@ikenga/contract 0.17.0 → 0.18.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/dist/ngwa.d.ts ADDED
@@ -0,0 +1,1650 @@
1
+ import { z } from 'zod';
2
+ /** Eleven kinds — two more than D-02's locked Kind facet. `bundle` and
3
+ * `sidecar` are real in the code (`Kind::Bundle`, `SidecarSpec`) and reachable
4
+ * through *More filters*; `workflow` has no producer in Phase 2 (Phase 4 /
5
+ * G-MANIFEST-V5) but stays in the union so adding one is not a contract break.
6
+ * `project` and `artifact` from the older `ngwa-surface.html` are NOT here —
7
+ * neither is in the locked facet list and neither has a producer. */
8
+ export declare const NGWA_KINDS: readonly ["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"];
9
+ export declare const NgwaKindSchema: z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>;
10
+ export type NgwaKind = (typeof NGWA_KINDS)[number];
11
+ /** `personal` is the kernel's `project_id: null` and Ọba's `workspace`. */
12
+ export declare const NgwaScopeSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
13
+ kind: z.ZodLiteral<"personal">;
14
+ }, "strip", z.ZodTypeAny, {
15
+ kind: "personal";
16
+ }, {
17
+ kind: "personal";
18
+ }>, z.ZodObject<{
19
+ kind: z.ZodLiteral<"project">;
20
+ project_id: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ kind: "project";
23
+ project_id: string;
24
+ }, {
25
+ kind: "project";
26
+ project_id: string;
27
+ }>]>;
28
+ export type NgwaScope = z.infer<typeof NgwaScopeSchema>;
29
+ /** The union of the kernel's `InstallSource` (`builtin`/`registry`/`local`/
30
+ * `dev`) and Ọba's `ProvenanceSource` (`local`/`git`/`npx`/`catalog`). */
31
+ export declare const NGWA_SOURCES: readonly ["builtin", "registry", "git", "npx", "local", "dev", "catalog"];
32
+ export declare const NgwaSourceSchema: z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>;
33
+ export type NgwaSource = z.infer<typeof NgwaSourceSchema>;
34
+ /** Provenance. The plan's single `source` string could not hold the url / ref /
35
+ * resolved version / publisher both provenance records carry, so it became an
36
+ * object; `origin.source` is the facet value. */
37
+ export declare const NgwaOriginSchema: z.ZodObject<{
38
+ source: z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>;
39
+ /** registry url | git remote | npm spec */
40
+ url: z.ZodNullable<z.ZodString>;
41
+ /** git ref */
42
+ ref: z.ZodNullable<z.ZodString>;
43
+ /** git SHA | npm version */
44
+ resolved_version: z.ZodNullable<z.ZodString>;
45
+ /** `InstallSource::Registry.publisher_key`, or catalog publisher */
46
+ publisher: z.ZodNullable<z.ZodString>;
47
+ /** vault-owned and deletable (Ọba `managed`) */
48
+ managed: z.ZodBoolean;
49
+ auto_update: z.ZodBoolean;
50
+ installed_at_ms: z.ZodNullable<z.ZodNumber>;
51
+ updated_at_ms: z.ZodNullable<z.ZodNumber>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ url: string | null;
54
+ ref: string | null;
55
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
56
+ resolved_version: string | null;
57
+ publisher: string | null;
58
+ managed: boolean;
59
+ auto_update: boolean;
60
+ installed_at_ms: number | null;
61
+ updated_at_ms: number | null;
62
+ }, {
63
+ url: string | null;
64
+ ref: string | null;
65
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
66
+ resolved_version: string | null;
67
+ publisher: string | null;
68
+ managed: boolean;
69
+ auto_update: boolean;
70
+ installed_at_ms: number | null;
71
+ updated_at_ms: number | null;
72
+ }>;
73
+ export type NgwaOrigin = z.infer<typeof NgwaOriginSchema>;
74
+ export declare const NGWA_STATES: readonly ["enabled", "disabled", "available", "update", "orphaned", "broken"];
75
+ export declare const NgwaStateSchema: z.ZodEnum<["enabled", "disabled", "available", "update", "orphaned", "broken"]>;
76
+ export type NgwaState = z.infer<typeof NgwaStateSchema>;
77
+ /** Live supervisor state. Only long-lived sidecars / MCP servers have one.
78
+ * Read from `sidecar_supervisor` directly — `PkgRowV2.state` never does, which
79
+ * is drift §10.5 that this type fixes for the new surface. */
80
+ export declare const NgwaRuntimeSchema: z.ZodObject<{
81
+ state: z.ZodEnum<["spawning", "running", "crashed", "blocked", "parked", "stopped", "shuttingdown"]>;
82
+ pid: z.ZodNullable<z.ZodNumber>;
83
+ uptime_s: z.ZodNullable<z.ZodNumber>;
84
+ restarts: z.ZodNumber;
85
+ last_err: z.ZodNullable<z.ZodString>;
86
+ last_crash_ms: z.ZodNullable<z.ZodNumber>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
89
+ pid: number | null;
90
+ uptime_s: number | null;
91
+ restarts: number;
92
+ last_err: string | null;
93
+ last_crash_ms: number | null;
94
+ }, {
95
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
96
+ pid: number | null;
97
+ uptime_s: number | null;
98
+ restarts: number;
99
+ last_err: string | null;
100
+ last_crash_ms: number | null;
101
+ }>;
102
+ export type NgwaRuntime = z.infer<typeof NgwaRuntimeSchema>;
103
+ /** The four sorted permission lists the trust snapshot hash is taken over
104
+ * (`trust.rs:61-67`, `159-182`). All-or-nothing: no per-permission row exists
105
+ * anywhere, which is the constraint WP-18 inherits. */
106
+ export declare const NgwaPermsSummarySchema: z.ZodObject<{
107
+ shell_execute: z.ZodArray<z.ZodString, "many">;
108
+ fs_write_outside_sandbox: z.ZodArray<z.ZodString, "many">;
109
+ net: z.ZodArray<z.ZodString, "many">;
110
+ vault_keys: z.ZodArray<z.ZodString, "many">;
111
+ }, "strip", z.ZodTypeAny, {
112
+ net: string[];
113
+ shell_execute: string[];
114
+ fs_write_outside_sandbox: string[];
115
+ vault_keys: string[];
116
+ }, {
117
+ net: string[];
118
+ shell_execute: string[];
119
+ fs_write_outside_sandbox: string[];
120
+ vault_keys: string[];
121
+ }>;
122
+ export type NgwaPermsSummary = z.infer<typeof NgwaPermsSummarySchema>;
123
+ /** Two distinct trust systems exist and must not be conflated: `pkg/trust.rs`
124
+ * is the per-call sensitive-permission gate (`state`), `commands/pkg_trust.rs`
125
+ * is the separate boot-time capability-diff review (`review_pending`). The
126
+ * D-02 facet values are derived, not read off one enum:
127
+ * `builtin` ← `auto_trusted`; `signed` ← `signed`; `unsigned` ← `!signed &&
128
+ * state !== 'needs_approval'`; `review` ← `state === 'needs_approval' ||
129
+ * review_pending`. Ọba primitives get `state: 'not_applicable'`, `perms: null`
130
+ * — a skill declares intent and is never granted anything. */
131
+ export declare const NgwaTrustSchema: z.ZodObject<{
132
+ /** Mirrors PkgTrustState; 'not_applicable' for everything that is not a pkg. */
133
+ state: z.ZodEnum<["auto_trusted", "auto_granted", "granted", "needs_approval", "not_applicable"]>;
134
+ /** manifest `signature` present, or minisign-verified catalog entry */
135
+ signed: z.ZodBoolean;
136
+ /** provenance-trusted (builtin / dev) */
137
+ auto_trusted: z.ZodBoolean;
138
+ /** a TrustReview row is waiting (pkg_trust.rs) */
139
+ review_pending: z.ZodBoolean;
140
+ /** null when state is 'not_applicable' */
141
+ perms: z.ZodNullable<z.ZodObject<{
142
+ shell_execute: z.ZodArray<z.ZodString, "many">;
143
+ fs_write_outside_sandbox: z.ZodArray<z.ZodString, "many">;
144
+ net: z.ZodArray<z.ZodString, "many">;
145
+ vault_keys: z.ZodArray<z.ZodString, "many">;
146
+ }, "strip", z.ZodTypeAny, {
147
+ net: string[];
148
+ shell_execute: string[];
149
+ fs_write_outside_sandbox: string[];
150
+ vault_keys: string[];
151
+ }, {
152
+ net: string[];
153
+ shell_execute: string[];
154
+ fs_write_outside_sandbox: string[];
155
+ vault_keys: string[];
156
+ }>>;
157
+ last_granted_at_ms: z.ZodNullable<z.ZodNumber>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
160
+ auto_trusted: boolean;
161
+ signed: boolean;
162
+ review_pending: boolean;
163
+ perms: {
164
+ net: string[];
165
+ shell_execute: string[];
166
+ fs_write_outside_sandbox: string[];
167
+ vault_keys: string[];
168
+ } | null;
169
+ last_granted_at_ms: number | null;
170
+ }, {
171
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
172
+ auto_trusted: boolean;
173
+ signed: boolean;
174
+ review_pending: boolean;
175
+ perms: {
176
+ net: string[];
177
+ shell_execute: string[];
178
+ fs_write_outside_sandbox: string[];
179
+ vault_keys: string[];
180
+ } | null;
181
+ last_granted_at_ms: number | null;
182
+ }>;
183
+ export type NgwaTrust = z.infer<typeof NgwaTrustSchema>;
184
+ /** The real per-instance placement record, sourced primarily from the
185
+ * `claude_config` scan; `engine_assets` is a second contributor that marks a
186
+ * placement `managed_by: 'pkg'`. `present === false` on an `enabled` item is
187
+ * the orphan case WP-16 Health reports. */
188
+ export declare const NgwaPlacementSchema: z.ZodObject<{
189
+ /** 'claude' | 'gemini' | 'codex' | ... */
190
+ engine: z.ZodString;
191
+ scope: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
192
+ kind: z.ZodLiteral<"personal">;
193
+ }, "strip", z.ZodTypeAny, {
194
+ kind: "personal";
195
+ }, {
196
+ kind: "personal";
197
+ }>, z.ZodObject<{
198
+ kind: z.ZodLiteral<"project">;
199
+ project_id: z.ZodString;
200
+ }, "strip", z.ZodTypeAny, {
201
+ kind: "project";
202
+ project_id: string;
203
+ }, {
204
+ kind: "project";
205
+ project_id: string;
206
+ }>]>;
207
+ path: z.ZodString;
208
+ mechanism: z.ZodEnum<["symlink-dir", "file", "settings-key"]>;
209
+ /** the target actually exists on disk */
210
+ present: z.ZodBoolean;
211
+ link_target: z.ZodNullable<z.ZodString>;
212
+ /** the link resolves into the Ọba store */
213
+ in_store: z.ZodBoolean;
214
+ managed_by: z.ZodEnum<["oba", "pkg", "user"]>;
215
+ /** path of the placement that shadows this one */
216
+ overridden_by: z.ZodNullable<z.ZodString>;
217
+ format: z.ZodNullable<z.ZodEnum<["md-yaml", "toml", "json-embedded"]>>;
218
+ status: z.ZodEnum<["active", "deprecated"]>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ path: string;
221
+ status: "active" | "deprecated";
222
+ format: "md-yaml" | "toml" | "json-embedded" | null;
223
+ engine: string;
224
+ scope: {
225
+ kind: "personal";
226
+ } | {
227
+ kind: "project";
228
+ project_id: string;
229
+ };
230
+ mechanism: "file" | "symlink-dir" | "settings-key";
231
+ present: boolean;
232
+ link_target: string | null;
233
+ in_store: boolean;
234
+ managed_by: "user" | "oba" | "pkg";
235
+ overridden_by: string | null;
236
+ }, {
237
+ path: string;
238
+ status: "active" | "deprecated";
239
+ format: "md-yaml" | "toml" | "json-embedded" | null;
240
+ engine: string;
241
+ scope: {
242
+ kind: "personal";
243
+ } | {
244
+ kind: "project";
245
+ project_id: string;
246
+ };
247
+ mechanism: "file" | "symlink-dir" | "settings-key";
248
+ present: boolean;
249
+ link_target: string | null;
250
+ in_store: boolean;
251
+ managed_by: "user" | "oba" | "pkg";
252
+ overridden_by: string | null;
253
+ }>;
254
+ export type NgwaPlacement = z.infer<typeof NgwaPlacementSchema>;
255
+ /** null on the item means "never measured" and MUST render as "—", never as 0
256
+ * (designs/frame-workbench-v4.html:2679 — "anything not measured reads —").
257
+ * Phase 2 sources this from transcript JSONL (DEC-24); `'hooks'` stays a legal
258
+ * value so a later increment can add it — principally for `hook` rows, which
259
+ * the transcript cannot see at all — without reopening the gate. */
260
+ export declare const NgwaUsageSchema: z.ZodObject<{
261
+ source: z.ZodEnum<["hooks", "transcript"]>;
262
+ last_used_ms: z.ZodNullable<z.ZodNumber>;
263
+ count_7d: z.ZodNullable<z.ZodNumber>;
264
+ count_30d: z.ZodNullable<z.ZodNumber>;
265
+ /** null when the chosen source carries no tokens */
266
+ tokens_30d: z.ZodNullable<z.ZodNumber>;
267
+ /** Earliest moment the source can see. Anything before it is unknown, not zero. */
268
+ window_start_ms: z.ZodNumber;
269
+ }, "strip", z.ZodTypeAny, {
270
+ source: "hooks" | "transcript";
271
+ last_used_ms: number | null;
272
+ count_7d: number | null;
273
+ count_30d: number | null;
274
+ tokens_30d: number | null;
275
+ window_start_ms: number;
276
+ }, {
277
+ source: "hooks" | "transcript";
278
+ last_used_ms: number | null;
279
+ count_7d: number | null;
280
+ count_30d: number | null;
281
+ tokens_30d: number | null;
282
+ window_start_ms: number;
283
+ }>;
284
+ export type NgwaUsage = z.infer<typeof NgwaUsageSchema>;
285
+ export declare const NgwaRefSchema: z.ZodObject<{
286
+ /** open, mirroring RequiresEntry.kind (manifest.rs:177-192) */
287
+ kind: z.ZodUnion<[z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>, z.ZodString]>;
288
+ name: z.ZodString;
289
+ /** resolved NgwaItem.id, or null if unresolved */
290
+ item_id: z.ZodNullable<z.ZodString>;
291
+ source: z.ZodNullable<z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>>;
292
+ ref: z.ZodNullable<z.ZodString>;
293
+ }, "strip", z.ZodTypeAny, {
294
+ kind: string;
295
+ name: string;
296
+ ref: string | null;
297
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
298
+ item_id: string | null;
299
+ }, {
300
+ kind: string;
301
+ name: string;
302
+ ref: string | null;
303
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
304
+ item_id: string | null;
305
+ }>;
306
+ export type NgwaRef = z.infer<typeof NgwaRefSchema>;
307
+ export declare const NgwaItemSchema: z.ZodObject<{
308
+ /** Stable across a refresh. Pkg-backed: the manifest id. Everything else:
309
+ * `${kind}:${scope_key}:${name}` where scope_key is 'personal' | `project:<id>`. */
310
+ id: z.ZodString;
311
+ kind: z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>;
312
+ /** the on-disk / manifest name (stable, used for joins) */
313
+ name: z.ZodString;
314
+ /** manifest `name`, else `name` */
315
+ display_name: z.ZodString;
316
+ description: z.ZodNullable<z.ZodString>;
317
+ /** null for Ọba primitives with no resolved version */
318
+ version: z.ZodNullable<z.ZodString>;
319
+ /** registry index only; null otherwise */
320
+ latest_version: z.ZodNullable<z.ZodString>;
321
+ scope: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
322
+ kind: z.ZodLiteral<"personal">;
323
+ }, "strip", z.ZodTypeAny, {
324
+ kind: "personal";
325
+ }, {
326
+ kind: "personal";
327
+ }>, z.ZodObject<{
328
+ kind: z.ZodLiteral<"project">;
329
+ project_id: z.ZodString;
330
+ }, "strip", z.ZodTypeAny, {
331
+ kind: "project";
332
+ project_id: string;
333
+ }, {
334
+ kind: "project";
335
+ project_id: string;
336
+ }>]>;
337
+ origin: z.ZodObject<{
338
+ source: z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>;
339
+ /** registry url | git remote | npm spec */
340
+ url: z.ZodNullable<z.ZodString>;
341
+ /** git ref */
342
+ ref: z.ZodNullable<z.ZodString>;
343
+ /** git SHA | npm version */
344
+ resolved_version: z.ZodNullable<z.ZodString>;
345
+ /** `InstallSource::Registry.publisher_key`, or catalog publisher */
346
+ publisher: z.ZodNullable<z.ZodString>;
347
+ /** vault-owned and deletable (Ọba `managed`) */
348
+ managed: z.ZodBoolean;
349
+ auto_update: z.ZodBoolean;
350
+ installed_at_ms: z.ZodNullable<z.ZodNumber>;
351
+ updated_at_ms: z.ZodNullable<z.ZodNumber>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ url: string | null;
354
+ ref: string | null;
355
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
356
+ resolved_version: string | null;
357
+ publisher: string | null;
358
+ managed: boolean;
359
+ auto_update: boolean;
360
+ installed_at_ms: number | null;
361
+ updated_at_ms: number | null;
362
+ }, {
363
+ url: string | null;
364
+ ref: string | null;
365
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
366
+ resolved_version: string | null;
367
+ publisher: string | null;
368
+ managed: boolean;
369
+ auto_update: boolean;
370
+ installed_at_ms: number | null;
371
+ updated_at_ms: number | null;
372
+ }>;
373
+ state: z.ZodEnum<["enabled", "disabled", "available", "update", "orphaned", "broken"]>;
374
+ runtime: z.ZodNullable<z.ZodObject<{
375
+ state: z.ZodEnum<["spawning", "running", "crashed", "blocked", "parked", "stopped", "shuttingdown"]>;
376
+ pid: z.ZodNullable<z.ZodNumber>;
377
+ uptime_s: z.ZodNullable<z.ZodNumber>;
378
+ restarts: z.ZodNumber;
379
+ last_err: z.ZodNullable<z.ZodString>;
380
+ last_crash_ms: z.ZodNullable<z.ZodNumber>;
381
+ }, "strip", z.ZodTypeAny, {
382
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
383
+ pid: number | null;
384
+ uptime_s: number | null;
385
+ restarts: number;
386
+ last_err: string | null;
387
+ last_crash_ms: number | null;
388
+ }, {
389
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
390
+ pid: number | null;
391
+ uptime_s: number | null;
392
+ restarts: number;
393
+ last_err: string | null;
394
+ last_crash_ms: number | null;
395
+ }>>;
396
+ trust: z.ZodObject<{
397
+ /** Mirrors PkgTrustState; 'not_applicable' for everything that is not a pkg. */
398
+ state: z.ZodEnum<["auto_trusted", "auto_granted", "granted", "needs_approval", "not_applicable"]>;
399
+ /** manifest `signature` present, or minisign-verified catalog entry */
400
+ signed: z.ZodBoolean;
401
+ /** provenance-trusted (builtin / dev) */
402
+ auto_trusted: z.ZodBoolean;
403
+ /** a TrustReview row is waiting (pkg_trust.rs) */
404
+ review_pending: z.ZodBoolean;
405
+ /** null when state is 'not_applicable' */
406
+ perms: z.ZodNullable<z.ZodObject<{
407
+ shell_execute: z.ZodArray<z.ZodString, "many">;
408
+ fs_write_outside_sandbox: z.ZodArray<z.ZodString, "many">;
409
+ net: z.ZodArray<z.ZodString, "many">;
410
+ vault_keys: z.ZodArray<z.ZodString, "many">;
411
+ }, "strip", z.ZodTypeAny, {
412
+ net: string[];
413
+ shell_execute: string[];
414
+ fs_write_outside_sandbox: string[];
415
+ vault_keys: string[];
416
+ }, {
417
+ net: string[];
418
+ shell_execute: string[];
419
+ fs_write_outside_sandbox: string[];
420
+ vault_keys: string[];
421
+ }>>;
422
+ last_granted_at_ms: z.ZodNullable<z.ZodNumber>;
423
+ }, "strip", z.ZodTypeAny, {
424
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
425
+ auto_trusted: boolean;
426
+ signed: boolean;
427
+ review_pending: boolean;
428
+ perms: {
429
+ net: string[];
430
+ shell_execute: string[];
431
+ fs_write_outside_sandbox: string[];
432
+ vault_keys: string[];
433
+ } | null;
434
+ last_granted_at_ms: number | null;
435
+ }, {
436
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
437
+ auto_trusted: boolean;
438
+ signed: boolean;
439
+ review_pending: boolean;
440
+ perms: {
441
+ net: string[];
442
+ shell_execute: string[];
443
+ fs_write_outside_sandbox: string[];
444
+ vault_keys: string[];
445
+ } | null;
446
+ last_granted_at_ms: number | null;
447
+ }>;
448
+ /** An item with no placements is not an error: a pkg app has none. */
449
+ placements: z.ZodArray<z.ZodObject<{
450
+ /** 'claude' | 'gemini' | 'codex' | ... */
451
+ engine: z.ZodString;
452
+ scope: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
453
+ kind: z.ZodLiteral<"personal">;
454
+ }, "strip", z.ZodTypeAny, {
455
+ kind: "personal";
456
+ }, {
457
+ kind: "personal";
458
+ }>, z.ZodObject<{
459
+ kind: z.ZodLiteral<"project">;
460
+ project_id: z.ZodString;
461
+ }, "strip", z.ZodTypeAny, {
462
+ kind: "project";
463
+ project_id: string;
464
+ }, {
465
+ kind: "project";
466
+ project_id: string;
467
+ }>]>;
468
+ path: z.ZodString;
469
+ mechanism: z.ZodEnum<["symlink-dir", "file", "settings-key"]>;
470
+ /** the target actually exists on disk */
471
+ present: z.ZodBoolean;
472
+ link_target: z.ZodNullable<z.ZodString>;
473
+ /** the link resolves into the Ọba store */
474
+ in_store: z.ZodBoolean;
475
+ managed_by: z.ZodEnum<["oba", "pkg", "user"]>;
476
+ /** path of the placement that shadows this one */
477
+ overridden_by: z.ZodNullable<z.ZodString>;
478
+ format: z.ZodNullable<z.ZodEnum<["md-yaml", "toml", "json-embedded"]>>;
479
+ status: z.ZodEnum<["active", "deprecated"]>;
480
+ }, "strip", z.ZodTypeAny, {
481
+ path: string;
482
+ status: "active" | "deprecated";
483
+ format: "md-yaml" | "toml" | "json-embedded" | null;
484
+ engine: string;
485
+ scope: {
486
+ kind: "personal";
487
+ } | {
488
+ kind: "project";
489
+ project_id: string;
490
+ };
491
+ mechanism: "file" | "symlink-dir" | "settings-key";
492
+ present: boolean;
493
+ link_target: string | null;
494
+ in_store: boolean;
495
+ managed_by: "user" | "oba" | "pkg";
496
+ overridden_by: string | null;
497
+ }, {
498
+ path: string;
499
+ status: "active" | "deprecated";
500
+ format: "md-yaml" | "toml" | "json-embedded" | null;
501
+ engine: string;
502
+ scope: {
503
+ kind: "personal";
504
+ } | {
505
+ kind: "project";
506
+ project_id: string;
507
+ };
508
+ mechanism: "file" | "symlink-dir" | "settings-key";
509
+ present: boolean;
510
+ link_target: string | null;
511
+ in_store: boolean;
512
+ managed_by: "user" | "oba" | "pkg";
513
+ overridden_by: string | null;
514
+ }>, "many">;
515
+ /** null = unmeasured. A measured zero is `{ count_7d: 0, … }`; the UI must
516
+ * distinguish them. */
517
+ usage: z.ZodNullable<z.ZodObject<{
518
+ source: z.ZodEnum<["hooks", "transcript"]>;
519
+ last_used_ms: z.ZodNullable<z.ZodNumber>;
520
+ count_7d: z.ZodNullable<z.ZodNumber>;
521
+ count_30d: z.ZodNullable<z.ZodNumber>;
522
+ /** null when the chosen source carries no tokens */
523
+ tokens_30d: z.ZodNullable<z.ZodNumber>;
524
+ /** Earliest moment the source can see. Anything before it is unknown, not zero. */
525
+ window_start_ms: z.ZodNumber;
526
+ }, "strip", z.ZodTypeAny, {
527
+ source: "hooks" | "transcript";
528
+ last_used_ms: number | null;
529
+ count_7d: number | null;
530
+ count_30d: number | null;
531
+ tokens_30d: number | null;
532
+ window_start_ms: number;
533
+ }, {
534
+ source: "hooks" | "transcript";
535
+ last_used_ms: number | null;
536
+ count_7d: number | null;
537
+ count_30d: number | null;
538
+ tokens_30d: number | null;
539
+ window_start_ms: number;
540
+ }>>;
541
+ requires: z.ZodArray<z.ZodObject<{
542
+ /** open, mirroring RequiresEntry.kind (manifest.rs:177-192) */
543
+ kind: z.ZodUnion<[z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>, z.ZodString]>;
544
+ name: z.ZodString;
545
+ /** resolved NgwaItem.id, or null if unresolved */
546
+ item_id: z.ZodNullable<z.ZodString>;
547
+ source: z.ZodNullable<z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>>;
548
+ ref: z.ZodNullable<z.ZodString>;
549
+ }, "strip", z.ZodTypeAny, {
550
+ kind: string;
551
+ name: string;
552
+ ref: string | null;
553
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
554
+ item_id: string | null;
555
+ }, {
556
+ kind: string;
557
+ name: string;
558
+ ref: string | null;
559
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
560
+ item_id: string | null;
561
+ }>, "many">;
562
+ /** Computed per snapshot by inverting `requires[]`, never stored — Ọba
563
+ * deliberately does not persist the reverse graph (claude_store.rs:120-122). */
564
+ required_by: z.ZodArray<z.ZodObject<{
565
+ /** open, mirroring RequiresEntry.kind (manifest.rs:177-192) */
566
+ kind: z.ZodUnion<[z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>, z.ZodString]>;
567
+ name: z.ZodString;
568
+ /** resolved NgwaItem.id, or null if unresolved */
569
+ item_id: z.ZodNullable<z.ZodString>;
570
+ source: z.ZodNullable<z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>>;
571
+ ref: z.ZodNullable<z.ZodString>;
572
+ }, "strip", z.ZodTypeAny, {
573
+ kind: string;
574
+ name: string;
575
+ ref: string | null;
576
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
577
+ item_id: string | null;
578
+ }, {
579
+ kind: string;
580
+ name: string;
581
+ ref: string | null;
582
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
583
+ item_id: string | null;
584
+ }>, "many">;
585
+ /** The pkg that contributed this item, when it is not itself a pkg. */
586
+ owner_pkg_id: z.ZodNullable<z.ZodString>;
587
+ install_path: z.ZodNullable<z.ZodString>;
588
+ /** Engines this item is placed in, derived from placements[]. Facet source. */
589
+ engines: z.ZodArray<z.ZodString, "many">;
590
+ }, "strip", z.ZodTypeAny, {
591
+ kind: "sidecar" | "tool" | "schedule" | "engine" | "agent" | "command" | "app" | "skill" | "hook" | "bundle" | "workflow";
592
+ name: string;
593
+ description: string | null;
594
+ id: string;
595
+ version: string | null;
596
+ requires: {
597
+ kind: string;
598
+ name: string;
599
+ ref: string | null;
600
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
601
+ item_id: string | null;
602
+ }[];
603
+ usage: {
604
+ source: "hooks" | "transcript";
605
+ last_used_ms: number | null;
606
+ count_7d: number | null;
607
+ count_30d: number | null;
608
+ tokens_30d: number | null;
609
+ window_start_ms: number;
610
+ } | null;
611
+ engines: string[];
612
+ state: "enabled" | "disabled" | "available" | "update" | "orphaned" | "broken";
613
+ scope: {
614
+ kind: "personal";
615
+ } | {
616
+ kind: "project";
617
+ project_id: string;
618
+ };
619
+ display_name: string;
620
+ latest_version: string | null;
621
+ origin: {
622
+ url: string | null;
623
+ ref: string | null;
624
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
625
+ resolved_version: string | null;
626
+ publisher: string | null;
627
+ managed: boolean;
628
+ auto_update: boolean;
629
+ installed_at_ms: number | null;
630
+ updated_at_ms: number | null;
631
+ };
632
+ runtime: {
633
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
634
+ pid: number | null;
635
+ uptime_s: number | null;
636
+ restarts: number;
637
+ last_err: string | null;
638
+ last_crash_ms: number | null;
639
+ } | null;
640
+ trust: {
641
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
642
+ auto_trusted: boolean;
643
+ signed: boolean;
644
+ review_pending: boolean;
645
+ perms: {
646
+ net: string[];
647
+ shell_execute: string[];
648
+ fs_write_outside_sandbox: string[];
649
+ vault_keys: string[];
650
+ } | null;
651
+ last_granted_at_ms: number | null;
652
+ };
653
+ placements: {
654
+ path: string;
655
+ status: "active" | "deprecated";
656
+ format: "md-yaml" | "toml" | "json-embedded" | null;
657
+ engine: string;
658
+ scope: {
659
+ kind: "personal";
660
+ } | {
661
+ kind: "project";
662
+ project_id: string;
663
+ };
664
+ mechanism: "file" | "symlink-dir" | "settings-key";
665
+ present: boolean;
666
+ link_target: string | null;
667
+ in_store: boolean;
668
+ managed_by: "user" | "oba" | "pkg";
669
+ overridden_by: string | null;
670
+ }[];
671
+ required_by: {
672
+ kind: string;
673
+ name: string;
674
+ ref: string | null;
675
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
676
+ item_id: string | null;
677
+ }[];
678
+ owner_pkg_id: string | null;
679
+ install_path: string | null;
680
+ }, {
681
+ kind: "sidecar" | "tool" | "schedule" | "engine" | "agent" | "command" | "app" | "skill" | "hook" | "bundle" | "workflow";
682
+ name: string;
683
+ description: string | null;
684
+ id: string;
685
+ version: string | null;
686
+ requires: {
687
+ kind: string;
688
+ name: string;
689
+ ref: string | null;
690
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
691
+ item_id: string | null;
692
+ }[];
693
+ usage: {
694
+ source: "hooks" | "transcript";
695
+ last_used_ms: number | null;
696
+ count_7d: number | null;
697
+ count_30d: number | null;
698
+ tokens_30d: number | null;
699
+ window_start_ms: number;
700
+ } | null;
701
+ engines: string[];
702
+ state: "enabled" | "disabled" | "available" | "update" | "orphaned" | "broken";
703
+ scope: {
704
+ kind: "personal";
705
+ } | {
706
+ kind: "project";
707
+ project_id: string;
708
+ };
709
+ display_name: string;
710
+ latest_version: string | null;
711
+ origin: {
712
+ url: string | null;
713
+ ref: string | null;
714
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
715
+ resolved_version: string | null;
716
+ publisher: string | null;
717
+ managed: boolean;
718
+ auto_update: boolean;
719
+ installed_at_ms: number | null;
720
+ updated_at_ms: number | null;
721
+ };
722
+ runtime: {
723
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
724
+ pid: number | null;
725
+ uptime_s: number | null;
726
+ restarts: number;
727
+ last_err: string | null;
728
+ last_crash_ms: number | null;
729
+ } | null;
730
+ trust: {
731
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
732
+ auto_trusted: boolean;
733
+ signed: boolean;
734
+ review_pending: boolean;
735
+ perms: {
736
+ net: string[];
737
+ shell_execute: string[];
738
+ fs_write_outside_sandbox: string[];
739
+ vault_keys: string[];
740
+ } | null;
741
+ last_granted_at_ms: number | null;
742
+ };
743
+ placements: {
744
+ path: string;
745
+ status: "active" | "deprecated";
746
+ format: "md-yaml" | "toml" | "json-embedded" | null;
747
+ engine: string;
748
+ scope: {
749
+ kind: "personal";
750
+ } | {
751
+ kind: "project";
752
+ project_id: string;
753
+ };
754
+ mechanism: "file" | "symlink-dir" | "settings-key";
755
+ present: boolean;
756
+ link_target: string | null;
757
+ in_store: boolean;
758
+ managed_by: "user" | "oba" | "pkg";
759
+ overridden_by: string | null;
760
+ }[];
761
+ required_by: {
762
+ kind: string;
763
+ name: string;
764
+ ref: string | null;
765
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
766
+ item_id: string | null;
767
+ }[];
768
+ owner_pkg_id: string | null;
769
+ install_path: string | null;
770
+ }>;
771
+ export type NgwaItem = z.infer<typeof NgwaItemSchema>;
772
+ /** Per-source health entry, so the UI can say "Ọba unreadable" instead of
773
+ * silently rendering "no skills". */
774
+ export declare const NgwaSourceHealthSchema: z.ZodObject<{
775
+ ok: z.ZodBoolean;
776
+ error: z.ZodNullable<z.ZodString>;
777
+ count: z.ZodNumber;
778
+ }, "strip", z.ZodTypeAny, {
779
+ ok: boolean;
780
+ error: string | null;
781
+ count: number;
782
+ }, {
783
+ ok: boolean;
784
+ error: string | null;
785
+ count: number;
786
+ }>;
787
+ export type NgwaSourceHealth = z.infer<typeof NgwaSourceHealthSchema>;
788
+ export declare const NgwaSnapshotSchema: z.ZodObject<{
789
+ /** `id` is unique within a snapshot; WP-14 asserts uniqueness. */
790
+ items: z.ZodArray<z.ZodObject<{
791
+ /** Stable across a refresh. Pkg-backed: the manifest id. Everything else:
792
+ * `${kind}:${scope_key}:${name}` where scope_key is 'personal' | `project:<id>`. */
793
+ id: z.ZodString;
794
+ kind: z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>;
795
+ /** the on-disk / manifest name (stable, used for joins) */
796
+ name: z.ZodString;
797
+ /** manifest `name`, else `name` */
798
+ display_name: z.ZodString;
799
+ description: z.ZodNullable<z.ZodString>;
800
+ /** null for Ọba primitives with no resolved version */
801
+ version: z.ZodNullable<z.ZodString>;
802
+ /** registry index only; null otherwise */
803
+ latest_version: z.ZodNullable<z.ZodString>;
804
+ scope: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
805
+ kind: z.ZodLiteral<"personal">;
806
+ }, "strip", z.ZodTypeAny, {
807
+ kind: "personal";
808
+ }, {
809
+ kind: "personal";
810
+ }>, z.ZodObject<{
811
+ kind: z.ZodLiteral<"project">;
812
+ project_id: z.ZodString;
813
+ }, "strip", z.ZodTypeAny, {
814
+ kind: "project";
815
+ project_id: string;
816
+ }, {
817
+ kind: "project";
818
+ project_id: string;
819
+ }>]>;
820
+ origin: z.ZodObject<{
821
+ source: z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>;
822
+ /** registry url | git remote | npm spec */
823
+ url: z.ZodNullable<z.ZodString>;
824
+ /** git ref */
825
+ ref: z.ZodNullable<z.ZodString>;
826
+ /** git SHA | npm version */
827
+ resolved_version: z.ZodNullable<z.ZodString>;
828
+ /** `InstallSource::Registry.publisher_key`, or catalog publisher */
829
+ publisher: z.ZodNullable<z.ZodString>;
830
+ /** vault-owned and deletable (Ọba `managed`) */
831
+ managed: z.ZodBoolean;
832
+ auto_update: z.ZodBoolean;
833
+ installed_at_ms: z.ZodNullable<z.ZodNumber>;
834
+ updated_at_ms: z.ZodNullable<z.ZodNumber>;
835
+ }, "strip", z.ZodTypeAny, {
836
+ url: string | null;
837
+ ref: string | null;
838
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
839
+ resolved_version: string | null;
840
+ publisher: string | null;
841
+ managed: boolean;
842
+ auto_update: boolean;
843
+ installed_at_ms: number | null;
844
+ updated_at_ms: number | null;
845
+ }, {
846
+ url: string | null;
847
+ ref: string | null;
848
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
849
+ resolved_version: string | null;
850
+ publisher: string | null;
851
+ managed: boolean;
852
+ auto_update: boolean;
853
+ installed_at_ms: number | null;
854
+ updated_at_ms: number | null;
855
+ }>;
856
+ state: z.ZodEnum<["enabled", "disabled", "available", "update", "orphaned", "broken"]>;
857
+ runtime: z.ZodNullable<z.ZodObject<{
858
+ state: z.ZodEnum<["spawning", "running", "crashed", "blocked", "parked", "stopped", "shuttingdown"]>;
859
+ pid: z.ZodNullable<z.ZodNumber>;
860
+ uptime_s: z.ZodNullable<z.ZodNumber>;
861
+ restarts: z.ZodNumber;
862
+ last_err: z.ZodNullable<z.ZodString>;
863
+ last_crash_ms: z.ZodNullable<z.ZodNumber>;
864
+ }, "strip", z.ZodTypeAny, {
865
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
866
+ pid: number | null;
867
+ uptime_s: number | null;
868
+ restarts: number;
869
+ last_err: string | null;
870
+ last_crash_ms: number | null;
871
+ }, {
872
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
873
+ pid: number | null;
874
+ uptime_s: number | null;
875
+ restarts: number;
876
+ last_err: string | null;
877
+ last_crash_ms: number | null;
878
+ }>>;
879
+ trust: z.ZodObject<{
880
+ /** Mirrors PkgTrustState; 'not_applicable' for everything that is not a pkg. */
881
+ state: z.ZodEnum<["auto_trusted", "auto_granted", "granted", "needs_approval", "not_applicable"]>;
882
+ /** manifest `signature` present, or minisign-verified catalog entry */
883
+ signed: z.ZodBoolean;
884
+ /** provenance-trusted (builtin / dev) */
885
+ auto_trusted: z.ZodBoolean;
886
+ /** a TrustReview row is waiting (pkg_trust.rs) */
887
+ review_pending: z.ZodBoolean;
888
+ /** null when state is 'not_applicable' */
889
+ perms: z.ZodNullable<z.ZodObject<{
890
+ shell_execute: z.ZodArray<z.ZodString, "many">;
891
+ fs_write_outside_sandbox: z.ZodArray<z.ZodString, "many">;
892
+ net: z.ZodArray<z.ZodString, "many">;
893
+ vault_keys: z.ZodArray<z.ZodString, "many">;
894
+ }, "strip", z.ZodTypeAny, {
895
+ net: string[];
896
+ shell_execute: string[];
897
+ fs_write_outside_sandbox: string[];
898
+ vault_keys: string[];
899
+ }, {
900
+ net: string[];
901
+ shell_execute: string[];
902
+ fs_write_outside_sandbox: string[];
903
+ vault_keys: string[];
904
+ }>>;
905
+ last_granted_at_ms: z.ZodNullable<z.ZodNumber>;
906
+ }, "strip", z.ZodTypeAny, {
907
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
908
+ auto_trusted: boolean;
909
+ signed: boolean;
910
+ review_pending: boolean;
911
+ perms: {
912
+ net: string[];
913
+ shell_execute: string[];
914
+ fs_write_outside_sandbox: string[];
915
+ vault_keys: string[];
916
+ } | null;
917
+ last_granted_at_ms: number | null;
918
+ }, {
919
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
920
+ auto_trusted: boolean;
921
+ signed: boolean;
922
+ review_pending: boolean;
923
+ perms: {
924
+ net: string[];
925
+ shell_execute: string[];
926
+ fs_write_outside_sandbox: string[];
927
+ vault_keys: string[];
928
+ } | null;
929
+ last_granted_at_ms: number | null;
930
+ }>;
931
+ /** An item with no placements is not an error: a pkg app has none. */
932
+ placements: z.ZodArray<z.ZodObject<{
933
+ /** 'claude' | 'gemini' | 'codex' | ... */
934
+ engine: z.ZodString;
935
+ scope: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
936
+ kind: z.ZodLiteral<"personal">;
937
+ }, "strip", z.ZodTypeAny, {
938
+ kind: "personal";
939
+ }, {
940
+ kind: "personal";
941
+ }>, z.ZodObject<{
942
+ kind: z.ZodLiteral<"project">;
943
+ project_id: z.ZodString;
944
+ }, "strip", z.ZodTypeAny, {
945
+ kind: "project";
946
+ project_id: string;
947
+ }, {
948
+ kind: "project";
949
+ project_id: string;
950
+ }>]>;
951
+ path: z.ZodString;
952
+ mechanism: z.ZodEnum<["symlink-dir", "file", "settings-key"]>;
953
+ /** the target actually exists on disk */
954
+ present: z.ZodBoolean;
955
+ link_target: z.ZodNullable<z.ZodString>;
956
+ /** the link resolves into the Ọba store */
957
+ in_store: z.ZodBoolean;
958
+ managed_by: z.ZodEnum<["oba", "pkg", "user"]>;
959
+ /** path of the placement that shadows this one */
960
+ overridden_by: z.ZodNullable<z.ZodString>;
961
+ format: z.ZodNullable<z.ZodEnum<["md-yaml", "toml", "json-embedded"]>>;
962
+ status: z.ZodEnum<["active", "deprecated"]>;
963
+ }, "strip", z.ZodTypeAny, {
964
+ path: string;
965
+ status: "active" | "deprecated";
966
+ format: "md-yaml" | "toml" | "json-embedded" | null;
967
+ engine: string;
968
+ scope: {
969
+ kind: "personal";
970
+ } | {
971
+ kind: "project";
972
+ project_id: string;
973
+ };
974
+ mechanism: "file" | "symlink-dir" | "settings-key";
975
+ present: boolean;
976
+ link_target: string | null;
977
+ in_store: boolean;
978
+ managed_by: "user" | "oba" | "pkg";
979
+ overridden_by: string | null;
980
+ }, {
981
+ path: string;
982
+ status: "active" | "deprecated";
983
+ format: "md-yaml" | "toml" | "json-embedded" | null;
984
+ engine: string;
985
+ scope: {
986
+ kind: "personal";
987
+ } | {
988
+ kind: "project";
989
+ project_id: string;
990
+ };
991
+ mechanism: "file" | "symlink-dir" | "settings-key";
992
+ present: boolean;
993
+ link_target: string | null;
994
+ in_store: boolean;
995
+ managed_by: "user" | "oba" | "pkg";
996
+ overridden_by: string | null;
997
+ }>, "many">;
998
+ /** null = unmeasured. A measured zero is `{ count_7d: 0, … }`; the UI must
999
+ * distinguish them. */
1000
+ usage: z.ZodNullable<z.ZodObject<{
1001
+ source: z.ZodEnum<["hooks", "transcript"]>;
1002
+ last_used_ms: z.ZodNullable<z.ZodNumber>;
1003
+ count_7d: z.ZodNullable<z.ZodNumber>;
1004
+ count_30d: z.ZodNullable<z.ZodNumber>;
1005
+ /** null when the chosen source carries no tokens */
1006
+ tokens_30d: z.ZodNullable<z.ZodNumber>;
1007
+ /** Earliest moment the source can see. Anything before it is unknown, not zero. */
1008
+ window_start_ms: z.ZodNumber;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ source: "hooks" | "transcript";
1011
+ last_used_ms: number | null;
1012
+ count_7d: number | null;
1013
+ count_30d: number | null;
1014
+ tokens_30d: number | null;
1015
+ window_start_ms: number;
1016
+ }, {
1017
+ source: "hooks" | "transcript";
1018
+ last_used_ms: number | null;
1019
+ count_7d: number | null;
1020
+ count_30d: number | null;
1021
+ tokens_30d: number | null;
1022
+ window_start_ms: number;
1023
+ }>>;
1024
+ requires: z.ZodArray<z.ZodObject<{
1025
+ /** open, mirroring RequiresEntry.kind (manifest.rs:177-192) */
1026
+ kind: z.ZodUnion<[z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>, z.ZodString]>;
1027
+ name: z.ZodString;
1028
+ /** resolved NgwaItem.id, or null if unresolved */
1029
+ item_id: z.ZodNullable<z.ZodString>;
1030
+ source: z.ZodNullable<z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>>;
1031
+ ref: z.ZodNullable<z.ZodString>;
1032
+ }, "strip", z.ZodTypeAny, {
1033
+ kind: string;
1034
+ name: string;
1035
+ ref: string | null;
1036
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1037
+ item_id: string | null;
1038
+ }, {
1039
+ kind: string;
1040
+ name: string;
1041
+ ref: string | null;
1042
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1043
+ item_id: string | null;
1044
+ }>, "many">;
1045
+ /** Computed per snapshot by inverting `requires[]`, never stored — Ọba
1046
+ * deliberately does not persist the reverse graph (claude_store.rs:120-122). */
1047
+ required_by: z.ZodArray<z.ZodObject<{
1048
+ /** open, mirroring RequiresEntry.kind (manifest.rs:177-192) */
1049
+ kind: z.ZodUnion<[z.ZodEnum<["app", "engine", "tool", "sidecar", "skill", "agent", "command", "hook", "bundle", "schedule", "workflow"]>, z.ZodString]>;
1050
+ name: z.ZodString;
1051
+ /** resolved NgwaItem.id, or null if unresolved */
1052
+ item_id: z.ZodNullable<z.ZodString>;
1053
+ source: z.ZodNullable<z.ZodEnum<["builtin", "registry", "git", "npx", "local", "dev", "catalog"]>>;
1054
+ ref: z.ZodNullable<z.ZodString>;
1055
+ }, "strip", z.ZodTypeAny, {
1056
+ kind: string;
1057
+ name: string;
1058
+ ref: string | null;
1059
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1060
+ item_id: string | null;
1061
+ }, {
1062
+ kind: string;
1063
+ name: string;
1064
+ ref: string | null;
1065
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1066
+ item_id: string | null;
1067
+ }>, "many">;
1068
+ /** The pkg that contributed this item, when it is not itself a pkg. */
1069
+ owner_pkg_id: z.ZodNullable<z.ZodString>;
1070
+ install_path: z.ZodNullable<z.ZodString>;
1071
+ /** Engines this item is placed in, derived from placements[]. Facet source. */
1072
+ engines: z.ZodArray<z.ZodString, "many">;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ kind: "sidecar" | "tool" | "schedule" | "engine" | "agent" | "command" | "app" | "skill" | "hook" | "bundle" | "workflow";
1075
+ name: string;
1076
+ description: string | null;
1077
+ id: string;
1078
+ version: string | null;
1079
+ requires: {
1080
+ kind: string;
1081
+ name: string;
1082
+ ref: string | null;
1083
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1084
+ item_id: string | null;
1085
+ }[];
1086
+ usage: {
1087
+ source: "hooks" | "transcript";
1088
+ last_used_ms: number | null;
1089
+ count_7d: number | null;
1090
+ count_30d: number | null;
1091
+ tokens_30d: number | null;
1092
+ window_start_ms: number;
1093
+ } | null;
1094
+ engines: string[];
1095
+ state: "enabled" | "disabled" | "available" | "update" | "orphaned" | "broken";
1096
+ scope: {
1097
+ kind: "personal";
1098
+ } | {
1099
+ kind: "project";
1100
+ project_id: string;
1101
+ };
1102
+ display_name: string;
1103
+ latest_version: string | null;
1104
+ origin: {
1105
+ url: string | null;
1106
+ ref: string | null;
1107
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
1108
+ resolved_version: string | null;
1109
+ publisher: string | null;
1110
+ managed: boolean;
1111
+ auto_update: boolean;
1112
+ installed_at_ms: number | null;
1113
+ updated_at_ms: number | null;
1114
+ };
1115
+ runtime: {
1116
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
1117
+ pid: number | null;
1118
+ uptime_s: number | null;
1119
+ restarts: number;
1120
+ last_err: string | null;
1121
+ last_crash_ms: number | null;
1122
+ } | null;
1123
+ trust: {
1124
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
1125
+ auto_trusted: boolean;
1126
+ signed: boolean;
1127
+ review_pending: boolean;
1128
+ perms: {
1129
+ net: string[];
1130
+ shell_execute: string[];
1131
+ fs_write_outside_sandbox: string[];
1132
+ vault_keys: string[];
1133
+ } | null;
1134
+ last_granted_at_ms: number | null;
1135
+ };
1136
+ placements: {
1137
+ path: string;
1138
+ status: "active" | "deprecated";
1139
+ format: "md-yaml" | "toml" | "json-embedded" | null;
1140
+ engine: string;
1141
+ scope: {
1142
+ kind: "personal";
1143
+ } | {
1144
+ kind: "project";
1145
+ project_id: string;
1146
+ };
1147
+ mechanism: "file" | "symlink-dir" | "settings-key";
1148
+ present: boolean;
1149
+ link_target: string | null;
1150
+ in_store: boolean;
1151
+ managed_by: "user" | "oba" | "pkg";
1152
+ overridden_by: string | null;
1153
+ }[];
1154
+ required_by: {
1155
+ kind: string;
1156
+ name: string;
1157
+ ref: string | null;
1158
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1159
+ item_id: string | null;
1160
+ }[];
1161
+ owner_pkg_id: string | null;
1162
+ install_path: string | null;
1163
+ }, {
1164
+ kind: "sidecar" | "tool" | "schedule" | "engine" | "agent" | "command" | "app" | "skill" | "hook" | "bundle" | "workflow";
1165
+ name: string;
1166
+ description: string | null;
1167
+ id: string;
1168
+ version: string | null;
1169
+ requires: {
1170
+ kind: string;
1171
+ name: string;
1172
+ ref: string | null;
1173
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1174
+ item_id: string | null;
1175
+ }[];
1176
+ usage: {
1177
+ source: "hooks" | "transcript";
1178
+ last_used_ms: number | null;
1179
+ count_7d: number | null;
1180
+ count_30d: number | null;
1181
+ tokens_30d: number | null;
1182
+ window_start_ms: number;
1183
+ } | null;
1184
+ engines: string[];
1185
+ state: "enabled" | "disabled" | "available" | "update" | "orphaned" | "broken";
1186
+ scope: {
1187
+ kind: "personal";
1188
+ } | {
1189
+ kind: "project";
1190
+ project_id: string;
1191
+ };
1192
+ display_name: string;
1193
+ latest_version: string | null;
1194
+ origin: {
1195
+ url: string | null;
1196
+ ref: string | null;
1197
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
1198
+ resolved_version: string | null;
1199
+ publisher: string | null;
1200
+ managed: boolean;
1201
+ auto_update: boolean;
1202
+ installed_at_ms: number | null;
1203
+ updated_at_ms: number | null;
1204
+ };
1205
+ runtime: {
1206
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
1207
+ pid: number | null;
1208
+ uptime_s: number | null;
1209
+ restarts: number;
1210
+ last_err: string | null;
1211
+ last_crash_ms: number | null;
1212
+ } | null;
1213
+ trust: {
1214
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
1215
+ auto_trusted: boolean;
1216
+ signed: boolean;
1217
+ review_pending: boolean;
1218
+ perms: {
1219
+ net: string[];
1220
+ shell_execute: string[];
1221
+ fs_write_outside_sandbox: string[];
1222
+ vault_keys: string[];
1223
+ } | null;
1224
+ last_granted_at_ms: number | null;
1225
+ };
1226
+ placements: {
1227
+ path: string;
1228
+ status: "active" | "deprecated";
1229
+ format: "md-yaml" | "toml" | "json-embedded" | null;
1230
+ engine: string;
1231
+ scope: {
1232
+ kind: "personal";
1233
+ } | {
1234
+ kind: "project";
1235
+ project_id: string;
1236
+ };
1237
+ mechanism: "file" | "symlink-dir" | "settings-key";
1238
+ present: boolean;
1239
+ link_target: string | null;
1240
+ in_store: boolean;
1241
+ managed_by: "user" | "oba" | "pkg";
1242
+ overridden_by: string | null;
1243
+ }[];
1244
+ required_by: {
1245
+ kind: string;
1246
+ name: string;
1247
+ ref: string | null;
1248
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1249
+ item_id: string | null;
1250
+ }[];
1251
+ owner_pkg_id: string | null;
1252
+ install_path: string | null;
1253
+ }>, "many">;
1254
+ as_of_ms: z.ZodNumber;
1255
+ /** Per-source health, so the UI can say "Ọba unreadable" instead of "no skills". */
1256
+ sources: z.ZodObject<{
1257
+ kernel: z.ZodObject<{
1258
+ ok: z.ZodBoolean;
1259
+ error: z.ZodNullable<z.ZodString>;
1260
+ count: z.ZodNumber;
1261
+ }, "strip", z.ZodTypeAny, {
1262
+ ok: boolean;
1263
+ error: string | null;
1264
+ count: number;
1265
+ }, {
1266
+ ok: boolean;
1267
+ error: string | null;
1268
+ count: number;
1269
+ }>;
1270
+ oba: z.ZodObject<{
1271
+ ok: z.ZodBoolean;
1272
+ error: z.ZodNullable<z.ZodString>;
1273
+ count: z.ZodNumber;
1274
+ }, "strip", z.ZodTypeAny, {
1275
+ ok: boolean;
1276
+ error: string | null;
1277
+ count: number;
1278
+ }, {
1279
+ ok: boolean;
1280
+ error: string | null;
1281
+ count: number;
1282
+ }>;
1283
+ engine_config: z.ZodObject<{
1284
+ ok: z.ZodBoolean;
1285
+ error: z.ZodNullable<z.ZodString>;
1286
+ count: z.ZodNumber;
1287
+ }, "strip", z.ZodTypeAny, {
1288
+ ok: boolean;
1289
+ error: string | null;
1290
+ count: number;
1291
+ }, {
1292
+ ok: boolean;
1293
+ error: string | null;
1294
+ count: number;
1295
+ }>;
1296
+ engine_assets: z.ZodObject<{
1297
+ ok: z.ZodBoolean;
1298
+ error: z.ZodNullable<z.ZodString>;
1299
+ count: z.ZodNumber;
1300
+ }, "strip", z.ZodTypeAny, {
1301
+ ok: boolean;
1302
+ error: string | null;
1303
+ count: number;
1304
+ }, {
1305
+ ok: boolean;
1306
+ error: string | null;
1307
+ count: number;
1308
+ }>;
1309
+ trust: z.ZodObject<{
1310
+ ok: z.ZodBoolean;
1311
+ error: z.ZodNullable<z.ZodString>;
1312
+ count: z.ZodNumber;
1313
+ }, "strip", z.ZodTypeAny, {
1314
+ ok: boolean;
1315
+ error: string | null;
1316
+ count: number;
1317
+ }, {
1318
+ ok: boolean;
1319
+ error: string | null;
1320
+ count: number;
1321
+ }>;
1322
+ usage: z.ZodObject<{
1323
+ ok: z.ZodBoolean;
1324
+ error: z.ZodNullable<z.ZodString>;
1325
+ count: z.ZodNumber;
1326
+ }, "strip", z.ZodTypeAny, {
1327
+ ok: boolean;
1328
+ error: string | null;
1329
+ count: number;
1330
+ }, {
1331
+ ok: boolean;
1332
+ error: string | null;
1333
+ count: number;
1334
+ }>;
1335
+ }, "strip", z.ZodTypeAny, {
1336
+ usage: {
1337
+ ok: boolean;
1338
+ error: string | null;
1339
+ count: number;
1340
+ };
1341
+ oba: {
1342
+ ok: boolean;
1343
+ error: string | null;
1344
+ count: number;
1345
+ };
1346
+ trust: {
1347
+ ok: boolean;
1348
+ error: string | null;
1349
+ count: number;
1350
+ };
1351
+ kernel: {
1352
+ ok: boolean;
1353
+ error: string | null;
1354
+ count: number;
1355
+ };
1356
+ engine_config: {
1357
+ ok: boolean;
1358
+ error: string | null;
1359
+ count: number;
1360
+ };
1361
+ engine_assets: {
1362
+ ok: boolean;
1363
+ error: string | null;
1364
+ count: number;
1365
+ };
1366
+ }, {
1367
+ usage: {
1368
+ ok: boolean;
1369
+ error: string | null;
1370
+ count: number;
1371
+ };
1372
+ oba: {
1373
+ ok: boolean;
1374
+ error: string | null;
1375
+ count: number;
1376
+ };
1377
+ trust: {
1378
+ ok: boolean;
1379
+ error: string | null;
1380
+ count: number;
1381
+ };
1382
+ kernel: {
1383
+ ok: boolean;
1384
+ error: string | null;
1385
+ count: number;
1386
+ };
1387
+ engine_config: {
1388
+ ok: boolean;
1389
+ error: string | null;
1390
+ count: number;
1391
+ };
1392
+ engine_assets: {
1393
+ ok: boolean;
1394
+ error: string | null;
1395
+ count: number;
1396
+ };
1397
+ }>;
1398
+ }, "strip", z.ZodTypeAny, {
1399
+ items: {
1400
+ kind: "sidecar" | "tool" | "schedule" | "engine" | "agent" | "command" | "app" | "skill" | "hook" | "bundle" | "workflow";
1401
+ name: string;
1402
+ description: string | null;
1403
+ id: string;
1404
+ version: string | null;
1405
+ requires: {
1406
+ kind: string;
1407
+ name: string;
1408
+ ref: string | null;
1409
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1410
+ item_id: string | null;
1411
+ }[];
1412
+ usage: {
1413
+ source: "hooks" | "transcript";
1414
+ last_used_ms: number | null;
1415
+ count_7d: number | null;
1416
+ count_30d: number | null;
1417
+ tokens_30d: number | null;
1418
+ window_start_ms: number;
1419
+ } | null;
1420
+ engines: string[];
1421
+ state: "enabled" | "disabled" | "available" | "update" | "orphaned" | "broken";
1422
+ scope: {
1423
+ kind: "personal";
1424
+ } | {
1425
+ kind: "project";
1426
+ project_id: string;
1427
+ };
1428
+ display_name: string;
1429
+ latest_version: string | null;
1430
+ origin: {
1431
+ url: string | null;
1432
+ ref: string | null;
1433
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
1434
+ resolved_version: string | null;
1435
+ publisher: string | null;
1436
+ managed: boolean;
1437
+ auto_update: boolean;
1438
+ installed_at_ms: number | null;
1439
+ updated_at_ms: number | null;
1440
+ };
1441
+ runtime: {
1442
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
1443
+ pid: number | null;
1444
+ uptime_s: number | null;
1445
+ restarts: number;
1446
+ last_err: string | null;
1447
+ last_crash_ms: number | null;
1448
+ } | null;
1449
+ trust: {
1450
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
1451
+ auto_trusted: boolean;
1452
+ signed: boolean;
1453
+ review_pending: boolean;
1454
+ perms: {
1455
+ net: string[];
1456
+ shell_execute: string[];
1457
+ fs_write_outside_sandbox: string[];
1458
+ vault_keys: string[];
1459
+ } | null;
1460
+ last_granted_at_ms: number | null;
1461
+ };
1462
+ placements: {
1463
+ path: string;
1464
+ status: "active" | "deprecated";
1465
+ format: "md-yaml" | "toml" | "json-embedded" | null;
1466
+ engine: string;
1467
+ scope: {
1468
+ kind: "personal";
1469
+ } | {
1470
+ kind: "project";
1471
+ project_id: string;
1472
+ };
1473
+ mechanism: "file" | "symlink-dir" | "settings-key";
1474
+ present: boolean;
1475
+ link_target: string | null;
1476
+ in_store: boolean;
1477
+ managed_by: "user" | "oba" | "pkg";
1478
+ overridden_by: string | null;
1479
+ }[];
1480
+ required_by: {
1481
+ kind: string;
1482
+ name: string;
1483
+ ref: string | null;
1484
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1485
+ item_id: string | null;
1486
+ }[];
1487
+ owner_pkg_id: string | null;
1488
+ install_path: string | null;
1489
+ }[];
1490
+ as_of_ms: number;
1491
+ sources: {
1492
+ usage: {
1493
+ ok: boolean;
1494
+ error: string | null;
1495
+ count: number;
1496
+ };
1497
+ oba: {
1498
+ ok: boolean;
1499
+ error: string | null;
1500
+ count: number;
1501
+ };
1502
+ trust: {
1503
+ ok: boolean;
1504
+ error: string | null;
1505
+ count: number;
1506
+ };
1507
+ kernel: {
1508
+ ok: boolean;
1509
+ error: string | null;
1510
+ count: number;
1511
+ };
1512
+ engine_config: {
1513
+ ok: boolean;
1514
+ error: string | null;
1515
+ count: number;
1516
+ };
1517
+ engine_assets: {
1518
+ ok: boolean;
1519
+ error: string | null;
1520
+ count: number;
1521
+ };
1522
+ };
1523
+ }, {
1524
+ items: {
1525
+ kind: "sidecar" | "tool" | "schedule" | "engine" | "agent" | "command" | "app" | "skill" | "hook" | "bundle" | "workflow";
1526
+ name: string;
1527
+ description: string | null;
1528
+ id: string;
1529
+ version: string | null;
1530
+ requires: {
1531
+ kind: string;
1532
+ name: string;
1533
+ ref: string | null;
1534
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1535
+ item_id: string | null;
1536
+ }[];
1537
+ usage: {
1538
+ source: "hooks" | "transcript";
1539
+ last_used_ms: number | null;
1540
+ count_7d: number | null;
1541
+ count_30d: number | null;
1542
+ tokens_30d: number | null;
1543
+ window_start_ms: number;
1544
+ } | null;
1545
+ engines: string[];
1546
+ state: "enabled" | "disabled" | "available" | "update" | "orphaned" | "broken";
1547
+ scope: {
1548
+ kind: "personal";
1549
+ } | {
1550
+ kind: "project";
1551
+ project_id: string;
1552
+ };
1553
+ display_name: string;
1554
+ latest_version: string | null;
1555
+ origin: {
1556
+ url: string | null;
1557
+ ref: string | null;
1558
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev";
1559
+ resolved_version: string | null;
1560
+ publisher: string | null;
1561
+ managed: boolean;
1562
+ auto_update: boolean;
1563
+ installed_at_ms: number | null;
1564
+ updated_at_ms: number | null;
1565
+ };
1566
+ runtime: {
1567
+ state: "running" | "spawning" | "crashed" | "blocked" | "parked" | "stopped" | "shuttingdown";
1568
+ pid: number | null;
1569
+ uptime_s: number | null;
1570
+ restarts: number;
1571
+ last_err: string | null;
1572
+ last_crash_ms: number | null;
1573
+ } | null;
1574
+ trust: {
1575
+ state: "auto_trusted" | "auto_granted" | "granted" | "needs_approval" | "not_applicable";
1576
+ auto_trusted: boolean;
1577
+ signed: boolean;
1578
+ review_pending: boolean;
1579
+ perms: {
1580
+ net: string[];
1581
+ shell_execute: string[];
1582
+ fs_write_outside_sandbox: string[];
1583
+ vault_keys: string[];
1584
+ } | null;
1585
+ last_granted_at_ms: number | null;
1586
+ };
1587
+ placements: {
1588
+ path: string;
1589
+ status: "active" | "deprecated";
1590
+ format: "md-yaml" | "toml" | "json-embedded" | null;
1591
+ engine: string;
1592
+ scope: {
1593
+ kind: "personal";
1594
+ } | {
1595
+ kind: "project";
1596
+ project_id: string;
1597
+ };
1598
+ mechanism: "file" | "symlink-dir" | "settings-key";
1599
+ present: boolean;
1600
+ link_target: string | null;
1601
+ in_store: boolean;
1602
+ managed_by: "user" | "oba" | "pkg";
1603
+ overridden_by: string | null;
1604
+ }[];
1605
+ required_by: {
1606
+ kind: string;
1607
+ name: string;
1608
+ ref: string | null;
1609
+ source: "git" | "npx" | "catalog" | "local" | "builtin" | "registry" | "dev" | null;
1610
+ item_id: string | null;
1611
+ }[];
1612
+ owner_pkg_id: string | null;
1613
+ install_path: string | null;
1614
+ }[];
1615
+ as_of_ms: number;
1616
+ sources: {
1617
+ usage: {
1618
+ ok: boolean;
1619
+ error: string | null;
1620
+ count: number;
1621
+ };
1622
+ oba: {
1623
+ ok: boolean;
1624
+ error: string | null;
1625
+ count: number;
1626
+ };
1627
+ trust: {
1628
+ ok: boolean;
1629
+ error: string | null;
1630
+ count: number;
1631
+ };
1632
+ kernel: {
1633
+ ok: boolean;
1634
+ error: string | null;
1635
+ count: number;
1636
+ };
1637
+ engine_config: {
1638
+ ok: boolean;
1639
+ error: string | null;
1640
+ count: number;
1641
+ };
1642
+ engine_assets: {
1643
+ ok: boolean;
1644
+ error: string | null;
1645
+ count: number;
1646
+ };
1647
+ };
1648
+ }>;
1649
+ export type NgwaSnapshot = z.infer<typeof NgwaSnapshotSchema>;
1650
+ //# sourceMappingURL=ngwa.d.ts.map