import type { Tool } from '../../types/tools.js'; import type { CrossSessionTaskRegistry } from '../../sessions/orchestration/index.js'; /** Options for {@link createTaskTool}. */ export interface TaskToolOptions { /** * Resolves the REAL runtime session identity, called fresh on every tool * invocation. * * A getter, not a value: `runtime.sessionId` is reassigned in place when a * crash-recovery snapshot is accepted, so an id captured at tool-registration * time would keep writing refs under the boot session the user just left * behind. Reading it per call is the only way the tool follows the session the * user is actually in. * * When absent, the tool falls back to the legacy namespace and every ref it * writes is unowned, see {@link LEGACY_TASK_NAMESPACE}. Hosts that care * about owner-existence reaping must pass this. */ readonly resolveSessionId?: (() => string) | undefined; } /** * The `task` tool. * * OWNERSHIP IS NOT A TOOL INPUT. The owning `sessionId` on every ref this tool * writes comes from `options.resolveSessionId`, the host's real runtime session * identity, and the model's `input.sessionId` is IGNORED for all of them. It * used to be the authority, defaulting to the literal `'local'`, which meant an * ownership key the model could set to anything (or, overwhelmingly, forget to * set at all). A field the caller can spoof cannot be the key a store reaps by: * owner-existence housekeeping over a namespace the model chooses is not * housekeeping, and one shared `'local'` bucket is not per-session ownership. * * `input.sessionId` still means something in exactly one place: READ modes * (`list`, `show`), where it selects WHICH session's refs to display. Reading * another session's graph is the point of a cross-session registry and asserts * no ownership, so it stays available and simply defaults to the caller's own * session. Naming another session as a dependency target * (`dependsOnSessionId`) or a handoff destination (`toSessionId`) likewise * still works, those are references to a counterparty, not a claim about who * owns the record being written. */ export declare function createTaskTool(registry: CrossSessionTaskRegistry, options?: TaskToolOptions): Tool; //# sourceMappingURL=index.d.ts.map