import { PlannerPlan } from "../contracts/planner/planner-plan.type.mjs"; import { StandardSchemaV1 } from "@standard-schema/spec"; //#region ../ai/src/planner/plan-schema.d.ts /** * Build the Standard Schema the planning agent emits — an ordered * `{ steps: [...], summary? }` plan whose every step references one of * `capabilityNames` via the `capability` field. * * Mirrors the router's hand-built schema approach * (`supervisor/router-factory.ts`): the JSON Schema extension carries * the capability names as an `enum` so capable providers enforce the * choice natively, while `validate()` still accepts the shape softly so * providers without native structured output can pass a parsed object * through. Validation is intentionally lenient on `capability` — an * unknown name is surfaced later by the planner as a typed * `PlannerPlanInvalidError`, with the full forensic context, rather * than as an opaque schema issue here. * * `maxSteps` cannot be expressed on the wire (strict mode rejects * `maxItems`), so `validate()` enforces a hard parse-time ceiling * derived from it — see {@link parsedStepCeiling}. */ type PlanSchema = StandardSchemaV1 & { "~standard": { /** * JSON Schema extension read by the native structured-output path. * Part of the declared type so callers don't have to re-assert it. */ jsonSchema: { input: () => Record; }; }; }; declare function planSchema(capabilityNames: string[], maxSteps?: number): PlanSchema; //#endregion export { planSchema }; //# sourceMappingURL=plan-schema.d.mts.map