/** * The crew team surface (DES-TEAMING-002 T8): reads and commands over the engine. Commands go * through the API, facts go on the bus (§4.0); crew publishes no team row. * * GET /runs/:id/team the engine's persisted team state (`Core.runTeam`) joined with the * run's `wicked.team.*` bus rows and the folded ledger each gate read * POST /runs/:id/plan a plan edit: at a `plan_approval` gate the gate answer * (`confirmGate … edit_plan`), otherwise a mid-run edit (`Core.proposePlan`) * POST /team/outbox/replay `Core.replayTeamOutbox`: the team outbox onto the bus * GET /catalog the engine's phase catalog * POST /plans/preview the launch's decision over a draft plan (`Core.previewPlan`) * * The live stream is the relay (`team/ws-relay.ts`). An addon without a binding answers 501. */ import type { FastifyInstance } from 'fastify'; import { z } from 'zod'; import type { CoreAdapter } from '../core/adapter.js'; import type { RunTeamResponse, RunTeamView, TeamRow } from '../core/types.js'; import { AuditLog } from '../api/audit.js'; export declare const EditPlanSchema: z.ZodObject<{ plan: z.ZodObject<{ steps: z.ZodArray; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">; touch: z.ZodOptional>; override: z.ZodOptional; reason: z.ZodString; }, "strict", z.ZodTypeAny, { reason: string; remove: string[]; }, { reason: string; remove: string[]; }>>; monitors: z.ZodOptional>; }, "strict", z.ZodTypeAny, { steps: z.objectOutputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }, { steps: z.objectInputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }>; requestId: z.ZodOptional; }, "strict", z.ZodTypeAny, { plan: { steps: z.objectOutputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }; requestId?: string | undefined; }, { plan: { steps: z.objectInputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }; requestId?: string | undefined; }>; export declare const PlanPreviewSchema: z.ZodObject<{ plan: z.ZodObject<{ steps: z.ZodArray; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>, "many">; touch: z.ZodOptional>; override: z.ZodOptional; reason: z.ZodString; }, "strict", z.ZodTypeAny, { reason: string; remove: string[]; }, { reason: string; remove: string[]; }>>; monitors: z.ZodOptional>; }, "strict", z.ZodTypeAny, { steps: z.objectOutputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }, { steps: z.objectInputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }>; projectId: z.ZodOptional; humanConfirm: z.ZodOptional; repoRef: z.ZodOptional; deliver: z.ZodOptional>; }, "strict", z.ZodTypeAny, { plan: { steps: z.objectOutputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }; deliver?: "pr" | "none" | undefined; projectId?: string | undefined; humanConfirm?: string | undefined; repoRef?: string | undefined; }, { plan: { steps: z.objectInputType<{ catalog: z.ZodString; id: z.ZodOptional; }, z.ZodTypeAny, "passthrough">[]; override?: { reason: string; remove: string[]; } | undefined; touch?: string[] | undefined; monitors?: { asked: number; } | undefined; }; deliver?: "pr" | "none" | undefined; projectId?: string | undefined; humanConfirm?: string | undefined; repoRef?: string | undefined; }>; /** The run's `wicked.team.*` rows, by `event_id`, read through the engine that holds the bus * (core/bus.ts); `[]` when the bus is absent or unreadable. */ export declare function busRows(busDbPath: string | undefined, runId: string): Promise; /** * The OPEN plan gate's own reading of the plan it holds: the newest `gate.opened{kind:"plan_approval"}` * no `gate.decided` answered, with its `band` and `high_risk` (brainstorm idea 13 — a plan-approval * trust order re-reads these before it answers). `undefined` when no plan gate is open or the row * does not state both its band and a boolean `high_risk`: the caller fails closed. */ export declare function openPlanGateRisk(rows: readonly TeamRow[]): { band: string; highRisk: boolean; } | undefined; /** * Join the bus rows onto the engine's snapshot. Rows with `ord: null` are the run's; the rest go * to their unit. `gate.opened{kind:"unit_review"}.ledger_ref` is the only authority on which * ledger a gate read: the `ledger.folded` row it names is the unit's `ledger`, and a fold for an * attempt whose gate named another ledger is labelled `unused`. */ export declare function joinTeam(view: RunTeamView, rows: TeamRow[]): RunTeamResponse; type SessionView = import('../core/types.js').SessionView; export declare function registerTeamRoutes(app: FastifyInstance, adapter: CoreAdapter, security: { audit: AuditLog; }, gateDecisions: { exclusive: (runId: string, fn: () => Promise) => Promise; judge: (run: SessionView, namedOrd: number | undefined) => Promise<{ refusal: { code: number; body: unknown; }; } | object>; /** crew#1157: a refusal when `plan` would let a read-only (analysis) run write; `null` otherwise. */ readOnlyRefusal?: (runId: string, plan: { steps: Array<{ catalog: string; [k: string]: unknown; }>; }) => { code: number; body: unknown; } | null; }): void; export {}; //# sourceMappingURL=routes.d.ts.map