codepunk-protocol 0.0.0-stage → 0.1.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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/dist/approval.d.ts +90 -0
  4. package/dist/approval.d.ts.map +1 -0
  5. package/dist/approval.js +76 -0
  6. package/dist/approval.js.map +1 -0
  7. package/dist/common.d.ts +69 -0
  8. package/dist/common.d.ts.map +1 -0
  9. package/dist/common.js +97 -0
  10. package/dist/common.js.map +1 -0
  11. package/dist/daemon.d.ts +2113 -0
  12. package/dist/daemon.d.ts.map +1 -0
  13. package/dist/daemon.js +161 -0
  14. package/dist/daemon.js.map +1 -0
  15. package/dist/delivery.d.ts +106 -0
  16. package/dist/delivery.d.ts.map +1 -0
  17. package/dist/delivery.js +91 -0
  18. package/dist/delivery.js.map +1 -0
  19. package/dist/evidence.d.ts +268 -0
  20. package/dist/evidence.d.ts.map +1 -0
  21. package/dist/evidence.js +93 -0
  22. package/dist/evidence.js.map +1 -0
  23. package/dist/index.d.ts +26 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +25 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/memory.d.ts +51 -0
  28. package/dist/memory.d.ts.map +1 -0
  29. package/dist/memory.js +53 -0
  30. package/dist/memory.js.map +1 -0
  31. package/dist/plugin.d.ts +77 -0
  32. package/dist/plugin.d.ts.map +1 -0
  33. package/dist/plugin.js +65 -0
  34. package/dist/plugin.js.map +1 -0
  35. package/dist/policy.d.ts +33 -0
  36. package/dist/policy.d.ts.map +1 -0
  37. package/dist/policy.js +33 -0
  38. package/dist/policy.js.map +1 -0
  39. package/dist/retention.d.ts +21 -0
  40. package/dist/retention.d.ts.map +1 -0
  41. package/dist/retention.js +31 -0
  42. package/dist/retention.js.map +1 -0
  43. package/dist/session.d.ts +1941 -0
  44. package/dist/session.d.ts.map +1 -0
  45. package/dist/session.js +649 -0
  46. package/dist/session.js.map +1 -0
  47. package/dist/swarm.d.ts +25 -0
  48. package/dist/swarm.d.ts.map +1 -0
  49. package/dist/swarm.js +33 -0
  50. package/dist/swarm.js.map +1 -0
  51. package/dist/verdict.d.ts +35 -0
  52. package/dist/verdict.d.ts.map +1 -0
  53. package/dist/verdict.js +44 -0
  54. package/dist/verdict.js.map +1 -0
  55. package/dist/version.d.ts +14 -0
  56. package/dist/version.d.ts.map +1 -0
  57. package/dist/version.js +37 -0
  58. package/dist/version.js.map +1 -0
  59. package/package.json +32 -4
