bioscode 0.1.5

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 (142) hide show
  1. package/LICENSE +306 -0
  2. package/NOTICE +45 -0
  3. package/README.md +277 -0
  4. package/dist/auth/index.d.ts +202 -0
  5. package/dist/brand/index.d.ts +7 -0
  6. package/dist/brand/loader.d.ts +463 -0
  7. package/dist/brand/rules.d.ts +25 -0
  8. package/dist/brand/schema.d.ts +246 -0
  9. package/dist/bus/bus-event.d.ts +10 -0
  10. package/dist/bus/global.d.ts +7 -0
  11. package/dist/bus/index.d.ts +26 -0
  12. package/dist/cli/auth.d.ts +23 -0
  13. package/dist/cli/brand.d.ts +6 -0
  14. package/dist/cli/index.d.ts +1 -0
  15. package/dist/cli/ui.d.ts +26 -0
  16. package/dist/command/index.d.ts +54 -0
  17. package/dist/config/config.d.ts +6036 -0
  18. package/dist/config/index.d.ts +2 -0
  19. package/dist/config/markdown.d.ts +415 -0
  20. package/dist/constants/index.d.ts +6 -0
  21. package/dist/constants/version.d.ts +5 -0
  22. package/dist/diff/engine.d.ts +15 -0
  23. package/dist/diff/index.d.ts +8 -0
  24. package/dist/diff/types.d.ts +66 -0
  25. package/dist/file/ignore.d.ts +7 -0
  26. package/dist/flag/index.d.ts +19 -0
  27. package/dist/gateway/bridge.d.ts +11 -0
  28. package/dist/gateway/handlers/llm.d.ts +7 -0
  29. package/dist/gateway/handlers/permission.d.ts +15 -0
  30. package/dist/gateway/handlers/session.d.ts +7 -0
  31. package/dist/gateway/handlers/system.d.ts +7 -0
  32. package/dist/gateway/handlers/tool.d.ts +7 -0
  33. package/dist/gateway/index.d.ts +18 -0
  34. package/dist/gateway/protocol.d.ts +159 -0
  35. package/dist/gateway/router.d.ts +7 -0
  36. package/dist/gateway/server.d.ts +24 -0
  37. package/dist/global/index.d.ts +23 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +34 -0
  40. package/dist/permission/index.d.ts +2 -0
  41. package/dist/permission/permission.d.ts +172 -0
  42. package/dist/permission/types.d.ts +109 -0
  43. package/dist/project/index.d.ts +3 -0
  44. package/dist/project/instance.d.ts +33 -0
  45. package/dist/project/project.d.ts +82 -0
  46. package/dist/project/state.d.ts +4 -0
  47. package/dist/prompt/index.d.ts +5 -0
  48. package/dist/prompt/system.d.ts +29 -0
  49. package/dist/prompt/template.d.ts +24 -0
  50. package/dist/provider/index.d.ts +3 -0
  51. package/dist/provider/models.d.ts +14 -0
  52. package/dist/provider/provider.d.ts +848 -0
  53. package/dist/provider/types.d.ts +328 -0
  54. package/dist/server/index.d.ts +21 -0
  55. package/dist/server/routes/api.d.ts +2 -0
  56. package/dist/server/routes/auth.d.ts +2 -0
  57. package/dist/server/routes/events.d.ts +2 -0
  58. package/dist/server/routes/health.d.ts +2 -0
  59. package/dist/server/routes/sessions.d.ts +2 -0
  60. package/dist/server/services/agent.d.ts +40 -0
  61. package/dist/server/services/permission.d.ts +43 -0
  62. package/dist/server/sse/emitter.d.ts +57 -0
  63. package/dist/session/context-cache.d.ts +75 -0
  64. package/dist/session/context-optimization.d.ts +165 -0
  65. package/dist/session/index.d.ts +5 -0
  66. package/dist/session/llm.d.ts +68 -0
  67. package/dist/session/message-optimizer.d.ts +32 -0
  68. package/dist/session/session.d.ts +524 -0
  69. package/dist/session/title-generator.d.ts +11 -0
  70. package/dist/session/types.d.ts +713 -0
  71. package/dist/snapshot/index.d.ts +40 -0
  72. package/dist/storage/index.d.ts +1 -0
  73. package/dist/storage/storage.d.ts +34 -0
  74. package/dist/theme.d.ts +64 -0
  75. package/dist/tool/bash.d.ts +19 -0
  76. package/dist/tool/edit.d.ts +21 -0
  77. package/dist/tool/glob.d.ts +15 -0
  78. package/dist/tool/grep.d.ts +20 -0
  79. package/dist/tool/image.d.ts +22 -0
  80. package/dist/tool/index.d.ts +11 -0
  81. package/dist/tool/ls.d.ts +14 -0
  82. package/dist/tool/read.d.ts +17 -0
  83. package/dist/tool/registry.d.ts +30 -0
  84. package/dist/tool/think.d.ts +11 -0
  85. package/dist/tool/todo.d.ts +76 -0
  86. package/dist/tool/tool.d.ts +65 -0
  87. package/dist/tool/webfetch.d.ts +15 -0
  88. package/dist/tool/write.d.ts +16 -0
  89. package/dist/tui/App.d.ts +10 -0
  90. package/dist/tui/components/Header.d.ts +13 -0
  91. package/dist/tui/components/LoadingIndicator.d.ts +26 -0
  92. package/dist/tui/components/Message/AssistantMessage.d.ts +11 -0
  93. package/dist/tui/components/Message/ReasoningMessage.d.ts +21 -0
  94. package/dist/tui/components/Message/ToolCallMessage.d.ts +26 -0
  95. package/dist/tui/components/Message/UserMessage.d.ts +12 -0
  96. package/dist/tui/components/Message/index.d.ts +16 -0
  97. package/dist/tui/components/PermissionPrompt.d.ts +6 -0
  98. package/dist/tui/components/PromptInput.d.ts +33 -0
  99. package/dist/tui/components/REPL.d.ts +22 -0
  100. package/dist/tui/components/Spinner.d.ts +13 -0
  101. package/dist/tui/components/StatusBar.d.ts +13 -0
  102. package/dist/tui/components/TodoList.d.ts +17 -0
  103. package/dist/tui/components/WelcomeBox.d.ts +13 -0
  104. package/dist/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
  105. package/dist/tui/components/dialogs/HelpPanel.d.ts +11 -0
  106. package/dist/tui/components/dialogs/ModelSelector.d.ts +14 -0
  107. package/dist/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
  108. package/dist/tui/components/dialogs/SessionPicker.d.ts +20 -0
  109. package/dist/tui/components/dialogs/index.d.ts +10 -0
  110. package/dist/tui/components/diff/DiffHunk.d.ts +12 -0
  111. package/dist/tui/components/diff/DiffLine.d.ts +14 -0
  112. package/dist/tui/components/diff/DiffStats.d.ts +12 -0
  113. package/dist/tui/components/diff/DiffView.d.ts +15 -0
  114. package/dist/tui/components/diff/index.d.ts +9 -0
  115. package/dist/tui/hooks/useAnimatedLabel.d.ts +12 -0
  116. package/dist/tui/hooks/usePermission.d.ts +34 -0
  117. package/dist/tui/hooks/useTermWidth.d.ts +13 -0
  118. package/dist/tui/index.d.ts +20 -0
  119. package/dist/tui/theme.d.ts +8 -0
  120. package/dist/tui/utils/Cursor.d.ts +37 -0
  121. package/dist/tui/utils/clipboard.d.ts +3 -0
  122. package/dist/tui/utils/keypress.d.ts +39 -0
  123. package/dist/tui/utils/markdown.d.ts +13 -0
  124. package/dist/tui/utils/openContent.d.ts +22 -0
  125. package/dist/util/ascii.d.ts +22 -0
  126. package/dist/util/bell.d.ts +14 -0
  127. package/dist/util/color.d.ts +28 -0
  128. package/dist/util/context.d.ts +10 -0
  129. package/dist/util/debug.d.ts +51 -0
  130. package/dist/util/error.d.ts +294 -0
  131. package/dist/util/example-commands.d.ts +18 -0
  132. package/dist/util/filesystem.d.ts +17 -0
  133. package/dist/util/id.d.ts +24 -0
  134. package/dist/util/iife.d.ts +1 -0
  135. package/dist/util/index.d.ts +7 -0
  136. package/dist/util/lazy.d.ts +1 -0
  137. package/dist/util/log.d.ts +26 -0
  138. package/dist/util/paths.d.ts +45 -0
  139. package/dist/util/shell.d.ts +36 -0
  140. package/dist/util/timeout.d.ts +1 -0
  141. package/dist/util/wildcard.d.ts +8 -0
  142. package/package.json +87 -0
