wicked-crew-api-types 0.147.0 → 0.149.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 +529 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -29,7 +29,12 @@
29
29
  // ── Identity / actor contract (task #88, locked decision #6) ───────────────────
30
30
 
31
31
  /** What kind of principal an actor is: a person (OAuth/OIDC or local operator), a workload, or an internal process. */
32
- export type ActorKind = 'human' | 'agent' | 'system';
32
+ /**
33
+ * Who acted. `plugin` (program DES-PLUGIN-EVENTS §3.4; spike 3): a studio plugin acting as itself, id
34
+ * `plugin:<id>@<version>`. Its trust is never above `observer` (read-only), and its only write is to its own section of
35
+ * a run's working document — never as a person, and never a gate, a launch or a steer.
36
+ */
37
+ export type ActorKind = 'human' | 'agent' | 'system' | 'plugin';
33
38
 
34
39
  /**
35
40
  * The minimal trust ladder: `admin` > `operator` > `observer`.
@@ -336,6 +341,489 @@ export interface HealthCapabilities {
336
341
  * `false`: hide the schedules view.
337
342
  */
338
343
  schedules?: boolean;
344
+ /**
345
+ * (api-types 0.148.0, power mode spike 3) A run's working document is served: `GET|POST /runs/:id/working-doc`
346
+ * and `POST /runs/:id/working-doc/versions` ({@link WorkingDocView}). ABSENT on an older daemon — read as `false`.
347
+ */
348
+ workingDoc?: boolean;
349
+ /**
350
+ * (api-types 0.149.0, power mode) The engine runs POWER MODE: `LaunchRunBody.power`, `GET|POST /runs/:id/power`,
351
+ * `POST /runs/:id/rigor`, `POST /runs/:id/power/pause`, `GET /runs/:id/bus` ({@link RunBusPage}),
352
+ * `AgentSession.power` ({@link PowerState}) and the power frames ({@link PowerEvent}).
353
+ * ABSENT on an older daemon: read as `false` and hide the switch.
354
+ */
355
+ powerMode?: boolean | undefined;
356
+ }
357
+
358
+ // ── A run's working document (program DES-POWER-MODE §8.3, §9; api-types 0.148.0) ──────────────────
359
+
360
+ /** The working document's sections, in order. */
361
+ export type WorkingDocSectionId = 'goal' | 'approach' | 'decisions' | 'constraints' | 'questions' | 'next';
362
+
363
+ /** Who wrote a version: a person (the operator), a plugin's own generated lines, or crew (the first version). */
364
+ export type WorkingDocAuthor =
365
+ | { kind: 'human'; id: string }
366
+ | { kind: 'plugin'; id: string }
367
+ | { kind: 'system'; id: 'crew' };
368
+
369
+ /** One version of the working document, as crew attributed it. */
370
+ export interface WorkingDocTrailEntry {
371
+ version: number;
372
+ parent: number | null;
373
+ author: WorkingDocAuthor;
374
+ /** The plugin that hosted a person's edit (`plugin:<id>@<version>`), or null. */
375
+ surface: string | null;
376
+ sections: WorkingDocSectionId[];
377
+ /** Unix millis. */
378
+ at: number;
379
+ /** The steering note this version made, or null (a plugin's lines and Decisions / Open questions never steer). */
380
+ steerId: string | null;
381
+ }
382
+
383
+ /** One steering note a person's version became. It rides the next step's prompt (the operator inject); it never
384
+ * answers, skips or changes a gate, check, review or QE step. */
385
+ export interface WorkingDocSteer {
386
+ id: string;
387
+ version: number;
388
+ sections: WorkingDocSectionId[];
389
+ /** `next`: the next step, once. `standing`: Constraints and steering, re-sent before every later step until a
390
+ * later edit replaces it. */
391
+ kind: 'next' | 'standing';
392
+ /** Exactly what was sent. */
393
+ note: string;
394
+ at: number;
395
+ by: string;
396
+ /** When the engine took it (queued for the next step), or null. */
397
+ queuedAt: number | null;
398
+ /** The step whose prompt carried it. */
399
+ pickedUp: { ord: number | null; step: string | null; at: number } | null;
400
+ /** Why it was not sent (the job had ended, the engine refused), or null. */
401
+ error: string | null;
402
+ supersededBy?: string | null;
403
+ renewals?: number;
404
+ }
405
+
406
+ /** `GET /runs/:id/working-doc` (and the body of `POST /runs/:id/working-doc`). */
407
+ export interface WorkingDocView {
408
+ runId: string;
409
+ /** Null until the run has one. The document is a wicked-interactive document of kind `phase-report`. */
410
+ doc: { projectId: string; docId: string; head: number } | null;
411
+ sections: Record<WorkingDocSectionId, string> | null;
412
+ labels: Record<WorkingDocSectionId, string>;
413
+ trail: WorkingDocTrailEntry[];
414
+ steers: WorkingDocSteer[];
415
+ }
416
+
417
+ /** `POST /runs/:id/working-doc/versions`. `author: 'operator'` only from a person; `author: 'plugin'` writes only the
418
+ * plugin's own section (`decisions`). 409 `{head}` when the document moved since `base`. */
419
+ export interface ProposeWorkingDocRequest {
420
+ base: number;
421
+ sections: Partial<Record<WorkingDocSectionId, string>>;
422
+ author: 'operator' | 'plugin';
423
+ plugin?: { id: string; version: string };
424
+ }
425
+
426
+ export interface ProposeWorkingDocResponse {
427
+ /** Null when nothing changed. */
428
+ version: number | null;
429
+ unchanged: boolean;
430
+ steer: WorkingDocSteer | null;
431
+ view: WorkingDocView;
432
+ }
433
+
434
+ /** `/ws` frame: a run's working document changed (a version, a steer, a pickup). Re-read `GET /runs/:id/working-doc`. */
435
+ export interface WorkingDocChangedEvent {
436
+ type: 'workingDocChanged';
437
+ session: string;
438
+ head: number | null;
439
+ }
440
+
441
+ // ── Power mode (program DES-POWER-MODE; api-types 0.149.0) ──────────────────────────────────────────
442
+ //
443
+ // One orchestrator seat session builds the whole change in many turns; rigor is sized at intake, re-scored at
444
+ // checkpoints from the actual diff, and applied once at hand-off. The ENGINE computes every rigor value: nothing on a
445
+ // request or a plugin can lower it. Field names are camelCase on every surface (session, route, frame, bus row).
446
+
447
+ /** The operator's word for the engine's floor band (core `review_scale` bands): light 0-19, standard 20-39,
448
+ * high 40-69, highest 70-100 (or destructive). */
449
+ export type Rigor = 'light' | 'standard' | 'high' | 'highest';
450
+
451
+ /** What re-scored the run. `intake` is the QE plan; `commit` / `turn` / `timer` / `pre_handoff` are checkpoints;
452
+ * `operator` / `plugin` / `doc_edit` are raises; `toggle` records a power switch flip. */
453
+ export type RigorTrigger =
454
+ | 'intake' | 'commit' | 'turn' | 'timer' | 'pre_handoff'
455
+ | 'operator' | 'plugin' | 'doc_edit' | 'toggle';
456
+
457
+ /** A level rigor can never go below, and who set it. */
458
+ export interface RigorFloor {
459
+ rigor: Rigor;
460
+ /** `policy` (the assurance contract / required phases), `compliance` (a steering rule), `qe_plan`, `operator`,
461
+ * `plugin`, `doc_edit`. */
462
+ by: 'policy' | 'compliance' | 'qe_plan' | 'operator' | 'plugin' | 'doc_edit';
463
+ why: string;
464
+ }
465
+
466
+ /** What hand-off will apply, as the current rigor sizes it. */
467
+ export interface HandoffRequirements {
468
+ /** `targeted`: the floor runs the change's targeted tests; `full`: the repo's full suite. */
469
+ tests: 'targeted' | 'full';
470
+ /** Reviews on a seat distinct from the orchestrator (never the builder, nor its subagents). `design` is not a
471
+ * separate step: the `review` step ({@link HandoffStep}) also judges the orchestrator's approach and counts as the
472
+ * band's `design` phase (operator ruling 2026-10-29); it is listed so the card can say so. */
473
+ reviews: Array<{ kind: 'distinct_seat' | 'design' | 'security'; why: string }>;
474
+ qeAcceptance: { required: boolean; why: string };
475
+ /** Named checks beyond the repo's floor (QE plan / plugin added), in order. */
476
+ checks: string[];
477
+ }
478
+
479
+ /** The intake QE plan's rigor record (`wicked.run.intake.planned`). The band is the engine's intent score of the
480
+ * declared scope; the QE plan (garden qe-risk-assessor + qe-test-strategist) can only RAISE it. */
481
+ export interface RigorPlan {
482
+ rigor: Rigor;
483
+ /** The engine's 0-100 intent score and its band (`"20-39"`). */
484
+ score: number;
485
+ band: string;
486
+ highRisk: boolean;
487
+ /** Plain reasons for the band (the scorer's, then the QE plan's). */
488
+ reasons: string[];
489
+ handoff: HandoffRequirements;
490
+ /** Phases that stay phased even in power mode (policy, a steering rule, or the QE plan), with why. */
491
+ mandatoryPhases: Array<{ phase: string; why: string }>;
492
+ /** Non-null when power mode is refused for this run (policy or the plan requires phased), in one line. */
493
+ phasedRequired: string | null;
494
+ /** The QE plan's time estimate for the build, minutes; null when it gave none. */
495
+ estimateMinutes: number | null;
496
+ /** The QE plan's risks and planned test scenarios (pass 1), plain lines. */
497
+ risks: string[];
498
+ scenarios: string[];
499
+ /** What rigor can never go below. */
500
+ floors: RigorFloor[];
501
+ /** The seat that planned (the intake unit's seat), and when (unix millis). */
502
+ plannedBy: string;
503
+ at: number;
504
+ }
505
+
506
+ /** The signals one checkpoint read from the actual diff. */
507
+ export interface RigorSignals {
508
+ files: number;
509
+ lines: number;
510
+ /** Graph dependents within the scorer's hops; null when the graph could not be read. */
511
+ dependents: number | null;
512
+ /** Products (top-level areas) the diff spans. */
513
+ spread: number;
514
+ newDependencies: number;
515
+ /** Sensitive areas touched: critical-path markers and steering-rule areas, plain words. */
516
+ sensitive: string[];
517
+ struggle: {
518
+ failedRuns: number;
519
+ reverts: number;
520
+ turns: number;
521
+ elapsedMinutes: number;
522
+ estimateMinutes: number | null;
523
+ /** 0-100; at or over the struggle line pauses the session. */
524
+ score: number;
525
+ };
526
+ /** Planned scenarios with no test yet, or new surfaces the plan did not cover. */
527
+ planGaps: string[];
528
+ }
529
+
530
+ /** One rigor-history row (`wicked.run.rigor.rescored`), written EVERY time the run is re-scored, raised, lowered or
531
+ * toggled — also when nothing changed (`direction: 'same'`). */
532
+ export interface RigorChange {
533
+ /** 1-based, per run. */
534
+ seq: number;
535
+ at: number;
536
+ trigger: RigorTrigger;
537
+ /** Rigor before and after. The `intake` row has `from === to` (the planned rigor). Null only on a `toggle` row
538
+ * written before intake planned anything. */
539
+ from: Rigor | null;
540
+ to: Rigor | null;
541
+ direction: 'up' | 'down' | 'same';
542
+ /** The intake score, the score now, and `actual - planned`. */
543
+ planned: number;
544
+ actual: number;
545
+ delta: number;
546
+ reasons: string[];
547
+ signals: RigorSignals | null;
548
+ /** `engine`, a person's actor id, or `plugin:<id>@<version>`. */
549
+ by: string;
550
+ /** What held rigor up when a lowering was capped (empty otherwise). */
551
+ floors: RigorFloor[];
552
+ /** The checkpoint ordinal (1-based) and the orchestrator turn, when a checkpoint wrote it. */
553
+ checkpoint: number | null;
554
+ turn: number | null;
555
+ /** This checkpoint paused the session ("suddenly complex"); see {@link PowerPause}. */
556
+ paused: boolean;
557
+ }
558
+
559
+ /** One flip of the power switch. */
560
+ export interface PowerToggle {
561
+ at: number;
562
+ on: boolean;
563
+ by: string;
564
+ reason: string | null;
565
+ /** The phases that stay phased after an Off -> On flip (the plan mandates them). */
566
+ stayPhased: string[];
567
+ }
568
+
569
+ /** The session is paused at a checkpoint: a two-band jump, a destructive marker, spread into another product, a new
570
+ * dependency in a sensitive area, or struggle past its line. The orchestrator waits at its turn end (the run stays
571
+ * `executing`; no engine gate opens under an in-flight unit) until `POST /runs/:id/power/pause`
572
+ * ({@link PowerPauseRequest}) answers. */
573
+ export interface PowerPause {
574
+ at: number;
575
+ checkpoint: number;
576
+ reasons: string[];
577
+ /** `split` is recommended when the diff spans two or more products. */
578
+ recommended: 'split' | 'switch_phased' | 'continue_high' | 'stop';
579
+ }
580
+
581
+ /** One hand-off step as it ran. */
582
+ export interface HandoffStep {
583
+ step: 'rescore' | 'checks' | 'review' | 'security' | 'qe' | 'compliance';
584
+ /** The hand-off round this row belongs to (1-based): a failed round's rows stay, the next round adds its own. */
585
+ round: number;
586
+ ord: number | null;
587
+ status: 'pending' | 'running' | 'passed' | 'failed' | 'skipped';
588
+ /** The seat that ran it (never the orchestrator for a review / QE). */
589
+ seat: string | null;
590
+ summary: string | null;
591
+ at: number;
592
+ }
593
+
594
+ /** A run's power-mode state: `AgentSession.power`, and the body of `GET /runs/:id/power`. */
595
+ export interface PowerState {
596
+ /** The switch, now. */
597
+ on: boolean;
598
+ /** False when policy or the plan requires phased; {@link refusedReason} says why. */
599
+ available: boolean;
600
+ refusedReason: string | null;
601
+ /** Current rigor (null before intake has planned). */
602
+ rigor: Rigor | null;
603
+ plan: RigorPlan | null;
604
+ history: RigorChange[];
605
+ toggles: PowerToggle[];
606
+ /** The orchestrator seat session: its seat, the build unit, turns so far, and whether it is in a turn now. */
607
+ orchestrator: { cli: string | null; ord: number | null; turns: number; inTurn: boolean; sessionRestarts: number };
608
+ /** Every orchestrator turn so far, oldest first (at most the last 50). */
609
+ turnLog: PowerTurnRecord[];
610
+ checkpoints: number;
611
+ /** The hand-off as it runs: round 1 is the first hand-off; a failure goes back to the SAME session as a new turn
612
+ * and starts the next round. After `maxRounds` the run asks the operator. */
613
+ handoff: { round: number; maxRounds: number; steps: HandoffStep[] } | null;
614
+ pause: PowerPause | null;
615
+ /** The insights row for planned vs actual (written when the run ends). */
616
+ outcome: PowerOutcome | null;
617
+ /** Floors set after launch (an operator's raise), kept whether or not intake planned anything; the intake plan's own
618
+ * are on `plan.floors`. Rigor never goes below any of them. */
619
+ floors: RigorFloor[];
620
+ }
621
+
622
+ /** One orchestrator turn as recorded. */
623
+ export interface PowerTurnRecord {
624
+ turn: number;
625
+ attempt: number;
626
+ cli: string;
627
+ startedAt: number;
628
+ endedAt: number | null;
629
+ outcome: 'checkpoint' | 'handoff' | 'paused' | 'failed' | 'cap' | null;
630
+ summary: string | null;
631
+ }
632
+
633
+ /** Planned vs actual, recorded when a power run ends (the insights calibration input). */
634
+ export interface PowerOutcome {
635
+ plannedRigor: Rigor;
636
+ finalRigor: Rigor;
637
+ plannedScore: number;
638
+ finalScore: number;
639
+ estimateMinutes: number | null;
640
+ actualMinutes: number;
641
+ turns: number;
642
+ checkpoints: number;
643
+ handoffRounds: number;
644
+ operatorGates: number;
645
+ outcome: 'delivered' | 'completed' | 'failed' | 'cancelled';
646
+ }
647
+
648
+ /** `GET /runs/:id/power` (404 for an unknown run; a run launched phased answers `on: false`). */
649
+ export interface PowerView extends PowerState {
650
+ runId: string;
651
+ }
652
+
653
+ /** `POST /runs/:id/power`: flip the switch; 200 answers {@link PowerView}. On -> Off is always allowed (adds rigor;
654
+ * the remaining work goes phased). Off -> On is allowed only for phases the plan does not mandate; a phased-required
655
+ * run answers 409 {@link PowerConflict}. Human actors only; audited `run.power_mode.toggled`. */
656
+ export interface PowerToggleRequest {
657
+ on: boolean;
658
+ reason?: string | null | undefined;
659
+ }
660
+
661
+ /** `POST /runs/:id/rigor`: raise rigor; 200 answers {@link PowerView}. Never lowers: a lower or equal `atLeast` is
662
+ * 409 {@link PowerConflict}. The raise becomes a floor. Human actors only; audited `run.rigor.raised`. */
663
+ export interface RigorRaiseRequest {
664
+ atLeast: Rigor;
665
+ reason: string;
666
+ }
667
+
668
+ /** `POST /runs/:id/power/pause`: answer a checkpoint pause ({@link PowerPause}); 200 answers {@link PowerView}.
669
+ * `continue_high` raises rigor to at least high (an operator floor), `continue` goes on (the `note`, if any, is the
670
+ * next turn's steer), `switch_phased` flips the switch off (the build hands off as it stands), `stop` cancels the
671
+ * run. 409 {@link PowerConflict} when the run is not paused. Human actors only; audited `run.power_mode.paused`. */
672
+ export interface PowerPauseRequest {
673
+ decision: 'continue_high' | 'continue' | 'switch_phased' | 'stop';
674
+ note?: string | null | undefined;
675
+ }
676
+
677
+ /** The 409 (and 422) body of the power routes. */
678
+ export interface PowerConflict {
679
+ error: string;
680
+ reason: string;
681
+ }
682
+
683
+ /** `/ws` frame: intake planned the run's rigor (bus `wicked.run.intake.planned`). */
684
+ export type PowerIntakePlannedEvent = {
685
+ type: 'powerIntakePlanned';
686
+ session: string;
687
+ ord: number;
688
+ plan: RigorPlan;
689
+ };
690
+
691
+ /** `/ws` frame: the run was re-scored, raised, lowered or toggled (bus `wicked.run.rigor.rescored`). */
692
+ export type RigorRescoredEvent = {
693
+ type: 'rigorRescored';
694
+ session: string;
695
+ change: RigorChange;
696
+ };
697
+
698
+ /** `/ws` frame: a checkpoint ran (bus `wicked.run.checkpoint.reached`). `picked` = the operator messages and doc
699
+ * steers the next turn's prompt carries. */
700
+ export type PowerCheckpointEvent = {
701
+ type: 'powerCheckpointReached';
702
+ session: string;
703
+ ord: number;
704
+ checkpoint: number;
705
+ turn: number;
706
+ trigger: 'commit' | 'turn' | 'timer' | 'pre_handoff';
707
+ /** The worktree HEAD at the checkpoint (short sha), null before the first commit. */
708
+ head: string | null;
709
+ picked: number;
710
+ rigor: Rigor;
711
+ paused: boolean;
712
+ /** The pause this checkpoint opened (also on `PowerState.pause`), else null. */
713
+ pause: PowerPause | null;
714
+ at: number;
715
+ };
716
+
717
+ /** `/ws` frame: an orchestrator turn started (bus `wicked.run.turn.started`). */
718
+ export type PowerTurnStartedEvent = {
719
+ type: 'powerTurnStarted';
720
+ session: string;
721
+ ord: number;
722
+ attempt: number;
723
+ turn: number;
724
+ cli: string;
725
+ };
726
+
727
+ /** `/ws` frame: an orchestrator turn ended (bus `wicked.run.turn.completed`). `outcome`: `checkpoint` (more turns
728
+ * follow), `handoff` (the orchestrator declared hand-off), `paused`, `failed`, `cap` (the turn cap; handed off). */
729
+ export type PowerTurnCompletedEvent = {
730
+ type: 'powerTurnCompleted';
731
+ session: string;
732
+ ord: number;
733
+ attempt: number;
734
+ turn: number;
735
+ cli: string;
736
+ outcome: 'checkpoint' | 'handoff' | 'paused' | 'failed' | 'cap';
737
+ /** The orchestrator's one-line summary, or null. */
738
+ summary: string | null;
739
+ };
740
+
741
+ export type PowerTurnEvent = PowerTurnStartedEvent | PowerTurnCompletedEvent;
742
+
743
+ /** `/ws` frame: a hand-off step changed (bus `wicked.run.handoff.stepped`). */
744
+ export type PowerHandoffEvent = {
745
+ type: 'powerHandoffStepped';
746
+ session: string;
747
+ round: number;
748
+ maxRounds: number;
749
+ step: HandoffStep;
750
+ };
751
+
752
+ /** `/ws` frame: the power switch flipped (bus `wicked.run.power.toggled`). */
753
+ export type PowerToggledEvent = {
754
+ type: 'powerToggled';
755
+ session: string;
756
+ toggle: PowerToggle;
757
+ };
758
+
759
+ /** `/ws` frame: what the orchestrator did in the worktree, read off git by the engine (bus
760
+ * `wicked.run.activity.recorded`). Polled about once a minute during a turn and at its end, so rows arrive in
761
+ * batches, not keystroke by keystroke. `edit`: a file whose +/- against the run's base changed since the last look
762
+ * (`path`, `added`, `removed`: the file's totals against the base, not the delta). `commit`: a new commit (`sha`
763
+ * short, `subject`, `added`, `removed` of that commit). Test runs are NOT reported (the headless carrier records
764
+ * no exit codes); the hand-off's `checks` step and `repoChecksEvaluated` carry the test results. */
765
+ export type PowerActivityEvent = {
766
+ type: 'powerActivity';
767
+ session: string;
768
+ ord: number;
769
+ turn: number;
770
+ at: number;
771
+ kind: 'edit' | 'commit';
772
+ path: string | null;
773
+ added: number | null;
774
+ removed: number | null;
775
+ sha: string | null;
776
+ subject: string | null;
777
+ };
778
+
779
+ export type PowerEvent =
780
+ | PowerActivityEvent
781
+ | PowerIntakePlannedEvent
782
+ | RigorRescoredEvent
783
+ | PowerCheckpointEvent
784
+ | PowerTurnEvent
785
+ | PowerHandoffEvent
786
+ | PowerToggledEvent;
787
+
788
+ /** The engine's bus mirror of the power frames (and the first `wicked.run.*` lifecycle set, DES-PLUGIN-EVENTS §3.1),
789
+ * 4-segment `wicked.<domain>.<noun>.<verb>`, `domain=wicked-core`. */
790
+ export type RunBusType =
791
+ | 'wicked.run.intake.planned'
792
+ | 'wicked.run.rigor.rescored'
793
+ | 'wicked.run.checkpoint.reached'
794
+ | 'wicked.run.turn.started'
795
+ | 'wicked.run.turn.completed'
796
+ | 'wicked.run.handoff.stepped'
797
+ | 'wicked.run.power.toggled'
798
+ | 'wicked.run.activity.recorded'
799
+ | 'wicked.run.unit.started'
800
+ | 'wicked.run.unit.finished'
801
+ | 'wicked.run.checks.evaluated'
802
+ | 'wicked.run.human.awaited'
803
+ | 'wicked.run.qe.decided'
804
+ | 'wicked.run.steer.queued'
805
+ | 'wicked.run.steer.delivered';
806
+
807
+ /** One mirrored row as a plugin feed or `GET /runs/:id/bus` serves it. `eventId` is the bus row id (ordered,
808
+ * at-least-once: dedupe on it). `seq` is the durable run log's `seq` of the event the row mirrors: a correlation and
809
+ * ordering value, strictly increasing within a run but WITH GAPS (the log counter is process-wide and most events
810
+ * are not mirrored) — never a continuity check. `payload` is the matching `/ws` frame without `type` and `session`
811
+ * (bulky `output` / `log` fields dropped), plus `runId`, `seq` and `at`. */
812
+ export interface RunBusRow {
813
+ eventId: number;
814
+ seq: number;
815
+ type: RunBusType;
816
+ runId: string;
817
+ at: number;
818
+ payload: Record<string, unknown>;
819
+ }
820
+
821
+ /** `GET /runs/:id/bus?after=<eventId>&limit=<n>`: the run's mirrored rows after a cursor, oldest first. `cursor` is
822
+ * the last row's `eventId` (pass it back as `after`); `rows` is empty and `cursor === after` when there are none.
823
+ * 503 when the daemon has no bus. */
824
+ export interface RunBusPage {
825
+ rows: RunBusRow[];
826
+ cursor: number;
339
827
  }
