@h-ai/ai 1.0.0-beta.18 → 1.0.0-beta.19

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/README.md CHANGED
@@ -35,7 +35,11 @@ const ready = await apiClient.init({ baseUrl: 'https://api.example.com/api/v1' }
35
35
  if (!ready.success)
36
36
  throw new Error(ready.error.message)
37
37
  try {
38
- const response = await apiClient.ai.chats.createCompletion({ messages: [{ role: 'user', content: '你好' }] })
38
+ const response = await apiClient.ai.chats.createCompletion({
39
+ messages: [
40
+ { role: 'user', content: '你好' }
41
+ ]
42
+ })
39
43
  if (!response.success)
40
44
  throw new Error(response.error.message)
41
45
  const reply = response.data.choices[0]?.message.content
@@ -51,6 +55,8 @@ finally {
51
55
 
52
56
  ## 使用入门
53
57
 
58
+ `ai.close()` 等待已开始的初始化完成并清理,合并并发关闭;重初始化先清理旧实例,关闭期间不接受新初始化。
59
+
54
60
  ### 快速开始
55
61
 
56
62
  #### 开发 LLM-only(零数据库依赖)
@@ -68,7 +74,9 @@ if (!init.success)
68
74
  return init
69
75
 
70
76
  const result = await ai.llm.chat({
71
- messages: [{ role: 'user', content: '你好!' }],
77
+ messages: [
78
+ { role: 'user', content: '你好!' }
79
+ ],
72
80
  })
73
81
 
74
82
  await ai.close()
@@ -97,7 +105,11 @@ try {
97
105
  })
98
106
  if (!initialized.success)
99
107
  throw new Error(initialized.error.message)
100
- const result = await ai.llm.chat({ messages: [{ role: 'user', content: 'Hello!' }] })
108
+ const result = await ai.llm.chat({
109
+ messages: [
110
+ { role: 'user', content: 'Hello!' }
111
+ ]
112
+ })
101
113
  if (!result.success)
102
114
  throw new Error(result.error.message)
103
115
  const reply = result.data.choices[0]?.message.content ?? ''
@@ -128,7 +140,9 @@ import { ai } from '@h-ai/ai'
128
140
  const storeProvider: AIStoreProvider = createMyStoreProvider()
129
141
 
130
142
  await ai.init(
131
- { llm: { model: 'gpt-4o-mini', apiKey: process.env.HAI_AI_LLM_APIKEY } },
143
+ {
144
+ llm: { model: 'gpt-4o-mini', apiKey: process.env.HAI_AI_LLM_APIKEY }
145
+ },
132
146
  { storeProvider },
133
147
  )
134
148
 
@@ -191,7 +205,9 @@ const registry = ai.tools.createRegistry({
191
205
  const registered = registry.register(ai.tools.define({
192
206
  name: 'get_weather',
193
207
  description: '获取天气',
194
- parameters: z.object({ city: z.string() }),
208
+ parameters: z.object({
209
+ city: z.string()
210
+ }),
195
211
  // handler 第二参为执行上下文:可响应取消(打断/超时)、感知截止时间与交互主体
196
212
  handler: async ({ city }, { signal }) => {
197
213
  const res = await fetch(`https://api.example.com/weather?city=${city}`, { signal })
@@ -208,7 +224,10 @@ const result = await registry.execute(toolCall, { signal: controller.signal, obj
208
224
  // 批量调用默认串行,避免副作用工具并发启动;纯读取且确认安全时才显式并行
209
225
  const batch = await registry.executeAll(toolCalls)
210
226
 
211
- const chat = await ai.llm.chat({ messages, tools: registry.getDefinitions() })
227
+ const chat = await ai.llm.chat({
228
+ messages,
229
+ tools: registry.getDefinitions()
230
+ })
212
231
  ```
213
232
 
214
233
  #### ACP 智能体、工作区和会话
@@ -240,7 +259,9 @@ Goose 1.57.0 镜像提供原生 `goose serve` HTTP/WS `/acp` 服务,通过 cus
240
259
 
241
260
  #### A2A 协议边界
242
261
 
243
- `ai.a2a.getAgentCard()` 返回完整 A2A 0.3 Agent Card,含 `protocolVersion`、MIME 和 streaming 能力;Kit 默认发现路径为 `/.well-known/agent-card.json`。`handleRequest()` 始终返回 JSON-RPC/SSE 处理结果,未初始化返回 JSON-RPC 错误。可信 HTTP 认证上下文的 `agentId` 映射为 executor 的 `context.user.userName`。当前支持 JSON-RPC/SSE,不声明 push notifications、gRPC 或 REST 支持;业务资源授权仍由应用负责。
262
+ 远端调用的自定义请求头按名称大小写不敏感地覆盖。固定 JSON-RPC 地址拒绝 HTTP 重定向,认证头不会被转发到重定向目标。
263
+
264
+ `ai.a2a.getAgentCard()` 返回可直接用于 HTTP 发现响应的标准 A2A 1.0 ProtoJSON,含 `supportedInterfaces`、MIME 和 streaming 能力;Kit 默认发现路径为 `/.well-known/agent-card.json`。`handleRequest()` 始终返回 JSON-RPC/SSE 处理结果,未初始化返回 JSON-RPC 错误。可信 HTTP 认证上下文的 `agentId` 映射为 executor 的 `context.user.userName`。当前支持 JSON-RPC/SSE,不声明 push notifications、gRPC 或 REST 支持;业务资源授权仍由应用负责。
244
265
 
245
266
  A2A 的 journal、context 归属与消息表在 `ai.init()` 阶段初始化。任务按可信 `agentId` 隔离(含获取、取消和续接);匿名请求共享匿名主体,生产应在可信传输层认证。`listMessages` 是服务端管理接口,支持 `callerId`、`contextId`、`since`,不能向未授权客户端暴露。
246
267
 
@@ -261,15 +282,25 @@ import { z } from 'zod'
261
282
  const server = createMcpServer({ name: 'my-server', version: '1.0.0' })
262
283
  server.registerTool('search', {
263
284
  description: '搜索',
264
- inputSchema: { query: z.string() },
285
+ inputSchema: {
286
+ query: z.string()
287
+ },
265
288
  }, async ({ query }) => ({
266
- content: [{ type: 'text', text: `Results for ${query}` }],
289
+ content: [
290
+ { type: 'text', text: `Results for ${query}` }
291
+ ],
292
+ }))
293
+ await server.connect(new StreamableHTTPServerTransport({
294
+ sessionIdGenerator: () => globalThis.crypto.randomUUID()
267
295
  }))
268
- await server.connect(new StreamableHTTPServerTransport({ sessionIdGenerator: () => globalThis.crypto.randomUUID() }))
269
296
  ```
270
297
 
271
298
  #### Memory / RAG / Knowledge
272
299
 
300
+ 原生记忆删除(包括管理员全清)先清向量,再删除权威记录;向量清理失败时记录保留以便重试。SQL 与向量后端不共享事务,后一步失败仍需核对当前状态。
301
+
302
+ `ai.memory.scoped({ objectId })` 要求非空且非纯空白的主体 ID,否则工厂立即抛 `TypeError`,不会创建未绑定实例。公共 `clear({ scope: {} })` 等空范围返回失败;跨主体全清必须调用显式管理员入口。原生记忆的访问统计与更新使用版本 CAS,迟到读取不会复活已删除记录;数据库或向量清理失败通过 HaiResult 返回,不能当作成功。
303
+
273
304
  Knowledge 每次导入生成唯一 `revision` 和分块 ID,先完整准备分块、向量及实体,再持久化暂存清单、写入向量,最后通过共享 Store CAS 一次发布正文、实体和元数据。相同文档并发重建只允许一个写入者;失败时保留完整旧版,缩短文档不会留下可见旧尾块。检索只接受当前发布版本,并在发布穿插时重试,持续冲突返回错误供调用方重试。向量候选可能按需扩大,清理积压会增加查询成本。
274
305
 
275
306
  `ingest` 成功结果包含 `revision` 与 `cleanupPending`:后者为 true 表示新版本已经发布,但旧向量删除仍待补偿。调用 `repair({ collection, offset, limit })` 分页重试;`setup` 自动检查前 100 份清单,生产环境应定期扫描全部页。暂存期限为存储端时钟的 5 分钟,超时写入者不能发布;故障暂存的永久墓碑用于反复删除迟到的外部写入,不能随日志保留期删除。SQL 与 vecdb 不组成跨库事务,恢复依赖持久清单和持续补偿。`removeDocument` / `deleteCollection` 先撤销可见性,清理失败返回错误;集合删除保留空向量集合及代际墓碑以支持补偿,重新 setup 不显示上一代内容。
@@ -287,15 +318,23 @@ if (!enriched.success) {
287
318
  }
288
319
 
289
320
  // 多租户推荐入口:scoped() 绑定主体与作用域,所有操作自动携带 objectId / scope(含归属校验),杜绝「忘记传 objectId」越权
290
- const memory = ai.memory.scoped({ objectId: 'user-001', scope: { topicId: 't-1', personaId: 'p-1' } })
321
+ const memory = ai.memory.scoped({
322
+ objectId: 'user-001',
323
+ scope: { topicId: 't-1', personaId: 'p-1' }
324
+ })
291
325
  await memory.add({ content: '用户偏好中文', type: 'preference' })
292
326
  const recalled = await memory.recall('语言偏好')
293
327
 
294
328
  // clear 拒绝空过滤(防误清全局);全局清空只能显式走管理接口
295
- await memory.clear({ types: ['event'] }) // 仅清该作用域内的 event
329
+ await memory.clear({
330
+ types: ['event']
331
+ }) // 仅清该作用域内的 event
296
332
  await ai.memory.admin.clearAll({ confirm: true }) // 危险:清空整个记忆后端,需显式确认
297
333
 
298
- const rag = await ai.rag.query('核心架构是什么?', { sources: ['docs'], topK: 5 })
334
+ const rag = await ai.rag.query('核心架构是什么?', {
335
+ sources: ['docs'],
336
+ topK: 5
337
+ })
299
338
 
300
339
  const setup = await ai.knowledge.setup()
301
340
  if (setup.success) {
@@ -326,11 +365,33 @@ await ai.init({
326
365
  audio: {
327
366
  inheritLlmApiKey: true,
328
367
  models: [
329
- { id: 'asr', provider: 'qwen', model: 'qwen3-asr-flash-realtime', operations: ['transcribe'] },
330
- { id: 'tts', provider: 'qwen', model: 'qwen3-tts-flash-realtime', operations: ['synthesize'] },
368
+ {
369
+ id: 'asr',
370
+ provider: 'qwen',
371
+ model: 'qwen3-asr-flash-realtime',
372
+ operations: ['transcribe']
373
+ },
374
+ {
375
+ id: 'tts',
376
+ provider: 'qwen',
377
+ model: 'qwen3-tts-flash-realtime',
378
+ operations: ['synthesize']
379
+ },
331
380
  // 自托管:whisper / indextts 必须显式配置 baseUrl
332
- { id: 'whisper', provider: 'whisper', model: 'faster-whisper-large-v3', operations: ['transcribe'], baseUrl: 'http://127.0.0.1:8101/v1' },
333
- { id: 'indextts', provider: 'indextts', model: 'indextts-2.5', operations: ['synthesize'], baseUrl: 'http://127.0.0.1:8102/v1' },
381
+ {
382
+ id: 'whisper',
383
+ provider: 'whisper',
384
+ model: 'faster-whisper-large-v3',
385
+ operations: ['transcribe'],
386
+ baseUrl: 'http://127.0.0.1:8101/v1'
387
+ },
388
+ {
389
+ id: 'indextts',
390
+ provider: 'indextts',
391
+ model: 'indextts-2.5',
392
+ operations: ['synthesize'],
393
+ baseUrl: 'http://127.0.0.1:8102/v1'
394
+ },
334
395
  ],
335
396
  transcribeModel: 'asr',
336
397
  synthesizeModel: 'tts',
@@ -457,6 +518,12 @@ if (result.success) {
457
518
 
458
519
  `image.maxImageBytes` 默认 20971520(20 MiB,最大 100 MiB),限制单张输出和参考图;`image.maxImages` 默认 4(最大 16),限制输出与参考图数量,临时 URL 串行下载。实际读取(含解压后)超过上限立即取消;JSON 响应最多 `max(64 KiB, 2 × maxImageBytes)`,错误正文最多 64 KiB。模型 `timeout` 默认 120000ms,覆盖厂商请求、重定向和全部下载;`signal` 可取消整个过程。输出仅支持 PNG/JPEG/GIF/WebP 的 MIME 与魔数匹配,拒绝 SVG;魔数校验不等于完整图片解码或尺寸核验。拒绝地址、超限、超时分别返回 `IMAGE_DOWNLOAD_BLOCKED`、`IMAGE_TOO_LARGE`、`IMAGE_TIMEOUT`,调用方须先检查 success。
459
520
 
521
+ #### 文件解析(File)
522
+
523
+ 向 `ai.file.parse({ content, filename, options: { outputFormat: 'markdown' } })` 传入业务文件内容和名称;先检查 `success`,再读取 `data.text`,纯文本输出选择 `outputFormat: 'text'`。HTML 使用 parse5 解析结构并迭代提取,忽略 script/style,保留标题、列表、链接、图片、引用、代码和表格等常见 Markdown 结构,不以截断正常文档规避畸形标签的正则回溯。
524
+
525
+ 结果是文本或 Markdown,不是可信 HTML;界面使用文本绑定或框架的 `MarkdownRenderer`,不要直接交给 `{@html}`。配置、调用参数和错误码保持原有契约。
526
+
460
527
  #### Context 管理器
461
528
 
462
529
  自动记忆提取在本节点后台运行;`pendingMemoryTasks=0` 不代表全部成功。`flush()` 等待本批任务,异常和失败 HaiResult 都返回 `MEMORY_EXTRACT_FAILED`(含失败数量),同轮并发观察者共享结果。返回即确认该批报告,后续只观察新任务,不自动重放可能部分完成的提取。`save()`、`reset({ waitForMemoryTasks: true })`、`consolidate()` 遇到该失败立即返回,不继续后续状态或记忆写入。进程崩溃后的外部效果仍须人工核对。
@@ -495,7 +562,10 @@ if (manager.success) {
495
562
  `chatStream` 在**调用上游模型前**就登记轮次并产出 `turn_started`(事件序列 `turn_started → delta* → done`,中途取消时 `turn_started → delta* → cancelled`)。因此即使生成到一半被 `AbortSignal` 取消,也能拿到 `turnId` 与已生成文本,用真实内容提交:
496
563
 
497
564
  ```ts
498
- const created = ai.context.createManager({ scope: { objectId: 'user-001', sessionId: 'sess-001' }, turnCommit: 'manual' })
565
+ const created = ai.context.createManager({
566
+ scope: { objectId: 'user-001', sessionId: 'sess-001' },
567
+ turnCommit: 'manual'
568
+ })
499
569
  if (!created.success)
500
570
  return created
501
571
  const m = created.data
@@ -533,7 +603,9 @@ const turns = m.getTurns()
533
603
 
534
604
  ```ts
535
605
  // 会话结束时固化:整合摘要 → 提取长期记忆(写入不含 sessionId 的持久作用域)
536
- const result = await manager.consolidate({ scope: { userId: 'user-001', personaId: 'xiaoq' } })
606
+ const result = await manager.consolidate({
607
+ scope: { userId: 'user-001', personaId: 'xiaoq' }
608
+ })
537
609
  if (result.success) {
538
610
  // result.data.summary —— 本次会话整合摘要
539
611
  // result.data.memories —— 固化到长期记忆的条目
@@ -558,11 +630,15 @@ const composed = await ai.persona.compose('xiaoq')
558
630
  const manager = ai.context.createManager({
559
631
  scope: { objectId: 'user-001', sessionId: 'persona-session' },
560
632
  systemPrompt: composed.data,
561
- memory: { enable: true, enableExtract: true, scope: { personaId: 'xiaoq' } },
633
+ memory: {
634
+ enable: true,
635
+ enableExtract: true,
636
+ scope: { personaId: 'xiaoq' }
637
+ },
562
638
  })
563
639
  ```
564
640
 
565
- `ai.persona` 提供 `save` / `get` / `update` / `remove` / `list` / `compose`;角色档案全局共享(不按 `objectId` 隔离)。
641
+ `ai.persona` 提供 `save` / `get` / `update` / `remove` / `list` / `compose`,按 `[objectId, id]` 隔离角色。保存时传 `objectId`,其余操作传 `{ objectId }`;省略时访问 `system` 平台角色。租户业务应绑定可信认证主体,不能把客户端传入的角色 ID 当作授权。
566
642
 
567
643
  ### 配置
568
644
 
@@ -616,7 +692,7 @@ memory:
616
692
  通过 `core.config.load('ai', ...)` 加载时,约定环境变量优先于 YAML;
617
693
  例如 `HAI_AI_LLM_APIKEY`、`HAI_AI_LLM_BASEURL`、`HAI_AI_LLM_MODEL`。
618
694
 
619
- 启用 mem0(真·嵌入式 mem0ai/oss 引擎):
695
+ 启用 Mem0 数据格式适配:
620
696
 
621
697
  ```yaml
622
698
  memory:
@@ -625,17 +701,15 @@ memory:
625
701
  ```
626
702
 
627
703
  - **`native`(默认,推荐)**:HAI 原生引擎,复用同一套 vecdb(向量库)、reldb(关系库)、LLM 与 Embedding。`extract` 采用 **Mem0 式批量合并**——一次 LLM 调用对整批抽取事实与相关既有记忆做 ADD / UPDATE / DELETE / NONE 决策,实现增量更新、跨条去重与矛盾删除,并支持 `category` 主题标签。`maxEntriesPerObject`、`maxEntriesGlobal`、`recencyDecay`、`embeddingEnabled`、`writebackRelatedTopK` 均作用于此后端;淘汰按 `objectId` 分区触发,不会因某一主体写入过多而淘汰其他主体的记忆。native 后端的 `scope` 过滤:候选集已被 `objectId` 索引收窄(≤ `maxEntriesPerObject`),PostgreSQL 上还会把 scope 下推为 `data @> '{"scope":...}'::jsonb` 包含查询并命中 JSONB **GIN 索引**(SQLite / MySQL 退回内存匹配,结果一致)。
628
- - **`mem0`(真·mem0ai/oss)**:直接使用 `mem0ai/oss` 的 `Memory` 引擎(嵌入式,无云服务)。LLM / Embedder 从 `llm` 配置提取;`qdrant` 可复用底层 vecdb。当前适配仅映射带完整连接参数的 `qdrant`;生产环境(`NODE_ENV` 或 `HAI_CORE_ENV` 为 `production`)即使设置 `memory.allowEphemeralFallback: true` 也拒绝实际内存回退。临时回退仅限开发或明确的 `HAI_E2E=1` / `HAI_E2E_MOCK=1`;缺少后端同样不能在生产启动。历史记录默认禁用。
629
-
630
- 两个 Provider 对外 `ai.memory.*` API 完全一致(`extract` / `recall` / `injectMemories` / `add` / `update` / `get` / `remove` / `list` / `listPage` / `clear`),均支持 `objectId`(主体隔离)与 `scope`(业务作用域 key-value 过滤,如 `{ topicId, personaId }`)。`recall` / `list` / `listPage` / `clear` 均按 `scope` 严格过滤,`clear` 在传入 `types` / `scope` 时仅删除同时匹配项(避免误删)。mem0 后端的 `extract` 在框架层用统一提取器完成分类与打分(honor `types` / `model` / `minImportance` / `systemPrompt`)后以 `infer:false` 写入,保留 `hai_type` / `hai_importance`;`recall` 同样支持 `types` 过滤与 `recencyWeight` 时间衰减——二者行为与 native 一致。Mem0 的 `update` 使用 SDK 原地修改文本与元数据,保持 `id` 和创建时间。SDK 查询使用 `filters.user_id`,写入和整主体删除使用 `userId`。SDK 无列表游标:`list` / `listPage` / 条件 `clear` 最多支持每主体 1000 条原始候选(含过期条目),多取一条探测完整性;超限返回 `MEMORY_LIST_INCOMPLETE`(906),不会伪造 total 或执行部分条件删除。候选完整时按 UTC 日期剔除过期项,再按类型/scope 过滤和分页;仅 `objectId` 的清理使用 SDK `deleteAll`,不受列表上限限制。公共空条件清理被拒绝;跨主体全清仅限受信管理员显式 `admin.clearAll({ confirm: true })`。
704
+ - **`mem0`(数据格式适配)**:框架负责提取与 Embedding,通过原生 HTTP 读写 Qdrant 的 Mem0 UUID/payload 格式,可读取既有数据;不运行完整上游引擎、遥测或历史数据库。仅映射带完整连接参数的 Qdrant。生产(`NODE_ENV` 或 `HAI_CORE_ENV=production`)拒绝临时回退;开发或明确 E2E 可显式使用 `memory.allowEphemeralFallback: true`。其它持久化后端选择 `native`。
631
705
 
632
- Mem0 3.3.1 的 Qdrant 适配仍依赖 `QdrantClient.search`;项目将 `@qdrant/js-client-rest` 精确锁定为受测的 `1.18.0`,AI 的可选 peer 也声明此版本。启动会检查该公开方法,缺失时明确配置失败;不要覆盖为已移除此方法的 1.19。
706
+ 两个 Provider 对外 `ai.memory.*` API 完全一致(`extract` / `recall` / `injectMemories` / `add` / `update` / `get` / `remove` / `list` / `listPage` / `clear`),均支持 `objectId`(主体隔离)与 `scope`(业务作用域 key-value 过滤,如 `{ topicId, personaId }`)。`recall` / `list` / `listPage` / `clear` 均按 `scope` 严格过滤,`clear` 在传入 `types` / `scope` 时仅删除同时匹配项(避免误删)。mem0 后端的 `extract` 在框架层用统一提取器完成分类与打分(honor `types` / `model` / `minImportance` / `systemPrompt`)后直接写入格式存储,保留 `hai_type` / `hai_importance`;`recall` 同样支持 `types` 过滤与 `recencyWeight` 时间衰减——二者行为与 native 一致。Mem0 的 `update` 原地修改文本与元数据,保持 `id` 和创建时间。候选扫描有界:`list` / `listPage` / 条件 `clear` 最多支持每主体 1000 条原始候选(含过期条目),多取一条探测完整性;超限返回 `MEMORY_LIST_INCOMPLETE`(906),不会伪造 total 或执行部分条件删除。候选完整时按 UTC 日期剔除过期项,再按类型/scope 过滤和分页;仅 `objectId` 的清理使用后端过滤删除,不受列表上限限制。公共空条件清理被拒绝;跨主体全清仅限受信管理员显式 `admin.clearAll({ confirm: true })`。
633
707
 
634
- 适配器通过 SDK 公开的 `client` 配置注入独享客户端;Mem0 的 Qdrant 写入与删除均使用 `wait: true`,等待服务端应用完成后才继续写后读或分批清理。
708
+ Mem0 格式存储与 VecDB 的 Qdrant Provider 均使用原生 HTTP,无需额外 SDK。固定 REST 请求使用 `query`,路径段编码;30 秒超时覆盖完整响应体,响应超过 16 MiB 明确失败。写入和删除等待 `wait=true` 的实际完成回执。列表和条件清理最多核对每主体 1000 条原始候选(包括过期项),超限返回 `MEMORY_LIST_INCOMPLETE`,不执行部分条件删除;仅按主体清理不受此列表上限限制。
635
709
 
636
- Mem0 的 pgvector 组合在所有环境拒绝启动:当前 SDK 将 PostgreSQL 连接保存在私有对象中,未提供公开关闭入口,框架无法履行资源清理契约。需要 pgvector 时选择 `memory.provider: native`;该原生后端保持支持。`disableHistory: true` 使用 SDK 无资源的历史占位实现,不创建历史 SQLite 文件。工厂通过公开的一条有界只读查询等待实际后端 ready 后才发布成功。
710
+ Qdrant 格式后端要求 1.19 或更新版本,并拒绝 HTTP 重定向。更新使用服务端 `update_only` 与主体/版本条件,同一次原子写入拒绝已删除或已被其它写入更新的条目;迟到更新不会复活删除记录。写后版本核对失败仍需按已有回执核对实际效果。
637
711
 
638
- `add` / `extract` 的 SDK 回执不含完整业务字段,框架写后读取权威记录再返回;并发提取等待全部在途写入结束。若写入或写后读失败,`error.ext.requiresEffectReconciliation=true`,`memoryIds` 保存已知写入 ID(回执丢失时可能为空)。应按主体核对实际记忆后决定恢复,不能盲目重做 add/extract;框架不自动重放。
712
+ `add` / `extract` 的写入回执不含完整业务字段,框架写后读取权威记录再返回;并发提取等待全部在途写入结束。若写入或写后读失败,`error.ext.requiresEffectReconciliation=true`,`memoryIds` 保存已知写入 ID(回执丢失时可能为空)。应按主体核对实际记忆后决定恢复,不能盲目重做 add/extract;框架不自动重放。
639
713
 
640
714
  **候选池与 scope 漏召回**:`scope` 过滤在内存中完成,若先按 `topK` 截断再过滤,同一主体下相关度较高的其它主题/角色记忆会把目标 scope 的记忆挤出候选池,导致「明明有却召回 0 条」。为此 `recall` / `injectMemories` 先取回 `topK × candidateMultiplier`(默认 5)条候选,过滤后再截取 `topK`。scope 隔离越细(如按 `topicId` + `personaId`),可将 `candidateMultiplier` 调大:
641
715
 
@@ -1,6 +1,6 @@
1
1
  import * as _h_ai_core from '@h-ai/core';
2
2
  import { HaiResult, HaiError } from '@h-ai/core';
3
- import { AgentCard } from '@a2a-js/sdk';
3
+ import { TaskState } from '@a2a-js/sdk';
4
4
  import { AgentExecutor } from '@a2a-js/sdk/server';
5
5
  import * as zod from 'zod';
6
6
  import { z, ZodType } from 'zod';
@@ -824,7 +824,7 @@ interface KnowledgeStore {
824
824
  /**
825
825
  * 向量库后端连接信息
826
826
  *
827
- * 由 Provider 暴露底层向量库的原始连接,供需要复用同一后端的外部引擎(如 mem0 OSS)
827
+ * 由 Provider 暴露底层向量库的原始连接,供需要复用同一后端的格式适配器(如 Mem0 数据格式存储)
828
828
  * 直连。字段按后端类型填充;包含凭证,仅供同进程内集成使用。
829
829
  *
830
830
  * @example
@@ -885,7 +885,7 @@ interface AIStoreProvider {
885
885
  /**
886
886
  * 暴露底层向量库后端连接(可选)
887
887
  *
888
- * 供需要直连同一向量库的外部引擎(如 mem0 OSS)复用后端。未初始化或不支持时返回
888
+ * 供需要直连同一向量库的格式适配器(如 Mem0 数据格式存储)复用后端。未初始化或不支持时返回
889
889
  * `undefined`。返回值含凭证,仅供同进程内集成使用,禁止写入日志。
890
890
  */
891
891
  getVectorBackend?: () => AIVectorBackend | undefined;
@@ -2046,12 +2046,12 @@ interface RetrievalOperations {
2046
2046
  * ```
2047
2047
  */
2048
2048
  declare const EntityTypeSchema: z.ZodEnum<{
2049
- event: "event";
2050
2049
  person: "person";
2051
2050
  project: "project";
2052
2051
  concept: "concept";
2053
2052
  organization: "organization";
2054
2053
  location: "location";
2054
+ event: "event";
2055
2055
  other: "other";
2056
2056
  }>;
2057
2057
  /**
@@ -2755,9 +2755,9 @@ interface KnowledgeOperations {
2755
2755
  * ```
2756
2756
  */
2757
2757
  declare const MemoryTypeSchema: z.ZodEnum<{
2758
+ event: "event";
2758
2759
  fact: "fact";
2759
2760
  preference: "preference";
2760
- event: "event";
2761
2761
  entity: "entity";
2762
2762
  instruction: "instruction";
2763
2763
  }>;
@@ -3309,6 +3309,7 @@ interface MemoryOperations extends MemoryCoreOperations {
3309
3309
  *
3310
3310
  * @param binding - 作用域绑定(objectId + 可选 scope)
3311
3311
  * @returns 所有操作自动携带该作用域的记忆实例
3312
+ * @throws objectId 缺失、为空或只有空白时抛 TypeError;工厂不创建未绑定的实例。
3312
3313
  */
3313
3314
  scoped: (binding: ScopedMemoryBinding) => ScopedMemoryOperations;
3314
3315
  /** 管理接口(危险的全局操作,需显式确认) */
@@ -3368,14 +3369,14 @@ declare const OptionalSecretSchema: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodS
3368
3369
  declare const ModelScenarioSchema: z.ZodEnum<{
3369
3370
  default: "default";
3370
3371
  chat: "chat";
3371
- summary: "summary";
3372
- plan: "plan";
3373
3372
  reasoning: "reasoning";
3374
- ocr: "ocr";
3373
+ plan: "plan";
3375
3374
  execute: "execute";
3376
3375
  extraction: "extraction";
3376
+ summary: "summary";
3377
3377
  embedding: "embedding";
3378
3378
  rerank: "rerank";
3379
+ ocr: "ocr";
3379
3380
  fast: "fast";
3380
3381
  }>;
3381
3382
  /**
@@ -3442,14 +3443,14 @@ declare const ModelCapabilitiesSchema: z.ZodObject<{
3442
3443
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
3443
3444
  inputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3444
3445
  image: "image";
3445
- audio: "audio";
3446
3446
  text: "text";
3447
+ audio: "audio";
3447
3448
  video: "video";
3448
3449
  }>>>;
3449
3450
  outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3450
3451
  image: "image";
3451
- audio: "audio";
3452
3452
  text: "text";
3453
+ audio: "audio";
3453
3454
  video: "video";
3454
3455
  }>>>;
3455
3456
  toolCalling: z.ZodOptional<z.ZodBoolean>;
@@ -3483,14 +3484,14 @@ declare const ModelEntrySchema: z.ZodObject<{
3483
3484
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
3484
3485
  inputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3485
3486
  image: "image";
3486
- audio: "audio";
3487
3487
  text: "text";
3488
+ audio: "audio";
3488
3489
  video: "video";
3489
3490
  }>>>;
3490
3491
  outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3491
3492
  image: "image";
3492
- audio: "audio";
3493
3493
  text: "text";
3494
+ audio: "audio";
3494
3495
  video: "video";
3495
3496
  }>>>;
3496
3497
  toolCalling: z.ZodOptional<z.ZodBoolean>;
@@ -3566,14 +3567,14 @@ declare const LLMConfigSchema: z.ZodObject<{
3566
3567
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
3567
3568
  inputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3568
3569
  image: "image";
3569
- audio: "audio";
3570
3570
  text: "text";
3571
+ audio: "audio";
3571
3572
  video: "video";
3572
3573
  }>>>;
3573
3574
  outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3574
3575
  image: "image";
3575
- audio: "audio";
3576
3576
  text: "text";
3577
+ audio: "audio";
3577
3578
  video: "video";
3578
3579
  }>>>;
3579
3580
  toolCalling: z.ZodOptional<z.ZodBoolean>;
@@ -3597,14 +3598,14 @@ declare const LLMConfigSchema: z.ZodObject<{
3597
3598
  scenarios: z.ZodOptional<z.ZodObject<{
3598
3599
  default: z.ZodOptional<z.ZodString>;
3599
3600
  chat: z.ZodOptional<z.ZodString>;
3600
- summary: z.ZodOptional<z.ZodString>;
3601
- plan: z.ZodOptional<z.ZodString>;
3602
3601
  reasoning: z.ZodOptional<z.ZodString>;
3603
- ocr: z.ZodOptional<z.ZodString>;
3602
+ plan: z.ZodOptional<z.ZodString>;
3604
3603
  execute: z.ZodOptional<z.ZodString>;
3605
3604
  extraction: z.ZodOptional<z.ZodString>;
3605
+ summary: z.ZodOptional<z.ZodString>;
3606
3606
  embedding: z.ZodOptional<z.ZodString>;
3607
3607
  rerank: z.ZodOptional<z.ZodString>;
3608
+ ocr: z.ZodOptional<z.ZodString>;
3608
3609
  fast: z.ZodOptional<z.ZodString>;
3609
3610
  }, z.core.$strip>>;
3610
3611
  }, z.core.$strict>;
@@ -4914,14 +4915,14 @@ declare const AIConfigSchema: z.ZodObject<{
4914
4915
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
4915
4916
  inputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
4916
4917
  image: "image";
4917
- audio: "audio";
4918
4918
  text: "text";
4919
+ audio: "audio";
4919
4920
  video: "video";
4920
4921
  }>>>;
4921
4922
  outputModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
4922
4923
  image: "image";
4923
- audio: "audio";
4924
4924
  text: "text";
4925
+ audio: "audio";
4925
4926
  video: "video";
4926
4927
  }>>>;
4927
4928
  toolCalling: z.ZodOptional<z.ZodBoolean>;
@@ -4945,14 +4946,14 @@ declare const AIConfigSchema: z.ZodObject<{
4945
4946
  scenarios: z.ZodOptional<z.ZodObject<{
4946
4947
  default: z.ZodOptional<z.ZodString>;
4947
4948
  chat: z.ZodOptional<z.ZodString>;
4948
- summary: z.ZodOptional<z.ZodString>;
4949
- plan: z.ZodOptional<z.ZodString>;
4950
4949
  reasoning: z.ZodOptional<z.ZodString>;
4951
- ocr: z.ZodOptional<z.ZodString>;
4950
+ plan: z.ZodOptional<z.ZodString>;
4952
4951
  execute: z.ZodOptional<z.ZodString>;
4953
4952
  extraction: z.ZodOptional<z.ZodString>;
4953
+ summary: z.ZodOptional<z.ZodString>;
4954
4954
  embedding: z.ZodOptional<z.ZodString>;
4955
4955
  rerank: z.ZodOptional<z.ZodString>;
4956
+ ocr: z.ZodOptional<z.ZodString>;
4956
4957
  fast: z.ZodOptional<z.ZodString>;
4957
4958
  }, z.core.$strip>>;
4958
4959
  }, z.core.$strict>>;
@@ -5174,6 +5175,48 @@ type AIConfigInput = z.input<typeof AIConfigSchema>;
5174
5175
  * @module ai-a2a-types
5175
5176
  */
5176
5177
 
5178
+ /**
5179
+ * 可直接用于 HTTP 发现响应的 A2A 1.0 ProtoJSON 文档;不暴露 SDK 内部 oneof 结构。
5180
+ * @example
5181
+ * ```ts
5182
+ * import { ai } from '@h-ai/ai'
5183
+ * const card = ai.a2a.getAgentCard()
5184
+ * if (card.success) Response.json(card.data)
5185
+ * ```
5186
+ */
5187
+ interface A2AAgentCardDocument {
5188
+ name: string;
5189
+ description: string;
5190
+ version: string;
5191
+ supportedInterfaces: Array<{
5192
+ url: string;
5193
+ protocolBinding: string;
5194
+ protocolVersion: string;
5195
+ }>;
5196
+ defaultInputModes: string[];
5197
+ defaultOutputModes: string[];
5198
+ capabilities: {
5199
+ streaming: boolean;
5200
+ pushNotifications: boolean;
5201
+ };
5202
+ skills: Array<{
5203
+ id: string;
5204
+ name: string;
5205
+ description: string;
5206
+ tags: string[];
5207
+ }>;
5208
+ securitySchemes?: Record<string, {
5209
+ apiKeySecurityScheme: {
5210
+ location: string;
5211
+ name: string;
5212
+ };
5213
+ }>;
5214
+ securityRequirements?: Array<{
5215
+ schemes: Record<string, {
5216
+ list: string[];
5217
+ }>;
5218
+ }>;
5219
+ }
5177
5220
  /**
5178
5221
  * A2A 调用方身份信息
5179
5222
  *
@@ -5329,9 +5372,9 @@ interface A2AOperations {
5329
5372
  *
5330
5373
  * 配置了 a2a 后即可使用,无需注册 executor。
5331
5374
  *
5332
- * @returns 符合 A2A 0.3 的完整 Agent Card(含能力与安全方案)
5375
+ * @returns 可直接用于 HTTP 发现响应的 A2A 1.0 ProtoJSON Agent Card(含能力与安全方案)
5333
5376
  */
5334
- getAgentCard: () => HaiResult<AgentCard>;
5377
+ getAgentCard: () => HaiResult<A2AAgentCardDocument>;
5335
5378
  /**
5336
5379
  * 处理入站 JSON-RPC 请求
5337
5380
  *
@@ -5418,7 +5461,7 @@ interface A2AAgentCardConfig {
5418
5461
  description?: string;
5419
5462
  tags?: string[];
5420
5463
  }>;
5421
- /** 安全认证配置(体现在 Agent Card 的 securitySchemes / security 字段) */
5464
+ /** 安全认证配置(体现在 Agent Card 的 securitySchemes / securityRequirements 字段) */
5422
5465
  security?: A2ASecurityConfig;
5423
5466
  }
5424
5467
  /**
@@ -5462,7 +5505,7 @@ interface A2AHandleResult {
5462
5505
  interface A2ACallOptions {
5463
5506
  /** 超时时间(毫秒),默认 60 秒。 */
5464
5507
  timeout?: number;
5465
- /** 额外请求头 */
5508
+ /** 额外请求头,按大小写不敏感的同名字段覆盖;远端 HTTP 重定向被拒绝。 */
5466
5509
  headers?: Record<string, string>;
5467
5510
  }
5468
5511
  /**
@@ -5480,7 +5523,7 @@ interface A2ACallResult {
5480
5523
  /** 远端任务 ID */
5481
5524
  taskId?: string;
5482
5525
  /** 任务最终状态 */
5483
- taskState?: string;
5526
+ taskState?: TaskState;
5484
5527
  /** 响应消息文本 */
5485
5528
  responseText?: string;
5486
5529
  /** 响应消息 Part 数组 */
@@ -6761,7 +6804,7 @@ interface FileParseRequest {
6761
6804
  * ```
6762
6805
  */
6763
6806
  interface FileParseResult {
6764
- /** 提取的文本内容(当 `outputFormat` 为 `'markdown'` 时为 Markdown 格式) */
6807
+ /** 提取的文本内容(当 `outputFormat` 为 `'markdown'` 时为 Markdown 格式);不是可直接执行的可信 HTML。 */
6765
6808
  text: string;
6766
6809
  /** 解析方法 */
6767
6810
  method: FileParseMethod;
@@ -9821,4 +9864,5 @@ interface ACPGitReport {
9821
9864
  */
9822
9865
  type ACPOperations = ReturnType<typeof createACPOperations>;
9823
9866
 
9824
- export { type AudioModelEntry as $, type A2AAgentCardConfig as A, ACPRepositorySchema as B, type ACPSessionInfo as C, type ACPTransport as D, ACPWorkspaceSchema as E, type AIConfig as F, type AIConfigInput as G, AIConfigSchema as H, type AIFunctions as I, type AIInitOptions as J, type AIRelStore as K, type AIRelStoreCompareAndSwap as L, type AIRelStoreOptions as M, type AIResourceEntry as N, type AIResourceRegistry as O, type AIStoreProvider as P, type AIVectorBackend as Q, type AIVectorStore as R, type AIVersionedRecord as S, AUDIO_WS_PATH as T, type ApiType as U, ApiTypeSchema as V, type AskOptions as W, type AssistantMessage as X, type AudioConfig as Y, AudioConfigSchema as Z, AudioFormatSchema as _, type A2AApiKeySecurity as a, type FileConfig as a$, AudioModelEntrySchema as a0, type AudioOperation as a1, AudioOperationSchema as a2, AudioOperationsSchema as a3, type AudioProviderName as a4, AudioProviderSchema as a5, type AudioWsClientMessage as a6, AudioWsClientMessageSchema as a7, type AudioWsDoneMessage as a8, AudioWsDoneMessageSchema as a9, type CompressionStrategy as aA, CompressionStrategySchema as aB, type ConsolidateOptions as aC, type ConsolidateResult as aD, type ContextChatOptions as aE, type ContextChatResult as aF, type ContextManager as aG, type ContextManagerOptions as aH, type ContextOperations as aI, type ContextResetOptions as aJ, type ContextStreamEvent as aK, type ConversationTurn as aL, type ConversationTurnStatus as aM, type DefineToolOptions as aN, type DeveloperMessage as aO, type EmbeddingConfig as aP, EmbeddingConfigSchema as aQ, type EmbeddingItem as aR, type EmbeddingOperations as aS, type EmbeddingRequest as aT, type EmbeddingResponse as aU, type EntityDocumentRelation as aV, type EntityDocumentResult as aW, type EntityListOptions as aX, type EntityQueryOptions as aY, type EntityType as aZ, EntityTypeSchema as a_, type AudioWsEndMessage as aa, type AudioWsErrorMessage as ab, type AudioWsSegmentDoneMessage as ac, type AudioWsSegmentStartedMessage as ad, type AudioWsServerMessage as ae, type AudioWsSpeechMessage as af, type AudioWsStartMessage as ag, AudioWsStartMessageSchema as ah, type AudioWsTextMessage as ai, AudioWsTextMessageSchema as aj, type AudioWsTranscriptMessage as ak, type ChatCompletionChoice as al, type ChatCompletionChunk as am, type ChatCompletionDelta as an, type ChatCompletionRequest as ao, type ChatCompletionResponse as ap, type ChatHistoryOptions as aq, type ChatMessage as ar, type ChatRecord as as, type Citation as at, type CommitTurnInput as au, type CompressConfig as av, CompressConfigSchema as aw, type CompressOperations as ax, type CompressOptions as ay, type CompressResult as az, type A2AAuthenticator as b, MCPServerConfigSchema as b$, FileConfigSchema as b0, type FileOperations as b1, type FileParseMethod as b2, type FileParseOptions as b3, type FileParseRequest as b4, type FileParseResult as b5, type GenerateImageRequest as b6, type GenerateImageResult as b7, type GenerateObjectRequest as b8, type GeneratedImage as b9, type KnowledgeOperations as bA, type KnowledgeRepairOptions as bB, type KnowledgeRepairProgress as bC, type KnowledgeRepairResult as bD, type KnowledgeRetrieveItem as bE, type KnowledgeRetrieveOptions as bF, type KnowledgeRetrieveResult as bG, type KnowledgeSetupOptions as bH, type KnowledgeStore as bI, type LLMConfig as bJ, LLMConfigSchema as bK, type LLMOperations as bL, type MCPConfig as bM, MCPConfigSchema as bN, type MCPContext as bO, type MCPExternalServer as bP, MCPExternalServerSchema as bQ, type MCPOperations as bR, type MCPPrompt as bS, type MCPPromptArgument as bT, type MCPPromptContent as bU, type MCPPromptMessage as bV, type MCPResource as bW, type MCPResourceContent as bX, type MCPServerCapabilities as bY, MCPServerCapabilitiesSchema as bZ, type MCPServerConfig as b_, HaiAIError as ba, type ImageConfig as bb, ImageConfigSchema as bc, type ImageContent as bd, type ImageModelEntry as be, ImageModelEntrySchema as bf, type ImageOperations as bg, type ImageProviderName as bh, ImageProviderSchema as bi, type ImageSize as bj, type InteractionScope as bk, type KnowledgeAskOptions as bl, type KnowledgeAskResult as bm, type KnowledgeConfig as bn, KnowledgeConfigSchema as bo, type KnowledgeDocumentInfo as bp, type KnowledgeDocumentListOptions as bq, type KnowledgeDocumentMetadata as br, type KnowledgeDocumentRemoveOptions as bs, type KnowledgeDocumentRevision as bt, type KnowledgeEntity as bu, type KnowledgeIngestBatchProgress as bv, type KnowledgeIngestBatchResult as bw, type KnowledgeIngestFileInput as bx, type KnowledgeIngestInput as by, type KnowledgeIngestResult as bz, type A2ACallOptions as c, type RetrievalConfig as c$, type MCPToolDefinition as c0, type MCPToolHandler as c1, type ManagedAudioOperations as c2, type ManagedImageOperations as c3, type ManagedLLMOperations as c4, type ManagedMCPOperations as c5, type ManagedRetrievalOperations as c6, type McpServerOptions as c7, type MemoryAccessScope as c8, type MemoryAdminOperations as c9, type PersonaOperations as cA, type PersonaProfile as cB, type PersonaProfileInput as cC, type PersonaProfileUpdate as cD, type PersonaScopeOptions as cE, type RagContextItem as cF, type RagOperations as cG, type RagOptions as cH, type RagResult as cI, type RagStreamEvent as cJ, type ReasoningOperations as cK, type ReasoningOptions as cL, type ReasoningResult as cM, type ReasoningStep as cN, type ReasoningStepType as cO, type ReasoningStrategy as cP, type ReasoningStreamEvent as cQ, type ReferenceImage as cR, type RerankDocument as cS, type RerankItem as cT, type RerankOperations as cU, type RerankRequest as cV, type RerankResponse as cW, type ResolveRequiredModelEntryOptions as cX, type ResolvedAudioModel as cY, type ResolvedImageModel as cZ, type ResolvedModelConfig as c_, type MemoryClearAllOptions as ca, type MemoryClearOptions as cb, type MemoryConfig as cc, MemoryConfigSchema as cd, type MemoryCoreOperations as ce, type MemoryEntry as cf, type MemoryEntryInput as cg, type MemoryExtractOptions as ch, type MemoryInjectionOptions as ci, type MemoryListOptions as cj, type MemoryListPageOptions as ck, type MemoryOperations as cl, type MemoryRecallOptions as cm, type MemoryType as cn, MemoryTypeSchema as co, type MemoryUpdateInput as cp, type MessageContent as cq, type MessageRole as cr, ModelCapabilitiesSchema as cs, type ModelEntry as ct, ModelEntrySchema as cu, type ModelScenario as cv, ModelScenarioSchema as cw, type ObjectRef as cx, OptionalSecretSchema as cy, type OutputFormat as cz, type A2ACallResult as d, RetrievalConfigSchema as d0, type RetrievalOperations as d1, type RetrievalRequest as d2, type RetrievalResult as d3, type RetrievalResultItem as d4, type RetrievalSource as d5, type RetrievalSourceConfig as d6, RetrievalSourceSchema as d7, type SSEDecoder as d8, type SSEEvent as d9, type ToolDefinition as dA, type ToolErrorType as dB, type ToolExecutionContext as dC, type ToolExecutionOptions as dD, type ToolMessage as dE, type ToolRegistryOperations as dF, type ToolRegistryOptions as dG, type ToolsOperations as dH, type UserMessage as dI, type WhereClause as dJ, type WhereOperator as dK, type WhereValue as dL, ensureAudioCredential as dM, resolveAudioModel as dN, resolveImageModel as dO, resolveModelApi as dP, resolveModelEntry as dQ, serializePlayableAudio as dR, type ACPSessionWorkspace as dS, type ScopedMemoryBinding as da, type ScopedMemoryOperations as db, type SessionInfo as dc, type StoreFilter as dd, type StorePage as de, type StoreScope as df, type StreamOperations as dg, type StreamProcessor as dh, type StreamResult as di, type SummaryConfig as dj, SummaryConfigSchema as dk, type SummaryOperations as dl, type SummaryOptions as dm, type SummaryResult as dn, type SystemMessage as dp, type TempModelConfig as dq, type TextContent as dr, type TokenConfig as ds, TokenConfigSchema as dt, type TokenOperations as du, type TokenUsage as dv, type Tool as dw, type ToolAuthorizationRequest as dx, type ToolAuthorizer as dy, type ToolCall as dz, type A2ACallerIdentity as e, type A2AConfig as f, A2AConfigSchema as g, type A2AContextInfo as h, type A2AHandleResult as i, type A2AMessageRecord as j, type A2AOperations as k, type A2ASecurityConfig as l, A2ASkillConfigSchema as m, type A2ATaskFilter as n, type ACPAgentAdapter as o, type ACPAgentAdapterInput as p, type ACPAgentLaunch as q, ACPAgentSchema as r, type ACPClientOptions as s, type ACPConfig as t, type ACPConfigInput as u, ACPConfigSchema as v, type ACPCreateSessionOptions as w, type ACPGitReport as x, type ACPOperations as y, ACPPublishSchema as z };
9867
+ export { AudioFormatSchema as $, ACPPublishSchema as B, ACPRepositorySchema as C, ACPWorkspaceSchema as F, AIConfigSchema as I, AUDIO_WS_PATH as U, ApiTypeSchema as W, AudioConfigSchema as _, EntityTypeSchema as a$, AudioModelEntrySchema as a1, AudioOperationSchema as a3, AudioOperationsSchema as a4, AudioProviderSchema as a6, AudioWsClientMessageSchema as a8, CompressionStrategySchema as aC, EmbeddingConfigSchema as aR, AudioWsDoneMessageSchema as aa, AudioWsStartMessageSchema as ai, AudioWsTextMessageSchema as ak, CompressConfigSchema as ax, FileConfigSchema as b1, LLMConfigSchema as bL, MCPConfigSchema as bO, MCPExternalServerSchema as bR, MCPServerCapabilitiesSchema as b_, HaiAIError as bb, ImageConfigSchema as bd, ImageModelEntrySchema as bg, ImageProviderSchema as bj, KnowledgeConfigSchema as bp, MCPServerConfigSchema as c0, MemoryConfigSchema as ce, MemoryTypeSchema as cp, ModelCapabilitiesSchema as ct, ModelEntrySchema as cv, ModelScenarioSchema as cx, OptionalSecretSchema as cz, RetrievalConfigSchema as d1, RetrievalSourceSchema as d8, ensureAudioCredential as dN, resolveAudioModel as dO, resolveImageModel as dP, resolveModelApi as dQ, resolveModelEntry as dR, serializePlayableAudio as dS, SummaryConfigSchema as dl, TokenConfigSchema as du, A2AConfigSchema as h, A2ASkillConfigSchema as n, ACPAgentSchema as s, ACPConfigSchema as w };
9868
+ export type { A2AAgentCardConfig as A, ACPSessionInfo as D, ACPTransport as E, AIConfig as G, AIConfigInput as H, AIFunctions as J, AIInitOptions as K, AIRelStore as L, AIRelStoreCompareAndSwap as M, AIRelStoreOptions as N, AIResourceEntry as O, AIResourceRegistry as P, AIStoreProvider as Q, AIVectorBackend as R, AIVectorStore as S, AIVersionedRecord as T, ApiType as V, AskOptions as X, AssistantMessage as Y, AudioConfig as Z, A2AAgentCardDocument as a, AudioModelEntry as a0, AudioOperation as a2, AudioProviderName as a5, AudioWsClientMessage as a7, AudioWsDoneMessage as a9, CompressResult as aA, CompressionStrategy as aB, ConsolidateOptions as aD, ConsolidateResult as aE, ContextChatOptions as aF, ContextChatResult as aG, ContextManager as aH, ContextManagerOptions as aI, ContextOperations as aJ, ContextResetOptions as aK, ContextStreamEvent as aL, ConversationTurn as aM, ConversationTurnStatus as aN, DefineToolOptions as aO, DeveloperMessage as aP, EmbeddingConfig as aQ, EmbeddingItem as aS, EmbeddingOperations as aT, EmbeddingRequest as aU, EmbeddingResponse as aV, EntityDocumentRelation as aW, EntityDocumentResult as aX, EntityListOptions as aY, EntityQueryOptions as aZ, EntityType as a_, AudioWsEndMessage as ab, AudioWsErrorMessage as ac, AudioWsSegmentDoneMessage as ad, AudioWsSegmentStartedMessage as ae, AudioWsServerMessage as af, AudioWsSpeechMessage as ag, AudioWsStartMessage as ah, AudioWsTextMessage as aj, AudioWsTranscriptMessage as al, ChatCompletionChoice as am, ChatCompletionChunk as an, ChatCompletionDelta as ao, ChatCompletionRequest as ap, ChatCompletionResponse as aq, ChatHistoryOptions as ar, ChatMessage as as, ChatRecord as at, Citation as au, CommitTurnInput as av, CompressConfig as aw, CompressOperations as ay, CompressOptions as az, A2AApiKeySecurity as b, MCPServerConfig as b$, FileConfig as b0, FileOperations as b2, FileParseMethod as b3, FileParseOptions as b4, FileParseRequest as b5, FileParseResult as b6, GenerateImageRequest as b7, GenerateImageResult as b8, GenerateObjectRequest as b9, KnowledgeIngestResult as bA, KnowledgeOperations as bB, KnowledgeRepairOptions as bC, KnowledgeRepairProgress as bD, KnowledgeRepairResult as bE, KnowledgeRetrieveItem as bF, KnowledgeRetrieveOptions as bG, KnowledgeRetrieveResult as bH, KnowledgeSetupOptions as bI, KnowledgeStore as bJ, LLMConfig as bK, LLMOperations as bM, MCPConfig as bN, MCPContext as bP, MCPExternalServer as bQ, MCPOperations as bS, MCPPrompt as bT, MCPPromptArgument as bU, MCPPromptContent as bV, MCPPromptMessage as bW, MCPResource as bX, MCPResourceContent as bY, MCPServerCapabilities as bZ, GeneratedImage as ba, ImageConfig as bc, ImageContent as be, ImageModelEntry as bf, ImageOperations as bh, ImageProviderName as bi, ImageSize as bk, InteractionScope as bl, KnowledgeAskOptions as bm, KnowledgeAskResult as bn, KnowledgeConfig as bo, KnowledgeDocumentInfo as bq, KnowledgeDocumentListOptions as br, KnowledgeDocumentMetadata as bs, KnowledgeDocumentRemoveOptions as bt, KnowledgeDocumentRevision as bu, KnowledgeEntity as bv, KnowledgeIngestBatchProgress as bw, KnowledgeIngestBatchResult as bx, KnowledgeIngestFileInput as by, KnowledgeIngestInput as bz, A2AAuthenticator as c, ResolvedModelConfig as c$, MCPToolDefinition as c1, MCPToolHandler as c2, ManagedAudioOperations as c3, ManagedImageOperations as c4, ManagedLLMOperations as c5, ManagedMCPOperations as c6, ManagedRetrievalOperations as c7, McpServerOptions as c8, MemoryAccessScope as c9, OutputFormat as cA, PersonaOperations as cB, PersonaProfile as cC, PersonaProfileInput as cD, PersonaProfileUpdate as cE, PersonaScopeOptions as cF, RagContextItem as cG, RagOperations as cH, RagOptions as cI, RagResult as cJ, RagStreamEvent as cK, ReasoningOperations as cL, ReasoningOptions as cM, ReasoningResult as cN, ReasoningStep as cO, ReasoningStepType as cP, ReasoningStrategy as cQ, ReasoningStreamEvent as cR, ReferenceImage as cS, RerankDocument as cT, RerankItem as cU, RerankOperations as cV, RerankRequest as cW, RerankResponse as cX, ResolveRequiredModelEntryOptions as cY, ResolvedAudioModel as cZ, ResolvedImageModel as c_, MemoryAdminOperations as ca, MemoryClearAllOptions as cb, MemoryClearOptions as cc, MemoryConfig as cd, MemoryCoreOperations as cf, MemoryEntry as cg, MemoryEntryInput as ch, MemoryExtractOptions as ci, MemoryInjectionOptions as cj, MemoryListOptions as ck, MemoryListPageOptions as cl, MemoryOperations as cm, MemoryRecallOptions as cn, MemoryType as co, MemoryUpdateInput as cq, MessageContent as cr, MessageRole as cs, ModelEntry as cu, ModelScenario as cw, ObjectRef as cy, A2ACallOptions as d, RetrievalConfig as d0, RetrievalOperations as d2, RetrievalRequest as d3, RetrievalResult as d4, RetrievalResultItem as d5, RetrievalSource as d6, RetrievalSourceConfig as d7, SSEDecoder as d9, ToolCall as dA, ToolDefinition as dB, ToolErrorType as dC, ToolExecutionContext as dD, ToolExecutionOptions as dE, ToolMessage as dF, ToolRegistryOperations as dG, ToolRegistryOptions as dH, ToolsOperations as dI, UserMessage as dJ, WhereClause as dK, WhereOperator as dL, WhereValue as dM, ACPSessionWorkspace as dT, SSEEvent as da, ScopedMemoryBinding as db, ScopedMemoryOperations as dc, SessionInfo as dd, StoreFilter as de, StorePage as df, StoreScope as dg, StreamOperations as dh, StreamProcessor as di, StreamResult as dj, SummaryConfig as dk, SummaryOperations as dm, SummaryOptions as dn, SummaryResult as dp, SystemMessage as dq, TempModelConfig as dr, TextContent as ds, TokenConfig as dt, TokenOperations as dv, TokenUsage as dw, Tool as dx, ToolAuthorizationRequest as dy, ToolAuthorizer as dz, A2ACallResult as e, A2ACallerIdentity as f, A2AConfig as g, A2AContextInfo as i, A2AHandleResult as j, A2AMessageRecord as k, A2AOperations as l, A2ASecurityConfig as m, A2ATaskFilter as o, ACPAgentAdapter as p, ACPAgentAdapterInput as q, ACPAgentLaunch as r, ACPClientOptions as t, ACPConfig as u, ACPConfigInput as v, ACPCreateSessionOptions as x, ACPGitReport as y, ACPOperations as z };