import { z } from 'zod'; /** * The RUNS family of `/api/v1` — a task's record, its lifecycle mutations, and the artifacts * (queued prompt stack, commits, git actions) that hang off one run. * * The record itself is persisted by `src/runs/store.ts`, so these schemas describe a shape that * already has a zod definition server-side; they are the WIRE half of it, and the parity guard in * `src/server/contract-parity.runs.test.ts` is what keeps the two from drifting. * * Two things about the mutation responses are deliberate and were measured, not assumed: * * - every "did it work" flag is a `z.literal(true)`, not a boolean. Each of those routes answers * 409 (or 404) on refusal, so `false` is not a value the 200 branch can carry — the * hand-written DTO's `boolean` invited a re-check the server never needs. `cancelled` is the * one real boolean: `POST /runs/:id/cancel` answers 200 either way. * - `POST /runs/:id/messages` answers a three-way UNION, not one object with three optional * keys. The client narrows on which key is present, and the DTO's flattened shape allowed * `{}` — a payload the route cannot produce. */ export declare const runStatusSchema: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; export type RunStatus = z.infer; /** * Sub-state of `running` (spec 2026-07-18-subagent-monitoring-status, #490): the agent ended its * turn still working on its own downstream work (a sub-agent, a monitored command) and said so * with the `CEZ:MONITORING` marker — a non-attention state, not "needs you". */ export declare const runActivitySchema: z.ZodEnum<{ monitoring: "monitoring"; }>; export type RunActivity = z.infer; export declare const stepStatusSchema: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; export type StepStatus = z.infer; /** One step of a run's chain. */ export declare const stepStateSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; kind: z.ZodEnum<{ agent: "agent"; check: "check"; }>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; iterations: z.ZodNumber; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; usageInvocationsStarted: z.ZodOptional; usageInvocationsObserved: z.ZodOptional; usageTurnsStarted: z.ZodOptional; usageTurnsRecorded: z.ZodOptional; usageInvocationEpoch: z.ZodOptional; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; error: z.ZodOptional; sessionId: z.ZodOptional; backend: z.ZodOptional>; profileId: z.ZodOptional; costUsd: z.ZodOptional; }, z.core.$strip>; export type StepState = z.infer; /** Aggregate diff numbers of a run's worktree vs its base (#389). */ export declare const diffStatSchema: z.ZodObject<{ adds: z.ZodNumber; dels: z.ZodNumber; files: z.ZodNumber; repointed: z.ZodOptional; }, z.core.$strip>; export type DiffStat = z.infer; /** One prompt message stacked onto a run while it waits for a free agent slot (#472). */ export declare const queuedMessageSchema: z.ZodObject<{ id: z.ZodString; text: z.ZodString; images: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>; export type QueuedMessage = z.infer; /** One aggregated sample of a run's live process tree (`src/core/process-usage.ts`). */ export declare const processUsageSchema: z.ZodObject<{ cpuPct: z.ZodNumber; rssBytes: z.ZodNumber; procCount: z.ZodNumber; }, z.core.$strip>; export type ProcessUsage = z.infer; /** * The stored run record, as `runs.json` holds it (`src/runs/store.ts`). * * `archived` is required although the store schema defaults it: a default fills on PARSE, so the * key is always present in what the server hands out. Everything else optional here is optional * there — these are additive fields, and an absent one means "this run predates it". */ export declare const runRecordSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; titleSummary: z.ZodOptional; diffStat: z.ZodOptional; }, z.core.$strip>>; workflow: z.ZodString; task: z.ZodString; queuedMessages: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>>>; taskImages: z.ZodOptional>; model: z.ZodOptional; modelIdentity: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; systemPrompt: z.ZodOptional; generateFollowups: z.ZodOptional; autonomous: z.ZodOptional; automation: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; monitoringWakeAt: z.ZodOptional; monitoringWakeCapReached: z.ZodOptional; autoResumeAt: z.ZodOptional; autoResumeAttempts: z.ZodOptional; createdAt: z.ZodString; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueNumberSeeded: z.ZodOptional; titleOrigin: z.ZodOptional>; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; referencedPrCandidates: z.ZodOptional>; referencedIssueUrl: z.ZodOptional; referencedIssueCandidates: z.ZodOptional>; worktree: z.ZodOptional>; worktreePath: z.ZodOptional; branch: z.ZodOptional; baseBranch: z.ZodOptional; worktreeReclaimedAt: z.ZodOptional; groupId: z.ZodOptional; variant: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; archived: z.ZodBoolean; archivedAt: z.ZodOptional; seenAt: z.ZodOptional; currentStepId: z.ZodOptional; error: z.ZodOptional; steps: z.ZodArray; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; iterations: z.ZodNumber; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; usageInvocationsStarted: z.ZodOptional; usageInvocationsObserved: z.ZodOptional; usageTurnsStarted: z.ZodOptional; usageTurnsRecorded: z.ZodOptional; usageInvocationEpoch: z.ZodOptional; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; error: z.ZodOptional; sessionId: z.ZodOptional; backend: z.ZodOptional>; profileId: z.ZodOptional; costUsd: z.ZodOptional; }, z.core.$strip>>; workflowDef: z.ZodOptional; steps: z.ZodArray; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; source: z.ZodEnum<{ "built-in": "built-in"; file: "file"; }>; path: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type RunRecord = z.infer; /** * What `GET /runs` and `GET /runs/:id` answer: the stored record plus the live `usage` sample the * server attaches on the way out (`withUsage`). Absent for finished runs and wherever `ps` yields * nothing — never persisted, and never attached by the mutation routes. */ export declare const apiRunSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; titleSummary: z.ZodOptional; diffStat: z.ZodOptional; }, z.core.$strip>>; workflow: z.ZodString; task: z.ZodString; queuedMessages: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>>>; taskImages: z.ZodOptional>; model: z.ZodOptional; modelIdentity: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; systemPrompt: z.ZodOptional; generateFollowups: z.ZodOptional; autonomous: z.ZodOptional; automation: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; monitoringWakeAt: z.ZodOptional; monitoringWakeCapReached: z.ZodOptional; autoResumeAt: z.ZodOptional; autoResumeAttempts: z.ZodOptional; createdAt: z.ZodString; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueNumberSeeded: z.ZodOptional; titleOrigin: z.ZodOptional>; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; referencedPrCandidates: z.ZodOptional>; referencedIssueUrl: z.ZodOptional; referencedIssueCandidates: z.ZodOptional>; worktree: z.ZodOptional>; worktreePath: z.ZodOptional; branch: z.ZodOptional; baseBranch: z.ZodOptional; worktreeReclaimedAt: z.ZodOptional; groupId: z.ZodOptional; variant: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; archived: z.ZodBoolean; archivedAt: z.ZodOptional; seenAt: z.ZodOptional; currentStepId: z.ZodOptional; error: z.ZodOptional; steps: z.ZodArray; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; iterations: z.ZodNumber; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; usageInvocationsStarted: z.ZodOptional; usageInvocationsObserved: z.ZodOptional; usageTurnsStarted: z.ZodOptional; usageTurnsRecorded: z.ZodOptional; usageInvocationEpoch: z.ZodOptional; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; error: z.ZodOptional; sessionId: z.ZodOptional; backend: z.ZodOptional>; profileId: z.ZodOptional; costUsd: z.ZodOptional; }, z.core.$strip>>; workflowDef: z.ZodOptional; steps: z.ZodArray; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; source: z.ZodEnum<{ "built-in": "built-in"; file: "file"; }>; path: z.ZodOptional; }, z.core.$strip>>; usage: z.ZodOptional>; }, z.core.$strip>; export type ApiRun = z.infer; /** * One run in the WORKSPACE-level index (`GET /api/v1/workspace/runs-index`) — the ⌘K palette's * "find a task in any project" list, and the global Tasks page's rows. * * Deliberately a separate, slim shape rather than `ApiRun`. The index answers for every * registered project at once, and `runRecordSchema` carries `steps[]` and `workflowDef` — a fat * record whose cost is fine per project and absurd multiplied by the registry. These are exactly * the fields a palette row renders: `runTitle`'s three (`title`, `titleSummary`, `titleOrigin`), * `deriveAttention`'s `AttentionInput`, `isUnread`'s `ReadStateInput`, and the timestamps * `shortAge` reads. Adding a field here is cheap; adding the whole record is what this exists to * avoid — but note that widening either of those two `Pick`s means widening this too, or the * palette's cross-project rows silently answer differently from every other surface. * * `projectId` is the join key, NOT the project name: the registry is already on the client and is * authoritative for display names, and duplicating one here would let a renamed project show two * different labels in one palette. */ export declare const runIndexEntrySchema: z.ZodObject<{ projectId: z.ZodString; id: z.ZodString; title: z.ZodString; titleSummary: z.ZodOptional; titleOrigin: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; createdAt: z.ZodString; finishedAt: z.ZodOptional; seenAt: z.ZodOptional; archived: z.ZodBoolean; autoResumeAt: z.ZodOptional; workflow: z.ZodString; branch: z.ZodOptional; startedAt: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueUrl: z.ZodOptional; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; costUsd: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; usage: z.ZodOptional>; }, z.core.$strip>; export type RunIndexEntry = z.infer; /** * `GET /workspace/runs-index`. * * `truncated` is not decoration: the index caps each project's contribution, and a capped list * that says nothing reads as "your task is not here" when the honest answer is "not in the * newest N". Naming the projects that hit the cap is what lets a consumer say so. */ /** * Everything the SERVER already knew about the references its rows carry, per project — the * statuses that would otherwise cost a second round trip a beat after the table paints. * * Read from cache only: this never asks the forge, so a cold entry is simply absent and * `GET /github/ref-status` stays the route that actually goes and looks. That makes it free, and * being free is what lets it be a superset — the server looks up every number a run mentions * rather than re-deriving which one the cockpit will display (#407, #526 live client-side, and * duplicating that rule is how the two would drift). */ export declare const referenceStatusesByProjectSchema: z.ZodRecord>; issues: z.ZodRecord>; }, z.core.$strip>>; export declare const runsIndexResponseSchema: z.ZodObject<{ runs: z.ZodArray; titleOrigin: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; createdAt: z.ZodString; finishedAt: z.ZodOptional; seenAt: z.ZodOptional; archived: z.ZodBoolean; autoResumeAt: z.ZodOptional; workflow: z.ZodString; branch: z.ZodOptional; startedAt: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueUrl: z.ZodOptional; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; costUsd: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; usage: z.ZodOptional>; }, z.core.$strip>>; referenceStatuses: z.ZodRecord>; issues: z.ZodRecord>; }, z.core.$strip>>; perProjectLimit: z.ZodNumber; truncated: z.ZodArray; }, z.core.$strip>; export type RunsIndexResponse = z.infer; /** * `POST /runs` (201) — one record for ×1, a group for ×2/×3. * * The ×1 branch is the STORED record, not `ApiRun`: `startRun` answers before any `ps` sample * exists, so the create route never runs a record through `withUsage`. */ export declare const createRunResponseSchema: z.ZodUnion; diffStat: z.ZodOptional; }, z.core.$strip>>; workflow: z.ZodString; task: z.ZodString; queuedMessages: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>>>; taskImages: z.ZodOptional>; model: z.ZodOptional; modelIdentity: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; systemPrompt: z.ZodOptional; generateFollowups: z.ZodOptional; autonomous: z.ZodOptional; automation: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; monitoringWakeAt: z.ZodOptional; monitoringWakeCapReached: z.ZodOptional; autoResumeAt: z.ZodOptional; autoResumeAttempts: z.ZodOptional; createdAt: z.ZodString; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueNumberSeeded: z.ZodOptional; titleOrigin: z.ZodOptional>; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; referencedPrCandidates: z.ZodOptional>; referencedIssueUrl: z.ZodOptional; referencedIssueCandidates: z.ZodOptional>; worktree: z.ZodOptional>; worktreePath: z.ZodOptional; branch: z.ZodOptional; baseBranch: z.ZodOptional; worktreeReclaimedAt: z.ZodOptional; groupId: z.ZodOptional; variant: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; archived: z.ZodBoolean; archivedAt: z.ZodOptional; seenAt: z.ZodOptional; currentStepId: z.ZodOptional; error: z.ZodOptional; steps: z.ZodArray; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; iterations: z.ZodNumber; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; usageInvocationsStarted: z.ZodOptional; usageInvocationsObserved: z.ZodOptional; usageTurnsStarted: z.ZodOptional; usageTurnsRecorded: z.ZodOptional; usageInvocationEpoch: z.ZodOptional; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; error: z.ZodOptional; sessionId: z.ZodOptional; backend: z.ZodOptional>; profileId: z.ZodOptional; costUsd: z.ZodOptional; }, z.core.$strip>>; workflowDef: z.ZodOptional; steps: z.ZodArray; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; source: z.ZodEnum<{ "built-in": "built-in"; file: "file"; }>; path: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ runs: z.ZodArray; diffStat: z.ZodOptional; }, z.core.$strip>>; workflow: z.ZodString; task: z.ZodString; queuedMessages: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>>>; taskImages: z.ZodOptional>; model: z.ZodOptional; modelIdentity: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; systemPrompt: z.ZodOptional; generateFollowups: z.ZodOptional; autonomous: z.ZodOptional; automation: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; monitoringWakeAt: z.ZodOptional; monitoringWakeCapReached: z.ZodOptional; autoResumeAt: z.ZodOptional; autoResumeAttempts: z.ZodOptional; createdAt: z.ZodString; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueNumberSeeded: z.ZodOptional; titleOrigin: z.ZodOptional>; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; referencedPrCandidates: z.ZodOptional>; referencedIssueUrl: z.ZodOptional; referencedIssueCandidates: z.ZodOptional>; worktree: z.ZodOptional>; worktreePath: z.ZodOptional; branch: z.ZodOptional; baseBranch: z.ZodOptional; worktreeReclaimedAt: z.ZodOptional; groupId: z.ZodOptional; variant: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; archived: z.ZodBoolean; archivedAt: z.ZodOptional; seenAt: z.ZodOptional; currentStepId: z.ZodOptional; error: z.ZodOptional; steps: z.ZodArray; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; iterations: z.ZodNumber; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; usageInvocationsStarted: z.ZodOptional; usageInvocationsObserved: z.ZodOptional; usageTurnsStarted: z.ZodOptional; usageTurnsRecorded: z.ZodOptional; usageInvocationEpoch: z.ZodOptional; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; error: z.ZodOptional; sessionId: z.ZodOptional; backend: z.ZodOptional>; profileId: z.ZodOptional; costUsd: z.ZodOptional; }, z.core.$strip>>; workflowDef: z.ZodOptional; steps: z.ZodArray; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; source: z.ZodEnum<{ "built-in": "built-in"; file: "file"; }>; path: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>]>; export type CreateRunResponse = z.infer; /** `POST /runs/:id/cancel` — genuinely a boolean: an already-settled run answers 200 + `false`. */ export declare const cancelResponseSchema: z.ZodObject<{ cancelled: z.ZodBoolean; }, z.core.$strip>; export type CancelResponse = z.infer; /** * `DELETE /runs/:id/auto-resume` (spec 2026-08-03-auto-resume-after-usage-limit) — the per-task * off switch for a pending usage-limit resume, next to the workspace-wide setting. * * `z.literal(true)`, not a boolean, and that IS the shape: the route is idempotent, so a run with * nothing pending answers 200 as well — "this task will not resume itself" is equally true either * way. Only an unknown run refuses, with 404. */ export declare const cancelAutoResumeResponseSchema: z.ZodObject<{ cancelled: z.ZodLiteral; }, z.core.$strip>; export type CancelAutoResumeResponse = z.infer; /** `POST /runs/archive-finished` — how many runs the sweep archived. */ export declare const archiveFinishedResponseSchema: z.ZodObject<{ archived: z.ZodNumber; }, z.core.$strip>; export type ArchiveFinishedResponse = z.infer; /** `POST /runs/read-all` — how many unread finished runs the sweep marked read. */ export declare const markAllReadResponseSchema: z.ZodObject<{ read: z.ZodNumber; }, z.core.$strip>; export type MarkAllReadResponse = z.infer; /** `DELETE /runs/:id` — an active run is a 409 and an unknown one a 404, so this only ever * reports success. */ export declare const deleteRunResponseSchema: z.ZodObject<{ deleted: z.ZodLiteral; }, z.core.$strip>; export type DeleteRunResponse = z.infer; /** `POST /runs/:id/finish` — "no open session" is a 409. */ export declare const finishResponseSchema: z.ZodObject<{ finished: z.ZodLiteral; }, z.core.$strip>; export type FinishResponse = z.infer; /** `POST /runs/:id/continue` — a refusal to reopen is a 409 carrying the engine's reason. */ export declare const continueResponseSchema: z.ZodObject<{ continued: z.ZodLiteral; }, z.core.$strip>; export type ContinueResponse = z.infer; /** * `POST /runs/:id/pr` (201, spec 009) — the draft PR's URL; `dryRun` marks the CEZ_DRY_RUN fake * (no push, no gh). Failure is a 409 whose `ApiError` carries the `manual` merge command instead. * * `dryRun` is REQUIRED: `createDraftPr`'s success outcome always sets it (`forge/types.ts`), so * the key is always on the wire. The hand-written DTO had it optional. */ export declare const createPrResponseSchema: z.ZodObject<{ url: z.ZodString; dryRun: z.ZodBoolean; }, z.core.$strip>; export type CreatePrResponse = z.infer; /** * `POST /runs/:id/messages` — one of three shapes (#472), by how far the run has got: * `delivered` (a live session took it), `queued` (still waiting for a slot, so it was stacked * onto the prompt and the stored entry rides along), `deferred` (mid-spawn, so it was buffered * and arrives as an ordinary follow-up turn once the session opens). Anything else is a 409. * * A union, not one object of optional flags: exactly one of the three keys is ever present, and * the flattened DTO shape admitted `{}`. Pre-#472 clients only ever saw `delivered`. */ export declare const messageResponseSchema: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ queued: z.ZodLiteral; message: z.ZodObject<{ id: z.ZodString; text: z.ZodString; images: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ deferred: z.ZodLiteral; }, z.core.$strip>]>; export type MessageResponse = z.infer; /** `PATCH /runs/:id/queued-messages/:msgId` (#472) — the replaced entry. */ export declare const editQueuedMessageResponseSchema: z.ZodObject<{ message: z.ZodObject<{ id: z.ZodString; text: z.ZodString; images: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; export type EditQueuedMessageResponse = z.infer; /** `DELETE /runs/:id/queued-messages/:msgId` (#472) — `409 run already started` otherwise. */ export declare const removeQueuedMessageResponseSchema: z.ZodObject<{ removed: z.ZodLiteral; }, z.core.$strip>; export type RemoveQueuedMessageResponse = z.infer; /** * `POST /runs/:id/open-in-cli` — a terminal was spawned with `command` running in it. With no * terminal emulator the server answers 409 and the `ApiError` carries the full `cd … && ` * for the clipboard fallback. */ export declare const openInCliResponseSchema: z.ZodObject<{ opened: z.ZodLiteral; command: z.ZodString; }, z.core.$strip>; export type OpenInCliResponse = z.infer; /** `POST /runs/:id/remove-worktree` — per-row delete in the worktrees panel (#483). */ export declare const removeWorktreeResponseSchema: z.ZodObject<{ removed: z.ZodLiteral; }, z.core.$strip>; export type RemoveWorktreeResponse = z.infer; /** `POST /runs/:id/git/commit` — `git add -A && git commit` in the run's worktree. */ export declare const gitCommitResponseSchema: z.ZodObject<{ committed: z.ZodLiteral; sha: z.ZodString; }, z.core.$strip>; export type GitCommitResponse = z.infer; /** `POST /runs/:id/git/push` — push the worktree's branch, setting upstream if it has none. */ export declare const gitPushResponseSchema: z.ZodObject<{ pushed: z.ZodLiteral; branch: z.ZodString; remote: z.ZodString; upstreamSet: z.ZodBoolean; }, z.core.$strip>; export type GitPushResponse = z.infer; /** A commit a run made on its worktree branch. */ export declare const runCommitSchema: z.ZodObject<{ sha: z.ZodString; subject: z.ZodString; author: z.ZodString; when: z.ZodString; }, z.core.$strip>; export type RunCommit = z.infer; /** `GET /runs/:id/commits` — `..HEAD` on the worktree branch, newest first. */ export declare const runCommitsResponseSchema: z.ZodObject<{ commits: z.ZodArray>; }, z.core.$strip>; export type RunCommitsResponse = z.infer; /** * One variant column of the compare view. * * CAREFUL: `diffStat` here is the raw `git diff --stat` TEXT the server runs in the variant's * worktree — a different thing from the numeric `RunRecord.diffStat`. `''` when the worktree * is gone. */ export declare const groupVariantSchema: z.ZodObject<{ id: z.ZodString; variant: z.ZodString; title: z.ZodString; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; archived: z.ZodBoolean; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; diffStat: z.ZodString; handoffExcerpt: z.ZodString; }, z.core.$strip>; export type GroupVariant = z.infer; /** `GET /groups/:groupId` — every run sharing a groupId, side by side. */ export declare const groupResponseSchema: z.ZodObject<{ groupId: z.ZodString; runs: z.ZodArray; archived: z.ZodBoolean; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; diffStat: z.ZodString; handoffExcerpt: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; export type GroupResponse = z.infer; /** * `POST /groups/:groupId/pick` — the winner (parked at `review` when it has a diff); the losers * were cancelled if alive, archived, and their worktrees + branches removed. * * `winner` is OPTIONAL because that is what the wire says: `store.getRun(id)` can miss, and * `JSON.stringify` drops a key whose value is `undefined`. The handler spreads the key in * conditionally (`server.ts`, the `/groups/:groupId/pick` route) so its own type says the same * thing — the two-way check in `contract-parity.workflows.test.ts` is what pins that. */ export declare const pickVariantResponseSchema: z.ZodObject<{ winner: z.ZodOptional; diffStat: z.ZodOptional; }, z.core.$strip>>; workflow: z.ZodString; task: z.ZodString; queuedMessages: z.ZodOptional>; createdAt: z.ZodString; }, z.core.$strip>>>; taskImages: z.ZodOptional>; model: z.ZodOptional; modelIdentity: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; systemPrompt: z.ZodOptional; generateFollowups: z.ZodOptional; autonomous: z.ZodOptional; automation: z.ZodOptional>; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; queued: "queued"; review: "review"; running: "running"; waiting: "waiting"; }>; activity: z.ZodOptional>; monitoringWakeAt: z.ZodOptional; monitoringWakeCapReached: z.ZodOptional; autoResumeAt: z.ZodOptional; autoResumeAttempts: z.ZodOptional; createdAt: z.ZodString; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; costUsd: z.ZodOptional; pullRequestUrl: z.ZodOptional; referencedPullRequestUrl: z.ZodOptional; prNumber: z.ZodOptional; issueNumber: z.ZodOptional; referencedIssueNumberSeeded: z.ZodOptional; titleOrigin: z.ZodOptional>; markerRefs: z.ZodOptional; issue: z.ZodOptional; }, z.core.$strip>>; referencedPrCandidates: z.ZodOptional>; referencedIssueUrl: z.ZodOptional; referencedIssueCandidates: z.ZodOptional>; worktree: z.ZodOptional>; worktreePath: z.ZodOptional; branch: z.ZodOptional; baseBranch: z.ZodOptional; worktreeReclaimedAt: z.ZodOptional; groupId: z.ZodOptional; variant: z.ZodOptional; peakRssBytes: z.ZodOptional; peakProcCount: z.ZodOptional; archived: z.ZodBoolean; archivedAt: z.ZodOptional; seenAt: z.ZodOptional; currentStepId: z.ZodOptional; error: z.ZodOptional; steps: z.ZodArray; status: z.ZodEnum<{ cancelled: "cancelled"; done: "done"; failed: "failed"; pending: "pending"; review: "review"; running: "running"; skipped: "skipped"; waiting: "waiting"; }>; iterations: z.ZodNumber; tokensUsed: z.ZodNumber; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; usageInvocationsStarted: z.ZodOptional; usageInvocationsObserved: z.ZodOptional; usageTurnsStarted: z.ZodOptional; usageTurnsRecorded: z.ZodOptional; usageInvocationEpoch: z.ZodOptional; startedAt: z.ZodOptional; finishedAt: z.ZodOptional; error: z.ZodOptional; sessionId: z.ZodOptional; backend: z.ZodOptional>; profileId: z.ZodOptional; costUsd: z.ZodOptional; }, z.core.$strip>>; workflowDef: z.ZodOptional; steps: z.ZodArray; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; source: z.ZodEnum<{ "built-in": "built-in"; file: "file"; }>; path: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>; export type PickVariantResponse = z.infer; /** An inline image, base64 — ≤4 per request, ~5 MB each once decoded. */ export declare const imageInputSchema: z.ZodObject<{ mediaType: z.ZodString; data: z.ZodString; }, z.core.$strip>; export type ImageInput = z.input; /** * The KEYS of `POST /runs`' body, before the XOR refinement that `createRunInputSchema` adds. * * Split out for one reason: `./automations.ts` builds an automation's task on top of this shape * (a task IS a run-creation body minus the three keys an automation supplies itself), and zod * refuses `.omit()` on a schema that carries refinements. Validate with `createRunInputSchema` * below — this half accepts a body naming both `workflow` and `steps`, which the server does not. */ export declare const createRunInputBaseSchema: z.ZodObject<{ workflow: z.ZodOptional; steps: z.ZodOptional; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>>; task: z.ZodString; model: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; variants: z.ZodOptional; worktree: z.ZodOptional; autonomous: z.ZodOptional; generateFollowups: z.ZodOptional; systemPrompt: z.ZodPipe, z.ZodTransform>; images: z.ZodOptional>>; todoId: z.ZodOptional; }, z.core.$strip>; /** * `POST /runs`. Exactly one of `workflow` / `steps` — the server rejects both or neither. * * Every bound here is the server's own (#429): an unbounded body must never reach a spawned * process, so a client that validates before sending gets the same answer the route would give. */ export declare const createRunInputSchema: z.ZodObject<{ workflow: z.ZodOptional; steps: z.ZodOptional; prompt: z.ZodOptional; skill: z.ZodOptional; model: z.ZodOptional; runner: z.ZodOptional>; allowedTools: z.ZodOptional>; bashAllowlist: z.ZodOptional>; command: z.ZodOptional; onFail: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>>>; task: z.ZodString; model: z.ZodOptional; runner: z.ZodOptional>; agentProfile: z.ZodOptional; variants: z.ZodOptional; worktree: z.ZodOptional; autonomous: z.ZodOptional; generateFollowups: z.ZodOptional; systemPrompt: z.ZodPipe, z.ZodTransform>; images: z.ZodOptional>>; todoId: z.ZodOptional; }, z.core.$strip>; export type CreateRunInput = z.input; /** * `POST /runs/:id/messages` — text and/or pasted screenshots for a live session. Both keys have * server-side defaults, so an omitted `text` is `''` and an omitted `images` is `[]`; the refine * is what rejects a message that is empty in both. */ export declare const messageInputSchema: z.ZodObject<{ text: z.ZodDefault; images: z.ZodDefault>>; }, z.core.$strip>; export type MessageInput = z.input; /** * `PATCH /runs/:id` (#389). `title` is trimmed server-side, 1–300 chars, and the edit sets both * `title` and `titleSummary` so it wins over any auto-summary. `task` (#472) is the initial * prompt, editable only while the run is still queued — any other status answers * `409 run already started`, and the folded total across the task and its stack bounds it again. */ export declare const patchRunInputSchema: z.ZodObject<{ title: z.ZodOptional; task: z.ZodOptional; }, z.core.$strip>; export type PatchRunInput = z.input;