wicked-crew-api-types 0.98.0 → 0.100.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 +181 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -711,6 +711,110 @@ export interface WorkUnit {
711
711
  * marker was MISSING (that denies; the denial is the record), and on an older engine.
712
712
  */
713
713
  capture_report?: CaptureReport;
714
+ /**
715
+ * TRUE when the worktree guard governs this unit (a def-driven, agent-executed
716
+ * `executes_code: false` phase — a READ-ONLY phase; wicked-core `WorkUnit.worktree_guarded`,
717
+ * derived at plan time). Skip-if-false on the wire: ABSENT on every other unit and on an older
718
+ * engine. Typed here for crew#891 (the floor-fix gate is a read-only phase's).
719
+ */
720
+ worktree_guarded?: boolean;
721
+ /**
722
+ * TRUE when this unit runs the repository's own checks as its floor (wicked-core
723
+ * `WorkUnit.repo_checks_floor`). Skip-if-false on the wire: ABSENT otherwise.
724
+ */
725
+ repo_checks_floor?: boolean;
726
+ /**
727
+ * The repo-checks evidence the fold attached to this unit (wicked-core `RepoChecksReport`),
728
+ * typed only as far as a skin reads it (crew#891); the rest of the report rides the index
729
+ * signature. ABSENT until the unit's gate folds, and when the floor does not apply.
730
+ */
731
+ repo_checks?: WorkUnitRepoChecks;
732
+ /**
733
+ * Every human gate note that amended this unit, oldest first (wicked-core#760
734
+ * `WorkUnit.operator_rulings`) — the record the evaluator reviewing it reads. ABSENT when empty.
735
+ */
736
+ operator_rulings?: OperatorRuling[];
737
+ /** (crew#894, wicked-core#810) The phase's worker pool (one creator plus monitors). ABSENT = 1. */
738
+ pool?: number;
739
+ /** (crew#894) How that pool was seated, once distributed (see {@link UnitPoolSeating}). ABSENT
740
+ * for a pool of 1 and before distribution. */
741
+ pool_seating?: UnitPoolSeating;
742
+ }
743
+
744
+ /**
745
+ * How an operator's floor-only re-run ran (wicked-core `FloorRerunMode`, snake_case on the wire):
746
+ * `extend` | `targeted` | `accept_partial` (wicked-core#469, the escalation arms of a floor that did
747
+ * not finish) and `floor_fix` (crew#891, wicked-core#782 / #811 — a seat distinct from the
748
+ * read-only phase made the operator's fix first; reached only through an approve with a note at
749
+ * that phase's floor gate, never as its own `GateDecision.action`).
750
+ */
751
+ export type FloorRerunMode = 'extend' | 'targeted' | 'accept_partial' | 'floor_fix';
752
+
753
+ /** (crew#891, wicked-core#782) The fix a `floor_fix` re-run makes before its floor runs. */
754
+ export interface FloorFix {
755
+ /** The operator's note, verbatim — the fixing seat's whole task. */
756
+ note: string;
757
+ /** The seat that makes the fix: distinct from the read-only phase's own (evaluator ≠ fixer). */
758
+ seat: string;
759
+ }
760
+
761
+ /** (wicked-core#469) A floor-only re-run the escalation gate armed on a unit, read by its next dispatch. */
762
+ export interface FloorRerun {
763
+ mode: FloorRerunMode;
764
+ /** `accept_partial`: the checks waived. Absent when empty. */
765
+ waive?: string[];
766
+ /** The seat's output from the attempt the gate reviewed (the fold reads it; the seat does not re-run).
767
+ * Always serialised (`""` when none). */
768
+ output: string;
769
+ /** `floor_fix` only (crew#891): the note and the distinct seat that makes it. */
770
+ fix?: FloorFix;
771
+ }
772
+
773
+ /** {@link WorkUnit.repo_checks}: the parts of wicked-core's `RepoChecksReport` a skin reads. */
774
+ export interface WorkUnitRepoChecks {
775
+ /** Whether the floor passed (vacuously true when nothing was detected). The engine always sends
776
+ * it; optional here because this type is a partial reading, and consumers (fixtures included)
777
+ * already hold units whose report they only partly know. */
778
+ passed?: boolean;
779
+ /** The operator's re-run this report answers; absent for the ordinary floor. */
780
+ rerun?: FloorRerunMode;
781
+ /** Checks the operator waived for this unit. Absent when empty. */
782
+ waived?: string[];
783
+ /** The re-run armed at the gate and not yet consumed. Absent otherwise. */
784
+ requested_rerun?: FloorRerun;
785
+ [k: string]: unknown;
786
+ }
787
+
788
+ /**
789
+ * One human gate note on a unit (wicked-core#760 `OperatorRuling`): `request_changes` | `amend`,
790
+ * and `floor_fix` (crew#891, wicked-core#782) for an approve-with-note a distinct seat made as a
791
+ * floor fix. Read an unknown token as a note, never as an error.
792
+ */
793
+ export interface OperatorRuling {
794
+ action: 'request_changes' | 'amend' | 'floor_fix' | (string & {});
795
+ /** The operator's own words. */
796
+ text: string;
797
+ /** The amended unit's attempt when the ruling was given. */
798
+ attempt: number;
799
+ /** Unix millis. */
800
+ at: number;
801
+ }
802
+
803
+ /**
804
+ * (crew#894, wicked-core#810) A unit's worker-pool fill — `unitDistributed.pool` and
805
+ * `WorkUnit.pool_seating` (the same keys; core-ts `UnitPoolSeatingJson`).
806
+ */
807
+ export interface UnitPoolSeating {
808
+ /** The phase's `pool` (after any plan step lowered it). */
809
+ requested: number;
810
+ /** Seats filled: the creator plus `monitors.length`. */
811
+ seated: number;
812
+ /** The monitor seat instances (`claude#2`), in the order the team supervisor summons them. */
813
+ monitors: string[];
814
+ /** Configured instances that could have filled the shortfall but are not signed in. */
815
+ missing: string[];
816
+ /** Why `seated < requested`; `null` when the pool was filled. */
817
+ shortfall: string | null;
714
818
  }
