import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { ToolCallRef } from "./action-guard.js"; import type { SlopSymptom, Verdict } from "./guard.js"; import type { ShapeResult } from "./shape.js"; export declare const disclosure = "With TypeSafe judgments enabled, pi-warden sends to api.typesafe.ai: your latest request and up to eight redacted prior user/assistant text messages for task context, plus a redacted, truncated summary of each guarded bash, write, or edit call before it runs, with the agent's own words from the message that makes the call (its stated plan); for a write or edit in a project with a rules file (pi-warden.md, the configured files, or README/CLAUDE/AGENTS as fallback), a larger redacted sample of the written content with the current file around each edit and the rule text; the last few tool calls and output tails when the agent keeps failing; the agent's final message when it reports completion without running checks; redacted tool-output samples for security and context saving (retention and output format); a redacted sample of an async subagent report that names a failure, a stop, or a question, with your latest request, when warden decides whether that report should wake the agent; and, on the first guarded call after your reply, the redacted summaries of the calls allowed in the previous turn, so Jev can say whether your reply regrets one of them. Compression and duplicate notes store an exact, owner-only copy in a temporary file on this machine; the hold feedback log stores tool names, pattern ids, scores, and outcomes (never commands) in an owner-only file under Pi's agent directory; an owner-only SQLite database under Pi's agent directory stores redacted hold context (plan, summary, reason) for learning and retention (configurable, default 365 days). Requests may incur charges. Secret redaction is best-effort. Results are model judgments, not proof or authorization; offline pattern checks stay active either way."; /** Which guard spent the user's attention. The status line reports one count per guard. */ export type SteerGuard = "action" | "rules" | "security" | "stuck" | "done" | "prose" | "runaway" | "subagent"; /** * One steer message can carry notes from more than one guard, so the per-guard numbers may add up to more than the * message count; the line says so instead of hiding it. Worst offender first: that is the number worth acting on. */ export declare function formatSteers(stats: { steers: number; steersSkipped: number; steerGuards: Partial>; }): string; /** * Tool calls of the assistant message being preflighted. Pi runs `tool_call` hooks for sibling calls one after another, * so judging them one request at a time costs one round trip per call; judging them together costs one round trip. */ export declare function siblingToolCalls(ctx: ExtensionContext): ToolCallRef[]; /** * The agent's own words before the call: the text of the assistant message that carries it, or, when that message is * tool calls only, the latest assistant text since the user's prompt. Sent as `plan`; it explains the step and cannot approve it. */ export declare function assistantPlan(ctx: ExtensionContext): string | undefined; export declare function confirmMessage(verdict: Verdict): string; /** Names each symptom and its fix; repeats in the session turn the note into a standing rule. */ export declare function slopSteer(where: string, symptoms: readonly SlopSymptom[], counts: Record): string; /** * `completeConfig` in shape.ts fills sections an older config module lacks, but shape.ts can be the stale module too: the * 0.8 version knew nothing of `rules`, so a 0.9 extension read `config.rules.enabled` on undefined and every tool call * failed until Pi was restarted. The sections this build reads are therefore checked here as well, in the module that reads them. */ export declare function guardCurrentSections(result: ShapeResult): ShapeResult; /** Native Pi registration; importing the root library does not load this module. */ export default function wardenExtension(pi: ExtensionAPI): void;