wicked-crew-api-types 0.34.0 → 0.35.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 +125 -8
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -426,9 +426,61 @@ export interface RosterSeat {
426
426
  * unknown seat keys, or a daemon predating the field).
427
427
  */
428
428
  signed_in?: boolean | null;
429
+ /**
430
+ * What `signed_in` MEANS for this seat (api-types 0.35.0, F-2R2-009): `signed_in` — a credential
431
+ * artifact is observable; `signed_out` — none is and the seat needs one (a council benches it on
432
+ * its first ballot; a chat refuses it up front); `not_required` — none is, but the seat answers
433
+ * on a free tier with no account (`free_tier` names it); `unknown` — the probe cannot tell
434
+ * cheaply (keychain-backed seats, unknown seat keys). Absent on a daemon predating the field.
435
+ */
436
+ auth?: SeatAuth;
437
+ /** Present when `auth` is `not_required`: the free tier the seat answers on. */
438
+ free_tier?: string;
439
+ /**
440
+ * Where the `not_required` reading came from: `registry` when the CLI's own record declared the
441
+ * credential requirement, `crew-heuristic` when the daemon's per-CLI table did (today's only
442
+ * source — the engine's `AgenticCli` declares none; a wicked-core follow-up). A reader can show
443
+ * the heuristic as such.
444
+ */
445
+ free_tier_source?: 'registry' | 'crew-heuristic';
446
+ /**
447
+ * Whether a council would seat AND keep this seat as far as the daemon can tell: enabled for
448
+ * council, runtime `health` active, `auth` not `signed_out`. The daemon's PREDICTION from its
449
+ * own records — the engine still convenes whatever roster it is handed and benches a seat only
450
+ * after it fails. Chat admission (`POST /chats` defaults) reads the same auth predicate.
451
+ */
452
+ council_eligible?: boolean;
453
+ /** Present when `council_eligible` is false: the one reason, in the operator's words. */
454
+ council_ineligible_reason?: string;
455
+ /**
456
+ * Present when THIS daemon's recent councils benched the seat: the engine's own
457
+ * `councilSeatFailed` evidence (`non_zero_exit` / `timed_out`, the derivative `benched` kind
458
+ * excluded), folded over a bounded window (`window_ms`) and cleared by the seat's next ok unit
459
+ * output. `council_eligible` is false while it is present.
460
+ */
461
+ council_bench?: RosterSeatCouncilBench;
429
462
  [k: string]: unknown;
430
463
  }
431
464
 
465
+ /** `RosterSeat.council_bench` (api-types 0.35.0). */
466
+ export interface RosterSeatCouncilBench {
467
+ /** Primary ballot failures inside the window. */
468
+ failures: number;
469
+ /** The last failure's `councilSeatFailed.kind`. */
470
+ last_kind: string;
471
+ /** ISO-8601 of the last failure. */
472
+ last_at: string;
473
+ /** The run the last failure happened in, when the frame named one. */
474
+ last_run?: string;
475
+ /** A bounded excerpt of the last failure's detail / stderr, when there was one. */
476
+ last_detail?: string;
477
+ /** The rolling window the failures were counted over, ms. */
478
+ window_ms: number;
479
+ }
480
+
481
+ /** A seat's auth reading (`RosterSeat.auth`; api-types 0.35.0). */
482
+ export type SeatAuth = 'signed_in' | 'signed_out' | 'not_required' | 'unknown';
483
+
432
484
  /** Body for `POST /open` — open a file/folder with the OS default application (crew#273). */