715
819
 
716
820
  /** The counts a capture phase reported (`WorkUnit.capture_report`; wicked-core#535). */
@@ -826,6 +930,15 @@ export interface RosterSeat {
826
930
  * engine predating the field (serde omits `None`) and on seats with no known login flow.
827
931
  */
828
932
  login_invocation?: string;
933
+ /**
934
+ * The shell invocation that signs this seat OUT of its own configuration root (crew#615;
935
+ * wicked-core#807 `AgenticCli.logout_invocation`, core-ts >= 0.7.43): the CLI's own documented
936
+ * logout (`claude auth logout`, `codex logout`, `opencode auth logout`), prefixed with the seat's
937
+ * root exactly like {@link login_invocation}. Passed through VERBATIM; absent for a seat whose CLI
938
+ * documents no logout (copilot, pi, agy) and on an engine predating the field. `POST
939
+ * /seats/:cli/logout` runs it.
940
+ */
941
+ logout_invocation?: string;
829
942
  /**
830
943
  * Whether the seat LOOKS signed in — a cheap file/env-presence HEURISTIC computed by the
831
944
  * daemon (`seat-signin.ts`), never a spawned probe and never proof the credential still
@@ -2523,10 +2636,14 @@ export interface UnitReworkAmendedEvent {
2523
2636
  * (`amendScope: 'creator'`); `'request_changes'` — the creator phase the gate rewound to, and
2524
2637
  * `amendment` then carries the evaluator's full findings + the operator's note;
2525
2638
  * `'accept_suggestion'` (wicked-core#467) — the same rewind after the operator adopted the
2526
- * evaluator's pinned edit, and `amendment` names it. ABSENT on an engine before the field — read
2527
- * as `'cursor'`.
2639
+ * evaluator's pinned edit, and `amendment` names it. `'floor_fix'` (crew#891, wicked-core#782 /
2640
+ * #811) — an approve WITH A NOTE at the escalation gate of a READ-ONLY phase (worktree-guarded,
2641
+ * `executes_code: false`) whose own repo-checks floor denied it: a seat DISTINCT from that phase
2642
+ * makes the note's fix in the worktree, then only the floor re-runs (the phase does not run again;
2643
+ * its verdict stands and the floor decides). ABSENT on an engine before the field — read as
2644
+ * `'cursor'`.
2528
2645
  */
2529
- scope?: 'cursor' | 'creator' | 'request_changes' | 'accept_suggestion';
2646
+ scope?: 'cursor' | 'creator' | 'request_changes' | 'accept_suggestion' | 'floor_fix';
2530
2647
  }
