wicked-crew-api-types 0.91.0 → 0.94.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 +193 -6
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -215,6 +215,15 @@ export interface HealthResponse {
215
215
  export interface HealthCapabilities {
216
216
  /** See {@link HealthResponse} — the engine's deliver gate exists (wicked-core-ts ≥ 0.7.24). */
217
217
  deliverGate: boolean;
218
+ /**
219
+ * (DES-ASK-TEAM-CHAT-001 §5.1; api-types 0.92.0) An ask starts a PATH: `POST /chats` resolves
220
+ * eligibility and warms nothing, the first `POST /chats/:id/messages` launches one team run
221
+ * (one PA, picked at random among the eligible seats unless `primary` names one; a reviewer
222
+ * member), later messages continue it, and the reply is the PA's `step.completed` output. The
223
+ * whole behaviour contract — launch, continue, output review — needs wicked-core-ts ≥ 0.7.38;
224
+ * ABSENT or `false` means this daemon still fans a send out to every warm seat.
225
+ */
226
+ askPath?: boolean;
218
227
  /**
219
228
  * `LaunchRunBody.revisesPr` is accepted (crew#550; crew ≥ 0.7.36). ABSENT on a daemon before
220
229
  * the field — read as `false`: do not send `revisesPr` to such a daemon.
@@ -1140,6 +1149,11 @@ export interface LaunchPlan {
1140
1149
  steps: Array<{ catalog: string; id?: string | undefined; [k: string]: unknown }>;
1141
1150
  touch?: string[];
1142
1151
  override?: TeamPlanOverride;
1152
+ /**
1153
+ * (DES-TEAMING-002 §6.1 `plan.proposed.monitors`; core ASK-K1b) How many members the plan asks
1154
+ * for; the supervisor seats `min(max(band monitors, asked), 3)`. An ask asks for one reviewer.
1155
+ */
1156
+ monitors?: { asked: number };
1143
1157
  }
1144
1158
 
1145
1159
  /**
@@ -1399,6 +1413,30 @@ export interface CoreEvent {
1399
1413
  * named live, and a bundle assembled after a run cannot describe it in different
1400
1414
  * words than the operator watched it happen in. (FINDING-014)
1401
1415
  */
1416
+ /**
1417
+ * The engine's ORPHAN frame (wicked-core `RunOrphaned`, core#124; named here additively for
1418
+ * crew#830). Written to a run's durable event log at actor bootstrap for every session the store
1419
+ * still calls `executing` that the new process restored no worker for — the daemon died mid-run.
1420
+ * It is a REPORT, not a terminal: the run stays `executing` and resumable (`qe/acceptance.ts` keeps
1421
+ * it out of the terminal set on purpose). A trail that ENDS on this frame is a run nobody is
1422
+ * running; a live run's trail continues past it.
1423
+ *
1424
+ * The daemon acts on it at boot: every `executing` run whose trail ends on `runOrphaned` is resumed
1425
+ * once through the engine's `resumeRun` (the same path as `POST /runs/:id/resume`) and the resume is
1426
+ * recorded in the audit trail as `run.resumed` by the `daemon` actor with
1427
+ * `detail: { via: 'boot', status, ord? }` — `via: 'boot'` is what tells it apart from an operator's
1428
+ * manual resume (`detail: { status }`, actor = the caller).
1429
+ */
1430
+ export type RunOrphanedFrame = {
1431
+ type: 'runOrphaned';
1432
+ /** The orphaned run's id. */
1433
+ session: string;
1434
+ /** The cursor unit's 1-based ord (the cursor position when the units could not be read). */
1435
+ ord: number;
1436
+ /** The remedy, spelled out: `POST /api/v1/runs/<id>/resume`. */
1437
+ detail: string;
1438
+ };
1439
+
1402
1440
  /**
1403
1441
  * The stall watchdog's DETECTION frame (crew#287; api-types 0.18.0 — previously daemon-local).
1404
1442
  * DAEMON-SYNTHETIC: broadcast straight to `/ws` when a run in `executing` has been silent on the
@@ -1468,9 +1506,12 @@ export type WorkerStallEscalatedFrame = {
1468
1506
  * `evaluating` — the worker returned and its gate evaluation is in flight, a reassign would start
1469
1507
  * a second creator; `evaluator_distinct` — every other seat is one evaluator ≠ creator forbids
1470
1508
  * (see `avoided`), so the unit was left for a human; `no_output` (outcome `exhausted`) — the
1471
- * reassigned seat produced nothing past a startup banner.
1509
+ * reassigned seat produced nothing past a startup banner; `no_eligible_seat` (crew#833; additive)
1510
+ * — every other seat is one this run BENCHED (see `benched`: quota exhausted, signed out — a seat
1511
+ * the engine already failed over away from) or one evaluator ≠ creator forbids (see `avoided`),
1512
+ * so the unit was left for a human rather than dispatched to a seat known to fail.
1472
1513
  */
1473
- reason?: 'tool_unit' | 'evaluating' | 'evaluator_distinct' | 'no_output';
1514
+ reason?: 'tool_unit' | 'evaluating' | 'evaluator_distinct' | 'no_output' | 'no_eligible_seat';
1474
1515
  /**
1475
1516
  * The seats the failover pick excluded under evaluator ≠ creator (crew#638; additive): a
1476
1517
  * creator cursor avoids the run's evaluator seats, an evaluator cursor the seats that built its
@@ -1478,6 +1519,13 @@ export type WorkerStallEscalatedFrame = {
1478
1519
  * reassign that skipped one and on a `reason: 'evaluator_distinct'` notify; absent otherwise.
1479
1520
  */
1480
1521
  avoided?: string[];
1522
+ /**
1523
+ * The pool seats the failover pick excluded because THIS RUN benched them (crew#833; additive):
1524
+ * `AgentSession.benched_seats` keys — a seat the engine failed over away from (quota exhausted,
1525
+ * signed out, dead) is never a failover target in the same run. Present on an `ok` reassign that
1526
+ * skipped one and on a `reason: 'no_eligible_seat'` notify; absent otherwise.
1527
+ */
1528
+ benched?: string[];
1481
1529
  };
