@absolutejs/absolute 0.19.0-beta.248 → 0.19.0-beta.249
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.
- package/.absolutejs/eslint-cache +1 -1
- package/.absolutejs/prettier.cache.json +17 -13
- package/.absolutejs/vue-tsc.tsbuildinfo +1 -1
- package/.claude/settings.local.json +2 -1
- package/dist/ai/index.js +636 -1
- package/dist/ai/index.js.map +10 -8
- package/dist/ai/providers/anthropic.js.map +2 -2
- package/dist/ai/providers/gemini.js +331 -0
- package/dist/ai/providers/gemini.js.map +10 -0
- package/dist/ai/providers/ollama.js.map +2 -2
- package/dist/ai/providers/openai.js.map +2 -2
- package/dist/ai/providers/openaiCompatible.js.map +3 -3
- package/dist/ai/providers/openaiResponses.js +432 -0
- package/dist/ai/providers/openaiResponses.js.map +10 -0
- package/dist/ai-client/angular/ai/index.js +61 -1
- package/dist/ai-client/react/ai/index.js +61 -1
- package/dist/ai-client/vue/ai/index.js +61 -1
- package/dist/angular/ai/index.js +62 -2
- package/dist/angular/ai/index.js.map +5 -5
- package/dist/build.js +3 -1
- package/dist/build.js.map +3 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +3 -3
- package/dist/react/ai/index.js +62 -2
- package/dist/react/ai/index.js.map +6 -6
- package/dist/src/ai/client/actions.d.ts +43 -0
- package/dist/src/ai/index.d.ts +2 -0
- package/dist/src/ai/providers/gemini.d.ts +7 -0
- package/dist/src/ai/providers/openaiResponses.d.ts +10 -0
- package/dist/svelte/ai/index.js +62 -2
- package/dist/svelte/ai/index.js.map +5 -5
- package/dist/types/ai.d.ts +38 -2
- package/dist/vue/ai/index.js +62 -2
- package/dist/vue/ai/index.js.map +5 -5
- package/package.json +9 -1
- package/scripts/build.ts +2 -0
- package/types/ai.ts +73 -6
- package/types/typeGuards.ts +11 -0
package/types/ai.ts
CHANGED
|
@@ -29,7 +29,21 @@ export type AIThinkingChunk = {
|
|
|
29
29
|
content: string;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export type
|
|
32
|
+
export type AIImageChunk = {
|
|
33
|
+
type: 'image';
|
|
34
|
+
data: string;
|
|
35
|
+
format: string;
|
|
36
|
+
isPartial: boolean;
|
|
37
|
+
revisedPrompt?: string;
|
|
38
|
+
imageId?: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type AIChunk =
|
|
42
|
+
| AITextChunk
|
|
43
|
+
| AIThinkingChunk
|
|
44
|
+
| AIToolUseChunk
|
|
45
|
+
| AIImageChunk
|
|
46
|
+
| AIDoneChunk;
|
|
33
47
|
|
|
34
48
|
export type AIProviderStreamParams = {
|
|
35
49
|
model: string;
|
|
@@ -88,7 +102,12 @@ export type AIToolMap = Record<string, AIToolDefinition>;
|
|
|
88
102
|
|
|
89
103
|
export type AIAttachment = {
|
|
90
104
|
data: string;
|
|
91
|
-
media_type:
|
|
105
|
+
media_type:
|
|
106
|
+
| 'image/png'
|
|
107
|
+
| 'image/jpeg'
|
|
108
|
+
| 'image/gif'
|
|
109
|
+
| 'image/webp'
|
|
110
|
+
| 'application/pdf';
|
|
92
111
|
name?: string;
|
|
93
112
|
};
|
|
94
113
|
|
|
@@ -151,6 +170,17 @@ export type AICompleteMessage = {
|
|
|
151
170
|
usage?: AIUsage;
|
|
152
171
|
};
|
|
153
172
|
|
|
173
|
+
export type AIImageMessage = {
|
|
174
|
+
type: 'image';
|
|
175
|
+
data: string;
|
|
176
|
+
format: string;
|
|
177
|
+
isPartial: boolean;
|
|
178
|
+
revisedPrompt?: string;
|
|
179
|
+
imageId?: string;
|
|
180
|
+
messageId: string;
|
|
181
|
+
conversationId: string;
|
|
182
|
+
};
|
|
183
|
+
|
|
154
184
|
export type AIErrorMessage = {
|
|
155
185
|
type: 'error';
|
|
156
186
|
message: string;
|
|
@@ -162,6 +192,7 @@ export type AIServerMessage =
|
|
|
162
192
|
| AIChunkMessage
|
|
163
193
|
| AIThinkingMessage
|
|
164
194
|
| AIToolStatusMessage
|
|
195
|
+
| AIImageMessage
|
|
165
196
|
| AICompleteMessage
|
|
166
197
|
| AIErrorMessage;
|
|
167
198
|
|
|
@@ -176,6 +207,14 @@ export type AIToolCall = {
|
|
|
176
207
|
result?: string;
|
|
177
208
|
};
|
|
178
209
|
|
|
210
|
+
export type AIImageData = {
|
|
211
|
+
data: string;
|
|
212
|
+
format: string;
|
|
213
|
+
isPartial: boolean;
|
|
214
|
+
revisedPrompt?: string;
|
|
215
|
+
imageId?: string;
|
|
216
|
+
};
|
|
217
|
+
|
|
179
218
|
export type AIMessage = {
|
|
180
219
|
id: string;
|
|
181
220
|
role: AIRole;
|
|
@@ -185,6 +224,7 @@ export type AIMessage = {
|
|
|
185
224
|
attachments?: AIAttachment[];
|
|
186
225
|
thinking?: string;
|
|
187
226
|
toolCalls?: AIToolCall[];
|
|
227
|
+
images?: AIImageData[];
|
|
188
228
|
isStreaming?: boolean;
|
|
189
229
|
model?: string;
|
|
190
230
|
usage?: AIUsage;
|
|
@@ -221,6 +261,7 @@ export type StreamAIOptions = {
|
|
|
221
261
|
onChunk?: (chunk: AITextChunk) => AITextChunk | void;
|
|
222
262
|
onComplete?: (fullResponse: string, usage?: AIUsage) => void;
|
|
223
263
|
onToolUse?: (name: string, input: unknown, result: string) => void;
|
|
264
|
+
onImage?: (imageData: AIImageData) => void;
|
|
224
265
|
maxTurns?: number;
|
|
225
266
|
signal?: AbortSignal;
|
|
226
267
|
};
|
|
@@ -264,6 +305,16 @@ export type AIStoreAction =
|
|
|
264
305
|
model?: string;
|
|
265
306
|
usage?: AIUsage;
|
|
266
307
|
}
|
|
308
|
+
| {
|
|
309
|
+
type: 'image';
|
|
310
|
+
conversationId: string;
|
|
311
|
+
messageId: string;
|
|
312
|
+
data: string;
|
|
313
|
+
format: string;
|
|
314
|
+
isPartial: boolean;
|
|
315
|
+
revisedPrompt?: string;
|
|
316
|
+
imageId?: string;
|
|
317
|
+
}
|
|
267
318
|
| { type: 'error'; message: string }
|
|
268
319
|
| {
|
|
269
320
|
type: 'send';
|
|
@@ -294,12 +345,28 @@ export type AIChatPluginConfig = {
|
|
|
294
345
|
path?: string;
|
|
295
346
|
provider: (providerName: string) => AIProviderConfig;
|
|
296
347
|
model?: string | ((providerName: string) => string);
|
|
297
|
-
tools?:
|
|
298
|
-
|
|
348
|
+
tools?:
|
|
349
|
+
| AIToolMap
|
|
350
|
+
| ((providerName: string, model: string) => AIToolMap | undefined);
|
|
351
|
+
thinking?:
|
|
352
|
+
| boolean
|
|
353
|
+
| { budgetTokens: number }
|
|
354
|
+
| ((
|
|
355
|
+
providerName: string,
|
|
356
|
+
model: string
|
|
357
|
+
) => boolean | { budgetTokens: number } | undefined);
|
|
299
358
|
systemPrompt?: string;
|
|
300
359
|
maxTurns?: number;
|
|
301
|
-
parseProvider?: (content: string) => {
|
|
302
|
-
|
|
360
|
+
parseProvider?: (content: string) => {
|
|
361
|
+
content: string;
|
|
362
|
+
model?: string;
|
|
363
|
+
providerName: string;
|
|
364
|
+
};
|
|
365
|
+
onComplete?: (
|
|
366
|
+
conversationId: string,
|
|
367
|
+
fullResponse: string,
|
|
368
|
+
usage?: AIUsage
|
|
369
|
+
) => void;
|
|
303
370
|
};
|
|
304
371
|
|
|
305
372
|
/* ─── Connection options ─── */
|
package/types/typeGuards.ts
CHANGED
|
@@ -69,6 +69,17 @@ export const isValidAIServerMessage = (
|
|
|
69
69
|
'messageId' in data &&
|
|
70
70
|
'conversationId' in data
|
|
71
71
|
);
|
|
72
|
+
case 'image':
|
|
73
|
+
return (
|
|
74
|
+
'data' in data &&
|
|
75
|
+
typeof data.data === 'string' &&
|
|
76
|
+
'format' in data &&
|
|
77
|
+
typeof data.format === 'string' &&
|
|
78
|
+
'isPartial' in data &&
|
|
79
|
+
typeof data.isPartial === 'boolean' &&
|
|
80
|
+
'messageId' in data &&
|
|
81
|
+
'conversationId' in data
|
|
82
|
+
);
|
|
72
83
|
case 'complete':
|
|
73
84
|
return 'messageId' in data && 'conversationId' in data;
|
|
74
85
|
case 'error':
|