433
485
  export interface OpenPathBody {
434
486
  /**
@@ -2825,6 +2877,20 @@ export interface CodeGraphData {
2825
2877
  stats: { nodeCount: number; edgeCount: number; fileCount: number };
2826
2878
  }
2827
2879
 
2880
+ /**
2881
+ * `GET /repos/:id/graph` → 200 (api-types 0.35.0, F-2R2-005). `graph: null` = the repo's code
2882
+ * graph has not been built (nothing at its registered graph path) — and `reason` says WHY, so a
2883
+ * consumer of this route alone can tell "not indexed" from "empty": the same finding text the
2884
+ * repos wire carries when the engine has one (`finding` — e.g. `in_tree_code_graph_ignored`: a
2885
+ * checkout's in-tree graph is ignored and no live graph exists yet; re-run onboarding), else the
2886
+ * daemon's own sentence. Both absent when `graph` is present.
2887
+ */
2888
+ export interface RepoGraphResponse {
2889
+ graph: CodeGraphData | null;
2890
+ reason?: string;
2891
+ finding?: RepoFinding;
2892
+ }
2893
+
2828
2894
  export interface GitCommit {
2829
2895
  sha: string;
2830
2896
  shortSha: string;
@@ -3403,8 +3469,10 @@ export interface ChatScope {
3403
3469
  cwd: string;
3404
3470
  /** Whether a READ-ONLY estate MCP over a code graph is attached, and why / why not. `repoLabel`
3405
3471
  * is the estate label the project graph indexes the (single) scoped repo under, when the
3406
- * binding was repo-bound — informational; the engine binds by graph path. */
3407
- graph: { bound: boolean; reason: string; repoLabel?: string };
3472
+ * binding was repo-bound — informational; the engine binds by graph path. `action` (api-types
3473
+ * 0.35.0, F-2R2-008) names the UI action that would change a `bound: false` outcome, when one
3474
+ * would: `projects.graph.refresh` = build the project graph from the project page. */
3475
+ graph: { bound: boolean; reason: string; repoLabel?: string; action?: ProjectGraphAction };
3408
3476
  /** `crew.repo` members of the project whose registry record is gone — named, not readable. */
3409
3477
  dangling: string[];
3410
3478
  }
@@ -3416,6 +3484,18 @@ export interface ChatSeatOutcome {
3416
3484
  error?: string;
3417
3485
  }
3418
3486
 
3487
+ /**
3488
+ * One seat a `POST /chats` did NOT seat, and why (api-types 0.35.0, F-2R2-007): a DEFAULT seat the
3489
+ * daemon's admission dropped before the engine saw it (signed out; not admissible to a scoped chat
3490
+ * — its ACP adapter asks no permissions and arms no sandbox, or it has no ACP adapter), or a
3491
+ * REQUESTED seat (`clis`) the engine refused (`ChatSeatOutcome.ok: false`, its `error` repeated
3492
+ * here as `reason`). One list for the scope card and the thread to read.
3493
+ */
3494
+ export interface ChatSeatRefusal {
3495
+ cliKey: string;
3496
+ reason: string;
3497
+ }
3498
+
3419
3499
  /** `POST /chats` → 201. */
3420
3500
  export interface ChatOpenResponse {
3421
3501
  chatId: string;
@@ -3424,8 +3504,27 @@ export interface ChatOpenResponse {
3424
3504
  scope: ChatScope;
3425
3505
  /** Present when the chat opened but its `crew.chat` filing into `projectId` failed. */
3426
3506
  projectAttachError?: string;
3507
+ /** Every seat that was asked for or defaulted and is NOT in `seats` as warm, with its reason
3508
+ * (api-types 0.35.0). Empty when every seat warmed; absent on a daemon predating the field. */
3509
+ refused?: ChatSeatRefusal[];
3427
3510
  }
3428
3511
 
3512
+ /**
3513
+ * A seat refused at `POST /chats` (api-types 0.35.0, F-2R2-007). DAEMON-SYNTHETIC: broadcast
3514
+ * straight to `/ws` once per refused seat, right after the open, so the chat thread can say why a
3515
+ * seat is missing (the studio's `chat-scope-admission` copy) — the engine emits nothing for a seat
3516
+ * it never saw. `chat` names the chat the way the engine's `chatClosed` does; `project_id` rides
3517
+ * along when the chat was filed. An anonymous object type on purpose, like the stall frames, so it
3518
+ * flows through `CoreEvent`-typed seams.
3519
+ */
3520
+ export type ChatSeatRefusedFrame = {
3521
+ type: 'chatSeatRefused';
3522
+ chat: string;
3523
+ cliKey: string;
3524
+ reason: string;
3525
+ project_id?: string;
3526
+ };
3527
+
3429
3528
  /** One live chat on `GET /chats` (FINDING-027 gap 4; scope fields with crew#502). */
3430
3529
  export interface ChatSummary {
3431
3530
  chatId: string;
@@ -3522,11 +3621,21 @@ export interface ProjectGraphRepo {
3522
3621
  }
3523
3622
 
3524
3623
  /** `GET /projects/:id/graph` — what the project graph holds and what it cannot answer. */
3624
+ /** The UI action that resolves a project-graph state or a declined binding (api-types 0.35.0):
3625
+ * `projects.graph.refresh` = `POST /projects/:id/graph/refresh`, surfaced as the project page's
3626
+ * build/refresh control. */
3627
+ export type ProjectGraphAction = 'projects.graph.refresh';
3628
+
3525
3629
  export interface ProjectGraphStatus {
3526
3630
  projectId: string;
3527
3631
  state: ProjectGraphState;
3528
- /** One sentence naming the state's cause and its remedy. Always present, never empty. */
3632
+ /** One sentence naming the state's cause and its remedy, in the operator's words — never a raw
3633
+ * route (F-2R2-008); the route rides on `action`. Always present, never empty. */
3529
3634
  detail: string;
3635
+ /** Present when one UI action resolves the state (today: `not-indexed` with registered members
3636
+ * → `projects.graph.refresh`). Absent when no single action does (dangling-only members, no
3637
+ * members, or a graph that is already built). api-types 0.35.0. */
3638
+ action?: ProjectGraphAction;
3530
3639
  /** Absolute path of the co-located database; `null` when there is none to point at. */
3531
3640
  dbPath: string | null;
3532
3641
  repos: ProjectGraphRepo[];
@@ -4082,16 +4191,24 @@ export interface DiagnosticsGovernanceDeadletters {
4082
4191
  /** `true` when the fold stopped at its byte cap — `count` is then a floor. */
4083
4192
  truncated: boolean;
4084
4193
  /** The pre-fix outbox under HOME (`~/.something-wicked/wicked-apps/emit-outbox.ndjson`) when it exists and is
4085
- * non-empty — events earlier daemons on this host spooled there; `null` otherwise. Reported, never written. */
4086
- legacyOutbox: { path: string; bytes: number } | null;
4194
+ * non-empty — events earlier daemons on this host spooled there; `null` otherwise. Reported, never written.
4195
+ * `scope` (api-types 0.35.0, F-2R2-006): `own` = this daemon runs in that HOME's default state home, so the
4196
+ * file is its own earlier versions' outbox (the finding is a warning with the replay recipe); `host` = this
4197
+ * daemon's state home is isolated, so the file — shared by every daemon on the host — cannot be attributed
4198
+ * to it (an `info` finding with a read-only `--dry-run` inspect recipe and no replay). REQUIRED, deliberately:
4199
+ * the daemon always attributes the file it reports, so a `legacyOutbox` object without `scope` never leaves a
4200
+ * daemon shipping this contract; a skin that talks to an OLDER daemon must treat the whole `legacyOutbox`
4201
+ * object as best-effort (it predates the attribution), not the field alone. */
4202
+ legacyOutbox: { path: string; bytes: number; scope: 'own' | 'host' } | null;
4087
4203
  }
4088
4204
 
4089
4205
  /** One governance finding. `governance.store` (error) = no store resolved, every emit dead-letters;
4090
- * `governance.deadletter` (error) = the outbox holds entries; `governance.legacy-outbox` (warning) =
4091
- * the pre-fix HOME outbox exists. Every message names the replay command. */
4206
+ * `governance.deadletter` (error) = the outbox holds entries; `governance.legacy-outbox` = the pre-fix
4207
+ * HOME outbox exists — `warning` with the replay command when it is this daemon's own, `info` with none
4208
+ * when it is shared across the host's daemons and not this one's (api-types 0.35.0). */
4092
4209
  export interface DiagnosticsGovernanceFinding {
4093
4210
  kind: 'governance.store' | 'governance.deadletter' | 'governance.legacy-outbox';
4094
- severity: 'warning' | 'error';
4211
+ severity: 'info' | 'warning' | 'error';
4095
4212
  message: string;
4096
4213
  }
4097
4214
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.34.0",
4
- "description": "The wire contract of the wicked-crew daemon's /api/v1 REST surface and /ws CoreEvent frames — types only, zero runtime",
3
+ "version": "0.35.0",
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",
7
7
  "exports": {