wicked-crew-api-types 0.172.0 → 0.175.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 +390 -16
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -12311,9 +12311,12 @@ export interface PutDeliveryFreezeBody {
12311
12311
 
12312
12312
  /**
12313
12313
  * How crew reaches an upstream: an MCP server over stdio or streamable HTTP, or a plain REST API
12314
- * wrapped as tools from its OpenAPI document (`rest`, api-types 0.64.0).
12314
+ * wrapped as tools from its OpenAPI document (`rest`, api-types 0.64.0). (api-types 0.175.0,
12315
+ * DES-APPS-001 §5.1) `sql` (drivers `postgres`, `mysql`, `sqlite`) and `graphql` are Apps data
12316
+ * sources: registered through the same preview/save, but with NO tools — nothing of theirs is ever
12317
+ * offered to a governed run. Their preview answers {@link McpPreviewResponse.source} (the catalog).
12315
12318
  */
12316
- export type McpUpstreamKind = 'mcp-stdio' | 'mcp-http' | 'rest';
12319
+ export type McpUpstreamKind = 'mcp-stdio' | 'mcp-http' | 'rest' | 'sql' | 'graphql';
12317
12320
  /**
12318
12321
  * A tool's class, from its own `tools/list` annotations (never from a carrier): `read` when
12319
12322
  * `readOnlyHint` is true; else `destructive` unless `destructiveHint` is false; else `write`. A tool
@@ -12354,6 +12357,29 @@ export interface McpAuthConfig {
12354
12357
  prefix?: string;
12355
12358
  }
12356
12359
 
12360
+ /**
12361
+ * (api-types 0.174.0, DES-APPS-001 §5.2) The ranges the person confirmed for one server's (or
12362
+ * source's) connections. Every connection crew makes to it goes through ONE dialer that resolves
12363
+ * the host once, checks EVERY address, connects to the checked address (keeping the name for TLS)
12364
+ * and refuses redirects. With nothing confirmed, only global unicast addresses are reached, over
12365
+ * TLS. A loopback or private address is reached only when a range here covers it. `0.0.0.0/8`,
12366
+ * link-local (`169.254.0.0/16`, which holds `169.254.169.254`), CGNAT (`100.64.0.0/10`),
12367
+ * `fd00:ec2::254`, multicast, documentation and reserved ranges are always refused and cannot be
12368
+ * confirmed. An IPv4-mapped IPv6 address is judged as its IPv4 address.
12369
+ */
12370
+ export interface McpAddressPolicy {
12371
+ /**
12372
+ * CIDR ranges wholly inside loopback (`127.0.0.0/8`, `::1/128`) or a private range
12373
+ * (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `fc00::/7`); at most 16. Anything else is a 400.
12374
+ */
12375
+ allow: string[];
12376
+ /**
12377
+ * Plaintext (`http:`) is accepted on a confirmed PRIVATE range. Loopback never needs it; a global
12378
+ * address never gets it. `false`/absent = TLS only.
12379
+ */
12380
+ plaintext?: boolean;
12381
+ }
12382
+
12357
12383
  /**
12358
12384
  * `POST /mcp/servers/preview`. `mcp-stdio` takes `command` (+ `args`); `mcp-http` takes `url`.
12359
12385
  * `rest` takes `url`, the base URL every call of the API is pinned to (its scheme, host and port,
@@ -12375,6 +12401,28 @@ export interface McpServerConfigBody {
12375
12401
  openapi?: Record<string, unknown>;
12376
12402
  /** `rest` only: the operations to wrap, by `operationId` or tool name; absent = all. */
12377
12403
  operations?: string[];
12404
+ /**
12405
+ * (api-types 0.174.0, DES-APPS-001 §5.2) `mcp-http` and `rest` only (a 400 on `mcp-stdio`, a
12406
+ * local program outside the dialer): the loopback/private ranges this server's connections may
12407
+ * reach. The preview already dials under it, so a preview of a server whose host is loopback or
12408
+ * private without a range covering it is a 409 `address_unconfirmed` naming the range to confirm
12409
+ * (`address_refused` for an always-refused address, `plaintext_refused` for http where TLS is
12410
+ * required). A non-empty `allow`, or
12411
+ * `plaintext: true`, is a human operator's only, at the preview and at the save (else 403
12412
+ * `address_confirm_human_only`), and the save audits it `mcp.server.address_confirmed`.
12413
+ */
12414
+ address?: McpAddressPolicy;
12415
+ /**
12416
+ * (api-types 0.175.0, DES-APPS-001 §5.1) `sql` only: the driver and its connection settings. The
12417
+ * password is the secret behind `auth.ref` (`auth` takes only `ref` for `sql`). `sqlite` sources come
12418
+ * from `POST /apps/uploads` (a snapshot digest), not from a preview.
12419
+ */
12420
+ sql?: SqlSourceConfigBody;
12421
+ /**
12422
+ * (api-types 0.175.0) `sql` only: the views (and materialized views) a read may name, as
12423
+ * `schema.view` (MySQL `database.view`). A view not listed is refused by the read policy.
12424
+ */
12425
+ viewsAllowed?: string[];
12378
12426
  /**
12379
12427
  * The secret VALUE this server's keychain entry will hold (wicked-crew#719). The preview is
12380
12428
  * probed with it and it is held with the preview; `POST /mcp/servers` writes it to the OS store
@@ -12453,6 +12501,30 @@ export interface McpServer {
12453
12501
  openapiUrl?: string | null;
12454
12502
  /** `rest` only: the operations that were picked; `null` = all. */
12455
12503
  operations?: string[] | null;
12504
+ /** (api-types 0.175.0) `sql` only: driver and connection settings (`ca` shown as whether one is set). */
12505
+ sql?: SqlSourceView;
12506
+ /** (api-types 0.175.0) `sql` only: views a read may name. */
12507
+ viewsAllowed?: string[];
12508
+ /**
12509
+ * (api-types 0.175.0, DES-APPS-001 §7.4) Postgres `sql` only: the per-source **Allow writes**
12510
+ * switch, `false` on every new source. Only a human operator turns it on or off
12511
+ * (`PUT /sources/:name/allow-writes`); turning it off withdraws every row-write grant on the
12512
+ * source. It is not part of the connection descriptor: reads are unaffected.
12513
+ */
12514
+ allowWrites?: boolean;
12515
+ /**
12516
+ * (api-types 0.175.0) `sql`/`graphql`: the sha256 of the source's connection descriptor (driver,
12517
+ * host, port, database, login, TLS mode, url, auth header, snapshot, confirmed ranges; never
12518
+ * `allowWrites`). Queries, actions and grants bind to it.
12519
+ */
12520
+ descriptorHash?: string;
12521
+ /**
12522
+ * (api-types 0.174.0) `mcp-http` and `rest` only: the ranges confirmed for this server's
12523
+ * connections. A server saved before 0.174.0 shows what crew re-derived for it: the IP literal or
12524
+ * `localhost` it was registered at; a private host NAME is not re-derived, and its calls are
12525
+ * refused until it is saved again with a range.
12526
+ */
12527
+ address?: McpAddressPolicy;
12456
12528
  authState: McpAuthState;
12457
12529
  enabled: boolean;
12458
12530
  health: McpHealth;
@@ -12534,7 +12606,17 @@ export interface McpPreviewResponse {
12534
12606
  auth: McpAuthConfig | null;
12535
12607
  openapiUrl?: string | null;
12536
12608
  operations?: string[] | null;
12609
+ /** (api-types 0.174.0) `mcp-http` and `rest` only: the ranges this preview dialled under. */
12610
+ address?: McpAddressPolicy;
12611
+ /** (api-types 0.175.0) `sql` only. */
12612
+ sql?: SqlSourceView;
12613
+ viewsAllowed?: string[];
12537
12614
  };
12615
+ /**
12616
+ * (api-types 0.175.0, DES-APPS-001 §5.1) `sql`/`graphql` only: what the describe found —
12617
+ * structure, never a value from a row — and, for Postgres, the login's privilege report.
12618
+ */
12619
+ source?: { catalog: SourceCatalog; privileges?: SourcePrivilegeReport };
12538
12620
  serverInfo: { name: string; version: string } | null;
12539
12621
  tools: McpPreviewTool[];
12540
12622
  diff: McpToolDiff | null;
@@ -12570,8 +12652,8 @@ export interface SaveMcpServerBody {
12570
12652
  /**
12571
12653
  * (api-types 0.112.0, G2) The operator naming the exact origin a `rest` server's calls go to
12572
12654
  * (`McpPreviewResponse.egress.origin`). Required when the preview's `egress.confirmRequired`
12573
- * (the base URL matches none of the document's `servers`, or its host is a loopback or private
12574
- * address, or did not resolve); without it, or with any other value, the save is a 409 `egress_unconfirmed`. It is
12655
+ * (the base URL matches none of the document's `servers`; since 0.174.0 a loopback or private
12656
+ * host is confirmed as a range in the config's `address` instead); without it, or with any other value, the save is a 409 `egress_unconfirmed`. It is
12575
12657
  * remembered with the server, so re-saving over the same origin does not ask again. Human
12576
12658
  * operator only (403 `egress_confirm_human_only`); audited `mcp.server.egress_confirmed`. A 400
12577
12659
  * `egress_not_rest` for a server that is not `rest`.
@@ -12596,16 +12678,21 @@ export interface McpRestEgress {
12596
12678
  servers: string[];
12597
12679
  /** The origin is one server's and the base path is that server's path or under it. */
12598
12680
  matches: boolean;
12599
- /** The host is `localhost`, or is or resolves to a loopback/private/link-local/unique-local address. */
12681
+ /**
12682
+ * The host is a loopback or private address (since api-types 0.174.0 always one the preview's
12683
+ * `address` confirmed: an unconfirmed one fails the preview, and an always-refused one, like
12684
+ * link-local or CGNAT, can never be confirmed).
12685
+ */
12600
12686
  privateAddress: boolean;
12601
12687
  /**
12602
- * `false` = the host is a name that did not resolve at preview, so crew could not check that it
12603
- * is not private. An IP literal is always `true`.
12688
+ * Since api-types 0.174.0 always `true`: a host that does not resolve fails the preview, because
12689
+ * the dialer cannot check where it goes.
12604
12690
  */
12605
12691
  resolved: boolean;
12606
12692
  /**
12607
- * `!matches || privateAddress || !resolved`, unless this origin was already confirmed for this
12608
- * server by an earlier save: the save needs `allowOrigin`.
12693
+ * `!matches`, unless this origin was already confirmed for this server by an earlier save: the
12694
+ * save needs `allowOrigin`. (Before api-types 0.174.0 a private or unresolved host needed it too;
12695
+ * addresses are now confirmed as ranges, in the config's `address`.)
12609
12696
  */
12610
12697
  confirmRequired: boolean;
12611
12698
  }
@@ -13012,6 +13099,246 @@ export interface McpUsageResponse {
13012
13099
  skipped: number;
13013
13100
  }
13014
13101
 
13102
+ // ── Apps data sources (DES-APPS-001 §5, §7.4, §7.5; api-types 0.175.0) ───────────────────────────
13103
+
13104
+ /** `McpServerConfigBody.sql`: a network SQL source's settings. Secrets go in `auth.ref` only. */
13105
+ export interface SqlSourceConfigBody {
13106
+ driver: 'postgres' | 'mysql';
13107
+ host: string;
13108
+ /** Default 5432 (Postgres), 3306 (MySQL). */
13109
+ port?: number;
13110
+ database: string;
13111
+ /** The login. A read-only login is recommended; the privilege report says when it is not one. */
13112
+ user: string;
13113
+ /**
13114
+ * `verify-full` (default; Postgres verify-full, MySQL VERIFY_IDENTITY: the certificate and the
13115
+ * host name are verified). `disable` only to loopback, or a private range confirmed as plaintext
13116
+ * in `address` (else the preview is a 409 `plaintext_refused`).
13117
+ */
13118
+ tls?: 'verify-full' | 'disable';
13119
+ /** A CA certificate (PEM) when the server's is not signed by a public root. */
13120
+ ca?: string;
13121
+ }
13122
+
13123
+ /** A `sql` source's settings as answered (the CA as whether one is set). */
13124
+ export interface SqlSourceView {
13125
+ driver: 'postgres' | 'mysql' | 'sqlite';
13126
+ host: string | null;
13127
+ port: number | null;
13128
+ database: string | null;
13129
+ user: string | null;
13130
+ tls: 'verify-full' | 'disable';
13131
+ ca: boolean;
13132
+ /** `sqlite`: the snapshot's sha256. */
13133
+ snapshot: string | null;
13134
+ }
13135
+
13136
+ /** How a relation may be read: base tables; views only by name (`viewsAllowed`); foreign tables never. */
13137
+ export type SourceRelationKind = 'table' | 'partitioned' | 'view' | 'matview' | 'foreign';
13138
+
13139
+ export interface SourceCatalogColumn {
13140
+ name: string;
13141
+ /** The source's own type text (`integer`, `character varying(80)`, `support.priority`). */
13142
+ type: string;
13143
+ nullable: boolean;
13144
+ /** Enum literals the schema declares (Postgres enum, MySQL ENUM). Never a value read from a row. */
13145
+ enumValues?: string[];
13146
+ }
13147
+
13148
+ export interface SourceCatalogRelation {
13149
+ /** Postgres schema, MySQL database; `null` for SQLite. */
13150
+ schema: string | null;
13151
+ name: string;
13152
+ kind: SourceRelationKind;
13153
+ /** The planner's estimate (SQLite: the snapshot's exact count); `null` = unknown. */
13154
+ rowEstimate: number | null;
13155
+ columns: SourceCatalogColumn[];
13156
+ primaryKey: string[];
13157
+ foreignKeys: Array<{ name: string; columns: string[]; references: { schema: string | null; table: string; columns: string[] } }>;
13158
+ /** Postgres: row security enabled or forced. */
13159
+ rowSecurity?: boolean;
13160
+ }
13161
+
13162
+ /** A `sql` source's catalog: structure only. */
13163
+ export interface SqlSourceCatalog {
13164
+ dialect: 'postgres' | 'mysql' | 'sqlite';
13165
+ database: string | null;
13166
+ relations: SourceCatalogRelation[];
13167
+ describedAt: string;
13168
+ }
13169
+
13170
+ /** A `graphql` source's catalog: root fields and declared enums (from introspection). */
13171
+ export interface GraphqlSourceCatalog {
13172
+ queries: Array<{ name: string; type: string; args: Array<{ name: string; type: string }> }>;
13173
+ mutations: Array<{ name: string; type: string; args: Array<{ name: string; type: string }> }>;
13174
+ enums: Array<{ name: string; values: string[] }>;
13175
+ describedAt: string;
13176
+ }
13177
+
13178
+ export type SourceCatalog = SqlSourceCatalog | GraphqlSourceCatalog;
13179
+
13180
+ /** One declared Postgres row write, as the privilege report and the safety check take it (DES §7.4). */
13181
+ export interface SourceRowWrite {
13182
+ schema: string;
13183
+ table: string;
13184
+ op: 'insert' | 'update' | 'delete';
13185
+ /** The columns the write sets (an insert: every column of the table). */
13186
+ set: string[];
13187
+ /** Every primary-key column. */
13188
+ key: string[];
13189
+ }
13190
+
13191
+ /**
13192
+ * The Postgres privilege report (DES §5.1 "Test", §7.4 "the writer login"): what the login can read
13193
+ * and change, whether it is read-only, and per declared row write the EXACT `GRANT` statements still
13194
+ * missing: `USAGE` on the schema, table-level `SELECT` (the returned row type reads the whole row;
13195
+ * it covers the key and written columns), table-level `UPDATE` for every row write (the lock needs
13196
+ * it), and `INSERT` or `DELETE` for those operations.
13197
+ */
13198
+ export interface SourcePrivilegeReport {
13199
+ login: string;
13200
+ superuser: boolean;
13201
+ /**
13202
+ * Not a superuser, and no INSERT/UPDATE/DELETE/TRUNCATE (table or column level) on any visible
13203
+ * table, view (an updatable view writes its table) or foreign table, nor UPDATE or USAGE
13204
+ * (`nextval`) on a sequence.
13205
+ */
13206
+ readOnly: boolean;
13207
+ tables: Array<{ schema: string; table: string; select: boolean; selectSomeColumns: boolean; insert: boolean; update: boolean; delete: boolean }>;
13208
+ writes: Array<{ write: SourceRowWrite; missing: string[] }>;
13209
+ }
13210
+
13211
+ /** `GET /sources/:name/catalog`, `POST /sources/:name/describe` (re-describe now). */
13212
+ export interface SourceCatalogResponse {
13213
+ name: string;
13214
+ kind: 'sql' | 'graphql' | 'crew';
13215
+ catalog: SourceCatalog | CrewSourceCatalog;
13216
+ privileges?: SourcePrivilegeReport;
13217
+ descriptorHash: string | null;
13218
+ }
13219
+
13220
+ /** `POST /sources/:name/privileges`. */
13221
+ export interface SourcePrivilegesBody {
13222
+ writes?: SourceRowWrite[];
13223
+ }
13224
+
13225
+ /** `POST /sources/:name/check` — the per-kind source check: policy, then prepare/describe, never execute. */
13226
+ export interface SourceCheckBody {
13227
+ /** SQL text (Postgres `$1…`, MySQL and SQLite `?`), or a GraphQL document. */
13228
+ text: string;
13229
+ }
13230
+
13231
+ export type SourceCheckResponse =
13232
+ | { ok: true; columns: Array<{ name: string; type: string }>; params: string[]; relations: string[] }
13233
+ | {
13234
+ ok: false;
13235
+ /**
13236
+ * Why the query was refused. Two kinds of class:
13237
+ *
13238
+ * - The read policy, before anything reaches the source: `not_select`, `function`, `cast`,
13239
+ * `operator`, `relation`, `view`, `unqualified`, `qualified_name`, `column`, `recursive`,
13240
+ * `locking`, `into`, `statements`, `lexical`, `syntax` (NATURAL JOIN among them), `parse`,
13241
+ * `params`, `too_long`; GraphQL `operations`, `not_query`, `invalid`, `schema` (the described
13242
+ * schema does not validate: describe the source again).
13243
+ * - The source, after crew connected and asked it to prepare the text (never to execute it):
13244
+ * `prepare` (the source refused to prepare it; its own words reach a human only, an agent gets
13245
+ * the SQLSTATE), `authorizer` (SQLite's authorizer denied it), `refused` (a relation changed at
13246
+ * the source since the describe: describe it again), or a dialer refusal code.
13247
+ */
13248
+ code: string;
13249
+ detail: string;
13250
+ };
13251
+
13252
+ /** `POST /sources/:name/safety` — the Postgres table safety check (DES §7.4 rev 11). */
13253
+ export interface SourceSafetyBody {
13254
+ schema: string;
13255
+ table: string;
13256
+ /** A declared row write to check as well (key = the whole primary key; FK enforcement refused). */
13257
+ write?: { op: 'insert' | 'update' | 'delete'; set: string[]; key: string[] };
13258
+ }
13259
+
13260
+ export interface SourceSafetyResponse {
13261
+ table: { schema: string; name: string };
13262
+ safe: boolean;
13263
+ /**
13264
+ * Each reason a v1 row write may not touch the table, in words naming the object (`code`:
13265
+ * `not_a_table`, `partitioned`, `partition`, `access_method`, `inheritance_parent`,
13266
+ * `inheritance_child`, `row_security`, `rule`, `user_trigger`, `internal_trigger_disabled`,
13267
+ * `cascading_key`, `fk_operator`, `column_type`, `user_cast`, `generated_column`,
13268
+ * `exclusion_constraint`, `check_expression`, `check_dependency`, `index_expression`,
13269
+ * `index_partial`, `index_access_method`, `index_opclass`, `statistics_expression`, `depend_net`,
13270
+ * `no_primary_key`, `table_not_found`; for a declared write also `key_mismatch`, `key_write`,
13271
+ * `unknown_column`, `nothing_set`, `fk_enforcement`, `insert_columns`, `written_type`).
13272
+ */
13273
+ reasons: Array<{ code: string; detail: string }>;
13274
+ /** sha256 over the full definitions read; a grant binds to it (K2b). */
13275
+ fingerprint: string;
13276
+ }
13277
+
13278
+ /** `PUT /sources/:name/allow-writes` — human operator only (403 `writes_switch_human_only`). */
13279
+ export interface SourceAllowWritesBody {
13280
+ allowed: boolean;
13281
+ }
13282
+
13283
+ export interface SourceAllowWritesResponse {
13284
+ name: string;
13285
+ allowWrites: boolean;
13286
+ /** Row-write grants withdrawn by turning the switch off (0 when turning it on). */
13287
+ withdrawnGrants: number;
13288
+ }
13289
+
13290
+ /**
13291
+ * `POST /sources/:name/test-call` (G6) — human operator only. Without `confirm` it sends NOTHING and
13292
+ * answers the exact request it would send and its `requestHash`; with `confirm` equal to that hash it
13293
+ * sends exactly that one request. Reads only: a REST GET/HEAD operation, a GraphQL `query`, an MCP
13294
+ * tool whose class is `read`. Audited `apps.source.test_call`.
13295
+ */
13296
+ export interface SourceTestCallBody {
13297
+ /** REST: the tool (operation) name; MCP: the tool name; GraphQL: the query document. */
13298
+ target: string;
13299
+ args?: Record<string, unknown>;
13300
+ confirm?: string;
13301
+ }
13302
+
13303
+ export interface SourceTestCallRequest {
13304
+ kind: 'rest' | 'graphql' | 'mcp';
13305
+ /** REST/GraphQL: `GET https://api…/v1/tickets?page=1`; MCP: the tool name. */
13306
+ summary: string;
13307
+ method?: string;
13308
+ url?: string;
13309
+ /** Header NAMES only; the auth header's value is never shown. */
13310
+ headers?: string[];
13311
+ body?: unknown;
13312
+ tool?: string;
13313
+ args?: Record<string, unknown>;
13314
+ }
13315
+
13316
+ export type SourceTestCallResponse =
13317
+ | { sent: false; request: SourceTestCallRequest; requestHash: string }
13318
+ | { sent: true; request: SourceTestCallRequest; ok: boolean; status: number | null; result: unknown; truncated: boolean };
13319
+
13320
+ /** `POST /apps/uploads?name=<source>&filename=<file>` (body: the file's bytes) — a file becomes a `sql`/`sqlite` source. */
13321
+ export interface SourceUploadResponse {
13322
+ source: McpServer;
13323
+ snapshot: { digest: string; bytes: number; kind: 'csv' | 'xlsx' | 'sqlite' };
13324
+ /** The table a CSV/XLSX became; `null` for a `.sqlite` file. */
13325
+ table: string | null;
13326
+ /**
13327
+ * CSV/XLSX: whether the first row was taken as the header, and the column names. Only a HUMAN's
13328
+ * upload takes one (detected, or `header=yes`); a first row that looks like data, or holds values
13329
+ * such as an email, becomes `col_1…`, and an agent's upload always gets `col_1…` names.
13330
+ */
13331
+ header: { detected: boolean; columns: string[] } | null;
13332
+ /** The first 20 rows, answered to a HUMAN actor only (an agent gets `[]`). */
13333
+ sample: string[][];
13334
+ catalog: SqlSourceCatalog;
13335
+ }
13336
+
13337
+ /** The built-in `crew` source (DES §5.1): allowlisted GET routes, read in-process as the viewing actor. */
13338
+ export interface CrewSourceCatalog {
13339
+ routes: Array<{ path: string; responseType: string; params: string[] }>;
13340
+ }
13341
+
13015
13342
  // ── Decision capture (DES-decision-capture §4.2.1 / §4.6; DC-S4a, api-types 0.80.0) ──────────────
13016
13343
 
13017
13344
  /** The laya codebook's decision types. `none` is crew's label for "no decision". */
@@ -13834,7 +14161,18 @@ export interface DismissRecommendationResponse {
13834
14161
  export type McpInspectTarget =
13835
14162
  | { server: string }
13836
14163
  | { command: string; args?: string[]; env?: Record<string, string>; cwd?: string }
13837
- | { url: string; transport?: 'streamable-http' | 'sse'; headers?: Record<string, string> };
14164
+ | {
14165
+ url: string;
14166
+ transport?: 'streamable-http' | 'sse';
14167
+ headers?: Record<string, string>;
14168
+ /**
14169
+ * (api-types 0.174.0, DES-APPS-001 §5.2) Every request goes through crew's one dialer. A typed
14170
+ * loopback IP literal or `localhost` is reachable as typed (http allowed); a typed private IP
14171
+ * literal is reachable over https, and over http only with `plaintext: true` here; a private
14172
+ * host NAME needs a range here (a 400 for a range outside loopback/private).
14173
+ */
14174
+ address?: McpAddressPolicy;
14175
+ };
13838
14176
 
13839
14177
  /** `POST /mcp-inspect/sessions` */
13840
14178
  export interface McpInspectStartBody {
@@ -14830,7 +15168,11 @@ export interface AppTurnState {
14830
15168
 
14831
15169
  /** `GET /apps` item. */
14832
15170
  export interface AppSummary {
14833
- /** `^[a-z][a-z0-9-]{0,47}$`; `check` and `uploads` are reserved. */
15171
+ /**
15172
+ * 1-48 characters, at most four words of `a-z 0-9` joined by `-`, starting with a letter
15173
+ * (`^[a-z][a-z0-9]*(-[a-z0-9]+){0,3}$`): the app repo's id in crew's repo registry is the slug itself.
15174
+ * `check` and `uploads` are reserved.
15175
+ */
14834
15176
  slug: string;
14835
15177
  name: string;
14836
15178
  projectId: string;
@@ -14879,9 +15221,9 @@ export interface AppDetailResponse {
14879
15221
  export type AppEditOp = { op: 'spec'; spec: AppSpec } | { op: 'query-text'; query: string; text: string };
14880
15222
 
14881
15223
  /**
14882
- * `POST /apps/:app/edits` (HUMAN operator only): one `you` version from one edit burst (1-50 ops). `base`
14883
- * is the head version the edit was made on: a stale one is `409 stale_base`, and while a turn runs every
14884
- * edit is `409 turn_in_flight`.
15224
+ * `POST /apps/:app/edits` (HUMAN operator only): one `you` version from one edit burst (1-50 ops; the JSON
15225
+ * body is at most 12 MB, which holds a whole spec and 50 query texts). `base` is the head version the edit
15226
+ * was made on: a stale one is `409 stale_base`, and while a turn runs every edit is `409 turn_in_flight`.
14885
15227
  */
14886
15228
  export interface AppEditsBody {
14887
15229
  base: number;
@@ -14968,6 +15310,9 @@ export interface AppCheckFinding {
14968
15310
  * accepted receipt for this app), `nothing_to_undo`, `nothing_to_redo`, `slug_taken` (with
14969
15311
  * `suggestion`), `source_check_unavailable` (the tree has queries or actions and this daemon cannot
14970
15312
  * run the source stage yet, so nothing lands);
15313
+ * - (api-types 0.173.0) 409 `unreadable_tree` (a tree crew landed no longer reads back from the app repo: the repo was changed);
15314
+ * - (api-types 0.173.0) the worker-facing `POST /apps/check` also answers 401 `invalid_token` and 409 `not_this_turn` (the token's
15315
+ * run is not the app's turn in flight); landing a turn refuses `not_checked` and `reviewer_not_distinct`;
14971
15316
  * - 422 `check_failed` (with `findings`), `reserved_slug`;
14972
15317
  * - 429 `rate_limited` (with `retryAfterMs`: a query queue or a per-viewer rate is full, DES §7.5);
14973
15318
  * - 501 `not_implemented` (a route a later slice serves; nothing happened);
@@ -14992,6 +15337,11 @@ export interface AppErrorBody {
14992
15337
  | 'reserved_slug'
14993
15338
  | 'not_implemented'
14994
15339
  | 'rate_limited'
15340
+ | 'unreadable_tree'
15341
+ | 'invalid_token'
15342
+ | 'not_this_turn'
15343
+ | 'not_checked'
15344
+ | 'reviewer_not_distinct'
14995
15345
  | 'apps_unavailable';
14996
15346
  error: string;
14997
15347
  /** `rate_limited`: when to try again (also sent as `Retry-After`). */
@@ -15002,6 +15352,28 @@ export interface AppErrorBody {
15002
15352
  suggestion?: string;
15003
15353
  }
15004
15354
 
15355
+ /**
15356
+ * (api-types 0.173.0) `POST /apps/check` (worker-facing; the `apps_check` Tool runs `wicked-crew apps-check`, which sends the
15357
+ * unit's capability token in the body, never as a bearer): check the builder's candidate commit of the
15358
+ * app's turn in flight (DES §9.2 `check`).
15359
+ */
15360
+ export interface AppsCheckBody {
15361
+ token: string;
15362
+ app: string;
15363
+ /** The builder's candidate commit in the app repo. */
15364
+ commit: string;
15365
+ /** The publish manifest, for the publish check (a later slice). */
15366
+ manifest?: unknown;
15367
+ }
15368
+
15369
+ /**
15370
+ * (api-types 0.173.0) `POST /apps/check` 200: on a pass, the commit crew made on the candidate with its lock (the only tree the
15371
+ * turn's review can land) and what the check ran; on a refusal, why.
15372
+ */
15373
+ export type AppsCheckResponse =
15374
+ | { ok: true; commit: string; tree: string; summary: AppCheckSummary }
15375
+ | { ok: false; code: 'check_failed' | 'source_check_unavailable'; findings: AppCheckFinding[] };
15376
+
15005
15377
  /**
15006
15378
  * {@link HealthCapabilities.apps} (api-types 0.172.0): present when crew serves the app store
15007
15379
  * (`/api/v1/apps`, list, add, read, edits, undo, redo, restore); each flag is true only once its slice
@@ -15025,8 +15397,10 @@ export interface AppsCapabilities {
15025
15397
  /**
15026
15398
  * `POST /repos` body. `create: true` (api-types 0.172.0, DES-APPS-001): crew makes `<apps root>/<name>`
15027
15399
  * (`~/.wicked/apps` by default), runs `git init` with one empty commit and registers it; no onboarding
15028
- * run starts (`onboardRunId: null`), and `rootPath`/`gitUrl` are refused beside it. A taken name is
15029
- * `409 slug_taken` with a `suggestion`.
15400
+ * run starts (`onboardRunId: null`), and `rootPath`/`gitUrl` are refused beside it. With `create`, `name` is
15401
+ * an app slug ({@link AppSummary.slug}; `check` and `uploads` are `422 reserved_slug`). A name that is
15402
+ * taken (an app, a path under the apps root, or a registered repo id) is `409 slug_taken` with a
15403
+ * `suggestion`.
15030
15404
  */
15031
15405
  export interface RegisterRepoBody {
15032
15406
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.172.0",
3
+ "version": "0.175.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",