sa2kit 3.7.0 → 3.8.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 (33) hide show
  1. package/dist/{chunk-ZJLS5JU5.mjs → chunk-6KD4CD7O.mjs} +7 -16
  2. package/dist/chunk-6KD4CD7O.mjs.map +1 -0
  3. package/dist/chunk-GJVEYCS4.js +12 -0
  4. package/dist/chunk-GJVEYCS4.js.map +1 -0
  5. package/dist/chunk-PPV4IEWR.mjs +8 -0
  6. package/dist/chunk-PPV4IEWR.mjs.map +1 -0
  7. package/dist/{chunk-XPY45Y75.js → chunk-VVHFMAE7.js} +9 -21
  8. package/dist/chunk-VVHFMAE7.js.map +1 -0
  9. package/dist/common/aiApi/client/index.d.mts +66 -4
  10. package/dist/common/aiApi/client/index.d.ts +66 -4
  11. package/dist/common/aiApi/client/index.js +360 -15
  12. package/dist/common/aiApi/client/index.js.map +1 -1
  13. package/dist/common/aiApi/client/index.mjs +345 -11
  14. package/dist/common/aiApi/client/index.mjs.map +1 -1
  15. package/dist/common/aiApi/index.d.mts +2 -2
  16. package/dist/common/aiApi/index.d.ts +2 -2
  17. package/dist/common/aiApi/index.js +63 -62
  18. package/dist/common/aiApi/index.mjs +2 -1
  19. package/dist/common/aiApi/server/index.d.mts +1 -1
  20. package/dist/common/aiApi/server/index.d.ts +1 -1
  21. package/dist/common/aiApi/server/index.js +63 -62
  22. package/dist/common/aiApi/server/index.mjs +2 -1
  23. package/dist/index.d.mts +9 -1
  24. package/dist/index.d.ts +9 -1
  25. package/dist/index.js +3 -9
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +3 -9
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/{types-CiqMQ-uu.d.mts → types-DgbG0Of-.d.mts} +9 -1
  30. package/dist/{types-CiqMQ-uu.d.ts → types-DgbG0Of-.d.ts} +9 -1
  31. package/package.json +1 -1
  32. package/dist/chunk-XPY45Y75.js.map +0 -1
  33. package/dist/chunk-ZJLS5JU5.mjs.map +0 -1
@@ -1,217 +1,218 @@
1
1
  'use strict';
2
2
 
3
- var chunkXPY45Y75_js = require('../../../chunk-XPY45Y75.js');
3
+ var chunkVVHFMAE7_js = require('../../../chunk-VVHFMAE7.js');
4
+ var chunkGJVEYCS4_js = require('../../../chunk-GJVEYCS4.js');
4
5
  require('../../../chunk-NSBPE2FW.js');
5
6
 
6
7
 
7
8
 
8
- Object.defineProperty(exports, "CORE_CONNECTIVITY_TEST_TASK_ID", {
9
- enumerable: true,
10
- get: function () { return chunkXPY45Y75_js.CORE_CONNECTIVITY_TEST_TASK_ID; }
11
- });
12
- Object.defineProperty(exports, "CORE_LLM_COMPLETION_TASK_ID", {
13
- enumerable: true,
14
- get: function () { return chunkXPY45Y75_js.CORE_LLM_COMPLETION_TASK_ID; }
15
- });
16
- Object.defineProperty(exports, "CORE_STRUCTURED_MULTIMODAL_TASK_ID", {
17
- enumerable: true,
18
- get: function () { return chunkXPY45Y75_js.CORE_STRUCTURED_MULTIMODAL_TASK_ID; }
19
- });
20
9
  Object.defineProperty(exports, "DEFAULT_OPENAI_BASE_URL", {
21
10
  enumerable: true,
22
- get: function () { return chunkXPY45Y75_js.DEFAULT_OPENAI_BASE_URL; }
11
+ get: function () { return chunkVVHFMAE7_js.DEFAULT_OPENAI_BASE_URL; }
23
12
  });
24
13
  Object.defineProperty(exports, "DEFAULT_TEXT_MODEL", {
25
14
  enumerable: true,
26
- get: function () { return chunkXPY45Y75_js.DEFAULT_TEXT_MODEL; }
15
+ get: function () { return chunkVVHFMAE7_js.DEFAULT_TEXT_MODEL; }
27
16
  });
28
17
  Object.defineProperty(exports, "appendTranscriptionsToPrompt", {
29
18
  enumerable: true,
30
- get: function () { return chunkXPY45Y75_js.appendTranscriptionsToPrompt; }
19
+ get: function () { return chunkVVHFMAE7_js.appendTranscriptionsToPrompt; }
31
20
  });
32
21
  Object.defineProperty(exports, "assertMultimodalCapableModel", {
33
22
  enumerable: true,
34
- get: function () { return chunkXPY45Y75_js.assertMultimodalCapableModel; }
23
+ get: function () { return chunkVVHFMAE7_js.assertMultimodalCapableModel; }
35
24
  });
36
25
  Object.defineProperty(exports, "assertValidAudioInput", {
37
26
  enumerable: true,
38
- get: function () { return chunkXPY45Y75_js.assertValidAudioInput; }
27
+ get: function () { return chunkVVHFMAE7_js.assertValidAudioInput; }
39
28
  });
40
29
  Object.defineProperty(exports, "assertValidImageInput", {
41
30
  enumerable: true,
42
- get: function () { return chunkXPY45Y75_js.assertValidImageInput; }
31
+ get: function () { return chunkVVHFMAE7_js.assertValidImageInput; }
43
32
  });
