@linnlabs/linnkit 0.32.2 → 0.33.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 (78) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cli.cjs +312 -50
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +312 -50
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager.cjs +1 -0
  7. package/dist/context-manager.cjs.map +1 -1
  8. package/dist/context-manager.js +1 -0
  9. package/dist/context-manager.js.map +1 -1
  10. package/dist/contracts/agentSpec.d.cts +30 -30
  11. package/dist/contracts/agentSpec.d.ts +30 -30
  12. package/dist/contracts/audit.d.cts +32 -32
  13. package/dist/contracts/audit.d.ts +32 -32
  14. package/dist/contracts/contextPolicy.d.cts +36 -36
  15. package/dist/contracts/contextPolicy.d.ts +36 -36
  16. package/dist/contracts/events.d.cts +968 -968
  17. package/dist/contracts/events.d.ts +968 -968
  18. package/dist/contracts/execution.d.cts +8 -8
  19. package/dist/contracts/execution.d.ts +8 -8
  20. package/dist/contracts/messages.d.cts +204 -204
  21. package/dist/contracts/messages.d.ts +204 -204
  22. package/dist/contracts/sse.d.cts +891 -891
  23. package/dist/contracts/sse.d.ts +891 -891
  24. package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
  25. package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
  26. package/dist/contracts/token-accounting.d.cts +28 -28
  27. package/dist/contracts/token-accounting.d.ts +28 -28
  28. package/dist/index.cjs +383 -66
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.js +383 -66
  31. package/dist/index.js.map +1 -1
  32. package/dist/quickstart/toolRuntime.d.cts +1 -1
  33. package/dist/quickstart/toolRuntime.d.ts +1 -1
  34. package/dist/quickstart/types.d.cts +1 -1
  35. package/dist/quickstart/types.d.ts +1 -1
  36. package/dist/quickstart.cjs +312 -50
  37. package/dist/quickstart.cjs.map +1 -1
  38. package/dist/quickstart.js +312 -50
  39. package/dist/quickstart.js.map +1 -1
  40. package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +11 -0
  41. package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +11 -0
  42. package/dist/runtime-kernel/events/agentEvents.d.cts +98 -98
  43. package/dist/runtime-kernel/events/agentEvents.d.ts +98 -98
  44. package/dist/runtime-kernel/execution/eventBusEventPersistence.d.cts +15 -1
  45. package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +15 -1
  46. package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.cts +34 -0
  47. package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.ts +34 -0
  48. package/dist/runtime-kernel/graph-engine/engine.d.cts +13 -2
  49. package/dist/runtime-kernel/graph-engine/engine.d.ts +13 -2
  50. package/dist/runtime-kernel/graph-engine/index.d.cts +2 -1
  51. package/dist/runtime-kernel/graph-engine/index.d.ts +2 -1
  52. package/dist/runtime-kernel/graph-engine/types.d.cts +8 -0
  53. package/dist/runtime-kernel/graph-engine/types.d.ts +8 -0
  54. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +14 -2
  55. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +14 -2
  56. package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +1 -0
  57. package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +1 -0
  58. package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +9 -5
  59. package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +9 -5
  60. package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +2 -0
  61. package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +2 -0
  62. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +7 -1
  63. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +7 -1
  64. package/dist/runtime-kernel.cjs +383 -66
  65. package/dist/runtime-kernel.cjs.map +1 -1
  66. package/dist/runtime-kernel.d.cts +2 -1
  67. package/dist/runtime-kernel.d.ts +2 -1
  68. package/dist/runtime-kernel.js +381 -67
  69. package/dist/runtime-kernel.js.map +1 -1
  70. package/dist/testkit.cjs +383 -66
  71. package/dist/testkit.cjs.map +1 -1
  72. package/dist/testkit.js +383 -66
  73. package/dist/testkit.js.map +1 -1
  74. package/docs/integration/01-installation.md +1 -1
  75. package/docs/integration/child-runs.md +12 -0
  76. package/docs/integration/persistence.md +23 -0
  77. package/docs/integration/run-supervisor.md +12 -2
  78. package/package.json +4 -4
@@ -14,12 +14,12 @@ declare const SubRunTraceToolCallDecision: z.ZodObject<{
14
14
  tool_name: z.ZodString;
15
15
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
16
16
  }, "strict", z.ZodTypeAny, {
17
- tool_call_id: string & z.BRAND<"ToolCallId">;
18
17
  tool_name: string;
18
+ tool_call_id: string & z.BRAND<"ToolCallId">;
19
19
  args: Record<string, SerializableJsonValue>;
20
20
  }, {
21
- tool_call_id: string;
22
21
  tool_name: string;
22
+ tool_call_id: string;
23
23
  args: Record<string, SerializableJsonValue>;
24
24
  }>;
