wicked-crew-api-types 0.139.0 → 0.145.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 +536 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -292,6 +292,14 @@ export interface HealthCapabilities {
|
|
|
292
292
|
* ({@link SystemSnapshot}). ABSENT on an older daemon — show the older Health cards instead.
|
|
293
293
|
*/
|
|
294
294
|
system?: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* (api-types 0.140.0) `GET /system.attention[]` follows the one "needs you" rule (root causes with
|
|
297
|
+
* `blockedRunIds`, `kind`, `waitedSince`, ranked by impact) and the snapshot carries
|
|
298
|
+
* `unresolved[]` + `toReview`; `POST /runs/:id/resolve` is served. A skin shows
|
|
299
|
+
* `attention.length` as its "needs you" number only when this is true; ABSENT on an older daemon,
|
|
300
|
+
* which keeps its own fold.
|
|
301
|
+
*/
|
|
302
|
+
attentionRanked?: boolean;
|
|
295
303
|
/**
|
|
296
304
|
* (api-types 0.137.0, DES-SYSTEM-CHAT) The chat history is served: `GET /chats` carries `items` +
|
|
297
305
|
* `nextCursor`, `GET /chats/:id/messages` reopens a chat, `POST /chats/:id/close` ends one and keeps
|
|
@@ -303,6 +311,31 @@ export interface HealthCapabilities {
|
|
|
303
311
|
* ABSENT on an older daemon — hide upload.
|
|
304
312
|
*/
|
|
305
313
|
chatAttachments?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* (api-types 0.141.0, crew#1157) The read-only workflows `ChatOpenBody.workflow` runs on this
|
|
316
|
+
* daemon's engine — `['analyze']` on a core-ts that carries the built-in `analyze` preset, `[]` on
|
|
317
|
+
* one that does not. ABSENT on an older daemon (its strict schema refuses `workflow`): open a plain
|
|
318
|
+
* chat instead.
|
|
319
|
+
*/
|
|
320
|
+
chatWorkflows?: string[];
|
|
321
|
+
/**
|
|
322
|
+
* (api-types 0.145.0) The default evals are served: `GET /testing/default-evals/suites`,
|
|
323
|
+
* `POST /testing/default-evals/run` and `GET /testing/default-evals[/:id]` (api-types 0.143.0).
|
|
324
|
+
* ABSENT on an older daemon — read as `false`: probe the route or hide the default-evals view.
|
|
325
|
+
*/
|
|
326
|
+
defaultEvals?: boolean;
|
|
327
|
+
/**
|
|
328
|
+
* (api-types 0.145.0) The run insights are served: `GET /insights` and
|
|
329
|
+
* `POST /insights/recommendations/:id/{accept,dismiss}`. ABSENT on an older daemon — read as
|
|
330
|
+
* `false`: hide the Insights link.
|
|
331
|
+
*/
|
|
332
|
+
insights?: boolean;
|
|
333
|
+
/**
|
|
334
|
+
* (api-types 0.145.0) The workflow schedules are served: `GET /schedules`,
|
|
335
|
+
* `PUT|DELETE /schedules/:id` and `POST /schedules/:id/run`. ABSENT on an older daemon — read as
|
|
336
|
+
* `false`: hide the schedules view.
|
|
337
|
+
*/
|
|
338
|
+
schedules?: boolean;
|
|
306
339
|
}
|
|
307
340
|
|
|
308
341
|
/** One `GET /health.warnings[]` entry (additive; wicked-core#411 / wicked-crew#497). */
|
|
@@ -310,7 +343,8 @@ export interface HealthWarning {
|
|
|
310
343
|
/** `state-home.unregistered` today; open for later kinds (e.g. `seat.work_default`,
|
|
311
344
|
* api-types 0.133.0 — see `DiagnosticsSeatGovernance.roleFindings`). */
|
|
312
345
|
kind: string;
|
|
313
|
-
|
|
346
|
+
/** `info` (api-types 0.144.0, crew#1149): a notice, never a blocker — `skills.publishing` today. */
|
|
347
|
+
severity: 'info' | 'warning' | 'error';
|
|
314
348
|
message: string;
|
|
315
349
|
}
|
|
316
350
|
|
|
@@ -6695,6 +6729,14 @@ export interface ChatOpenBody {
|
|
|
6695
6729
|
primary?: string;
|
|
6696
6730
|
/** (api-types 0.137.0, DES-SYSTEM-CHAT) The page the chat was started on, for the history list. */
|
|
6697
6731
|
startedOn?: ChatStartedOn;
|
|
6732
|
+
/**
|
|
6733
|
+
* (api-types 0.141.0, crew#1157) Run every turn of this chat as a READ-ONLY workflow: `analyze`
|
|
6734
|
+
* answers questions about the repositories in scope from the code graph and the files, each claim
|
|
6735
|
+
* cited, changing nothing. The chat seats ONE helper (`primary`, else the first eligible), asks for
|
|
6736
|
+
* no reviewer, never delivers, and its seats propose no work. A name chats do not run is a 400; an
|
|
6737
|
+
* engine without it is a 409. Send it only when `GET /health.capabilities.chatWorkflows` names it.
|
|
6738
|
+
*/
|
|
6739
|
+
workflow?: string;
|
|
6698
6740
|
}
|
|
6699
6741
|
|
|
6700
6742
|
/** The scope a `POST /chats` caller may name (api-types 0.39.0, studio#323 R4). */
|
|
@@ -6842,6 +6884,8 @@ export interface ChatOpenResponse {
|
|
|
6842
6884
|
* field; a daemon between #641 and #650 emitted it only when `refused` was non-empty.
|
|
6843
6885
|
*/
|
|
6844
6886
|
singleSeat?: ChatSingleSeatDegradation;
|
|
6887
|
+
/** (api-types 0.141.0, crew#1157) The workflow every turn runs, when the open named one. */
|
|
6888
|
+
workflow?: string;
|
|
6845
6889
|
}
|
|
6846
6890
|
|
|
6847
6891
|
/** `POST /chats/:id/messages` → 202. */
|
|
@@ -8045,7 +8089,9 @@ export interface DiagnosticsSkillsFinding {
|
|
|
8045
8089
|
* not the baseline the published generation was built from — runs use the published (older)
|
|
8046
8090
|
* skills; `message` names both versions and the remedy (refresh-baseline, then publish). A
|
|
8047
8091
|
* daemon boot refreshes and publishes on its own when nothing in the catalog is user-edited
|
|
8048
|
-
* (`WICKED_CREW_SKILLS_AUTO_REFRESH=0` turns that off);
|
|
8092
|
+
* (`WICKED_CREW_SKILLS_AUTO_REFRESH=0` turns that off); `skills.publishing` (`info`, api-types 0.144.0, crew#1149) =
|
|
8093
|
+
* the boot ladder is still publishing (state `publishing`): the only finding then, in place of a
|
|
8094
|
+
* `skills.base-skill` error — launches wait until it lands. */
|
|
8049
8095
|
kind:
|
|
8050
8096
|
| 'skills.fallback'
|
|
8051
8097
|
| 'skills.blocked'
|
|
@@ -8057,8 +8103,9 @@ export interface DiagnosticsSkillsFinding {
|
|
|
8057
8103
|
| 'skills.phase-skill'
|
|
8058
8104
|
| 'skills.garden'
|
|
8059
8105
|
| 'skills.publish-warning'
|
|
8060
|
-
| 'skills.installed-ahead'
|
|
8061
|
-
|
|
8106
|
+
| 'skills.installed-ahead'
|
|
8107
|
+
| 'skills.publishing';
|
|
8108
|
+
severity: 'info' | 'warning' | 'error';
|
|
8062
8109
|
message: string;
|
|
8063
8110
|
}
|
|
8064
8111
|
|
|
@@ -8288,7 +8335,9 @@ export interface NoEligibleSeatBody {
|
|
|
8288
8335
|
export type SystemState = 'ok' | 'degraded' | 'down' | 'unknown' | 'off';
|
|
8289
8336
|
|
|
8290
8337
|
/** The Nerve Center light: `red` when work is blocked, `yellow` when something needs a look but
|
|
8291
|
-
* work still flows, `green` when `attention[]` is empty. Derived from `attention[]` only.
|
|
8338
|
+
* work still flows, `green` when `attention[]` is empty. Derived from `attention[]` only.
|
|
8339
|
+
* (api-types 0.140.0, `capabilities.attentionRanked`) `green` ONLY when `attention[]` AND
|
|
8340
|
+
* `unresolved[]` are both empty: unresolved work alone reads `yellow`. */
|
|
8292
8341
|
export type SystemLevel = 'green' | 'yellow' | 'red';
|
|
8293
8342
|
|
|
8294
8343
|
/** The existing action an attention item or row offers (the snapshot itself is read-only):
|
|
@@ -8318,11 +8367,36 @@ export interface SystemSnapshot {
|
|
|
8318
8367
|
budgetMs: number;
|
|
8319
8368
|
/** How long assembling it took, in ms. */
|
|
8320
8369
|
tookMs: number;
|
|
8321
|
-
/** `red` iff some attention item is `red`, else `yellow` iff any item, else `green`.
|
|
8370
|
+
/** `red` iff some attention item is `red`, else `yellow` iff any item, else `green`. (api-types
|
|
8371
|
+
* 0.140.0, `capabilities.attentionRanked`) `yellow` also when `unresolved[]` is not empty: `green`
|
|
8372
|
+
* only when both are empty. */
|
|
8322
8373
|
level: SystemLevel;
|
|
8323
8374
|
/** Every item that needs a look, worst first (red before yellow, then by how many runs it
|
|
8324
|
-
* blocks, then infra › cli › run › governance). Empty when all is clear.
|
|
8375
|
+
* blocks, then infra › cli › run › governance). Empty when all is clear.
|
|
8376
|
+
*
|
|
8377
|
+
* (api-types 0.140.0, `capabilities.attentionRanked`) The ONE "needs you" list: each item is one
|
|
8378
|
+
* root cause holding work up right now, either because work cannot move until a person acts
|
|
8379
|
+
* (`kind: 'prevents'`) or because the system itself slows it (`kind: 'slows'`). One cause that
|
|
8380
|
+
* holds several runs is ONE item naming them in `blockedRunIds`. Superseded runs, answered asks,
|
|
8381
|
+
* failed runs older than 7 days, benches with an alternative and pending proposals are not in it
|
|
8382
|
+
* (the first three move to `unresolved[]`; proposals are `toReview`). Sorted by runs held, then
|
|
8383
|
+
* prevents before slows, then a component (infra, or no seat at all) before one run's own cause,
|
|
8384
|
+
* then the longest wait, then the units left. Its length is the number. */
|
|
8325
8385
|
attention: SystemAttentionItem[];
|
|
8386
|
+
/**
|
|
8387
|
+
* (api-types 0.140.0) Work nobody has resolved: failed runs not retried and not archived,
|
|
8388
|
+
* superseded runs still open, asks parked at their turn gate past a day. Each carries what it cost
|
|
8389
|
+
* and how to resolve it (retry, archive with a reason, or close as superseded). Never counted in
|
|
8390
|
+
* `attention[]`, never dropped by age. ABSENT on an older daemon.
|
|
8391
|
+
*/
|
|
8392
|
+
unresolved?: SystemUnresolvedItem[];
|
|
8393
|
+
/** (api-types 0.140.0) `unresolved[]`'s summed cost: `costUsd` is `null` when no item's cost is
|
|
8394
|
+
* known; `costKnown` says how many items carried one. ABSENT on an older daemon. */
|
|
8395
|
+
unresolvedSpend?: { costUsd: number | null; tokens: { input: number; output: number } | null; costKnown: number };
|
|
8396
|
+
/** (api-types 0.140.0) Pending proposals waiting on review: shown as "N to review", never in the
|
|
8397
|
+
* "needs you" number (no run waits on them). `null` when the queue did not answer in time. ABSENT
|
|
8398
|
+
* on an older daemon. */
|
|
8399
|
+
toReview?: number | null;
|
|
8326
8400
|
/** One entry per CLI on the roster, in roster order. */
|
|
8327
8401
|
clis: SystemCli[];
|
|
8328
8402
|
/** Every unfinished run (not completed / cancelled / failed), worst first:
|
|
@@ -8349,6 +8423,72 @@ export interface SystemAttentionItem {
|
|
|
8349
8423
|
target: SystemTarget;
|
|
8350
8424
|
/** The one existing action that helps, or `null`. */
|
|
8351
8425
|
action: SystemAction | null;
|
|
8426
|
+
/** (api-types 0.140.0) `prevents`: work cannot move until someone acts; `slows`: the system
|
|
8427
|
+
* slows it (host load). ABSENT on an older daemon. */
|
|
8428
|
+
kind?: 'prevents' | 'slows';
|
|
8429
|
+
/** (api-types 0.140.0) The runs this one cause holds (`blocks` is its length). For a `slows`
|
|
8430
|
+
* item, the runs whose next step it slows. ABSENT on an older daemon. */
|
|
8431
|
+
blockedRunIds?: string[];
|
|
8432
|
+
/** (api-types 0.140.0) ISO-8601 of the oldest open gate among the held runs (the gate's
|
|
8433
|
+
* arrival, never the run's launch); a failed run's end; `null` when unknown. ABSENT on an older
|
|
8434
|
+
* daemon. */
|
|
8435
|
+
waitedSince?: string | null;
|
|
8436
|
+
/** (api-types 0.140.0) Units not yet done across the held runs. ABSENT on an older daemon. */
|
|
8437
|
+
unitsLeft?: number;
|
|
8438
|
+
}
|
|
8439
|
+
|
|
8440
|
+
/** (api-types 0.140.0) Why a run is in `unresolved[]`. `failed`: it failed and was neither retried
|
|
8441
|
+
* (`retry_of`) nor archived; `superseded`: a retry or a later completed run with the same repo,
|
|
8442
|
+
* workflow and title replaced it, but it is still open or unarchived; `parked`: an ask waits at its
|
|
8443
|
+
* turn gate past a day. */
|
|
8444
|
+
export type SystemUnresolvedWhy = 'failed' | 'superseded' | 'parked';
|
|
8445
|
+
|
|
8446
|
+
/** (api-types 0.140.0) The ways to resolve an unresolved run: `retry` (`POST /runs {retryOf}`),
|
|
8447
|
+
* `archive` (`POST /runs/:id/resolve {action: 'archive', reason}`, a reason is required) and
|
|
8448
|
+
* `close_superseded` (`POST /runs/:id/resolve {action: 'superseded', by}`). */
|
|
8449
|
+
export type SystemResolveKind = 'retry' | 'archive' | 'close_superseded';
|
|
8450
|
+
|
|
8451
|
+
/** (api-types 0.140.0) One run nobody has resolved (`SystemSnapshot.unresolved[]`). */
|
|
8452
|
+
export interface SystemUnresolvedItem {
|
|
8453
|
+
/** `unresolved:<runId>`. */
|
|
8454
|
+
id: string;
|
|
8455
|
+
runId: string;
|
|
8456
|
+
title: string;
|
|
8457
|
+
/** (api-types 0.142.0) The run's repo (`repo_ref`) and workflow, so a skin can group look-alike items; `null` when none. ABSENT before. */
|
|
8458
|
+
repo?: string | null;
|
|
8459
|
+
workflow?: string | null;
|
|
8460
|
+
/** The engine's status. */
|
|
8461
|
+
status: string;
|
|
8462
|
+
why: SystemUnresolvedWhy;
|
|
8463
|
+
/** Plain words ("failed 9 days ago", "superseded by 6f11390c, which delivered"). */
|
|
8464
|
+
reason: string;
|
|
8465
|
+
/** The run that superseded it, for `why: 'superseded'`. */
|
|
8466
|
+
supersededBy?: string;
|
|
8467
|
+
/** ISO-8601 of when it stopped moving (its end, or its gate's arrival); `null` when unknown. */
|
|
8468
|
+
since: string | null;
|
|
8469
|
+
/** What it cost. `costUsd`/`tokens` are `null` when the run's log carried no usage frame (or was
|
|
8470
|
+
* not read yet); `wallMs` is launch to end (or to now while open), `null` for an undated run. */
|
|
8471
|
+
cost: { costUsd: number | null; tokens: { input: number; output: number } | null; wallMs: number | null };
|
|
8472
|
+
/** The resolutions that apply, best first. */
|
|
8473
|
+
actions: SystemResolveKind[];
|
|
8474
|
+
}
|
|
8475
|
+
|
|
8476
|
+
/** (api-types 0.140.0) `POST /runs/:id/resolve`: resolve an unresolved run. `archive` needs a
|
|
8477
|
+
* non-blank `reason` (a blank or missing one is a 400); `superseded` names the run that replaced it
|
|
8478
|
+
* in `by` (an existing run, not itself). A run parked at a gate is stopped first, then archived; a
|
|
8479
|
+
* run that is executing is refused (409). The archive note keeps the reason. */
|
|
8480
|
+
export type ResolveRunRequest =
|
|
8481
|
+
| { action: 'archive'; reason: string }
|
|
8482
|
+
| { action: 'superseded'; by: string; reason?: string };
|
|
8483
|
+
|
|
8484
|
+
export interface ResolveRunResponse {
|
|
8485
|
+
runId: string;
|
|
8486
|
+
action: 'archive' | 'superseded';
|
|
8487
|
+
archived: true;
|
|
8488
|
+
/** The run was parked at a gate and was stopped before it was archived. */
|
|
8489
|
+
cancelled: boolean;
|
|
8490
|
+
/** The archive note written (`resolved: <reason>` or `superseded by <id>[: <reason>]`). */
|
|
8491
|
+
note: string;
|
|
8352
8492
|
}
|
|
8353
8493
|
|
|
8354
8494
|
// ── clis[] ──
|
|
@@ -8475,8 +8615,9 @@ export interface SystemRun {
|
|
|
8475
8615
|
/** The thresholds the verdict used (from `workerStallMinutes`). */
|
|
8476
8616
|
quietAfterMs: number;
|
|
8477
8617
|
stallAfterMs: number;
|
|
8478
|
-
/** The open gate or question, when the run waits on one.
|
|
8479
|
-
|
|
8618
|
+
/** The open gate or question, when the run waits on one. `receivedAt` (api-types 0.140.0): ISO-8601
|
|
8619
|
+
* of the gate's arrival; `null`/ABSENT when unknown. */
|
|
8620
|
+
gate?: { interactionId: string | null; ord: number | null; kind: string | null; prompt: string | null; receivedAt?: string | null };
|
|
8480
8621
|
/** ISO-8601 the run was launched, when known. */
|
|
8481
8622
|
createdAt: string | null;
|
|
8482
8623
|
}
|
|
@@ -11724,6 +11865,187 @@ export interface LearnTopicsResponse {
|
|
|
11724
11865
|
topics: LearnTopic[];
|
|
11725
11866
|
}
|
|
11726
11867
|
|
|
11868
|
+
// ── workflow schedules + the run review (DES-RUNS-REVIEW-001) ─────────────────────────────────
|
|
11869
|
+
// `/api/v1/schedules`: any workflow on a cadence (the default entry reviews recent work every 48 h).
|
|
11870
|
+
// `/api/v1/insights`: every review of recent work, its numbers and what happened to each recommendation.
|
|
11871
|
+
|
|
11872
|
+
/** A schedule's last outcome: `launched` while its run is open; `refused` = the launch failed. */
|
|
11873
|
+
/** `launching` = the run id is reserved and the engine is being asked; it holds the slot across a restart. */
|
|
11874
|
+
export type ScheduleOutcome = 'launching' | 'launched' | 'refused' | 'completed' | 'failed' | 'cancelled' | 'skipped';
|
|
11875
|
+
|
|
11876
|
+
/** One workflow schedule (`GET /schedules`). */
|
|
11877
|
+
export interface WorkflowSchedule {
|
|
11878
|
+
/** Kebab-case; the default entry is `review-recent-work`. */
|
|
11879
|
+
id: string;
|
|
11880
|
+
workflow: string;
|
|
11881
|
+
/** Interval, 24..2160 hours. */
|
|
11882
|
+
everyHours: number;
|
|
11883
|
+
enabled: boolean;
|
|
11884
|
+
/** Projects the run covers; empty = all. */
|
|
11885
|
+
projectIds: string[];
|
|
11886
|
+
repoRef: string | null;
|
|
11887
|
+
problem: string | null;
|
|
11888
|
+
/** ISO-8601. Missed intervals coalesce into one launch; a schedule whose last run is open is skipped. */
|
|
11889
|
+
nextDueAt: string;
|
|
11890
|
+
lastRunId: string | null;
|
|
11891
|
+
lastRunAt: string | null;
|
|
11892
|
+
lastOutcome: ScheduleOutcome | null;
|
|
11893
|
+
/** Why the last attempt was skipped or refused, in plain words; null after a launch. */
|
|
11894
|
+
lastNote: string | null;
|
|
11895
|
+
/** Consecutive refused launches (backoff = min(2^failures, 24) h). */
|
|
11896
|
+
failures: number;
|
|
11897
|
+
createdAt: string;
|
|
11898
|
+
updatedAt: string;
|
|
11899
|
+
/** The `review-recent-work` schedule only: the latest review's date and outcome. */
|
|
11900
|
+
lastReview?: { runId: string; launchedAt: string; endedAt: string | null; status: InsightsReviewStatus } | null;
|
|
11901
|
+
}
|
|
11902
|
+
|
|
11903
|
+
export interface SchedulesResponse {
|
|
11904
|
+
schedules: WorkflowSchedule[];
|
|
11905
|
+
}
|
|
11906
|
+
|
|
11907
|
+
/** `PUT /schedules/:id` (human-only). */
|
|
11908
|
+
export interface SchedulePutBody {
|
|
11909
|
+
workflow: string;
|
|
11910
|
+
everyHours: number;
|
|
11911
|
+
enabled?: boolean;
|
|
11912
|
+
projectIds?: string[];
|
|
11913
|
+
repoRef?: string | null;
|
|
11914
|
+
problem?: string | null;
|
|
11915
|
+
}
|
|
11916
|
+
|
|
11917
|
+
/** `POST /schedules/:id/run` ("Run it now", human-only): 409 when its last run is still going or another run works. */
|
|
11918
|
+
export interface ScheduleRunResponse {
|
|
11919
|
+
runId: string;
|
|
11920
|
+
schedule: WorkflowSchedule;
|
|
11921
|
+
}
|
|
11922
|
+
|
|
11923
|
+
export type InsightsMetricId = 'pass_rate' | 'override_rate' | 'unresolved_rate' | 'time_to_pr' | 'floor_minutes' | 'wait_on_people' | 'spend' | 'retries';
|
|
11924
|
+
/** `too-few` = below the minimum sample (n < 5) in the window or the baseline: no trend is called. */
|
|
11925
|
+
export type InsightsVerdict = 'too-few' | 'no-change' | 'improved' | 'regressed';
|
|
11926
|
+
export type InsightsRecommendationKind = 'steering-rule' | 'memory' | 'setting' | 'issue' | 'resolve-stale';
|
|
11927
|
+
export type InsightsReviewStatus = 'running' | 'completed' | 'failed' | 'cancelled';
|
|
11928
|
+
|
|
11929
|
+
export interface InsightsInterval {
|
|
11930
|
+
lo: number;
|
|
11931
|
+
hi: number;
|
|
11932
|
+
}
|
|
11933
|
+
|
|
11934
|
+
/** A sample: a rate (Wilson 95 % interval) or a median (bootstrap 95 % interval, with p75/p90). */
|
|
11935
|
+
export interface InsightsSampleStat {
|
|
11936
|
+
n: number;
|
|
11937
|
+
value: number | null;
|
|
11938
|
+
interval: InsightsInterval | null;
|
|
11939
|
+
p75?: number | null;
|
|
11940
|
+
p90?: number | null;
|
|
11941
|
+
}
|
|
11942
|
+
|
|
11943
|
+
export interface InsightsMetricDef {
|
|
11944
|
+
id: InsightsMetricId;
|
|
11945
|
+
label: string;
|
|
11946
|
+
kind: 'rate' | 'median';
|
|
11947
|
+
unit: 'ratio' | 'minutes' | 'usd' | 'count';
|
|
11948
|
+
higherIsBetter: boolean;
|
|
11949
|
+
}
|
|
11950
|
+
|
|
11951
|
+
export interface InsightsRecommendation {
|
|
11952
|
+
/** `<review run id>:<candidate id>`. */
|
|
11953
|
+
id: string;
|
|
11954
|
+
candidate: string;
|
|
11955
|
+
kind: InsightsRecommendationKind;
|
|
11956
|
+
title: string;
|
|
11957
|
+
evidence: {
|
|
11958
|
+
line: string;
|
|
11959
|
+
runs: Array<{ id: string; title: string }>;
|
|
11960
|
+
metric?: InsightsMetricId;
|
|
11961
|
+
segment?: string;
|
|
11962
|
+
n: number;
|
|
11963
|
+
value?: number | null;
|
|
11964
|
+
baseline?: number | null;
|
|
11965
|
+
interval?: InsightsInterval | null;
|
|
11966
|
+
};
|
|
11967
|
+
expectedEffect: string;
|
|
11968
|
+
confidence: 'high' | 'medium' | 'low';
|
|
11969
|
+
/** What evidence would change our mind. */
|
|
11970
|
+
changeMind: string;
|
|
11971
|
+
/** Crew's ranking key: runs affected + hours at stake + dollars at stake. */
|
|
11972
|
+
impact: number;
|
|
11973
|
+
basis: 'notable' | 'pattern';
|
|
11974
|
+
action: {
|
|
11975
|
+
setting?: string;
|
|
11976
|
+
issue?: { repoRef: string | null; title: string; body: string };
|
|
11977
|
+
runs?: string[];
|
|
11978
|
+
proposal?: { kindType: string; content: string; severity?: string };
|
|
11979
|
+
};
|
|
11980
|
+
state: 'new' | 'accepted' | 'dismissed';
|
|
11981
|
+
reason: string | null;
|
|
11982
|
+
decidedAt: string | null;
|
|
11983
|
+
/** The approve-queue proposal filed for a steering-rule or memory recommendation. */
|
|
11984
|
+
proposalId: string | null;
|
|
11985
|
+
proposalError: string | null;
|
|
11986
|
+
}
|
|
11987
|
+
|
|
11988
|
+
export interface InsightsReview {
|
|
11989
|
+
runId: string;
|
|
11990
|
+
trigger: 'schedule' | 'manual';
|
|
11991
|
+
scheduleId: string | null;
|
|
11992
|
+
launchedAt: string;
|
|
11993
|
+
endedAt: string | null;
|
|
11994
|
+
status: InsightsReviewStatus;
|
|
11995
|
+
window: { startMs: number; endMs: number };
|
|
11996
|
+
baselineWindows: Array<{ startMs: number; endMs: number }>;
|
|
11997
|
+
projectIds: string[];
|
|
11998
|
+
summary: string | null;
|
|
11999
|
+
/** false = the seat wrote no usable report; crew's own wording is shown, labelled "not interpreted". */
|
|
12000
|
+
interpreted: boolean;
|
|
12001
|
+
totals: Record<string, number> | null;
|
|
12002
|
+
/** The all-runs metrics of this review: one point per metric on the trend lines. */
|
|
12003
|
+
series: Array<{ metric: InsightsMetricId; window: InsightsSampleStat; baseline: InsightsSampleStat; verdict: InsightsVerdict }>;
|
|
12004
|
+
/** What got better, and what is working. */
|
|
12005
|
+
improvements: Array<{ metric: InsightsMetricId; segment: string; line: string }>;
|
|
12006
|
+
regressions: Array<{ metric: InsightsMetricId; segment: string; line: string }>;
|
|
12007
|
+
/** At most five, ranked by impact. */
|
|
12008
|
+
recommendations: InsightsRecommendation[];
|
|
12009
|
+
watching: Array<{ id: string; title: string; line: string }>;
|
|
12010
|
+
error: string | null;
|
|
12011
|
+
}
|
|
12012
|
+
|
|
12013
|
+
/** `GET /insights`: the review history, newest first. */
|
|
12014
|
+
export interface InsightsResponse {
|
|
12015
|
+
reviews: InsightsReview[];
|
|
12016
|
+
/** Recommendations nobody has accepted or dismissed yet, across the history. */
|
|
12017
|
+
newRecommendations: number;
|
|
12018
|
+
running: boolean;
|
|
12019
|
+
lastReview: { runId: string; launchedAt: string; endedAt: string | null; status: InsightsReviewStatus } | null;
|
|
12020
|
+
metrics: InsightsMetricDef[];
|
|
12021
|
+
/** Below this n no trend is called. */
|
|
12022
|
+
minSample: number;
|
|
12023
|
+
}
|
|
12024
|
+
|
|
12025
|
+
/** What studio opens on Accept: the proposal (approval stays in the approve queue), a settings section, a
|
|
12026
|
+
* prefilled new-issue page, or the runs list filtered to these runs. */
|
|
12027
|
+
export type InsightsAcceptTarget =
|
|
12028
|
+
| { kind: 'proposal'; proposalId: string }
|
|
12029
|
+
| { kind: 'settings'; section: string }
|
|
12030
|
+
| { kind: 'issue'; repoRef: string | null; title: string; body: string; url: string | null }
|
|
12031
|
+
| { kind: 'runs'; runIds: string[] }
|
|
12032
|
+
| { kind: 'none' };
|
|
12033
|
+
|
|
12034
|
+
/** `POST /insights/recommendations/:id/accept` (human-only). */
|
|
12035
|
+
export interface AcceptRecommendationResponse {
|
|
12036
|
+
recommendation: InsightsRecommendation;
|
|
12037
|
+
open: InsightsAcceptTarget;
|
|
12038
|
+
}
|
|
12039
|
+
|
|
12040
|
+
/** `POST /insights/recommendations/:id/dismiss` (human-only). A proposal-backed one rejects its proposal. */
|
|
12041
|
+
export interface DismissRecommendationBody {
|
|
12042
|
+
reason: string;
|
|
12043
|
+
}
|
|
12044
|
+
|
|
12045
|
+
export interface DismissRecommendationResponse {
|
|
12046
|
+
recommendation: InsightsRecommendation;
|
|
12047
|
+
}
|
|
12048
|
+
|
|
11727
12049
|
// ── MCP inspector bridge (DES-MCP-INSPECTOR-001 §3) ───────────────────────────────────────────
|
|
11728
12050
|
// `/api/v1/mcp-inspect/sessions`: one live connection to an MCP server per session, driven by
|
|
11729
12051
|
// studio's host for an `mcp-server` editor. Start, send and delete are human-only; the log is
|
|
@@ -11910,3 +12232,208 @@ export interface SearchResponse {
|
|
|
11910
12232
|
partial: boolean;
|
|
11911
12233
|
took_ms: number;
|
|
11912
12234
|
}
|
|
12235
|
+
|
|
12236
|
+
// ── Default evals (DES-DEFAULT-EVALS-001; api-types 0.143.0) ─────────────────────────────────────────────
|
|
12237
|
+
// `/api/v1/testing/default-evals*`: the system's own judgments (needs-you, floor class, QE verdict, attribution,
|
|
12238
|
+
// steering firing, recall, prompt routing, normalization) scored against what really happened. One case shape for
|
|
12239
|
+
// every suite; real, synthetic, combined and model-labelled figures are always reported apart.
|
|
12240
|
+
|
|
12241
|
+
/** The eight inference points. */
|
|
12242
|
+
export type DefaultEvalSuiteId =
|
|
12243
|
+
| 'needs-you'
|
|
12244
|
+
| 'floor-class'
|
|
12245
|
+
| 'qe-verdict'
|
|
12246
|
+
| 'attribution'
|
|
12247
|
+
| 'steering'
|
|
12248
|
+
| 'recall'
|
|
12249
|
+
| 'archetype'
|
|
12250
|
+
| 'normalization';
|
|
12251
|
+
|
|
12252
|
+
export type DefaultEvalCaseSource = 'real' | 'synthetic';
|
|
12253
|
+
|
|
12254
|
+
/**
|
|
12255
|
+
* Who said what the answer should be. `operator`: the person's choice at a gate (or a ruling); `rule`: a
|
|
12256
|
+
* deterministic consistency rule over the case's own evidence; `fixture`: written into a corpus or the generator;
|
|
12257
|
+
* `model:<seat>`: a model labelled it because nothing else could. Model labels are reported in their own row and
|
|
12258
|
+
* never in the headline (DES §3, determinism).
|
|
12259
|
+
*/
|
|
12260
|
+
export type DefaultEvalLabelBy = 'operator' | 'rule' | 'fixture' | `model:${string}`;
|
|
12261
|
+
|
|
12262
|
+
/** What the system answered: a class, a set (attribution), or a cluster key (needs-you merge). */
|
|
12263
|
+
export interface DefaultEvalAnswer {
|
|
12264
|
+
label?: string;
|
|
12265
|
+
labels?: string[];
|
|
12266
|
+
cluster?: string;
|
|
12267
|
+
}
|
|
12268
|
+
|
|
12269
|
+
export interface DefaultEvalObserved extends DefaultEvalAnswer {
|
|
12270
|
+
/** The classifier's own confidence in `label`, in [0, 1], when it gives one (calibration). */
|
|
12271
|
+
confidence?: number;
|
|
12272
|
+
/** `recorded`: read from the run store as the system said it then. `replay`: the current classifier, run now. */
|
|
12273
|
+
by: 'recorded' | 'replay';
|
|
12274
|
+
}
|
|
12275
|
+
|
|
12276
|
+
export interface DefaultEvalExpected extends DefaultEvalAnswer {
|
|
12277
|
+
by: DefaultEvalLabelBy;
|
|
12278
|
+
/** Why this is the answer, in a line (the operator's words, or the rule that fired). */
|
|
12279
|
+
why?: string;
|
|
12280
|
+
}
|
|
12281
|
+
|
|
12282
|
+
export interface DefaultEvalCaseEvidence {
|
|
12283
|
+
runId?: string;
|
|
12284
|
+
ord?: number;
|
|
12285
|
+
seq?: number;
|
|
12286
|
+
decisionId?: string;
|
|
12287
|
+
/** A repo-relative or program-relative file the case was read from (seed cases). */
|
|
12288
|
+
file?: string;
|
|
12289
|
+
}
|
|
12290
|
+
|
|
12291
|
+
export interface DefaultEvalCase {
|
|
12292
|
+
/** Stable identity: capture is idempotent by it. */
|
|
12293
|
+
id: string;
|
|
12294
|
+
suite: DefaultEvalSuiteId;
|
|
12295
|
+
source: DefaultEvalCaseSource;
|
|
12296
|
+
/** The project (or repo, when the run has no project) the case belongs to; `null` when neither is known. */
|
|
12297
|
+
project: string | null;
|
|
12298
|
+
/** The surface that produced `observed`, when several surfaces answer one question (needs-you). */
|
|
12299
|
+
surface?: string;
|
|
12300
|
+
/**
|
|
12301
|
+
* The canonical input fingerprint: two cases with the same key asked the system the same question. The
|
|
12302
|
+
* normalization suite compares observations per key across projects and surfaces.
|
|
12303
|
+
*/
|
|
12304
|
+
inputKey: string;
|
|
12305
|
+
/** The case's input, small and scrubbed (no paths, no prompts beyond a title). */
|
|
12306
|
+
input: Record<string, unknown>;
|
|
12307
|
+
/** `null` when the system's answer is not known yet: a synthetic case waiting on a replay adapter. */
|
|
12308
|
+
observed: DefaultEvalObserved | null;
|
|
12309
|
+
expected: DefaultEvalExpected;
|
|
12310
|
+
evidence?: DefaultEvalCaseEvidence;
|
|
12311
|
+
/** A case from the shipped baseline (the 2026-10-27 rig capture and the needs-you ruling), not this daemon's own
|
|
12312
|
+
* run store. Only counted when a run asks for the baseline; always disclosed in the counts. */
|
|
12313
|
+
baseline?: true;
|
|
12314
|
+
}
|
|
12315
|
+
|
|
12316
|
+
/** A proportion with its Wilson 95 % interval. `tooFew` when n is below the minimum (DES §6). */
|
|
12317
|
+
export interface DefaultEvalRate {
|
|
12318
|
+
k: number;
|
|
12319
|
+
n: number;
|
|
12320
|
+
value: number | null;
|
|
12321
|
+
lo: number | null;
|
|
12322
|
+
hi: number | null;
|
|
12323
|
+
tooFew: boolean;
|
|
12324
|
+
}
|
|
12325
|
+
|
|
12326
|
+
export interface DefaultEvalClassScore {
|
|
12327
|
+
label: string;
|
|
12328
|
+
precision: DefaultEvalRate;
|
|
12329
|
+
recall: DefaultEvalRate;
|
|
12330
|
+
}
|
|
12331
|
+
|
|
12332
|
+
export interface DefaultEvalCalibration {
|
|
12333
|
+
n: number;
|
|
12334
|
+
/** DefaultEvalExpected calibration error over 10 equal-width bins. `null` below the calibration minimum. */
|
|
12335
|
+
ece: number | null;
|
|
12336
|
+
brier: number | null;
|
|
12337
|
+
tooFew: boolean;
|
|
12338
|
+
}
|
|
12339
|
+
|
|
12340
|
+
/** One slice of a suite's cases (real, synthetic, combined, model-labelled, or one project). */
|
|
12341
|
+
export interface DefaultEvalSliceScore {
|
|
12342
|
+
/** Cases in the slice, including those that could not be scored. */
|
|
12343
|
+
cases: number;
|
|
12344
|
+
/** Cases with no observation (a synthetic case with no replay adapter). Never counted as right or wrong. */
|
|
12345
|
+
unscored: number;
|
|
12346
|
+
/** DefaultEvalObserved matched expected: exact class, set equality, or the pair agreement for merges. */
|
|
12347
|
+
agreement: DefaultEvalRate;
|
|
12348
|
+
perClass: DefaultEvalClassScore[];
|
|
12349
|
+
/** Set-valued suites (attribution): micro precision / recall over the set members. */
|
|
12350
|
+
members?: { precision: DefaultEvalRate; recall: DefaultEvalRate };
|
|
12351
|
+
/** Cluster suites (needs-you merge): pairwise precision / recall over "these two are one item". */
|
|
12352
|
+
pairs?: { precision: DefaultEvalRate; recall: DefaultEvalRate };
|
|
12353
|
+
calibration?: DefaultEvalCalibration;
|
|
12354
|
+
}
|
|
12355
|
+
|
|
12356
|
+
export type DefaultEvalTrend = 'too-few' | 'no-change' | 'improved' | 'regressed' | 'first-run';
|
|
12357
|
+
|
|
12358
|
+
export interface DefaultEvalSuiteScore {
|
|
12359
|
+
suite: DefaultEvalSuiteId;
|
|
12360
|
+
title: string;
|
|
12361
|
+
/** Slices that always appear. `model` holds only model-labelled cases; the other three exclude them. */
|
|
12362
|
+
real: DefaultEvalSliceScore;
|
|
12363
|
+
synthetic: DefaultEvalSliceScore;
|
|
12364
|
+
combined: DefaultEvalSliceScore;
|
|
12365
|
+
model: DefaultEvalSliceScore;
|
|
12366
|
+
/** Per project (cross-project runs only), over real + synthetic. */
|
|
12367
|
+
byProject?: Record<string, DefaultEvalSliceScore>;
|
|
12368
|
+
/** Per answerer, when several surfaces answer the same question (needs-you). */
|
|
12369
|
+
bySurface?: Record<string, DefaultEvalSliceScore>;
|
|
12370
|
+
/** Against the last stored run of the same suite and scope, on the combined agreement. */
|
|
12371
|
+
trend: { word: DefaultEvalTrend; previous: number | null; previousRunId: string | null };
|
|
12372
|
+
/** Plain-words notes the suite must carry (why synthetic is unscored, which adapter is missing, …). */
|
|
12373
|
+
notes: string[];
|
|
12374
|
+
}
|
|
12375
|
+
|
|
12376
|
+
/** One input judged differently by place: the normalization drift a cross-project run surfaces. */
|
|
12377
|
+
export interface DefaultEvalDriftKey {
|
|
12378
|
+
inputKey: string;
|
|
12379
|
+
suite: DefaultEvalSuiteId;
|
|
12380
|
+
/** `project` or `surface`: what differed. */
|
|
12381
|
+
axis: 'project' | 'surface';
|
|
12382
|
+
/** place → the observed labels there (sorted, distinct). */
|
|
12383
|
+
observed: Record<string, string[]>;
|
|
12384
|
+
caseIds: string[];
|
|
12385
|
+
}
|
|
12386
|
+
|
|
12387
|
+
export interface DefaultEvalReport {
|
|
12388
|
+
id: string;
|
|
12389
|
+
createdAt: string;
|
|
12390
|
+
/** `null` = every project (a cross-project run). */
|
|
12391
|
+
project: string | null;
|
|
12392
|
+
suites: DefaultEvalSuiteScore[];
|
|
12393
|
+
drift: DefaultEvalDriftKey[];
|
|
12394
|
+
counts: { real: number; synthetic: number; modelLabelled: number; unscored: number; baseline: number };
|
|
12395
|
+
/** The minimum n a figure needs before it is called (and the calibration minimum). */
|
|
12396
|
+
minimums: { rate: number; calibration: number };
|
|
12397
|
+
}
|
|
12398
|
+
|
|
12399
|
+
export interface DefaultEvalSummary {
|
|
12400
|
+
id: string;
|
|
12401
|
+
createdAt: string;
|
|
12402
|
+
project: string | null;
|
|
12403
|
+
suites: Array<{ suite: DefaultEvalSuiteId; agreement: number | null; n: number; tooFew: boolean; trend: DefaultEvalTrend }>;
|
|
12404
|
+
drift: number;
|
|
12405
|
+
counts: DefaultEvalReport['counts'];
|
|
12406
|
+
}
|
|
12407
|
+
|
|
12408
|
+
/** `GET /testing/default-evals/suites`. */
|
|
12409
|
+
export interface DefaultEvalSuitesResponse {
|
|
12410
|
+
suites: Array<{
|
|
12411
|
+
id: DefaultEvalSuiteId;
|
|
12412
|
+
title: string;
|
|
12413
|
+
/** Crew can run the current classifier on a case's input (so synthetic cases are scored). */
|
|
12414
|
+
replay: boolean;
|
|
12415
|
+
/** The generator makes synthetic cases for it. */
|
|
12416
|
+
synthetic: boolean;
|
|
12417
|
+
/** Why it cannot replay, when it cannot. */
|
|
12418
|
+
note: string | null;
|
|
12419
|
+
}>;
|
|
12420
|
+
}
|
|
12421
|
+
|
|
12422
|
+
/** `POST /testing/default-evals/run` body. `project`: one project (or repo) id, or `"all"` (the default). */
|
|
12423
|
+
export interface RunDefaultEvalsBody {
|
|
12424
|
+
project?: string;
|
|
12425
|
+
suites?: DefaultEvalSuiteId[];
|
|
12426
|
+
/** Count the shipped baseline cases too (the 2026-10-27 rig capture and the needs-you ruling). */
|
|
12427
|
+
baseline?: boolean;
|
|
12428
|
+
}
|
|
12429
|
+
|
|
12430
|
+
/** `GET /testing/default-evals`. Newest first. */
|
|
12431
|
+
export interface ListDefaultEvalRunsResponse {
|
|
12432
|
+
runs: DefaultEvalSummary[];
|
|
12433
|
+
}
|
|
12434
|
+
|
|
12435
|
+
/** `GET /testing/default-evals/:id`. */
|
|
12436
|
+
export interface DefaultEvalDetail {
|
|
12437
|
+
report: DefaultEvalReport;
|
|
12438
|
+
cases: DefaultEvalCase[];
|
|
12439
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-crew-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.145.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",
|