44
33
  Object.defineProperty(exports, "assertValidMultimodalMedia", {
45
34
  enumerable: true,
46
- get: function () { return chunkXPY45Y75_js.assertValidMultimodalMedia; }
35
+ get: function () { return chunkVVHFMAE7_js.assertValidMultimodalMedia; }
47
36
  });
48
37
  Object.defineProperty(exports, "assertVisionCapableModel", {
49
38
  enumerable: true,
50
- get: function () { return chunkXPY45Y75_js.assertVisionCapableModel; }
39
+ get: function () { return chunkVVHFMAE7_js.assertVisionCapableModel; }
51
40
  });
52
41
  Object.defineProperty(exports, "base64ToBlob", {
53
42
  enumerable: true,
54
- get: function () { return chunkXPY45Y75_js.base64ToBlob; }
43
+ get: function () { return chunkVVHFMAE7_js.base64ToBlob; }
55
44
  });
56
45
  Object.defineProperty(exports, "buildMultimodalMessages", {
57
46
  enumerable: true,
58
- get: function () { return chunkXPY45Y75_js.buildMultimodalMessages; }
47
+ get: function () { return chunkVVHFMAE7_js.buildMultimodalMessages; }
59
48
  });
60
49
  Object.defineProperty(exports, "callChat", {
61
50
  enumerable: true,
62
- get: function () { return chunkXPY45Y75_js.callChat; }
51
+ get: function () { return chunkVVHFMAE7_js.callChat; }
63
52
  });
64
53
  Object.defineProperty(exports, "callCompletion", {
65
54
  enumerable: true,
66
- get: function () { return chunkXPY45Y75_js.callCompletion; }
55
+ get: function () { return chunkVVHFMAE7_js.callCompletion; }
67
56
  });
68
57
  Object.defineProperty(exports, "callMultimodalChat", {
69
58
  enumerable: true,
70
- get: function () { return chunkXPY45Y75_js.callMultimodalChat; }
59
+ get: function () { return chunkVVHFMAE7_js.callMultimodalChat; }
71
60
  });
72
61
  Object.defineProperty(exports, "clearAiTasksForTest", {
73
62
  enumerable: true,
74
- get: function () { return chunkXPY45Y75_js.clearAiTasksForTest; }
63
+ get: function () { return chunkVVHFMAE7_js.clearAiTasksForTest; }
75
64
  });
76
65
  Object.defineProperty(exports, "coreConnectivityTestTask", {
77
66
  enumerable: true,
78
- get: function () { return chunkXPY45Y75_js.coreConnectivityTestTask; }
67
+ get: function () { return chunkVVHFMAE7_js.coreConnectivityTestTask; }
79
68
  });
80
69
  Object.defineProperty(exports, "coreLlmCompletionTask", {
81
70
  enumerable: true,
82
- get: function () { return chunkXPY45Y75_js.coreLlmCompletionTask; }
71
+ get: function () { return chunkVVHFMAE7_js.coreLlmCompletionTask; }
83
72
  });
84
73
  Object.defineProperty(exports, "coreStructuredMultimodalTask", {
85
74
  enumerable: true,
86
- get: function () { return chunkXPY45Y75_js.coreStructuredMultimodalTask; }
75
+ get: function () { return chunkVVHFMAE7_js.coreStructuredMultimodalTask; }
87
76
  });
88
77
  Object.defineProperty(exports, "detectVisionMessageFormat", {
89
78
  enumerable: true,
90
- get: function () { return chunkXPY45Y75_js.detectVisionMessageFormat; }
79
+ get: function () { return chunkVVHFMAE7_js.detectVisionMessageFormat; }
91
80
  });
92
81
  Object.defineProperty(exports, "ensureCoreAiTasksRegistered", {
93
82
  enumerable: true,
94
- get: function () { return chunkXPY45Y75_js.ensureCoreAiTasksRegistered; }
83
+ get: function () { return chunkVVHFMAE7_js.ensureCoreAiTasksRegistered; }
95
84
  });
96
85
  Object.defineProperty(exports, "extractJsonObject", {
97
86
  enumerable: true,
98
- get: function () { return chunkXPY45Y75_js.extractJsonObject; }
87
+ get: function () { return chunkVVHFMAE7_js.extractJsonObject; }
99
88
  });
100
89
  Object.defineProperty(exports, "fileToAiAudioInput", {
101
90
  enumerable: true,
102
- get: function () { return chunkXPY45Y75_js.fileToAiAudioInput; }
91
+ get: function () { return chunkVVHFMAE7_js.fileToAiAudioInput; }
103
92
  });
104
93
  Object.defineProperty(exports, "fileToAiImageInput", {
105
94
  enumerable: true,
106
- get: function () { return chunkXPY45Y75_js.fileToAiImageInput; }
95
+ get: function () { return chunkVVHFMAE7_js.fileToAiImageInput; }
107
96
  });
108
97
  Object.defineProperty(exports, "filterChatModels", {
109
98
  enumerable: true,
110
- get: function () { return chunkXPY45Y75_js.filterChatModels; }
99
+ get: function () { return chunkVVHFMAE7_js.filterChatModels; }
111
100
  });
112
101
  Object.defineProperty(exports, "filterSttModels", {
113
102
  enumerable: true,
114
- get: function () { return chunkXPY45Y75_js.filterSttModels; }
103
+ get: function () { return chunkVVHFMAE7_js.filterSttModels; }
115
104
  });
116
105
  Object.defineProperty(exports, "filterVisionModels", {
117
106
  enumerable: true,
118
- get: function () { return chunkXPY45Y75_js.filterVisionModels; }
107
+ get: function () { return chunkVVHFMAE7_js.filterVisionModels; }
119
108
  });
