import type { FabricMessageSender, FabricScope, FabricScopeAction, FabricScopeGrant } from "./protocol.js"; export type { FabricMessageSender, FabricScope, FabricScopeAction, FabricScopeGrant } from "./protocol.js"; export declare const FABRIC_SCOPE_ENV = "PI_FABRIC_SCOPE"; export declare const FABRIC_SCOPE_FILE_ENV = "PI_FABRIC_SCOPE_FILE"; export declare const MAX_FABRIC_SCOPE_GRANTS = 64; export declare const MAX_FABRIC_SCOPE_RESOURCE_CHARS = 512; /** * Validate a scope (fail closed) and return its canonical frozen form. `digest` * is computed when omitted and must match when present. */ export declare const normalizeScope: (input: unknown) => FabricScope; /** True when a grant covers `resource` (a concrete resource or a pattern) for `action`. */ export declare const scopeAllows: (scope: FabricScope, resource: string, action: FabricScopeAction) => boolean; /** * Narrow `parent`: every requested grant must be covered by one parent grant * (resource subset and action subset). The principal is always the parent's. */ export declare const deriveScope: (parent: FabricScope, grants: readonly FabricScopeGrant[]) => FabricScope; /** True when `outer` has the same principal and covers every grant of `inner`. */ export declare const scopeCovers: (outer: FabricScope, inner: FabricScope) => boolean; /** @internal The host stamp for a message sent with `scope` (absent: unscoped host authority). */ export declare const senderStamp: (scope: FabricScope | undefined) => FabricMessageSender; /** @internal This process's stamp; failed issuance yields a stamp no actor trusts. */ export declare const processSender: () => FabricMessageSender; /** * @internal Whether an actor bound to `actorScope` may treat a message from * `sender` as coming from its own authority. Unscoped senders are trusted; a * scoped sender must cover the actor's scope; an unstamped (older build) * message is trusted only by an unscoped actor. Malformed stamps never are. */ export declare const senderTrusted: (actorScope: FabricScope | undefined, sender: unknown) => boolean; /** * Issue the root session's scope in-process. Call once, before Pi emits * session_start; later or repeated calls throw. Invalid input throws and also * leaves the extension refusing provider calls (fail closed). */ export declare const issueRootScope: (scope: Omit & { version?: 1; digest?: string; principal: { id: string; issuer?: "host"; }; }) => FabricScope; /** * @internal Extension entry: resolve the environment issuance once and seal * further issueRootScope calls. Any failure is retained so the registry refuses * provider calls instead of running unscoped. */ export declare const sealRootScope: (env: { json?: string | undefined; file?: string | undefined; }) => void; /** @internal The current session scope; throws when issuance failed. */ export declare const sessionScope: () => FabricScope | undefined; /** * @internal Scope for a child launch. Without a request the child inherits the * session scope unchanged; a request `{ grants }` narrows it and is refused in * an unscoped session (there is no principal to narrow from). */ export declare const childScope: (request: unknown) => FabricScope | undefined; /** * @internal Scope for a launch whose parent scope was forwarded by the * requesting host (durable spawns, actor turns). The forwarded scope must be * canonical (digest checked) and, in a scoped process, covered by its scope; * a host without its own scope relies on the single-user boundary. */ export declare const launchScope: (request: unknown, inherited: unknown) => FabricScope | undefined; //# sourceMappingURL=scope.d.ts.map