wicked-crew-api-types 0.110.0 → 0.115.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 +371 -16
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -288,6 +288,18 @@ export interface AgentSession {
288
288
  id: string;
289
289
  workflow_id: string;
290
290
  problem: string;
291
+ /**
292
+ * (api-types 0.113.0; operator ruling 2026-10-12) The run's SHORT JOB TITLE, derived by the daemon
293
+ * at DTO assembly on `GET /runs` and `GET /runs/:id` from {@link problem} — deterministic, at most
294
+ * 60 characters (an ellipsis included), so every skin shows the same headline: the operator's words
295
+ * without an attached studio context pack or step scaffold, cut at the first clause and then at an
296
+ * aside ("— …", ", meaning …", " when …"), which reads as a clause end; only a cut at a word boundary
297
+ * (no aside left) ends in "…". Onboarding runs read
298
+ * "Set up <repo>"; a chat's ask run reads "A conversation about <repos>". The full text stays in
299
+ * `problem` (show it on hover). ABSENT on a daemon before this field: a skin then falls back to its
300
+ * own first-clause cut of `problem`, never an invented title.
301
+ */
302
+ title?: string;
291
303
  entity_mode: EntityMode;
292
304
  collection_scope: string | null;
293
305
  clis: string[];
@@ -502,10 +514,13 @@ export interface AgentSession {
502
514
  * {@link created_at} ("started" ≡ "created" — the ONE launch instant) it gives a run its own clock;
503
515
  * a skin prefers these over the moment it happened to attach.
504
516
  *
505
- * ABSENT — never `null`, never fabricated — when the daemon has no `run.ended` entry: a run
506
- * still live, a run that terminalled before this field existed or before THIS daemon booted
507
- * (no re-emission at boot), a lost trail, or the one crash window between the engine's status
508
- * write and the daemon's synchronous audit record. Read with `typeof === 'number'`; a duration
517
+ * A terminal run with no `run.ended` entry (it ended before this field existed, or while no
518
+ * daemon was watching) is dated from the FIRST terminal frame in the engine's event log
519
+ * (`GET /runs/:id/events`), derived at read time and never written back (crew#985).
520
+ *
521
+ * ABSENT — never `null`, never fabricated — when neither source has it: a run still live, or a
522
+ * terminal run with no `run.ended` entry whose event log holds no terminal frame (it predates
523
+ * the log). Read with `typeof === 'number'`; a duration
509
524
  * or a "finished N minutes ago" MUST be omitted for an undated run, never derived from now.
510
525
  * Distinct from {@link finished_at} (engine-side unix MILLIS, retention bookkeeping).
511
526
  */
@@ -997,9 +1012,9 @@ export interface RosterSeat {
997
1012
  /**
998
1013
  * The shell invocation that runs this seat's own interactive login flow (seat sign-in;
999
1014
  * wicked-core PR#278 `AgenticCli.login_invocation`). Passed through from the engine roster
1000
- * VERBATIM — the daemon never synthesizes one. The studio hosts it in a PTY terminal
1001
- * (`POST /terminals`) so every CLI's native sign-in gets one uniform surface. Absent on an
1002
- * engine predating the field (serde omits `None`) and on seats with no known login flow.
1015
+ * VERBATIM — the daemon never synthesizes one. The operator runs it in their own terminal (the
1016
+ * Agents page copies it; `RosterSeat.issues[].commands` carries a `$HOME` display form). Absent on
1017
+ * an engine predating the field (serde omits `None`) and on seats with no known login flow.
1003
1018
  */
1004
1019
  login_invocation?: string;
1005
1020
  /**
@@ -1037,7 +1052,9 @@ export interface RosterSeat {
1037
1052
  */
1038
1053
  auth_source?: 'seat-stderr' | 'probe';
1039
1054
  /** Present with `auth_source: 'seat-stderr'`, and with `probe` when it read signed out: the
1040
- * seat's own words, bounded. */
1055
+ * seat's own words, bounded. From api-types 0.115.0 (A8) account identifiers are dropped before
1056
+ * they reach the wire: a JSON status keeps only `loggedIn` / `authMethod` / `apiProvider`, and
1057
+ * email-, id- and key-shaped strings are masked. */
1041
1058
  auth_evidence?: string;
1042
1059
  /**
1043
1060
  * Present with `auth_source: 'probe'` (crew#630): ISO-8601 of the seat's own auth-status check
@@ -1056,7 +1073,8 @@ export interface RosterSeat {
1056
1073
  * or could not tell). Optional on the wire: a daemon before it sends none.
1057
1074
  */
1058
1075
  login_check?: 'live' | 'status' | 'unverified';
1059
- /** Present unless `login_check` is `live`: why, in the operator's words ("login unverified — …"). */
1076
+ /** Present unless `login_check` is `live`: why, in the operator's words ("login unverified — …").
1077
+ * Scrubbed like `auth_evidence` (A8). */
1060
1078
  login_note?: string;
1061
1079
  /** Present when `auth` is `not_required`: the free tier the seat answers on. */
1062
1080
  free_tier?: string;
@@ -1106,9 +1124,156 @@ export interface RosterSeat {
1106
1124
  * engine (`clisJson` strips it).
1107
1125
  */
1108
1126
  governance_mode?: Record<GovernanceScopeKind, SeatGovernanceMode>;
1127
+ /**
1128
+ * (api-types 0.115.0, DES-seats-page A1) The seat's installed version, for EVERY seat (not only
1129
+ * the pinned ones `version_pin` covers), read from its registry `version_probe` in the background.
1130
+ * ABSENT until the first reading, and for a pinned seat until its pin has been probed too.
1131
+ */
1132
+ version?: SeatVersion;
1133
+ /**
1134
+ * (api-types 0.115.0, A2) The account KIND the seat is signed in with — never an email, an account
1135
+ * or an organisation id. Present when `auth` is `signed_in` (`unknown` when the seat's status
1136
+ * command states no kind) or `not_required` (`free`).
1137
+ */
1138
+ account?: SeatAccount;
1139
+ /**
1140
+ * (api-types 0.115.0, A3) The engine's bench of the seat that is ACTIVE now: a run benched it on
1141
+ * its worker's or judge's own refusal, and crew keeps it out of new launches until `lifts_at`,
1142
+ * its next good turn, or — for an account bench (`not_logged_in`, `quota_exhausted`,
1143
+ * `usage_limit`) — a live sign-in check that answered after it. The week's history stays in
1144
+ * `GET /roster/record`. ABSENT when there is no active bench.
1145
+ */
1146
+ recent_bench?: SeatRecentBench;
1147
+ /**
1148
+ * (api-types 0.115.0, A5) Whether a job of each scope kind would give the seat work, including
1149
+ * the engine's launcher benches (core#769's codex worktree bench, via `Core.worktreeBenched`).
1150
+ * ABSENT on a daemon whose engine addon cannot answer the worktree bench (wicked-core-ts without
1151
+ * `worktreeBenched`): crew does not restate the engine's rule.
1152
+ */
1153
+ work_admission?: Record<GovernanceScopeKind, SeatWorkAdmission>;
1154
+ /**
1155
+ * (api-types 0.115.0, A4) Whether the seat can run the isolated QE review. Since wicked-core#917
1156
+ * (core-ts 0.9.9) the engine starts the reviewer as a fresh session on any run seat it admits, so
1157
+ * a seat is eligible when it is signed in, a run bound to one repository keeps it (QE runs only
1158
+ * there), and the host's skill routing admits it to the QE skill (`Core.qeReviewerAdmitted`, wicked-core#923: a
1159
+ * Claude-only skills root admits claude seats only). A reviewer-only seat counts. ABSENT unless
1160
+ * the engine answers both `Core.worktreeBenched` (wicked-core#920) and `Core.qeReviewerAdmitted` (wicked-core#923).
1161
+ */
1162
+ qe_reviewer?: SeatQeReviewer;
1163
+ /**
1164
+ * (api-types 0.115.0, A6) What the Agents page shows for the seat, most important first (problem
1165
+ * before warning before note; within one, safety before availability). Crew sends codes and
1166
+ * facts; the client owns the words per code and shows `message` only for a code it does not know.
1167
+ */
1168
+ issues?: SeatIssue[];
1109
1169
  [k: string]: unknown;
1110
1170
  }
1111
1171
 
1172
+ /** `RosterSeat.version` (api-types 0.115.0). */
1173
+ export interface SeatVersion {
1174
+ /** The first non-empty line of the seat's `--version`, home written `~`; `null` when it did not answer. */
1175
+ installed: string | null;
1176
+ /** The build the seat's governance was proven on (`acp.verified_version`); `null` when it pins none. */
1177
+ proven: string | null;
1178
+ /** `proven` — the installed build is the pinned one; `unproven` — it is not (governance fails
1179
+ * closed); `no_pin` — the seat pins no build. */
1180
+ status: 'proven' | 'unproven' | 'no_pin';
1181
+ /** ISO-8601 of the reading. */
1182
+ checked_at: string;
1183
+ /** How the binary on PATH was installed, from its resolved path: under `node_modules` = `npm`, a
1184
+ * Homebrew prefix = `brew`, else `other`; `null` when it is not on PATH. */
1185
+ install_source: 'npm' | 'brew' | 'other' | null;
1186
+ }
1187
+
1188
+ /** `RosterSeat.account` (api-types 0.115.0). */
1189
+ export interface SeatAccount {
1190
+ kind: 'subscription' | 'api_key' | 'free' | 'unknown';
1191
+ /** A provider-public plan name (`Max`, `Pro`, `Team`, `Enterprise`), only from a fixed table. */
1192
+ plan?: string;
1193
+ }
1194
+
1195
+ /** `RosterSeat.recent_bench` (api-types 0.115.0). */
1196
+ export interface SeatRecentBench {
1197
+ /** The engine's cause token: `quota_exhausted`, `not_logged_in`, `not_installed`,
1198
+ * `approval_unavailable`, `timed_out`, … */
1199
+ kind: string;
1200
+ /** Runs that benched the seat while this bench was active (at least 1). */
1201
+ runs: number;
1202
+ /** ISO-8601 of the latest bench. */
1203
+ last_at: string;
1204
+ /** ISO-8601 of when crew stops carrying it to new launches. Crew's window, NOT a provider reset
1205
+ * time (no provider states one on the wire today). */
1206
+ lifts_at: string;
1207
+ /** Who benched it in the run: `worker` or `judge`. */
1208
+ source: string;
1209
+ /** The engine's own reason, verbatim (technical details). */
1210
+ reason: string;
1211
+ }
1212
+
1213
+ /** Why a seat would get no work, one code per refusal (api-types 0.115.0). */
1214
+ export type SeatWorkReasonCode =
1215
+ | 'signed_out'
1216
+ | 'not_enabled'
1217
+ | 'reviewer_only'
1218
+ | 'recent_bench'
1219
+ | 'login_pending'
1220
+ | 'worktree_bench'
1221
+ | 'scope_ungoverned';
1222
+
1223
+ /** `RosterSeat.work_admission[scope]` (api-types 0.115.0). `source`: `auth` — signed out;
1224
+ * `launcher` — a launch benches it (disabled, reviewer-only, a recent bench, a pending login
1225
+ * check, the engine's worktree bench); `scope` — the scope's governance rule refuses it. */
1226
+ export type SeatWorkAdmission =
1227
+ | { ok: true }
1228
+ | { ok: false; reason_code: SeatWorkReasonCode; source: 'auth' | 'launcher' | 'scope'; reason: string };
1229
+
1230
+ /** `RosterSeat.qe_reviewer` (api-types 0.115.0). */
1231
+ export type SeatQeReviewer =
1232
+ | { ok: true }
1233
+ | {
1234
+ ok: false;
1235
+ /** `skill_not_admitted`: this host's skills root admits only a claude seat to the QE skill. */
1236
+ reason_code: Exclude<SeatWorkReasonCode, 'reviewer_only' | 'scope_ungoverned'> | 'skill_not_admitted';
1237
+ reason: string;
1238
+ };
1239
+
1240
+ /**
1241
+ * One `RosterSeat.issues` entry (api-types 0.115.0). Today's codes: `signed_out`, `qe_blocked`
1242
+ * (problems); `quota`, `usage_limit`, `benched`, `codex_worktree`, `version_unproven`,
1243
+ * `unchecked` (`params.why`: `no_governance` | `no_host_boundary`), `fence_scoped`,
1244
+ * `live_check_failed` (warnings); `opt_in`, `no_qe`, `unverified` (notes). A client must tolerate
1245
+ * an unknown code.
1246
+ */
1247
+ export interface SeatIssue {
1248
+ code: string;
1249
+ severity: 'problem' | 'warning' | 'note';
1250
+ /** Names, versions, counts and ISO times only — never a CLI's free text. */
1251
+ params: Record<string, string | number>;
1252
+ /** Crew's one line, for a client that does not know the code. */
1253
+ message: string;
1254
+ commands?: SeatIssueCommand[];
1255
+ }
1256
+
1257
+ /** A command an issue offers. Run the roster's `login_invocation` / `logout_invocation` (or
1258
+ * `<binary> --version`); `display` is the safe rendering, the home directory written `$HOME`. */
1259
+ export interface SeatIssueCommand {
1260
+ purpose: 'sign_in' | 'sign_out' | 'version';
1261
+ display: string;
1262
+ }
1263
+
1264
+ /**
1265
+ * `GET /roster[?refresh=<key>]` (api-types 0.115.0 names it). With `?refresh=<key>` the daemon
1266
+ * re-runs that seat's sign-in check and waits for it, at most 20 s, before answering (A3b); 400
1267
+ * when the key is not a roster seat.
1268
+ */
1269
+ export interface RosterResponse {
1270
+ roster: RosterSeat[];
1271
+ /** Present on a `?refresh=` read: `probed` — the answer is fresh; `timed_out` — still running
1272
+ * (the roster shows the last reading; the check keeps going); `not_probed` — the seat has no
1273
+ * sign-in check (it reads its credential file). */
1274
+ refresh?: { key: string; outcome: 'probed' | 'timed_out' | 'not_probed' };
1275
+ }
1276
+
1112
1277
  /** The engine's governance class names (IG1-core-3). */
1113
1278
  export type EngineGovernanceClass = 'acp_input_governance' | 'os_sandbox' | 'none';
1114
1279
 
@@ -1170,14 +1335,21 @@ export interface RosterSeatCouncilBench {
1170
1335
  }
1171
1336
 
1172
1337
  /**
1173
- * `GET /roster/record?days=N` (api-types 0.52.0): each seat's record over the last N days (default 7,
1174
- * max 30), folded from the runs' durable event logs (studio's weekly 1:1 per agent). Nothing new is
1338
+ * `GET /roster/record?days=N[&project=<id>]` (api-types 0.52.0): each seat's record over the last N days
1339
+ * (default 7, max 90 from api-types 0.113.0; was 30), folded from the runs' durable event logs (studio's
1340
+ * weekly 1:1 per agent; the dashboards sum `costUsd` across seats for a window's spend). Nothing new is
1175
1341
  * stored; the window is by event time. A unit's seat is `unitDistributed.cli` (moved by
1176
1342
  * `unitReassigned.newCli`), else the unit row's `assigned_cli`. 503 when the engine has no event-log
1177
1343
  * read binding (a missing binding is not an empty week).
1178
1344
  */
1179
1345
  export interface SeatRecordResponse {
1180
1346
  days: number;
1347
+ /**
1348
+ * (api-types 0.113.0) The project the read was scoped to (`?project=<id>`: only that project's runs
1349
+ * were folded). ABSENT on an unscoped read AND on a daemon before the parameter, which ignores it and
1350
+ * answers for every run: trust a project-scoped spend only when this echoes the id you asked for.
1351
+ */
1352
+ project?: string;
1181
1353
  /** Window start, unix MILLIS. */
1182
1354
  since: number;
1183
1355
  /** Window end (the read time), unix MILLIS. */
@@ -5007,9 +5179,10 @@ export interface DomainCoverage {
5007
5179
  }
5008
5180
 
5009
5181
  /**
5010
- * `POST /seats/:cli/login` and `POST /seats/:cli/logout` (crew#615): the PTY size for the terminal
5011
- * the daemon opens running the seat's own `login_invocation` / `logout_invocation`. Both optional
5012
- * (default 100 x 30).
5182
+ * `POST /seats/:cli/logout` (crew#615): the PTY size for the terminal the daemon opens running the
5183
+ * seat's own `logout_invocation`. Both optional (default 100 x 30). `POST /seats/:cli/login` is
5184
+ * GONE from api-types 0.115.0 (DES-seats-page Q3): sign-in is a command the operator runs in their
5185
+ * own terminal (`RosterSeat.login_invocation`).
5013
5186
  */
5014
5187
  export interface SeatSessionBody {
5015
5188
  cols?: number;
@@ -5025,6 +5198,7 @@ export interface SeatSessionResponse {
5025
5198
  terminalId: string;
5026
5199
  /** The seat key the command was run for. */
5027
5200
  cli: string;
5201
+ /** `login` is no longer produced (api-types 0.115.0: the login route is gone). */
5028
5202
  action: 'login' | 'logout';
5029
5203
  }
5030
5204
 
@@ -9490,8 +9664,22 @@ export interface McpPreviewTool {
9490
9664
  description: string | null;
9491
9665
  annotations: McpToolAnnotations | null;
9492
9666
  inputSchema: Record<string, unknown> | null;
9667
+ /** The class the tool will have once saved: `classOverride ?? ` the class its annotations imply. */
9493
9668
  class: McpToolClass;
9669
+ /**
9670
+ * (api-types 0.111.0) The operator's class override this save keeps: the registered tool's, while
9671
+ * its schema is unchanged; `null` for a new or changed tool, or one with no override.
9672
+ */
9673
+ classOverride: McpToolClass | null;
9494
9674
  schemaHash: string;
9675
+ /**
9676
+ * (api-types 0.111.0, G1) The switch `POST /mcp/servers` gives this tool when `enabledWrites`
9677
+ * does not name it. A `write` or `destructive` tool that is new, or whose schema changed since
9678
+ * the last save, is `false`: registered DISABLED until the operator grants it. A tool whose saved
9679
+ * schema is unchanged keeps its switch; a new `read` tool is `true`. Enabling a tool is not
9680
+ * approving it: `MCP-FIRST-USE` still asks on its first call.
9681
+ */
9682
+ enabledOnSave: boolean;
9495
9683
  }
9496
9684
 
9497
9685
  /**
@@ -9517,6 +9705,12 @@ export interface McpPreviewResponse {
9517
9705
  diff: McpToolDiff | null;
9518
9706
  /** `rest` only (api-types 0.64.0): operations that could not be wrapped, each with why. */
9519
9707
  skipped?: string[];
9708
+ /**
9709
+ * `rest` only (api-types 0.112.0, G2): where the tools' calls would go, checked against the
9710
+ * document's `servers`. When `confirmRequired`, `POST /mcp/servers` needs `allowOrigin` set to
9711
+ * exactly `egress.origin`.
9712
+ */
9713
+ egress?: McpRestEgress;
9520
9714
  /**
9521
9715
  * Each tool's decision per phase role × seat × mode under the current policies and approvals,
9522
9716
  * judged as if this preview were saved now (api-types 0.63.0); see `withdrawOnSave`. `null` when
@@ -9528,6 +9722,57 @@ export interface McpPreviewResponse {
9528
9722
  /** `POST /mcp/servers`. No `previewHash`, or one that is unknown or expired, is a 409. */
9529
9723
  export interface SaveMcpServerBody {
9530
9724
  previewHash?: string;
9725
+ /**
9726
+ * (api-types 0.111.0, G1) The operator's write grant: names of this preview's `write` or
9727
+ * `destructive` tools to register ENABLED. Every other write tool that is new or changed is
9728
+ * registered disabled (`McpPreviewTool.enabledOnSave`). A name the preview does not list is a 400
9729
+ * `unknown_tool`; a tool that would not be a write once saved (its annotations, or a class override
9730
+ * that survives an unchanged schema) a 400 `not_a_write_tool`. Both are refused before any approval
9731
+ * is withdrawn and leave the preview usable. A grant from anyone but a human
9732
+ * operator a 403 `write_grant_human_only`. Each grant is audited `mcp.tool.write_granted`.
9733
+ */
9734
+ enabledWrites?: string[];
9735
+ /**
9736
+ * (api-types 0.112.0, G2) The operator naming the exact origin a `rest` server's calls go to
9737
+ * (`McpPreviewResponse.egress.origin`). Required when the preview's `egress.confirmRequired`
9738
+ * (the base URL matches none of the document's `servers`, or its host is a loopback or private
9739
+ * address, or did not resolve); without it, or with any other value, the save is a 409 `egress_unconfirmed`. It is
9740
+ * remembered with the server, so re-saving over the same origin does not ask again. Human
9741
+ * operator only (403 `egress_confirm_human_only`); audited `mcp.server.egress_confirmed`. A 400
9742
+ * `egress_not_rest` for a server that is not `rest`.
9743
+ */
9744
+ allowOrigin?: string;
9745
+ }
9746
+
9747
+ /**
9748
+ * (api-types 0.112.0, G2, DES-data-connectors §3) A `rest` server's egress as its preview found it.
9749
+ * A REST tool's schema hash also covers `{origin, basePath, auth header}`, so a changed target
9750
+ * re-registers its tools and withdraws their approvals.
9751
+ */
9752
+ export interface McpRestEgress {
9753
+ /** The base URL's origin (`https://api.example.com`): the exact string `allowOrigin` names. */
9754
+ origin: string;
9755
+ /** The base URL's path, no trailing slash (`""` at the root). */
9756
+ basePath: string;
9757
+ /**
9758
+ * The document's `servers` crew could resolve, as absolute URLs (`{variable}` = its default; a
9759
+ * relative URL resolves against `openapiUrl`). No `servers` means `/`, per OpenAPI 3.
9760
+ */
9761
+ servers: string[];
9762
+ /** The origin is one server's and the base path is that server's path or under it. */
9763
+ matches: boolean;
9764
+ /** The host is `localhost`, or is or resolves to a loopback/private/link-local/unique-local address. */
9765
+ privateAddress: boolean;
9766
+ /**
9767
+ * `false` = the host is a name that did not resolve at preview, so crew could not check that it
9768
+ * is not private. An IP literal is always `true`.
9769
+ */
9770
+ resolved: boolean;
9771
+ /**
9772
+ * `!matches || privateAddress || !resolved`, unless this origin was already confirmed for this
9773
+ * server by an earlier save: the save needs `allowOrigin`.
9774
+ */
9775
+ confirmRequired: boolean;
9531
9776
  }
9532
9777
 
9533
9778
  /** `PATCH /mcp/servers/:name`. */
@@ -9535,7 +9780,13 @@ export interface PatchMcpServerBody {
9535
9780
  enabled: boolean;
9536
9781
  }
9537
9782
 
9538
- /** `PATCH /mcp/tools/:subject` (subject URL-encoded). At least one field. */
9783
+ /**
9784
+ * `PATCH /mcp/tools/:subject` (subject URL-encoded). At least one field. (G1) A patch that leaves
9785
+ * the tool enabled AND a write (by its annotations, or its class after the patch) when it was not
9786
+ * both before is a write grant: turning a write on, or re-classing an enabled read as a write. A
9787
+ * grant is a human operator's only (else 403 `write_grant_human_only`) and is audited
9788
+ * `mcp.tool.write_granted`. Turning a tool off, and enabling a read, need no grant.
9789
+ */
9539
9790
  export interface PatchMcpToolBody {
9540
9791
  enabled?: boolean;
9541
9792
  classOverride?: McpToolClass | null;
@@ -10138,7 +10389,10 @@ export type EditorPermission =
10138
10389
  | 'media.read'
10139
10390
  | 'artifact.export'
10140
10391
  | 'ui.fullscreen'
10141
- | 'network.media';
10392
+ | 'network.media'
10393
+ /** Talk, through studio's host, to an MCP server the operator connected (DES-MCP-INSPECTOR-001).
10394
+ * No posture rule allows it: the editor's install consent writes its per-build grant. */
10395
+ | 'mcp.session';
10142
10396
 
10143
10397
  /**
10144
10398
  * One registered editor, as Settings → Editors renders it. No path is on the wire: the bundle is
@@ -10193,6 +10447,14 @@ export interface InstallEditorResponse {
10193
10447
  editors: EditorView[];
10194
10448
  check: PackCheckResult;
10195
10449
  conformance: EditorConformanceSummary;
10450
+ /**
10451
+ * The `mcp.session` grant tokens this install consent wrote into `EDITOR-GRANTS` (one per installed
10452
+ * editor that declares it). Absent when no installed editor declares it. `grantError` = the editor is
10453
+ * installed but the ledger could not be edited: a declaring build's `mcp.session` still asks, or (for
10454
+ * a build that no longer declares it) an earlier build's grant was not withdrawn.
10455
+ */
10456
+ granted?: string[];
10457
+ grantError?: string;
10196
10458
  }
10197
10459
 
10198
10460
  /** What the install-time conformance run found (garden `scripts/editor/conformance.py`). */
@@ -10458,3 +10720,96 @@ export interface LearnTopicsResponse {
10458
10720
  repoRef: string;
10459
10721
  topics: LearnTopic[];
10460
10722
  }
10723
+
10724
+ // ── MCP inspector bridge (DES-MCP-INSPECTOR-001 §3) ───────────────────────────────────────────
10725
+ // `/api/v1/mcp-inspect/sessions`: one live connection to an MCP server per session, driven by
10726
+ // studio's host for an `mcp-server` editor. Start, send and delete are human-only; the log is
10727
+ // operator-only. No session id, command, URL, env or header value is ever given to the plugin.
10728
+
10729
+ /** What to connect to: a server in crew's MCP registry, a stdio command, or an HTTP endpoint. */
10730
+ export type McpInspectTarget =
10731
+ | { server: string }
10732
+ | { command: string; args?: string[]; env?: Record<string, string>; cwd?: string }
10733
+ | { url: string; transport?: 'streamable-http' | 'sse'; headers?: Record<string, string> };
10734
+
10735
+ /** `POST /mcp-inspect/sessions` */
10736
+ export interface McpInspectStartBody {
10737
+ target: McpInspectTarget;
10738
+ }
10739
+
10740
+ export type McpInspectState = 'connecting' | 'ready' | 'closed' | 'failed';
10741
+
10742
+ /** The server's `initialize` result, secrets scrubbed. */
10743
+ export interface McpInspectInitialize {
10744
+ protocolVersion: string | null;
10745
+ serverInfo: { name: string; version: string; [k: string]: unknown } | null;
10746
+ capabilities: Record<string, unknown>;
10747
+ instructions: string | null;
10748
+ }
10749
+
10750
+ export interface McpInspectSessionView {
10751
+ id: string;
10752
+ target: {
10753
+ kind: 'server' | 'stdio' | 'streamable-http' | 'sse';
10754
+ /** A short name: the registry name, the command's basename, or the URL's host. */
10755
+ name: string;
10756
+ /** The full command line or URL, for the HOST's header only. */
10757
+ label: string;
10758
+ /** Names only, never values. */
10759
+ envNames: string[];
10760
+ headerNames: string[];
10761
+ };
10762
+ state: McpInspectState;
10763
+ initialize: McpInspectInitialize | null;
10764
+ error: string | null;
10765
+ startedAt: string;
10766
+ /** The last log sequence number written. */
10767
+ lastSeq: number;
10768
+ }
10769
+
10770
+ /** `201` of `POST /mcp-inspect/sessions` */
10771
+ export interface McpInspectStartResponse {
10772
+ session: McpInspectSessionView;
10773
+ }
10774
+
10775
+ /** `POST /mcp-inspect/sessions/:id/rpc` */
10776
+ export interface McpInspectRpcBody {
10777
+ method: string;
10778
+ params?: Record<string, unknown>;
10779
+ }
10780
+
10781
+ export interface McpInspectRpcResponse {
10782
+ /** The server's JSON-RPC answer (`{ result }` or `{ error: { code, message, data? } }`), secrets scrubbed. */
10783
+ response: { result?: unknown; error?: { code: number; message: string; data?: unknown } };
10784
+ ms: number;
10785
+ /** The answer was over the cap and is cut (the log entry carries the cut text). */
10786
+ truncated: boolean;
10787
+ }
10788
+
10789
+ export interface McpInspectLogEntry {
10790
+ seq: number;
10791
+ /** ISO time. */
10792
+ at: string;
10793
+ /** `out` = to the server, `in` = from it, `host` = the bridge's own line (state, exit). */
10794
+ dir: 'out' | 'in' | 'host';
10795
+ kind: 'request' | 'response' | 'notification' | 'stderr' | 'state';
10796
+ method?: string;
10797
+ rpcId?: string | number;
10798
+ /** Round trip, on a response. */
10799
+ ms?: number;
10800
+ error?: boolean;
10801
+ /** The message as JSON (or the stderr text), secrets scrubbed, at most 64 KB. */
10802
+ text: string;
10803
+ truncated?: boolean;
10804
+ }
10805
+
10806
+ /** `GET /mcp-inspect/sessions/:id/log?after=&wait=` (a long poll) */
10807
+ export interface McpInspectLogResponse {
10808
+ entries: McpInspectLogEntry[];
10809
+ /** Pass as `after` next time. */
10810
+ next: number;
10811
+ /** The oldest sequence still held; entries before it were evicted (a gap). */
10812
+ first: number;
10813
+ state: McpInspectState;
10814
+ error: string | null;
10815
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.110.0",
3
+ "version": "0.115.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",