/** * A chat that RUNS A WORKFLOW (crew#1157): `POST /chats {workflow: "analyze"}`. The workflow is * data — a wicked-core built-in preset (`src/presets/analyze.json`) — and every turn of the chat is * its one step, re-stated as the ask path's `answer-N` step (`ask-paths.ts`), so the chat thread, * the turn gate, follow-ups and the citation check all work exactly as for a plain chat. * * What makes it safe to run in a chat is checked HERE, not trusted from the name: only a BUILT-IN * preset named in {@link CHAT_WORKFLOWS} is accepted, and only while it is one agent step on the * catalog's `understand` entry (neutral, `executes_code: false`, no pin: the engine gives it the * read-only write posture on a bound or unbound run), with no Tool executor, no raised * `executes_code`, and no deliverables. A chat that runs one launches without `deliver`, asks for no * reviewer, seats one helper, and its statement proposes no `PLAN+` work. */ import type { Preset, PresetStep } from 'wicked-crew-api-types'; /** The workflows a chat may run. Each is a built-in, read-only preset of the engine. */ export declare const CHAT_WORKFLOWS: ReadonlySet; /** The one step a chat workflow contributes to each answer step. */ export interface ChatWorkflow { name: string; instructions: string; skillRef?: string; } export type ChatWorkflowResolution = { ok: true; workflow: ChatWorkflow; } | { ok: false; status: 400 | 409; error: string; }; /** * Why `step` could write (or run something), or `null` when it is a read-only `understand` agent step. * The ONE predicate: the chat open applies it to the workflow's step, and an analysis run applies it * to every step a plan edit would add (`routes.ts` `analysisPlanRefusal`). */ export declare function writeCapableStep(step: { catalog: string; id?: string | undefined; [k: string]: unknown; }): string | null; /** Why `step` cannot run as a read-only chat turn, or `null` when it can. */ export declare function readOnlyStepRefusal(step: PresetStep): string | null; /** * Resolve `name` against the engine's presets: a 400 for a name chats do not run, a 409 when this * engine does not carry it (an older core-ts) or carries a shape that could write. */ export declare function resolveChatWorkflow(name: string, presets: readonly Preset[]): ChatWorkflowResolution; /** The chat workflows this engine carries (served as `GET /health.capabilities.chatWorkflows`). */ export declare function servedChatWorkflows(presets: readonly Preset[]): string[]; /** * One turn of a chat: the ask path's answer step ({@link answerStep}: `understand`, the turn gate, * the turn budget), carrying the workflow's skill and its instructions ahead of the turn's own * (the scope statement, the preface, the operator's words). */ export declare function chatTurnStep(stepId: string, text: string, workflow?: ChatWorkflow): { catalog: string; id: string; [k: string]: unknown; }; //# sourceMappingURL=chat-workflow.d.ts.map