wicked-crew-api-types 0.69.0 → 0.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +464 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -231,6 +231,19 @@ export interface HealthCapabilities {
231
231
  * on such a daemon.
232
232
  */
233
233
  seatChipOnCreate?: boolean;
234
+ /**
235
+ * `AgentSession.chat_id` is served on every run launched from a chat, terminal ones included
236
+ * (C1; crew ≥ the release carrying api-types 0.71.0). ABSENT on a daemon before the field — read
237
+ * as `false`: group such a daemon's runs one session per run.
238
+ */
239
+ runChatId?: boolean;
240
+ /**
241
+ * Repo-bound runs get an EVIDENCE ROOT for walkthroughs (WT-W1, api-types 0.74.0): the engine
242
+ * addon takes `LaunchOptions.evidenceRoot` (wicked-core-ts ≥ 0.7.35), so a walkthrough step on a
243
+ * run launched now can record and pass. `GET /runs/:id/walkthrough` answers on every daemon that
244
+ * has the field. ABSENT or `false` — a walkthrough step on this daemon's runs fails closed.
245
+ */
246
+ walkthroughRoots?: boolean;
234
247
  }
235
248
 
236
249
  /** One `GET /health.warnings[]` entry (additive; wicked-core#411 / wicked-crew#497). */
@@ -344,6 +357,13 @@ export interface AgentSession {
344
357
  * plus `denial_reason` (crew#318's message), both already on the list wire.
345
358
  */
346
359
  delivery?: 'delivered' | 'pushed' | 'stranded' | 'vacuous' | 'none';
360
+ /**
361
+ * (crew#755; api-types 0.76.0) `'text_only'` on a COMPLETED free-text run (launched with neither a
362
+ * workflow nor a plan) that had no repo and no write root of its own: whatever it did, it did in
363
+ * text — nothing was changed, checked or delivered. Show it as such, never as plain completed
364
+ * work. ABSENT on every other run (and on a daemon before the field).
365
+ */
366
+ outcome?: 'text_only';
347
367
  /**
348
368
  * The delivered PR's URL (crew#393; api-types 0.18.0) — present exactly when
349
369
  * `delivery === 'delivered'`; absent otherwise (absence is the one spelling, never `null`).
@@ -492,6 +512,13 @@ export interface AgentSession {
492
512
  * this field.
493
513
  */
494
514
  chat_grounded?: boolean;
515
+ /**
516
+ * The chat this run was launched from (`LaunchRunBody.chatId`; C1, api-types 0.71.0) — on EVERY
517
+ * run, terminal ones included, and after a daemon restart (read back from the `run.launched`
518
+ * trail entry). ABSENT — never `null` — when the run was not launched from a chat, or on a daemon
519
+ * before the field: check `GET /health.capabilities.runChatId` before grouping runs by chat.
520
+ */
521
+ chat_id?: string;
495
522
  /**
496
523
  * The engine's plan state (wicked-core `TeamPlanState`, DES-TEAMING-002 §8.4-§8.6; api-types
497
524
  * 0.46.0 types the engine field) — present on a run launched from a PLAN or a PRESET, ABSENT on
@@ -508,6 +535,14 @@ export interface AgentSession {
508
535
  * workflow ids.
509
536
  */
510
537
  run_identity?: RunIdentity;
538
+ /**
539
+ * The run's EVIDENCE ROOT (WT-W1, DES-walkthrough-proof §4.2; api-types 0.74.0), minted by the
540
+ * daemon for every repo-bound run on an engine that takes it: `<root>/author/<plan step>/` is
541
+ * the walkthrough author's write dir, `<root>/<review step>/` the proof root only the jailed
542
+ * `walkthrough_review` Tool writes. Read the walkthrough through `GET /runs/:id/walkthrough`, not
543
+ * from this path. ABSENT on a repo-less run, on an engine before the field, and on older runs.
544
+ */
545
+ evidence_root?: string;
511
546
  }
512
547
 
513
548
  /**
@@ -2544,7 +2579,13 @@ export interface ConformanceRule {
2544
2579
  statement: string;
2545
2580
  severity: 'info' | 'warn' | 'error' | 'critical';
2546
2581
  confidence: number;
2547
- targets: { language?: string; layer?: string; framework?: string };
2582
+ /**
2583
+ * Facets. `language` / `layer` / `framework` are wildcards (absent = every value). `project`
2584
+ * (api-types 0.77.0, DC-S3; engine >= wicked-core-ts 0.7.35) is ASYMMETRIC: a rule with no project
2585
+ * applies everywhere; a rule with one is recalled only for that project. A landed policy proposal
2586
+ * keeps its `project` facet here.
2587
+ */
2588
+ targets: { language?: string; layer?: string; framework?: string; project?: string };
2548
2589
  symbol_ref?: string;
2549
2590
  compliance?: { framework: string; control_id: string };
2550
2591
  /** Where the rule came from. Doc-ingested rules keep `path@sha#id` in `ref`; UI/chat-authored
@@ -2588,6 +2629,8 @@ export interface ConformanceRule {
2588
2629
  * pre-bump binding), so a `since`/`until` filter cannot assert an undated rule in range.
2589
2630
  */
2590
2631
  created_at?: number;
2632
+ /** (api-types 0.77.0, DC-S1/DC-S3) The rule ids this rule replaces. Absent when it replaces none. */
2633
+ supersedes?: string[];
2591
2634
  }