1482
1530
 
1483
1531
  export interface RecordedEvent extends CoreEvent {
@@ -3057,6 +3105,14 @@ export interface SkillsManifestResponse {
3057
3105
  * `manifest.baseline`: different = Refresh baseline, then Publish.
3058
3106
  */
3059
3107
  installed?: InstalledPlugin | null;
3108
+ /**
3109
+ * Whether a `POST /skills/publish` is running on the daemon right now (crew#852; api-types
3110
+ * 0.94.0) — its validate / hash / stage / lock run paced on the event loop, so this read answers
3111
+ * while it runs, and `current` names the PREVIOUS generation until the publish commits and flips
3112
+ * it (a reader sees the old generation or the new one, never half). A second publish in that
3113
+ * window is the 2xx `publish-in-flight` envelope. Absent on a daemon older than 0.8.4.
3114
+ */
3115
+ publishing?: boolean;
3060
3116
  }
3061
3117
 
3062
3118
  /** `SkillsManifestResponse.installed` — the live plugin's identity (wicked-studio#388). */
@@ -4916,6 +4972,43 @@ export interface InteractiveStatusPosted {
4916
4972
  /** Wave 6: the unit (ord) the line narrates — the latest unit-scoped engine frame's `ord`, so a
4917
4973
  * skin renders one council at a time. Absent before the first unit-scoped frame. */
4918
4974
  unit_ord?: number;
4975
+ /**
4976
+ * crew#512 (api-types 0.93.0): the document's repository grounding as data — present on exactly
4977
+ * ONE frame per draft launch, the same `working` frame whose `message` is the "Grounded on …" /
4978
+ * "Requested repository … skipped." narration (the text stays, for a skin that renders the
4979
+ * transcript only). A skin keys a persistent header chip off this and never parses the sentence.
4980
+ * Absent on every other frame, on a pre-0.93 daemon, and when the project has no repositories.
4981
+ */
4982
+ grounding?: InteractiveDocGrounding;
4983
+ }
4984
+
4985
+ /**
4986
+ * Where a document is grounded and why (crew#512; api-types 0.93.0) — the structured twin of the
4987
+ * draft seam's "Grounded on …" narration (`groundingNarration`, doc-grounding.ts). Rides the one
4988
+ * `InteractiveStatusPosted` frame that carries the narration and, once recorded, the document's
4989
+ * `InteractiveDocSummary` row — the same object in both places, from the `crew-grounding.json`
4990
+ * sidecar beside the document.
4991
+ */
4992
+ export interface InteractiveDocGrounding {
4993
+ /** Registry ids of the repositories the launch grounded on — the worker reads an offline snapshot
4994
+ * of each. `[]` = not repository-grounded (brief + code graph only). Names resolve through `GET /repos`. */
4995
+ repo_refs: string[];
4996
+ /** Why those: `named` — `repo_ref(s)` on the create request; `brief` — the brief names member repos;
4997
+ * `sole-member` — the project's only repository; `none` — nothing named, nothing inferred. */
4998
+ source: 'named' | 'brief' | 'sole-member' | 'none';
4999
+ /** Requested repositories that grounded nothing, with why (the narration's "skipped" clauses). */
5000
+ skipped: InteractiveDocGroundingSkip[];
5001
+ /** How many repositories the project has — the "1 of N" in a chip; `0` for a repo-less project. */
5002
+ member_count: number;
5003
+ }
5004
+
5005
+ /** One repository a launch did not ground on, as spelled on the request (or its registry id). */
5006
+ export interface InteractiveDocGroundingSkip {
5007
+ ref: string;
5008
+ /** `not-a-member` — not (or no longer) a project member; `ambiguous` — several members share that
5009
+ * name, the registry id disambiguates; `unsnapshotable` — a member whose offline snapshot failed
5010
+ * (too large, unreadable, …), so the task names it but the worker has no copy. */
5011
+ reason: 'not-a-member' | 'ambiguous' | 'unsnapshotable';
4919
5012
  }
4920
5013
 
4921
5014
  // ── EP-C2: a document's checks — the four reviewers (api-types 0.88.0) ─────────────────────────
@@ -4999,6 +5092,14 @@ export interface InteractiveDocSummary {
4999
5092
  retired_at?: string;
5000
5093
  /** The crew project this row was listed under — the mount's `:projectId`. */
5001
5094
  projectId: string;
5095
+ /**
5096
+ * crew#512 (api-types 0.93.0): the repository grounding the draft seam resolved for this document,
5097
+ * read from the `crew-grounding.json` sidecar beside it — the same object the launch's status
5098
+ * frame carried, so a reopened document shows its chip without replaying the thread. Absent
5099
+ * until a draft launch resolved it (a document still generating, one created before this release, an
5100
+ * unfiled document) and on a pre-0.93 daemon.
5101
+ */
5102
+ grounding?: InteractiveDocGrounding;
5002
5103
  }
5003
5104
 
5004
5105
  /**
@@ -5158,6 +5259,12 @@ export interface ChatOpenBody {
5158
5259
  * - `none` — the legacy unscoped chat; takes neither `projectId` nor `repoRefs`.
5159
5260
  */
5160
5261
  scopeKind?: ChatScopeRequestKind;
5262
+ /**
5263
+ * (DES-ASK-TEAM-CHAT-001 §4.1; api-types 0.92.0) The seat the operator CHOSE as the primary
5264
+ * agent — one of the eligible seats, else 400. Omitted: the engine picks one at random
5265
+ * (`path.started.selection: "random"`).
5266
+ */
5267
+ primary?: string;
5161
5268
  }
