@linnlabs/linnkit 0.37.5 → 0.38.1

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 (65) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/dist/cli.cjs +346 -178
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +346 -178
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager.cjs +55 -11
  7. package/dist/context-manager.cjs.map +1 -1
  8. package/dist/context-manager.js +55 -11
  9. package/dist/context-manager.js.map +1 -1
  10. package/dist/contracts/events.d.cts +517 -35
  11. package/dist/contracts/events.d.ts +517 -35
  12. package/dist/contracts/llm-retry.d.cts +47 -0
  13. package/dist/contracts/llm-retry.d.ts +47 -0
  14. package/dist/contracts/runtime-error.d.cts +26 -0
  15. package/dist/contracts/runtime-error.d.ts +26 -0
  16. package/dist/contracts/sse.d.cts +555 -39
  17. package/dist/contracts/sse.d.ts +555 -39
  18. package/dist/contracts/sub-run-trace-payload.d.cts +102 -6
  19. package/dist/contracts/sub-run-trace-payload.d.ts +102 -6
  20. package/dist/contracts/token-accounting.d.cts +18 -18
  21. package/dist/contracts/token-accounting.d.ts +18 -18
  22. package/dist/contracts.cjs +65 -10
  23. package/dist/contracts.cjs.map +1 -1
  24. package/dist/contracts.d.cts +4 -2
  25. package/dist/contracts.d.ts +4 -2
  26. package/dist/contracts.js +62 -11
  27. package/dist/contracts.js.map +1 -1
  28. package/dist/index.cjs +551 -286
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.js +551 -286
  31. package/dist/index.js.map +1 -1
  32. package/dist/ports/canonical-inference.d.cts +3 -0
  33. package/dist/ports/canonical-inference.d.ts +3 -0
  34. package/dist/ports/llm-call.d.cts +4 -0
  35. package/dist/ports/llm-call.d.ts +4 -0
  36. package/dist/quickstart.cjs +346 -178
  37. package/dist/quickstart.cjs.map +1 -1
  38. package/dist/quickstart.js +346 -178
  39. package/dist/quickstart.js.map +1 -1
  40. package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.cts +8 -0
  41. package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.ts +8 -0
  42. package/dist/runtime-kernel/events/agentEvents.d.cts +85 -4
  43. package/dist/runtime-kernel/events/agentEvents.d.ts +85 -4
  44. package/dist/runtime-kernel/events/eventGovernance.d.cts +1 -1
  45. package/dist/runtime-kernel/events/eventGovernance.d.ts +1 -1
  46. package/dist/runtime-kernel/events.cjs +55 -11
  47. package/dist/runtime-kernel/events.cjs.map +1 -1
  48. package/dist/runtime-kernel/events.js +55 -11
  49. package/dist/runtime-kernel/events.js.map +1 -1
  50. package/dist/runtime-kernel/llm/request-builder.d.cts +2 -0
  51. package/dist/runtime-kernel/llm/request-builder.d.ts +2 -0
  52. package/dist/runtime-kernel.cjs +513 -271
  53. package/dist/runtime-kernel.cjs.map +1 -1
  54. package/dist/runtime-kernel.js +513 -271
  55. package/dist/runtime-kernel.js.map +1 -1
  56. package/dist/shared/errorClassifier.d.cts +5 -0
  57. package/dist/shared/errorClassifier.d.ts +5 -0
  58. package/dist/testkit.cjs +511 -269
  59. package/dist/testkit.cjs.map +1 -1
  60. package/dist/testkit.js +511 -269
  61. package/dist/testkit.js.map +1 -1
  62. package/docs/integration/llm-provider.md +24 -5
  63. package/docs/integration/realtime.md +29 -0
  64. package/docs/integration/tools.md +4 -0
  65. package/package.json +2 -2
@@ -7,7 +7,7 @@ import { SerializableJsonValue } from './json.cjs';
7
7
  * Host 查询、持久化读取、SSE 与插件公开类型都必须从这里派生;禁止在消费层
8
8
  * 重列 enum 或用 switch 维护另一份“可读取 kind”清单。
9
9
  */
10
- declare const SubRunTraceKind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary"]>;
10
+ declare const SubRunTraceKind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary", "llm_retry", "error"]>;
11
11
  type SubRunTraceKind = z.infer<typeof SubRunTraceKind>;
