/** * The facts accessor a worker-registered tool receives on its invocation * context as `invocation.facts` (see docs/proposals/tool-context-facts-accessor.md). * * Three scopes, one session binding each: * session (default) this session's scope key dies with the session * root the root session of this tree dies with the root * shared the cluster-wide key until deleted * * A tool can never name an arbitrary session. Reads are EXACT (by scope key), * never a LIKE pattern: `bindings/my_service` must not also match * `bindings/myXservice`. * * Runtime context only: not part of any tool schema, never sent to the model. * Keys under `tools/` (TOOL_PRIVATE_FACT_PREFIX) are reachable ONLY here — the * agent-facing fact tools refuse them for every agent identity. */ import { type FactStore } from "./facts-store.js"; export type ToolFactsScope = "session" | "root" | "shared"; export interface ToolFactsScopeOptions { scope?: ToolFactsScope; } export interface ToolFactsAccessor { /** The calling PilotSwarm session. */ readonly durableSessionId: string; /** The root of the calling session's spawn tree (itself for a top-level session). */ readonly rootSessionId: string; /** Exact read of `key` in the chosen scope. `null` when absent. */ read(key: string, opts?: ToolFactsScopeOptions): Promise; /** Upsert `key` in the chosen scope. */ store(key: string, value: unknown, opts?: ToolFactsScopeOptions): Promise; /** Remove the exact `key` in the chosen scope. True when a row was removed. */ delete(key: string, opts?: ToolFactsScopeOptions): Promise; } /** Keys under this prefix belong to tools; no agent can read, write, delete or search them. */ export { TOOL_PRIVATE_FACT_PREFIX } from "./facts-tools.js"; export declare function createToolFactsAccessor(opts: { factStore: FactStore; durableSessionId: string; rootSessionId?: string | null; /** Recorded as the writing agent on stored facts (provenance only). */ agentId?: string | null; }): ToolFactsAccessor; //# sourceMappingURL=tool-facts-accessor.d.ts.map