/** * No-tool structured model runner for Workflow v3 parameter distillation. * * Unlike an ordinary v3 goal worker, this subprocess is not an agent runtime: * it receives the minimized field array on stdin, has every model tool disabled, * loads no project/user customizations, and returns one schema-constrained JSON * value on stdout. The provider/model is trusted with the explicitly authorized * field text; its output has no structural, execution, naming, or publication * authority and is recompiled by the host. */ import type { BotSnapshot } from './contract.js'; import { type V3DistillationSuggestionV1 } from './distillation-schema.js'; import type { V3DistillationModelFieldV1 } from './distillation-compiler.js'; export type V3DistillationRunnerReasonCode = 'UNSUPPORTED_PLATFORM' | 'UNSUPPORTED_CLI' | 'INVALID_MODEL_INPUT' | 'SCRATCH_SETUP_FAILED' | 'MANAGED_POLICY_UNSUPPORTED' | 'MODEL_FAILED' | 'MODEL_OUTPUT_INVALID' | 'SCRATCH_CLEANUP_FAILED'; /** Safe to render: neither the message nor the code reflects model/source data. */ export declare class V3DistillationRunnerError extends Error { readonly code: V3DistillationRunnerReasonCode; constructor(code: V3DistillationRunnerReasonCode); } export interface RunV3DistillationModelInput { fields: readonly V3DistillationModelFieldV1[]; botSnapshot: BotSnapshot; /** Explicit per-bot provider transport/auth environment. Only a narrow key * allowlist is forwarded; Botmux/Lark/session variables are never inherited. */ providerEnv?: Readonly>; timeoutMs?: number; } export interface V3DistillationStructuredInvocation { bin: string; args: string[]; cwd: string; env: NodeJS.ProcessEnv; stdin: string; timeoutMs: number; maxOutputBytes: number; } export interface V3DistillationRunnerDeps { invokeStructuredModel?: (input: V3DistillationStructuredInvocation) => Promise; /** Test-only executable seam. Production intentionally resolves the stock * `claude` binary and rejects bot-level path overrides/custom launchers. */ adapterBin?: string; scratchParent?: string; platform?: NodeJS.Platform; removeScratch?: (path: string) => Promise; /** Test seam for Linux endpoint-managed Claude policy discovery. */ managedPolicyRoot?: string; /** Test-only frozen Linux `/etc` view. */ etcSnapshot?: readonly string[]; /** Test-only bwrap seam. Production always invokes the stock `bwrap`. */ sandboxBin?: string; } /** Best-effort startup recovery for scratch left by a daemon/process crash. */ export declare function sweepAbandonedV3DistillationScratch(input?: { scratchParent?: string; nowMs?: number; maxAgeMs?: number; /** Test-only platform seam for host-independent cleanup cases. */ platform?: NodeJS.Platform; }): Promise; interface NormalizedFieldInput { schemaVersion: 1; fields: V3DistillationModelFieldV1[]; } export declare function runV3DistillationModel(input: RunV3DistillationModelInput, deps?: V3DistillationRunnerDeps): Promise; export declare function buildV3DistillationSystemPrompt(): string; export declare function buildV3DistillationModelPrompt(modelInput: NormalizedFieldInput): string; export {}; //# sourceMappingURL=distillation-runner.d.ts.map