@skillsregistry/contracts 1.0.1 → 2.0.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.
@@ -1,4 +1,93 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * Risk appetite. Domain layer maps to a numeric trust threshold + an
4
+ * allowVulnerable flag; when the caller sets `minTrust` / `allowVulnerable`
5
+ * explicitly, those override the appetite-derived values.
6
+ */
7
+ export declare const AppetiteSchema: z.ZodEnum<["strict", "cautious", "balanced", "adventurous"]>;
8
+ export type Appetite = z.infer<typeof AppetiteSchema>;
9
+ /**
10
+ * Visibility bands per cortex.md §16.6. Four-band tenant-scope model
11
+ * (schema migration 0035). `private` is a legacy alias kept for pre-v6.3
12
+ * consumers — new writes should prefer `tenant_private`.
13
+ *
14
+ * Enum *values* stay snake_case: they are stored as-is in the Postgres
15
+ * `chk_visibility` CHECK constraint (`@skillsregistry/schema`), so the wire
16
+ * value must match the column value. Only *field names* were flipped to
17
+ * camelCase in v2.0.0.
18
+ */
19
+ export declare const SkillVisibilitySchema: z.ZodEnum<["public", "private", "tenant_private", "tenant_internal", "unlisted"]>;
20
+ export type SkillVisibility = z.infer<typeof SkillVisibilitySchema>;
21
+ /**
22
+ * Search request per cortex.md §6.2:
23
+ *
24
+ * POST /v1/search { query, appetite, minTrust, allowVulnerable, tenantId, limit }
25
+ *
26
+ * Fields beyond the cortex minimum (`tags`, `category`, `runtimeEnv`,
27
+ * `visibility`, `portable`) are the local node's search superset — the
28
+ * mothership treats them as optional filters when set.
29
+ *
30
+ * **v2.0.0 (MAJOR).** Field names flipped snake_case → camelCase to match
31
+ * every current caller (mothership inline schema at `src/routes/search.ts`,
32
+ * Cortex `SkillsRegistryClient.findSkill()`, local-node route surface). The
33
+ * v1.x snake_case shape caught no real consumers — 100% of live wire traffic
34
+ * was already camelCase, so the shared contract was inert. Aligning the
35
+ * contract to observed reality eliminates the silent-drop risk documented as
36
+ * X6 in the mothership repo's CLAUDE.md sibling-spec drift log (2026-07-15).
37
+ * Consumers that spelled the snake form must switch to camelCase in the same
38
+ * bump.
39
+ */
40
+ export declare const SearchRequestSchema: z.ZodObject<{
41
+ /** Free-text query. Required, non-empty. */
42
+ query: z.ZodString;
43
+ /** Advisory tenant scope. */
44
+ tenantId: z.ZodOptional<z.ZodString>;
45
+ /** Risk appetite → default trust floor + allowVulnerable default. */
46
+ appetite: z.ZodOptional<z.ZodEnum<["strict", "cautious", "balanced", "adventurous"]>>;
47
+ /**
48
+ * Hard trust-score floor (0..1). Overrides `appetite` when set.
49
+ * Cortex sends this to gate before the confidence tier is even assessed.
50
+ */
51
+ minTrust: z.ZodOptional<z.ZodNumber>;
52
+ /**
53
+ * Allow skills tagged vulnerable / contains-vulnerable through the filter.
54
+ * Overrides the appetite-derived default when set.
55
+ */
56
+ allowVulnerable: z.ZodOptional<z.ZodBoolean>;
57
+ /** Result cap (1..50). Default 10 at the domain layer. */
58
+ limit: z.ZodOptional<z.ZodNumber>;
59
+ /** Local-superset filters — mothership treats as optional. */
60
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
61
+ category: z.ZodOptional<z.ZodString>;
62
+ runtimeEnv: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
63
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private", "tenant_private", "tenant_internal", "unlisted"]>>;
64
+ portable: z.ZodOptional<z.ZodBoolean>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ query: string;
67
+ limit?: number | undefined;
68
+ tags?: string[] | undefined;
69
+ category?: string | undefined;
70
+ runtimeEnv?: string[] | undefined;
71
+ visibility?: "public" | "private" | "tenant_private" | "tenant_internal" | "unlisted" | undefined;
72
+ tenantId?: string | undefined;
73
+ portable?: boolean | undefined;
74
+ appetite?: "strict" | "cautious" | "balanced" | "adventurous" | undefined;
75
+ minTrust?: number | undefined;
76
+ allowVulnerable?: boolean | undefined;
77
+ }, {
78
+ query: string;
79
+ limit?: number | undefined;
80
+ tags?: string[] | undefined;
81
+ category?: string | undefined;
82
+ runtimeEnv?: string[] | undefined;
83
+ visibility?: "public" | "private" | "tenant_private" | "tenant_internal" | "unlisted" | undefined;
84
+ tenantId?: string | undefined;
85
+ portable?: boolean | undefined;
86
+ appetite?: "strict" | "cautious" | "balanced" | "adventurous" | undefined;
87
+ minTrust?: number | undefined;
88
+ allowVulnerable?: boolean | undefined;
89
+ }>;
90
+ export type SearchRequest = z.infer<typeof SearchRequestSchema>;
2
91
  export declare const TrustScoreRequestSchema: z.ZodObject<{
3
92
  /** Skill identifier — either the mothership UUID or the local node's slug. */
4
93
  skill_id: z.ZodString;
@@ -13,14 +102,14 @@ export declare const TrustScoreRequestSchema: z.ZodObject<{
13
102
  description: z.ZodOptional<z.ZodString>;
14
103
  skill_md: z.ZodOptional<z.ZodString>;
15
104
  }, "strip", z.ZodTypeAny, {
16
- version: string;
17
105
  name: string;
106
+ version: string;
18
107
  source: string;
19
108
  description?: string | undefined;
20
109
  skill_md?: string | undefined;
21
110
  }, {
22
- version: string;
23
111
  name: string;
112
+ version: string;
24
113
  source: string;
25
114
  description?: string | undefined;
26
115
  skill_md?: string | undefined;
@@ -30,8 +119,8 @@ export declare const TrustScoreRequestSchema: z.ZodObject<{
30
119
  }, "strip", z.ZodTypeAny, {
31
120
  skill_id: string;
32
121
  manifest?: {
33
- version: string;
34
122
  name: string;
123
+ version: string;
35
124
  source: string;
36
125
  description?: string | undefined;
37
126
  skill_md?: string | undefined;
@@ -40,8 +129,8 @@ export declare const TrustScoreRequestSchema: z.ZodObject<{
40
129
  }, {
41
130
  skill_id: string;
42
131
  manifest?: {
43
- version: string;
44
132
  name: string;
133
+ version: string;
45
134
  source: string;
46
135
  description?: string | undefined;
47
136
  skill_md?: string | undefined;
@@ -97,6 +186,91 @@ export declare const BudgetResponseSchema: z.ZodObject<{
97
186
  low_balance: boolean;
98
187
  }>;
99
188
  export type BudgetResponse = z.infer<typeof BudgetResponseSchema>;
189
+ /**
190
+ * Sandbox contract per `skill-convention.md` v1.3 §9. The runtime (Cortex L3,
191
+ * on any Sandbox-seam adapter — Daytona / Novita / E2B) reads these fields
192
+ * verbatim to provision the execution environment. Applies to any skill with
193
+ * a sandbox surface (`runtime_env` ∈ {vm, agent} today; `api` may declare
194
+ * one if it spawns a subprocess).
195
+ *
196
+ * `image` is the OCI ref — the portability anchor (§9.1). The image family
197
+ * (`skill-base`, `skill-java`, `cognium-scan-base`, `agent-base`) is derived
198
+ * by prefix-matching the ref; not enforced here so the Lane 0 rollout can
199
+ * ship unbuilt images without tripping ingest.
200
+ *
201
+ * `egress` is a default-deny allow-list of hostnames (§9.3). Every host the
202
+ * skill contacts — clone targets, package mirrors, MCP endpoints — must be
203
+ * listed or the sandbox will block the connection.
204
+ *
205
+ * `profile: 'agent'` + `budget_caps` are the agent-runtime extension
206
+ * (§14.2). `budget_caps` are hard caps enforced in-band by the agent skill's
207
+ * wrapper script through llmproxy session metering — the caller cannot rely
208
+ * on Cortex enforcing them at the outer boundary.
209
+ */
210
+ export declare const SkillSandboxSchema: z.ZodObject<{
211
+ /** OCI ref, e.g. `ghcr.io/cognium-labs/skill-base:1.0.0`. */
212
+ image: z.ZodString;
213
+ /** Memory allocation in MB. Base default 512 (vm) / 2048 (agent). */
214
+ memory_mb: z.ZodNumber;
215
+ /** vCPU count. Base default 2 (vm) / 4 (agent). */
216
+ cpu: z.ZodNumber;
217
+ /** Wall-clock ceiling in seconds. Base default 300 (vm) / 7200 (agent). */
218
+ timeout_seconds: z.ZodNumber;
219
+ /**
220
+ * Default-deny egress allow-list of hostnames. Empty array = no outbound
221
+ * network from the sandbox. Wildcards are NOT interpreted here — the
222
+ * runtime treats each entry as an exact host match.
223
+ */
224
+ egress: z.ZodArray<z.ZodString, "many">;
225
+ /** Present when `runtime_env: agent`. Signals the agent-runtime shape. */
226
+ profile: z.ZodOptional<z.ZodLiteral<"agent">>;
227
+ /**
228
+ * Agent-only hard caps. Enforced in-band by the wrapper script via
229
+ * llmproxy metering (Cortex only enforces the outer wall-clock via
230
+ * provider timeout).
231
+ */
232
+ budget_caps: z.ZodOptional<z.ZodObject<{
233
+ /** Max spend in USD across all LLM calls this run. */
234
+ max_tokens_usd: z.ZodOptional<z.ZodNumber>;
235
+ /** Max sub-tool invocations from inside the agent sandbox. */
236
+ max_internal_tool_calls: z.ZodOptional<z.ZodNumber>;
237
+ /** Wall-clock ceiling; usually mirrors top-level `timeout_seconds`. */
238
+ max_wall_seconds: z.ZodOptional<z.ZodNumber>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ max_tokens_usd?: number | undefined;
241
+ max_internal_tool_calls?: number | undefined;
242
+ max_wall_seconds?: number | undefined;
243
+ }, {
244
+ max_tokens_usd?: number | undefined;
245
+ max_internal_tool_calls?: number | undefined;
246
+ max_wall_seconds?: number | undefined;
247
+ }>>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ image: string;
250
+ memory_mb: number;
251
+ cpu: number;
252
+ timeout_seconds: number;
253
+ egress: string[];
254
+ profile?: "agent" | undefined;
255
+ budget_caps?: {
256
+ max_tokens_usd?: number | undefined;
257
+ max_internal_tool_calls?: number | undefined;
258
+ max_wall_seconds?: number | undefined;
259
+ } | undefined;
260
+ }, {
261
+ image: string;
262
+ memory_mb: number;
263
+ cpu: number;
264
+ timeout_seconds: number;
265
+ egress: string[];
266
+ profile?: "agent" | undefined;
267
+ budget_caps?: {
268
+ max_tokens_usd?: number | undefined;
269
+ max_internal_tool_calls?: number | undefined;
270
+ max_wall_seconds?: number | undefined;
271
+ } | undefined;
272
+ }>;
273
+ export type SkillSandbox = z.infer<typeof SkillSandboxSchema>;
100
274
  export declare const PublishRequestSchema: z.ZodObject<{
101
275
  /** Skill manifest to promote from local to global registry. */
102
276
  manifest: z.ZodObject<{
@@ -115,10 +289,79 @@ export declare const PublishRequestSchema: z.ZodObject<{
115
289
  source_url: z.ZodOptional<z.ZodString>;
116
290
  repository_url: z.ZodOptional<z.ZodString>;
117
291
  mcp_url: z.ZodOptional<z.ZodString>;
292
+ /**
293
+ * Sandbox contract per skill-convention v1.3 §9. Required in practice
294
+ * for runtime_env ∈ {vm, agent} (Cortex L3 dispatch reads it directly);
295
+ * kept optional at the schema level so pre-v1.3 rows / api+llm skills
296
+ * don't need to carry it.
297
+ */
298
+ sandbox: z.ZodOptional<z.ZodObject<{
299
+ /** OCI ref, e.g. `ghcr.io/cognium-labs/skill-base:1.0.0`. */
300
+ image: z.ZodString;
301
+ /** Memory allocation in MB. Base default 512 (vm) / 2048 (agent). */
302
+ memory_mb: z.ZodNumber;
303
+ /** vCPU count. Base default 2 (vm) / 4 (agent). */
304
+ cpu: z.ZodNumber;
305
+ /** Wall-clock ceiling in seconds. Base default 300 (vm) / 7200 (agent). */
306
+ timeout_seconds: z.ZodNumber;
307
+ /**
308
+ * Default-deny egress allow-list of hostnames. Empty array = no outbound
309
+ * network from the sandbox. Wildcards are NOT interpreted here — the
310
+ * runtime treats each entry as an exact host match.
311
+ */
312
+ egress: z.ZodArray<z.ZodString, "many">;
313
+ /** Present when `runtime_env: agent`. Signals the agent-runtime shape. */
314
+ profile: z.ZodOptional<z.ZodLiteral<"agent">>;
315
+ /**
316
+ * Agent-only hard caps. Enforced in-band by the wrapper script via
317
+ * llmproxy metering (Cortex only enforces the outer wall-clock via
318
+ * provider timeout).
319
+ */
320
+ budget_caps: z.ZodOptional<z.ZodObject<{
321
+ /** Max spend in USD across all LLM calls this run. */
322
+ max_tokens_usd: z.ZodOptional<z.ZodNumber>;
323
+ /** Max sub-tool invocations from inside the agent sandbox. */
324
+ max_internal_tool_calls: z.ZodOptional<z.ZodNumber>;
325
+ /** Wall-clock ceiling; usually mirrors top-level `timeout_seconds`. */
326
+ max_wall_seconds: z.ZodOptional<z.ZodNumber>;
327
+ }, "strip", z.ZodTypeAny, {
328
+ max_tokens_usd?: number | undefined;
329
+ max_internal_tool_calls?: number | undefined;
330
+ max_wall_seconds?: number | undefined;
331
+ }, {
332
+ max_tokens_usd?: number | undefined;
333
+ max_internal_tool_calls?: number | undefined;
334
+ max_wall_seconds?: number | undefined;
335
+ }>>;
336
+ }, "strip", z.ZodTypeAny, {
337
+ image: string;
338
+ memory_mb: number;
339
+ cpu: number;
340
+ timeout_seconds: number;
341
+ egress: string[];
342
+ profile?: "agent" | undefined;
343
+ budget_caps?: {
344
+ max_tokens_usd?: number | undefined;
345
+ max_internal_tool_calls?: number | undefined;
346
+ max_wall_seconds?: number | undefined;
347
+ } | undefined;
348
+ }, {
349
+ image: string;
350
+ memory_mb: number;
351
+ cpu: number;
352
+ timeout_seconds: number;
353
+ egress: string[];
354
+ profile?: "agent" | undefined;
355
+ budget_caps?: {
356
+ max_tokens_usd?: number | undefined;
357
+ max_internal_tool_calls?: number | undefined;
358
+ max_wall_seconds?: number | undefined;
359
+ } | undefined;
360
+ }>>;
118
361
  }, "strip", z.ZodTypeAny, {
119
- version: string;
120
362
  name: string;
121
363
  slug: string;
364
+ version: string;
122
365
  source: string;
123
366
  execution_layer: string;
124
367
  description?: string | undefined;
@@ -131,10 +374,23 @@ export declare const PublishRequestSchema: z.ZodObject<{
131
374
  source_url?: string | undefined;
132
375
  repository_url?: string | undefined;
133
376
  mcp_url?: string | undefined;
377
+ sandbox?: {
378
+ image: string;
379
+ memory_mb: number;
380
+ cpu: number;
381
+ timeout_seconds: number;
382
+ egress: string[];
383
+ profile?: "agent" | undefined;
384
+ budget_caps?: {
385
+ max_tokens_usd?: number | undefined;
386
+ max_internal_tool_calls?: number | undefined;
387
+ max_wall_seconds?: number | undefined;
388
+ } | undefined;
389
+ } | undefined;
134
390
  }, {
135
- version: string;
136
391
  name: string;
137
392
  slug: string;
393
+ version: string;
138
394
  source: string;
139
395
  execution_layer: string;
140
396
  description?: string | undefined;
@@ -147,6 +403,19 @@ export declare const PublishRequestSchema: z.ZodObject<{
147
403
  source_url?: string | undefined;
148
404
  repository_url?: string | undefined;
149
405
  mcp_url?: string | undefined;
406
+ sandbox?: {
407
+ image: string;
408
+ memory_mb: number;
409
+ cpu: number;
410
+ timeout_seconds: number;
411
+ egress: string[];
412
+ profile?: "agent" | undefined;
413
+ budget_caps?: {
414
+ max_tokens_usd?: number | undefined;
415
+ max_internal_tool_calls?: number | undefined;
416
+ max_wall_seconds?: number | undefined;
417
+ } | undefined;
418
+ } | undefined;
150
419
  }>;
151
420
  /** Publisher key ID that signs the manifest. Required for A/B tier. */
152
421
  publisher_key_id: z.ZodOptional<z.ZodString>;
@@ -154,9 +423,9 @@ export declare const PublishRequestSchema: z.ZodObject<{
154
423
  signature: z.ZodOptional<z.ZodString>;
155
424
  }, "strip", z.ZodTypeAny, {
156
425
  manifest: {
157
- version: string;
158
426
  name: string;
159
427
  slug: string;
428
+ version: string;
160
429
  source: string;
161
430
  execution_layer: string;
162
431
  description?: string | undefined;
@@ -169,14 +438,27 @@ export declare const PublishRequestSchema: z.ZodObject<{
169
438
  source_url?: string | undefined;
170
439
  repository_url?: string | undefined;
171
440
  mcp_url?: string | undefined;
441
+ sandbox?: {
442
+ image: string;
443
+ memory_mb: number;
444
+ cpu: number;
445
+ timeout_seconds: number;
446
+ egress: string[];
447
+ profile?: "agent" | undefined;
448
+ budget_caps?: {
449
+ max_tokens_usd?: number | undefined;
450
+ max_internal_tool_calls?: number | undefined;
451
+ max_wall_seconds?: number | undefined;
452
+ } | undefined;
453
+ } | undefined;
172
454
  };
173
455
  publisher_key_id?: string | undefined;
174
456
  signature?: string | undefined;
175
457
  }, {
176
458
  manifest: {
177
- version: string;
178
459
  name: string;
179
460
  slug: string;
461
+ version: string;
180
462
  source: string;
181
463
  execution_layer: string;
182
464
  description?: string | undefined;
@@ -189,6 +471,19 @@ export declare const PublishRequestSchema: z.ZodObject<{
189
471
  source_url?: string | undefined;
190
472
  repository_url?: string | undefined;
191
473
  mcp_url?: string | undefined;
474
+ sandbox?: {
475
+ image: string;
476
+ memory_mb: number;
477
+ cpu: number;
478
+ timeout_seconds: number;
479
+ egress: string[];
480
+ profile?: "agent" | undefined;
481
+ budget_caps?: {
482
+ max_tokens_usd?: number | undefined;
483
+ max_internal_tool_calls?: number | undefined;
484
+ max_wall_seconds?: number | undefined;
485
+ } | undefined;
486
+ } | undefined;
192
487
  };
193
488
  publisher_key_id?: string | undefined;
194
489
  signature?: string | undefined;
@@ -204,15 +499,15 @@ export declare const PublishResponseSchema: z.ZodObject<{
204
499
  url: z.ZodString;
205
500
  }, "strip", z.ZodTypeAny, {
206
501
  status: "published" | "pending_review" | "rejected";
207
- version: string;
208
502
  slug: string;
503
+ version: string;
209
504
  skill_id: string;
210
505
  published_at: string;
211
506
  url: string;
212
507
  }, {
213
508
  status: "published" | "pending_review" | "rejected";
214
- version: string;
215
509
  slug: string;
510
+ version: string;
216
511
  skill_id: string;
217
512
  published_at: string;
218
513
  url: string;
@@ -283,6 +578,161 @@ export declare const TrustScoreSyncResponseSchema: z.ZodObject<{
283
578
  }[];
284
579
  next_cursor?: string | undefined;
285
580
  }>;
581
+ export declare const SkillRevocationReasonSchema: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
582
+ export type SkillRevocationReason = z.infer<typeof SkillRevocationReasonSchema>;
583
+ export declare const SkillRevocationEventTypeSchema: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
584
+ export type SkillRevocationEventType = z.infer<typeof SkillRevocationEventTypeSchema>;
585
+ /**
586
+ * Single revocation / deprecation event. `event_id` is the idempotency key —
587
+ * consumers store the last-seen id per source to dedupe replays.
588
+ */
589
+ export declare const SkillRevocationEventSchema: z.ZodObject<{
590
+ /** Idempotency key. Consumer dedupes on (source, event_id). */
591
+ event_id: z.ZodString;
592
+ event_type: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
593
+ emitted_at: z.ZodString;
594
+ /** Mothership skill UUID. */
595
+ skill_id: z.ZodString;
596
+ /** Human-readable identifier — helpful in webhook logs. */
597
+ slug: z.ZodString;
598
+ /** Pinned version at the time of revocation (if the whole line was pulled). */
599
+ version: z.ZodOptional<z.ZodString>;
600
+ reason: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
601
+ /** Free-form operator-visible detail — never rendered to end users unsanitized. */
602
+ reason_detail: z.ZodOptional<z.ZodString>;
603
+ /** Actionable message consumers can show in remediation UI. */
604
+ remediation_message: z.ZodOptional<z.ZodString>;
605
+ remediation_url: z.ZodOptional<z.ZodString>;
606
+ /** Mothership UUID of the replacement skill, if any. */
607
+ replacement_skill_id: z.ZodOptional<z.ZodString>;
608
+ /** Slug of the replacement skill (redundant with id — safer for humans). */
609
+ replacement_slug: z.ZodOptional<z.ZodString>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ slug: string;
612
+ skill_id: string;
613
+ event_id: string;
614
+ event_type: "skill.revoked" | "skill.deprecated";
615
+ emitted_at: string;
616
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
617
+ version?: string | undefined;
618
+ reason_detail?: string | undefined;
619
+ remediation_message?: string | undefined;
620
+ remediation_url?: string | undefined;
621
+ replacement_skill_id?: string | undefined;
622
+ replacement_slug?: string | undefined;
623
+ }, {
624
+ slug: string;
625
+ skill_id: string;
626
+ event_id: string;
627
+ event_type: "skill.revoked" | "skill.deprecated";
628
+ emitted_at: string;
629
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
630
+ version?: string | undefined;
631
+ reason_detail?: string | undefined;
632
+ remediation_message?: string | undefined;
633
+ remediation_url?: string | undefined;
634
+ replacement_skill_id?: string | undefined;
635
+ replacement_slug?: string | undefined;
636
+ }>;
637
+ export type SkillRevocationEvent = z.infer<typeof SkillRevocationEventSchema>;
638
+ /**
639
+ * Response for `GET /v1/sync/revocations?since=<ISO>`. Mirrors the shape of
640
+ * `TrustScoreSyncResponse` so consumers can share a delta-pull scaffold.
641
+ */
642
+ export declare const SkillRevocationSyncResponseSchema: z.ZodObject<{
643
+ since: z.ZodString;
644
+ until: z.ZodString;
645
+ count: z.ZodNumber;
646
+ events: z.ZodArray<z.ZodObject<{
647
+ /** Idempotency key. Consumer dedupes on (source, event_id). */
648
+ event_id: z.ZodString;
649
+ event_type: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
650
+ emitted_at: z.ZodString;
651
+ /** Mothership skill UUID. */
652
+ skill_id: z.ZodString;
653
+ /** Human-readable identifier — helpful in webhook logs. */
654
+ slug: z.ZodString;
655
+ /** Pinned version at the time of revocation (if the whole line was pulled). */
656
+ version: z.ZodOptional<z.ZodString>;
657
+ reason: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
658
+ /** Free-form operator-visible detail — never rendered to end users unsanitized. */
659
+ reason_detail: z.ZodOptional<z.ZodString>;
660
+ /** Actionable message consumers can show in remediation UI. */
661
+ remediation_message: z.ZodOptional<z.ZodString>;
662
+ remediation_url: z.ZodOptional<z.ZodString>;
663
+ /** Mothership UUID of the replacement skill, if any. */
664
+ replacement_skill_id: z.ZodOptional<z.ZodString>;
665
+ /** Slug of the replacement skill (redundant with id — safer for humans). */
666
+ replacement_slug: z.ZodOptional<z.ZodString>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ slug: string;
669
+ skill_id: string;
670
+ event_id: string;
671
+ event_type: "skill.revoked" | "skill.deprecated";
672
+ emitted_at: string;
673
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
674
+ version?: string | undefined;
675
+ reason_detail?: string | undefined;
676
+ remediation_message?: string | undefined;
677
+ remediation_url?: string | undefined;
678
+ replacement_skill_id?: string | undefined;
679
+ replacement_slug?: string | undefined;
680
+ }, {
681
+ slug: string;
682
+ skill_id: string;
683
+ event_id: string;
684
+ event_type: "skill.revoked" | "skill.deprecated";
685
+ emitted_at: string;
686
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
687
+ version?: string | undefined;
688
+ reason_detail?: string | undefined;
689
+ remediation_message?: string | undefined;
690
+ remediation_url?: string | undefined;
691
+ replacement_skill_id?: string | undefined;
692
+ replacement_slug?: string | undefined;
693
+ }>, "many">;
694
+ /** Cursor for pagination. When present, re-request with `since=<next_cursor>`. */
695
+ next_cursor: z.ZodOptional<z.ZodString>;
696
+ }, "strip", z.ZodTypeAny, {
697
+ count: number;
698
+ since: string;
699
+ until: string;
700
+ events: {
701
+ slug: string;
702
+ skill_id: string;
703
+ event_id: string;
704
+ event_type: "skill.revoked" | "skill.deprecated";
705
+ emitted_at: string;
706
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
707
+ version?: string | undefined;
708
+ reason_detail?: string | undefined;
709
+ remediation_message?: string | undefined;
710
+ remediation_url?: string | undefined;
711
+ replacement_skill_id?: string | undefined;
712
+ replacement_slug?: string | undefined;
713
+ }[];
714
+ next_cursor?: string | undefined;
715
+ }, {
716
+ count: number;
717
+ since: string;
718
+ until: string;
719
+ events: {
720
+ slug: string;
721
+ skill_id: string;
722
+ event_id: string;
723
+ event_type: "skill.revoked" | "skill.deprecated";
724
+ emitted_at: string;
725
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
726
+ version?: string | undefined;
727
+ reason_detail?: string | undefined;
728
+ remediation_message?: string | undefined;
729
+ remediation_url?: string | undefined;
730
+ replacement_skill_id?: string | undefined;
731
+ replacement_slug?: string | undefined;
732
+ }[];
733
+ next_cursor?: string | undefined;
734
+ }>;
735
+ export type SkillRevocationSyncResponse = z.infer<typeof SkillRevocationSyncResponseSchema>;
286
736
  export type TrustScoreSyncResponse = z.infer<typeof TrustScoreSyncResponseSchema>;
287
737
  /**
288
738
  * Every upstream failure maps to one of these codes. Consumers can pattern-
@@ -301,23 +751,29 @@ export type TrustScoreSyncResponse = z.infer<typeof TrustScoreSyncResponseSchema
301
751
  * - `bad_request` — schema validation failed at mothership.
302
752
  * - `upstream_unavailable` — network / 5xx / circuit-breaker open.
303
753
  * - `upstream_timeout` — request exceeded configured timeout.
754
+ * - `sandbox_contract_violated` — L3 sandbox exited with code 90
755
+ * (skill-convention §9.2) — wrong image /
756
+ * wrong provider default / preflight failed
757
+ * (`git`/`bash`/`ca-certificates` missing).
758
+ * Distinct from generic exec failure so
759
+ * operators see a named actionable cause.
304
760
  */
305
- export type UpstreamErrorCode = 'upstream_not_configured' | 'budget_exhausted' | 'unauthenticated' | 'forbidden' | 'not_found' | 'rate_limited' | 'bad_request' | 'upstream_unavailable' | 'upstream_timeout';
761
+ export type UpstreamErrorCode = 'upstream_not_configured' | 'budget_exhausted' | 'unauthenticated' | 'forbidden' | 'not_found' | 'rate_limited' | 'bad_request' | 'upstream_unavailable' | 'upstream_timeout' | 'sandbox_contract_violated';
306
762
  export declare const UpstreamErrorSchema: z.ZodObject<{
307
763
  error: z.ZodObject<{
308
- code: z.ZodEnum<["upstream_not_configured", "budget_exhausted", "unauthenticated", "forbidden", "not_found", "rate_limited", "bad_request", "upstream_unavailable", "upstream_timeout"]>;
764
+ code: z.ZodEnum<["upstream_not_configured", "budget_exhausted", "unauthenticated", "forbidden", "not_found", "rate_limited", "bad_request", "upstream_unavailable", "upstream_timeout", "sandbox_contract_violated"]>;
309
765
  message: z.ZodString;
310
766
  /** Seconds until the caller may safely retry. Absent for permanent errors. */
311
767
  retry_after: z.ZodOptional<z.ZodNumber>;
312
768
  /** Optional structured detail (upstream field errors, etc.). */
313
769
  detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
314
770
  }, "strip", z.ZodTypeAny, {
315
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
771
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
316
772
  message: string;
317
773
  retry_after?: number | undefined;
318
774
  detail?: Record<string, unknown> | undefined;
319
775
  }, {
320
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
776
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
321
777
  message: string;
322
778
  retry_after?: number | undefined;
323
779
  detail?: Record<string, unknown> | undefined;
@@ -326,7 +782,7 @@ export declare const UpstreamErrorSchema: z.ZodObject<{
326
782
  request_id: z.ZodOptional<z.ZodString>;
327
783
  }, "strip", z.ZodTypeAny, {
328
784
  error: {
329
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
785
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
330
786
  message: string;
331
787
  retry_after?: number | undefined;
332
788
  detail?: Record<string, unknown> | undefined;
@@ -334,7 +790,7 @@ export declare const UpstreamErrorSchema: z.ZodObject<{
334
790
  request_id?: string | undefined;
335
791
  }, {
336
792
  error: {
337
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
793
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
338
794
  message: string;
339
795
  retry_after?: number | undefined;
340
796
  detail?: Record<string, unknown> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"upstream.d.ts","sourceRoot":"","sources":["../src/upstream.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB;IAClC,8EAA8E;;IAE9E;;;OAGG;;;;;;;;;;;;;;;;;;;;IAUH,0EAA0E;;;;;;;;;;;;;;;;;;;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