@blokjs/shared 2.1.0 → 2.2.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.
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,1062 @@
1
+ import { z } from "zod";
2
+ import { type EnforcementProfile } from "./EnforcementProfileContracts.js";
3
+ import type { PrincipalIdentity } from "./PolicyContracts.js";
4
+ /** Version of the language-neutral workflow binding contract. */
5
+ export declare const WORKFLOW_BINDING_CONTRACT_VERSION: "1";
6
+ export declare const WORKFLOW_RUN_CONTRACT_VERSION: "1";
7
+ export declare const ENFORCEMENT_OVERRIDE_EVENT_VERSION: "1";
8
+ export declare const WORKFLOW_BINDING_MAX_RULES = 128;
9
+ export declare const WORKFLOW_BINDING_MAX_LABELS = 128;
10
+ export declare const WORKFLOW_BINDING_MAX_PATHS = 128;
11
+ export declare const WORKFLOW_BINDING_MAX_ATTRIBUTES = 64;
12
+ export declare const WORKFLOW_BINDING_MAX_NODES = 512;
13
+ export declare const WORKFLOW_BINDING_MAX_RUNTIMES = 32;
14
+ export declare const WORKFLOW_BINDING_MAX_SCOPE_ITEMS = 128;
15
+ export declare const WORKFLOW_BINDING_MAX_STRING_LENGTH = 256;
16
+ export declare const WORKFLOW_BINDING_MAX_CONTRACT_BYTES: number;
17
+ export declare const WORKFLOW_SOURCE_KINDS: readonly ["registry", "repository", "workspace"];
18
+ export declare const WORKFLOW_RUNTIME_KINDS: readonly ["nodejs", "bun", "python3", "go", "java", "kotlin", "rust", "php", "csharp", "ruby", "swift", "dart", "elixir", "docker", "wasm", "wasi"];
19
+ export type WorkflowSourceKind = (typeof WORKFLOW_SOURCE_KINDS)[number];
20
+ export type WorkflowRuntimeKind = (typeof WORKFLOW_RUNTIME_KINDS)[number];
21
+ export type BindingScalar = string | number | boolean;
22
+ export interface RepositoryIdentity {
23
+ readonly provider: string;
24
+ readonly id: string;
25
+ readonly revision?: string;
26
+ }
27
+ export interface BindingActorIdentity extends PrincipalIdentity {
28
+ }
29
+ /** Runtime facts used to select a binding; no payloads or secrets are allowed. */
30
+ export interface WorkflowBindingInputs {
31
+ readonly repository?: RepositoryIdentity;
32
+ readonly taskType?: string;
33
+ readonly labels?: readonly string[];
34
+ readonly paths?: readonly string[];
35
+ readonly tenant?: string;
36
+ readonly actor?: BindingActorIdentity;
37
+ readonly environment?: string;
38
+ readonly attributes?: Readonly<Record<string, BindingScalar>>;
39
+ }
40
+ export interface WorkflowBindingSelector {
41
+ readonly repository?: RepositoryIdentity;
42
+ readonly taskTypes?: readonly string[];
43
+ /** Every listed label is required; labels are normalized as a set. */
44
+ readonly labels?: readonly string[];
45
+ /** A selector path matches by the resolver's documented path policy. */
46
+ readonly paths?: readonly string[];
47
+ readonly tenant?: string;
48
+ readonly actors?: readonly string[];
49
+ readonly environments?: readonly string[];
50
+ readonly attributes?: Readonly<Record<string, BindingScalar>>;
51
+ }
52
+ export interface TrustedWorkflowSource {
53
+ readonly kind: WorkflowSourceKind;
54
+ readonly id: string;
55
+ readonly digest: string;
56
+ readonly trusted: true;
57
+ }
58
+ export interface WorkflowReference {
59
+ readonly name: string;
60
+ readonly version: string;
61
+ readonly source: TrustedWorkflowSource;
62
+ readonly irDigest: string;
63
+ }
64
+ export interface WorkflowBindingRule {
65
+ readonly version: typeof WORKFLOW_BINDING_CONTRACT_VERSION;
66
+ readonly id: string;
67
+ readonly priority: number;
68
+ readonly selector: WorkflowBindingSelector;
69
+ readonly workflow: WorkflowReference;
70
+ readonly profile: EnforcementProfile;
71
+ }
72
+ export type WorkflowBindingRules = readonly WorkflowBindingRule[];
73
+ export interface PinnedNodeIdentity {
74
+ readonly id: string;
75
+ readonly version: string;
76
+ readonly digest?: string;
77
+ }
78
+ export interface PinnedRuntimeIdentity {
79
+ readonly kind: WorkflowRuntimeKind;
80
+ readonly version: string;
81
+ }
82
+ export interface PinnedCapabilityManifestIdentity {
83
+ readonly version: string;
84
+ readonly digest: string;
85
+ }
86
+ export interface PinnedPolicyIdentity {
87
+ readonly id: string;
88
+ readonly version: string;
89
+ readonly digest?: string;
90
+ }
91
+ export interface PinnedModelConfigurationIdentity {
92
+ readonly provider: string;
93
+ readonly id: string;
94
+ readonly version: string;
95
+ readonly configDigest: string;
96
+ }
97
+ /** Immutable execution contract captured before a bound run starts. */
98
+ export interface PinnedWorkflowRunContract {
99
+ readonly version: typeof WORKFLOW_RUN_CONTRACT_VERSION;
100
+ readonly runId: string;
101
+ readonly profile: EnforcementProfile;
102
+ readonly bindingRuleId: string;
103
+ readonly boundAt: string;
104
+ readonly workflow: WorkflowReference;
105
+ readonly nodes: readonly PinnedNodeIdentity[];
106
+ readonly runtimes: readonly PinnedRuntimeIdentity[];
107
+ readonly capabilityManifest: PinnedCapabilityManifestIdentity;
108
+ readonly policy: PinnedPolicyIdentity;
109
+ readonly model: PinnedModelConfigurationIdentity;
110
+ }
111
+ export interface EnforcementOverrideScope {
112
+ readonly stepIds?: readonly string[];
113
+ readonly transitionIds?: readonly string[];
114
+ readonly capabilityIds?: readonly string[];
115
+ }
116
+ export interface EnforcementOverrideAuthorization {
117
+ readonly method: "durable-interaction";
118
+ readonly interactionId: string;
119
+ readonly decisionId: string;
120
+ readonly status: "answered";
121
+ }
122
+ /** Append-only event authorizing one bounded deviation in guided mode. */
123
+ export interface EnforcementOverrideEvent {
124
+ readonly version: typeof ENFORCEMENT_OVERRIDE_EVENT_VERSION;
125
+ readonly eventType: "enforcement.override";
126
+ readonly eventId: string;
127
+ readonly timestamp: string;
128
+ readonly runId: string;
129
+ readonly profile: "guided";
130
+ readonly bindingRuleId: string;
131
+ readonly requestedBy?: BindingActorIdentity;
132
+ readonly authorizedBy: BindingActorIdentity;
133
+ readonly authorization: EnforcementOverrideAuthorization;
134
+ readonly reasonCode: string;
135
+ readonly reason?: string;
136
+ readonly scope: EnforcementOverrideScope;
137
+ readonly expiresAt?: string;
138
+ }
139
+ export declare const WorkflowBindingInputsSchema: z.ZodObject<{
140
+ repository: z.ZodOptional<z.ZodObject<{
141
+ provider: z.ZodString;
142
+ id: z.ZodString;
143
+ revision: z.ZodOptional<z.ZodString>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ id: string;
146
+ provider: string;
147
+ revision?: string | undefined;
148
+ }, {
149
+ id: string;
150
+ provider: string;
151
+ revision?: string | undefined;
152
+ }>>;
153
+ taskType: z.ZodOptional<z.ZodString>;
154
+ labels: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
155
+ paths: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
156
+ tenant: z.ZodOptional<z.ZodString>;
157
+ actor: z.ZodOptional<z.ZodObject<{
158
+ id: z.ZodString;
159
+ kind: z.ZodString;
160
+ }, "strip", z.ZodTypeAny, {
161
+ id: string;
162
+ kind: string;
163
+ }, {
164
+ id: string;
165
+ kind: string;
166
+ }>>;
167
+ environment: z.ZodOptional<z.ZodString>;
168
+ attributes: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>, Record<string, string | number | boolean>, Record<string, string | number | boolean>>>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ actor?: {
171
+ id: string;
172
+ kind: string;
173
+ } | undefined;
174
+ repository?: {
175
+ id: string;
176
+ provider: string;
177
+ revision?: string | undefined;
178
+ } | undefined;
179
+ taskType?: string | undefined;
180
+ labels?: string[] | undefined;
181
+ paths?: string[] | undefined;
182
+ tenant?: string | undefined;
183
+ environment?: string | undefined;
184
+ attributes?: Record<string, string | number | boolean> | undefined;
185
+ }, {
186
+ actor?: {
187
+ id: string;
188
+ kind: string;
189
+ } | undefined;
190
+ repository?: {
191
+ id: string;
192
+ provider: string;
193
+ revision?: string | undefined;
194
+ } | undefined;
195
+ taskType?: string | undefined;
196
+ labels?: string[] | undefined;
197
+ paths?: string[] | undefined;
198
+ tenant?: string | undefined;
199
+ environment?: string | undefined;
200
+ attributes?: Record<string, string | number | boolean> | undefined;
201
+ }>;
202
+ export declare const WorkflowBindingSelectorSchema: z.ZodObject<{
203
+ repository: z.ZodOptional<z.ZodObject<{
204
+ provider: z.ZodString;
205
+ id: z.ZodString;
206
+ revision: z.ZodOptional<z.ZodString>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ id: string;
209
+ provider: string;
210
+ revision?: string | undefined;
211
+ }, {
212
+ id: string;
213
+ provider: string;
214
+ revision?: string | undefined;
215
+ }>>;
216
+ taskTypes: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
217
+ labels: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
218
+ paths: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
219
+ tenant: z.ZodOptional<z.ZodString>;
220
+ actors: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
221
+ environments: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
222
+ attributes: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>, Record<string, string | number | boolean>, Record<string, string | number | boolean>>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ repository?: {
225
+ id: string;
226
+ provider: string;
227
+ revision?: string | undefined;
228
+ } | undefined;
229
+ labels?: string[] | undefined;
230
+ paths?: string[] | undefined;
231
+ tenant?: string | undefined;
232
+ attributes?: Record<string, string | number | boolean> | undefined;
233
+ taskTypes?: string[] | undefined;
234
+ actors?: string[] | undefined;
235
+ environments?: string[] | undefined;
236
+ }, {
237
+ repository?: {
238
+ id: string;
239
+ provider: string;
240
+ revision?: string | undefined;
241
+ } | undefined;
242
+ labels?: string[] | undefined;
243
+ paths?: string[] | undefined;
244
+ tenant?: string | undefined;
245
+ attributes?: Record<string, string | number | boolean> | undefined;
246
+ taskTypes?: string[] | undefined;
247
+ actors?: string[] | undefined;
248
+ environments?: string[] | undefined;
249
+ }>;
250
+ export declare const WorkflowBindingRuleSchema: z.ZodObject<{
251
+ version: z.ZodLiteral<"1">;
252
+ id: z.ZodString;
253
+ priority: z.ZodNumber;
254
+ selector: z.ZodObject<{
255
+ repository: z.ZodOptional<z.ZodObject<{
256
+ provider: z.ZodString;
257
+ id: z.ZodString;
258
+ revision: z.ZodOptional<z.ZodString>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ id: string;
261
+ provider: string;
262
+ revision?: string | undefined;
263
+ }, {
264
+ id: string;
265
+ provider: string;
266
+ revision?: string | undefined;
267
+ }>>;
268
+ taskTypes: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
269
+ labels: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
270
+ paths: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
271
+ tenant: z.ZodOptional<z.ZodString>;
272
+ actors: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
273
+ environments: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
274
+ attributes: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>, Record<string, string | number | boolean>, Record<string, string | number | boolean>>>;
275
+ }, "strip", z.ZodTypeAny, {
276
+ repository?: {
277
+ id: string;
278
+ provider: string;
279
+ revision?: string | undefined;
280
+ } | undefined;
281
+ labels?: string[] | undefined;
282
+ paths?: string[] | undefined;
283
+ tenant?: string | undefined;
284
+ attributes?: Record<string, string | number | boolean> | undefined;
285
+ taskTypes?: string[] | undefined;
286
+ actors?: string[] | undefined;
287
+ environments?: string[] | undefined;
288
+ }, {
289
+ repository?: {
290
+ id: string;
291
+ provider: string;
292
+ revision?: string | undefined;
293
+ } | undefined;
294
+ labels?: string[] | undefined;
295
+ paths?: string[] | undefined;
296
+ tenant?: string | undefined;
297
+ attributes?: Record<string, string | number | boolean> | undefined;
298
+ taskTypes?: string[] | undefined;
299
+ actors?: string[] | undefined;
300
+ environments?: string[] | undefined;
301
+ }>;
302
+ workflow: z.ZodObject<{
303
+ name: z.ZodString;
304
+ version: z.ZodString;
305
+ source: z.ZodObject<{
306
+ kind: z.ZodEnum<["registry", "repository", "workspace"]>;
307
+ id: z.ZodString;
308
+ digest: z.ZodEffects<z.ZodString, string, string>;
309
+ trusted: z.ZodLiteral<true>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ id: string;
312
+ kind: "repository" | "registry" | "workspace";
313
+ digest: string;
314
+ trusted: true;
315
+ }, {
316
+ id: string;
317
+ kind: "repository" | "registry" | "workspace";
318
+ digest: string;
319
+ trusted: true;
320
+ }>;
321
+ irDigest: z.ZodEffects<z.ZodString, string, string>;
322
+ }, "strip", z.ZodTypeAny, {
323
+ version: string;
324
+ name: string;
325
+ source: {
326
+ id: string;
327
+ kind: "repository" | "registry" | "workspace";
328
+ digest: string;
329
+ trusted: true;
330
+ };
331
+ irDigest: string;
332
+ }, {
333
+ version: string;
334
+ name: string;
335
+ source: {
336
+ id: string;
337
+ kind: "repository" | "registry" | "workspace";
338
+ digest: string;
339
+ trusted: true;
340
+ };
341
+ irDigest: string;
342
+ }>;
343
+ profile: z.ZodEnum<["advisory", "guided", "strict"]>;
344
+ }, "strip", z.ZodTypeAny, {
345
+ workflow: {
346
+ version: string;
347
+ name: string;
348
+ source: {
349
+ id: string;
350
+ kind: "repository" | "registry" | "workspace";
351
+ digest: string;
352
+ trusted: true;
353
+ };
354
+ irDigest: string;
355
+ };
356
+ id: string;
357
+ version: "1";
358
+ profile: "strict" | "advisory" | "guided";
359
+ priority: number;
360
+ selector: {
361
+ repository?: {
362
+ id: string;
363
+ provider: string;
364
+ revision?: string | undefined;
365
+ } | undefined;
366
+ labels?: string[] | undefined;
367
+ paths?: string[] | undefined;
368
+ tenant?: string | undefined;
369
+ attributes?: Record<string, string | number | boolean> | undefined;
370
+ taskTypes?: string[] | undefined;
371
+ actors?: string[] | undefined;
372
+ environments?: string[] | undefined;
373
+ };
374
+ }, {
375
+ workflow: {
376
+ version: string;
377
+ name: string;
378
+ source: {
379
+ id: string;
380
+ kind: "repository" | "registry" | "workspace";
381
+ digest: string;
382
+ trusted: true;
383
+ };
384
+ irDigest: string;
385
+ };
386
+ id: string;
387
+ version: "1";
388
+ profile: "strict" | "advisory" | "guided";
389
+ priority: number;
390
+ selector: {
391
+ repository?: {
392
+ id: string;
393
+ provider: string;
394
+ revision?: string | undefined;
395
+ } | undefined;
396
+ labels?: string[] | undefined;
397
+ paths?: string[] | undefined;
398
+ tenant?: string | undefined;
399
+ attributes?: Record<string, string | number | boolean> | undefined;
400
+ taskTypes?: string[] | undefined;
401
+ actors?: string[] | undefined;
402
+ environments?: string[] | undefined;
403
+ };
404
+ }>;
405
+ export declare const WorkflowBindingRulesSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
406
+ version: z.ZodLiteral<"1">;
407
+ id: z.ZodString;
408
+ priority: z.ZodNumber;
409
+ selector: z.ZodObject<{
410
+ repository: z.ZodOptional<z.ZodObject<{
411
+ provider: z.ZodString;
412
+ id: z.ZodString;
413
+ revision: z.ZodOptional<z.ZodString>;
414
+ }, "strip", z.ZodTypeAny, {
415
+ id: string;
416
+ provider: string;
417
+ revision?: string | undefined;
418
+ }, {
419
+ id: string;
420
+ provider: string;
421
+ revision?: string | undefined;
422
+ }>>;
423
+ taskTypes: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
424
+ labels: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
425
+ paths: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
426
+ tenant: z.ZodOptional<z.ZodString>;
427
+ actors: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
428
+ environments: z.ZodOptional<z.ZodArray<z.ZodType<string, z.ZodTypeDef, string>, "many">>;
429
+ attributes: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>, Record<string, string | number | boolean>, Record<string, string | number | boolean>>>;
430
+ }, "strip", z.ZodTypeAny, {
431
+ repository?: {
432
+ id: string;
433
+ provider: string;
434
+ revision?: string | undefined;
435
+ } | undefined;
436
+ labels?: string[] | undefined;
437
+ paths?: string[] | undefined;
438
+ tenant?: string | undefined;
439
+ attributes?: Record<string, string | number | boolean> | undefined;
440
+ taskTypes?: string[] | undefined;
441
+ actors?: string[] | undefined;
442
+ environments?: string[] | undefined;
443
+ }, {
444
+ repository?: {
445
+ id: string;
446
+ provider: string;
447
+ revision?: string | undefined;
448
+ } | undefined;
449
+ labels?: string[] | undefined;
450
+ paths?: string[] | undefined;
451
+ tenant?: string | undefined;
452
+ attributes?: Record<string, string | number | boolean> | undefined;
453
+ taskTypes?: string[] | undefined;
454
+ actors?: string[] | undefined;
455
+ environments?: string[] | undefined;
456
+ }>;
457
+ workflow: z.ZodObject<{
458
+ name: z.ZodString;
459
+ version: z.ZodString;
460
+ source: z.ZodObject<{
461
+ kind: z.ZodEnum<["registry", "repository", "workspace"]>;
462
+ id: z.ZodString;
463
+ digest: z.ZodEffects<z.ZodString, string, string>;
464
+ trusted: z.ZodLiteral<true>;
465
+ }, "strip", z.ZodTypeAny, {
466
+ id: string;
467
+ kind: "repository" | "registry" | "workspace";
468
+ digest: string;
469
+ trusted: true;
470
+ }, {
471
+ id: string;
472
+ kind: "repository" | "registry" | "workspace";
473
+ digest: string;
474
+ trusted: true;
475
+ }>;
476
+ irDigest: z.ZodEffects<z.ZodString, string, string>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ version: string;
479
+ name: string;
480
+ source: {
481
+ id: string;
482
+ kind: "repository" | "registry" | "workspace";
483
+ digest: string;
484
+ trusted: true;
485
+ };
486
+ irDigest: string;
487
+ }, {
488
+ version: string;
489
+ name: string;
490
+ source: {
491
+ id: string;
492
+ kind: "repository" | "registry" | "workspace";
493
+ digest: string;
494
+ trusted: true;
495
+ };
496
+ irDigest: string;
497
+ }>;
498
+ profile: z.ZodEnum<["advisory", "guided", "strict"]>;
499
+ }, "strip", z.ZodTypeAny, {
500
+ workflow: {
501
+ version: string;
502
+ name: string;
503
+ source: {
504
+ id: string;
505
+ kind: "repository" | "registry" | "workspace";
506
+ digest: string;
507
+ trusted: true;
508
+ };
509
+ irDigest: string;
510
+ };
511
+ id: string;
512
+ version: "1";
513
+ profile: "strict" | "advisory" | "guided";
514
+ priority: number;
515
+ selector: {
516
+ repository?: {
517
+ id: string;
518
+ provider: string;
519
+ revision?: string | undefined;
520
+ } | undefined;
521
+ labels?: string[] | undefined;
522
+ paths?: string[] | undefined;
523
+ tenant?: string | undefined;
524
+ attributes?: Record<string, string | number | boolean> | undefined;
525
+ taskTypes?: string[] | undefined;
526
+ actors?: string[] | undefined;
527
+ environments?: string[] | undefined;
528
+ };
529
+ }, {
530
+ workflow: {
531
+ version: string;
532
+ name: string;
533
+ source: {
534
+ id: string;
535
+ kind: "repository" | "registry" | "workspace";
536
+ digest: string;
537
+ trusted: true;
538
+ };
539
+ irDigest: string;
540
+ };
541
+ id: string;
542
+ version: "1";
543
+ profile: "strict" | "advisory" | "guided";
544
+ priority: number;
545
+ selector: {
546
+ repository?: {
547
+ id: string;
548
+ provider: string;
549
+ revision?: string | undefined;
550
+ } | undefined;
551
+ labels?: string[] | undefined;
552
+ paths?: string[] | undefined;
553
+ tenant?: string | undefined;
554
+ attributes?: Record<string, string | number | boolean> | undefined;
555
+ taskTypes?: string[] | undefined;
556
+ actors?: string[] | undefined;
557
+ environments?: string[] | undefined;
558
+ };
559
+ }>, "many">, {
560
+ workflow: {
561
+ version: string;
562
+ name: string;
563
+ source: {
564
+ id: string;
565
+ kind: "repository" | "registry" | "workspace";
566
+ digest: string;
567
+ trusted: true;
568
+ };
569
+ irDigest: string;
570
+ };
571
+ id: string;
572
+ version: "1";
573
+ profile: "strict" | "advisory" | "guided";
574
+ priority: number;
575
+ selector: {
576
+ repository?: {
577
+ id: string;
578
+ provider: string;
579
+ revision?: string | undefined;
580
+ } | undefined;
581
+ labels?: string[] | undefined;
582
+ paths?: string[] | undefined;
583
+ tenant?: string | undefined;
584
+ attributes?: Record<string, string | number | boolean> | undefined;
585
+ taskTypes?: string[] | undefined;
586
+ actors?: string[] | undefined;
587
+ environments?: string[] | undefined;
588
+ };
589
+ }[], {
590
+ workflow: {
591
+ version: string;
592
+ name: string;
593
+ source: {
594
+ id: string;
595
+ kind: "repository" | "registry" | "workspace";
596
+ digest: string;
597
+ trusted: true;
598
+ };
599
+ irDigest: string;
600
+ };
601
+ id: string;
602
+ version: "1";
603
+ profile: "strict" | "advisory" | "guided";
604
+ priority: number;
605
+ selector: {
606
+ repository?: {
607
+ id: string;
608
+ provider: string;
609
+ revision?: string | undefined;
610
+ } | undefined;
611
+ labels?: string[] | undefined;
612
+ paths?: string[] | undefined;
613
+ tenant?: string | undefined;
614
+ attributes?: Record<string, string | number | boolean> | undefined;
615
+ taskTypes?: string[] | undefined;
616
+ actors?: string[] | undefined;
617
+ environments?: string[] | undefined;
618
+ };
619
+ }[]>;
620
+ export declare const PinnedWorkflowRunContractSchema: z.ZodEffects<z.ZodObject<{
621
+ version: z.ZodLiteral<"1">;
622
+ runId: z.ZodString;
623
+ profile: z.ZodEnum<["advisory", "guided", "strict"]>;
624
+ bindingRuleId: z.ZodString;
625
+ boundAt: z.ZodString;
626
+ workflow: z.ZodObject<{
627
+ name: z.ZodString;
628
+ version: z.ZodString;
629
+ source: z.ZodObject<{
630
+ kind: z.ZodEnum<["registry", "repository", "workspace"]>;
631
+ id: z.ZodString;
632
+ digest: z.ZodEffects<z.ZodString, string, string>;
633
+ trusted: z.ZodLiteral<true>;
634
+ }, "strip", z.ZodTypeAny, {
635
+ id: string;
636
+ kind: "repository" | "registry" | "workspace";
637
+ digest: string;
638
+ trusted: true;
639
+ }, {
640
+ id: string;
641
+ kind: "repository" | "registry" | "workspace";
642
+ digest: string;
643
+ trusted: true;
644
+ }>;
645
+ irDigest: z.ZodEffects<z.ZodString, string, string>;
646
+ }, "strip", z.ZodTypeAny, {
647
+ version: string;
648
+ name: string;
649
+ source: {
650
+ id: string;
651
+ kind: "repository" | "registry" | "workspace";
652
+ digest: string;
653
+ trusted: true;
654
+ };
655
+ irDigest: string;
656
+ }, {
657
+ version: string;
658
+ name: string;
659
+ source: {
660
+ id: string;
661
+ kind: "repository" | "registry" | "workspace";
662
+ digest: string;
663
+ trusted: true;
664
+ };
665
+ irDigest: string;
666
+ }>;
667
+ nodes: z.ZodArray<z.ZodObject<{
668
+ id: z.ZodString;
669
+ version: z.ZodString;
670
+ digest: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ id: string;
673
+ version: string;
674
+ digest?: string | undefined;
675
+ }, {
676
+ id: string;
677
+ version: string;
678
+ digest?: string | undefined;
679
+ }>, "many">;
680
+ runtimes: z.ZodArray<z.ZodObject<{
681
+ kind: z.ZodEnum<["nodejs", "bun", "python3", "go", "java", "kotlin", "rust", "php", "csharp", "ruby", "swift", "dart", "elixir", "docker", "wasm", "wasi"]>;
682
+ version: z.ZodString;
683
+ }, "strip", z.ZodTypeAny, {
684
+ kind: "nodejs" | "bun" | "python3" | "go" | "java" | "kotlin" | "rust" | "php" | "csharp" | "ruby" | "swift" | "dart" | "elixir" | "docker" | "wasm" | "wasi";
685
+ version: string;
686
+ }, {
687
+ kind: "nodejs" | "bun" | "python3" | "go" | "java" | "kotlin" | "rust" | "php" | "csharp" | "ruby" | "swift" | "dart" | "elixir" | "docker" | "wasm" | "wasi";
688
+ version: string;
689
+ }>, "many">;
690
+ capabilityManifest: z.ZodObject<{
691
+ version: z.ZodString;
692
+ digest: z.ZodEffects<z.ZodString, string, string>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ version: string;
695
+ digest: string;
696
+ }, {
697
+ version: string;
698
+ digest: string;
699
+ }>;
700
+ policy: z.ZodObject<{
701
+ id: z.ZodString;
702
+ version: z.ZodString;
703
+ digest: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
704
+ }, "strip", z.ZodTypeAny, {
705
+ id: string;
706
+ version: string;
707
+ digest?: string | undefined;
708
+ }, {
709
+ id: string;
710
+ version: string;
711
+ digest?: string | undefined;
712
+ }>;
713
+ model: z.ZodObject<{
714
+ provider: z.ZodString;
715
+ id: z.ZodString;
716
+ version: z.ZodString;
717
+ configDigest: z.ZodEffects<z.ZodString, string, string>;
718
+ }, "strip", z.ZodTypeAny, {
719
+ id: string;
720
+ version: string;
721
+ provider: string;
722
+ configDigest: string;
723
+ }, {
724
+ id: string;
725
+ version: string;
726
+ provider: string;
727
+ configDigest: string;
728
+ }>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ workflow: {
731
+ version: string;
732
+ name: string;
733
+ source: {
734
+ id: string;
735
+ kind: "repository" | "registry" | "workspace";
736
+ digest: string;
737
+ trusted: true;
738
+ };
739
+ irDigest: string;
740
+ };
741
+ version: "1";
742
+ runtimes: {
743
+ kind: "nodejs" | "bun" | "python3" | "go" | "java" | "kotlin" | "rust" | "php" | "csharp" | "ruby" | "swift" | "dart" | "elixir" | "docker" | "wasm" | "wasi";
744
+ version: string;
745
+ }[];
746
+ model: {
747
+ id: string;
748
+ version: string;
749
+ provider: string;
750
+ configDigest: string;
751
+ };
752
+ profile: "strict" | "advisory" | "guided";
753
+ runId: string;
754
+ bindingRuleId: string;
755
+ boundAt: string;
756
+ nodes: {
757
+ id: string;
758
+ version: string;
759
+ digest?: string | undefined;
760
+ }[];
761
+ capabilityManifest: {
762
+ version: string;
763
+ digest: string;
764
+ };
765
+ policy: {
766
+ id: string;
767
+ version: string;
768
+ digest?: string | undefined;
769
+ };
770
+ }, {
771
+ workflow: {
772
+ version: string;
773
+ name: string;
774
+ source: {
775
+ id: string;
776
+ kind: "repository" | "registry" | "workspace";
777
+ digest: string;
778
+ trusted: true;
779
+ };
780
+ irDigest: string;
781
+ };
782
+ version: "1";
783
+ runtimes: {
784
+ kind: "nodejs" | "bun" | "python3" | "go" | "java" | "kotlin" | "rust" | "php" | "csharp" | "ruby" | "swift" | "dart" | "elixir" | "docker" | "wasm" | "wasi";
785
+ version: string;
786
+ }[];
787
+ model: {
788
+ id: string;
789
+ version: string;
790
+ provider: string;
791
+ configDigest: string;
792
+ };
793
+ profile: "strict" | "advisory" | "guided";
794
+ runId: string;
795
+ bindingRuleId: string;
796
+ boundAt: string;
797
+ nodes: {
798
+ id: string;
799
+ version: string;
800
+ digest?: string | undefined;
801
+ }[];
802
+ capabilityManifest: {
803
+ version: string;
804
+ digest: string;
805
+ };
806
+ policy: {
807
+ id: string;
808
+ version: string;
809
+ digest?: string | undefined;
810
+ };
811
+ }>, {
812
+ workflow: {
813
+ version: string;
814
+ name: string;
815
+ source: {
816
+ id: string;
817
+ kind: "repository" | "registry" | "workspace";
818
+ digest: string;
819
+ trusted: true;
820
+ };
821
+ irDigest: string;
822
+ };
823
+ version: "1";
824
+ runtimes: {
825
+ kind: "nodejs" | "bun" | "python3" | "go" | "java" | "kotlin" | "rust" | "php" | "csharp" | "ruby" | "swift" | "dart" | "elixir" | "docker" | "wasm" | "wasi";
826
+ version: string;
827
+ }[];
828
+ model: {
829
+ id: string;
830
+ version: string;
831
+ provider: string;
832
+ configDigest: string;
833
+ };
834
+ profile: "strict" | "advisory" | "guided";
835
+ runId: string;
836
+ bindingRuleId: string;
837
+ boundAt: string;
838
+ nodes: {
839
+ id: string;
840
+ version: string;
841
+ digest?: string | undefined;
842
+ }[];
843
+ capabilityManifest: {
844
+ version: string;
845
+ digest: string;
846
+ };
847
+ policy: {
848
+ id: string;
849
+ version: string;
850
+ digest?: string | undefined;
851
+ };
852
+ }, {
853
+ workflow: {
854
+ version: string;
855
+ name: string;
856
+ source: {
857
+ id: string;
858
+ kind: "repository" | "registry" | "workspace";
859
+ digest: string;
860
+ trusted: true;
861
+ };
862
+ irDigest: string;
863
+ };
864
+ version: "1";
865
+ runtimes: {
866
+ kind: "nodejs" | "bun" | "python3" | "go" | "java" | "kotlin" | "rust" | "php" | "csharp" | "ruby" | "swift" | "dart" | "elixir" | "docker" | "wasm" | "wasi";
867
+ version: string;
868
+ }[];
869
+ model: {
870
+ id: string;
871
+ version: string;
872
+ provider: string;
873
+ configDigest: string;
874
+ };
875
+ profile: "strict" | "advisory" | "guided";
876
+ runId: string;
877
+ bindingRuleId: string;
878
+ boundAt: string;
879
+ nodes: {
880
+ id: string;
881
+ version: string;
882
+ digest?: string | undefined;
883
+ }[];
884
+ capabilityManifest: {
885
+ version: string;
886
+ digest: string;
887
+ };
888
+ policy: {
889
+ id: string;
890
+ version: string;
891
+ digest?: string | undefined;
892
+ };
893
+ }>;
894
+ export declare const EnforcementOverrideScopeSchema: z.ZodEffects<z.ZodObject<{
895
+ stepIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
896
+ transitionIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
897
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
898
+ }, "strip", z.ZodTypeAny, {
899
+ stepIds?: string[] | undefined;
900
+ transitionIds?: string[] | undefined;
901
+ capabilityIds?: string[] | undefined;
902
+ }, {
903
+ stepIds?: string[] | undefined;
904
+ transitionIds?: string[] | undefined;
905
+ capabilityIds?: string[] | undefined;
906
+ }>, {
907
+ stepIds?: string[] | undefined;
908
+ transitionIds?: string[] | undefined;
909
+ capabilityIds?: string[] | undefined;
910
+ }, {
911
+ stepIds?: string[] | undefined;
912
+ transitionIds?: string[] | undefined;
913
+ capabilityIds?: string[] | undefined;
914
+ }>;
915
+ export declare const EnforcementOverrideEventSchema: z.ZodObject<{
916
+ version: z.ZodLiteral<"1">;
917
+ eventType: z.ZodLiteral<"enforcement.override">;
918
+ eventId: z.ZodString;
919
+ timestamp: z.ZodString;
920
+ runId: z.ZodString;
921
+ profile: z.ZodLiteral<"guided">;
922
+ bindingRuleId: z.ZodString;
923
+ requestedBy: z.ZodOptional<z.ZodObject<{
924
+ id: z.ZodString;
925
+ kind: z.ZodString;
926
+ }, "strip", z.ZodTypeAny, {
927
+ id: string;
928
+ kind: string;
929
+ }, {
930
+ id: string;
931
+ kind: string;
932
+ }>>;
933
+ authorizedBy: z.ZodObject<{
934
+ id: z.ZodString;
935
+ kind: z.ZodString;
936
+ }, "strip", z.ZodTypeAny, {
937
+ id: string;
938
+ kind: string;
939
+ }, {
940
+ id: string;
941
+ kind: string;
942
+ }>;
943
+ authorization: z.ZodObject<{
944
+ method: z.ZodLiteral<"durable-interaction">;
945
+ interactionId: z.ZodString;
946
+ decisionId: z.ZodString;
947
+ status: z.ZodLiteral<"answered">;
948
+ }, "strip", z.ZodTypeAny, {
949
+ interactionId: string;
950
+ status: "answered";
951
+ method: "durable-interaction";
952
+ decisionId: string;
953
+ }, {
954
+ interactionId: string;
955
+ status: "answered";
956
+ method: "durable-interaction";
957
+ decisionId: string;
958
+ }>;
959
+ reasonCode: z.ZodString;
960
+ reason: z.ZodOptional<z.ZodString>;
961
+ scope: z.ZodEffects<z.ZodObject<{
962
+ stepIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
963
+ transitionIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
964
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
965
+ }, "strip", z.ZodTypeAny, {
966
+ stepIds?: string[] | undefined;
967
+ transitionIds?: string[] | undefined;
968
+ capabilityIds?: string[] | undefined;
969
+ }, {
970
+ stepIds?: string[] | undefined;
971
+ transitionIds?: string[] | undefined;
972
+ capabilityIds?: string[] | undefined;
973
+ }>, {
974
+ stepIds?: string[] | undefined;
975
+ transitionIds?: string[] | undefined;
976
+ capabilityIds?: string[] | undefined;
977
+ }, {
978
+ stepIds?: string[] | undefined;
979
+ transitionIds?: string[] | undefined;
980
+ capabilityIds?: string[] | undefined;
981
+ }>;
982
+ expiresAt: z.ZodOptional<z.ZodString>;
983
+ }, "strip", z.ZodTypeAny, {
984
+ version: "1";
985
+ profile: "guided";
986
+ scope: {
987
+ stepIds?: string[] | undefined;
988
+ transitionIds?: string[] | undefined;
989
+ capabilityIds?: string[] | undefined;
990
+ };
991
+ runId: string;
992
+ reasonCode: string;
993
+ bindingRuleId: string;
994
+ eventType: "enforcement.override";
995
+ eventId: string;
996
+ timestamp: string;
997
+ authorizedBy: {
998
+ id: string;
999
+ kind: string;
1000
+ };
1001
+ authorization: {
1002
+ interactionId: string;
1003
+ status: "answered";
1004
+ method: "durable-interaction";
1005
+ decisionId: string;
1006
+ };
1007
+ reason?: string | undefined;
1008
+ expiresAt?: string | undefined;
1009
+ requestedBy?: {
1010
+ id: string;
1011
+ kind: string;
1012
+ } | undefined;
1013
+ }, {
1014
+ version: "1";
1015
+ profile: "guided";
1016
+ scope: {
1017
+ stepIds?: string[] | undefined;
1018
+ transitionIds?: string[] | undefined;
1019
+ capabilityIds?: string[] | undefined;
1020
+ };
1021
+ runId: string;
1022
+ reasonCode: string;
1023
+ bindingRuleId: string;
1024
+ eventType: "enforcement.override";
1025
+ eventId: string;
1026
+ timestamp: string;
1027
+ authorizedBy: {
1028
+ id: string;
1029
+ kind: string;
1030
+ };
1031
+ authorization: {
1032
+ interactionId: string;
1033
+ status: "answered";
1034
+ method: "durable-interaction";
1035
+ decisionId: string;
1036
+ };
1037
+ reason?: string | undefined;
1038
+ expiresAt?: string | undefined;
1039
+ requestedBy?: {
1040
+ id: string;
1041
+ kind: string;
1042
+ } | undefined;
1043
+ }>;
1044
+ export declare class WorkflowBindingContractError extends Error {
1045
+ readonly issues: readonly string[];
1046
+ constructor(issues: readonly string[]);
1047
+ }
1048
+ /** Parse and canonicalize caller-controlled binding facts. */
1049
+ export declare function parseWorkflowBindingInputs(value: unknown): WorkflowBindingInputs;
1050
+ export declare function parseWorkflowBindingSelector(value: unknown): WorkflowBindingSelector;
1051
+ export declare function parseWorkflowBindingRule(value: unknown): WorkflowBindingRule;
1052
+ export declare function parseWorkflowBindingRules(value: unknown): WorkflowBindingRules;
1053
+ /** Parse a complete run contract; the returned value is safe to persist as a pin. */
1054
+ export declare function parsePinnedWorkflowRunContract(value: unknown): PinnedWorkflowRunContract;
1055
+ /** Parse a guided authorization event; strict/advisory bypass events are invalid. */
1056
+ export declare function parseEnforcementOverrideEvent(value: unknown): EnforcementOverrideEvent;
1057
+ export declare function serializeWorkflowBindingInputs(value: unknown): string;
1058
+ export declare function serializeWorkflowBindingRule(value: unknown): string;
1059
+ export declare function serializeWorkflowBindingRules(value: unknown): string;
1060
+ export declare function serializePinnedWorkflowRunContract(value: unknown): string;
1061
+ export declare function serializeEnforcementOverrideEvent(value: unknown): string;
1062
+ export declare function isEnforcementProfile(value: unknown): value is EnforcementProfile;