@skillsregistry/contracts 1.1.0 → 3.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,179 +1,118 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
3
  * Risk appetite. Domain layer maps to a numeric trust threshold + an
4
- * allowVulnerable flag; when the caller sets `min_trust` / `allow_vulnerable`
4
+ * allowVulnerable flag; when the caller sets `minTrust` / `allowVulnerable`
5
5
  * explicitly, those override the appetite-derived values.
6
6
  */
7
- export declare const AppetiteSchema: z.ZodEnum<["strict", "cautious", "balanced", "adventurous"]>;
7
+ export declare const AppetiteSchema: z.ZodEnum<{
8
+ strict: "strict";
9
+ cautious: "cautious";
10
+ balanced: "balanced";
11
+ adventurous: "adventurous";
12
+ }>;
8
13
  export type Appetite = z.infer<typeof AppetiteSchema>;
9
14
  /**
10
15
  * Visibility bands per cortex.md §16.6. Four-band tenant-scope model
11
16
  * (schema migration 0035). `private` is a legacy alias kept for pre-v6.3
12
17
  * consumers — new writes should prefer `tenant_private`.
18
+ *
19
+ * Enum *values* stay snake_case: they are stored as-is in the Postgres
20
+ * `chk_visibility` CHECK constraint (`@skillsregistry/schema`), so the wire
21
+ * value must match the column value. Only *field names* were flipped to
22
+ * camelCase in v2.0.0.
13
23
  */
14
- export declare const SkillVisibilitySchema: z.ZodEnum<["public", "private", "tenant_private", "tenant_internal", "unlisted"]>;
24
+ export declare const SkillVisibilitySchema: z.ZodEnum<{
25
+ public: "public";
26
+ private: "private";
27
+ tenant_private: "tenant_private";
28
+ tenant_internal: "tenant_internal";
29
+ unlisted: "unlisted";
30
+ }>;
15
31
  export type SkillVisibility = z.infer<typeof SkillVisibilitySchema>;
16
32
  /**
17
33
  * Search request per cortex.md §6.2:
18
34
  *
19
35
  * POST /v1/search { query, appetite, minTrust, allowVulnerable, tenantId, limit }
20
36
  *
21
- * Fields beyond the cortex minimum (`tags`, `category`, `runtime_env`,
37
+ * Fields beyond the cortex minimum (`tags`, `category`, `runtimeEnv`,
22
38
  * `visibility`, `portable`) are the local node's search superset — the
23
39
  * mothership treats them as optional filters when set.
24
40
  *
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.
41
+ * **v2.0.0 (MAJOR).** Field names flipped snake_case → camelCase to match
42
+ * every current caller (mothership inline schema at `src/routes/search.ts`,
43
+ * Cortex `SkillsRegistryClient.findSkill()`, local-node route surface). The
44
+ * v1.x snake_case shape caught no real consumers — 100% of live wire traffic
45
+ * was already camelCase, so the shared contract was inert. Aligning the
46
+ * contract to observed reality eliminates the silent-drop risk documented as
47
+ * X6 in the mothership repo's CLAUDE.md sibling-spec drift log (2026-07-15).
48
+ * Consumers that spelled the snake form must switch to camelCase in the same
49
+ * bump.
28
50
  */
29
51
  export declare const SearchRequestSchema: z.ZodObject<{
30
- /** Free-text query. Required, non-empty. */
31
52
  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. */
53
+ tenantId: z.ZodOptional<z.ZodString>;
54
+ appetite: z.ZodOptional<z.ZodEnum<{
55
+ strict: "strict";
56
+ cautious: "cautious";
57
+ balanced: "balanced";
58
+ adventurous: "adventurous";
59
+ }>>;
60
+ minTrust: z.ZodOptional<z.ZodNumber>;
61
+ allowVulnerable: z.ZodOptional<z.ZodBoolean>;
47
62
  limit: z.ZodOptional<z.ZodNumber>;
48
- /** Local-superset filters — mothership treats as optional. */
49
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
63
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
64
  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"]>>;
65
+ runtimeEnv: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
+ visibility: z.ZodOptional<z.ZodEnum<{
67
+ public: "public";
68
+ private: "private";
69
+ tenant_private: "tenant_private";
70
+ tenant_internal: "tenant_internal";
71
+ unlisted: "unlisted";
72
+ }>>;
53
73
  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
- }>;
74
+ }, z.core.$strip>;
79
75
  export type SearchRequest = z.infer<typeof SearchRequestSchema>;
