wicked-crew-api-types 0.110.0 → 0.114.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 +211 -8
  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
  */
@@ -1170,14 +1185,21 @@ export interface RosterSeatCouncilBench {
1170
1185
  }
1171
1186
 
1172
1187
  /**
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
1188
+ * `GET /roster/record?days=N[&project=<id>]` (api-types 0.52.0): each seat's record over the last N days
1189
+ * (default 7, max 90 from api-types 0.113.0; was 30), folded from the runs' durable event logs (studio's
1190
+ * weekly 1:1 per agent; the dashboards sum `costUsd` across seats for a window's spend). Nothing new is
1175
1191
  * stored; the window is by event time. A unit's seat is `unitDistributed.cli` (moved by
1176
1192
  * `unitReassigned.newCli`), else the unit row's `assigned_cli`. 503 when the engine has no event-log
1177
1193
  * read binding (a missing binding is not an empty week).
1178
1194
  */
1179
1195
  export interface SeatRecordResponse {
1180
1196
  days: number;
1197
+ /**
1198
+ * (api-types 0.113.0) The project the read was scoped to (`?project=<id>`: only that project's runs
1199
+ * were folded). ABSENT on an unscoped read AND on a daemon before the parameter, which ignores it and
1200
+ * answers for every run: trust a project-scoped spend only when this echoes the id you asked for.
1201
+ */
1202
+ project?: string;
1181
1203
  /** Window start, unix MILLIS. */
1182
1204
  since: number;
1183
1205
  /** Window end (the read time), unix MILLIS. */
@@ -9490,8 +9512,22 @@ export interface McpPreviewTool {
9490
9512
  description: string | null;
9491
9513
  annotations: McpToolAnnotations | null;
9492
9514
  inputSchema: Record<string, unknown> | null;
9515
+ /** The class the tool will have once saved: `classOverride ?? ` the class its annotations imply. */
9493
9516
  class: McpToolClass;
9517
+ /**
9518
+ * (api-types 0.111.0) The operator's class override this save keeps: the registered tool's, while
9519
+ * its schema is unchanged; `null` for a new or changed tool, or one with no override.
9520
+ */
9521
+ classOverride: McpToolClass | null;
9494
9522
  schemaHash: string;
9523
+ /**
9524
+ * (api-types 0.111.0, G1) The switch `POST /mcp/servers` gives this tool when `enabledWrites`
9525
+ * does not name it. A `write` or `destructive` tool that is new, or whose schema changed since
9526
+ * the last save, is `false`: registered DISABLED until the operator grants it. A tool whose saved
9527
+ * schema is unchanged keeps its switch; a new `read` tool is `true`. Enabling a tool is not
9528
+ * approving it: `MCP-FIRST-USE` still asks on its first call.
9529
+ */
9530
+ enabledOnSave: boolean;
9495
9531
  }
9496
9532
 
9497
9533
  /**
@@ -9517,6 +9553,12 @@ export interface McpPreviewResponse {
9517
9553
  diff: McpToolDiff | null;
9518
9554
  /** `rest` only (api-types 0.64.0): operations that could not be wrapped, each with why. */
9519
9555
  skipped?: string[];
9556
+ /**
9557
+ * `rest` only (api-types 0.112.0, G2): where the tools' calls would go, checked against the
9558
+ * document's `servers`. When `confirmRequired`, `POST /mcp/servers` needs `allowOrigin` set to
9559
+ * exactly `egress.origin`.
9560
+ */
9561
+ egress?: McpRestEgress;
9520
9562
  /**
9521
9563
  * Each tool's decision per phase role × seat × mode under the current policies and approvals,
9522
9564
  * judged as if this preview were saved now (api-types 0.63.0); see `withdrawOnSave`. `null` when
@@ -9528,6 +9570,57 @@ export interface McpPreviewResponse {
9528
9570
  /** `POST /mcp/servers`. No `previewHash`, or one that is unknown or expired, is a 409. */
9529
9571
  export interface SaveMcpServerBody {
9530
9572
  previewHash?: string;
9573
+ /**
9574
+ * (api-types 0.111.0, G1) The operator's write grant: names of this preview's `write` or
9575
+ * `destructive` tools to register ENABLED. Every other write tool that is new or changed is
9576
+ * registered disabled (`McpPreviewTool.enabledOnSave`). A name the preview does not list is a 400
9577
+ * `unknown_tool`; a tool that would not be a write once saved (its annotations, or a class override
9578
+ * that survives an unchanged schema) a 400 `not_a_write_tool`. Both are refused before any approval
9579
+ * is withdrawn and leave the preview usable. A grant from anyone but a human
9580
+ * operator a 403 `write_grant_human_only`. Each grant is audited `mcp.tool.write_granted`.
9581
+ */
9582
+ enabledWrites?: string[];
9583
+ /**
9584
+ * (api-types 0.112.0, G2) The operator naming the exact origin a `rest` server's calls go to
9585
+ * (`McpPreviewResponse.egress.origin`). Required when the preview's `egress.confirmRequired`
9586
+ * (the base URL matches none of the document's `servers`, or its host is a loopback or private
9587
+ * address, or did not resolve); without it, or with any other value, the save is a 409 `egress_unconfirmed`. It is
9588
+ * remembered with the server, so re-saving over the same origin does not ask again. Human
9589
+ * operator only (403 `egress_confirm_human_only`); audited `mcp.server.egress_confirmed`. A 400
9590
+ * `egress_not_rest` for a server that is not `rest`.
9591
+ */
9592
+ allowOrigin?: string;
9593
+ }
9594
+
9595
+ /**
9596
+ * (api-types 0.112.0, G2, DES-data-connectors §3) A `rest` server's egress as its preview found it.
9597
+ * A REST tool's schema hash also covers `{origin, basePath, auth header}`, so a changed target
9598
+ * re-registers its tools and withdraws their approvals.
9599
+ */
9600
+ export interface McpRestEgress {
9601
+ /** The base URL's origin (`https://api.example.com`): the exact string `allowOrigin` names. */
9602
+ origin: string;
9603
+ /** The base URL's path, no trailing slash (`""` at the root). */
9604
+ basePath: string;
9605
+ /**
9606
+ * The document's `servers` crew could resolve, as absolute URLs (`{variable}` = its default; a
9607
+ * relative URL resolves against `openapiUrl`). No `servers` means `/`, per OpenAPI 3.
9608
+ */
9609
+ servers: string[];
9610
+ /** The origin is one server's and the base path is that server's path or under it. */
9611
+ matches: boolean;
9612
+ /** The host is `localhost`, or is or resolves to a loopback/private/link-local/unique-local address. */
9613
+ privateAddress: boolean;
9614
+ /**
9615
+ * `false` = the host is a name that did not resolve at preview, so crew could not check that it
9616
+ * is not private. An IP literal is always `true`.
9617
+ */
9618
+ resolved: boolean;
9619
+ /**
9620
+ * `!matches || privateAddress || !resolved`, unless this origin was already confirmed for this
9621
+ * server by an earlier save: the save needs `allowOrigin`.
9622
+ */
9623
+ confirmRequired: boolean;
9531
9624
  }
9532
9625
 
9533
9626
  /** `PATCH /mcp/servers/:name`. */
@@ -9535,7 +9628,13 @@ export interface PatchMcpServerBody {
9535
9628
  enabled: boolean;
9536
9629
  }
9537
9630
 
9538
- /** `PATCH /mcp/tools/:subject` (subject URL-encoded). At least one field. */
9631
+ /**
9632
+ * `PATCH /mcp/tools/:subject` (subject URL-encoded). At least one field. (G1) A patch that leaves
9633
+ * the tool enabled AND a write (by its annotations, or its class after the patch) when it was not
9634
+ * both before is a write grant: turning a write on, or re-classing an enabled read as a write. A
9635
+ * grant is a human operator's only (else 403 `write_grant_human_only`) and is audited
9636
+ * `mcp.tool.write_granted`. Turning a tool off, and enabling a read, need no grant.
9637
+ */
9539
9638
  export interface PatchMcpToolBody {
9540
9639
  enabled?: boolean;
9541
9640
  classOverride?: McpToolClass | null;
@@ -10138,7 +10237,10 @@ export type EditorPermission =
10138
10237
  | 'media.read'
10139
10238
  | 'artifact.export'
10140
10239
  | 'ui.fullscreen'
10141
- | 'network.media';
10240
+ | 'network.media'
10241
+ /** Talk, through studio's host, to an MCP server the operator connected (DES-MCP-INSPECTOR-001).
10242
+ * No posture rule allows it: the editor's install consent writes its per-build grant. */
10243
+ | 'mcp.session';
10142
10244
 
10143
10245
  /**
10144
10246
  * One registered editor, as Settings → Editors renders it. No path is on the wire: the bundle is
@@ -10193,6 +10295,14 @@ export interface InstallEditorResponse {
10193
10295
  editors: EditorView[];
10194
10296
  check: PackCheckResult;
10195
10297
  conformance: EditorConformanceSummary;
10298
+ /**
10299
+ * The `mcp.session` grant tokens this install consent wrote into `EDITOR-GRANTS` (one per installed
10300
+ * editor that declares it). Absent when no installed editor declares it. `grantError` = the editor is
10301
+ * installed but the ledger could not be edited: a declaring build's `mcp.session` still asks, or (for
10302
+ * a build that no longer declares it) an earlier build's grant was not withdrawn.
10303
+ */
10304
+ granted?: string[];
10305
+ grantError?: string;
10196
10306
  }
10197
10307
 
10198
10308
  /** What the install-time conformance run found (garden `scripts/editor/conformance.py`). */
@@ -10458,3 +10568,96 @@ export interface LearnTopicsResponse {
10458
10568
  repoRef: string;
10459
10569
  topics: LearnTopic[];
10460
10570
  }
10571
+
10572
+ // ── MCP inspector bridge (DES-MCP-INSPECTOR-001 §3) ───────────────────────────────────────────
10573
+ // `/api/v1/mcp-inspect/sessions`: one live connection to an MCP server per session, driven by
10574
+ // studio's host for an `mcp-server` editor. Start, send and delete are human-only; the log is
10575
+ // operator-only. No session id, command, URL, env or header value is ever given to the plugin.
10576
+
10577
+ /** What to connect to: a server in crew's MCP registry, a stdio command, or an HTTP endpoint. */
10578
+ export type McpInspectTarget =
10579
+ | { server: string }
10580
+ | { command: string; args?: string[]; env?: Record<string, string>; cwd?: string }
10581
+ | { url: string; transport?: 'streamable-http' | 'sse'; headers?: Record<string, string> };
10582
+
10583
+ /** `POST /mcp-inspect/sessions` */
10584
+ export interface McpInspectStartBody {
10585
+ target: McpInspectTarget;
10586
+ }
10587
+
10588
+ export type McpInspectState = 'connecting' | 'ready' | 'closed' | 'failed';
10589
+
10590
+ /** The server's `initialize` result, secrets scrubbed. */
10591
+ export interface McpInspectInitialize {
10592
+ protocolVersion: string | null;
10593
+ serverInfo: { name: string; version: string; [k: string]: unknown } | null;
10594
+ capabilities: Record<string, unknown>;
10595
+ instructions: string | null;
10596
+ }
10597
+
10598
+ export interface McpInspectSessionView {
10599
+ id: string;
10600
+ target: {
10601
+ kind: 'server' | 'stdio' | 'streamable-http' | 'sse';
10602
+ /** A short name: the registry name, the command's basename, or the URL's host. */
10603
+ name: string;
10604
+ /** The full command line or URL, for the HOST's header only. */
10605
+ label: string;
10606
+ /** Names only, never values. */
10607
+ envNames: string[];
10608
+ headerNames: string[];
10609
+ };
10610
+ state: McpInspectState;
10611
+ initialize: McpInspectInitialize | null;
10612
+ error: string | null;
10613
+ startedAt: string;
10614
+ /** The last log sequence number written. */
10615
+ lastSeq: number;
10616
+ }
10617
+
10618
+ /** `201` of `POST /mcp-inspect/sessions` */
10619
+ export interface McpInspectStartResponse {
10620
+ session: McpInspectSessionView;
10621
+ }
10622
+
10623
+ /** `POST /mcp-inspect/sessions/:id/rpc` */
10624
+ export interface McpInspectRpcBody {
10625
+ method: string;
10626
+ params?: Record<string, unknown>;
10627
+ }
10628
+
10629
+ export interface McpInspectRpcResponse {
10630
+ /** The server's JSON-RPC answer (`{ result }` or `{ error: { code, message, data? } }`), secrets scrubbed. */
10631
+ response: { result?: unknown; error?: { code: number; message: string; data?: unknown } };
10632
+ ms: number;
10633
+ /** The answer was over the cap and is cut (the log entry carries the cut text). */
10634
+ truncated: boolean;
10635
+ }
10636
+
10637
+ export interface McpInspectLogEntry {
10638
+ seq: number;
10639
+ /** ISO time. */
10640
+ at: string;
10641
+ /** `out` = to the server, `in` = from it, `host` = the bridge's own line (state, exit). */
10642
+ dir: 'out' | 'in' | 'host';
10643
+ kind: 'request' | 'response' | 'notification' | 'stderr' | 'state';
10644
+ method?: string;
10645
+ rpcId?: string | number;
10646
+ /** Round trip, on a response. */
10647
+ ms?: number;
10648
+ error?: boolean;
10649
+ /** The message as JSON (or the stderr text), secrets scrubbed, at most 64 KB. */
10650
+ text: string;
10651
+ truncated?: boolean;
10652
+ }
10653
+
10654
+ /** `GET /mcp-inspect/sessions/:id/log?after=&wait=` (a long poll) */
10655
+ export interface McpInspectLogResponse {
10656
+ entries: McpInspectLogEntry[];
10657
+ /** Pass as `after` next time. */
10658
+ next: number;
10659
+ /** The oldest sequence still held; entries before it were evicted (a gap). */
10660
+ first: number;
10661
+ state: McpInspectState;
10662
+ error: string | null;
10663
+ }
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.114.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",