/** * The generation engine's shared plumbing: the model-call helpers the remaining * actors use (the automation planner, the AI reviewer) and the * {@link GenerationDependencies} every generation module speaks. * * There is no create/edit loop here, and no longer one anywhere in this package. * The ORDER of a build is the screen assembler's own loop * (the umbrella's `screen-agent.ts`) and, when it escalates, the server lane in * ./lanes.ts. What is ENFORCED lives in ./validation and ../checking. */ import { type ShapeType, type ToolSemantics } from "@vendoai/core"; import { type AppDocument } from "../../contract/index.js"; import type { LanguageModel, SystemModelMessage } from "ai"; import type { FloorDependencies } from "../checking/deps.js"; /** The floor owns the tool slice now (`../checking/deps.ts`) so it can outlive * this pipeline; re-exported here because every generation module already * imports it from this file. */ export type { HostToolInfo } from "../checking/deps.js"; /** * Everything a generation needs — the floor's four fields plus the pipeline's * own. It EXTENDS {@link FloorDependencies} rather than restating it, so the * assignability the conductor's checking layer relies on is declared instead of * left to structural luck. */ export interface GenerationDependencies extends FloorDependencies { /** Narrowed to REQUIRED: the floor can run its deterministic half without a * model, but a generation cannot happen without one. */ model: LanguageModel; /** Each tool's declared response schema in structural form * (`shapeFromJsonSchema`), keyed by tool: the shape cards the prompts render * and the automation planner reads. It sits here rather than on the floor * because no check reads it — the screen type check works off the tools' * own `outputSchema`. */ toolShapes?: Readonly>; /** Per-tool field semantics from `.vendo/semantics.json`: annotated shape * cards and Kit format defaults. Keyed by tool name. */ semantics?: Readonly>; } export type GeneratedAppDocument = Omit; /** The generation prompt's stable prefix (role, dialect, component menu, host * tools, design rules), marked cacheable. It is identical across back-to-back * generations for a deployment, so Anthropic re-reads it from cache instead of * re-billing it; the per-request `prompt` is the variable tail, deliberately * left OUT of the cached prefix. * * It travels as `system` rather than as a system-role message inside * `messages`: ai@7 rejects the latter (AI_InvalidPromptError), and both majors * carry this message form — breakpoint and all — to the provider unchanged. */ export declare const cacheableGenerationSystem: (system: string) => SystemModelMessage; /** * One model call, text accumulated off the stream — the answer lands whole or * not at all. Every generation actor speaks through here (the brain, a fill * worker, the island lane, the automation planner), so the failure handling * exists exactly once: streamText does NOT throw provider errors (its default * onError logs the raw error and the text stream simply ends), so a missing * key or quota exhaustion is captured here or it reaches the caller as an * unclassifiable empty answer. * * The "model generation failed: " prefix is load-bearing, not decoration: * runtime.buildFailureReason strips exactly it before matching the * no-usable-credential lines, so a 402 classifies as non-retryable quota and * the actionable `npm install @ai-sdk/...` line reaches the person. */ export declare const askModel: (model: LanguageModel, system: string, prompt: string) => Promise<{ text?: string; issues: string[]; }>; export declare const distinctIssues: (current: string[], next: string[]) => string[]; //# sourceMappingURL=engine.d.ts.map