@@ agent/node/scope.ts
+export class ScopeGuard {
+ allow(channelId: string): boolean {
+ return this.ids.has(channelId);
+ }
+ require(channelId: string, action: string): void {
+ if (!this.allow(channelId)) {
+ throw new ScopeError(`blocked ${action} on ${channelId}`);
+ }
+ }
+}