@h-ai/api-contract 0.1.0-alpha.15

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.
@@ -0,0 +1,1129 @@
1
+ import * as _orpc_contract from '@orpc/contract';
2
+ import * as zod_v4_core from 'zod/v4/core';
3
+ import * as zod from 'zod';
4
+ import { z } from 'zod';
5
+
6
+ /**
7
+ * @h-ai/api-contract — AI 领域 contract
8
+ *
9
+ * 定义 AI 功能相关 API 的接口边界:聊天补全、记忆管理与会话管理。
10
+ * 聊天补全使用 OpenAI 兼容结构(`messages` 数组 + `choices` 数组)。
11
+ * 所有接口均需 Bearer Token 认证(由 `@h-ai/serv` 的 feature 层强制)。
12
+ * @module ai-contract
13
+ */
14
+ /** AI 领域 oRPC contract。 */
15
+ declare const aiContract: {
16
+ chats: {
17
+ createCompletion: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
18
+ model: zod.ZodOptional<zod.ZodString>;
19
+ messages: zod.ZodArray<zod.ZodObject<{
20
+ role: zod.ZodEnum<{
21
+ system: "system";
22
+ user: "user";
23
+ assistant: "assistant";
24
+ tool: "tool";
25
+ }>;
26
+ content: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
27
+ type: zod.ZodLiteral<"text">;
28
+ text: zod.ZodString;
29
+ }, zod_v4_core.$strip>, zod.ZodObject<{
30
+ type: zod.ZodLiteral<"image_url">;
31
+ image_url: zod.ZodObject<{
32
+ url: zod.ZodString;
33
+ detail: zod.ZodOptional<zod.ZodEnum<{
34
+ auto: "auto";
35
+ low: "low";
36
+ high: "high";
37
+ }>>;
38
+ }, zod_v4_core.$strip>;
39
+ }, zod_v4_core.$strip>]>>]>>;
40
+ name: zod.ZodOptional<zod.ZodString>;
41
+ tool_calls: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
42
+ id: zod.ZodString;
43
+ type: zod.ZodLiteral<"function">;
44
+ function: zod.ZodObject<{
45
+ name: zod.ZodString;
46
+ arguments: zod.ZodString;
47
+ }, zod_v4_core.$strip>;
48
+ }, zod_v4_core.$strip>>>;
49
+ tool_call_id: zod.ZodOptional<zod.ZodString>;
50
+ }, zod_v4_core.$strip>>;
51
+ temperature: zod.ZodOptional<zod.ZodNumber>;
52
+ top_p: zod.ZodOptional<zod.ZodNumber>;
53
+ max_tokens: zod.ZodOptional<zod.ZodNumber>;
54
+ stream: zod.ZodOptional<zod.ZodBoolean>;
55
+ tools: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
56
+ type: zod.ZodLiteral<"function">;
57
+ function: zod.ZodObject<{
58
+ name: zod.ZodString;
59
+ description: zod.ZodOptional<zod.ZodString>;
60
+ parameters: zod.ZodOptional<zod.ZodObject<{
61
+ type: zod.ZodLiteral<"object">;
62
+ properties: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
63
+ type: zod.ZodString;
64
+ description: zod.ZodOptional<zod.ZodString>;
65
+ enum: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
66
+ }, zod_v4_core.$strip>>>;
67
+ required: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
68
+ }, zod_v4_core.$strip>>;
69
+ }, zod_v4_core.$strip>;
70
+ }, zod_v4_core.$strip>>>;
71
+ tool_choice: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodLiteral<"auto">, zod.ZodLiteral<"none">, zod.ZodObject<{
72
+ type: zod.ZodLiteral<"function">;
73
+ function: zod.ZodObject<{
74
+ name: zod.ZodString;
75
+ }, zod_v4_core.$strip>;
76
+ }, zod_v4_core.$strip>]>>;
77
+ }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
78
+ success: zod.ZodLiteral<true>;
79
+ data: zod.ZodObject<{
80
+ id: zod.ZodString;
81
+ object: zod.ZodLiteral<"chat.completion">;
82
+ created: zod.ZodNumber;
83
+ model: zod.ZodString;
84
+ choices: zod.ZodArray<zod.ZodObject<{
85
+ index: zod.ZodNumber;
86
+ message: zod.ZodObject<{
87
+ role: zod.ZodLiteral<"assistant">;
88
+ content: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
89
+ tool_calls: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
90
+ id: zod.ZodString;
91
+ type: zod.ZodLiteral<"function">;
92
+ function: zod.ZodObject<{
93
+ name: zod.ZodString;
94
+ arguments: zod.ZodString;
95
+ }, zod_v4_core.$strip>;
96
+ }, zod_v4_core.$strip>>>;
97
+ }, zod_v4_core.$strip>;
98
+ finish_reason: zod.ZodEnum<{
99
+ length: "length";
100
+ tool_calls: "tool_calls";
101
+ stop: "stop";
102
+ content_filter: "content_filter";
103
+ }>;
104
+ }, zod_v4_core.$strip>>;
105
+ usage: zod.ZodObject<{
106
+ prompt_tokens: zod.ZodNumber;
107
+ completion_tokens: zod.ZodNumber;
108
+ total_tokens: zod.ZodNumber;
109
+ }, zod_v4_core.$strip>;
110
+ }, zod_v4_core.$strip>;
111
+ }, zod_v4_core.$strip>, zod.ZodObject<{
112
+ success: zod.ZodLiteral<false>;
113
+ error: zod.ZodObject<{
114
+ code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
115
+ message: zod.ZodString;
116
+ httpStatus: zod.ZodOptional<zod.ZodNumber>;
117
+ system: zod.ZodOptional<zod.ZodString>;
118
+ module: zod.ZodOptional<zod.ZodString>;
119
+ cause: zod.ZodOptional<zod.ZodUnknown>;
120
+ suggestion: zod.ZodOptional<zod.ZodString>;
121
+ ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
122
+ }, zod_v4_core.$strip>;
123
+ }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
124
+ sendMessage: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
125
+ message: zod.ZodString;
126
+ systemPrompt: zod.ZodOptional<zod.ZodString>;
127
+ model: zod.ZodOptional<zod.ZodString>;
128
+ temperature: zod.ZodOptional<zod.ZodNumber>;
129
+ }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
130
+ success: zod.ZodLiteral<true>;
131
+ data: zod.ZodObject<{
132
+ content: zod.ZodString;
133
+ model: zod.ZodString;
134
+ usage: zod.ZodOptional<zod.ZodObject<{
135
+ prompt_tokens: zod.ZodNumber;
136
+ completion_tokens: zod.ZodNumber;
137
+ total_tokens: zod.ZodNumber;
138
+ }, zod_v4_core.$strip>>;
139
+ }, zod_v4_core.$strip>;
140
+ }, zod_v4_core.$strip>, zod.ZodObject<{
141
+ success: zod.ZodLiteral<false>;
142
+ error: zod.ZodObject<{
143
+ code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
144
+ message: zod.ZodString;
145
+ httpStatus: zod.ZodOptional<zod.ZodNumber>;
146
+ system: zod.ZodOptional<zod.ZodString>;
147
+ module: zod.ZodOptional<zod.ZodString>;
148
+ cause: zod.ZodOptional<zod.ZodUnknown>;
149
+ suggestion: zod.ZodOptional<zod.ZodString>;
150
+ ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
151
+ }, zod_v4_core.$strip>;
152
+ }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
153
+ listHistory: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
154
+ objectId: zod.ZodString;
155
+ sessionId: zod.ZodString;
156
+ limit: zod.ZodOptional<zod.ZodNumber>;
157
+ order: zod.ZodOptional<zod.ZodEnum<{
158
+ asc: "asc";
159
+ desc: "desc";
160
+ }>>;
161
+ }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
162
+ success: zod.ZodLiteral<true>;
163
+ data: zod.ZodObject<{
164
+ items: zod.ZodArray<zod.ZodObject<{
165
+ id: zod.ZodString;
166
+ objectId: zod.ZodString;
167
+ sessionId: zod.ZodString;
168
+ request: zod.ZodObject<{
169
+ model: zod.ZodString;
170
+ messages: zod.ZodArray<zod.ZodObject<{
171
+ role: zod.ZodEnum<{
172
+ system: "system";
173
+ user: "user";
174
+ assistant: "assistant";
175
+ tool: "tool";
176
+ }>;
177
+ content: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
178
+ type: zod.ZodLiteral<"text">;
179
+ text: zod.ZodString;
180
+ }, zod_v4_core.$strip>, zod.ZodObject<{
181
+ type: zod.ZodLiteral<"image_url">;
182
+ image_url: zod.ZodObject<{
183
+ url: zod.ZodString;
184
+ detail: zod.ZodOptional<zod.ZodEnum<{
185
+ auto: "auto";
186
+ low: "low";
187
+ high: "high";
188
+ }>>;
189
+ }, zod_v4_core.$strip>;
190
+ }, zod_v4_core.$strip>]>>]>>;
191
+ name: zod.ZodOptional<zod.ZodString>;
192
+ tool_calls: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
193
+ id: zod.ZodString;
194
+ type: zod.ZodLiteral<"function">;
195
+ function: zod.ZodObject<{
196
+ name: zod.ZodString;
197
+ arguments: zod.ZodString;
198
+ }, zod_v4_core.$strip>;
199
+ }, zod_v4_core.$strip>>>;
200
+ tool_call_id: zod.ZodOptional<zod.ZodString>;
201
+ }, zod_v4_core.$strip>>;
202
+ }, zod_v4_core.$strip>;
203
+ response: zod.ZodObject<{
204
+ content: zod.ZodString;
205
+ toolCalls: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
206
+ id: zod.ZodString;
207
+ type: zod.ZodLiteral<"function">;
208
+ function: zod.ZodObject<{
209
+ name: zod.ZodString;
210
+ arguments: zod.ZodString;
211
+ }, zod_v4_core.$strip>;
212
+ }, zod_v4_core.$strip>>>;
213
+ finishReason: zod.ZodString;
214
+ usage: zod.ZodObject<{
215
+ prompt_tokens: zod.ZodNumber;
216
+ completion_tokens: zod.ZodNumber;
217
+ total_tokens: zod.ZodNumber;
218
+ }, zod_v4_core.$strip>;
219
+ }, zod_v4_core.$strip>;
220
+ createdAt: zod.ZodNumber;
221
+ duration: zod.ZodNumber;
222
+ }, zod_v4_core.$strip>>;
223
+ }, zod_v4_core.$strip>;
224
+ }, zod_v4_core.$strip>, zod.ZodObject<{
225
+ success: zod.ZodLiteral<false>;
226
+ error: zod.ZodObject<{
227
+ code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
228
+ message: zod.ZodString;
229
+ httpStatus: zod.ZodOptional<zod.ZodNumber>;
230
+ system: zod.ZodOptional<zod.ZodString>;
231
+ module: zod.ZodOptional<zod.ZodString>;
232
+ cause: zod.ZodOptional<zod.ZodUnknown>;
233
+ suggestion: zod.ZodOptional<zod.ZodString>;
234
+ ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
235
+ }, zod_v4_core.$strip>;
236
+ }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
237
+ };
238
+ memories: {
239
+ recall: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
240
+ query: zod.ZodString;
241
+ topK: zod.ZodOptional<zod.ZodNumber>;
242
+ types: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
243
+ fact: "fact";
244
+ preference: "preference";
245
+ event: "event";
246
+ entity: "entity";
247
+ instruction: "instruction";
248
+ }>>>;
249
+ minImportance: zod.ZodOptional<zod.ZodNumber>;
250
+ objectId: zod.ZodOptional<zod.ZodString>;
251
+ }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
252
+ success: zod.ZodLiteral<true>;
253
+ data: zod.ZodObject<{
254
+ items: zod.ZodArray<zod.ZodObject<{
255
+ id: zod.ZodString;
256
+ content: zod.ZodString;
257
+ type: zod.ZodEnum<{
258
+ fact: "fact";
259
+ preference: "preference";
260
+ event: "event";
261
+ entity: "entity";
262
+ instruction: "instruction";
263
+ }>;
264
+ importance: zod.ZodNumber;
265
+ objectId: zod.ZodOptional<zod.ZodString>;
266
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
267
+ createdAt: zod.ZodNumber;
268
+ lastAccessedAt: zod.ZodNumber;
269
+ accessCount: zod.ZodNumber;
270
+ }, zod_v4_core.$strip>>;
271
+ }, zod_v4_core.$strip>;
272
+ }, zod_v4_core.$strip>, zod.ZodObject<{
273
+ success: zod.ZodLiteral<false>;
274
+ error: zod.ZodObject<{
275
+ code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
276
+ message: zod.ZodString;
277
+ httpStatus: zod.ZodOptional<zod.ZodNumber>;
278
+ system: zod.ZodOptional<zod.ZodString>;
279
+ module: zod.ZodOptional<zod.ZodString>;
280
+ cause: zod.ZodOptional<zod.ZodUnknown>;
281
+ suggestion: zod.ZodOptional<zod.ZodString>;
282
+ ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
283
+ }, zod_v4_core.$strip>;
284
+ }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
285
+ list: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
286
+ types: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
287
+ fact: "fact";
288
+ preference: "preference";
289
+ event: "event";
290
+ entity: "entity";
291
+ instruction: "instruction";
292
+ }>>>;
293
+ objectId: zod.ZodOptional<zod.ZodString>;
294
+ offset: zod.ZodOptional<zod.ZodNumber>;
295
+ limit: zod.ZodOptional<zod.ZodNumber>;
296
+ }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
297
+ success: zod.ZodLiteral<true>;
298
+ data: zod.ZodObject<{
299
+ items: zod.ZodArray<zod.ZodObject<{
300
+ id: zod.ZodString;
301
+ content: zod.ZodString;
302
+ type: zod.ZodEnum<{
303
+ fact: "fact";
304
+ preference: "preference";
305
+ event: "event";
306
+ entity: "entity";
307
+ instruction: "instruction";
308
+ }>;
309
+ importance: zod.ZodNumber;
310
+ objectId: zod.ZodOptional<zod.ZodString>;
311
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
312
+ createdAt: zod.ZodNumber;
313
+ lastAccessedAt: zod.ZodNumber;
314
+ accessCount: zod.ZodNumber;
315
+ }, zod_v4_core.$strip>>;
316
+ total: zod.ZodNumber;
317
+ }, zod_v4_core.$strip>;
318
+ }, zod_v4_core.$strip>, zod.ZodObject<{
319
+ success: zod.ZodLiteral<false>;
320
+ error: zod.ZodObject<{
321
+ code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
322
+ message: zod.ZodString;
323
+ httpStatus: zod.ZodOptional<zod.ZodNumber>;
324
+ system: zod.ZodOptional<zod.ZodString>;
325
+ module: zod.ZodOptional<zod.ZodString>;
326
+ cause: zod.ZodOptional<zod.ZodUnknown>;
327
+ suggestion: zod.ZodOptional<zod.ZodString>;
328
+ ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
329
+ }, zod_v4_core.$strip>;
330
+ }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
331
+ };
332
+ sessions: {
333
+ list: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
334
+ objectId: zod.ZodString;
335
+ }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
336
+ success: zod.ZodLiteral<true>;
337
+ data: zod.ZodObject<{
338
+ items: zod.ZodArray<zod.ZodObject<{
339
+ objectId: zod.ZodString;
340
+ sessionId: zod.ZodString;
341
+ createdAt: zod.ZodNumber;
342
+ updatedAt: zod.ZodNumber;
343
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
344
+ }, zod_v4_core.$strip>>;
345
+ }, zod_v4_core.$strip>;
346
+ }, zod_v4_core.$strip>, zod.ZodObject<{
347
+ success: zod.ZodLiteral<false>;
348
+ error: zod.ZodObject<{
349
+ code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
350
+ message: zod.ZodString;
351
+ httpStatus: zod.ZodOptional<zod.ZodNumber>;
352
+ system: zod.ZodOptional<zod.ZodString>;
353
+ module: zod.ZodOptional<zod.ZodString>;
354
+ cause: zod.ZodOptional<zod.ZodUnknown>;
355
+ suggestion: zod.ZodOptional<zod.ZodString>;
356
+ ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
357
+ }, zod_v4_core.$strip>;
358
+ }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
359
+ };
360
+ };
361
+ type AiContract = typeof aiContract;
362
+
363
+ /**
364
+ * @h-ai/api-contract — AI 领域 Schema
365
+ *
366
+ * 包含聊天补全、消息占位、记忆召回与历史会话相关的 input/output Zod Schema。
367
+ * 聊天补全结构对齐 OpenAI Chat Completions API,支持 tool calling。
368
+ * 所有 Output Schema 均用 `haiResultSchema()` 封装。
369
+ * @module ai-schemas
370
+ */
371
+
372
+ /** 消息角色 Schema。 */
373
+ declare const AiMessageRoleSchema: z.ZodEnum<{
374
+ system: "system";
375
+ user: "user";
376
+ assistant: "assistant";
377
+ tool: "tool";
378
+ }>;
379
+ /** 文本内容 Schema。 */
380
+ declare const AiTextContentSchema: z.ZodObject<{
381
+ type: z.ZodLiteral<"text">;
382
+ text: z.ZodString;
383
+ }, z.core.$strip>;
384
+ /** 图片内容 Schema。 */
385
+ declare const AiImageContentSchema: z.ZodObject<{
386
+ type: z.ZodLiteral<"image_url">;
387
+ image_url: z.ZodObject<{
388
+ url: z.ZodString;
389
+ detail: z.ZodOptional<z.ZodEnum<{
390
+ auto: "auto";
391
+ low: "low";
392
+ high: "high";
393
+ }>>;
394
+ }, z.core.$strip>;
395
+ }, z.core.$strip>;
396
+ /** 消息内容 Schema。 */
397
+ declare const AiMessageContentSchema: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
398
+ type: z.ZodLiteral<"text">;
399
+ text: z.ZodString;
400
+ }, z.core.$strip>, z.ZodObject<{
401
+ type: z.ZodLiteral<"image_url">;
402
+ image_url: z.ZodObject<{
403
+ url: z.ZodString;
404
+ detail: z.ZodOptional<z.ZodEnum<{
405
+ auto: "auto";
406
+ low: "low";
407
+ high: "high";
408
+ }>>;
409
+ }, z.core.$strip>;
410
+ }, z.core.$strip>]>>]>;
411
+ /** 工具调用 Schema。 */
412
+ declare const AiToolCallSchema: z.ZodObject<{
413
+ id: z.ZodString;
414
+ type: z.ZodLiteral<"function">;
415
+ function: z.ZodObject<{
416
+ name: z.ZodString;
417
+ arguments: z.ZodString;
418
+ }, z.core.$strip>;
419
+ }, z.core.$strip>;
420
+ /** 聊天消息 Schema。 */
421
+ declare const AiChatMessageSchema: z.ZodObject<{
422
+ role: z.ZodEnum<{
423
+ system: "system";
424
+ user: "user";
425
+ assistant: "assistant";
426
+ tool: "tool";
427
+ }>;
428
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
429
+ type: z.ZodLiteral<"text">;
430
+ text: z.ZodString;
431
+ }, z.core.$strip>, z.ZodObject<{
432
+ type: z.ZodLiteral<"image_url">;
433
+ image_url: z.ZodObject<{
434
+ url: z.ZodString;
435
+ detail: z.ZodOptional<z.ZodEnum<{
436
+ auto: "auto";
437
+ low: "low";
438
+ high: "high";
439
+ }>>;
440
+ }, z.core.$strip>;
441
+ }, z.core.$strip>]>>]>>;
442
+ name: z.ZodOptional<z.ZodString>;
443
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
444
+ id: z.ZodString;
445
+ type: z.ZodLiteral<"function">;
446
+ function: z.ZodObject<{
447
+ name: z.ZodString;
448
+ arguments: z.ZodString;
449
+ }, z.core.$strip>;
450
+ }, z.core.$strip>>>;
451
+ tool_call_id: z.ZodOptional<z.ZodString>;
452
+ }, z.core.$strip>;
453
+ /** 工具参数 Schema。 */
454
+ declare const AiToolParameterSchema: z.ZodObject<{
455
+ type: z.ZodString;
456
+ description: z.ZodOptional<z.ZodString>;
457
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
458
+ }, z.core.$strip>;
459
+ /** 工具定义 Schema。 */
460
+ declare const AiToolDefinitionSchema: z.ZodObject<{
461
+ type: z.ZodLiteral<"function">;
462
+ function: z.ZodObject<{
463
+ name: z.ZodString;
464
+ description: z.ZodOptional<z.ZodString>;
465
+ parameters: z.ZodOptional<z.ZodObject<{
466
+ type: z.ZodLiteral<"object">;
467
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
468
+ type: z.ZodString;
469
+ description: z.ZodOptional<z.ZodString>;
470
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
471
+ }, z.core.$strip>>>;
472
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
473
+ }, z.core.$strip>>;
474
+ }, z.core.$strip>;
475
+ }, z.core.$strip>;
476
+ /** 聊天完成入参 Schema。 */
477
+ declare const AiChatCompletionInputSchema: z.ZodObject<{
478
+ model: z.ZodOptional<z.ZodString>;
479
+ messages: z.ZodArray<z.ZodObject<{
480
+ role: z.ZodEnum<{
481
+ system: "system";
482
+ user: "user";
483
+ assistant: "assistant";
484
+ tool: "tool";
485
+ }>;
486
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
487
+ type: z.ZodLiteral<"text">;
488
+ text: z.ZodString;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ type: z.ZodLiteral<"image_url">;
491
+ image_url: z.ZodObject<{
492
+ url: z.ZodString;
493
+ detail: z.ZodOptional<z.ZodEnum<{
494
+ auto: "auto";
495
+ low: "low";
496
+ high: "high";
497
+ }>>;
498
+ }, z.core.$strip>;
499
+ }, z.core.$strip>]>>]>>;
500
+ name: z.ZodOptional<z.ZodString>;
501
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
502
+ id: z.ZodString;
503
+ type: z.ZodLiteral<"function">;
504
+ function: z.ZodObject<{
505
+ name: z.ZodString;
506
+ arguments: z.ZodString;
507
+ }, z.core.$strip>;
508
+ }, z.core.$strip>>>;
509
+ tool_call_id: z.ZodOptional<z.ZodString>;
510
+ }, z.core.$strip>>;
511
+ temperature: z.ZodOptional<z.ZodNumber>;
512
+ top_p: z.ZodOptional<z.ZodNumber>;
513
+ max_tokens: z.ZodOptional<z.ZodNumber>;
514
+ stream: z.ZodOptional<z.ZodBoolean>;
515
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
516
+ type: z.ZodLiteral<"function">;
517
+ function: z.ZodObject<{
518
+ name: z.ZodString;
519
+ description: z.ZodOptional<z.ZodString>;
520
+ parameters: z.ZodOptional<z.ZodObject<{
521
+ type: z.ZodLiteral<"object">;
522
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
523
+ type: z.ZodString;
524
+ description: z.ZodOptional<z.ZodString>;
525
+ enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
526
+ }, z.core.$strip>>>;
527
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
528
+ }, z.core.$strip>>;
529
+ }, z.core.$strip>;
530
+ }, z.core.$strip>>>;
531
+ tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
532
+ type: z.ZodLiteral<"function">;
533
+ function: z.ZodObject<{
534
+ name: z.ZodString;
535
+ }, z.core.$strip>;
536
+ }, z.core.$strip>]>>;
537
+ }, z.core.$strip>;
538
+ /** Token 使用统计 Schema。 */
539
+ declare const AiTokenUsageSchema: z.ZodObject<{
540
+ prompt_tokens: z.ZodNumber;
541
+ completion_tokens: z.ZodNumber;
542
+ total_tokens: z.ZodNumber;
543
+ }, z.core.$strip>;
544
+ /** 助手消息 Schema。 */
545
+ declare const AiAssistantMessageSchema: z.ZodObject<{
546
+ role: z.ZodLiteral<"assistant">;
547
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
548
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
549
+ id: z.ZodString;
550
+ type: z.ZodLiteral<"function">;
551
+ function: z.ZodObject<{
552
+ name: z.ZodString;
553
+ arguments: z.ZodString;
554
+ }, z.core.$strip>;
555
+ }, z.core.$strip>>>;
556
+ }, z.core.$strip>;
557
+ /** 聊天完成选择 Schema。 */
558
+ declare const AiChatCompletionChoiceSchema: z.ZodObject<{
559
+ index: z.ZodNumber;
560
+ message: z.ZodObject<{
561
+ role: z.ZodLiteral<"assistant">;
562
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
563
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
564
+ id: z.ZodString;
565
+ type: z.ZodLiteral<"function">;
566
+ function: z.ZodObject<{
567
+ name: z.ZodString;
568
+ arguments: z.ZodString;
569
+ }, z.core.$strip>;
570
+ }, z.core.$strip>>>;
571
+ }, z.core.$strip>;
572
+ finish_reason: z.ZodEnum<{
573
+ length: "length";
574
+ tool_calls: "tool_calls";
575
+ stop: "stop";
576
+ content_filter: "content_filter";
577
+ }>;
578
+ }, z.core.$strip>;
579
+ /** 聊天完成业务数据 Schema。 */
580
+ declare const AiChatCompletionDataSchema: z.ZodObject<{
581
+ id: z.ZodString;
582
+ object: z.ZodLiteral<"chat.completion">;
583
+ created: z.ZodNumber;
584
+ model: z.ZodString;
585
+ choices: z.ZodArray<z.ZodObject<{
586
+ index: z.ZodNumber;
587
+ message: z.ZodObject<{
588
+ role: z.ZodLiteral<"assistant">;
589
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
590
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
591
+ id: z.ZodString;
592
+ type: z.ZodLiteral<"function">;
593
+ function: z.ZodObject<{
594
+ name: z.ZodString;
595
+ arguments: z.ZodString;
596
+ }, z.core.$strip>;
597
+ }, z.core.$strip>>>;
598
+ }, z.core.$strip>;
599
+ finish_reason: z.ZodEnum<{
600
+ length: "length";
601
+ tool_calls: "tool_calls";
602
+ stop: "stop";
603
+ content_filter: "content_filter";
604
+ }>;
605
+ }, z.core.$strip>>;
606
+ usage: z.ZodObject<{
607
+ prompt_tokens: z.ZodNumber;
608
+ completion_tokens: z.ZodNumber;
609
+ total_tokens: z.ZodNumber;
610
+ }, z.core.$strip>;
611
+ }, z.core.$strip>;
612
+ /** 简单消息入参 Schema。 */
613
+ declare const AiSendMessageInputSchema: z.ZodObject<{
614
+ message: z.ZodString;
615
+ systemPrompt: z.ZodOptional<z.ZodString>;
616
+ model: z.ZodOptional<z.ZodString>;
617
+ temperature: z.ZodOptional<z.ZodNumber>;
618
+ }, z.core.$strip>;
619
+ /** 简单消息业务数据 Schema。 */
620
+ declare const AiSendMessageDataSchema: z.ZodObject<{
621
+ content: z.ZodString;
622
+ model: z.ZodString;
623
+ usage: z.ZodOptional<z.ZodObject<{
624
+ prompt_tokens: z.ZodNumber;
625
+ completion_tokens: z.ZodNumber;
626
+ total_tokens: z.ZodNumber;
627
+ }, z.core.$strip>>;
628
+ }, z.core.$strip>;
629
+ /** 记忆类型 Schema。 */
630
+ declare const AiMemoryTypeSchema: z.ZodEnum<{
631
+ fact: "fact";
632
+ preference: "preference";
633
+ event: "event";
634
+ entity: "entity";
635
+ instruction: "instruction";
636
+ }>;
637
+ /** 记忆条目 Schema。 */
638
+ declare const AiMemoryEntrySchema: z.ZodObject<{
639
+ id: z.ZodString;
640
+ content: z.ZodString;
641
+ type: z.ZodEnum<{
642
+ fact: "fact";
643
+ preference: "preference";
644
+ event: "event";
645
+ entity: "entity";
646
+ instruction: "instruction";
647
+ }>;
648
+ importance: z.ZodNumber;
649
+ objectId: z.ZodOptional<z.ZodString>;
650
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
651
+ createdAt: z.ZodNumber;
652
+ lastAccessedAt: z.ZodNumber;
653
+ accessCount: z.ZodNumber;
654
+ }, z.core.$strip>;
655
+ /** 记忆检索入参 Schema。 */
656
+ declare const AiMemoryRecallInputSchema: z.ZodObject<{
657
+ query: z.ZodString;
658
+ topK: z.ZodOptional<z.ZodNumber>;
659
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
660
+ fact: "fact";
661
+ preference: "preference";
662
+ event: "event";
663
+ entity: "entity";
664
+ instruction: "instruction";
665
+ }>>>;
666
+ minImportance: z.ZodOptional<z.ZodNumber>;
667
+ objectId: z.ZodOptional<z.ZodString>;
668
+ }, z.core.$strip>;
669
+ /** 记忆检索业务数据 Schema。 */
670
+ declare const AiMemoryRecallDataSchema: z.ZodObject<{
671
+ items: z.ZodArray<z.ZodObject<{
672
+ id: z.ZodString;
673
+ content: z.ZodString;
674
+ type: z.ZodEnum<{
675
+ fact: "fact";
676
+ preference: "preference";
677
+ event: "event";
678
+ entity: "entity";
679
+ instruction: "instruction";
680
+ }>;
681
+ importance: z.ZodNumber;
682
+ objectId: z.ZodOptional<z.ZodString>;
683
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
684
+ createdAt: z.ZodNumber;
685
+ lastAccessedAt: z.ZodNumber;
686
+ accessCount: z.ZodNumber;
687
+ }, z.core.$strip>>;
688
+ }, z.core.$strip>;
689
+ /** 记忆列表入参 Schema。 */
690
+ declare const AiMemoryListInputSchema: z.ZodObject<{
691
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
692
+ fact: "fact";
693
+ preference: "preference";
694
+ event: "event";
695
+ entity: "entity";
696
+ instruction: "instruction";
697
+ }>>>;
698
+ objectId: z.ZodOptional<z.ZodString>;
699
+ offset: z.ZodOptional<z.ZodNumber>;
700
+ limit: z.ZodOptional<z.ZodNumber>;
701
+ }, z.core.$strip>;
702
+ /** 记忆列表业务数据 Schema。 */
703
+ declare const AiMemoryListDataSchema: z.ZodObject<{
704
+ items: z.ZodArray<z.ZodObject<{
705
+ id: z.ZodString;
706
+ content: z.ZodString;
707
+ type: z.ZodEnum<{
708
+ fact: "fact";
709
+ preference: "preference";
710
+ event: "event";
711
+ entity: "entity";
712
+ instruction: "instruction";
713
+ }>;
714
+ importance: z.ZodNumber;
715
+ objectId: z.ZodOptional<z.ZodString>;
716
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
717
+ createdAt: z.ZodNumber;
718
+ lastAccessedAt: z.ZodNumber;
719
+ accessCount: z.ZodNumber;
720
+ }, z.core.$strip>>;
721
+ total: z.ZodNumber;
722
+ }, z.core.$strip>;
723
+ /** 会话信息 Schema。 */
724
+ declare const AiSessionInfoSchema: z.ZodObject<{
725
+ objectId: z.ZodString;
726
+ sessionId: z.ZodString;
727
+ createdAt: z.ZodNumber;
728
+ updatedAt: z.ZodNumber;
729
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
730
+ }, z.core.$strip>;
731
+ /** 会话列表入参 Schema。 */
732
+ declare const AiSessionListInputSchema: z.ZodObject<{
733
+ objectId: z.ZodString;
734
+ }, z.core.$strip>;
735
+ /** 会话列表业务数据 Schema。 */
736
+ declare const AiSessionListDataSchema: z.ZodObject<{
737
+ items: z.ZodArray<z.ZodObject<{
738
+ objectId: z.ZodString;
739
+ sessionId: z.ZodString;
740
+ createdAt: z.ZodNumber;
741
+ updatedAt: z.ZodNumber;
742
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
743
+ }, z.core.$strip>>;
744
+ }, z.core.$strip>;
745
+ /** 对话记录 Schema。 */
746
+ declare const AiChatRecordSchema: z.ZodObject<{
747
+ id: z.ZodString;
748
+ objectId: z.ZodString;
749
+ sessionId: z.ZodString;
750
+ request: z.ZodObject<{
751
+ model: z.ZodString;
752
+ messages: z.ZodArray<z.ZodObject<{
753
+ role: z.ZodEnum<{
754
+ system: "system";
755
+ user: "user";
756
+ assistant: "assistant";
757
+ tool: "tool";
758
+ }>;
759
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
760
+ type: z.ZodLiteral<"text">;
761
+ text: z.ZodString;
762
+ }, z.core.$strip>, z.ZodObject<{
763
+ type: z.ZodLiteral<"image_url">;
764
+ image_url: z.ZodObject<{
765
+ url: z.ZodString;
766
+ detail: z.ZodOptional<z.ZodEnum<{
767
+ auto: "auto";
768
+ low: "low";
769
+ high: "high";
770
+ }>>;
771
+ }, z.core.$strip>;
772
+ }, z.core.$strip>]>>]>>;
773
+ name: z.ZodOptional<z.ZodString>;
774
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
775
+ id: z.ZodString;
776
+ type: z.ZodLiteral<"function">;
777
+ function: z.ZodObject<{
778
+ name: z.ZodString;
779
+ arguments: z.ZodString;
780
+ }, z.core.$strip>;
781
+ }, z.core.$strip>>>;
782
+ tool_call_id: z.ZodOptional<z.ZodString>;
783
+ }, z.core.$strip>>;
784
+ }, z.core.$strip>;
785
+ response: z.ZodObject<{
786
+ content: z.ZodString;
787
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
788
+ id: z.ZodString;
789
+ type: z.ZodLiteral<"function">;
790
+ function: z.ZodObject<{
791
+ name: z.ZodString;
792
+ arguments: z.ZodString;
793
+ }, z.core.$strip>;
794
+ }, z.core.$strip>>>;
795
+ finishReason: z.ZodString;
796
+ usage: z.ZodObject<{
797
+ prompt_tokens: z.ZodNumber;
798
+ completion_tokens: z.ZodNumber;
799
+ total_tokens: z.ZodNumber;
800
+ }, z.core.$strip>;
801
+ }, z.core.$strip>;
802
+ createdAt: z.ZodNumber;
803
+ duration: z.ZodNumber;
804
+ }, z.core.$strip>;
805
+ /** 对话历史入参 Schema。 */
806
+ declare const AiChatHistoryInputSchema: z.ZodObject<{
807
+ objectId: z.ZodString;
808
+ sessionId: z.ZodString;
809
+ limit: z.ZodOptional<z.ZodNumber>;
810
+ order: z.ZodOptional<z.ZodEnum<{
811
+ asc: "asc";
812
+ desc: "desc";
813
+ }>>;
814
+ }, z.core.$strip>;
815
+ /** 对话历史业务数据 Schema。 */
816
+ declare const AiChatHistoryDataSchema: z.ZodObject<{
817
+ items: z.ZodArray<z.ZodObject<{
818
+ id: z.ZodString;
819
+ objectId: z.ZodString;
820
+ sessionId: z.ZodString;
821
+ request: z.ZodObject<{
822
+ model: z.ZodString;
823
+ messages: z.ZodArray<z.ZodObject<{
824
+ role: z.ZodEnum<{
825
+ system: "system";
826
+ user: "user";
827
+ assistant: "assistant";
828
+ tool: "tool";
829
+ }>;
830
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
831
+ type: z.ZodLiteral<"text">;
832
+ text: z.ZodString;
833
+ }, z.core.$strip>, z.ZodObject<{
834
+ type: z.ZodLiteral<"image_url">;
835
+ image_url: z.ZodObject<{
836
+ url: z.ZodString;
837
+ detail: z.ZodOptional<z.ZodEnum<{
838
+ auto: "auto";
839
+ low: "low";
840
+ high: "high";
841
+ }>>;
842
+ }, z.core.$strip>;
843
+ }, z.core.$strip>]>>]>>;
844
+ name: z.ZodOptional<z.ZodString>;
845
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
846
+ id: z.ZodString;
847
+ type: z.ZodLiteral<"function">;
848
+ function: z.ZodObject<{
849
+ name: z.ZodString;
850
+ arguments: z.ZodString;
851
+ }, z.core.$strip>;
852
+ }, z.core.$strip>>>;
853
+ tool_call_id: z.ZodOptional<z.ZodString>;
854
+ }, z.core.$strip>>;
855
+ }, z.core.$strip>;
856
+ response: z.ZodObject<{
857
+ content: z.ZodString;
858
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
859
+ id: z.ZodString;
860
+ type: z.ZodLiteral<"function">;
861
+ function: z.ZodObject<{
862
+ name: z.ZodString;
863
+ arguments: z.ZodString;
864
+ }, z.core.$strip>;
865
+ }, z.core.$strip>>>;
866
+ finishReason: z.ZodString;
867
+ usage: z.ZodObject<{
868
+ prompt_tokens: z.ZodNumber;
869
+ completion_tokens: z.ZodNumber;
870
+ total_tokens: z.ZodNumber;
871
+ }, z.core.$strip>;
872
+ }, z.core.$strip>;
873
+ createdAt: z.ZodNumber;
874
+ duration: z.ZodNumber;
875
+ }, z.core.$strip>>;
876
+ }, z.core.$strip>;
877
+ declare const AiChatCompletionOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
878
+ success: z.ZodLiteral<true>;
879
+ data: z.ZodObject<{
880
+ id: z.ZodString;
881
+ object: z.ZodLiteral<"chat.completion">;
882
+ created: z.ZodNumber;
883
+ model: z.ZodString;
884
+ choices: z.ZodArray<z.ZodObject<{
885
+ index: z.ZodNumber;
886
+ message: z.ZodObject<{
887
+ role: z.ZodLiteral<"assistant">;
888
+ content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
889
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
890
+ id: z.ZodString;
891
+ type: z.ZodLiteral<"function">;
892
+ function: z.ZodObject<{
893
+ name: z.ZodString;
894
+ arguments: z.ZodString;
895
+ }, z.core.$strip>;
896
+ }, z.core.$strip>>>;
897
+ }, z.core.$strip>;
898
+ finish_reason: z.ZodEnum<{
899
+ length: "length";
900
+ tool_calls: "tool_calls";
901
+ stop: "stop";
902
+ content_filter: "content_filter";
903
+ }>;
904
+ }, z.core.$strip>>;
905
+ usage: z.ZodObject<{
906
+ prompt_tokens: z.ZodNumber;
907
+ completion_tokens: z.ZodNumber;
908
+ total_tokens: z.ZodNumber;
909
+ }, z.core.$strip>;
910
+ }, z.core.$strip>;
911
+ }, z.core.$strip>, z.ZodObject<{
912
+ success: z.ZodLiteral<false>;
913
+ error: z.ZodObject<{
914
+ code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
915
+ message: z.ZodString;
916
+ httpStatus: z.ZodOptional<z.ZodNumber>;
917
+ system: z.ZodOptional<z.ZodString>;
918
+ module: z.ZodOptional<z.ZodString>;
919
+ cause: z.ZodOptional<z.ZodUnknown>;
920
+ suggestion: z.ZodOptional<z.ZodString>;
921
+ ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
922
+ }, z.core.$strip>;
923
+ }, z.core.$strip>], "success">;
924
+ declare const AiSendMessageOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
925
+ success: z.ZodLiteral<true>;
926
+ data: z.ZodObject<{
927
+ content: z.ZodString;
928
+ model: z.ZodString;
929
+ usage: z.ZodOptional<z.ZodObject<{
930
+ prompt_tokens: z.ZodNumber;
931
+ completion_tokens: z.ZodNumber;
932
+ total_tokens: z.ZodNumber;
933
+ }, z.core.$strip>>;
934
+ }, z.core.$strip>;
935
+ }, z.core.$strip>, z.ZodObject<{
936
+ success: z.ZodLiteral<false>;
937
+ error: z.ZodObject<{
938
+ code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
939
+ message: z.ZodString;
940
+ httpStatus: z.ZodOptional<z.ZodNumber>;
941
+ system: z.ZodOptional<z.ZodString>;
942
+ module: z.ZodOptional<z.ZodString>;
943
+ cause: z.ZodOptional<z.ZodUnknown>;
944
+ suggestion: z.ZodOptional<z.ZodString>;
945
+ ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
946
+ }, z.core.$strip>;
947
+ }, z.core.$strip>], "success">;
948
+ declare const AiMemoryRecallOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
949
+ success: z.ZodLiteral<true>;
950
+ data: z.ZodObject<{
951
+ items: z.ZodArray<z.ZodObject<{
952
+ id: z.ZodString;
953
+ content: z.ZodString;
954
+ type: z.ZodEnum<{
955
+ fact: "fact";
956
+ preference: "preference";
957
+ event: "event";
958
+ entity: "entity";
959
+ instruction: "instruction";
960
+ }>;
961
+ importance: z.ZodNumber;
962
+ objectId: z.ZodOptional<z.ZodString>;
963
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
964
+ createdAt: z.ZodNumber;
965
+ lastAccessedAt: z.ZodNumber;
966
+ accessCount: z.ZodNumber;
967
+ }, z.core.$strip>>;
968
+ }, z.core.$strip>;
969
+ }, z.core.$strip>, z.ZodObject<{
970
+ success: z.ZodLiteral<false>;
971
+ error: z.ZodObject<{
972
+ code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
973
+ message: z.ZodString;
974
+ httpStatus: z.ZodOptional<z.ZodNumber>;
975
+ system: z.ZodOptional<z.ZodString>;
976
+ module: z.ZodOptional<z.ZodString>;
977
+ cause: z.ZodOptional<z.ZodUnknown>;
978
+ suggestion: z.ZodOptional<z.ZodString>;
979
+ ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
980
+ }, z.core.$strip>;
981
+ }, z.core.$strip>], "success">;
982
+ declare const AiMemoryListOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
983
+ success: z.ZodLiteral<true>;
984
+ data: z.ZodObject<{
985
+ items: z.ZodArray<z.ZodObject<{
986
+ id: z.ZodString;
987
+ content: z.ZodString;
988
+ type: z.ZodEnum<{
989
+ fact: "fact";
990
+ preference: "preference";
991
+ event: "event";
992
+ entity: "entity";
993
+ instruction: "instruction";
994
+ }>;
995
+ importance: z.ZodNumber;
996
+ objectId: z.ZodOptional<z.ZodString>;
997
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
998
+ createdAt: z.ZodNumber;
999
+ lastAccessedAt: z.ZodNumber;
1000
+ accessCount: z.ZodNumber;
1001
+ }, z.core.$strip>>;
1002
+ total: z.ZodNumber;
1003
+ }, z.core.$strip>;
1004
+ }, z.core.$strip>, z.ZodObject<{
1005
+ success: z.ZodLiteral<false>;
1006
+ error: z.ZodObject<{
1007
+ code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1008
+ message: z.ZodString;
1009
+ httpStatus: z.ZodOptional<z.ZodNumber>;
1010
+ system: z.ZodOptional<z.ZodString>;
1011
+ module: z.ZodOptional<z.ZodString>;
1012
+ cause: z.ZodOptional<z.ZodUnknown>;
1013
+ suggestion: z.ZodOptional<z.ZodString>;
1014
+ ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1015
+ }, z.core.$strip>;
1016
+ }, z.core.$strip>], "success">;
1017
+ declare const AiSessionListOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1018
+ success: z.ZodLiteral<true>;
1019
+ data: z.ZodObject<{
1020
+ items: z.ZodArray<z.ZodObject<{
1021
+ objectId: z.ZodString;
1022
+ sessionId: z.ZodString;
1023
+ createdAt: z.ZodNumber;
1024
+ updatedAt: z.ZodNumber;
1025
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1026
+ }, z.core.$strip>>;
1027
+ }, z.core.$strip>;
1028
+ }, z.core.$strip>, z.ZodObject<{
1029
+ success: z.ZodLiteral<false>;
1030
+ error: z.ZodObject<{
1031
+ code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1032
+ message: z.ZodString;
1033
+ httpStatus: z.ZodOptional<z.ZodNumber>;
1034
+ system: z.ZodOptional<z.ZodString>;
1035
+ module: z.ZodOptional<z.ZodString>;
1036
+ cause: z.ZodOptional<z.ZodUnknown>;
1037
+ suggestion: z.ZodOptional<z.ZodString>;
1038
+ ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1039
+ }, z.core.$strip>;
1040
+ }, z.core.$strip>], "success">;
1041
+ declare const AiChatHistoryOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1042
+ success: z.ZodLiteral<true>;
1043
+ data: z.ZodObject<{
1044
+ items: z.ZodArray<z.ZodObject<{
1045
+ id: z.ZodString;
1046
+ objectId: z.ZodString;
1047
+ sessionId: z.ZodString;
1048
+ request: z.ZodObject<{
1049
+ model: z.ZodString;
1050
+ messages: z.ZodArray<z.ZodObject<{
1051
+ role: z.ZodEnum<{
1052
+ system: "system";
1053
+ user: "user";
1054
+ assistant: "assistant";
1055
+ tool: "tool";
1056
+ }>;
1057
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1058
+ type: z.ZodLiteral<"text">;
1059
+ text: z.ZodString;
1060
+ }, z.core.$strip>, z.ZodObject<{
1061
+ type: z.ZodLiteral<"image_url">;
1062
+ image_url: z.ZodObject<{
1063
+ url: z.ZodString;
1064
+ detail: z.ZodOptional<z.ZodEnum<{
1065
+ auto: "auto";
1066
+ low: "low";
1067
+ high: "high";
1068
+ }>>;
1069
+ }, z.core.$strip>;
1070
+ }, z.core.$strip>]>>]>>;
1071
+ name: z.ZodOptional<z.ZodString>;
1072
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1073
+ id: z.ZodString;
1074
+ type: z.ZodLiteral<"function">;
1075
+ function: z.ZodObject<{
1076
+ name: z.ZodString;
1077
+ arguments: z.ZodString;
1078
+ }, z.core.$strip>;
1079
+ }, z.core.$strip>>>;
1080
+ tool_call_id: z.ZodOptional<z.ZodString>;
1081
+ }, z.core.$strip>>;
1082
+ }, z.core.$strip>;
1083
+ response: z.ZodObject<{
1084
+ content: z.ZodString;
1085
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1086
+ id: z.ZodString;
1087
+ type: z.ZodLiteral<"function">;
1088
+ function: z.ZodObject<{
1089
+ name: z.ZodString;
1090
+ arguments: z.ZodString;
1091
+ }, z.core.$strip>;
1092
+ }, z.core.$strip>>>;
1093
+ finishReason: z.ZodString;
1094
+ usage: z.ZodObject<{
1095
+ prompt_tokens: z.ZodNumber;
1096
+ completion_tokens: z.ZodNumber;
1097
+ total_tokens: z.ZodNumber;
1098
+ }, z.core.$strip>;
1099
+ }, z.core.$strip>;
1100
+ createdAt: z.ZodNumber;
1101
+ duration: z.ZodNumber;
1102
+ }, z.core.$strip>>;
1103
+ }, z.core.$strip>;
1104
+ }, z.core.$strip>, z.ZodObject<{
1105
+ success: z.ZodLiteral<false>;
1106
+ error: z.ZodObject<{
1107
+ code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1108
+ message: z.ZodString;
1109
+ httpStatus: z.ZodOptional<z.ZodNumber>;
1110
+ system: z.ZodOptional<z.ZodString>;
1111
+ module: z.ZodOptional<z.ZodString>;
1112
+ cause: z.ZodOptional<z.ZodUnknown>;
1113
+ suggestion: z.ZodOptional<z.ZodString>;
1114
+ ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1115
+ }, z.core.$strip>;
1116
+ }, z.core.$strip>], "success">;
1117
+ type AiChatCompletionInput = z.infer<typeof AiChatCompletionInputSchema>;
1118
+ type AiChatCompletionData = z.infer<typeof AiChatCompletionDataSchema>;
1119
+ type AiChatCompletionOutput = z.infer<typeof AiChatCompletionOutputSchema>;
1120
+ type AiSendMessageInput = z.infer<typeof AiSendMessageInputSchema>;
1121
+ type AiSendMessageData = z.infer<typeof AiSendMessageDataSchema>;
1122
+ type AiSendMessageOutput = z.infer<typeof AiSendMessageOutputSchema>;
1123
+ type AiMemoryRecallInput = z.infer<typeof AiMemoryRecallInputSchema>;
1124
+ type AiMemoryListInput = z.infer<typeof AiMemoryListInputSchema>;
1125
+ type AiSessionListInput = z.infer<typeof AiSessionListInputSchema>;
1126
+ type AiChatHistoryInput = z.infer<typeof AiChatHistoryInputSchema>;
1127
+ type AiChatRecord = z.infer<typeof AiChatRecordSchema>;
1128
+
1129
+ export { AiAssistantMessageSchema, AiChatCompletionChoiceSchema, type AiChatCompletionData, AiChatCompletionDataSchema, type AiChatCompletionInput, AiChatCompletionInputSchema, type AiChatCompletionOutput, AiChatCompletionOutputSchema, AiChatHistoryDataSchema, type AiChatHistoryInput, AiChatHistoryInputSchema, AiChatHistoryOutputSchema, AiChatMessageSchema, type AiChatRecord, AiChatRecordSchema, type AiContract, AiImageContentSchema, AiMemoryEntrySchema, AiMemoryListDataSchema, type AiMemoryListInput, AiMemoryListInputSchema, AiMemoryListOutputSchema, AiMemoryRecallDataSchema, type AiMemoryRecallInput, AiMemoryRecallInputSchema, AiMemoryRecallOutputSchema, AiMemoryTypeSchema, AiMessageContentSchema, AiMessageRoleSchema, type AiSendMessageData, AiSendMessageDataSchema, type AiSendMessageInput, AiSendMessageInputSchema, type AiSendMessageOutput, AiSendMessageOutputSchema, AiSessionInfoSchema, AiSessionListDataSchema, type AiSessionListInput, AiSessionListInputSchema, AiSessionListOutputSchema, AiTextContentSchema, AiTokenUsageSchema, AiToolCallSchema, AiToolDefinitionSchema, AiToolParameterSchema, aiContract };