2592
2635
 
2593
2636
  /** Facet query for `GET /governance/rules/preview`. All fields are optional. */
@@ -3933,6 +3976,12 @@ export interface LinkedIssue {
3933
3976
  export interface LaunchRunResponse {
3934
3977
  runId: string;
3935
3978
  linkedIssues?: LinkedIssue[];
3979
+ /**
3980
+ * (crew#755; api-types 0.76.0) PRESENT when the launch named neither a `workflow` nor a `plan`:
3981
+ * the run uses the engine's free-text planner (one step, the brief verbatim; no phases, checks or
3982
+ * delivery), and `notice` says so in words a composer can show. ABSENT on every other launch.
3983
+ */
3984
+ freeText?: { notice: string };
3936
3985
  }
3937
3986
 
3938
3987
  /**
@@ -4252,6 +4301,12 @@ export interface GitContributor {
4252
4301
  export interface SystemSettings {
4253
4302
  /** Max nodes returned by wicked-estate graph-view (default 150). */
4254
4303
  graphNodeLimit: number;
4304
+ /**
4305
+ * The watch registry's operator settings (TR-W5a, api-types 0.73.0): only `enabled` and
4306
+ * `threshold` of a shipped entry, and the LLM lane switch. A `watch` patch needs a human actor
4307
+ * (a worker's bearer is refused 403); the daemon stamps who changed what and when.
4308
+ */
4309
+ watch?: WatchSettings;
4255
4310
  /**
4256
4311
  * Base directory for the ENGINE-OWNED worker CLI config homes (the claude worker home is
4257
4312
  * `<root>/claude`). The daemon applies it as env `WICKED_WORKER_HOME` at boot and on every
@@ -6288,6 +6343,12 @@ export interface PolicyLandingResult {
6288
6343
  ruleId?: string;
6289
6344
  /** The steering type derived from the proposal's `kind_type` (`policy:<type>`). Present on `landed`. */
6290
6345
  steering_type?: SteeringType;
6346
+ /**
6347
+ * (api-types 0.77.0, DC-S3) The project the landed rule is scoped to — the proposal's `project`
6348
+ * facet, kept as `targets.project` and confirmed by reading the rule back. Absent on a landing
6349
+ * with no project (the rule applies everywhere).
6350
+ */
6351
+ project?: string;
6291
6352
  /** Present iff `outcome:"failed"` — the loud reason the rule did not land. */
6292
6353
  error?: string;
6293
6354
  }