120
109
  Object.defineProperty(exports, "getAiTask", {
121
110
  enumerable: true,
122
- get: function () { return chunkXPY45Y75_js.getAiTask; }
111
+ get: function () { return chunkVVHFMAE7_js.getAiTask; }
123
112
  });
124
113
  Object.defineProperty(exports, "isAudioInputError", {
125
114
  enumerable: true,
126
- get: function () { return chunkXPY45Y75_js.isAudioInputError; }
115
+ get: function () { return chunkVVHFMAE7_js.isAudioInputError; }
127
116
  });
128
117
  Object.defineProperty(exports, "isImageUrlVariantError", {
129
118
  enumerable: true,
130
- get: function () { return chunkXPY45Y75_js.isImageUrlVariantError; }
119
+ get: function () { return chunkVVHFMAE7_js.isImageUrlVariantError; }
131
120
  });
132
121
  Object.defineProperty(exports, "isKnownTextOnlyModel", {
133
122
  enumerable: true,
134
- get: function () { return chunkXPY45Y75_js.isKnownTextOnlyModel; }
123
+ get: function () { return chunkVVHFMAE7_js.isKnownTextOnlyModel; }
135
124
  });
136
125
  Object.defineProperty(exports, "isLikelyNativeAudioChatModel", {
137
126
  enumerable: true,
138
- get: function () { return chunkXPY45Y75_js.isLikelyNativeAudioChatModel; }
127
+ get: function () { return chunkVVHFMAE7_js.isLikelyNativeAudioChatModel; }
139
128
  });
140
129
  Object.defineProperty(exports, "isLikelySttModel", {
141
130
  enumerable: true,
142
- get: function () { return chunkXPY45Y75_js.isLikelySttModel; }
131
+ get: function () { return chunkVVHFMAE7_js.isLikelySttModel; }
143
132
  });
144
133
  Object.defineProperty(exports, "isLikelyVisionModel", {
145
134
  enumerable: true,
146
- get: function () { return chunkXPY45Y75_js.isLikelyVisionModel; }
135
+ get: function () { return chunkVVHFMAE7_js.isLikelyVisionModel; }
147
136
  });
148
137
  Object.defineProperty(exports, "listAiTasks", {
149
138
  enumerable: true,
150
- get: function () { return chunkXPY45Y75_js.listAiTasks; }
139
+ get: function () { return chunkVVHFMAE7_js.listAiTasks; }
151
140
  });
152
141
  Object.defineProperty(exports, "listOpenAiCompatibleModels", {
153
142
  enumerable: true,
154
- get: function () { return chunkXPY45Y75_js.listOpenAiCompatibleModels; }
143
+ get: function () { return chunkVVHFMAE7_js.listOpenAiCompatibleModels; }
155
144
  });
156
145
  Object.defineProperty(exports, "mimeToAudioFormat", {
157
146
  enumerable: true,
158
- get: function () { return chunkXPY45Y75_js.mimeToAudioFormat; }
147
+ get: function () { return chunkVVHFMAE7_js.mimeToAudioFormat; }
159
148
  });
160
149
  Object.defineProperty(exports, "pickDefaultSttModel", {
161
150
  enumerable: true,
162
- get: function () { return chunkXPY45Y75_js.pickDefaultSttModel; }
151
+ get: function () { return chunkVVHFMAE7_js.pickDefaultSttModel; }
163
152
  });
164
153
  Object.defineProperty(exports, "pickDefaultVisionModel", {
165
154
  enumerable: true,
166
- get: function () { return chunkXPY45Y75_js.pickDefaultVisionModel; }
155
+ get: function () { return chunkVVHFMAE7_js.pickDefaultVisionModel; }
167
156
  });
168
157
  Object.defineProperty(exports, "registerAiTask", {
169
158
  enumerable: true,
170
- get: function () { return chunkXPY45Y75_js.registerAiTask; }
159
+ get: function () { return chunkVVHFMAE7_js.registerAiTask; }
171
160
  });
172
161
  Object.defineProperty(exports, "registerCoreAiTasks", {
173
162
  enumerable: true,
174
- get: function () { return chunkXPY45Y75_js.registerCoreAiTasks; }
163
+ get: function () { return chunkVVHFMAE7_js.registerCoreAiTasks; }
175
164
  });
176
165
  Object.defineProperty(exports, "requestJson", {
177
166
  enumerable: true,
178
- get: function () { return chunkXPY45Y75_js.requestJson; }
167
+ get: function () { return chunkVVHFMAE7_js.requestJson; }
179
168
  });
180
169
  Object.defineProperty(exports, "requireAiConnectionConfig", {
181
170
  enumerable: true,
182
- get: function () { return chunkXPY45Y75_js.requireAiConnectionConfig; }
171
+ get: function () { return chunkVVHFMAE7_js.requireAiConnectionConfig; }
183
172
  });
184
173
  Object.defineProperty(exports, "resetCoreAiTasksForTest", {
185
174
  enumerable: true,
186
- get: function () { return chunkXPY45Y75_js.resetCoreAiTasksForTest; }
175
+ get: function () { return chunkVVHFMAE7_js.resetCoreAiTasksForTest; }
187
176
  });
188
177
  Object.defineProperty(exports, "resolveAiConnectionConfig", {
189
178
  enumerable: true,
190
- get: function () { return chunkXPY45Y75_js.resolveAiConnectionConfig; }
179
+ get: function () { return chunkVVHFMAE7_js.resolveAiConnectionConfig; }
191
180
  });
192
181
  Object.defineProperty(exports, "resolveAudioHandling", {
193
182
  enumerable: true,
194
- get: function () { return chunkXPY45Y75_js.resolveAudioHandling; }
183
+ get: function () { return chunkVVHFMAE7_js.resolveAudioHandling; }
195
184
  });
