@blokjs/shared 2.1.0 → 2.2.1

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.
Files changed (46) hide show
  1. package/dist/AgentSessionContracts.d.ts +316 -0
  2. package/dist/AgentSessionContracts.js +331 -0
  3. package/dist/BlokError.d.ts +23 -0
  4. package/dist/BlokError.js +65 -0
  5. package/dist/CapabilityContracts.d.ts +91 -0
  6. package/dist/CapabilityContracts.js +104 -0
  7. package/dist/CapabilityManifest.d.ts +67 -0
  8. package/dist/CapabilityManifest.js +172 -0
  9. package/dist/EnforcementContracts.d.ts +61 -0
  10. package/dist/EnforcementContracts.js +17 -0
  11. package/dist/EnforcementProfileContracts.d.ts +36 -0
  12. package/dist/EnforcementProfileContracts.js +55 -0
  13. package/dist/EvidenceContracts.d.ts +884 -0
  14. package/dist/EvidenceContracts.js +237 -0
  15. package/dist/GitCapabilityContracts.d.ts +103 -0
  16. package/dist/GitCapabilityContracts.js +222 -0
  17. package/dist/GlobalLogger.d.ts +2 -0
  18. package/dist/GlobalLogger.js +4 -0
  19. package/dist/GraphContracts.d.ts +1643 -0
  20. package/dist/GraphContracts.js +333 -0
  21. package/dist/InteractionContracts.d.ts +76 -0
  22. package/dist/InteractionContracts.js +218 -0
  23. package/dist/JoinContracts.d.ts +593 -0
  24. package/dist/JoinContracts.js +329 -0
  25. package/dist/NodeBase.d.ts +20 -0
  26. package/dist/NodeBase.js +57 -6
  27. package/dist/PermissionAlgebra.d.ts +51 -0
  28. package/dist/PermissionAlgebra.js +125 -0
  29. package/dist/PolicyContracts.d.ts +184 -0
  30. package/dist/PolicyContracts.js +1 -0
  31. package/dist/ProcessCapabilityContracts.d.ts +146 -0
  32. package/dist/ProcessCapabilityContracts.js +263 -0
  33. package/dist/RuntimeContracts.d.ts +125 -0
  34. package/dist/RuntimeContracts.js +108 -0
  35. package/dist/SecretContracts.d.ts +43 -0
  36. package/dist/SecretContracts.js +1 -0
  37. package/dist/WasiComponentContracts.d.ts +582 -0
  38. package/dist/WasiComponentContracts.js +192 -0
  39. package/dist/WorkflowBindingContracts.d.ts +1062 -0
  40. package/dist/WorkflowBindingContracts.js +339 -0
  41. package/dist/index.d.ts +33 -2
  42. package/dist/index.js +21 -2
  43. package/dist/types/LoggerContext.d.ts +7 -0
  44. package/dist/utils/Mapper.d.ts +14 -0
  45. package/dist/utils/Mapper.js +32 -0
  46. package/package.json +3 -2