@@ -6489,6 +6550,166 @@ export interface DemoView {
6489
6550
  syntheticLabelled: boolean;
6490
6551
  }
6491
6552
 
6553
+ /** What `POST /runs/:id/demo/export` makes (EP-C3; api-types 0.72.0). The MP4 itself needs no export: download `video.path`. */
6554
+ export type DemoExportFormat = 'gif' | 'poster';
6555
+
6556
+ /**
6557
+ * `POST /runs/:id/demo/export` body (EP-C3; api-types 0.72.0). `gif` encodes the stitched MP4 into
6558
+ * `demo-video/demo.gif` (two-pass palette, 10 fps, 720 px wide); `poster` writes one frame to
6559
+ * `demo-video/poster.jpg`. The daemon encodes with ffmpeg off its event loop and a timeout (GIF 180 s,
6560
+ * poster 30 s), only at the review gate or once the run has ended. Refusals: 400 a bad body, 404 not a demo run, 409 no stitched MP4 yet / the run is still recording / `demo-video/` changed mid-encode, 422 no frame
6561
+ * at `atSec`, 502 ffmpeg failed, 503 no ffmpeg on the daemon host (`hint` says how to install it),
6562
+ * 504 the encode ran past its timeout. A second identical request while one encodes joins it.
6563
+ */
6564
+ export interface DemoExportBody {
6565
+ format: DemoExportFormat;
6566
+ /** Poster only: the frame, in seconds from the start (0 … 86400). Default: the first chapter marker + 1 s, or 1 s with no markers. */
6567
+ atSec?: number;
6568
+ }
6569
+
6570
+ /** `POST /runs/:id/demo/export` → 200: the file, ready for `GET /runs/:id/demo/file?path=`. */
6571
+ export interface DemoExportResponse {
6572
+ format: DemoExportFormat;
6573
+ /** `demo-video/demo.gif` or `demo-video/poster.jpg` (root-relative). */
6574
+ path: string;
6575
+ bytes: number;
6576
+ }
6577
+
6578
+ // ── Walkthroughs: the recording view (WT-W1, DES-walkthrough-proof §4.10; api-types 0.74.0) ──────
6579
+
6580
+ /**
6581
+ * Where a walkthrough stands (`WalkthroughView.state`), read from the run's walkthrough pair — the
6582
+ * `walkthrough_plan` unit (the author, an evaluator) and the `walkthrough_review` unit (the jailed
6583
+ * engine-run recorder) — and the recorder's files in the proof root.
6584
+ *
6585
+ * - `authoring` the author has not finished the storyline (also: the run has no walkthrough
6586
+ * step yet — `stepId` is then `null` and `cause` says so);
6587
+ * - `linting` the author's storyline was refused by its pinned lint (the unit was denied;
6588
+ * its escalation gate is open, `cause` is the lint's reason);
6589
+ * - `starting_app`, `recording`, `judging`
6590
+ * the recorder is queued or running: its `progress.json` names the phase;
6591
+ * - `passed`, `failed`, `inconclusive`
6592
+ * the recorder finished: `result.json`'s `overall` (PASS / FAIL / INCONCLUSIVE).
6593
+ * A finished recorder with no readable `result.json` reads `inconclusive` with
6594
+ * `cause: 'no_result'`.
6595
+ */
6596
+ export type WalkthroughState =
6597
+ | 'authoring'
6598
+ | 'linting'
6599
+ | 'starting_app'
6600
+ | 'recording'
6601
+ | 'judging'
6602
+ | 'passed'
6603
+ | 'failed'
6604
+ | 'inconclusive';
6605
+
6606
+ /** One chapter's verdict, as the recorder's judge wrote it (§4.5). */
6607
+ export type WalkthroughVerdict = 'PASS' | 'FAIL' | 'INCONCLUSIVE';
6608
+
6609
+ /** One check of a chapter: what was captured on screen or underneath, and whether its verifier passed. */
6610
+ export interface WalkthroughCheck {
6611
+ id: string;
6612
+ /** `on_screen`, `saved_state`, `events`, `side_effects`, `output`, `must_not_happen`, `cross_check`. */
6613
+ kind: string;
6614
+ /** The plain sentence the check proves. */
6615
+ sentence: string;
6616
+ /** `null` when the check never ran (its `ctx.check` was not reached, or the take was refused). */
6617
+ passed: boolean | null;
6618
+ /** Seconds into the chapter when the check was captured; `null` when it never ran. */
6619
+ atSec: number | null;
6620
+ /** Proof-root-relative paths (for `GET /runs/:id/walkthrough/file`). */
6621
+ evidence: string[];
6622
+ vaultEntry: string | null;
6623
+ detail: string | null;
6624
+ }
6625
+
6626
+ /** A capped leg of a chapter (§4.5 "the honest cap"): e.g. the provider leg ran against a sink. */
6627
+ export interface WalkthroughLeg {
6628
+ leg: string;
6629
+ claim_level: string;
6630
+ reason: string;
6631
+ }
6632
+
6633
+ /** One chapter of a walkthrough: the demo chapter plus its verdict and checks. */
6634
+ export interface WalkthroughChapter extends DemoChapter {
6635
+ /** 1-based position and the chapter count, for "chapter 2 of 5". */
6636
+ index: number;
6637
+ total: number;
6638
+ /** `null` until the judge has written it. */
6639
+ verdict: WalkthroughVerdict | null;
6640
+ /** How many takes the recorder made of this chapter (failed takes are kept, never stitched). */
6641
+ takes: number;
6642
+ /** Seconds into the chapter of the first failing check; `null` unless it failed. */
6643
+ failedAtSec: number | null;
6644
+ /** The failing frame (proof-root-relative), when the recorder kept one. */
6645
+ failedFrame: string | null;
6646
+ /** The plan step ids this chapter proves. */
6647
+ proves: string[];
6648
+ legs: WalkthroughLeg[];
6649
+ checks: WalkthroughCheck[];
6650
+ }
6651
+
6652
+ /**
6653
+ * Per plan step, whether a sealed walkthrough proves it (§4.9). Computed at every read, never stored.
6654
+ * `checked`: every proving chapter of the newest sealed walkthrough passed; `failed`: one failed;
6655
+ * `claimed`: the step passed its own gate and no sealed chapter proves it; `owned_by_you`: the
6656
+ * accepted plan's override removed the walkthrough pair.
6657
+ */
6658
+ export type WalkthroughCheckState = 'checked' | 'failed' | 'claimed' | 'owned_by_you';
6659
+
6660
+ export interface WalkthroughStepState {
6661
+ stepId: string;
6662
+ checkState: WalkthroughCheckState;
6663
+ provedBy: Array<{ chapter: string; atSec: number | null }>;
6664
+ }
6665
+
6666
+ /**
6667
+ * `GET /runs/:id/walkthrough?step=` → 200 for every known run (404 for an unknown run, or a `step`
6668
+ * that names no walkthrough step of it). `step` is the `walkthrough_review` step id (or its author's
6669
+ * `walkthrough_plan` step id); omitted, the NEWEST pair. Studio polls it, as Demo mode polls `DemoView`.
6670
+ */
6671
+ export interface WalkthroughView {
6672
+ runId: string;
6673
+ /** The `walkthrough_review` step id; `null` when the run has no walkthrough step. */
6674
+ stepId: string | null;
6675
+ /** The `walkthrough_plan` step that authored it; `null` when there is none. */
6676
+ planStepId: string | null;
6677
+ state: WalkthroughState;
6678
+ /** Why the state is what it is, when there is something to say (`no_walkthrough`, `no_evidence_root`,
6679
+ * the recorder's own causes such as `unjailed_host`, `fixture_unavailable`, `storyline_refused`). */
6680
+ cause: string | null;
6681
+ /** Evaluator ≠ creator: the seat that wrote the checks, and the seats that built what they check. */
6682
+ seat: { evaluator: string | null; builders: string[] };
6683
+ /** The tree id the recorder recorded (`git archive` of it is what ran). */
6684
+ tree: string | null;
6685
+ /** Always `false`: a later creator step re-inserts the pair after it (§4.8). Kept so an old plan shape reads honestly. */
6686
+ stale: false;
6687
+ /** The take's seal was found in the engine store and every re-check against the files on disk held (WT-W2). */
6688
+ sealed: boolean;
6689
+ /** Proof-root-relative paths of the stitched take; `null` until there is one. */
6690
+ video: { mp4: string | null; poster: string | null; markers: DemoMarker[] };
6691
+ chapters: WalkthroughChapter[];
6692
+ /** Per creator step, the check state from THIS pair's take — computed at every read from its re-verified seal (WT-W2). */
6693
+ steps: WalkthroughStepState[];
6694
+ }
6695
+
6696
+ /**
6697
+ * `GET /runs/:id/acceptance` → `walkthrough` (WT-W2, DES-walkthrough-proof §4.9; api-types 0.75.0):
6698
+ * the walkthrough half of the gate. One row per `walkthrough_review` step the run's requirement names,
6699
+ * each re-verified at this read — the seal (the last `WALKTHROUGH-SEAL` line of the recorder's
6700
+ * engine-captured output), `bundle_sha` recomputed from the proof root, and the proof root's stamped
6701
+ * ledger verdicts against the sealed chapter verdicts. The gate is deny-dominates across the repo
6702
+ * ledger and every row: a missing, mismatched ("changed after it was sealed") or non-PASS seal
6703
+ * denies. ABSENT when the requirement names no walkthrough step.
6704
+ */
6705
+ export interface RunAcceptanceWalkthrough {
6706
+ roots: Array<{ stepId: string; sealed: boolean; satisfied: boolean; reason: string }>;
6707
+ /** Every row's seal held. */
6708
+ sealed: boolean;
6709
+ /** Per creator step, from the NEWEST walkthrough of the run. */
6710
+ steps: WalkthroughStepState[];
6711
+ }
6712
+
6492
6713
  /** `POST /proposals/:id/reject` → 200. */