196
185
  Object.defineProperty(exports, "runAiTask", {
197
186
  enumerable: true,
198
- get: function () { return chunkXPY45Y75_js.runAiTask; }
187
+ get: function () { return chunkVVHFMAE7_js.runAiTask; }
199
188
  });
200
189
  Object.defineProperty(exports, "splitMediaByKind", {
201
190
  enumerable: true,
202
- get: function () { return chunkXPY45Y75_js.splitMediaByKind; }
191
+ get: function () { return chunkVVHFMAE7_js.splitMediaByKind; }
203
192
  });
204
193
  Object.defineProperty(exports, "toVisionApiErrorMessage", {
205
194
  enumerable: true,
206
- get: function () { return chunkXPY45Y75_js.toVisionApiErrorMessage; }
195
+ get: function () { return chunkVVHFMAE7_js.toVisionApiErrorMessage; }
207
196
  });
208
197
  Object.defineProperty(exports, "transcribeAudio", {
209
198
  enumerable: true,
210
- get: function () { return chunkXPY45Y75_js.transcribeAudio; }
199
+ get: function () { return chunkVVHFMAE7_js.transcribeAudio; }
211
200
  });
212
201
  Object.defineProperty(exports, "transcribeAudios", {
213
202
  enumerable: true,
214
- get: function () { return chunkXPY45Y75_js.transcribeAudios; }
203
+ get: function () { return chunkVVHFMAE7_js.transcribeAudios; }
204
+ });
205
+ Object.defineProperty(exports, "CORE_CONNECTIVITY_TEST_TASK_ID", {
206
+ enumerable: true,
207
+ get: function () { return chunkGJVEYCS4_js.CORE_CONNECTIVITY_TEST_TASK_ID; }
208
+ });
209
+ Object.defineProperty(exports, "CORE_LLM_COMPLETION_TASK_ID", {
210
+ enumerable: true,
211
+ get: function () { return chunkGJVEYCS4_js.CORE_LLM_COMPLETION_TASK_ID; }
212
+ });
213
+ Object.defineProperty(exports, "CORE_STRUCTURED_MULTIMODAL_TASK_ID", {
214
+ enumerable: true,
215
+ get: function () { return chunkGJVEYCS4_js.CORE_STRUCTURED_MULTIMODAL_TASK_ID; }
215
216
  });
216
217
  //# sourceMappingURL=index.js.map
217
218
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
- export { CORE_CONNECTIVITY_TEST_TASK_ID, CORE_LLM_COMPLETION_TASK_ID, CORE_STRUCTURED_MULTIMODAL_TASK_ID, DEFAULT_OPENAI_BASE_URL, DEFAULT_TEXT_MODEL, appendTranscriptionsToPrompt, assertMultimodalCapableModel, assertValidAudioInput, assertValidImageInput, assertValidMultimodalMedia, assertVisionCapableModel, base64ToBlob, buildMultimodalMessages, callChat, callCompletion, callMultimodalChat, clearAiTasksForTest, coreConnectivityTestTask, coreLlmCompletionTask, coreStructuredMultimodalTask, detectVisionMessageFormat, ensureCoreAiTasksRegistered, extractJsonObject, fileToAiAudioInput, fileToAiImageInput, filterChatModels, filterSttModels, filterVisionModels, getAiTask, isAudioInputError, isImageUrlVariantError, isKnownTextOnlyModel, isLikelyNativeAudioChatModel, isLikelySttModel, isLikelyVisionModel, listAiTasks, listOpenAiCompatibleModels, mimeToAudioFormat, pickDefaultSttModel, pickDefaultVisionModel, registerAiTask, registerCoreAiTasks, requestJson, requireAiConnectionConfig, resetCoreAiTasksForTest, resolveAiConnectionConfig, resolveAudioHandling, runAiTask, splitMediaByKind, toVisionApiErrorMessage, transcribeAudio, transcribeAudios } from '../../../chunk-ZJLS5JU5.mjs';
1
+ export { DEFAULT_OPENAI_BASE_URL, DEFAULT_TEXT_MODEL, appendTranscriptionsToPrompt, assertMultimodalCapableModel, assertValidAudioInput, assertValidImageInput, assertValidMultimodalMedia, assertVisionCapableModel, base64ToBlob, buildMultimodalMessages, callChat, callCompletion, callMultimodalChat, clearAiTasksForTest, coreConnectivityTestTask, coreLlmCompletionTask, coreStructuredMultimodalTask, detectVisionMessageFormat, ensureCoreAiTasksRegistered, extractJsonObject, fileToAiAudioInput, fileToAiImageInput, filterChatModels, filterSttModels, filterVisionModels, getAiTask, isAudioInputError, isImageUrlVariantError, isKnownTextOnlyModel, isLikelyNativeAudioChatModel, isLikelySttModel, isLikelyVisionModel, listAiTasks, listOpenAiCompatibleModels, mimeToAudioFormat, pickDefaultSttModel, pickDefaultVisionModel, registerAiTask, registerCoreAiTasks, requestJson, requireAiConnectionConfig, resetCoreAiTasksForTest, resolveAiConnectionConfig, resolveAudioHandling, runAiTask, splitMediaByKind, toVisionApiErrorMessage, transcribeAudio, transcribeAudios } from '../../../chunk-6KD4CD7O.mjs';
2
+ export { CORE_CONNECTIVITY_TEST_TASK_ID, CORE_LLM_COMPLETION_TASK_ID, CORE_STRUCTURED_MULTIMODAL_TASK_ID } from '../../../chunk-PPV4IEWR.mjs';
2
3
  import '../../../chunk-MAI35PU6.mjs';
3
4
  //# sourceMappingURL=index.mjs.map
4
5
  //# sourceMappingURL=index.mjs.map
