import { z } from "zod"; /** * The ExtractionHarness seam (install-dx v1, brainstorm 2026-07-18): Vendo * owns the instructions, the deterministic validation, and the artifact * contract; a world-class coding agent does the reading. Everything above * this seam is vendor-neutral — swapping the harness (Claude Agent SDK today, * anything tomorrow) is a config change, not an architecture change. */ /** One drafted polish entry for an extracted tool. The AI pass proposes; * deterministic guards in extraction.ts decide what applies. */ export declare const draftToolSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; risk: z.ZodOptional>; confirmEach: z.ZodOptional; /** false = wake a statically-unclassifiable tool (needs reasoning). */ disabled: z.ZodOptional; /** Who the handler's own auth admits; non-end-user grades exclude the tool * by default (applyDraft). */ audience: z.ZodOptional>; reasoning: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description: string; risk?: "read" | "write" | "destructive" | undefined; confirmEach?: boolean | undefined; disabled?: boolean | undefined; audience?: "internal" | "end-user" | "operator" | undefined; reasoning?: string | undefined; }, { name: string; description: string; risk?: "read" | "write" | "destructive" | undefined; confirmEach?: boolean | undefined; disabled?: boolean | undefined; audience?: "internal" | "end-user" | "operator" | undefined; reasoning?: string | undefined; }>; export type DraftTool = z.infer; export declare const extractionDraftSchema: z.ZodObject<{ /** One-paragraph product brief drafted from the codebase. */ brief: z.ZodString; tools: z.ZodArray>; confirmEach: z.ZodOptional; /** false = wake a statically-unclassifiable tool (needs reasoning). */ disabled: z.ZodOptional; /** Who the handler's own auth admits; non-end-user grades exclude the tool * by default (applyDraft). */ audience: z.ZodOptional>; reasoning: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description: string; risk?: "read" | "write" | "destructive" | undefined; confirmEach?: boolean | undefined; disabled?: boolean | undefined; audience?: "internal" | "end-user" | "operator" | undefined; reasoning?: string | undefined; }, { name: string; description: string; risk?: "read" | "write" | "destructive" | undefined; confirmEach?: boolean | undefined; disabled?: boolean | undefined; audience?: "internal" | "end-user" | "operator" | undefined; reasoning?: string | undefined; }>, "many">; /** API surfaces the static extractor missed — surfaced to the dev, not * written anywhere (adding tools is future work on the sync side). */ missedSurfaces: z.ZodOptional>; }, "strip", z.ZodTypeAny, { brief: string; tools: { name: string; description: string; risk?: "read" | "write" | "destructive" | undefined; confirmEach?: boolean | undefined; disabled?: boolean | undefined; audience?: "internal" | "end-user" | "operator" | undefined; reasoning?: string | undefined; }[]; missedSurfaces?: string[] | undefined; }, { brief: string; tools: { name: string; description: string; risk?: "read" | "write" | "destructive" | undefined; confirmEach?: boolean | undefined; disabled?: boolean | undefined; audience?: "internal" | "end-user" | "operator" | undefined; reasoning?: string | undefined; }[]; missedSurfaces?: string[] | undefined; }>; export type ExtractionDraft = z.infer; export interface ExtractionRunInput { root: string; /** The complete staged instructions, composed by extraction.ts. */ instructions: string; env: Record; /** Live narration line (surface discoveries, files being read). */ onProgress?: (line: string) => void; } export interface ExtractionHarness { /** Stable identifier ("claude-agent-sdk"). */ id: string; /** A short human label of the credential this harness would use * ("your Claude Code login", "your ANTHROPIC_API_KEY"), or null when the * harness cannot run on this machine. */ availability(input: { root: string; env: Record; }): Promise; /** Run the instructions and return the agent's final text (extraction.ts * parses and validates; the harness never interprets the draft). */ run(input: ExtractionRunInput): Promise; } /** The extraction model pin every harness honors (models spec 2026-07-22): * VENDO_MODEL_EXTRACT. Blank values count as unset. */ export declare function extractionModelPin(env: Record): string | undefined; /** Extract a stage artifact from an agent's final text: prefer a fenced * block, else try each balanced object span until one validates against the * stage's schema. Throws on unparseable output. */ export declare function parseArtifact(text: string, schema: Schema): z.infer; export declare function parseDraft(text: string): ExtractionDraft;