/** * wiki_write — the agent records a conclusion while it still holds the context. * * The wiki design named this tool ("Model-invoked `wiki_write` exists for the * agent to record something deliberately") but it was never built, so the only * route into the graph was a post-hoc extraction that itself was never wired. * The result was a graph with a full structural skeleton and zero findings. * * WHY THE AGENT AND NOT ONLY THE HARVEST. The harvest reads a transcript * afterwards with a cheap model and infers what was learned. The session that * did the work already knows, at no marginal cost and with nothing leaving the * machine. The design's objection to agent writes was that "anything opt-in * does not happen" — true of a suggestion, but this project answered exactly * that problem elsewhere by ENFORCING tool routing rather than advising it. * * The two paths are complements: this captures what the working session * concluded; the harvest, when enabled, catches what it forgot to record. */ export interface WikiWriteOptions { /** The claim itself. What was concluded, in a sentence someone can act on. */ claim: string; /** * Files (or `file#symbol`) the claim is about. Required, and not decorative: * an unanchored finding can never be invalidated when the code changes, so it * would be served as permanently current. Anchors that do not resolve are * dropped and the finding is refused rather than stored unfalsifiable. */ anchors: string[]; /** Concrete observation, command result, test, or user decision supporting the claim. */ evidence: string; /** Human-readable condition under which a later model should use the claim. */ applicability: string; /** finding | decision | failure | command | map. */ type?: string; /** * Optional regex matched against a command about to run. Anchors answer * "which file"; a trigger answers "when". Without one, a claim about running * something can only surface if someone opens the file it is anchored to, * which is not when the advice is needed. */ trigger?: string; /** 0..1. Defaults to 0.9 — deliberate, but still a model's assertion. */ confidence?: number; /** Calibrated status; the numeric value is derived from this when omitted. */ confidenceLabel: 'verified' | 'probable' | 'speculative'; /** Project-only by default; broader scopes opt into cross-project delivery. */ scope?: 'project' | 'organization' | 'global'; /** Conditions that should cause a later reader to distrust or re-check it. */ invalidators?: string[]; /** * Recorded for provenance so a claim can be traced to the session -- * stored on the finding, nothing more. It does NOT produce an `answers` * edge: this value is a model-supplied tool argument nothing verifies, so * `writeHarvested` never treats it as authoritative for attribution * (see its `authoritativeSessionId` parameter, which this call omits). * `plugin/hooks/harvest-worker.mjs` is the caller whose session id comes * from a trusted channel (Claude Code's own hook payload) and can supply * that; a tool argument cannot. */ sessionId?: string; /** Overrides the project the finding belongs to. Defaults to the anchor's repo. */ projectRoot?: string; } export interface WikiWriteResult { success: boolean; written: number; keys: string[]; /** Anchors that named nothing on disk, so could not carry a claim. */ unresolvedAnchors: string[]; project?: string; error?: string; } export declare function wikiWrite(options: WikiWriteOptions): Promise; export declare const WIKI_WRITE_TOOL_DEFINITION: { name: string; description: string; annotations: { title: string; readOnlyHint: boolean; destructiveHint: boolean; idempotentHint: boolean; openWorldHint: boolean; }; inputSchema: { type: string; properties: { claim: { type: string; description: string; }; anchors: { type: string; items: { type: string; }; description: string; }; evidence: { type: string; description: string; }; applicability: { type: string; description: string; }; type: { type: string; enum: string[]; description: string; }; confidence: { type: string; description: string; }; confidenceLabel: { type: string; enum: string[]; description: string; }; scope: { type: string; enum: string[]; description: string; }; invalidators: { type: string; items: { type: string; }; description: string; }; sessionId: { type: string; description: string; }; trigger: { type: string; description: string; }; projectRoot: { type: string; description: string; }; }; required: string[]; }; }; //# sourceMappingURL=wiki-write.d.ts.map