12
12
  declare const SubRunTraceToolCallDecision: z.ZodObject<{
13
13
  tool_call_id: z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "ToolCallId">;
@@ -28,7 +28,63 @@ declare const SubRunTracePayload: z.ZodObject<{
28
28
  subrun_id: z.ZodEffects<z.ZodString, string, string>;
29
29
  subrun_parent_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
30
30
  source_event_id: z.ZodEffects<z.ZodString, string, string>;
31
- kind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary"]>;
31
+ kind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary", "llm_retry", "error"]>;
32
+ retry: z.ZodOptional<z.ZodObject<{
33
+ retry_id: z.ZodEffects<z.ZodString, string, string>;
34
+ status: z.ZodEnum<["waiting", "retrying", "succeeded", "exhausted", "failed", "cancelled"]>;
35
+ category: z.ZodEnum<["transport", "output", "rate_limit", "other"]>;
36
+ attempt: z.ZodNumber;
37
+ max_retries: z.ZodNumber;
38
+ total_attempts: z.ZodNumber;
39
+ started_at: z.ZodNumber;
40
+ delay_ms: z.ZodNumber;
41
+ next_retry_at: z.ZodOptional<z.ZodNumber>;
42
+ error: z.ZodString;
43
+ error_code: z.ZodString;
44
+ }, "strict", z.ZodTypeAny, {
45
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
46
+ error: string;
47
+ error_code: string;
48
+ retry_id: string;
49
+ category: "transport" | "output" | "rate_limit" | "other";
50
+ attempt: number;
51
+ max_retries: number;
52
+ total_attempts: number;
53
+ started_at: number;
54
+ delay_ms: number;
55
+ next_retry_at?: number | undefined;
56
+ }, {
57
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
58
+ error: string;
59
+ error_code: string;
60
+ retry_id: string;
61
+ category: "transport" | "output" | "rate_limit" | "other";
62
+ attempt: number;
63
+ max_retries: number;
64
+ total_attempts: number;
65
+ started_at: number;
66
+ delay_ms: number;
67
+ next_retry_at?: number | undefined;
68
+ }>>;
69
+ failure: z.ZodOptional<z.ZodObject<{
70
+ error: z.ZodString;
71
+ error_code: z.ZodOptional<z.ZodString>;
72
+ retryable: z.ZodOptional<z.ZodBoolean>;
73
+ retry_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
74
+ details: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
75
+ }, "strict", z.ZodTypeAny, {
76
+ error: string;
77
+ error_code?: string | undefined;
78
+ retry_id?: string | undefined;
79
+ retryable?: boolean | undefined;
80
+ details?: SerializableJsonValue | undefined;
81
+ }, {
82
+ error: string;
83
+ error_code?: string | undefined;
84
+ retry_id?: string | undefined;
85
+ retryable?: boolean | undefined;
86
+ details?: SerializableJsonValue | undefined;
87
+ }>>;
32
88
  delta: z.ZodOptional<z.ZodString>;
33
89
  content: z.ZodOptional<z.ZodString>;
34
90
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -95,7 +151,7 @@ declare const SubRunTracePayload: z.ZodObject<{
95
151
  replaced_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
96
152
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
97
153
  }, "strip", z.ZodTypeAny, {
98
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
154
+ kind: "error" | "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "llm_retry";
99
155
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
100
156
  subrun_id: string;
101
157
  source_event_id: string;
@@ -122,21 +178,41 @@ declare const SubRunTracePayload: z.ZodObject<{
122
178
  fileName?: string | undefined;
123
179
  label?: string | undefined;
124
180
  }[] | undefined;
181
+ retry?: {
182
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
183
+ error: string;
184
+ error_code: string;
185
+ retry_id: string;
186
+ category: "transport" | "output" | "rate_limit" | "other";
187
+ attempt: number;
188
+ max_retries: number;
189
+ total_attempts: number;
190
+ started_at: number;
191
+ delay_ms: number;
192
+ next_retry_at?: number | undefined;
193
+ } | undefined;
125
194
  delta?: string | undefined;
126
195
  phase?: "error" | "start" | "update" | "complete" | undefined;
127
196
  meta?: Record<string, SerializableJsonValue> | undefined;
128
197
  duration_ms?: number | undefined;
129
198
  subrun_parent_id?: string | undefined;
199
+ output?: SerializableJsonValue | undefined;
200
+ failure?: {
201
+ error: string;
202
+ error_code?: string | undefined;
203
+ retry_id?: string | undefined;
204
+ retryable?: boolean | undefined;
205
+ details?: SerializableJsonValue | undefined;
206
+ } | undefined;
130
207
  answer_id?: string | undefined;
131
208
  seq?: number | undefined;
132
209
  is_last?: boolean | undefined;
133
- output?: SerializableJsonValue | undefined;
134
210
  original_message_count?: number | undefined;
135
211
  compression_ratio?: number | undefined;
136
212
  included_old_summary?: boolean | undefined;
137
213
  replaced_message_ids?: string[] | undefined;
138
214
  }, {
139
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
215
+ kind: "error" | "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "llm_retry";
140
216
  parent_tool_call_id: string;
141
217
  subrun_id: string;
142
218
  source_event_id: string;
@@ -163,15 +239,35 @@ declare const SubRunTracePayload: z.ZodObject<{
163
239
  fileName?: string | undefined;
164
240
  label?: string | undefined;
165
241
  }[] | undefined;
242
+ retry?: {
243
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
244
+ error: string;
245
+ error_code: string;
246
+ retry_id: string;
247
+ category: "transport" | "output" | "rate_limit" | "other";
248
+ attempt: number;
249
+ max_retries: number;
250
+ total_attempts: number;
251
+ started_at: number;
252
+ delay_ms: number;
253
+ next_retry_at?: number | undefined;
254
+ } | undefined;
166
255
  delta?: string | undefined;
167
256
  phase?: "error" | "start" | "update" | "complete" | undefined;
168
257
  meta?: Record<string, SerializableJsonValue> | undefined;
169
258
  duration_ms?: number | undefined;
170
259
  subrun_parent_id?: string | undefined;
260
+ output?: SerializableJsonValue | undefined;
261
+ failure?: {
262
+ error: string;
263
+ error_code?: string | undefined;
264
+ retry_id?: string | undefined;
265
+ retryable?: boolean | undefined;
266
+ details?: SerializableJsonValue | undefined;
267
+ } | undefined;
171
268
  answer_id?: string | undefined;
172
269
  seq?: number | undefined;
173
270
  is_last?: boolean | undefined;
174
- output?: SerializableJsonValue | undefined;
175
271
  original_message_count?: number | undefined;
176
272
  compression_ratio?: number | undefined;
177
273
  included_old_summary?: boolean | undefined;
@@ -7,7 +7,7 @@ import { SerializableJsonValue } from './json.js';
7
7
  * Host 查询、持久化读取、SSE 与插件公开类型都必须从这里派生;禁止在消费层
8
8
  * 重列 enum 或用 switch 维护另一份“可读取 kind”清单。
9
9
  */
10
- declare const SubRunTraceKind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary"]>;
10
+ declare const SubRunTraceKind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary", "llm_retry", "error"]>;
11
11
  type SubRunTraceKind = z.infer<typeof SubRunTraceKind>;
12
12
  declare const SubRunTraceToolCallDecision: z.ZodObject<{
13
13
  tool_call_id: z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "ToolCallId">;
@@ -28,7 +28,63 @@ declare const SubRunTracePayload: z.ZodObject<{
28
28
  subrun_id: z.ZodEffects<z.ZodString, string, string>;
29
29
  subrun_parent_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
30
30
  source_event_id: z.ZodEffects<z.ZodString, string, string>;
31
- kind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary"]>;
31
+ kind: z.ZodEnum<["thought_delta", "thought_complete", "tool_call_decision", "tool_process", "tool_output", "final_answer_chunk", "final_answer", "history_summary", "llm_retry", "error"]>;
32
+ retry: z.ZodOptional<z.ZodObject<{
33
+ retry_id: z.ZodEffects<z.ZodString, string, string>;
34
+ status: z.ZodEnum<["waiting", "retrying", "succeeded", "exhausted", "failed", "cancelled"]>;
35
+ category: z.ZodEnum<["transport", "output", "rate_limit", "other"]>;
36
+ attempt: z.ZodNumber;
37
+ max_retries: z.ZodNumber;
38
+ total_attempts: z.ZodNumber;
39
+ started_at: z.ZodNumber;
40
+ delay_ms: z.ZodNumber;
41
+ next_retry_at: z.ZodOptional<z.ZodNumber>;
42
+ error: z.ZodString;
43
+ error_code: z.ZodString;
44
+ }, "strict", z.ZodTypeAny, {
45
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
46
+ error: string;
47
+ error_code: string;
48
+ retry_id: string;
49
+ category: "transport" | "output" | "rate_limit" | "other";
50
+ attempt: number;
51
+ max_retries: number;
52
+ total_attempts: number;
53
+ started_at: number;
54
+ delay_ms: number;
55
+ next_retry_at?: number | undefined;
56
+ }, {
57
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
58
+ error: string;
59
+ error_code: string;
60
+ retry_id: string;
61
+ category: "transport" | "output" | "rate_limit" | "other";
62
+ attempt: number;
63
+ max_retries: number;
64
+ total_attempts: number;
65
+ started_at: number;
66
+ delay_ms: number;
67
+ next_retry_at?: number | undefined;
68
+ }>>;
69
+ failure: z.ZodOptional<z.ZodObject<{
70
+ error: z.ZodString;
71
+ error_code: z.ZodOptional<z.ZodString>;
72
+ retryable: z.ZodOptional<z.ZodBoolean>;
73
+ retry_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
74
+ details: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
75
+ }, "strict", z.ZodTypeAny, {
76
+ error: string;
77
+ error_code?: string | undefined;
78
+ retry_id?: string | undefined;
79
+ retryable?: boolean | undefined;
80
+ details?: SerializableJsonValue | undefined;
81
+ }, {
82
+ error: string;
83
+ error_code?: string | undefined;
84
+ retry_id?: string | undefined;
85
+ retryable?: boolean | undefined;
86
+ details?: SerializableJsonValue | undefined;
87
+ }>>;
32
88
  delta: z.ZodOptional<z.ZodString>;
33
89
  content: z.ZodOptional<z.ZodString>;
34
90
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -95,7 +151,7 @@ declare const SubRunTracePayload: z.ZodObject<{
95
151
  replaced_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
96
152
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
97
153
  }, "strip", z.ZodTypeAny, {
98
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
154
+ kind: "error" | "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "llm_retry";
99
155
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
100
156
  subrun_id: string;
101
157
  source_event_id: string;
@@ -122,21 +178,41 @@ declare const SubRunTracePayload: z.ZodObject<{
122
178
  fileName?: string | undefined;
123
179
  label?: string | undefined;
124
180
  }[] | undefined;
181
+ retry?: {
182
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
183
+ error: string;
184
+ error_code: string;
185
+ retry_id: string;
186
+ category: "transport" | "output" | "rate_limit" | "other";
187
+ attempt: number;
188
+ max_retries: number;
189
+ total_attempts: number;
190
+ started_at: number;
191
+ delay_ms: number;
192
+ next_retry_at?: number | undefined;
193
+ } | undefined;
125
194
  delta?: string | undefined;
126
195
  phase?: "error" | "start" | "update" | "complete" | undefined;
127
196
  meta?: Record<string, SerializableJsonValue> | undefined;
128
197
  duration_ms?: number | undefined;
129
198
  subrun_parent_id?: string | undefined;
199
+ output?: SerializableJsonValue | undefined;
200
+ failure?: {
201
+ error: string;
202
+ error_code?: string | undefined;
203
+ retry_id?: string | undefined;
204
+ retryable?: boolean | undefined;
205
+ details?: SerializableJsonValue | undefined;
206
+ } | undefined;
130
207
  answer_id?: string | undefined;
131
208
  seq?: number | undefined;
132
209
  is_last?: boolean | undefined;
133
- output?: SerializableJsonValue | undefined;
134
210
  original_message_count?: number | undefined;
135
211
  compression_ratio?: number | undefined;
136
212
  included_old_summary?: boolean | undefined;
137
213
  replaced_message_ids?: string[] | undefined;
138
214
  }, {
139
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
215
+ kind: "error" | "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "llm_retry";
140
216
  parent_tool_call_id: string;
141
217
  subrun_id: string;
142
218
  source_event_id: string;
@@ -163,15 +239,35 @@ declare const SubRunTracePayload: z.ZodObject<{
163
239
  fileName?: string | undefined;
164
240
  label?: string | undefined;
165
241
  }[] | undefined;
242
+ retry?: {
243
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
244
+ error: string;
245
+ error_code: string;
246
+ retry_id: string;
247
+ category: "transport" | "output" | "rate_limit" | "other";
248
+ attempt: number;
249
+ max_retries: number;
250
+ total_attempts: number;
251
+ started_at: number;
252
+ delay_ms: number;
253
+ next_retry_at?: number | undefined;
254
+ } | undefined;
166
255
  delta?: string | undefined;
167
256
  phase?: "error" | "start" | "update" | "complete" | undefined;
168
257
  meta?: Record<string, SerializableJsonValue> | undefined;
169
258
  duration_ms?: number | undefined;
170
259
  subrun_parent_id?: string | undefined;
260
+ output?: SerializableJsonValue | undefined;
261
+ failure?: {
262
+ error: string;
263
+ error_code?: string | undefined;
264
+ retry_id?: string | undefined;
265
+ retryable?: boolean | undefined;
266
+ details?: SerializableJsonValue | undefined;
267
+ } | undefined;
171
268
  answer_id?: string | undefined;
172
269
  seq?: number | undefined;
173
270
  is_last?: boolean | undefined;
174
- output?: SerializableJsonValue | undefined;
175
271
  original_message_count?: number | undefined;
176
272
  compression_ratio?: number | undefined;
177
273
  included_old_summary?: boolean | undefined;
@@ -56,7 +56,7 @@ 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";
59
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
60
60
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
61
61
  confidence: "estimate" | "provider-estimate" | "actual";
62
62
  componentId: string;
@@ -78,7 +78,7 @@ 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";
81
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
82
82
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
83
83
  confidence: "estimate" | "provider-estimate" | "actual";
84
84
  componentId: string;
@@ -210,7 +210,6 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
210
210
  parentRunId?: string | undefined;
211
211
  turnId?: string | undefined;
212
212
  modelId?: string | undefined;
213
- stepId?: string | undefined;
214
213
  route?: {
215
214
  modelId: string;
216
215
  capabilityId: string;
@@ -223,6 +222,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
223
222
  baseURL?: string | undefined;
224
223
  endpointModelId?: string | undefined;
225
224
  } | undefined;
225
+ stepId?: string | undefined;
226
226
  createdAt?: number | undefined;
227
227
  }, {
228
228
  id: string;
@@ -244,7 +244,6 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
244
244
  parentRunId?: string | undefined;
245
245
  turnId?: string | undefined;
246
246
  modelId?: string | undefined;
247
- stepId?: string | undefined;
248
247
  route?: {
249
248
  modelId: string;
250
249
  capabilityId: string;
@@ -257,6 +256,7 @@ declare const LlmUsageTokenLedgerEntry: z.ZodObject<{
257
256
  baseURL?: string | undefined;
258
257
  endpointModelId?: string | undefined;
259
258
  } | undefined;
259
+ stepId?: string | undefined;
260
260
  createdAt?: number | undefined;
261
261
  }>;
262
262
  type LlmUsageTokenLedgerEntry = z.infer<typeof LlmUsageTokenLedgerEntry>;
@@ -337,7 +337,7 @@ 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";
340
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
341
341
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
342
342
  confidence: "estimate" | "provider-estimate" | "actual";
343
343
  componentId: string;
@@ -359,7 +359,7 @@ 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";
362
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
363
363
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
364
364
  confidence: "estimate" | "provider-estimate" | "actual";
365
365
  componentId: string;
@@ -386,7 +386,7 @@ 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";
389
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
390
390
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
391
391
  confidence: "estimate" | "provider-estimate" | "actual";
392
392
  componentId: string;
@@ -413,7 +413,6 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
413
413
  runId?: string | undefined;
414
414
  parentRunId?: string | undefined;
415
415
  turnId?: string | undefined;
416
- stepId?: string | undefined;
417
416
  route?: {
418
417
  modelId: string;
419
418
  capabilityId: string;
@@ -426,12 +425,13 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
426
425
  baseURL?: string | undefined;
427
426
  endpointModelId?: string | undefined;
428
427
  } | undefined;
428
+ stepId?: string | undefined;
429
429
  createdAt?: number | undefined;
430
430
  }, {
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";
434
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
435
435
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
436
436
  confidence: "estimate" | "provider-estimate" | "actual";
437
437
  componentId: string;
@@ -458,7 +458,6 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
458
458
  runId?: string | undefined;
459
459
  parentRunId?: string | undefined;
460
460
  turnId?: string | undefined;
461
- stepId?: string | undefined;
462
461
  route?: {
463
462
  modelId: string;
464
463
  capabilityId: string;
@@ -471,6 +470,7 @@ declare const ContextComponentTokenLedgerEntry: z.ZodObject<{
471
470
  baseURL?: string | undefined;
472
471
  endpointModelId?: string | undefined;
473
472
  } | undefined;
473
+ stepId?: string | undefined;
474
474
  createdAt?: number | undefined;
475
475
  }>;
476
476
  type ContextComponentTokenLedgerEntry = z.infer<typeof ContextComponentTokenLedgerEntry>;
@@ -583,7 +583,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
583
583
  parentRunId?: string | undefined;
584
584
  turnId?: string | undefined;
585
585
  modelId?: string | undefined;
586
- stepId?: string | undefined;
587
586
  route?: {
588
587
  modelId: string;
589
588
  capabilityId: string;
@@ -596,6 +595,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
596
595
  baseURL?: string | undefined;
597
596
  endpointModelId?: string | undefined;
598
597
  } | undefined;
598
+ stepId?: string | undefined;
599
599
  createdAt?: number | undefined;
600
600
  }, {
601
601
  id: string;
@@ -617,7 +617,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
617
617
  parentRunId?: string | undefined;
618
618
  turnId?: string | undefined;
619
619
  modelId?: string | undefined;
620
- stepId?: string | undefined;
621
620
  route?: {
622
621
  modelId: string;
623
622
  capabilityId: string;
@@ -630,6 +629,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
630
629
  baseURL?: string | undefined;
631
630
  endpointModelId?: string | undefined;
632
631
  } | undefined;
632
+ stepId?: string | undefined;
633
633
  createdAt?: number | undefined;
634
634
  }>, z.ZodObject<{
635
635
  id: z.ZodString;
@@ -708,7 +708,7 @@ 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";
711
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
712
712
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
713
713
  confidence: "estimate" | "provider-estimate" | "actual";
714
714
  componentId: string;
@@ -730,7 +730,7 @@ 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";
733
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
734
734
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
735
735
  confidence: "estimate" | "provider-estimate" | "actual";
736
736
  componentId: string;
@@ -757,7 +757,7 @@ 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";
760
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
761
761
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
762
762
  confidence: "estimate" | "provider-estimate" | "actual";
763
763
  componentId: string;
@@ -784,7 +784,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
784
784
  runId?: string | undefined;
785
785
  parentRunId?: string | undefined;
786
786
  turnId?: string | undefined;
787
- stepId?: string | undefined;
788
787
  route?: {
789
788
  modelId: string;
790
789
  capabilityId: string;
@@ -797,12 +796,13 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
797
796
  baseURL?: string | undefined;
798
797
  endpointModelId?: string | undefined;
799
798
  } | undefined;
799
+ stepId?: string | undefined;
800
800
  createdAt?: number | undefined;
801
801
  }, {
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";
805
+ kind: "system" | "user" | "assistant" | "tool" | "other" | "context-injection" | "history-summary" | "working-memory" | "fence" | "system-reminder" | "image-attachment";
806
806
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
807
807
  confidence: "estimate" | "provider-estimate" | "actual";
808
808
  componentId: string;
@@ -829,7 +829,6 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
829
829
  runId?: string | undefined;
830
830
  parentRunId?: string | undefined;
831
831
  turnId?: string | undefined;
832
- stepId?: string | undefined;
833
832
  route?: {
834
833
  modelId: string;
835
834
  capabilityId: string;
@@ -842,6 +841,7 @@ declare const TokenLedgerEntry: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
842
841
  baseURL?: string | undefined;
843
842
  endpointModelId?: string | undefined;
844
843
  } | undefined;
844
+ stepId?: string | undefined;
845
845
  createdAt?: number | undefined;
846
846
  }>]>;
847
847
  type TokenLedgerEntry = z.infer<typeof TokenLedgerEntry>;