@lumenflow/kernel 3.0.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 (127) hide show
  1. package/LICENSE.md +190 -0
  2. package/README.md +26 -0
  3. package/dist/canonical-json.d.ts +7 -0
  4. package/dist/canonical-json.d.ts.map +1 -0
  5. package/dist/canonical-json.js +50 -0
  6. package/dist/canonical-json.js.map +1 -0
  7. package/dist/event-kinds.d.ts +32 -0
  8. package/dist/event-kinds.d.ts.map +1 -0
  9. package/dist/event-kinds.js +49 -0
  10. package/dist/event-kinds.js.map +1 -0
  11. package/dist/event-store/index.d.ts +64 -0
  12. package/dist/event-store/index.d.ts.map +1 -0
  13. package/dist/event-store/index.js +634 -0
  14. package/dist/event-store/index.js.map +1 -0
  15. package/dist/evidence/evidence-store.d.ts +78 -0
  16. package/dist/evidence/evidence-store.d.ts.map +1 -0
  17. package/dist/evidence/evidence-store.js +409 -0
  18. package/dist/evidence/evidence-store.js.map +1 -0
  19. package/dist/evidence/fs-helpers.d.ts +13 -0
  20. package/dist/evidence/fs-helpers.d.ts.map +1 -0
  21. package/dist/evidence/fs-helpers.js +38 -0
  22. package/dist/evidence/fs-helpers.js.map +1 -0
  23. package/dist/evidence/index.d.ts +3 -0
  24. package/dist/evidence/index.d.ts.map +1 -0
  25. package/dist/evidence/index.js +5 -0
  26. package/dist/evidence/index.js.map +1 -0
  27. package/dist/index.d.ts +17 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +19 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/kernel.schemas.d.ts +642 -0
  32. package/dist/kernel.schemas.d.ts.map +1 -0
  33. package/dist/kernel.schemas.js +331 -0
  34. package/dist/kernel.schemas.js.map +1 -0
  35. package/dist/pack/hash.d.ts +7 -0
  36. package/dist/pack/hash.d.ts.map +1 -0
  37. package/dist/pack/hash.js +56 -0
  38. package/dist/pack/hash.js.map +1 -0
  39. package/dist/pack/index.d.ts +4 -0
  40. package/dist/pack/index.d.ts.map +1 -0
  41. package/dist/pack/index.js +6 -0
  42. package/dist/pack/index.js.map +1 -0
  43. package/dist/pack/manifest.d.ts +100 -0
  44. package/dist/pack/manifest.d.ts.map +1 -0
  45. package/dist/pack/manifest.js +50 -0
  46. package/dist/pack/manifest.js.map +1 -0
  47. package/dist/pack/pack-loader.d.ts +108 -0
  48. package/dist/pack/pack-loader.d.ts.map +1 -0
  49. package/dist/pack/pack-loader.js +282 -0
  50. package/dist/pack/pack-loader.js.map +1 -0
  51. package/dist/policy/approval-event.d.ts +29 -0
  52. package/dist/policy/approval-event.d.ts.map +1 -0
  53. package/dist/policy/approval-event.js +17 -0
  54. package/dist/policy/approval-event.js.map +1 -0
  55. package/dist/policy/index.d.ts +3 -0
  56. package/dist/policy/index.d.ts.map +1 -0
  57. package/dist/policy/index.js +5 -0
  58. package/dist/policy/index.js.map +1 -0
  59. package/dist/policy/policy-engine.d.ts +52 -0
  60. package/dist/policy/policy-engine.d.ts.map +1 -0
  61. package/dist/policy/policy-engine.js +83 -0
  62. package/dist/policy/policy-engine.js.map +1 -0
  63. package/dist/runtime/index.d.ts +2 -0
  64. package/dist/runtime/index.d.ts.map +1 -0
  65. package/dist/runtime/index.js +4 -0
  66. package/dist/runtime/index.js.map +1 -0
  67. package/dist/runtime/kernel-runtime.d.ts +170 -0
  68. package/dist/runtime/kernel-runtime.d.ts.map +1 -0
  69. package/dist/runtime/kernel-runtime.js +751 -0
  70. package/dist/runtime/kernel-runtime.js.map +1 -0
  71. package/dist/sandbox/bwrap-invocation.d.ts +13 -0
  72. package/dist/sandbox/bwrap-invocation.d.ts.map +1 -0
  73. package/dist/sandbox/bwrap-invocation.js +105 -0
  74. package/dist/sandbox/bwrap-invocation.js.map +1 -0
  75. package/dist/sandbox/index.d.ts +5 -0
  76. package/dist/sandbox/index.d.ts.map +1 -0
  77. package/dist/sandbox/index.js +7 -0
  78. package/dist/sandbox/index.js.map +1 -0
  79. package/dist/sandbox/profile.d.ts +32 -0
  80. package/dist/sandbox/profile.d.ts.map +1 -0
  81. package/dist/sandbox/profile.js +101 -0
  82. package/dist/sandbox/profile.js.map +1 -0
  83. package/dist/sandbox/subprocess-dispatcher.d.ts +38 -0
  84. package/dist/sandbox/subprocess-dispatcher.d.ts.map +1 -0
  85. package/dist/sandbox/subprocess-dispatcher.js +145 -0
  86. package/dist/sandbox/subprocess-dispatcher.js.map +1 -0
  87. package/dist/sandbox/tool-runner-worker.d.ts +54 -0
  88. package/dist/sandbox/tool-runner-worker.d.ts.map +1 -0
  89. package/dist/sandbox/tool-runner-worker.js +159 -0
  90. package/dist/sandbox/tool-runner-worker.js.map +1 -0
  91. package/dist/shared-constants.d.ts +48 -0
  92. package/dist/shared-constants.d.ts.map +1 -0
  93. package/dist/shared-constants.js +49 -0
  94. package/dist/shared-constants.js.map +1 -0
  95. package/dist/state-machine/index.d.ts +30 -0
  96. package/dist/state-machine/index.d.ts.map +1 -0
  97. package/dist/state-machine/index.js +92 -0
  98. package/dist/state-machine/index.js.map +1 -0
  99. package/dist/tool-host/builtins/capabilities.d.ts +20 -0
  100. package/dist/tool-host/builtins/capabilities.d.ts.map +1 -0
  101. package/dist/tool-host/builtins/capabilities.js +211 -0
  102. package/dist/tool-host/builtins/capabilities.js.map +1 -0
  103. package/dist/tool-host/builtins/index.d.ts +2 -0
  104. package/dist/tool-host/builtins/index.d.ts.map +1 -0
  105. package/dist/tool-host/builtins/index.js +4 -0
  106. package/dist/tool-host/builtins/index.js.map +1 -0
  107. package/dist/tool-host/index.d.ts +5 -0
  108. package/dist/tool-host/index.d.ts.map +1 -0
  109. package/dist/tool-host/index.js +7 -0
  110. package/dist/tool-host/index.js.map +1 -0
  111. package/dist/tool-host/scope-intersection.d.ts +10 -0
  112. package/dist/tool-host/scope-intersection.d.ts.map +1 -0
  113. package/dist/tool-host/scope-intersection.js +188 -0
  114. package/dist/tool-host/scope-intersection.js.map +1 -0
  115. package/dist/tool-host/subprocess-dispatcher.d.ts +14 -0
  116. package/dist/tool-host/subprocess-dispatcher.d.ts.map +1 -0
  117. package/dist/tool-host/subprocess-dispatcher.js +14 -0
  118. package/dist/tool-host/subprocess-dispatcher.js.map +1 -0
  119. package/dist/tool-host/tool-host.d.ts +42 -0
  120. package/dist/tool-host/tool-host.d.ts.map +1 -0
  121. package/dist/tool-host/tool-host.js +395 -0
  122. package/dist/tool-host/tool-host.js.map +1 -0
  123. package/dist/tool-host/tool-registry.d.ts +9 -0
  124. package/dist/tool-host/tool-registry.d.ts.map +1 -0
  125. package/dist/tool-host/tool-registry.js +28 -0
  126. package/dist/tool-host/tool-registry.js.map +1 -0
  127. package/package.json +71 -0
