@nexural/schema 0.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.
@@ -0,0 +1,2839 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Primitive atoms imported by every other schema in @nexural/schema.
5
+ *
6
+ * Changing a primitive is a major version bump per SCHEMA_CHARTER §5.
7
+ */
8
+
9
+ /** ISO 8601 timestamp with timezone offset. */
10
+ declare const Iso8601: z.ZodString;
11
+ /** ISO 8601 date (YYYY-MM-DD). */
12
+ declare const IsoDate: z.ZodString;
13
+ /** ULID — Crockford base32, 26 chars. */
14
+ declare const Ulid: z.ZodString;
15
+ /** Kebab-case slug — lowercase alphanumeric with single-hyphen separators. */
16
+ declare const KebabSlug: z.ZodString;
17
+ /** Warehouse trust tiers (per ARCHITECTURE.md §6, THREAT_MODEL §1). */
18
+ declare const TrustTier: z.ZodEnum<["public", "internal", "private-encrypted"]>;
19
+ type TrustTier = z.infer<typeof TrustTier>;
20
+ /** Warehouse lifecycle status (per RETIREMENT.md §1). */
21
+ declare const WarehouseStatus: z.ZodEnum<["active", "seeded", "archived", "deprecated", "merged"]>;
22
+ type WarehouseStatus = z.infer<typeof WarehouseStatus>;
23
+ /** Schema version — currently a single integer literal. Bumps require migration codemod (SCHEMA_CHARTER §6). */
24
+ declare const SchemaVersion: z.ZodLiteral<1>;
25
+ type SchemaVersion = z.infer<typeof SchemaVersion>;
26
+ /** Strict semver string per https://semver.org */
27
+ declare const SemverString: z.ZodString;
28
+ /** GitHub repo URL — pinned to github.com (per NAMING.md). */
29
+ declare const RepoUrl: z.ZodString;
30
+ /** RFC 5322 email. */
31
+ declare const Email: z.ZodString;
32
+ /** Decay rate in days (1 = daily, 7 = weekly, 90 = quarterly, 365 = yearly, 3650 = decadal). */
33
+ declare const DecayDays: z.ZodNumber;
34
+ /** Federation identifier (per ADR-0003). */
35
+ declare const Federation: z.ZodEnum<["factory", "lifeops"]>;
36
+ type Federation = z.infer<typeof Federation>;
37
+ /** Git SHA — short (7+) or full (40 or 64 for sha256). */
38
+ declare const GitSha: z.ZodString;
39
+ /** SHA-256 hex string (64 chars). */
40
+ declare const Sha256Hex: z.ZodString;
41
+ /** 1Password CLI URI (`op://VaultName/ItemName/field`). */
42
+ declare const OpUri: z.ZodString;
43
+ /** Environment variable identifier (SCREAMING_SNAKE_CASE, valid POSIX). */
44
+ declare const EnvVarName: z.ZodString;
45
+ /** USD amount (non-negative for projections, positive for caps). */
46
+ declare const UsdAmount: z.ZodNumber;
47
+ declare const PositiveUsdAmount: z.ZodNumber;
48
+
49
+ /**
50
+ * Typed error shapes used by @nexural/sdk, @nexural/mcp-base, @nexural/factory.
51
+ *
52
+ * All errors include a stable `code` string for telemetry filtering.
53
+ */
54
+
55
+ declare const NexuralErrorCode: z.ZodEnum<["schema_validation_failed", "schema_version_mismatch", "mcp_timeout", "mcp_unavailable", "mcp_invalid_response", "decay_quarantined", "decay_stale", "recipe_signature_invalid", "recipe_revoked", "recipe_input_invalid", "recipe_sbom_gate_failed", "recipe_license_gate_failed", "recipe_typosquat_detected", "cost_cap_exceeded", "cost_cap_streaming_exceeded", "cost_circuit_break", "tier_confinement_violation", "federation_mismatch", "secret_resolution_failed", "op_signin_required"]>;
56
+ type NexuralErrorCode = z.infer<typeof NexuralErrorCode>;
57
+ declare const NexuralError: z.ZodObject<{
58
+ code: z.ZodEnum<["schema_validation_failed", "schema_version_mismatch", "mcp_timeout", "mcp_unavailable", "mcp_invalid_response", "decay_quarantined", "decay_stale", "recipe_signature_invalid", "recipe_revoked", "recipe_input_invalid", "recipe_sbom_gate_failed", "recipe_license_gate_failed", "recipe_typosquat_detected", "cost_cap_exceeded", "cost_cap_streaming_exceeded", "cost_circuit_break", "tier_confinement_violation", "federation_mismatch", "secret_resolution_failed", "op_signin_required"]>;
59
+ message: z.ZodString;
60
+ retryable: z.ZodBoolean;
61
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
62
+ }, "strict", z.ZodTypeAny, {
63
+ code: "schema_validation_failed" | "schema_version_mismatch" | "mcp_timeout" | "mcp_unavailable" | "mcp_invalid_response" | "decay_quarantined" | "decay_stale" | "recipe_signature_invalid" | "recipe_revoked" | "recipe_input_invalid" | "recipe_sbom_gate_failed" | "recipe_license_gate_failed" | "recipe_typosquat_detected" | "cost_cap_exceeded" | "cost_cap_streaming_exceeded" | "cost_circuit_break" | "tier_confinement_violation" | "federation_mismatch" | "secret_resolution_failed" | "op_signin_required";
64
+ message: string;
65
+ retryable: boolean;
66
+ details?: Record<string, unknown> | undefined;
67
+ }, {
68
+ code: "schema_validation_failed" | "schema_version_mismatch" | "mcp_timeout" | "mcp_unavailable" | "mcp_invalid_response" | "decay_quarantined" | "decay_stale" | "recipe_signature_invalid" | "recipe_revoked" | "recipe_input_invalid" | "recipe_sbom_gate_failed" | "recipe_license_gate_failed" | "recipe_typosquat_detected" | "cost_cap_exceeded" | "cost_cap_streaming_exceeded" | "cost_circuit_break" | "tier_confinement_violation" | "federation_mismatch" | "secret_resolution_failed" | "op_signin_required";
69
+ message: string;
70
+ retryable: boolean;
71
+ details?: Record<string, unknown> | undefined;
72
+ }>;
73
+ type NexuralError = z.infer<typeof NexuralError>;
74
+
75
+ /**
76
+ * WarehouseMeta — the `meta.yaml` file at the root of every warehouse.
77
+ *
78
+ * Validated:
79
+ * - pre-commit via husky (warehouse-local `scripts/validate.mjs`)
80
+ * - CI on every warehouse PR
81
+ * - nightly via nexural-meta `scripts/verify-all.mjs`
82
+ *
83
+ * Per ARCHITECTURE.md §4.4 + ADR-0003 (federation field).
84
+ */
85
+
86
+ declare const WarehouseMeta: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
87
+ schema_version: z.ZodLiteral<1>;
88
+ name: z.ZodString;
89
+ tier: z.ZodEnum<["public", "internal", "private-encrypted"]>;
90
+ description: z.ZodString;
91
+ owner: z.ZodString;
92
+ created: z.ZodString;
93
+ last_reviewed: z.ZodString;
94
+ decay_rate_days: z.ZodNumber;
95
+ status: z.ZodEnum<["active", "seeded", "archived", "deprecated", "merged"]>;
96
+ merged_into: z.ZodOptional<z.ZodString>;
97
+ /** Which federation this warehouse belongs to (per ADR-0003). */
98
+ federation: z.ZodEnum<["factory", "lifeops"]>;
99
+ trust: z.ZodDiscriminatedUnion<"encryption", [z.ZodObject<{
100
+ encryption: z.ZodLiteral<"none">;
101
+ }, "strict", z.ZodTypeAny, {
102
+ encryption: "none";
103
+ }, {
104
+ encryption: "none";
105
+ }>, z.ZodObject<{
106
+ encryption: z.ZodLiteral<"age+sops">;
107
+ key_source: z.ZodEnum<["yubikey-primary", "yubikey-backup", "1password-emergency"]>;
108
+ recovery: z.ZodString;
109
+ filename_strategy: z.ZodEnum<["plaintext", "ulid"]>;
110
+ }, "strict", z.ZodTypeAny, {
111
+ encryption: "age+sops";
112
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
113
+ recovery: string;
114
+ filename_strategy: "plaintext" | "ulid";
115
+ }, {
116
+ encryption: "age+sops";
117
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
118
+ recovery: string;
119
+ filename_strategy: "plaintext" | "ulid";
120
+ }>]>;
121
+ backup: z.ZodObject<{
122
+ destination: z.ZodString;
123
+ cadence: z.ZodEnum<["realtime", "hourly", "nightly", "weekly"]>;
124
+ retention_days: z.ZodNumber;
125
+ }, "strict", z.ZodTypeAny, {
126
+ destination: string;
127
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
128
+ retention_days: number;
129
+ }, {
130
+ destination: string;
131
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
132
+ retention_days: number;
133
+ }>;
134
+ mcp: z.ZodObject<{
135
+ tool_prefix: z.ZodString;
136
+ exposes: z.ZodArray<z.ZodString, "many">;
137
+ }, "strict", z.ZodTypeAny, {
138
+ tool_prefix: string;
139
+ exposes: string[];
140
+ }, {
141
+ tool_prefix: string;
142
+ exposes: string[];
143
+ }>;
144
+ cross_refs: z.ZodObject<{
145
+ consumes_from: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
146
+ exposed_to: z.ZodObject<{
147
+ public: z.ZodBoolean;
148
+ agents: z.ZodBoolean;
149
+ human: z.ZodBoolean;
150
+ }, "strict", z.ZodTypeAny, {
151
+ public: boolean;
152
+ agents: boolean;
153
+ human: boolean;
154
+ }, {
155
+ public: boolean;
156
+ agents: boolean;
157
+ human: boolean;
158
+ }>;
159
+ }, "strict", z.ZodTypeAny, {
160
+ consumes_from: string[];
161
+ exposed_to: {
162
+ public: boolean;
163
+ agents: boolean;
164
+ human: boolean;
165
+ };
166
+ }, {
167
+ exposed_to: {
168
+ public: boolean;
169
+ agents: boolean;
170
+ human: boolean;
171
+ };
172
+ consumes_from?: string[] | undefined;
173
+ }>;
174
+ metrics: z.ZodOptional<z.ZodObject<{
175
+ target_entries: z.ZodOptional<z.ZodNumber>;
176
+ target_scorecard: z.ZodOptional<z.ZodNumber>;
177
+ }, "strict", z.ZodTypeAny, {
178
+ target_entries?: number | undefined;
179
+ target_scorecard?: number | undefined;
180
+ }, {
181
+ target_entries?: number | undefined;
182
+ target_scorecard?: number | undefined;
183
+ }>>;
184
+ links: z.ZodObject<{
185
+ repo: z.ZodString;
186
+ docs: z.ZodOptional<z.ZodString>;
187
+ }, "strict", z.ZodTypeAny, {
188
+ repo: string;
189
+ docs?: string | undefined;
190
+ }, {
191
+ repo: string;
192
+ docs?: string | undefined;
193
+ }>;
194
+ }, "strict", z.ZodTypeAny, {
195
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
196
+ schema_version: 1;
197
+ name: string;
198
+ tier: "public" | "internal" | "private-encrypted";
199
+ description: string;
200
+ owner: string;
201
+ created: string;
202
+ last_reviewed: string;
203
+ decay_rate_days: number;
204
+ federation: "factory" | "lifeops";
205
+ trust: {
206
+ encryption: "none";
207
+ } | {
208
+ encryption: "age+sops";
209
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
210
+ recovery: string;
211
+ filename_strategy: "plaintext" | "ulid";
212
+ };
213
+ backup: {
214
+ destination: string;
215
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
216
+ retention_days: number;
217
+ };
218
+ mcp: {
219
+ tool_prefix: string;
220
+ exposes: string[];
221
+ };
222
+ cross_refs: {
223
+ consumes_from: string[];
224
+ exposed_to: {
225
+ public: boolean;
226
+ agents: boolean;
227
+ human: boolean;
228
+ };
229
+ };
230
+ links: {
231
+ repo: string;
232
+ docs?: string | undefined;
233
+ };
234
+ merged_into?: string | undefined;
235
+ metrics?: {
236
+ target_entries?: number | undefined;
237
+ target_scorecard?: number | undefined;
238
+ } | undefined;
239
+ }, {
240
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
241
+ schema_version: 1;
242
+ name: string;
243
+ tier: "public" | "internal" | "private-encrypted";
244
+ description: string;
245
+ owner: string;
246
+ created: string;
247
+ last_reviewed: string;
248
+ decay_rate_days: number;
249
+ federation: "factory" | "lifeops";
250
+ trust: {
251
+ encryption: "none";
252
+ } | {
253
+ encryption: "age+sops";
254
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
255
+ recovery: string;
256
+ filename_strategy: "plaintext" | "ulid";
257
+ };
258
+ backup: {
259
+ destination: string;
260
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
261
+ retention_days: number;
262
+ };
263
+ mcp: {
264
+ tool_prefix: string;
265
+ exposes: string[];
266
+ };
267
+ cross_refs: {
268
+ exposed_to: {
269
+ public: boolean;
270
+ agents: boolean;
271
+ human: boolean;
272
+ };
273
+ consumes_from?: string[] | undefined;
274
+ };
275
+ links: {
276
+ repo: string;
277
+ docs?: string | undefined;
278
+ };
279
+ merged_into?: string | undefined;
280
+ metrics?: {
281
+ target_entries?: number | undefined;
282
+ target_scorecard?: number | undefined;
283
+ } | undefined;
284
+ }>, {
285
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
286
+ schema_version: 1;
287
+ name: string;
288
+ tier: "public" | "internal" | "private-encrypted";
289
+ description: string;
290
+ owner: string;
291
+ created: string;
292
+ last_reviewed: string;
293
+ decay_rate_days: number;
294
+ federation: "factory" | "lifeops";
295
+ trust: {
296
+ encryption: "none";
297
+ } | {
298
+ encryption: "age+sops";
299
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
300
+ recovery: string;
301
+ filename_strategy: "plaintext" | "ulid";
302
+ };
303
+ backup: {
304
+ destination: string;
305
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
306
+ retention_days: number;
307
+ };
308
+ mcp: {
309
+ tool_prefix: string;
310
+ exposes: string[];
311
+ };
312
+ cross_refs: {
313
+ consumes_from: string[];
314
+ exposed_to: {
315
+ public: boolean;
316
+ agents: boolean;
317
+ human: boolean;
318
+ };
319
+ };
320
+ links: {
321
+ repo: string;
322
+ docs?: string | undefined;
323
+ };
324
+ merged_into?: string | undefined;
325
+ metrics?: {
326
+ target_entries?: number | undefined;
327
+ target_scorecard?: number | undefined;
328
+ } | undefined;
329
+ }, {
330
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
331
+ schema_version: 1;
332
+ name: string;
333
+ tier: "public" | "internal" | "private-encrypted";
334
+ description: string;
335
+ owner: string;
336
+ created: string;
337
+ last_reviewed: string;
338
+ decay_rate_days: number;
339
+ federation: "factory" | "lifeops";
340
+ trust: {
341
+ encryption: "none";
342
+ } | {
343
+ encryption: "age+sops";
344
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
345
+ recovery: string;
346
+ filename_strategy: "plaintext" | "ulid";
347
+ };
348
+ backup: {
349
+ destination: string;
350
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
351
+ retention_days: number;
352
+ };
353
+ mcp: {
354
+ tool_prefix: string;
355
+ exposes: string[];
356
+ };
357
+ cross_refs: {
358
+ exposed_to: {
359
+ public: boolean;
360
+ agents: boolean;
361
+ human: boolean;
362
+ };
363
+ consumes_from?: string[] | undefined;
364
+ };
365
+ links: {
366
+ repo: string;
367
+ docs?: string | undefined;
368
+ };
369
+ merged_into?: string | undefined;
370
+ metrics?: {
371
+ target_entries?: number | undefined;
372
+ target_scorecard?: number | undefined;
373
+ } | undefined;
374
+ }>, {
375
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
376
+ schema_version: 1;
377
+ name: string;
378
+ tier: "public" | "internal" | "private-encrypted";
379
+ description: string;
380
+ owner: string;
381
+ created: string;
382
+ last_reviewed: string;
383
+ decay_rate_days: number;
384
+ federation: "factory" | "lifeops";
385
+ trust: {
386
+ encryption: "none";
387
+ } | {
388
+ encryption: "age+sops";
389
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
390
+ recovery: string;
391
+ filename_strategy: "plaintext" | "ulid";
392
+ };
393
+ backup: {
394
+ destination: string;
395
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
396
+ retention_days: number;
397
+ };
398
+ mcp: {
399
+ tool_prefix: string;
400
+ exposes: string[];
401
+ };
402
+ cross_refs: {
403
+ consumes_from: string[];
404
+ exposed_to: {
405
+ public: boolean;
406
+ agents: boolean;
407
+ human: boolean;
408
+ };
409
+ };
410
+ links: {
411
+ repo: string;
412
+ docs?: string | undefined;
413
+ };
414
+ merged_into?: string | undefined;
415
+ metrics?: {
416
+ target_entries?: number | undefined;
417
+ target_scorecard?: number | undefined;
418
+ } | undefined;
419
+ }, {
420
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
421
+ schema_version: 1;
422
+ name: string;
423
+ tier: "public" | "internal" | "private-encrypted";
424
+ description: string;
425
+ owner: string;
426
+ created: string;
427
+ last_reviewed: string;
428
+ decay_rate_days: number;
429
+ federation: "factory" | "lifeops";
430
+ trust: {
431
+ encryption: "none";
432
+ } | {
433
+ encryption: "age+sops";
434
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
435
+ recovery: string;
436
+ filename_strategy: "plaintext" | "ulid";
437
+ };
438
+ backup: {
439
+ destination: string;
440
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
441
+ retention_days: number;
442
+ };
443
+ mcp: {
444
+ tool_prefix: string;
445
+ exposes: string[];
446
+ };
447
+ cross_refs: {
448
+ exposed_to: {
449
+ public: boolean;
450
+ agents: boolean;
451
+ human: boolean;
452
+ };
453
+ consumes_from?: string[] | undefined;
454
+ };
455
+ links: {
456
+ repo: string;
457
+ docs?: string | undefined;
458
+ };
459
+ merged_into?: string | undefined;
460
+ metrics?: {
461
+ target_entries?: number | undefined;
462
+ target_scorecard?: number | undefined;
463
+ } | undefined;
464
+ }>, {
465
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
466
+ schema_version: 1;
467
+ name: string;
468
+ tier: "public" | "internal" | "private-encrypted";
469
+ description: string;
470
+ owner: string;
471
+ created: string;
472
+ last_reviewed: string;
473
+ decay_rate_days: number;
474
+ federation: "factory" | "lifeops";
475
+ trust: {
476
+ encryption: "none";
477
+ } | {
478
+ encryption: "age+sops";
479
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
480
+ recovery: string;
481
+ filename_strategy: "plaintext" | "ulid";
482
+ };
483
+ backup: {
484
+ destination: string;
485
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
486
+ retention_days: number;
487
+ };
488
+ mcp: {
489
+ tool_prefix: string;
490
+ exposes: string[];
491
+ };
492
+ cross_refs: {
493
+ consumes_from: string[];
494
+ exposed_to: {
495
+ public: boolean;
496
+ agents: boolean;
497
+ human: boolean;
498
+ };
499
+ };
500
+ links: {
501
+ repo: string;
502
+ docs?: string | undefined;
503
+ };
504
+ merged_into?: string | undefined;
505
+ metrics?: {
506
+ target_entries?: number | undefined;
507
+ target_scorecard?: number | undefined;
508
+ } | undefined;
509
+ }, {
510
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
511
+ schema_version: 1;
512
+ name: string;
513
+ tier: "public" | "internal" | "private-encrypted";
514
+ description: string;
515
+ owner: string;
516
+ created: string;
517
+ last_reviewed: string;
518
+ decay_rate_days: number;
519
+ federation: "factory" | "lifeops";
520
+ trust: {
521
+ encryption: "none";
522
+ } | {
523
+ encryption: "age+sops";
524
+ key_source: "yubikey-primary" | "yubikey-backup" | "1password-emergency";
525
+ recovery: string;
526
+ filename_strategy: "plaintext" | "ulid";
527
+ };
528
+ backup: {
529
+ destination: string;
530
+ cadence: "realtime" | "hourly" | "nightly" | "weekly";
531
+ retention_days: number;
532
+ };
533
+ mcp: {
534
+ tool_prefix: string;
535
+ exposes: string[];
536
+ };
537
+ cross_refs: {
538
+ exposed_to: {
539
+ public: boolean;
540
+ agents: boolean;
541
+ human: boolean;
542
+ };
543
+ consumes_from?: string[] | undefined;
544
+ };
545
+ links: {
546
+ repo: string;
547
+ docs?: string | undefined;
548
+ };
549
+ merged_into?: string | undefined;
550
+ metrics?: {
551
+ target_entries?: number | undefined;
552
+ target_scorecard?: number | undefined;
553
+ } | undefined;
554
+ }>;
555
+ type WarehouseMeta = z.infer<typeof WarehouseMeta>;
556
+
557
+ /**
558
+ * ContentFrontmatter — per-entry `frontmatter.yaml` inside a warehouse.
559
+ *
560
+ * Validated at warehouse pre-commit + CI.
561
+ */
562
+
563
+ declare const SourceType: z.ZodEnum<["principle", "playbook", "framework", "template", "case-study", "decision", "reference", "snippet", "checklist", "rubric", "post-mortem"]>;
564
+ type SourceType = z.infer<typeof SourceType>;
565
+ declare const RelatedRelation: z.ZodEnum<["extends", "supersedes", "informs", "contradicts", "cites"]>;
566
+ type RelatedRelation = z.infer<typeof RelatedRelation>;
567
+ declare const ContentFrontmatter: z.ZodObject<{
568
+ schema_version: z.ZodLiteral<1>;
569
+ id: z.ZodUnion<[z.ZodString, z.ZodString]>;
570
+ title: z.ZodString;
571
+ summary: z.ZodString;
572
+ tags: z.ZodArray<z.ZodString, "many">;
573
+ created: z.ZodString;
574
+ updated: z.ZodString;
575
+ last_reviewed: z.ZodString;
576
+ decay_rate_days: z.ZodOptional<z.ZodNumber>;
577
+ status: z.ZodEnum<["draft", "active", "archived", "deprecated"]>;
578
+ authors: z.ZodArray<z.ZodString, "many">;
579
+ source_type: z.ZodEnum<["principle", "playbook", "framework", "template", "case-study", "decision", "reference", "snippet", "checklist", "rubric", "post-mortem"]>;
580
+ related: z.ZodDefault<z.ZodArray<z.ZodObject<{
581
+ warehouse: z.ZodString;
582
+ id: z.ZodUnion<[z.ZodString, z.ZodString]>;
583
+ relation: z.ZodEnum<["extends", "supersedes", "informs", "contradicts", "cites"]>;
584
+ }, "strict", z.ZodTypeAny, {
585
+ warehouse: string;
586
+ id: string;
587
+ relation: "extends" | "supersedes" | "informs" | "contradicts" | "cites";
588
+ }, {
589
+ warehouse: string;
590
+ id: string;
591
+ relation: "extends" | "supersedes" | "informs" | "contradicts" | "cites";
592
+ }>, "many">>;
593
+ visibility: z.ZodObject<{
594
+ public_via_mcp: z.ZodBoolean;
595
+ embedding_eligible: z.ZodBoolean;
596
+ }, "strict", z.ZodTypeAny, {
597
+ public_via_mcp: boolean;
598
+ embedding_eligible: boolean;
599
+ }, {
600
+ public_via_mcp: boolean;
601
+ embedding_eligible: boolean;
602
+ }>;
603
+ }, "strict", z.ZodTypeAny, {
604
+ status: "active" | "archived" | "deprecated" | "draft";
605
+ schema_version: 1;
606
+ created: string;
607
+ last_reviewed: string;
608
+ id: string;
609
+ title: string;
610
+ summary: string;
611
+ tags: string[];
612
+ updated: string;
613
+ authors: string[];
614
+ source_type: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem";
615
+ related: {
616
+ warehouse: string;
617
+ id: string;
618
+ relation: "extends" | "supersedes" | "informs" | "contradicts" | "cites";
619
+ }[];
620
+ visibility: {
621
+ public_via_mcp: boolean;
622
+ embedding_eligible: boolean;
623
+ };
624
+ decay_rate_days?: number | undefined;
625
+ }, {
626
+ status: "active" | "archived" | "deprecated" | "draft";
627
+ schema_version: 1;
628
+ created: string;
629
+ last_reviewed: string;
630
+ id: string;
631
+ title: string;
632
+ summary: string;
633
+ tags: string[];
634
+ updated: string;
635
+ authors: string[];
636
+ source_type: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem";
637
+ visibility: {
638
+ public_via_mcp: boolean;
639
+ embedding_eligible: boolean;
640
+ };
641
+ decay_rate_days?: number | undefined;
642
+ related?: {
643
+ warehouse: string;
644
+ id: string;
645
+ relation: "extends" | "supersedes" | "informs" | "contradicts" | "cites";
646
+ }[] | undefined;
647
+ }>;
648
+ type ContentFrontmatter = z.infer<typeof ContentFrontmatter>;
649
+
650
+ /**
651
+ * WarehouseIndex — generated `index.json` per warehouse.
652
+ *
653
+ * NEVER hand-edited. Pre-commit hook fails if hash diverges from
654
+ * `scripts/build-index.mjs` output.
655
+ */
656
+
657
+ declare const WarehouseIndex: z.ZodObject<{
658
+ schema_version: z.ZodLiteral<1>;
659
+ warehouse: z.ZodString;
660
+ generated_at: z.ZodString;
661
+ generator_version: z.ZodString;
662
+ count: z.ZodNumber;
663
+ entries: z.ZodArray<z.ZodObject<{
664
+ id: z.ZodUnion<[z.ZodString, z.ZodString]>;
665
+ path: z.ZodString;
666
+ title: z.ZodString;
667
+ tags: z.ZodArray<z.ZodString, "many">;
668
+ updated: z.ZodString;
669
+ last_reviewed: z.ZodString;
670
+ source_type: z.ZodEnum<["principle", "playbook", "framework", "template", "case-study", "decision", "reference", "snippet", "checklist", "rubric", "post-mortem"]>;
671
+ }, "strict", z.ZodTypeAny, {
672
+ path: string;
673
+ last_reviewed: string;
674
+ id: string;
675
+ title: string;
676
+ tags: string[];
677
+ updated: string;
678
+ source_type: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem";
679
+ }, {
680
+ path: string;
681
+ last_reviewed: string;
682
+ id: string;
683
+ title: string;
684
+ tags: string[];
685
+ updated: string;
686
+ source_type: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem";
687
+ }>, "many">;
688
+ health: z.ZodObject<{
689
+ decayed_entries: z.ZodNumber;
690
+ draft_entries: z.ZodNumber;
691
+ scorecard: z.ZodOptional<z.ZodNumber>;
692
+ }, "strict", z.ZodTypeAny, {
693
+ decayed_entries: number;
694
+ draft_entries: number;
695
+ scorecard?: number | undefined;
696
+ }, {
697
+ decayed_entries: number;
698
+ draft_entries: number;
699
+ scorecard?: number | undefined;
700
+ }>;
701
+ }, "strict", z.ZodTypeAny, {
702
+ entries: {
703
+ path: string;
704
+ last_reviewed: string;
705
+ id: string;
706
+ title: string;
707
+ tags: string[];
708
+ updated: string;
709
+ source_type: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem";
710
+ }[];
711
+ schema_version: 1;
712
+ warehouse: string;
713
+ generated_at: string;
714
+ generator_version: string;
715
+ count: number;
716
+ health: {
717
+ decayed_entries: number;
718
+ draft_entries: number;
719
+ scorecard?: number | undefined;
720
+ };
721
+ }, {
722
+ entries: {
723
+ path: string;
724
+ last_reviewed: string;
725
+ id: string;
726
+ title: string;
727
+ tags: string[];
728
+ updated: string;
729
+ source_type: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem";
730
+ }[];
731
+ schema_version: 1;
732
+ warehouse: string;
733
+ generated_at: string;
734
+ generator_version: string;
735
+ count: number;
736
+ health: {
737
+ decayed_entries: number;
738
+ draft_entries: number;
739
+ scorecard?: number | undefined;
740
+ };
741
+ }>;
742
+ type WarehouseIndex = z.infer<typeof WarehouseIndex>;
743
+
744
+ /**
745
+ * MCP tool envelopes — used by every MCP tool exposed by every warehouse.
746
+ *
747
+ * Enforced by @nexural/mcp-base at runtime (Zod parse on every req/resp).
748
+ *
749
+ * Per SCHEMA_CHARTER §4.4 + ADR-0008 (prompt-injection warning codes).
750
+ */
751
+
752
+ declare const McpToolRequest: z.ZodObject<{
753
+ schema_version: z.ZodLiteral<1>;
754
+ request_id: z.ZodString;
755
+ caller: z.ZodObject<{
756
+ kind: z.ZodEnum<["nx-cli", "agent", "dashboard", "test"]>;
757
+ session_id: z.ZodOptional<z.ZodString>;
758
+ user: z.ZodOptional<z.ZodString>;
759
+ }, "strict", z.ZodTypeAny, {
760
+ kind: "nx-cli" | "agent" | "dashboard" | "test";
761
+ session_id?: string | undefined;
762
+ user?: string | undefined;
763
+ }, {
764
+ kind: "nx-cli" | "agent" | "dashboard" | "test";
765
+ session_id?: string | undefined;
766
+ user?: string | undefined;
767
+ }>;
768
+ tool: z.ZodString;
769
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
770
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
771
+ }, "strict", z.ZodTypeAny, {
772
+ schema_version: 1;
773
+ request_id: string;
774
+ caller: {
775
+ kind: "nx-cli" | "agent" | "dashboard" | "test";
776
+ session_id?: string | undefined;
777
+ user?: string | undefined;
778
+ };
779
+ tool: string;
780
+ args: Record<string, unknown>;
781
+ timeout_ms: number;
782
+ }, {
783
+ schema_version: 1;
784
+ request_id: string;
785
+ caller: {
786
+ kind: "nx-cli" | "agent" | "dashboard" | "test";
787
+ session_id?: string | undefined;
788
+ user?: string | undefined;
789
+ };
790
+ tool: string;
791
+ args: Record<string, unknown>;
792
+ timeout_ms?: number | undefined;
793
+ }>;
794
+ type McpToolRequest = z.infer<typeof McpToolRequest>;
795
+ declare const McpToolResponse: z.ZodEffects<z.ZodObject<{
796
+ schema_version: z.ZodLiteral<1>;
797
+ request_id: z.ZodString;
798
+ warehouse: z.ZodString;
799
+ tool: z.ZodString;
800
+ ok: z.ZodBoolean;
801
+ latency_ms: z.ZodNumber;
802
+ data: z.ZodOptional<z.ZodUnknown>;
803
+ error: z.ZodOptional<z.ZodObject<{
804
+ code: z.ZodString;
805
+ message: z.ZodString;
806
+ retryable: z.ZodBoolean;
807
+ }, "strict", z.ZodTypeAny, {
808
+ code: string;
809
+ message: string;
810
+ retryable: boolean;
811
+ }, {
812
+ code: string;
813
+ message: string;
814
+ retryable: boolean;
815
+ }>>;
816
+ warnings: z.ZodDefault<z.ZodArray<z.ZodObject<{
817
+ code: z.ZodEnum<["stale", "draft-content", "low-confidence", "tier-mismatch", "deprecated", "tier_confinement_violation", "citation_stripped", "token_budget_trimmed"]>;
818
+ message: z.ZodString;
819
+ }, "strict", z.ZodTypeAny, {
820
+ code: "deprecated" | "tier_confinement_violation" | "stale" | "draft-content" | "low-confidence" | "tier-mismatch" | "citation_stripped" | "token_budget_trimmed";
821
+ message: string;
822
+ }, {
823
+ code: "deprecated" | "tier_confinement_violation" | "stale" | "draft-content" | "low-confidence" | "tier-mismatch" | "citation_stripped" | "token_budget_trimmed";
824
+ message: string;
825
+ }>, "many">>;
826
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
827
+ warehouse: z.ZodString;
828
+ id: z.ZodUnion<[z.ZodString, z.ZodString]>;
829
+ title: z.ZodOptional<z.ZodString>;
830
+ url: z.ZodOptional<z.ZodString>;
831
+ }, "strict", z.ZodTypeAny, {
832
+ warehouse: string;
833
+ id: string;
834
+ title?: string | undefined;
835
+ url?: string | undefined;
836
+ }, {
837
+ warehouse: string;
838
+ id: string;
839
+ title?: string | undefined;
840
+ url?: string | undefined;
841
+ }>, "many">>;
842
+ }, "strict", z.ZodTypeAny, {
843
+ schema_version: 1;
844
+ warehouse: string;
845
+ request_id: string;
846
+ tool: string;
847
+ ok: boolean;
848
+ latency_ms: number;
849
+ warnings: {
850
+ code: "deprecated" | "tier_confinement_violation" | "stale" | "draft-content" | "low-confidence" | "tier-mismatch" | "citation_stripped" | "token_budget_trimmed";
851
+ message: string;
852
+ }[];
853
+ citations: {
854
+ warehouse: string;
855
+ id: string;
856
+ title?: string | undefined;
857
+ url?: string | undefined;
858
+ }[];
859
+ data?: unknown;
860
+ error?: {
861
+ code: string;
862
+ message: string;
863
+ retryable: boolean;
864
+ } | undefined;
865
+ }, {
866
+ schema_version: 1;
867
+ warehouse: string;
868
+ request_id: string;
869
+ tool: string;
870
+ ok: boolean;
871
+ latency_ms: number;
872
+ data?: unknown;
873
+ error?: {
874
+ code: string;
875
+ message: string;
876
+ retryable: boolean;
877
+ } | undefined;
878
+ warnings?: {
879
+ code: "deprecated" | "tier_confinement_violation" | "stale" | "draft-content" | "low-confidence" | "tier-mismatch" | "citation_stripped" | "token_budget_trimmed";
880
+ message: string;
881
+ }[] | undefined;
882
+ citations?: {
883
+ warehouse: string;
884
+ id: string;
885
+ title?: string | undefined;
886
+ url?: string | undefined;
887
+ }[] | undefined;
888
+ }>, {
889
+ schema_version: 1;
890
+ warehouse: string;
891
+ request_id: string;
892
+ tool: string;
893
+ ok: boolean;
894
+ latency_ms: number;
895
+ warnings: {
896
+ code: "deprecated" | "tier_confinement_violation" | "stale" | "draft-content" | "low-confidence" | "tier-mismatch" | "citation_stripped" | "token_budget_trimmed";
897
+ message: string;
898
+ }[];
899
+ citations: {
900
+ warehouse: string;
901
+ id: string;
902
+ title?: string | undefined;
903
+ url?: string | undefined;
904
+ }[];
905
+ data?: unknown;
906
+ error?: {
907
+ code: string;
908
+ message: string;
909
+ retryable: boolean;
910
+ } | undefined;
911
+ }, {
912
+ schema_version: 1;
913
+ warehouse: string;
914
+ request_id: string;
915
+ tool: string;
916
+ ok: boolean;
917
+ latency_ms: number;
918
+ data?: unknown;
919
+ error?: {
920
+ code: string;
921
+ message: string;
922
+ retryable: boolean;
923
+ } | undefined;
924
+ warnings?: {
925
+ code: "deprecated" | "tier_confinement_violation" | "stale" | "draft-content" | "low-confidence" | "tier-mismatch" | "citation_stripped" | "token_budget_trimmed";
926
+ message: string;
927
+ }[] | undefined;
928
+ citations?: {
929
+ warehouse: string;
930
+ id: string;
931
+ title?: string | undefined;
932
+ url?: string | undefined;
933
+ }[] | undefined;
934
+ }>;
935
+ type McpToolResponse = z.infer<typeof McpToolResponse>;
936
+
937
+ /**
938
+ * Telemetry events — written by every component (nx, router, warehouse-mcp, ci, cron).
939
+ *
940
+ * **Privacy:** raw query strings and tool args are NEVER stored. Only hashes.
941
+ *
942
+ * Per SCHEMA_CHARTER §4.5 + ADR-0007 (CostEvent).
943
+ */
944
+
945
+ declare const ToolCallEvent: z.ZodObject<{
946
+ schema_version: z.ZodLiteral<1>;
947
+ event_id: z.ZodString;
948
+ ts: z.ZodString;
949
+ host: z.ZodString;
950
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
951
+ session_id: z.ZodOptional<z.ZodString>;
952
+ } & {
953
+ kind: z.ZodLiteral<"tool_call">;
954
+ warehouse: z.ZodString;
955
+ tool: z.ZodString;
956
+ latency_ms: z.ZodNumber;
957
+ ok: z.ZodBoolean;
958
+ error_code: z.ZodOptional<z.ZodString>;
959
+ }, "strict", z.ZodTypeAny, {
960
+ schema_version: 1;
961
+ warehouse: string;
962
+ kind: "tool_call";
963
+ tool: string;
964
+ ok: boolean;
965
+ latency_ms: number;
966
+ event_id: string;
967
+ ts: string;
968
+ host: string;
969
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
970
+ session_id?: string | undefined;
971
+ error_code?: string | undefined;
972
+ }, {
973
+ schema_version: 1;
974
+ warehouse: string;
975
+ kind: "tool_call";
976
+ tool: string;
977
+ ok: boolean;
978
+ latency_ms: number;
979
+ event_id: string;
980
+ ts: string;
981
+ host: string;
982
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
983
+ session_id?: string | undefined;
984
+ error_code?: string | undefined;
985
+ }>;
986
+ type ToolCallEvent = z.infer<typeof ToolCallEvent>;
987
+ declare const NxCommandEvent: z.ZodObject<{
988
+ schema_version: z.ZodLiteral<1>;
989
+ event_id: z.ZodString;
990
+ ts: z.ZodString;
991
+ host: z.ZodString;
992
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
993
+ session_id: z.ZodOptional<z.ZodString>;
994
+ } & {
995
+ kind: z.ZodLiteral<"nx_command">;
996
+ command: z.ZodString;
997
+ args_hash: z.ZodString;
998
+ latency_ms: z.ZodNumber;
999
+ exit_code: z.ZodNumber;
1000
+ }, "strict", z.ZodTypeAny, {
1001
+ schema_version: 1;
1002
+ kind: "nx_command";
1003
+ latency_ms: number;
1004
+ event_id: string;
1005
+ ts: string;
1006
+ host: string;
1007
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1008
+ command: string;
1009
+ args_hash: string;
1010
+ exit_code: number;
1011
+ session_id?: string | undefined;
1012
+ }, {
1013
+ schema_version: 1;
1014
+ kind: "nx_command";
1015
+ latency_ms: number;
1016
+ event_id: string;
1017
+ ts: string;
1018
+ host: string;
1019
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1020
+ command: string;
1021
+ args_hash: string;
1022
+ exit_code: number;
1023
+ session_id?: string | undefined;
1024
+ }>;
1025
+ type NxCommandEvent = z.infer<typeof NxCommandEvent>;
1026
+ declare const DecayWarnEvent: z.ZodObject<{
1027
+ schema_version: z.ZodLiteral<1>;
1028
+ event_id: z.ZodString;
1029
+ ts: z.ZodString;
1030
+ host: z.ZodString;
1031
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1032
+ session_id: z.ZodOptional<z.ZodString>;
1033
+ } & {
1034
+ kind: z.ZodLiteral<"decay_warn">;
1035
+ warehouse: z.ZodString;
1036
+ days_since_review: z.ZodNumber;
1037
+ decay_rate_days: z.ZodNumber;
1038
+ severity: z.ZodEnum<["warn", "quarantine"]>;
1039
+ }, "strict", z.ZodTypeAny, {
1040
+ schema_version: 1;
1041
+ decay_rate_days: number;
1042
+ warehouse: string;
1043
+ kind: "decay_warn";
1044
+ event_id: string;
1045
+ ts: string;
1046
+ host: string;
1047
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1048
+ days_since_review: number;
1049
+ severity: "warn" | "quarantine";
1050
+ session_id?: string | undefined;
1051
+ }, {
1052
+ schema_version: 1;
1053
+ decay_rate_days: number;
1054
+ warehouse: string;
1055
+ kind: "decay_warn";
1056
+ event_id: string;
1057
+ ts: string;
1058
+ host: string;
1059
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1060
+ days_since_review: number;
1061
+ severity: "warn" | "quarantine";
1062
+ session_id?: string | undefined;
1063
+ }>;
1064
+ type DecayWarnEvent = z.infer<typeof DecayWarnEvent>;
1065
+ declare const AuditEvent: z.ZodObject<{
1066
+ schema_version: z.ZodLiteral<1>;
1067
+ event_id: z.ZodString;
1068
+ ts: z.ZodString;
1069
+ host: z.ZodString;
1070
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1071
+ session_id: z.ZodOptional<z.ZodString>;
1072
+ } & {
1073
+ kind: z.ZodLiteral<"audit">;
1074
+ op: z.ZodEnum<["decrypt", "encrypt", "key_rotate", "key_lost", "key_added"]>;
1075
+ warehouse: z.ZodOptional<z.ZodString>;
1076
+ file_ulid: z.ZodOptional<z.ZodString>;
1077
+ key_id: z.ZodString;
1078
+ exit: z.ZodNumber;
1079
+ }, "strict", z.ZodTypeAny, {
1080
+ schema_version: 1;
1081
+ kind: "audit";
1082
+ event_id: string;
1083
+ ts: string;
1084
+ host: string;
1085
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1086
+ op: "decrypt" | "encrypt" | "key_rotate" | "key_lost" | "key_added";
1087
+ key_id: string;
1088
+ exit: number;
1089
+ warehouse?: string | undefined;
1090
+ session_id?: string | undefined;
1091
+ file_ulid?: string | undefined;
1092
+ }, {
1093
+ schema_version: 1;
1094
+ kind: "audit";
1095
+ event_id: string;
1096
+ ts: string;
1097
+ host: string;
1098
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1099
+ op: "decrypt" | "encrypt" | "key_rotate" | "key_lost" | "key_added";
1100
+ key_id: string;
1101
+ exit: number;
1102
+ warehouse?: string | undefined;
1103
+ session_id?: string | undefined;
1104
+ file_ulid?: string | undefined;
1105
+ }>;
1106
+ type AuditEvent = z.infer<typeof AuditEvent>;
1107
+ /** Per ADR-0007 §7 — emitted by @nexural/sdk.llmClient() cost wrapper. */
1108
+ declare const CostEvent: z.ZodObject<{
1109
+ schema_version: z.ZodLiteral<1>;
1110
+ event_id: z.ZodString;
1111
+ ts: z.ZodString;
1112
+ host: z.ZodString;
1113
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1114
+ session_id: z.ZodOptional<z.ZodString>;
1115
+ } & {
1116
+ kind: z.ZodLiteral<"cost_event">;
1117
+ app: z.ZodString;
1118
+ recipe: z.ZodString;
1119
+ severity: z.ZodEnum<["warn", "exceeded", "circuit_break"]>;
1120
+ scope: z.ZodEnum<["per_request", "per_user_day", "per_app_day"]>;
1121
+ projected_usd: z.ZodNumber;
1122
+ cap_usd: z.ZodNumber;
1123
+ user_hash: z.ZodOptional<z.ZodString>;
1124
+ }, "strict", z.ZodTypeAny, {
1125
+ schema_version: 1;
1126
+ kind: "cost_event";
1127
+ event_id: string;
1128
+ ts: string;
1129
+ host: string;
1130
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1131
+ severity: "warn" | "exceeded" | "circuit_break";
1132
+ app: string;
1133
+ recipe: string;
1134
+ scope: "per_request" | "per_user_day" | "per_app_day";
1135
+ projected_usd: number;
1136
+ cap_usd: number;
1137
+ session_id?: string | undefined;
1138
+ user_hash?: string | undefined;
1139
+ }, {
1140
+ schema_version: 1;
1141
+ kind: "cost_event";
1142
+ event_id: string;
1143
+ ts: string;
1144
+ host: string;
1145
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1146
+ severity: "warn" | "exceeded" | "circuit_break";
1147
+ app: string;
1148
+ recipe: string;
1149
+ scope: "per_request" | "per_user_day" | "per_app_day";
1150
+ projected_usd: number;
1151
+ cap_usd: number;
1152
+ session_id?: string | undefined;
1153
+ user_hash?: string | undefined;
1154
+ }>;
1155
+ type CostEvent = z.infer<typeof CostEvent>;
1156
+ declare const TelemetryEvent: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1157
+ schema_version: z.ZodLiteral<1>;
1158
+ event_id: z.ZodString;
1159
+ ts: z.ZodString;
1160
+ host: z.ZodString;
1161
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1162
+ session_id: z.ZodOptional<z.ZodString>;
1163
+ } & {
1164
+ kind: z.ZodLiteral<"tool_call">;
1165
+ warehouse: z.ZodString;
1166
+ tool: z.ZodString;
1167
+ latency_ms: z.ZodNumber;
1168
+ ok: z.ZodBoolean;
1169
+ error_code: z.ZodOptional<z.ZodString>;
1170
+ }, "strict", z.ZodTypeAny, {
1171
+ schema_version: 1;
1172
+ warehouse: string;
1173
+ kind: "tool_call";
1174
+ tool: string;
1175
+ ok: boolean;
1176
+ latency_ms: number;
1177
+ event_id: string;
1178
+ ts: string;
1179
+ host: string;
1180
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1181
+ session_id?: string | undefined;
1182
+ error_code?: string | undefined;
1183
+ }, {
1184
+ schema_version: 1;
1185
+ warehouse: string;
1186
+ kind: "tool_call";
1187
+ tool: string;
1188
+ ok: boolean;
1189
+ latency_ms: number;
1190
+ event_id: string;
1191
+ ts: string;
1192
+ host: string;
1193
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1194
+ session_id?: string | undefined;
1195
+ error_code?: string | undefined;
1196
+ }>, z.ZodObject<{
1197
+ schema_version: z.ZodLiteral<1>;
1198
+ event_id: z.ZodString;
1199
+ ts: z.ZodString;
1200
+ host: z.ZodString;
1201
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1202
+ session_id: z.ZodOptional<z.ZodString>;
1203
+ } & {
1204
+ kind: z.ZodLiteral<"nx_command">;
1205
+ command: z.ZodString;
1206
+ args_hash: z.ZodString;
1207
+ latency_ms: z.ZodNumber;
1208
+ exit_code: z.ZodNumber;
1209
+ }, "strict", z.ZodTypeAny, {
1210
+ schema_version: 1;
1211
+ kind: "nx_command";
1212
+ latency_ms: number;
1213
+ event_id: string;
1214
+ ts: string;
1215
+ host: string;
1216
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1217
+ command: string;
1218
+ args_hash: string;
1219
+ exit_code: number;
1220
+ session_id?: string | undefined;
1221
+ }, {
1222
+ schema_version: 1;
1223
+ kind: "nx_command";
1224
+ latency_ms: number;
1225
+ event_id: string;
1226
+ ts: string;
1227
+ host: string;
1228
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1229
+ command: string;
1230
+ args_hash: string;
1231
+ exit_code: number;
1232
+ session_id?: string | undefined;
1233
+ }>, z.ZodObject<{
1234
+ schema_version: z.ZodLiteral<1>;
1235
+ event_id: z.ZodString;
1236
+ ts: z.ZodString;
1237
+ host: z.ZodString;
1238
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1239
+ session_id: z.ZodOptional<z.ZodString>;
1240
+ } & {
1241
+ kind: z.ZodLiteral<"decay_warn">;
1242
+ warehouse: z.ZodString;
1243
+ days_since_review: z.ZodNumber;
1244
+ decay_rate_days: z.ZodNumber;
1245
+ severity: z.ZodEnum<["warn", "quarantine"]>;
1246
+ }, "strict", z.ZodTypeAny, {
1247
+ schema_version: 1;
1248
+ decay_rate_days: number;
1249
+ warehouse: string;
1250
+ kind: "decay_warn";
1251
+ event_id: string;
1252
+ ts: string;
1253
+ host: string;
1254
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1255
+ days_since_review: number;
1256
+ severity: "warn" | "quarantine";
1257
+ session_id?: string | undefined;
1258
+ }, {
1259
+ schema_version: 1;
1260
+ decay_rate_days: number;
1261
+ warehouse: string;
1262
+ kind: "decay_warn";
1263
+ event_id: string;
1264
+ ts: string;
1265
+ host: string;
1266
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1267
+ days_since_review: number;
1268
+ severity: "warn" | "quarantine";
1269
+ session_id?: string | undefined;
1270
+ }>, z.ZodObject<{
1271
+ schema_version: z.ZodLiteral<1>;
1272
+ event_id: z.ZodString;
1273
+ ts: z.ZodString;
1274
+ host: z.ZodString;
1275
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1276
+ session_id: z.ZodOptional<z.ZodString>;
1277
+ } & {
1278
+ kind: z.ZodLiteral<"audit">;
1279
+ op: z.ZodEnum<["decrypt", "encrypt", "key_rotate", "key_lost", "key_added"]>;
1280
+ warehouse: z.ZodOptional<z.ZodString>;
1281
+ file_ulid: z.ZodOptional<z.ZodString>;
1282
+ key_id: z.ZodString;
1283
+ exit: z.ZodNumber;
1284
+ }, "strict", z.ZodTypeAny, {
1285
+ schema_version: 1;
1286
+ kind: "audit";
1287
+ event_id: string;
1288
+ ts: string;
1289
+ host: string;
1290
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1291
+ op: "decrypt" | "encrypt" | "key_rotate" | "key_lost" | "key_added";
1292
+ key_id: string;
1293
+ exit: number;
1294
+ warehouse?: string | undefined;
1295
+ session_id?: string | undefined;
1296
+ file_ulid?: string | undefined;
1297
+ }, {
1298
+ schema_version: 1;
1299
+ kind: "audit";
1300
+ event_id: string;
1301
+ ts: string;
1302
+ host: string;
1303
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1304
+ op: "decrypt" | "encrypt" | "key_rotate" | "key_lost" | "key_added";
1305
+ key_id: string;
1306
+ exit: number;
1307
+ warehouse?: string | undefined;
1308
+ session_id?: string | undefined;
1309
+ file_ulid?: string | undefined;
1310
+ }>, z.ZodObject<{
1311
+ schema_version: z.ZodLiteral<1>;
1312
+ event_id: z.ZodString;
1313
+ ts: z.ZodString;
1314
+ host: z.ZodString;
1315
+ process: z.ZodEnum<["nx", "router", "warehouse-mcp", "ci", "cron"]>;
1316
+ session_id: z.ZodOptional<z.ZodString>;
1317
+ } & {
1318
+ kind: z.ZodLiteral<"cost_event">;
1319
+ app: z.ZodString;
1320
+ recipe: z.ZodString;
1321
+ severity: z.ZodEnum<["warn", "exceeded", "circuit_break"]>;
1322
+ scope: z.ZodEnum<["per_request", "per_user_day", "per_app_day"]>;
1323
+ projected_usd: z.ZodNumber;
1324
+ cap_usd: z.ZodNumber;
1325
+ user_hash: z.ZodOptional<z.ZodString>;
1326
+ }, "strict", z.ZodTypeAny, {
1327
+ schema_version: 1;
1328
+ kind: "cost_event";
1329
+ event_id: string;
1330
+ ts: string;
1331
+ host: string;
1332
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1333
+ severity: "warn" | "exceeded" | "circuit_break";
1334
+ app: string;
1335
+ recipe: string;
1336
+ scope: "per_request" | "per_user_day" | "per_app_day";
1337
+ projected_usd: number;
1338
+ cap_usd: number;
1339
+ session_id?: string | undefined;
1340
+ user_hash?: string | undefined;
1341
+ }, {
1342
+ schema_version: 1;
1343
+ kind: "cost_event";
1344
+ event_id: string;
1345
+ ts: string;
1346
+ host: string;
1347
+ process: "nx" | "router" | "warehouse-mcp" | "ci" | "cron";
1348
+ severity: "warn" | "exceeded" | "circuit_break";
1349
+ app: string;
1350
+ recipe: string;
1351
+ scope: "per_request" | "per_user_day" | "per_app_day";
1352
+ projected_usd: number;
1353
+ cap_usd: number;
1354
+ session_id?: string | undefined;
1355
+ user_hash?: string | undefined;
1356
+ }>]>;
1357
+ type TelemetryEvent = z.infer<typeof TelemetryEvent>;
1358
+
1359
+ /**
1360
+ * ScorecardReport — generated artifact produced by nexural-qa-os
1361
+ * verify-all run. Lives at `nexural-meta/scorecard.json`.
1362
+ */
1363
+
1364
+ declare const ScorecardReport: z.ZodObject<{
1365
+ schema_version: z.ZodLiteral<1>;
1366
+ generated_at: z.ZodString;
1367
+ warehouses: z.ZodArray<z.ZodObject<{
1368
+ name: z.ZodString;
1369
+ federation: z.ZodEnum<["factory", "lifeops"]>;
1370
+ score: z.ZodNumber;
1371
+ grade: z.ZodEnum<["S", "A", "B", "C", "D", "F"]>;
1372
+ findings: z.ZodArray<z.ZodObject<{
1373
+ category: z.ZodString;
1374
+ severity: z.ZodEnum<["info", "warn", "error", "critical"]>;
1375
+ message: z.ZodString;
1376
+ file: z.ZodOptional<z.ZodString>;
1377
+ }, "strict", z.ZodTypeAny, {
1378
+ message: string;
1379
+ severity: "error" | "warn" | "info" | "critical";
1380
+ category: string;
1381
+ file?: string | undefined;
1382
+ }, {
1383
+ message: string;
1384
+ severity: "error" | "warn" | "info" | "critical";
1385
+ category: string;
1386
+ file?: string | undefined;
1387
+ }>, "many">;
1388
+ }, "strict", z.ZodTypeAny, {
1389
+ name: string;
1390
+ federation: "factory" | "lifeops";
1391
+ score: number;
1392
+ grade: "S" | "A" | "B" | "C" | "D" | "F";
1393
+ findings: {
1394
+ message: string;
1395
+ severity: "error" | "warn" | "info" | "critical";
1396
+ category: string;
1397
+ file?: string | undefined;
1398
+ }[];
1399
+ }, {
1400
+ name: string;
1401
+ federation: "factory" | "lifeops";
1402
+ score: number;
1403
+ grade: "S" | "A" | "B" | "C" | "D" | "F";
1404
+ findings: {
1405
+ message: string;
1406
+ severity: "error" | "warn" | "info" | "critical";
1407
+ category: string;
1408
+ file?: string | undefined;
1409
+ }[];
1410
+ }>, "many">;
1411
+ aggregate: z.ZodObject<{
1412
+ mean_score: z.ZodNumber;
1413
+ median_score: z.ZodNumber;
1414
+ below_80_count: z.ZodNumber;
1415
+ below_90_count: z.ZodNumber;
1416
+ }, "strict", z.ZodTypeAny, {
1417
+ mean_score: number;
1418
+ median_score: number;
1419
+ below_80_count: number;
1420
+ below_90_count: number;
1421
+ }, {
1422
+ mean_score: number;
1423
+ median_score: number;
1424
+ below_80_count: number;
1425
+ below_90_count: number;
1426
+ }>;
1427
+ }, "strict", z.ZodTypeAny, {
1428
+ schema_version: 1;
1429
+ generated_at: string;
1430
+ warehouses: {
1431
+ name: string;
1432
+ federation: "factory" | "lifeops";
1433
+ score: number;
1434
+ grade: "S" | "A" | "B" | "C" | "D" | "F";
1435
+ findings: {
1436
+ message: string;
1437
+ severity: "error" | "warn" | "info" | "critical";
1438
+ category: string;
1439
+ file?: string | undefined;
1440
+ }[];
1441
+ }[];
1442
+ aggregate: {
1443
+ mean_score: number;
1444
+ median_score: number;
1445
+ below_80_count: number;
1446
+ below_90_count: number;
1447
+ };
1448
+ }, {
1449
+ schema_version: 1;
1450
+ generated_at: string;
1451
+ warehouses: {
1452
+ name: string;
1453
+ federation: "factory" | "lifeops";
1454
+ score: number;
1455
+ grade: "S" | "A" | "B" | "C" | "D" | "F";
1456
+ findings: {
1457
+ message: string;
1458
+ severity: "error" | "warn" | "info" | "critical";
1459
+ category: string;
1460
+ file?: string | undefined;
1461
+ }[];
1462
+ }[];
1463
+ aggregate: {
1464
+ mean_score: number;
1465
+ median_score: number;
1466
+ below_80_count: number;
1467
+ below_90_count: number;
1468
+ };
1469
+ }>;
1470
+ type ScorecardReport = z.infer<typeof ScorecardReport>;
1471
+
1472
+ /**
1473
+ * Registry — generated per-federation artifact. Two files exist per ADR-0003:
1474
+ * - registry-factory.yaml
1475
+ * - registry-lifeops.yaml
1476
+ *
1477
+ * Generated nightly by `scripts/discover.mjs`. NEVER hand-edited.
1478
+ */
1479
+
1480
+ declare const Registry: z.ZodObject<{
1481
+ schema_version: z.ZodLiteral<1>;
1482
+ federation: z.ZodEnum<["factory", "lifeops"]>;
1483
+ generated_at: z.ZodString;
1484
+ warehouses: z.ZodArray<z.ZodObject<{
1485
+ name: z.ZodString;
1486
+ tier: z.ZodEnum<["public", "internal", "private-encrypted"]>;
1487
+ status: z.ZodEnum<["active", "seeded", "archived", "deprecated", "merged"]>;
1488
+ repo: z.ZodString;
1489
+ last_reviewed: z.ZodString;
1490
+ decay_rate_days: z.ZodNumber;
1491
+ discovered_via: z.ZodEnum<["github-topic", "explicit-list", "manual-add"]>;
1492
+ }, "strict", z.ZodTypeAny, {
1493
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
1494
+ repo: string;
1495
+ name: string;
1496
+ tier: "public" | "internal" | "private-encrypted";
1497
+ last_reviewed: string;
1498
+ decay_rate_days: number;
1499
+ discovered_via: "github-topic" | "explicit-list" | "manual-add";
1500
+ }, {
1501
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
1502
+ repo: string;
1503
+ name: string;
1504
+ tier: "public" | "internal" | "private-encrypted";
1505
+ last_reviewed: string;
1506
+ decay_rate_days: number;
1507
+ discovered_via: "github-topic" | "explicit-list" | "manual-add";
1508
+ }>, "many">;
1509
+ }, "strict", z.ZodTypeAny, {
1510
+ schema_version: 1;
1511
+ federation: "factory" | "lifeops";
1512
+ generated_at: string;
1513
+ warehouses: {
1514
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
1515
+ repo: string;
1516
+ name: string;
1517
+ tier: "public" | "internal" | "private-encrypted";
1518
+ last_reviewed: string;
1519
+ decay_rate_days: number;
1520
+ discovered_via: "github-topic" | "explicit-list" | "manual-add";
1521
+ }[];
1522
+ }, {
1523
+ schema_version: 1;
1524
+ federation: "factory" | "lifeops";
1525
+ generated_at: string;
1526
+ warehouses: {
1527
+ status: "active" | "seeded" | "archived" | "deprecated" | "merged";
1528
+ repo: string;
1529
+ name: string;
1530
+ tier: "public" | "internal" | "private-encrypted";
1531
+ last_reviewed: string;
1532
+ decay_rate_days: number;
1533
+ discovered_via: "github-topic" | "explicit-list" | "manual-add";
1534
+ }[];
1535
+ }>;
1536
+ type Registry = z.infer<typeof Registry>;
1537
+
1538
+ /**
1539
+ * CrossRefReport — generated artifact validating `related` links across the federation.
1540
+ *
1541
+ * Produced nightly by `scripts/cross-refs.mjs`.
1542
+ */
1543
+
1544
+ declare const CrossRefReport: z.ZodObject<{
1545
+ schema_version: z.ZodLiteral<1>;
1546
+ generated_at: z.ZodString;
1547
+ links: z.ZodArray<z.ZodObject<{
1548
+ from_warehouse: z.ZodString;
1549
+ from_id: z.ZodUnion<[z.ZodString, z.ZodString]>;
1550
+ to_warehouse: z.ZodString;
1551
+ to_id: z.ZodUnion<[z.ZodString, z.ZodString]>;
1552
+ relation: z.ZodString;
1553
+ valid: z.ZodBoolean;
1554
+ reason: z.ZodOptional<z.ZodString>;
1555
+ }, "strict", z.ZodTypeAny, {
1556
+ valid: boolean;
1557
+ relation: string;
1558
+ from_warehouse: string;
1559
+ from_id: string;
1560
+ to_warehouse: string;
1561
+ to_id: string;
1562
+ reason?: string | undefined;
1563
+ }, {
1564
+ valid: boolean;
1565
+ relation: string;
1566
+ from_warehouse: string;
1567
+ from_id: string;
1568
+ to_warehouse: string;
1569
+ to_id: string;
1570
+ reason?: string | undefined;
1571
+ }>, "many">;
1572
+ summary: z.ZodObject<{
1573
+ total: z.ZodNumber;
1574
+ broken: z.ZodNumber;
1575
+ orphan_warehouses: z.ZodArray<z.ZodString, "many">;
1576
+ }, "strict", z.ZodTypeAny, {
1577
+ total: number;
1578
+ broken: number;
1579
+ orphan_warehouses: string[];
1580
+ }, {
1581
+ total: number;
1582
+ broken: number;
1583
+ orphan_warehouses: string[];
1584
+ }>;
1585
+ }, "strict", z.ZodTypeAny, {
1586
+ schema_version: 1;
1587
+ links: {
1588
+ valid: boolean;
1589
+ relation: string;
1590
+ from_warehouse: string;
1591
+ from_id: string;
1592
+ to_warehouse: string;
1593
+ to_id: string;
1594
+ reason?: string | undefined;
1595
+ }[];
1596
+ summary: {
1597
+ total: number;
1598
+ broken: number;
1599
+ orphan_warehouses: string[];
1600
+ };
1601
+ generated_at: string;
1602
+ }, {
1603
+ schema_version: 1;
1604
+ links: {
1605
+ valid: boolean;
1606
+ relation: string;
1607
+ from_warehouse: string;
1608
+ from_id: string;
1609
+ to_warehouse: string;
1610
+ to_id: string;
1611
+ reason?: string | undefined;
1612
+ }[];
1613
+ summary: {
1614
+ total: number;
1615
+ broken: number;
1616
+ orphan_warehouses: string[];
1617
+ };
1618
+ generated_at: string;
1619
+ }>;
1620
+ type CrossRefReport = z.infer<typeof CrossRefReport>;
1621
+
1622
+ /**
1623
+ * DecayConfig — `.nexural/decay.yaml` inside any warehouse.
1624
+ *
1625
+ * Allows per-warehouse override of decay rate plus targeted overrides
1626
+ * for specific tags / source_types / path globs.
1627
+ */
1628
+
1629
+ declare const DecayConfig: z.ZodObject<{
1630
+ schema_version: z.ZodLiteral<1>;
1631
+ default_days: z.ZodOptional<z.ZodNumber>;
1632
+ overrides: z.ZodDefault<z.ZodArray<z.ZodObject<{
1633
+ match: z.ZodObject<{
1634
+ tag: z.ZodOptional<z.ZodString>;
1635
+ source_type: z.ZodOptional<z.ZodEnum<["principle", "playbook", "framework", "template", "case-study", "decision", "reference", "snippet", "checklist", "rubric", "post-mortem"]>>;
1636
+ path_glob: z.ZodOptional<z.ZodString>;
1637
+ }, "strict", z.ZodTypeAny, {
1638
+ source_type?: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem" | undefined;
1639
+ tag?: string | undefined;
1640
+ path_glob?: string | undefined;
1641
+ }, {
1642
+ source_type?: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem" | undefined;
1643
+ tag?: string | undefined;
1644
+ path_glob?: string | undefined;
1645
+ }>;
1646
+ decay_days: z.ZodNumber;
1647
+ }, "strict", z.ZodTypeAny, {
1648
+ match: {
1649
+ source_type?: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem" | undefined;
1650
+ tag?: string | undefined;
1651
+ path_glob?: string | undefined;
1652
+ };
1653
+ decay_days: number;
1654
+ }, {
1655
+ match: {
1656
+ source_type?: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem" | undefined;
1657
+ tag?: string | undefined;
1658
+ path_glob?: string | undefined;
1659
+ };
1660
+ decay_days: number;
1661
+ }>, "many">>;
1662
+ }, "strict", z.ZodTypeAny, {
1663
+ schema_version: 1;
1664
+ overrides: {
1665
+ match: {
1666
+ source_type?: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem" | undefined;
1667
+ tag?: string | undefined;
1668
+ path_glob?: string | undefined;
1669
+ };
1670
+ decay_days: number;
1671
+ }[];
1672
+ default_days?: number | undefined;
1673
+ }, {
1674
+ schema_version: 1;
1675
+ default_days?: number | undefined;
1676
+ overrides?: {
1677
+ match: {
1678
+ source_type?: "principle" | "playbook" | "framework" | "template" | "case-study" | "decision" | "reference" | "snippet" | "checklist" | "rubric" | "post-mortem" | undefined;
1679
+ tag?: string | undefined;
1680
+ path_glob?: string | undefined;
1681
+ };
1682
+ decay_days: number;
1683
+ }[] | undefined;
1684
+ }>;
1685
+ type DecayConfig = z.infer<typeof DecayConfig>;
1686
+
1687
+ /**
1688
+ * ADR frontmatter — for ADRs in `nexural-meta/docs/adr/NNNN-*.md`.
1689
+ *
1690
+ * Pre-commit + CI enforces this on ADR creation per ARCHITECTURE §12.
1691
+ */
1692
+
1693
+ declare const AdrFrontmatter: z.ZodObject<{
1694
+ number: z.ZodNumber;
1695
+ title: z.ZodString;
1696
+ status: z.ZodEnum<["proposed", "accepted", "superseded", "deprecated"]>;
1697
+ supersedes: z.ZodOptional<z.ZodNumber>;
1698
+ superseded_by: z.ZodOptional<z.ZodNumber>;
1699
+ date: z.ZodString;
1700
+ deciders: z.ZodArray<z.ZodString, "many">;
1701
+ soak_until: z.ZodString;
1702
+ }, "strict", z.ZodTypeAny, {
1703
+ number: number;
1704
+ status: "deprecated" | "proposed" | "accepted" | "superseded";
1705
+ date: string;
1706
+ title: string;
1707
+ deciders: string[];
1708
+ soak_until: string;
1709
+ supersedes?: number | undefined;
1710
+ superseded_by?: number | undefined;
1711
+ }, {
1712
+ number: number;
1713
+ status: "deprecated" | "proposed" | "accepted" | "superseded";
1714
+ date: string;
1715
+ title: string;
1716
+ deciders: string[];
1717
+ soak_until: string;
1718
+ supersedes?: number | undefined;
1719
+ superseded_by?: number | undefined;
1720
+ }>;
1721
+ type AdrFrontmatter = z.infer<typeof AdrFrontmatter>;
1722
+
1723
+ /**
1724
+ * Recipe family — RecipeManifest, ForgedLockfile, CostEnvelope, ServiceDeclaration.
1725
+ *
1726
+ * Canonical reference: docs/SCHEMA_AMENDMENTS.md.
1727
+ * Source ADRs: 0002 (factory), 0004 (polyglot), 0006 (lockfile/signing/license),
1728
+ * 0007 (cost envelope), 0008 (per-recipe docs), 0009 (forge sandbox).
1729
+ */
1730
+
1731
+ declare const ServiceDeclaration: z.ZodDiscriminatedUnion<"runtime", [z.ZodObject<{
1732
+ id: z.ZodString;
1733
+ runtime: z.ZodLiteral<"nextjs">;
1734
+ language: z.ZodLiteral<"typescript">;
1735
+ host: z.ZodEnum<["vercel", "cloudflare-pages"]>;
1736
+ }, "strict", z.ZodTypeAny, {
1737
+ id: string;
1738
+ host: "vercel" | "cloudflare-pages";
1739
+ runtime: "nextjs";
1740
+ language: "typescript";
1741
+ }, {
1742
+ id: string;
1743
+ host: "vercel" | "cloudflare-pages";
1744
+ runtime: "nextjs";
1745
+ language: "typescript";
1746
+ }>, z.ZodObject<{
1747
+ id: z.ZodString;
1748
+ runtime: z.ZodLiteral<"modal">;
1749
+ language: z.ZodLiteral<"python">;
1750
+ python_version: z.ZodEnum<["3.11", "3.12"]>;
1751
+ deps: z.ZodString;
1752
+ host: z.ZodLiteral<"modal">;
1753
+ contract: z.ZodString;
1754
+ gpu: z.ZodDefault<z.ZodEnum<["none", "t4", "a10g", "a100"]>>;
1755
+ }, "strict", z.ZodTypeAny, {
1756
+ id: string;
1757
+ host: "modal";
1758
+ runtime: "modal";
1759
+ language: "python";
1760
+ python_version: "3.11" | "3.12";
1761
+ deps: string;
1762
+ contract: string;
1763
+ gpu: "none" | "t4" | "a10g" | "a100";
1764
+ }, {
1765
+ id: string;
1766
+ host: "modal";
1767
+ runtime: "modal";
1768
+ language: "python";
1769
+ python_version: "3.11" | "3.12";
1770
+ deps: string;
1771
+ contract: string;
1772
+ gpu?: "none" | "t4" | "a10g" | "a100" | undefined;
1773
+ }>, z.ZodObject<{
1774
+ id: z.ZodString;
1775
+ runtime: z.ZodLiteral<"railway">;
1776
+ language: z.ZodEnum<["python", "node"]>;
1777
+ deps: z.ZodString;
1778
+ host: z.ZodLiteral<"railway">;
1779
+ contract: z.ZodString;
1780
+ }, "strict", z.ZodTypeAny, {
1781
+ id: string;
1782
+ host: "railway";
1783
+ runtime: "railway";
1784
+ language: "python" | "node";
1785
+ deps: string;
1786
+ contract: string;
1787
+ }, {
1788
+ id: string;
1789
+ host: "railway";
1790
+ runtime: "railway";
1791
+ language: "python" | "node";
1792
+ deps: string;
1793
+ contract: string;
1794
+ }>, z.ZodObject<{
1795
+ id: z.ZodString;
1796
+ runtime: z.ZodLiteral<"cloudflare-worker">;
1797
+ language: z.ZodLiteral<"typescript">;
1798
+ host: z.ZodLiteral<"cloudflare">;
1799
+ contract: z.ZodOptional<z.ZodString>;
1800
+ }, "strict", z.ZodTypeAny, {
1801
+ id: string;
1802
+ host: "cloudflare";
1803
+ runtime: "cloudflare-worker";
1804
+ language: "typescript";
1805
+ contract?: string | undefined;
1806
+ }, {
1807
+ id: string;
1808
+ host: "cloudflare";
1809
+ runtime: "cloudflare-worker";
1810
+ language: "typescript";
1811
+ contract?: string | undefined;
1812
+ }>]>;
1813
+ type ServiceDeclaration = z.infer<typeof ServiceDeclaration>;
1814
+ declare const CostEnvelope: z.ZodObject<{
1815
+ per_request_p50_usd: z.ZodNumber;
1816
+ per_request_p99_usd: z.ZodNumber;
1817
+ monthly_baseline_usd: z.ZodNumber;
1818
+ hard_caps: z.ZodObject<{
1819
+ per_request_usd: z.ZodNumber;
1820
+ per_user_per_day_usd: z.ZodNumber;
1821
+ per_app_per_day_usd: z.ZodNumber;
1822
+ }, "strict", z.ZodTypeAny, {
1823
+ per_request_usd: number;
1824
+ per_user_per_day_usd: number;
1825
+ per_app_per_day_usd: number;
1826
+ }, {
1827
+ per_request_usd: number;
1828
+ per_user_per_day_usd: number;
1829
+ per_app_per_day_usd: number;
1830
+ }>;
1831
+ }, "strict", z.ZodTypeAny, {
1832
+ per_request_p50_usd: number;
1833
+ per_request_p99_usd: number;
1834
+ monthly_baseline_usd: number;
1835
+ hard_caps: {
1836
+ per_request_usd: number;
1837
+ per_user_per_day_usd: number;
1838
+ per_app_per_day_usd: number;
1839
+ };
1840
+ }, {
1841
+ per_request_p50_usd: number;
1842
+ per_request_p99_usd: number;
1843
+ monthly_baseline_usd: number;
1844
+ hard_caps: {
1845
+ per_request_usd: number;
1846
+ per_user_per_day_usd: number;
1847
+ per_app_per_day_usd: number;
1848
+ };
1849
+ }>;
1850
+ type CostEnvelope = z.infer<typeof CostEnvelope>;
1851
+ declare const RecipeManifest: z.ZodEffects<z.ZodObject<{
1852
+ schema_version: z.ZodLiteral<1>;
1853
+ name: z.ZodString;
1854
+ version: z.ZodString;
1855
+ description: z.ZodString;
1856
+ extends: z.ZodOptional<z.ZodString>;
1857
+ composes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1858
+ inputs_schema: z.ZodString;
1859
+ warehouses: z.ZodArray<z.ZodString, "many">;
1860
+ services: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"runtime", [z.ZodObject<{
1861
+ id: z.ZodString;
1862
+ runtime: z.ZodLiteral<"nextjs">;
1863
+ language: z.ZodLiteral<"typescript">;
1864
+ host: z.ZodEnum<["vercel", "cloudflare-pages"]>;
1865
+ }, "strict", z.ZodTypeAny, {
1866
+ id: string;
1867
+ host: "vercel" | "cloudflare-pages";
1868
+ runtime: "nextjs";
1869
+ language: "typescript";
1870
+ }, {
1871
+ id: string;
1872
+ host: "vercel" | "cloudflare-pages";
1873
+ runtime: "nextjs";
1874
+ language: "typescript";
1875
+ }>, z.ZodObject<{
1876
+ id: z.ZodString;
1877
+ runtime: z.ZodLiteral<"modal">;
1878
+ language: z.ZodLiteral<"python">;
1879
+ python_version: z.ZodEnum<["3.11", "3.12"]>;
1880
+ deps: z.ZodString;
1881
+ host: z.ZodLiteral<"modal">;
1882
+ contract: z.ZodString;
1883
+ gpu: z.ZodDefault<z.ZodEnum<["none", "t4", "a10g", "a100"]>>;
1884
+ }, "strict", z.ZodTypeAny, {
1885
+ id: string;
1886
+ host: "modal";
1887
+ runtime: "modal";
1888
+ language: "python";
1889
+ python_version: "3.11" | "3.12";
1890
+ deps: string;
1891
+ contract: string;
1892
+ gpu: "none" | "t4" | "a10g" | "a100";
1893
+ }, {
1894
+ id: string;
1895
+ host: "modal";
1896
+ runtime: "modal";
1897
+ language: "python";
1898
+ python_version: "3.11" | "3.12";
1899
+ deps: string;
1900
+ contract: string;
1901
+ gpu?: "none" | "t4" | "a10g" | "a100" | undefined;
1902
+ }>, z.ZodObject<{
1903
+ id: z.ZodString;
1904
+ runtime: z.ZodLiteral<"railway">;
1905
+ language: z.ZodEnum<["python", "node"]>;
1906
+ deps: z.ZodString;
1907
+ host: z.ZodLiteral<"railway">;
1908
+ contract: z.ZodString;
1909
+ }, "strict", z.ZodTypeAny, {
1910
+ id: string;
1911
+ host: "railway";
1912
+ runtime: "railway";
1913
+ language: "python" | "node";
1914
+ deps: string;
1915
+ contract: string;
1916
+ }, {
1917
+ id: string;
1918
+ host: "railway";
1919
+ runtime: "railway";
1920
+ language: "python" | "node";
1921
+ deps: string;
1922
+ contract: string;
1923
+ }>, z.ZodObject<{
1924
+ id: z.ZodString;
1925
+ runtime: z.ZodLiteral<"cloudflare-worker">;
1926
+ language: z.ZodLiteral<"typescript">;
1927
+ host: z.ZodLiteral<"cloudflare">;
1928
+ contract: z.ZodOptional<z.ZodString>;
1929
+ }, "strict", z.ZodTypeAny, {
1930
+ id: string;
1931
+ host: "cloudflare";
1932
+ runtime: "cloudflare-worker";
1933
+ language: "typescript";
1934
+ contract?: string | undefined;
1935
+ }, {
1936
+ id: string;
1937
+ host: "cloudflare";
1938
+ runtime: "cloudflare-worker";
1939
+ language: "typescript";
1940
+ contract?: string | undefined;
1941
+ }>]>, "many">>;
1942
+ qa_profile: z.ZodDefault<z.ZodEnum<["fast", "standard", "thorough", "deep"]>>;
1943
+ cost_envelope: z.ZodObject<{
1944
+ per_request_p50_usd: z.ZodNumber;
1945
+ per_request_p99_usd: z.ZodNumber;
1946
+ monthly_baseline_usd: z.ZodNumber;
1947
+ hard_caps: z.ZodObject<{
1948
+ per_request_usd: z.ZodNumber;
1949
+ per_user_per_day_usd: z.ZodNumber;
1950
+ per_app_per_day_usd: z.ZodNumber;
1951
+ }, "strict", z.ZodTypeAny, {
1952
+ per_request_usd: number;
1953
+ per_user_per_day_usd: number;
1954
+ per_app_per_day_usd: number;
1955
+ }, {
1956
+ per_request_usd: number;
1957
+ per_user_per_day_usd: number;
1958
+ per_app_per_day_usd: number;
1959
+ }>;
1960
+ }, "strict", z.ZodTypeAny, {
1961
+ per_request_p50_usd: number;
1962
+ per_request_p99_usd: number;
1963
+ monthly_baseline_usd: number;
1964
+ hard_caps: {
1965
+ per_request_usd: number;
1966
+ per_user_per_day_usd: number;
1967
+ per_app_per_day_usd: number;
1968
+ };
1969
+ }, {
1970
+ per_request_p50_usd: number;
1971
+ per_request_p99_usd: number;
1972
+ monthly_baseline_usd: number;
1973
+ hard_caps: {
1974
+ per_request_usd: number;
1975
+ per_user_per_day_usd: number;
1976
+ per_app_per_day_usd: number;
1977
+ };
1978
+ }>;
1979
+ model_families: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1980
+ output_license: z.ZodEnum<["MIT", "Apache-2.0", "ISC"]>;
1981
+ commercial_restricted_ok: z.ZodDefault<z.ZodBoolean>;
1982
+ secrets_required: z.ZodDefault<z.ZodArray<z.ZodObject<{
1983
+ logical_name: z.ZodString;
1984
+ op_path: z.ZodString;
1985
+ target_file: z.ZodString;
1986
+ target_var: z.ZodString;
1987
+ }, "strict", z.ZodTypeAny, {
1988
+ logical_name: string;
1989
+ op_path: string;
1990
+ target_file: string;
1991
+ target_var: string;
1992
+ }, {
1993
+ logical_name: string;
1994
+ op_path: string;
1995
+ target_file: string;
1996
+ target_var: string;
1997
+ }>, "many">>;
1998
+ emit: z.ZodObject<{
1999
+ template_path: z.ZodString;
2000
+ pre_emit_hooks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2001
+ post_emit_hooks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2002
+ }, "strict", z.ZodTypeAny, {
2003
+ template_path: string;
2004
+ pre_emit_hooks: string[];
2005
+ post_emit_hooks: string[];
2006
+ }, {
2007
+ template_path: string;
2008
+ pre_emit_hooks?: string[] | undefined;
2009
+ post_emit_hooks?: string[] | undefined;
2010
+ }>;
2011
+ threat_model_path: z.ZodString;
2012
+ decisions_path: z.ZodString;
2013
+ forge_sandbox: z.ZodDefault<z.ZodObject<{
2014
+ ignore_scripts: z.ZodDefault<z.ZodBoolean>;
2015
+ allowed_postinstalls: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2016
+ }, "strict", z.ZodTypeAny, {
2017
+ ignore_scripts: boolean;
2018
+ allowed_postinstalls: string[];
2019
+ }, {
2020
+ ignore_scripts?: boolean | undefined;
2021
+ allowed_postinstalls?: string[] | undefined;
2022
+ }>>;
2023
+ }, "strict", z.ZodTypeAny, {
2024
+ schema_version: 1;
2025
+ name: string;
2026
+ description: string;
2027
+ warehouses: string[];
2028
+ version: string;
2029
+ composes: string[];
2030
+ inputs_schema: string;
2031
+ services: ({
2032
+ id: string;
2033
+ host: "vercel" | "cloudflare-pages";
2034
+ runtime: "nextjs";
2035
+ language: "typescript";
2036
+ } | {
2037
+ id: string;
2038
+ host: "modal";
2039
+ runtime: "modal";
2040
+ language: "python";
2041
+ python_version: "3.11" | "3.12";
2042
+ deps: string;
2043
+ contract: string;
2044
+ gpu: "none" | "t4" | "a10g" | "a100";
2045
+ } | {
2046
+ id: string;
2047
+ host: "railway";
2048
+ runtime: "railway";
2049
+ language: "python" | "node";
2050
+ deps: string;
2051
+ contract: string;
2052
+ } | {
2053
+ id: string;
2054
+ host: "cloudflare";
2055
+ runtime: "cloudflare-worker";
2056
+ language: "typescript";
2057
+ contract?: string | undefined;
2058
+ })[];
2059
+ qa_profile: "fast" | "standard" | "thorough" | "deep";
2060
+ cost_envelope: {
2061
+ per_request_p50_usd: number;
2062
+ per_request_p99_usd: number;
2063
+ monthly_baseline_usd: number;
2064
+ hard_caps: {
2065
+ per_request_usd: number;
2066
+ per_user_per_day_usd: number;
2067
+ per_app_per_day_usd: number;
2068
+ };
2069
+ };
2070
+ model_families: string[];
2071
+ output_license: "MIT" | "Apache-2.0" | "ISC";
2072
+ commercial_restricted_ok: boolean;
2073
+ secrets_required: {
2074
+ logical_name: string;
2075
+ op_path: string;
2076
+ target_file: string;
2077
+ target_var: string;
2078
+ }[];
2079
+ emit: {
2080
+ template_path: string;
2081
+ pre_emit_hooks: string[];
2082
+ post_emit_hooks: string[];
2083
+ };
2084
+ threat_model_path: string;
2085
+ decisions_path: string;
2086
+ forge_sandbox: {
2087
+ ignore_scripts: boolean;
2088
+ allowed_postinstalls: string[];
2089
+ };
2090
+ extends?: string | undefined;
2091
+ }, {
2092
+ schema_version: 1;
2093
+ name: string;
2094
+ description: string;
2095
+ warehouses: string[];
2096
+ version: string;
2097
+ inputs_schema: string;
2098
+ cost_envelope: {
2099
+ per_request_p50_usd: number;
2100
+ per_request_p99_usd: number;
2101
+ monthly_baseline_usd: number;
2102
+ hard_caps: {
2103
+ per_request_usd: number;
2104
+ per_user_per_day_usd: number;
2105
+ per_app_per_day_usd: number;
2106
+ };
2107
+ };
2108
+ output_license: "MIT" | "Apache-2.0" | "ISC";
2109
+ emit: {
2110
+ template_path: string;
2111
+ pre_emit_hooks?: string[] | undefined;
2112
+ post_emit_hooks?: string[] | undefined;
2113
+ };
2114
+ threat_model_path: string;
2115
+ decisions_path: string;
2116
+ extends?: string | undefined;
2117
+ composes?: string[] | undefined;
2118
+ services?: ({
2119
+ id: string;
2120
+ host: "vercel" | "cloudflare-pages";
2121
+ runtime: "nextjs";
2122
+ language: "typescript";
2123
+ } | {
2124
+ id: string;
2125
+ host: "modal";
2126
+ runtime: "modal";
2127
+ language: "python";
2128
+ python_version: "3.11" | "3.12";
2129
+ deps: string;
2130
+ contract: string;
2131
+ gpu?: "none" | "t4" | "a10g" | "a100" | undefined;
2132
+ } | {
2133
+ id: string;
2134
+ host: "railway";
2135
+ runtime: "railway";
2136
+ language: "python" | "node";
2137
+ deps: string;
2138
+ contract: string;
2139
+ } | {
2140
+ id: string;
2141
+ host: "cloudflare";
2142
+ runtime: "cloudflare-worker";
2143
+ language: "typescript";
2144
+ contract?: string | undefined;
2145
+ })[] | undefined;
2146
+ qa_profile?: "fast" | "standard" | "thorough" | "deep" | undefined;
2147
+ model_families?: string[] | undefined;
2148
+ commercial_restricted_ok?: boolean | undefined;
2149
+ secrets_required?: {
2150
+ logical_name: string;
2151
+ op_path: string;
2152
+ target_file: string;
2153
+ target_var: string;
2154
+ }[] | undefined;
2155
+ forge_sandbox?: {
2156
+ ignore_scripts?: boolean | undefined;
2157
+ allowed_postinstalls?: string[] | undefined;
2158
+ } | undefined;
2159
+ }>, {
2160
+ schema_version: 1;
2161
+ name: string;
2162
+ description: string;
2163
+ warehouses: string[];
2164
+ version: string;
2165
+ composes: string[];
2166
+ inputs_schema: string;
2167
+ services: ({
2168
+ id: string;
2169
+ host: "vercel" | "cloudflare-pages";
2170
+ runtime: "nextjs";
2171
+ language: "typescript";
2172
+ } | {
2173
+ id: string;
2174
+ host: "modal";
2175
+ runtime: "modal";
2176
+ language: "python";
2177
+ python_version: "3.11" | "3.12";
2178
+ deps: string;
2179
+ contract: string;
2180
+ gpu: "none" | "t4" | "a10g" | "a100";
2181
+ } | {
2182
+ id: string;
2183
+ host: "railway";
2184
+ runtime: "railway";
2185
+ language: "python" | "node";
2186
+ deps: string;
2187
+ contract: string;
2188
+ } | {
2189
+ id: string;
2190
+ host: "cloudflare";
2191
+ runtime: "cloudflare-worker";
2192
+ language: "typescript";
2193
+ contract?: string | undefined;
2194
+ })[];
2195
+ qa_profile: "fast" | "standard" | "thorough" | "deep";
2196
+ cost_envelope: {
2197
+ per_request_p50_usd: number;
2198
+ per_request_p99_usd: number;
2199
+ monthly_baseline_usd: number;
2200
+ hard_caps: {
2201
+ per_request_usd: number;
2202
+ per_user_per_day_usd: number;
2203
+ per_app_per_day_usd: number;
2204
+ };
2205
+ };
2206
+ model_families: string[];
2207
+ output_license: "MIT" | "Apache-2.0" | "ISC";
2208
+ commercial_restricted_ok: boolean;
2209
+ secrets_required: {
2210
+ logical_name: string;
2211
+ op_path: string;
2212
+ target_file: string;
2213
+ target_var: string;
2214
+ }[];
2215
+ emit: {
2216
+ template_path: string;
2217
+ pre_emit_hooks: string[];
2218
+ post_emit_hooks: string[];
2219
+ };
2220
+ threat_model_path: string;
2221
+ decisions_path: string;
2222
+ forge_sandbox: {
2223
+ ignore_scripts: boolean;
2224
+ allowed_postinstalls: string[];
2225
+ };
2226
+ extends?: string | undefined;
2227
+ }, {
2228
+ schema_version: 1;
2229
+ name: string;
2230
+ description: string;
2231
+ warehouses: string[];
2232
+ version: string;
2233
+ inputs_schema: string;
2234
+ cost_envelope: {
2235
+ per_request_p50_usd: number;
2236
+ per_request_p99_usd: number;
2237
+ monthly_baseline_usd: number;
2238
+ hard_caps: {
2239
+ per_request_usd: number;
2240
+ per_user_per_day_usd: number;
2241
+ per_app_per_day_usd: number;
2242
+ };
2243
+ };
2244
+ output_license: "MIT" | "Apache-2.0" | "ISC";
2245
+ emit: {
2246
+ template_path: string;
2247
+ pre_emit_hooks?: string[] | undefined;
2248
+ post_emit_hooks?: string[] | undefined;
2249
+ };
2250
+ threat_model_path: string;
2251
+ decisions_path: string;
2252
+ extends?: string | undefined;
2253
+ composes?: string[] | undefined;
2254
+ services?: ({
2255
+ id: string;
2256
+ host: "vercel" | "cloudflare-pages";
2257
+ runtime: "nextjs";
2258
+ language: "typescript";
2259
+ } | {
2260
+ id: string;
2261
+ host: "modal";
2262
+ runtime: "modal";
2263
+ language: "python";
2264
+ python_version: "3.11" | "3.12";
2265
+ deps: string;
2266
+ contract: string;
2267
+ gpu?: "none" | "t4" | "a10g" | "a100" | undefined;
2268
+ } | {
2269
+ id: string;
2270
+ host: "railway";
2271
+ runtime: "railway";
2272
+ language: "python" | "node";
2273
+ deps: string;
2274
+ contract: string;
2275
+ } | {
2276
+ id: string;
2277
+ host: "cloudflare";
2278
+ runtime: "cloudflare-worker";
2279
+ language: "typescript";
2280
+ contract?: string | undefined;
2281
+ })[] | undefined;
2282
+ qa_profile?: "fast" | "standard" | "thorough" | "deep" | undefined;
2283
+ model_families?: string[] | undefined;
2284
+ commercial_restricted_ok?: boolean | undefined;
2285
+ secrets_required?: {
2286
+ logical_name: string;
2287
+ op_path: string;
2288
+ target_file: string;
2289
+ target_var: string;
2290
+ }[] | undefined;
2291
+ forge_sandbox?: {
2292
+ ignore_scripts?: boolean | undefined;
2293
+ allowed_postinstalls?: string[] | undefined;
2294
+ } | undefined;
2295
+ }>;
2296
+ type RecipeManifest = z.infer<typeof RecipeManifest>;
2297
+ declare const ForgedLockfile: z.ZodObject<{
2298
+ schema_version: z.ZodLiteral<1>;
2299
+ forged_at: z.ZodString;
2300
+ forged_by_nx_version: z.ZodString;
2301
+ recipe: z.ZodObject<{
2302
+ name: z.ZodString;
2303
+ version: z.ZodString;
2304
+ sha: z.ZodString;
2305
+ signature: z.ZodString;
2306
+ provenance: z.ZodString;
2307
+ }, "strict", z.ZodTypeAny, {
2308
+ name: string;
2309
+ version: string;
2310
+ sha: string;
2311
+ signature: string;
2312
+ provenance: string;
2313
+ }, {
2314
+ name: string;
2315
+ version: string;
2316
+ sha: string;
2317
+ signature: string;
2318
+ provenance: string;
2319
+ }>;
2320
+ warehouses_consumed: z.ZodArray<z.ZodObject<{
2321
+ name: z.ZodString;
2322
+ sha: z.ZodString;
2323
+ version: z.ZodOptional<z.ZodString>;
2324
+ }, "strict", z.ZodTypeAny, {
2325
+ name: string;
2326
+ sha: string;
2327
+ version?: string | undefined;
2328
+ }, {
2329
+ name: string;
2330
+ sha: string;
2331
+ version?: string | undefined;
2332
+ }>, "many">;
2333
+ inputs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2334
+ model_families_used: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2335
+ sbom_hash: z.ZodString;
2336
+ }, "strict", z.ZodTypeAny, {
2337
+ schema_version: 1;
2338
+ recipe: {
2339
+ name: string;
2340
+ version: string;
2341
+ sha: string;
2342
+ signature: string;
2343
+ provenance: string;
2344
+ };
2345
+ forged_at: string;
2346
+ forged_by_nx_version: string;
2347
+ warehouses_consumed: {
2348
+ name: string;
2349
+ sha: string;
2350
+ version?: string | undefined;
2351
+ }[];
2352
+ inputs: Record<string, unknown>;
2353
+ model_families_used: string[];
2354
+ sbom_hash: string;
2355
+ }, {
2356
+ schema_version: 1;
2357
+ recipe: {
2358
+ name: string;
2359
+ version: string;
2360
+ sha: string;
2361
+ signature: string;
2362
+ provenance: string;
2363
+ };
2364
+ forged_at: string;
2365
+ forged_by_nx_version: string;
2366
+ warehouses_consumed: {
2367
+ name: string;
2368
+ sha: string;
2369
+ version?: string | undefined;
2370
+ }[];
2371
+ inputs: Record<string, unknown>;
2372
+ sbom_hash: string;
2373
+ model_families_used?: string[] | undefined;
2374
+ }>;
2375
+ type ForgedLockfile = z.infer<typeof ForgedLockfile>;
2376
+
2377
+ /**
2378
+ * ExternalMcpEndpoint + ExternalMcpRegistry — per ADR-0005.
2379
+ *
2380
+ * Registers third-party MCP servers (e.g. ai-warehouse) that are federated
2381
+ * via the router but NOT subject to factory governance.
2382
+ *
2383
+ * Manual file: nexural-meta/registry-external-mcp.yaml.
2384
+ */
2385
+
2386
+ declare const ExternalMcpEndpoint: z.ZodEffects<z.ZodObject<{
2387
+ schema_version: z.ZodLiteral<1>;
2388
+ name: z.ZodString;
2389
+ type: z.ZodLiteral<"external">;
2390
+ transport: z.ZodEnum<["stdio", "http", "websocket"]>;
2391
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2392
+ url: z.ZodOptional<z.ZodString>;
2393
+ tool_prefix: z.ZodString;
2394
+ schema_compatibility: z.ZodEnum<["nexural-1", "external"]>;
2395
+ federations: z.ZodArray<z.ZodEnum<["factory", "lifeops"]>, "many">;
2396
+ quality_attestation: z.ZodObject<{
2397
+ source: z.ZodString;
2398
+ score: z.ZodNumber;
2399
+ verified_at: z.ZodString;
2400
+ next_review: z.ZodString;
2401
+ }, "strict", z.ZodTypeAny, {
2402
+ score: number;
2403
+ source: string;
2404
+ verified_at: string;
2405
+ next_review: string;
2406
+ }, {
2407
+ score: number;
2408
+ source: string;
2409
+ verified_at: string;
2410
+ next_review: string;
2411
+ }>;
2412
+ }, "strict", z.ZodTypeAny, {
2413
+ type: "external";
2414
+ tool_prefix: string;
2415
+ schema_version: 1;
2416
+ name: string;
2417
+ transport: "stdio" | "http" | "websocket";
2418
+ schema_compatibility: "external" | "nexural-1";
2419
+ federations: ("factory" | "lifeops")[];
2420
+ quality_attestation: {
2421
+ score: number;
2422
+ source: string;
2423
+ verified_at: string;
2424
+ next_review: string;
2425
+ };
2426
+ url?: string | undefined;
2427
+ command?: string[] | undefined;
2428
+ }, {
2429
+ type: "external";
2430
+ tool_prefix: string;
2431
+ schema_version: 1;
2432
+ name: string;
2433
+ transport: "stdio" | "http" | "websocket";
2434
+ schema_compatibility: "external" | "nexural-1";
2435
+ federations: ("factory" | "lifeops")[];
2436
+ quality_attestation: {
2437
+ score: number;
2438
+ source: string;
2439
+ verified_at: string;
2440
+ next_review: string;
2441
+ };
2442
+ url?: string | undefined;
2443
+ command?: string[] | undefined;
2444
+ }>, {
2445
+ type: "external";
2446
+ tool_prefix: string;
2447
+ schema_version: 1;
2448
+ name: string;
2449
+ transport: "stdio" | "http" | "websocket";
2450
+ schema_compatibility: "external" | "nexural-1";
2451
+ federations: ("factory" | "lifeops")[];
2452
+ quality_attestation: {
2453
+ score: number;
2454
+ source: string;
2455
+ verified_at: string;
2456
+ next_review: string;
2457
+ };
2458
+ url?: string | undefined;
2459
+ command?: string[] | undefined;
2460
+ }, {
2461
+ type: "external";
2462
+ tool_prefix: string;
2463
+ schema_version: 1;
2464
+ name: string;
2465
+ transport: "stdio" | "http" | "websocket";
2466
+ schema_compatibility: "external" | "nexural-1";
2467
+ federations: ("factory" | "lifeops")[];
2468
+ quality_attestation: {
2469
+ score: number;
2470
+ source: string;
2471
+ verified_at: string;
2472
+ next_review: string;
2473
+ };
2474
+ url?: string | undefined;
2475
+ command?: string[] | undefined;
2476
+ }>;
2477
+ type ExternalMcpEndpoint = z.infer<typeof ExternalMcpEndpoint>;
2478
+ declare const ExternalMcpRegistry: z.ZodObject<{
2479
+ schema_version: z.ZodLiteral<1>;
2480
+ endpoints: z.ZodArray<z.ZodEffects<z.ZodObject<{
2481
+ schema_version: z.ZodLiteral<1>;
2482
+ name: z.ZodString;
2483
+ type: z.ZodLiteral<"external">;
2484
+ transport: z.ZodEnum<["stdio", "http", "websocket"]>;
2485
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2486
+ url: z.ZodOptional<z.ZodString>;
2487
+ tool_prefix: z.ZodString;
2488
+ schema_compatibility: z.ZodEnum<["nexural-1", "external"]>;
2489
+ federations: z.ZodArray<z.ZodEnum<["factory", "lifeops"]>, "many">;
2490
+ quality_attestation: z.ZodObject<{
2491
+ source: z.ZodString;
2492
+ score: z.ZodNumber;
2493
+ verified_at: z.ZodString;
2494
+ next_review: z.ZodString;
2495
+ }, "strict", z.ZodTypeAny, {
2496
+ score: number;
2497
+ source: string;
2498
+ verified_at: string;
2499
+ next_review: string;
2500
+ }, {
2501
+ score: number;
2502
+ source: string;
2503
+ verified_at: string;
2504
+ next_review: string;
2505
+ }>;
2506
+ }, "strict", z.ZodTypeAny, {
2507
+ type: "external";
2508
+ tool_prefix: string;
2509
+ schema_version: 1;
2510
+ name: string;
2511
+ transport: "stdio" | "http" | "websocket";
2512
+ schema_compatibility: "external" | "nexural-1";
2513
+ federations: ("factory" | "lifeops")[];
2514
+ quality_attestation: {
2515
+ score: number;
2516
+ source: string;
2517
+ verified_at: string;
2518
+ next_review: string;
2519
+ };
2520
+ url?: string | undefined;
2521
+ command?: string[] | undefined;
2522
+ }, {
2523
+ type: "external";
2524
+ tool_prefix: string;
2525
+ schema_version: 1;
2526
+ name: string;
2527
+ transport: "stdio" | "http" | "websocket";
2528
+ schema_compatibility: "external" | "nexural-1";
2529
+ federations: ("factory" | "lifeops")[];
2530
+ quality_attestation: {
2531
+ score: number;
2532
+ source: string;
2533
+ verified_at: string;
2534
+ next_review: string;
2535
+ };
2536
+ url?: string | undefined;
2537
+ command?: string[] | undefined;
2538
+ }>, {
2539
+ type: "external";
2540
+ tool_prefix: string;
2541
+ schema_version: 1;
2542
+ name: string;
2543
+ transport: "stdio" | "http" | "websocket";
2544
+ schema_compatibility: "external" | "nexural-1";
2545
+ federations: ("factory" | "lifeops")[];
2546
+ quality_attestation: {
2547
+ score: number;
2548
+ source: string;
2549
+ verified_at: string;
2550
+ next_review: string;
2551
+ };
2552
+ url?: string | undefined;
2553
+ command?: string[] | undefined;
2554
+ }, {
2555
+ type: "external";
2556
+ tool_prefix: string;
2557
+ schema_version: 1;
2558
+ name: string;
2559
+ transport: "stdio" | "http" | "websocket";
2560
+ schema_compatibility: "external" | "nexural-1";
2561
+ federations: ("factory" | "lifeops")[];
2562
+ quality_attestation: {
2563
+ score: number;
2564
+ source: string;
2565
+ verified_at: string;
2566
+ next_review: string;
2567
+ };
2568
+ url?: string | undefined;
2569
+ command?: string[] | undefined;
2570
+ }>, "many">;
2571
+ }, "strict", z.ZodTypeAny, {
2572
+ schema_version: 1;
2573
+ endpoints: {
2574
+ type: "external";
2575
+ tool_prefix: string;
2576
+ schema_version: 1;
2577
+ name: string;
2578
+ transport: "stdio" | "http" | "websocket";
2579
+ schema_compatibility: "external" | "nexural-1";
2580
+ federations: ("factory" | "lifeops")[];
2581
+ quality_attestation: {
2582
+ score: number;
2583
+ source: string;
2584
+ verified_at: string;
2585
+ next_review: string;
2586
+ };
2587
+ url?: string | undefined;
2588
+ command?: string[] | undefined;
2589
+ }[];
2590
+ }, {
2591
+ schema_version: 1;
2592
+ endpoints: {
2593
+ type: "external";
2594
+ tool_prefix: string;
2595
+ schema_version: 1;
2596
+ name: string;
2597
+ transport: "stdio" | "http" | "websocket";
2598
+ schema_compatibility: "external" | "nexural-1";
2599
+ federations: ("factory" | "lifeops")[];
2600
+ quality_attestation: {
2601
+ score: number;
2602
+ source: string;
2603
+ verified_at: string;
2604
+ next_review: string;
2605
+ };
2606
+ url?: string | undefined;
2607
+ command?: string[] | undefined;
2608
+ }[];
2609
+ }>;
2610
+ type ExternalMcpRegistry = z.infer<typeof ExternalMcpRegistry>;
2611
+
2612
+ /**
2613
+ * ModelFamilyResolution + ModelFamilyRegistry — per ADR-0007 + ADR-0010 §2.8.
2614
+ *
2615
+ * NOTE: this file contains only the SCHEMA. The runtime resolver lives in
2616
+ * the separate `@nexural/model-router` package.
2617
+ */
2618
+
2619
+ declare const ModelFamilyResolution: z.ZodObject<{
2620
+ family: z.ZodString;
2621
+ id: z.ZodString;
2622
+ tier: z.ZodEnum<["flagship", "premium", "balanced", "fast", "small"]>;
2623
+ context_window: z.ZodNumber;
2624
+ pricing: z.ZodObject<{
2625
+ input_per_million_tokens_usd: z.ZodNumber;
2626
+ output_per_million_tokens_usd: z.ZodNumber;
2627
+ cached_input_per_million_tokens_usd: z.ZodOptional<z.ZodNumber>;
2628
+ }, "strict", z.ZodTypeAny, {
2629
+ input_per_million_tokens_usd: number;
2630
+ output_per_million_tokens_usd: number;
2631
+ cached_input_per_million_tokens_usd?: number | undefined;
2632
+ }, {
2633
+ input_per_million_tokens_usd: number;
2634
+ output_per_million_tokens_usd: number;
2635
+ cached_input_per_million_tokens_usd?: number | undefined;
2636
+ }>;
2637
+ /** Per ADR-0010 §2.8 — if current pricing exceeds this ceiling, router substitutes next family. */
2638
+ price_ceiling_usd_per_million_tokens: z.ZodOptional<z.ZodNumber>;
2639
+ deprecates_at: z.ZodNullable<z.ZodString>;
2640
+ status: z.ZodEnum<["current", "deprecating", "deprecated", "preview"]>;
2641
+ }, "strict", z.ZodTypeAny, {
2642
+ status: "deprecated" | "current" | "deprecating" | "preview";
2643
+ tier: "fast" | "flagship" | "premium" | "balanced" | "small";
2644
+ id: string;
2645
+ family: string;
2646
+ context_window: number;
2647
+ pricing: {
2648
+ input_per_million_tokens_usd: number;
2649
+ output_per_million_tokens_usd: number;
2650
+ cached_input_per_million_tokens_usd?: number | undefined;
2651
+ };
2652
+ deprecates_at: string | null;
2653
+ price_ceiling_usd_per_million_tokens?: number | undefined;
2654
+ }, {
2655
+ status: "deprecated" | "current" | "deprecating" | "preview";
2656
+ tier: "fast" | "flagship" | "premium" | "balanced" | "small";
2657
+ id: string;
2658
+ family: string;
2659
+ context_window: number;
2660
+ pricing: {
2661
+ input_per_million_tokens_usd: number;
2662
+ output_per_million_tokens_usd: number;
2663
+ cached_input_per_million_tokens_usd?: number | undefined;
2664
+ };
2665
+ deprecates_at: string | null;
2666
+ price_ceiling_usd_per_million_tokens?: number | undefined;
2667
+ }>;
2668
+ type ModelFamilyResolution = z.infer<typeof ModelFamilyResolution>;
2669
+ declare const ModelFamilyRegistry: z.ZodObject<{
2670
+ schema_version: z.ZodLiteral<1>;
2671
+ generated_at: z.ZodString;
2672
+ resolutions: z.ZodArray<z.ZodObject<{
2673
+ family: z.ZodString;
2674
+ id: z.ZodString;
2675
+ tier: z.ZodEnum<["flagship", "premium", "balanced", "fast", "small"]>;
2676
+ context_window: z.ZodNumber;
2677
+ pricing: z.ZodObject<{
2678
+ input_per_million_tokens_usd: z.ZodNumber;
2679
+ output_per_million_tokens_usd: z.ZodNumber;
2680
+ cached_input_per_million_tokens_usd: z.ZodOptional<z.ZodNumber>;
2681
+ }, "strict", z.ZodTypeAny, {
2682
+ input_per_million_tokens_usd: number;
2683
+ output_per_million_tokens_usd: number;
2684
+ cached_input_per_million_tokens_usd?: number | undefined;
2685
+ }, {
2686
+ input_per_million_tokens_usd: number;
2687
+ output_per_million_tokens_usd: number;
2688
+ cached_input_per_million_tokens_usd?: number | undefined;
2689
+ }>;
2690
+ /** Per ADR-0010 §2.8 — if current pricing exceeds this ceiling, router substitutes next family. */
2691
+ price_ceiling_usd_per_million_tokens: z.ZodOptional<z.ZodNumber>;
2692
+ deprecates_at: z.ZodNullable<z.ZodString>;
2693
+ status: z.ZodEnum<["current", "deprecating", "deprecated", "preview"]>;
2694
+ }, "strict", z.ZodTypeAny, {
2695
+ status: "deprecated" | "current" | "deprecating" | "preview";
2696
+ tier: "fast" | "flagship" | "premium" | "balanced" | "small";
2697
+ id: string;
2698
+ family: string;
2699
+ context_window: number;
2700
+ pricing: {
2701
+ input_per_million_tokens_usd: number;
2702
+ output_per_million_tokens_usd: number;
2703
+ cached_input_per_million_tokens_usd?: number | undefined;
2704
+ };
2705
+ deprecates_at: string | null;
2706
+ price_ceiling_usd_per_million_tokens?: number | undefined;
2707
+ }, {
2708
+ status: "deprecated" | "current" | "deprecating" | "preview";
2709
+ tier: "fast" | "flagship" | "premium" | "balanced" | "small";
2710
+ id: string;
2711
+ family: string;
2712
+ context_window: number;
2713
+ pricing: {
2714
+ input_per_million_tokens_usd: number;
2715
+ output_per_million_tokens_usd: number;
2716
+ cached_input_per_million_tokens_usd?: number | undefined;
2717
+ };
2718
+ deprecates_at: string | null;
2719
+ price_ceiling_usd_per_million_tokens?: number | undefined;
2720
+ }>, "many">;
2721
+ }, "strict", z.ZodTypeAny, {
2722
+ schema_version: 1;
2723
+ generated_at: string;
2724
+ resolutions: {
2725
+ status: "deprecated" | "current" | "deprecating" | "preview";
2726
+ tier: "fast" | "flagship" | "premium" | "balanced" | "small";
2727
+ id: string;
2728
+ family: string;
2729
+ context_window: number;
2730
+ pricing: {
2731
+ input_per_million_tokens_usd: number;
2732
+ output_per_million_tokens_usd: number;
2733
+ cached_input_per_million_tokens_usd?: number | undefined;
2734
+ };
2735
+ deprecates_at: string | null;
2736
+ price_ceiling_usd_per_million_tokens?: number | undefined;
2737
+ }[];
2738
+ }, {
2739
+ schema_version: 1;
2740
+ generated_at: string;
2741
+ resolutions: {
2742
+ status: "deprecated" | "current" | "deprecating" | "preview";
2743
+ tier: "fast" | "flagship" | "premium" | "balanced" | "small";
2744
+ id: string;
2745
+ family: string;
2746
+ context_window: number;
2747
+ pricing: {
2748
+ input_per_million_tokens_usd: number;
2749
+ output_per_million_tokens_usd: number;
2750
+ cached_input_per_million_tokens_usd?: number | undefined;
2751
+ };
2752
+ deprecates_at: string | null;
2753
+ price_ceiling_usd_per_million_tokens?: number | undefined;
2754
+ }[];
2755
+ }>;
2756
+ type ModelFamilyRegistry = z.infer<typeof ModelFamilyRegistry>;
2757
+
2758
+ /**
2759
+ * RevokedRecipesList — `nexural-meta/security/revoked-recipes.yaml`.
2760
+ *
2761
+ * APPEND-ONLY. Per ADR-0009 §1.6.
2762
+ * Every entry is signed via cosign.
2763
+ * `nx forge` consults this list before emitting; revoked recipe → forge fails.
2764
+ */
2765
+
2766
+ declare const RevokedRecipeEntry: z.ZodObject<{
2767
+ recipe_name: z.ZodString;
2768
+ recipe_version: z.ZodString;
2769
+ revoked_at: z.ZodString;
2770
+ reason: z.ZodString;
2771
+ ticket: z.ZodOptional<z.ZodString>;
2772
+ signature: z.ZodString;
2773
+ }, "strict", z.ZodTypeAny, {
2774
+ reason: string;
2775
+ signature: string;
2776
+ recipe_name: string;
2777
+ recipe_version: string;
2778
+ revoked_at: string;
2779
+ ticket?: string | undefined;
2780
+ }, {
2781
+ reason: string;
2782
+ signature: string;
2783
+ recipe_name: string;
2784
+ recipe_version: string;
2785
+ revoked_at: string;
2786
+ ticket?: string | undefined;
2787
+ }>;
2788
+ type RevokedRecipeEntry = z.infer<typeof RevokedRecipeEntry>;
2789
+ declare const RevokedRecipesList: z.ZodObject<{
2790
+ schema_version: z.ZodLiteral<1>;
2791
+ generated_at: z.ZodString;
2792
+ entries: z.ZodArray<z.ZodObject<{
2793
+ recipe_name: z.ZodString;
2794
+ recipe_version: z.ZodString;
2795
+ revoked_at: z.ZodString;
2796
+ reason: z.ZodString;
2797
+ ticket: z.ZodOptional<z.ZodString>;
2798
+ signature: z.ZodString;
2799
+ }, "strict", z.ZodTypeAny, {
2800
+ reason: string;
2801
+ signature: string;
2802
+ recipe_name: string;
2803
+ recipe_version: string;
2804
+ revoked_at: string;
2805
+ ticket?: string | undefined;
2806
+ }, {
2807
+ reason: string;
2808
+ signature: string;
2809
+ recipe_name: string;
2810
+ recipe_version: string;
2811
+ revoked_at: string;
2812
+ ticket?: string | undefined;
2813
+ }>, "many">;
2814
+ }, "strict", z.ZodTypeAny, {
2815
+ entries: {
2816
+ reason: string;
2817
+ signature: string;
2818
+ recipe_name: string;
2819
+ recipe_version: string;
2820
+ revoked_at: string;
2821
+ ticket?: string | undefined;
2822
+ }[];
2823
+ schema_version: 1;
2824
+ generated_at: string;
2825
+ }, {
2826
+ entries: {
2827
+ reason: string;
2828
+ signature: string;
2829
+ recipe_name: string;
2830
+ recipe_version: string;
2831
+ revoked_at: string;
2832
+ ticket?: string | undefined;
2833
+ }[];
2834
+ schema_version: 1;
2835
+ generated_at: string;
2836
+ }>;
2837
+ type RevokedRecipesList = z.infer<typeof RevokedRecipesList>;
2838
+
2839
+ export { AdrFrontmatter, AuditEvent, ContentFrontmatter, CostEnvelope, CostEvent, CrossRefReport, DecayConfig, DecayDays, DecayWarnEvent, Email, EnvVarName, ExternalMcpEndpoint, ExternalMcpRegistry, Federation, ForgedLockfile, GitSha, Iso8601, IsoDate, KebabSlug, McpToolRequest, McpToolResponse, ModelFamilyRegistry, ModelFamilyResolution, NexuralError, NexuralErrorCode, NxCommandEvent, OpUri, PositiveUsdAmount, RecipeManifest, Registry, RelatedRelation, RepoUrl, RevokedRecipeEntry, RevokedRecipesList, SchemaVersion, ScorecardReport, SemverString, ServiceDeclaration, Sha256Hex, SourceType, TelemetryEvent, ToolCallEvent, TrustTier, Ulid, UsdAmount, WarehouseIndex, WarehouseMeta, WarehouseStatus };