80
76
  export declare const TrustScoreRequestSchema: z.ZodObject<{
81
- /** Skill identifier — either the mothership UUID or the local node's slug. */
82
77
  skill_id: z.ZodString;
83
- /**
84
- * Optional pinned skill manifest. When present, the mothership scores
85
- * against this snapshot instead of the version it may have indexed.
86
- */
87
78
  manifest: z.ZodOptional<z.ZodObject<{
88
79
  name: z.ZodString;
89
80
  version: z.ZodString;
90
81
  source: z.ZodString;
91
82
  description: z.ZodOptional<z.ZodString>;
92
83
  skill_md: z.ZodOptional<z.ZodString>;
93
- }, "strip", z.ZodTypeAny, {
94
- name: string;
95
- version: string;
96
- source: string;
97
- description?: string | undefined;
98
- skill_md?: string | undefined;
99
- }, {
100
- name: string;
101
- version: string;
102
- source: string;
103
- description?: string | undefined;
104
- skill_md?: string | undefined;
105
- }>>;
106
- /** Tenant scope hint (advisory in v1; enforced when write tools land). */
84
+ }, z.core.$strip>>;
107
85
  tenant_id: z.ZodOptional<z.ZodString>;
108
- }, "strip", z.ZodTypeAny, {
109
- skill_id: string;
110
- tenant_id?: string | undefined;
111
- manifest?: {
112
- name: string;
113
- version: string;
114
- source: string;
115
- description?: string | undefined;
116
- skill_md?: string | undefined;
117
- } | undefined;
118
- }, {
119
- skill_id: string;
120
- tenant_id?: string | undefined;
121
- manifest?: {
122
- name: string;
123
- version: string;
124
- source: string;
125
- description?: string | undefined;
126
- skill_md?: string | undefined;
127
- } | undefined;
128
- }>;
86
+ }, z.core.$strip>;
129
87
  export type TrustScoreRequest = z.infer<typeof TrustScoreRequestSchema>;
130
88
  export declare const TrustScoreResponseSchema: z.ZodObject<{
131
89
  skill_id: z.ZodString;
132
90
  trust_score: z.ZodNumber;
133
- trust_tier: z.ZodEnum<["A", "B", "C", "D", "F"]>;
91
+ trust_tier: z.ZodEnum<{
92
+ A: "A";
93
+ B: "B";
94
+ C: "C";
95
+ D: "D";
96
+ F: "F";
97
+ }>;
134
98
  trust_breakdown: z.ZodRecord<z.ZodString, z.ZodNumber>;
135
99
  scored_at: z.ZodString;
136
- /** Tokens consumed by this call, deducted from the tenant's budget. */
137
100
  tokens_consumed: z.ZodNumber;
138
- }, "strip", z.ZodTypeAny, {
139
- skill_id: string;
140
- trust_score: number;
141
- trust_tier: "A" | "B" | "C" | "D" | "F";
142
- trust_breakdown: Record<string, number>;
143
- scored_at: string;
144
- tokens_consumed: number;
145
- }, {
146
- skill_id: string;
147
- trust_score: number;
148
- trust_tier: "A" | "B" | "C" | "D" | "F";
149
- trust_breakdown: Record<string, number>;
150
- scored_at: string;
151
- tokens_consumed: number;
152
- }>;
101
+ }, z.core.$strip>;
153
102
  export type TrustScoreResponse = z.infer<typeof TrustScoreResponseSchema>;
