wicked-crew-api-types 0.178.0 → 0.191.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 +1160 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -259,6 +259,12 @@ export interface HealthCapabilities {
|
|
|
259
259
|
* send the field (its strict launch schema 400s on it) and do not call the preview.
|
|
260
260
|
*/
|
|
261
261
|
linkedIssuesExclude?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* (api-types 0.187.0, DES-PM-001 PM-1) This daemon serves project-management sources: the `pm` registration field,
|
|
264
|
+
* the human-only `/tracker-links` routes (and `/tracker-links/issues`), `GET /sources/:name/trackers`, the tracker
|
|
265
|
+
* set in linked issues (`LinkedIssuesPreviewBody.projectId`), and `/runs/:id/tracker-actions`. Absent = none of it.
|
|
266
|
+
*/
|
|
267
|
+
trackerLinks?: boolean;
|
|
262
268
|
/**
|
|
263
269
|
* Repo-bound runs get an EVIDENCE ROOT for walkthroughs (WT-W1, api-types 0.74.0): the engine
|
|
264
270
|
* addon takes `LaunchOptions.evidenceRoot` (wicked-core-ts ≥ 0.7.35), so a walkthrough step on a
|
|
@@ -353,6 +359,13 @@ export interface HealthCapabilities {
|
|
|
353
359
|
* ABSENT on an older daemon: read as `false` and hide the switch.
|
|
354
360
|
*/
|
|
355
361
|
powerMode?: boolean | undefined;
|
|
362
|
+
/**
|
|
363
|
+
* (api-types 0.188.0, crew#1139) A `plan_approval` approval carries the operator's note: `GateDecision.amend`
|
|
364
|
+
* on `{approve: true}` or `{approve: true, plan}` at a plan gate lands on the first creator step the plan
|
|
365
|
+
* releases (else its first step) as `unitReworkAmended`. ABSENT or `false` (an engine without it refuses the
|
|
366
|
+
* note): offer no note field on the plan card.
|
|
367
|
+
*/
|
|
368
|
+
planGateNote?: boolean | undefined;
|
|
356
369
|
/**
|
|
357
370
|
* (api-types 0.156.0, DES-VOICE) Voice mode's routes are served: `GET /voice/status`, `POST|DELETE /voice/model`,
|
|
358
371
|
* `POST /voice/transcribe` and `GET|PUT /voice/dashboard`. Whether transcription can run NOW (the engine and
|
|
@@ -2456,6 +2469,18 @@ export interface GateDecision {
|
|
|
2456
2469
|
* `operator_judgment` then applies). Refused (409, gate left open) at every other gate and on a
|
|
2457
2470
|
* run that does not require QE acceptance. Engine: wicked-core-ts after 0.16.3. */
|
|
2458
2471
|
| 'skip_qe'
|
|
2472
|
+
/** (api-types 0.190.0, DES-RULE-CHECK-001 S2) At a `rules_unchecked` gate (a steering rule no
|
|
2473
|
+
* judge ruled on), with `approve: true` and no `amend` / `amendScope` / `plan`: RE-RUN THE RULE
|
|
2474
|
+
* CHECK on the same work (the step's seat does not run again; every verdict whose rule and
|
|
2475
|
+
* evidence are unchanged is reused). The engine refuses it at any other gate (409). */
|
|
2476
|
+
| 'retry_rules'
|
|
2477
|
+
/** (api-types 0.190.0) SKIP UNCHECKED STEERING RULES, each with the person's written reason in
|
|
2478
|
+
* {@link GateDecision.skipRules} (required), `approve: true`, no `amend` / `amendScope` / `plan`;
|
|
2479
|
+
* then the check re-runs. A skipped rule's row is `skipped`, labelled with its reason on the
|
|
2480
|
+
* gate receipt and the delivery. Only a rule the gate holds as `unchecked` can be skipped (a
|
|
2481
|
+
* `broken` one denies); the human operator's call alone (a seat or standing order: 403
|
|
2482
|
+
* `human_operator_only`). Refused (409, gate left open) at any other gate. */
|
|
2483
|
+
| 'skip_rules'
|
|
2459
2484
|
/** (core#820) A `consent` gate's choice from its dry-run plan (`awaitingHuman.choices`), with
|
|
2460
2485
|
* `approve: true`: `consent:worker` (the default), `consent:operator`, …; `reject` declines. */
|
|
2461
2486
|
| `consent:${string}`;
|
|
@@ -2464,7 +2489,8 @@ export interface GateDecision {
|
|
|
2464
2489
|
* Absent = `'cursor'` (today: the gated unit's description). `'creator'` — the first creator
|
|
2465
2490
|
* phase at or after the cursor receives it (`unitReworkAmended{scope: 'creator'}`) while the
|
|
2466
2491
|
* cursor dispatches unamended: the intake steer that must reach the fix phase, not triage.
|
|
2467
|
-
* Identical text already present on the target is not appended twice.
|
|
2492
|
+
* Identical text already present on the target is not appended twice. At a `plan_approval` gate
|
|
2493
|
+
* it does not apply (api-types 0.188.0): the note lands as {@link GateDecision.plan} says.
|
|
2468
2494
|
*/
|
|
2469
2495
|
amendScope?: 'cursor' | 'creator';
|
|
2470
2496
|
/**
|
|
@@ -2473,8 +2499,16 @@ export interface GateDecision {
|
|
|
2473
2499
|
* `plan.proposed{by:"human", kind:"edit"}`, floor-fills it (phases below the floor are ADDED,
|
|
2474
2500
|
* never refused) and accepts it as the next `plan_rev` — or refuses it (`plan.refused`) and
|
|
2475
2501
|
* re-opens the gate under a new `gate_id`, answering `awaiting_human`. Requires `approve: true`
|
|
2476
|
-
* and `action` omitted or `'edit_plan'`;
|
|
2477
|
-
*
|
|
2502
|
+
* and `action` omitted or `'edit_plan'`; no `amendScope` (a 400). A plain approve (no `plan`)
|
|
2503
|
+
* releases the held plan as it is; `approve: false` rejects (cancels).
|
|
2504
|
+
*
|
|
2505
|
+
* THE OPERATOR'S NOTE (api-types 0.188.0, crew#1139; {@link HealthCapabilities.planGateNote}): `amend`
|
|
2506
|
+
* on a plan gate's approve, with or without `plan`, is carried to the steps the plan releases. It lands
|
|
2507
|
+
* once the answer applies (after an edit's re-plan, so on the edited plan's units) on the FIRST CREATOR
|
|
2508
|
+
* step at or after the cursor (`unitReworkAmended{scope: 'creator'}`), else on the cursor step
|
|
2509
|
+
* (`scope: 'cursor'`), and the gate's recorded answer carries it. A refused edit re-opens the gate and
|
|
2510
|
+
* lands nothing. An engine without it answers 501 for a note beside `plan` and 409 for one on a plain
|
|
2511
|
+
* approve, with the gate left open.
|
|
2478
2512
|
*/
|
|
2479
2513
|
plan?: LaunchPlan;
|
|
2480
2514
|
/**
|
|
@@ -2510,6 +2544,9 @@ export interface GateDecision {
|
|
|
2510
2544
|
* draft, **409** `draft_changed` when an id is not in the draft as it reads now (the gate stays open).
|
|
2511
2545
|
*/
|
|
2512
2546
|
keepRules?: string[];
|
|
2547
|
+
/** (api-types 0.190.0) With `action: 'skip_rules'` (and only with it): each unchecked rule to
|
|
2548
|
+
* skip, with the person's written reason (both non-empty, no rule twice). */
|
|
2549
|
+
skipRules?: RuleSkipAnswer[];
|
|
2513
2550
|
}
|
|
2514
2551
|
|
|
2515
2552
|
/**
|
|
@@ -3278,6 +3315,50 @@ export interface AssuranceReceipt {
|
|
|
3278
3315
|
* ABSENT when every judge was the run's own (the routine case) or on an older engine. A unit
|
|
3279
3316
|
* receipt carries at most one; a delivery receipt lists the run's. */
|
|
3280
3317
|
judgeFallbacks?: JudgeFallback[];
|
|
3318
|
+
/** (api-types 0.190.0, DES-RULE-CHECK-001 S2) Every steering rule in force and its verdict at this
|
|
3319
|
+
* gate (the review step's rule check), or, on a delivery receipt, the worst row per rule across
|
|
3320
|
+
* the run's gates. ABSENT when no rule check ran (not a review gate, no rule store, no change, an
|
|
3321
|
+
* older engine). Deny-dominates: a `broken` row denied the gate, an `unchecked` row held it. */
|
|
3322
|
+
rules?: RuleVerdict[];
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
/** (api-types 0.190.0) A steering rule's verdict: `kept` · `broken` · `n_a` (not applicable) ·
|
|
3326
|
+
* `unchecked` (no judge ruled; holds the gate) · `skipped` (the operator skipped it, with a reason;
|
|
3327
|
+
* a confirmed waiver reads `waived by instruction (…), confirmed by <who>: <reason>`) · `waived`
|
|
3328
|
+
* (the person's own instruction conflicts with the rule: holds the gate until the person confirms
|
|
3329
|
+
* it with a reason through `skip_rules`; never kept, never skipped silently) · `deferred` (api-types
|
|
3330
|
+
* 0.191.0: the rule's subject only exists at delivery, by recorded fact: obligations
|
|
3331
|
+
* `evidence:delivery` or `applies_to` naming only the deliver step; it does not hold review or QE,
|
|
3332
|
+
* and the deliver step's receipt carries its verdict on the pull request's text). */
|
|
3333
|
+
export type RuleVerdictStatus = 'kept' | 'broken' | 'n_a' | 'unchecked' | 'skipped' | 'waived' | 'deferred';
|
|
3334
|
+
/** How it was reached: `fact` (a recorded fact ruled it out) · `judge` (a seat distinct from the
|
|
3335
|
+
* creators ruled) · `machine` (an engine check, e.g. `check:test-fails-on-base`) · `cache` (an
|
|
3336
|
+
* earlier verdict on the same rule and evidence) · `operator` (skipped) · `none` (unchecked). */
|
|
3337
|
+
export type RuleVerdictHow = 'fact' | 'judge' | 'machine' | 'cache' | 'operator' | 'none';
|
|
3338
|
+
|
|
3339
|
+
/** (api-types 0.190.0) One steering rule's row on an assurance receipt. */
|
|
3340
|
+
export interface RuleVerdict {
|
|
3341
|
+
ruleId: string;
|
|
3342
|
+
status: RuleVerdictStatus;
|
|
3343
|
+
how: RuleVerdictHow;
|
|
3344
|
+
/** Why, in words: the fact, the cite, the skip's reason (`skipped by <who>: <reason>`), or why nobody ruled. */
|
|
3345
|
+
reason: string;
|
|
3346
|
+
/** The evidence the judge or the machine check cited, when one ruled. */
|
|
3347
|
+
cite?: string;
|
|
3348
|
+
/** The seat that ruled. */
|
|
3349
|
+
judge?: string;
|
|
3350
|
+
/** SHA-256 of the rule's judged content (statement, criteria, obligations, facets). */
|
|
3351
|
+
ruleKey: string;
|
|
3352
|
+
/** SHA-256 of the evidence the verdict read; absent on a `fact` row. */
|
|
3353
|
+
evidenceKey?: string;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
/** (api-types 0.190.0) One skip in a `skip_rules` gate answer. */
|
|
3357
|
+
export interface RuleSkipAnswer {
|
|
3358
|
+
/** The unchecked rule's id. */
|
|
3359
|
+
id: string;
|
|
3360
|
+
/** The person's written reason (labelled on the run, the gate and the delivery). */
|
|
3361
|
+
reason: string;
|
|
3281
3362
|
}
|
|
3282
3363
|
|
|
3283
3364
|
/**
|
|
@@ -3604,7 +3685,10 @@ export interface GateEscalatedEvent {
|
|
|
3604
3685
|
* (0.7.27) · `governance` · `same_seat_evaluator` (a `dead_seat` condition: the review ran on its
|
|
3605
3686
|
* builder's seat — core-ts 0.7.46, EX-01) · `evaluator_error` · `judge_unavailable` (a
|
|
3606
3687
|
* `judge_unavailable` condition; since core-ts 0.7.46 also a required judge with no distinct
|
|
3607
|
-
* seat — EX-02)
|
|
3688
|
+
* seat — EX-02) · `rule_check` (a `rule_broken` condition: a steering rule the review's rule check
|
|
3689
|
+
* found broken, api-types 0.190.0) · `rules_unchecked` (a `rules_unchecked` condition: a rule no
|
|
3690
|
+
* judge ruled on, answered by `retry_rules` / `skip_rules`). `""` (EMPTY) = a hook veto whose
|
|
3691
|
+
* source identity was folded away
|
|
3608
3692
|
* (`actor.rs` `boundary_deny` arm with no structured denial) — a reader keys copy on
|
|
3609
3693
|
* `(condition, denialSource)` and treats `""` beside `boundary_deny` as input governance.
|
|
3610
3694
|
*/
|
|
@@ -6034,6 +6118,11 @@ export interface LinkedIssuesPreviewBody {
|
|
|
6034
6118
|
problem: string;
|
|
6035
6119
|
repoRef?: string;
|
|
6036
6120
|
excludeLinkedIssues?: string[];
|
|
6121
|
+
/**
|
|
6122
|
+
* (api-types 0.187.0, DES-PM-001 §3.2) The project the launch is filed in: with a registered PM source, a
|
|
6123
|
+
* reference resolves only through the tracker set of this project and `repoRef`.
|
|
6124
|
+
*/
|
|
6125
|
+
projectId?: string;
|
|
6037
6126
|
}
|
|
6038
6127
|
|
|
6039
6128
|
/** The `POST /linked-issues/preview` 200 body: the same reading `POST /runs` does, nothing launched. */
|
|
@@ -6064,6 +6153,23 @@ export interface LinkedIssue {
|
|
|
6064
6153
|
chars?: number;
|
|
6065
6154
|
/** (crew#825; additive) `true` when the launch left this ref out (`excludeLinkedIssues`). */
|
|
6066
6155
|
excluded?: true;
|
|
6156
|
+
/**
|
|
6157
|
+
* (api-types 0.187.0, DES-PM-001 §3.2, Q-PM5) Read through a registered PM source: the tracker that admitted it,
|
|
6158
|
+
* that source's registry name, and its system. Absent on the daemon's `gh` path (no GitHub source registered).
|
|
6159
|
+
*/
|
|
6160
|
+
trackerId?: string;
|
|
6161
|
+
source?: string;
|
|
6162
|
+
system?: PmSystem;
|
|
6163
|
+
/**
|
|
6164
|
+
* (api-types 0.187.0) Why it was not read, as a code: `not_linked` (no tracker of the run's project or repos has
|
|
6165
|
+
* it), `ambiguous` (two trackers in the set share the key: pick one, which writes `<source>:<KEY-N>`), `hidden`
|
|
6166
|
+
* (the source's Agents switches keep this project out), `query_off`, `unavailable` (the vendor could not be
|
|
6167
|
+
* read), `not_found`. To pick among `ambiguous` candidates, write `<source>:<KEY-N>` (two sources) or
|
|
6168
|
+
* `<source>@<tenant>:<KEY-N>` (two sites behind one source).
|
|
6169
|
+
*/
|
|
6170
|
+
code?: 'not_linked' | 'ambiguous' | 'hidden' | 'query_off' | 'unavailable' | 'not_found';
|
|
6171
|
+
/** (api-types 0.187.0) `ambiguous` only: the trackers that share the key, for the composer to pick from. */
|
|
6172
|
+
candidates?: Array<{ source: string; tenant: string; tenantLabel?: string; key: string; trackerId: string }>;
|
|
6067
6173
|
}
|
|
6068
6174
|
|
|
6069
6175
|
/** The `POST /runs` 201 body. `linkedIssues` (crew#627, additive) is present when the intent of a
|
|
@@ -7392,6 +7498,10 @@ export interface WorkflowCatalogInput {
|
|
|
7392
7498
|
* How a client starts an entry: `run` = `POST /runs {workflow}`; `demo` = `POST /projects/:id/demo`;
|
|
7393
7499
|
* `compose` = `POST /projects/:id/product/compose` (draft epics); `document` = a new interactive document
|
|
7394
7500
|
* of that style (its draft run); `chat` = a chat on its own page; `none` = nothing to launch (coming soon).
|
|
7501
|
+
* (api-types 0.187.0, additive) `app` = a new app by chat: `POST /apps` in the project, then the words as its
|
|
7502
|
+
* first turn, `POST /apps/:app/turns` (DES-APPS-001 §6.2); offered only where `GET /health.capabilities.apps.turns`
|
|
7503
|
+
* is true; `repo` = register a repository, which onboards it (`POST /repos`; studio's Add a repository). A
|
|
7504
|
+
* client that does not know a kind shows the entry and does not start it.
|
|
7395
7505
|
*/
|
|
7396
7506
|
export type WorkflowCatalogLaunch =
|
|
7397
7507
|
| { kind: 'run'; workflow: string }
|
|
@@ -7399,6 +7509,8 @@ export type WorkflowCatalogLaunch =
|
|
|
7399
7509
|
| { kind: 'compose' }
|
|
7400
7510
|
| { kind: 'document'; style: 'web' | 'doc' | 'ppt' | 'brochure' }
|
|
7401
7511
|
| { kind: 'chat' }
|
|
7512
|
+
| { kind: 'app' }
|
|
7513
|
+
| { kind: 'repo' }
|
|
7402
7514
|
| { kind: 'none' };
|
|
7403
7515
|
|
|
7404
7516
|
/** The requesting operator's use of an entry (scope: {@link WorkflowCatalogResponse.usage}). */
|
|
@@ -12316,7 +12428,61 @@ export interface PutDeliveryFreezeBody {
|
|
|
12316
12428
|
* sources: registered through the same preview/save, but with NO tools — nothing of theirs is ever
|
|
12317
12429
|
* offered to a governed run. Their preview answers {@link McpPreviewResponse.source} (the catalog).
|
|
12318
12430
|
*/
|
|
12319
|
-
export type McpUpstreamKind = 'mcp-stdio' | 'mcp-http' | 'rest' | 'sql' | 'graphql';
|
|
12431
|
+
export type McpUpstreamKind = 'mcp-stdio' | 'mcp-http' | 'rest' | 'sql' | 'graphql' | 'toolbox-source';
|
|
12432
|
+
|
|
12433
|
+
// ── The one registry's entry (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5) ─────────────────────
|
|
12434
|
+
|
|
12435
|
+
/**
|
|
12436
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) A database source as MCP Toolbox for Databases models it: its
|
|
12437
|
+
* own source document (`kind: source`, `type`, that type's fields), which the registry stores as the source of
|
|
12438
|
+
* truth for `kind: 'toolbox-source'`. Checked against crew's deployment policy for the pinned Toolbox release
|
|
12439
|
+
* (v1.15.0) at preview and at save: a field that bypasses the address check (`connectionString`), names a host
|
|
12440
|
+
* path, or tunes the driver is a 400 `refused_field`; a field only crew writes (`name`, `queryParams`,
|
|
12441
|
+
* `connectTimeout`: the TLS settings, startup parameters and timeouts) a 400 `crew_written_field`; any other
|
|
12442
|
+
* unknown field a 400 `unknown_field`. `password` is exactly `"${WICKED_SRC_1}"`, the placeholder naming
|
|
12443
|
+
* `auth.ref`'s secret (a value is a 400 `secret_literal`); `${` anywhere else is a 400 `interpolation`.
|
|
12444
|
+
*/
|
|
12445
|
+
// A type alias (not an interface) so it is assignable to a plain record: the route takes any object and the
|
|
12446
|
+
// deployment policy judges each field.
|
|
12447
|
+
export type ToolboxSourceDocument = {
|
|
12448
|
+
kind: 'source';
|
|
12449
|
+
/** v1: `postgres` only (any other type is a 400 `unsupported_type`). */
|
|
12450
|
+
type: 'postgres';
|
|
12451
|
+
/** One host name or IP address. */
|
|
12452
|
+
host: string;
|
|
12453
|
+
/** Toolbox takes the port as a string, `"1"`-`"65535"`. */
|
|
12454
|
+
port: string;
|
|
12455
|
+
database: string;
|
|
12456
|
+
user: string;
|
|
12457
|
+
password?: string;
|
|
12458
|
+
};
|
|
12459
|
+
|
|
12460
|
+
/**
|
|
12461
|
+
* (api-types 0.183.0) How crew reads a database source: `native` (crew's own adapter: K1's driver, dialer and
|
|
12462
|
+
* read policy; Postgres) or `toolbox` (one Toolbox process per source; a preview is a 501 `runtime_unavailable`
|
|
12463
|
+
* on a daemon without the Toolbox runtime).
|
|
12464
|
+
*/
|
|
12465
|
+
export type McpSourceRuntime = 'native' | 'toolbox';
|
|
12466
|
+
|
|
12467
|
+
/**
|
|
12468
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §7.1) What a tool's answer discloses: `rows` (needs a source's
|
|
12469
|
+
* "query" switch), `structure` (needs "see"), or `none`. Reviewed at preview, bound to the tool's saved schema
|
|
12470
|
+
* hash; `null` = not reviewed, or reviewed against a schema that has since changed. A tool with no class in force
|
|
12471
|
+
* is offered to no agent.
|
|
12472
|
+
*/
|
|
12473
|
+
export type McpToolDisclosure = 'none' | 'structure' | 'rows';
|
|
12474
|
+
|
|
12475
|
+
/**
|
|
12476
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §7.1) A data source's agent switches: `see` (on by default),
|
|
12477
|
+
* `query` (off by default; needs `see`; turned off again by a descriptor change and by a restore), `projects`
|
|
12478
|
+
* (none by default) and `everyProject` (an explicit choice). Set by a human operator only.
|
|
12479
|
+
*/
|
|
12480
|
+
export interface McpSourceAgents {
|
|
12481
|
+
see: boolean;
|
|
12482
|
+
query: boolean;
|
|
12483
|
+
projects: string[];
|
|
12484
|
+
everyProject: boolean;
|
|
12485
|
+
}
|
|
12320
12486
|
/**
|
|
12321
12487
|
* A tool's class, from its own `tools/list` annotations (never from a carrier): `read` when
|
|
12322
12488
|
* `readOnlyHint` is true; else `destructive` unless `destructiveHint` is false; else `write`. A tool
|
|
@@ -12418,6 +12584,16 @@ export interface McpServerConfigBody {
|
|
|
12418
12584
|
* from `POST /apps/uploads` (a snapshot digest), not from a preview.
|
|
12419
12585
|
*/
|
|
12420
12586
|
sql?: SqlSourceConfigBody;
|
|
12587
|
+
/**
|
|
12588
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) `toolbox-source` only: Toolbox's own source document. Its
|
|
12589
|
+
* password is the secret behind `auth.ref` (`auth` takes only `ref`). A `sql` body with Postgres settings is
|
|
12590
|
+
* saved as the same document.
|
|
12591
|
+
*/
|
|
12592
|
+
toolbox?: ToolboxSourceDocument;
|
|
12593
|
+
/** (api-types 0.183.0) `toolbox-source` only: default `native`. */
|
|
12594
|
+
runtime?: McpSourceRuntime;
|
|
12595
|
+
/** (api-types 0.183.0) `toolbox-source` only: the TLS choice crew writes the driver's settings from; default `verify-full`. */
|
|
12596
|
+
tls?: { mode: 'verify-full' | 'disable'; ca?: string };
|
|
12421
12597
|
/**
|
|
12422
12598
|
* (api-types 0.175.0) `sql` only: the views (and materialized views) a read may name, as
|
|
12423
12599
|
* `schema.view` (MySQL `database.view`). A view not listed is refused by the read policy.
|
|
@@ -12433,6 +12609,35 @@ export interface McpServerConfigBody {
|
|
|
12433
12609
|
* response, log, audit entry or file.
|
|
12434
12610
|
*/
|
|
12435
12611
|
secret?: string;
|
|
12612
|
+
/**
|
|
12613
|
+
* (api-types 0.187.0, DES-PM-001 §3) `mcp-http` and `mcp-stdio` only: this server is a project-management
|
|
12614
|
+
* system's own MCP server (GitHub's `github-mcp-server`, the Atlassian remote server). Its calls then go through
|
|
12615
|
+
* crew's data gate with resource bindings (§3.1), and trackers of it can be linked to projects and repos. A
|
|
12616
|
+
* human operator's only, at the preview and at the save (else 403 `pm_source_human_only`). PM-1 registers `github`
|
|
12617
|
+
* and `jira`; a re-save of a PM source must name the same system (409 `pm_marker_fixed`).
|
|
12618
|
+
*/
|
|
12619
|
+
pm?: { system: 'github' | 'jira' };
|
|
12620
|
+
}
|
|
12621
|
+
|
|
12622
|
+
/** (api-types 0.187.0, DES-PM-001 §1) The project-management system a registry entry is. PM-1 registers `github` and `jira`. */
|
|
12623
|
+
export interface McpPmMarker {
|
|
12624
|
+
system: PmSystem;
|
|
12625
|
+
}
|
|
12626
|
+
|
|
12627
|
+
/** (api-types 0.187.0) A project-management system. `gitlab` and `ado` are wave PM-2: a registration naming them is a 400 today. */
|
|
12628
|
+
export type PmSystem = 'github' | 'jira' | 'gitlab' | 'ado';
|
|
12629
|
+
|
|
12630
|
+
/**
|
|
12631
|
+
* (api-types 0.187.0, DES-PM-001 §3.1) A PM tool's resource binding as crew holds it: crew's binding for the tool
|
|
12632
|
+
* (`policy`, e.g. `jira/getJiraIssue@1`), bound to the schema it was reviewed against. In force only while both
|
|
12633
|
+
* match: a changed schema, or a new binding-policy version, makes the tool unavailable to agents until a person
|
|
12634
|
+
* saves the server again. `null` = crew has no binding for this tool, so no agent may use it.
|
|
12635
|
+
*/
|
|
12636
|
+
export interface McpToolBinding {
|
|
12637
|
+
policy: string;
|
|
12638
|
+
schemaHash: string;
|
|
12639
|
+
/** Whether it is in force now (the saved schema is the reviewed one and the policy is crew's current one). */
|
|
12640
|
+
inForce: boolean;
|
|
12436
12641
|
}
|
|
12437
12642
|
|
|
12438
12643
|
/**
|
|
@@ -12488,9 +12693,18 @@ export interface McpTool {
|
|
|
12488
12693
|
schemaHash: string | null;
|
|
12489
12694
|
/** The hash the last probe saw. */
|
|
12490
12695
|
observedSchemaHash: string;
|
|
12696
|
+
/** (api-types 0.183.0) The disclosure class in force; `null` = none reviewed for the saved schema. */
|
|
12697
|
+
disclosure: McpToolDisclosure | null;
|
|
12698
|
+
/** (api-types 0.187.0) PM entries only: the tool's resource binding; `null` = unbound, so unavailable to agents. */
|
|
12699
|
+
binding?: McpToolBinding | null;
|
|
12491
12700
|
}
|
|
12492
12701
|
|
|
12493
12702
|
export interface McpServer {
|
|
12703
|
+
/**
|
|
12704
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) The entry's immutable id. Estate's source documents, `deps`,
|
|
12705
|
+
* grants and records key on it, never on the name: a name removed and registered again is a new id.
|
|
12706
|
+
*/
|
|
12707
|
+
id: string;
|
|
12494
12708
|
name: string;
|
|
12495
12709
|
kind: McpUpstreamKind;
|
|
12496
12710
|
command: string | null;
|
|
@@ -12518,6 +12732,26 @@ export interface McpServer {
|
|
|
12518
12732
|
* `allowWrites`). Queries, actions and grants bind to it.
|
|
12519
12733
|
*/
|
|
12520
12734
|
descriptorHash?: string;
|
|
12735
|
+
/**
|
|
12736
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1, §5.4) A database source stored as its Toolbox document. A
|
|
12737
|
+
* `native` one still answers `kind: 'sql'` and `sql` (the read-path projection every existing reader uses).
|
|
12738
|
+
* `descriptorVersion` 1 = mapped from a K1 record, hashed with K1's function (locks and grants unchanged);
|
|
12739
|
+
* 2 = written by a save, hashed over the canonical execution descriptor.
|
|
12740
|
+
*/
|
|
12741
|
+
runtime?: McpSourceRuntime;
|
|
12742
|
+
toolbox?: ToolboxSourceDocument;
|
|
12743
|
+
descriptorVersion?: 1 | 2;
|
|
12744
|
+
/** The deployment policy the document was checked under, e.g. `postgres/1@toolbox-v1.15.0`. */
|
|
12745
|
+
policyVersion?: string;
|
|
12746
|
+
/** (api-types 0.183.0) Data sources only: the agent switches (defaults filled in). */
|
|
12747
|
+
agents?: McpSourceAgents;
|
|
12748
|
+
/** (api-types 0.187.0, DES-PM-001) A project-management system's server: its system. */
|
|
12749
|
+
pm?: McpPmMarker;
|
|
12750
|
+
/**
|
|
12751
|
+
* (api-types 0.187.0) PM entries only: the trackers linked to projects or repos, with their links (read-only
|
|
12752
|
+
* here; written only through `POST`/`DELETE /tracker-links`).
|
|
12753
|
+
*/
|
|
12754
|
+
trackers?: TrackerLink[];
|
|
12521
12755
|
/**
|
|
12522
12756
|
* (api-types 0.174.0) `mcp-http` and `rest` only: the ranges confirmed for this server's
|
|
12523
12757
|
* connections. A server saved before 0.174.0 shows what crew re-derived for it: the IP literal or
|
|
@@ -12549,12 +12783,79 @@ export interface McpDiscoveredServer {
|
|
|
12549
12783
|
managed: boolean;
|
|
12550
12784
|
}
|
|
12551
12785
|
|
|
12552
|
-
/**
|
|
12786
|
+
/**
|
|
12787
|
+
* `GET /mcp/servers`, for a human actor. (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.2, crew#1310) Any other
|
|
12788
|
+
* actor, and `?view=agent`, gets {@link McpServersAgentResponse} instead; so do the answers of a save, a
|
|
12789
|
+
* `PATCH /mcp/servers/:name` and a test for a non-human actor.
|
|
12790
|
+
*/
|
|
12553
12791
|
export interface McpServersResponse {
|
|
12554
12792
|
servers: McpServer[];
|
|
12555
12793
|
discovered: McpDiscoveredServer[];
|
|
12556
12794
|
}
|
|
12557
12795
|
|
|
12796
|
+
/**
|
|
12797
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.2) A server as an agent may know it: no host, port, database,
|
|
12798
|
+
* login, url, command, arguments, path, address, secret reference or descriptor.
|
|
12799
|
+
*/
|
|
12800
|
+
export interface McpServerAgentView {
|
|
12801
|
+
id: string;
|
|
12802
|
+
name: string;
|
|
12803
|
+
kind: McpUpstreamKind;
|
|
12804
|
+
enabled: boolean;
|
|
12805
|
+
health: { state: McpHealthState };
|
|
12806
|
+
/** The tools that are not `gone`. */
|
|
12807
|
+
tools: Array<{ name: string; subject: string; class: McpToolClass; disclosure: McpToolDisclosure | null; enabled: boolean; status: McpToolStatus }>;
|
|
12808
|
+
/** Data sources only. */
|
|
12809
|
+
agents?: { see: boolean; query: boolean };
|
|
12810
|
+
/** (api-types 0.187.0) PM entries only. */
|
|
12811
|
+
pm?: McpPmMarker;
|
|
12812
|
+
}
|
|
12813
|
+
|
|
12814
|
+
/** (api-types 0.183.0) `GET /mcp/servers?view=agent`, and `GET /mcp/servers` for any non-human actor. */
|
|
12815
|
+
export interface McpServersAgentResponse {
|
|
12816
|
+
view: 'agent';
|
|
12817
|
+
servers: McpServerAgentView[];
|
|
12818
|
+
}
|
|
12819
|
+
|
|
12820
|
+
/**
|
|
12821
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.5) `GET /mcp/registry/generations` (human operator only). Every
|
|
12822
|
+
* write keeps the registry it replaces; the last 10 are kept.
|
|
12823
|
+
*/
|
|
12824
|
+
export interface McpRegistryGenerationsResponse {
|
|
12825
|
+
/** The generation in force. */
|
|
12826
|
+
current: number;
|
|
12827
|
+
/** Newest first. */
|
|
12828
|
+
generations: Array<{ generation: number; savedAt: string }>;
|
|
12829
|
+
}
|
|
12830
|
+
|
|
12831
|
+
/** (api-types 0.183.0) `POST /mcp/registry/restore`. */
|
|
12832
|
+
export interface McpRegistryRestoreBody {
|
|
12833
|
+
generation: number;
|
|
12834
|
+
}
|
|
12835
|
+
|
|
12836
|
+
/**
|
|
12837
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.5) `POST /mcp/registry/restore`'s 200 (human operator only;
|
|
12838
|
+
* audited `mcp.registry.restored`). A restore fails closed: every source's "query" switch and Allow writes come
|
|
12839
|
+
* back OFF; a server whose secret reference resolves to nothing comes back DISABLED (`secret_missing`); MCP
|
|
12840
|
+
* approvals whose tool schema differs from the restored one are withdrawn first (a failed withdrawal refuses the
|
|
12841
|
+
* restore, 500 `withdraw_failed`). A generation that is not kept is a 404 `unknown_generation`; one that does not
|
|
12842
|
+
* parse, or holds a record crew could not have written, a 409 `generation_unreadable`, and nothing changes. The
|
|
12843
|
+
* withdrawal and the commit hold every affected server's lock; when servers keep being registered meanwhile the
|
|
12844
|
+
* restore gives up with a 409 `registry_busy`, having changed nothing. The registry in force before the restore is
|
|
12845
|
+
* kept as a generation too.
|
|
12846
|
+
*/
|
|
12847
|
+
export interface McpRegistryRestoreResponse {
|
|
12848
|
+
restored: number;
|
|
12849
|
+
/** The generation the restore wrote. */
|
|
12850
|
+
generation: number;
|
|
12851
|
+
servers: number;
|
|
12852
|
+
disabled: Array<{ name: string; code: 'secret_missing' }>;
|
|
12853
|
+
queryReset: string[];
|
|
12854
|
+
writesReset: string[];
|
|
12855
|
+
/** The approval tokens withdrawn first. */
|
|
12856
|
+
withdrawnApprovals?: string[];
|
|
12857
|
+
}
|
|
12858
|
+
|
|
12558
12859
|
/** The difference between the registered tools and a probe, by tool name. */
|
|
12559
12860
|
export interface McpToolDiff {
|
|
12560
12861
|
added: string[];
|
|
@@ -12587,6 +12888,13 @@ export interface McpPreviewTool {
|
|
|
12587
12888
|
* approving it: `MCP-FIRST-USE` still asks on its first call.
|
|
12588
12889
|
*/
|
|
12589
12890
|
enabledOnSave: boolean;
|
|
12891
|
+
/**
|
|
12892
|
+
* (api-types 0.183.0) The disclosure class a save gives the tool when `disclosures` does not name it: its
|
|
12893
|
+
* class while its schema is unchanged, crew's own class for a tool of crew's Toolbox configuration, else `null`.
|
|
12894
|
+
*/
|
|
12895
|
+
disclosure: McpToolDisclosure | null;
|
|
12896
|
+
/** (api-types 0.187.0) PM entries only: the binding a save gives the tool; `null` = crew has none, so agents never get it. */
|
|
12897
|
+
binding?: { policy: string } | null;
|
|
12590
12898
|
}
|
|
12591
12899
|
|
|
12592
12900
|
/**
|
|
@@ -12611,6 +12919,11 @@ export interface McpPreviewResponse {
|
|
|
12611
12919
|
/** (api-types 0.175.0) `sql` only. */
|
|
12612
12920
|
sql?: SqlSourceView;
|
|
12613
12921
|
viewsAllowed?: string[];
|
|
12922
|
+
/** (api-types 0.183.0) A database source: the Toolbox document the save will store. */
|
|
12923
|
+
runtime?: McpSourceRuntime;
|
|
12924
|
+
toolbox?: ToolboxSourceDocument;
|
|
12925
|
+
descriptorVersion?: 1 | 2;
|
|
12926
|
+
policyVersion?: string;
|
|
12614
12927
|
};
|
|
12615
12928
|
/**
|
|
12616
12929
|
* (api-types 0.175.0, DES-APPS-001 §5.1) `sql`/`graphql` only: what the describe found —
|
|
@@ -12659,6 +12972,13 @@ export interface SaveMcpServerBody {
|
|
|
12659
12972
|
* `egress_not_rest` for a server that is not `rest`.
|
|
12660
12973
|
*/
|
|
12661
12974
|
allowOrigin?: string;
|
|
12975
|
+
/**
|
|
12976
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.1) The operator's review of what each tool discloses, by tool
|
|
12977
|
+
* name (`McpPreviewTool.disclosure` is what a tool not named here gets). A name the preview does not list is a
|
|
12978
|
+
* 400 `unknown_tool`. Human operator only (403 `disclosure_review_human_only`); audited
|
|
12979
|
+
* `mcp.tool.disclosure_reviewed`.
|
|
12980
|
+
*/
|
|
12981
|
+
disclosures?: Record<string, McpToolDisclosure>;
|
|
12662
12982
|
}
|
|
12663
12983
|
|
|
12664
12984
|
/**
|
|
@@ -12712,6 +13032,25 @@ export interface PatchMcpServerBody {
|
|
|
12712
13032
|
export interface PatchMcpToolBody {
|
|
12713
13033
|
enabled?: boolean;
|
|
12714
13034
|
classOverride?: McpToolClass | null;
|
|
13035
|
+
/**
|
|
13036
|
+
* (api-types 0.183.0) Review what the tool discloses, against its saved schema (409 `not_registered` when the
|
|
13037
|
+
* schema changed since the save). Setting a class is a human operator's only (403
|
|
13038
|
+
* `disclosure_review_human_only`), audited `mcp.tool.disclosure_reviewed`; `null` clears it (the tool is then
|
|
13039
|
+
* offered to no agent).
|
|
13040
|
+
*/
|
|
13041
|
+
disclosure?: McpToolDisclosure | null;
|
|
13042
|
+
}
|
|
13043
|
+
|
|
13044
|
+
/**
|
|
13045
|
+
* (api-types 0.183.0, DES-KNOWLEDGE-DATA-001 §5.2) `POST /mcp/servers/:name/test`'s 200 for a NON-HUMAN actor: the
|
|
13046
|
+
* server as the agent-safe projection, and `error` reduced to `"the probe failed"` (a probe's words can name the host).
|
|
13047
|
+
* A save and `PATCH /mcp/servers/:name` likewise answer an {@link McpServerAgentView} to a non-human actor.
|
|
13048
|
+
*/
|
|
13049
|
+
export interface McpServerTestAgentResponse {
|
|
13050
|
+
ok: boolean;
|
|
13051
|
+
error: string | null;
|
|
13052
|
+
diff: McpToolDiff | null;
|
|
13053
|
+
server: McpServerAgentView;
|
|
12715
13054
|
}
|
|
12716
13055
|
|
|
12717
13056
|
/** `POST /mcp/servers/:name/test`'s 200: a failed probe is `ok: false` and counts toward `failing`. */
|
|
@@ -13289,6 +13628,403 @@ export interface SourceAllowWritesResponse {
|
|
|
13289
13628
|
withdrawnGrants: number;
|
|
13290
13629
|
}
|
|
13291
13630
|
|
|
13631
|
+
/**
|
|
13632
|
+
* (api-types 0.184.0, DES-KNOWLEDGE-DATA-001 §7.1) A live source's agent switches. Agents reach a source
|
|
13633
|
+
* only through crew's data gate (`mcp:<source>/<tool>` through the broker); Apps units get none of its tools,
|
|
13634
|
+
* whatever this says (D-7). Never a write, never a credential.
|
|
13635
|
+
*/
|
|
13636
|
+
export type SourceAgentAccess = McpSourceAgents;
|
|
13637
|
+
|
|
13638
|
+
/** `PUT /sources/:name/agents` (human operator only; each change audited). At least one field. */
|
|
13639
|
+
export interface SourceAgentAccessBody {
|
|
13640
|
+
see?: boolean;
|
|
13641
|
+
query?: boolean;
|
|
13642
|
+
projects?: string[];
|
|
13643
|
+
everyProject?: boolean;
|
|
13644
|
+
}
|
|
13645
|
+
|
|
13646
|
+
export interface SourceAgentAccessResponse {
|
|
13647
|
+
name: string;
|
|
13648
|
+
agents: SourceAgentAccess;
|
|
13649
|
+
}
|
|
13650
|
+
|
|
13651
|
+
/** 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. */
|
|
13652
|
+
export interface SourceAgentQuery {
|
|
13653
|
+
/** The broker call's id. */
|
|
13654
|
+
callId: string;
|
|
13655
|
+
at: string;
|
|
13656
|
+
runId: string;
|
|
13657
|
+
unit: number;
|
|
13658
|
+
attempt: number;
|
|
13659
|
+
seat: string;
|
|
13660
|
+
source: string;
|
|
13661
|
+
/** The source's registry id. */
|
|
13662
|
+
sourceId: string;
|
|
13663
|
+
/** sha256 of the SQL text, hex. */
|
|
13664
|
+
sqlHash: string;
|
|
13665
|
+
/** `ok` (rows released), or crew's code (a read-policy code, `query_off`, `deadline`, `too_large`, `busy`, `changed_while_running`, …). */
|
|
13666
|
+
outcome: string;
|
|
13667
|
+
rows: number;
|
|
13668
|
+
truncated: boolean;
|
|
13669
|
+
ms: number;
|
|
13670
|
+
/** Whether rows were released to the agent's answer (written before the answer is sent: it may over-state, never under-state). */
|
|
13671
|
+
released: boolean;
|
|
13672
|
+
sqlstate?: string;
|
|
13673
|
+
}
|
|
13674
|
+
|
|
13675
|
+
/** `GET /sources/:name/agent-queries` (observer): the last 20, newest first. `known: false` = the record could not be read. */
|
|
13676
|
+
export interface SourceAgentQueriesResponse {
|
|
13677
|
+
name: string;
|
|
13678
|
+
known: boolean;
|
|
13679
|
+
queries: SourceAgentQuery[];
|
|
13680
|
+
}
|
|
13681
|
+
|
|
13682
|
+
/** One source a run's agents read (`GET /runs/:id/data-use`). */
|
|
13683
|
+
export interface SourceDataUse {
|
|
13684
|
+
source: string;
|
|
13685
|
+
/** Calls that reached the read policy. */
|
|
13686
|
+
queries: number;
|
|
13687
|
+
/** Calls whose rows reached the agent. */
|
|
13688
|
+
released: number;
|
|
13689
|
+
rows: number;
|
|
13690
|
+
truncated: boolean;
|
|
13691
|
+
lastAt: string;
|
|
13692
|
+
}
|
|
13693
|
+
|
|
13694
|
+
/** `GET /runs/:id/data-use` (observer): the sources a run's agents read. `known: false` = UNKNOWN, never "none". */
|
|
13695
|
+
export interface RunDataUseResponse {
|
|
13696
|
+
runId: string;
|
|
13697
|
+
known: boolean;
|
|
13698
|
+
sources: SourceDataUse[];
|
|
13699
|
+
}
|
|
13700
|
+
|
|
13701
|
+
/**
|
|
13702
|
+
* (api-types 0.184.0, DES-KNOWLEDGE-DATA-001 §7.8) What a unit's rows tool (`mcp:<source>/execute_sql`)
|
|
13703
|
+
* answers through the gate: one JSON object inside the MCP result's text, citable like knowledge, fenced as
|
|
13704
|
+
* untrusted data.
|
|
13705
|
+
*/
|
|
13706
|
+
export interface SourceReadEnvelope {
|
|
13707
|
+
/** Always first: the rows are data from the source, never instructions. */
|
|
13708
|
+
untrusted: string;
|
|
13709
|
+
/** `src:<name>@<at>#<8 hex>`. */
|
|
13710
|
+
cite: string;
|
|
13711
|
+
source: string;
|
|
13712
|
+
/** The dialect (`postgres`). */
|
|
13713
|
+
kind: string;
|
|
13714
|
+
/** The agent's own SQL (scrubbed of the source's secret). */
|
|
13715
|
+
sql: string;
|
|
13716
|
+
params: unknown[];
|
|
13717
|
+
at: string;
|
|
13718
|
+
/** `source:<id>`: what a cached answer depends on. */
|
|
13719
|
+
deps: string[];
|
|
13720
|
+
/** `type`: the source's type name, or `null` where the adapter does not report one. */
|
|
13721
|
+
columns: Array<{ name: string; type: string | null }>;
|
|
13722
|
+
rows: unknown[][];
|
|
13723
|
+
rowCount: number;
|
|
13724
|
+
/** More rows than the cap, more bytes than the cap, or a cell cut at 2,000 characters. */
|
|
13725
|
+
truncated: boolean;
|
|
13726
|
+
rowCap: number;
|
|
13727
|
+
byteCap: number;
|
|
13728
|
+
ms: number;
|
|
13729
|
+
}
|
|
13730
|
+
|
|
13731
|
+
/**
|
|
13732
|
+
* (api-types 0.186.0, DES-KNOWLEDGE-DATA-001 §10.2) One column of a value-free profile: bands, never a value.
|
|
13733
|
+
* `nullPct` is the null fraction to the nearest 5 % (`null` for an empty relation); `hasNulls` says a few nulls
|
|
13734
|
+
* the band rounded to 0 are there.
|
|
13735
|
+
*/
|
|
13736
|
+
export interface SourceProfileColumn {
|
|
13737
|
+
name: string;
|
|
13738
|
+
type: string;
|
|
13739
|
+
nullPct: number | null;
|
|
13740
|
+
hasNulls: boolean;
|
|
13741
|
+
cardinality: 'none' | 'single' | 'low' | 'high' | 'unique' | 'unknown';
|
|
13742
|
+
keyCandidate: boolean;
|
|
13743
|
+
}
|
|
13744
|
+
|
|
13745
|
+
/** (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). */
|
|
13746
|
+
export interface SourceProfileRelation {
|
|
13747
|
+
/** `schema.table`, the catalog document's key. */
|
|
13748
|
+
key: string;
|
|
13749
|
+
rows: '0' | '1-99' | '100-9,999' | '10,000-999,999' | '1,000,000+' | null;
|
|
13750
|
+
columns: SourceProfileColumn[];
|
|
13751
|
+
error: string | null;
|
|
13752
|
+
/** Columns not profiled (more than the profiler reads per relation). */
|
|
13753
|
+
columnsNotListed?: number;
|
|
13754
|
+
}
|
|
13755
|
+
|
|
13756
|
+
/** (api-types 0.186.0) A join the profiler found: a declared foreign key, or a name-and-type match the overlap band confirmed. */
|
|
13757
|
+
export interface SourceProfileJoin {
|
|
13758
|
+
from: string;
|
|
13759
|
+
columns: string[];
|
|
13760
|
+
to: string;
|
|
13761
|
+
references: string[];
|
|
13762
|
+
basis: 'fk' | 'name_type';
|
|
13763
|
+
/** How many of the referencing side's distinct values the other side holds (one-column joins); measured at the source. */
|
|
13764
|
+
overlap: 'empty' | 'none' | 'some' | 'most' | 'all' | null;
|
|
13765
|
+
}
|
|
13766
|
+
|
|
13767
|
+
/**
|
|
13768
|
+
* (api-types 0.186.0) `POST /sources/:name/profile`, a human operator's only (403 `profile_human_only`). The
|
|
13769
|
+
* value-free profile of a described native Postgres source, through the data gate's person read, and the data shapes
|
|
13770
|
+
* it filed as `knowledge` proposals for the review (one per relation; an identical shape already in the queue is not
|
|
13771
|
+
* filed again). 409 `not_in_knowledge`: estate holds no structure for the source yet.
|
|
13772
|
+
*/
|
|
13773
|
+
export interface SourceProfileResponse {
|
|
13774
|
+
name: string;
|
|
13775
|
+
/** The registry id. */
|
|
13776
|
+
sourceId: string;
|
|
13777
|
+
profiledAt: string;
|
|
13778
|
+
relations: SourceProfileRelation[];
|
|
13779
|
+
joins: SourceProfileJoin[];
|
|
13780
|
+
/** Code entities named exactly like a relation, in the repos' code graphs. */
|
|
13781
|
+
describes: Array<{ relation: string; repo: string; name: string; kind: string; file: string }>;
|
|
13782
|
+
proposed: Array<{ id: string; relation: string }>;
|
|
13783
|
+
alreadyProposed: number;
|
|
13784
|
+
codeSearch: { searched: string[]; notSearched: string[] };
|
|
13785
|
+
/** Catalog documents estate holds that crew's own catalog does not (or a view not allowed): not profiled. */
|
|
13786
|
+
notInKnowledge?: number;
|
|
13787
|
+
/** Relations beyond what one profile reads (too many): not profiled. */
|
|
13788
|
+
notListed?: number;
|
|
13789
|
+
/** Estate holds more catalog pages than one read takes: the rest were not profiled. */
|
|
13790
|
+
catalogTruncated?: true;
|
|
13791
|
+
}
|
|
13792
|
+
|
|
13793
|
+
/**
|
|
13794
|
+
* (api-types 0.186.0) The crew-owned record a data-shape proposal carries in `payload.shape` (a `knowledge`
|
|
13795
|
+
* proposal filed by the profiler). The review shows it; estate stores it as given.
|
|
13796
|
+
*/
|
|
13797
|
+
export interface KnowledgeShapeRecord {
|
|
13798
|
+
format: 1;
|
|
13799
|
+
sourceId: string;
|
|
13800
|
+
source: string;
|
|
13801
|
+
relation: string;
|
|
13802
|
+
profile: SourceProfileRelation;
|
|
13803
|
+
joins: SourceProfileJoin[];
|
|
13804
|
+
describes: Array<{ repo: string; symbolId: string; name: string; kind: string; file: string }>;
|
|
13805
|
+
/** Related tables whose join did not fit estate's 200 links per proposal (`joins` above keeps every one). */
|
|
13806
|
+
linksNotListed?: number;
|
|
13807
|
+
}
|
|
13808
|
+
|
|
13809
|
+
/** (api-types 0.186.0) A node of the Knowledge map. `key` is `<store>:<id>` (`source:`, `repo:`, `knowledge:`, `estate:`). */
|
|
13810
|
+
export interface KnowledgeMapNode {
|
|
13811
|
+
key: string;
|
|
13812
|
+
/**
|
|
13813
|
+
* (api-types 0.187.0, DES-PM-001 §3.4) `tracker`: a linked tracker; `project`: a studio project a tracker is
|
|
13814
|
+
* `tracked_in`; `issue`: an issue a run addresses (an `issue_ref`, only its key); `run`: the job that addresses it;
|
|
13815
|
+
* `pr`: the pull request that run delivered (`closes` the issue; `repo` names its repo).
|
|
13816
|
+
*/
|
|
13817
|
+
kind: 'source' | 'table' | 'shape' | 'code' | 'repo' | 'knowledge' | 'tracker' | 'project' | 'issue' | 'run' | 'pr';
|
|
13818
|
+
label: string;
|
|
13819
|
+
/** (api-types 0.187.0) A tracker node's PM source (registry name) and key. */
|
|
13820
|
+
tracker?: { source: string; key: string };
|
|
13821
|
+
/** A table's source name. */
|
|
13822
|
+
source?: string;
|
|
13823
|
+
/** A code entity's repo id. */
|
|
13824
|
+
repo?: string;
|
|
13825
|
+
/** A shape's proposal id. */
|
|
13826
|
+
proposalId?: string;
|
|
13827
|
+
/** A shape's value-free summary. */
|
|
13828
|
+
summary?: string;
|
|
13829
|
+
}
|
|
13830
|
+
|
|
13831
|
+
/**
|
|
13832
|
+
* (api-types 0.186.0) A typed edge of the Knowledge map (`describes`, `joins`, `governed_by`, `derived_from`, …;
|
|
13833
|
+
* `contains` is drawn structure). A `joins` edge's evidence is `{basis, on: [{columns, references, basis, overlap?,
|
|
13834
|
+
* cut?}], more?}`: every condition between the two tables, held under estate's 1 KiB evidence bound.
|
|
13835
|
+
*/
|
|
13836
|
+
export interface KnowledgeMapEdge {
|
|
13837
|
+
rel: string;
|
|
13838
|
+
from: string;
|
|
13839
|
+
to: string;
|
|
13840
|
+
confidence: number | null;
|
|
13841
|
+
evidence: Record<string, unknown> | null;
|
|
13842
|
+
/** The node of the shape that asserts it (`kconcept synthetic proposal:<id>:`, estate's id); `null` for drawn structure. */
|
|
13843
|
+
owner: string | null;
|
|
13844
|
+
}
|
|
13845
|
+
|
|
13846
|
+
/**
|
|
13847
|
+
* (api-types 0.186.0) `GET /knowledge/map`, a human operator's only. The source catalogs and the APPROVED data shapes
|
|
13848
|
+
* estate holds live, with their typed edges; a pending or declined shape is never in it. Every source and repo is in
|
|
13849
|
+
* the read's visible set; a repo is drawn when a shape links into it. A catalog estate replaced while it was read is
|
|
13850
|
+
* left out with a note, never drawn half.
|
|
13851
|
+
*/
|
|
13852
|
+
export interface KnowledgeMapResponse {
|
|
13853
|
+
nodes: KnowledgeMapNode[];
|
|
13854
|
+
edges: KnowledgeMapEdge[];
|
|
13855
|
+
sources: Array<{ id: string; name: string; described: boolean; inKnowledge: boolean; tables: number }>;
|
|
13856
|
+
shapes: number;
|
|
13857
|
+
/** Approved shapes estate no longer holds, or hides. */
|
|
13858
|
+
skipped: number;
|
|
13859
|
+
truncated: boolean;
|
|
13860
|
+
notes: string[];
|
|
13861
|
+
}
|
|
13862
|
+
|
|
13863
|
+
// ── Project-management trackers (DES-PM-001 rev 4, PM-1; api-types 0.187.0) ───────────────────────────────
|
|
13864
|
+
|
|
13865
|
+
/**
|
|
13866
|
+
* What a tracker link points at: a studio project (`proj_…`) or a registered repo. A tracker linked to a repo is in
|
|
13867
|
+
* the tracker set of every project that repo belongs to, and of any run that targets it; a tracker linked to a
|
|
13868
|
+
* project reaches only units filed in that project, never another project through a shared repo (§3.2).
|
|
13869
|
+
*/
|
|
13870
|
+
export type TrackerLinkTarget = { kind: 'project'; id: string } | { kind: 'repo'; id: string };
|
|
13871
|
+
|
|
13872
|
+
/**
|
|
13873
|
+
* One link of one tracker (§3.3). A tracker is (source, tenant, key): one project inside one tenant of a registered PM
|
|
13874
|
+
* system (a Jira project on one site, a GitHub repo's issues). Ids are derived: `trk_` + 16 hex of
|
|
13875
|
+
* sha256(source id, tenant, key) and `tl_` + 16 hex of sha256(tracker id, kind, id), so linking twice is one link.
|
|
13876
|
+
*/
|
|
13877
|
+
export interface TrackerLink {
|
|
13878
|
+
/** `tl_<hash16>` */
|
|
13879
|
+
id: string;
|
|
13880
|
+
/** `trk_<hash16>` */
|
|
13881
|
+
trackerId: string;
|
|
13882
|
+
/** The PM source's registry name, for display. */
|
|
13883
|
+
source: string;
|
|
13884
|
+
/** The PM source's registry id. */
|
|
13885
|
+
sourceId: string;
|
|
13886
|
+
system: PmSystem;
|
|
13887
|
+
/** Jira: the site's `cloudId`; GitHub: the host (`github.com`). */
|
|
13888
|
+
tenant: string;
|
|
13889
|
+
/** The tenant as a person reads it (a Jira site's name or URL host); absent when not known. */
|
|
13890
|
+
tenantLabel?: string;
|
|
13891
|
+
/** Jira: the project key (`PROJA`); GitHub: `owner/repo`. */
|
|
13892
|
+
key: string;
|
|
13893
|
+
/** The vendor's name for it, at most 120 characters. Vendor text: render it as text. */
|
|
13894
|
+
label: string;
|
|
13895
|
+
target: TrackerLinkTarget;
|
|
13896
|
+
linkedAt: string;
|
|
13897
|
+
/** The person who linked it (the actor id). */
|
|
13898
|
+
linkedBy: string;
|
|
13899
|
+
/** Whether estate holds the link yet (Understand follows when it lands; access follows the registry at once). */
|
|
13900
|
+
projection: 'current' | 'pending' | 'failed';
|
|
13901
|
+
}
|
|
13902
|
+
|
|
13903
|
+
/** `POST /tracker-links` (human-only). */
|
|
13904
|
+
export interface CreateTrackerLinkBody {
|
|
13905
|
+
/** The PM source's registry name. */
|
|
13906
|
+
source: string;
|
|
13907
|
+
tenant: string;
|
|
13908
|
+
key: string;
|
|
13909
|
+
target: TrackerLinkTarget;
|
|
13910
|
+
}
|
|
13911
|
+
|
|
13912
|
+
/**
|
|
13913
|
+
* `GET /tracker-links?project=<id>`, `?repo=<id>`, or both (human-only; 403 `tracker_links_human_only` for any other
|
|
13914
|
+
* actor). With both, `links` + `viaRepos` are the tracker set a run in that project targeting that repo would have.
|
|
13915
|
+
*/
|
|
13916
|
+
export interface TrackerLinksResponse {
|
|
13917
|
+
target: { project?: string; repo?: string };
|
|
13918
|
+
/** Linked to the target itself (the project, or with only `repo`, that repo). */
|
|
13919
|
+
links: TrackerLink[];
|
|
13920
|
+
/** With a project: the links of its member repos (and of `repo`, when given), each marked with the repo it comes through. */
|
|
13921
|
+
viaRepos: Array<TrackerLink & { viaRepo: string }>;
|
|
13922
|
+
/** With only a repo: the projects the repo is in (its links reach each of them). */
|
|
13923
|
+
projects: Array<{ id: string; name: string }>;
|
|
13924
|
+
/** With a project: for each PM source with a link here, whether its Agents switches let this project see / query it. */
|
|
13925
|
+
agents: Array<{ source: string; see: boolean; query: boolean }>;
|
|
13926
|
+
}
|
|
13927
|
+
|
|
13928
|
+
/**
|
|
13929
|
+
* `GET /sources/:name/trackers?q=<text>&cursor=<c>&tenant=<t>` (human-only): one page of the projects the PM source
|
|
13930
|
+
* lists NOW (a live read with the source's own credential), each with its links. `next` is the following page's
|
|
13931
|
+
* cursor, `null` at the end. 503 `source_unavailable` when the vendor cannot be reached; 409 `not_a_tracker` for a
|
|
13932
|
+
* source that is not a PM system.
|
|
13933
|
+
*/
|
|
13934
|
+
export interface SourceTrackersResponse {
|
|
13935
|
+
name: string;
|
|
13936
|
+
trackers: Array<{ tenant: string; tenantLabel?: string; key: string; label: string; links: TrackerLink[] }>;
|
|
13937
|
+
next: string | null;
|
|
13938
|
+
}
|
|
13939
|
+
|
|
13940
|
+
/**
|
|
13941
|
+
* `GET /tracker-links/issues?project=<id>&repo=<id>&q=<text>` (human-only): for "Start a job from an issue" (§6 step 1),
|
|
13942
|
+
* the issues of each tracker in the tracker set that project and repo would give a run (under the sources' Agents
|
|
13943
|
+
* switches), read live through the same bindings and response projectors an agent's reads go through. `key` is the
|
|
13944
|
+
* reference a launch intent takes (`PROJA-12`, `owner/repo#212`). A tracker that cannot be read says why in `error`
|
|
13945
|
+
* (`query_off`, `unavailable`, `tool_unbound`) and has no issues.
|
|
13946
|
+
*/
|
|
13947
|
+
export interface TrackerIssuesResponse {
|
|
13948
|
+
trackers: Array<{
|
|
13949
|
+
trackerId: string;
|
|
13950
|
+
source: string;
|
|
13951
|
+
system: PmSystem;
|
|
13952
|
+
key: string;
|
|
13953
|
+
label: string;
|
|
13954
|
+
tenantLabel?: string;
|
|
13955
|
+
via: { kind: 'project' } | { kind: 'repo'; id: string };
|
|
13956
|
+
/** Jira: the site's cloudId; GitHub: the host. */
|
|
13957
|
+
tenant: string;
|
|
13958
|
+
/** `ref`: the reference a launch intent takes for it (`<source>@<tenant>:KEY-N` when two trackers share the key). */
|
|
13959
|
+
issues: Array<{ key: string; ref: string; title: string; state: string | null }>;
|
|
13960
|
+
error?: string;
|
|
13961
|
+
}>;
|
|
13962
|
+
}
|
|
13963
|
+
|
|
13964
|
+
/**
|
|
13965
|
+
* (DES-PM-001 §5) A governed action on an issue of a run's tracker set: a comment, a transition, or both on one card.
|
|
13966
|
+
* `POST /runs/:id/tracker-actions` (human-only). Without `confirm` it does NOTHING and answers the card (exactly what
|
|
13967
|
+
* would be posted, as whom, from and to which state, and the link that admits the issue) and its `actionHash`; with
|
|
13968
|
+
* `confirm` equal to that hash it does exactly that. An issue outside the run's tracker set has no card: 404
|
|
13969
|
+
* `issue_not_in_tracker_set`. Recorded against the run and audited `knowledge.tracker.action`.
|
|
13970
|
+
*/
|
|
13971
|
+
export interface TrackerActionBody {
|
|
13972
|
+
/**
|
|
13973
|
+
* Jira `PROJA-1` (`<source>:PROJA-1` or `<source>@<cloudId>:PROJA-1` picks one of several trackers with that key);
|
|
13974
|
+
* GitHub `owner/repo#42` (or `#42` for the run's own repo).
|
|
13975
|
+
*/
|
|
13976
|
+
issue: string;
|
|
13977
|
+
/** The exact comment text (at most 8,000 characters). */
|
|
13978
|
+
comment?: string;
|
|
13979
|
+
/** The state to move it to, by name: a Jira transition's target status (`In Review`), or GitHub `closed` / `open`. */
|
|
13980
|
+
transition?: string;
|
|
13981
|
+
confirm?: string;
|
|
13982
|
+
}
|
|
13983
|
+
|
|
13984
|
+
export interface TrackerActionCard {
|
|
13985
|
+
runId: string;
|
|
13986
|
+
source: string;
|
|
13987
|
+
system: PmSystem;
|
|
13988
|
+
tenant: string;
|
|
13989
|
+
tenantLabel?: string;
|
|
13990
|
+
/** The issue as the tracker names it (`PROJA-1`, `owner/repo#42`). */
|
|
13991
|
+
issue: string;
|
|
13992
|
+
/** The issue's title; vendor text, render it as text. `null` when it could not be read. */
|
|
13993
|
+
title: string | null;
|
|
13994
|
+
/** Who the tracker will say did it (the registered credential's account), `null` when it could not be read. */
|
|
13995
|
+
identity: string | null;
|
|
13996
|
+
comment?: string;
|
|
13997
|
+
transition?: {
|
|
13998
|
+
from: string | null;
|
|
13999
|
+
to: string;
|
|
14000
|
+
/** The states mapped to `todo` / `doing` / `done` (Jira status categories; GitHub open = todo, closed = done). */
|
|
14001
|
+
mapped: { from: 'todo' | 'doing' | 'done' | null; to: 'todo' | 'doing' | 'done' | null };
|
|
14002
|
+
};
|
|
14003
|
+
/** The link that admits the issue for this run: to its project, or through one of its repos. */
|
|
14004
|
+
admittedBy: { kind: 'project'; id: string } | { kind: 'repo'; id: string };
|
|
14005
|
+
}
|
|
14006
|
+
|
|
14007
|
+
export type TrackerActionResponse =
|
|
14008
|
+
| { done: false; card: TrackerActionCard; actionHash: string }
|
|
14009
|
+
| {
|
|
14010
|
+
done: true;
|
|
14011
|
+
card: TrackerActionCard;
|
|
14012
|
+
at: string;
|
|
14013
|
+
/** Each part as it went; a transition after a failed comment is not attempted. */
|
|
14014
|
+
results: Array<{ part: 'comment' | 'transition'; ok: boolean; error?: string }>;
|
|
14015
|
+
};
|
|
14016
|
+
|
|
14017
|
+
/**
|
|
14018
|
+
* `GET /runs/:id/tracker-actions` (human-only): the issues this run addresses (resolved at launch through its tracker
|
|
14019
|
+
* set) that a governed action can be proposed for, each with the link that still admits it (`null`: no longer in the
|
|
14020
|
+
* run's tracker set, so no card).
|
|
14021
|
+
*/
|
|
14022
|
+
export interface RunTrackerIssuesResponse {
|
|
14023
|
+
runId: string;
|
|
14024
|
+
/** `ref`: the reference `POST` takes for it (`<source>@<tenant>:KEY-N` when two trackers of the run's set share the key). */
|
|
14025
|
+
issues: Array<{ issue: string; ref: string; source: string; system: PmSystem; trackerId: string; admittedBy: TrackerActionCard['admittedBy'] | null }>;
|
|
14026
|
+
}
|
|
14027
|
+
|
|
13292
14028
|
/**
|
|
13293
14029
|
* `POST /sources/:name/test-call` (G6) — human operator only. Without `confirm` it sends NOTHING and
|
|
13294
14030
|
* answers the exact request it would send and its `requestHash`; with `confirm` equal to that hash it
|
|
@@ -13341,6 +14077,106 @@ export interface CrewSourceCatalog {
|
|
|
13341
14077
|
routes: Array<{ path: string; responseType: string; params: string[] }>;
|
|
13342
14078
|
}
|
|
13343
14079
|
|
|
14080
|
+
// ── Test connection, and ask a question of a source (operator 2026-11-03; api-types 0.179.0) ─────────
|
|
14081
|
+
|
|
14082
|
+
/**
|
|
14083
|
+
* `POST /sources/:name/test` — "Test connection" on a saved `sql` or `graphql` source (it replaces
|
|
14084
|
+
* "Describe again"). crew connects with the saved credentials resolved now, describes the source again
|
|
14085
|
+
* and saves that description, then (SQL) checks a probe read of one table with the read policy and a
|
|
14086
|
+
* prepare at the source; the probe is never executed. A failure is a result (`ok: false`, HTTP 200):
|
|
14087
|
+
* crew's `code` and words (a source's own words reach a human only, scrubbed of the secret). No answer
|
|
14088
|
+
* carries the secret.
|
|
14089
|
+
*/
|
|
14090
|
+
export interface SourceConnectionTestResponse {
|
|
14091
|
+
name: string;
|
|
14092
|
+
kind: 'sql' | 'graphql';
|
|
14093
|
+
driver: 'postgres' | 'mysql' | 'sqlite' | null;
|
|
14094
|
+
ok: boolean;
|
|
14095
|
+
/** Connecting and describing, in milliseconds (a failure: until it failed). */
|
|
14096
|
+
ms: number;
|
|
14097
|
+
/** When crew ran the test (ISO 8601). */
|
|
14098
|
+
testedAt: string;
|
|
14099
|
+
/**
|
|
14100
|
+
* How crew connects: `verified` (TLS, the certificate checked against the host: Postgres
|
|
14101
|
+
* `verify-full`, MySQL `VERIFY_IDENTITY`, HTTPS), `off` (plaintext, allowed on this confirmed
|
|
14102
|
+
* address), `local` (an upload: crew opens its own snapshot, there is no connection).
|
|
14103
|
+
*/
|
|
14104
|
+
tls: 'verified' | 'off' | 'local';
|
|
14105
|
+
/** `ok`: the fresh description (saved): structure, and for Postgres the login's privilege report. */
|
|
14106
|
+
catalog?: SourceCatalogResponse;
|
|
14107
|
+
/** `ok`, SQL: the read-policy check of the probe read (`null`: no table to probe). */
|
|
14108
|
+
readCheck?: ({ ok: true; text: string; relation: string } | { ok: false; text: string; relation: string; code: string; detail: string }) | null;
|
|
14109
|
+
/** `!ok`: why (`secret_missing`, a dialer refusal code, `source_connection`, `source_timeout`, `source_source`, `test_failed`, …). */
|
|
14110
|
+
code?: string;
|
|
14111
|
+
error?: string;
|
|
14112
|
+
}
|
|
14113
|
+
|
|
14114
|
+
/** `POST /sources/:name/ask` — HUMAN operator only (403 `ask_human_only`). SQL sources. */
|
|
14115
|
+
export interface SourceAskBody {
|
|
14116
|
+
/** The person's question, e.g. "How many tickets are open?" (1-1000 characters). */
|
|
14117
|
+
question: string;
|
|
14118
|
+
}
|
|
14119
|
+
|
|
14120
|
+
/**
|
|
14121
|
+
* The draft: one seat wrote one read query from the question and the source's STRUCTURE only (what
|
|
14122
|
+
* agents see: names, types, keys, declared enum literals, row estimates; never a row or a credential),
|
|
14123
|
+
* and crew checked it with the read policy, then a prepare at the source. NOTHING RAN. `confirm` is
|
|
14124
|
+
* crew's run token for exactly `sql` (only when the check passed): `POST /sources/:name/query` with it
|
|
14125
|
+
* runs that text. Audited `apps.source.asked` (no question, no SQL).
|
|
14126
|
+
*/
|
|
14127
|
+
export interface SourceAskResponse {
|
|
14128
|
+
/** The query the seat wrote (`''`: it said the structure cannot answer the question). */
|
|
14129
|
+
sql: string;
|
|
14130
|
+
/** The seat's one line: what the query returns and how to read it (or why there is no query). */
|
|
14131
|
+
explanation: string;
|
|
14132
|
+
/** The seat that drafted it. */
|
|
14133
|
+
seat: string;
|
|
14134
|
+
/** The check of `sql` (`null` when there is no query). */
|
|
14135
|
+
check: SourceCheckResponse | null;
|
|
14136
|
+
confirm: string | null;
|
|
14137
|
+
}
|
|
14138
|
+
|
|
14139
|
+
/** `POST /sources/:name/query` — HUMAN operator only (403 `query_human_only`). SQL sources. */
|
|
14140
|
+
export interface SourceQueryBody {
|
|
14141
|
+
/** The SQL to check (or run): a draft, an edited draft, or the person's own. */
|
|
14142
|
+
sql: string;
|
|
14143
|
+
/** crew's run token for exactly `sql` (from the ask, or from this route without `confirm`). */
|
|
14144
|
+
confirm?: string;
|
|
14145
|
+
}
|
|
14146
|
+
|
|
14147
|
+
/**
|
|
14148
|
+
* Without `confirm`: the check only (`ran: false`; nothing reaches the source but a prepare) and, when
|
|
14149
|
+
* it passed, the run token. With `confirm`: crew verifies the token is its own for exactly this text
|
|
14150
|
+
* and this source as it is now (`409 query_changed` otherwise), then runs it: the read policy again,
|
|
14151
|
+
* a `READ ONLY` transaction, the 10 s deadline cancelled at the source (`504 source_timeout`), at most
|
|
14152
|
+
* {@link SourceQueryRan.rowCap} rows. The rows go to this answer only: never to a seat, a log or the
|
|
14153
|
+
* audit trail (`apps.source.queried` records the relations, counts and time).
|
|
14154
|
+
*/
|
|
14155
|
+
export type SourceQueryResponse = SourceQueryChecked | SourceQueryRan;
|
|
14156
|
+
|
|
14157
|
+
export interface SourceQueryChecked {
|
|
14158
|
+
ran: false;
|
|
14159
|
+
check: SourceCheckResponse;
|
|
14160
|
+
confirm: string | null;
|
|
14161
|
+
}
|
|
14162
|
+
|
|
14163
|
+
export interface SourceQueryRan {
|
|
14164
|
+
ran: true;
|
|
14165
|
+
columns: Array<{ name: string; type: string }>;
|
|
14166
|
+
/**
|
|
14167
|
+
* Cells as the source's driver reads them, as JSON carries them: Postgres and MySQL dates, times,
|
|
14168
|
+
* numerics and 64-bit integers as the source's own text (`2026-01-01 01:00:00+00`, in the session's
|
|
14169
|
+
* time zone), bytes as `\x` hex (the first 32,767 bytes, `…` past them; Postgres `bytea` arrives as the source's `\x`
|
|
14170
|
+
* text and is cut like any text), JSON values as JSON; text past 64 KB
|
|
14171
|
+
* is cut.
|
|
14172
|
+
*/
|
|
14173
|
+
rows: unknown[][];
|
|
14174
|
+
/** More rows than the cap, or past 1 MB of rows as encoded: only the first are shown. */
|
|
14175
|
+
truncated: boolean;
|
|
14176
|
+
rowCap: number;
|
|
14177
|
+
ms: number;
|
|
14178
|
+
}
|
|
14179
|
+
|
|
13344
14180
|
// ── Decision capture (DES-decision-capture §4.2.1 / §4.6; DC-S4a, api-types 0.80.0) ──────────────
|
|
13345
14181
|
|
|
13346
14182
|
/** The laya codebook's decision types. `none` is crew's label for "no decision". */
|
|
@@ -14918,8 +15754,12 @@ export interface AppLinkComponent extends AppComponentBase {
|
|
|
14918
15754
|
to: AppLinkTarget;
|
|
14919
15755
|
}
|
|
14920
15756
|
|
|
14921
|
-
/**
|
|
14922
|
-
|
|
15757
|
+
/**
|
|
15758
|
+
* A source kind a query reads; it names the text file: `sql` `.sql`, `graphql` `.graphql`, else `.json`.
|
|
15759
|
+
* (api-types 0.189.0) `recall` reads the system's KNOWLEDGE (DES-KNOWLEDGE-DATA-001 §9.1) in the app's own project,
|
|
15760
|
+
* on the reserved source `estate`: its text is an {@link AppRecallQueryText}. Studio-hosted only: Publish refuses it.
|
|
15761
|
+
*/
|
|
15762
|
+
export type AppQueryKind = 'sql' | 'graphql' | 'rest' | 'mcp' | 'crew' | 'recall';
|
|
14923
15763
|
|
|
14924
15764
|
/** A declared output column's type. A value the source cannot confirm is validated on every row (DES §7.2). */
|
|
14925
15765
|
export type AppColumnType = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'datetime';
|
|
@@ -15105,6 +15945,80 @@ export interface AppCrewQueryText {
|
|
|
15105
15945
|
query: Record<string, AppQueryArg>;
|
|
15106
15946
|
}
|
|
15107
15947
|
|
|
15948
|
+
/**
|
|
15949
|
+
* (api-types 0.189.0, DES-KNOWLEDGE-DATA-001 §9.1) `queries/<id>.json` of a `recall` query (source `estate`): one
|
|
15950
|
+
* read of the knowledge the APP'S project may see (crew computes `visible` from the app's project, never from the
|
|
15951
|
+
* request, and re-checks every item before release). `from` names what is read:
|
|
15952
|
+
*
|
|
15953
|
+
* - `knowledge`: documents, source structure and approved data shapes (estate recall); needs `query`; `source`
|
|
15954
|
+
* keeps only what was derived from that registry source;
|
|
15955
|
+
* - `memories`: what the project remembers (estate memory recall, the project's facet); needs `query`;
|
|
15956
|
+
* - `steering`: the active steering rules that apply to the project; `query` keeps rules whose statement holds its
|
|
15957
|
+
* words;
|
|
15958
|
+
* - `tables`: one registry source's tables as estate holds them (structure, never rows), with each table's approved
|
|
15959
|
+
* data shape (its text says what the table joins); needs `source`, takes no `query`.
|
|
15960
|
+
*
|
|
15961
|
+
* Rows have the columns of {@link AppRecallColumns} for that `from` (an app's `output` declares a subset, with
|
|
15962
|
+
* exactly these types); with `group` they are `key` (string) and `count` (integer) per value of that column instead.
|
|
15963
|
+
* `limit` is 1-50 (default 20). Text from a source's structure is marked `untrusted`.
|
|
15964
|
+
*/
|
|
15965
|
+
export interface AppRecallQueryText {
|
|
15966
|
+
from: AppRecallFrom;
|
|
15967
|
+
/**
|
|
15968
|
+
* The words recalled: a literal of 1-200 characters, or the query's ONE parameter (a string, never viewer-bound:
|
|
15969
|
+
* no `from`), which a search filter binds.
|
|
15970
|
+
*/
|
|
15971
|
+
query?: AppQueryArg;
|
|
15972
|
+
/** A registry source name (`tables`: required; `knowledge`: optional). */
|
|
15973
|
+
source?: string;
|
|
15974
|
+
group?: 'kind' | 'source' | 'severity';
|
|
15975
|
+
limit?: number;
|
|
15976
|
+
}
|
|
15977
|
+
|
|
15978
|
+
export type AppRecallFrom = 'knowledge' | 'memories' | 'steering' | 'tables';
|
|
15979
|
+
|
|
15980
|
+
/**
|
|
15981
|
+
* (api-types 0.189.0) The columns a `recall` query answers, per `from`, with their types. Every `from` has `title`,
|
|
15982
|
+
* `content`, `cite` (where it came from: `memory:<id>`, `rule:<id>`, `src:<source>/<table>`, a document's
|
|
15983
|
+
* provenance) and `kind` (document, table, shape or note; a memory's tier; a rule's steering type).
|
|
15984
|
+
*/
|
|
15985
|
+
export interface AppRecallColumns {
|
|
15986
|
+
knowledge: 'title' | 'content' | 'cite' | 'kind' | 'source' | 'score' | 'untrusted';
|
|
15987
|
+
memories: 'title' | 'content' | 'cite' | 'kind' | 'score';
|
|
15988
|
+
steering: 'title' | 'content' | 'cite' | 'kind' | 'severity';
|
|
15989
|
+
tables: 'title' | 'content' | 'cite' | 'kind' | 'columns' | 'shape' | 'untrusted';
|
|
15990
|
+
}
|
|
15991
|
+
|
|
15992
|
+
/**
|
|
15993
|
+
* (api-types 0.189.0) `GET /knowledge/summary?project=<id>` (a HUMAN operator): what knowledge an app in that project
|
|
15994
|
+
* can be built on, as counts and registry names only (never a row, a document's text or a memory's words). The same
|
|
15995
|
+
* summary is in the apps builder's knowledge package, so a suggestion never names knowledge the builder cannot use.
|
|
15996
|
+
*/
|
|
15997
|
+
export interface KnowledgeSummaryResponse {
|
|
15998
|
+
projectId: string;
|
|
15999
|
+
/** The data sources the project may see (the agents switch `see`), in name order. */
|
|
16000
|
+
sources: Array<{
|
|
16001
|
+
name: string;
|
|
16002
|
+
/** Its structure is in estate under its current description (a `tables` query can read it). */
|
|
16003
|
+
described: boolean;
|
|
16004
|
+
/** Agents may read its rows for this project. */
|
|
16005
|
+
query: boolean;
|
|
16006
|
+
/**
|
|
16007
|
+
* Approved data shapes on it that the project may see, each verified against estate's own node and deps, counted
|
|
16008
|
+
* up to 5. `null` = the count could not be established (the review queue or a shape's node could not be read, or
|
|
16009
|
+
* the summary's budget ran out before enough were checked): unknown, not zero.
|
|
16010
|
+
*/
|
|
16011
|
+
shapes: number | null;
|
|
16012
|
+
}>;
|
|
16013
|
+
/**
|
|
16014
|
+
* Memories a recall in this project can reach (every facet of a memory must match the project's: faceted to it, or
|
|
16015
|
+
* to nothing), working memories left out (an app's memory recall leaves them out too). `null` = estate did not answer.
|
|
16016
|
+
*/
|
|
16017
|
+
memories: { project: number; shared: number } | null;
|
|
16018
|
+
/** Active steering rules that apply to this project, by steering type. `null` = the engine did not answer. */
|
|
16019
|
+
steering: { total: number; byType: Partial<Record<SteeringType, number>> } | null;
|
|
16020
|
+
}
|
|
16021
|
+
|
|
15108
16022
|
// How a query's text binds its parameters (api-types 0.176.0): SQL `$n` (Postgres) and the n-th `?` (MySQL,
|
|
15109
16023
|
// SQLite) bind the n-th parameter in the order `params.properties` declares them, and every declared
|
|
15110
16024
|
// parameter is used; GraphQL variables are the parameters by name; `.json` texts name them in `AppQueryArg`s.
|
|
@@ -15200,6 +16114,42 @@ export interface AppTurnState {
|
|
|
15200
16114
|
actor: string;
|
|
15201
16115
|
}
|
|
15202
16116
|
|
|
16117
|
+
/**
|
|
16118
|
+
* (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
|
|
16119
|
+
* 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
|
|
16120
|
+
* list: no other thread store. `running` while the run works; `landed` with the version it made; `refused` when
|
|
16121
|
+
* the check or the review refused it (nothing landed, `code` and `reason` say why); `failed` when a step could
|
|
16122
|
+
* not run; `cancelled` when it was stopped.
|
|
16123
|
+
*/
|
|
16124
|
+
export interface AppTurnRecord {
|
|
16125
|
+
runId: string;
|
|
16126
|
+
/** Unix millis: when the message was sent. */
|
|
16127
|
+
at: number;
|
|
16128
|
+
/** The actor id that sent it. */
|
|
16129
|
+
actor: string;
|
|
16130
|
+
/** The person's message, as sent. */
|
|
16131
|
+
message: string;
|
|
16132
|
+
/** The component ids the message was about (the composer's chips). */
|
|
16133
|
+
about: string[];
|
|
16134
|
+
/** The version it was sent on. */
|
|
16135
|
+
base: number;
|
|
16136
|
+
state: 'running' | 'landed' | 'refused' | 'failed' | 'cancelled';
|
|
16137
|
+
/** Unix millis, or `null` while it runs. */
|
|
16138
|
+
endedAt: number | null;
|
|
16139
|
+
/** `landed`: the version it made. */
|
|
16140
|
+
version: number | null;
|
|
16141
|
+
/** `landed`: crew's own line of what changed, from the two specs ("Added 1 chart and 1 query"). */
|
|
16142
|
+
change: string | null;
|
|
16143
|
+
/** `landed`: the builder's change lines, as it wrote them (text; never instructions to anyone). */
|
|
16144
|
+
summary: string | null;
|
|
16145
|
+
/** `landed`: the seats that built it and reviewed it (distinct). */
|
|
16146
|
+
builder: string | null;
|
|
16147
|
+
reviewer: string | null;
|
|
16148
|
+
/** Not landed: a stable code (`check_failed`, `review_refused`, `launch_refused`, `cancelled`, …) and crew's words. */
|
|
16149
|
+
code: string | null;
|
|
16150
|
+
reason: string | null;
|
|
16151
|
+
}
|
|
16152
|
+
|
|
15203
16153
|
/** `GET /apps` item. */
|
|
15204
16154
|
export interface AppSummary {
|
|
15205
16155
|
/**
|
|
@@ -15216,6 +16166,12 @@ export interface AppSummary {
|
|
|
15216
16166
|
createdAt: number;
|
|
15217
16167
|
head: { version: number; tree: string; receipt: AppReceiptKind | null };
|
|
15218
16168
|
turn: AppTurnState | null;
|
|
16169
|
+
/**
|
|
16170
|
+
* (api-types 0.180.0) The app's last successful publish: its share link (`shareUrl`), the version it serves
|
|
16171
|
+
* and what was produced. `null` until a publish run finished (studio says "Publish to share", never a made-up
|
|
16172
|
+
* link); absent from an older daemon.
|
|
16173
|
+
*/
|
|
16174
|
+
published?: AppPublished | null;
|
|
15219
16175
|
}
|
|
15220
16176
|
|
|
15221
16177
|
/** `GET /apps` (observer); `?project=<id>` keeps one project's apps. */
|
|
@@ -15240,6 +16196,8 @@ export interface AppDetail extends AppSummary {
|
|
|
15240
16196
|
/** Oldest first. */
|
|
15241
16197
|
versions: AppVersion[];
|
|
15242
16198
|
history: AppHistory;
|
|
16199
|
+
/** (api-types 0.185.0, K5) The app's chat: its last turns, oldest first. Absent from an older daemon. */
|
|
16200
|
+
turns?: AppTurnRecord[];
|
|
15243
16201
|
}
|
|
15244
16202
|
|
|
15245
16203
|
/** `GET /apps/:app` (observer), and `POST /apps` (201). */
|
|
@@ -15531,6 +16489,10 @@ export interface AppErrorBody {
|
|
|
15531
16489
|
| 'unknown_version'
|
|
15532
16490
|
| 'unknown_query'
|
|
15533
16491
|
| 'unknown_project'
|
|
16492
|
+
/** (api-types 0.185.0) `POST /apps/check` from a unit that is not the turn's check step. */
|
|
16493
|
+
| 'not_the_check'
|
|
16494
|
+
/** (api-types 0.185.0) A turn on an app whose repository is not registered yet. */
|
|
16495
|
+
| 'not_registered'
|
|
15534
16496
|
| 'stale_base'
|
|
15535
16497
|
| 'turn_in_flight'
|
|
15536
16498
|
| 'not_accepted'
|
|
@@ -15580,21 +16542,40 @@ export interface AppErrorBody {
|
|
|
15580
16542
|
* unit's capability token in the body, never as a bearer): check the builder's candidate commit of the
|
|
15581
16543
|
* app's turn in flight (DES §9.2 `check`).
|
|
15582
16544
|
*/
|
|
15583
|
-
export
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
16545
|
+
export type AppsCheckBody =
|
|
16546
|
+
| {
|
|
16547
|
+
token: string;
|
|
16548
|
+
/**
|
|
16549
|
+
* (api-types 0.185.0) The builder's worktree as the engine snapshotted it (`WICKED_TREE`, a tree in the app
|
|
16550
|
+
* repo's objects); crew finds the app by the unit's run.
|
|
16551
|
+
*/
|
|
16552
|
+
tree: string;
|
|
16553
|
+
/** The publish manifest, for the publish check (a later slice). */
|
|
16554
|
+
manifest?: unknown;
|
|
16555
|
+
}
|
|
16556
|
+
| {
|
|
16557
|
+
token: string;
|
|
16558
|
+
app: string;
|
|
16559
|
+
/** The builder's candidate commit in the app repo (the older form). */
|
|
16560
|
+
commit: string;
|
|
16561
|
+
/** The publish manifest, for the publish check (a later slice). */
|
|
16562
|
+
manifest?: unknown;
|
|
16563
|
+
};
|
|
15591
16564
|
|
|
15592
16565
|
/**
|
|
15593
16566
|
* (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
|
|
15594
16567
|
* turn's review can land) and what the check ran; on a refusal, why.
|
|
15595
16568
|
*/
|
|
15596
16569
|
export type AppsCheckResponse =
|
|
15597
|
-
| {
|
|
16570
|
+
| {
|
|
16571
|
+
ok: true; commit: string; tree: string; summary: AppCheckSummary;
|
|
16572
|
+
/**
|
|
16573
|
+
* (api-types 0.185.0) The checked tree's files as text (`apps.json`, `apps.lock.json`, `queries/<id>.<ext>`):
|
|
16574
|
+
* `wicked-crew apps-check` writes exactly these into the turn's worktree, so the review is dispatched on the
|
|
16575
|
+
* tree that can land.
|
|
16576
|
+
*/
|
|
16577
|
+
files?: Array<{ path: string; text: string }>;
|
|
16578
|
+
}
|
|
15598
16579
|
| { ok: false; code: 'check_failed' | 'source_check_unavailable'; findings: AppCheckFinding[] };
|
|
15599
16580
|
|
|
15600
16581
|
/**
|
|
@@ -15613,7 +16594,7 @@ export interface AppsCapabilities {
|
|
|
15613
16594
|
* since api-types 0.178.0 (K2b, the write path: API actions and Postgres row writes).
|
|
15614
16595
|
*/
|
|
15615
16596
|
actions: boolean;
|
|
15616
|
-
/** `POST /apps/:app/turns` launches `apps-turn` runs. */
|
|
16597
|
+
/** `POST /apps/:app/turns` launches `apps-turn` runs (true since api-types 0.185.0 on a daemon whose engine runs them). */
|
|
15617
16598
|
turns: boolean;
|
|
15618
16599
|
/** `POST /apps/:app/publish`. */
|
|
15619
16600
|
publish: boolean;
|
|
@@ -15644,3 +16625,164 @@ export interface RegisterRepoBody {
|
|
|
15644
16625
|
actor?: string;
|
|
15645
16626
|
autoCapture?: boolean;
|
|
15646
16627
|
}
|
|
16628
|
+
|
|
16629
|
+
// ── Apps: publish and the standalone site (api-types 0.180.0, DES-APPS-001 §8.1-8.2, §9.3, slice K6) ──────────
|
|
16630
|
+
//
|
|
16631
|
+
// Publish turns an accepted version into a container image the deployer runs: `wicked-apps-server` with the
|
|
16632
|
+
// runtime, the checked `apps.json`, `queries/`, `apps.lock.json`, the snapshots by digest and the manifest
|
|
16633
|
+
// below. The SHARE LINK is the site's own address, the base URL the deployer gives in the publish settings
|
|
16634
|
+
// (`site.origin`): after a successful publish it is `AppPublished.shareUrl`, and anyone in the app's audience
|
|
16635
|
+
// (anyone at all, for a public app) opens it. crew never invents one and pushes nothing anywhere.
|
|
16636
|
+
|
|
16637
|
+
/** Where a publish puts the app. `studio` is always on; `embed` needs a public app; `teams` needs the Entra profile. */
|
|
16638
|
+
export type AppPublishTarget = 'studio' | 'site' | 'embed' | 'teams';
|
|
16639
|
+
|
|
16640
|
+
/**
|
|
16641
|
+
* Who may open the site, judged on the verified token (DES §8.2). `public`: anyone, read-only (every query
|
|
16642
|
+
* public, no action). `oidc-groups`: a group claim value (`claim`, default `groups`). `oidc-email-domain`: the
|
|
16643
|
+
* email's domain, only with `email_verified: true` (a Boolean). `entra-roles`: an app-role VALUE in `roles`
|
|
16644
|
+
* (recommended). `entra-groups`: a group object id in `groups` (a token with a groups overage marker is refused).
|
|
16645
|
+
*/
|
|
16646
|
+
export type AppAudienceRule =
|
|
16647
|
+
| { kind: 'public' }
|
|
16648
|
+
| { kind: 'oidc-groups'; groups: string[]; claim?: string }
|
|
16649
|
+
| { kind: 'oidc-email-domain'; domains: string[] }
|
|
16650
|
+
| { kind: 'entra-roles'; roles: string[] }
|
|
16651
|
+
| { kind: 'entra-groups'; groups: string[] };
|
|
16652
|
+
|
|
16653
|
+
/**
|
|
16654
|
+
* The site's one issuer, fixed at publish. `oidc`: the page signs in with authorization code + PKCE and sends
|
|
16655
|
+
* the ID token (`aud` = `clientId`). `entra`: the page sends a v2 ACCESS token for the app's own
|
|
16656
|
+
* `access_as_user` scope (`aud` = `clientId`, `scp` has `access_as_user`, `tid` = `tenantId`); app-only tokens and
|
|
16657
|
+
* ID tokens are refused. The issuer is `https://` (Entra: `https://login.microsoftonline.com/<tenantId>/v2.0`).
|
|
16658
|
+
*/
|
|
16659
|
+
export interface AppPublishIdentity {
|
|
16660
|
+
profile: 'oidc' | 'entra';
|
|
16661
|
+
issuer: string;
|
|
16662
|
+
clientId: string;
|
|
16663
|
+
/** `entra` only. */
|
|
16664
|
+
tenantId?: string;
|
|
16665
|
+
/** The scope the page asks for. Default: `openid email profile groups` (oidc), `api://<site host>/<clientId>/access_as_user openid profile` (entra). */
|
|
16666
|
+
scope?: string;
|
|
16667
|
+
/**
|
|
16668
|
+
* Loopback or private CIDR ranges the issuer may be reached at when it is a NAME on a private network (crew's
|
|
16669
|
+
* `OidcConfig.allowRanges`); an IP-literal issuer confirms itself. Never metadata or link-local.
|
|
16670
|
+
*/
|
|
16671
|
+
allowRanges?: string[];
|
|
16672
|
+
}
|
|
16673
|
+
|
|
16674
|
+
/** `POST /apps/:app/publish` (HUMAN operator): launch an `apps-publish` run bound to the head tree and this manifest. */
|
|
16675
|
+
export interface AppPublishBody {
|
|
16676
|
+
/** The head version the person is publishing (`409 stale_base` if head moved). */
|
|
16677
|
+
base: number;
|
|
16678
|
+
targets: AppPublishTarget[];
|
|
16679
|
+
/**
|
|
16680
|
+
* The site's address: `https://<host>[:port]`, or `http://localhost:<port>` / `http://127.0.0.1:<port>` for a
|
|
16681
|
+
* local run. No path, query or credentials. It is the share link, the redirect URI's origin
|
|
16682
|
+
* (`<origin>/auth/callback`), and the only origin a POST to the site may come from.
|
|
16683
|
+
*/
|
|
16684
|
+
site: { origin: string };
|
|
16685
|
+
/** `null` = a public app (no sign-in). */
|
|
16686
|
+
identity: AppPublishIdentity | null;
|
|
16687
|
+
audience: AppAudienceRule;
|
|
16688
|
+
/** `embed`: the origins that may frame the public site (`https://…`, no path). `teams` adds the Teams origins itself. */
|
|
16689
|
+
embedOrigins?: string[];
|
|
16690
|
+
}
|
|
16691
|
+
|
|
16692
|
+
/** One source as the person consents to shipping it (DES §9.3 step 3). */
|
|
16693
|
+
export interface AppManifestSource {
|
|
16694
|
+
name: string;
|
|
16695
|
+
kind: 'sql' | 'graphql' | 'rest' | 'mcp-http';
|
|
16696
|
+
descriptorHash: string;
|
|
16697
|
+
/** Where the container must reach it (`db.support.internal:5432`, a URL's origin), or `null` for a snapshot. */
|
|
16698
|
+
reach: string | null;
|
|
16699
|
+
/** The address is loopback or private: the container's network must reach it. */
|
|
16700
|
+
privateAddress: boolean;
|
|
16701
|
+
/** The environment variable the deployer passes its secret in, or `null` when it has none. */
|
|
16702
|
+
env: string | null;
|
|
16703
|
+
/** A Postgres source's Allow writes switch at publish. */
|
|
16704
|
+
allowWrites: boolean;
|
|
16705
|
+
/** An upload: the snapshot's digest, shipped in the image. */
|
|
16706
|
+
snapshot?: string;
|
|
16707
|
+
}
|
|
16708
|
+
|
|
16709
|
+
/** The manifest a publish run is bound to (its digest is on the run, the QE verdict and the `published` receipt). */
|
|
16710
|
+
export interface AppPublishManifest {
|
|
16711
|
+
schema: 'wicked.apps.manifest/v1';
|
|
16712
|
+
app: { slug: string; name: string; version: number; tree: string; commit: string };
|
|
16713
|
+
targets: AppPublishTarget[];
|
|
16714
|
+
site: { origin: string };
|
|
16715
|
+
/**
|
|
16716
|
+
* The issuer, with the endpoints its discovery document named at publish (the page's `connect-src`) and the ID
|
|
16717
|
+
* token signing algorithms it named (`id_token_signing_alg_values_supported`; the page checks the ID token's).
|
|
16718
|
+
*/
|
|
16719
|
+
identity: (AppPublishIdentity & { endpoints: { authorization: string; token: string; idTokenAlgs?: string[] } }) | null;
|
|
16720
|
+
audience: AppAudienceRule;
|
|
16721
|
+
embedOrigins: string[];
|
|
16722
|
+
sources: AppManifestSource[];
|
|
16723
|
+
queries: Array<{ id: string; source: string; public: boolean }>;
|
|
16724
|
+
/** Each action with the grant the image enforces (revoking = publishing again without it). */
|
|
16725
|
+
actions: Array<{ id: string; kind: 'api' | 'row-write'; source: string; grant: AppActionGrant; table?: string; columns?: string[] }>;
|
|
16726
|
+
/** Every environment name the image needs, sorted. A missing one fails the server's start, by name. */
|
|
16727
|
+
env: string[];
|
|
16728
|
+
/** `/data` must be a mounted volume when the app has an action (its action records and logs live there). */
|
|
16729
|
+
volume: '/data' | null;
|
|
16730
|
+
}
|
|
16731
|
+
|
|
16732
|
+
/** An app's last successful publish (`AppSummary.published`, so also on `AppDetail`): the share link and what was produced. */
|
|
16733
|
+
export interface AppPublished {
|
|
16734
|
+
version: number;
|
|
16735
|
+
tree: string;
|
|
16736
|
+
/** The `apps-publish` run. */
|
|
16737
|
+
runId: string;
|
|
16738
|
+
/** Unix millis, when the image was produced. */
|
|
16739
|
+
at: number;
|
|
16740
|
+
/** Who consented. */
|
|
16741
|
+
actor: Actor;
|
|
16742
|
+
targets: AppPublishTarget[];
|
|
16743
|
+
/** The share link: `site.origin` + `/`. What studio's Copy link copies. */
|
|
16744
|
+
shareUrl: string;
|
|
16745
|
+
/** Who can open it, in one line ("People in group support-ops who sign in at dex.apps.test"). */
|
|
16746
|
+
audience: string;
|
|
16747
|
+
/** The image in the local container engine (never pushed): its tag and its id (`sha256:…`). */
|
|
16748
|
+
image: { tag: string; id: string };
|
|
16749
|
+
/** `embed`: the iframe snippet (a public app only); otherwise `null`. */
|
|
16750
|
+
snippet: string | null;
|
|
16751
|
+
/** `teams`: the Teams app package, at `GET /api/v1/apps/:app/published/teams.zip`; otherwise `null`. */
|
|
16752
|
+
teamsPackage: { url: string; sha256: string } | null;
|
|
16753
|
+
manifestDigest: string;
|
|
16754
|
+
/** How the deployer runs it: the environment names, the volume (or `null`), the port the server listens on. */
|
|
16755
|
+
run: { env: string[]; volume: '/data' | null; port: number };
|
|
16756
|
+
}
|
|
16757
|
+
|
|
16758
|
+
// The standalone site's own routes (`wicked-apps-server`; the page's in-process host calls them). Bearer only,
|
|
16759
|
+
// no cookies; every POST needs `Origin` = the site's origin and `Content-Type: application/json`.
|
|
16760
|
+
|
|
16761
|
+
/** `GET /spec` (a token in the audience, or a public app): the published version and who is viewing. */
|
|
16762
|
+
export interface AppSiteSpecResponse {
|
|
16763
|
+
app: { slug: string; name: string; version: number };
|
|
16764
|
+
spec: AppSpec;
|
|
16765
|
+
/** What the server took from the verified token; `null` on a public site. */
|
|
16766
|
+
viewer: { email: string | null; name: string | null } | null;
|
|
16767
|
+
/** Actions run on this site (a mounted `/data`, `APPS_READ_ONLY` unset). The page still refuses them in a frame. */
|
|
16768
|
+
actions: boolean;
|
|
16769
|
+
/**
|
|
16770
|
+
* Queries and actions the server refuses NOW, each with its reason. They are judged again at every refresh (every
|
|
16771
|
+
* 10 minutes, and after a failed read): a source back as it was published clears them; a source that really
|
|
16772
|
+
* changed needs the app checked and published again.
|
|
16773
|
+
*/
|
|
16774
|
+
refused: Array<{ kind: 'query' | 'action'; id: string; reason: string }>;
|
|
16775
|
+
}
|
|
16776
|
+
|
|
16777
|
+
/**
|
|
16778
|
+
* `GET /healthz` (no sign-in): up, and what it refuses, by kind, id and a code only (`contract_changed`,
|
|
16779
|
+
* `table_changed`, `source_unavailable`, …). The reasons, which can name a source or a table, are on `GET /spec`
|
|
16780
|
+
* behind the sign-in.
|
|
16781
|
+
*/
|
|
16782
|
+
export interface AppSiteHealth {
|
|
16783
|
+
ok: boolean;
|
|
16784
|
+
app: string;
|
|
16785
|
+
version: number;
|
|
16786
|
+
refused: Array<{ kind: 'query' | 'action'; id: string; code: string }>;
|
|
16787
|
+
actions: boolean;
|
|
16788
|
+
}
|