25
25
  type SubRunTraceToolCallDecision = z.infer<typeof SubRunTraceToolCallDecision>;
@@ -45,12 +45,12 @@ declare const SubRunTracePayload: z.ZodObject<{
45
45
  tool_name: z.ZodString;
46
46
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
47
47
  }, "strict", z.ZodTypeAny, {
48
- tool_call_id: string & z.BRAND<"ToolCallId">;
49
48
  tool_name: string;
49
+ tool_call_id: string & z.BRAND<"ToolCallId">;
50
50
  args: Record<string, SerializableJsonValue>;
51
51
  }, {
52
- tool_call_id: string;
53
52
  tool_name: string;
53
+ tool_call_id: string;
54
54
  args: Record<string, SerializableJsonValue>;
55
55
  }>, "many">>;
56
56
  output: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
@@ -95,20 +95,11 @@ declare const SubRunTracePayload: z.ZodObject<{
95
95
  replaced_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
96
96
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
97
97
  }, "strip", z.ZodTypeAny, {
98
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
98
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
99
99
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
100
100
  subrun_id: string;
101
101
  source_event_id: string;
102
102
  status?: "error" | "loading" | "success" | undefined;
103
- tool_calls?: {
104
- tool_call_id: string & z.BRAND<"ToolCallId">;
105
- tool_name: string;
106
- args: Record<string, SerializableJsonValue>;
107
- }[] | undefined;
108
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
109
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
110
- tool_name?: string | undefined;
111
- args?: Record<string, SerializableJsonValue> | undefined;
112
103
  content?: string | undefined;
113
104
  attachments?: {
114
105
  id: string;
@@ -123,33 +114,33 @@ declare const SubRunTracePayload: z.ZodObject<{
123
114
  label?: string | undefined;
124
115
  }[] | undefined;
125
116
  delta?: string | undefined;
126
- phase?: "error" | "start" | "update" | "complete" | undefined;
117
+ tool_name?: string | undefined;
118
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
119
+ phase?: "start" | "update" | "complete" | "error" | undefined;
120
+ args?: Record<string, SerializableJsonValue> | undefined;
121
+ tool_calls?: {
122
+ tool_name: string;
123
+ tool_call_id: string & z.BRAND<"ToolCallId">;
124
+ args: Record<string, SerializableJsonValue>;
125
+ }[] | undefined;
127
126
  meta?: Record<string, SerializableJsonValue> | undefined;
128
127
  duration_ms?: number | undefined;
129
128
  subrun_parent_id?: string | undefined;
130
129
  answer_id?: string | undefined;
131
130
  seq?: number | undefined;
132
131
  is_last?: boolean | undefined;
132
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
133
133
  output?: SerializableJsonValue | undefined;
134
134
  original_message_count?: number | undefined;
135
135
  compression_ratio?: number | undefined;
136
136
  included_old_summary?: boolean | undefined;
137
137
  replaced_message_ids?: string[] | undefined;
138
138
  }, {
139
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
139
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
140
140
  parent_tool_call_id: string;
141
141
  subrun_id: string;
142
142
  source_event_id: string;
143
143
  status?: "error" | "loading" | "success" | undefined;
144
- tool_calls?: {
145
- tool_call_id: string;
146
- tool_name: string;
147
- args: Record<string, SerializableJsonValue>;
148
- }[] | undefined;
149
- tool_call_id?: string | undefined;
150
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
151
- tool_name?: string | undefined;
152
- args?: Record<string, SerializableJsonValue> | undefined;
153
144
  content?: string | undefined;
154
145
  attachments?: {
155
146
  id: string;
@@ -164,13 +155,22 @@ declare const SubRunTracePayload: z.ZodObject<{
164
155
  label?: string | undefined;
165
156
  }[] | undefined;
166
157
  delta?: string | undefined;
167
- phase?: "error" | "start" | "update" | "complete" | undefined;
158
+ tool_name?: string | undefined;
159
+ tool_call_id?: string | undefined;
160
+ phase?: "start" | "update" | "complete" | "error" | undefined;
161
+ args?: Record<string, SerializableJsonValue> | undefined;
162
+ tool_calls?: {
163
+ tool_name: string;
164
+ tool_call_id: string;
165
+ args: Record<string, SerializableJsonValue>;
166
+ }[] | undefined;
168
167
  meta?: Record<string, SerializableJsonValue> | undefined;
169
168
  duration_ms?: number | undefined;
170
169
  subrun_parent_id?: string | undefined;
171
170
  answer_id?: string | undefined;
172
171
  seq?: number | undefined;
173
172
  is_last?: boolean | undefined;
173
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
174
174
  output?: SerializableJsonValue | undefined;
175
175
  original_message_count?: number | undefined;
176
176
  compression_ratio?: number | undefined;
@@ -14,12 +14,12 @@ declare const SubRunTraceToolCallDecision: z.ZodObject<{
14
14
  tool_name: z.ZodString;
15
15
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
16
16
  }, "strict", z.ZodTypeAny, {
17
- tool_call_id: string & z.BRAND<"ToolCallId">;
18
17
  tool_name: string;
18
+ tool_call_id: string & z.BRAND<"ToolCallId">;
19
19
  args: Record<string, SerializableJsonValue>;
20
20
  }, {
21
- tool_call_id: string;
22
21
  tool_name: string;
22
+ tool_call_id: string;
23
23
  args: Record<string, SerializableJsonValue>;
24
24
  }>;
25
25
  type SubRunTraceToolCallDecision = z.infer<typeof SubRunTraceToolCallDecision>;
@@ -45,12 +45,12 @@ declare const SubRunTracePayload: z.ZodObject<{
45
45
  tool_name: z.ZodString;
46
46
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
47
47
  }, "strict", z.ZodTypeAny, {
48
- tool_call_id: string & z.BRAND<"ToolCallId">;
49
48
  tool_name: string;
49
+ tool_call_id: string & z.BRAND<"ToolCallId">;
50
50
  args: Record<string, SerializableJsonValue>;
51
51
  }, {
52
- tool_call_id: string;
53
52
  tool_name: string;
53
+ tool_call_id: string;
54
54
  args: Record<string, SerializableJsonValue>;
55
55
  }>, "many">>;
56
56
  output: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
@@ -95,20 +95,11 @@ declare const SubRunTracePayload: z.ZodObject<{
95
95
  replaced_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
96
96
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
97
97
  }, "strip", z.ZodTypeAny, {
98
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
98
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
99
99
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
100
100
  subrun_id: string;
101
101
  source_event_id: string;
102
102
  status?: "error" | "loading" | "success" | undefined;
103
- tool_calls?: {
104
- tool_call_id: string & z.BRAND<"ToolCallId">;
105
- tool_name: string;
106
- args: Record<string, SerializableJsonValue>;
107
- }[] | undefined;
108
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
109
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
110
- tool_name?: string | undefined;
111
- args?: Record<string, SerializableJsonValue> | undefined;
112
103
  content?: string | undefined;
113
104
  attachments?: {
114
105
  id: string;
@@ -123,33 +114,33 @@ declare const SubRunTracePayload: z.ZodObject<{
123
114
  label?: string | undefined;
124
115
  }[] | undefined;
125
116
  delta?: string | undefined;
126
- phase?: "error" | "start" | "update" | "complete" | undefined;
117
+ tool_name?: string | undefined;
118
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
119
+ phase?: "start" | "update" | "complete" | "error" | undefined;
120
+ args?: Record<string, SerializableJsonValue> | undefined;
121
+ tool_calls?: {
122
+ tool_name: string;
123
+ tool_call_id: string & z.BRAND<"ToolCallId">;
124
+ args: Record<string, SerializableJsonValue>;
125
+ }[] | undefined;
127
126
  meta?: Record<string, SerializableJsonValue> | undefined;
128
127
  duration_ms?: number | undefined;
129
128
  subrun_parent_id?: string | undefined;
130
129
  answer_id?: string | undefined;
131
130
  seq?: number | undefined;
132
131
  is_last?: boolean | undefined;
132
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
133
133
  output?: SerializableJsonValue | undefined;
134
134
  original_message_count?: number | undefined;
135
135
  compression_ratio?: number | undefined;
136
136
  included_old_summary?: boolean | undefined;
137
137
  replaced_message_ids?: string[] | undefined;
138
138
  }, {
139
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
139
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
140
140
  parent_tool_call_id: string;
141
141
  subrun_id: string;
142
142
  source_event_id: string;
143
143
  status?: "error" | "loading" | "success" | undefined;
144
- tool_calls?: {
145
- tool_call_id: string;
146
- tool_name: string;
147
- args: Record<string, SerializableJsonValue>;
148
- }[] | undefined;
149
- tool_call_id?: string | undefined;
150
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
151
- tool_name?: string | undefined;
152
- args?: Record<string, SerializableJsonValue> | undefined;
153
144
  content?: string | undefined;
154
145
  attachments?: {
155
146
  id: string;
@@ -164,13 +155,22 @@ declare const SubRunTracePayload: z.ZodObject<{
164
155
  label?: string | undefined;
165
156
  }[] | undefined;
166
157
  delta?: string | undefined;
167
- phase?: "error" | "start" | "update" | "complete" | undefined;
158
+ tool_name?: string | undefined;
159
+ tool_call_id?: string | undefined;
160
+ phase?: "start" | "update" | "complete" | "error" | undefined;
161
+ args?: Record<string, SerializableJsonValue> | undefined;
162
+ tool_calls?: {
163
+ tool_name: string;
164
+ tool_call_id: string;
165
+ args: Record<string, SerializableJsonValue>;
166
+ }[] | undefined;
168
167
  meta?: Record<string, SerializableJsonValue> | undefined;
169
168
  duration_ms?: number | undefined;
170
169
  subrun_parent_id?: string | undefined;
171
170
  answer_id?: string | undefined;
172
171
  seq?: number | undefined;
173
172
  is_last?: boolean | undefined;
173
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
174
174
  output?: SerializableJsonValue | undefined;
175
175
  original_message_count?: number | undefined;
176
176
  compression_ratio?: number | undefined;
@@ -56,8 +56,8 @@ declare const ContextTokenComponent: z.ZodObject<{
56
56
  profileId: z.ZodOptional<z.ZodString>;
57
57
  estimatorVersion: z.ZodOptional<z.ZodString>;
58
58
  }, "strip", z.ZodTypeAny, {
59
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
60
59
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
60
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
61
61
  confidence: "estimate" | "provider-estimate" | "actual";
62
62
  componentId: string;
63
63
  tokens: number;
@@ -65,9 +65,9 @@ declare const ContextTokenComponent: z.ZodObject<{
65
65
  width?: number | undefined;
66
66
  height?: number | undefined;
67
67
  label?: string | undefined;
68
+ action?: string | undefined;
68
69
  role?: string | undefined;
69
70
  profileId?: string | undefined;
70
- action?: string | undefined;
71
71
  messageId?: string | undefined;
72
72
  kept?: boolean | undefined;
73
73
  truncatedAtExecution?: boolean | undefined;
@@ -78,8 +78,8 @@ declare const ContextTokenComponent: z.ZodObject<{
78
78
  attachmentIndex?: number | undefined;
79
79
  estimatorVersion?: string | undefined;
80
80
  }, {
81
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
82
81
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
82
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
83
83
  confidence: "estimate" | "provider-estimate" | "actual";
84
84
  componentId: string;
85
85
  tokens: number;
@@ -87,9 +87,9 @@ declare const ContextTokenComponent: z.ZodObject<{
87
87
  width?: number | undefined;
88
88
  height?: number | undefined;
89
89
  label?: string | undefined;
90
+ action?: string | undefined;
90
91
  role?: string | undefined;
91
92
  profileId?: string | undefined;
92
- action?: string | undefined;
93
93
  messageId?: string | undefined;
94
94
  kept?: boolean | undefined;
95
95
  truncatedAtExecution?: boolean | undefined;
@@ -205,9 +205,9 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
205
205
  totalTokens?: number | undefined;
206
206
  rawUsage?: unknown;
207
207
  };
208
- conversationId?: string | undefined;
209
208
  runId?: string | undefined;
210
209
  parentRunId?: string | undefined;
210
+ conversationId?: string | undefined;
211
211
  turnId?: string | undefined;
212
212
  modelId?: string | undefined;
213
213
  stepId?: string | undefined;
@@ -239,9 +239,9 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
239
239
  totalTokens?: number | undefined;
240
240
  rawUsage?: unknown;
241
241
  };
242
- conversationId?: string | undefined;
243
242
  runId?: string | undefined;
244
243
  parentRunId?: string | undefined;
244
+ conversationId?: string | undefined;
245
245
  turnId?: string | undefined;
246
246
  modelId?: string | undefined;
247
247
  stepId?: string | undefined;
@@ -337,8 +337,8 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
337
337
  profileId: z.ZodOptional<z.ZodString>;
338
338
  estimatorVersion: z.ZodOptional<z.ZodString>;
339
339
  }, "strip", z.ZodTypeAny, {
340
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
341
340
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
341
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
342
342
  confidence: "estimate" | "provider-estimate" | "actual";
343
343
  componentId: string;
344
344
  tokens: number;
@@ -346,9 +346,9 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
346
346
  width?: number | undefined;
347
347
  height?: number | undefined;
348
348
  label?: string | undefined;
349
+ action?: string | undefined;
349
350
  role?: string | undefined;
350
351
  profileId?: string | undefined;
351
- action?: string | undefined;
352
352
  messageId?: string | undefined;
353
353
  kept?: boolean | undefined;
354
354
  truncatedAtExecution?: boolean | undefined;
@@ -359,8 +359,8 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
359
359
  attachmentIndex?: number | undefined;
360
360
  estimatorVersion?: string | undefined;
361
361
  }, {
362
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
363
362
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
363
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
364
364
  confidence: "estimate" | "provider-estimate" | "actual";
365
365
  componentId: string;
366
366
  tokens: number;
@@ -368,9 +368,9 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
368
368
  width?: number | undefined;
369
369
  height?: number | undefined;
370
370
  label?: string | undefined;
371
+ action?: string | undefined;
371
372
  role?: string | undefined;
372
373
  profileId?: string | undefined;
373
- action?: string | undefined;
374
374
  messageId?: string | undefined;
375
375
  kept?: boolean | undefined;
376
376
  truncatedAtExecution?: boolean | undefined;
@@ -386,8 +386,8 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
386
386
  id: string;
387
387
  kind: "context-component";
388
388
  components: {
389
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
390
389
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
390
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
391
391
  confidence: "estimate" | "provider-estimate" | "actual";
392
392
  componentId: string;
393
393
  tokens: number;
@@ -395,9 +395,9 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
395
395
  width?: number | undefined;
396
396
  height?: number | undefined;
397
397
  label?: string | undefined;
398
+ action?: string | undefined;
398
399
  role?: string | undefined;
399
400
  profileId?: string | undefined;
400
- action?: string | undefined;
401
401
  messageId?: string | undefined;
402
402
  kept?: boolean | undefined;
403
403
  truncatedAtExecution?: boolean | undefined;
@@ -409,9 +409,9 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
409
409
  estimatorVersion?: string | undefined;
410
410
  }[];
411
411
  totalTokens: number;
412
- conversationId?: string | undefined;
413
412
  runId?: string | undefined;
414
413
  parentRunId?: string | undefined;
414
+ conversationId?: string | undefined;
415
415
  turnId?: string | undefined;
416
416
  stepId?: string | undefined;
417
417
  route?: {
@@ -431,8 +431,8 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
431
431
  id: string;
432
432
  kind: "context-component";
433
433
  components: {
434
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
435
434
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
435
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
436
436
  confidence: "estimate" | "provider-estimate" | "actual";
437
437
  componentId: string;
438
438
  tokens: number;
@@ -440,9 +440,9 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
440
440
  width?: number | undefined;
441
441
  height?: number | undefined;
442
442
  label?: string | undefined;
443
+ action?: string | undefined;
443
444
  role?: string | undefined;
444
445
  profileId?: string | undefined;
445
- action?: string | undefined;
446
446
  messageId?: string | undefined;
447
447
  kept?: boolean | undefined;
448
448
  truncatedAtExecution?: boolean | undefined;
@@ -454,9 +454,9 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
454
454
  estimatorVersion?: string | undefined;
455
455
  }[];
456
456
  totalTokens: number;
457
- conversationId?: string | undefined;
458
457
  runId?: string | undefined;
459
458
  parentRunId?: string | undefined;
459
+ conversationId?: string | undefined;
460
460
  turnId?: string | undefined;
461
461
  stepId?: string | undefined;
462
462
  route?: {
@@ -578,9 +578,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
578
578
  totalTokens?: number | undefined;
579
579
  rawUsage?: unknown;
580
580
  };
581
- conversationId?: string | undefined;
582
581
  runId?: string | undefined;
583
582
  parentRunId?: string | undefined;
583
+ conversationId?: string | undefined;
584
584
  turnId?: string | undefined;
585
585
  modelId?: string | undefined;
586
586
  stepId?: string | undefined;
@@ -612,9 +612,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
612
612
  totalTokens?: number | undefined;
613
613
  rawUsage?: unknown;
614
614
  };
615
- conversationId?: string | undefined;
616
615
  runId?: string | undefined;
617
616
  parentRunId?: string | undefined;
617
+ conversationId?: string | undefined;
618
618
  turnId?: string | undefined;
619
619
  modelId?: string | undefined;
620
620
  stepId?: string | undefined;
@@ -708,8 +708,8 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
708
708
  profileId: z.ZodOptional<z.ZodString>;
709
709
  estimatorVersion: z.ZodOptional<z.ZodString>;
710
710
  }, "strip", z.ZodTypeAny, {
711
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
712
711
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
712
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
713
713
  confidence: "estimate" | "provider-estimate" | "actual";
714
714
  componentId: string;
715
715
  tokens: number;
@@ -717,9 +717,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
717
717
  width?: number | undefined;
718
718
  height?: number | undefined;
719
719
  label?: string | undefined;
720
+ action?: string | undefined;
720
721
  role?: string | undefined;
721
722
  profileId?: string | undefined;
722
- action?: string | undefined;
723
723
  messageId?: string | undefined;
724
724
  kept?: boolean | undefined;
725
725
  truncatedAtExecution?: boolean | undefined;
@@ -730,8 +730,8 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
730
730
  attachmentIndex?: number | undefined;
731
731
  estimatorVersion?: string | undefined;
732
732
  }, {
733
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
734
733
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
734
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
735
735
  confidence: "estimate" | "provider-estimate" | "actual";
736
736
  componentId: string;
737
737
  tokens: number;
@@ -739,9 +739,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
739
739
  width?: number | undefined;
740
740
  height?: number | undefined;
741
741
  label?: string | undefined;
742
+ action?: string | undefined;
742
743
  role?: string | undefined;
743
744
  profileId?: string | undefined;
744
- action?: string | undefined;
745
745
  messageId?: string | undefined;
746
746
  kept?: boolean | undefined;
747
747
  truncatedAtExecution?: boolean | undefined;
@@ -757,8 +757,8 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
757
757
  id: string;
758
758
  kind: "context-component";
759
759
  components: {
760
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
761
760
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
761
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
762
762
  confidence: "estimate" | "provider-estimate" | "actual";
763
763
  componentId: string;
764
764
  tokens: number;
@@ -766,9 +766,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
766
766
  width?: number | undefined;
767
767
  height?: number | undefined;
768
768
  label?: string | undefined;
769
+ action?: string | undefined;
769
770
  role?: string | undefined;
770
771
  profileId?: string | undefined;
771
- action?: string | undefined;
772
772
  messageId?: string | undefined;
773
773
  kept?: boolean | undefined;
774
774
  truncatedAtExecution?: boolean | undefined;
@@ -780,9 +780,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
780
780
  estimatorVersion?: string | undefined;
781
781
  }[];
782
782
  totalTokens: number;
783
- conversationId?: string | undefined;
784
783
  runId?: string | undefined;
785
784
  parentRunId?: string | undefined;
785
+ conversationId?: string | undefined;
786
786
  turnId?: string | undefined;
787
787
  stepId?: string | undefined;
788
788
  route?: {
@@ -802,8 +802,8 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
802
802
  id: string;
803
803
  kind: "context-component";
804
804
  components: {
805
- kind: "system" | "user" | "assistant" | "tool" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
806
805
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
806
+ kind: "user" | "system" | "tool" | "assistant" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment" | "other";
807
807
  confidence: "estimate" | "provider-estimate" | "actual";
808
808
  componentId: string;
809
809
  tokens: number;
@@ -811,9 +811,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
811
811
  width?: number | undefined;
812
812
  height?: number | undefined;
813
813
  label?: string | undefined;
814
+ action?: string | undefined;
814
815
  role?: string | undefined;
815
816
  profileId?: string | undefined;
816
- action?: string | undefined;
817
817
  messageId?: string | undefined;
818
818
  kept?: boolean | undefined;
819
819
  truncatedAtExecution?: boolean | undefined;
@@ -825,9 +825,9 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
825
825
  estimatorVersion?: string | undefined;
826
826
  }[];
827
827
  totalTokens: number;
828
- conversationId?: string | undefined;
829
828
  runId?: string | undefined;
830
829
  parentRunId?: string | undefined;
830
+ conversationId?: string | undefined;
831
831
  turnId?: string | undefined;
832
832
  stepId?: string | undefined;
833
833
  route?: {