@skillsregistry/contracts 1.0.1 → 1.1.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,82 @@
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 `min_trust` / `allow_vulnerable`
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
+ export declare const SkillVisibilitySchema: z.ZodEnum<["public", "private", "tenant_private", "tenant_internal", "unlisted"]>;
15
+ export type SkillVisibility = z.infer<typeof SkillVisibilitySchema>;
16
+ /**
17
+ * Search request per cortex.md §6.2:
18
+ *
19
+ * POST /v1/search { query, appetite, minTrust, allowVulnerable, tenantId, limit }
20
+ *
21
+ * Fields beyond the cortex minimum (`tags`, `category`, `runtime_env`,
22
+ * `visibility`, `portable`) are the local node's search superset — the
23
+ * mothership treats them as optional filters when set.
24
+ *
25
+ * Wire naming is snake_case for parity with the rest of the upstream API
26
+ * (TrustScoreRequest, BudgetResponse, PublishRequest). Consumers using the
27
+ * domain `FindSkillRequest` (camelCase) map at the route boundary.
28
+ */
29
+ export declare const SearchRequestSchema: z.ZodObject<{
30
+ /** Free-text query. Required, non-empty. */
31
+ query: z.ZodString;
32
+ /** Advisory tenant scope. */
33
+ tenant_id: z.ZodOptional<z.ZodString>;
34
+ /** Risk appetite → default trust floor + allowVulnerable default. */
35
+ appetite: z.ZodOptional<z.ZodEnum<["strict", "cautious", "balanced", "adventurous"]>>;
36
+ /**
37
+ * Hard trust-score floor (0..1). Overrides `appetite` when set.
38
+ * Cortex sends this to gate before the confidence tier is even assessed.
39
+ */
40
+ min_trust: z.ZodOptional<z.ZodNumber>;
41
+ /**
42
+ * Allow skills tagged vulnerable / contains-vulnerable through the filter.
43
+ * Overrides the appetite-derived default when set.
44
+ */
45
+ allow_vulnerable: z.ZodOptional<z.ZodBoolean>;
46
+ /** Result cap (1..50). Default 10 at the domain layer. */
47
+ limit: z.ZodOptional<z.ZodNumber>;
48
+ /** Local-superset filters — mothership treats as optional. */
49
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
+ category: z.ZodOptional<z.ZodString>;
51
+ runtime_env: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
52
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private", "tenant_private", "tenant_internal", "unlisted"]>>;
53
+ portable: z.ZodOptional<z.ZodBoolean>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ query: string;
56
+ tenant_id?: string | undefined;
57
+ appetite?: "strict" | "cautious" | "balanced" | "adventurous" | undefined;
58
+ min_trust?: number | undefined;
59
+ allow_vulnerable?: boolean | undefined;
60
+ limit?: number | undefined;
61
+ tags?: string[] | undefined;
62
+ category?: string | undefined;
63
+ runtime_env?: string[] | undefined;
64
+ visibility?: "public" | "private" | "tenant_private" | "tenant_internal" | "unlisted" | undefined;
65
+ portable?: boolean | undefined;
66
+ }, {
67
+ query: string;
68
+ tenant_id?: string | undefined;
69
+ appetite?: "strict" | "cautious" | "balanced" | "adventurous" | undefined;
70
+ min_trust?: number | undefined;
71
+ allow_vulnerable?: boolean | undefined;
72
+ limit?: number | undefined;
73
+ tags?: string[] | undefined;
74
+ category?: string | undefined;
75
+ runtime_env?: string[] | undefined;
76
+ visibility?: "public" | "private" | "tenant_private" | "tenant_internal" | "unlisted" | undefined;
77
+ portable?: boolean | undefined;
78
+ }>;
79
+ export type SearchRequest = z.infer<typeof SearchRequestSchema>;
2
80
  export declare const TrustScoreRequestSchema: z.ZodObject<{
3
81
  /** Skill identifier — either the mothership UUID or the local node's slug. */
4
82
  skill_id: z.ZodString;
@@ -13,14 +91,14 @@ export declare const TrustScoreRequestSchema: z.ZodObject<{
13
91
  description: z.ZodOptional<z.ZodString>;
14
92
  skill_md: z.ZodOptional<z.ZodString>;
15
93
  }, "strip", z.ZodTypeAny, {
16
- version: string;
17
94
  name: string;
95
+ version: string;
18
96
  source: string;
19
97
  description?: string | undefined;
20
98
  skill_md?: string | undefined;
21
99
  }, {
22
- version: string;
23
100
  name: string;
101
+ version: string;
24
102
  source: string;
25
103
  description?: string | undefined;
26
104
  skill_md?: string | undefined;
@@ -29,24 +107,24 @@ export declare const TrustScoreRequestSchema: z.ZodObject<{
29
107
  tenant_id: z.ZodOptional<z.ZodString>;
30
108
  }, "strip", z.ZodTypeAny, {
31
109
  skill_id: string;
110
+ tenant_id?: string | undefined;
32
111
  manifest?: {
33
- version: string;
34
112
  name: string;
113
+ version: string;
35
114
  source: string;
36
115
  description?: string | undefined;
37
116
  skill_md?: string | undefined;
38
117
  } | undefined;
39
- tenant_id?: string | undefined;
40
118
  }, {
41
119
  skill_id: string;
120
+ tenant_id?: string | undefined;
42
121
  manifest?: {
43
- version: string;
44
122
  name: string;
123
+ version: string;
45
124
  source: string;
46
125
  description?: string | undefined;
47
126
  skill_md?: string | undefined;
48
127
  } | undefined;
49
- tenant_id?: string | undefined;
50
128
  }>;
51
129
  export type TrustScoreRequest = z.infer<typeof TrustScoreRequestSchema>;
52
130
  export declare const TrustScoreResponseSchema: z.ZodObject<{
@@ -97,6 +175,91 @@ export declare const BudgetResponseSchema: z.ZodObject<{
97
175
  low_balance: boolean;
98
176
  }>;
99
177
  export type BudgetResponse = z.infer<typeof BudgetResponseSchema>;
178
+ /**
179
+ * Sandbox contract per `skill-convention.md` v1.3 §9. The runtime (Cortex L3,
180
+ * on any Sandbox-seam adapter — Daytona / Novita / E2B) reads these fields
181
+ * verbatim to provision the execution environment. Applies to any skill with
182
+ * a sandbox surface (`runtime_env` ∈ {vm, agent} today; `api` may declare
183
+ * one if it spawns a subprocess).
184
+ *
185
+ * `image` is the OCI ref — the portability anchor (§9.1). The image family
186
+ * (`skill-base`, `skill-java`, `cognium-scan-base`, `agent-base`) is derived
187
+ * by prefix-matching the ref; not enforced here so the Lane 0 rollout can
188
+ * ship unbuilt images without tripping ingest.
189
+ *
190
+ * `egress` is a default-deny allow-list of hostnames (§9.3). Every host the
191
+ * skill contacts — clone targets, package mirrors, MCP endpoints — must be
192
+ * listed or the sandbox will block the connection.
193
+ *
194
+ * `profile: 'agent'` + `budget_caps` are the agent-runtime extension
195
+ * (§14.2). `budget_caps` are hard caps enforced in-band by the agent skill's
196
+ * wrapper script through llmproxy session metering — the caller cannot rely
197
+ * on Cortex enforcing them at the outer boundary.
198
+ */
199
+ export declare const SkillSandboxSchema: z.ZodObject<{
200
+ /** OCI ref, e.g. `ghcr.io/cognium-labs/skill-base:1.0.0`. */
201
+ image: z.ZodString;
202
+ /** Memory allocation in MB. Base default 512 (vm) / 2048 (agent). */
203
+ memory_mb: z.ZodNumber;
204
+ /** vCPU count. Base default 2 (vm) / 4 (agent). */
205
+ cpu: z.ZodNumber;
206
+ /** Wall-clock ceiling in seconds. Base default 300 (vm) / 7200 (agent). */
207
+ timeout_seconds: z.ZodNumber;
208
+ /**
209
+ * Default-deny egress allow-list of hostnames. Empty array = no outbound
210
+ * network from the sandbox. Wildcards are NOT interpreted here — the
211
+ * runtime treats each entry as an exact host match.
212
+ */
213
+ egress: z.ZodArray<z.ZodString, "many">;
214
+ /** Present when `runtime_env: agent`. Signals the agent-runtime shape. */
215
+ profile: z.ZodOptional<z.ZodLiteral<"agent">>;
216
+ /**
217
+ * Agent-only hard caps. Enforced in-band by the wrapper script via
218
+ * llmproxy metering (Cortex only enforces the outer wall-clock via
219
+ * provider timeout).
220
+ */
221
+ budget_caps: z.ZodOptional<z.ZodObject<{
222
+ /** Max spend in USD across all LLM calls this run. */
223
+ max_tokens_usd: z.ZodOptional<z.ZodNumber>;
224
+ /** Max sub-tool invocations from inside the agent sandbox. */
225
+ max_internal_tool_calls: z.ZodOptional<z.ZodNumber>;
226
+ /** Wall-clock ceiling; usually mirrors top-level `timeout_seconds`. */
227
+ max_wall_seconds: z.ZodOptional<z.ZodNumber>;
228
+ }, "strip", z.ZodTypeAny, {
229
+ max_tokens_usd?: number | undefined;
230
+ max_internal_tool_calls?: number | undefined;
231
+ max_wall_seconds?: number | undefined;
232
+ }, {
233
+ max_tokens_usd?: number | undefined;
234
+ max_internal_tool_calls?: number | undefined;
235
+ max_wall_seconds?: number | undefined;
236
+ }>>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ image: string;
239
+ memory_mb: number;
240
+ cpu: number;
241
+ timeout_seconds: number;
242
+ egress: string[];
243
+ profile?: "agent" | undefined;
244
+ budget_caps?: {
245
+ max_tokens_usd?: number | undefined;
246
+ max_internal_tool_calls?: number | undefined;
247
+ max_wall_seconds?: number | undefined;
248
+ } | undefined;
249
+ }, {
250
+ image: string;
251
+ memory_mb: number;
252
+ cpu: number;
253
+ timeout_seconds: number;
254
+ egress: string[];
255
+ profile?: "agent" | undefined;
256
+ budget_caps?: {
257
+ max_tokens_usd?: number | undefined;
258
+ max_internal_tool_calls?: number | undefined;
259
+ max_wall_seconds?: number | undefined;
260
+ } | undefined;
261
+ }>;
262
+ export type SkillSandbox = z.infer<typeof SkillSandboxSchema>;
100
263
  export declare const PublishRequestSchema: z.ZodObject<{
101
264
  /** Skill manifest to promote from local to global registry. */
102
265
  manifest: z.ZodObject<{
@@ -115,11 +278,80 @@ export declare const PublishRequestSchema: z.ZodObject<{
115
278
  source_url: z.ZodOptional<z.ZodString>;
116
279
  repository_url: z.ZodOptional<z.ZodString>;
117
280
  mcp_url: z.ZodOptional<z.ZodString>;
281
+ /**
282
+ * Sandbox contract per skill-convention v1.3 §9. Required in practice
283
+ * for runtime_env ∈ {vm, agent} (Cortex L3 dispatch reads it directly);
284
+ * kept optional at the schema level so pre-v1.3 rows / api+llm skills
285
+ * don't need to carry it.
286
+ */
287
+ sandbox: z.ZodOptional<z.ZodObject<{
288
+ /** OCI ref, e.g. `ghcr.io/cognium-labs/skill-base:1.0.0`. */
289
+ image: z.ZodString;
290
+ /** Memory allocation in MB. Base default 512 (vm) / 2048 (agent). */
291
+ memory_mb: z.ZodNumber;
292
+ /** vCPU count. Base default 2 (vm) / 4 (agent). */
293
+ cpu: z.ZodNumber;
294
+ /** Wall-clock ceiling in seconds. Base default 300 (vm) / 7200 (agent). */
295
+ timeout_seconds: z.ZodNumber;
296
+ /**
297
+ * Default-deny egress allow-list of hostnames. Empty array = no outbound
298
+ * network from the sandbox. Wildcards are NOT interpreted here — the
299
+ * runtime treats each entry as an exact host match.
300
+ */
301
+ egress: z.ZodArray<z.ZodString, "many">;
302
+ /** Present when `runtime_env: agent`. Signals the agent-runtime shape. */
303
+ profile: z.ZodOptional<z.ZodLiteral<"agent">>;
304
+ /**
305
+ * Agent-only hard caps. Enforced in-band by the wrapper script via
306
+ * llmproxy metering (Cortex only enforces the outer wall-clock via
307
+ * provider timeout).
308
+ */
309
+ budget_caps: z.ZodOptional<z.ZodObject<{
310
+ /** Max spend in USD across all LLM calls this run. */
311
+ max_tokens_usd: z.ZodOptional<z.ZodNumber>;
312
+ /** Max sub-tool invocations from inside the agent sandbox. */
313
+ max_internal_tool_calls: z.ZodOptional<z.ZodNumber>;
314
+ /** Wall-clock ceiling; usually mirrors top-level `timeout_seconds`. */
315
+ max_wall_seconds: z.ZodOptional<z.ZodNumber>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ max_tokens_usd?: number | undefined;
318
+ max_internal_tool_calls?: number | undefined;
319
+ max_wall_seconds?: number | undefined;
320
+ }, {
321
+ max_tokens_usd?: number | undefined;
322
+ max_internal_tool_calls?: number | undefined;
323
+ max_wall_seconds?: number | undefined;
324
+ }>>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ image: string;
327
+ memory_mb: number;
328
+ cpu: number;
329
+ timeout_seconds: number;
330
+ egress: string[];
331
+ profile?: "agent" | undefined;
332
+ budget_caps?: {
333
+ max_tokens_usd?: number | undefined;
334
+ max_internal_tool_calls?: number | undefined;
335
+ max_wall_seconds?: number | undefined;
336
+ } | undefined;
337
+ }, {
338
+ image: string;
339
+ memory_mb: number;
340
+ cpu: number;
341
+ timeout_seconds: number;
342
+ egress: string[];
343
+ profile?: "agent" | undefined;
344
+ budget_caps?: {
345
+ max_tokens_usd?: number | undefined;
346
+ max_internal_tool_calls?: number | undefined;
347
+ max_wall_seconds?: number | undefined;
348
+ } | undefined;
349
+ }>>;
118
350
  }, "strip", z.ZodTypeAny, {
119
- version: string;
120
351
  name: string;
121
- slug: string;
352
+ version: string;
122
353
  source: string;
354
+ slug: string;
123
355
  execution_layer: string;
124
356
  description?: string | undefined;
125
357
  tags?: string[] | undefined;
@@ -131,11 +363,24 @@ export declare const PublishRequestSchema: z.ZodObject<{
131
363
  source_url?: string | undefined;
132
364
  repository_url?: string | undefined;
133
365
  mcp_url?: string | undefined;
366
+ sandbox?: {
367
+ image: string;
368
+ memory_mb: number;
369
+ cpu: number;
370
+ timeout_seconds: number;
371
+ egress: string[];
372
+ profile?: "agent" | undefined;
373
+ budget_caps?: {
374
+ max_tokens_usd?: number | undefined;
375
+ max_internal_tool_calls?: number | undefined;
376
+ max_wall_seconds?: number | undefined;
377
+ } | undefined;
378
+ } | undefined;
134
379
  }, {
135
- version: string;
136
380
  name: string;
137
- slug: string;
381
+ version: string;
138
382
  source: string;
383
+ slug: string;
139
384
  execution_layer: string;
140
385
  description?: string | undefined;
141
386
  tags?: string[] | undefined;
@@ -147,6 +392,19 @@ export declare const PublishRequestSchema: z.ZodObject<{
147
392
  source_url?: string | undefined;
148
393
  repository_url?: string | undefined;
149
394
  mcp_url?: string | undefined;
395
+ sandbox?: {
396
+ image: string;
397
+ memory_mb: number;
398
+ cpu: number;
399
+ timeout_seconds: number;
400
+ egress: string[];
401
+ profile?: "agent" | undefined;
402
+ budget_caps?: {
403
+ max_tokens_usd?: number | undefined;
404
+ max_internal_tool_calls?: number | undefined;
405
+ max_wall_seconds?: number | undefined;
406
+ } | undefined;
407
+ } | undefined;
150
408
  }>;
151
409
  /** Publisher key ID that signs the manifest. Required for A/B tier. */
152
410
  publisher_key_id: z.ZodOptional<z.ZodString>;
@@ -154,10 +412,10 @@ export declare const PublishRequestSchema: z.ZodObject<{
154
412
  signature: z.ZodOptional<z.ZodString>;
155
413
  }, "strip", z.ZodTypeAny, {
156
414
  manifest: {
157
- version: string;
158
415
  name: string;
159
- slug: string;
416
+ version: string;
160
417
  source: string;
418
+ slug: string;
161
419
  execution_layer: string;
162
420
  description?: string | undefined;
163
421
  tags?: string[] | undefined;
@@ -169,15 +427,28 @@ export declare const PublishRequestSchema: z.ZodObject<{
169
427
  source_url?: string | undefined;
170
428
  repository_url?: string | undefined;
171
429
  mcp_url?: string | undefined;
430
+ sandbox?: {
431
+ image: string;
432
+ memory_mb: number;
433
+ cpu: number;
434
+ timeout_seconds: number;
435
+ egress: string[];
436
+ profile?: "agent" | undefined;
437
+ budget_caps?: {
438
+ max_tokens_usd?: number | undefined;
439
+ max_internal_tool_calls?: number | undefined;
440
+ max_wall_seconds?: number | undefined;
441
+ } | undefined;
442
+ } | undefined;
172
443
  };
173
444
  publisher_key_id?: string | undefined;
174
445
  signature?: string | undefined;
175
446
  }, {
176
447
  manifest: {
177
- version: string;
178
448
  name: string;
179
- slug: string;
449
+ version: string;
180
450
  source: string;
451
+ slug: string;
181
452
  execution_layer: string;
182
453
  description?: string | undefined;
183
454
  tags?: string[] | undefined;
@@ -189,6 +460,19 @@ export declare const PublishRequestSchema: z.ZodObject<{
189
460
  source_url?: string | undefined;
190
461
  repository_url?: string | undefined;
191
462
  mcp_url?: string | undefined;
463
+ sandbox?: {
464
+ image: string;
465
+ memory_mb: number;
466
+ cpu: number;
467
+ timeout_seconds: number;
468
+ egress: string[];
469
+ profile?: "agent" | undefined;
470
+ budget_caps?: {
471
+ max_tokens_usd?: number | undefined;
472
+ max_internal_tool_calls?: number | undefined;
473
+ max_wall_seconds?: number | undefined;
474
+ } | undefined;
475
+ } | undefined;
192
476
  };
193
477
  publisher_key_id?: string | undefined;
194
478
  signature?: string | undefined;
@@ -204,16 +488,16 @@ export declare const PublishResponseSchema: z.ZodObject<{
204
488
  url: z.ZodString;
205
489
  }, "strip", z.ZodTypeAny, {
206
490
  status: "published" | "pending_review" | "rejected";
491
+ skill_id: string;
207
492
  version: string;
208
493
  slug: string;
209
- skill_id: string;
210
494
  published_at: string;
211
495
  url: string;
212
496
  }, {
213
497
  status: "published" | "pending_review" | "rejected";
498
+ skill_id: string;
214
499
  version: string;
215
500
  slug: string;
216
- skill_id: string;
217
501
  published_at: string;
218
502
  url: string;
219
503
  }>;
@@ -261,9 +545,9 @@ export declare const TrustScoreSyncResponseSchema: z.ZodObject<{
261
545
  */
262
546
  next_cursor: z.ZodOptional<z.ZodString>;
263
547
  }, "strip", z.ZodTypeAny, {
264
- count: number;
265
548
  since: string;
266
549
  until: string;
550
+ count: number;
267
551
  deltas: {
268
552
  skill_id: string;
269
553
  trust_score: number;
@@ -272,9 +556,9 @@ export declare const TrustScoreSyncResponseSchema: z.ZodObject<{
272
556
  }[];
273
557
  next_cursor?: string | undefined;
274
558
  }, {
275
- count: number;
276
559
  since: string;
277
560
  until: string;
561
+ count: number;
278
562
  deltas: {
279
563
  skill_id: string;
280
564
  trust_score: number;
@@ -283,6 +567,161 @@ export declare const TrustScoreSyncResponseSchema: z.ZodObject<{
283
567
  }[];
284
568
  next_cursor?: string | undefined;
285
569
  }>;
570
+ export declare const SkillRevocationReasonSchema: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
571
+ export type SkillRevocationReason = z.infer<typeof SkillRevocationReasonSchema>;
572
+ export declare const SkillRevocationEventTypeSchema: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
573
+ export type SkillRevocationEventType = z.infer<typeof SkillRevocationEventTypeSchema>;
574
+ /**
575
+ * Single revocation / deprecation event. `event_id` is the idempotency key —
576
+ * consumers store the last-seen id per source to dedupe replays.
577
+ */
578
+ export declare const SkillRevocationEventSchema: z.ZodObject<{
579
+ /** Idempotency key. Consumer dedupes on (source, event_id). */
580
+ event_id: z.ZodString;
581
+ event_type: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
582
+ emitted_at: z.ZodString;
583
+ /** Mothership skill UUID. */
584
+ skill_id: z.ZodString;
585
+ /** Human-readable identifier — helpful in webhook logs. */
586
+ slug: z.ZodString;
587
+ /** Pinned version at the time of revocation (if the whole line was pulled). */
588
+ version: z.ZodOptional<z.ZodString>;
589
+ reason: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
590
+ /** Free-form operator-visible detail — never rendered to end users unsanitized. */
591
+ reason_detail: z.ZodOptional<z.ZodString>;
592
+ /** Actionable message consumers can show in remediation UI. */
593
+ remediation_message: z.ZodOptional<z.ZodString>;
594
+ remediation_url: z.ZodOptional<z.ZodString>;
595
+ /** Mothership UUID of the replacement skill, if any. */
596
+ replacement_skill_id: z.ZodOptional<z.ZodString>;
597
+ /** Slug of the replacement skill (redundant with id — safer for humans). */
598
+ replacement_slug: z.ZodOptional<z.ZodString>;
599
+ }, "strip", z.ZodTypeAny, {
600
+ skill_id: string;
601
+ slug: string;
602
+ event_id: string;
603
+ event_type: "skill.revoked" | "skill.deprecated";
604
+ emitted_at: string;
605
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
606
+ version?: string | undefined;
607
+ reason_detail?: string | undefined;
608
+ remediation_message?: string | undefined;
609
+ remediation_url?: string | undefined;
610
+ replacement_skill_id?: string | undefined;
611
+ replacement_slug?: string | undefined;
612
+ }, {
613
+ skill_id: string;
614
+ slug: string;
615
+ event_id: string;
616
+ event_type: "skill.revoked" | "skill.deprecated";
617
+ emitted_at: string;
618
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
619
+ version?: string | undefined;
620
+ reason_detail?: string | undefined;
621
+ remediation_message?: string | undefined;
622
+ remediation_url?: string | undefined;
623
+ replacement_skill_id?: string | undefined;
624
+ replacement_slug?: string | undefined;
625
+ }>;
626
+ export type SkillRevocationEvent = z.infer<typeof SkillRevocationEventSchema>;
627
+ /**
628
+ * Response for `GET /v1/sync/revocations?since=<ISO>`. Mirrors the shape of
629
+ * `TrustScoreSyncResponse` so consumers can share a delta-pull scaffold.
630
+ */
631
+ export declare const SkillRevocationSyncResponseSchema: z.ZodObject<{
632
+ since: z.ZodString;
633
+ until: z.ZodString;
634
+ count: z.ZodNumber;
635
+ events: z.ZodArray<z.ZodObject<{
636
+ /** Idempotency key. Consumer dedupes on (source, event_id). */
637
+ event_id: z.ZodString;
638
+ event_type: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
639
+ emitted_at: z.ZodString;
640
+ /** Mothership skill UUID. */
641
+ skill_id: z.ZodString;
642
+ /** Human-readable identifier — helpful in webhook logs. */
643
+ slug: z.ZodString;
644
+ /** Pinned version at the time of revocation (if the whole line was pulled). */
645
+ version: z.ZodOptional<z.ZodString>;
646
+ reason: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
647
+ /** Free-form operator-visible detail — never rendered to end users unsanitized. */
648
+ reason_detail: z.ZodOptional<z.ZodString>;
649
+ /** Actionable message consumers can show in remediation UI. */
650
+ remediation_message: z.ZodOptional<z.ZodString>;
651
+ remediation_url: z.ZodOptional<z.ZodString>;
652
+ /** Mothership UUID of the replacement skill, if any. */
653
+ replacement_skill_id: z.ZodOptional<z.ZodString>;
654
+ /** Slug of the replacement skill (redundant with id — safer for humans). */
655
+ replacement_slug: z.ZodOptional<z.ZodString>;
656
+ }, "strip", z.ZodTypeAny, {
657
+ skill_id: string;
658
+ slug: string;
659
+ event_id: string;
660
+ event_type: "skill.revoked" | "skill.deprecated";
661
+ emitted_at: string;
662
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
663
+ version?: string | undefined;
664
+ reason_detail?: string | undefined;
665
+ remediation_message?: string | undefined;
666
+ remediation_url?: string | undefined;
667
+ replacement_skill_id?: string | undefined;
668
+ replacement_slug?: string | undefined;
669
+ }, {
670
+ skill_id: string;
671
+ slug: string;
672
+ event_id: string;
673
+ event_type: "skill.revoked" | "skill.deprecated";
674
+ emitted_at: string;
675
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
676
+ version?: string | undefined;
677
+ reason_detail?: string | undefined;
678
+ remediation_message?: string | undefined;
679
+ remediation_url?: string | undefined;
680
+ replacement_skill_id?: string | undefined;
681
+ replacement_slug?: string | undefined;
682
+ }>, "many">;
683
+ /** Cursor for pagination. When present, re-request with `since=<next_cursor>`. */
684
+ next_cursor: z.ZodOptional<z.ZodString>;
685
+ }, "strip", z.ZodTypeAny, {
686
+ since: string;
687
+ until: string;
688
+ count: number;
689
+ events: {
690
+ skill_id: string;
691
+ slug: string;
692
+ event_id: string;
693
+ event_type: "skill.revoked" | "skill.deprecated";
694
+ emitted_at: string;
695
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
696
+ version?: string | undefined;
697
+ reason_detail?: string | undefined;
698
+ remediation_message?: string | undefined;
699
+ remediation_url?: string | undefined;
700
+ replacement_skill_id?: string | undefined;
701
+ replacement_slug?: string | undefined;
702
+ }[];
703
+ next_cursor?: string | undefined;
704
+ }, {
705
+ since: string;
706
+ until: string;
707
+ count: number;
708
+ events: {
709
+ skill_id: string;
710
+ slug: string;
711
+ event_id: string;
712
+ event_type: "skill.revoked" | "skill.deprecated";
713
+ emitted_at: string;
714
+ reason: "unknown" | "security" | "compliance" | "policy" | "quality" | "author_request" | "superseded";
715
+ version?: string | undefined;
716
+ reason_detail?: string | undefined;
717
+ remediation_message?: string | undefined;
718
+ remediation_url?: string | undefined;
719
+ replacement_skill_id?: string | undefined;
720
+ replacement_slug?: string | undefined;
721
+ }[];
722
+ next_cursor?: string | undefined;
723
+ }>;
724
+ export type SkillRevocationSyncResponse = z.infer<typeof SkillRevocationSyncResponseSchema>;
286
725
  export type TrustScoreSyncResponse = z.infer<typeof TrustScoreSyncResponseSchema>;
287
726
  /**
288
727
  * Every upstream failure maps to one of these codes. Consumers can pattern-
@@ -301,23 +740,29 @@ export type TrustScoreSyncResponse = z.infer<typeof TrustScoreSyncResponseSchema
301
740
  * - `bad_request` — schema validation failed at mothership.
302
741
  * - `upstream_unavailable` — network / 5xx / circuit-breaker open.
303
742
  * - `upstream_timeout` — request exceeded configured timeout.
743
+ * - `sandbox_contract_violated` — L3 sandbox exited with code 90
744
+ * (skill-convention §9.2) — wrong image /
745
+ * wrong provider default / preflight failed
746
+ * (`git`/`bash`/`ca-certificates` missing).
747
+ * Distinct from generic exec failure so
748
+ * operators see a named actionable cause.
304
749
  */
305
- export type UpstreamErrorCode = 'upstream_not_configured' | 'budget_exhausted' | 'unauthenticated' | 'forbidden' | 'not_found' | 'rate_limited' | 'bad_request' | 'upstream_unavailable' | 'upstream_timeout';
750
+ export type UpstreamErrorCode = 'upstream_not_configured' | 'budget_exhausted' | 'unauthenticated' | 'forbidden' | 'not_found' | 'rate_limited' | 'bad_request' | 'upstream_unavailable' | 'upstream_timeout' | 'sandbox_contract_violated';
306
751
  export declare const UpstreamErrorSchema: z.ZodObject<{
307
752
  error: z.ZodObject<{
308
- code: z.ZodEnum<["upstream_not_configured", "budget_exhausted", "unauthenticated", "forbidden", "not_found", "rate_limited", "bad_request", "upstream_unavailable", "upstream_timeout"]>;
753
+ code: z.ZodEnum<["upstream_not_configured", "budget_exhausted", "unauthenticated", "forbidden", "not_found", "rate_limited", "bad_request", "upstream_unavailable", "upstream_timeout", "sandbox_contract_violated"]>;
309
754
  message: z.ZodString;
310
755
  /** Seconds until the caller may safely retry. Absent for permanent errors. */
311
756
  retry_after: z.ZodOptional<z.ZodNumber>;
312
757
  /** Optional structured detail (upstream field errors, etc.). */
313
758
  detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
314
759
  }, "strip", z.ZodTypeAny, {
315
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
760
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
316
761
  message: string;
317
762
  retry_after?: number | undefined;
318
763
  detail?: Record<string, unknown> | undefined;
319
764
  }, {
320
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
765
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
321
766
  message: string;
322
767
  retry_after?: number | undefined;
323
768
  detail?: Record<string, unknown> | undefined;
@@ -326,7 +771,7 @@ export declare const UpstreamErrorSchema: z.ZodObject<{
326
771
  request_id: z.ZodOptional<z.ZodString>;
327
772
  }, "strip", z.ZodTypeAny, {
328
773
  error: {
329
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
774
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
330
775
  message: string;
331
776
  retry_after?: number | undefined;
332
777
  detail?: Record<string, unknown> | undefined;
@@ -334,7 +779,7 @@ export declare const UpstreamErrorSchema: z.ZodObject<{
334
779
  request_id?: string | undefined;
335
780
  }, {
336
781
  error: {
337
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout";
782
+ code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
338
783
  message: string;
339
784
  retry_after?: number | undefined;
340
785
  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;;;;;;;;;;;;;;;;;;;;;;EAE1E,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;;;IAMnC,uEAAuE;;;;;;;;;;;;;;;;EAEvE,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E,eAAO,MAAM,oBAAoB;;;;;;IAM/B,mEAAmE;;;;;;;;;;;;;;;;EAEnE,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAMlE,eAAO,MAAM,oBAAoB;IAC/B,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkB/D,uEAAuE;;IAEvE,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5D,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;IAMhC,0CAA0C;;;;;;;;;;;;;;;;EAE1C,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAA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