wicked-crew-api-types 0.31.0 → 0.32.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 +197 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -341,8 +341,31 @@ export interface RepoEntry {
|
|
|
341
341
|
* Optional in the TYPE, mandatory in practice: an addon predating the field omits it, and
|
|
342
342
|
* `codeGraphDb()` in the daemon's `repoPaths.ts` is where that turns into a loud error. Never
|
|
343
343
|
* join this path yourself — six independent spellings is what FINDING-069 was.
|
|
344
|
+
*
|
|
345
|
+
* Since wicked-core#406 the path is `<daemon state home>/repo-graphs/<key>/estate.db` — never
|
|
346
|
+
* inside `root_path`; a checkout's in-tree `.codegraph/` is reported in `findings`, not adopted.
|
|
344
347
|
*/
|
|
345
348
|
code_graph_db?: string;
|
|
349
|
+
/**
|
|
350
|
+
* Diagnostics about the checkout the engine wants shown on the repo card (wicked-core#406) —
|
|
351
|
+
* derived by the engine on every read like `code_graph_db`, never authoritative in the record.
|
|
352
|
+
* An empty array for a clean checkout; optional in the TYPE only because an addon predating the
|
|
353
|
+
* field omits it. Today's codes: `in_tree_code_graph_ignored` (the checkout carries a
|
|
354
|
+
* `.codegraph/` an older engine indexed in-tree — ignored; `path` names the directory and
|
|
355
|
+
* `message` says how to clear it) and `code_graph_root_unresolvable` (no repo-graph root
|
|
356
|
+
* resolves for this daemon, so `code_graph_db` is empty).
|
|
357
|
+
*/
|
|
358
|
+
findings?: RepoFinding[];
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/** One engine diagnostic on a registered repo (`RepoEntry.findings[]`; wicked-core#406). */
|
|
362
|
+
export interface RepoFinding {
|
|
363
|
+
/** Stable machine code (`snake_case`) a consumer switches on. */
|
|
364
|
+
code: string;
|
|
365
|
+
/** Operator-facing explanation: what was found, why it is ignored, how to clear it. */
|
|
366
|
+
message: string;
|
|
367
|
+
/** The filesystem path the finding is about, or `null` when it has none. */
|
|
368
|
+
path: string | null;
|
|
346
369
|
}
|
|
347
370
|
|
|
348
371
|
/** The run id of the onboarding run launched when a repo was registered (`GET /repos/:id/onboard`). */
|
|
@@ -3070,15 +3093,107 @@ export interface ProjectPrompts {
|
|
|
3070
3093
|
prompts: InteractionRequest[];
|
|
3071
3094
|
}
|
|
3072
3095
|
|
|
3073
|
-
/**
|
|
3096
|
+
/**
|
|
3097
|
+
* `POST /chats` body (gains `projectId` with DES-PROJECT-001; `repoRefs` and the SCOPE semantics
|
|
3098
|
+
* with crew#502).
|
|
3099
|
+
*
|
|
3100
|
+
* A chat is SCOPED (crew#502, F-067): its seats run in a private scratch root — never a repo and
|
|
3101
|
+
* never the daemon's working directory — with the scoped repositories as read roots and, where a
|
|
3102
|
+
* graph can be bound, a READ-ONLY wicked-estate MCP over it (the grounding governed runs get). The
|
|
3103
|
+
* scope is: the explicit `repoRefs` (plus the legacy single `repoRef`, merged in) when given, else
|
|
3104
|
+
* ALL of `projectId`'s registered `crew.repo` members, else nothing (the seats see only their
|
|
3105
|
+
* scratch root). The resolved scope comes back as {@link ChatOpenResponse.scope}.
|
|
3106
|
+
*/
|
|
3074
3107
|
export interface ChatOpenBody {
|
|
3075
3108
|
chatId?: string;
|
|
3076
3109
|
clis?: string[];
|
|
3110
|
+
/** One repo in scope — the legacy spelling; merged into `repoRefs`. */
|
|
3077
3111
|
repoRef?: string;
|
|
3078
|
-
/**
|
|
3112
|
+
/** The repos in scope, by registry id or name (1–32). With `projectId` the PROJECT graph grounds
|
|
3113
|
+
* them; without it a single repo's own graph does, and several repos get no graph. */
|
|
3114
|
+
repoRefs?: string[];
|
|
3115
|
+
/** File the chat into a project (`crew.chat` membership, attached on open) — and, when no
|
|
3116
|
+
* `repoRefs` are given, scope it to every registered `crew.repo` member of that project. */
|
|
3079
3117
|
projectId?: string;
|
|
3080
3118
|
}
|
|
3081
3119
|
|
|
3120
|
+
/** How a chat's scope was chosen (crew#502). */
|
|
3121
|
+
export type ChatScopeKind = 'project' | 'repos' | 'none';
|
|
3122
|
+
|
|
3123
|
+
/** One repository a chat's seats may read. */
|
|
3124
|
+
export interface ChatScopeRepo {
|
|
3125
|
+
id: string;
|
|
3126
|
+
name: string;
|
|
3127
|
+
/** The registered root path — the read root the seats are pointed at. */
|
|
3128
|
+
rootPath: string;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
/**
|
|
3132
|
+
* What a chat's seats can see — decided at `POST /chats`, stated to the seats in their scratch
|
|
3133
|
+
* root's `AGENTS.md` / `CLAUDE.md`, and returned to the caller so the UI can show it. Additive:
|
|
3134
|
+
* older skins ignore it.
|
|
3135
|
+
*/
|
|
3136
|
+
export interface ChatScope {
|
|
3137
|
+
kind: ChatScopeKind;
|
|
3138
|
+
/** The project the chat is filed into, when any. */
|
|
3139
|
+
projectId?: string;
|
|
3140
|
+
/** The repositories in scope (read-only). Empty for `kind: 'none'`. */
|
|
3141
|
+
repos: ChatScopeRepo[];
|
|
3142
|
+
/** The seats' working directory: the chat's private scratch root under the OS temp dir. */
|
|
3143
|
+
cwd: string;
|
|
3144
|
+
/** Whether a READ-ONLY estate MCP over a code graph is attached, and why / why not. `repoLabel`
|
|
3145
|
+
* is the estate label the project graph indexes the (single) scoped repo under, when the
|
|
3146
|
+
* binding was repo-bound — informational; the engine binds by graph path. */
|
|
3147
|
+
graph: { bound: boolean; reason: string; repoLabel?: string };
|
|
3148
|
+
/** `crew.repo` members of the project whose registry record is gone — named, not readable. */
|
|
3149
|
+
dangling: string[];
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
/** One seat's warm-up outcome on `POST /chats`. */
|
|
3153
|
+
export interface ChatSeatOutcome {
|
|
3154
|
+
cliKey: string;
|
|
3155
|
+
ok: boolean;
|
|
3156
|
+
error?: string;
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
/** `POST /chats` → 201. */
|
|
3160
|
+
export interface ChatOpenResponse {
|
|
3161
|
+
chatId: string;
|
|
3162
|
+
seats: ChatSeatOutcome[];
|
|
3163
|
+
/** The resolved scope (crew#502). */
|
|
3164
|
+
scope: ChatScope;
|
|
3165
|
+
/** Present when the chat opened but its `crew.chat` filing into `projectId` failed. */
|
|
3166
|
+
projectAttachError?: string;
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
/** One live chat on `GET /chats` (FINDING-027 gap 4; scope fields with crew#502). */
|
|
3170
|
+
export interface ChatSummary {
|
|
3171
|
+
chatId: string;
|
|
3172
|
+
/** The seats currently warm, sorted. */
|
|
3173
|
+
seats: string[];
|
|
3174
|
+
/** Seconds since the chat's last open/ensure/turn; `null` when it has no activity stamp. */
|
|
3175
|
+
idleSecs: number | null;
|
|
3176
|
+
/** The seats' working directory as the engine recorded it; absent on an engine predating scope. */
|
|
3177
|
+
cwd?: string | null;
|
|
3178
|
+
/** The estate graph the seats' read-only estate MCP is bound to; `null` ⇒ none. */
|
|
3179
|
+
codeGraphDb?: string | null;
|
|
3180
|
+
/** The repository roots in scope. */
|
|
3181
|
+
readRoots?: string[];
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
/** `GET /chats` → 200. */
|
|
3185
|
+
export interface ChatListResponse {
|
|
3186
|
+
chats: ChatSummary[];
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
/** `GET /chats/:id` → 200. */
|
|
3190
|
+
export interface ChatDetailResponse {
|
|
3191
|
+
chatId: string;
|
|
3192
|
+
seats: string[];
|
|
3193
|
+
/** The scope recorded at open; `null` for a chat this daemon did not open (or after a restart). */
|
|
3194
|
+
scope: ChatScope | null;
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3082
3197
|
// ── Project code graph (DES-PROJECT-001; the co-located multi-repo graph) ──────
|
|
3083
3198
|
//
|
|
3084
3199
|
// A project's `crew.repo` members indexed into ONE wicked-estate database, each under a stable
|
|
@@ -3638,13 +3753,92 @@ export interface AcpDiagnostics {
|
|
|
3638
3753
|
export interface DiagnosticsResponse {
|
|
3639
3754
|
components: DiagnosticsComponents;
|
|
3640
3755
|
daemon: DiagnosticsDaemon;
|
|
3641
|
-
/** `core.db` + sidecars + the events dir (as a total), sorted by name
|
|
3756
|
+
/** `core.db` + sidecars + the events dir (as a total), sorted by name, followed by one entry per
|
|
3757
|
+
* repo code graph under the state home (`repo-graphs/<key>/estate.db`, key-sorted;
|
|
3758
|
+
* wicked-core#406). */
|
|
3642
3759
|
stores: DiagnosticsStoreFile[];
|
|
3643
3760
|
/** Bounded tail of the daemon's own error-level log lines, newest first. */
|
|
3644
3761
|
recentErrors: DiagnosticsRecentError[];
|
|
3645
3762
|
acp: AcpDiagnostics;
|
|
3646
3763
|
/** The skills seam's last outcome (api-types 0.28.0) — see `DiagnosticsSkills`. */
|
|
3647
3764
|
skills: DiagnosticsSkills;
|
|
3765
|
+
/** Whether the engine's governance evidence is LANDING (api-types 0.31.0, crew#495) — see `DiagnosticsGovernance`. */
|
|
3766
|
+
governance: DiagnosticsGovernance;
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
// ── Diagnostics — governance store + dead letters (api-types 0.31.0, crew#495 / F-022) ─────────
|
|
3770
|
+
//
|
|
3771
|
+
// The engine's emit seam writes every cross-product `wicked.*` event — conformance claims and
|
|
3772
|
+
// decisions, phase transitions, the steering-rule lifecycle — onto the shared estate store named
|
|
3773
|
+
// by `WICKED_ESTATE_DB`, or, when it cannot, spools the event to an NDJSON dead-letter outbox
|
|
3774
|
+
// (`WICKED_APPS_EMIT_DEADLETTER`). `serve` now resolves that store (`--governance-db` /
|
|
3775
|
+
// `WICKED_CREW_GOVERNANCE_DB` › an inherited `WICKED_ESTATE_DB` › `<core db>.governance/
|
|
3776
|
+
// governance.db`) and keeps the outbox under the state home (`<core db>.governance/
|
|
3777
|
+
// emit-outbox.ndjson`), never under HOME; this block is the read-only account of both.
|
|
3778
|
+
|
|
3779
|
+
/** Which rule chose the store: the flag, crew's env override, the engine's own inherited
|
|
3780
|
+
* `WICKED_ESTATE_DB`, or the default sidecar of the core db. */
|
|
3781
|
+
export type DiagnosticsGovernanceStoreSource = 'flag' | 'env-crew' | 'env-estate' | 'core-db-sidecar';
|
|
3782
|
+
|
|
3783
|
+
/** The store the engine's emit seam writes governance events to. */
|
|
3784
|
+
export interface DiagnosticsGovernanceStore {
|
|
3785
|
+
/** The store as exported to the engine — an absolute SQLite path, or `:memory:`. The emit seam is SQLite-only,
|
|
3786
|
+
* so a URL spec (`postgres://…`) is refused at boot and never appears here. */
|
|
3787
|
+
path: string;
|
|
3788
|
+
source: DiagnosticsGovernanceStoreSource;
|
|
3789
|
+
}
|
|
3790
|
+
|
|
3791
|
+
/** EVENT records on the governance store. Counted through the engine binding; an engine without
|
|
3792
|
+
* it answers `null` for both — never a fabricated 0. */
|
|
3793
|
+
export interface DiagnosticsGovernanceRecords {
|
|
3794
|
+
/** Event records on the store right now (short-TTL), or `null` when the engine cannot count. */
|
|
3795
|
+
total: number | null;
|
|
3796
|
+
/** Records landed since this daemon's API came up (`total − baseline`; the baseline is taken when the routes
|
|
3797
|
+
* register, after the engine has booted, so its boot-time emits are in the baseline), or `null` when either
|
|
3798
|
+
* side is unknown. */
|
|
3799
|
+
sinceBoot: number | null;
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
/** The dead-letter outbox, folded (streamed, size-capped). */
|
|
3803
|
+
export interface DiagnosticsGovernanceDeadletters {
|
|
3804
|
+
/** The outbox this daemon exports to the engine; `null` when no store was resolved (library boot). */
|
|
3805
|
+
path: string | null;
|
|
3806
|
+
/** Entries in the outbox — 0 is the good answer. A floor when `truncated`. */
|
|
3807
|
+
count: number;
|
|
3808
|
+
/** Entries per event type (`wicked.crew.governance.conformance_recorded`, …); overflow folds into `other`. */
|
|
3809
|
+
byType: Record<string, number>;
|
|
3810
|
+
/** Entries per reason bucket — the engine's reason text before its first `:` (`no shared store (WICKED_ESTATE_DB unset)`,
|
|
3811
|
+
* `open shared store failed`, `store write failed`). */
|
|
3812
|
+
byReason: Record<string, number>;
|
|
3813
|
+
/** Entries carrying the engine's `ts` (epoch ms; written by wicked-core builds that stamp spooled records). */
|
|
3814
|
+
timestamped: number;
|
|
3815
|
+
/** Entries without a timestamp (a pre-stamp engine, or an unparseable line) — counted, never given an invented time. */
|
|
3816
|
+
untimestamped: number;
|
|
3817
|
+
/** Epoch ms of the oldest / newest timestamped entry, or `null` when none carries one. */
|
|
3818
|
+
oldestTs: number | null;
|
|
3819
|
+
newestTs: number | null;
|
|
3820
|
+
/** `true` when the fold stopped at its byte cap — `count` is then a floor. */
|
|
3821
|
+
truncated: boolean;
|
|
3822
|
+
/** The pre-fix outbox under HOME (`~/.something-wicked/wicked-apps/emit-outbox.ndjson`) when it exists and is
|
|
3823
|
+
* non-empty — events earlier daemons on this host spooled there; `null` otherwise. Reported, never written. */
|
|
3824
|
+
legacyOutbox: { path: string; bytes: number } | null;
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
/** One governance finding. `governance.store` (error) = no store resolved, every emit dead-letters;
|
|
3828
|
+
* `governance.deadletter` (error) = the outbox holds entries; `governance.legacy-outbox` (warning) =
|
|
3829
|
+
* the pre-fix HOME outbox exists. Every message names the replay command. */
|
|
3830
|
+
export interface DiagnosticsGovernanceFinding {
|
|
3831
|
+
kind: 'governance.store' | 'governance.deadletter' | 'governance.legacy-outbox';
|
|
3832
|
+
severity: 'warning' | 'error';
|
|
3833
|
+
message: string;
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
/** `GET /diagnostics` → `governance` (api-types 0.31.0). */
|
|
3837
|
+
export interface DiagnosticsGovernance {
|
|
3838
|
+
store: DiagnosticsGovernanceStore | null;
|
|
3839
|
+
records: DiagnosticsGovernanceRecords;
|
|
3840
|
+
deadletters: DiagnosticsGovernanceDeadletters;
|
|
3841
|
+
findings: DiagnosticsGovernanceFinding[];
|
|
3648
3842
|
}
|
|
3649
3843
|
|
|
3650
3844
|
/** The skills seam's state as `GET /diagnostics` reports it (skills keystone, api-types 0.28.0). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wicked-crew-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.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",
|