import { type TSchema } from "typebox"; import type { AgentTool } from "../../internal/harness.js"; import type { SkillManifest } from "../types.js"; import type { ActiveSkillScope } from "./active-skill-scope.js"; /** Reserved name of the injected structured-output tool (CC 2.1.187 `StructuredOutput`; batch-A rename — old * "submit_output" is canonicalized for pre-rename durable state). */ export declare const OUTPUT_TOOL_NAME = "StructuredOutput"; /** Reserved name of the injected blocked-report signal tool (design/108 PascalCase: `report_blocked`→`ReportBlocked`). */ export declare const REPORT_BLOCKED_TOOL_NAME = "ReportBlocked"; /** Default `submit_output` retries (council OS3); total attempts = retries + 1. Overridable via `TaskSpec.outputRetries`. */ export declare const OUTPUT_DEFAULT_RETRIES = 2; /** * Resolve the per-task cap on *consecutive failed* `submit_output` attempts. The task fails with * `output.invalid` when the failure streak EXCEEDS this value, so total attempts = cap + 1 * (default 2 → 3 attempts; `outputRetries: 0` → cap 0 → fail on the first invalid submit). Illegal * values (NaN/Infinity/negative) fall back to the default; fractional values floor down. */ export declare function resolveOutputRetries(outputRetries?: number): number; export interface BlockedRef { reason?: string; } /** Captures the validated object a `submit_output` call submitted (structured output, 1.41). `set` is * flipped so we can tell "model submitted {}" from "never called". Mirrors `BlockedRef`. */ export interface OutputRef { value?: unknown; set?: boolean; } /** * @param strictSchema CC 2.1.205 parity (strict-output-schema.ts): the STRICT derivation of `schema` when * it converted (`additionalProperties:false` stamped, subset-validated). It becomes the tool's * `parameters` — both the model-visible wire schema (CC sends it as `strictInputJSONSchema`) and the * validation schema (the strict form only TIGHTENS the caller's schema, so anything it accepts is valid * under the original — CC's Ajv-against-original validation agrees on every accepted submission). * Absent (fallback / legacy callers) → the caller's schema is served as-is, the pre-205 behavior. */ export declare function makeOutputTool(ref: OutputRef, schema: TSchema, strictSchema?: TSchema): AgentTool; export declare function makeReportBlockedTool(ref: BlockedRef): AgentTool; /** Reserved name of the injected skill-loading tool (present only when `spec.skills` is non-empty). */ export declare const SKILL_TOOL_NAME = "Skill"; /** Per-skill body cap for the `skill` tool result (~5k tokens, CC-scale). */ export declare const SKILL_BODY_MAX_CHARS = 20000; interface SkillLike { name: string; description: string; content: string; /** Optional Gate-3 runtime capability manifest (design/77 §3) — carried through so a successful * `skill` load can push its scope frame. Skills without one stay unscoped (backward-compatible). */ manifest?: SkillManifest; } /** Dedupe by name (first occurrence wins) and sort by name — one deterministic list shared by the * disclosure block and the tool, so what the prompt promises is exactly what the tool serves. */ export declare function normalizeSkills(skills: SkillLike[] | undefined): SkillLike[]; /** Render the stable `` disclosure block (metadata only — bodies stay behind the tool). */ export declare function buildSkillsBlock(skills: SkillLike[]): string | undefined; /** * The injected `skill` tool: returns a skill's full body as a tool result. * * When a {@link ActiveSkillScope} is supplied (design/77 §3 Gate-3) and the loaded skill carries a * `manifest`, a successful load PUSHES a scope frame onto the per-task LIFO stack, so the rest of the * invocation is deny-narrowed to the manifest's tools/paths. Nested loads (a skill whose body loads * another skill) STACK and compose MONOTONICALLY as the INTERSECTION of every active frame's * `allowTools` — a child can only narrow further, never re-grant. Frames are popped at task end (and * the test/lifecycle may pop explicitly via `scope.pop()` to model a skill frame closing). Skills with * NO manifest push nothing (unscoped, backward-compatible). * * v1 lifetime is heuristic (design/77 §3 residual): the model controls its own turns, so push-on-load * is the trigger and the worst case (a frame never popped) is simply continued narrowing — never a * widening, so it stays safe-by-construction. */ export declare function makeSkillTool(skills: SkillLike[], scope?: ActiveSkillScope): AgentTool; export {}; //# sourceMappingURL=synthetic-tools.d.ts.map