@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,582 @@
1
+ import { z } from "zod";
2
+ import { type CapabilityManifestV1 } from "./CapabilityManifest.js";
3
+ /** The version of the Blok-owned component manifest, independent of WASI. */
4
+ export declare const WASI_COMPONENT_MANIFEST_VERSION: "1";
5
+ /** The version of the runner↔host request/response seam. */
6
+ export declare const WASI_COMPONENT_CONTRACT_VERSION: "1";
7
+ export declare const WASI_COMPONENT_WIT_PACKAGE: "blok:runtime";
8
+ export declare const WASI_COMPONENT_WIT_WORLD: "blok-node";
9
+ export declare const WASI_COMPONENT_WIT_VERSION: "1.0.0";
10
+ /** v1 targets the stable WASI 0.2 Component Model surface. */
11
+ export declare const WASI_COMPONENT_WASI_VERSION: "0.2";
12
+ export declare const WASI_COMPONENT_MEDIA_TYPE: "application/wasm-component";
13
+ export declare const WasiComponentLimitsSchema: z.ZodOptional<z.ZodObject<{
14
+ /** Deterministic compute budget. The host must translate this to fuel. */
15
+ fuel: z.ZodOptional<z.ZodNumber>;
16
+ /** Wall-clock guard used with epoch interruption, not as a fuel substitute. */
17
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
18
+ maxMemoryBytes: z.ZodOptional<z.ZodNumber>;
19
+ maxInputBytes: z.ZodOptional<z.ZodNumber>;
20
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
21
+ maxLogBytes: z.ZodOptional<z.ZodNumber>;
22
+ maxHostCalls: z.ZodOptional<z.ZodNumber>;
23
+ maxConcurrentExecutions: z.ZodOptional<z.ZodNumber>;
24
+ maxQueueDepth: z.ZodOptional<z.ZodNumber>;
25
+ }, "strict", z.ZodTypeAny, {
26
+ maxDurationMs?: number | undefined;
27
+ maxMemoryBytes?: number | undefined;
28
+ maxInputBytes?: number | undefined;
29
+ maxOutputBytes?: number | undefined;
30
+ fuel?: number | undefined;
31
+ maxLogBytes?: number | undefined;
32
+ maxHostCalls?: number | undefined;
33
+ maxConcurrentExecutions?: number | undefined;
34
+ maxQueueDepth?: number | undefined;
35
+ }, {
36
+ maxDurationMs?: number | undefined;
37
+ maxMemoryBytes?: number | undefined;
38
+ maxInputBytes?: number | undefined;
39
+ maxOutputBytes?: number | undefined;
40
+ fuel?: number | undefined;
41
+ maxLogBytes?: number | undefined;
42
+ maxHostCalls?: number | undefined;
43
+ maxConcurrentExecutions?: number | undefined;
44
+ maxQueueDepth?: number | undefined;
45
+ }>>;
46
+ export declare const WasiComponentArtifactSchema: z.ZodObject<{
47
+ /** Development may use a local path; production policy still requires digest. */
48
+ uri: z.ZodString;
49
+ digest: z.ZodString;
50
+ mediaType: z.ZodLiteral<"application/wasm-component">;
51
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
52
+ }, "strict", z.ZodTypeAny, {
53
+ digest: string;
54
+ mediaType: "application/wasm-component";
55
+ uri: string;
56
+ sizeBytes?: number | undefined;
57
+ }, {
58
+ digest: string;
59
+ mediaType: "application/wasm-component";
60
+ uri: string;
61
+ sizeBytes?: number | undefined;
62
+ }>;
63
+ export declare const WasiComponentWorldSchema: z.ZodObject<{
64
+ package: z.ZodLiteral<"blok:runtime">;
65
+ world: z.ZodLiteral<"blok-node">;
66
+ version: z.ZodString;
67
+ }, "strict", z.ZodTypeAny, {
68
+ version: string;
69
+ package: "blok:runtime";
70
+ world: "blok-node";
71
+ }, {
72
+ version: string;
73
+ package: "blok:runtime";
74
+ world: "blok-node";
75
+ }>;
76
+ export declare const WasiComponentNodeSchema: z.ZodObject<{
77
+ name: z.ZodString;
78
+ description: z.ZodOptional<z.ZodString>;
79
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
+ inputSchema: z.ZodOptional<z.ZodUnknown>;
81
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
82
+ }, "strict", z.ZodTypeAny, {
83
+ name: string;
84
+ description?: string | undefined;
85
+ tags?: string[] | undefined;
86
+ inputSchema?: unknown;
87
+ outputSchema?: unknown;
88
+ }, {
89
+ name: string;
90
+ description?: string | undefined;
91
+ tags?: string[] | undefined;
92
+ inputSchema?: unknown;
93
+ outputSchema?: unknown;
94
+ }>;
95
+ export declare const WasiComponentManifestSchema: z.ZodObject<{
96
+ version: z.ZodLiteral<"1">;
97
+ runtime: z.ZodLiteral<"runtime.wasi">;
98
+ artifact: z.ZodObject<{
99
+ /** Development may use a local path; production policy still requires digest. */
100
+ uri: z.ZodString;
101
+ digest: z.ZodString;
102
+ mediaType: z.ZodLiteral<"application/wasm-component">;
103
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
104
+ }, "strict", z.ZodTypeAny, {
105
+ digest: string;
106
+ mediaType: "application/wasm-component";
107
+ uri: string;
108
+ sizeBytes?: number | undefined;
109
+ }, {
110
+ digest: string;
111
+ mediaType: "application/wasm-component";
112
+ uri: string;
113
+ sizeBytes?: number | undefined;
114
+ }>;
115
+ world: z.ZodObject<{
116
+ package: z.ZodLiteral<"blok:runtime">;
117
+ world: z.ZodLiteral<"blok-node">;
118
+ version: z.ZodString;
119
+ }, "strict", z.ZodTypeAny, {
120
+ version: string;
121
+ package: "blok:runtime";
122
+ world: "blok-node";
123
+ }, {
124
+ version: string;
125
+ package: "blok:runtime";
126
+ world: "blok-node";
127
+ }>;
128
+ wasiVersion: z.ZodLiteral<"0.2">;
129
+ componentModelVersion: z.ZodLiteral<"0.2">;
130
+ exportName: z.ZodString;
131
+ node: z.ZodObject<{
132
+ name: z.ZodString;
133
+ description: z.ZodOptional<z.ZodString>;
134
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
135
+ inputSchema: z.ZodOptional<z.ZodUnknown>;
136
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
137
+ }, "strict", z.ZodTypeAny, {
138
+ name: string;
139
+ description?: string | undefined;
140
+ tags?: string[] | undefined;
141
+ inputSchema?: unknown;
142
+ outputSchema?: unknown;
143
+ }, {
144
+ name: string;
145
+ description?: string | undefined;
146
+ tags?: string[] | undefined;
147
+ inputSchema?: unknown;
148
+ outputSchema?: unknown;
149
+ }>;
150
+ capabilityManifest: z.ZodObject<{
151
+ version: z.ZodLiteral<"1">;
152
+ classification: z.ZodEnum<["agent-compatible", "trusted-legacy", "denied-to-agents"]>;
153
+ effects: z.ZodArray<z.ZodEnum<["read", "write", "network", "filesystem", "process", "secret", "streaming", "destructive"]>, "many">;
154
+ capabilities: z.ZodArray<z.ZodString, "many">;
155
+ secrets: z.ZodArray<z.ZodString, "many">;
156
+ determinism: z.ZodEnum<["deterministic", "time-dependent", "random", "external", "unknown"]>;
157
+ idempotency: z.ZodEnum<["idempotent", "conditionally-idempotent", "non-idempotent", "unknown"]>;
158
+ maturity: z.ZodEnum<["stable", "beta", "experimental", "deprecated"]>;
159
+ resources: z.ZodOptional<z.ZodObject<{
160
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
161
+ maxMemoryBytes: z.ZodOptional<z.ZodNumber>;
162
+ maxInputBytes: z.ZodOptional<z.ZodNumber>;
163
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
164
+ maxConcurrency: z.ZodOptional<z.ZodNumber>;
165
+ }, "strict", z.ZodTypeAny, {
166
+ maxDurationMs?: number | undefined;
167
+ maxMemoryBytes?: number | undefined;
168
+ maxInputBytes?: number | undefined;
169
+ maxOutputBytes?: number | undefined;
170
+ maxConcurrency?: number | undefined;
171
+ }, {
172
+ maxDurationMs?: number | undefined;
173
+ maxMemoryBytes?: number | undefined;
174
+ maxInputBytes?: number | undefined;
175
+ maxOutputBytes?: number | undefined;
176
+ maxConcurrency?: number | undefined;
177
+ }>>;
178
+ runtimes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
179
+ triggers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
180
+ }, "strict", z.ZodTypeAny, {
181
+ version: "1";
182
+ classification: "agent-compatible" | "trusted-legacy" | "denied-to-agents";
183
+ determinism: "unknown" | "deterministic" | "time-dependent" | "random" | "external";
184
+ idempotency: "unknown" | "idempotent" | "conditionally-idempotent" | "non-idempotent";
185
+ maturity: "stable" | "beta" | "experimental" | "deprecated";
186
+ effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
187
+ capabilities: string[];
188
+ secrets: string[];
189
+ resources?: {
190
+ maxDurationMs?: number | undefined;
191
+ maxMemoryBytes?: number | undefined;
192
+ maxInputBytes?: number | undefined;
193
+ maxOutputBytes?: number | undefined;
194
+ maxConcurrency?: number | undefined;
195
+ } | undefined;
196
+ runtimes?: string[] | undefined;
197
+ triggers?: string[] | undefined;
198
+ }, {
199
+ version: "1";
200
+ classification: "agent-compatible" | "trusted-legacy" | "denied-to-agents";
201
+ determinism: "unknown" | "deterministic" | "time-dependent" | "random" | "external";
202
+ idempotency: "unknown" | "idempotent" | "conditionally-idempotent" | "non-idempotent";
203
+ maturity: "stable" | "beta" | "experimental" | "deprecated";
204
+ effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
205
+ capabilities: string[];
206
+ secrets: string[];
207
+ resources?: {
208
+ maxDurationMs?: number | undefined;
209
+ maxMemoryBytes?: number | undefined;
210
+ maxInputBytes?: number | undefined;
211
+ maxOutputBytes?: number | undefined;
212
+ maxConcurrency?: number | undefined;
213
+ } | undefined;
214
+ runtimes?: string[] | undefined;
215
+ triggers?: string[] | undefined;
216
+ }>;
217
+ limits: z.ZodOptional<z.ZodObject<{
218
+ /** Deterministic compute budget. The host must translate this to fuel. */
219
+ fuel: z.ZodOptional<z.ZodNumber>;
220
+ /** Wall-clock guard used with epoch interruption, not as a fuel substitute. */
221
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
222
+ maxMemoryBytes: z.ZodOptional<z.ZodNumber>;
223
+ maxInputBytes: z.ZodOptional<z.ZodNumber>;
224
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
225
+ maxLogBytes: z.ZodOptional<z.ZodNumber>;
226
+ maxHostCalls: z.ZodOptional<z.ZodNumber>;
227
+ maxConcurrentExecutions: z.ZodOptional<z.ZodNumber>;
228
+ maxQueueDepth: z.ZodOptional<z.ZodNumber>;
229
+ }, "strict", z.ZodTypeAny, {
230
+ maxDurationMs?: number | undefined;
231
+ maxMemoryBytes?: number | undefined;
232
+ maxInputBytes?: number | undefined;
233
+ maxOutputBytes?: number | undefined;
234
+ fuel?: number | undefined;
235
+ maxLogBytes?: number | undefined;
236
+ maxHostCalls?: number | undefined;
237
+ maxConcurrentExecutions?: number | undefined;
238
+ maxQueueDepth?: number | undefined;
239
+ }, {
240
+ maxDurationMs?: number | undefined;
241
+ maxMemoryBytes?: number | undefined;
242
+ maxInputBytes?: number | undefined;
243
+ maxOutputBytes?: number | undefined;
244
+ fuel?: number | undefined;
245
+ maxLogBytes?: number | undefined;
246
+ maxHostCalls?: number | undefined;
247
+ maxConcurrentExecutions?: number | undefined;
248
+ maxQueueDepth?: number | undefined;
249
+ }>>;
250
+ }, "strict", z.ZodTypeAny, {
251
+ version: "1";
252
+ node: {
253
+ name: string;
254
+ description?: string | undefined;
255
+ tags?: string[] | undefined;
256
+ inputSchema?: unknown;
257
+ outputSchema?: unknown;
258
+ };
259
+ artifact: {
260
+ digest: string;
261
+ mediaType: "application/wasm-component";
262
+ uri: string;
263
+ sizeBytes?: number | undefined;
264
+ };
265
+ capabilityManifest: {
266
+ version: "1";
267
+ classification: "agent-compatible" | "trusted-legacy" | "denied-to-agents";
268
+ determinism: "unknown" | "deterministic" | "time-dependent" | "random" | "external";
269
+ idempotency: "unknown" | "idempotent" | "conditionally-idempotent" | "non-idempotent";
270
+ maturity: "stable" | "beta" | "experimental" | "deprecated";
271
+ effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
272
+ capabilities: string[];
273
+ secrets: string[];
274
+ resources?: {
275
+ maxDurationMs?: number | undefined;
276
+ maxMemoryBytes?: number | undefined;
277
+ maxInputBytes?: number | undefined;
278
+ maxOutputBytes?: number | undefined;
279
+ maxConcurrency?: number | undefined;
280
+ } | undefined;
281
+ runtimes?: string[] | undefined;
282
+ triggers?: string[] | undefined;
283
+ };
284
+ runtime: "runtime.wasi";
285
+ world: {
286
+ version: string;
287
+ package: "blok:runtime";
288
+ world: "blok-node";
289
+ };
290
+ wasiVersion: "0.2";
291
+ componentModelVersion: "0.2";
292
+ exportName: string;
293
+ limits?: {
294
+ maxDurationMs?: number | undefined;
295
+ maxMemoryBytes?: number | undefined;
296
+ maxInputBytes?: number | undefined;
297
+ maxOutputBytes?: number | undefined;
298
+ fuel?: number | undefined;
299
+ maxLogBytes?: number | undefined;
300
+ maxHostCalls?: number | undefined;
301
+ maxConcurrentExecutions?: number | undefined;
302
+ maxQueueDepth?: number | undefined;
303
+ } | undefined;
304
+ }, {
305
+ version: "1";
306
+ node: {
307
+ name: string;
308
+ description?: string | undefined;
309
+ tags?: string[] | undefined;
310
+ inputSchema?: unknown;
311
+ outputSchema?: unknown;
312
+ };
313
+ artifact: {
314
+ digest: string;
315
+ mediaType: "application/wasm-component";
316
+ uri: string;
317
+ sizeBytes?: number | undefined;
318
+ };
319
+ capabilityManifest: {
320
+ version: "1";
321
+ classification: "agent-compatible" | "trusted-legacy" | "denied-to-agents";
322
+ determinism: "unknown" | "deterministic" | "time-dependent" | "random" | "external";
323
+ idempotency: "unknown" | "idempotent" | "conditionally-idempotent" | "non-idempotent";
324
+ maturity: "stable" | "beta" | "experimental" | "deprecated";
325
+ effects: ("read" | "write" | "network" | "filesystem" | "process" | "secret" | "streaming" | "destructive")[];
326
+ capabilities: string[];
327
+ secrets: string[];
328
+ resources?: {
329
+ maxDurationMs?: number | undefined;
330
+ maxMemoryBytes?: number | undefined;
331
+ maxInputBytes?: number | undefined;
332
+ maxOutputBytes?: number | undefined;
333
+ maxConcurrency?: number | undefined;
334
+ } | undefined;
335
+ runtimes?: string[] | undefined;
336
+ triggers?: string[] | undefined;
337
+ };
338
+ runtime: "runtime.wasi";
339
+ world: {
340
+ version: string;
341
+ package: "blok:runtime";
342
+ world: "blok-node";
343
+ };
344
+ wasiVersion: "0.2";
345
+ componentModelVersion: "0.2";
346
+ exportName: string;
347
+ limits?: {
348
+ maxDurationMs?: number | undefined;
349
+ maxMemoryBytes?: number | undefined;
350
+ maxInputBytes?: number | undefined;
351
+ maxOutputBytes?: number | undefined;
352
+ fuel?: number | undefined;
353
+ maxLogBytes?: number | undefined;
354
+ maxHostCalls?: number | undefined;
355
+ maxConcurrentExecutions?: number | undefined;
356
+ maxQueueDepth?: number | undefined;
357
+ } | undefined;
358
+ }>;
359
+ export type WasiComponentLimits = z.infer<typeof WasiComponentLimitsSchema>;
360
+ export type WasiComponentArtifact = z.infer<typeof WasiComponentArtifactSchema>;
361
+ export type WasiComponentWorld = z.infer<typeof WasiComponentWorldSchema>;
362
+ export type WasiComponentNode = z.infer<typeof WasiComponentNodeSchema>;
363
+ export type WasiComponentManifestV1 = Omit<z.infer<typeof WasiComponentManifestSchema>, "capabilityManifest"> & {
364
+ capabilityManifest: CapabilityManifestV1;
365
+ };
366
+ /** Parse and normalize the only manifest accepted by the v1 WASI seam. */
367
+ export declare function parseWasiComponentManifest(value: unknown): WasiComponentManifestV1;
368
+ export declare function serializeWasiComponentManifest(value: unknown): string;
369
+ export declare const WasiComponentErrorSchema: z.ZodObject<{
370
+ code: z.ZodString;
371
+ category: z.ZodEnum<["VALIDATION", "CONFIGURATION", "DEPENDENCY", "TIMEOUT", "PERMISSION", "RATE_LIMIT", "NOT_FOUND", "CONFLICT", "CANCELLED", "INTERNAL", "PROTOCOL", "DATA"]>;
372
+ message: z.ZodString;
373
+ retryable: z.ZodBoolean;
374
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
375
+ }, "strict", z.ZodTypeAny, {
376
+ code: string;
377
+ message: string;
378
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
379
+ retryable: boolean;
380
+ details?: Record<string, unknown> | undefined;
381
+ }, {
382
+ code: string;
383
+ message: string;
384
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
385
+ retryable: boolean;
386
+ details?: Record<string, unknown> | undefined;
387
+ }>;
388
+ export declare const WasiComponentExecutionRequestSchema: z.ZodObject<{
389
+ contractVersion: z.ZodLiteral<"1">;
390
+ componentDigest: z.ZodString;
391
+ exportName: z.ZodString;
392
+ input: z.ZodUnknown;
393
+ request: z.ZodObject<{
394
+ body: z.ZodUnknown;
395
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
396
+ params: z.ZodRecord<z.ZodString, z.ZodString>;
397
+ query: z.ZodRecord<z.ZodString, z.ZodString>;
398
+ }, "strip", z.ZodTypeAny, {
399
+ params: Record<string, string>;
400
+ query: Record<string, string>;
401
+ headers: Record<string, string>;
402
+ body?: unknown;
403
+ }, {
404
+ params: Record<string, string>;
405
+ query: Record<string, string>;
406
+ headers: Record<string, string>;
407
+ body?: unknown;
408
+ }>;
409
+ contentType: z.ZodString;
410
+ deadlineMs: z.ZodNumber;
411
+ traceparent: z.ZodOptional<z.ZodString>;
412
+ }, "strict", z.ZodTypeAny, {
413
+ contractVersion: "1";
414
+ exportName: string;
415
+ componentDigest: string;
416
+ request: {
417
+ params: Record<string, string>;
418
+ query: Record<string, string>;
419
+ headers: Record<string, string>;
420
+ body?: unknown;
421
+ };
422
+ contentType: string;
423
+ deadlineMs: number;
424
+ input?: unknown;
425
+ traceparent?: string | undefined;
426
+ }, {
427
+ contractVersion: "1";
428
+ exportName: string;
429
+ componentDigest: string;
430
+ request: {
431
+ params: Record<string, string>;
432
+ query: Record<string, string>;
433
+ headers: Record<string, string>;
434
+ body?: unknown;
435
+ };
436
+ contentType: string;
437
+ deadlineMs: number;
438
+ input?: unknown;
439
+ traceparent?: string | undefined;
440
+ }>;
441
+ export declare const WasiComponentExecutionResponseSchema: z.ZodEffects<z.ZodObject<{
442
+ contractVersion: z.ZodLiteral<"1">;
443
+ success: z.ZodBoolean;
444
+ output: z.ZodNullable<z.ZodUnknown>;
445
+ contentType: z.ZodOptional<z.ZodString>;
446
+ logs: z.ZodArray<z.ZodObject<{
447
+ level: z.ZodEnum<["debug", "info", "warn", "error"]>;
448
+ message: z.ZodString;
449
+ }, "strict", z.ZodTypeAny, {
450
+ message: string;
451
+ level: "error" | "info" | "warn" | "debug";
452
+ }, {
453
+ message: string;
454
+ level: "error" | "info" | "warn" | "debug";
455
+ }>, "many">;
456
+ metrics: z.ZodOptional<z.ZodObject<{
457
+ durationMs: z.ZodOptional<z.ZodNumber>;
458
+ cpuMs: z.ZodOptional<z.ZodNumber>;
459
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
460
+ }, "strict", z.ZodTypeAny, {
461
+ durationMs?: number | undefined;
462
+ cpuMs?: number | undefined;
463
+ memoryBytes?: number | undefined;
464
+ }, {
465
+ durationMs?: number | undefined;
466
+ cpuMs?: number | undefined;
467
+ memoryBytes?: number | undefined;
468
+ }>>;
469
+ error: z.ZodOptional<z.ZodObject<{
470
+ code: z.ZodString;
471
+ category: z.ZodEnum<["VALIDATION", "CONFIGURATION", "DEPENDENCY", "TIMEOUT", "PERMISSION", "RATE_LIMIT", "NOT_FOUND", "CONFLICT", "CANCELLED", "INTERNAL", "PROTOCOL", "DATA"]>;
472
+ message: z.ZodString;
473
+ retryable: z.ZodBoolean;
474
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
475
+ }, "strict", z.ZodTypeAny, {
476
+ code: string;
477
+ message: string;
478
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
479
+ retryable: boolean;
480
+ details?: Record<string, unknown> | undefined;
481
+ }, {
482
+ code: string;
483
+ message: string;
484
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
485
+ retryable: boolean;
486
+ details?: Record<string, unknown> | undefined;
487
+ }>>;
488
+ }, "strict", z.ZodTypeAny, {
489
+ contractVersion: "1";
490
+ success: boolean;
491
+ logs: {
492
+ message: string;
493
+ level: "error" | "info" | "warn" | "debug";
494
+ }[];
495
+ error?: {
496
+ code: string;
497
+ message: string;
498
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
499
+ retryable: boolean;
500
+ details?: Record<string, unknown> | undefined;
501
+ } | undefined;
502
+ output?: unknown;
503
+ contentType?: string | undefined;
504
+ metrics?: {
505
+ durationMs?: number | undefined;
506
+ cpuMs?: number | undefined;
507
+ memoryBytes?: number | undefined;
508
+ } | undefined;
509
+ }, {
510
+ contractVersion: "1";
511
+ success: boolean;
512
+ logs: {
513
+ message: string;
514
+ level: "error" | "info" | "warn" | "debug";
515
+ }[];
516
+ error?: {
517
+ code: string;
518
+ message: string;
519
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
520
+ retryable: boolean;
521
+ details?: Record<string, unknown> | undefined;
522
+ } | undefined;
523
+ output?: unknown;
524
+ contentType?: string | undefined;
525
+ metrics?: {
526
+ durationMs?: number | undefined;
527
+ cpuMs?: number | undefined;
528
+ memoryBytes?: number | undefined;
529
+ } | undefined;
530
+ }>, {
531
+ contractVersion: "1";
532
+ success: boolean;
533
+ logs: {
534
+ message: string;
535
+ level: "error" | "info" | "warn" | "debug";
536
+ }[];
537
+ error?: {
538
+ code: string;
539
+ message: string;
540
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
541
+ retryable: boolean;
542
+ details?: Record<string, unknown> | undefined;
543
+ } | undefined;
544
+ output?: unknown;
545
+ contentType?: string | undefined;
546
+ metrics?: {
547
+ durationMs?: number | undefined;
548
+ cpuMs?: number | undefined;
549
+ memoryBytes?: number | undefined;
550
+ } | undefined;
551
+ }, {
552
+ contractVersion: "1";
553
+ success: boolean;
554
+ logs: {
555
+ message: string;
556
+ level: "error" | "info" | "warn" | "debug";
557
+ }[];
558
+ error?: {
559
+ code: string;
560
+ message: string;
561
+ category: "VALIDATION" | "CONFIGURATION" | "DEPENDENCY" | "TIMEOUT" | "PERMISSION" | "RATE_LIMIT" | "NOT_FOUND" | "CONFLICT" | "CANCELLED" | "INTERNAL" | "PROTOCOL" | "DATA";
562
+ retryable: boolean;
563
+ details?: Record<string, unknown> | undefined;
564
+ } | undefined;
565
+ output?: unknown;
566
+ contentType?: string | undefined;
567
+ metrics?: {
568
+ durationMs?: number | undefined;
569
+ cpuMs?: number | undefined;
570
+ memoryBytes?: number | undefined;
571
+ } | undefined;
572
+ }>;
573
+ export type WasiComponentExecutionRequest = z.infer<typeof WasiComponentExecutionRequestSchema>;
574
+ export type WasiComponentExecutionResponse = z.infer<typeof WasiComponentExecutionResponseSchema>;
575
+ /** The boundary intentionally carries only these host-mediated capabilities in v1. */
576
+ export declare const WASI_COMPONENT_CAPABILITIES: readonly ["wasi.log", "wasi.trace", "wasi.secret.read", "wasi.blob.read", "wasi.fs.read", "wasi.fs.write", "wasi.net.connect", "wasi.env.read", "wasi.clock.read", "wasi.random.read", "wasi.http.request", "wasi.socket.connect", "wasi.process.spawn", "wasi.state.read", "wasi.state.write"];
577
+ export type WasiComponentReadiness = {
578
+ status: "ready" | "draining" | "unavailable";
579
+ contractVersion: typeof WASI_COMPONENT_CONTRACT_VERSION;
580
+ engineVersion?: string;
581
+ reason?: string;
582
+ };