@roll-agent/runtime 0.7.0 → 0.8.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 (73) hide show
  1. package/dist/bash/classifier/compound.d.ts +2 -1
  2. package/dist/bash/classifier/compound.js +1 -1
  3. package/dist/bash/classifier/flag-audit.js +1 -1
  4. package/dist/bash/classifier/git-audit.d.ts +9 -1
  5. package/dist/bash/classifier/git-audit.js +1 -1
  6. package/dist/bash/classifier/index.d.ts +0 -1
  7. package/dist/bash/classifier/index.js +1 -1
  8. package/dist/bash/classifier/path-audit.d.ts +1 -1
  9. package/dist/bash/classifier/path-audit.js +1 -1
  10. package/dist/bash/classifier/safe-list.d.ts +6 -0
  11. package/dist/bash/classifier/safe-list.js +1 -1
  12. package/dist/bash/clean-env.d.ts +2 -0
  13. package/dist/bash/clean-env.js +1 -1
  14. package/dist/bash/format-result.d.ts +1 -1
  15. package/dist/bash/format-result.js +1 -1
  16. package/dist/bash/profile.js +1 -1
  17. package/dist/bash/session/session-manager.d.ts +1 -0
  18. package/dist/bash/session/session-manager.js +1 -1
  19. package/dist/bash/workdir.js +1 -1
  20. package/dist/engine/agent-session.d.ts +88 -3
  21. package/dist/engine/agent-session.js +1 -1
  22. package/dist/engine/cancelled-turn-recovery.d.ts +34 -0
  23. package/dist/engine/cancelled-turn-recovery.js +1 -0
  24. package/dist/engine/capability-manifest.d.ts +160 -0
  25. package/dist/engine/capability-manifest.js +1 -0
  26. package/dist/engine/compaction-checkpoint.d.ts +3827 -0
  27. package/dist/engine/compaction-checkpoint.js +1 -0
  28. package/dist/engine/compaction-semantic-state.d.ts +1741 -0
  29. package/dist/engine/compaction-semantic-state.js +1 -0
  30. package/dist/engine/compactor.d.ts +35 -3
  31. package/dist/engine/compactor.js +1 -1
  32. package/dist/engine/context-window.js +1 -1
  33. package/dist/engine/conversation-engine.d.ts +17 -4
  34. package/dist/engine/conversation-engine.js +1 -1
  35. package/dist/engine/explicit-skill-context.d.ts +103 -0
  36. package/dist/engine/explicit-skill-context.js +1 -0
  37. package/dist/engine/system-prompt.d.ts +4 -0
  38. package/dist/engine/system-prompt.js +1 -1
  39. package/dist/engine/tool-protocol-repair.d.ts +21 -0
  40. package/dist/engine/tool-protocol-repair.js +1 -0
  41. package/dist/engine/vcs-context.d.ts +3 -0
  42. package/dist/engine/vcs-context.js +1 -0
  43. package/dist/index.d.ts +6 -4
  44. package/dist/index.js +1 -1
  45. package/dist/server/protocol.d.ts +31 -0
  46. package/dist/server/protocol.js +1 -1
  47. package/dist/server/runtime-server.d.ts +21 -1
  48. package/dist/server/runtime-server.js +1 -1
  49. package/dist/store/thread-store.d.ts +96 -0
  50. package/dist/store/thread-store.js +1 -1
  51. package/dist/tool-bridge/agent-install-tool.js +1 -1
  52. package/dist/tool-bridge/bash-tool.d.ts +1 -0
  53. package/dist/tool-bridge/bash-tool.js +1 -1
  54. package/dist/tool-bridge/build-tools.d.ts +10 -1
  55. package/dist/tool-bridge/build-tools.js +1 -1
  56. package/dist/tool-bridge/naming.d.ts +10 -2
  57. package/dist/tool-bridge/naming.js +1 -1
  58. package/dist/tool-bridge/normalize-result.d.ts +73 -1
  59. package/dist/tool-bridge/normalize-result.js +1 -1
  60. package/dist/tool-bridge/session-exec-tool.d.ts +3 -2
  61. package/dist/tool-bridge/session-exec-tool.js +1 -1
  62. package/dist/tool-bridge/skill-tool.d.ts +3 -2
  63. package/dist/tool-bridge/skill-tool.js +1 -1
  64. package/dist/tool-bridge/tool-execution-coordinator.d.ts +69 -0
  65. package/dist/tool-bridge/tool-execution-coordinator.js +1 -0
  66. package/dist/tool-bridge/tool-execution-record.d.ts +148 -0
  67. package/dist/tool-bridge/tool-execution-record.js +1 -0
  68. package/dist/tool-bridge/transcript-tool.d.ts +30 -0
  69. package/dist/tool-bridge/transcript-tool.js +1 -0
  70. package/dist/types/cancellation.d.ts +18 -0
  71. package/dist/types/cancellation.js +1 -1
  72. package/dist/types/events.d.ts +20 -0
  73. package/package.json +2 -2