154
103
  export declare const BudgetResponseSchema: z.ZodObject<{
155
104
  tenant_id: z.ZodString;
156
- plan: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
105
+ plan: z.ZodEnum<{
106
+ free: "free";
107
+ starter: "starter";
108
+ growth: "growth";
109
+ enterprise: "enterprise";
110
+ }>;
157
111
  tokens_total: z.ZodNumber;
158
112
  tokens_remaining: z.ZodNumber;
159
113
  tokens_reset_at: z.ZodString;
160
- /** True when `tokens_remaining` is below 10% of `tokens_total`. */
161
114
  low_balance: z.ZodBoolean;
162
- }, "strip", z.ZodTypeAny, {
163
- tenant_id: string;
164
- plan: "free" | "starter" | "growth" | "enterprise";
165
- tokens_total: number;
166
- tokens_remaining: number;
167
- tokens_reset_at: string;
168
- low_balance: boolean;
169
- }, {
170
- tenant_id: string;
171
- plan: "free" | "starter" | "growth" | "enterprise";
172
- tokens_total: number;
173
- tokens_remaining: number;
174
- tokens_reset_at: string;
175
- low_balance: boolean;
176
- }>;
115
+ }, z.core.$strip>;
177
116
  export type BudgetResponse = z.infer<typeof BudgetResponseSchema>;
178
117
  /**
179
118
  * Sandbox contract per `skill-convention.md` v1.3 §9. The runtime (Cortex L3,
@@ -193,75 +132,24 @@ export type BudgetResponse = z.infer<typeof BudgetResponseSchema>;
193
132
  *
194
133
  * `profile: 'agent'` + `budget_caps` are the agent-runtime extension
195
134
  * (§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
135
+ * wrapper script through session metering — the caller cannot rely
197
136
  * on Cortex enforcing them at the outer boundary.
198
137
  */
199
138
  export declare const SkillSandboxSchema: z.ZodObject<{
200
- /** OCI ref, e.g. `ghcr.io/cognium-labs/skill-base:1.0.0`. */
201
139
  image: z.ZodString;
202
- /** Memory allocation in MB. Base default 512 (vm) / 2048 (agent). */
203
140
  memory_mb: z.ZodNumber;
204
- /** vCPU count. Base default 2 (vm) / 4 (agent). */
205
141
  cpu: z.ZodNumber;
206
- /** Wall-clock ceiling in seconds. Base default 300 (vm) / 7200 (agent). */
207
142
  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. */
143
+ egress: z.ZodArray<z.ZodString>;
215
144
  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
145
  budget_caps: z.ZodOptional<z.ZodObject<{
222
- /** Max spend in USD across all LLM calls this run. */
223
146
  max_tokens_usd: z.ZodOptional<z.ZodNumber>;
224
- /** Max sub-tool invocations from inside the agent sandbox. */
225
147
  max_internal_tool_calls: z.ZodOptional<z.ZodNumber>;
226
- /** Wall-clock ceiling; usually mirrors top-level `timeout_seconds`. */
227
148
  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
- }>;
149
+ }, z.core.$strip>>;
150
+ }, z.core.$strip>;
262
151
  export type SkillSandbox = z.infer<typeof SkillSandboxSchema>;
