@omnicross/contracts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/account-tokens-types.cjs +18 -0
  4. package/dist/account-tokens-types.d.cts +142 -0
  5. package/dist/account-tokens-types.d.ts +142 -0
  6. package/dist/account-tokens-types.js +0 -0
  7. package/dist/canonical-models.cjs +262 -0
  8. package/dist/canonical-models.d.cts +107 -0
  9. package/dist/canonical-models.d.ts +107 -0
  10. package/dist/canonical-models.js +232 -0
  11. package/dist/completion-types.cjs +18 -0
  12. package/dist/completion-types.d.cts +324 -0
  13. package/dist/completion-types.d.ts +324 -0
  14. package/dist/completion-types.js +0 -0
  15. package/dist/endpoint-resolver.cjs +54 -0
  16. package/dist/endpoint-resolver.d.cts +43 -0
  17. package/dist/endpoint-resolver.d.ts +43 -0
  18. package/dist/endpoint-resolver.js +29 -0
  19. package/dist/extended-context.cjs +39 -0
  20. package/dist/extended-context.d.cts +21 -0
  21. package/dist/extended-context.d.ts +21 -0
  22. package/dist/extended-context.js +13 -0
  23. package/dist/index.cjs +2724 -0
  24. package/dist/index.d.cts +14 -0
  25. package/dist/index.d.ts +14 -0
  26. package/dist/index.js +2656 -0
  27. package/dist/llm-config-CQjOimv2.d.cts +390 -0
  28. package/dist/llm-config-D1jKQLVp.d.ts +390 -0
  29. package/dist/llm-config.cjs +18 -0
  30. package/dist/llm-config.d.cts +2 -0
  31. package/dist/llm-config.d.ts +2 -0
  32. package/dist/llm-config.js +0 -0
  33. package/dist/mcp-types.cjs +33 -0
  34. package/dist/mcp-types.d.cts +131 -0
  35. package/dist/mcp-types.d.ts +131 -0
  36. package/dist/mcp-types.js +8 -0
  37. package/dist/message-blocks.cjs +18 -0
  38. package/dist/message-blocks.d.cts +44 -0
  39. package/dist/message-blocks.d.ts +44 -0
  40. package/dist/message-blocks.js +0 -0
  41. package/dist/provider-presets/index.cjs +2183 -0
  42. package/dist/provider-presets/index.d.cts +104 -0
  43. package/dist/provider-presets/index.d.ts +104 -0
  44. package/dist/provider-presets/index.js +2143 -0
  45. package/dist/subscription-types.cjs +48 -0
  46. package/dist/subscription-types.d.cts +149 -0
  47. package/dist/subscription-types.d.ts +149 -0
  48. package/dist/subscription-types.js +22 -0
  49. package/dist/thinking-CBWSLel8.d.cts +33 -0
  50. package/dist/thinking-CBWSLel8.d.ts +33 -0
  51. package/dist/thinking-config.cjs +243 -0
  52. package/dist/thinking-config.d.cts +71 -0
  53. package/dist/thinking-config.d.ts +71 -0
  54. package/dist/thinking-config.js +205 -0
  55. package/dist/usage-types.cjs +18 -0
  56. package/dist/usage-types.d.cts +41 -0
  57. package/dist/usage-types.d.ts +41 -0
  58. package/dist/usage-types.js +0 -0
  59. package/dist/websearch-types.cjs +37 -0
  60. package/dist/websearch-types.d.cts +76 -0
  61. package/dist/websearch-types.d.ts +76 -0
  62. package/dist/websearch-types.js +11 -0
  63. package/package.json +116 -0