@@ -0,0 +1,1741 @@
1
+ import { z } from "zod";
2
+ export declare const COMPACTION_SEMANTIC_STATE_VERSION: 1;
3
+ export declare const COMPACTION_PROVENANCE_KINDS: readonly ["message", "tool_execution", "resource", "running_session", "legacy_snapshot"];
4
+ export declare const COMPACTION_SEMANTIC_ITEM_KINDS: readonly ["goal", "constraint", "decision", "completed_work", "pending_work", "resource", "running_session", "uncertainty"];
5
+ export declare const legacyCompactionTranscriptFragmentsSchema: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
6
+ export type LegacyCompactionTranscriptFragments = z.infer<typeof legacyCompactionTranscriptFragmentsSchema>;
7
+ export declare const compactionSemanticItemIdSchema: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
8
+ export type CompactionSemanticItemId = z.infer<typeof compactionSemanticItemIdSchema>;
9
+ /**
10
+ * A single-object representation is deliberate: some structured-output providers
11
+ * cannot reliably emit discriminated unions. Every property is required and the
12
+ * kind-specific nullability invariant is checked after decoding.
13
+ */
14
+ export declare const compactionProvenanceRefSchema: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
15
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
16
+ messageSequence: z.ZodNullable<z.ZodNumber>;
17
+ toolExecutionId: z.ZodNullable<z.ZodString>;
18
+ resourceKey: z.ZodNullable<z.ZodString>;
19
+ managerInstanceId: z.ZodNullable<z.ZodString>;
20
+ sessionId: z.ZodNullable<z.ZodNumber>;
21
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
22
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
23
+ }, "strict", z.ZodTypeAny, {
24
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
25
+ messageSequence: number | null;
26
+ toolExecutionId: string | null;
27
+ resourceKey: string | null;
28
+ managerInstanceId: string | null;
29
+ sessionId: number | null;
30
+ checkpointId: string | null;
31
+ snapshotIndex: number | null;
32
+ }, {
33
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
34
+ messageSequence: number | null;
35
+ toolExecutionId: string | null;
36
+ resourceKey: string | null;
37
+ managerInstanceId: string | null;
38
+ sessionId: number | null;
39
+ checkpointId?: string | null | undefined;
40
+ snapshotIndex?: number | null | undefined;
41
+ }>, {
42
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
43
+ messageSequence: number | null;
44
+ toolExecutionId: string | null;
45
+ resourceKey: string | null;
46
+ managerInstanceId: string | null;
47
+ sessionId: number | null;
48
+ checkpointId: string | null;
49
+ snapshotIndex: number | null;
50
+ }, {
51
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
52
+ messageSequence: number | null;
53
+ toolExecutionId: string | null;
54
+ resourceKey: string | null;
55
+ managerInstanceId: string | null;
56
+ sessionId: number | null;
57
+ checkpointId?: string | null | undefined;
58
+ snapshotIndex?: number | null | undefined;
59
+ }>>;
60
+ export type CompactionProvenanceRef = z.infer<typeof compactionProvenanceRefSchema>;
61
+ /**
62
+ * Provider-portable structured output contract. All object properties are
63
+ * required; goal is explicitly nullable and empty arrays mean "no candidate".
64
+ */
65
+ export declare const compactionModelDraftSchema: z.ZodReadonly<z.ZodObject<{
66
+ startsNewGoalScope: z.ZodBoolean;
67
+ goal: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
68
+ priorItemId: z.ZodNullable<z.ZodString>;
69
+ text: z.ZodString;
70
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
71
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
72
+ }, "strict", z.ZodTypeAny, {
73
+ text: string;
74
+ priorItemId: string | null;
75
+ sourceEvidenceIds: string[];
76
+ sourceQuotes: string[];
77
+ }, {
78
+ text: string;
79
+ priorItemId: string | null;
80
+ sourceEvidenceIds: string[];
81
+ sourceQuotes: string[];
82
+ }>>>;
83
+ constraints: z.ZodArray<z.ZodReadonly<z.ZodObject<{
84
+ priorItemId: z.ZodNullable<z.ZodString>;
85
+ text: z.ZodString;
86
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
87
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
88
+ }, "strict", z.ZodTypeAny, {
89
+ text: string;
90
+ priorItemId: string | null;
91
+ sourceEvidenceIds: string[];
92
+ sourceQuotes: string[];
93
+ }, {
94
+ text: string;
95
+ priorItemId: string | null;
96
+ sourceEvidenceIds: string[];
97
+ sourceQuotes: string[];
98
+ }>>, "many">;
99
+ decisions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
100
+ priorItemId: z.ZodNullable<z.ZodString>;
101
+ text: z.ZodString;
102
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
103
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
104
+ }, "strict", z.ZodTypeAny, {
105
+ text: string;
106
+ priorItemId: string | null;
107
+ sourceEvidenceIds: string[];
108
+ sourceQuotes: string[];
109
+ }, {
110
+ text: string;
111
+ priorItemId: string | null;
112
+ sourceEvidenceIds: string[];
113
+ sourceQuotes: string[];
114
+ }>>, "many">;
115
+ completedWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
116
+ priorItemId: z.ZodNullable<z.ZodString>;
117
+ text: z.ZodString;
118
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
119
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
120
+ }, "strict", z.ZodTypeAny, {
121
+ text: string;
122
+ priorItemId: string | null;
123
+ sourceEvidenceIds: string[];
124
+ sourceQuotes: string[];
125
+ }, {
126
+ text: string;
127
+ priorItemId: string | null;
128
+ sourceEvidenceIds: string[];
129
+ sourceQuotes: string[];
130
+ }>>, "many">;
131
+ pendingWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
132
+ priorItemId: z.ZodNullable<z.ZodString>;
133
+ text: z.ZodString;
134
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
135
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
136
+ }, "strict", z.ZodTypeAny, {
137
+ text: string;
138
+ priorItemId: string | null;
139
+ sourceEvidenceIds: string[];
140
+ sourceQuotes: string[];
141
+ }, {
142
+ text: string;
143
+ priorItemId: string | null;
144
+ sourceEvidenceIds: string[];
145
+ sourceQuotes: string[];
146
+ }>>, "many">;
147
+ resources: z.ZodArray<z.ZodReadonly<z.ZodObject<{
148
+ priorItemId: z.ZodNullable<z.ZodString>;
149
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
150
+ }, "strict", z.ZodTypeAny, {
151
+ priorItemId: string | null;
152
+ sourceEvidenceIds: string[];
153
+ }, {
154
+ priorItemId: string | null;
155
+ sourceEvidenceIds: string[];
156
+ }>>, "many">;
157
+ runningSessions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
158
+ priorItemId: z.ZodNullable<z.ZodString>;
159
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
160
+ }, "strict", z.ZodTypeAny, {
161
+ priorItemId: string | null;
162
+ sourceEvidenceIds: string[];
163
+ }, {
164
+ priorItemId: string | null;
165
+ sourceEvidenceIds: string[];
166
+ }>>, "many">;
167
+ uncertainties: z.ZodArray<z.ZodReadonly<z.ZodObject<{
168
+ priorItemId: z.ZodNullable<z.ZodString>;
169
+ text: z.ZodString;
170
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
171
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
172
+ }, "strict", z.ZodTypeAny, {
173
+ text: string;
174
+ priorItemId: string | null;
175
+ sourceEvidenceIds: string[];
176
+ sourceQuotes: string[];
177
+ }, {
178
+ text: string;
179
+ priorItemId: string | null;
180
+ sourceEvidenceIds: string[];
181
+ sourceQuotes: string[];
182
+ }>>, "many">;
183
+ resolutions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
184
+ targetItemId: z.ZodString;
185
+ targetCategory: z.ZodEnum<["constraint", "decision", "pending_work", "uncertainty"]>;
186
+ action: z.ZodEnum<["cancel", "supersede", "clarify", "revoke"]>;
187
+ reason: z.ZodString;
188
+ sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
189
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
190
+ }, "strict", z.ZodTypeAny, {
191
+ action: "cancel" | "supersede" | "clarify" | "revoke";
192
+ reason: string;
193
+ sourceEvidenceIds: string[];
194
+ sourceQuotes: string[];
195
+ targetItemId: string;
196
+ targetCategory: "constraint" | "decision" | "pending_work" | "uncertainty";
197
+ }, {
198
+ action: "cancel" | "supersede" | "clarify" | "revoke";
199
+ reason: string;
200
+ sourceEvidenceIds: string[];
201
+ sourceQuotes: string[];
202
+ targetItemId: string;
203
+ targetCategory: "constraint" | "decision" | "pending_work" | "uncertainty";
204
+ }>>, "many">;
205
+ evidenceReviews: z.ZodArray<z.ZodReadonly<z.ZodObject<{
206
+ evidenceId: z.ZodString;
207
+ disposition: z.ZodEnum<["irrelevant", "uncertain"]>;
208
+ reason: z.ZodString;
209
+ }, "strict", z.ZodTypeAny, {
210
+ reason: string;
211
+ evidenceId: string;
212
+ disposition: "irrelevant" | "uncertain";
213
+ }, {
214
+ reason: string;
215
+ evidenceId: string;
216
+ disposition: "irrelevant" | "uncertain";
217
+ }>>, "many">;
218
+ }, "strict", z.ZodTypeAny, {
219
+ resources: Readonly<{
220
+ priorItemId: string | null;
221
+ sourceEvidenceIds: string[];
222
+ }>[];
223
+ goal: Readonly<{
224
+ text: string;
225
+ priorItemId: string | null;
226
+ sourceEvidenceIds: string[];
227
+ sourceQuotes: string[];
228
+ }> | null;
229
+ startsNewGoalScope: boolean;
230
+ constraints: Readonly<{
231
+ text: string;
232
+ priorItemId: string | null;
233
+ sourceEvidenceIds: string[];
234
+ sourceQuotes: string[];
235
+ }>[];
236
+ decisions: Readonly<{
237
+ text: string;
238
+ priorItemId: string | null;
239
+ sourceEvidenceIds: string[];
240
+ sourceQuotes: string[];
241
+ }>[];
242
+ completedWork: Readonly<{
243
+ text: string;
244
+ priorItemId: string | null;
245
+ sourceEvidenceIds: string[];
246
+ sourceQuotes: string[];
247
+ }>[];
248
+ pendingWork: Readonly<{
249
+ text: string;
250
+ priorItemId: string | null;
251
+ sourceEvidenceIds: string[];
252
+ sourceQuotes: string[];
253
+ }>[];
254
+ runningSessions: Readonly<{
255
+ priorItemId: string | null;
256
+ sourceEvidenceIds: string[];
257
+ }>[];
258
+ uncertainties: Readonly<{
259
+ text: string;
260
+ priorItemId: string | null;
261
+ sourceEvidenceIds: string[];
262
+ sourceQuotes: string[];
263
+ }>[];
264
+ resolutions: Readonly<{
265
+ action: "cancel" | "supersede" | "clarify" | "revoke";
266
+ reason: string;
267
+ sourceEvidenceIds: string[];
268
+ sourceQuotes: string[];
269
+ targetItemId: string;
270
+ targetCategory: "constraint" | "decision" | "pending_work" | "uncertainty";
271
+ }>[];
272
+ evidenceReviews: Readonly<{
273
+ reason: string;
274
+ evidenceId: string;
275
+ disposition: "irrelevant" | "uncertain";
276
+ }>[];
277
+ }, {
278
+ resources: Readonly<{
279
+ priorItemId: string | null;
280
+ sourceEvidenceIds: string[];
281
+ }>[];
282
+ goal: Readonly<{
283
+ text: string;
284
+ priorItemId: string | null;
285
+ sourceEvidenceIds: string[];
286
+ sourceQuotes: string[];
287
+ }> | null;
288
+ startsNewGoalScope: boolean;
289
+ constraints: Readonly<{
290
+ text: string;
291
+ priorItemId: string | null;
292
+ sourceEvidenceIds: string[];
293
+ sourceQuotes: string[];
294
+ }>[];
295
+ decisions: Readonly<{
296
+ text: string;
297
+ priorItemId: string | null;
298
+ sourceEvidenceIds: string[];
299
+ sourceQuotes: string[];
300
+ }>[];
301
+ completedWork: Readonly<{
302
+ text: string;
303
+ priorItemId: string | null;
304
+ sourceEvidenceIds: string[];
305
+ sourceQuotes: string[];
306
+ }>[];
307
+ pendingWork: Readonly<{
308
+ text: string;
309
+ priorItemId: string | null;
310
+ sourceEvidenceIds: string[];
311
+ sourceQuotes: string[];
312
+ }>[];
313
+ runningSessions: Readonly<{
314
+ priorItemId: string | null;
315
+ sourceEvidenceIds: string[];
316
+ }>[];
317
+ uncertainties: Readonly<{
318
+ text: string;
319
+ priorItemId: string | null;
320
+ sourceEvidenceIds: string[];
321
+ sourceQuotes: string[];
322
+ }>[];
323
+ resolutions: Readonly<{
324
+ action: "cancel" | "supersede" | "clarify" | "revoke";
325
+ reason: string;
326
+ sourceEvidenceIds: string[];
327
+ sourceQuotes: string[];
328
+ targetItemId: string;
329
+ targetCategory: "constraint" | "decision" | "pending_work" | "uncertainty";
330
+ }>[];
331
+ evidenceReviews: Readonly<{
332
+ reason: string;
333
+ evidenceId: string;
334
+ disposition: "irrelevant" | "uncertain";
335
+ }>[];
336
+ }>>;
337
+ export type CompactionModelDraft = z.infer<typeof compactionModelDraftSchema>;
338
+ export declare function createEmptyCompactionModelDraft(): CompactionModelDraft;
339
+ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
340
+ version: z.ZodLiteral<1>;
341
+ goal: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
342
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
343
+ text: z.ZodString;
344
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
345
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
346
+ messageSequence: z.ZodNullable<z.ZodNumber>;
347
+ toolExecutionId: z.ZodNullable<z.ZodString>;
348
+ resourceKey: z.ZodNullable<z.ZodString>;
349
+ managerInstanceId: z.ZodNullable<z.ZodString>;
350
+ sessionId: z.ZodNullable<z.ZodNumber>;
351
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
352
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
353
+ }, "strict", z.ZodTypeAny, {
354
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
355
+ messageSequence: number | null;
356
+ toolExecutionId: string | null;
357
+ resourceKey: string | null;
358
+ managerInstanceId: string | null;
359
+ sessionId: number | null;
360
+ checkpointId: string | null;
361
+ snapshotIndex: number | null;
362
+ }, {
363
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
364
+ messageSequence: number | null;
365
+ toolExecutionId: string | null;
366
+ resourceKey: string | null;
367
+ managerInstanceId: string | null;
368
+ sessionId: number | null;
369
+ checkpointId?: string | null | undefined;
370
+ snapshotIndex?: number | null | undefined;
371
+ }>, {
372
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
373
+ messageSequence: number | null;
374
+ toolExecutionId: string | null;
375
+ resourceKey: string | null;
376
+ managerInstanceId: string | null;
377
+ sessionId: number | null;
378
+ checkpointId: string | null;
379
+ snapshotIndex: number | null;
380
+ }, {
381
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
382
+ messageSequence: number | null;
383
+ toolExecutionId: string | null;
384
+ resourceKey: string | null;
385
+ managerInstanceId: string | null;
386
+ sessionId: number | null;
387
+ checkpointId?: string | null | undefined;
388
+ snapshotIndex?: number | null | undefined;
389
+ }>>, "many">;
390
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
391
+ }, "strict", z.ZodTypeAny, {
392
+ text: string;
393
+ id: string & z.BRAND<"CompactionSemanticItemId">;
394
+ sourceQuotes: string[];
395
+ provenance: Readonly<{
396
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
397
+ messageSequence: number | null;
398
+ toolExecutionId: string | null;
399
+ resourceKey: string | null;
400
+ managerInstanceId: string | null;
401
+ sessionId: number | null;
402
+ checkpointId: string | null;
403
+ snapshotIndex: number | null;
404
+ }>[];
405
+ }, {
406
+ text: string;
407
+ id: string;
408
+ provenance: Readonly<{
409
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
410
+ messageSequence: number | null;
411
+ toolExecutionId: string | null;
412
+ resourceKey: string | null;
413
+ managerInstanceId: string | null;
414
+ sessionId: number | null;
415
+ checkpointId?: string | null | undefined;
416
+ snapshotIndex?: number | null | undefined;
417
+ }>[];
418
+ sourceQuotes?: string[] | undefined;
419
+ }>>>;
420
+ constraints: z.ZodDefault<z.ZodArray<z.ZodReadonly<z.ZodObject<{
421
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
422
+ text: z.ZodString;
423
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
424
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
425
+ messageSequence: z.ZodNullable<z.ZodNumber>;
426
+ toolExecutionId: z.ZodNullable<z.ZodString>;
427
+ resourceKey: z.ZodNullable<z.ZodString>;
428
+ managerInstanceId: z.ZodNullable<z.ZodString>;
429
+ sessionId: z.ZodNullable<z.ZodNumber>;
430
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
431
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
432
+ }, "strict", z.ZodTypeAny, {
433
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
434
+ messageSequence: number | null;
435
+ toolExecutionId: string | null;
436
+ resourceKey: string | null;
437
+ managerInstanceId: string | null;
438
+ sessionId: number | null;
439
+ checkpointId: string | null;
440
+ snapshotIndex: number | null;
441
+ }, {
442
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
443
+ messageSequence: number | null;
444
+ toolExecutionId: string | null;
445
+ resourceKey: string | null;
446
+ managerInstanceId: string | null;
447
+ sessionId: number | null;
448
+ checkpointId?: string | null | undefined;
449
+ snapshotIndex?: number | null | undefined;
450
+ }>, {
451
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
452
+ messageSequence: number | null;
453
+ toolExecutionId: string | null;
454
+ resourceKey: string | null;
455
+ managerInstanceId: string | null;
456
+ sessionId: number | null;
457
+ checkpointId: string | null;
458
+ snapshotIndex: number | null;
459
+ }, {
460
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
461
+ messageSequence: number | null;
462
+ toolExecutionId: string | null;
463
+ resourceKey: string | null;
464
+ managerInstanceId: string | null;
465
+ sessionId: number | null;
466
+ checkpointId?: string | null | undefined;
467
+ snapshotIndex?: number | null | undefined;
468
+ }>>, "many">;
469
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
470
+ }, "strict", z.ZodTypeAny, {
471
+ text: string;
472
+ id: string & z.BRAND<"CompactionSemanticItemId">;
473
+ sourceQuotes: string[];
474
+ provenance: Readonly<{
475
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
476
+ messageSequence: number | null;
477
+ toolExecutionId: string | null;
478
+ resourceKey: string | null;
479
+ managerInstanceId: string | null;
480
+ sessionId: number | null;
481
+ checkpointId: string | null;
482
+ snapshotIndex: number | null;
483
+ }>[];
484
+ }, {
485
+ text: string;
486
+ id: string;
487
+ provenance: Readonly<{
488
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
489
+ messageSequence: number | null;
490
+ toolExecutionId: string | null;
491
+ resourceKey: string | null;
492
+ managerInstanceId: string | null;
493
+ sessionId: number | null;
494
+ checkpointId?: string | null | undefined;
495
+ snapshotIndex?: number | null | undefined;
496
+ }>[];
497
+ sourceQuotes?: string[] | undefined;
498
+ }>>, "many">>;
499
+ decisions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
500
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
501
+ text: z.ZodString;
502
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
503
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
504
+ messageSequence: z.ZodNullable<z.ZodNumber>;
505
+ toolExecutionId: z.ZodNullable<z.ZodString>;
506
+ resourceKey: z.ZodNullable<z.ZodString>;
507
+ managerInstanceId: z.ZodNullable<z.ZodString>;
508
+ sessionId: z.ZodNullable<z.ZodNumber>;
509
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
510
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
511
+ }, "strict", z.ZodTypeAny, {
512
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
513
+ messageSequence: number | null;
514
+ toolExecutionId: string | null;
515
+ resourceKey: string | null;
516
+ managerInstanceId: string | null;
517
+ sessionId: number | null;
518
+ checkpointId: string | null;
519
+ snapshotIndex: number | null;
520
+ }, {
521
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
522
+ messageSequence: number | null;
523
+ toolExecutionId: string | null;
524
+ resourceKey: string | null;
525
+ managerInstanceId: string | null;
526
+ sessionId: number | null;
527
+ checkpointId?: string | null | undefined;
528
+ snapshotIndex?: number | null | undefined;
529
+ }>, {
530
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
531
+ messageSequence: number | null;
532
+ toolExecutionId: string | null;
533
+ resourceKey: string | null;
534
+ managerInstanceId: string | null;
535
+ sessionId: number | null;
536
+ checkpointId: string | null;
537
+ snapshotIndex: number | null;
538
+ }, {
539
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
540
+ messageSequence: number | null;
541
+ toolExecutionId: string | null;
542
+ resourceKey: string | null;
543
+ managerInstanceId: string | null;
544
+ sessionId: number | null;
545
+ checkpointId?: string | null | undefined;
546
+ snapshotIndex?: number | null | undefined;
547
+ }>>, "many">;
548
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
549
+ }, "strict", z.ZodTypeAny, {
550
+ text: string;
551
+ id: string & z.BRAND<"CompactionSemanticItemId">;
552
+ sourceQuotes: string[];
553
+ provenance: Readonly<{
554
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
555
+ messageSequence: number | null;
556
+ toolExecutionId: string | null;
557
+ resourceKey: string | null;
558
+ managerInstanceId: string | null;
559
+ sessionId: number | null;
560
+ checkpointId: string | null;
561
+ snapshotIndex: number | null;
562
+ }>[];
563
+ }, {
564
+ text: string;
565
+ id: string;
566
+ provenance: Readonly<{
567
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
568
+ messageSequence: number | null;
569
+ toolExecutionId: string | null;
570
+ resourceKey: string | null;
571
+ managerInstanceId: string | null;
572
+ sessionId: number | null;
573
+ checkpointId?: string | null | undefined;
574
+ snapshotIndex?: number | null | undefined;
575
+ }>[];
576
+ sourceQuotes?: string[] | undefined;
577
+ }>>, "many">;
578
+ completedWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
579
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
580
+ text: z.ZodString;
581
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
582
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
583
+ messageSequence: z.ZodNullable<z.ZodNumber>;
584
+ toolExecutionId: z.ZodNullable<z.ZodString>;
585
+ resourceKey: z.ZodNullable<z.ZodString>;
586
+ managerInstanceId: z.ZodNullable<z.ZodString>;
587
+ sessionId: z.ZodNullable<z.ZodNumber>;
588
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
589
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
590
+ }, "strict", z.ZodTypeAny, {
591
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
592
+ messageSequence: number | null;
593
+ toolExecutionId: string | null;
594
+ resourceKey: string | null;
595
+ managerInstanceId: string | null;
596
+ sessionId: number | null;
597
+ checkpointId: string | null;
598
+ snapshotIndex: number | null;
599
+ }, {
600
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
601
+ messageSequence: number | null;
602
+ toolExecutionId: string | null;
603
+ resourceKey: string | null;
604
+ managerInstanceId: string | null;
605
+ sessionId: number | null;
606
+ checkpointId?: string | null | undefined;
607
+ snapshotIndex?: number | null | undefined;
608
+ }>, {
609
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
610
+ messageSequence: number | null;
611
+ toolExecutionId: string | null;
612
+ resourceKey: string | null;
613
+ managerInstanceId: string | null;
614
+ sessionId: number | null;
615
+ checkpointId: string | null;
616
+ snapshotIndex: number | null;
617
+ }, {
618
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
619
+ messageSequence: number | null;
620
+ toolExecutionId: string | null;
621
+ resourceKey: string | null;
622
+ managerInstanceId: string | null;
623
+ sessionId: number | null;
624
+ checkpointId?: string | null | undefined;
625
+ snapshotIndex?: number | null | undefined;
626
+ }>>, "many">;
627
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
628
+ }, "strict", z.ZodTypeAny, {
629
+ text: string;
630
+ id: string & z.BRAND<"CompactionSemanticItemId">;
631
+ sourceQuotes: string[];
632
+ provenance: Readonly<{
633
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
634
+ messageSequence: number | null;
635
+ toolExecutionId: string | null;
636
+ resourceKey: string | null;
637
+ managerInstanceId: string | null;
638
+ sessionId: number | null;
639
+ checkpointId: string | null;
640
+ snapshotIndex: number | null;
641
+ }>[];
642
+ }, {
643
+ text: string;
644
+ id: string;
645
+ provenance: Readonly<{
646
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
647
+ messageSequence: number | null;
648
+ toolExecutionId: string | null;
649
+ resourceKey: string | null;
650
+ managerInstanceId: string | null;
651
+ sessionId: number | null;
652
+ checkpointId?: string | null | undefined;
653
+ snapshotIndex?: number | null | undefined;
654
+ }>[];
655
+ sourceQuotes?: string[] | undefined;
656
+ }>>, "many">;
657
+ pendingWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
658
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
659
+ text: z.ZodString;
660
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
661
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
662
+ messageSequence: z.ZodNullable<z.ZodNumber>;
663
+ toolExecutionId: z.ZodNullable<z.ZodString>;
664
+ resourceKey: z.ZodNullable<z.ZodString>;
665
+ managerInstanceId: z.ZodNullable<z.ZodString>;
666
+ sessionId: z.ZodNullable<z.ZodNumber>;
667
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
668
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
669
+ }, "strict", z.ZodTypeAny, {
670
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
671
+ messageSequence: number | null;
672
+ toolExecutionId: string | null;
673
+ resourceKey: string | null;
674
+ managerInstanceId: string | null;
675
+ sessionId: number | null;
676
+ checkpointId: string | null;
677
+ snapshotIndex: number | null;
678
+ }, {
679
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
680
+ messageSequence: number | null;
681
+ toolExecutionId: string | null;
682
+ resourceKey: string | null;
683
+ managerInstanceId: string | null;
684
+ sessionId: number | null;
685
+ checkpointId?: string | null | undefined;
686
+ snapshotIndex?: number | null | undefined;
687
+ }>, {
688
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
689
+ messageSequence: number | null;
690
+ toolExecutionId: string | null;
691
+ resourceKey: string | null;
692
+ managerInstanceId: string | null;
693
+ sessionId: number | null;
694
+ checkpointId: string | null;
695
+ snapshotIndex: number | null;
696
+ }, {
697
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
698
+ messageSequence: number | null;
699
+ toolExecutionId: string | null;
700
+ resourceKey: string | null;
701
+ managerInstanceId: string | null;
702
+ sessionId: number | null;
703
+ checkpointId?: string | null | undefined;
704
+ snapshotIndex?: number | null | undefined;
705
+ }>>, "many">;
706
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
707
+ }, "strict", z.ZodTypeAny, {
708
+ text: string;
709
+ id: string & z.BRAND<"CompactionSemanticItemId">;
710
+ sourceQuotes: string[];
711
+ provenance: Readonly<{
712
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
713
+ messageSequence: number | null;
714
+ toolExecutionId: string | null;
715
+ resourceKey: string | null;
716
+ managerInstanceId: string | null;
717
+ sessionId: number | null;
718
+ checkpointId: string | null;
719
+ snapshotIndex: number | null;
720
+ }>[];
721
+ }, {
722
+ text: string;
723
+ id: string;
724
+ provenance: Readonly<{
725
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
726
+ messageSequence: number | null;
727
+ toolExecutionId: string | null;
728
+ resourceKey: string | null;
729
+ managerInstanceId: string | null;
730
+ sessionId: number | null;
731
+ checkpointId?: string | null | undefined;
732
+ snapshotIndex?: number | null | undefined;
733
+ }>[];
734
+ sourceQuotes?: string[] | undefined;
735
+ }>>, "many">;
736
+ resources: z.ZodArray<z.ZodReadonly<z.ZodObject<{
737
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
738
+ resourceKey: z.ZodString;
739
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
740
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
741
+ messageSequence: z.ZodNullable<z.ZodNumber>;
742
+ toolExecutionId: z.ZodNullable<z.ZodString>;
743
+ resourceKey: z.ZodNullable<z.ZodString>;
744
+ managerInstanceId: z.ZodNullable<z.ZodString>;
745
+ sessionId: z.ZodNullable<z.ZodNumber>;
746
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
747
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
748
+ }, "strict", z.ZodTypeAny, {
749
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
750
+ messageSequence: number | null;
751
+ toolExecutionId: string | null;
752
+ resourceKey: string | null;
753
+ managerInstanceId: string | null;
754
+ sessionId: number | null;
755
+ checkpointId: string | null;
756
+ snapshotIndex: number | null;
757
+ }, {
758
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
759
+ messageSequence: number | null;
760
+ toolExecutionId: string | null;
761
+ resourceKey: string | null;
762
+ managerInstanceId: string | null;
763
+ sessionId: number | null;
764
+ checkpointId?: string | null | undefined;
765
+ snapshotIndex?: number | null | undefined;
766
+ }>, {
767
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
768
+ messageSequence: number | null;
769
+ toolExecutionId: string | null;
770
+ resourceKey: string | null;
771
+ managerInstanceId: string | null;
772
+ sessionId: number | null;
773
+ checkpointId: string | null;
774
+ snapshotIndex: number | null;
775
+ }, {
776
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
777
+ messageSequence: number | null;
778
+ toolExecutionId: string | null;
779
+ resourceKey: string | null;
780
+ managerInstanceId: string | null;
781
+ sessionId: number | null;
782
+ checkpointId?: string | null | undefined;
783
+ snapshotIndex?: number | null | undefined;
784
+ }>>, "many">;
785
+ }, "strict", z.ZodTypeAny, {
786
+ id: string & z.BRAND<"CompactionSemanticItemId">;
787
+ resourceKey: string;
788
+ provenance: Readonly<{
789
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
790
+ messageSequence: number | null;
791
+ toolExecutionId: string | null;
792
+ resourceKey: string | null;
793
+ managerInstanceId: string | null;
794
+ sessionId: number | null;
795
+ checkpointId: string | null;
796
+ snapshotIndex: number | null;
797
+ }>[];
798
+ }, {
799
+ id: string;
800
+ resourceKey: string;
801
+ provenance: Readonly<{
802
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
803
+ messageSequence: number | null;
804
+ toolExecutionId: string | null;
805
+ resourceKey: string | null;
806
+ managerInstanceId: string | null;
807
+ sessionId: number | null;
808
+ checkpointId?: string | null | undefined;
809
+ snapshotIndex?: number | null | undefined;
810
+ }>[];
811
+ }>>, "many">;
812
+ runningSessions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
813
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
814
+ managerInstanceId: z.ZodString;
815
+ sessionId: z.ZodNumber;
816
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
817
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
818
+ messageSequence: z.ZodNullable<z.ZodNumber>;
819
+ toolExecutionId: z.ZodNullable<z.ZodString>;
820
+ resourceKey: z.ZodNullable<z.ZodString>;
821
+ managerInstanceId: z.ZodNullable<z.ZodString>;
822
+ sessionId: z.ZodNullable<z.ZodNumber>;
823
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
824
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
825
+ }, "strict", z.ZodTypeAny, {
826
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
827
+ messageSequence: number | null;
828
+ toolExecutionId: string | null;
829
+ resourceKey: string | null;
830
+ managerInstanceId: string | null;
831
+ sessionId: number | null;
832
+ checkpointId: string | null;
833
+ snapshotIndex: number | null;
834
+ }, {
835
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
836
+ messageSequence: number | null;
837
+ toolExecutionId: string | null;
838
+ resourceKey: string | null;
839
+ managerInstanceId: string | null;
840
+ sessionId: number | null;
841
+ checkpointId?: string | null | undefined;
842
+ snapshotIndex?: number | null | undefined;
843
+ }>, {
844
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
845
+ messageSequence: number | null;
846
+ toolExecutionId: string | null;
847
+ resourceKey: string | null;
848
+ managerInstanceId: string | null;
849
+ sessionId: number | null;
850
+ checkpointId: string | null;
851
+ snapshotIndex: number | null;
852
+ }, {
853
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
854
+ messageSequence: number | null;
855
+ toolExecutionId: string | null;
856
+ resourceKey: string | null;
857
+ managerInstanceId: string | null;
858
+ sessionId: number | null;
859
+ checkpointId?: string | null | undefined;
860
+ snapshotIndex?: number | null | undefined;
861
+ }>>, "many">;
862
+ }, "strict", z.ZodTypeAny, {
863
+ id: string & z.BRAND<"CompactionSemanticItemId">;
864
+ managerInstanceId: string;
865
+ sessionId: number;
866
+ provenance: Readonly<{
867
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
868
+ messageSequence: number | null;
869
+ toolExecutionId: string | null;
870
+ resourceKey: string | null;
871
+ managerInstanceId: string | null;
872
+ sessionId: number | null;
873
+ checkpointId: string | null;
874
+ snapshotIndex: number | null;
875
+ }>[];
876
+ }, {
877
+ id: string;
878
+ managerInstanceId: string;
879
+ sessionId: number;
880
+ provenance: Readonly<{
881
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
882
+ messageSequence: number | null;
883
+ toolExecutionId: string | null;
884
+ resourceKey: string | null;
885
+ managerInstanceId: string | null;
886
+ sessionId: number | null;
887
+ checkpointId?: string | null | undefined;
888
+ snapshotIndex?: number | null | undefined;
889
+ }>[];
890
+ }>>, "many">;
891
+ uncertainties: z.ZodArray<z.ZodReadonly<z.ZodObject<{
892
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
893
+ text: z.ZodString;
894
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
895
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
896
+ messageSequence: z.ZodNullable<z.ZodNumber>;
897
+ toolExecutionId: z.ZodNullable<z.ZodString>;
898
+ resourceKey: z.ZodNullable<z.ZodString>;
899
+ managerInstanceId: z.ZodNullable<z.ZodString>;
900
+ sessionId: z.ZodNullable<z.ZodNumber>;
901
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
902
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
903
+ }, "strict", z.ZodTypeAny, {
904
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
905
+ messageSequence: number | null;
906
+ toolExecutionId: string | null;
907
+ resourceKey: string | null;
908
+ managerInstanceId: string | null;
909
+ sessionId: number | null;
910
+ checkpointId: string | null;
911
+ snapshotIndex: number | null;
912
+ }, {
913
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
914
+ messageSequence: number | null;
915
+ toolExecutionId: string | null;
916
+ resourceKey: string | null;
917
+ managerInstanceId: string | null;
918
+ sessionId: number | null;
919
+ checkpointId?: string | null | undefined;
920
+ snapshotIndex?: number | null | undefined;
921
+ }>, {
922
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
923
+ messageSequence: number | null;
924
+ toolExecutionId: string | null;
925
+ resourceKey: string | null;
926
+ managerInstanceId: string | null;
927
+ sessionId: number | null;
928
+ checkpointId: string | null;
929
+ snapshotIndex: number | null;
930
+ }, {
931
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
932
+ messageSequence: number | null;
933
+ toolExecutionId: string | null;
934
+ resourceKey: string | null;
935
+ managerInstanceId: string | null;
936
+ sessionId: number | null;
937
+ checkpointId?: string | null | undefined;
938
+ snapshotIndex?: number | null | undefined;
939
+ }>>, "many">;
940
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
941
+ }, "strict", z.ZodTypeAny, {
942
+ text: string;
943
+ id: string & z.BRAND<"CompactionSemanticItemId">;
944
+ sourceQuotes: string[];
945
+ provenance: Readonly<{
946
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
947
+ messageSequence: number | null;
948
+ toolExecutionId: string | null;
949
+ resourceKey: string | null;
950
+ managerInstanceId: string | null;
951
+ sessionId: number | null;
952
+ checkpointId: string | null;
953
+ snapshotIndex: number | null;
954
+ }>[];
955
+ }, {
956
+ text: string;
957
+ id: string;
958
+ provenance: Readonly<{
959
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
960
+ messageSequence: number | null;
961
+ toolExecutionId: string | null;
962
+ resourceKey: string | null;
963
+ managerInstanceId: string | null;
964
+ sessionId: number | null;
965
+ checkpointId?: string | null | undefined;
966
+ snapshotIndex?: number | null | undefined;
967
+ }>[];
968
+ sourceQuotes?: string[] | undefined;
969
+ }>>, "many">;
970
+ prunedItemCounts: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
971
+ constraint: z.ZodDefault<z.ZodNumber>;
972
+ decision: z.ZodNumber;
973
+ completed_work: z.ZodNumber;
974
+ pending_work: z.ZodNumber;
975
+ resource: z.ZodNumber;
976
+ running_session: z.ZodNumber;
977
+ uncertainty: z.ZodNumber;
978
+ }, "strict", z.ZodTypeAny, {
979
+ resource: number;
980
+ running_session: number;
981
+ constraint: number;
982
+ decision: number;
983
+ completed_work: number;
984
+ pending_work: number;
985
+ uncertainty: number;
986
+ }, {
987
+ resource: number;
988
+ running_session: number;
989
+ decision: number;
990
+ completed_work: number;
991
+ pending_work: number;
992
+ uncertainty: number;
993
+ constraint?: number | undefined;
994
+ }>>>;
995
+ }, "strict", z.ZodTypeAny, {
996
+ version: 1;
997
+ resources: Readonly<{
998
+ id: string & z.BRAND<"CompactionSemanticItemId">;
999
+ resourceKey: string;
1000
+ provenance: Readonly<{
1001
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1002
+ messageSequence: number | null;
1003
+ toolExecutionId: string | null;
1004
+ resourceKey: string | null;
1005
+ managerInstanceId: string | null;
1006
+ sessionId: number | null;
1007
+ checkpointId: string | null;
1008
+ snapshotIndex: number | null;
1009
+ }>[];
1010
+ }>[];
1011
+ goal: Readonly<{
1012
+ text: string;
1013
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1014
+ sourceQuotes: string[];
1015
+ provenance: Readonly<{
1016
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1017
+ messageSequence: number | null;
1018
+ toolExecutionId: string | null;
1019
+ resourceKey: string | null;
1020
+ managerInstanceId: string | null;
1021
+ sessionId: number | null;
1022
+ checkpointId: string | null;
1023
+ snapshotIndex: number | null;
1024
+ }>[];
1025
+ }> | null;
1026
+ constraints: Readonly<{
1027
+ text: string;
1028
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1029
+ sourceQuotes: string[];
1030
+ provenance: Readonly<{
1031
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1032
+ messageSequence: number | null;
1033
+ toolExecutionId: string | null;
1034
+ resourceKey: string | null;
1035
+ managerInstanceId: string | null;
1036
+ sessionId: number | null;
1037
+ checkpointId: string | null;
1038
+ snapshotIndex: number | null;
1039
+ }>[];
1040
+ }>[];
1041
+ decisions: Readonly<{
1042
+ text: string;
1043
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1044
+ sourceQuotes: string[];
1045
+ provenance: Readonly<{
1046
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1047
+ messageSequence: number | null;
1048
+ toolExecutionId: string | null;
1049
+ resourceKey: string | null;
1050
+ managerInstanceId: string | null;
1051
+ sessionId: number | null;
1052
+ checkpointId: string | null;
1053
+ snapshotIndex: number | null;
1054
+ }>[];
1055
+ }>[];
1056
+ completedWork: Readonly<{
1057
+ text: string;
1058
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1059
+ sourceQuotes: string[];
1060
+ provenance: Readonly<{
1061
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1062
+ messageSequence: number | null;
1063
+ toolExecutionId: string | null;
1064
+ resourceKey: string | null;
1065
+ managerInstanceId: string | null;
1066
+ sessionId: number | null;
1067
+ checkpointId: string | null;
1068
+ snapshotIndex: number | null;
1069
+ }>[];
1070
+ }>[];
1071
+ pendingWork: Readonly<{
1072
+ text: string;
1073
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1074
+ sourceQuotes: string[];
1075
+ provenance: Readonly<{
1076
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1077
+ messageSequence: number | null;
1078
+ toolExecutionId: string | null;
1079
+ resourceKey: string | null;
1080
+ managerInstanceId: string | null;
1081
+ sessionId: number | null;
1082
+ checkpointId: string | null;
1083
+ snapshotIndex: number | null;
1084
+ }>[];
1085
+ }>[];
1086
+ runningSessions: Readonly<{
1087
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1088
+ managerInstanceId: string;
1089
+ sessionId: number;
1090
+ provenance: Readonly<{
1091
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1092
+ messageSequence: number | null;
1093
+ toolExecutionId: string | null;
1094
+ resourceKey: string | null;
1095
+ managerInstanceId: string | null;
1096
+ sessionId: number | null;
1097
+ checkpointId: string | null;
1098
+ snapshotIndex: number | null;
1099
+ }>[];
1100
+ }>[];
1101
+ uncertainties: Readonly<{
1102
+ text: string;
1103
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1104
+ sourceQuotes: string[];
1105
+ provenance: Readonly<{
1106
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1107
+ messageSequence: number | null;
1108
+ toolExecutionId: string | null;
1109
+ resourceKey: string | null;
1110
+ managerInstanceId: string | null;
1111
+ sessionId: number | null;
1112
+ checkpointId: string | null;
1113
+ snapshotIndex: number | null;
1114
+ }>[];
1115
+ }>[];
1116
+ prunedItemCounts: Readonly<{
1117
+ resource: number;
1118
+ running_session: number;
1119
+ constraint: number;
1120
+ decision: number;
1121
+ completed_work: number;
1122
+ pending_work: number;
1123
+ uncertainty: number;
1124
+ }>;
1125
+ }, {
1126
+ version: 1;
1127
+ resources: Readonly<{
1128
+ id: string;
1129
+ resourceKey: string;
1130
+ provenance: Readonly<{
1131
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1132
+ messageSequence: number | null;
1133
+ toolExecutionId: string | null;
1134
+ resourceKey: string | null;
1135
+ managerInstanceId: string | null;
1136
+ sessionId: number | null;
1137
+ checkpointId?: string | null | undefined;
1138
+ snapshotIndex?: number | null | undefined;
1139
+ }>[];
1140
+ }>[];
1141
+ goal: Readonly<{
1142
+ text: string;
1143
+ id: string;
1144
+ provenance: Readonly<{
1145
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1146
+ messageSequence: number | null;
1147
+ toolExecutionId: string | null;
1148
+ resourceKey: string | null;
1149
+ managerInstanceId: string | null;
1150
+ sessionId: number | null;
1151
+ checkpointId?: string | null | undefined;
1152
+ snapshotIndex?: number | null | undefined;
1153
+ }>[];
1154
+ sourceQuotes?: string[] | undefined;
1155
+ }> | null;
1156
+ decisions: Readonly<{
1157
+ text: string;
1158
+ id: string;
1159
+ provenance: Readonly<{
1160
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1161
+ messageSequence: number | null;
1162
+ toolExecutionId: string | null;
1163
+ resourceKey: string | null;
1164
+ managerInstanceId: string | null;
1165
+ sessionId: number | null;
1166
+ checkpointId?: string | null | undefined;
1167
+ snapshotIndex?: number | null | undefined;
1168
+ }>[];
1169
+ sourceQuotes?: string[] | undefined;
1170
+ }>[];
1171
+ completedWork: Readonly<{
1172
+ text: string;
1173
+ id: string;
1174
+ provenance: Readonly<{
1175
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1176
+ messageSequence: number | null;
1177
+ toolExecutionId: string | null;
1178
+ resourceKey: string | null;
1179
+ managerInstanceId: string | null;
1180
+ sessionId: number | null;
1181
+ checkpointId?: string | null | undefined;
1182
+ snapshotIndex?: number | null | undefined;
1183
+ }>[];
1184
+ sourceQuotes?: string[] | undefined;
1185
+ }>[];
1186
+ pendingWork: Readonly<{
1187
+ text: string;
1188
+ id: string;
1189
+ provenance: Readonly<{
1190
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1191
+ messageSequence: number | null;
1192
+ toolExecutionId: string | null;
1193
+ resourceKey: string | null;
1194
+ managerInstanceId: string | null;
1195
+ sessionId: number | null;
1196
+ checkpointId?: string | null | undefined;
1197
+ snapshotIndex?: number | null | undefined;
1198
+ }>[];
1199
+ sourceQuotes?: string[] | undefined;
1200
+ }>[];
1201
+ runningSessions: Readonly<{
1202
+ id: string;
1203
+ managerInstanceId: string;
1204
+ sessionId: number;
1205
+ provenance: Readonly<{
1206
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1207
+ messageSequence: number | null;
1208
+ toolExecutionId: string | null;
1209
+ resourceKey: string | null;
1210
+ managerInstanceId: string | null;
1211
+ sessionId: number | null;
1212
+ checkpointId?: string | null | undefined;
1213
+ snapshotIndex?: number | null | undefined;
1214
+ }>[];
1215
+ }>[];
1216
+ uncertainties: Readonly<{
1217
+ text: string;
1218
+ id: string;
1219
+ provenance: Readonly<{
1220
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1221
+ messageSequence: number | null;
1222
+ toolExecutionId: string | null;
1223
+ resourceKey: string | null;
1224
+ managerInstanceId: string | null;
1225
+ sessionId: number | null;
1226
+ checkpointId?: string | null | undefined;
1227
+ snapshotIndex?: number | null | undefined;
1228
+ }>[];
1229
+ sourceQuotes?: string[] | undefined;
1230
+ }>[];
1231
+ constraints?: Readonly<{
1232
+ text: string;
1233
+ id: string;
1234
+ provenance: Readonly<{
1235
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1236
+ messageSequence: number | null;
1237
+ toolExecutionId: string | null;
1238
+ resourceKey: string | null;
1239
+ managerInstanceId: string | null;
1240
+ sessionId: number | null;
1241
+ checkpointId?: string | null | undefined;
1242
+ snapshotIndex?: number | null | undefined;
1243
+ }>[];
1244
+ sourceQuotes?: string[] | undefined;
1245
+ }>[] | undefined;
1246
+ prunedItemCounts?: Readonly<{
1247
+ resource: number;
1248
+ running_session: number;
1249
+ decision: number;
1250
+ completed_work: number;
1251
+ pending_work: number;
1252
+ uncertainty: number;
1253
+ constraint?: number | undefined;
1254
+ }> | undefined;
1255
+ }>, {
1256
+ version: 1;
1257
+ resources: Readonly<{
1258
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1259
+ resourceKey: string;
1260
+ provenance: Readonly<{
1261
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1262
+ messageSequence: number | null;
1263
+ toolExecutionId: string | null;
1264
+ resourceKey: string | null;
1265
+ managerInstanceId: string | null;
1266
+ sessionId: number | null;
1267
+ checkpointId: string | null;
1268
+ snapshotIndex: number | null;
1269
+ }>[];
1270
+ }>[];
1271
+ goal: Readonly<{
1272
+ text: string;
1273
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1274
+ sourceQuotes: string[];
1275
+ provenance: Readonly<{
1276
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1277
+ messageSequence: number | null;
1278
+ toolExecutionId: string | null;
1279
+ resourceKey: string | null;
1280
+ managerInstanceId: string | null;
1281
+ sessionId: number | null;
1282
+ checkpointId: string | null;
1283
+ snapshotIndex: number | null;
1284
+ }>[];
1285
+ }> | null;
1286
+ constraints: Readonly<{
1287
+ text: string;
1288
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1289
+ sourceQuotes: string[];
1290
+ provenance: Readonly<{
1291
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1292
+ messageSequence: number | null;
1293
+ toolExecutionId: string | null;
1294
+ resourceKey: string | null;
1295
+ managerInstanceId: string | null;
1296
+ sessionId: number | null;
1297
+ checkpointId: string | null;
1298
+ snapshotIndex: number | null;
1299
+ }>[];
1300
+ }>[];
1301
+ decisions: Readonly<{
1302
+ text: string;
1303
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1304
+ sourceQuotes: string[];
1305
+ provenance: Readonly<{
1306
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1307
+ messageSequence: number | null;
1308
+ toolExecutionId: string | null;
1309
+ resourceKey: string | null;
1310
+ managerInstanceId: string | null;
1311
+ sessionId: number | null;
1312
+ checkpointId: string | null;
1313
+ snapshotIndex: number | null;
1314
+ }>[];
1315
+ }>[];
1316
+ completedWork: Readonly<{
1317
+ text: string;
1318
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1319
+ sourceQuotes: string[];
1320
+ provenance: Readonly<{
1321
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1322
+ messageSequence: number | null;
1323
+ toolExecutionId: string | null;
1324
+ resourceKey: string | null;
1325
+ managerInstanceId: string | null;
1326
+ sessionId: number | null;
1327
+ checkpointId: string | null;
1328
+ snapshotIndex: number | null;
1329
+ }>[];
1330
+ }>[];
1331
+ pendingWork: Readonly<{
1332
+ text: string;
1333
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1334
+ sourceQuotes: string[];
1335
+ provenance: Readonly<{
1336
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1337
+ messageSequence: number | null;
1338
+ toolExecutionId: string | null;
1339
+ resourceKey: string | null;
1340
+ managerInstanceId: string | null;
1341
+ sessionId: number | null;
1342
+ checkpointId: string | null;
1343
+ snapshotIndex: number | null;
1344
+ }>[];
1345
+ }>[];
1346
+ runningSessions: Readonly<{
1347
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1348
+ managerInstanceId: string;
1349
+ sessionId: number;
1350
+ provenance: Readonly<{
1351
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1352
+ messageSequence: number | null;
1353
+ toolExecutionId: string | null;
1354
+ resourceKey: string | null;
1355
+ managerInstanceId: string | null;
1356
+ sessionId: number | null;
1357
+ checkpointId: string | null;
1358
+ snapshotIndex: number | null;
1359
+ }>[];
1360
+ }>[];
1361
+ uncertainties: Readonly<{
1362
+ text: string;
1363
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1364
+ sourceQuotes: string[];
1365
+ provenance: Readonly<{
1366
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1367
+ messageSequence: number | null;
1368
+ toolExecutionId: string | null;
1369
+ resourceKey: string | null;
1370
+ managerInstanceId: string | null;
1371
+ sessionId: number | null;
1372
+ checkpointId: string | null;
1373
+ snapshotIndex: number | null;
1374
+ }>[];
1375
+ }>[];
1376
+ prunedItemCounts: Readonly<{
1377
+ resource: number;
1378
+ running_session: number;
1379
+ constraint: number;
1380
+ decision: number;
1381
+ completed_work: number;
1382
+ pending_work: number;
1383
+ uncertainty: number;
1384
+ }>;
1385
+ }, {
1386
+ version: 1;
1387
+ resources: Readonly<{
1388
+ id: string;
1389
+ resourceKey: string;
1390
+ provenance: Readonly<{
1391
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1392
+ messageSequence: number | null;
1393
+ toolExecutionId: string | null;
1394
+ resourceKey: string | null;
1395
+ managerInstanceId: string | null;
1396
+ sessionId: number | null;
1397
+ checkpointId?: string | null | undefined;
1398
+ snapshotIndex?: number | null | undefined;
1399
+ }>[];
1400
+ }>[];
1401
+ goal: Readonly<{
1402
+ text: string;
1403
+ id: string;
1404
+ provenance: Readonly<{
1405
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1406
+ messageSequence: number | null;
1407
+ toolExecutionId: string | null;
1408
+ resourceKey: string | null;
1409
+ managerInstanceId: string | null;
1410
+ sessionId: number | null;
1411
+ checkpointId?: string | null | undefined;
1412
+ snapshotIndex?: number | null | undefined;
1413
+ }>[];
1414
+ sourceQuotes?: string[] | undefined;
1415
+ }> | null;
1416
+ decisions: Readonly<{
1417
+ text: string;
1418
+ id: string;
1419
+ provenance: Readonly<{
1420
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1421
+ messageSequence: number | null;
1422
+ toolExecutionId: string | null;
1423
+ resourceKey: string | null;
1424
+ managerInstanceId: string | null;
1425
+ sessionId: number | null;
1426
+ checkpointId?: string | null | undefined;
1427
+ snapshotIndex?: number | null | undefined;
1428
+ }>[];
1429
+ sourceQuotes?: string[] | undefined;
1430
+ }>[];
1431
+ completedWork: Readonly<{
1432
+ text: string;
1433
+ id: string;
1434
+ provenance: Readonly<{
1435
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1436
+ messageSequence: number | null;
1437
+ toolExecutionId: string | null;
1438
+ resourceKey: string | null;
1439
+ managerInstanceId: string | null;
1440
+ sessionId: number | null;
1441
+ checkpointId?: string | null | undefined;
1442
+ snapshotIndex?: number | null | undefined;
1443
+ }>[];
1444
+ sourceQuotes?: string[] | undefined;
1445
+ }>[];
1446
+ pendingWork: Readonly<{
1447
+ text: string;
1448
+ id: string;
1449
+ provenance: Readonly<{
1450
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1451
+ messageSequence: number | null;
1452
+ toolExecutionId: string | null;
1453
+ resourceKey: string | null;
1454
+ managerInstanceId: string | null;
1455
+ sessionId: number | null;
1456
+ checkpointId?: string | null | undefined;
1457
+ snapshotIndex?: number | null | undefined;
1458
+ }>[];
1459
+ sourceQuotes?: string[] | undefined;
1460
+ }>[];
1461
+ runningSessions: Readonly<{
1462
+ id: string;
1463
+ managerInstanceId: string;
1464
+ sessionId: number;
1465
+ provenance: Readonly<{
1466
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1467
+ messageSequence: number | null;
1468
+ toolExecutionId: string | null;
1469
+ resourceKey: string | null;
1470
+ managerInstanceId: string | null;
1471
+ sessionId: number | null;
1472
+ checkpointId?: string | null | undefined;
1473
+ snapshotIndex?: number | null | undefined;
1474
+ }>[];
1475
+ }>[];
1476
+ uncertainties: Readonly<{
1477
+ text: string;
1478
+ id: string;
1479
+ provenance: Readonly<{
1480
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1481
+ messageSequence: number | null;
1482
+ toolExecutionId: string | null;
1483
+ resourceKey: string | null;
1484
+ managerInstanceId: string | null;
1485
+ sessionId: number | null;
1486
+ checkpointId?: string | null | undefined;
1487
+ snapshotIndex?: number | null | undefined;
1488
+ }>[];
1489
+ sourceQuotes?: string[] | undefined;
1490
+ }>[];
1491
+ constraints?: Readonly<{
1492
+ text: string;
1493
+ id: string;
1494
+ provenance: Readonly<{
1495
+ kind: "resource" | "message" | "tool_execution" | "running_session" | "legacy_snapshot";
1496
+ messageSequence: number | null;
1497
+ toolExecutionId: string | null;
1498
+ resourceKey: string | null;
1499
+ managerInstanceId: string | null;
1500
+ sessionId: number | null;
1501
+ checkpointId?: string | null | undefined;
1502
+ snapshotIndex?: number | null | undefined;
1503
+ }>[];
1504
+ sourceQuotes?: string[] | undefined;
1505
+ }>[] | undefined;
1506
+ prunedItemCounts?: Readonly<{
1507
+ resource: number;
1508
+ running_session: number;
1509
+ decision: number;
1510
+ completed_work: number;
1511
+ pending_work: number;
1512
+ uncertainty: number;
1513
+ constraint?: number | undefined;
1514
+ }> | undefined;
1515
+ }>>;
1516
+ export type CompactionSemanticState = z.infer<typeof compactionSemanticStateSchema>;
1517
+ export type CompactionSemanticTextItem = CompactionSemanticState["decisions"][number];
1518
+ export type CompactionSemanticResource = CompactionSemanticState["resources"][number];
1519
+ export type CompactionSemanticRunningSession = CompactionSemanticState["runningSessions"][number];
1520
+ export declare const compactionSemanticReminderProjectionSchema: z.ZodReadonly<z.ZodObject<{
1521
+ version: z.ZodLiteral<1>;
1522
+ items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
1523
+ itemId: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
1524
+ category: z.ZodEnum<["goal", "constraint", "decision", "completed_work", "pending_work", "resource", "running_session", "uncertainty"]>;
1525
+ text: z.ZodString;
1526
+ sourceQuotes: z.ZodArray<z.ZodString, "many">;
1527
+ }, "strict", z.ZodTypeAny, {
1528
+ text: string;
1529
+ sourceQuotes: string[];
1530
+ itemId: string & z.BRAND<"CompactionSemanticItemId">;
1531
+ category: "resource" | "running_session" | "goal" | "constraint" | "decision" | "completed_work" | "pending_work" | "uncertainty";
1532
+ }, {
1533
+ text: string;
1534
+ sourceQuotes: string[];
1535
+ itemId: string;
1536
+ category: "resource" | "running_session" | "goal" | "constraint" | "decision" | "completed_work" | "pending_work" | "uncertainty";
1537
+ }>>, "many">;
1538
+ omittedCounts: z.ZodReadonly<z.ZodObject<{
1539
+ goal: z.ZodNumber;
1540
+ constraint: z.ZodNumber;
1541
+ decision: z.ZodNumber;
1542
+ completed_work: z.ZodNumber;
1543
+ pending_work: z.ZodNumber;
1544
+ resource: z.ZodNumber;
1545
+ running_session: z.ZodNumber;
1546
+ uncertainty: z.ZodNumber;
1547
+ }, "strict", z.ZodTypeAny, {
1548
+ resource: number;
1549
+ running_session: number;
1550
+ goal: number;
1551
+ constraint: number;
1552
+ decision: number;
1553
+ completed_work: number;
1554
+ pending_work: number;
1555
+ uncertainty: number;
1556
+ }, {
1557
+ resource: number;
1558
+ running_session: number;
1559
+ goal: number;
1560
+ constraint: number;
1561
+ decision: number;
1562
+ completed_work: number;
1563
+ pending_work: number;
1564
+ uncertainty: number;
1565
+ }>>;
1566
+ }, "strict", z.ZodTypeAny, {
1567
+ version: 1;
1568
+ items: Readonly<{
1569
+ text: string;
1570
+ sourceQuotes: string[];
1571
+ itemId: string & z.BRAND<"CompactionSemanticItemId">;
1572
+ category: "resource" | "running_session" | "goal" | "constraint" | "decision" | "completed_work" | "pending_work" | "uncertainty";
1573
+ }>[];
1574
+ omittedCounts: Readonly<{
1575
+ resource: number;
1576
+ running_session: number;
1577
+ goal: number;
1578
+ constraint: number;
1579
+ decision: number;
1580
+ completed_work: number;
1581
+ pending_work: number;
1582
+ uncertainty: number;
1583
+ }>;
1584
+ }, {
1585
+ version: 1;
1586
+ items: Readonly<{
1587
+ text: string;
1588
+ sourceQuotes: string[];
1589
+ itemId: string;
1590
+ category: "resource" | "running_session" | "goal" | "constraint" | "decision" | "completed_work" | "pending_work" | "uncertainty";
1591
+ }>[];
1592
+ omittedCounts: Readonly<{
1593
+ resource: number;
1594
+ running_session: number;
1595
+ goal: number;
1596
+ constraint: number;
1597
+ decision: number;
1598
+ completed_work: number;
1599
+ pending_work: number;
1600
+ uncertainty: number;
1601
+ }>;
1602
+ }>>;
1603
+ export type CompactionSemanticReminderProjection = z.infer<typeof compactionSemanticReminderProjectionSchema>;
1604
+ export interface CompactionSemanticResolution {
1605
+ readonly targetItemId: CompactionSemanticItemId;
1606
+ readonly targetCategory: "constraint" | "decision" | "pending_work" | "uncertainty";
1607
+ readonly action: "cancel" | "supersede" | "clarify" | "revoke";
1608
+ readonly reason: string;
1609
+ readonly provenance: readonly CompactionProvenanceRef[];
1610
+ }
1611
+ export interface CompactionSemanticMessageEvidence {
1612
+ readonly sequence: number;
1613
+ readonly role?: string;
1614
+ readonly summary: string;
1615
+ }
1616
+ export interface CompactionSemanticToolEvidence {
1617
+ readonly id: string;
1618
+ readonly agentName?: string;
1619
+ readonly toolName?: string;
1620
+ /** Bounded and redacted by the Harness before entering model context. */
1621
+ readonly inputSummary?: string;
1622
+ /** Bounded and redacted by the Harness before entering model context. */
1623
+ readonly resultSummary?: string;
1624
+ readonly outcome: {
1625
+ readonly kind: string;
1626
+ };
1627
+ }
1628
+ export interface CompactionSemanticResourceEvidence {
1629
+ readonly key: string;
1630
+ readonly mode?: string;
1631
+ }
1632
+ export interface CompactionSemanticRunningSessionEvidence {
1633
+ readonly managerInstanceId: string;
1634
+ readonly sessionId: number;
1635
+ readonly state?: string;
1636
+ }
1637
+ export interface BuildCompactionSemanticEvidenceRegistryInput {
1638
+ readonly messages: readonly CompactionSemanticMessageEvidence[];
1639
+ readonly toolExecutions: readonly CompactionSemanticToolEvidence[];
1640
+ readonly resources: readonly CompactionSemanticResourceEvidence[];
1641
+ readonly runningSessions: readonly CompactionSemanticRunningSessionEvidence[];
1642
+ }
1643
+ export interface CompactionSemanticEvidenceRegistryEntry {
1644
+ readonly evidenceId: string;
1645
+ readonly summary: string;
1646
+ readonly provenance: CompactionProvenanceRef;
1647
+ readonly messageRole?: string;
1648
+ readonly toolOutcomeKind?: string;
1649
+ }
1650
+ export type CompactionSemanticEvidenceRegistry = readonly CompactionSemanticEvidenceRegistryEntry[];
1651
+ export interface ValidateCompactionModelDraftInput {
1652
+ readonly draft: unknown;
1653
+ readonly evidenceRegistry: CompactionSemanticEvidenceRegistry;
1654
+ readonly presentedEvidenceIds?: readonly string[];
1655
+ readonly previousState?: CompactionSemanticState;
1656
+ readonly harnessGoal?: {
1657
+ readonly verbatimRequest: string;
1658
+ readonly sourceSequence: number;
1659
+ };
1660
+ }
1661
+ export interface MergeCompactionSemanticStateOptions {
1662
+ /** Computed by the Harness from durable goal sourceSequence, never from model wording or IDs. */
1663
+ readonly startsNewGoalScope: boolean;
1664
+ }
1665
+ export declare const COMPACTION_SEMANTIC_REJECTION_REASONS: readonly ["unknown_provenance", "missing_required_provenance", "completed_work_without_success_evidence", "resource_not_observed", "running_session_not_observed", "unknown_resolution_target", "resolution_target_category_mismatch", "invalid_resolution_action", "unsupported_source_quote", "unknown_evidence_review"];
1666
+ export interface CompactionSemanticRejection {
1667
+ readonly category: "goal" | "constraint" | "decision" | "completed_work" | "pending_work" | "resource" | "running_session" | "uncertainty" | "resolution" | "evidence_review";
1668
+ readonly index: number;
1669
+ readonly reason: (typeof COMPACTION_SEMANTIC_REJECTION_REASONS)[number];
1670
+ }
1671
+ export interface ValidatedCompactionSemanticCandidate {
1672
+ readonly state: CompactionSemanticState;
1673
+ readonly resolutions: readonly CompactionSemanticResolution[];
1674
+ readonly rejections: readonly CompactionSemanticRejection[];
1675
+ readonly coveredEvidenceIds: readonly string[];
1676
+ readonly startsNewGoalScope: boolean;
1677
+ }
1678
+ /** Builds opaque model-facing handles backed by exact Harness-owned facts. */
1679
+ export declare function buildCompactionSemanticEvidenceRegistry(input: BuildCompactionSemanticEvidenceRegistryInput): CompactionSemanticEvidenceRegistry;
1680
+ /** Renders opaque evidence handles in caller-provided priority order with a hard bound. */
1681
+ export declare function renderCompactionSemanticEvidenceRegistry(registry: CompactionSemanticEvidenceRegistry, maxChars?: number): string;
1682
+ export interface CompactionSemanticModelContext {
1683
+ readonly prompt: string;
1684
+ readonly includedEvidenceIds: readonly string[];
1685
+ }
1686
+ /** Returns both the bounded prompt and the exact evidence handles shown to the model. */
1687
+ export declare function buildCompactionSemanticModelContext(registry: CompactionSemanticEvidenceRegistry, previousState: CompactionSemanticState | undefined, maxChars?: number): CompactionSemanticModelContext;
1688
+ /** Includes prior stable IDs/text so the model can explicitly retain or resolve known items. */
1689
+ export declare function renderCompactionSemanticModelContext(registry: CompactionSemanticEvidenceRegistry, previousState: CompactionSemanticState | undefined, maxChars?: number): string;
1690
+ /**
1691
+ * Validates a model-authored semantic candidate against Harness-owned evidence.
1692
+ * Invalid individual claims are rejected without turning the remaining grounded
1693
+ * candidate into an all-or-nothing failure.
1694
+ */
1695
+ export declare function validateCompactionModelDraft(input: ValidateCompactionModelDraftInput): ValidatedCompactionSemanticCandidate;
1696
+ export declare function createEmptyCompactionSemanticState(): CompactionSemanticState;
1697
+ /** Seeds V1/top-level constraint evidence into the V2 semantic state without language heuristics. */
1698
+ export declare function seedCompactionSemanticConstraints(stateInput: CompactionSemanticState | undefined, constraints: readonly {
1699
+ readonly quote: string;
1700
+ readonly sourceSequence: number;
1701
+ }[]): CompactionSemanticState;
1702
+ export interface LegacyCompactionSnapshotMigrationResult {
1703
+ readonly state: CompactionSemanticState;
1704
+ /** Every migrated fragment must remain visible in the first V2 checkpoint reminder. */
1705
+ readonly requiredItemIds: readonly CompactionSemanticItemId[];
1706
+ /** Exact, redacted fragments that must be archived in transcript when V1 is retired. */
1707
+ readonly transcriptFragments: LegacyCompactionTranscriptFragments;
1708
+ /** False means at least one legacy snapshot chunk did not fit and its active prefix must stay. */
1709
+ readonly complete: boolean;
1710
+ }
1711
+ /**
1712
+ * Migrates an old active snapshot into low-confidence V2 state. It may only become uncertainty:
1713
+ * legacy prose is not authoritative user intent or Tool completion evidence.
1714
+ */
1715
+ export declare function seedLegacyCompactionSnapshotUncertainties(stateInput: CompactionSemanticState, input: {
1716
+ readonly checkpointId: string;
1717
+ readonly fragments: readonly string[];
1718
+ }): LegacyCompactionSnapshotMigrationResult;
1719
+ /** Deterministic truncate mode replaces only the constraint slice from verbatim user evidence. */
1720
+ export declare function replaceCompactionSemanticConstraints(stateInput: CompactionSemanticState, constraints: readonly {
1721
+ readonly quote: string;
1722
+ readonly sourceSequence: number;
1723
+ }[]): CompactionSemanticState;
1724
+ /** Deterministic truncate mode may advance the goal only from an exact persisted user request. */
1725
+ export declare function replaceCompactionSemanticGoal(stateInput: CompactionSemanticState, goal: {
1726
+ readonly verbatimRequest: string;
1727
+ readonly sourceSequence: number;
1728
+ } | undefined): CompactionSemanticState;
1729
+ /**
1730
+ * Carries grounded state forward. Empty candidate arrays do not erase history;
1731
+ * removal requires an evidence-grounded, category-specific explicit resolution.
1732
+ */
1733
+ export declare function mergeCompactionSemanticState(previousInput: CompactionSemanticState | undefined, candidateInput: ValidatedCompactionSemanticCandidate, options: MergeCompactionSemanticStateOptions): CompactionSemanticState;
1734
+ /**
1735
+ * Projects the durable semantic state into a bounded, structured prompt reminder.
1736
+ * The complete state remains in the checkpoint and can be recovered through the
1737
+ * transcript path; omitted counts make prompt truncation explicit to the model.
1738
+ */
1739
+ export declare function createCompactionSemanticReminderProjection(stateInput: CompactionSemanticState, maxChars?: number): CompactionSemanticReminderProjection;
1740
+ /** Renders a deterministic, bounded presentation derived only from grounded state. */
1741
+ export declare function renderCompactionSemanticSummary(stateInput: CompactionSemanticState, maxChars?: number): string;