@@ -0,0 +1,713 @@
1
+ import z from "zod";
2
+ /**
3
+ * Session and Message Type Definitions
4
+ */
5
+ export declare const SessionId: z.ZodBranded<z.ZodString, "SessionId">;
6
+ export type SessionId = z.infer<typeof SessionId>;
7
+ export declare const MessageId: z.ZodBranded<z.ZodString, "MessageId">;
8
+ export type MessageId = z.infer<typeof MessageId>;
9
+ export declare const PartId: z.ZodBranded<z.ZodString, "PartId">;
10
+ export type PartId = z.infer<typeof PartId>;
11
+ /**
12
+ * Session information
13
+ */
14
+ export declare const SessionInfo: z.ZodObject<{
15
+ id: z.ZodString;
16
+ projectId: z.ZodString;
17
+ directory: z.ZodString;
18
+ parentId: z.ZodOptional<z.ZodString>;
19
+ title: z.ZodString;
20
+ createdAt: z.ZodNumber;
21
+ updatedAt: z.ZodNumber;
22
+ promptHistory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
+ tokens: z.ZodOptional<z.ZodObject<{
24
+ input: z.ZodNumber;
25
+ output: z.ZodNumber;
26
+ }, "strip", z.ZodTypeAny, {
27
+ input: number;
28
+ output: number;
29
+ }, {
30
+ input: number;
31
+ output: number;
32
+ }>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ id: string;
35
+ directory: string;
36
+ title: string;
37
+ projectId: string;
38
+ createdAt: number;
39
+ updatedAt: number;
40
+ parentId?: string | undefined;
41
+ promptHistory?: string[] | undefined;
42
+ tokens?: {
43
+ input: number;
44
+ output: number;
45
+ } | undefined;
46
+ }, {
47
+ id: string;
48
+ directory: string;
49
+ title: string;
50
+ projectId: string;
51
+ createdAt: number;
52
+ updatedAt: number;
53
+ parentId?: string | undefined;
54
+ promptHistory?: string[] | undefined;
55
+ tokens?: {
56
+ input: number;
57
+ output: number;
58
+ } | undefined;
59
+ }>;
60
+ export type SessionInfo = z.infer<typeof SessionInfo>;
61
+ /**
62
+ * Message roles
63
+ */
64
+ export declare const MessageRole: z.ZodEnum<["user", "assistant", "system"]>;
65
+ export type MessageRole = z.infer<typeof MessageRole>;
66
+ /**
67
+ * Text content part
68
+ */
69
+ export declare const TextPart: z.ZodObject<{
70
+ type: z.ZodLiteral<"text">;
71
+ id: z.ZodString;
72
+ messageId: z.ZodString;
73
+ sessionId: z.ZodString;
74
+ content: z.ZodString;
75
+ sequence: z.ZodOptional<z.ZodNumber>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ type: "text";
78
+ id: string;
79
+ sessionId: string;
80
+ content: string;
81
+ messageId: string;
82
+ sequence?: number | undefined;
83
+ }, {
84
+ type: "text";
85
+ id: string;
86
+ sessionId: string;
87
+ content: string;
88
+ messageId: string;
89
+ sequence?: number | undefined;
90
+ }>;
91
+ export type TextPart = z.infer<typeof TextPart>;
92
+ /**
93
+ * Reasoning content part (for models with thinking)
94
+ */
95
+ export declare const ReasoningPart: z.ZodObject<{
96
+ type: z.ZodLiteral<"reasoning">;
97
+ id: z.ZodString;
98
+ messageId: z.ZodString;
99
+ sessionId: z.ZodString;
100
+ content: z.ZodString;
101
+ sequence: z.ZodOptional<z.ZodNumber>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ type: "reasoning";
104
+ id: string;
105
+ sessionId: string;
106
+ content: string;
107
+ messageId: string;
108
+ sequence?: number | undefined;
109
+ }, {
110
+ type: "reasoning";
111
+ id: string;
112
+ sessionId: string;
113
+ content: string;
114
+ messageId: string;
115
+ sequence?: number | undefined;
116
+ }>;
117
+ export type ReasoningPart = z.infer<typeof ReasoningPart>;
118
+ /**
119
+ * Tool call part
120
+ */
121
+ export declare const ToolCallPart: z.ZodObject<{
122
+ type: z.ZodLiteral<"tool-call">;
123
+ id: z.ZodString;
124
+ messageId: z.ZodString;
125
+ sessionId: z.ZodString;
126
+ toolId: z.ZodString;
127
+ toolName: z.ZodString;
128
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
129
+ state: z.ZodEnum<["pending", "running", "completed", "failed"]>;
130
+ sequence: z.ZodOptional<z.ZodNumber>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ state: "completed" | "pending" | "running" | "failed";
133
+ type: "tool-call";
134
+ id: string;
135
+ input: Record<string, any>;
136
+ sessionId: string;
137
+ toolId: string;
138
+ messageId: string;
139
+ toolName: string;
140
+ sequence?: number | undefined;
141
+ }, {
142
+ state: "completed" | "pending" | "running" | "failed";
143
+ type: "tool-call";
144
+ id: string;
145
+ input: Record<string, any>;
146
+ sessionId: string;
147
+ toolId: string;
148
+ messageId: string;
149
+ toolName: string;
150
+ sequence?: number | undefined;
151
+ }>;
152
+ export type ToolCallPart = z.infer<typeof ToolCallPart>;
153
+ /**
154
+ * Tool result part
155
+ */
156
+ export declare const ToolResultPart: z.ZodObject<{
157
+ type: z.ZodLiteral<"tool-result">;
158
+ id: z.ZodString;
159
+ messageId: z.ZodString;
160
+ sessionId: z.ZodString;
161
+ toolCallId: z.ZodString;
162
+ toolName: z.ZodOptional<z.ZodString>;
163
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
164
+ output: z.ZodString;
165
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
166
+ sequence: z.ZodOptional<z.ZodNumber>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ type: "tool-result";
169
+ id: string;
170
+ output: string;
171
+ sessionId: string;
172
+ messageId: string;
173
+ toolCallId: string;
174
+ input?: Record<string, any> | undefined;
175
+ sequence?: number | undefined;
176
+ toolName?: string | undefined;
177
+ metadata?: Record<string, any> | undefined;
178
+ }, {
179
+ type: "tool-result";
180
+ id: string;
181
+ output: string;
182
+ sessionId: string;
183
+ messageId: string;
184
+ toolCallId: string;
185
+ input?: Record<string, any> | undefined;
186
+ sequence?: number | undefined;
187
+ toolName?: string | undefined;
188
+ metadata?: Record<string, any> | undefined;
189
+ }>;
190
+ export type ToolResultPart = z.infer<typeof ToolResultPart>;
191
+ /**
192
+ * Image content part (for vision models)
193
+ */
194
+ export declare const ImagePart: z.ZodObject<{
195
+ type: z.ZodLiteral<"image">;
196
+ id: z.ZodString;
197
+ messageId: z.ZodString;
198
+ sessionId: z.ZodString;
199
+ mimeType: z.ZodEnum<["image/png", "image/jpeg", "image/gif", "image/webp"]>;
200
+ data: z.ZodString;
201
+ filename: z.ZodOptional<z.ZodString>;
202
+ sequence: z.ZodOptional<z.ZodNumber>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ type: "image";
205
+ id: string;
206
+ data: string;
207
+ sessionId: string;
208
+ messageId: string;
209
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
210
+ sequence?: number | undefined;
211
+ filename?: string | undefined;
212
+ }, {
213
+ type: "image";
214
+ id: string;
215
+ data: string;
216
+ sessionId: string;
217
+ messageId: string;
218
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
219
+ sequence?: number | undefined;
220
+ filename?: string | undefined;
221
+ }>;
222
+ export type ImagePart = z.infer<typeof ImagePart>;
223
+ /**
224
+ * All message part types
225
+ */
226
+ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
227
+ type: z.ZodLiteral<"text">;
228
+ id: z.ZodString;
229
+ messageId: z.ZodString;
230
+ sessionId: z.ZodString;
231
+ content: z.ZodString;
232
+ sequence: z.ZodOptional<z.ZodNumber>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ type: "text";
235
+ id: string;
236
+ sessionId: string;
237
+ content: string;
238
+ messageId: string;
239
+ sequence?: number | undefined;
240
+ }, {
241
+ type: "text";
242
+ id: string;
243
+ sessionId: string;
244
+ content: string;
245
+ messageId: string;
246
+ sequence?: number | undefined;
247
+ }>, z.ZodObject<{
248
+ type: z.ZodLiteral<"reasoning">;
249
+ id: z.ZodString;
250
+ messageId: z.ZodString;
251
+ sessionId: z.ZodString;
252
+ content: z.ZodString;
253
+ sequence: z.ZodOptional<z.ZodNumber>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ type: "reasoning";
256
+ id: string;
257
+ sessionId: string;
258
+ content: string;
259
+ messageId: string;
260
+ sequence?: number | undefined;
261
+ }, {
262
+ type: "reasoning";
263
+ id: string;
264
+ sessionId: string;
265
+ content: string;
266
+ messageId: string;
267
+ sequence?: number | undefined;
268
+ }>, z.ZodObject<{
269
+ type: z.ZodLiteral<"tool-call">;
270
+ id: z.ZodString;
271
+ messageId: z.ZodString;
272
+ sessionId: z.ZodString;
273
+ toolId: z.ZodString;
274
+ toolName: z.ZodString;
275
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
276
+ state: z.ZodEnum<["pending", "running", "completed", "failed"]>;
277
+ sequence: z.ZodOptional<z.ZodNumber>;
278
+ }, "strip", z.ZodTypeAny, {
279
+ state: "completed" | "pending" | "running" | "failed";
280
+ type: "tool-call";
281
+ id: string;
282
+ input: Record<string, any>;
283
+ sessionId: string;
284
+ toolId: string;
285
+ messageId: string;
286
+ toolName: string;
287
+ sequence?: number | undefined;
288
+ }, {
289
+ state: "completed" | "pending" | "running" | "failed";
290
+ type: "tool-call";
291
+ id: string;
292
+ input: Record<string, any>;
293
+ sessionId: string;
294
+ toolId: string;
295
+ messageId: string;
296
+ toolName: string;
297
+ sequence?: number | undefined;
298
+ }>, z.ZodObject<{
299
+ type: z.ZodLiteral<"tool-result">;
300
+ id: z.ZodString;
301
+ messageId: z.ZodString;
302
+ sessionId: z.ZodString;
303
+ toolCallId: z.ZodString;
304
+ toolName: z.ZodOptional<z.ZodString>;
305
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
306
+ output: z.ZodString;
307
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
308
+ sequence: z.ZodOptional<z.ZodNumber>;
309
+ }, "strip", z.ZodTypeAny, {
310
+ type: "tool-result";
311
+ id: string;
312
+ output: string;
313
+ sessionId: string;
314
+ messageId: string;
315
+ toolCallId: string;
316
+ input?: Record<string, any> | undefined;
317
+ sequence?: number | undefined;
318
+ toolName?: string | undefined;
319
+ metadata?: Record<string, any> | undefined;
320
+ }, {
321
+ type: "tool-result";
322
+ id: string;
323
+ output: string;
324
+ sessionId: string;
325
+ messageId: string;
326
+ toolCallId: string;
327
+ input?: Record<string, any> | undefined;
328
+ sequence?: number | undefined;
329
+ toolName?: string | undefined;
330
+ metadata?: Record<string, any> | undefined;
331
+ }>, z.ZodObject<{
332
+ type: z.ZodLiteral<"image">;
333
+ id: z.ZodString;
334
+ messageId: z.ZodString;
335
+ sessionId: z.ZodString;
336
+ mimeType: z.ZodEnum<["image/png", "image/jpeg", "image/gif", "image/webp"]>;
337
+ data: z.ZodString;
338
+ filename: z.ZodOptional<z.ZodString>;
339
+ sequence: z.ZodOptional<z.ZodNumber>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ type: "image";
342
+ id: string;
343
+ data: string;
344
+ sessionId: string;
345
+ messageId: string;
346
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
347
+ sequence?: number | undefined;
348
+ filename?: string | undefined;
349
+ }, {
350
+ type: "image";
351
+ id: string;
352
+ data: string;
353
+ sessionId: string;
354
+ messageId: string;
355
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
356
+ sequence?: number | undefined;
357
+ filename?: string | undefined;
358
+ }>]>;
359
+ export type MessagePart = z.infer<typeof MessagePart>;
360
+ /**
361
+ * Message information
362
+ */
363
+ export declare const MessageInfo: z.ZodObject<{
364
+ id: z.ZodString;
365
+ sessionId: z.ZodString;
366
+ role: z.ZodEnum<["user", "assistant", "system"]>;
367
+ createdAt: z.ZodNumber;
368
+ model: z.ZodOptional<z.ZodString>;
369
+ provider: z.ZodOptional<z.ZodString>;
370
+ }, "strip", z.ZodTypeAny, {
371
+ id: string;
372
+ sessionId: string;
373
+ createdAt: number;
374
+ role: "system" | "user" | "assistant";
375
+ provider?: string | undefined;
376
+ model?: string | undefined;
377
+ }, {
378
+ id: string;
379
+ sessionId: string;
380
+ createdAt: number;
381
+ role: "system" | "user" | "assistant";
382
+ provider?: string | undefined;
383
+ model?: string | undefined;
384
+ }>;
385
+ export type MessageInfo = z.infer<typeof MessageInfo>;
386
+ /**
387
+ * Message with all its parts
388
+ */
389
+ export declare const MessageWithParts: z.ZodObject<{
390
+ info: z.ZodObject<{
391
+ id: z.ZodString;
392
+ sessionId: z.ZodString;
393
+ role: z.ZodEnum<["user", "assistant", "system"]>;
394
+ createdAt: z.ZodNumber;
395
+ model: z.ZodOptional<z.ZodString>;
396
+ provider: z.ZodOptional<z.ZodString>;
397
+ }, "strip", z.ZodTypeAny, {
398
+ id: string;
399
+ sessionId: string;
400
+ createdAt: number;
401
+ role: "system" | "user" | "assistant";
402
+ provider?: string | undefined;
403
+ model?: string | undefined;
404
+ }, {
405
+ id: string;
406
+ sessionId: string;
407
+ createdAt: number;
408
+ role: "system" | "user" | "assistant";
409
+ provider?: string | undefined;
410
+ model?: string | undefined;
411
+ }>;
412
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
413
+ type: z.ZodLiteral<"text">;
414
+ id: z.ZodString;
415
+ messageId: z.ZodString;
416
+ sessionId: z.ZodString;
417
+ content: z.ZodString;
418
+ sequence: z.ZodOptional<z.ZodNumber>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ type: "text";
421
+ id: string;
422
+ sessionId: string;
423
+ content: string;
424
+ messageId: string;
425
+ sequence?: number | undefined;
426
+ }, {
427
+ type: "text";
428
+ id: string;
429
+ sessionId: string;
430
+ content: string;
431
+ messageId: string;
432
+ sequence?: number | undefined;
433
+ }>, z.ZodObject<{
434
+ type: z.ZodLiteral<"reasoning">;
435
+ id: z.ZodString;
436
+ messageId: z.ZodString;
437
+ sessionId: z.ZodString;
438
+ content: z.ZodString;
439
+ sequence: z.ZodOptional<z.ZodNumber>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ type: "reasoning";
442
+ id: string;
443
+ sessionId: string;
444
+ content: string;
445
+ messageId: string;
446
+ sequence?: number | undefined;
447
+ }, {
448
+ type: "reasoning";
449
+ id: string;
450
+ sessionId: string;
451
+ content: string;
452
+ messageId: string;
453
+ sequence?: number | undefined;
454
+ }>, z.ZodObject<{
455
+ type: z.ZodLiteral<"tool-call">;
456
+ id: z.ZodString;
457
+ messageId: z.ZodString;
458
+ sessionId: z.ZodString;
459
+ toolId: z.ZodString;
460
+ toolName: z.ZodString;
461
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
462
+ state: z.ZodEnum<["pending", "running", "completed", "failed"]>;
463
+ sequence: z.ZodOptional<z.ZodNumber>;
464
+ }, "strip", z.ZodTypeAny, {
465
+ state: "completed" | "pending" | "running" | "failed";
466
+ type: "tool-call";
467
+ id: string;
468
+ input: Record<string, any>;
469
+ sessionId: string;
470
+ toolId: string;
471
+ messageId: string;
472
+ toolName: string;
473
+ sequence?: number | undefined;
474
+ }, {
475
+ state: "completed" | "pending" | "running" | "failed";
476
+ type: "tool-call";
477
+ id: string;
478
+ input: Record<string, any>;
479
+ sessionId: string;
480
+ toolId: string;
481
+ messageId: string;
482
+ toolName: string;
483
+ sequence?: number | undefined;
484
+ }>, z.ZodObject<{
485
+ type: z.ZodLiteral<"tool-result">;
486
+ id: z.ZodString;
487
+ messageId: z.ZodString;
488
+ sessionId: z.ZodString;
489
+ toolCallId: z.ZodString;
490
+ toolName: z.ZodOptional<z.ZodString>;
491
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
492
+ output: z.ZodString;
493
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
494
+ sequence: z.ZodOptional<z.ZodNumber>;
495
+ }, "strip", z.ZodTypeAny, {
496
+ type: "tool-result";
497
+ id: string;
498
+ output: string;
499
+ sessionId: string;
500
+ messageId: string;
501
+ toolCallId: string;
502
+ input?: Record<string, any> | undefined;
503
+ sequence?: number | undefined;
504
+ toolName?: string | undefined;
505
+ metadata?: Record<string, any> | undefined;
506
+ }, {
507
+ type: "tool-result";
508
+ id: string;
509
+ output: string;
510
+ sessionId: string;
511
+ messageId: string;
512
+ toolCallId: string;
513
+ input?: Record<string, any> | undefined;
514
+ sequence?: number | undefined;
515
+ toolName?: string | undefined;
516
+ metadata?: Record<string, any> | undefined;
517
+ }>, z.ZodObject<{
518
+ type: z.ZodLiteral<"image">;
519
+ id: z.ZodString;
520
+ messageId: z.ZodString;
521
+ sessionId: z.ZodString;
522
+ mimeType: z.ZodEnum<["image/png", "image/jpeg", "image/gif", "image/webp"]>;
523
+ data: z.ZodString;
524
+ filename: z.ZodOptional<z.ZodString>;
525
+ sequence: z.ZodOptional<z.ZodNumber>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ type: "image";
528
+ id: string;
529
+ data: string;
530
+ sessionId: string;
531
+ messageId: string;
532
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
533
+ sequence?: number | undefined;
534
+ filename?: string | undefined;
535
+ }, {
536
+ type: "image";
537
+ id: string;
538
+ data: string;
539
+ sessionId: string;
540
+ messageId: string;
541
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
542
+ sequence?: number | undefined;
543
+ filename?: string | undefined;
544
+ }>]>, "many">;
545
+ }, "strip", z.ZodTypeAny, {
546
+ info: {
547
+ id: string;
548
+ sessionId: string;
549
+ createdAt: number;
550
+ role: "system" | "user" | "assistant";
551
+ provider?: string | undefined;
552
+ model?: string | undefined;
553
+ };
554
+ parts: ({
555
+ type: "text";
556
+ id: string;
557
+ sessionId: string;
558
+ content: string;
559
+ messageId: string;
560
+ sequence?: number | undefined;
561
+ } | {
562
+ type: "reasoning";
563
+ id: string;
564
+ sessionId: string;
565
+ content: string;
566
+ messageId: string;
567
+ sequence?: number | undefined;
568
+ } | {
569
+ state: "completed" | "pending" | "running" | "failed";
570
+ type: "tool-call";
571
+ id: string;
572
+ input: Record<string, any>;
573
+ sessionId: string;
574
+ toolId: string;
575
+ messageId: string;
576
+ toolName: string;
577
+ sequence?: number | undefined;
578
+ } | {
579
+ type: "tool-result";
580
+ id: string;
581
+ output: string;
582
+ sessionId: string;
583
+ messageId: string;
584
+ toolCallId: string;
585
+ input?: Record<string, any> | undefined;
586
+ sequence?: number | undefined;
587
+ toolName?: string | undefined;
588
+ metadata?: Record<string, any> | undefined;
589
+ } | {
590
+ type: "image";
591
+ id: string;
592
+ data: string;
593
+ sessionId: string;
594
+ messageId: string;
595
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
596
+ sequence?: number | undefined;
597
+ filename?: string | undefined;
598
+ })[];
599
+ }, {
600
+ info: {
601
+ id: string;
602
+ sessionId: string;
603
+ createdAt: number;
604
+ role: "system" | "user" | "assistant";
605
+ provider?: string | undefined;
606
+ model?: string | undefined;
607
+ };
608
+ parts: ({
609
+ type: "text";
610
+ id: string;
611
+ sessionId: string;
612
+ content: string;
613
+ messageId: string;
614
+ sequence?: number | undefined;
615
+ } | {
616
+ type: "reasoning";
617
+ id: string;
618
+ sessionId: string;
619
+ content: string;
620
+ messageId: string;
621
+ sequence?: number | undefined;
622
+ } | {
623
+ state: "completed" | "pending" | "running" | "failed";
624
+ type: "tool-call";
625
+ id: string;
626
+ input: Record<string, any>;
627
+ sessionId: string;
628
+ toolId: string;
629
+ messageId: string;
630
+ toolName: string;
631
+ sequence?: number | undefined;
632
+ } | {
633
+ type: "tool-result";
634
+ id: string;
635
+ output: string;
636
+ sessionId: string;
637
+ messageId: string;
638
+ toolCallId: string;
639
+ input?: Record<string, any> | undefined;
640
+ sequence?: number | undefined;
641
+ toolName?: string | undefined;
642
+ metadata?: Record<string, any> | undefined;
643
+ } | {
644
+ type: "image";
645
+ id: string;
646
+ data: string;
647
+ sessionId: string;
648
+ messageId: string;
649
+ mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
650
+ sequence?: number | undefined;
651
+ filename?: string | undefined;
652
+ })[];
653
+ }>;
654
+ export type MessageWithParts = z.infer<typeof MessageWithParts>;
655
+ /**
656
+ * Token usage statistics
657
+ */
658
+ export declare const TokenUsage: z.ZodObject<{
659
+ input: z.ZodNumber;
660
+ output: z.ZodNumber;
661
+ reasoning: z.ZodOptional<z.ZodNumber>;
662
+ cached: z.ZodOptional<z.ZodNumber>;
663
+ }, "strip", z.ZodTypeAny, {
664
+ input: number;
665
+ output: number;
666
+ reasoning?: number | undefined;
667
+ cached?: number | undefined;
668
+ }, {
669
+ input: number;
670
+ output: number;
671
+ reasoning?: number | undefined;
672
+ cached?: number | undefined;
673
+ }>;
674
+ export type TokenUsage = z.infer<typeof TokenUsage>;
675
+ /**
676
+ * Cost calculation result
677
+ */
678
+ export declare const UsageCost: z.ZodObject<{
679
+ tokens: z.ZodObject<{
680
+ input: z.ZodNumber;
681
+ output: z.ZodNumber;
682
+ reasoning: z.ZodOptional<z.ZodNumber>;
683
+ cached: z.ZodOptional<z.ZodNumber>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ input: number;
686
+ output: number;
687
+ reasoning?: number | undefined;
688
+ cached?: number | undefined;
689
+ }, {
690
+ input: number;
691
+ output: number;
692
+ reasoning?: number | undefined;
693
+ cached?: number | undefined;
694
+ }>;
695
+ cost: z.ZodNumber;
696
+ }, "strip", z.ZodTypeAny, {
697
+ cost: number;
698
+ tokens: {
699
+ input: number;
700
+ output: number;
701
+ reasoning?: number | undefined;
702
+ cached?: number | undefined;
703
+ };
704
+ }, {
705
+ cost: number;
706
+ tokens: {
707
+ input: number;
708
+ output: number;
709
+ reasoning?: number | undefined;
710
+ cached?: number | undefined;
711
+ };
712
+ }>;
713
+ export type UsageCost = z.infer<typeof UsageCost>;