@blokjs/shared 2.0.1 → 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.
- package/dist/AgentSessionContracts.d.ts +316 -0
- package/dist/AgentSessionContracts.js +331 -0
- package/dist/BlokError.d.ts +55 -1
- package/dist/BlokError.js +99 -1
- package/dist/CapabilityContracts.d.ts +91 -0
- package/dist/CapabilityContracts.js +104 -0
- package/dist/CapabilityManifest.d.ts +67 -0
- package/dist/CapabilityManifest.js +172 -0
- package/dist/EnforcementContracts.d.ts +61 -0
- package/dist/EnforcementContracts.js +17 -0
- package/dist/EnforcementProfileContracts.d.ts +36 -0
- package/dist/EnforcementProfileContracts.js +55 -0
- package/dist/EvidenceContracts.d.ts +884 -0
- package/dist/EvidenceContracts.js +237 -0
- package/dist/GitCapabilityContracts.d.ts +103 -0
- package/dist/GitCapabilityContracts.js +222 -0
- package/dist/GlobalError.js +5 -1
- package/dist/GlobalLogger.d.ts +2 -0
- package/dist/GlobalLogger.js +4 -0
- package/dist/GraphContracts.d.ts +1643 -0
- package/dist/GraphContracts.js +333 -0
- package/dist/InteractionContracts.d.ts +76 -0
- package/dist/InteractionContracts.js +218 -0
- package/dist/JoinContracts.d.ts +593 -0
- package/dist/JoinContracts.js +329 -0
- package/dist/NodeBase.d.ts +20 -0
- package/dist/NodeBase.js +57 -6
- package/dist/PermissionAlgebra.d.ts +51 -0
- package/dist/PermissionAlgebra.js +125 -0
- package/dist/PolicyContracts.d.ts +184 -0
- package/dist/PolicyContracts.js +1 -0
- package/dist/ProcessCapabilityContracts.d.ts +146 -0
- package/dist/ProcessCapabilityContracts.js +263 -0
- package/dist/RuntimeContracts.d.ts +125 -0
- package/dist/RuntimeContracts.js +108 -0
- package/dist/SecretContracts.d.ts +43 -0
- package/dist/SecretContracts.js +1 -0
- package/dist/WasiComponentContracts.d.ts +582 -0
- package/dist/WasiComponentContracts.js +192 -0
- package/dist/WorkflowBindingContracts.d.ts +1062 -0
- package/dist/WorkflowBindingContracts.js +339 -0
- package/dist/index.d.ts +46 -15
- package/dist/index.js +26 -3
- package/dist/types/LoggerContext.d.ts +7 -0
- package/dist/utils/Mapper.d.ts +14 -0
- package/dist/utils/Mapper.js +32 -0
- package/dist/utils/lowerRefs.d.ts +25 -1
- package/dist/utils/lowerRefs.js +8 -3
- package/package.json +3 -2
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CapabilityEffect } from "./CapabilityManifest.js";
|
|
3
|
+
import { type EvidenceRequirement } from "./EvidenceContracts.js";
|
|
4
|
+
import { type CapabilityAuthority } from "./PermissionAlgebra.js";
|
|
5
|
+
/** Version of the language-neutral branch-join contract. */
|
|
6
|
+
export declare const JOIN_CONTRACT_VERSION: "1";
|
|
7
|
+
export declare const JOIN_MAX_BRANCHES = 128;
|
|
8
|
+
export declare const JOIN_MAX_OUTPUTS = 128;
|
|
9
|
+
export declare const JOIN_MAX_SCHEMA_DEPTH = 8;
|
|
10
|
+
export declare const JOIN_MAX_CONTRACT_BYTES: number;
|
|
11
|
+
/** Version of the retry/resume idempotency contract. */
|
|
12
|
+
export declare const RETRY_RESUME_IDEMPOTENCY_CONTRACT_VERSION: "1";
|
|
13
|
+
export declare const RETRY_RESUME_MAX_ATTEMPTS = 20;
|
|
14
|
+
export declare const RETRY_RESUME_MAX_RESUMES = 100;
|
|
15
|
+
export declare const RETRY_RESUME_MAX_EVIDENCE = 64;
|
|
16
|
+
declare const jsonSchema: z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
17
|
+
export type JoinJsonSchema = z.infer<typeof jsonSchema>;
|
|
18
|
+
export type JoinBranchStatus = "completed" | "failed" | "cancelled" | "missing";
|
|
19
|
+
export interface JoinBranchObligation {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
/** Optional branches may be absent; required branches must complete. */
|
|
22
|
+
readonly required: boolean;
|
|
23
|
+
/** Evidence required before this branch can contribute to the join. */
|
|
24
|
+
readonly evidence?: readonly EvidenceRequirement[];
|
|
25
|
+
}
|
|
26
|
+
export interface JoinOutputDeclaration {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly branchId: string;
|
|
29
|
+
readonly path: readonly (string | number)[];
|
|
30
|
+
/** JSON Schema for the value exported from the branch. */
|
|
31
|
+
readonly schema: JoinJsonSchema;
|
|
32
|
+
}
|
|
33
|
+
export interface JoinContract {
|
|
34
|
+
readonly version: typeof JOIN_CONTRACT_VERSION;
|
|
35
|
+
readonly id: string;
|
|
36
|
+
/** `all` requires every required branch; `any` requires one completed branch. */
|
|
37
|
+
readonly mode: "all" | "any";
|
|
38
|
+
readonly branches: readonly JoinBranchObligation[];
|
|
39
|
+
readonly outputs: readonly JoinOutputDeclaration[];
|
|
40
|
+
/** Optional effective authority carried across the join boundary. */
|
|
41
|
+
readonly authority?: CapabilityAuthority;
|
|
42
|
+
}
|
|
43
|
+
export interface JoinBranchResult {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly status: JoinBranchStatus;
|
|
46
|
+
readonly output?: unknown;
|
|
47
|
+
readonly evidence?: readonly unknown[];
|
|
48
|
+
}
|
|
49
|
+
export interface JoinResult {
|
|
50
|
+
readonly branches: readonly JoinBranchResult[];
|
|
51
|
+
}
|
|
52
|
+
/** Effects use the canonical capability-manifest vocabulary (and therefore the authority algebra). */
|
|
53
|
+
export type RetryResumeEffect = "none" | CapabilityEffect;
|
|
54
|
+
export type RetryResumeIdempotencyMode = "not-required" | "keyed" | "evidence-required";
|
|
55
|
+
export interface RetryResumeIdempotencyContract {
|
|
56
|
+
readonly version: typeof RETRY_RESUME_IDEMPOTENCY_CONTRACT_VERSION;
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly stepId: string;
|
|
59
|
+
readonly effect: RetryResumeEffect;
|
|
60
|
+
readonly maxAttempts: number;
|
|
61
|
+
readonly maxResumes: number;
|
|
62
|
+
readonly idempotency: {
|
|
63
|
+
readonly mode: RetryResumeIdempotencyMode;
|
|
64
|
+
/** The key is deliberately a declaration, never the secret/raw value. */
|
|
65
|
+
readonly keyDeclared?: boolean;
|
|
66
|
+
};
|
|
67
|
+
readonly evidence?: readonly EvidenceRequirement[];
|
|
68
|
+
/** Optional effective authority bound to every retry/resume attempt. */
|
|
69
|
+
readonly authority?: CapabilityAuthority;
|
|
70
|
+
}
|
|
71
|
+
export type EffectRetryEvidenceOutcome = "committed" | "deduplicated" | "not-committed";
|
|
72
|
+
export interface EffectRetryEvidence {
|
|
73
|
+
readonly version: typeof RETRY_RESUME_IDEMPOTENCY_CONTRACT_VERSION;
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly stepId: string;
|
|
76
|
+
readonly runId: string;
|
|
77
|
+
readonly attempt: number;
|
|
78
|
+
readonly effect: CapabilityEffect;
|
|
79
|
+
/** Digest of the resolved idempotency key; the raw key is never persisted. */
|
|
80
|
+
readonly idempotencyKeyDigest: string;
|
|
81
|
+
readonly outcome: EffectRetryEvidenceOutcome;
|
|
82
|
+
readonly producer: {
|
|
83
|
+
readonly kind: "capability" | "deterministic-step" | "runner";
|
|
84
|
+
readonly id: string;
|
|
85
|
+
};
|
|
86
|
+
readonly observedAt: string;
|
|
87
|
+
}
|
|
88
|
+
export declare class JoinContractError extends Error {
|
|
89
|
+
readonly reasonCode: string;
|
|
90
|
+
readonly code = "JOIN_REJECTED";
|
|
91
|
+
constructor(reasonCode: string, message: string);
|
|
92
|
+
}
|
|
93
|
+
export declare class RetryResumeContractError extends Error {
|
|
94
|
+
readonly reasonCode: string;
|
|
95
|
+
readonly code = "RETRY_RESUME_REJECTED";
|
|
96
|
+
constructor(reasonCode: string, message: string);
|
|
97
|
+
}
|
|
98
|
+
export declare const JoinBranchObligationSchema: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
required: z.ZodBoolean;
|
|
101
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"evidence">;
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
kind: z.ZodString;
|
|
105
|
+
claim: z.ZodOptional<z.ZodString>;
|
|
106
|
+
artifactKind: z.ZodOptional<z.ZodString>;
|
|
107
|
+
producers: z.ZodArray<z.ZodEnum<["capability", "deterministic-step", "runner"]>, "many">;
|
|
108
|
+
verification: z.ZodLiteral<"verified">;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
id: string;
|
|
111
|
+
kind: string;
|
|
112
|
+
type: "evidence";
|
|
113
|
+
verification: "verified";
|
|
114
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
115
|
+
claim?: string | undefined;
|
|
116
|
+
artifactKind?: string | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
id: string;
|
|
119
|
+
kind: string;
|
|
120
|
+
type: "evidence";
|
|
121
|
+
verification: "verified";
|
|
122
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
123
|
+
claim?: string | undefined;
|
|
124
|
+
artifactKind?: string | undefined;
|
|
125
|
+
}>, "many">>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
id: string;
|
|
128
|
+
required: boolean;
|
|
129
|
+
evidence?: {
|
|
130
|
+
id: string;
|
|
131
|
+
kind: string;
|
|
132
|
+
type: "evidence";
|
|
133
|
+
verification: "verified";
|
|
134
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
135
|
+
claim?: string | undefined;
|
|
136
|
+
artifactKind?: string | undefined;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
id: string;
|
|
140
|
+
required: boolean;
|
|
141
|
+
evidence?: {
|
|
142
|
+
id: string;
|
|
143
|
+
kind: string;
|
|
144
|
+
type: "evidence";
|
|
145
|
+
verification: "verified";
|
|
146
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
147
|
+
claim?: string | undefined;
|
|
148
|
+
artifactKind?: string | undefined;
|
|
149
|
+
}[] | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
export declare const JoinOutputDeclarationSchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
branchId: z.ZodString;
|
|
154
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
155
|
+
schema: z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
id: string;
|
|
158
|
+
path: (string | number)[];
|
|
159
|
+
branchId: string;
|
|
160
|
+
schema: boolean | Record<string, unknown>;
|
|
161
|
+
}, {
|
|
162
|
+
id: string;
|
|
163
|
+
path: (string | number)[];
|
|
164
|
+
branchId: string;
|
|
165
|
+
schema: boolean | Record<string, unknown>;
|
|
166
|
+
}>;
|
|
167
|
+
export declare const JoinContractSchema: z.ZodEffects<z.ZodObject<{
|
|
168
|
+
version: z.ZodLiteral<"1">;
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
mode: z.ZodEnum<["all", "any"]>;
|
|
171
|
+
branches: z.ZodArray<z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
required: z.ZodBoolean;
|
|
174
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
175
|
+
type: z.ZodLiteral<"evidence">;
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
kind: z.ZodString;
|
|
178
|
+
claim: z.ZodOptional<z.ZodString>;
|
|
179
|
+
artifactKind: z.ZodOptional<z.ZodString>;
|
|
180
|
+
producers: z.ZodArray<z.ZodEnum<["capability", "deterministic-step", "runner"]>, "many">;
|
|
181
|
+
verification: z.ZodLiteral<"verified">;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
id: string;
|
|
184
|
+
kind: string;
|
|
185
|
+
type: "evidence";
|
|
186
|
+
verification: "verified";
|
|
187
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
188
|
+
claim?: string | undefined;
|
|
189
|
+
artifactKind?: string | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
id: string;
|
|
192
|
+
kind: string;
|
|
193
|
+
type: "evidence";
|
|
194
|
+
verification: "verified";
|
|
195
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
196
|
+
claim?: string | undefined;
|
|
197
|
+
artifactKind?: string | undefined;
|
|
198
|
+
}>, "many">>;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
id: string;
|
|
201
|
+
required: boolean;
|
|
202
|
+
evidence?: {
|
|
203
|
+
id: string;
|
|
204
|
+
kind: string;
|
|
205
|
+
type: "evidence";
|
|
206
|
+
verification: "verified";
|
|
207
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
208
|
+
claim?: string | undefined;
|
|
209
|
+
artifactKind?: string | undefined;
|
|
210
|
+
}[] | undefined;
|
|
211
|
+
}, {
|
|
212
|
+
id: string;
|
|
213
|
+
required: boolean;
|
|
214
|
+
evidence?: {
|
|
215
|
+
id: string;
|
|
216
|
+
kind: string;
|
|
217
|
+
type: "evidence";
|
|
218
|
+
verification: "verified";
|
|
219
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
220
|
+
claim?: string | undefined;
|
|
221
|
+
artifactKind?: string | undefined;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
}>, "many">;
|
|
224
|
+
outputs: z.ZodArray<z.ZodObject<{
|
|
225
|
+
id: z.ZodString;
|
|
226
|
+
branchId: z.ZodString;
|
|
227
|
+
path: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
228
|
+
schema: z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
229
|
+
}, "strip", z.ZodTypeAny, {
|
|
230
|
+
id: string;
|
|
231
|
+
path: (string | number)[];
|
|
232
|
+
branchId: string;
|
|
233
|
+
schema: boolean | Record<string, unknown>;
|
|
234
|
+
}, {
|
|
235
|
+
id: string;
|
|
236
|
+
path: (string | number)[];
|
|
237
|
+
branchId: string;
|
|
238
|
+
schema: boolean | Record<string, unknown>;
|
|
239
|
+
}>, "many">;
|
|
240
|
+
authority: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
effects: z.ZodArray<z.ZodEnum<["read", "write", "network", "filesystem", "process", "secret", "streaming", "destructive"]>, "many">;
|
|
242
|
+
capabilities: z.ZodArray<z.ZodString, "many">;
|
|
243
|
+
secrets: z.ZodArray<z.ZodString, "many">;
|
|
244
|
+
fragments: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
245
|
+
}, "strict", z.ZodTypeAny, {
|
|
246
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
247
|
+
capabilities: string[];
|
|
248
|
+
secrets: string[];
|
|
249
|
+
fragments: Record<string, string | number | boolean>;
|
|
250
|
+
}, {
|
|
251
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
252
|
+
capabilities: string[];
|
|
253
|
+
secrets: string[];
|
|
254
|
+
fragments: Record<string, string | number | boolean>;
|
|
255
|
+
}>>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
id: string;
|
|
258
|
+
version: "1";
|
|
259
|
+
mode: "all" | "any";
|
|
260
|
+
branches: {
|
|
261
|
+
id: string;
|
|
262
|
+
required: boolean;
|
|
263
|
+
evidence?: {
|
|
264
|
+
id: string;
|
|
265
|
+
kind: string;
|
|
266
|
+
type: "evidence";
|
|
267
|
+
verification: "verified";
|
|
268
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
269
|
+
claim?: string | undefined;
|
|
270
|
+
artifactKind?: string | undefined;
|
|
271
|
+
}[] | undefined;
|
|
272
|
+
}[];
|
|
273
|
+
outputs: {
|
|
274
|
+
id: string;
|
|
275
|
+
path: (string | number)[];
|
|
276
|
+
branchId: string;
|
|
277
|
+
schema: boolean | Record<string, unknown>;
|
|
278
|
+
}[];
|
|
279
|
+
authority?: {
|
|
280
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
281
|
+
capabilities: string[];
|
|
282
|
+
secrets: string[];
|
|
283
|
+
fragments: Record<string, string | number | boolean>;
|
|
284
|
+
} | undefined;
|
|
285
|
+
}, {
|
|
286
|
+
id: string;
|
|
287
|
+
version: "1";
|
|
288
|
+
mode: "all" | "any";
|
|
289
|
+
branches: {
|
|
290
|
+
id: string;
|
|
291
|
+
required: boolean;
|
|
292
|
+
evidence?: {
|
|
293
|
+
id: string;
|
|
294
|
+
kind: string;
|
|
295
|
+
type: "evidence";
|
|
296
|
+
verification: "verified";
|
|
297
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
298
|
+
claim?: string | undefined;
|
|
299
|
+
artifactKind?: string | undefined;
|
|
300
|
+
}[] | undefined;
|
|
301
|
+
}[];
|
|
302
|
+
outputs: {
|
|
303
|
+
id: string;
|
|
304
|
+
path: (string | number)[];
|
|
305
|
+
branchId: string;
|
|
306
|
+
schema: boolean | Record<string, unknown>;
|
|
307
|
+
}[];
|
|
308
|
+
authority?: {
|
|
309
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
310
|
+
capabilities: string[];
|
|
311
|
+
secrets: string[];
|
|
312
|
+
fragments: Record<string, string | number | boolean>;
|
|
313
|
+
} | undefined;
|
|
314
|
+
}>, {
|
|
315
|
+
id: string;
|
|
316
|
+
version: "1";
|
|
317
|
+
mode: "all" | "any";
|
|
318
|
+
branches: {
|
|
319
|
+
id: string;
|
|
320
|
+
required: boolean;
|
|
321
|
+
evidence?: {
|
|
322
|
+
id: string;
|
|
323
|
+
kind: string;
|
|
324
|
+
type: "evidence";
|
|
325
|
+
verification: "verified";
|
|
326
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
327
|
+
claim?: string | undefined;
|
|
328
|
+
artifactKind?: string | undefined;
|
|
329
|
+
}[] | undefined;
|
|
330
|
+
}[];
|
|
331
|
+
outputs: {
|
|
332
|
+
id: string;
|
|
333
|
+
path: (string | number)[];
|
|
334
|
+
branchId: string;
|
|
335
|
+
schema: boolean | Record<string, unknown>;
|
|
336
|
+
}[];
|
|
337
|
+
authority?: {
|
|
338
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
339
|
+
capabilities: string[];
|
|
340
|
+
secrets: string[];
|
|
341
|
+
fragments: Record<string, string | number | boolean>;
|
|
342
|
+
} | undefined;
|
|
343
|
+
}, {
|
|
344
|
+
id: string;
|
|
345
|
+
version: "1";
|
|
346
|
+
mode: "all" | "any";
|
|
347
|
+
branches: {
|
|
348
|
+
id: string;
|
|
349
|
+
required: boolean;
|
|
350
|
+
evidence?: {
|
|
351
|
+
id: string;
|
|
352
|
+
kind: string;
|
|
353
|
+
type: "evidence";
|
|
354
|
+
verification: "verified";
|
|
355
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
356
|
+
claim?: string | undefined;
|
|
357
|
+
artifactKind?: string | undefined;
|
|
358
|
+
}[] | undefined;
|
|
359
|
+
}[];
|
|
360
|
+
outputs: {
|
|
361
|
+
id: string;
|
|
362
|
+
path: (string | number)[];
|
|
363
|
+
branchId: string;
|
|
364
|
+
schema: boolean | Record<string, unknown>;
|
|
365
|
+
}[];
|
|
366
|
+
authority?: {
|
|
367
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
368
|
+
capabilities: string[];
|
|
369
|
+
secrets: string[];
|
|
370
|
+
fragments: Record<string, string | number | boolean>;
|
|
371
|
+
} | undefined;
|
|
372
|
+
}>;
|
|
373
|
+
export declare const RetryResumeIdempotencyContractSchema: z.ZodEffects<z.ZodObject<{
|
|
374
|
+
version: z.ZodLiteral<"1">;
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
stepId: z.ZodString;
|
|
377
|
+
effect: z.ZodEnum<["none", "read", "write", "network", "filesystem", "process", "secret", "streaming", "destructive"]>;
|
|
378
|
+
maxAttempts: z.ZodNumber;
|
|
379
|
+
maxResumes: z.ZodNumber;
|
|
380
|
+
idempotency: z.ZodObject<{
|
|
381
|
+
mode: z.ZodEnum<["not-required", "keyed", "evidence-required"]>;
|
|
382
|
+
keyDeclared: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
+
}, "strip", z.ZodTypeAny, {
|
|
384
|
+
mode: "not-required" | "keyed" | "evidence-required";
|
|
385
|
+
keyDeclared?: boolean | undefined;
|
|
386
|
+
}, {
|
|
387
|
+
mode: "not-required" | "keyed" | "evidence-required";
|
|
388
|
+
keyDeclared?: boolean | undefined;
|
|
389
|
+
}>;
|
|
390
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
391
|
+
type: z.ZodLiteral<"evidence">;
|
|
392
|
+
id: z.ZodString;
|
|
393
|
+
kind: z.ZodString;
|
|
394
|
+
claim: z.ZodOptional<z.ZodString>;
|
|
395
|
+
artifactKind: z.ZodOptional<z.ZodString>;
|
|
396
|
+
producers: z.ZodArray<z.ZodEnum<["capability", "deterministic-step", "runner"]>, "many">;
|
|
397
|
+
verification: z.ZodLiteral<"verified">;
|
|
398
|
+
}, "strip", z.ZodTypeAny, {
|
|
399
|
+
id: string;
|
|
400
|
+
kind: string;
|
|
401
|
+
type: "evidence";
|
|
402
|
+
verification: "verified";
|
|
403
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
404
|
+
claim?: string | undefined;
|
|
405
|
+
artifactKind?: string | undefined;
|
|
406
|
+
}, {
|
|
407
|
+
id: string;
|
|
408
|
+
kind: string;
|
|
409
|
+
type: "evidence";
|
|
410
|
+
verification: "verified";
|
|
411
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
412
|
+
claim?: string | undefined;
|
|
413
|
+
artifactKind?: string | undefined;
|
|
414
|
+
}>, "many">>;
|
|
415
|
+
authority: z.ZodOptional<z.ZodObject<{
|
|
416
|
+
effects: z.ZodArray<z.ZodEnum<["read", "write", "network", "filesystem", "process", "secret", "streaming", "destructive"]>, "many">;
|
|
417
|
+
capabilities: z.ZodArray<z.ZodString, "many">;
|
|
418
|
+
secrets: z.ZodArray<z.ZodString, "many">;
|
|
419
|
+
fragments: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
420
|
+
}, "strict", z.ZodTypeAny, {
|
|
421
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
422
|
+
capabilities: string[];
|
|
423
|
+
secrets: string[];
|
|
424
|
+
fragments: Record<string, string | number | boolean>;
|
|
425
|
+
}, {
|
|
426
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
427
|
+
capabilities: string[];
|
|
428
|
+
secrets: string[];
|
|
429
|
+
fragments: Record<string, string | number | boolean>;
|
|
430
|
+
}>>;
|
|
431
|
+
}, "strip", z.ZodTypeAny, {
|
|
432
|
+
id: string;
|
|
433
|
+
version: "1";
|
|
434
|
+
idempotency: {
|
|
435
|
+
mode: "not-required" | "keyed" | "evidence-required";
|
|
436
|
+
keyDeclared?: boolean | undefined;
|
|
437
|
+
};
|
|
438
|
+
effect: "read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive" | "none";
|
|
439
|
+
stepId: string;
|
|
440
|
+
maxAttempts: number;
|
|
441
|
+
maxResumes: number;
|
|
442
|
+
authority?: {
|
|
443
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
444
|
+
capabilities: string[];
|
|
445
|
+
secrets: string[];
|
|
446
|
+
fragments: Record<string, string | number | boolean>;
|
|
447
|
+
} | undefined;
|
|
448
|
+
evidence?: {
|
|
449
|
+
id: string;
|
|
450
|
+
kind: string;
|
|
451
|
+
type: "evidence";
|
|
452
|
+
verification: "verified";
|
|
453
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
454
|
+
claim?: string | undefined;
|
|
455
|
+
artifactKind?: string | undefined;
|
|
456
|
+
}[] | undefined;
|
|
457
|
+
}, {
|
|
458
|
+
id: string;
|
|
459
|
+
version: "1";
|
|
460
|
+
idempotency: {
|
|
461
|
+
mode: "not-required" | "keyed" | "evidence-required";
|
|
462
|
+
keyDeclared?: boolean | undefined;
|
|
463
|
+
};
|
|
464
|
+
effect: "read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive" | "none";
|
|
465
|
+
stepId: string;
|
|
466
|
+
maxAttempts: number;
|
|
467
|
+
maxResumes: number;
|
|
468
|
+
authority?: {
|
|
469
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
470
|
+
capabilities: string[];
|
|
471
|
+
secrets: string[];
|
|
472
|
+
fragments: Record<string, string | number | boolean>;
|
|
473
|
+
} | undefined;
|
|
474
|
+
evidence?: {
|
|
475
|
+
id: string;
|
|
476
|
+
kind: string;
|
|
477
|
+
type: "evidence";
|
|
478
|
+
verification: "verified";
|
|
479
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
480
|
+
claim?: string | undefined;
|
|
481
|
+
artifactKind?: string | undefined;
|
|
482
|
+
}[] | undefined;
|
|
483
|
+
}>, {
|
|
484
|
+
id: string;
|
|
485
|
+
version: "1";
|
|
486
|
+
idempotency: {
|
|
487
|
+
mode: "not-required" | "keyed" | "evidence-required";
|
|
488
|
+
keyDeclared?: boolean | undefined;
|
|
489
|
+
};
|
|
490
|
+
effect: "read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive" | "none";
|
|
491
|
+
stepId: string;
|
|
492
|
+
maxAttempts: number;
|
|
493
|
+
maxResumes: number;
|
|
494
|
+
authority?: {
|
|
495
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
496
|
+
capabilities: string[];
|
|
497
|
+
secrets: string[];
|
|
498
|
+
fragments: Record<string, string | number | boolean>;
|
|
499
|
+
} | undefined;
|
|
500
|
+
evidence?: {
|
|
501
|
+
id: string;
|
|
502
|
+
kind: string;
|
|
503
|
+
type: "evidence";
|
|
504
|
+
verification: "verified";
|
|
505
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
506
|
+
claim?: string | undefined;
|
|
507
|
+
artifactKind?: string | undefined;
|
|
508
|
+
}[] | undefined;
|
|
509
|
+
}, {
|
|
510
|
+
id: string;
|
|
511
|
+
version: "1";
|
|
512
|
+
idempotency: {
|
|
513
|
+
mode: "not-required" | "keyed" | "evidence-required";
|
|
514
|
+
keyDeclared?: boolean | undefined;
|
|
515
|
+
};
|
|
516
|
+
effect: "read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive" | "none";
|
|
517
|
+
stepId: string;
|
|
518
|
+
maxAttempts: number;
|
|
519
|
+
maxResumes: number;
|
|
520
|
+
authority?: {
|
|
521
|
+
effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
|
|
522
|
+
capabilities: string[];
|
|
523
|
+
secrets: string[];
|
|
524
|
+
fragments: Record<string, string | number | boolean>;
|
|
525
|
+
} | undefined;
|
|
526
|
+
evidence?: {
|
|
527
|
+
id: string;
|
|
528
|
+
kind: string;
|
|
529
|
+
type: "evidence";
|
|
530
|
+
verification: "verified";
|
|
531
|
+
producers: ("capability" | "deterministic-step" | "runner")[];
|
|
532
|
+
claim?: string | undefined;
|
|
533
|
+
artifactKind?: string | undefined;
|
|
534
|
+
}[] | undefined;
|
|
535
|
+
}>;
|
|
536
|
+
export declare const EffectRetryEvidenceSchema: z.ZodObject<{
|
|
537
|
+
version: z.ZodLiteral<"1">;
|
|
538
|
+
id: z.ZodString;
|
|
539
|
+
stepId: z.ZodString;
|
|
540
|
+
runId: z.ZodString;
|
|
541
|
+
attempt: z.ZodNumber;
|
|
542
|
+
effect: z.ZodEnum<["read", "write", "network", "filesystem", "process", "secret", "streaming", "destructive"]>;
|
|
543
|
+
idempotencyKeyDigest: z.ZodString;
|
|
544
|
+
outcome: z.ZodEnum<["committed", "deduplicated", "not-committed"]>;
|
|
545
|
+
producer: z.ZodObject<{
|
|
546
|
+
kind: z.ZodEnum<["capability", "deterministic-step", "runner"]>;
|
|
547
|
+
id: z.ZodString;
|
|
548
|
+
}, "strip", z.ZodTypeAny, {
|
|
549
|
+
id: string;
|
|
550
|
+
kind: "capability" | "deterministic-step" | "runner";
|
|
551
|
+
}, {
|
|
552
|
+
id: string;
|
|
553
|
+
kind: "capability" | "deterministic-step" | "runner";
|
|
554
|
+
}>;
|
|
555
|
+
observedAt: z.ZodString;
|
|
556
|
+
}, "strip", z.ZodTypeAny, {
|
|
557
|
+
id: string;
|
|
558
|
+
version: "1";
|
|
559
|
+
attempt: number;
|
|
560
|
+
runId: string;
|
|
561
|
+
producer: {
|
|
562
|
+
id: string;
|
|
563
|
+
kind: "capability" | "deterministic-step" | "runner";
|
|
564
|
+
};
|
|
565
|
+
outcome: "committed" | "deduplicated" | "not-committed";
|
|
566
|
+
observedAt: string;
|
|
567
|
+
effect: "read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive";
|
|
568
|
+
stepId: string;
|
|
569
|
+
idempotencyKeyDigest: string;
|
|
570
|
+
}, {
|
|
571
|
+
id: string;
|
|
572
|
+
version: "1";
|
|
573
|
+
attempt: number;
|
|
574
|
+
runId: string;
|
|
575
|
+
producer: {
|
|
576
|
+
id: string;
|
|
577
|
+
kind: "capability" | "deterministic-step" | "runner";
|
|
578
|
+
};
|
|
579
|
+
outcome: "committed" | "deduplicated" | "not-committed";
|
|
580
|
+
observedAt: string;
|
|
581
|
+
effect: "read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive";
|
|
582
|
+
stepId: string;
|
|
583
|
+
idempotencyKeyDigest: string;
|
|
584
|
+
}>;
|
|
585
|
+
/** Validate branch completion, evidence, and declared output types at a join boundary. */
|
|
586
|
+
export declare function assertJoinSatisfied(contract: JoinContract, result: JoinResult): void;
|
|
587
|
+
export declare function parseJoinContract(value: unknown): JoinContract;
|
|
588
|
+
export declare function serializeJoinContract(value: unknown): string;
|
|
589
|
+
export declare function parseRetryResumeIdempotencyContract(value: unknown): RetryResumeIdempotencyContract;
|
|
590
|
+
export declare function parseEffectRetryEvidence(value: unknown): EffectRetryEvidence;
|
|
591
|
+
/** Require an evidence record for effectful retry/resume; no effect is retried without proof. */
|
|
592
|
+
export declare function assertEffectRetryEvidence(contract: RetryResumeIdempotencyContract, evidence: readonly unknown[]): void;
|
|
593
|
+
export {};
|