package/dist/index.d.mts CHANGED
@@ -10974,6 +10974,14 @@ interface ConnectivityTestOutput {
10974
10974
  ok: boolean;
10975
10975
  reply: string;
10976
10976
  }
10977
+ /** GET /api/ai/config 响应(宿主实现,不暴露 apiKey) */
10978
+ interface AiServerConfigStatus {
10979
+ serverConfigured: boolean;
10980
+ baseUrl?: string;
10981
+ visionModel?: string;
10982
+ textModel?: string;
10983
+ error?: string;
10984
+ }
10977
10985
  interface AiModelsListRequest {
10978
10986
  clientSettings?: AiClientSettings;
10979
10987
  }
@@ -11201,4 +11209,4 @@ declare const coreStructuredMultimodalTask: AiTaskDefinition<StructuredMultimoda
11201
11209
 
11202
11210
  declare const coreConnectivityTestTask: AiTaskDefinition<Record<string, never>, ConnectivityTestOutput>;
11203
11211
 
11204
- export { type AiApiErrorBody, type AiApiErrorCode, type AiApiResponse, type AiApiResponseMeta, type AiApiRunRequest, type AiAudioInput, type AiAudioMediaInput, type AiClientSettings, type AiConnectionConfig, type AiConnectionSettings, type AiImageInput, type AiImageMediaInput, type AiMediaInput, type AiMediaKind, type AiModelsListRequest, type AiModelsListResponse, type AiTaskContext, type AiTaskDefinition, type AiTaskRunOptions, Dialog as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, DialogDescription as AlertDialogDescription, DialogFooter as AlertDialogFooter, DialogHeader as AlertDialogHeader, DialogOverlay as AlertDialogOverlay, DialogPortal as AlertDialogPortal, DialogTitle as AlertDialogTitle, DialogTrigger as AlertDialogTrigger, type AudioStrategy, Avatar, AvatarFallback, AvatarImage, BackButton, type BackButtonProps, type BackgroundRemovalOptions, type BackgroundRemovalState, BackgroundRemover, Badge, type BadgeProps, Ball, Button, type ButtonProps, CORE_CONNECTIVITY_TEST_TASK_ID, CORE_LLM_COMPLETION_TASK_ID, CORE_STRUCTURED_MULTIMODAL_TASK_ID, type CallChatOptions, type CallChatResult, type CallCompletionParams, type CallCompletionResult, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatRole, type ChatUsage, CollisionBalls, CollisionBallsConfig, ConfirmModal, type ConfirmModalProps, type ConnectivityTestOutput, ConsoleLoggerAdapter, DEFAULT_OPENAI_BASE_URL, DEFAULT_TEXT_MODEL, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterButtonGroup, type FilterButtonGroupProps, type FilterOption, GenericOrderManager, type GenericOrderManagerProps, Grid, GridColumns, GridGap, GridItem, GridProps, type ImageMappingItem, ImageMappingPanel, type ImageMappingPanelProps, type ImageMappingValue, Input, type JsonRequestOptions, Label, type ListModelsResult, LocalImageMappingPanel, type LocalImageMappingPanelProps, type LogEntry, LogLevel, Logger, type LoggerAdapter, type LoggerConfig, Modal, type ModalProps, type MultimodalChatParams, type MultimodalChatResult, type OCROptions, type OCRResult, OCRScanner, type OCRState, type OrderManagerOperations, type OrderableItem, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, type ResolvedAudioHandling, ScrollArea, ScrollBar, SearchBox, SearchResultHint, type SearchResultHintProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SentimentAnalyzer, type SentimentOptions, type SentimentResult, type SentimentState, Separator, type SeparatorProps, Dialog as Sheet, DialogClose as SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, DialogOverlay as SheetOverlay, DialogPortal as SheetPortal, SheetTitle, DialogTrigger as SheetTrigger, SmartAssistant, type StorageAdapter, type StorageChangeEvent, type StructuredMultimodalInput, type StructuredMultimodalOutput, Tabs, TabsContent, TabsList, TabsTrigger, type TextCompletionInput, type TextCompletionOutput, type TextGenerationOptions, type TextGenerationState, Textarea, Timeline, TimelineConfig, TimelineItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TranscribeAudioOptions, type VisionMessageFormat, appendTranscriptionsToPrompt, arrayUtils, assertMultimodalCapableModel, assertValidAudioInput, assertValidImageInput, assertValidMultimodalMedia, assertVisionCapableModel, badgeVariants, base64ToBlob, buildMultimodalMessages, buttonVariants, callChat, callCompletion, callMultimodalChat, clearAiTasksForTest, cn, index as common, coreConnectivityTestTask, coreLlmCompletionTask, coreStructuredMultimodalTask, createLogger, debugUtils, detectVisionMessageFormat, ensureCoreAiTasksRegistered, errorUtils, extractJsonObject, fileToAiAudioInput, fileToAiImageInput, fileUtils, filterChatModels, filterSttModels, filterVisionModels, formatTime, getAiTask, isAudioInputError, isImageUrlVariantError, isKnownTextOnlyModel, isLikelyNativeAudioChatModel, isLikelySttModel, isLikelyVisionModel, japaneseUtils, listAiTasks, listOpenAiCompatibleModels, logger, mimeToAudioFormat, pickDefaultSttModel, pickDefaultVisionModel, registerAiTask, registerCoreAiTasks, requestJson, requireAiConnectionConfig, resetCoreAiTasksForTest, resolveAiConnectionConfig, resolveAudioHandling, runAiTask, splitMediaByKind, stringUtils, toVisionApiErrorMessage, transcribeAudio, transcribeAudios, useAsyncStorage, useBackgroundRemoval, useElectronStorage, useLocalStorage, useOCR, useSentimentAnalysis, useStorage, useTaroStorage, useTextGeneration, validators };
11212
+ export { type AiApiErrorBody, type AiApiErrorCode, type AiApiResponse, type AiApiResponseMeta, type AiApiRunRequest, type AiAudioInput, type AiAudioMediaInput, type AiClientSettings, type AiConnectionConfig, type AiConnectionSettings, type AiImageInput, type AiImageMediaInput, type AiMediaInput, type AiMediaKind, type AiModelsListRequest, type AiModelsListResponse, type AiServerConfigStatus, type AiTaskContext, type AiTaskDefinition, type AiTaskRunOptions, Dialog as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, DialogDescription as AlertDialogDescription, DialogFooter as AlertDialogFooter, DialogHeader as AlertDialogHeader, DialogOverlay as AlertDialogOverlay, DialogPortal as AlertDialogPortal, DialogTitle as AlertDialogTitle, DialogTrigger as AlertDialogTrigger, type AudioStrategy, Avatar, AvatarFallback, AvatarImage, BackButton, type BackButtonProps, type BackgroundRemovalOptions, type BackgroundRemovalState, BackgroundRemover, Badge, type BadgeProps, Ball, Button, type ButtonProps, CORE_CONNECTIVITY_TEST_TASK_ID, CORE_LLM_COMPLETION_TASK_ID, CORE_STRUCTURED_MULTIMODAL_TASK_ID, type CallChatOptions, type CallChatResult, type CallCompletionParams, type CallCompletionResult, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatRole, type ChatUsage, CollisionBalls, CollisionBallsConfig, ConfirmModal, type ConfirmModalProps, type ConnectivityTestOutput, ConsoleLoggerAdapter, DEFAULT_OPENAI_BASE_URL, DEFAULT_TEXT_MODEL, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterButtonGroup, type FilterButtonGroupProps, type FilterOption, GenericOrderManager, type GenericOrderManagerProps, Grid, GridColumns, GridGap, GridItem, GridProps, type ImageMappingItem, ImageMappingPanel, type ImageMappingPanelProps, type ImageMappingValue, Input, type JsonRequestOptions, Label, type ListModelsResult, LocalImageMappingPanel, type LocalImageMappingPanelProps, type LogEntry, LogLevel, Logger, type LoggerAdapter, type LoggerConfig, Modal, type ModalProps, type MultimodalChatParams, type MultimodalChatResult, type OCROptions, type OCRResult, OCRScanner, type OCRState, type OrderManagerOperations, type OrderableItem, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, type ResolvedAudioHandling, ScrollArea, ScrollBar, SearchBox, SearchResultHint, type SearchResultHintProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SentimentAnalyzer, type SentimentOptions, type SentimentResult, type SentimentState, Separator, type SeparatorProps, Dialog as Sheet, DialogClose as SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, DialogOverlay as SheetOverlay, DialogPortal as SheetPortal, SheetTitle, DialogTrigger as SheetTrigger, SmartAssistant, type StorageAdapter, type StorageChangeEvent, type StructuredMultimodalInput, type StructuredMultimodalOutput, Tabs, TabsContent, TabsList, TabsTrigger, type TextCompletionInput, type TextCompletionOutput, type TextGenerationOptions, type TextGenerationState, Textarea, Timeline, TimelineConfig, TimelineItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TranscribeAudioOptions, type VisionMessageFormat, appendTranscriptionsToPrompt, arrayUtils, assertMultimodalCapableModel, assertValidAudioInput, assertValidImageInput, assertValidMultimodalMedia, assertVisionCapableModel, badgeVariants, base64ToBlob, buildMultimodalMessages, buttonVariants, callChat, callCompletion, callMultimodalChat, clearAiTasksForTest, cn, index as common, coreConnectivityTestTask, coreLlmCompletionTask, coreStructuredMultimodalTask, createLogger, debugUtils, detectVisionMessageFormat, ensureCoreAiTasksRegistered, errorUtils, extractJsonObject, fileToAiAudioInput, fileToAiImageInput, fileUtils, filterChatModels, filterSttModels, filterVisionModels, formatTime, getAiTask, isAudioInputError, isImageUrlVariantError, isKnownTextOnlyModel, isLikelyNativeAudioChatModel, isLikelySttModel, isLikelyVisionModel, japaneseUtils, listAiTasks, listOpenAiCompatibleModels, logger, mimeToAudioFormat, pickDefaultSttModel, pickDefaultVisionModel, registerAiTask, registerCoreAiTasks, requestJson, requireAiConnectionConfig, resetCoreAiTasksForTest, resolveAiConnectionConfig, resolveAudioHandling, runAiTask, splitMediaByKind, stringUtils, toVisionApiErrorMessage, transcribeAudio, transcribeAudios, useAsyncStorage, useBackgroundRemoval, useElectronStorage, useLocalStorage, useOCR, useSentimentAnalysis, useStorage, useTaroStorage, useTextGeneration, validators };
package/dist/index.d.ts CHANGED
@@ -10974,6 +10974,14 @@ interface ConnectivityTestOutput {
10974
10974
  ok: boolean;
10975
10975
  reply: string;
10976
10976
  }
