/** * The `/api/v1/campaigns` surface (crew#342 + TH-9; DES-CAMPAIGN-001 §8). * * Thin by design: validation is zod (strict, unknown keys named — the FINDING-031 doctrine), * scenario→node mapping is `plan.ts` (pure), and the scheduler is the ENGINE's (durable, * single-writer, crash-resumable) — the daemon keeps no shadow campaign SCHEDULING state, so a * restarted daemon and a second daemon over the same db answer the DAG identically. Campaign * progress is NOT polled from here: the 11 `campaign*` CoreEvents ride the daemon's existing * allowlist-free `/ws` relay the moment the engine emits them. * * What the GET routes ADD at DTO assembly (wicked-studio#27; api-types 0.19.0, `rollup.ts`) is * provenance and derivation, never scheduling state: per-node `node_delivery` (the run wire's * own delivery derivation), the ad-hoc `attached_runs` filed onto a campaign at launch, and the * `groups` rows — the latter two read from the daemon's audit trail via `GroupIndex`, the same * durable-record pattern as retry lineage. * * Error posture mirrors the chat/elicitation surfaces: a build whose engine addon lacks the * campaign bindings answers 501 (`CampaignsUnsupportedError` — "upgrade the engine"), never * 400 ("fix your request"). */ import type { FastifyInstance, FastifyRequest } from 'fastify'; import { z } from 'zod'; import { type CoreAdapter } from '../core/adapter.js'; import type { Actor } from '../core/types.js'; import type { AuditLog } from '../api/audit.js'; import { type RollupDeps } from './rollup.js'; export declare const LaunchCampaignSchema: z.ZodObject<{ id: z.ZodOptional; name: z.ZodOptional; scenarios: z.ZodArray; deps: z.ZodOptional>; depsCondition: z.ZodOptional>; tool: z.ZodOptional; }, "strict", z.ZodTypeAny, { cmd: string[]; }, { cmd: string[]; }>>; agent: z.ZodOptional; }, "strict", z.ZodTypeAny, { problem: string; workflow?: string | undefined; }, { problem: string; workflow?: string | undefined; }>>; repoRef: z.ZodOptional; }, "strict", z.ZodTypeAny, { id: string; title?: string | undefined; agent?: { problem: string; workflow?: string | undefined; } | undefined; tool?: { cmd: string[]; } | undefined; repoRef?: string | undefined; deps?: string[] | undefined; depsCondition?: "on_success" | "on_terminal" | undefined; }, { id: string; title?: string | undefined; agent?: { problem: string; workflow?: string | undefined; } | undefined; tool?: { cmd: string[]; } | undefined; repoRef?: string | undefined; deps?: string[] | undefined; depsCondition?: "on_success" | "on_terminal" | undefined; }>, "many">; policy: z.ZodOptional>; maxConcurrency: z.ZodOptional; denialGate: z.ZodOptional>; clisJson: z.ZodOptional; projectId: z.ZodOptional; repoRefs: z.ZodOptional>; }, "strict", z.ZodTypeAny, { scenarios: { id: string; title?: string | undefined; agent?: { problem: string; workflow?: string | undefined; } | undefined; tool?: { cmd: string[]; } | undefined; repoRef?: string | undefined; deps?: string[] | undefined; depsCondition?: "on_success" | "on_terminal" | undefined; }[]; id?: string | undefined; name?: string | undefined; projectId?: string | undefined; clisJson?: string | undefined; policy?: "continue_independent" | "fail_fast" | "human_gate_on_failure" | undefined; repoRefs?: string[] | undefined; maxConcurrency?: number | undefined; denialGate?: "hold" | "auto_reject" | undefined; }, { scenarios: { id: string; title?: string | undefined; agent?: { problem: string; workflow?: string | undefined; } | undefined; tool?: { cmd: string[]; } | undefined; repoRef?: string | undefined; deps?: string[] | undefined; depsCondition?: "on_success" | "on_terminal" | undefined; }[]; id?: string | undefined; name?: string | undefined; projectId?: string | undefined; clisJson?: string | undefined; policy?: "continue_independent" | "fail_fast" | "human_gate_on_failure" | undefined; repoRefs?: string[] | undefined; maxConcurrency?: number | undefined; denialGate?: "hold" | "auto_reject" | undefined; }>; export interface CampaignRoutesDeps extends RollupDeps { audit: AuditLog; actorOf: (req: FastifyRequest & { actor?: Actor; }) => Actor; /** The default council roster for agent scenarios (already parsed) — WITH crew's standing * (`council_eligible` …), which the adapter translates into the engine's per-seat `health` at * launch, per node (`core/engine-roster.ts` `engineCampaignDef`, F-086). */ roster: () => unknown[]; } export declare function registerCampaignRoutes(app: FastifyInstance, adapter: CoreAdapter, deps: CampaignRoutesDeps): void; //# sourceMappingURL=routes.d.ts.map