263
152
  export declare const PublishRequestSchema: z.ZodObject<{
264
- /** Skill manifest to promote from local to global registry. */
265
153
  manifest: z.ZodObject<{
266
154
  name: z.ZodString;
267
155
  slug: z.ZodString;
@@ -269,7 +157,7 @@ export declare const PublishRequestSchema: z.ZodObject<{
269
157
  source: z.ZodString;
270
158
  description: z.ZodOptional<z.ZodString>;
271
159
  agent_summary: z.ZodOptional<z.ZodString>;
272
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
160
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
273
161
  category: z.ZodOptional<z.ZodString>;
274
162
  schema_json: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
275
163
  install_method: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -278,246 +166,49 @@ export declare const PublishRequestSchema: z.ZodObject<{
278
166
  source_url: z.ZodOptional<z.ZodString>;
279
167
  repository_url: z.ZodOptional<z.ZodString>;
280
168
  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
169
  sandbox: z.ZodOptional<z.ZodObject<{
288
- /** OCI ref, e.g. `ghcr.io/cognium-labs/skill-base:1.0.0`. */
289
170
  image: z.ZodString;
290
- /** Memory allocation in MB. Base default 512 (vm) / 2048 (agent). */
291
171
  memory_mb: z.ZodNumber;
292
- /** vCPU count. Base default 2 (vm) / 4 (agent). */
293
172
  cpu: z.ZodNumber;
294
- /** Wall-clock ceiling in seconds. Base default 300 (vm) / 7200 (agent). */
295
173
  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. */
174
+ egress: z.ZodArray<z.ZodString>;
303
175
  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
176
  budget_caps: z.ZodOptional<z.ZodObject<{
310
- /** Max spend in USD across all LLM calls this run. */
311
177
  max_tokens_usd: z.ZodOptional<z.ZodNumber>;
312
- /** Max sub-tool invocations from inside the agent sandbox. */
313
178
  max_internal_tool_calls: z.ZodOptional<z.ZodNumber>;
314
- /** Wall-clock ceiling; usually mirrors top-level `timeout_seconds`. */
315
179
  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
- }>>;
350
- }, "strip", z.ZodTypeAny, {
351
- name: string;
352
- version: string;
353
- source: string;
354
- slug: string;
355
- execution_layer: string;
356
- description?: string | undefined;
357
- tags?: string[] | undefined;
358
- category?: string | undefined;
359
- skill_md?: string | undefined;
360
- agent_summary?: string | undefined;
361
- schema_json?: Record<string, unknown> | undefined;
362
- install_method?: Record<string, unknown> | undefined;
363
- source_url?: string | undefined;
364
- repository_url?: string | undefined;
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;
379
- }, {
380
- name: string;
381
- version: string;
382
- source: string;
383
- slug: string;
384
- execution_layer: string;
385
- description?: string | undefined;
386
- tags?: string[] | undefined;
387
- category?: string | undefined;
388
- skill_md?: string | undefined;
389
- agent_summary?: string | undefined;
390
- schema_json?: Record<string, unknown> | undefined;
391
- install_method?: Record<string, unknown> | undefined;
392
- source_url?: string | undefined;
393
- repository_url?: string | undefined;
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;
408
- }>;
409
- /** Publisher key ID that signs the manifest. Required for A/B tier. */
180
+ }, z.core.$strip>>;
181
+ }, z.core.$strip>>;
182
+ }, z.core.$strip>;
410
183
  publisher_key_id: z.ZodOptional<z.ZodString>;
411
- /** Detached signature over the canonical manifest bytes. */
412
184
  signature: z.ZodOptional<z.ZodString>;
413
- }, "strip", z.ZodTypeAny, {
414
- manifest: {
415
- name: string;
416
- version: string;
417
- source: string;
418
- slug: string;
419
- execution_layer: string;
420
- description?: string | undefined;
421
- tags?: string[] | undefined;
422
- category?: string | undefined;
423
- skill_md?: string | undefined;
424
- agent_summary?: string | undefined;
425
- schema_json?: Record<string, unknown> | undefined;
426
- install_method?: Record<string, unknown> | undefined;
427
- source_url?: string | undefined;
428
- repository_url?: string | undefined;
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;
443
- };
444
- publisher_key_id?: string | undefined;
445
- signature?: string | undefined;
446
- }, {
447
- manifest: {
448
- name: string;
449
- version: string;
450
- source: string;
451
- slug: string;
452
- execution_layer: string;
453
- description?: string | undefined;
454
- tags?: string[] | undefined;
455
- category?: string | undefined;
456
- skill_md?: string | undefined;
457
- agent_summary?: string | undefined;
458
- schema_json?: Record<string, unknown> | undefined;
459
- install_method?: Record<string, unknown> | undefined;
460
- source_url?: string | undefined;
461
- repository_url?: string | undefined;
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;
476
- };
477
- publisher_key_id?: string | undefined;
478
- signature?: string | undefined;
479
- }>;
185
+ }, z.core.$strip>;
480
186
  export type PublishRequest = z.infer<typeof PublishRequestSchema>;
