/** * ADR-406 §19.7 — the mission semantic operations, shared by every client. * * `mission.create`, `mission.plan`, `mission.get`, `mission.events` and * `mission.requestAction` parse raw input with the same zod schemas whether * the caller is the CLI or an MCP tool. Principal, tenant and workspace are * derived from the trusted local context (the OS user owning this process and * the canonical project path); nothing in the input can name them, and no * input field is treated as proof of permission. * * Every mutation carries a request id and the expected mission revision. A * stale revision is refused with the current one (refreshable conflict). A * repeated request id with the same input returns the original outcome; with * different input it is refused. */ import { type MissionEvent } from './schemas.js'; export type Channel = 'cli' | 'mcp'; export interface MissionContext { readonly projectRoot: string; readonly channel: Channel; readonly now?: () => Date; } export type MissionResult = { readonly ok: true; readonly data: T; } | { readonly ok: false; readonly code: string; readonly message: string; readonly currentRevision?: number; }; export declare class RevisionConflict extends Error { readonly currentRevision: number; constructor(currentRevision: number, expected: number); } export declare class MissionService { private readonly ctx; private readonly store; private readonly identity; constructor(ctx: MissionContext); private now; private event; /** Same principal + request id earlier in this mission's log: same input replays, other input is refused. */ private prior; private publishObservation; create(raw: unknown): Promise>; /** Run a control transition with request dedup and an expected-revision check. */ private control; plan(raw: unknown): Promise>; /** * Scoped control requests. Admission and resume need an admitted executor * and a policy-authorized budget reservation (M2); until one exists they are * refused with an explicit reason rather than recorded as if work started. */ requestAction(raw: unknown): Promise>; get(raw?: unknown): Promise>; /** * Events after a cursor. Delivery may repeat; clients deduplicate by * (missionId, seq). `retainedFromSequence` is the oldest event kept; a cursor * older than that gets `gap: true` and must reload a snapshot first. */ events(raw: unknown): Promise>; } //# sourceMappingURL=service.d.ts.map