/** * tools/profile, the agent tool that records what the owner says about themselves. * * ## Why the tool cannot be told its own authority * * Every write here goes through the owner-profile write gate, and that gate's * first layer asks which surface the instruction came from. If the model * supplied that answer, a sentence inside a forwarded email could claim to be * the owner and the gate would be decoration. * * So the authority is BOUND to the tool, not passed to it. The composition root * resolves it once per conversational turn from the turn's channel and the * owner's settings (personal-capture/authority.ts) and calls `bindCapture` to * produce the instance that run sees. The model chooses WHAT to record and * never whether it is allowed to. * * An unbound instance, a local surface, a turn nobody resolved a channel for, * keeps the default the composition root gave it, which is the owner's own * authority for a surface the owner is sitting at. * * ## Refusals are spoken, never swallowed * * Every failure path returns `success: true` with a `stored: false` payload and * a plain sentence naming what stopped it. That is deliberate: a tool error * tends to be summarised away as "something went wrong", and the standing rule * for this subsystem is that nothing unresolved drops silently. The agent is * told, in the same structure as a success, exactly what to repeat to the owner. */ import type { Tool } from '../../types/tools.js'; import type { CaptureAuthorityDecision } from '../../personal-capture/authority.js'; import type { PersonalCaptureHolder } from '../../personal-capture/port.js'; /** A profile tool instance that can be re-bound to one turn's authority. */ export interface ProfileTool extends Tool { /** A copy of this tool that writes with `decision`'s authority. Pure; the original is unchanged. */ bindCapture(decision: CaptureAuthorityDecision): ProfileTool; } export interface ProfileToolDeps { /** Where the profile store and occasions service arrive, once composed. */ readonly holder: Pick; /** Live read of `profile.conversationalCapture`. Absent ⇒ on. */ readonly captureEnabled?: (() => boolean) | undefined; /** The authority an unbound instance writes with. */ readonly defaultAuthority: CaptureAuthorityDecision; } export declare function createProfileTool(deps: ProfileToolDeps): ProfileTool; export { PROFILE_TOOL_SCHEMA } from './schema.js'; export type { ProfileToolInput } from './schema.js'; //# sourceMappingURL=index.d.ts.map