@@ -0,0 +1,642 @@
1
+ import { z, type ZodTypeAny } from 'zod';
2
+ export declare const RUN_STATUSES: {
3
+ readonly PLANNED: "planned";
4
+ readonly EXECUTING: "executing";
5
+ readonly PAUSED: "paused";
6
+ readonly FAILED: "failed";
7
+ readonly SUCCEEDED: "succeeded";
8
+ };
9
+ export declare const RUN_STATUS_VALUES: readonly ["planned", "executing", "paused", "failed", "succeeded"];
10
+ export type RunStatus = (typeof RUN_STATUS_VALUES)[number];
11
+ export declare const TOOL_HANDLER_KINDS: {
12
+ readonly IN_PROCESS: "in-process";
13
+ readonly SUBPROCESS: "subprocess";
14
+ };
15
+ export declare const TOOL_HANDLER_KIND_VALUES: readonly ["in-process", "subprocess"];
16
+ export type ToolHandlerKind = (typeof TOOL_HANDLER_KIND_VALUES)[number];
17
+ export declare const TOOL_ERROR_CODES: {
18
+ readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
19
+ readonly SCOPE_DENIED: "SCOPE_DENIED";
20
+ readonly POLICY_DENIED: "POLICY_DENIED";
21
+ readonly INVALID_INPUT: "INVALID_INPUT";
22
+ readonly INVALID_OUTPUT: "INVALID_OUTPUT";
23
+ readonly TOOL_EXECUTION_FAILED: "TOOL_EXECUTION_FAILED";
24
+ };
25
+ export type ToolErrorCode = (typeof TOOL_ERROR_CODES)[keyof typeof TOOL_ERROR_CODES];
26
+ export declare const ToolScopePathSchema: z.ZodObject<{
27
+ type: z.ZodLiteral<"path">;
28
+ pattern: z.ZodString;
29
+ access: z.ZodEnum<{
30
+ read: "read";
31
+ write: "write";
32
+ }>;
33
+ }, z.core.$strip>;
34
+ export declare const ToolScopeNetworkSchema: z.ZodObject<{
35
+ type: z.ZodLiteral<"network">;
36
+ posture: z.ZodEnum<{
37
+ off: "off";
38
+ full: "full";
39
+ }>;
40
+ }, z.core.$strip>;
41
+ export declare const ToolScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
42
+ type: z.ZodLiteral<"path">;
43
+ pattern: z.ZodString;
44
+ access: z.ZodEnum<{
45
+ read: "read";
46
+ write: "write";
47
+ }>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<"network">;
50
+ posture: z.ZodEnum<{
51
+ off: "off";
52
+ full: "full";
53
+ }>;
54
+ }, z.core.$strip>], "type">;
55
+ export type ToolScope = z.infer<typeof ToolScopeSchema>;
56
+ export declare const TaskSpecSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ workspace_id: z.ZodString;
59
+ lane_id: z.ZodString;
60
+ domain: z.ZodString;
61
+ title: z.ZodString;
62
+ description: z.ZodString;
63
+ acceptance: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>]>;
64
+ declared_scopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
65
+ type: z.ZodLiteral<"path">;
66
+ pattern: z.ZodString;
67
+ access: z.ZodEnum<{
68
+ read: "read";
69
+ write: "write";
70
+ }>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ type: z.ZodLiteral<"network">;
73
+ posture: z.ZodEnum<{
74
+ off: "off";
75
+ full: "full";
76
+ }>;
77
+ }, z.core.$strip>], "type">>;
78
+ expected_artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
+ risk: z.ZodEnum<{
80
+ low: "low";
81
+ medium: "medium";
82
+ high: "high";
83
+ critical: "critical";
84
+ }>;
85
+ blocks: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ blocked_by: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
+ extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
88
+ type: z.ZodString;
89
+ priority: z.ZodEnum<{
90
+ P0: "P0";
91
+ P1: "P1";
92
+ P2: "P2";
93
+ P3: "P3";
94
+ }>;
95
+ created: z.ZodString;
96
+ labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
+ }, z.core.$strip>;
98
+ export type TaskSpec = z.infer<typeof TaskSpecSchema>;
99
+ export declare const RunSchema: z.ZodObject<{
100
+ run_id: z.ZodString;
101
+ task_id: z.ZodString;
102
+ status: z.ZodEnum<{
103
+ planned: "planned";
104
+ executing: "executing";
105
+ paused: "paused";
106
+ failed: "failed";
107
+ succeeded: "succeeded";
108
+ }>;
109
+ started_at: z.ZodString;
110
+ completed_at: z.ZodOptional<z.ZodString>;
111
+ by: z.ZodString;
112
+ session_id: z.ZodString;
113
+ }, z.core.$strip>;
114
+ export type Run = z.infer<typeof RunSchema>;
115
+ export declare const TaskStateSchema: z.ZodObject<{
116
+ task_id: z.ZodString;
117
+ status: z.ZodEnum<{
118
+ ready: "ready";
119
+ active: "active";
120
+ blocked: "blocked";
121
+ waiting: "waiting";
122
+ done: "done";
123
+ }>;
124
+ claimed_at: z.ZodOptional<z.ZodString>;
125
+ claimed_by: z.ZodOptional<z.ZodString>;
126
+ session_id: z.ZodOptional<z.ZodString>;
127
+ blocked_reason: z.ZodOptional<z.ZodString>;
128
+ completed_at: z.ZodOptional<z.ZodString>;
129
+ current_run: z.ZodOptional<z.ZodObject<{
130
+ run_id: z.ZodString;
131
+ task_id: z.ZodString;
132
+ status: z.ZodEnum<{
133
+ planned: "planned";
134
+ executing: "executing";
135
+ paused: "paused";
136
+ failed: "failed";
137
+ succeeded: "succeeded";
138
+ }>;
139
+ started_at: z.ZodString;
140
+ completed_at: z.ZodOptional<z.ZodString>;
141
+ by: z.ZodString;
142
+ session_id: z.ZodString;
143
+ }, z.core.$strip>>;
144
+ run_count: z.ZodNumber;
145
+ domain_state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
146
+ }, z.core.$strip>;
147
+ export type TaskState = z.infer<typeof TaskStateSchema>;
148
+ export declare const PackPinSchema: z.ZodObject<{
149
+ id: z.ZodString;
150
+ version: z.ZodString;
151
+ integrity: z.ZodUnion<readonly [z.ZodLiteral<"dev">, z.ZodString]>;
152
+ source: z.ZodEnum<{
153
+ local: "local";
154
+ git: "git";
155
+ registry: "registry";
156
+ }>;
157
+ url: z.ZodOptional<z.ZodString>;
158
+ registry_url: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strip>;
160
+ export type PackPin = z.infer<typeof PackPinSchema>;
161
+ export declare const LaneSpecSchema: z.ZodObject<{
162
+ id: z.ZodString;
163
+ title: z.ZodString;
164
+ allowed_scopes: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
165
+ type: z.ZodLiteral<"path">;
166
+ pattern: z.ZodString;
167
+ access: z.ZodEnum<{
168
+ read: "read";
169
+ write: "write";
170
+ }>;
171
+ }, z.core.$strip>, z.ZodObject<{
172
+ type: z.ZodLiteral<"network">;
173
+ posture: z.ZodEnum<{
174
+ off: "off";
175
+ full: "full";
176
+ }>;
177
+ }, z.core.$strip>], "type">>>;
178
+ wip_limit: z.ZodOptional<z.ZodNumber>;
179
+ policy_overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
180
+ }, z.core.$strip>;
181
+ export type LaneSpec = z.infer<typeof LaneSpecSchema>;
182
+ export declare const WorkspaceSpecSchema: z.ZodObject<{
183
+ id: z.ZodString;
184
+ name: z.ZodString;
185
+ packs: z.ZodArray<z.ZodObject<{
186
+ id: z.ZodString;
187
+ version: z.ZodString;
188
+ integrity: z.ZodUnion<readonly [z.ZodLiteral<"dev">, z.ZodString]>;
189
+ source: z.ZodEnum<{
190
+ local: "local";
191
+ git: "git";
192
+ registry: "registry";
193
+ }>;
194
+ url: z.ZodOptional<z.ZodString>;
195
+ registry_url: z.ZodOptional<z.ZodString>;
196
+ }, z.core.$strip>>;
197
+ lanes: z.ZodArray<z.ZodObject<{
198
+ id: z.ZodString;
199
+ title: z.ZodString;
200
+ allowed_scopes: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
201
+ type: z.ZodLiteral<"path">;
202
+ pattern: z.ZodString;
203
+ access: z.ZodEnum<{
204
+ read: "read";
205
+ write: "write";
206
+ }>;
207
+ }, z.core.$strip>, z.ZodObject<{
208
+ type: z.ZodLiteral<"network">;
209
+ posture: z.ZodEnum<{
210
+ off: "off";
211
+ full: "full";
212
+ }>;
213
+ }, z.core.$strip>], "type">>>;
214
+ wip_limit: z.ZodOptional<z.ZodNumber>;
215
+ policy_overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
216
+ }, z.core.$strip>>;
217
+ policies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
218
+ security: z.ZodObject<{
219
+ allowed_scopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
220
+ type: z.ZodLiteral<"path">;
221
+ pattern: z.ZodString;
222
+ access: z.ZodEnum<{
223
+ read: "read";
224
+ write: "write";
225
+ }>;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ type: z.ZodLiteral<"network">;
228
+ posture: z.ZodEnum<{
229
+ off: "off";
230
+ full: "full";
231
+ }>;
232
+ }, z.core.$strip>], "type">>;
233
+ network_default: z.ZodEnum<{
234
+ off: "off";
235
+ full: "full";
236
+ }>;
237
+ deny_overlays: z.ZodArray<z.ZodString>;
238
+ }, z.core.$strip>;
239
+ memory_namespace: z.ZodString;
240
+ event_namespace: z.ZodString;
241
+ }, z.core.$strip>;
242
+ export type WorkspaceSpec = z.infer<typeof WorkspaceSpecSchema>;
243
+ export declare const KernelEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
244
+ schema_version: z.ZodLiteral<1>;
245
+ timestamp: z.ZodString;
246
+ task_id: z.ZodString;
247
+ kind: z.ZodLiteral<"task_created">;
248
+ spec_hash: z.ZodString;
249
+ }, z.core.$strip>, z.ZodObject<{
250
+ schema_version: z.ZodLiteral<1>;
251
+ timestamp: z.ZodString;
252
+ task_id: z.ZodString;
253
+ kind: z.ZodLiteral<"task_claimed">;
254
+ by: z.ZodString;
255
+ session_id: z.ZodString;
256
+ domain_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
257
+ }, z.core.$strip>, z.ZodObject<{
258
+ schema_version: z.ZodLiteral<1>;
259
+ timestamp: z.ZodString;
260
+ task_id: z.ZodString;
261
+ kind: z.ZodLiteral<"task_blocked">;
262
+ reason: z.ZodString;
263
+ }, z.core.$strip>, z.ZodObject<{
264
+ schema_version: z.ZodLiteral<1>;
265
+ timestamp: z.ZodString;
266
+ task_id: z.ZodString;
267
+ kind: z.ZodLiteral<"task_unblocked">;
268
+ }, z.core.$strip>, z.ZodObject<{
269
+ schema_version: z.ZodLiteral<1>;
270
+ timestamp: z.ZodString;
271
+ task_id: z.ZodString;
272
+ kind: z.ZodLiteral<"task_waiting">;
273
+ reason: z.ZodString;
274
+ wait_for: z.ZodOptional<z.ZodString>;
275
+ }, z.core.$strip>, z.ZodObject<{
276
+ schema_version: z.ZodLiteral<1>;
277
+ timestamp: z.ZodString;
278
+ task_id: z.ZodString;
279
+ kind: z.ZodLiteral<"task_resumed">;
280
+ }, z.core.$strip>, z.ZodObject<{
281
+ schema_version: z.ZodLiteral<1>;
282
+ timestamp: z.ZodString;
283
+ task_id: z.ZodString;
284
+ kind: z.ZodLiteral<"task_completed">;
285
+ evidence_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
286
+ }, z.core.$strip>, z.ZodObject<{
287
+ schema_version: z.ZodLiteral<1>;
288
+ timestamp: z.ZodString;
289
+ task_id: z.ZodString;
290
+ kind: z.ZodLiteral<"task_released">;
291
+ reason: z.ZodString;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ schema_version: z.ZodLiteral<1>;
294
+ timestamp: z.ZodString;
295
+ task_id: z.ZodString;
296
+ kind: z.ZodLiteral<"task_delegated">;
297
+ parent_task_id: z.ZodString;
298
+ delegation_id: z.ZodString;
299
+ }, z.core.$strip>, z.ZodObject<{
300
+ schema_version: z.ZodLiteral<1>;
301
+ timestamp: z.ZodString;
302
+ task_id: z.ZodString;
303
+ run_id: z.ZodString;
304
+ kind: z.ZodLiteral<"run_started">;
305
+ by: z.ZodString;
306
+ session_id: z.ZodString;
307
+ }, z.core.$strip>, z.ZodObject<{
308
+ schema_version: z.ZodLiteral<1>;
309
+ timestamp: z.ZodString;
310
+ task_id: z.ZodString;
311
+ run_id: z.ZodString;
312
+ kind: z.ZodLiteral<"run_paused">;
313
+ reason: z.ZodString;
314
+ }, z.core.$strip>, z.ZodObject<{
315
+ schema_version: z.ZodLiteral<1>;
316
+ timestamp: z.ZodString;
317
+ task_id: z.ZodString;
318
+ run_id: z.ZodString;
319
+ kind: z.ZodLiteral<"run_failed">;
320
+ reason: z.ZodString;
321
+ evidence_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
322
+ }, z.core.$strip>, z.ZodObject<{
323
+ schema_version: z.ZodLiteral<1>;
324
+ timestamp: z.ZodString;
325
+ task_id: z.ZodString;
326
+ run_id: z.ZodString;
327
+ kind: z.ZodLiteral<"run_succeeded">;
328
+ evidence_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
329
+ }, z.core.$strip>, z.ZodObject<{
330
+ schema_version: z.ZodLiteral<1>;
331
+ timestamp: z.ZodString;
332
+ kind: z.ZodLiteral<"workspace_updated">;
333
+ config_hash: z.ZodString;
334
+ changes_summary: z.ZodString;
335
+ }, z.core.$strip>, z.ZodObject<{
336
+ schema_version: z.ZodLiteral<1>;
337
+ timestamp: z.ZodString;
338
+ kind: z.ZodLiteral<"workspace_warning">;
339
+ message: z.ZodString;
340
+ }, z.core.$strip>, z.ZodObject<{
341
+ schema_version: z.ZodLiteral<1>;
342
+ timestamp: z.ZodString;
343
+ kind: z.ZodLiteral<"spec_tampered">;
344
+ spec: z.ZodEnum<{
345
+ task: "task";
346
+ workspace: "workspace";
347
+ }>;
348
+ id: z.ZodString;
349
+ expected_hash: z.ZodString;
350
+ actual_hash: z.ZodString;
351
+ }, z.core.$strip>, z.ZodObject<{
352
+ schema_version: z.ZodLiteral<1>;
353
+ timestamp: z.ZodString;
354
+ task_id: z.ZodString;
355
+ kind: z.ZodLiteral<"checkpoint">;
356
+ run_id: z.ZodOptional<z.ZodString>;
357
+ note: z.ZodString;
358
+ progress: z.ZodOptional<z.ZodString>;
359
+ }, z.core.$strip>], "kind">;
360
+ export type KernelEvent = z.infer<typeof KernelEventSchema>;
361
+ export declare const PolicyDecisionSchema: z.ZodObject<{
362
+ policy_id: z.ZodString;
363
+ decision: z.ZodEnum<{
364
+ allow: "allow";
365
+ deny: "deny";
366
+ }>;
367
+ reason: z.ZodOptional<z.ZodString>;
368
+ }, z.core.$strip>;
369
+ export type PolicyDecision = z.infer<typeof PolicyDecisionSchema>;
370
+ export declare const ToolCallStartedSchema: z.ZodObject<{
371
+ schema_version: z.ZodLiteral<1>;
372
+ kind: z.ZodLiteral<"tool_call_started">;
373
+ receipt_id: z.ZodString;
374
+ run_id: z.ZodString;
375
+ task_id: z.ZodString;
376
+ session_id: z.ZodString;
377
+ timestamp: z.ZodString;
378
+ tool_name: z.ZodString;
379
+ execution_mode: z.ZodEnum<{
380
+ "in-process": "in-process";
381
+ subprocess: "subprocess";
382
+ }>;
383
+ scope_requested: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
384
+ type: z.ZodLiteral<"path">;
385
+ pattern: z.ZodString;
386
+ access: z.ZodEnum<{
387
+ read: "read";
388
+ write: "write";
389
+ }>;
390
+ }, z.core.$strip>, z.ZodObject<{
391
+ type: z.ZodLiteral<"network">;
392
+ posture: z.ZodEnum<{
393
+ off: "off";
394
+ full: "full";
395
+ }>;
396
+ }, z.core.$strip>], "type">>;
397
+ scope_allowed: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
398
+ type: z.ZodLiteral<"path">;
399
+ pattern: z.ZodString;
400
+ access: z.ZodEnum<{
401
+ read: "read";
402
+ write: "write";
403
+ }>;
404
+ }, z.core.$strip>, z.ZodObject<{
405
+ type: z.ZodLiteral<"network">;
406
+ posture: z.ZodEnum<{
407
+ off: "off";
408
+ full: "full";
409
+ }>;
410
+ }, z.core.$strip>], "type">>;
411
+ scope_enforced: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
412
+ type: z.ZodLiteral<"path">;
413
+ pattern: z.ZodString;
414
+ access: z.ZodEnum<{
415
+ read: "read";
416
+ write: "write";
417
+ }>;
418
+ }, z.core.$strip>, z.ZodObject<{
419
+ type: z.ZodLiteral<"network">;
420
+ posture: z.ZodEnum<{
421
+ off: "off";
422
+ full: "full";
423
+ }>;
424
+ }, z.core.$strip>], "type">>;
425
+ input_hash: z.ZodString;
426
+ input_ref: z.ZodString;
427
+ tool_version: z.ZodString;
428
+ pack_id: z.ZodOptional<z.ZodString>;
429
+ pack_version: z.ZodOptional<z.ZodString>;
430
+ pack_integrity: z.ZodOptional<z.ZodString>;
431
+ workspace_config_hash: z.ZodString;
432
+ runtime_version: z.ZodString;
433
+ }, z.core.$strip>;
434
+ export declare const ToolCallFinishedSchema: z.ZodObject<{
435
+ schema_version: z.ZodLiteral<1>;
436
+ kind: z.ZodLiteral<"tool_call_finished">;
437
+ receipt_id: z.ZodString;
438
+ timestamp: z.ZodString;
439
+ result: z.ZodEnum<{
440
+ success: "success";
441
+ failure: "failure";
442
+ denied: "denied";
443
+ crashed: "crashed";
444
+ }>;
445
+ duration_ms: z.ZodNumber;
446
+ output_hash: z.ZodOptional<z.ZodString>;
447
+ output_ref: z.ZodOptional<z.ZodString>;
448
+ redaction_summary: z.ZodOptional<z.ZodString>;
449
+ scope_enforcement_note: z.ZodOptional<z.ZodString>;
450
+ policy_decisions: z.ZodArray<z.ZodObject<{
451
+ policy_id: z.ZodString;
452
+ decision: z.ZodEnum<{
453
+ allow: "allow";
454
+ deny: "deny";
455
+ }>;
456
+ reason: z.ZodOptional<z.ZodString>;
457
+ }, z.core.$strip>>;
458
+ artifacts_written: z.ZodOptional<z.ZodArray<z.ZodString>>;
459
+ }, z.core.$strip>;
460
+ export declare const ToolTraceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
461
+ schema_version: z.ZodLiteral<1>;
462
+ kind: z.ZodLiteral<"tool_call_started">;
463
+ receipt_id: z.ZodString;
464
+ run_id: z.ZodString;
465
+ task_id: z.ZodString;
466
+ session_id: z.ZodString;
467
+ timestamp: z.ZodString;
468
+ tool_name: z.ZodString;
469
+ execution_mode: z.ZodEnum<{
470
+ "in-process": "in-process";
471
+ subprocess: "subprocess";
472
+ }>;
473
+ scope_requested: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
474
+ type: z.ZodLiteral<"path">;
475
+ pattern: z.ZodString;
476
+ access: z.ZodEnum<{
477
+ read: "read";
478
+ write: "write";
479
+ }>;
480
+ }, z.core.$strip>, z.ZodObject<{
481
+ type: z.ZodLiteral<"network">;
482
+ posture: z.ZodEnum<{
483
+ off: "off";
484
+ full: "full";
485
+ }>;
486
+ }, z.core.$strip>], "type">>;
487
+ scope_allowed: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
488
+ type: z.ZodLiteral<"path">;
489
+ pattern: z.ZodString;
490
+ access: z.ZodEnum<{
491
+ read: "read";
492
+ write: "write";
493
+ }>;
494
+ }, z.core.$strip>, z.ZodObject<{
495
+ type: z.ZodLiteral<"network">;
496
+ posture: z.ZodEnum<{
497
+ off: "off";
498
+ full: "full";
499
+ }>;
500
+ }, z.core.$strip>], "type">>;
501
+ scope_enforced: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
502
+ type: z.ZodLiteral<"path">;
503
+ pattern: z.ZodString;
504
+ access: z.ZodEnum<{
505
+ read: "read";
506
+ write: "write";
507
+ }>;
508
+ }, z.core.$strip>, z.ZodObject<{
509
+ type: z.ZodLiteral<"network">;
510
+ posture: z.ZodEnum<{
511
+ off: "off";
512
+ full: "full";
513
+ }>;
514
+ }, z.core.$strip>], "type">>;
515
+ input_hash: z.ZodString;
516
+ input_ref: z.ZodString;
517
+ tool_version: z.ZodString;
518
+ pack_id: z.ZodOptional<z.ZodString>;
519
+ pack_version: z.ZodOptional<z.ZodString>;
520
+ pack_integrity: z.ZodOptional<z.ZodString>;
521
+ workspace_config_hash: z.ZodString;
522
+ runtime_version: z.ZodString;
523
+ }, z.core.$strip>, z.ZodObject<{
524
+ schema_version: z.ZodLiteral<1>;
525
+ kind: z.ZodLiteral<"tool_call_finished">;
526
+ receipt_id: z.ZodString;
527
+ timestamp: z.ZodString;
528
+ result: z.ZodEnum<{
529
+ success: "success";
530
+ failure: "failure";
531
+ denied: "denied";
532
+ crashed: "crashed";
533
+ }>;
534
+ duration_ms: z.ZodNumber;
535
+ output_hash: z.ZodOptional<z.ZodString>;
536
+ output_ref: z.ZodOptional<z.ZodString>;
537
+ redaction_summary: z.ZodOptional<z.ZodString>;
538
+ scope_enforcement_note: z.ZodOptional<z.ZodString>;
539
+ policy_decisions: z.ZodArray<z.ZodObject<{
540
+ policy_id: z.ZodString;
541
+ decision: z.ZodEnum<{
542
+ allow: "allow";
543
+ deny: "deny";
544
+ }>;
545
+ reason: z.ZodOptional<z.ZodString>;
546
+ }, z.core.$strip>>;
547
+ artifacts_written: z.ZodOptional<z.ZodArray<z.ZodString>>;
548
+ }, z.core.$strip>], "kind">;
549
+ export type ToolTraceEntry = z.infer<typeof ToolTraceEntrySchema>;
550
+ export declare const ToolErrorSchema: z.ZodObject<{
551
+ code: z.ZodString;
552
+ message: z.ZodString;
553
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
554
+ }, z.core.$strip>;
555
+ export type ToolError = z.infer<typeof ToolErrorSchema>;
556
+ export declare const ToolOutputSchema: z.ZodObject<{
557
+ success: z.ZodBoolean;
558
+ data: z.ZodOptional<z.ZodUnknown>;
559
+ error: z.ZodOptional<z.ZodObject<{
560
+ code: z.ZodString;
561
+ message: z.ZodString;
562
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
563
+ }, z.core.$strip>>;
564
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
565
+ }, z.core.$strip>;
566
+ export type ToolOutput = z.infer<typeof ToolOutputSchema>;
567
+ export declare const ExecutionContextSchema: z.ZodObject<{
568
+ run_id: z.ZodString;
569
+ task_id: z.ZodString;
570
+ session_id: z.ZodString;
571
+ allowed_scopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
572
+ type: z.ZodLiteral<"path">;
573
+ pattern: z.ZodString;
574
+ access: z.ZodEnum<{
575
+ read: "read";
576
+ write: "write";
577
+ }>;
578
+ }, z.core.$strip>, z.ZodObject<{
579
+ type: z.ZodLiteral<"network">;
580
+ posture: z.ZodEnum<{
581
+ off: "off";
582
+ full: "full";
583
+ }>;
584
+ }, z.core.$strip>], "type">>;
585
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
586
+ }, z.core.$strip>;
587
+ export type ExecutionContext = z.infer<typeof ExecutionContextSchema>;
588
+ export type InProcessToolFn = (input: unknown, ctx: ExecutionContext) => Promise<ToolOutput>;
589
+ export declare const InProcessToolHandlerSchema: z.ZodObject<{
590
+ kind: z.ZodLiteral<"in-process">;
591
+ fn: z.ZodCustom<InProcessToolFn, InProcessToolFn>;
592
+ }, z.core.$strip>;
593
+ export declare const SubprocessToolHandlerSchema: z.ZodObject<{
594
+ kind: z.ZodLiteral<"subprocess">;
595
+ entry: z.ZodString;
596
+ }, z.core.$strip>;
597
+ export declare const ToolHandlerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
598
+ kind: z.ZodLiteral<"in-process">;
599
+ fn: z.ZodCustom<InProcessToolFn, InProcessToolFn>;
600
+ }, z.core.$strip>, z.ZodObject<{
601
+ kind: z.ZodLiteral<"subprocess">;
602
+ entry: z.ZodString;
603
+ }, z.core.$strip>], "kind">;
604
+ export type ToolHandler = z.infer<typeof ToolHandlerSchema>;
605
+ export declare const ToolCapabilitySchema: z.ZodObject<{
606
+ name: z.ZodString;
607
+ domain: z.ZodString;
608
+ version: z.ZodString;
609
+ input_schema: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
610
+ output_schema: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
611
+ permission: z.ZodEnum<{
612
+ read: "read";
613
+ write: "write";
614
+ admin: "admin";
615
+ }>;
616
+ required_scopes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
617
+ type: z.ZodLiteral<"path">;
618
+ pattern: z.ZodString;
619
+ access: z.ZodEnum<{
620
+ read: "read";
621
+ write: "write";
622
+ }>;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ type: z.ZodLiteral<"network">;
625
+ posture: z.ZodEnum<{
626
+ off: "off";
627
+ full: "full";
628
+ }>;
629
+ }, z.core.$strip>], "type">>;
630
+ handler: z.ZodDiscriminatedUnion<[z.ZodObject<{
631
+ kind: z.ZodLiteral<"in-process">;
632
+ fn: z.ZodCustom<InProcessToolFn, InProcessToolFn>;
633
+ }, z.core.$strip>, z.ZodObject<{
634
+ kind: z.ZodLiteral<"subprocess">;
635
+ entry: z.ZodString;
636
+ }, z.core.$strip>], "kind">;
637
+ description: z.ZodString;
638
+ pack: z.ZodOptional<z.ZodString>;
639
+ }, z.core.$strip>;
640
+ export type ToolCapability = z.infer<typeof ToolCapabilitySchema>;
641
+ export declare function toMcpJsonSchema(schema: ZodTypeAny): Record<string, unknown>;
642
+ //# sourceMappingURL=kernel.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel.schemas.d.ts","sourceRoot":"","sources":["../src/kernel.schemas.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAQzC,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,eAAO,MAAM,iBAAiB,oEAMpB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,eAAO,MAAM,wBAAwB,uCAG3B,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,gBAAgB;;;;;;;CAOnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAErF,eAAO,MAAM,mBAAmB;;;;;;;iBAI9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;iBAGjC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;2BAG1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAOxD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;iBAQpB,CAAC;AAEH,MAAM,MAAM,GAA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