5162
5269
 
5163
5270
  /** The scope a `POST /chats` caller may name (api-types 0.39.0, studio#323 R4). */
@@ -5312,6 +5419,9 @@ export interface ChatMessageResponse {
5312
5419
  * and only `POST /chats` → 201, which performed the open, says anything about that moment.
5313
5420
  */
5314
5421
  singleSeat?: ChatSingleSeatDegradation;
5422
+ /** (api-types 0.92.0) The ask path this message launched or continued, and its answer step. */
5423
+ runId?: string;
5424
+ stepId?: string;
5315
5425
  }
5316
5426
 
5317
5427
  /**
@@ -5480,6 +5590,25 @@ export interface ChatDetailResponse {
5480
5590
  * "session continues" without history). Unbounded — a reply may be up to the engine's cap.
5481
5591
  */
5482
5592
  messages?: ChatTranscriptRecord[];
5593
+ /**
5594
+ * (DES-ASK-TEAM-CHAT-001 §5.1; api-types 0.92.0) The chat's path once its first message
5595
+ * launched it: the run, the PA and how it was picked, the reviewer member (null until one
5596
+ * attached) and the helpers that answered. Absent before the first message and on a daemon
5597
+ * without `capabilities.askPath`.
5598
+ */
5599
+ path?: ChatPathView;
5600
+ }
5601
+
5602
+ /** (api-types 0.92.0) A chat's ask path — see {@link ChatDetailResponse.path}. */
5603
+ export interface ChatPathView {
5604
+ runId: string;
5605
+ /** The primary agent's seat key, `null` until `path.started` has been seen. */
5606
+ pa: string | null;
5607
+ selection: 'chosen' | 'random';
5608
+ reviewer: string | null;
5609
+ helpers: string[];
5610
+ /** The answer step the last message added (`answer-N`). */
5611
+ stepId: string;
5483
5612
  }
