/** * Request scope primitives for protocol tools. * * `scopeType`/`scopeId` describe the user's focused scope, not the full set of * networks a caller may read or write. Helper functions derive concrete network * id sets from the focused scope plus the caller's memberships. */ export type ToolScopeType = 'network' | 'intent'; export interface ToolScopeEnvelope { scopeType?: ToolScopeType; scopeId?: string; } export interface ScopeMembership { networkId: string; isPersonal?: boolean | null; } export interface DeriveNetworkScopeInput extends ToolScopeEnvelope { memberships: ScopeMembership[]; } export declare function scopeFromNetworkId(networkId: string | null | undefined): ToolScopeEnvelope; export declare function scopeFromIntentId(intentId: string | null | undefined): ToolScopeEnvelope; export declare function hasNetworkScope(scope: ToolScopeEnvelope): scope is { scopeType: 'network'; scopeId: string; }; export declare function hasIntentScope(scope: ToolScopeEnvelope): scope is { scopeType: 'intent'; scopeId: string; }; /** * Returns the focused network id from the canonical scope envelope. * * This intentionally does not inspect legacy `networkId` fields; callers that * still need a transition fallback should pass `scopeFromNetworkId(networkId)` * at the boundary so tool logic remains envelope-driven. */ export declare function focusedNetworkId(scope: ToolScopeEnvelope): string | undefined; export declare function focusedIntentId(scope: ToolScopeEnvelope): string | undefined; /** Human-readable label for a focused scope, used in scope-restriction notes. */ export declare function focusedNetworkLabel(scope: ToolScopeEnvelope & { indexName?: string; }): string; export declare function deriveAllowedNetworkIds(input: DeriveNetworkScopeInput): string[]; export declare function deriveDiscoveryNetworkIds(input: DeriveNetworkScopeInput): string[];