10977
+ /** GET /api/ai/config 响应(宿主实现,不暴露 apiKey) */
10978
+ interface AiServerConfigStatus {
10979
+ serverConfigured: boolean;
10980
+ baseUrl?: string;
10981
+ visionModel?: string;
10982
+ textModel?: string;
10983
+ error?: string;
10984
+ }
10977
10985
  interface AiModelsListRequest {
10978
10986
  clientSettings?: AiClientSettings;
10979
10987
  }
@@ -11201,4 +11209,4 @@ declare const coreStructuredMultimodalTask: AiTaskDefinition<StructuredMultimoda
11201
11209
 
11202
11210
  declare const coreConnectivityTestTask: AiTaskDefinition<Record<string, never>, ConnectivityTestOutput>;
11203
11211
 
11204
- export { type AiApiErrorBody, type AiApiErrorCode, type AiApiResponse, type AiApiResponseMeta, type AiApiRunRequest, type AiAudioInput, type AiAudioMediaInput, type AiClientSettings, type AiConnectionConfig, type AiConnectionSettings, type AiImageInput, type AiImageMediaInput, type AiMediaInput, type AiMediaKind, type AiModelsListRequest, type AiModelsListResponse, type AiTaskContext, type AiTaskDefinition, type AiTaskRunOptions, Dialog as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, DialogDescription as AlertDialogDescription, DialogFooter as AlertDialogFooter, DialogHeader as AlertDialogHeader, DialogOverlay as AlertDialogOverlay, DialogPortal as AlertDialogPortal, DialogTitle as AlertDialogTitle, DialogTrigger as AlertDialogTrigger, type AudioStrategy, Avatar, AvatarFallback, AvatarImage, BackButton, type BackButtonProps, type BackgroundRemovalOptions, type BackgroundRemovalState, BackgroundRemover, Badge, type BadgeProps, Ball, Button, type ButtonProps, CORE_CONNECTIVITY_TEST_TASK_ID, CORE_LLM_COMPLETION_TASK_ID, CORE_STRUCTURED_MULTIMODAL_TASK_ID, type CallChatOptions, type CallChatResult, type CallCompletionParams, type CallCompletionResult, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatRole, type ChatUsage, CollisionBalls, CollisionBallsConfig, ConfirmModal, type ConfirmModalProps, type ConnectivityTestOutput, ConsoleLoggerAdapter, DEFAULT_OPENAI_BASE_URL, DEFAULT_TEXT_MODEL, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterButtonGroup, type FilterButtonGroupProps, type FilterOption, GenericOrderManager, type GenericOrderManagerProps, Grid, GridColumns, GridGap, GridItem, GridProps, type ImageMappingItem, ImageMappingPanel, type ImageMappingPanelProps, type ImageMappingValue, Input, type JsonRequestOptions, Label, type ListModelsResult, LocalImageMappingPanel, type LocalImageMappingPanelProps, type LogEntry, LogLevel, Logger, type LoggerAdapter, type LoggerConfig, Modal, type ModalProps, type MultimodalChatParams, type MultimodalChatResult, type OCROptions, type OCRResult, OCRScanner, type OCRState, type OrderManagerOperations, type OrderableItem, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, type ResolvedAudioHandling, ScrollArea, ScrollBar, SearchBox, SearchResultHint, type SearchResultHintProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SentimentAnalyzer, type SentimentOptions, type SentimentResult, type SentimentState, Separator, type SeparatorProps, Dialog as Sheet, DialogClose as SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, DialogOverlay as SheetOverlay, DialogPortal as SheetPortal, SheetTitle, DialogTrigger as SheetTrigger, SmartAssistant, type StorageAdapter, type StorageChangeEvent, type StructuredMultimodalInput, type StructuredMultimodalOutput, Tabs, TabsContent, TabsList, TabsTrigger, type TextCompletionInput, type TextCompletionOutput, type TextGenerationOptions, type TextGenerationState, Textarea, Timeline, TimelineConfig, TimelineItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TranscribeAudioOptions, type VisionMessageFormat, appendTranscriptionsToPrompt, arrayUtils, assertMultimodalCapableModel, assertValidAudioInput, assertValidImageInput, assertValidMultimodalMedia, assertVisionCapableModel, badgeVariants, base64ToBlob, buildMultimodalMessages, buttonVariants, callChat, callCompletion, callMultimodalChat, clearAiTasksForTest, cn, index as common, coreConnectivityTestTask, coreLlmCompletionTask, coreStructuredMultimodalTask, createLogger, debugUtils, detectVisionMessageFormat, ensureCoreAiTasksRegistered, errorUtils, extractJsonObject, fileToAiAudioInput, fileToAiImageInput, fileUtils, filterChatModels, filterSttModels, filterVisionModels, formatTime, getAiTask, isAudioInputError, isImageUrlVariantError, isKnownTextOnlyModel, isLikelyNativeAudioChatModel, isLikelySttModel, isLikelyVisionModel, japaneseUtils, listAiTasks, listOpenAiCompatibleModels, logger, mimeToAudioFormat, pickDefaultSttModel, pickDefaultVisionModel, registerAiTask, registerCoreAiTasks, requestJson, requireAiConnectionConfig, resetCoreAiTasksForTest, resolveAiConnectionConfig, resolveAudioHandling, runAiTask, splitMediaByKind, stringUtils, toVisionApiErrorMessage, transcribeAudio, transcribeAudios, useAsyncStorage, useBackgroundRemoval, useElectronStorage, useLocalStorage, useOCR, useSentimentAnalysis, useStorage, useTaroStorage, useTextGeneration, validators };
11212
+ export { type AiApiErrorBody, type AiApiErrorCode, type AiApiResponse, type AiApiResponseMeta, type AiApiRunRequest, type AiAudioInput, type AiAudioMediaInput, type AiClientSettings, type AiConnectionConfig, type AiConnectionSettings, type AiImageInput, type AiImageMediaInput, type AiMediaInput, type AiMediaKind, type AiModelsListRequest, type AiModelsListResponse, type AiServerConfigStatus, type AiTaskContext, type AiTaskDefinition, type AiTaskRunOptions, Dialog as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, DialogDescription as AlertDialogDescription, DialogFooter as AlertDialogFooter, DialogHeader as AlertDialogHeader, DialogOverlay as AlertDialogOverlay, DialogPortal as AlertDialogPortal, DialogTitle as AlertDialogTitle, DialogTrigger as AlertDialogTrigger, type AudioStrategy, Avatar, AvatarFallback, AvatarImage, BackButton, type BackButtonProps, type BackgroundRemovalOptions, type BackgroundRemovalState, BackgroundRemover, Badge, type BadgeProps, Ball, Button, type ButtonProps, CORE_CONNECTIVITY_TEST_TASK_ID, CORE_LLM_COMPLETION_TASK_ID, CORE_STRUCTURED_MULTIMODAL_TASK_ID, type CallChatOptions, type CallChatResult, type CallCompletionParams, type CallCompletionResult, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatRole, type ChatUsage, CollisionBalls, CollisionBallsConfig, ConfirmModal, type ConfirmModalProps, type ConnectivityTestOutput, ConsoleLoggerAdapter, DEFAULT_OPENAI_BASE_URL, DEFAULT_TEXT_MODEL, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterButtonGroup, type FilterButtonGroupProps, type FilterOption, GenericOrderManager, type GenericOrderManagerProps, Grid, GridColumns, GridGap, GridItem, GridProps, type ImageMappingItem, ImageMappingPanel, type ImageMappingPanelProps, type ImageMappingValue, Input, type JsonRequestOptions, Label, type ListModelsResult, LocalImageMappingPanel, type LocalImageMappingPanelProps, type LogEntry, LogLevel, Logger, type LoggerAdapter, type LoggerConfig, Modal, type ModalProps, type MultimodalChatParams, type MultimodalChatResult, type OCROptions, type OCRResult, OCRScanner, type OCRState, type OrderManagerOperations, type OrderableItem, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, type ResolvedAudioHandling, ScrollArea, ScrollBar, SearchBox, SearchResultHint, type SearchResultHintProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SentimentAnalyzer, type SentimentOptions, type SentimentResult, type SentimentState, Separator, type SeparatorProps, Dialog as Sheet, DialogClose as SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, DialogOverlay as SheetOverlay, DialogPortal as SheetPortal, SheetTitle, DialogTrigger as SheetTrigger, SmartAssistant, type StorageAdapter, type StorageChangeEvent, type StructuredMultimodalInput, type StructuredMultimodalOutput, Tabs, TabsContent, TabsList, TabsTrigger, type TextCompletionInput, type TextCompletionOutput, type TextGenerationOptions, type TextGenerationState, Textarea, Timeline, TimelineConfig, TimelineItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TranscribeAudioOptions, type VisionMessageFormat, appendTranscriptionsToPrompt, arrayUtils, assertMultimodalCapableModel, assertValidAudioInput, assertValidImageInput, assertValidMultimodalMedia, assertVisionCapableModel, badgeVariants, base64ToBlob, buildMultimodalMessages, buttonVariants, callChat, callCompletion, callMultimodalChat, clearAiTasksForTest, cn, index as common, coreConnectivityTestTask, coreLlmCompletionTask, coreStructuredMultimodalTask, createLogger, debugUtils, detectVisionMessageFormat, ensureCoreAiTasksRegistered, errorUtils, extractJsonObject, fileToAiAudioInput, fileToAiImageInput, fileUtils, filterChatModels, filterSttModels, filterVisionModels, formatTime, getAiTask, isAudioInputError, isImageUrlVariantError, isKnownTextOnlyModel, isLikelyNativeAudioChatModel, isLikelySttModel, isLikelyVisionModel, japaneseUtils, listAiTasks, listOpenAiCompatibleModels, logger, mimeToAudioFormat, pickDefaultSttModel, pickDefaultVisionModel, registerAiTask, registerCoreAiTasks, requestJson, requireAiConnectionConfig, resetCoreAiTasksForTest, resolveAiConnectionConfig, resolveAudioHandling, runAiTask, splitMediaByKind, stringUtils, toVisionApiErrorMessage, transcribeAudio, transcribeAudios, useAsyncStorage, useBackgroundRemoval, useElectronStorage, useLocalStorage, useOCR, useSentimentAnalysis, useStorage, useTaroStorage, useTextGeneration, validators };
package/dist/index.js CHANGED
@@ -33564,23 +33564,17 @@ var coreConnectivityTestTask = {
33564
33564
  baseUrl: config.baseUrl,
33565
33565
  apiKey: config.apiKey,
33566
33566
  model: config.textModel,
33567
- systemPrompt: "You are a connectivity probe. Reply with JSON only.",
33568
- userPrompt: 'Return JSON: {"ok":true,"reply":"OK"}',
33567
+ systemPrompt: "You are a connectivity probe. Reply briefly.",
33568
+ userPrompt: "Say OK",
33569
33569
  temperature: 0,
33570
33570
  maxTokens: 32,
33571
33571
  timeoutMs: config.timeoutMs
33572
33572
  });
33573
- let ok = false;
33574
33573
  let reply = result.content.trim();
33575
33574
  try {
33576
33575
  const json2 = extractJsonObject(result.content);
33577
- ok = json2.ok === true || json2.ok === "true";
33578
- reply = String(json2.reply ?? result.content).trim();
33576
+ reply = String(json2.reply ?? json2.message ?? result.content).trim();
33579
33577
  } catch {
33580
- ok = /ok/i.test(result.content);
33581
- }
33582
- if (!ok && !reply) {
33583
- throw new Error("\u6A21\u578B\u672A\u8FD4\u56DE\u6709\u6548\u54CD\u5E94");
33584
33578
  }
33585
33579
  return {
33586
33580
  data: { ok: true, reply: reply || "OK" },