481
187
  export declare const PublishResponseSchema: z.ZodObject<{
482
188
  skill_id: z.ZodString;
483
189
  slug: z.ZodString;
484
190
  version: z.ZodString;
485
- status: z.ZodEnum<["published", "pending_review", "rejected"]>;
191
+ status: z.ZodEnum<{
192
+ published: "published";
193
+ pending_review: "pending_review";
194
+ rejected: "rejected";
195
+ }>;
486
196
  published_at: z.ZodString;
487
- /** URL of the skill on the mothership. */
488
197
  url: z.ZodString;
489
- }, "strip", z.ZodTypeAny, {
490
- status: "published" | "pending_review" | "rejected";
491
- skill_id: string;
492
- version: string;
493
- slug: string;
494
- published_at: string;
495
- url: string;
496
- }, {
497
- status: "published" | "pending_review" | "rejected";
498
- skill_id: string;
499
- version: string;
500
- slug: string;
501
- published_at: string;
502
- url: string;
503
- }>;
198
+ }, z.core.$strip>;
504
199
  export type PublishResponse = z.infer<typeof PublishResponseSchema>;
505
200
  export declare const TrustScoreDeltaSchema: z.ZodObject<{
506
201
  skill_id: z.ZodString;
507
202
  trust_score: z.ZodNumber;
508
- trust_tier: z.ZodEnum<["A", "B", "C", "D", "F"]>;
203
+ trust_tier: z.ZodEnum<{
204
+ A: "A";
205
+ B: "B";
206
+ C: "C";
207
+ D: "D";
208
+ F: "F";
209
+ }>;
509
210
  scored_at: z.ZodString;
510
- }, "strip", z.ZodTypeAny, {
511
- skill_id: string;
512
- trust_score: number;
513
- trust_tier: "A" | "B" | "C" | "D" | "F";
514
- scored_at: string;
515
- }, {
516
- skill_id: string;
517
- trust_score: number;
518
- trust_tier: "A" | "B" | "C" | "D" | "F";
519
- scored_at: string;
520
- }>;
211
+ }, z.core.$strip>;
521
212
  export type TrustScoreDelta = z.infer<typeof TrustScoreDeltaSchema>;
522
213
  export declare const TrustScoreSyncResponseSchema: z.ZodObject<{
523
214
  since: z.ZodString;
@@ -526,103 +217,61 @@ export declare const TrustScoreSyncResponseSchema: z.ZodObject<{
526
217
  deltas: z.ZodArray<z.ZodObject<{
527
218
  skill_id: z.ZodString;
528
219
  trust_score: z.ZodNumber;
529
- trust_tier: z.ZodEnum<["A", "B", "C", "D", "F"]>;
220
+ trust_tier: z.ZodEnum<{
221
+ A: "A";
222
+ B: "B";
223
+ C: "C";
224
+ D: "D";
225
+ F: "F";
226
+ }>;
530
227
  scored_at: z.ZodString;
531
- }, "strip", z.ZodTypeAny, {
532
- skill_id: string;
533
- trust_score: number;
534
- trust_tier: "A" | "B" | "C" | "D" | "F";
535
- scored_at: string;
536
- }, {
537
- skill_id: string;
538
- trust_score: number;
539
- trust_tier: "A" | "B" | "C" | "D" | "F";
540
- scored_at: string;
541
- }>, "many">;
542
- /**
543
- * Cursor for pagination. When present, the client should re-request with
544
- * `since=<next_cursor>` to continue.
545
- */
228
+ }, z.core.$strip>>;
546
229
  next_cursor: z.ZodOptional<z.ZodString>;
547
- }, "strip", z.ZodTypeAny, {
548
- since: string;
549
- until: string;
550
- count: number;
551
- deltas: {
552
- skill_id: string;
553
- trust_score: number;
554
- trust_tier: "A" | "B" | "C" | "D" | "F";
555
- scored_at: string;
556
- }[];
557
- next_cursor?: string | undefined;
558
- }, {
559
- since: string;
560
- until: string;
561
- count: number;
562
- deltas: {
563
- skill_id: string;
564
- trust_score: number;
565
- trust_tier: "A" | "B" | "C" | "D" | "F";
566
- scored_at: string;
567
- }[];
568
- next_cursor?: string | undefined;
230
+ }, z.core.$strip>;
231
+ export declare const SkillRevocationReasonSchema: z.ZodEnum<{
232
+ unknown: "unknown";
233
+ security: "security";
234
+ compliance: "compliance";
235
+ policy: "policy";
236
+ quality: "quality";
237
+ author_request: "author_request";
238
+ superseded: "superseded";
569
239
  }>;