340
828
 
341
829
  /** One `GET /health.warnings[]` entry (additive; wicked-core#411 / wicked-crew#497). */
@@ -353,6 +841,11 @@ export interface AgentSession {
353
841
  id: string;
354
842
  workflow_id: string;
355
843
  problem: string;
844
+ /**
845
+ * (api-types 0.149.0) The run's power-mode state ({@link PowerState}); ABSENT or `null` on a run launched phased
846
+ * before power mode existed, or on an older engine. camelCase inside, unlike the session's own fields.
847
+ */
848
+ power?: PowerState | null | undefined;
356
849
  /**
357
850
  * (api-types 0.113.0; operator ruling 2026-10-12) The run's SHORT JOB TITLE, derived by the daemon
358
851
  * at DTO assembly on `GET /runs` and `GET /runs/:id` from {@link problem} — deterministic, at most
@@ -1902,6 +2395,12 @@ export interface LaunchPlan {
1902
2395
  */
1903
2396
  export interface ReassignRequest {
1904
2397
  cli?: string;
2398
+ /**
2399
+ * An operator note that rides the retry as the gate approve's amendment (crew#1153). Only a run
2400
+ * parked at a gate takes one — on an executing run a note is a 400. Trimmed; blank counts as
2401
+ * absent; over 8192 UTF-8 bytes is a 400.
2402
+ */
2403
+ note?: string;
1905
2404
  }
1906
2405
 
1907
2406
  /**
@@ -5044,6 +5543,15 @@ export interface GovernanceClaim {
5044
5543
  /** The launch-run request body (`POST /runs`). */
5045
5544
  export interface LaunchRunBody {
5046
5545
  problem: string;
5546
+ /**
5547
+ * (api-types 0.149.0) Run in POWER MODE: one orchestrator session (the `primary` seat, Claude Code by default)
5548
+ * builds the change in many turns, rigor is sized by an intake QE plan and applied at hand-off, and the only human
5549
+ * gate is deliver (plus what policy requires). ABSENT: the daemon's Settings default
5550
+ * ({@link SystemSettings.powerModeDefault}, on when unset). `false` launches phased. Ignored (phased) when the
5551
+ * engine lacks it (`capabilities.powerMode` false). A power launch runs without plan approval (`humanConfirm`
5552
+ * is forced to `none`); a high-risk plan still holds at its gate (policy).
5553
+ */
5554
+ power?: boolean | undefined;
5047
5555
  sessionId?: string;
5048
5556
  clisJson?: string;
5049
5557
  /**
@@ -5283,6 +5791,10 @@ export interface LaunchRunResponse {
5283
5791
  /** (crew ≥ 0.9.0; wicked-core#850) PRESENT when a full-assurance launch's usable seats are all one
5284
5792
  * CLI: the run will wait at a gate for a distinct seat. ABSENT otherwise. */
5285
5793
  assuranceNotice?: LaunchAssuranceNotice;
5794
+ /** (api-types 0.149.0) PRESENT (`true`) when the run launched in power mode; absent means phased. */
5795
+ power?: boolean | undefined;
5796
+ /** (api-types 0.149.0) Power mode was wanted (the launch or the setting) but the run is phased: why, in one line. */
5797
+ powerNotice?: string | undefined;
5286
5798
  }
5287
5799
 
5288
5800
  /**
@@ -5733,6 +6245,11 @@ export interface GitContributor {
5733
6245
  export interface SystemSettings {
5734
6246
  /** Max nodes returned by wicked-estate graph-view (default 150). */
5735
6247
  graphNodeLimit: number;
6248
+ /**
6249
+ * (api-types 0.149.0) "Power mode for new jobs": the default of `LaunchRunBody.power` when a launch omits it.
6250
+ * ABSENT = `true` (the shipped default is on). Human actors only.
6251
+ */
6252
+ powerModeDefault?: boolean | undefined;
5736
6253
  /**
5737
6254
  * The watch registry's operator settings (TR-W5a, api-types 0.73.0): only `enabled` and
5738
6255
  * `threshold` of a shipped entry, and the LLM lane switch. A `watch` patch needs a human actor
@@ -11969,7 +12486,17 @@ export interface ScheduleRunResponse {
11969
12486
  schedule: WorkflowSchedule;
11970
12487
  }
11971
12488
 
11972
- export type InsightsMetricId = 'pass_rate' | 'override_rate' | 'unresolved_rate' | 'time_to_pr' | 'floor_minutes' | 'wait_on_people' | 'spend' | 'retries';
12489
+ export type InsightsMetricId =
12490
+ | 'pass_rate'
12491
+ | 'override_rate'
12492
+ | 'unresolved_rate'
12493
+ | 'time_to_pr'
12494
+ | 'floor_minutes'
12495
+ | 'wait_on_people'
12496
+ | 'spend'
12497
+ | 'retries'
12498
+ /** (api-types 0.149.0, power mode) Power runs whose rigor rose after their intake QE plan sized them. */
12499
+ | 'rigor_raised';
11973
12500
  /** `too-few` = below the minimum sample (n < 5) in the window or the baseline: no trend is called. */
11974
12501
  export type InsightsVerdict = 'too-few' | 'no-change' | 'improved' | 'regressed';
11975
12502
  export type InsightsRecommendationKind = 'steering-rule' | 'memory' | 'setting' | 'issue' | 'resolve-stale';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.147.0",
3
+ "version": "0.149.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",