5484
5613
 
5485
5614
  // ── Project code graph (DES-PROJECT-001; the co-located multi-repo graph) ──────
@@ -6203,7 +6332,10 @@ export interface GovernanceReplayOutcome {
6203
6332
  alreadyPresent: number | null;
6204
6333
  failed: number;
6205
6334
  dryRun: boolean;
6206
- /** The same-event conflation caveat the CLI prints, or `null`. */
6335
+ /** The caveat the CLI prints, or `null`: on a dry run, that the outbox's untimestamped (pre-stamp) entries
6336
+ * cannot be ordered by a replay — they land in file order, and byte-identical unstamped lines share one
6337
+ * replay id (crew#829; `null` when every entry is stamped); on a real replay, the same-event conflation
6338
+ * caveat when entries were `alreadyPresent` and the outbox held unstamped lines. */
6207
6339
  note: string | null;
6208
6340
  /** Dry run only: the outbox fold (the `/diagnostics` dead-letter block minus the legacy pointer). */
6209
6341
  fold?: Omit<DiagnosticsGovernanceDeadletters, 'legacyOutbox'>;
@@ -7116,7 +7248,9 @@ export type TeamEventType =
7116
7248
  | 'wicked.team.ledger.folded'
7117
7249
  | 'wicked.team.gate.opened'
7118
7250
  | 'wicked.team.gate.decided'
7119
- | 'wicked.team.path.ended';
7251
+ | 'wicked.team.path.ended'
7252
+ /** (DES-ASK-TEAM-CHAT-001 §4.1; core ASK-K1a) The PA changed mid-path. */
7253
+ | 'wicked.team.path.repicked';
7120
7254
 
7121
7255
  /** The fields every team payload carries. */
7122
7256
  export interface TeamEnvelope {
@@ -7216,6 +7350,15 @@ export type TeamPlanAcceptedPayload = TeamEnvelope & {
7216
7350
  steps: TeamPlanStep[];
7217
7351
  override: TeamPlanOverride | null;
7218
7352
  proposal_id: string | null;
7353
+ /**
7354
+ * (core TR-W1a) This rev's declared touch unioned with every earlier accepted rev's, first-seen
7355
+ * order, capped; absent on rows written before the field existed. `touch_source` names where
7356
+ * THIS rev's declared touch came from: `user` (the launch), `pa_scope` (the PA's SCOPE answer,
7357
+ * or — DES-TEAMING-002 rev 15 — the touch a first-creator PA `PLAN+` declared), `none`.
7358
+ */
7359
+ touch?: string[];
7360
+ touch_truncated?: boolean;
7361
+ touch_source?: 'user' | 'pa_scope' | 'none' | (string & {});
7219
7362
  };
7220
7363
 
7221
7364
  export type TeamPlanRefusedPayload = TeamEnvelope & {
@@ -7227,7 +7370,12 @@ export type TeamPlanRefusedPayload = TeamEnvelope & {
7227
7370
  export type TeamMemberJoinedPayload = TeamEnvelope & {
7228
7371
  member_id: string;
7229
7372
  open_seq: number;
7230
- seat: string;
7373
+ /**
7374
+ * (DES-ASK-TEAM-CHAT-001 §4.6; core ASK-K3a) `null` on a `status: 'failed'` row published when
7375
+ * no distinct seat exists to seat the member on (one signed-in seat); `member_id`/`open_seq`
7376
+ * are still minted, so the row keeps its key.
7377
+ */
7378
+ seat: string | null;
7231
7379
  role: 'monitor' | (string & {});
7232
7380
  status: 'attached' | 'failed' | (string & {});
7233
7381
  reason: string;
@@ -7271,6 +7419,12 @@ export type TeamFindingRaisedPayload = TeamEnvelope & {
7271
7419
  anchor: string | null;
7272
7420
  anchor_source: 'graph' | 'hunk' | 'none' | (string & {}) | null;
7273
7421
  severity: 'high' | 'medium' | (string & {});
7422
+ /**
7423
+ * (DES-ASK-TEAM-CHAT-001 §4.6; core ASK-K3a) What the finding cites: a line of the settled tree
7424
+ * (`tree`, absent on old rows) or a line of the step's output (`output`: `path` is the step id,
7425
+ * `line` a line of the output; the bar is `medium`).
7426
+ */
7427
+ target?: 'tree' | 'output' | (string & {});
7274
7428
  path: string;
7275
7429
  line: number;
7276
7430
  evidence: string;
@@ -7279,6 +7433,8 @@ export type TeamFindingRaisedPayload = TeamEnvelope & {
7279
7433
  tree: string;
7280
7434
  in_diff: boolean;
7281
7435
  corroborated_by: string[];
7436
+ /** (core T6) The attempt that first raised it, when a redriven attempt carried it; else null. */
7437
+ carried_from_attempt?: number | null;
7282
7438
  };
7283
7439
 
7284
7440
  export type TeamAdviceDeliveredPayload = TeamEnvelope & {
@@ -7311,8 +7467,16 @@ export type TeamHelpRequestedPayload = TeamEnvelope & {
7311
7467
  export type TeamHelpAnsweredPayload = TeamEnvelope & {
7312
7468
  help_id: string;
7313
7469
  answer_id: string;
7314
- answer: string;
7470
+ /** `null` when `outcome` is not `answered` (core ASK-K3a). */
7471
+ answer: string | null;
7315
7472
  evidence: string[];
7473
+ /**
7474
+ * (DES-ASK-TEAM-CHAT-001 §4.5; core ASK-K3a) The help turn's terminal outcome, a fact on the row
7475
+ * S owns — never inferred from a missing row. Absent on old rows (= `answered`).
7476
+ */
7477
+ outcome?: 'answered' | 'timed_out' | 'failed' | 'no_member' | (string & {});
7478
+ /** Why, for a non-`answered` outcome. */
7479
+ error?: string | null;
7316
7480
  };
7317
7481
 
7318
7482
  export type TeamChangeRequestedPayload = TeamEnvelope & {
@@ -7328,6 +7492,11 @@ export type TeamStepCompletedPayload = TeamEnvelope & {
7328
7492
  tree: string | null;
7329
7493
  output_bytes: number;
7330
7494
  output_ref: string;
7495
+ /**
7496
+ * (core ASK-K3c) The attempt's `[team advice]` boundary block reached a seat turn. Omitted
7497
+ * when false (old rows read false).
7498
+ */
7499
+ answers_presented?: boolean;
7331
7500
  };
7332
7501
 
7333
7502
  export type TeamStepReviewedPayload = TeamEnvelope & {
@@ -7335,6 +7504,8 @@ export type TeamStepReviewedPayload = TeamEnvelope & {
7335
7504
  verdict: 'accepted' | 'rejected' | (string & {});
7336
7505
  to: 'member' | 'pa' | (string & {}) | null;
7337
7506
  reason: string;
7507
+ /** (core T6) The attempt of `step_id` the verdict is about; null on rows written before it existed. */
7508
+ reviewed_attempt?: number | null;
7338
7509
  };
7339
7510
 
7340
7511
  export type TeamFindingSettledPayload = TeamEnvelope & {
@@ -7490,6 +7661,21 @@ export type TeamPathEndedPayload = TeamEnvelope & {
7490
7661
  status: 'completed' | 'failed' | 'cancelled' | (string & {});
7491
7662
  };
7492
7663
 
7664
+ /**
7665
+ * (DES-ASK-TEAM-CHAT-001 §4.1; core ASK-K1a) `wicked.team.path.repicked` (E): a PA step's attempt
7666
+ * ended for a seat cause (`timed_out`, `failed`, a seat refusal's class) and another eligible seat
7667
+ * took over as the PA. The envelope's `ord`/`attempt` name the step; it is redispatched as
7668
+ * attempt+1 on `to`. Keyed by `pick_seq`, the engine's per-run re-pick counter (from 1).
7669
+ */
7670
+ export type TeamPathRepickedPayload = TeamEnvelope & {
7671
+ from: string;
7672
+ to: string;
7673
+ reason: string;
7674
+ /** Always `'random'`: a re-pick is never the operator's choice. */
7675
+ selection: 'random' | (string & {});
7676
+ pick_seq: number;
7677
+ };
7678
+
7493
7679
  /** Each team event type's payload. */
7494
7680
  export interface TeamEventPayloads {
7495
7681
  'wicked.team.path.started': TeamPathStartedPayload;
@@ -7517,6 +7703,7 @@ export interface TeamEventPayloads {
7517
7703
  'wicked.team.gate.opened': TeamGateOpenedPayload;
7518
7704
  'wicked.team.gate.decided': TeamGateDecidedPayload;
7519
7705
  'wicked.team.path.ended': TeamPathEndedPayload;
7706
+ 'wicked.team.path.repicked': TeamPathRepickedPayload;
7520
7707
  }
7521
7708
 
7522
7709
  /** One team bus row, discriminated on `event_type`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.91.0",
3
+ "version": "0.94.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",