570
- export declare const SkillRevocationReasonSchema: z.ZodEnum<["security", "compliance", "policy", "quality", "author_request", "superseded", "unknown"]>;
571
240
  export type SkillRevocationReason = z.infer<typeof SkillRevocationReasonSchema>;
572
- export declare const SkillRevocationEventTypeSchema: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
241
+ export declare const SkillRevocationEventTypeSchema: z.ZodEnum<{
242
+ "skill.revoked": "skill.revoked";
243
+ "skill.deprecated": "skill.deprecated";
244
+ }>;
573
245
  export type SkillRevocationEventType = z.infer<typeof SkillRevocationEventTypeSchema>;
574
246
  /**
575
247
  * Single revocation / deprecation event. `event_id` is the idempotency key —
576
248
  * consumers store the last-seen id per source to dedupe replays.
577
249
  */
578
250
  export declare const SkillRevocationEventSchema: z.ZodObject<{
579
- /** Idempotency key. Consumer dedupes on (source, event_id). */
580
251
  event_id: z.ZodString;
581
- event_type: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
252
+ event_type: z.ZodEnum<{
253
+ "skill.revoked": "skill.revoked";
254
+ "skill.deprecated": "skill.deprecated";
255
+ }>;
582
256
  emitted_at: z.ZodString;
583
- /** Mothership skill UUID. */
584
257
  skill_id: z.ZodString;
585
- /** Human-readable identifier — helpful in webhook logs. */
586
258
  slug: z.ZodString;
587
- /** Pinned version at the time of revocation (if the whole line was pulled). */
588
259
  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. */
260
+ reason: z.ZodEnum<{
261
+ unknown: "unknown";
262
+ security: "security";
263
+ compliance: "compliance";
264
+ policy: "policy";
265
+ quality: "quality";
266
+ author_request: "author_request";
267
+ superseded: "superseded";
268
+ }>;
591
269
  reason_detail: z.ZodOptional<z.ZodString>;
592
- /** Actionable message consumers can show in remediation UI. */
593
270
  remediation_message: z.ZodOptional<z.ZodString>;
594
271
  remediation_url: z.ZodOptional<z.ZodString>;
595
- /** Mothership UUID of the replacement skill, if any. */
596
272
  replacement_skill_id: z.ZodOptional<z.ZodString>;
597
- /** Slug of the replacement skill (redundant with id — safer for humans). */
598
273
  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
- }>;
274
+ }, z.core.$strip>;
626
275
  export type SkillRevocationEvent = z.infer<typeof SkillRevocationEventSchema>;
627
276
  /**
628
277
  * Response for `GET /v1/sync/revocations?since=<ISO>`. Mirrors the shape of
@@ -633,94 +282,32 @@ export declare const SkillRevocationSyncResponseSchema: z.ZodObject<{
633
282
  until: z.ZodString;
634
283
  count: z.ZodNumber;
635
284
  events: z.ZodArray<z.ZodObject<{
636
- /** Idempotency key. Consumer dedupes on (source, event_id). */
637
285
  event_id: z.ZodString;
638
- event_type: z.ZodEnum<["skill.revoked", "skill.deprecated"]>;
286
+ event_type: z.ZodEnum<{
287
+ "skill.revoked": "skill.revoked";
288
+ "skill.deprecated": "skill.deprecated";
289
+ }>;
639
290
  emitted_at: z.ZodString;
640
- /** Mothership skill UUID. */
641
291
  skill_id: z.ZodString;
642
- /** Human-readable identifier — helpful in webhook logs. */
643
292
  slug: z.ZodString;
644
- /** Pinned version at the time of revocation (if the whole line was pulled). */
645
293
  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. */