6493
6714
  export interface RejectProposalResponse {
6494
6715
  ok: true;
@@ -7075,6 +7296,248 @@ export interface TeamEventFrame {
7075
7296
  project_id?: string;
7076
7297
  }
7077
7298
 
7299
+ // ── The watch registry wire contract (DES-TRIGGER-REGISTRY-001 §4.5; TR-W4; api-types 0.70.0) ──
7300
+ //
7301
+ // The registry is advisory by construction: a watch row can never allow, approve or block. Its
7302
+ // facts are two bus types owned by crew (`wicked.crew.watch_finding.{raised,cleared}`), relayed
7303
+ // onto `/ws` as {@link WatchEventFrame} by a bus tap (never broadcast directly, so the socket and
7304
+ // the record cannot disagree). Types only: the runtime lands in TR-W5a, and a daemon without it
7305
+ // simply never sends these frames or serves these routes.
7306
+
7307
+ /** The two bus types the watch registry publishes. */
7308
+ export type WatchEventType = 'wicked.crew.watch_finding.raised' | 'wicked.crew.watch_finding.cleared';
7309
+
7310
+ /** How a watch row is meant: a contradiction in the work's own evidence, a look-worthy flag, or a candidate rule for the review queue. */
7311
+ export type WatchEmitAs = 'finding' | 'flag' | 'proposal';
7312
+ export type WatchSeverity = 'high' | 'medium' | 'info';
7313
+ /** The Watchtower's kind column. There is no `needs` kind: needs-you stays studio's own fold. */
7314
+ export type WatchKind = 'problem' | 'decision' | 'done' | 'quiet' | 'delivery';
7315
+ /** `p0` is never shed; `p1` is shed after `p2` when the push ring overflows. */
7316
+ export type WatchPriority = 'p0' | 'p1' | 'p2';
7317
+
7318
+ /** Where in the run a watch row points: "Jump in" scrolls to the nearest event at or after `at`. */
7319
+ export interface WatchAnchor {
7320
+ run_id: string;
7321
+ ord: number | null;
7322
+ attempt: number | null;
7323
+ /** Unix millis of the source event. */
7324
+ at: number;
7325
+ }
7326
+
7327
+ /** One piece of evidence a watch row cites. `run_event` names a persisted CoreEvent; `bus_row` a bus row. */
7328
+ export interface WatchEvidenceRef {
7329
+ kind: 'run_event' | 'bus_row' | (string & {});
7330
+ type: string;
7331
+ ord?: number | null;
7332
+ attempt?: number | null;
7333
+ /** For `bus_row`: the cited row's `event_id`. */
7334
+ event_id?: number;
7335
+ }
7336
+
7337
+ /**
7338
+ * The payload of `wicked.crew.watch_finding.raised`. Its first six fields are the team
7339
+ * envelope's (`DES-TEAMING-002` §4.4). `watch_id` is `"w-"` + the deterministic key over
7340
+ * (`run_id | "-"`, `entry_id`, `entry_version`, `subject`), so a replay or a redelivery resolves to
7341
+ * the same row.
7342
+ */
7343
+ export interface WatchFinding {
7344
+ /** `null` for a row no run owns (a registry-internal flag such as `registry-lagging`). */
7345
+ run_id: string | null;
7346
+ ord: number | null;
7347
+ attempt: number | null;
7348
+ /** `"watch:<entry_id>@<entry_version>"`. */
7349
+ by: string;
7350
+ /** Unix millis the row was produced. */
7351
+ at: number;
7352
+ /** What it answers: `"<CoreEvent type>#<ord>:<attempt>"`, or a bus source row's idempotency key. */
7353
+ re: string;
7354
+ watch_id: string;
7355
+ entry_id: string;
7356
+ entry_version: number;
7357
+ /** `"deterministic:<name>"` or `"llm:<prompt-ref>@<n>"`. */
7358
+ check: string;
7359
+ kind: WatchEmitAs;
7360
+ severity: WatchSeverity;
7361
+ watch_kind: WatchKind;
7362
+ /** `"gate"`: render as one line on the open gate's existing row, never a new row. */
7363
+ attach: 'gate' | null;
7364
+ /** The run's project membership, as the relay tags frames; absent when the run is unfiled. */
7365
+ project_id?: string;
7366
+ /** The one plain sentence the Watchtower shows. */
7367
+ sentence: string;
7368
+ /** Entry-specific facts, at most 4 KB, redacted. */
7369
+ facts: Record<string, unknown>;
7370
+ anchor: WatchAnchor | null;
7371
+ evidence: WatchEvidenceRef[];
7372
+ /** Set for an `llm:*` check only. */
7373
+ model: { seat: string; model: string; latency_ms: number } | null;
7374
+ /** How many later rows this roll-up stands for (`0` on an ordinary row). */
7375
+ rolled_up: number;
7376
+ }
7377
+
7378
+ /** The fields every `wicked.crew.watch_finding.cleared` payload carries. */
7379
+ export interface WatchFindingClearedBase {
7380
+ run_id: string | null;
7381
+ ord: number | null;
7382
+ attempt: number | null;
7383
+ by: string;
7384
+ at: number;
7385
+ re: string;
7386
+ /** The raised row this clears. */
7387
+ watch_id: string;
7388
+ entry_id: string;
7389
+ entry_version: number;
7390
+ project_id?: string;
7391
+ }
7392
+
7393
+ /**
7394
+ * The payload of `wicked.crew.watch_finding.cleared`, discriminated on `reason`: the raised row
7395
+ * `watch_id` names is resolved (a later attempt passed, the worker produced output), dismissed by
7396
+ * the operator ("Seen, not a problem": `dismissed_by` says who), or replaced by a roll-up
7397
+ * (`replaced_by` names it). The set is closed on purpose: no clearing reason is allow-like.
7398
+ */
7399
+ export type WatchFindingCleared =
7400
+ | (WatchFindingClearedBase & { reason: 'resolved' })
7401
+ | (WatchFindingClearedBase & { reason: 'dismissed'; dismissed_by: string })
7402
+ | (WatchFindingClearedBase & { reason: 'rolled_up'; replaced_by: string });
7403
+
7404
+ export interface WatchEventPayloads {
7405
+ 'wicked.crew.watch_finding.raised': WatchFinding;
7406
+ 'wicked.crew.watch_finding.cleared': WatchFindingCleared;
7407
+ }
7408
+
7409
+ /** One watch bus row, discriminated on `event_type`. */
7410
+ export type WatchBusEvent = {
7411
+ [K in WatchEventType]: { event_type: K; payload: WatchEventPayloads[K] };
7412
+ }[WatchEventType];
7413
+
7414
+ /**
7415
+ * A `/ws` frame carrying one `wicked.crew.watch_finding.*` bus row, relayed verbatim (the
7416
+ * {@link TeamEventFrame} pattern). `project_id` is set when the run's membership files it.
7417
+ */
7418
+ export interface WatchEventFrame {
7419
+ type: 'watchEvent';
7420
+ /** The whole bus row as wicked-bus delivers it. */
7421
+ event: WatchBusEvent & { event_id: number; [k: string]: unknown };
7422
+ project_id?: string;
7423
+ }
7424
+
7425
+ /**
7426
+ * What one check can see on one run. Studio never renders an empty list as "all clear" when an entry
7427
+ * was `not_checked`; a `not_checked` entry always says why, in plain words ("no declared scope", "the
7428
+ * daemon was down").
7429
+ */
7430
+ export type WatchCoverage =
7431
+ | { entry_id: string; state: 'checked' }
7432
+ | { entry_id: string; state: 'not_checked'; reason: string };
7433
+
7434
+ /** `GET /watch?project=&kind=&run=&since=&limit=`: the feed fold, newest first. */
7435
+ export interface WatchFeedResponse {
7436
+ findings: WatchFinding[];
7437
+ /**
7438
+ * The clearing rows of the findings on this page (a late join folds them as the live
7439
+ * `watch_finding.cleared` frames would: Fixed, Dismissed, rolled up). api-types 0.73.0.
7440
+ */
7441
+ cleared?: WatchFindingCleared[];
7442
+ /** Present with `run=` only. */
7443
+ coverage?: WatchCoverage[];
7444
+ }
7445
+
7446
+ /**
7447
+ * Where an entry's key point comes from. `core`: a CoreEvent from the daemon fan-in. `bus`: a pulled
7448
+ * 4-segment bus type. `watchdog`: a stall-watchdog frame (`workerStalled`, …). `internal`: the
7449
+ * registry's own tick or check-failure report (`registry-lagging`, `registry-check-failed`).
7450
+ * (api-types 0.73.0 adds `watchdog` and `internal`.)
7451
+ */
7452
+ export type WatchEntrySource = 'core' | 'bus' | 'watchdog' | 'internal';
7453
+
7454
+ /** Who changed one operator setting of an entry, and when (stamped by the daemon, never the caller). */
7455
+ export interface WatchSettingStamp {
7456
+ by: string;
7457
+ /** Unix millis. */
7458
+ at: number;
7459
+ }
7460
+
7461
+ /** One entry's operator override in `SystemSettings.watch.entries`. */
7462
+ export interface WatchEntryOverride {
7463
+ enabled?: boolean;
7464
+ /** Merged over the shipped threshold, validated by the entry's check. */
7465
+ threshold?: Record<string, unknown>;
7466
+ /** Daemon-stamped; a caller cannot set these. */
7467
+ enabled_changed?: WatchSettingStamp;
7468
+ threshold_changed?: WatchSettingStamp;
7469
+ }
7470
+
7471
+ /** `SystemSettings.watch`. */
7472
+ export interface WatchSettings {
7473
+ entries?: Record<string, WatchEntryOverride>;
7474
+ /** The LLM lane (off by default; TR-W9). */
7475
+ llm?: boolean;
7476
+ }
7477
+
7478
+ /**
7479
+ * One registry entry (`packages/crew/watch/entries/<id>.json`), as `GET /watch/entries` serves it:
7480
+ * the effective entry (the operator's `enabled` / `threshold` override applied) plus its threshold
7481
+ * in plain words. The schema has no allow-like `emit.as` value.
7482
+ */
7483
+ export interface WatchEntry {
7484
+ /** Stable, `[a-z0-9-]{3,48}`; equals the file name. */
7485
+ id: string;
7486
+ /** Bumped on any semantic change; part of every finding key. */
7487
+ version: number;
7488
+ /** See {@link WatchEntrySource}. A `bus` type is a 4-segment `wicked.<domain>.<noun>.<verb>` type. */
7489
+ on: { source: WatchEntrySource; type: string };
7490
+ /** JSON-path equality, AND of keys; an array means "any of". */
7491
+ filter: Record<string, unknown>;
7492
+ check: string;
7493
+ params: Record<string, unknown>;
7494
+ threshold: Record<string, unknown>;
7495
+ emit: {
7496
+ as: WatchEmitAs;
7497
+ severity: WatchSeverity;
7498
+ watch_kind: WatchKind;
7499
+ attach: 'gate' | null;
7500
+ /** Past `per_run`, one roll-up replaces the rest. */
7501
+ rate: { per_run: number };
7502
+ };
7503
+ priority: WatchPriority;
7504
+ enabled: boolean;
7505
+ /** The threshold in plain words, for "When Studio speaks up". Always set on `GET /watch/entries`. */
7506
+ threshold_text: string;
7507
+ }
7508
+
7509
+ /** Who changed an operator-adjustable entry setting, and when (read from the `settings.updated` audit entry). */
7510
+ export interface WatchEntryChange {
7511
+ id: string;
7512
+ by: string;
7513
+ /** Unix millis. */
7514
+ at: number;
7515
+ }
7516
+
7517
+ /** `GET /watch/health`. Every turned-off entry and every changed threshold is listed with who and when. */
7518
+ export interface WatchHealth {
7519
+ /** The registry is running. `false` ⇒ `reason` says why. */
7520
+ armed: boolean;
7521
+ reason: string | null;
7522
+ sources: {
7523
+ bus: 'ok' | 'lagging' | 'down' | (string & {});
7524
+ core: 'ok' | 'lagging' | 'down' | (string & {});
7525
+ watchdog: 'ok' | 'lagging' | 'down' | (string & {});
7526
+ };
7527
+ queue: { depth: number; hwm: number; shed_by_priority: Record<WatchPriority, number> };
7528
+ tail_lag_ms: number;
7529
+ emit: { failed: number };
7530
+ entries: {
7531
+ loaded: number;
7532
+ refused: Array<{ id: string; reason: string }>;
7533
+ off: WatchEntryChange[];
7534
+ thresholds_changed: WatchEntryChange[];
7535
+ };
7536
+ llm: { enabled: boolean; inflight: number; timeouts: number; skipped_no_seat: number };
7537
+ /** `core_gap: true`: runs that started and ended while the daemon was down were not evaluated this boot. */
7538
+ replay?: { core_gap: boolean };
7539
+ }
7540
+
7078
7541
  /** One `wicked.team.*` bus row as `GET /runs/:id/team` returns it. */
7079
7542
  export type TeamRow = TeamBusEvent & {
7080
7543
  event_id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.69.0",
3
+ "version": "0.77.0",
4
4
  "description": "The wire contract of the wicked-crew daemon's /api/v1 REST surface and /ws CoreEvent frames \u2014 types only, zero runtime",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",