wicked-crew-api-types 0.175.0 → 0.186.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.
- package/index.d.ts +987 -17
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -12316,7 +12316,61 @@ export interface PutDeliveryFreezeBody {
|
|
|
12316
12316
|
* sources: registered through the same preview/save, but with NO tools — nothing of theirs is ever
|
|
12317
12317
|
* offered to a governed run. Their preview answers {@link McpPreviewResponse.source} (the catalog).
|
|
12318
12318
|
*/
|
|
12319
|
-
export type McpUpstreamKind = 'mcp-stdio' | 'mcp-http' | 'rest' | 'sql' | 'graphql';
|
|
12319
|
+
export type McpUpstreamKind = 'mcp-stdio' | 'mcp-http' | 'rest' | 'sql' | 'graphql' | 'toolbox-source';
|
|
12320
|
+
|
|
12321
|
+
// ── The one registry's entry (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5) ─────────────────────
|
|
12322
|
+
|
|
12323
|
+
/**
|
|
12324
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) A database source as MCP Toolbox for Databases models it: its
|
|
12325
|
+
* own source document (`kind: source`, `type`, that type's fields), which the registry stores as the source of
|
|
12326
|
+
* truth for `kind: 'toolbox-source'`. Checked against crew's deployment policy for the pinned Toolbox release
|
|
12327
|
+
* (v1.15.0) at preview and at save: a field that bypasses the address check (`connectionString`), names a host
|
|
12328
|
+
* path, or tunes the driver is a 400 `refused_field`; a field only crew writes (`name`, `queryParams`,
|
|
12329
|
+
* `connectTimeout`: the TLS settings, startup parameters and timeouts) a 400 `crew_written_field`; any other
|
|
12330
|
+
* unknown field a 400 `unknown_field`. `password` is exactly `"${WICKED_SRC_1}"`, the placeholder naming
|
|
12331
|
+
* `auth.ref`'s secret (a value is a 400 `secret_literal`); `${` anywhere else is a 400 `interpolation`.
|
|
12332
|
+
*/
|
|
12333
|
+
// A type alias (not an interface) so it is assignable to a plain record: the route takes any object and the
|
|
12334
|
+
// deployment policy judges each field.
|
|
12335
|
+
export type ToolboxSourceDocument = {
|
|
12336
|
+
kind: 'source';
|
|
12337
|
+
/** v1: `postgres` only (any other type is a 400 `unsupported_type`). */
|
|
12338
|
+
type: 'postgres';
|
|
12339
|
+
/** One host name or IP address. */
|
|
12340
|
+
host: string;
|
|
12341
|
+
/** Toolbox takes the port as a string, `"1"`-`"65535"`. */
|
|
12342
|
+
port: string;
|
|
12343
|
+
database: string;
|
|
12344
|
+
user: string;
|
|
12345
|
+
password?: string;
|
|
12346
|
+
};
|
|
12347
|
+
|
|
12348
|
+
/**
|
|
12349
|
+
* (api-types 0.183.0) How crew reads a database source: `native` (crew's own adapter: K1's driver, dialer and
|
|
12350
|
+
* read policy; Postgres) or `toolbox` (one Toolbox process per source; a preview is a 501 `runtime_unavailable`
|
|
12351
|
+
* on a daemon without the Toolbox runtime).
|
|
12352
|
+
*/
|
|
12353
|
+
export type McpSourceRuntime = 'native' | 'toolbox';
|
|
12354
|
+
|
|
12355
|
+
/**
|
|
12356
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §7.1) What a tool's answer discloses: `rows` (needs a source's
|
|
12357
|
+
* "query" switch), `structure` (needs "see"), or `none`. Reviewed at preview, bound to the tool's saved schema
|
|
12358
|
+
* hash; `null` = not reviewed, or reviewed against a schema that has since changed. A tool with no class in force
|
|
12359
|
+
* is offered to no agent.
|
|
12360
|
+
*/
|
|
12361
|
+
export type McpToolDisclosure = 'none' | 'structure' | 'rows';
|
|
12362
|
+
|
|
12363
|
+
/**
|
|
12364
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §7.1) A data source's agent switches: `see` (on by default),
|
|
12365
|
+
* `query` (off by default; needs `see`; turned off again by a descriptor change and by a restore), `projects`
|
|
12366
|
+
* (none by default) and `everyProject` (an explicit choice). Set by a human operator only.
|
|
12367
|
+
*/
|
|
12368
|
+
export interface McpSourceAgents {
|
|
12369
|
+
see: boolean;
|
|
12370
|
+
query: boolean;
|
|
12371
|
+
projects: string[];
|
|
12372
|
+
everyProject: boolean;
|
|
12373
|
+
}
|
|
12320
12374
|
/**
|
|
12321
12375
|
* A tool's class, from its own `tools/list` annotations (never from a carrier): `read` when
|
|
12322
12376
|
* `readOnlyHint` is true; else `destructive` unless `destructiveHint` is false; else `write`. A tool
|
|
@@ -12418,6 +12472,16 @@ export interface McpServerConfigBody {
|
|
|
12418
12472
|
* from `POST /apps/uploads` (a snapshot digest), not from a preview.
|
|
12419
12473
|
*/
|
|
12420
12474
|
sql?: SqlSourceConfigBody;
|
|
12475
|
+
/**
|
|
12476
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) `toolbox-source` only: Toolbox's own source document. Its
|
|
12477
|
+
* password is the secret behind `auth.ref` (`auth` takes only `ref`). A `sql` body with Postgres settings is
|
|
12478
|
+
* saved as the same document.
|
|
12479
|
+
*/
|
|
12480
|
+
toolbox?: ToolboxSourceDocument;
|
|
12481
|
+
/** (api-types 0.183.0) `toolbox-source` only: default `native`. */
|
|
12482
|
+
runtime?: McpSourceRuntime;
|
|
12483
|
+
/** (api-types 0.183.0) `toolbox-source` only: the TLS choice crew writes the driver's settings from; default `verify-full`. */
|
|
12484
|
+
tls?: { mode: 'verify-full' | 'disable'; ca?: string };
|
|
12421
12485
|
/**
|
|
12422
12486
|
* (api-types 0.175.0) `sql` only: the views (and materialized views) a read may name, as
|
|
12423
12487
|
* `schema.view` (MySQL `database.view`). A view not listed is refused by the read policy.
|
|
@@ -12488,9 +12552,16 @@ export interface McpTool {
|
|
|
12488
12552
|
schemaHash: string | null;
|
|
12489
12553
|
/** The hash the last probe saw. */
|
|
12490
12554
|
observedSchemaHash: string;
|
|
12555
|
+
/** (api-types 0.183.0) The disclosure class in force; `null` = none reviewed for the saved schema. */
|
|
12556
|
+
disclosure: McpToolDisclosure | null;
|
|
12491
12557
|
}
|
|
12492
12558
|
|
|
12493
12559
|
export interface McpServer {
|
|
12560
|
+
/**
|
|
12561
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) The entry's immutable id. Estate's source documents, `deps`,
|
|
12562
|
+
* grants and records key on it, never on the name: a name removed and registered again is a new id.
|
|
12563
|
+
*/
|
|
12564
|
+
id: string;
|
|
12494
12565
|
name: string;
|
|
12495
12566
|
kind: McpUpstreamKind;
|
|
12496
12567
|
command: string | null;
|
|
@@ -12518,6 +12589,19 @@ export interface McpServer {
|
|
|
12518
12589
|
* `allowWrites`). Queries, actions and grants bind to it.
|
|
12519
12590
|
*/
|
|
12520
12591
|
descriptorHash?: string;
|
|
12592
|
+
/**
|
|
12593
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1, §5.4) A database source stored as its Toolbox document. A
|
|
12594
|
+
* `native` one still answers `kind: 'sql'` and `sql` (the read-path projection every existing reader uses).
|
|
12595
|
+
* `descriptorVersion` 1 = mapped from a K1 record, hashed with K1's function (locks and grants unchanged);
|
|
12596
|
+
* 2 = written by a save, hashed over the canonical execution descriptor.
|
|
12597
|
+
*/
|
|
12598
|
+
runtime?: McpSourceRuntime;
|
|
12599
|
+
toolbox?: ToolboxSourceDocument;
|
|
12600
|
+
descriptorVersion?: 1 | 2;
|
|
12601
|
+
/** The deployment policy the document was checked under, e.g. `postgres/1@toolbox-v1.15.0`. */
|
|
12602
|
+
policyVersion?: string;
|
|
12603
|
+
/** (api-types 0.183.0) Data sources only: the agent switches (defaults filled in). */
|
|
12604
|
+
agents?: McpSourceAgents;
|
|
12521
12605
|
/**
|
|
12522
12606
|
* (api-types 0.174.0) `mcp-http` and `rest` only: the ranges confirmed for this server's
|
|
12523
12607
|
* connections. A server saved before 0.174.0 shows what crew re-derived for it: the IP literal or
|
|
@@ -12549,12 +12633,77 @@ export interface McpDiscoveredServer {
|
|
|
12549
12633
|
managed: boolean;
|
|
12550
12634
|
}
|
|
12551
12635
|
|
|
12552
|
-
/**
|
|
12636
|
+
/**
|
|
12637
|
+
* `GET /mcp/servers`, for a human actor. (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.2, crew#1310) Any other
|
|
12638
|
+
* actor, and `?view=agent`, gets {@link McpServersAgentResponse} instead; so do the answers of a save, a
|
|
12639
|
+
* `PATCH /mcp/servers/:name` and a test for a non-human actor.
|
|
12640
|
+
*/
|
|
12553
12641
|
export interface McpServersResponse {
|
|
12554
12642
|
servers: McpServer[];
|
|
12555
12643
|
discovered: McpDiscoveredServer[];
|
|
12556
12644
|
}
|
|
12557
12645
|
|
|
12646
|
+
/**
|
|
12647
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.2) A server as an agent may know it: no host, port, database,
|
|
12648
|
+
* login, url, command, arguments, path, address, secret reference or descriptor.
|
|
12649
|
+
*/
|
|
12650
|
+
export interface McpServerAgentView {
|
|
12651
|
+
id: string;
|
|
12652
|
+
name: string;
|
|
12653
|
+
kind: McpUpstreamKind;
|
|
12654
|
+
enabled: boolean;
|
|
12655
|
+
health: { state: McpHealthState };
|
|
12656
|
+
/** The tools that are not `gone`. */
|
|
12657
|
+
tools: Array<{ name: string; subject: string; class: McpToolClass; disclosure: McpToolDisclosure | null; enabled: boolean; status: McpToolStatus }>;
|
|
12658
|
+
/** Data sources only. */
|
|
12659
|
+
agents?: { see: boolean; query: boolean };
|
|
12660
|
+
}
|
|
12661
|
+
|
|
12662
|
+
/** (api-types 0.183.0) `GET /mcp/servers?view=agent`, and `GET /mcp/servers` for any non-human actor. */
|
|
12663
|
+
export interface McpServersAgentResponse {
|
|
12664
|
+
view: 'agent';
|
|
12665
|
+
servers: McpServerAgentView[];
|
|
12666
|
+
}
|
|
12667
|
+
|
|
12668
|
+
/**
|
|
12669
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.5) `GET /mcp/registry/generations` (human operator only). Every
|
|
12670
|
+
* write keeps the registry it replaces; the last 10 are kept.
|
|
12671
|
+
*/
|
|
12672
|
+
export interface McpRegistryGenerationsResponse {
|
|
12673
|
+
/** The generation in force. */
|
|
12674
|
+
current: number;
|
|
12675
|
+
/** Newest first. */
|
|
12676
|
+
generations: Array<{ generation: number; savedAt: string }>;
|
|
12677
|
+
}
|
|
12678
|
+
|
|
12679
|
+
/** (api-types 0.183.0) `POST /mcp/registry/restore`. */
|
|
12680
|
+
export interface McpRegistryRestoreBody {
|
|
12681
|
+
generation: number;
|
|
12682
|
+
}
|
|
12683
|
+
|
|
12684
|
+
/**
|
|
12685
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.5) `POST /mcp/registry/restore`'s 200 (human operator only;
|
|
12686
|
+
* audited `mcp.registry.restored`). A restore fails closed: every source's "query" switch and Allow writes come
|
|
12687
|
+
* back OFF; a server whose secret reference resolves to nothing comes back DISABLED (`secret_missing`); MCP
|
|
12688
|
+
* approvals whose tool schema differs from the restored one are withdrawn first (a failed withdrawal refuses the
|
|
12689
|
+
* restore, 500 `withdraw_failed`). A generation that is not kept is a 404 `unknown_generation`; one that does not
|
|
12690
|
+
* parse, or holds a record crew could not have written, a 409 `generation_unreadable`, and nothing changes. The
|
|
12691
|
+
* withdrawal and the commit hold every affected server's lock; when servers keep being registered meanwhile the
|
|
12692
|
+
* restore gives up with a 409 `registry_busy`, having changed nothing. The registry in force before the restore is
|
|
12693
|
+
* kept as a generation too.
|
|
12694
|
+
*/
|
|
12695
|
+
export interface McpRegistryRestoreResponse {
|
|
12696
|
+
restored: number;
|
|
12697
|
+
/** The generation the restore wrote. */
|
|
12698
|
+
generation: number;
|
|
12699
|
+
servers: number;
|
|
12700
|
+
disabled: Array<{ name: string; code: 'secret_missing' }>;
|
|
12701
|
+
queryReset: string[];
|
|
12702
|
+
writesReset: string[];
|
|
12703
|
+
/** The approval tokens withdrawn first. */
|
|
12704
|
+
withdrawnApprovals?: string[];
|
|
12705
|
+
}
|
|
12706
|
+
|
|
12558
12707
|
/** The difference between the registered tools and a probe, by tool name. */
|
|
12559
12708
|
export interface McpToolDiff {
|
|
12560
12709
|
added: string[];
|
|
@@ -12587,6 +12736,11 @@ export interface McpPreviewTool {
|
|
|
12587
12736
|
* approving it: `MCP-FIRST-USE` still asks on its first call.
|
|
12588
12737
|
*/
|
|
12589
12738
|
enabledOnSave: boolean;
|
|
12739
|
+
/**
|
|
12740
|
+
* (api-types 0.183.0) The disclosure class a save gives the tool when `disclosures` does not name it: its
|
|
12741
|
+
* class while its schema is unchanged, crew's own class for a tool of crew's Toolbox configuration, else `null`.
|
|
12742
|
+
*/
|
|
12743
|
+
disclosure: McpToolDisclosure | null;
|
|
12590
12744
|
}
|
|
12591
12745
|
|
|
12592
12746
|
/**
|
|
@@ -12611,6 +12765,11 @@ export interface McpPreviewResponse {
|
|
|
12611
12765
|
/** (api-types 0.175.0) `sql` only. */
|
|
12612
12766
|
sql?: SqlSourceView;
|
|
12613
12767
|
viewsAllowed?: string[];
|
|
12768
|
+
/** (api-types 0.183.0) A database source: the Toolbox document the save will store. */
|
|
12769
|
+
runtime?: McpSourceRuntime;
|
|
12770
|
+
toolbox?: ToolboxSourceDocument;
|
|
12771
|
+
descriptorVersion?: 1 | 2;
|
|
12772
|
+
policyVersion?: string;
|
|
12614
12773
|
};
|
|
12615
12774
|
/**
|
|
12616
12775
|
* (api-types 0.175.0, DES-APPS-001 §5.1) `sql`/`graphql` only: what the describe found —
|
|
@@ -12659,6 +12818,13 @@ export interface SaveMcpServerBody {
|
|
|
12659
12818
|
* `egress_not_rest` for a server that is not `rest`.
|
|
12660
12819
|
*/
|
|
12661
12820
|
allowOrigin?: string;
|
|
12821
|
+
/**
|
|
12822
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) The operator's review of what each tool discloses, by tool
|
|
12823
|
+
* name (`McpPreviewTool.disclosure` is what a tool not named here gets). A name the preview does not list is a
|
|
12824
|
+
* 400 `unknown_tool`. Human operator only (403 `disclosure_review_human_only`); audited
|
|
12825
|
+
* `mcp.tool.disclosure_reviewed`.
|
|
12826
|
+
*/
|
|
12827
|
+
disclosures?: Record<string, McpToolDisclosure>;
|
|
12662
12828
|
}
|
|
12663
12829
|
|
|
12664
12830
|
/**
|
|
@@ -12712,6 +12878,25 @@ export interface PatchMcpServerBody {
|
|
|
12712
12878
|
export interface PatchMcpToolBody {
|
|
12713
12879
|
enabled?: boolean;
|
|
12714
12880
|
classOverride?: McpToolClass | null;
|
|
12881
|
+
/**
|
|
12882
|
+
* (api-types 0.183.0) Review what the tool discloses, against its saved schema (409 `not_registered` when the
|
|
12883
|
+
* schema changed since the save). Setting a class is a human operator's only (403
|
|
12884
|
+
* `disclosure_review_human_only`), audited `mcp.tool.disclosure_reviewed`; `null` clears it (the tool is then
|
|
12885
|
+
* offered to no agent).
|
|
12886
|
+
*/
|
|
12887
|
+
disclosure?: McpToolDisclosure | null;
|
|
12888
|
+
}
|
|
12889
|
+
|
|
12890
|
+
/**
|
|
12891
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.2) `POST /mcp/servers/:name/test`'s 200 for a NON-HUMAN actor: the
|
|
12892
|
+
* server as the agent-safe projection, and `error` reduced to `"the probe failed"` (a probe's words can name the host).
|
|
12893
|
+
* A save and `PATCH /mcp/servers/:name` likewise answer an {@link McpServerAgentView} to a non-human actor.
|
|
12894
|
+
*/
|
|
12895
|
+
export interface McpServerTestAgentResponse {
|
|
12896
|
+
ok: boolean;
|
|
12897
|
+
error: string | null;
|
|
12898
|
+
diff: McpToolDiff | null;
|
|
12899
|
+
server: McpServerAgentView;
|
|
12715
12900
|
}
|
|
12716
12901
|
|
|
12717
12902
|
/** `POST /mcp/servers/:name/test`'s 200: a failed probe is `ok: false` and counts toward `failing`. */
|
|
@@ -13157,6 +13342,8 @@ export interface SourceCatalogRelation {
|
|
|
13157
13342
|
foreignKeys: Array<{ name: string; columns: string[]; references: { schema: string | null; table: string; columns: string[] } }>;
|
|
13158
13343
|
/** Postgres: row security enabled or forced. */
|
|
13159
13344
|
rowSecurity?: boolean;
|
|
13345
|
+
/** (api-types 0.176.0) Postgres: row security FORCED (it applies to the table's owner too). */
|
|
13346
|
+
rowSecurityForced?: boolean;
|
|
13160
13347
|
}
|
|
13161
13348
|
|
|
13162
13349
|
/** A `sql` source's catalog: structure only. */
|
|
@@ -13287,6 +13474,231 @@ export interface SourceAllowWritesResponse {
|
|
|
13287
13474
|
withdrawnGrants: number;
|
|
13288
13475
|
}
|
|
13289
13476
|
|
|
13477
|
+
/**
|
|
13478
|
+
* (api-types 0.184.0, DES-KNOWLEDGE-DATA-001 §7.1) A live source's agent switches. Agents reach a source
|
|
13479
|
+
* only through crew's data gate (`mcp:<source>/<tool>` through the broker); Apps units get none of its tools,
|
|
13480
|
+
* whatever this says (D-7). Never a write, never a credential.
|
|
13481
|
+
*/
|
|
13482
|
+
export type SourceAgentAccess = McpSourceAgents;
|
|
13483
|
+
|
|
13484
|
+
/** `PUT /sources/:name/agents` (human operator only; each change audited). At least one field. */
|
|
13485
|
+
export interface SourceAgentAccessBody {
|
|
13486
|
+
see?: boolean;
|
|
13487
|
+
query?: boolean;
|
|
13488
|
+
projects?: string[];
|
|
13489
|
+
everyProject?: boolean;
|
|
13490
|
+
}
|
|
13491
|
+
|
|
13492
|
+
export interface SourceAgentAccessResponse {
|
|
13493
|
+
name: string;
|
|
13494
|
+
agents: SourceAgentAccess;
|
|
13495
|
+
}
|
|
13496
|
+
|
|
13497
|
+
/** One agent read of a source (`GET /sources/:name/agent-queries`), as crew recorded it: never the SQL, a value or a source's words. */
|
|
13498
|
+
export interface SourceAgentQuery {
|
|
13499
|
+
/** The broker call's id. */
|
|
13500
|
+
callId: string;
|
|
13501
|
+
at: string;
|
|
13502
|
+
runId: string;
|
|
13503
|
+
unit: number;
|
|
13504
|
+
attempt: number;
|
|
13505
|
+
seat: string;
|
|
13506
|
+
source: string;
|
|
13507
|
+
/** The source's registry id. */
|
|
13508
|
+
sourceId: string;
|
|
13509
|
+
/** sha256 of the SQL text, hex. */
|
|
13510
|
+
sqlHash: string;
|
|
13511
|
+
/** `ok` (rows released), or crew's code (a read-policy code, `query_off`, `deadline`, `too_large`, `busy`, `changed_while_running`, …). */
|
|
13512
|
+
outcome: string;
|
|
13513
|
+
rows: number;
|
|
13514
|
+
truncated: boolean;
|
|
13515
|
+
ms: number;
|
|
13516
|
+
/** Whether rows were released to the agent's answer (written before the answer is sent: it may over-state, never under-state). */
|
|
13517
|
+
released: boolean;
|
|
13518
|
+
sqlstate?: string;
|
|
13519
|
+
}
|
|
13520
|
+
|
|
13521
|
+
/** `GET /sources/:name/agent-queries` (observer): the last 20, newest first. `known: false` = the record could not be read. */
|
|
13522
|
+
export interface SourceAgentQueriesResponse {
|
|
13523
|
+
name: string;
|
|
13524
|
+
known: boolean;
|
|
13525
|
+
queries: SourceAgentQuery[];
|
|
13526
|
+
}
|
|
13527
|
+
|
|
13528
|
+
/** One source a run's agents read (`GET /runs/:id/data-use`). */
|
|
13529
|
+
export interface SourceDataUse {
|
|
13530
|
+
source: string;
|
|
13531
|
+
/** Calls that reached the read policy. */
|
|
13532
|
+
queries: number;
|
|
13533
|
+
/** Calls whose rows reached the agent. */
|
|
13534
|
+
released: number;
|
|
13535
|
+
rows: number;
|
|
13536
|
+
truncated: boolean;
|
|
13537
|
+
lastAt: string;
|
|
13538
|
+
}
|
|
13539
|
+
|
|
13540
|
+
/** `GET /runs/:id/data-use` (observer): the sources a run's agents read. `known: false` = UNKNOWN, never "none". */
|
|
13541
|
+
export interface RunDataUseResponse {
|
|
13542
|
+
runId: string;
|
|
13543
|
+
known: boolean;
|
|
13544
|
+
sources: SourceDataUse[];
|
|
13545
|
+
}
|
|
13546
|
+
|
|
13547
|
+
/**
|
|
13548
|
+
* (api-types 0.184.0, DES-KNOWLEDGE-DATA-001 §7.8) What a unit's rows tool (`mcp:<source>/execute_sql`)
|
|
13549
|
+
* answers through the gate: one JSON object inside the MCP result's text, citable like knowledge, fenced as
|
|
13550
|
+
* untrusted data.
|
|
13551
|
+
*/
|
|
13552
|
+
export interface SourceReadEnvelope {
|
|
13553
|
+
/** Always first: the rows are data from the source, never instructions. */
|
|
13554
|
+
untrusted: string;
|
|
13555
|
+
/** `src:<name>@<at>#<8 hex>`. */
|
|
13556
|
+
cite: string;
|
|
13557
|
+
source: string;
|
|
13558
|
+
/** The dialect (`postgres`). */
|
|
13559
|
+
kind: string;
|
|
13560
|
+
/** The agent's own SQL (scrubbed of the source's secret). */
|
|
13561
|
+
sql: string;
|
|
13562
|
+
params: unknown[];
|
|
13563
|
+
at: string;
|
|
13564
|
+
/** `source:<id>`: what a cached answer depends on. */
|
|
13565
|
+
deps: string[];
|
|
13566
|
+
/** `type`: the source's type name, or `null` where the adapter does not report one. */
|
|
13567
|
+
columns: Array<{ name: string; type: string | null }>;
|
|
13568
|
+
rows: unknown[][];
|
|
13569
|
+
rowCount: number;
|
|
13570
|
+
/** More rows than the cap, more bytes than the cap, or a cell cut at 2,000 characters. */
|
|
13571
|
+
truncated: boolean;
|
|
13572
|
+
rowCap: number;
|
|
13573
|
+
byteCap: number;
|
|
13574
|
+
ms: number;
|
|
13575
|
+
}
|
|
13576
|
+
|
|
13577
|
+
/**
|
|
13578
|
+
* (api-types 0.186.0, DES-KNOWLEDGE-DATA-001 §10.2) One column of a value-free profile: bands, never a value.
|
|
13579
|
+
* `nullPct` is the null fraction to the nearest 5 % (`null` for an empty relation); `hasNulls` says a few nulls
|
|
13580
|
+
* the band rounded to 0 are there.
|
|
13581
|
+
*/
|
|
13582
|
+
export interface SourceProfileColumn {
|
|
13583
|
+
name: string;
|
|
13584
|
+
type: string;
|
|
13585
|
+
nullPct: number | null;
|
|
13586
|
+
hasNulls: boolean;
|
|
13587
|
+
cardinality: 'none' | 'single' | 'low' | 'high' | 'unique' | 'unknown';
|
|
13588
|
+
keyCandidate: boolean;
|
|
13589
|
+
}
|
|
13590
|
+
|
|
13591
|
+
/** (api-types 0.186.0) A relation's value-free profile; `rows` is an order-of-magnitude band, `null` when it was not read (`error` = a class). */
|
|
13592
|
+
export interface SourceProfileRelation {
|
|
13593
|
+
/** `schema.table`, the catalog document's key. */
|
|
13594
|
+
key: string;
|
|
13595
|
+
rows: '0' | '1-99' | '100-9,999' | '10,000-999,999' | '1,000,000+' | null;
|
|
13596
|
+
columns: SourceProfileColumn[];
|
|
13597
|
+
error: string | null;
|
|
13598
|
+
/** Columns not profiled (more than the profiler reads per relation). */
|
|
13599
|
+
columnsNotListed?: number;
|
|
13600
|
+
}
|
|
13601
|
+
|
|
13602
|
+
/** (api-types 0.186.0) A join the profiler found: a declared foreign key, or a name-and-type match the overlap band confirmed. */
|
|
13603
|
+
export interface SourceProfileJoin {
|
|
13604
|
+
from: string;
|
|
13605
|
+
columns: string[];
|
|
13606
|
+
to: string;
|
|
13607
|
+
references: string[];
|
|
13608
|
+
basis: 'fk' | 'name_type';
|
|
13609
|
+
/** How many of the referencing side's distinct values the other side holds (one-column joins); measured at the source. */
|
|
13610
|
+
overlap: 'empty' | 'none' | 'some' | 'most' | 'all' | null;
|
|
13611
|
+
}
|
|
13612
|
+
|
|
13613
|
+
/**
|
|
13614
|
+
* (api-types 0.186.0) `POST /sources/:name/profile`, a human operator's only (403 `profile_human_only`). The
|
|
13615
|
+
* value-free profile of a described native Postgres source, through the data gate's person read, and the data shapes
|
|
13616
|
+
* it filed as `knowledge` proposals for the review (one per relation; an identical shape already in the queue is not
|
|
13617
|
+
* filed again). 409 `not_in_knowledge`: estate holds no structure for the source yet.
|
|
13618
|
+
*/
|
|
13619
|
+
export interface SourceProfileResponse {
|
|
13620
|
+
name: string;
|
|
13621
|
+
/** The registry id. */
|
|
13622
|
+
sourceId: string;
|
|
13623
|
+
profiledAt: string;
|
|
13624
|
+
relations: SourceProfileRelation[];
|
|
13625
|
+
joins: SourceProfileJoin[];
|
|
13626
|
+
/** Code entities named exactly like a relation, in the repos' code graphs. */
|
|
13627
|
+
describes: Array<{ relation: string; repo: string; name: string; kind: string; file: string }>;
|
|
13628
|
+
proposed: Array<{ id: string; relation: string }>;
|
|
13629
|
+
alreadyProposed: number;
|
|
13630
|
+
codeSearch: { searched: string[]; notSearched: string[] };
|
|
13631
|
+
/** Catalog documents estate holds that crew's own catalog does not (or a view not allowed): not profiled. */
|
|
13632
|
+
notInKnowledge?: number;
|
|
13633
|
+
/** Relations beyond what one profile reads (too many): not profiled. */
|
|
13634
|
+
notListed?: number;
|
|
13635
|
+
/** Estate holds more catalog pages than one read takes: the rest were not profiled. */
|
|
13636
|
+
catalogTruncated?: true;
|
|
13637
|
+
}
|
|
13638
|
+
|
|
13639
|
+
/**
|
|
13640
|
+
* (api-types 0.186.0) The crew-owned record a data-shape proposal carries in `payload.shape` (a `knowledge`
|
|
13641
|
+
* proposal filed by the profiler). The review shows it; estate stores it as given.
|
|
13642
|
+
*/
|
|
13643
|
+
export interface KnowledgeShapeRecord {
|
|
13644
|
+
format: 1;
|
|
13645
|
+
sourceId: string;
|
|
13646
|
+
source: string;
|
|
13647
|
+
relation: string;
|
|
13648
|
+
profile: SourceProfileRelation;
|
|
13649
|
+
joins: SourceProfileJoin[];
|
|
13650
|
+
describes: Array<{ repo: string; symbolId: string; name: string; kind: string; file: string }>;
|
|
13651
|
+
/** Related tables whose join did not fit estate's 200 links per proposal (`joins` above keeps every one). */
|
|
13652
|
+
linksNotListed?: number;
|
|
13653
|
+
}
|
|
13654
|
+
|
|
13655
|
+
/** (api-types 0.186.0) A node of the Knowledge map. `key` is `<store>:<id>` (`source:`, `repo:`, `knowledge:`, `estate:`). */
|
|
13656
|
+
export interface KnowledgeMapNode {
|
|
13657
|
+
key: string;
|
|
13658
|
+
kind: 'source' | 'table' | 'shape' | 'code' | 'repo' | 'knowledge';
|
|
13659
|
+
label: string;
|
|
13660
|
+
/** A table's source name. */
|
|
13661
|
+
source?: string;
|
|
13662
|
+
/** A code entity's repo id. */
|
|
13663
|
+
repo?: string;
|
|
13664
|
+
/** A shape's proposal id. */
|
|
13665
|
+
proposalId?: string;
|
|
13666
|
+
/** A shape's value-free summary. */
|
|
13667
|
+
summary?: string;
|
|
13668
|
+
}
|
|
13669
|
+
|
|
13670
|
+
/**
|
|
13671
|
+
* (api-types 0.186.0) A typed edge of the Knowledge map (`describes`, `joins`, `governed_by`, `derived_from`, …;
|
|
13672
|
+
* `contains` is drawn structure). A `joins` edge's evidence is `{basis, on: [{columns, references, basis, overlap?,
|
|
13673
|
+
* cut?}], more?}`: every condition between the two tables, held under estate's 1 KiB evidence bound.
|
|
13674
|
+
*/
|
|
13675
|
+
export interface KnowledgeMapEdge {
|
|
13676
|
+
rel: string;
|
|
13677
|
+
from: string;
|
|
13678
|
+
to: string;
|
|
13679
|
+
confidence: number | null;
|
|
13680
|
+
evidence: Record<string, unknown> | null;
|
|
13681
|
+
/** The node of the shape that asserts it (`kconcept synthetic proposal:<id>:`, estate's id); `null` for drawn structure. */
|
|
13682
|
+
owner: string | null;
|
|
13683
|
+
}
|
|
13684
|
+
|
|
13685
|
+
/**
|
|
13686
|
+
* (api-types 0.186.0) `GET /knowledge/map`, a human operator's only. The source catalogs and the APPROVED data shapes
|
|
13687
|
+
* estate holds live, with their typed edges; a pending or declined shape is never in it. Every source and repo is in
|
|
13688
|
+
* the read's visible set; a repo is drawn when a shape links into it. A catalog estate replaced while it was read is
|
|
13689
|
+
* left out with a note, never drawn half.
|
|
13690
|
+
*/
|
|
13691
|
+
export interface KnowledgeMapResponse {
|
|
13692
|
+
nodes: KnowledgeMapNode[];
|
|
13693
|
+
edges: KnowledgeMapEdge[];
|
|
13694
|
+
sources: Array<{ id: string; name: string; described: boolean; inKnowledge: boolean; tables: number }>;
|
|
13695
|
+
shapes: number;
|
|
13696
|
+
/** Approved shapes estate no longer holds, or hides. */
|
|
13697
|
+
skipped: number;
|
|
13698
|
+
truncated: boolean;
|
|
13699
|
+
notes: string[];
|
|
13700
|
+
}
|
|
13701
|
+
|
|
13290
13702
|
/**
|
|
13291
13703
|
* `POST /sources/:name/test-call` (G6) — human operator only. Without `confirm` it sends NOTHING and
|
|
13292
13704
|
* answers the exact request it would send and its `requestHash`; with `confirm` equal to that hash it
|
|
@@ -13339,6 +13751,106 @@ export interface CrewSourceCatalog {
|
|
|
13339
13751
|
routes: Array<{ path: string; responseType: string; params: string[] }>;
|
|
13340
13752
|
}
|
|
13341
13753
|
|
|
13754
|
+
// ── Test connection, and ask a question of a source (operator 2026-11-03; api-types 0.179.0) ─────────
|
|
13755
|
+
|
|
13756
|
+
/**
|
|
13757
|
+
* `POST /sources/:name/test` — "Test connection" on a saved `sql` or `graphql` source (it replaces
|
|
13758
|
+
* "Describe again"). crew connects with the saved credentials resolved now, describes the source again
|
|
13759
|
+
* and saves that description, then (SQL) checks a probe read of one table with the read policy and a
|
|
13760
|
+
* prepare at the source; the probe is never executed. A failure is a result (`ok: false`, HTTP 200):
|
|
13761
|
+
* crew's `code` and words (a source's own words reach a human only, scrubbed of the secret). No answer
|
|
13762
|
+
* carries the secret.
|
|
13763
|
+
*/
|
|
13764
|
+
export interface SourceConnectionTestResponse {
|
|
13765
|
+
name: string;
|
|
13766
|
+
kind: 'sql' | 'graphql';
|
|
13767
|
+
driver: 'postgres' | 'mysql' | 'sqlite' | null;
|
|
13768
|
+
ok: boolean;
|
|
13769
|
+
/** Connecting and describing, in milliseconds (a failure: until it failed). */
|
|
13770
|
+
ms: number;
|
|
13771
|
+
/** When crew ran the test (ISO 8601). */
|
|
13772
|
+
testedAt: string;
|
|
13773
|
+
/**
|
|
13774
|
+
* How crew connects: `verified` (TLS, the certificate checked against the host: Postgres
|
|
13775
|
+
* `verify-full`, MySQL `VERIFY_IDENTITY`, HTTPS), `off` (plaintext, allowed on this confirmed
|
|
13776
|
+
* address), `local` (an upload: crew opens its own snapshot, there is no connection).
|
|
13777
|
+
*/
|
|
13778
|
+
tls: 'verified' | 'off' | 'local';
|
|
13779
|
+
/** `ok`: the fresh description (saved): structure, and for Postgres the login's privilege report. */
|
|
13780
|
+
catalog?: SourceCatalogResponse;
|
|
13781
|
+
/** `ok`, SQL: the read-policy check of the probe read (`null`: no table to probe). */
|
|
13782
|
+
readCheck?: ({ ok: true; text: string; relation: string } | { ok: false; text: string; relation: string; code: string; detail: string }) | null;
|
|
13783
|
+
/** `!ok`: why (`secret_missing`, a dialer refusal code, `source_connection`, `source_timeout`, `source_source`, `test_failed`, …). */
|
|
13784
|
+
code?: string;
|
|
13785
|
+
error?: string;
|
|
13786
|
+
}
|
|
13787
|
+
|
|
13788
|
+
/** `POST /sources/:name/ask` — HUMAN operator only (403 `ask_human_only`). SQL sources. */
|
|
13789
|
+
export interface SourceAskBody {
|
|
13790
|
+
/** The person's question, e.g. "How many tickets are open?" (1-1000 characters). */
|
|
13791
|
+
question: string;
|
|
13792
|
+
}
|
|
13793
|
+
|
|
13794
|
+
/**
|
|
13795
|
+
* The draft: one seat wrote one read query from the question and the source's STRUCTURE only (what
|
|
13796
|
+
* agents see: names, types, keys, declared enum literals, row estimates; never a row or a credential),
|
|
13797
|
+
* and crew checked it with the read policy, then a prepare at the source. NOTHING RAN. `confirm` is
|
|
13798
|
+
* crew's run token for exactly `sql` (only when the check passed): `POST /sources/:name/query` with it
|
|
13799
|
+
* runs that text. Audited `apps.source.asked` (no question, no SQL).
|
|
13800
|
+
*/
|
|
13801
|
+
export interface SourceAskResponse {
|
|
13802
|
+
/** The query the seat wrote (`''`: it said the structure cannot answer the question). */
|
|
13803
|
+
sql: string;
|
|
13804
|
+
/** The seat's one line: what the query returns and how to read it (or why there is no query). */
|
|
13805
|
+
explanation: string;
|
|
13806
|
+
/** The seat that drafted it. */
|
|
13807
|
+
seat: string;
|
|
13808
|
+
/** The check of `sql` (`null` when there is no query). */
|
|
13809
|
+
check: SourceCheckResponse | null;
|
|
13810
|
+
confirm: string | null;
|
|
13811
|
+
}
|
|
13812
|
+
|
|
13813
|
+
/** `POST /sources/:name/query` — HUMAN operator only (403 `query_human_only`). SQL sources. */
|
|
13814
|
+
export interface SourceQueryBody {
|
|
13815
|
+
/** The SQL to check (or run): a draft, an edited draft, or the person's own. */
|
|
13816
|
+
sql: string;
|
|
13817
|
+
/** crew's run token for exactly `sql` (from the ask, or from this route without `confirm`). */
|
|
13818
|
+
confirm?: string;
|
|
13819
|
+
}
|
|
13820
|
+
|
|
13821
|
+
/**
|
|
13822
|
+
* Without `confirm`: the check only (`ran: false`; nothing reaches the source but a prepare) and, when
|
|
13823
|
+
* it passed, the run token. With `confirm`: crew verifies the token is its own for exactly this text
|
|
13824
|
+
* and this source as it is now (`409 query_changed` otherwise), then runs it: the read policy again,
|
|
13825
|
+
* a `READ ONLY` transaction, the 10 s deadline cancelled at the source (`504 source_timeout`), at most
|
|
13826
|
+
* {@link SourceQueryRan.rowCap} rows. The rows go to this answer only: never to a seat, a log or the
|
|
13827
|
+
* audit trail (`apps.source.queried` records the relations, counts and time).
|
|
13828
|
+
*/
|
|
13829
|
+
export type SourceQueryResponse = SourceQueryChecked | SourceQueryRan;
|
|
13830
|
+
|
|
13831
|
+
export interface SourceQueryChecked {
|
|
13832
|
+
ran: false;
|
|
13833
|
+
check: SourceCheckResponse;
|
|
13834
|
+
confirm: string | null;
|
|
13835
|
+
}
|
|
13836
|
+
|
|
13837
|
+
export interface SourceQueryRan {
|
|
13838
|
+
ran: true;
|
|
13839
|
+
columns: Array<{ name: string; type: string }>;
|
|
13840
|
+
/**
|
|
13841
|
+
* Cells as the source's driver reads them, as JSON carries them: Postgres and MySQL dates, times,
|
|
13842
|
+
* numerics and 64-bit integers as the source's own text (`2026-01-01 01:00:00+00`, in the session's
|
|
13843
|
+
* time zone), bytes as `\x` hex (the first 32,767 bytes, `…` past them; Postgres `bytea` arrives as the source's `\x`
|
|
13844
|
+
* text and is cut like any text), JSON values as JSON; text past 64 KB
|
|
13845
|
+
* is cut.
|
|
13846
|
+
*/
|
|
13847
|
+
rows: unknown[][];
|
|
13848
|
+
/** More rows than the cap, or past 1 MB of rows as encoded: only the first are shown. */
|
|
13849
|
+
truncated: boolean;
|
|
13850
|
+
rowCap: number;
|
|
13851
|
+
ms: number;
|
|
13852
|
+
}
|
|
13853
|
+
|
|
13342
13854
|
// ── Decision capture (DES-decision-capture §4.2.1 / §4.6; DC-S4a, api-types 0.80.0) ──────────────
|
|
13343
13855
|
|
|
13344
13856
|
/** The laya codebook's decision types. `none` is crew's label for "no decision". */
|
|
@@ -15076,6 +15588,38 @@ export interface AppLockAction {
|
|
|
15076
15588
|
contractHash: string;
|
|
15077
15589
|
}
|
|
15078
15590
|
|
|
15591
|
+
/**
|
|
15592
|
+
* (api-types 0.176.0, DES-APPS-001 K2b) One argument of a `.json` query text: a declared parameter of the
|
|
15593
|
+
* query, or a literal fixed by the app (a string of at most 1,000 characters). Viewer values are declared on
|
|
15594
|
+
* the query's parameters (`from`), never here.
|
|
15595
|
+
*/
|
|
15596
|
+
export type AppQueryArg = { kind: 'param'; name: string } | { kind: 'literal'; value: string | number | boolean | null };
|
|
15597
|
+
|
|
15598
|
+
/**
|
|
15599
|
+
* (api-types 0.176.0) `queries/<id>.json` of a `rest` or `mcp` query: one registry tool the person accepted
|
|
15600
|
+
* as a read on the source sheet, and its arguments (at most 50, each one of the tool's input properties).
|
|
15601
|
+
*/
|
|
15602
|
+
export interface AppToolQueryText {
|
|
15603
|
+
tool: string;
|
|
15604
|
+
args: Record<string, AppQueryArg>;
|
|
15605
|
+
}
|
|
15606
|
+
|
|
15607
|
+
/**
|
|
15608
|
+
* (api-types 0.176.0) `queries/<id>.json` of a `crew` query: one route the built-in crew source reads
|
|
15609
|
+
* (`SourceCatalogResponse` of `crew` lists them, e.g. `/runs/:id`), every `:param` of it in `params`, and
|
|
15610
|
+
* query-string values in `query`.
|
|
15611
|
+
*/
|
|
15612
|
+
export interface AppCrewQueryText {
|
|
15613
|
+
route: string;
|
|
15614
|
+
params: Record<string, AppQueryArg>;
|
|
15615
|
+
query: Record<string, AppQueryArg>;
|
|
15616
|
+
}
|
|
15617
|
+
|
|
15618
|
+
// How a query's text binds its parameters (api-types 0.176.0): SQL `$n` (Postgres) and the n-th `?` (MySQL,
|
|
15619
|
+
// SQLite) bind the n-th parameter in the order `params.properties` declares them, and every declared
|
|
15620
|
+
// parameter is used; GraphQL variables are the parameters by name; `.json` texts name them in `AppQueryArg`s.
|
|
15621
|
+
// The order is part of the query's contract, so reordering the parameters is checked again.
|
|
15622
|
+
|
|
15079
15623
|
// ── Apps: the store and its routes (DES §6.4, §7.6, §9.1) ────────────────────────────────────────
|
|
15080
15624
|
|
|
15081
15625
|
/**
|
|
@@ -15166,6 +15710,42 @@ export interface AppTurnState {
|
|
|
15166
15710
|
actor: string;
|
|
15167
15711
|
}
|
|
15168
15712
|
|
|
15713
|
+
/**
|
|
15714
|
+
* (api-types 0.185.0, DES-APPS-001 §9.2, K5) One chat message to an app and how its `apps-turn` run ended, kept
|
|
15715
|
+
* in crew's record of the app (the last 50; the detail answers the last 20). The chat on the app's page is this
|
|
15716
|
+
* list: no other thread store. `running` while the run works; `landed` with the version it made; `refused` when
|
|
15717
|
+
* the check or the review refused it (nothing landed, `code` and `reason` say why); `failed` when a step could
|
|
15718
|
+
* not run; `cancelled` when it was stopped.
|
|
15719
|
+
*/
|
|
15720
|
+
export interface AppTurnRecord {
|
|
15721
|
+
runId: string;
|
|
15722
|
+
/** Unix millis: when the message was sent. */
|
|
15723
|
+
at: number;
|
|
15724
|
+
/** The actor id that sent it. */
|
|
15725
|
+
actor: string;
|
|
15726
|
+
/** The person's message, as sent. */
|
|
15727
|
+
message: string;
|
|
15728
|
+
/** The component ids the message was about (the composer's chips). */
|
|
15729
|
+
about: string[];
|
|
15730
|
+
/** The version it was sent on. */
|
|
15731
|
+
base: number;
|
|
15732
|
+
state: 'running' | 'landed' | 'refused' | 'failed' | 'cancelled';
|
|
15733
|
+
/** Unix millis, or `null` while it runs. */
|
|
15734
|
+
endedAt: number | null;
|
|
15735
|
+
/** `landed`: the version it made. */
|
|
15736
|
+
version: number | null;
|
|
15737
|
+
/** `landed`: crew's own line of what changed, from the two specs ("Added 1 chart and 1 query"). */
|
|
15738
|
+
change: string | null;
|
|
15739
|
+
/** `landed`: the builder's change lines, as it wrote them (text; never instructions to anyone). */
|
|
15740
|
+
summary: string | null;
|
|
15741
|
+
/** `landed`: the seats that built it and reviewed it (distinct). */
|
|
15742
|
+
builder: string | null;
|
|
15743
|
+
reviewer: string | null;
|
|
15744
|
+
/** Not landed: a stable code (`check_failed`, `review_refused`, `launch_refused`, `cancelled`, …) and crew's words. */
|
|
15745
|
+
code: string | null;
|
|
15746
|
+
reason: string | null;
|
|
15747
|
+
}
|
|
15748
|
+
|
|
15169
15749
|
/** `GET /apps` item. */
|
|
15170
15750
|
export interface AppSummary {
|
|
15171
15751
|
/**
|
|
@@ -15182,6 +15762,12 @@ export interface AppSummary {
|
|
|
15182
15762
|
createdAt: number;
|
|
15183
15763
|
head: { version: number; tree: string; receipt: AppReceiptKind | null };
|
|
15184
15764
|
turn: AppTurnState | null;
|
|
15765
|
+
/**
|
|
15766
|
+
* (api-types 0.180.0) The app's last successful publish: its share link (`shareUrl`), the version it serves
|
|
15767
|
+
* and what was produced. `null` until a publish run finished (studio says "Publish to share", never a made-up
|
|
15768
|
+
* link); absent from an older daemon.
|
|
15769
|
+
*/
|
|
15770
|
+
published?: AppPublished | null;
|
|
15185
15771
|
}
|
|
15186
15772
|
|
|
15187
15773
|
/** `GET /apps` (observer); `?project=<id>` keeps one project's apps. */
|
|
@@ -15206,6 +15792,8 @@ export interface AppDetail extends AppSummary {
|
|
|
15206
15792
|
/** Oldest first. */
|
|
15207
15793
|
versions: AppVersion[];
|
|
15208
15794
|
history: AppHistory;
|
|
15795
|
+
/** (api-types 0.185.0, K5) The app's chat: its last turns, oldest first. Absent from an older daemon. */
|
|
15796
|
+
turns?: AppTurnRecord[];
|
|
15209
15797
|
}
|
|
15210
15798
|
|
|
15211
15799
|
/** `GET /apps/:app` (observer), and `POST /apps` (201). */
|
|
@@ -15283,7 +15871,13 @@ export interface AppQueryBody {
|
|
|
15283
15871
|
/** One cell: values are rendered as text by the runtime. */
|
|
15284
15872
|
export type AppCell = string | number | boolean | null;
|
|
15285
15873
|
|
|
15286
|
-
/**
|
|
15874
|
+
/**
|
|
15875
|
+
* `POST /apps/:app/query` 200 (DES §7.2). `rows` are aligned with `columns`, which are exactly the query's
|
|
15876
|
+
* declared output (api-types 0.177.0: values coerced to their declared types; `integer` and `number` cells
|
|
15877
|
+
* are JS numbers within ±2^53; `date` is `YYYY-MM-DD`, `datetime` ISO 8601). `truncated`: a cap cut the
|
|
15878
|
+
* answer (5,000 rows, 10 MB, a cell past 64 KB cut). `hasMore`: the more path says another page exists.
|
|
15879
|
+
* `ms`: this request's time. Identical reads within the query's cache life share one answer.
|
|
15880
|
+
*/
|
|
15287
15881
|
export interface AppQueryResponse {
|
|
15288
15882
|
columns: AppOutputColumn[];
|
|
15289
15883
|
rows: AppCell[][];
|
|
@@ -15294,6 +15888,151 @@ export interface AppQueryResponse {
|
|
|
15294
15888
|
cachedAt: number | null;
|
|
15295
15889
|
}
|
|
15296
15890
|
|
|
15891
|
+
// ── Apps: the write path (api-types 0.178.0, DES-APPS-001 §7.3, §7.4, §9.4, slice K2b) ─────────────────
|
|
15892
|
+
|
|
15893
|
+
/** Where a value on an action card comes from (DES §7.3: "your sign-in", "fixed by the app", "filled by studio: now"). */
|
|
15894
|
+
export type AppActionValueSource = 'param' | 'app' | 'viewer' | 'crew';
|
|
15895
|
+
|
|
15896
|
+
/** One value on a card: the column or argument, the value as it will be sent, and where it comes from. */
|
|
15897
|
+
export interface AppActionCardValue {
|
|
15898
|
+
name: string;
|
|
15899
|
+
/** A list argument shows its items (an array parameter, the viewer's groups). */
|
|
15900
|
+
value: string | number | boolean | null | Array<string | number | boolean>;
|
|
15901
|
+
from: AppActionValueSource;
|
|
15902
|
+
/** The words for `from`: "you entered it", "fixed by the app", "your sign-in", "filled by studio: now". */
|
|
15903
|
+
label: string;
|
|
15904
|
+
}
|
|
15905
|
+
|
|
15906
|
+
/**
|
|
15907
|
+
* The card crew generates from the RESOLVED operation (DES §7.3) and the host draws outside the app's
|
|
15908
|
+
* frame: the only per-run consent. Every value is on it, literals included.
|
|
15909
|
+
*/
|
|
15910
|
+
export type AppActionCard =
|
|
15911
|
+
| {
|
|
15912
|
+
kind: 'api';
|
|
15913
|
+
app: string;
|
|
15914
|
+
action: string;
|
|
15915
|
+
source: string;
|
|
15916
|
+
/** The source's kind: `rest`, `mcp-http`, `mcp-stdio` or `graphql`. */
|
|
15917
|
+
sourceKind: string;
|
|
15918
|
+
/** `POST /v1/tickets/4821/assign`, `mutation assign`, or `tool assign_ticket`. */
|
|
15919
|
+
operation: string;
|
|
15920
|
+
args: AppActionCardValue[];
|
|
15921
|
+
/** The request as it will be sent (method and URL and body, the GraphQL document and variables, or the tool call). */
|
|
15922
|
+
request: string;
|
|
15923
|
+
/** The action's description, labelled "The app says" by the host. */
|
|
15924
|
+
appSays?: string;
|
|
15925
|
+
}
|
|
15926
|
+
| {
|
|
15927
|
+
kind: 'row-write';
|
|
15928
|
+
app: string;
|
|
15929
|
+
action: string;
|
|
15930
|
+
source: string;
|
|
15931
|
+
/** The login the write runs as. */
|
|
15932
|
+
login: string;
|
|
15933
|
+
verb: 'INSERT' | 'UPDATE' | 'DELETE';
|
|
15934
|
+
/** Schema-qualified: `support.tickets`. */
|
|
15935
|
+
table: string;
|
|
15936
|
+
/** Every column it sets (an insert: every column of the table), with its value. */
|
|
15937
|
+
columns: AppActionCardValue[];
|
|
15938
|
+
/** The key (`id = 4821`). */
|
|
15939
|
+
key: AppActionCardValue[];
|
|
15940
|
+
/** "exactly 1 row, verified". */
|
|
15941
|
+
rows: string;
|
|
15942
|
+
/** "plain table: no triggers, rules, inheritance or row security; checked just now". */
|
|
15943
|
+
checks: string;
|
|
15944
|
+
/** The statement as it will run (values are its `$n` parameters, listed above). */
|
|
15945
|
+
statement: string;
|
|
15946
|
+
appSays?: string;
|
|
15947
|
+
};
|
|
15948
|
+
|
|
15949
|
+
/** `POST /apps/:app/actions/:id/prepare` (HUMAN operator). `params` are the action's declared, non-viewer parameters. */
|
|
15950
|
+
export interface AppActionPrepareBody {
|
|
15951
|
+
version: number | string;
|
|
15952
|
+
params?: Record<string, unknown>;
|
|
15953
|
+
}
|
|
15954
|
+
|
|
15955
|
+
/** `POST /apps/:app/actions/:id/prepare` 200: the record to run within 2 minutes, and its card. */
|
|
15956
|
+
export interface AppActionPrepareResponse {
|
|
15957
|
+
record: string;
|
|
15958
|
+
card: AppActionCard;
|
|
15959
|
+
/** Unix millis. */
|
|
15960
|
+
expiresAt: number;
|
|
15961
|
+
}
|
|
15962
|
+
|
|
15963
|
+
/** `POST /apps/:app/actions/:id/run` (HUMAN operator, the person who prepared it). */
|
|
15964
|
+
export interface AppActionRunBody {
|
|
15965
|
+
record: string;
|
|
15966
|
+
}
|
|
15967
|
+
|
|
15968
|
+
/**
|
|
15969
|
+
* An action record's states (DES §7.3): `prepared → running → succeeded | failed | unknown`. `running` is the
|
|
15970
|
+
* linearization point (persisted before the upstream call); `unknown` = the outcome could not be known (the
|
|
15971
|
+
* daemon restarted during the call, or the call was sent and no answer came). Nothing is ever re-run.
|
|
15972
|
+
*/
|
|
15973
|
+
export type AppActionState = 'prepared' | 'running' | 'succeeded' | 'failed' | 'unknown';
|
|
15974
|
+
|
|
15975
|
+
/** `POST /apps/:app/actions/:id/run` 200: how it ended. */
|
|
15976
|
+
export interface AppActionRunResponse {
|
|
15977
|
+
record: string;
|
|
15978
|
+
state: 'succeeded' | 'failed' | 'unknown';
|
|
15979
|
+
/** Why it failed or is unknown, in crew's words. */
|
|
15980
|
+
reason?: string;
|
|
15981
|
+
/** A row write: `{ table, op, key }`; an API action: the answer, scrubbed and cut at 64 KB. */
|
|
15982
|
+
result?: unknown;
|
|
15983
|
+
}
|
|
15984
|
+
|
|
15985
|
+
/** `GET /apps/:app/actions/records/:id` 200 (the person who prepared it): answers a lost response. */
|
|
15986
|
+
export interface AppActionRecordView {
|
|
15987
|
+
id: string;
|
|
15988
|
+
app: string;
|
|
15989
|
+
action: string;
|
|
15990
|
+
version: number | null;
|
|
15991
|
+
tree: string;
|
|
15992
|
+
state: AppActionState;
|
|
15993
|
+
reason?: string;
|
|
15994
|
+
result?: unknown;
|
|
15995
|
+
card: AppActionCard;
|
|
15996
|
+
createdAt: number;
|
|
15997
|
+
expiresAt: number;
|
|
15998
|
+
endedAt?: number;
|
|
15999
|
+
}
|
|
16000
|
+
|
|
16001
|
+
/** `POST /apps/:app/actions/:id/grant` (HUMAN operator): grant the action as it is in this version. */
|
|
16002
|
+
export interface AppActionGrantBody {
|
|
16003
|
+
version: number | string;
|
|
16004
|
+
}
|
|
16005
|
+
|
|
16006
|
+
/**
|
|
16007
|
+
* A grant (DES §9.4): keyed by app and action, bound to the action hash, the contract hash (a row write's
|
|
16008
|
+
* holds the table's safety fingerprint) and the source descriptor; any change withdraws it. Turning a
|
|
16009
|
+
* source's Allow writes off withdraws its row-write grants.
|
|
16010
|
+
*/
|
|
16011
|
+
export interface AppActionGrant {
|
|
16012
|
+
app: string;
|
|
16013
|
+
action: string;
|
|
16014
|
+
kind: 'api' | 'row-write';
|
|
16015
|
+
source: string;
|
|
16016
|
+
actionHash: string;
|
|
16017
|
+
contractHash: string;
|
|
16018
|
+
descriptorHash: string;
|
|
16019
|
+
/** A row write: the table safety check's fingerprint at grant. */
|
|
16020
|
+
fingerprint?: string;
|
|
16021
|
+
grantedBy: Actor;
|
|
16022
|
+
/** Unix millis. */
|
|
16023
|
+
grantedAt: number;
|
|
16024
|
+
}
|
|
16025
|
+
|
|
16026
|
+
/** `POST …/grant` 200 and `GET …/grant` 200 (observer). */
|
|
16027
|
+
export interface AppActionGrantResponse {
|
|
16028
|
+
grant: AppActionGrant;
|
|
16029
|
+
}
|
|
16030
|
+
|
|
16031
|
+
/** `DELETE …/grant` 200: whether a grant was there. */
|
|
16032
|
+
export interface AppActionRevokeResponse {
|
|
16033
|
+
revoked: boolean;
|
|
16034
|
+
}
|
|
16035
|
+
|
|
15297
16036
|
/** One reason a check refused a tree. `path` is a JSON path into `apps.json`, or a repo path. */
|
|
15298
16037
|
export interface AppCheckFinding {
|
|
15299
16038
|
stage: 'spec' | 'files' | 'policy' | 'source';
|
|
@@ -15317,6 +16056,26 @@ export interface AppCheckFinding {
|
|
|
15317
16056
|
* - 429 `rate_limited` (with `retryAfterMs`: a query queue or a per-viewer rate is full, DES §7.5);
|
|
15318
16057
|
* - 501 `not_implemented` (a route a later slice serves; nothing happened);
|
|
15319
16058
|
* - 503 `apps_unavailable`.
|
|
16059
|
+
*
|
|
16060
|
+
* (api-types 0.178.0, K2b) The action routes also answer: 409 `read_only` (`APPS_READ_ONLY` is set: no
|
|
16061
|
+
* write at all), `not_granted` (no grant for the action as it is now; a stale grant is withdrawn and says
|
|
16062
|
+
* so), `writes_off` (the source's Allow writes switch is off), `table_changed` (the row write's table no
|
|
16063
|
+
* longer passes the safety check, or its fingerprint differs from the grant's: the grant is withdrawn),
|
|
16064
|
+
* `value_does_not_fit` (a value its column would change, P28), `record_used` (the record already ran or is
|
|
16065
|
+
* running: nothing is re-run), `record_expired`, `missing_grants` (granting a row write whose login lacks a
|
|
16066
|
+
* privilege the write needs: the message lists the exact `GRANT` statements); 404 `unknown_action`,
|
|
16067
|
+
* `unknown_record`.
|
|
16068
|
+
*
|
|
16069
|
+
* (api-types 0.177.0, K2b) `POST /apps/:app/query` also answers: 400 `bad_params` (a parameter that is not
|
|
16070
|
+
* declared, does not satisfy its schema, is required and missing, or is viewer-bound and was sent); 403
|
|
16071
|
+
* `human_only` for an agent or plugin actor (an app's rows reach a person, never a model); 409
|
|
16072
|
+
* `viewer_unavailable` (a viewer-bound value crew does not know, e.g. no git `user.email` locally, or groups
|
|
16073
|
+
* in local preview), `contract_changed` (the source's connection, or what the query reads there, changed
|
|
16074
|
+
* since this version was checked: check it again), `query_refused` (the read policy or the source's live
|
|
16075
|
+
* relation checks refuse it now); 422 `result_invalid` (a value does not fit its declared column: the
|
|
16076
|
+
* message names the column and row, never the value); 502 `source_failed` / `source_unavailable` (the
|
|
16077
|
+
* source answered an error or could not be reached: a class and a SQLSTATE, never the source's words); 504
|
|
16078
|
+
* `source_timeout` (stopped at the 10 s deadline, at the source).
|
|
15320
16079
|
*/
|
|
15321
16080
|
export interface AppErrorBody {
|
|
15322
16081
|
code:
|
|
@@ -15326,6 +16085,10 @@ export interface AppErrorBody {
|
|
|
15326
16085
|
| 'unknown_version'
|
|
15327
16086
|
| 'unknown_query'
|
|
15328
16087
|
| 'unknown_project'
|
|
16088
|
+
/** (api-types 0.185.0) `POST /apps/check` from a unit that is not the turn's check step. */
|
|
16089
|
+
| 'not_the_check'
|
|
16090
|
+
/** (api-types 0.185.0) A turn on an app whose repository is not registered yet. */
|
|
16091
|
+
| 'not_registered'
|
|
15329
16092
|
| 'stale_base'
|
|
15330
16093
|
| 'turn_in_flight'
|
|
15331
16094
|
| 'not_accepted'
|
|
@@ -15342,7 +16105,25 @@ export interface AppErrorBody {
|
|
|
15342
16105
|
| 'not_this_turn'
|
|
15343
16106
|
| 'not_checked'
|
|
15344
16107
|
| 'reviewer_not_distinct'
|
|
15345
|
-
| 'apps_unavailable'
|
|
16108
|
+
| 'apps_unavailable'
|
|
16109
|
+
| 'bad_params'
|
|
16110
|
+
| 'viewer_unavailable'
|
|
16111
|
+
| 'contract_changed'
|
|
16112
|
+
| 'query_refused'
|
|
16113
|
+
| 'result_invalid'
|
|
16114
|
+
| 'source_failed'
|
|
16115
|
+
| 'source_unavailable'
|
|
16116
|
+
| 'source_timeout'
|
|
16117
|
+
| 'read_only'
|
|
16118
|
+
| 'not_granted'
|
|
16119
|
+
| 'writes_off'
|
|
16120
|
+
| 'table_changed'
|
|
16121
|
+
| 'value_does_not_fit'
|
|
16122
|
+
| 'record_used'
|
|
16123
|
+
| 'record_expired'
|
|
16124
|
+
| 'unknown_action'
|
|
16125
|
+
| 'unknown_record'
|
|
16126
|
+
| 'missing_grants';
|
|
15346
16127
|
error: string;
|
|
15347
16128
|
/** `rate_limited`: when to try again (also sent as `Retry-After`). */
|
|
15348
16129
|
retryAfterMs?: number;
|
|
@@ -15357,21 +16138,40 @@ export interface AppErrorBody {
|
|
|
15357
16138
|
* unit's capability token in the body, never as a bearer): check the builder's candidate commit of the
|
|
15358
16139
|
* app's turn in flight (DES §9.2 `check`).
|
|
15359
16140
|
*/
|
|
15360
|
-
export
|
|
15361
|
-
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
|
|
16141
|
+
export type AppsCheckBody =
|
|
16142
|
+
| {
|
|
16143
|
+
token: string;
|
|
16144
|
+
/**
|
|
16145
|
+
* (api-types 0.185.0) The builder's worktree as the engine snapshotted it (`WICKED_TREE`, a tree in the app
|
|
16146
|
+
* repo's objects); crew finds the app by the unit's run.
|
|
16147
|
+
*/
|
|
16148
|
+
tree: string;
|
|
16149
|
+
/** The publish manifest, for the publish check (a later slice). */
|
|
16150
|
+
manifest?: unknown;
|
|
16151
|
+
}
|
|
16152
|
+
| {
|
|
16153
|
+
token: string;
|
|
16154
|
+
app: string;
|
|
16155
|
+
/** The builder's candidate commit in the app repo (the older form). */
|
|
16156
|
+
commit: string;
|
|
16157
|
+
/** The publish manifest, for the publish check (a later slice). */
|
|
16158
|
+
manifest?: unknown;
|
|
16159
|
+
};
|
|
15368
16160
|
|
|
15369
16161
|
/**
|
|
15370
16162
|
* (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
16163
|
* turn's review can land) and what the check ran; on a refusal, why.
|
|
15372
16164
|
*/
|
|
15373
16165
|
export type AppsCheckResponse =
|
|
15374
|
-
| {
|
|
16166
|
+
| {
|
|
16167
|
+
ok: true; commit: string; tree: string; summary: AppCheckSummary;
|
|
16168
|
+
/**
|
|
16169
|
+
* (api-types 0.185.0) The checked tree's files as text (`apps.json`, `apps.lock.json`, `queries/<id>.<ext>`):
|
|
16170
|
+
* `wicked-crew apps-check` writes exactly these into the turn's worktree, so the review is dispatched on the
|
|
16171
|
+
* tree that can land.
|
|
16172
|
+
*/
|
|
16173
|
+
files?: Array<{ path: string; text: string }>;
|
|
16174
|
+
}
|
|
15375
16175
|
| { ok: false; code: 'check_failed' | 'source_check_unavailable'; findings: AppCheckFinding[] };
|
|
15376
16176
|
|
|
15377
16177
|
/**
|
|
@@ -15380,17 +16180,26 @@ export type AppsCheckResponse =
|
|
|
15380
16180
|
* serves that route for real rather than answering `501`.
|
|
15381
16181
|
*/
|
|
15382
16182
|
export interface AppsCapabilities {
|
|
15383
|
-
/**
|
|
16183
|
+
/**
|
|
16184
|
+
* `POST /apps/:app/query` runs queries (until then it checks the receipt, then answers `501`). True since
|
|
16185
|
+
* api-types 0.177.0 (K2b, the executor).
|
|
16186
|
+
*/
|
|
15384
16187
|
query: boolean;
|
|
15385
|
-
/**
|
|
16188
|
+
/**
|
|
16189
|
+
* `POST /apps/:app/actions/:id/prepare|run|grant`, `GET|DELETE …/grant`, `GET …/actions/records/:id`. True
|
|
16190
|
+
* since api-types 0.178.0 (K2b, the write path: API actions and Postgres row writes).
|
|
16191
|
+
*/
|
|
15386
16192
|
actions: boolean;
|
|
15387
|
-
/** `POST /apps/:app/turns` launches `apps-turn` runs. */
|
|
16193
|
+
/** `POST /apps/:app/turns` launches `apps-turn` runs (true since api-types 0.185.0 on a daemon whose engine runs them). */
|
|
15388
16194
|
turns: boolean;
|
|
15389
16195
|
/** `POST /apps/:app/publish`. */
|
|
15390
16196
|
publish: boolean;
|
|
15391
16197
|
/** `POST /apps/uploads`. */
|
|
15392
16198
|
uploads: boolean;
|
|
15393
|
-
/**
|
|
16199
|
+
/**
|
|
16200
|
+
* The read policy and the per-kind source check run, so a change to queries or actions can land (true since
|
|
16201
|
+
* api-types 0.176.0 on a daemon with a connector registry: crew's source stage, DES §9.2 step 3).
|
|
16202
|
+
*/
|
|
15394
16203
|
sourceCheck: boolean;
|
|
15395
16204
|
}
|
|
15396
16205
|
|
|
@@ -15412,3 +16221,164 @@ export interface RegisterRepoBody {
|
|
|
15412
16221
|
actor?: string;
|
|
15413
16222
|
autoCapture?: boolean;
|
|
15414
16223
|
}
|
|
16224
|
+
|
|
16225
|
+
// ── Apps: publish and the standalone site (api-types 0.180.0, DES-APPS-001 §8.1-8.2, §9.3, slice K6) ──────────
|
|
16226
|
+
//
|
|
16227
|
+
// Publish turns an accepted version into a container image the deployer runs: `wicked-apps-server` with the
|
|
16228
|
+
// runtime, the checked `apps.json`, `queries/`, `apps.lock.json`, the snapshots by digest and the manifest
|
|
16229
|
+
// below. The SHARE LINK is the site's own address, the base URL the deployer gives in the publish settings
|
|
16230
|
+
// (`site.origin`): after a successful publish it is `AppPublished.shareUrl`, and anyone in the app's audience
|
|
16231
|
+
// (anyone at all, for a public app) opens it. crew never invents one and pushes nothing anywhere.
|
|
16232
|
+
|
|
16233
|
+
/** Where a publish puts the app. `studio` is always on; `embed` needs a public app; `teams` needs the Entra profile. */
|
|
16234
|
+
export type AppPublishTarget = 'studio' | 'site' | 'embed' | 'teams';
|
|
16235
|
+
|
|
16236
|
+
/**
|
|
16237
|
+
* Who may open the site, judged on the verified token (DES §8.2). `public`: anyone, read-only (every query
|
|
16238
|
+
* public, no action). `oidc-groups`: a group claim value (`claim`, default `groups`). `oidc-email-domain`: the
|
|
16239
|
+
* email's domain, only with `email_verified: true` (a Boolean). `entra-roles`: an app-role VALUE in `roles`
|
|
16240
|
+
* (recommended). `entra-groups`: a group object id in `groups` (a token with a groups overage marker is refused).
|
|
16241
|
+
*/
|
|
16242
|
+
export type AppAudienceRule =
|
|
16243
|
+
| { kind: 'public' }
|
|
16244
|
+
| { kind: 'oidc-groups'; groups: string[]; claim?: string }
|
|
16245
|
+
| { kind: 'oidc-email-domain'; domains: string[] }
|
|
16246
|
+
| { kind: 'entra-roles'; roles: string[] }
|
|
16247
|
+
| { kind: 'entra-groups'; groups: string[] };
|
|
16248
|
+
|
|
16249
|
+
/**
|
|
16250
|
+
* The site's one issuer, fixed at publish. `oidc`: the page signs in with authorization code + PKCE and sends
|
|
16251
|
+
* the ID token (`aud` = `clientId`). `entra`: the page sends a v2 ACCESS token for the app's own
|
|
16252
|
+
* `access_as_user` scope (`aud` = `clientId`, `scp` has `access_as_user`, `tid` = `tenantId`); app-only tokens and
|
|
16253
|
+
* ID tokens are refused. The issuer is `https://` (Entra: `https://login.microsoftonline.com/<tenantId>/v2.0`).
|
|
16254
|
+
*/
|
|
16255
|
+
export interface AppPublishIdentity {
|
|
16256
|
+
profile: 'oidc' | 'entra';
|
|
16257
|
+
issuer: string;
|
|
16258
|
+
clientId: string;
|
|
16259
|
+
/** `entra` only. */
|
|
16260
|
+
tenantId?: string;
|
|
16261
|
+
/** The scope the page asks for. Default: `openid email profile groups` (oidc), `api://<site host>/<clientId>/access_as_user openid profile` (entra). */
|
|
16262
|
+
scope?: string;
|
|
16263
|
+
/**
|
|
16264
|
+
* Loopback or private CIDR ranges the issuer may be reached at when it is a NAME on a private network (crew's
|
|
16265
|
+
* `OidcConfig.allowRanges`); an IP-literal issuer confirms itself. Never metadata or link-local.
|
|
16266
|
+
*/
|
|
16267
|
+
allowRanges?: string[];
|
|
16268
|
+
}
|
|
16269
|
+
|
|
16270
|
+
/** `POST /apps/:app/publish` (HUMAN operator): launch an `apps-publish` run bound to the head tree and this manifest. */
|
|
16271
|
+
export interface AppPublishBody {
|
|
16272
|
+
/** The head version the person is publishing (`409 stale_base` if head moved). */
|
|
16273
|
+
base: number;
|
|
16274
|
+
targets: AppPublishTarget[];
|
|
16275
|
+
/**
|
|
16276
|
+
* The site's address: `https://<host>[:port]`, or `http://localhost:<port>` / `http://127.0.0.1:<port>` for a
|
|
16277
|
+
* local run. No path, query or credentials. It is the share link, the redirect URI's origin
|
|
16278
|
+
* (`<origin>/auth/callback`), and the only origin a POST to the site may come from.
|
|
16279
|
+
*/
|
|
16280
|
+
site: { origin: string };
|
|
16281
|
+
/** `null` = a public app (no sign-in). */
|
|
16282
|
+
identity: AppPublishIdentity | null;
|
|
16283
|
+
audience: AppAudienceRule;
|
|
16284
|
+
/** `embed`: the origins that may frame the public site (`https://…`, no path). `teams` adds the Teams origins itself. */
|
|
16285
|
+
embedOrigins?: string[];
|
|
16286
|
+
}
|
|
16287
|
+
|
|
16288
|
+
/** One source as the person consents to shipping it (DES §9.3 step 3). */
|
|
16289
|
+
export interface AppManifestSource {
|
|
16290
|
+
name: string;
|
|
16291
|
+
kind: 'sql' | 'graphql' | 'rest' | 'mcp-http';
|
|
16292
|
+
descriptorHash: string;
|
|
16293
|
+
/** Where the container must reach it (`db.support.internal:5432`, a URL's origin), or `null` for a snapshot. */
|
|
16294
|
+
reach: string | null;
|
|
16295
|
+
/** The address is loopback or private: the container's network must reach it. */
|
|
16296
|
+
privateAddress: boolean;
|
|
16297
|
+
/** The environment variable the deployer passes its secret in, or `null` when it has none. */
|
|
16298
|
+
env: string | null;
|
|
16299
|
+
/** A Postgres source's Allow writes switch at publish. */
|
|
16300
|
+
allowWrites: boolean;
|
|
16301
|
+
/** An upload: the snapshot's digest, shipped in the image. */
|
|
16302
|
+
snapshot?: string;
|
|
16303
|
+
}
|
|
16304
|
+
|
|
16305
|
+
/** The manifest a publish run is bound to (its digest is on the run, the QE verdict and the `published` receipt). */
|
|
16306
|
+
export interface AppPublishManifest {
|
|
16307
|
+
schema: 'wicked.apps.manifest/v1';
|
|
16308
|
+
app: { slug: string; name: string; version: number; tree: string; commit: string };
|
|
16309
|
+
targets: AppPublishTarget[];
|
|
16310
|
+
site: { origin: string };
|
|
16311
|
+
/**
|
|
16312
|
+
* The issuer, with the endpoints its discovery document named at publish (the page's `connect-src`) and the ID
|
|
16313
|
+
* token signing algorithms it named (`id_token_signing_alg_values_supported`; the page checks the ID token's).
|
|
16314
|
+
*/
|
|
16315
|
+
identity: (AppPublishIdentity & { endpoints: { authorization: string; token: string; idTokenAlgs?: string[] } }) | null;
|
|
16316
|
+
audience: AppAudienceRule;
|
|
16317
|
+
embedOrigins: string[];
|
|
16318
|
+
sources: AppManifestSource[];
|
|
16319
|
+
queries: Array<{ id: string; source: string; public: boolean }>;
|
|
16320
|
+
/** Each action with the grant the image enforces (revoking = publishing again without it). */
|
|
16321
|
+
actions: Array<{ id: string; kind: 'api' | 'row-write'; source: string; grant: AppActionGrant; table?: string; columns?: string[] }>;
|
|
16322
|
+
/** Every environment name the image needs, sorted. A missing one fails the server's start, by name. */
|
|
16323
|
+
env: string[];
|
|
16324
|
+
/** `/data` must be a mounted volume when the app has an action (its action records and logs live there). */
|
|
16325
|
+
volume: '/data' | null;
|
|
16326
|
+
}
|
|
16327
|
+
|
|
16328
|
+
/** An app's last successful publish (`AppSummary.published`, so also on `AppDetail`): the share link and what was produced. */
|
|
16329
|
+
export interface AppPublished {
|
|
16330
|
+
version: number;
|
|
16331
|
+
tree: string;
|
|
16332
|
+
/** The `apps-publish` run. */
|
|
16333
|
+
runId: string;
|
|
16334
|
+
/** Unix millis, when the image was produced. */
|
|
16335
|
+
at: number;
|
|
16336
|
+
/** Who consented. */
|
|
16337
|
+
actor: Actor;
|
|
16338
|
+
targets: AppPublishTarget[];
|
|
16339
|
+
/** The share link: `site.origin` + `/`. What studio's Copy link copies. */
|
|
16340
|
+
shareUrl: string;
|
|
16341
|
+
/** Who can open it, in one line ("People in group support-ops who sign in at dex.apps.test"). */
|
|
16342
|
+
audience: string;
|
|
16343
|
+
/** The image in the local container engine (never pushed): its tag and its id (`sha256:…`). */
|
|
16344
|
+
image: { tag: string; id: string };
|
|
16345
|
+
/** `embed`: the iframe snippet (a public app only); otherwise `null`. */
|
|
16346
|
+
snippet: string | null;
|
|
16347
|
+
/** `teams`: the Teams app package, at `GET /api/v1/apps/:app/published/teams.zip`; otherwise `null`. */
|
|
16348
|
+
teamsPackage: { url: string; sha256: string } | null;
|
|
16349
|
+
manifestDigest: string;
|
|
16350
|
+
/** How the deployer runs it: the environment names, the volume (or `null`), the port the server listens on. */
|
|
16351
|
+
run: { env: string[]; volume: '/data' | null; port: number };
|
|
16352
|
+
}
|
|
16353
|
+
|
|
16354
|
+
// The standalone site's own routes (`wicked-apps-server`; the page's in-process host calls them). Bearer only,
|
|
16355
|
+
// no cookies; every POST needs `Origin` = the site's origin and `Content-Type: application/json`.
|
|
16356
|
+
|
|
16357
|
+
/** `GET /spec` (a token in the audience, or a public app): the published version and who is viewing. */
|
|
16358
|
+
export interface AppSiteSpecResponse {
|
|
16359
|
+
app: { slug: string; name: string; version: number };
|
|
16360
|
+
spec: AppSpec;
|
|
16361
|
+
/** What the server took from the verified token; `null` on a public site. */
|
|
16362
|
+
viewer: { email: string | null; name: string | null } | null;
|
|
16363
|
+
/** Actions run on this site (a mounted `/data`, `APPS_READ_ONLY` unset). The page still refuses them in a frame. */
|
|
16364
|
+
actions: boolean;
|
|
16365
|
+
/**
|
|
16366
|
+
* Queries and actions the server refuses NOW, each with its reason. They are judged again at every refresh (every
|
|
16367
|
+
* 10 minutes, and after a failed read): a source back as it was published clears them; a source that really
|
|
16368
|
+
* changed needs the app checked and published again.
|
|
16369
|
+
*/
|
|
16370
|
+
refused: Array<{ kind: 'query' | 'action'; id: string; reason: string }>;
|
|
16371
|
+
}
|
|
16372
|
+
|
|
16373
|
+
/**
|
|
16374
|
+
* `GET /healthz` (no sign-in): up, and what it refuses, by kind, id and a code only (`contract_changed`,
|
|
16375
|
+
* `table_changed`, `source_unavailable`, …). The reasons, which can name a source or a table, are on `GET /spec`
|
|
16376
|
+
* behind the sign-in.
|
|
16377
|
+
*/
|
|
16378
|
+
export interface AppSiteHealth {
|
|
16379
|
+
ok: boolean;
|
|
16380
|
+
app: string;
|
|
16381
|
+
version: number;
|
|
16382
|
+
refused: Array<{ kind: 'query' | 'action'; id: string; code: string }>;
|
|
16383
|
+
actions: boolean;
|
|
16384
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-crew-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.186.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",
|