@@ -0,0 +1,1941 @@
1
+ import { Type, type Static } from "typebox";
2
+ export declare const SessionHeaderSchema: Type.TObject<{
3
+ type: Type.TLiteral<"codepunk/session">;
4
+ version: Type.TLiteral<1>;
5
+ id: Type.TString;
6
+ project_id: Type.TString;
7
+ cwd: Type.TString;
8
+ created_at: Type.TString;
9
+ pi_version: Type.TString;
10
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
11
+ parent_session_id: Type.TOptional<Type.TString>;
12
+ fork_entry_id: Type.TOptional<Type.TString>;
13
+ }>;
14
+ export type SessionHeader = Static<typeof SessionHeaderSchema>;
15
+ export declare const RunStartEventSchema: Type.TObject<{
16
+ type: Type.TLiteral<"codepunk/event">;
17
+ version: Type.TLiteral<1>;
18
+ seq: Type.TInteger;
19
+ at: Type.TString;
20
+ kind: Type.TLiteral<"run/start">;
21
+ data: Type.TObject<{
22
+ run_id: Type.TString;
23
+ session_id: Type.TString;
24
+ }>;
25
+ }>;
26
+ export declare const UserInputEventSchema: Type.TObject<{
27
+ type: Type.TLiteral<"codepunk/event">;
28
+ version: Type.TLiteral<1>;
29
+ seq: Type.TInteger;
30
+ at: Type.TString;
31
+ kind: Type.TLiteral<"user/input">;
32
+ data: Type.TObject<{
33
+ run_id: Type.TString;
34
+ text: Type.TString;
35
+ }>;
36
+ }>;
37
+ export declare const SessionForkedEventSchema: Type.TObject<{
38
+ type: Type.TLiteral<"codepunk/event">;
39
+ version: Type.TLiteral<1>;
40
+ seq: Type.TInteger;
41
+ at: Type.TString;
42
+ kind: Type.TLiteral<"session/forked">;
43
+ data: Type.TObject<{
44
+ parent_session_id: Type.TString;
45
+ parent_last_seq: Type.TInteger;
46
+ parent_state_covers_seq: Type.TInteger;
47
+ parent_state_sha256: Type.TString;
48
+ fork_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
49
+ mode: Type.TUnion<[Type.TLiteral<"clone">, Type.TLiteral<"live">]>;
50
+ }>;
51
+ }>;
52
+ export declare const SessionTreeEventSchema: Type.TObject<{
53
+ type: Type.TLiteral<"codepunk/event">;
54
+ version: Type.TLiteral<1>;
55
+ seq: Type.TInteger;
56
+ at: Type.TString;
57
+ kind: Type.TLiteral<"session/tree">;
58
+ data: Type.TObject<{
59
+ action: Type.TLiteral<"navigate">;
60
+ from_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
61
+ to_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
62
+ target_entry_id: Type.TOptional<Type.TString>;
63
+ branch_entries: Type.TInteger;
64
+ }>;
65
+ }>;
66
+ export declare const ApprovalAnswerEventSchema: Type.TObject<{
67
+ type: Type.TLiteral<"codepunk/event">;
68
+ version: Type.TLiteral<1>;
69
+ seq: Type.TInteger;
70
+ at: Type.TString;
71
+ kind: Type.TLiteral<"approval/answer">;
72
+ data: Type.TObject<{
73
+ request_id: Type.TString;
74
+ answer: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"deny">]>;
75
+ scope: Type.TOptional<Type.TUnion<[Type.TLiteral<"once">, Type.TLiteral<"session">, Type.TLiteral<"persistent">]>>;
76
+ guidance: Type.TOptional<Type.TString>;
77
+ channel: Type.TString;
78
+ channel_id: Type.TString;
79
+ nonce_sha256: Type.TString;
80
+ worker_id: Type.TString;
81
+ session_id: Type.TString;
82
+ tool_call_id: Type.TString;
83
+ answered_at: Type.TString;
84
+ }>;
85
+ }>;
86
+ export declare const BashResultEventSchema: Type.TObject<{
87
+ type: Type.TLiteral<"codepunk/event">;
88
+ version: Type.TLiteral<1>;
89
+ seq: Type.TInteger;
90
+ at: Type.TString;
91
+ kind: Type.TLiteral<"bash/result">;
92
+ data: Type.TObject<{
93
+ run_id: Type.TString;
94
+ command: Type.TString;
95
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
96
+ output_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
97
+ cancelled: Type.TBoolean;
98
+ }>;
99
+ }>;
100
+ export declare const CommitCreatedEventSchema: Type.TObject<{
101
+ type: Type.TLiteral<"codepunk/event">;
102
+ version: Type.TLiteral<1>;
103
+ seq: Type.TInteger;
104
+ at: Type.TString;
105
+ kind: Type.TLiteral<"commit/created">;
106
+ data: Type.TObject<{
107
+ run_id: Type.TString;
108
+ commit: Type.TString;
109
+ previous_commit: Type.TUnion<[Type.TString, Type.TNull]>;
110
+ tree: Type.TString;
111
+ message_sha256: Type.TString;
112
+ message_bytes: Type.TInteger;
113
+ files: Type.TArray<Type.TString>;
114
+ stage: Type.TUnion<[Type.TLiteral<"staged">, Type.TLiteral<"tracked">, Type.TLiteral<"all">]>;
115
+ root: Type.TString;
116
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
117
+ }>;
118
+ }>;
119
+ export declare const CheckpointRestoreEventSchema: Type.TObject<{
120
+ type: Type.TLiteral<"codepunk/event">;
121
+ version: Type.TLiteral<1>;
122
+ seq: Type.TInteger;
123
+ at: Type.TString;
124
+ kind: Type.TLiteral<"checkpoint/restore">;
125
+ data: Type.TObject<{
126
+ action: Type.TUnion<[Type.TLiteral<"undo">, Type.TLiteral<"redo">]>;
127
+ checkpoint_id: Type.TString;
128
+ tool_call_id: Type.TString;
129
+ target: Type.TString;
130
+ from_sha256: Type.TString;
131
+ to_sha256: Type.TString;
132
+ }>;
133
+ }>;
134
+ export declare const ContextSourceSchema: Type.TObject<{
135
+ rank: Type.TInteger;
136
+ kind: Type.TUnion<[Type.TLiteral<"user-instructions">, Type.TLiteral<"project-instructions">, Type.TLiteral<"append">]>;
137
+ source: Type.TString;
138
+ sha256: Type.TString;
139
+ bytes: Type.TInteger;
140
+ truncated: Type.TBoolean;
141
+ }>;
142
+ export type ContextSource = Static<typeof ContextSourceSchema>;
143
+ export declare const ContextLoadedEventSchema: Type.TObject<{
144
+ type: Type.TLiteral<"codepunk/event">;
145
+ version: Type.TLiteral<1>;
146
+ seq: Type.TInteger;
147
+ at: Type.TString;
148
+ kind: Type.TLiteral<"context/loaded">;
149
+ data: Type.TObject<{
150
+ sources: Type.TArray<Type.TObject<{
151
+ rank: Type.TInteger;
152
+ kind: Type.TUnion<[Type.TLiteral<"user-instructions">, Type.TLiteral<"project-instructions">, Type.TLiteral<"append">]>;
153
+ source: Type.TString;
154
+ sha256: Type.TString;
155
+ bytes: Type.TInteger;
156
+ truncated: Type.TBoolean;
157
+ }>>;
158
+ warnings: Type.TArray<Type.TString>;
159
+ total_bytes: Type.TInteger;
160
+ truncated: Type.TBoolean;
161
+ }>;
162
+ }>;
163
+ export declare const TrustDecisionEventSchema: Type.TObject<{
164
+ type: Type.TLiteral<"codepunk/event">;
165
+ version: Type.TLiteral<1>;
166
+ seq: Type.TInteger;
167
+ at: Type.TString;
168
+ kind: Type.TLiteral<"trust/decision">;
169
+ data: Type.TObject<{
170
+ cwd: Type.TString;
171
+ root: Type.TString;
172
+ decision: Type.TUnion<[Type.TLiteral<"trusted">, Type.TLiteral<"untrusted">]>;
173
+ mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"all">, Type.TLiteral<"custom">, Type.TLiteral<"none">]>>;
174
+ source: Type.TUnion<[Type.TLiteral<"flag">, Type.TLiteral<"saved">, Type.TLiteral<"prompt">, Type.TLiteral<"default">, Type.TLiteral<"no-resources">]>;
175
+ resources: Type.TArray<Type.TString>;
176
+ skipped: Type.TArray<Type.TString>;
177
+ grants: Type.TOptional<Type.TObject<{
178
+ config: Type.TBoolean;
179
+ policy: Type.TBoolean;
180
+ skills: Type.TBoolean;
181
+ instructions: Type.TBoolean;
182
+ }>>;
183
+ available: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"config">, Type.TLiteral<"policy">, Type.TLiteral<"skills">, Type.TLiteral<"instructions">]>>>;
184
+ }>;
185
+ }>;
186
+ export type TrustDecisionEvent = Static<typeof TrustDecisionEventSchema>;
187
+ export declare const CompactionDecisionEventSchema: Type.TObject<{
188
+ type: Type.TLiteral<"codepunk/event">;
189
+ version: Type.TLiteral<1>;
190
+ seq: Type.TInteger;
191
+ at: Type.TString;
192
+ kind: Type.TLiteral<"compaction/decision">;
193
+ data: Type.TObject<{
194
+ run_id: Type.TString;
195
+ reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"threshold">, Type.TLiteral<"overflow">]>;
196
+ cancelled: Type.TBoolean;
197
+ entries: Type.TInteger;
198
+ keep_recent_tokens: Type.TInteger;
199
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
200
+ failure: Type.TOptional<Type.TString>;
201
+ checkpoint: Type.TOptional<Type.TObject<{
202
+ compaction_entry_id: Type.TString;
203
+ first_kept_entry_id: Type.TString;
204
+ summary_sha256: Type.TString;
205
+ summary_bytes: Type.TInteger;
206
+ tokens_before: Type.TInteger;
207
+ messages_before: Type.TInteger;
208
+ messages_after: Type.TInteger;
209
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
210
+ loadout_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
211
+ tool_names: Type.TArray<Type.TString>;
212
+ usage: Type.TOptional<Type.TObject<{
213
+ input_tokens: Type.TInteger;
214
+ output_tokens: Type.TInteger;
215
+ cache_read_tokens: Type.TInteger;
216
+ cache_write_tokens: Type.TInteger;
217
+ total_tokens: Type.TInteger;
218
+ cost_total: Type.TNumber;
219
+ }>>;
220
+ }>>;
221
+ }>;
222
+ }>;
223
+ export declare const RunEndEventSchema: Type.TObject<{
224
+ type: Type.TLiteral<"codepunk/event">;
225
+ version: Type.TLiteral<1>;
226
+ seq: Type.TInteger;
227
+ at: Type.TString;
228
+ kind: Type.TLiteral<"run/end">;
229
+ data: Type.TObject<{
230
+ run_id: Type.TString;
231
+ state: Type.TUnion<[Type.TLiteral<"settled">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">, Type.TLiteral<"cancelled">]>;
232
+ termination: Type.TUnion<[Type.TString, Type.TNull]>;
233
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
234
+ actor: Type.TString;
235
+ }>;
236
+ }>;
237
+ export declare const SignOffEventSchema: Type.TObject<{
238
+ type: Type.TLiteral<"codepunk/event">;
239
+ version: Type.TLiteral<1>;
240
+ seq: Type.TInteger;
241
+ at: Type.TString;
242
+ kind: Type.TLiteral<"verdict/sign_off">;
243
+ data: Type.TObject<{
244
+ sign_off_id: Type.TString;
245
+ previous_sign_off_id: Type.TUnion<[Type.TString, Type.TNull]>;
246
+ run_id: Type.TString;
247
+ evidence_head: Type.TString;
248
+ signed_verdict: Type.TUnion<[Type.TLiteral<"complete">, Type.TLiteral<"incomplete">]>;
249
+ channel: Type.TUnion<[Type.TLiteral<"tui">, Type.TLiteral<"cli">]>;
250
+ actor: Type.TString;
251
+ signed_at: Type.TString;
252
+ }>;
253
+ }>;
254
+ export declare const MemoryWriteEventSchema: Type.TObject<{
255
+ type: Type.TLiteral<"codepunk/event">;
256
+ version: Type.TLiteral<1>;
257
+ seq: Type.TInteger;
258
+ at: Type.TString;
259
+ kind: Type.TLiteral<"memory/write">;
260
+ data: Type.TObject<{
261
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
262
+ action: Type.TUnion<[Type.TLiteral<"add">, Type.TLiteral<"edit">, Type.TLiteral<"delete">, Type.TLiteral<"archive">, Type.TLiteral<"reject">]>;
263
+ memory_id: Type.TUnion<[Type.TString, Type.TNull]>;
264
+ content_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
265
+ source_refs: Type.TArray<Type.TString>;
266
+ reason: Type.TUnion<[Type.TString, Type.TNull]>;
267
+ }>;
268
+ }>;
269
+ export declare const MemoryRetrieveEventSchema: Type.TObject<{
270
+ type: Type.TLiteral<"codepunk/event">;
271
+ version: Type.TLiteral<1>;
272
+ seq: Type.TInteger;
273
+ at: Type.TString;
274
+ kind: Type.TLiteral<"memory/retrieve">;
275
+ data: Type.TObject<{
276
+ ids: Type.TArray<Type.TString>;
277
+ hashes: Type.TArray<Type.TString>;
278
+ cap: Type.TInteger;
279
+ truncated: Type.TBoolean;
280
+ digest_sha256: Type.TString;
281
+ }>;
282
+ }>;
283
+ export declare const ModelChangeEventSchema: Type.TObject<{
284
+ type: Type.TLiteral<"codepunk/event">;
285
+ version: Type.TLiteral<1>;
286
+ seq: Type.TInteger;
287
+ at: Type.TString;
288
+ kind: Type.TLiteral<"model/change">;
289
+ data: Type.TObject<{
290
+ previous: Type.TUnion<[Type.TString, Type.TNull]>;
291
+ model: Type.TString;
292
+ thinking: Type.TUnion<[Type.TString, Type.TNull]>;
293
+ }>;
294
+ }>;
295
+ export declare const ModelUsageEventSchema: Type.TObject<{
296
+ type: Type.TLiteral<"codepunk/event">;
297
+ version: Type.TLiteral<1>;
298
+ seq: Type.TInteger;
299
+ at: Type.TString;
300
+ kind: Type.TLiteral<"model/usage">;
301
+ data: Type.TObject<{
302
+ run_id: Type.TString;
303
+ provider: Type.TString;
304
+ model: Type.TString;
305
+ input_tokens: Type.TInteger;
306
+ output_tokens: Type.TInteger;
307
+ cache_read_tokens: Type.TInteger;
308
+ cache_write_tokens: Type.TInteger;
309
+ total_tokens: Type.TInteger;
310
+ cost_total: Type.TNumber;
311
+ stop_reason: Type.TString;
312
+ source: Type.TOptional<Type.TUnion<[Type.TLiteral<"assistant">, Type.TLiteral<"summary">]>>;
313
+ }>;
314
+ }>;
315
+ export declare const ModelFallbackEventSchema: Type.TObject<{
316
+ type: Type.TLiteral<"codepunk/event">;
317
+ version: Type.TLiteral<1>;
318
+ seq: Type.TInteger;
319
+ at: Type.TString;
320
+ kind: Type.TLiteral<"model/fallback">;
321
+ data: Type.TObject<{
322
+ from: Type.TString;
323
+ to: Type.TUnion<[Type.TString, Type.TNull]>;
324
+ reason: Type.TLiteral<"error">;
325
+ stop_reason: Type.TUnion<[Type.TString, Type.TNull]>;
326
+ attempted: Type.TArray<Type.TString>;
327
+ exhausted: Type.TBoolean;
328
+ chain_sha256: Type.TString;
329
+ }>;
330
+ }>;
331
+ export declare const ModelRetryStartEventSchema: Type.TObject<{
332
+ type: Type.TLiteral<"codepunk/event">;
333
+ version: Type.TLiteral<1>;
334
+ seq: Type.TInteger;
335
+ at: Type.TString;
336
+ kind: Type.TLiteral<"model/retry_start">;
337
+ data: Type.TObject<{
338
+ run_id: Type.TString;
339
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
340
+ attempt: Type.TInteger;
341
+ max_attempts: Type.TInteger;
342
+ delay_ms: Type.TInteger;
343
+ error_sha256: Type.TString;
344
+ error_preview: Type.TString;
345
+ }>;
346
+ }>;
347
+ export declare const ModelRetryEndEventSchema: Type.TObject<{
348
+ type: Type.TLiteral<"codepunk/event">;
349
+ version: Type.TLiteral<1>;
350
+ seq: Type.TInteger;
351
+ at: Type.TString;
352
+ kind: Type.TLiteral<"model/retry_end">;
353
+ data: Type.TObject<{
354
+ run_id: Type.TString;
355
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
356
+ attempt: Type.TInteger;
357
+ success: Type.TBoolean;
358
+ final_error_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
359
+ final_error_preview: Type.TUnion<[Type.TString, Type.TNull]>;
360
+ }>;
361
+ }>;
362
+ export declare const BudgetExceededEventSchema: Type.TObject<{
363
+ type: Type.TLiteral<"codepunk/event">;
364
+ version: Type.TLiteral<1>;
365
+ seq: Type.TInteger;
366
+ at: Type.TString;
367
+ kind: Type.TLiteral<"budget/exceeded">;
368
+ data: Type.TObject<{
369
+ run_id: Type.TString;
370
+ limit_kind: Type.TUnion<[Type.TLiteral<"tool_calls">, Type.TLiteral<"wall_ms">, Type.TLiteral<"tokens">, Type.TLiteral<"cost">]>;
371
+ limit: Type.TNumber;
372
+ used: Type.TNumber;
373
+ action: Type.TUnion<[Type.TLiteral<"reject_call">, Type.TLiteral<"abort_run">]>;
374
+ }>;
375
+ }>;
376
+ export declare const LoopGuardEventSchema: Type.TObject<{
377
+ type: Type.TLiteral<"codepunk/event">;
378
+ version: Type.TLiteral<1>;
379
+ seq: Type.TInteger;
380
+ at: Type.TString;
381
+ kind: Type.TLiteral<"loop_guard">;
382
+ data: Type.TObject<{
383
+ run_id: Type.TString;
384
+ tool: Type.TString;
385
+ canonical_argv: Type.TArray<Type.TString>;
386
+ cwd: Type.TString;
387
+ repeat_count: Type.TInteger;
388
+ threshold: Type.TInteger;
389
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
390
+ }>;
391
+ }>;
392
+ export declare const NetworkLimitSchema: Type.TObject<{
393
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
394
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
395
+ }>;
396
+ export type NetworkLimit = Static<typeof NetworkLimitSchema>;
397
+ export declare const NetworkRequestEventSchema: Type.TObject<{
398
+ type: Type.TLiteral<"codepunk/event">;
399
+ version: Type.TLiteral<1>;
400
+ seq: Type.TInteger;
401
+ at: Type.TString;
402
+ kind: Type.TLiteral<"network/request">;
403
+ data: Type.TObject<{
404
+ run_id: Type.TString;
405
+ domain: Type.TString;
406
+ requests: Type.TInteger;
407
+ bytes: Type.TInteger;
408
+ limit: Type.TObject<{
409
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
410
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
411
+ }>;
412
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
413
+ }>;
414
+ }>;
415
+ export declare const NetworkRedirectEventSchema: Type.TObject<{
416
+ type: Type.TLiteral<"codepunk/event">;
417
+ version: Type.TLiteral<1>;
418
+ seq: Type.TInteger;
419
+ at: Type.TString;
420
+ kind: Type.TLiteral<"network/redirect">;
421
+ data: Type.TObject<{
422
+ run_id: Type.TString;
423
+ from: Type.TString;
424
+ to: Type.TString;
425
+ status: Type.TInteger;
426
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
427
+ }>;
428
+ }>;
429
+ export declare const NetworkRejectedEventSchema: Type.TObject<{
430
+ type: Type.TLiteral<"codepunk/event">;
431
+ version: Type.TLiteral<1>;
432
+ seq: Type.TInteger;
433
+ at: Type.TString;
434
+ kind: Type.TLiteral<"network/rejected">;
435
+ data: Type.TObject<{
436
+ run_id: Type.TString;
437
+ domain: Type.TString;
438
+ reason: Type.TString;
439
+ limit: Type.TObject<{
440
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
441
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
442
+ }>;
443
+ }>;
444
+ }>;
445
+ export declare const ContextRequestEventSchema: Type.TObject<{
446
+ type: Type.TLiteral<"codepunk/event">;
447
+ version: Type.TLiteral<1>;
448
+ seq: Type.TInteger;
449
+ at: Type.TString;
450
+ kind: Type.TLiteral<"context/request">;
451
+ data: Type.TObject<{
452
+ run_id: Type.TString;
453
+ request_id: Type.TString;
454
+ message_ids: Type.TArray<Type.TString>;
455
+ omitted: Type.TObject<{
456
+ ids: Type.TArray<Type.TString>;
457
+ ranges: Type.TArray<Type.TObject<{
458
+ start: Type.TInteger;
459
+ end: Type.TInteger;
460
+ }>>;
461
+ }>;
462
+ truncation_sha256: Type.TString;
463
+ provider: Type.TString;
464
+ model: Type.TString;
465
+ token_estimate: Type.TInteger;
466
+ compaction_id: Type.TUnion<[Type.TString, Type.TNull]>;
467
+ }>;
468
+ }>;
469
+ export declare const McpServerStartEventSchema: Type.TObject<{
470
+ type: Type.TLiteral<"codepunk/event">;
471
+ version: Type.TLiteral<1>;
472
+ seq: Type.TInteger;
473
+ at: Type.TString;
474
+ kind: Type.TLiteral<"mcp/server_start">;
475
+ data: Type.TObject<{
476
+ server: Type.TString;
477
+ command_sha256: Type.TString;
478
+ pid: Type.TInteger;
479
+ transport: Type.TUnion<[Type.TLiteral<"stdio">, Type.TLiteral<"http">]>;
480
+ coverage: Type.TLiteral<"uncovered">;
481
+ }>;
482
+ }>;
483
+ export declare const SkillLoadedEventSchema: Type.TObject<{
484
+ type: Type.TLiteral<"codepunk/event">;
485
+ version: Type.TLiteral<1>;
486
+ seq: Type.TInteger;
487
+ at: Type.TString;
488
+ kind: Type.TLiteral<"skill/loaded">;
489
+ data: Type.TObject<{
490
+ skills: Type.TArray<Type.TObject<{
491
+ name: Type.TString;
492
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
493
+ sha256: Type.TString;
494
+ bytes: Type.TInteger;
495
+ }>>;
496
+ block_sha256: Type.TString;
497
+ }>;
498
+ }>;
499
+ export declare const SkillInvokedEventSchema: Type.TObject<{
500
+ type: Type.TLiteral<"codepunk/event">;
501
+ version: Type.TLiteral<1>;
502
+ seq: Type.TInteger;
503
+ at: Type.TString;
504
+ kind: Type.TLiteral<"skill/invoked">;
505
+ data: Type.TObject<{
506
+ name: Type.TString;
507
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
508
+ sha256: Type.TString;
509
+ bytes: Type.TInteger;
510
+ }>;
511
+ }>;
512
+ export declare const PlanStepSchema: Type.TObject<{
513
+ step: Type.TString;
514
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
515
+ }>;
516
+ export type PlanStep = Static<typeof PlanStepSchema>;
517
+ export declare const PlanUpdateEventSchema: Type.TObject<{
518
+ type: Type.TLiteral<"codepunk/event">;
519
+ version: Type.TLiteral<1>;
520
+ seq: Type.TInteger;
521
+ at: Type.TString;
522
+ kind: Type.TLiteral<"plan/update">;
523
+ data: Type.TObject<{
524
+ run_id: Type.TString;
525
+ steps: Type.TArray<Type.TObject<{
526
+ step: Type.TString;
527
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
528
+ }>>;
529
+ explanation: Type.TUnion<[Type.TString, Type.TNull]>;
530
+ updated_at: Type.TString;
531
+ sha256: Type.TString;
532
+ }>;
533
+ }>;
534
+ export type PlanUpdateEvent = Static<typeof PlanUpdateEventSchema>;
535
+ export declare const TodoItemSchema: Type.TObject<{
536
+ content: Type.TString;
537
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
538
+ }>;
539
+ export type TodoItem = Static<typeof TodoItemSchema>;
540
+ export declare const TodoUpdateEventSchema: Type.TObject<{
541
+ type: Type.TLiteral<"codepunk/event">;
542
+ version: Type.TLiteral<1>;
543
+ seq: Type.TInteger;
544
+ at: Type.TString;
545
+ kind: Type.TLiteral<"todo/update">;
546
+ data: Type.TObject<{
547
+ run_id: Type.TString;
548
+ items: Type.TArray<Type.TObject<{
549
+ content: Type.TString;
550
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
551
+ }>>;
552
+ updated_at: Type.TString;
553
+ sha256: Type.TString;
554
+ }>;
555
+ }>;
556
+ export type TodoUpdateEvent = Static<typeof TodoUpdateEventSchema>;
557
+ export declare const AutonomyProfileEventSchema: Type.TObject<{
558
+ type: Type.TLiteral<"codepunk/event">;
559
+ version: Type.TLiteral<1>;
560
+ seq: Type.TInteger;
561
+ at: Type.TString;
562
+ kind: Type.TLiteral<"autonomy/profile">;
563
+ data: Type.TObject<{
564
+ profile: Type.TUnion<[Type.TLiteral<"read-only">, Type.TLiteral<"ask">, Type.TLiteral<"scoped">]>;
565
+ source: Type.TUnion<[Type.TLiteral<"cli">, Type.TLiteral<"user-config">, Type.TLiteral<"default">]>;
566
+ rules_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
567
+ rules: Type.TArray<Type.TObject<{
568
+ id: Type.TString;
569
+ argv: Type.TArray<Type.TString>;
570
+ cwd: Type.TString;
571
+ executable_sha256: Type.TString;
572
+ rule_sha256: Type.TString;
573
+ }>>;
574
+ }>;
575
+ }>;
576
+ export declare const AutonomyRevokedEventSchema: Type.TObject<{
577
+ type: Type.TLiteral<"codepunk/event">;
578
+ version: Type.TLiteral<1>;
579
+ seq: Type.TInteger;
580
+ at: Type.TString;
581
+ kind: Type.TLiteral<"autonomy/revoked">;
582
+ data: Type.TObject<{
583
+ profile: Type.TUnion<[Type.TLiteral<"read-only">, Type.TLiteral<"ask">, Type.TLiteral<"scoped">]>;
584
+ reason: Type.TLiteral<"session_end">;
585
+ }>;
586
+ }>;
587
+ export declare const SubagentResultEventSchema: Type.TObject<{
588
+ type: Type.TLiteral<"codepunk/event">;
589
+ version: Type.TLiteral<1>;
590
+ seq: Type.TInteger;
591
+ at: Type.TString;
592
+ kind: Type.TLiteral<"subagent/result">;
593
+ data: Type.TObject<{
594
+ run_id: Type.TString;
595
+ parent_session_id: Type.TString;
596
+ child_session_id: Type.TString;
597
+ depth: Type.TInteger;
598
+ isolation: Type.TUnion<[Type.TLiteral<"worktree">, Type.TLiteral<"shared">]>;
599
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
600
+ status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"stopped">]>;
601
+ summary: Type.TString;
602
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
603
+ child_run_id: Type.TUnion<[Type.TString, Type.TNull]>;
604
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
605
+ error: Type.TUnion<[Type.TString, Type.TNull]>;
606
+ profile: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
607
+ profile_sha256: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
608
+ worktree: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
609
+ base_commit: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
610
+ transcript_path: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
611
+ changed_files: Type.TOptional<Type.TUnion<[Type.TInteger, Type.TNull]>>;
612
+ }>;
613
+ }>;
614
+ export declare const PluginStartedEventSchema: Type.TObject<{
615
+ type: Type.TLiteral<"codepunk/event">;
616
+ version: Type.TLiteral<1>;
617
+ seq: Type.TInteger;
618
+ at: Type.TString;
619
+ kind: Type.TLiteral<"plugin/started">;
620
+ data: Type.TObject<{
621
+ plugin_id: Type.TString;
622
+ version: Type.TString;
623
+ manifest_sha256: Type.TString;
624
+ pid: Type.TInteger;
625
+ credential_verified: Type.TBoolean;
626
+ started_at: Type.TString;
627
+ }>;
628
+ }>;
629
+ export declare const PluginToolCallEventSchema: Type.TObject<{
630
+ type: Type.TLiteral<"codepunk/event">;
631
+ version: Type.TLiteral<1>;
632
+ seq: Type.TInteger;
633
+ at: Type.TString;
634
+ kind: Type.TLiteral<"plugin/tool_call">;
635
+ data: Type.TObject<{
636
+ run_id: Type.TString;
637
+ tool_call_id: Type.TString;
638
+ plugin_id: Type.TString;
639
+ plugin_manifest_sha256: Type.TString;
640
+ executor: Type.TLiteral<"child-host">;
641
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
642
+ approval: Type.TUnion<[Type.TObject<{
643
+ channel: Type.TString;
644
+ request_id: Type.TString;
645
+ nonce_sha256: Type.TString;
646
+ ttl_ms: Type.TInteger;
647
+ worker_id: Type.TString;
648
+ session_id: Type.TString;
649
+ tool_call_id: Type.TString;
650
+ answer: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"deny">]>;
651
+ scope: Type.TOptional<Type.TUnion<[Type.TLiteral<"once">, Type.TLiteral<"session">, Type.TLiteral<"persistent">]>>;
652
+ guidance: Type.TOptional<Type.TString>;
653
+ reused_from_request_id: Type.TOptional<Type.TString>;
654
+ args_sha256: Type.TOptional<Type.TString>;
655
+ diff_sha256: Type.TOptional<Type.TString>;
656
+ }>, Type.TNull]>;
657
+ outcome: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"denied">, Type.TLiteral<"cancelled">]>;
658
+ reason: Type.TUnion<[Type.TString, Type.TNull]>;
659
+ }>;
660
+ }>;
661
+ export declare const PluginStoppedEventSchema: Type.TObject<{
662
+ type: Type.TLiteral<"codepunk/event">;
663
+ version: Type.TLiteral<1>;
664
+ seq: Type.TInteger;
665
+ at: Type.TString;
666
+ kind: Type.TLiteral<"plugin/stopped">;
667
+ data: Type.TObject<{
668
+ plugin_id: Type.TString;
669
+ pid: Type.TInteger;
670
+ credential_verified: Type.TBoolean;
671
+ reason: Type.TUnion<[Type.TLiteral<"exit">, Type.TLiteral<"crash">, Type.TLiteral<"timeout">, Type.TLiteral<"cancel">, Type.TLiteral<"shutdown">, Type.TLiteral<"error">]>;
672
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
673
+ stopped_at: Type.TString;
674
+ }>;
675
+ }>;
676
+ export declare const SessionEventSchema: Type.TUnion<[Type.TObject<{
677
+ type: Type.TLiteral<"codepunk/event">;
678
+ version: Type.TLiteral<1>;
679
+ seq: Type.TInteger;
680
+ at: Type.TString;
681
+ kind: Type.TLiteral<"run/start">;
682
+ data: Type.TObject<{
683
+ run_id: Type.TString;
684
+ session_id: Type.TString;
685
+ }>;
686
+ }>, Type.TObject<{
687
+ type: Type.TLiteral<"codepunk/event">;
688
+ version: Type.TLiteral<1>;
689
+ seq: Type.TInteger;
690
+ at: Type.TString;
691
+ kind: Type.TLiteral<"user/input">;
692
+ data: Type.TObject<{
693
+ run_id: Type.TString;
694
+ text: Type.TString;
695
+ }>;
696
+ }>, Type.TObject<{
697
+ type: Type.TLiteral<"codepunk/event">;
698
+ version: Type.TLiteral<1>;
699
+ seq: Type.TInteger;
700
+ at: Type.TString;
701
+ kind: Type.TLiteral<"session/forked">;
702
+ data: Type.TObject<{
703
+ parent_session_id: Type.TString;
704
+ parent_last_seq: Type.TInteger;
705
+ parent_state_covers_seq: Type.TInteger;
706
+ parent_state_sha256: Type.TString;
707
+ fork_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
708
+ mode: Type.TUnion<[Type.TLiteral<"clone">, Type.TLiteral<"live">]>;
709
+ }>;
710
+ }>, Type.TObject<{
711
+ type: Type.TLiteral<"codepunk/event">;
712
+ version: Type.TLiteral<1>;
713
+ seq: Type.TInteger;
714
+ at: Type.TString;
715
+ kind: Type.TLiteral<"session/tree">;
716
+ data: Type.TObject<{
717
+ action: Type.TLiteral<"navigate">;
718
+ from_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
719
+ to_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
720
+ target_entry_id: Type.TOptional<Type.TString>;
721
+ branch_entries: Type.TInteger;
722
+ }>;
723
+ }>, Type.TObject<{
724
+ type: Type.TLiteral<"codepunk/event">;
725
+ version: Type.TLiteral<1>;
726
+ seq: Type.TInteger;
727
+ at: Type.TString;
728
+ kind: Type.TLiteral<"approval/answer">;
729
+ data: Type.TObject<{
730
+ request_id: Type.TString;
731
+ answer: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"deny">]>;
732
+ scope: Type.TOptional<Type.TUnion<[Type.TLiteral<"once">, Type.TLiteral<"session">, Type.TLiteral<"persistent">]>>;
733
+ guidance: Type.TOptional<Type.TString>;
734
+ channel: Type.TString;
735
+ channel_id: Type.TString;
736
+ nonce_sha256: Type.TString;
737
+ worker_id: Type.TString;
738
+ session_id: Type.TString;
739
+ tool_call_id: Type.TString;
740
+ answered_at: Type.TString;
741
+ }>;
742
+ }>, Type.TObject<{
743
+ type: Type.TLiteral<"codepunk/event">;
744
+ version: Type.TLiteral<1>;
745
+ seq: Type.TInteger;
746
+ at: Type.TString;
747
+ kind: Type.TLiteral<"bash/result">;
748
+ data: Type.TObject<{
749
+ run_id: Type.TString;
750
+ command: Type.TString;
751
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
752
+ output_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
753
+ cancelled: Type.TBoolean;
754
+ }>;
755
+ }>, Type.TObject<{
756
+ type: Type.TLiteral<"codepunk/event">;
757
+ version: Type.TLiteral<1>;
758
+ seq: Type.TInteger;
759
+ at: Type.TString;
760
+ kind: Type.TLiteral<"commit/created">;
761
+ data: Type.TObject<{
762
+ run_id: Type.TString;
763
+ commit: Type.TString;
764
+ previous_commit: Type.TUnion<[Type.TString, Type.TNull]>;
765
+ tree: Type.TString;
766
+ message_sha256: Type.TString;
767
+ message_bytes: Type.TInteger;
768
+ files: Type.TArray<Type.TString>;
769
+ stage: Type.TUnion<[Type.TLiteral<"staged">, Type.TLiteral<"tracked">, Type.TLiteral<"all">]>;
770
+ root: Type.TString;
771
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
772
+ }>;
773
+ }>, Type.TObject<{
774
+ type: Type.TLiteral<"codepunk/event">;
775
+ version: Type.TLiteral<1>;
776
+ seq: Type.TInteger;
777
+ at: Type.TString;
778
+ kind: Type.TLiteral<"checkpoint/restore">;
779
+ data: Type.TObject<{
780
+ action: Type.TUnion<[Type.TLiteral<"undo">, Type.TLiteral<"redo">]>;
781
+ checkpoint_id: Type.TString;
782
+ tool_call_id: Type.TString;
783
+ target: Type.TString;
784
+ from_sha256: Type.TString;
785
+ to_sha256: Type.TString;
786
+ }>;
787
+ }>, Type.TObject<{
788
+ type: Type.TLiteral<"codepunk/event">;
789
+ version: Type.TLiteral<1>;
790
+ seq: Type.TInteger;
791
+ at: Type.TString;
792
+ kind: Type.TLiteral<"context/loaded">;
793
+ data: Type.TObject<{
794
+ sources: Type.TArray<Type.TObject<{
795
+ rank: Type.TInteger;
796
+ kind: Type.TUnion<[Type.TLiteral<"user-instructions">, Type.TLiteral<"project-instructions">, Type.TLiteral<"append">]>;
797
+ source: Type.TString;
798
+ sha256: Type.TString;
799
+ bytes: Type.TInteger;
800
+ truncated: Type.TBoolean;
801
+ }>>;
802
+ warnings: Type.TArray<Type.TString>;
803
+ total_bytes: Type.TInteger;
804
+ truncated: Type.TBoolean;
805
+ }>;
806
+ }>, Type.TObject<{
807
+ type: Type.TLiteral<"codepunk/event">;
808
+ version: Type.TLiteral<1>;
809
+ seq: Type.TInteger;
810
+ at: Type.TString;
811
+ kind: Type.TLiteral<"trust/decision">;
812
+ data: Type.TObject<{
813
+ cwd: Type.TString;
814
+ root: Type.TString;
815
+ decision: Type.TUnion<[Type.TLiteral<"trusted">, Type.TLiteral<"untrusted">]>;
816
+ mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"all">, Type.TLiteral<"custom">, Type.TLiteral<"none">]>>;
817
+ source: Type.TUnion<[Type.TLiteral<"flag">, Type.TLiteral<"saved">, Type.TLiteral<"prompt">, Type.TLiteral<"default">, Type.TLiteral<"no-resources">]>;
818
+ resources: Type.TArray<Type.TString>;
819
+ skipped: Type.TArray<Type.TString>;
820
+ grants: Type.TOptional<Type.TObject<{
821
+ config: Type.TBoolean;
822
+ policy: Type.TBoolean;
823
+ skills: Type.TBoolean;
824
+ instructions: Type.TBoolean;
825
+ }>>;
826
+ available: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"config">, Type.TLiteral<"policy">, Type.TLiteral<"skills">, Type.TLiteral<"instructions">]>>>;
827
+ }>;
828
+ }>, Type.TObject<{
829
+ type: Type.TLiteral<"codepunk/event">;
830
+ version: Type.TLiteral<1>;
831
+ seq: Type.TInteger;
832
+ at: Type.TString;
833
+ kind: Type.TLiteral<"compaction/decision">;
834
+ data: Type.TObject<{
835
+ run_id: Type.TString;
836
+ reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"threshold">, Type.TLiteral<"overflow">]>;
837
+ cancelled: Type.TBoolean;
838
+ entries: Type.TInteger;
839
+ keep_recent_tokens: Type.TInteger;
840
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
841
+ failure: Type.TOptional<Type.TString>;
842
+ checkpoint: Type.TOptional<Type.TObject<{
843
+ compaction_entry_id: Type.TString;
844
+ first_kept_entry_id: Type.TString;
845
+ summary_sha256: Type.TString;
846
+ summary_bytes: Type.TInteger;
847
+ tokens_before: Type.TInteger;
848
+ messages_before: Type.TInteger;
849
+ messages_after: Type.TInteger;
850
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
851
+ loadout_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
852
+ tool_names: Type.TArray<Type.TString>;
853
+ usage: Type.TOptional<Type.TObject<{
854
+ input_tokens: Type.TInteger;
855
+ output_tokens: Type.TInteger;
856
+ cache_read_tokens: Type.TInteger;
857
+ cache_write_tokens: Type.TInteger;
858
+ total_tokens: Type.TInteger;
859
+ cost_total: Type.TNumber;
860
+ }>>;
861
+ }>>;
862
+ }>;
863
+ }>, Type.TObject<{
864
+ type: Type.TLiteral<"codepunk/event">;
865
+ version: Type.TLiteral<1>;
866
+ seq: Type.TInteger;
867
+ at: Type.TString;
868
+ kind: Type.TLiteral<"context/request">;
869
+ data: Type.TObject<{
870
+ run_id: Type.TString;
871
+ request_id: Type.TString;
872
+ message_ids: Type.TArray<Type.TString>;
873
+ omitted: Type.TObject<{
874
+ ids: Type.TArray<Type.TString>;
875
+ ranges: Type.TArray<Type.TObject<{
876
+ start: Type.TInteger;
877
+ end: Type.TInteger;
878
+ }>>;
879
+ }>;
880
+ truncation_sha256: Type.TString;
881
+ provider: Type.TString;
882
+ model: Type.TString;
883
+ token_estimate: Type.TInteger;
884
+ compaction_id: Type.TUnion<[Type.TString, Type.TNull]>;
885
+ }>;
886
+ }>, Type.TObject<{
887
+ type: Type.TLiteral<"codepunk/event">;
888
+ version: Type.TLiteral<1>;
889
+ seq: Type.TInteger;
890
+ at: Type.TString;
891
+ kind: Type.TLiteral<"run/end">;
892
+ data: Type.TObject<{
893
+ run_id: Type.TString;
894
+ state: Type.TUnion<[Type.TLiteral<"settled">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">, Type.TLiteral<"cancelled">]>;
895
+ termination: Type.TUnion<[Type.TString, Type.TNull]>;
896
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
897
+ actor: Type.TString;
898
+ }>;
899
+ }>, Type.TObject<{
900
+ type: Type.TLiteral<"codepunk/event">;
901
+ version: Type.TLiteral<1>;
902
+ seq: Type.TInteger;
903
+ at: Type.TString;
904
+ kind: Type.TLiteral<"verdict/sign_off">;
905
+ data: Type.TObject<{
906
+ sign_off_id: Type.TString;
907
+ previous_sign_off_id: Type.TUnion<[Type.TString, Type.TNull]>;
908
+ run_id: Type.TString;
909
+ evidence_head: Type.TString;
910
+ signed_verdict: Type.TUnion<[Type.TLiteral<"complete">, Type.TLiteral<"incomplete">]>;
911
+ channel: Type.TUnion<[Type.TLiteral<"tui">, Type.TLiteral<"cli">]>;
912
+ actor: Type.TString;
913
+ signed_at: Type.TString;
914
+ }>;
915
+ }>, Type.TObject<{
916
+ type: Type.TLiteral<"codepunk/event">;
917
+ version: Type.TLiteral<1>;
918
+ seq: Type.TInteger;
919
+ at: Type.TString;
920
+ kind: Type.TLiteral<"memory/write">;
921
+ data: Type.TObject<{
922
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
923
+ action: Type.TUnion<[Type.TLiteral<"add">, Type.TLiteral<"edit">, Type.TLiteral<"delete">, Type.TLiteral<"archive">, Type.TLiteral<"reject">]>;
924
+ memory_id: Type.TUnion<[Type.TString, Type.TNull]>;
925
+ content_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
926
+ source_refs: Type.TArray<Type.TString>;
927
+ reason: Type.TUnion<[Type.TString, Type.TNull]>;
928
+ }>;
929
+ }>, Type.TObject<{
930
+ type: Type.TLiteral<"codepunk/event">;
931
+ version: Type.TLiteral<1>;
932
+ seq: Type.TInteger;
933
+ at: Type.TString;
934
+ kind: Type.TLiteral<"memory/retrieve">;
935
+ data: Type.TObject<{
936
+ ids: Type.TArray<Type.TString>;
937
+ hashes: Type.TArray<Type.TString>;
938
+ cap: Type.TInteger;
939
+ truncated: Type.TBoolean;
940
+ digest_sha256: Type.TString;
941
+ }>;
942
+ }>, Type.TObject<{
943
+ type: Type.TLiteral<"codepunk/event">;
944
+ version: Type.TLiteral<1>;
945
+ seq: Type.TInteger;
946
+ at: Type.TString;
947
+ kind: Type.TLiteral<"model/change">;
948
+ data: Type.TObject<{
949
+ previous: Type.TUnion<[Type.TString, Type.TNull]>;
950
+ model: Type.TString;
951
+ thinking: Type.TUnion<[Type.TString, Type.TNull]>;
952
+ }>;
953
+ }>, Type.TObject<{
954
+ type: Type.TLiteral<"codepunk/event">;
955
+ version: Type.TLiteral<1>;
956
+ seq: Type.TInteger;
957
+ at: Type.TString;
958
+ kind: Type.TLiteral<"model/usage">;
959
+ data: Type.TObject<{
960
+ run_id: Type.TString;
961
+ provider: Type.TString;
962
+ model: Type.TString;
963
+ input_tokens: Type.TInteger;
964
+ output_tokens: Type.TInteger;
965
+ cache_read_tokens: Type.TInteger;
966
+ cache_write_tokens: Type.TInteger;
967
+ total_tokens: Type.TInteger;
968
+ cost_total: Type.TNumber;
969
+ stop_reason: Type.TString;
970
+ source: Type.TOptional<Type.TUnion<[Type.TLiteral<"assistant">, Type.TLiteral<"summary">]>>;
971
+ }>;
972
+ }>, Type.TObject<{
973
+ type: Type.TLiteral<"codepunk/event">;
974
+ version: Type.TLiteral<1>;
975
+ seq: Type.TInteger;
976
+ at: Type.TString;
977
+ kind: Type.TLiteral<"model/fallback">;
978
+ data: Type.TObject<{
979
+ from: Type.TString;
980
+ to: Type.TUnion<[Type.TString, Type.TNull]>;
981
+ reason: Type.TLiteral<"error">;
982
+ stop_reason: Type.TUnion<[Type.TString, Type.TNull]>;
983
+ attempted: Type.TArray<Type.TString>;
984
+ exhausted: Type.TBoolean;
985
+ chain_sha256: Type.TString;
986
+ }>;
987
+ }>, Type.TObject<{
988
+ type: Type.TLiteral<"codepunk/event">;
989
+ version: Type.TLiteral<1>;
990
+ seq: Type.TInteger;
991
+ at: Type.TString;
992
+ kind: Type.TLiteral<"model/retry_start">;
993
+ data: Type.TObject<{
994
+ run_id: Type.TString;
995
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
996
+ attempt: Type.TInteger;
997
+ max_attempts: Type.TInteger;
998
+ delay_ms: Type.TInteger;
999
+ error_sha256: Type.TString;
1000
+ error_preview: Type.TString;
1001
+ }>;
1002
+ }>, Type.TObject<{
1003
+ type: Type.TLiteral<"codepunk/event">;
1004
+ version: Type.TLiteral<1>;
1005
+ seq: Type.TInteger;
1006
+ at: Type.TString;
1007
+ kind: Type.TLiteral<"model/retry_end">;
1008
+ data: Type.TObject<{
1009
+ run_id: Type.TString;
1010
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1011
+ attempt: Type.TInteger;
1012
+ success: Type.TBoolean;
1013
+ final_error_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1014
+ final_error_preview: Type.TUnion<[Type.TString, Type.TNull]>;
1015
+ }>;
1016
+ }>, Type.TObject<{
1017
+ type: Type.TLiteral<"codepunk/event">;
1018
+ version: Type.TLiteral<1>;
1019
+ seq: Type.TInteger;
1020
+ at: Type.TString;
1021
+ kind: Type.TLiteral<"budget/exceeded">;
1022
+ data: Type.TObject<{
1023
+ run_id: Type.TString;
1024
+ limit_kind: Type.TUnion<[Type.TLiteral<"tool_calls">, Type.TLiteral<"wall_ms">, Type.TLiteral<"tokens">, Type.TLiteral<"cost">]>;
1025
+ limit: Type.TNumber;
1026
+ used: Type.TNumber;
1027
+ action: Type.TUnion<[Type.TLiteral<"reject_call">, Type.TLiteral<"abort_run">]>;
1028
+ }>;
1029
+ }>, Type.TObject<{
1030
+ type: Type.TLiteral<"codepunk/event">;
1031
+ version: Type.TLiteral<1>;
1032
+ seq: Type.TInteger;
1033
+ at: Type.TString;
1034
+ kind: Type.TLiteral<"loop_guard">;
1035
+ data: Type.TObject<{
1036
+ run_id: Type.TString;
1037
+ tool: Type.TString;
1038
+ canonical_argv: Type.TArray<Type.TString>;
1039
+ cwd: Type.TString;
1040
+ repeat_count: Type.TInteger;
1041
+ threshold: Type.TInteger;
1042
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1043
+ }>;
1044
+ }>, Type.TObject<{
1045
+ type: Type.TLiteral<"codepunk/event">;
1046
+ version: Type.TLiteral<1>;
1047
+ seq: Type.TInteger;
1048
+ at: Type.TString;
1049
+ kind: Type.TLiteral<"network/request">;
1050
+ data: Type.TObject<{
1051
+ run_id: Type.TString;
1052
+ domain: Type.TString;
1053
+ requests: Type.TInteger;
1054
+ bytes: Type.TInteger;
1055
+ limit: Type.TObject<{
1056
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
1057
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
1058
+ }>;
1059
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1060
+ }>;
1061
+ }>, Type.TObject<{
1062
+ type: Type.TLiteral<"codepunk/event">;
1063
+ version: Type.TLiteral<1>;
1064
+ seq: Type.TInteger;
1065
+ at: Type.TString;
1066
+ kind: Type.TLiteral<"network/redirect">;
1067
+ data: Type.TObject<{
1068
+ run_id: Type.TString;
1069
+ from: Type.TString;
1070
+ to: Type.TString;
1071
+ status: Type.TInteger;
1072
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1073
+ }>;
1074
+ }>, Type.TObject<{
1075
+ type: Type.TLiteral<"codepunk/event">;
1076
+ version: Type.TLiteral<1>;
1077
+ seq: Type.TInteger;
1078
+ at: Type.TString;
1079
+ kind: Type.TLiteral<"network/rejected">;
1080
+ data: Type.TObject<{
1081
+ run_id: Type.TString;
1082
+ domain: Type.TString;
1083
+ reason: Type.TString;
1084
+ limit: Type.TObject<{
1085
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
1086
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
1087
+ }>;
1088
+ }>;
1089
+ }>, Type.TObject<{
1090
+ type: Type.TLiteral<"codepunk/event">;
1091
+ version: Type.TLiteral<1>;
1092
+ seq: Type.TInteger;
1093
+ at: Type.TString;
1094
+ kind: Type.TLiteral<"mcp/server_start">;
1095
+ data: Type.TObject<{
1096
+ server: Type.TString;
1097
+ command_sha256: Type.TString;
1098
+ pid: Type.TInteger;
1099
+ transport: Type.TUnion<[Type.TLiteral<"stdio">, Type.TLiteral<"http">]>;
1100
+ coverage: Type.TLiteral<"uncovered">;
1101
+ }>;
1102
+ }>, Type.TObject<{
1103
+ type: Type.TLiteral<"codepunk/event">;
1104
+ version: Type.TLiteral<1>;
1105
+ seq: Type.TInteger;
1106
+ at: Type.TString;
1107
+ kind: Type.TLiteral<"skill/loaded">;
1108
+ data: Type.TObject<{
1109
+ skills: Type.TArray<Type.TObject<{
1110
+ name: Type.TString;
1111
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
1112
+ sha256: Type.TString;
1113
+ bytes: Type.TInteger;
1114
+ }>>;
1115
+ block_sha256: Type.TString;
1116
+ }>;
1117
+ }>, Type.TObject<{
1118
+ type: Type.TLiteral<"codepunk/event">;
1119
+ version: Type.TLiteral<1>;
1120
+ seq: Type.TInteger;
1121
+ at: Type.TString;
1122
+ kind: Type.TLiteral<"skill/invoked">;
1123
+ data: Type.TObject<{
1124
+ name: Type.TString;
1125
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
1126
+ sha256: Type.TString;
1127
+ bytes: Type.TInteger;
1128
+ }>;
1129
+ }>, Type.TObject<{
1130
+ type: Type.TLiteral<"codepunk/event">;
1131
+ version: Type.TLiteral<1>;
1132
+ seq: Type.TInteger;
1133
+ at: Type.TString;
1134
+ kind: Type.TLiteral<"plan/update">;
1135
+ data: Type.TObject<{
1136
+ run_id: Type.TString;
1137
+ steps: Type.TArray<Type.TObject<{
1138
+ step: Type.TString;
1139
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
1140
+ }>>;
1141
+ explanation: Type.TUnion<[Type.TString, Type.TNull]>;
1142
+ updated_at: Type.TString;
1143
+ sha256: Type.TString;
1144
+ }>;
1145
+ }>, Type.TObject<{
1146
+ type: Type.TLiteral<"codepunk/event">;
1147
+ version: Type.TLiteral<1>;
1148
+ seq: Type.TInteger;
1149
+ at: Type.TString;
1150
+ kind: Type.TLiteral<"todo/update">;
1151
+ data: Type.TObject<{
1152
+ run_id: Type.TString;
1153
+ items: Type.TArray<Type.TObject<{
1154
+ content: Type.TString;
1155
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
1156
+ }>>;
1157
+ updated_at: Type.TString;
1158
+ sha256: Type.TString;
1159
+ }>;
1160
+ }>, Type.TObject<{
1161
+ type: Type.TLiteral<"codepunk/event">;
1162
+ version: Type.TLiteral<1>;
1163
+ seq: Type.TInteger;
1164
+ at: Type.TString;
1165
+ kind: Type.TLiteral<"autonomy/profile">;
1166
+ data: Type.TObject<{
1167
+ profile: Type.TUnion<[Type.TLiteral<"read-only">, Type.TLiteral<"ask">, Type.TLiteral<"scoped">]>;
1168
+ source: Type.TUnion<[Type.TLiteral<"cli">, Type.TLiteral<"user-config">, Type.TLiteral<"default">]>;
1169
+ rules_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1170
+ rules: Type.TArray<Type.TObject<{
1171
+ id: Type.TString;
1172
+ argv: Type.TArray<Type.TString>;
1173
+ cwd: Type.TString;
1174
+ executable_sha256: Type.TString;
1175
+ rule_sha256: Type.TString;
1176
+ }>>;
1177
+ }>;
1178
+ }>, Type.TObject<{
1179
+ type: Type.TLiteral<"codepunk/event">;
1180
+ version: Type.TLiteral<1>;
1181
+ seq: Type.TInteger;
1182
+ at: Type.TString;
1183
+ kind: Type.TLiteral<"autonomy/revoked">;
1184
+ data: Type.TObject<{
1185
+ profile: Type.TUnion<[Type.TLiteral<"read-only">, Type.TLiteral<"ask">, Type.TLiteral<"scoped">]>;
1186
+ reason: Type.TLiteral<"session_end">;
1187
+ }>;
1188
+ }>, Type.TObject<{
1189
+ type: Type.TLiteral<"codepunk/event">;
1190
+ version: Type.TLiteral<1>;
1191
+ seq: Type.TInteger;
1192
+ at: Type.TString;
1193
+ kind: Type.TLiteral<"subagent/result">;
1194
+ data: Type.TObject<{
1195
+ run_id: Type.TString;
1196
+ parent_session_id: Type.TString;
1197
+ child_session_id: Type.TString;
1198
+ depth: Type.TInteger;
1199
+ isolation: Type.TUnion<[Type.TLiteral<"worktree">, Type.TLiteral<"shared">]>;
1200
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1201
+ status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"stopped">]>;
1202
+ summary: Type.TString;
1203
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
1204
+ child_run_id: Type.TUnion<[Type.TString, Type.TNull]>;
1205
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
1206
+ error: Type.TUnion<[Type.TString, Type.TNull]>;
1207
+ profile: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1208
+ profile_sha256: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1209
+ worktree: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1210
+ base_commit: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1211
+ transcript_path: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1212
+ changed_files: Type.TOptional<Type.TUnion<[Type.TInteger, Type.TNull]>>;
1213
+ }>;
1214
+ }>, Type.TObject<{
1215
+ type: Type.TLiteral<"codepunk/event">;
1216
+ version: Type.TLiteral<1>;
1217
+ seq: Type.TInteger;
1218
+ at: Type.TString;
1219
+ kind: Type.TLiteral<"plugin/started">;
1220
+ data: Type.TObject<{
1221
+ plugin_id: Type.TString;
1222
+ version: Type.TString;
1223
+ manifest_sha256: Type.TString;
1224
+ pid: Type.TInteger;
1225
+ credential_verified: Type.TBoolean;
1226
+ started_at: Type.TString;
1227
+ }>;
1228
+ }>, Type.TObject<{
1229
+ type: Type.TLiteral<"codepunk/event">;
1230
+ version: Type.TLiteral<1>;
1231
+ seq: Type.TInteger;
1232
+ at: Type.TString;
1233
+ kind: Type.TLiteral<"plugin/tool_call">;
1234
+ data: Type.TObject<{
1235
+ run_id: Type.TString;
1236
+ tool_call_id: Type.TString;
1237
+ plugin_id: Type.TString;
1238
+ plugin_manifest_sha256: Type.TString;
1239
+ executor: Type.TLiteral<"child-host">;
1240
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1241
+ approval: Type.TUnion<[Type.TObject<{
1242
+ channel: Type.TString;
1243
+ request_id: Type.TString;
1244
+ nonce_sha256: Type.TString;
1245
+ ttl_ms: Type.TInteger;
1246
+ worker_id: Type.TString;
1247
+ session_id: Type.TString;
1248
+ tool_call_id: Type.TString;
1249
+ answer: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"deny">]>;
1250
+ scope: Type.TOptional<Type.TUnion<[Type.TLiteral<"once">, Type.TLiteral<"session">, Type.TLiteral<"persistent">]>>;
1251
+ guidance: Type.TOptional<Type.TString>;
1252
+ reused_from_request_id: Type.TOptional<Type.TString>;
1253
+ args_sha256: Type.TOptional<Type.TString>;
1254
+ diff_sha256: Type.TOptional<Type.TString>;
1255
+ }>, Type.TNull]>;
1256
+ outcome: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"denied">, Type.TLiteral<"cancelled">]>;
1257
+ reason: Type.TUnion<[Type.TString, Type.TNull]>;
1258
+ }>;
1259
+ }>, Type.TObject<{
1260
+ type: Type.TLiteral<"codepunk/event">;
1261
+ version: Type.TLiteral<1>;
1262
+ seq: Type.TInteger;
1263
+ at: Type.TString;
1264
+ kind: Type.TLiteral<"plugin/stopped">;
1265
+ data: Type.TObject<{
1266
+ plugin_id: Type.TString;
1267
+ pid: Type.TInteger;
1268
+ credential_verified: Type.TBoolean;
1269
+ reason: Type.TUnion<[Type.TLiteral<"exit">, Type.TLiteral<"crash">, Type.TLiteral<"timeout">, Type.TLiteral<"cancel">, Type.TLiteral<"shutdown">, Type.TLiteral<"error">]>;
1270
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
1271
+ stopped_at: Type.TString;
1272
+ }>;
1273
+ }>]>;
1274
+ export type SessionEvent = Static<typeof SessionEventSchema>;
1275
+ export type RunStartEvent = Static<typeof RunStartEventSchema>;
1276
+ export type UserInputEvent = Static<typeof UserInputEventSchema>;
1277
+ export type SessionForkedEvent = Static<typeof SessionForkedEventSchema>;
1278
+ export type SessionTreeEvent = Static<typeof SessionTreeEventSchema>;
1279
+ export type ApprovalAnswerEvent = Static<typeof ApprovalAnswerEventSchema>;
1280
+ export type BashResultEvent = Static<typeof BashResultEventSchema>;
1281
+ export type CommitCreatedEvent = Static<typeof CommitCreatedEventSchema>;
1282
+ export type CheckpointRestoreEvent = Static<typeof CheckpointRestoreEventSchema>;
1283
+ export type ContextLoadedEvent = Static<typeof ContextLoadedEventSchema>;
1284
+ export type CompactionDecisionEvent = Static<typeof CompactionDecisionEventSchema>;
1285
+ export type ContextRequestEvent = Static<typeof ContextRequestEventSchema>;
1286
+ export type RunEndEvent = Static<typeof RunEndEventSchema>;
1287
+ export type SignOffEvent = Static<typeof SignOffEventSchema>;
1288
+ export type MemoryWriteEvent = Static<typeof MemoryWriteEventSchema>;
1289
+ export type MemoryRetrieveEvent = Static<typeof MemoryRetrieveEventSchema>;
1290
+ export type ModelChangeEvent = Static<typeof ModelChangeEventSchema>;
1291
+ export type ModelUsageEvent = Static<typeof ModelUsageEventSchema>;
1292
+ export type ModelFallbackEvent = Static<typeof ModelFallbackEventSchema>;
1293
+ export type ModelRetryStartEvent = Static<typeof ModelRetryStartEventSchema>;
1294
+ export type ModelRetryEndEvent = Static<typeof ModelRetryEndEventSchema>;
1295
+ export type BudgetExceededEvent = Static<typeof BudgetExceededEventSchema>;
1296
+ export type LoopGuardEvent = Static<typeof LoopGuardEventSchema>;
1297
+ export type NetworkRequestEvent = Static<typeof NetworkRequestEventSchema>;
1298
+ export type NetworkRedirectEvent = Static<typeof NetworkRedirectEventSchema>;
1299
+ export type NetworkRejectedEvent = Static<typeof NetworkRejectedEventSchema>;
1300
+ export type McpServerStartEvent = Static<typeof McpServerStartEventSchema>;
1301
+ export type SkillLoadedEvent = Static<typeof SkillLoadedEventSchema>;
1302
+ export type SkillInvokedEvent = Static<typeof SkillInvokedEventSchema>;
1303
+ export type AutonomyProfileEvent = Static<typeof AutonomyProfileEventSchema>;
1304
+ export type AutonomyRevokedEvent = Static<typeof AutonomyRevokedEventSchema>;
1305
+ export type SubagentResultEvent = Static<typeof SubagentResultEventSchema>;
1306
+ export type PluginStartedEvent = Static<typeof PluginStartedEventSchema>;
1307
+ export type PluginToolCallEvent = Static<typeof PluginToolCallEventSchema>;
1308
+ export type PluginStoppedEvent = Static<typeof PluginStoppedEventSchema>;
1309
+ export declare const SessionRecordSchema: Type.TUnion<[Type.TObject<{
1310
+ type: Type.TLiteral<"codepunk/session">;
1311
+ version: Type.TLiteral<1>;
1312
+ id: Type.TString;
1313
+ project_id: Type.TString;
1314
+ cwd: Type.TString;
1315
+ created_at: Type.TString;
1316
+ pi_version: Type.TString;
1317
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1318
+ parent_session_id: Type.TOptional<Type.TString>;
1319
+ fork_entry_id: Type.TOptional<Type.TString>;
1320
+ }>, Type.TUnion<[Type.TObject<{
1321
+ type: Type.TLiteral<"codepunk/event">;
1322
+ version: Type.TLiteral<1>;
1323
+ seq: Type.TInteger;
1324
+ at: Type.TString;
1325
+ kind: Type.TLiteral<"run/start">;
1326
+ data: Type.TObject<{
1327
+ run_id: Type.TString;
1328
+ session_id: Type.TString;
1329
+ }>;
1330
+ }>, Type.TObject<{
1331
+ type: Type.TLiteral<"codepunk/event">;
1332
+ version: Type.TLiteral<1>;
1333
+ seq: Type.TInteger;
1334
+ at: Type.TString;
1335
+ kind: Type.TLiteral<"user/input">;
1336
+ data: Type.TObject<{
1337
+ run_id: Type.TString;
1338
+ text: Type.TString;
1339
+ }>;
1340
+ }>, Type.TObject<{
1341
+ type: Type.TLiteral<"codepunk/event">;
1342
+ version: Type.TLiteral<1>;
1343
+ seq: Type.TInteger;
1344
+ at: Type.TString;
1345
+ kind: Type.TLiteral<"session/forked">;
1346
+ data: Type.TObject<{
1347
+ parent_session_id: Type.TString;
1348
+ parent_last_seq: Type.TInteger;
1349
+ parent_state_covers_seq: Type.TInteger;
1350
+ parent_state_sha256: Type.TString;
1351
+ fork_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
1352
+ mode: Type.TUnion<[Type.TLiteral<"clone">, Type.TLiteral<"live">]>;
1353
+ }>;
1354
+ }>, Type.TObject<{
1355
+ type: Type.TLiteral<"codepunk/event">;
1356
+ version: Type.TLiteral<1>;
1357
+ seq: Type.TInteger;
1358
+ at: Type.TString;
1359
+ kind: Type.TLiteral<"session/tree">;
1360
+ data: Type.TObject<{
1361
+ action: Type.TLiteral<"navigate">;
1362
+ from_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
1363
+ to_entry_id: Type.TUnion<[Type.TString, Type.TNull]>;
1364
+ target_entry_id: Type.TOptional<Type.TString>;
1365
+ branch_entries: Type.TInteger;
1366
+ }>;
1367
+ }>, Type.TObject<{
1368
+ type: Type.TLiteral<"codepunk/event">;
1369
+ version: Type.TLiteral<1>;
1370
+ seq: Type.TInteger;
1371
+ at: Type.TString;
1372
+ kind: Type.TLiteral<"approval/answer">;
1373
+ data: Type.TObject<{
1374
+ request_id: Type.TString;
1375
+ answer: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"deny">]>;
1376
+ scope: Type.TOptional<Type.TUnion<[Type.TLiteral<"once">, Type.TLiteral<"session">, Type.TLiteral<"persistent">]>>;
1377
+ guidance: Type.TOptional<Type.TString>;
1378
+ channel: Type.TString;
1379
+ channel_id: Type.TString;
1380
+ nonce_sha256: Type.TString;
1381
+ worker_id: Type.TString;
1382
+ session_id: Type.TString;
1383
+ tool_call_id: Type.TString;
1384
+ answered_at: Type.TString;
1385
+ }>;
1386
+ }>, Type.TObject<{
1387
+ type: Type.TLiteral<"codepunk/event">;
1388
+ version: Type.TLiteral<1>;
1389
+ seq: Type.TInteger;
1390
+ at: Type.TString;
1391
+ kind: Type.TLiteral<"bash/result">;
1392
+ data: Type.TObject<{
1393
+ run_id: Type.TString;
1394
+ command: Type.TString;
1395
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
1396
+ output_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1397
+ cancelled: Type.TBoolean;
1398
+ }>;
1399
+ }>, Type.TObject<{
1400
+ type: Type.TLiteral<"codepunk/event">;
1401
+ version: Type.TLiteral<1>;
1402
+ seq: Type.TInteger;
1403
+ at: Type.TString;
1404
+ kind: Type.TLiteral<"commit/created">;
1405
+ data: Type.TObject<{
1406
+ run_id: Type.TString;
1407
+ commit: Type.TString;
1408
+ previous_commit: Type.TUnion<[Type.TString, Type.TNull]>;
1409
+ tree: Type.TString;
1410
+ message_sha256: Type.TString;
1411
+ message_bytes: Type.TInteger;
1412
+ files: Type.TArray<Type.TString>;
1413
+ stage: Type.TUnion<[Type.TLiteral<"staged">, Type.TLiteral<"tracked">, Type.TLiteral<"all">]>;
1414
+ root: Type.TString;
1415
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
1416
+ }>;
1417
+ }>, Type.TObject<{
1418
+ type: Type.TLiteral<"codepunk/event">;
1419
+ version: Type.TLiteral<1>;
1420
+ seq: Type.TInteger;
1421
+ at: Type.TString;
1422
+ kind: Type.TLiteral<"checkpoint/restore">;
1423
+ data: Type.TObject<{
1424
+ action: Type.TUnion<[Type.TLiteral<"undo">, Type.TLiteral<"redo">]>;
1425
+ checkpoint_id: Type.TString;
1426
+ tool_call_id: Type.TString;
1427
+ target: Type.TString;
1428
+ from_sha256: Type.TString;
1429
+ to_sha256: Type.TString;
1430
+ }>;
1431
+ }>, Type.TObject<{
1432
+ type: Type.TLiteral<"codepunk/event">;
1433
+ version: Type.TLiteral<1>;
1434
+ seq: Type.TInteger;
1435
+ at: Type.TString;
1436
+ kind: Type.TLiteral<"context/loaded">;
1437
+ data: Type.TObject<{
1438
+ sources: Type.TArray<Type.TObject<{
1439
+ rank: Type.TInteger;
1440
+ kind: Type.TUnion<[Type.TLiteral<"user-instructions">, Type.TLiteral<"project-instructions">, Type.TLiteral<"append">]>;
1441
+ source: Type.TString;
1442
+ sha256: Type.TString;
1443
+ bytes: Type.TInteger;
1444
+ truncated: Type.TBoolean;
1445
+ }>>;
1446
+ warnings: Type.TArray<Type.TString>;
1447
+ total_bytes: Type.TInteger;
1448
+ truncated: Type.TBoolean;
1449
+ }>;
1450
+ }>, Type.TObject<{
1451
+ type: Type.TLiteral<"codepunk/event">;
1452
+ version: Type.TLiteral<1>;
1453
+ seq: Type.TInteger;
1454
+ at: Type.TString;
1455
+ kind: Type.TLiteral<"trust/decision">;
1456
+ data: Type.TObject<{
1457
+ cwd: Type.TString;
1458
+ root: Type.TString;
1459
+ decision: Type.TUnion<[Type.TLiteral<"trusted">, Type.TLiteral<"untrusted">]>;
1460
+ mode: Type.TOptional<Type.TUnion<[Type.TLiteral<"all">, Type.TLiteral<"custom">, Type.TLiteral<"none">]>>;
1461
+ source: Type.TUnion<[Type.TLiteral<"flag">, Type.TLiteral<"saved">, Type.TLiteral<"prompt">, Type.TLiteral<"default">, Type.TLiteral<"no-resources">]>;
1462
+ resources: Type.TArray<Type.TString>;
1463
+ skipped: Type.TArray<Type.TString>;
1464
+ grants: Type.TOptional<Type.TObject<{
1465
+ config: Type.TBoolean;
1466
+ policy: Type.TBoolean;
1467
+ skills: Type.TBoolean;
1468
+ instructions: Type.TBoolean;
1469
+ }>>;
1470
+ available: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"config">, Type.TLiteral<"policy">, Type.TLiteral<"skills">, Type.TLiteral<"instructions">]>>>;
1471
+ }>;
1472
+ }>, Type.TObject<{
1473
+ type: Type.TLiteral<"codepunk/event">;
1474
+ version: Type.TLiteral<1>;
1475
+ seq: Type.TInteger;
1476
+ at: Type.TString;
1477
+ kind: Type.TLiteral<"compaction/decision">;
1478
+ data: Type.TObject<{
1479
+ run_id: Type.TString;
1480
+ reason: Type.TUnion<[Type.TLiteral<"manual">, Type.TLiteral<"threshold">, Type.TLiteral<"overflow">]>;
1481
+ cancelled: Type.TBoolean;
1482
+ entries: Type.TInteger;
1483
+ keep_recent_tokens: Type.TInteger;
1484
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
1485
+ failure: Type.TOptional<Type.TString>;
1486
+ checkpoint: Type.TOptional<Type.TObject<{
1487
+ compaction_entry_id: Type.TString;
1488
+ first_kept_entry_id: Type.TString;
1489
+ summary_sha256: Type.TString;
1490
+ summary_bytes: Type.TInteger;
1491
+ tokens_before: Type.TInteger;
1492
+ messages_before: Type.TInteger;
1493
+ messages_after: Type.TInteger;
1494
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1495
+ loadout_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1496
+ tool_names: Type.TArray<Type.TString>;
1497
+ usage: Type.TOptional<Type.TObject<{
1498
+ input_tokens: Type.TInteger;
1499
+ output_tokens: Type.TInteger;
1500
+ cache_read_tokens: Type.TInteger;
1501
+ cache_write_tokens: Type.TInteger;
1502
+ total_tokens: Type.TInteger;
1503
+ cost_total: Type.TNumber;
1504
+ }>>;
1505
+ }>>;
1506
+ }>;
1507
+ }>, Type.TObject<{
1508
+ type: Type.TLiteral<"codepunk/event">;
1509
+ version: Type.TLiteral<1>;
1510
+ seq: Type.TInteger;
1511
+ at: Type.TString;
1512
+ kind: Type.TLiteral<"context/request">;
1513
+ data: Type.TObject<{
1514
+ run_id: Type.TString;
1515
+ request_id: Type.TString;
1516
+ message_ids: Type.TArray<Type.TString>;
1517
+ omitted: Type.TObject<{
1518
+ ids: Type.TArray<Type.TString>;
1519
+ ranges: Type.TArray<Type.TObject<{
1520
+ start: Type.TInteger;
1521
+ end: Type.TInteger;
1522
+ }>>;
1523
+ }>;
1524
+ truncation_sha256: Type.TString;
1525
+ provider: Type.TString;
1526
+ model: Type.TString;
1527
+ token_estimate: Type.TInteger;
1528
+ compaction_id: Type.TUnion<[Type.TString, Type.TNull]>;
1529
+ }>;
1530
+ }>, Type.TObject<{
1531
+ type: Type.TLiteral<"codepunk/event">;
1532
+ version: Type.TLiteral<1>;
1533
+ seq: Type.TInteger;
1534
+ at: Type.TString;
1535
+ kind: Type.TLiteral<"run/end">;
1536
+ data: Type.TObject<{
1537
+ run_id: Type.TString;
1538
+ state: Type.TUnion<[Type.TLiteral<"settled">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">, Type.TLiteral<"cancelled">]>;
1539
+ termination: Type.TUnion<[Type.TString, Type.TNull]>;
1540
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
1541
+ actor: Type.TString;
1542
+ }>;
1543
+ }>, Type.TObject<{
1544
+ type: Type.TLiteral<"codepunk/event">;
1545
+ version: Type.TLiteral<1>;
1546
+ seq: Type.TInteger;
1547
+ at: Type.TString;
1548
+ kind: Type.TLiteral<"verdict/sign_off">;
1549
+ data: Type.TObject<{
1550
+ sign_off_id: Type.TString;
1551
+ previous_sign_off_id: Type.TUnion<[Type.TString, Type.TNull]>;
1552
+ run_id: Type.TString;
1553
+ evidence_head: Type.TString;
1554
+ signed_verdict: Type.TUnion<[Type.TLiteral<"complete">, Type.TLiteral<"incomplete">]>;
1555
+ channel: Type.TUnion<[Type.TLiteral<"tui">, Type.TLiteral<"cli">]>;
1556
+ actor: Type.TString;
1557
+ signed_at: Type.TString;
1558
+ }>;
1559
+ }>, Type.TObject<{
1560
+ type: Type.TLiteral<"codepunk/event">;
1561
+ version: Type.TLiteral<1>;
1562
+ seq: Type.TInteger;
1563
+ at: Type.TString;
1564
+ kind: Type.TLiteral<"memory/write">;
1565
+ data: Type.TObject<{
1566
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
1567
+ action: Type.TUnion<[Type.TLiteral<"add">, Type.TLiteral<"edit">, Type.TLiteral<"delete">, Type.TLiteral<"archive">, Type.TLiteral<"reject">]>;
1568
+ memory_id: Type.TUnion<[Type.TString, Type.TNull]>;
1569
+ content_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1570
+ source_refs: Type.TArray<Type.TString>;
1571
+ reason: Type.TUnion<[Type.TString, Type.TNull]>;
1572
+ }>;
1573
+ }>, Type.TObject<{
1574
+ type: Type.TLiteral<"codepunk/event">;
1575
+ version: Type.TLiteral<1>;
1576
+ seq: Type.TInteger;
1577
+ at: Type.TString;
1578
+ kind: Type.TLiteral<"memory/retrieve">;
1579
+ data: Type.TObject<{
1580
+ ids: Type.TArray<Type.TString>;
1581
+ hashes: Type.TArray<Type.TString>;
1582
+ cap: Type.TInteger;
1583
+ truncated: Type.TBoolean;
1584
+ digest_sha256: Type.TString;
1585
+ }>;
1586
+ }>, Type.TObject<{
1587
+ type: Type.TLiteral<"codepunk/event">;
1588
+ version: Type.TLiteral<1>;
1589
+ seq: Type.TInteger;
1590
+ at: Type.TString;
1591
+ kind: Type.TLiteral<"model/change">;
1592
+ data: Type.TObject<{
1593
+ previous: Type.TUnion<[Type.TString, Type.TNull]>;
1594
+ model: Type.TString;
1595
+ thinking: Type.TUnion<[Type.TString, Type.TNull]>;
1596
+ }>;
1597
+ }>, Type.TObject<{
1598
+ type: Type.TLiteral<"codepunk/event">;
1599
+ version: Type.TLiteral<1>;
1600
+ seq: Type.TInteger;
1601
+ at: Type.TString;
1602
+ kind: Type.TLiteral<"model/usage">;
1603
+ data: Type.TObject<{
1604
+ run_id: Type.TString;
1605
+ provider: Type.TString;
1606
+ model: Type.TString;
1607
+ input_tokens: Type.TInteger;
1608
+ output_tokens: Type.TInteger;
1609
+ cache_read_tokens: Type.TInteger;
1610
+ cache_write_tokens: Type.TInteger;
1611
+ total_tokens: Type.TInteger;
1612
+ cost_total: Type.TNumber;
1613
+ stop_reason: Type.TString;
1614
+ source: Type.TOptional<Type.TUnion<[Type.TLiteral<"assistant">, Type.TLiteral<"summary">]>>;
1615
+ }>;
1616
+ }>, Type.TObject<{
1617
+ type: Type.TLiteral<"codepunk/event">;
1618
+ version: Type.TLiteral<1>;
1619
+ seq: Type.TInteger;
1620
+ at: Type.TString;
1621
+ kind: Type.TLiteral<"model/fallback">;
1622
+ data: Type.TObject<{
1623
+ from: Type.TString;
1624
+ to: Type.TUnion<[Type.TString, Type.TNull]>;
1625
+ reason: Type.TLiteral<"error">;
1626
+ stop_reason: Type.TUnion<[Type.TString, Type.TNull]>;
1627
+ attempted: Type.TArray<Type.TString>;
1628
+ exhausted: Type.TBoolean;
1629
+ chain_sha256: Type.TString;
1630
+ }>;
1631
+ }>, Type.TObject<{
1632
+ type: Type.TLiteral<"codepunk/event">;
1633
+ version: Type.TLiteral<1>;
1634
+ seq: Type.TInteger;
1635
+ at: Type.TString;
1636
+ kind: Type.TLiteral<"model/retry_start">;
1637
+ data: Type.TObject<{
1638
+ run_id: Type.TString;
1639
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1640
+ attempt: Type.TInteger;
1641
+ max_attempts: Type.TInteger;
1642
+ delay_ms: Type.TInteger;
1643
+ error_sha256: Type.TString;
1644
+ error_preview: Type.TString;
1645
+ }>;
1646
+ }>, Type.TObject<{
1647
+ type: Type.TLiteral<"codepunk/event">;
1648
+ version: Type.TLiteral<1>;
1649
+ seq: Type.TInteger;
1650
+ at: Type.TString;
1651
+ kind: Type.TLiteral<"model/retry_end">;
1652
+ data: Type.TObject<{
1653
+ run_id: Type.TString;
1654
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1655
+ attempt: Type.TInteger;
1656
+ success: Type.TBoolean;
1657
+ final_error_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1658
+ final_error_preview: Type.TUnion<[Type.TString, Type.TNull]>;
1659
+ }>;
1660
+ }>, Type.TObject<{
1661
+ type: Type.TLiteral<"codepunk/event">;
1662
+ version: Type.TLiteral<1>;
1663
+ seq: Type.TInteger;
1664
+ at: Type.TString;
1665
+ kind: Type.TLiteral<"budget/exceeded">;
1666
+ data: Type.TObject<{
1667
+ run_id: Type.TString;
1668
+ limit_kind: Type.TUnion<[Type.TLiteral<"tool_calls">, Type.TLiteral<"wall_ms">, Type.TLiteral<"tokens">, Type.TLiteral<"cost">]>;
1669
+ limit: Type.TNumber;
1670
+ used: Type.TNumber;
1671
+ action: Type.TUnion<[Type.TLiteral<"reject_call">, Type.TLiteral<"abort_run">]>;
1672
+ }>;
1673
+ }>, Type.TObject<{
1674
+ type: Type.TLiteral<"codepunk/event">;
1675
+ version: Type.TLiteral<1>;
1676
+ seq: Type.TInteger;
1677
+ at: Type.TString;
1678
+ kind: Type.TLiteral<"loop_guard">;
1679
+ data: Type.TObject<{
1680
+ run_id: Type.TString;
1681
+ tool: Type.TString;
1682
+ canonical_argv: Type.TArray<Type.TString>;
1683
+ cwd: Type.TString;
1684
+ repeat_count: Type.TInteger;
1685
+ threshold: Type.TInteger;
1686
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1687
+ }>;
1688
+ }>, Type.TObject<{
1689
+ type: Type.TLiteral<"codepunk/event">;
1690
+ version: Type.TLiteral<1>;
1691
+ seq: Type.TInteger;
1692
+ at: Type.TString;
1693
+ kind: Type.TLiteral<"network/request">;
1694
+ data: Type.TObject<{
1695
+ run_id: Type.TString;
1696
+ domain: Type.TString;
1697
+ requests: Type.TInteger;
1698
+ bytes: Type.TInteger;
1699
+ limit: Type.TObject<{
1700
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
1701
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
1702
+ }>;
1703
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1704
+ }>;
1705
+ }>, Type.TObject<{
1706
+ type: Type.TLiteral<"codepunk/event">;
1707
+ version: Type.TLiteral<1>;
1708
+ seq: Type.TInteger;
1709
+ at: Type.TString;
1710
+ kind: Type.TLiteral<"network/redirect">;
1711
+ data: Type.TObject<{
1712
+ run_id: Type.TString;
1713
+ from: Type.TString;
1714
+ to: Type.TString;
1715
+ status: Type.TInteger;
1716
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1717
+ }>;
1718
+ }>, Type.TObject<{
1719
+ type: Type.TLiteral<"codepunk/event">;
1720
+ version: Type.TLiteral<1>;
1721
+ seq: Type.TInteger;
1722
+ at: Type.TString;
1723
+ kind: Type.TLiteral<"network/rejected">;
1724
+ data: Type.TObject<{
1725
+ run_id: Type.TString;
1726
+ domain: Type.TString;
1727
+ reason: Type.TString;
1728
+ limit: Type.TObject<{
1729
+ max_requests: Type.TUnion<[Type.TInteger, Type.TNull]>;
1730
+ max_bytes: Type.TUnion<[Type.TInteger, Type.TNull]>;
1731
+ }>;
1732
+ }>;
1733
+ }>, Type.TObject<{
1734
+ type: Type.TLiteral<"codepunk/event">;
1735
+ version: Type.TLiteral<1>;
1736
+ seq: Type.TInteger;
1737
+ at: Type.TString;
1738
+ kind: Type.TLiteral<"mcp/server_start">;
1739
+ data: Type.TObject<{
1740
+ server: Type.TString;
1741
+ command_sha256: Type.TString;
1742
+ pid: Type.TInteger;
1743
+ transport: Type.TUnion<[Type.TLiteral<"stdio">, Type.TLiteral<"http">]>;
1744
+ coverage: Type.TLiteral<"uncovered">;
1745
+ }>;
1746
+ }>, Type.TObject<{
1747
+ type: Type.TLiteral<"codepunk/event">;
1748
+ version: Type.TLiteral<1>;
1749
+ seq: Type.TInteger;
1750
+ at: Type.TString;
1751
+ kind: Type.TLiteral<"skill/loaded">;
1752
+ data: Type.TObject<{
1753
+ skills: Type.TArray<Type.TObject<{
1754
+ name: Type.TString;
1755
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
1756
+ sha256: Type.TString;
1757
+ bytes: Type.TInteger;
1758
+ }>>;
1759
+ block_sha256: Type.TString;
1760
+ }>;
1761
+ }>, Type.TObject<{
1762
+ type: Type.TLiteral<"codepunk/event">;
1763
+ version: Type.TLiteral<1>;
1764
+ seq: Type.TInteger;
1765
+ at: Type.TString;
1766
+ kind: Type.TLiteral<"skill/invoked">;
1767
+ data: Type.TObject<{
1768
+ name: Type.TString;
1769
+ scope: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"project">]>;
1770
+ sha256: Type.TString;
1771
+ bytes: Type.TInteger;
1772
+ }>;
1773
+ }>, Type.TObject<{
1774
+ type: Type.TLiteral<"codepunk/event">;
1775
+ version: Type.TLiteral<1>;
1776
+ seq: Type.TInteger;
1777
+ at: Type.TString;
1778
+ kind: Type.TLiteral<"plan/update">;
1779
+ data: Type.TObject<{
1780
+ run_id: Type.TString;
1781
+ steps: Type.TArray<Type.TObject<{
1782
+ step: Type.TString;
1783
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
1784
+ }>>;
1785
+ explanation: Type.TUnion<[Type.TString, Type.TNull]>;
1786
+ updated_at: Type.TString;
1787
+ sha256: Type.TString;
1788
+ }>;
1789
+ }>, Type.TObject<{
1790
+ type: Type.TLiteral<"codepunk/event">;
1791
+ version: Type.TLiteral<1>;
1792
+ seq: Type.TInteger;
1793
+ at: Type.TString;
1794
+ kind: Type.TLiteral<"todo/update">;
1795
+ data: Type.TObject<{
1796
+ run_id: Type.TString;
1797
+ items: Type.TArray<Type.TObject<{
1798
+ content: Type.TString;
1799
+ status: Type.TUnion<[Type.TLiteral<"pending">, Type.TLiteral<"in_progress">, Type.TLiteral<"completed">]>;
1800
+ }>>;
1801
+ updated_at: Type.TString;
1802
+ sha256: Type.TString;
1803
+ }>;
1804
+ }>, Type.TObject<{
1805
+ type: Type.TLiteral<"codepunk/event">;
1806
+ version: Type.TLiteral<1>;
1807
+ seq: Type.TInteger;
1808
+ at: Type.TString;
1809
+ kind: Type.TLiteral<"autonomy/profile">;
1810
+ data: Type.TObject<{
1811
+ profile: Type.TUnion<[Type.TLiteral<"read-only">, Type.TLiteral<"ask">, Type.TLiteral<"scoped">]>;
1812
+ source: Type.TUnion<[Type.TLiteral<"cli">, Type.TLiteral<"user-config">, Type.TLiteral<"default">]>;
1813
+ rules_sha256: Type.TUnion<[Type.TString, Type.TNull]>;
1814
+ rules: Type.TArray<Type.TObject<{
1815
+ id: Type.TString;
1816
+ argv: Type.TArray<Type.TString>;
1817
+ cwd: Type.TString;
1818
+ executable_sha256: Type.TString;
1819
+ rule_sha256: Type.TString;
1820
+ }>>;
1821
+ }>;
1822
+ }>, Type.TObject<{
1823
+ type: Type.TLiteral<"codepunk/event">;
1824
+ version: Type.TLiteral<1>;
1825
+ seq: Type.TInteger;
1826
+ at: Type.TString;
1827
+ kind: Type.TLiteral<"autonomy/revoked">;
1828
+ data: Type.TObject<{
1829
+ profile: Type.TUnion<[Type.TLiteral<"read-only">, Type.TLiteral<"ask">, Type.TLiteral<"scoped">]>;
1830
+ reason: Type.TLiteral<"session_end">;
1831
+ }>;
1832
+ }>, Type.TObject<{
1833
+ type: Type.TLiteral<"codepunk/event">;
1834
+ version: Type.TLiteral<1>;
1835
+ seq: Type.TInteger;
1836
+ at: Type.TString;
1837
+ kind: Type.TLiteral<"subagent/result">;
1838
+ data: Type.TObject<{
1839
+ run_id: Type.TString;
1840
+ parent_session_id: Type.TString;
1841
+ child_session_id: Type.TString;
1842
+ depth: Type.TInteger;
1843
+ isolation: Type.TUnion<[Type.TLiteral<"worktree">, Type.TLiteral<"shared">]>;
1844
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
1845
+ status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"stopped">]>;
1846
+ summary: Type.TString;
1847
+ evidence_head: Type.TUnion<[Type.TString, Type.TNull]>;
1848
+ child_run_id: Type.TUnion<[Type.TString, Type.TNull]>;
1849
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
1850
+ error: Type.TUnion<[Type.TString, Type.TNull]>;
1851
+ profile: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1852
+ profile_sha256: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1853
+ worktree: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1854
+ base_commit: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1855
+ transcript_path: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1856
+ changed_files: Type.TOptional<Type.TUnion<[Type.TInteger, Type.TNull]>>;
1857
+ }>;
1858
+ }>, Type.TObject<{
1859
+ type: Type.TLiteral<"codepunk/event">;
1860
+ version: Type.TLiteral<1>;
1861
+ seq: Type.TInteger;
1862
+ at: Type.TString;
1863
+ kind: Type.TLiteral<"plugin/started">;
1864
+ data: Type.TObject<{
1865
+ plugin_id: Type.TString;
1866
+ version: Type.TString;
1867
+ manifest_sha256: Type.TString;
1868
+ pid: Type.TInteger;
1869
+ credential_verified: Type.TBoolean;
1870
+ started_at: Type.TString;
1871
+ }>;
1872
+ }>, Type.TObject<{
1873
+ type: Type.TLiteral<"codepunk/event">;
1874
+ version: Type.TLiteral<1>;
1875
+ seq: Type.TInteger;
1876
+ at: Type.TString;
1877
+ kind: Type.TLiteral<"plugin/tool_call">;
1878
+ data: Type.TObject<{
1879
+ run_id: Type.TString;
1880
+ tool_call_id: Type.TString;
1881
+ plugin_id: Type.TString;
1882
+ plugin_manifest_sha256: Type.TString;
1883
+ executor: Type.TLiteral<"child-host">;
1884
+ decision: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"ask">, Type.TLiteral<"deny">]>;
1885
+ approval: Type.TUnion<[Type.TObject<{
1886
+ channel: Type.TString;
1887
+ request_id: Type.TString;
1888
+ nonce_sha256: Type.TString;
1889
+ ttl_ms: Type.TInteger;
1890
+ worker_id: Type.TString;
1891
+ session_id: Type.TString;
1892
+ tool_call_id: Type.TString;
1893
+ answer: Type.TUnion<[Type.TLiteral<"allow">, Type.TLiteral<"deny">]>;
1894
+ scope: Type.TOptional<Type.TUnion<[Type.TLiteral<"once">, Type.TLiteral<"session">, Type.TLiteral<"persistent">]>>;
1895
+ guidance: Type.TOptional<Type.TString>;
1896
+ reused_from_request_id: Type.TOptional<Type.TString>;
1897
+ args_sha256: Type.TOptional<Type.TString>;
1898
+ diff_sha256: Type.TOptional<Type.TString>;
1899
+ }>, Type.TNull]>;
1900
+ outcome: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"denied">, Type.TLiteral<"cancelled">]>;
1901
+ reason: Type.TUnion<[Type.TString, Type.TNull]>;
1902
+ }>;
1903
+ }>, Type.TObject<{
1904
+ type: Type.TLiteral<"codepunk/event">;
1905
+ version: Type.TLiteral<1>;
1906
+ seq: Type.TInteger;
1907
+ at: Type.TString;
1908
+ kind: Type.TLiteral<"plugin/stopped">;
1909
+ data: Type.TObject<{
1910
+ plugin_id: Type.TString;
1911
+ pid: Type.TInteger;
1912
+ credential_verified: Type.TBoolean;
1913
+ reason: Type.TUnion<[Type.TLiteral<"exit">, Type.TLiteral<"crash">, Type.TLiteral<"timeout">, Type.TLiteral<"cancel">, Type.TLiteral<"shutdown">, Type.TLiteral<"error">]>;
1914
+ exit_code: Type.TUnion<[Type.TInteger, Type.TNull]>;
1915
+ stopped_at: Type.TString;
1916
+ }>;
1917
+ }>]>]>;
1918
+ export type SessionRecord = Static<typeof SessionRecordSchema>;
1919
+ export declare const SessionMetaSchema: Type.TObject<{
1920
+ version: Type.TLiteral<1>;
1921
+ updated_at: Type.TString;
1922
+ title: Type.TUnion<[Type.TString, Type.TNull]>;
1923
+ pinned: Type.TBoolean;
1924
+ decision_ref: Type.TUnion<[Type.TString, Type.TNull]>;
1925
+ log_seq: Type.TInteger;
1926
+ state_covers_seq: Type.TInteger;
1927
+ }>;
1928
+ export type SessionMeta = Static<typeof SessionMetaSchema>;
1929
+ export declare const AgentStateSchema: Type.TObject<{
1930
+ version: Type.TLiteral<1>;
1931
+ session_version: Type.TInteger;
1932
+ pi_version: Type.TString;
1933
+ session_id: Type.TString;
1934
+ saved_at: Type.TString;
1935
+ header: Type.TUnknown;
1936
+ branch: Type.TArray<Type.TUnknown>;
1937
+ entries: Type.TOptional<Type.TArray<Type.TUnknown>>;
1938
+ leaf_id: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
1939
+ }>;
1940
+ export type AgentState = Static<typeof AgentStateSchema>;
1941
+ //# sourceMappingURL=session.d.ts.map