@@ -0,0 +1,884 @@
1
+ import { z } from "zod";
2
+ import type { InteractionPayload } from "./InteractionContracts.js";
3
+ /** Version of the language-neutral evidence wire contract. */
4
+ export declare const EVIDENCE_CONTRACT_VERSION: "1";
5
+ /** Evidence uses the same bounded JSON value envelope as H1-01 answers. */
6
+ export declare const EVIDENCE_MAX_RECORD_BYTES: number;
7
+ export declare const EVIDENCE_MAX_PAYLOAD_DEPTH = 8;
8
+ export declare const EVIDENCE_MAX_PAYLOAD_ITEMS = 256;
9
+ export declare const EVIDENCE_MAX_STRING_LENGTH: number;
10
+ export declare const EVIDENCE_MAX_CHECKS = 32;
11
+ export declare const EVIDENCE_MAX_REQUIREMENTS = 64;
12
+ export declare const EVIDENCE_PRODUCER_KINDS: readonly ["capability", "deterministic-step", "runner"];
13
+ export declare const EVIDENCE_VERIFIER_KINDS: readonly ["capability", "human", "runner"];
14
+ export declare const EVIDENCE_VERIFICATION_STATUSES: readonly ["verified", "failed", "unverified", "expired"];
15
+ export declare const EVIDENCE_VERIFICATION_METHODS: readonly ["artifact-digest", "schema-check", "deterministic-check", "capability-attestation", "human-approval"];
16
+ export declare const EVIDENCE_CHECK_OUTCOMES: readonly ["passed", "failed"];
17
+ export type EvidenceProducerKind = (typeof EVIDENCE_PRODUCER_KINDS)[number];
18
+ export type EvidenceVerifierKind = (typeof EVIDENCE_VERIFIER_KINDS)[number];
19
+ export type EvidenceVerificationStatus = (typeof EVIDENCE_VERIFICATION_STATUSES)[number];
20
+ export type EvidenceVerificationMethod = (typeof EVIDENCE_VERIFICATION_METHODS)[number];
21
+ export type EvidenceCheckOutcome = (typeof EVIDENCE_CHECK_OUTCOMES)[number];
22
+ /** JSON values may be persisted in evidence only inside the shared bounds. */
23
+ export type EvidencePayload = InteractionPayload;
24
+ export interface ArtifactIdentity {
25
+ /** Stable logical identity, independent of a particular produced version. */
26
+ readonly id: string;
27
+ /** Artifact family, for example `test-result` or `diff`. */
28
+ readonly kind: string;
29
+ }
30
+ export interface ArtifactVersionIdentity {
31
+ readonly artifact: ArtifactIdentity;
32
+ /** Immutable producer/version label for the artifact. */
33
+ readonly version: string;
34
+ /** Content identity. A digest is required; a locator is not trusted evidence. */
35
+ readonly digest: string;
36
+ }
37
+ export interface EvidenceProducerIdentity {
38
+ readonly kind: EvidenceProducerKind;
39
+ /** Stable capability, step, or runner identity. */
40
+ readonly id: string;
41
+ }
42
+ export interface EvidenceTraceIdentity {
43
+ /** H1-01-compatible durable workflow run identity. */
44
+ readonly runId: string;
45
+ /** Optional node-run identity from the existing trace model. */
46
+ readonly nodeRunId?: string;
47
+ }
48
+ export interface EvidenceProvenanceIdentity {
49
+ readonly producer: EvidenceProducerIdentity;
50
+ readonly workflow: {
51
+ readonly name: string;
52
+ readonly version?: string;
53
+ };
54
+ readonly step: {
55
+ readonly id: string;
56
+ readonly index?: number;
57
+ readonly attempt?: number;
58
+ };
59
+ readonly trace: EvidenceTraceIdentity;
60
+ /** H1-01 interaction id when an approval contributed to provenance. */
61
+ readonly interactionId?: string;
62
+ }
63
+ export type EvidenceArtifactIdentity = ArtifactVersionIdentity;
64
+ export interface EvidenceCheck {
65
+ /** Machine-readable check code; prose is intentionally not a check result. */
66
+ readonly code: string;
67
+ readonly outcome: EvidenceCheckOutcome;
68
+ }
69
+ export interface EvidenceVerifierIdentity {
70
+ readonly kind: EvidenceVerifierKind;
71
+ readonly id: string;
72
+ }
73
+ export interface EvidenceVerificationResult {
74
+ readonly status: EvidenceVerificationStatus;
75
+ readonly verifier: EvidenceVerifierIdentity;
76
+ readonly method: EvidenceVerificationMethod;
77
+ readonly checkedAt: string;
78
+ readonly checks: readonly EvidenceCheck[];
79
+ /** Stable machine-readable reason, never model-authored prose. */
80
+ readonly reasonCode?: string;
81
+ }
82
+ export type EvidenceKind = string;
83
+ export interface EvidenceRecord {
84
+ readonly version: typeof EVIDENCE_CONTRACT_VERSION;
85
+ readonly id: string;
86
+ /** Machine-readable claim type, such as `tests.pass`. */
87
+ readonly kind: EvidenceKind;
88
+ /** Machine-readable claim code, such as `repository.tests.pass`. */
89
+ readonly claim: string;
90
+ readonly artifact: EvidenceArtifactIdentity;
91
+ readonly provenance: EvidenceProvenanceIdentity;
92
+ readonly verification: EvidenceVerificationResult;
93
+ readonly observedAt: string;
94
+ readonly expiresAt?: string;
95
+ /** Structured facts only; this is not a model explanation channel. */
96
+ readonly payload?: EvidencePayload;
97
+ }
98
+ export interface EvidenceRequirement {
99
+ readonly type: "evidence";
100
+ readonly id: string;
101
+ readonly kind: EvidenceKind;
102
+ readonly claim?: string;
103
+ readonly artifactKind?: string;
104
+ readonly producers: readonly EvidenceProducerKind[];
105
+ /** Completion can consume only a verified record. */
106
+ readonly verification: "verified";
107
+ }
108
+ export interface ApprovalRequirement {
109
+ readonly type: "approval";
110
+ readonly id: string;
111
+ /** Durable interaction id from H1-01, never an answer/prose substitute. */
112
+ readonly interactionId: string;
113
+ /** The interaction must have reached its accepted terminal answer. */
114
+ readonly status: "answered";
115
+ }
116
+ export type CompletionRequirement = EvidenceRequirement | ApprovalRequirement;
117
+ export interface CompletionContract {
118
+ readonly version: typeof EVIDENCE_CONTRACT_VERSION;
119
+ readonly id: string;
120
+ readonly mode: "all" | "any";
121
+ readonly requirements: readonly CompletionRequirement[];
122
+ }
123
+ export declare class EvidenceContractError extends Error {
124
+ readonly issues: readonly string[];
125
+ constructor(issues: readonly string[]);
126
+ }
127
+ export declare const ArtifactIdentitySchema: z.ZodObject<{
128
+ id: z.ZodString;
129
+ kind: z.ZodString;
130
+ }, "strip", z.ZodTypeAny, {
131
+ id: string;
132
+ kind: string;
133
+ }, {
134
+ id: string;
135
+ kind: string;
136
+ }>;
137
+ export declare const ArtifactVersionIdentitySchema: z.ZodObject<{
138
+ artifact: z.ZodObject<{
139
+ id: z.ZodString;
140
+ kind: z.ZodString;
141
+ }, "strip", z.ZodTypeAny, {
142
+ id: string;
143
+ kind: string;
144
+ }, {
145
+ id: string;
146
+ kind: string;
147
+ }>;
148
+ version: z.ZodString;
149
+ digest: z.ZodEffects<z.ZodString, string, string>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ version: string;
152
+ digest: string;
153
+ artifact: {
154
+ id: string;
155
+ kind: string;
156
+ };
157
+ }, {
158
+ version: string;
159
+ digest: string;
160
+ artifact: {
161
+ id: string;
162
+ kind: string;
163
+ };
164
+ }>;
165
+ export declare const EvidenceProducerIdentitySchema: z.ZodObject<{
166
+ kind: z.ZodEnum<["capability", "deterministic-step", "runner"]>;
167
+ id: z.ZodString;
168
+ }, "strip", z.ZodTypeAny, {
169
+ id: string;
170
+ kind: "capability" | "deterministic-step" | "runner";
171
+ }, {
172
+ id: string;
173
+ kind: "capability" | "deterministic-step" | "runner";
174
+ }>;
175
+ export declare const EvidenceTraceIdentitySchema: z.ZodObject<{
176
+ runId: z.ZodString;
177
+ nodeRunId: z.ZodOptional<z.ZodString>;
178
+ }, "strip", z.ZodTypeAny, {
179
+ runId: string;
180
+ nodeRunId?: string | undefined;
181
+ }, {
182
+ runId: string;
183
+ nodeRunId?: string | undefined;
184
+ }>;
185
+ export declare const EvidenceProvenanceIdentitySchema: z.ZodObject<{
186
+ producer: z.ZodObject<{
187
+ kind: z.ZodEnum<["capability", "deterministic-step", "runner"]>;
188
+ id: z.ZodString;
189
+ }, "strip", z.ZodTypeAny, {
190
+ id: string;
191
+ kind: "capability" | "deterministic-step" | "runner";
192
+ }, {
193
+ id: string;
194
+ kind: "capability" | "deterministic-step" | "runner";
195
+ }>;
196
+ workflow: z.ZodObject<{
197
+ name: z.ZodString;
198
+ version: z.ZodOptional<z.ZodString>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ name: string;
201
+ version?: string | undefined;
202
+ }, {
203
+ name: string;
204
+ version?: string | undefined;
205
+ }>;
206
+ step: z.ZodObject<{
207
+ id: z.ZodString;
208
+ index: z.ZodOptional<z.ZodNumber>;
209
+ attempt: z.ZodOptional<z.ZodNumber>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ id: string;
212
+ index?: number | undefined;
213
+ attempt?: number | undefined;
214
+ }, {
215
+ id: string;
216
+ index?: number | undefined;
217
+ attempt?: number | undefined;
218
+ }>;
219
+ trace: z.ZodObject<{
220
+ runId: z.ZodString;
221
+ nodeRunId: z.ZodOptional<z.ZodString>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ runId: string;
224
+ nodeRunId?: string | undefined;
225
+ }, {
226
+ runId: string;
227
+ nodeRunId?: string | undefined;
228
+ }>;
229
+ interactionId: z.ZodOptional<z.ZodString>;
230
+ }, "strip", z.ZodTypeAny, {
231
+ workflow: {
232
+ name: string;
233
+ version?: string | undefined;
234
+ };
235
+ step: {
236
+ id: string;
237
+ index?: number | undefined;
238
+ attempt?: number | undefined;
239
+ };
240
+ producer: {
241
+ id: string;
242
+ kind: "capability" | "deterministic-step" | "runner";
243
+ };
244
+ trace: {
245
+ runId: string;
246
+ nodeRunId?: string | undefined;
247
+ };
248
+ interactionId?: string | undefined;
249
+ }, {
250
+ workflow: {
251
+ name: string;
252
+ version?: string | undefined;
253
+ };
254
+ step: {
255
+ id: string;
256
+ index?: number | undefined;
257
+ attempt?: number | undefined;
258
+ };
259
+ producer: {
260
+ id: string;
261
+ kind: "capability" | "deterministic-step" | "runner";
262
+ };
263
+ trace: {
264
+ runId: string;
265
+ nodeRunId?: string | undefined;
266
+ };
267
+ interactionId?: string | undefined;
268
+ }>;
269
+ export declare const EvidenceCheckSchema: z.ZodObject<{
270
+ code: z.ZodString;
271
+ outcome: z.ZodEnum<["passed", "failed"]>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ code: string;
274
+ outcome: "failed" | "passed";
275
+ }, {
276
+ code: string;
277
+ outcome: "failed" | "passed";
278
+ }>;
279
+ export declare const EvidenceVerifierIdentitySchema: z.ZodObject<{
280
+ kind: z.ZodEnum<["capability", "human", "runner"]>;
281
+ id: z.ZodString;
282
+ }, "strip", z.ZodTypeAny, {
283
+ id: string;
284
+ kind: "capability" | "runner" | "human";
285
+ }, {
286
+ id: string;
287
+ kind: "capability" | "runner" | "human";
288
+ }>;
289
+ export declare const EvidenceVerificationResultSchema: z.ZodEffects<z.ZodObject<{
290
+ status: z.ZodEnum<["verified", "failed", "unverified", "expired"]>;
291
+ verifier: z.ZodObject<{
292
+ kind: z.ZodEnum<["capability", "human", "runner"]>;
293
+ id: z.ZodString;
294
+ }, "strip", z.ZodTypeAny, {
295
+ id: string;
296
+ kind: "capability" | "runner" | "human";
297
+ }, {
298
+ id: string;
299
+ kind: "capability" | "runner" | "human";
300
+ }>;
301
+ method: z.ZodEnum<["artifact-digest", "schema-check", "deterministic-check", "capability-attestation", "human-approval"]>;
302
+ checkedAt: z.ZodString;
303
+ checks: z.ZodArray<z.ZodObject<{
304
+ code: z.ZodString;
305
+ outcome: z.ZodEnum<["passed", "failed"]>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ code: string;
308
+ outcome: "failed" | "passed";
309
+ }, {
310
+ code: string;
311
+ outcome: "failed" | "passed";
312
+ }>, "many">;
313
+ reasonCode: z.ZodOptional<z.ZodString>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ status: "expired" | "verified" | "failed" | "unverified";
316
+ verifier: {
317
+ id: string;
318
+ kind: "capability" | "runner" | "human";
319
+ };
320
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
321
+ checkedAt: string;
322
+ checks: {
323
+ code: string;
324
+ outcome: "failed" | "passed";
325
+ }[];
326
+ reasonCode?: string | undefined;
327
+ }, {
328
+ status: "expired" | "verified" | "failed" | "unverified";
329
+ verifier: {
330
+ id: string;
331
+ kind: "capability" | "runner" | "human";
332
+ };
333
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
334
+ checkedAt: string;
335
+ checks: {
336
+ code: string;
337
+ outcome: "failed" | "passed";
338
+ }[];
339
+ reasonCode?: string | undefined;
340
+ }>, {
341
+ status: "expired" | "verified" | "failed" | "unverified";
342
+ verifier: {
343
+ id: string;
344
+ kind: "capability" | "runner" | "human";
345
+ };
346
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
347
+ checkedAt: string;
348
+ checks: {
349
+ code: string;
350
+ outcome: "failed" | "passed";
351
+ }[];
352
+ reasonCode?: string | undefined;
353
+ }, {
354
+ status: "expired" | "verified" | "failed" | "unverified";
355
+ verifier: {
356
+ id: string;
357
+ kind: "capability" | "runner" | "human";
358
+ };
359
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
360
+ checkedAt: string;
361
+ checks: {
362
+ code: string;
363
+ outcome: "failed" | "passed";
364
+ }[];
365
+ reasonCode?: string | undefined;
366
+ }>;
367
+ export declare const EvidencePayloadSchema: z.ZodEffects<z.ZodUnknown, string | number | boolean | readonly InteractionPayload[] | Readonly<{
368
+ [key: string]: InteractionPayload;
369
+ }> | null | undefined, unknown>;
370
+ export declare const EvidenceRecordSchema: z.ZodObject<{
371
+ version: z.ZodLiteral<"1">;
372
+ id: z.ZodString;
373
+ kind: z.ZodString;
374
+ claim: z.ZodString;
375
+ artifact: z.ZodObject<{
376
+ artifact: z.ZodObject<{
377
+ id: z.ZodString;
378
+ kind: z.ZodString;
379
+ }, "strip", z.ZodTypeAny, {
380
+ id: string;
381
+ kind: string;
382
+ }, {
383
+ id: string;
384
+ kind: string;
385
+ }>;
386
+ version: z.ZodString;
387
+ digest: z.ZodEffects<z.ZodString, string, string>;
388
+ }, "strip", z.ZodTypeAny, {
389
+ version: string;
390
+ digest: string;
391
+ artifact: {
392
+ id: string;
393
+ kind: string;
394
+ };
395
+ }, {
396
+ version: string;
397
+ digest: string;
398
+ artifact: {
399
+ id: string;
400
+ kind: string;
401
+ };
402
+ }>;
403
+ provenance: z.ZodObject<{
404
+ producer: z.ZodObject<{
405
+ kind: z.ZodEnum<["capability", "deterministic-step", "runner"]>;
406
+ id: z.ZodString;
407
+ }, "strip", z.ZodTypeAny, {
408
+ id: string;
409
+ kind: "capability" | "deterministic-step" | "runner";
410
+ }, {
411
+ id: string;
412
+ kind: "capability" | "deterministic-step" | "runner";
413
+ }>;
414
+ workflow: z.ZodObject<{
415
+ name: z.ZodString;
416
+ version: z.ZodOptional<z.ZodString>;
417
+ }, "strip", z.ZodTypeAny, {
418
+ name: string;
419
+ version?: string | undefined;
420
+ }, {
421
+ name: string;
422
+ version?: string | undefined;
423
+ }>;
424
+ step: z.ZodObject<{
425
+ id: z.ZodString;
426
+ index: z.ZodOptional<z.ZodNumber>;
427
+ attempt: z.ZodOptional<z.ZodNumber>;
428
+ }, "strip", z.ZodTypeAny, {
429
+ id: string;
430
+ index?: number | undefined;
431
+ attempt?: number | undefined;
432
+ }, {
433
+ id: string;
434
+ index?: number | undefined;
435
+ attempt?: number | undefined;
436
+ }>;
437
+ trace: z.ZodObject<{
438
+ runId: z.ZodString;
439
+ nodeRunId: z.ZodOptional<z.ZodString>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ runId: string;
442
+ nodeRunId?: string | undefined;
443
+ }, {
444
+ runId: string;
445
+ nodeRunId?: string | undefined;
446
+ }>;
447
+ interactionId: z.ZodOptional<z.ZodString>;
448
+ }, "strip", z.ZodTypeAny, {
449
+ workflow: {
450
+ name: string;
451
+ version?: string | undefined;
452
+ };
453
+ step: {
454
+ id: string;
455
+ index?: number | undefined;
456
+ attempt?: number | undefined;
457
+ };
458
+ producer: {
459
+ id: string;
460
+ kind: "capability" | "deterministic-step" | "runner";
461
+ };
462
+ trace: {
463
+ runId: string;
464
+ nodeRunId?: string | undefined;
465
+ };
466
+ interactionId?: string | undefined;
467
+ }, {
468
+ workflow: {
469
+ name: string;
470
+ version?: string | undefined;
471
+ };
472
+ step: {
473
+ id: string;
474
+ index?: number | undefined;
475
+ attempt?: number | undefined;
476
+ };
477
+ producer: {
478
+ id: string;
479
+ kind: "capability" | "deterministic-step" | "runner";
480
+ };
481
+ trace: {
482
+ runId: string;
483
+ nodeRunId?: string | undefined;
484
+ };
485
+ interactionId?: string | undefined;
486
+ }>;
487
+ verification: z.ZodEffects<z.ZodObject<{
488
+ status: z.ZodEnum<["verified", "failed", "unverified", "expired"]>;
489
+ verifier: z.ZodObject<{
490
+ kind: z.ZodEnum<["capability", "human", "runner"]>;
491
+ id: z.ZodString;
492
+ }, "strip", z.ZodTypeAny, {
493
+ id: string;
494
+ kind: "capability" | "runner" | "human";
495
+ }, {
496
+ id: string;
497
+ kind: "capability" | "runner" | "human";
498
+ }>;
499
+ method: z.ZodEnum<["artifact-digest", "schema-check", "deterministic-check", "capability-attestation", "human-approval"]>;
500
+ checkedAt: z.ZodString;
501
+ checks: z.ZodArray<z.ZodObject<{
502
+ code: z.ZodString;
503
+ outcome: z.ZodEnum<["passed", "failed"]>;
504
+ }, "strip", z.ZodTypeAny, {
505
+ code: string;
506
+ outcome: "failed" | "passed";
507
+ }, {
508
+ code: string;
509
+ outcome: "failed" | "passed";
510
+ }>, "many">;
511
+ reasonCode: z.ZodOptional<z.ZodString>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ status: "expired" | "verified" | "failed" | "unverified";
514
+ verifier: {
515
+ id: string;
516
+ kind: "capability" | "runner" | "human";
517
+ };
518
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
519
+ checkedAt: string;
520
+ checks: {
521
+ code: string;
522
+ outcome: "failed" | "passed";
523
+ }[];
524
+ reasonCode?: string | undefined;
525
+ }, {
526
+ status: "expired" | "verified" | "failed" | "unverified";
527
+ verifier: {
528
+ id: string;
529
+ kind: "capability" | "runner" | "human";
530
+ };
531
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
532
+ checkedAt: string;
533
+ checks: {
534
+ code: string;
535
+ outcome: "failed" | "passed";
536
+ }[];
537
+ reasonCode?: string | undefined;
538
+ }>, {
539
+ status: "expired" | "verified" | "failed" | "unverified";
540
+ verifier: {
541
+ id: string;
542
+ kind: "capability" | "runner" | "human";
543
+ };
544
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
545
+ checkedAt: string;
546
+ checks: {
547
+ code: string;
548
+ outcome: "failed" | "passed";
549
+ }[];
550
+ reasonCode?: string | undefined;
551
+ }, {
552
+ status: "expired" | "verified" | "failed" | "unverified";
553
+ verifier: {
554
+ id: string;
555
+ kind: "capability" | "runner" | "human";
556
+ };
557
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
558
+ checkedAt: string;
559
+ checks: {
560
+ code: string;
561
+ outcome: "failed" | "passed";
562
+ }[];
563
+ reasonCode?: string | undefined;
564
+ }>;
565
+ observedAt: z.ZodString;
566
+ expiresAt: z.ZodOptional<z.ZodString>;
567
+ payload: z.ZodOptional<z.ZodEffects<z.ZodUnknown, string | number | boolean | readonly InteractionPayload[] | Readonly<{
568
+ [key: string]: InteractionPayload;
569
+ }> | null | undefined, unknown>>;
570
+ }, "strip", z.ZodTypeAny, {
571
+ id: string;
572
+ kind: string;
573
+ version: "1";
574
+ artifact: {
575
+ version: string;
576
+ digest: string;
577
+ artifact: {
578
+ id: string;
579
+ kind: string;
580
+ };
581
+ };
582
+ claim: string;
583
+ provenance: {
584
+ workflow: {
585
+ name: string;
586
+ version?: string | undefined;
587
+ };
588
+ step: {
589
+ id: string;
590
+ index?: number | undefined;
591
+ attempt?: number | undefined;
592
+ };
593
+ producer: {
594
+ id: string;
595
+ kind: "capability" | "deterministic-step" | "runner";
596
+ };
597
+ trace: {
598
+ runId: string;
599
+ nodeRunId?: string | undefined;
600
+ };
601
+ interactionId?: string | undefined;
602
+ };
603
+ verification: {
604
+ status: "expired" | "verified" | "failed" | "unverified";
605
+ verifier: {
606
+ id: string;
607
+ kind: "capability" | "runner" | "human";
608
+ };
609
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
610
+ checkedAt: string;
611
+ checks: {
612
+ code: string;
613
+ outcome: "failed" | "passed";
614
+ }[];
615
+ reasonCode?: string | undefined;
616
+ };
617
+ observedAt: string;
618
+ payload?: string | number | boolean | readonly InteractionPayload[] | Readonly<{
619
+ [key: string]: InteractionPayload;
620
+ }> | null | undefined;
621
+ expiresAt?: string | undefined;
622
+ }, {
623
+ id: string;
624
+ kind: string;
625
+ version: "1";
626
+ artifact: {
627
+ version: string;
628
+ digest: string;
629
+ artifact: {
630
+ id: string;
631
+ kind: string;
632
+ };
633
+ };
634
+ claim: string;
635
+ provenance: {
636
+ workflow: {
637
+ name: string;
638
+ version?: string | undefined;
639
+ };
640
+ step: {
641
+ id: string;
642
+ index?: number | undefined;
643
+ attempt?: number | undefined;
644
+ };
645
+ producer: {
646
+ id: string;
647
+ kind: "capability" | "deterministic-step" | "runner";
648
+ };
649
+ trace: {
650
+ runId: string;
651
+ nodeRunId?: string | undefined;
652
+ };
653
+ interactionId?: string | undefined;
654
+ };
655
+ verification: {
656
+ status: "expired" | "verified" | "failed" | "unverified";
657
+ verifier: {
658
+ id: string;
659
+ kind: "capability" | "runner" | "human";
660
+ };
661
+ method: "artifact-digest" | "schema-check" | "deterministic-check" | "capability-attestation" | "human-approval";
662
+ checkedAt: string;
663
+ checks: {
664
+ code: string;
665
+ outcome: "failed" | "passed";
666
+ }[];
667
+ reasonCode?: string | undefined;
668
+ };
669
+ observedAt: string;
670
+ payload?: unknown;
671
+ expiresAt?: string | undefined;
672
+ }>;
673
+ export declare const EvidenceRequirementSchema: z.ZodObject<{
674
+ type: z.ZodLiteral<"evidence">;
675
+ id: z.ZodString;
676
+ kind: z.ZodString;
677
+ claim: z.ZodOptional<z.ZodString>;
678
+ artifactKind: z.ZodOptional<z.ZodString>;
679
+ producers: z.ZodArray<z.ZodEnum<["capability", "deterministic-step", "runner"]>, "many">;
680
+ verification: z.ZodLiteral<"verified">;
681
+ }, "strip", z.ZodTypeAny, {
682
+ id: string;
683
+ kind: string;
684
+ type: "evidence";
685
+ verification: "verified";
686
+ producers: ("capability" | "deterministic-step" | "runner")[];
687
+ claim?: string | undefined;
688
+ artifactKind?: string | undefined;
689
+ }, {
690
+ id: string;
691
+ kind: string;
692
+ type: "evidence";
693
+ verification: "verified";
694
+ producers: ("capability" | "deterministic-step" | "runner")[];
695
+ claim?: string | undefined;
696
+ artifactKind?: string | undefined;
697
+ }>;
698
+ export declare const ApprovalRequirementSchema: z.ZodObject<{
699
+ type: z.ZodLiteral<"approval">;
700
+ id: z.ZodString;
701
+ interactionId: z.ZodString;
702
+ status: z.ZodLiteral<"answered">;
703
+ }, "strip", z.ZodTypeAny, {
704
+ id: string;
705
+ interactionId: string;
706
+ status: "answered";
707
+ type: "approval";
708
+ }, {
709
+ id: string;
710
+ interactionId: string;
711
+ status: "answered";
712
+ type: "approval";
713
+ }>;
714
+ export declare const CompletionRequirementSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
715
+ type: z.ZodLiteral<"evidence">;
716
+ id: z.ZodString;
717
+ kind: z.ZodString;
718
+ claim: z.ZodOptional<z.ZodString>;
719
+ artifactKind: z.ZodOptional<z.ZodString>;
720
+ producers: z.ZodArray<z.ZodEnum<["capability", "deterministic-step", "runner"]>, "many">;
721
+ verification: z.ZodLiteral<"verified">;
722
+ }, "strip", z.ZodTypeAny, {
723
+ id: string;
724
+ kind: string;
725
+ type: "evidence";
726
+ verification: "verified";
727
+ producers: ("capability" | "deterministic-step" | "runner")[];
728
+ claim?: string | undefined;
729
+ artifactKind?: string | undefined;
730
+ }, {
731
+ id: string;
732
+ kind: string;
733
+ type: "evidence";
734
+ verification: "verified";
735
+ producers: ("capability" | "deterministic-step" | "runner")[];
736
+ claim?: string | undefined;
737
+ artifactKind?: string | undefined;
738
+ }>, z.ZodObject<{
739
+ type: z.ZodLiteral<"approval">;
740
+ id: z.ZodString;
741
+ interactionId: z.ZodString;
742
+ status: z.ZodLiteral<"answered">;
743
+ }, "strip", z.ZodTypeAny, {
744
+ id: string;
745
+ interactionId: string;
746
+ status: "answered";
747
+ type: "approval";
748
+ }, {
749
+ id: string;
750
+ interactionId: string;
751
+ status: "answered";
752
+ type: "approval";
753
+ }>]>;
754
+ export declare const CompletionContractSchema: z.ZodEffects<z.ZodObject<{
755
+ version: z.ZodLiteral<"1">;
756
+ id: z.ZodString;
757
+ mode: z.ZodEnum<["all", "any"]>;
758
+ requirements: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
759
+ type: z.ZodLiteral<"evidence">;
760
+ id: z.ZodString;
761
+ kind: z.ZodString;
762
+ claim: z.ZodOptional<z.ZodString>;
763
+ artifactKind: z.ZodOptional<z.ZodString>;
764
+ producers: z.ZodArray<z.ZodEnum<["capability", "deterministic-step", "runner"]>, "many">;
765
+ verification: z.ZodLiteral<"verified">;
766
+ }, "strip", z.ZodTypeAny, {
767
+ id: string;
768
+ kind: string;
769
+ type: "evidence";
770
+ verification: "verified";
771
+ producers: ("capability" | "deterministic-step" | "runner")[];
772
+ claim?: string | undefined;
773
+ artifactKind?: string | undefined;
774
+ }, {
775
+ id: string;
776
+ kind: string;
777
+ type: "evidence";
778
+ verification: "verified";
779
+ producers: ("capability" | "deterministic-step" | "runner")[];
780
+ claim?: string | undefined;
781
+ artifactKind?: string | undefined;
782
+ }>, z.ZodObject<{
783
+ type: z.ZodLiteral<"approval">;
784
+ id: z.ZodString;
785
+ interactionId: z.ZodString;
786
+ status: z.ZodLiteral<"answered">;
787
+ }, "strip", z.ZodTypeAny, {
788
+ id: string;
789
+ interactionId: string;
790
+ status: "answered";
791
+ type: "approval";
792
+ }, {
793
+ id: string;
794
+ interactionId: string;
795
+ status: "answered";
796
+ type: "approval";
797
+ }>]>, "many">;
798
+ }, "strip", z.ZodTypeAny, {
799
+ id: string;
800
+ version: "1";
801
+ mode: "all" | "any";
802
+ requirements: ({
803
+ id: string;
804
+ kind: string;
805
+ type: "evidence";
806
+ verification: "verified";
807
+ producers: ("capability" | "deterministic-step" | "runner")[];
808
+ claim?: string | undefined;
809
+ artifactKind?: string | undefined;
810
+ } | {
811
+ id: string;
812
+ interactionId: string;
813
+ status: "answered";
814
+ type: "approval";
815
+ })[];
816
+ }, {
817
+ id: string;
818
+ version: "1";
819
+ mode: "all" | "any";
820
+ requirements: ({
821
+ id: string;
822
+ kind: string;
823
+ type: "evidence";
824
+ verification: "verified";
825
+ producers: ("capability" | "deterministic-step" | "runner")[];
826
+ claim?: string | undefined;
827
+ artifactKind?: string | undefined;
828
+ } | {
829
+ id: string;
830
+ interactionId: string;
831
+ status: "answered";
832
+ type: "approval";
833
+ })[];
834
+ }>, {
835
+ id: string;
836
+ version: "1";
837
+ mode: "all" | "any";
838
+ requirements: ({
839
+ id: string;
840
+ kind: string;
841
+ type: "evidence";
842
+ verification: "verified";
843
+ producers: ("capability" | "deterministic-step" | "runner")[];
844
+ claim?: string | undefined;
845
+ artifactKind?: string | undefined;
846
+ } | {
847
+ id: string;
848
+ interactionId: string;
849
+ status: "answered";
850
+ type: "approval";
851
+ })[];
852
+ }, {
853
+ id: string;
854
+ version: "1";
855
+ mode: "all" | "any";
856
+ requirements: ({
857
+ id: string;
858
+ kind: string;
859
+ type: "evidence";
860
+ verification: "verified";
861
+ producers: ("capability" | "deterministic-step" | "runner")[];
862
+ claim?: string | undefined;
863
+ artifactKind?: string | undefined;
864
+ } | {
865
+ id: string;
866
+ interactionId: string;
867
+ status: "answered";
868
+ type: "approval";
869
+ })[];
870
+ }>;
871
+ /** Parse one bounded structured fact payload without accepting model prose as a record. */
872
+ export declare function parseEvidencePayload(value: unknown): EvidencePayload;
873
+ /** Parse and normalize an evidence record at the trusted boundary. */
874
+ export declare function parseEvidenceRecord(value: unknown): EvidenceRecord;
875
+ /** Parse and normalize a completion contract at the workflow/load boundary. */
876
+ export declare function parseCompletionContract(value: unknown): CompletionContract;
877
+ export declare function serializeEvidenceRecord(value: unknown): string;
878
+ export declare function serializeCompletionContract(value: unknown): string;
879
+ /**
880
+ * A model message is descriptive context only. It cannot be adapted into a
881
+ * trusted record because the only accepted producer kinds are capability,
882
+ * deterministic-step, and runner.
883
+ */
884
+ export declare function rejectModelEvidence(_value: unknown): never;