294
+ reason: z.ZodEnum<{
295
+ unknown: "unknown";
296
+ security: "security";
297
+ compliance: "compliance";
298
+ policy: "policy";
299
+ quality: "quality";
300
+ author_request: "author_request";
301
+ superseded: "superseded";
302
+ }>;
648
303
  reason_detail: z.ZodOptional<z.ZodString>;
649
- /** Actionable message consumers can show in remediation UI. */
650
304
  remediation_message: z.ZodOptional<z.ZodString>;
651
305
  remediation_url: z.ZodOptional<z.ZodString>;
652
- /** Mothership UUID of the replacement skill, if any. */
653
306
  replacement_skill_id: z.ZodOptional<z.ZodString>;
654
- /** Slug of the replacement skill (redundant with id — safer for humans). */
655
307
  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>`. */
308
+ }, z.core.$strip>>;
684
309
  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
- }>;
310
+ }, z.core.$strip>;
724
311
  export type SkillRevocationSyncResponse = z.infer<typeof SkillRevocationSyncResponseSchema>;
725
312
  export type TrustScoreSyncResponse = z.infer<typeof TrustScoreSyncResponseSchema>;
726
313
  /**
@@ -750,41 +337,23 @@ export type TrustScoreSyncResponse = z.infer<typeof TrustScoreSyncResponseSchema
750
337
  export type UpstreamErrorCode = 'upstream_not_configured' | 'budget_exhausted' | 'unauthenticated' | 'forbidden' | 'not_found' | 'rate_limited' | 'bad_request' | 'upstream_unavailable' | 'upstream_timeout' | 'sandbox_contract_violated';
751
338
  export declare const UpstreamErrorSchema: z.ZodObject<{
752
339
  error: z.ZodObject<{
753
- code: z.ZodEnum<["upstream_not_configured", "budget_exhausted", "unauthenticated", "forbidden", "not_found", "rate_limited", "bad_request", "upstream_unavailable", "upstream_timeout", "sandbox_contract_violated"]>;
340
+ code: z.ZodEnum<{
341
+ upstream_not_configured: "upstream_not_configured";
342
+ budget_exhausted: "budget_exhausted";
343
+ unauthenticated: "unauthenticated";
344
+ forbidden: "forbidden";
345
+ not_found: "not_found";
346
+ rate_limited: "rate_limited";
347
+ bad_request: "bad_request";
348
+ upstream_unavailable: "upstream_unavailable";
349
+ upstream_timeout: "upstream_timeout";
350
+ sandbox_contract_violated: "sandbox_contract_violated";
351
+ }>;
754
352
  message: z.ZodString;
755
- /** Seconds until the caller may safely retry. Absent for permanent errors. */
756
353
  retry_after: z.ZodOptional<z.ZodNumber>;
757
- /** Optional structured detail (upstream field errors, etc.). */
758
354
  detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
759
- }, "strip", z.ZodTypeAny, {
760
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
761
- message: string;
762
- retry_after?: number | undefined;
763
- detail?: Record<string, unknown> | undefined;
764
- }, {
765
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
766
- message: string;
767
- retry_after?: number | undefined;
768
- detail?: Record<string, unknown> | undefined;
769
- }>;
770
- /** Request ID for cross-referencing with mothership logs. */
355
+ }, z.core.$strip>;
771
356
  request_id: z.ZodOptional<z.ZodString>;
772
- }, "strip", z.ZodTypeAny, {
773
- error: {
774
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
775
- message: string;
776
- retry_after?: number | undefined;
777
- detail?: Record<string, unknown> | undefined;
778
- };
779
- request_id?: string | undefined;
780
- }, {
781
- error: {
782
- code: "upstream_not_configured" | "budget_exhausted" | "unauthenticated" | "forbidden" | "not_found" | "rate_limited" | "bad_request" | "upstream_unavailable" | "upstream_timeout" | "sandbox_contract_violated";
783
- message: string;
784
- retry_after?: number | undefined;
785
- detail?: Record<string, unknown> | undefined;
786
- };
787
- request_id?: string | undefined;
788
- }>;
357
+ }, z.core.$strip>;
789
358
  export type UpstreamErrorEnvelope = z.infer<typeof UpstreamErrorSchema>;
790
359
  //# sourceMappingURL=upstream.d.ts.map