@@ -0,0 +1,324 @@
1
+ import { R as ReasoningConfig, a as ThinkingContent } from './thinking-CBWSLel8.cjs';
2
+ export { T as ThinkLevel } from './thinking-CBWSLel8.cjs';
3
+ import { MessageBlock } from './message-blocks.cjs';
4
+
5
+ /**
6
+ * @module shared/completion-types/anthropic
7
+ *
8
+ * Anthropic Messages API wire types — content-part union + message +
9
+ * tool + request / response. Also owns ConversionConfig (cross-provider
10
+ * mapping config).
11
+ */
12
+ interface AnthropicSystemContent {
13
+ type: 'text';
14
+ text: string;
15
+ cache_control?: {
16
+ type: string;
17
+ };
18
+ }
19
+ interface AnthropicTextContent {
20
+ type: 'text';
21
+ text: string;
22
+ }
23
+ interface AnthropicImageContent {
24
+ type: 'image';
25
+ source: {
26
+ type: 'base64' | 'url';
27
+ media_type?: string;
28
+ data?: string;
29
+ url?: string;
30
+ };
31
+ }
32
+ interface AnthropicToolUseContent {
33
+ type: 'tool_use';
34
+ id: string;
35
+ name: string;
36
+ input: Record<string, unknown>;
37
+ }
38
+ interface AnthropicToolResultContent {
39
+ type: 'tool_result';
40
+ tool_use_id: string;
41
+ content: string | AnthropicContentPart[];
42
+ is_error?: boolean;
43
+ }
44
+ interface AnthropicThinkingContent {
45
+ type: 'thinking';
46
+ thinking: string;
47
+ signature?: string;
48
+ }
49
+ interface AnthropicAudioContent {
50
+ type: 'audio';
51
+ source: {
52
+ type: 'base64';
53
+ media_type: string;
54
+ data: string;
55
+ };
56
+ }
57
+ interface AnthropicVideoContent {
58
+ type: 'video';
59
+ source: {
60
+ type: 'base64' | 'url';
61
+ media_type: string;
62
+ data?: string;
63
+ url?: string;
64
+ };
65
+ }
66
+ type AnthropicContentPart = AnthropicTextContent | AnthropicImageContent | AnthropicToolUseContent | AnthropicToolResultContent | AnthropicThinkingContent | AnthropicAudioContent | AnthropicVideoContent;
67
+ interface AnthropicMessage {
68
+ role: 'user' | 'assistant';
69
+ content: string | AnthropicContentPart[];
70
+ }
71
+ interface AnthropicTool {
72
+ name: string;
73
+ description: string;
74
+ input_schema: Record<string, unknown>;
75
+ }
76
+ interface AnthropicChatRequest {
77
+ model: string;
78
+ max_tokens: number;
79
+ system?: string | AnthropicSystemContent[];
80
+ messages: AnthropicMessage[];
81
+ tools?: AnthropicTool[];
82
+ tool_choice?: {
83
+ type: 'auto';
84
+ } | {
85
+ type: 'any';
86
+ } | {
87
+ type: 'tool';
88
+ name: string;
89
+ };
90
+ stream?: boolean;
91
+ temperature?: number;
92
+ thinking?: {
93
+ type: 'enabled' | 'disabled';
94
+ budget_tokens?: number;
95
+ };
96
+ }
97
+ interface AnthropicChatResponse {
98
+ id: string;
99
+ type: 'message';
100
+ role: 'assistant';
101
+ model: string;
102
+ content: AnthropicContentPart[];
103
+ stop_reason: 'end_turn' | 'tool_use' | 'max_tokens' | 'stop_sequence';
104
+ stop_sequence?: string;
105
+ usage: {
106
+ input_tokens: number;
107
+ output_tokens: number;
108
+ };
109
+ }
110
+ interface ConversionConfig {
111
+ defaultModel: string;
112
+ modelMapping?: Record<string, string>;
113
+ enableThinking?: boolean;
114
+ }
115
+
116
+ /**
117
+ * @module shared/completion-types/openai
118
+ *
119
+ * OpenAI chat-completions wire types — message / content parts / tool
120
+ * calls / requests / responses / stream chunks.
121
+ */
122
+
123
+ interface OpenAIMessage {
124
+ role: 'system' | 'user' | 'assistant' | 'tool';
125
+ content: string | OpenAIContentPart[] | null;
126
+ name?: string;
127
+ tool_calls?: OpenAIToolCall[];
128
+ tool_call_id?: string;
129
+ }
130
+ interface OpenAIContentPart {
131
+ type: 'text' | 'image_url' | 'audio_url' | 'video_url' | 'input_audio';
132
+ text?: string;
133
+ image_url?: {
134
+ url: string;
135
+ detail?: 'auto' | 'low' | 'high';
136
+ };
137
+ audio_url?: {
138
+ url: string;
139
+ format?: string;
140
+ };
141
+ video_url?: {
142
+ url: string;
143
+ };
144
+ /** OpenAI / OpenRouter chat audio input: base64 + format (wav/mp3/flac/m4a/ogg/aac/aiff/pcm16/pcm24). */
145
+ input_audio?: {
146
+ data: string;
147
+ format: string;
148
+ };
149
+ }
150
+ interface OpenAIToolCall {
151
+ id: string;
152
+ type: 'function';
153
+ function: {
154
+ name: string;
155
+ arguments: string;
156
+ };
157
+ }
158
+ interface OpenAITool {
159
+ type: 'function';
160
+ function: {
161
+ name: string;
162
+ description: string;
163
+ parameters: Record<string, unknown>;
164
+ };
165
+ }
166
+ interface OpenAIChatRequest {
167
+ model: string;
168
+ messages: OpenAIMessage[];
169
+ max_tokens?: number;
170
+ temperature?: number;
171
+ top_p?: number;
172
+ stream?: boolean;
173
+ tools?: OpenAITool[];
174
+ tool_choice?: 'auto' | 'none' | 'required' | {
175
+ type: 'function';
176
+ function: {
177
+ name: string;
178
+ };
179
+ };
180
+ stream_options?: {
181
+ include_usage?: boolean;
182
+ };
183
+ /** Reasoning configuration for thinking models */
184
+ reasoning?: ReasoningConfig;
185
+ }
186
+ interface OpenAIChatResponse {
187
+ id: string;
188
+ object: 'chat.completion';
189
+ created: number;
190
+ model: string;
191
+ choices: {
192
+ index: number;
193
+ message: {
194
+ role: 'assistant';
195
+ content: string | null;
196
+ tool_calls?: OpenAIToolCall[];
197
+ /** Thinking content for reasoning models */
198
+ thinking?: ThinkingContent;
199
+ };
200
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter';
201
+ }[];
202
+ usage: {
203
+ prompt_tokens: number;
204
+ completion_tokens: number;
205
+ total_tokens: number;
206
+ /** Detailed prompt token breakdown */
207
+ prompt_tokens_details?: {
208
+ cached_tokens?: number;
209
+ };
210
+ /** Detailed completion token breakdown */
211
+ completion_tokens_details?: {
212
+ reasoning_tokens?: number;
213
+ };
214
+ };
215
+ /** Extension for reasoning/thinking content (DeepSeek style) */
216
+ reasoning_content?: string;
217
+ }
218
+ interface OpenAIStreamChunk {
219
+ id: string;
220
+ object: 'chat.completion.chunk';
221
+ created: number;
222
+ model: string;
223
+ choices: {
224
+ index: number;
225
+ delta: {
226
+ role?: 'assistant';
227
+ content?: string;
228
+ tool_calls?: Partial<OpenAIToolCall>[];
229
+ /** Thinking content delta for reasoning models */
230
+ thinking?: Partial<ThinkingContent>;
231
+ /** DeepSeek style reasoning content */
232
+ reasoning_content?: string;
233
+ };
234
+ finish_reason?: 'stop' | 'length' | 'tool_calls' | 'content_filter' | null;
235
+ }[];
236
+ usage?: {
237
+ prompt_tokens: number;
238
+ completion_tokens: number;
239
+ total_tokens: number;
240
+ prompt_tokens_details?: {
241
+ cached_tokens?: number;
242
+ };
243
+ completion_tokens_details?: {
244
+ reasoning_tokens?: number;
245
+ };
246
+ };
247
+ }
248
+
249
+ /**
250
+ * @module completion-types/simple-chat
251
+ *
252
+ * Provider-neutral SimpleChat types used by simple UI chat flows (single
253
+ * provider, single model) — image / audio / video attachments + message
254
+ * + session shapes.
255
+ */
256
+
257
+ /** Image attachment for multimodal messages */
258
+ interface SimpleChatImage {
259
+ /** Base64 data URL (e.g., data:image/png;base64,...) or HTTP URL */
260
+ url: string;
261
+ /** MIME type (e.g., image/png, image/jpeg) */
262
+ mimeType?: string;
263
+ }
264
+ /** Audio attachment for multimodal messages */
265
+ interface SimpleChatAudio {
266
+ /** Base64 data URL (e.g., data:audio/wav;base64,...) or file path */
267
+ url: string;
268
+ /** MIME type (e.g., audio/wav, audio/mp3) */
269
+ mimeType: string;
270
+ /** Audio duration in seconds */
271
+ duration?: number;
272
+ /** File size in bytes */
273
+ size?: number;
274
+ }
275
+ /** Video attachment for multimodal messages */
276
+ interface SimpleChatVideo {
277
+ /** Base64 data URL (e.g., data:video/mp4;base64,...) or HTTP URL */
278
+ url: string;
279
+ /** MIME type (e.g., video/mp4, video/webm) */
280
+ mimeType: string;
281
+ /** Video duration in seconds */
282
+ duration?: number;
283
+ /** File size in bytes */
284
+ size?: number;
285
+ /** Thumbnail image URL */
286
+ thumbnail?: string;
287
+ }
288
+ interface SimpleChatMessage {
289
+ id: string;
290
+ role: 'user' | 'assistant' | 'system' | 'tool';
291
+ content: string;
292
+ timestamp: number;
293
+ /** Thinking/reasoning content with optional cryptographic signature */
294
+ thinking?: ThinkingContent;
295
+ /** Image attachments for vision/multimodal messages */
296
+ images?: SimpleChatImage[];
297
+ /** Audio attachments for multimodal messages */
298
+ audios?: SimpleChatAudio[];
299
+ /** Video attachments for multimodal messages */
300
+ videos?: SimpleChatVideo[];
301
+ /** Structured content blocks for multi-turn tool calls */
302
+ blocks?: MessageBlock[];
303
+ /** Tool call ID — present when role is 'tool' (result of a tool invocation) */
304
+ toolCallId?: string;
305
+ /** Tool or function name */
306
+ name?: string;
307
+ /** Tool calls requested by the assistant */
308
+ toolCalls?: Array<{
309
+ id: string;
310
+ name: string;
311
+ args: Record<string, unknown>;
312
+ }>;
313
+ }
314
+ interface SimpleChatSession {
315
+ id: string;
316
+ title: string;
317
+ messages: SimpleChatMessage[];
318
+ providerId: string;
319
+ model: string;
320
+ createdAt: number;
321
+ updatedAt: number;
322
+ }
323
+
324
+ export { type AnthropicAudioContent, type AnthropicChatRequest, type AnthropicChatResponse, type AnthropicContentPart, type AnthropicImageContent, type AnthropicMessage, type AnthropicSystemContent, type AnthropicTextContent, type AnthropicThinkingContent, type AnthropicTool, type AnthropicToolResultContent, type AnthropicToolUseContent, type AnthropicVideoContent, type ConversionConfig, type OpenAIChatRequest, type OpenAIChatResponse, type OpenAIContentPart, type OpenAIMessage, type OpenAIStreamChunk, type OpenAITool, type OpenAIToolCall, ReasoningConfig, type SimpleChatAudio, type SimpleChatImage, type SimpleChatMessage, type SimpleChatSession, type SimpleChatVideo, ThinkingContent };
@@ -0,0 +1,324 @@
1
+ import { R as ReasoningConfig, a as ThinkingContent } from './thinking-CBWSLel8.js';
2
+ export { T as ThinkLevel } from './thinking-CBWSLel8.js';
3
+ import { MessageBlock } from './message-blocks.js';
4
+
5
+ /**
6
+ * @module shared/completion-types/anthropic
7
+ *
8
+ * Anthropic Messages API wire types — content-part union + message +
9
+ * tool + request / response. Also owns ConversionConfig (cross-provider
10
+ * mapping config).
11
+ */
12
+ interface AnthropicSystemContent {
13
+ type: 'text';
14
+ text: string;
15
+ cache_control?: {
16
+ type: string;
17
+ };
18
+ }
19
+ interface AnthropicTextContent {
20
+ type: 'text';
21
+ text: string;
22
+ }
23
+ interface AnthropicImageContent {
24
+ type: 'image';
25
+ source: {
26
+ type: 'base64' | 'url';
27
+ media_type?: string;
28
+ data?: string;
29
+ url?: string;
30
+ };
31
+ }
32
+ interface AnthropicToolUseContent {
33
+ type: 'tool_use';
34
+ id: string;
35
+ name: string;
36
+ input: Record<string, unknown>;
37
+ }
38
+ interface AnthropicToolResultContent {
39
+ type: 'tool_result';
40
+ tool_use_id: string;
41
+ content: string | AnthropicContentPart[];
42
+ is_error?: boolean;
43
+ }
44
+ interface AnthropicThinkingContent {
45
+ type: 'thinking';
46
+ thinking: string;
47
+ signature?: string;
48
+ }
49
+ interface AnthropicAudioContent {
50
+ type: 'audio';
51
+ source: {
52
+ type: 'base64';
53
+ media_type: string;
54
+ data: string;
55
+ };
56
+ }
57
+ interface AnthropicVideoContent {
58
+ type: 'video';
59
+ source: {
60
+ type: 'base64' | 'url';
61
+ media_type: string;
62
+ data?: string;
63
+ url?: string;
64
+ };
65
+ }
66
+ type AnthropicContentPart = AnthropicTextContent | AnthropicImageContent | AnthropicToolUseContent | AnthropicToolResultContent | AnthropicThinkingContent | AnthropicAudioContent | AnthropicVideoContent;
67
+ interface AnthropicMessage {
68
+ role: 'user' | 'assistant';
69
+ content: string | AnthropicContentPart[];
70
+ }
71
+ interface AnthropicTool {
72
+ name: string;
73
+ description: string;
74
+ input_schema: Record<string, unknown>;
75
+ }
76
+ interface AnthropicChatRequest {
77
+ model: string;
78
+ max_tokens: number;
79
+ system?: string | AnthropicSystemContent[];
80
+ messages: AnthropicMessage[];
81
+ tools?: AnthropicTool[];
82
+ tool_choice?: {
83
+ type: 'auto';
84
+ } | {
85
+ type: 'any';
86
+ } | {
87
+ type: 'tool';
88
+ name: string;
89
+ };
90
+ stream?: boolean;
91
+ temperature?: number;
92
+ thinking?: {
93
+ type: 'enabled' | 'disabled';
94
+ budget_tokens?: number;
95
+ };
96
+ }
97
+ interface AnthropicChatResponse {
98
+ id: string;
99
+ type: 'message';
100
+ role: 'assistant';
101
+ model: string;
102
+ content: AnthropicContentPart[];
103
+ stop_reason: 'end_turn' | 'tool_use' | 'max_tokens' | 'stop_sequence';
104
+ stop_sequence?: string;
105
+ usage: {
106
+ input_tokens: number;
107
+ output_tokens: number;
108
+ };
109
+ }
110
+ interface ConversionConfig {
111
+ defaultModel: string;
112
+ modelMapping?: Record<string, string>;
113
+ enableThinking?: boolean;
114
+ }
115
+
116
+ /**
117
+ * @module shared/completion-types/openai
118
+ *
119
+ * OpenAI chat-completions wire types — message / content parts / tool
120
+ * calls / requests / responses / stream chunks.
121
+ */
122
+
123
+ interface OpenAIMessage {
124
+ role: 'system' | 'user' | 'assistant' | 'tool';
125
+ content: string | OpenAIContentPart[] | null;
126
+ name?: string;
127
+ tool_calls?: OpenAIToolCall[];
128
+ tool_call_id?: string;
129
+ }
130
+ interface OpenAIContentPart {
131
+ type: 'text' | 'image_url' | 'audio_url' | 'video_url' | 'input_audio';
132
+ text?: string;
133
+ image_url?: {
134
+ url: string;
135
+ detail?: 'auto' | 'low' | 'high';
136
+ };
137
+ audio_url?: {
138
+ url: string;
139
+ format?: string;
140
+ };
141
+ video_url?: {
142
+ url: string;
143
+ };
144
+ /** OpenAI / OpenRouter chat audio input: base64 + format (wav/mp3/flac/m4a/ogg/aac/aiff/pcm16/pcm24). */
145
+ input_audio?: {
146
+ data: string;
147
+ format: string;
148
+ };
149
+ }
150
+ interface OpenAIToolCall {
151
+ id: string;
152
+ type: 'function';
153
+ function: {
154
+ name: string;
155
+ arguments: string;
156
+ };
157
+ }
158
+ interface OpenAITool {
159
+ type: 'function';
160
+ function: {
161
+ name: string;
162
+ description: string;
163
+ parameters: Record<string, unknown>;
164
+ };
165
+ }
166
+ interface OpenAIChatRequest {
167
+ model: string;
168
+ messages: OpenAIMessage[];
169
+ max_tokens?: number;
170
+ temperature?: number;
171
+ top_p?: number;
172
+ stream?: boolean;
173
+ tools?: OpenAITool[];
174
+ tool_choice?: 'auto' | 'none' | 'required' | {
175
+ type: 'function';
176
+ function: {
177
+ name: string;
178
+ };
179
+ };
180
+ stream_options?: {
181
+ include_usage?: boolean;
182
+ };
183
+ /** Reasoning configuration for thinking models */
184
+ reasoning?: ReasoningConfig;
185
+ }
186
+ interface OpenAIChatResponse {
187
+ id: string;
188
+ object: 'chat.completion';
189
+ created: number;
190
+ model: string;
191
+ choices: {
192
+ index: number;
193
+ message: {
194
+ role: 'assistant';
195
+ content: string | null;
196
+ tool_calls?: OpenAIToolCall[];
197
+ /** Thinking content for reasoning models */
198
+ thinking?: ThinkingContent;
199
+ };
200
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter';
201
+ }[];
202
+ usage: {
203
+ prompt_tokens: number;
204
+ completion_tokens: number;
205
+ total_tokens: number;
206
+ /** Detailed prompt token breakdown */
207
+ prompt_tokens_details?: {
208
+ cached_tokens?: number;
209
+ };
210
+ /** Detailed completion token breakdown */
211
+ completion_tokens_details?: {
212
+ reasoning_tokens?: number;
213
+ };
214
+ };
215
+ /** Extension for reasoning/thinking content (DeepSeek style) */
216
+ reasoning_content?: string;
217
+ }
218
+ interface OpenAIStreamChunk {
219
+ id: string;
220
+ object: 'chat.completion.chunk';
221
+ created: number;
222
+ model: string;
223
+ choices: {
224
+ index: number;
225
+ delta: {
226
+ role?: 'assistant';
227
+ content?: string;
228
+ tool_calls?: Partial<OpenAIToolCall>[];
229
+ /** Thinking content delta for reasoning models */
230
+ thinking?: Partial<ThinkingContent>;
231
+ /** DeepSeek style reasoning content */
232
+ reasoning_content?: string;
233
+ };
234
+ finish_reason?: 'stop' | 'length' | 'tool_calls' | 'content_filter' | null;
235
+ }[];
236
+ usage?: {
237
+ prompt_tokens: number;
238
+ completion_tokens: number;
239
+ total_tokens: number;
240
+ prompt_tokens_details?: {
241
+ cached_tokens?: number;
242
+ };
243
+ completion_tokens_details?: {
244
+ reasoning_tokens?: number;
245
+ };
246
+ };
247
+ }
248
+
249
+ /**
250
+ * @module completion-types/simple-chat
251
+ *
252
+ * Provider-neutral SimpleChat types used by simple UI chat flows (single
253
+ * provider, single model) — image / audio / video attachments + message
254
+ * + session shapes.
255
+ */
256
+
257
+ /** Image attachment for multimodal messages */
258
+ interface SimpleChatImage {
259
+ /** Base64 data URL (e.g., data:image/png;base64,...) or HTTP URL */
260
+ url: string;
261
+ /** MIME type (e.g., image/png, image/jpeg) */
262
+ mimeType?: string;
263
+ }
264
+ /** Audio attachment for multimodal messages */
265
+ interface SimpleChatAudio {
266
+ /** Base64 data URL (e.g., data:audio/wav;base64,...) or file path */
267
+ url: string;
268
+ /** MIME type (e.g., audio/wav, audio/mp3) */
269
+ mimeType: string;
270
+ /** Audio duration in seconds */
271
+ duration?: number;
272
+ /** File size in bytes */
273
+ size?: number;
274
+ }
275
+ /** Video attachment for multimodal messages */
276
+ interface SimpleChatVideo {
277
+ /** Base64 data URL (e.g., data:video/mp4;base64,...) or HTTP URL */
278
+ url: string;
279
+ /** MIME type (e.g., video/mp4, video/webm) */
280
+ mimeType: string;
281
+ /** Video duration in seconds */
282
+ duration?: number;
283
+ /** File size in bytes */
284
+ size?: number;
285
+ /** Thumbnail image URL */
286
+ thumbnail?: string;
287
+ }
288
+ interface SimpleChatMessage {
289
+ id: string;
290
+ role: 'user' | 'assistant' | 'system' | 'tool';
291
+ content: string;
292
+ timestamp: number;
293
+ /** Thinking/reasoning content with optional cryptographic signature */
294
+ thinking?: ThinkingContent;
295
+ /** Image attachments for vision/multimodal messages */
296
+ images?: SimpleChatImage[];
297
+ /** Audio attachments for multimodal messages */
298
+ audios?: SimpleChatAudio[];
299
+ /** Video attachments for multimodal messages */
300
+ videos?: SimpleChatVideo[];
301
+ /** Structured content blocks for multi-turn tool calls */
302
+ blocks?: MessageBlock[];
303
+ /** Tool call ID — present when role is 'tool' (result of a tool invocation) */
304
+ toolCallId?: string;
305
+ /** Tool or function name */
306
+ name?: string;
307
+ /** Tool calls requested by the assistant */
308
+ toolCalls?: Array<{
309
+ id: string;
310
+ name: string;
311
+ args: Record<string, unknown>;
312
+ }>;
313
+ }
314
+ interface SimpleChatSession {
315
+ id: string;
316
+ title: string;
317
+ messages: SimpleChatMessage[];
318
+ providerId: string;
319
+ model: string;
320
+ createdAt: number;
321
+ updatedAt: number;
322
+ }
323
+
324
+ export { type AnthropicAudioContent, type AnthropicChatRequest, type AnthropicChatResponse, type AnthropicContentPart, type AnthropicImageContent, type AnthropicMessage, type AnthropicSystemContent, type AnthropicTextContent, type AnthropicThinkingContent, type AnthropicTool, type AnthropicToolResultContent, type AnthropicToolUseContent, type AnthropicVideoContent, type ConversionConfig, type OpenAIChatRequest, type OpenAIChatResponse, type OpenAIContentPart, type OpenAIMessage, type OpenAIStreamChunk, type OpenAITool, type OpenAIToolCall, ReasoningConfig, type SimpleChatAudio, type SimpleChatImage, type SimpleChatMessage, type SimpleChatSession, type SimpleChatVideo, ThinkingContent };
File without changes
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/endpoint-resolver.ts
21
+ var endpoint_resolver_exports = {};
22
+ __export(endpoint_resolver_exports, {
23
+ resolveProviderEndpoint: () => resolveProviderEndpoint
24
+ });
25
+ module.exports = __toCommonJS(endpoint_resolver_exports);
26
+ function resolveProviderEndpoint(provider) {
27
+ if (provider.apiModes && provider.apiModes.length > 0 && provider.selectedApiModeId) {
28
+ const mode = provider.apiModes.find((m) => m.id === provider.selectedApiModeId);
29
+ if (mode) {
30
+ return {
31
+ baseUrl: provider.api_base_url || mode.baseUrl,
32
+ apiKey: provider.api_key || mode.apiKey || "",
33
+ resolvedModeId: mode.id,
34
+ source: "api-mode"
35
+ };
36
+ }
37
+ }
38
+ if (provider.codingPlan?.enabled && provider.codingPlan.baseUrl) {
39
+ return {
40
+ baseUrl: provider.codingPlan.baseUrl,
41
+ apiKey: provider.codingPlan.apiKey || provider.api_key || "",
42
+ source: "legacy-coding-plan"
43
+ };
44
+ }
45
+ return {
46
+ baseUrl: provider.api_base_url || "",
47
+ apiKey: provider.api_key || "",
48
+ source: "plain"
49
+ };
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ resolveProviderEndpoint
54
+ });