2531
2648
 
2532
2649
  /** P2 — a worker's ApplyStepResult arrived and output is ready to be gated. Fires before GateDecided.
@@ -2569,7 +2686,8 @@ export interface UnitPlannedEvent {
2569
2686
  description: string;
2570
2687
  stage: StageKind;
2571
2688
  role: PhaseRole;
2572
- gate: 'auto' | 'human_confirm' | 'human_confirm_if';
2689
+ /** `consent_before` from wicked-core-ts 0.7.43 (core#801, crew#888). */
2690
+ gate: 'auto' | 'human_confirm' | 'human_confirm_if' | 'consent_before';
2573
2691
  skill_ref: string | null;
2574
2692
  has_validator_pin: boolean;
2575
2693
  executor_type: 'agent' | 'tool';
@@ -2636,6 +2754,13 @@ export interface UnitDistributedEvent {
2636
2754
  * unrecognised value as a disclosure too, never as "distinct".
2637
2755
  */
2638
2756
  distinctnessFallback?: 'creator_seat' | 'same_cli_instance' | null;
2757
+ /**
2758
+ * (crew#894, wicked-core#810 / #813; core-ts >= 0.7.44) How the unit's WORKER POOL was filled:
2759
+ * one creator plus monitors. `null` for a pool of 1 (the default) and a tool unit; ABSENT on an
2760
+ * older engine. A pool larger than the signed-in instances is seated SHORT and disclosed here
2761
+ * (`seated < requested`, `missing`, `shortfall`), never refused. Guard with `== null`.
2762
+ */
2763
+ pool?: UnitPoolSeating | null;
2639
2764
  /** @deprecated api-types 0.36.0 — the engine emits `routingMethod`; removed in 0.37. */
2640
2765
  routing_method?: 'council' | 'degraded' | 'evaluator_distinct' | 'tool' | 'teamed';
2641
2766
  /** @deprecated api-types 0.36.0 — the engine emits `agreementPct`; removed in 0.37. */
@@ -4301,9 +4426,17 @@ export interface GraphKind {
4301
4426
  /** Gate position in the value→strategy→execution ladder. */
4302
4427
  export type GateType = 'value' | 'strategy' | 'execution';
4303
4428
 
4304
- /** Human-confirm spec for a phase gate (serde flattened from Rust enum). */
4429
+ /**
4430
+ * Human-confirm spec for a phase gate (serde flattened from Rust enum).
4431
+ *
4432
+ * `'consent_before'` (wicked-core#805 / core#801, core-ts >= 0.7.43; crew#888): the engine pauses
4433
+ * BEFORE the phase runs, with `awaitingHuman{gateKind: 'consent'}`, whatever the run-level
4434
+ * `humanConfirm` policy, and nothing pauses after it. Approve runs the phase; reject cancels the run
4435
+ * with nothing in the phase run. A standing order never answers a `consent` gate.
4436
+ */
4305
4437
  export type GateSpec =
4306
4438
  | 'auto'
4439
+ | 'consent_before'
4307
4440
  | { human_confirm: { unconditional: boolean } }
4308
4441
  | { human_confirm_if: 'verdict_not_pass' };
4309
4442
 
@@ -4322,6 +4455,12 @@ export type PhaseExecutor =
4322
4455
  export interface PhaseDef {
4323
4456
  id: string;
4324
4457
  kind: StageKindPhase;
4458
+ /**
4459
+ * (crew#894, wicked-core#810) The phase's worker pool, `1..=4` (absent = 1): one creator plus
4460
+ * `pool - 1` monitors, inside a TEAM run only. A user workflow declaring `pool > 1` is refused at
4461
+ * registration (`pool outside a team run`), and so is a value outside `1..=4` (`pool out of range`).
4462
+ */
4463
+ pool?: number;
4325
4464
  /** How the phase executes. Omitted = Agent (engine default). Tool phases bypass the council and
4326
4465
  * run `cmd` directly. */
4327
4466
  executor?: PhaseExecutor;
@@ -4422,6 +4561,28 @@ export interface DomainCoverage {
4422
4561
  resolved: number;
4423
4562
  }
4424
4563
 
4564
+ /**
4565
+ * `POST /seats/:cli/login` and `POST /seats/:cli/logout` (crew#615): the PTY size for the terminal
4566
+ * the daemon opens running the seat's own `login_invocation` / `logout_invocation`. Both optional
4567
+ * (default 100 x 30).
4568
+ */
4569
+ export interface SeatSessionBody {
4570
+ cols?: number;
4571
+ rows?: number;
4572
+ }
4573
+
4574
+ /**
4575
+ * The answer to {@link SeatSessionBody}: the terminal running the seat's sign-in / sign-out
4576
+ * command. Drive and read it over `/ws/terminals/:id` (a device URL streams there). 404 when the
4577
+ * seat is unknown or its CLI documents no such command.
4578
+ */
4579
+ export interface SeatSessionResponse {
4580
+ terminalId: string;
4581
+ /** The seat key the command was run for. */
4582
+ cli: string;
4583
+ action: 'login' | 'logout';
4584
+ }
4585
+
4425
4586
  /** The open-terminal request body (`POST /terminals`, DES-TERMINAL-001 §6). */
4426
4587
  export interface OpenTerminalBody {
4427
4588
  /** Working directory the PTY opens in. */
@@ -5332,7 +5493,12 @@ export interface InteractionRequest {
5332
5493
  reviewing_ord: number | null;
5333
5494
  prompt: string;
5334
5495
  status: 'open' | 'answered' | 'expired' | 'cancelled';
5335
- /** The decision payload (JSON text, e.g. `{"approve":true,"amend":null}`) once resolved. */
5496
+ /**
5497
+ * The decision payload (JSON text, e.g. `{"approve":true,"amend":null}`) once resolved. Its
5498
+ * `action` names the arm; `"floor_fix"` (crew#891, wicked-core#782) replaces `"approve"` when an
5499
+ * approve with a note at a read-only phase's floor gate was taken as a floor fix — it IS an
5500
+ * approve.
5501
+ */
5336
5502
  answer: string | null;
5337
5503
  /** Unix millis. */
5338
5504
  created_at: number;
@@ -7461,6 +7627,10 @@ export interface TeamPlanStep {
7461
7627
  added_by?: 'plan' | 'floor' | (string & {});
7462
7628
  floor_reason?: string;
7463
7629
  late?: boolean;
7630
+ /** (crew#894, wicked-core#810) The step's worker pool. A plan step may only LOWER the catalog
7631
+ * phase's pool; a raise is refused (`wicked.team.plan.refused`, reason `pool_raised`). Omitted
7632
+ * when unset. */
7633
+ pool?: number;
7464
7634
  }
7465
7635
 
7466
7636
  export interface TeamPlanOverride {
@@ -7545,6 +7715,8 @@ export type TeamPlanAcceptedPayload = TeamEnvelope & {
7545
7715
  export type TeamPlanRefusedPayload = TeamEnvelope & {
7546
7716
  proposal_id: string;
7547
7717
  base_rev: number | null;
7718
+ /** The engine's refusal reason, verbatim — e.g. `pool_raised` (crew#894, wicked-core#810: a plan
7719
+ * step raised a phase's `pool`; a step may only lower it). */
7548
7720
  reason: string;
7549
7721
  };
7550
7722
 
@@ -7581,6 +7753,9 @@ export type TeamStepClaimedPayload = TeamEnvelope & {
7581
7753
  baseline_tree: string | null;
7582
7754
  repo: { workdir: string; git_dir: string } | null;
7583
7755
  code_graph_db: string | null;
7756
+ /** (crew#894, wicked-core#810) The monitor seat instances summoned beside the claiming creator
7757
+ * (a pool > 1). Omitted when empty. */
7758
+ monitors?: string[];
7584
7759
  };
7585
7760
 
7586
7761
  export type TeamCheckpointReachedPayload = TeamEnvelope & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.98.0",
3
+ "version": "0.100.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",