wicked-crew-api-types 0.69.0 → 0.73.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 +286 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -231,6 +231,12 @@ export interface HealthCapabilities {
|
|
|
231
231
|
* on such a daemon.
|
|
232
232
|
*/
|
|
233
233
|
seatChipOnCreate?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* `AgentSession.chat_id` is served on every run launched from a chat, terminal ones included
|
|
236
|
+
* (C1; crew ≥ the release carrying api-types 0.71.0). ABSENT on a daemon before the field — read
|
|
237
|
+
* as `false`: group such a daemon's runs one session per run.
|
|
238
|
+
*/
|
|
239
|
+
runChatId?: boolean;
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
/** One `GET /health.warnings[]` entry (additive; wicked-core#411 / wicked-crew#497). */
|
|
@@ -492,6 +498,13 @@ export interface AgentSession {
|
|
|
492
498
|
* this field.
|
|
493
499
|
*/
|
|
494
500
|
chat_grounded?: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* The chat this run was launched from (`LaunchRunBody.chatId`; C1, api-types 0.71.0) — on EVERY
|
|
503
|
+
* run, terminal ones included, and after a daemon restart (read back from the `run.launched`
|
|
504
|
+
* trail entry). ABSENT — never `null` — when the run was not launched from a chat, or on a daemon
|
|
505
|
+
* before the field: check `GET /health.capabilities.runChatId` before grouping runs by chat.
|
|
506
|
+
*/
|
|
507
|
+
chat_id?: string;
|
|
495
508
|
/**
|
|
496
509
|
* The engine's plan state (wicked-core `TeamPlanState`, DES-TEAMING-002 §8.4-§8.6; api-types
|
|
497
510
|
* 0.46.0 types the engine field) — present on a run launched from a PLAN or a PRESET, ABSENT on
|
|
@@ -4252,6 +4265,12 @@ export interface GitContributor {
|
|
|
4252
4265
|
export interface SystemSettings {
|
|
4253
4266
|
/** Max nodes returned by wicked-estate graph-view (default 150). */
|
|
4254
4267
|
graphNodeLimit: number;
|
|
4268
|
+
/**
|
|
4269
|
+
* The watch registry's operator settings (TR-W5a, api-types 0.73.0): only `enabled` and
|
|
4270
|
+
* `threshold` of a shipped entry, and the LLM lane switch. A `watch` patch needs a human actor
|
|
4271
|
+
* (a worker's bearer is refused 403); the daemon stamps who changed what and when.
|
|
4272
|
+
*/
|
|
4273
|
+
watch?: WatchSettings;
|
|
4255
4274
|
/**
|
|
4256
4275
|
* Base directory for the ENGINE-OWNED worker CLI config homes (the claude worker home is
|
|
4257
4276
|
* `<root>/claude`). The daemon applies it as env `WICKED_WORKER_HOME` at boot and on every
|
|
@@ -6489,6 +6508,31 @@ export interface DemoView {
|
|
|
6489
6508
|
syntheticLabelled: boolean;
|
|
6490
6509
|
}
|
|
6491
6510
|
|
|
6511
|
+
/** What `POST /runs/:id/demo/export` makes (EP-C3; api-types 0.72.0). The MP4 itself needs no export: download `video.path`. */
|
|
6512
|
+
export type DemoExportFormat = 'gif' | 'poster';
|
|
6513
|
+
|
|
6514
|
+
/**
|
|
6515
|
+
* `POST /runs/:id/demo/export` body (EP-C3; api-types 0.72.0). `gif` encodes the stitched MP4 into
|
|
6516
|
+
* `demo-video/demo.gif` (two-pass palette, 10 fps, 720 px wide); `poster` writes one frame to
|
|
6517
|
+
* `demo-video/poster.jpg`. The daemon encodes with ffmpeg off its event loop and a timeout (GIF 180 s,
|
|
6518
|
+
* poster 30 s), only at the review gate or once the run has ended. Refusals: 400 a bad body, 404 not a demo run, 409 no stitched MP4 yet / the run is still recording / `demo-video/` changed mid-encode, 422 no frame
|
|
6519
|
+
* at `atSec`, 502 ffmpeg failed, 503 no ffmpeg on the daemon host (`hint` says how to install it),
|
|
6520
|
+
* 504 the encode ran past its timeout. A second identical request while one encodes joins it.
|
|
6521
|
+
*/
|
|
6522
|
+
export interface DemoExportBody {
|
|
6523
|
+
format: DemoExportFormat;
|
|
6524
|
+
/** Poster only: the frame, in seconds from the start (0 … 86400). Default: the first chapter marker + 1 s, or 1 s with no markers. */
|
|
6525
|
+
atSec?: number;
|
|
6526
|
+
}
|
|
6527
|
+
|
|
6528
|
+
/** `POST /runs/:id/demo/export` → 200: the file, ready for `GET /runs/:id/demo/file?path=`. */
|
|
6529
|
+
export interface DemoExportResponse {
|
|
6530
|
+
format: DemoExportFormat;
|
|
6531
|
+
/** `demo-video/demo.gif` or `demo-video/poster.jpg` (root-relative). */
|
|
6532
|
+
path: string;
|
|
6533
|
+
bytes: number;
|
|
6534
|
+
}
|
|
6535
|
+
|
|
6492
6536
|
/** `POST /proposals/:id/reject` → 200. */
|
|
6493
6537
|
export interface RejectProposalResponse {
|
|
6494
6538
|
ok: true;
|
|
@@ -7075,6 +7119,248 @@ export interface TeamEventFrame {
|
|
|
7075
7119
|
project_id?: string;
|
|
7076
7120
|
}
|
|
7077
7121
|
|
|
7122
|
+
// ── The watch registry wire contract (DES-TRIGGER-REGISTRY-001 §4.5; TR-W4; api-types 0.70.0) ──
|
|
7123
|
+
//
|
|
7124
|
+
// The registry is advisory by construction: a watch row can never allow, approve or block. Its
|
|
7125
|
+
// facts are two bus types owned by crew (`wicked.crew.watch_finding.{raised,cleared}`), relayed
|
|
7126
|
+
// onto `/ws` as {@link WatchEventFrame} by a bus tap (never broadcast directly, so the socket and
|
|
7127
|
+
// the record cannot disagree). Types only: the runtime lands in TR-W5a, and a daemon without it
|
|
7128
|
+
// simply never sends these frames or serves these routes.
|
|
7129
|
+
|
|
7130
|
+
/** The two bus types the watch registry publishes. */
|
|
7131
|
+
export type WatchEventType = 'wicked.crew.watch_finding.raised' | 'wicked.crew.watch_finding.cleared';
|
|
7132
|
+
|
|
7133
|
+
/** How a watch row is meant: a contradiction in the work's own evidence, a look-worthy flag, or a candidate rule for the review queue. */
|
|
7134
|
+
export type WatchEmitAs = 'finding' | 'flag' | 'proposal';
|
|
7135
|
+
export type WatchSeverity = 'high' | 'medium' | 'info';
|
|
7136
|
+
/** The Watchtower's kind column. There is no `needs` kind: needs-you stays studio's own fold. */
|
|
7137
|
+
export type WatchKind = 'problem' | 'decision' | 'done' | 'quiet' | 'delivery';
|
|
7138
|
+
/** `p0` is never shed; `p1` is shed after `p2` when the push ring overflows. */
|
|
7139
|
+
export type WatchPriority = 'p0' | 'p1' | 'p2';
|
|
7140
|
+
|
|
7141
|
+
/** Where in the run a watch row points: "Jump in" scrolls to the nearest event at or after `at`. */
|
|
7142
|
+
export interface WatchAnchor {
|
|
7143
|
+
run_id: string;
|
|
7144
|
+
ord: number | null;
|
|
7145
|
+
attempt: number | null;
|
|
7146
|
+
/** Unix millis of the source event. */
|
|
7147
|
+
at: number;
|
|
7148
|
+
}
|
|
7149
|
+
|
|
7150
|
+
/** One piece of evidence a watch row cites. `run_event` names a persisted CoreEvent; `bus_row` a bus row. */
|
|
7151
|
+
export interface WatchEvidenceRef {
|
|
7152
|
+
kind: 'run_event' | 'bus_row' | (string & {});
|
|
7153
|
+
type: string;
|
|
7154
|
+
ord?: number | null;
|
|
7155
|
+
attempt?: number | null;
|
|
7156
|
+
/** For `bus_row`: the cited row's `event_id`. */
|
|
7157
|
+
event_id?: number;
|
|
7158
|
+
}
|
|
7159
|
+
|
|
7160
|
+
/**
|
|
7161
|
+
* The payload of `wicked.crew.watch_finding.raised`. Its first six fields are the team
|
|
7162
|
+
* envelope's (`DES-TEAMING-002` §4.4). `watch_id` is `"w-"` + the deterministic key over
|
|
7163
|
+
* (`run_id | "-"`, `entry_id`, `entry_version`, `subject`), so a replay or a redelivery resolves to
|
|
7164
|
+
* the same row.
|
|
7165
|
+
*/
|
|
7166
|
+
export interface WatchFinding {
|
|
7167
|
+
/** `null` for a row no run owns (a registry-internal flag such as `registry-lagging`). */
|
|
7168
|
+
run_id: string | null;
|
|
7169
|
+
ord: number | null;
|
|
7170
|
+
attempt: number | null;
|
|
7171
|
+
/** `"watch:<entry_id>@<entry_version>"`. */
|
|
7172
|
+
by: string;
|
|
7173
|
+
/** Unix millis the row was produced. */
|
|
7174
|
+
at: number;
|
|
7175
|
+
/** What it answers: `"<CoreEvent type>#<ord>:<attempt>"`, or a bus source row's idempotency key. */
|
|
7176
|
+
re: string;
|
|
7177
|
+
watch_id: string;
|
|
7178
|
+
entry_id: string;
|
|
7179
|
+
entry_version: number;
|
|
7180
|
+
/** `"deterministic:<name>"` or `"llm:<prompt-ref>@<n>"`. */
|
|
7181
|
+
check: string;
|
|
7182
|
+
kind: WatchEmitAs;
|
|
7183
|
+
severity: WatchSeverity;
|
|
7184
|
+
watch_kind: WatchKind;
|
|
7185
|
+
/** `"gate"`: render as one line on the open gate's existing row, never a new row. */
|
|
7186
|
+
attach: 'gate' | null;
|
|
7187
|
+
/** The run's project membership, as the relay tags frames; absent when the run is unfiled. */
|
|
7188
|
+
project_id?: string;
|
|
7189
|
+
/** The one plain sentence the Watchtower shows. */
|
|
7190
|
+
sentence: string;
|
|
7191
|
+
/** Entry-specific facts, at most 4 KB, redacted. */
|
|
7192
|
+
facts: Record<string, unknown>;
|
|
7193
|
+
anchor: WatchAnchor | null;
|
|
7194
|
+
evidence: WatchEvidenceRef[];
|
|
7195
|
+
/** Set for an `llm:*` check only. */
|
|
7196
|
+
model: { seat: string; model: string; latency_ms: number } | null;
|
|
7197
|
+
/** How many later rows this roll-up stands for (`0` on an ordinary row). */
|
|
7198
|
+
rolled_up: number;
|
|
7199
|
+
}
|
|
7200
|
+
|
|
7201
|
+
/** The fields every `wicked.crew.watch_finding.cleared` payload carries. */
|
|
7202
|
+
export interface WatchFindingClearedBase {
|
|
7203
|
+
run_id: string | null;
|
|
7204
|
+
ord: number | null;
|
|
7205
|
+
attempt: number | null;
|
|
7206
|
+
by: string;
|
|
7207
|
+
at: number;
|
|
7208
|
+
re: string;
|
|
7209
|
+
/** The raised row this clears. */
|
|
7210
|
+
watch_id: string;
|
|
7211
|
+
entry_id: string;
|
|
7212
|
+
entry_version: number;
|
|
7213
|
+
project_id?: string;
|
|
7214
|
+
}
|
|
7215
|
+
|
|
7216
|
+
/**
|
|
7217
|
+
* The payload of `wicked.crew.watch_finding.cleared`, discriminated on `reason`: the raised row
|
|
7218
|
+
* `watch_id` names is resolved (a later attempt passed, the worker produced output), dismissed by
|
|
7219
|
+
* the operator ("Seen, not a problem": `dismissed_by` says who), or replaced by a roll-up
|
|
7220
|
+
* (`replaced_by` names it). The set is closed on purpose: no clearing reason is allow-like.
|
|
7221
|
+
*/
|
|
7222
|
+
export type WatchFindingCleared =
|
|
7223
|
+
| (WatchFindingClearedBase & { reason: 'resolved' })
|
|
7224
|
+
| (WatchFindingClearedBase & { reason: 'dismissed'; dismissed_by: string })
|
|
7225
|
+
| (WatchFindingClearedBase & { reason: 'rolled_up'; replaced_by: string });
|
|
7226
|
+
|
|
7227
|
+
export interface WatchEventPayloads {
|
|
7228
|
+
'wicked.crew.watch_finding.raised': WatchFinding;
|
|
7229
|
+
'wicked.crew.watch_finding.cleared': WatchFindingCleared;
|
|
7230
|
+
}
|
|
7231
|
+
|
|
7232
|
+
/** One watch bus row, discriminated on `event_type`. */
|
|
7233
|
+
export type WatchBusEvent = {
|
|
7234
|
+
[K in WatchEventType]: { event_type: K; payload: WatchEventPayloads[K] };
|
|
7235
|
+
}[WatchEventType];
|
|
7236
|
+
|
|
7237
|
+
/**
|
|
7238
|
+
* A `/ws` frame carrying one `wicked.crew.watch_finding.*` bus row, relayed verbatim (the
|
|
7239
|
+
* {@link TeamEventFrame} pattern). `project_id` is set when the run's membership files it.
|
|
7240
|
+
*/
|
|
7241
|
+
export interface WatchEventFrame {
|
|
7242
|
+
type: 'watchEvent';
|
|
7243
|
+
/** The whole bus row as wicked-bus delivers it. */
|
|
7244
|
+
event: WatchBusEvent & { event_id: number; [k: string]: unknown };
|
|
7245
|
+
project_id?: string;
|
|
7246
|
+
}
|
|
7247
|
+
|
|
7248
|
+
/**
|
|
7249
|
+
* What one check can see on one run. Studio never renders an empty list as "all clear" when an entry
|
|
7250
|
+
* was `not_checked`; a `not_checked` entry always says why, in plain words ("no declared scope", "the
|
|
7251
|
+
* daemon was down").
|
|
7252
|
+
*/
|
|
7253
|
+
export type WatchCoverage =
|
|
7254
|
+
| { entry_id: string; state: 'checked' }
|
|
7255
|
+
| { entry_id: string; state: 'not_checked'; reason: string };
|
|
7256
|
+
|
|
7257
|
+
/** `GET /watch?project=&kind=&run=&since=&limit=`: the feed fold, newest first. */
|
|
7258
|
+
export interface WatchFeedResponse {
|
|
7259
|
+
findings: WatchFinding[];
|
|
7260
|
+
/**
|
|
7261
|
+
* The clearing rows of the findings on this page (a late join folds them as the live
|
|
7262
|
+
* `watch_finding.cleared` frames would: Fixed, Dismissed, rolled up). api-types 0.73.0.
|
|
7263
|
+
*/
|
|
7264
|
+
cleared?: WatchFindingCleared[];
|
|
7265
|
+
/** Present with `run=` only. */
|
|
7266
|
+
coverage?: WatchCoverage[];
|
|
7267
|
+
}
|
|
7268
|
+
|
|
7269
|
+
/**
|
|
7270
|
+
* Where an entry's key point comes from. `core`: a CoreEvent from the daemon fan-in. `bus`: a pulled
|
|
7271
|
+
* 4-segment bus type. `watchdog`: a stall-watchdog frame (`workerStalled`, …). `internal`: the
|
|
7272
|
+
* registry's own tick or check-failure report (`registry-lagging`, `registry-check-failed`).
|
|
7273
|
+
* (api-types 0.73.0 adds `watchdog` and `internal`.)
|
|
7274
|
+
*/
|
|
7275
|
+
export type WatchEntrySource = 'core' | 'bus' | 'watchdog' | 'internal';
|
|
7276
|
+
|
|
7277
|
+
/** Who changed one operator setting of an entry, and when (stamped by the daemon, never the caller). */
|
|
7278
|
+
export interface WatchSettingStamp {
|
|
7279
|
+
by: string;
|
|
7280
|
+
/** Unix millis. */
|
|
7281
|
+
at: number;
|
|
7282
|
+
}
|
|
7283
|
+
|
|
7284
|
+
/** One entry's operator override in `SystemSettings.watch.entries`. */
|
|
7285
|
+
export interface WatchEntryOverride {
|
|
7286
|
+
enabled?: boolean;
|
|
7287
|
+
/** Merged over the shipped threshold, validated by the entry's check. */
|
|
7288
|
+
threshold?: Record<string, unknown>;
|
|
7289
|
+
/** Daemon-stamped; a caller cannot set these. */
|
|
7290
|
+
enabled_changed?: WatchSettingStamp;
|
|
7291
|
+
threshold_changed?: WatchSettingStamp;
|
|
7292
|
+
}
|
|
7293
|
+
|
|
7294
|
+
/** `SystemSettings.watch`. */
|
|
7295
|
+
export interface WatchSettings {
|
|
7296
|
+
entries?: Record<string, WatchEntryOverride>;
|
|
7297
|
+
/** The LLM lane (off by default; TR-W9). */
|
|
7298
|
+
llm?: boolean;
|
|
7299
|
+
}
|
|
7300
|
+
|
|
7301
|
+
/**
|
|
7302
|
+
* One registry entry (`packages/crew/watch/entries/<id>.json`), as `GET /watch/entries` serves it:
|
|
7303
|
+
* the effective entry (the operator's `enabled` / `threshold` override applied) plus its threshold
|
|
7304
|
+
* in plain words. The schema has no allow-like `emit.as` value.
|
|
7305
|
+
*/
|
|
7306
|
+
export interface WatchEntry {
|
|
7307
|
+
/** Stable, `[a-z0-9-]{3,48}`; equals the file name. */
|
|
7308
|
+
id: string;
|
|
7309
|
+
/** Bumped on any semantic change; part of every finding key. */
|
|
7310
|
+
version: number;
|
|
7311
|
+
/** See {@link WatchEntrySource}. A `bus` type is a 4-segment `wicked.<domain>.<noun>.<verb>` type. */
|
|
7312
|
+
on: { source: WatchEntrySource; type: string };
|
|
7313
|
+
/** JSON-path equality, AND of keys; an array means "any of". */
|
|
7314
|
+
filter: Record<string, unknown>;
|
|
7315
|
+
check: string;
|
|
7316
|
+
params: Record<string, unknown>;
|
|
7317
|
+
threshold: Record<string, unknown>;
|
|
7318
|
+
emit: {
|
|
7319
|
+
as: WatchEmitAs;
|
|
7320
|
+
severity: WatchSeverity;
|
|
7321
|
+
watch_kind: WatchKind;
|
|
7322
|
+
attach: 'gate' | null;
|
|
7323
|
+
/** Past `per_run`, one roll-up replaces the rest. */
|
|
7324
|
+
rate: { per_run: number };
|
|
7325
|
+
};
|
|
7326
|
+
priority: WatchPriority;
|
|
7327
|
+
enabled: boolean;
|
|
7328
|
+
/** The threshold in plain words, for "When Studio speaks up". Always set on `GET /watch/entries`. */
|
|
7329
|
+
threshold_text: string;
|
|
7330
|
+
}
|
|
7331
|
+
|
|
7332
|
+
/** Who changed an operator-adjustable entry setting, and when (read from the `settings.updated` audit entry). */
|
|
7333
|
+
export interface WatchEntryChange {
|
|
7334
|
+
id: string;
|
|
7335
|
+
by: string;
|
|
7336
|
+
/** Unix millis. */
|
|
7337
|
+
at: number;
|
|
7338
|
+
}
|
|
7339
|
+
|
|
7340
|
+
/** `GET /watch/health`. Every turned-off entry and every changed threshold is listed with who and when. */
|
|
7341
|
+
export interface WatchHealth {
|
|
7342
|
+
/** The registry is running. `false` ⇒ `reason` says why. */
|
|
7343
|
+
armed: boolean;
|
|
7344
|
+
reason: string | null;
|
|
7345
|
+
sources: {
|
|
7346
|
+
bus: 'ok' | 'lagging' | 'down' | (string & {});
|
|
7347
|
+
core: 'ok' | 'lagging' | 'down' | (string & {});
|
|
7348
|
+
watchdog: 'ok' | 'lagging' | 'down' | (string & {});
|
|
7349
|
+
};
|
|
7350
|
+
queue: { depth: number; hwm: number; shed_by_priority: Record<WatchPriority, number> };
|
|
7351
|
+
tail_lag_ms: number;
|
|
7352
|
+
emit: { failed: number };
|
|
7353
|
+
entries: {
|
|
7354
|
+
loaded: number;
|
|
7355
|
+
refused: Array<{ id: string; reason: string }>;
|
|
7356
|
+
off: WatchEntryChange[];
|
|
7357
|
+
thresholds_changed: WatchEntryChange[];
|
|
7358
|
+
};
|
|
7359
|
+
llm: { enabled: boolean; inflight: number; timeouts: number; skipped_no_seat: number };
|
|
7360
|
+
/** `core_gap: true`: runs that started and ended while the daemon was down were not evaluated this boot. */
|
|
7361
|
+
replay?: { core_gap: boolean };
|
|
7362
|
+
}
|
|
7363
|
+
|
|
7078
7364
|
/** One `wicked.team.*` bus row as `GET /runs/:id/team` returns it. */
|
|
7079
7365
|
export type TeamRow = TeamBusEvent & {
|
|
7080
7366
|
event_id: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-crew-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.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",
|