@h-ai/ai 0.1.0-alpha.41 → 0.1.0-alpha.42
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 +33 -1
- package/dist/{ai-audio-ws-protocol-DE4WxxHM.d.ts → ai-audio-ws-protocol-DrFmoxAc.d.ts} +67 -2
- package/dist/{ai-reasoning-types-B8PH0w2_.d.ts → ai-reasoning-types-CiIOPCQw.d.ts} +94 -1
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +3 -3
- package/dist/{chunk-ELH2IPOE.js → chunk-6RWS5OWJ.js} +3 -3
- package/dist/{chunk-ELH2IPOE.js.map → chunk-6RWS5OWJ.js.map} +1 -1
- package/dist/{chunk-DRSZFSCT.js → chunk-GKFOJPSQ.js} +95 -5
- package/dist/chunk-GKFOJPSQ.js.map +1 -0
- package/dist/{chunk-P3GND76X.js → chunk-JC7QBT3C.js} +9 -2
- package/dist/chunk-JC7QBT3C.js.map +1 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +635 -154
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-DRSZFSCT.js.map +0 -1
- package/dist/chunk-P3GND76X.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @h-ai/ai
|
|
2
2
|
|
|
3
|
-
AI 能力模块,提供统一的 `ai` 服务对象,覆盖 LLM
|
|
3
|
+
AI 能力模块,提供统一的 `ai` 服务对象,覆盖 LLM 对话、文生图、工具调用、MCP、Embedding、记忆、检索/RAG、知识库、上下文管理、文件解析、Rerank、语音(ASR/TTS)与 A2A。Node.js 侧通过 `ai.init()` 初始化,浏览器侧通过 API/client 代理访问。
|
|
4
4
|
|
|
5
5
|
## 能力概览
|
|
6
6
|
|
|
@@ -16,6 +16,7 @@ AI 能力模块,提供统一的 `ai` 服务对象,覆盖 LLM 对话、工具
|
|
|
16
16
|
- `ai.context`:LLM + Memory + RAG + 压缩的一体化会话管理。
|
|
17
17
|
- `ai.file` / `ai.rerank`:文件解析/OCR 与文本重排序。
|
|
18
18
|
- `ai.audio`:语音识别(ASR)与语音合成(TTS),支持完整与流式调用,覆盖 OpenAI / MiMo / Qwen / 豆包平台。
|
|
19
|
+
- `ai.image`:文生图,覆盖 OpenAI GPT Image、Google Gemini Image / Nano Banana、Qwen-Image 2.0/3.0、Seedream 4.x/5.x 与 Pollinations 免费额度模型。
|
|
19
20
|
- `ai.a2a`:Agent-to-Agent 请求处理与远端调用。
|
|
20
21
|
- `@h-ai/ai/client`:前端轻量客户端(配合 API 服务)。
|
|
21
22
|
- `AIStoreProvider`:统一存储抽象;无数据库时默认使用进程内临时 Store,已初始化 reldb + vecdb 时自动使用持久化 DB Provider。
|
|
@@ -267,6 +268,36 @@ if (caps.success && caps.data.synthesize?.streamingAudioOutput) { /* 可实时 T
|
|
|
267
268
|
|
|
268
269
|
浏览器 / 移动端通过 `@h-ai/serv` 暴露的统一语音 WebSocket 入口访问,`@h-ai/ai/client` 提供与 Node 端一致的 `audio.*` API(传输细节内部隐藏)。浏览器客户端严格区分正常结束、取消(`AUDIO_CANCELLED`)与异常断连(`AUDIO_CONNECTION_FAILED`):取消或在 `end` 前断连会抛出对应领域错误码,`synthesize` 不会把未完成的部分音频当作成功结果返回。
|
|
269
270
|
|
|
271
|
+
### 文生图(Image)
|
|
272
|
+
|
|
273
|
+
在 `ai.init()` 注册模型后,调用方只接收标准化图片字节,不感知厂商 Base64、内联数据或临时 URL:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
await ai.init({
|
|
277
|
+
image: {
|
|
278
|
+
models: [
|
|
279
|
+
{ id: 'image', provider: 'openai', model: 'gpt-image-2' },
|
|
280
|
+
{ id: 'free', provider: 'pollinations', model: 'zimage' },
|
|
281
|
+
],
|
|
282
|
+
generateModel: 'image',
|
|
283
|
+
},
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
const result = await ai.image.generate({
|
|
287
|
+
prompt: '一个正在构建开源框架的友好机器人',
|
|
288
|
+
size: { width: 1024, height: 1024 },
|
|
289
|
+
referenceImages: [
|
|
290
|
+
{ data: await readImage('character.png'), mimeType: 'image/png' },
|
|
291
|
+
],
|
|
292
|
+
})
|
|
293
|
+
if (result.success) {
|
|
294
|
+
const { data, mimeType } = result.data.images[0]!
|
|
295
|
+
await saveImage(data, mimeType)
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
`referenceImages` 可省略;公共层只接受图片字节与 MIME,multipart、`inlineData`、Data URL 等差异由 Provider 转换。凭据可在模型条目传入,或使用 `HAI_AI_IMAGE_<PROVIDER>_API_KEY` / 厂商环境变量。Qwen 与 Seedream 返回的临时 URL 会在 Provider 内立即下载,不会泄漏到公共返回值。完整接口差异与模型说明见 [REFERENCE.md](./REFERENCE.md#image)。
|
|
300
|
+
|
|
270
301
|
### Context 管理器
|
|
271
302
|
|
|
272
303
|
```ts
|
|
@@ -460,6 +491,7 @@ if (!result.success) {
|
|
|
460
491
|
- `hai:ai:600-701`:Retrieval/RAG。
|
|
461
492
|
- `hai:ai:800-805`:Knowledge。
|
|
462
493
|
- `hai:ai:050-059`:Audio。
|
|
494
|
+
- `hai:ai:060-065`:Image。
|
|
463
495
|
- `hai:ai:900-905`:Memory。
|
|
464
496
|
- `hai:ai:980-984`:A2A。
|
|
465
497
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _h_ai_core from '@h-ai/core';
|
|
2
2
|
import { HaiResult } from '@h-ai/core';
|
|
3
|
-
import {
|
|
3
|
+
import { aO as ChatMessage, an as InteractionScope, U as MemoryType, bz as RagOptions, bD as ReasoningOptions, ca as ToolRegistryOperations, bl as MemoryEntry, bS as SessionInfo, be as LLMOperations, br as MemoryOperations, by as RagOperations, bC as ReasoningOperations, c as AIConfig, d as AIConfigInput, aD as AIStoreProvider, cc as ToolsOperations, bW as StreamOperations, bJ as RetrievalOperations, b8 as KnowledgeOperations, ax as A2AOperations, q as AudioOperations, l as AudioFormat } from './ai-reasoning-types-CiIOPCQw.js';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { Buffer } from 'node:buffer';
|
|
@@ -918,6 +918,63 @@ interface FileOperations {
|
|
|
918
918
|
parseText: (content: Buffer | string, filename?: string) => Promise<HaiResult<string>>;
|
|
919
919
|
}
|
|
920
920
|
|
|
921
|
+
/**
|
|
922
|
+
* @h-ai/ai — 文生图公共类型
|
|
923
|
+
*
|
|
924
|
+
* 公共契约只暴露业务需要的提示词、尺寸和标准化图片字节。
|
|
925
|
+
* 厂商请求字段、临时 URL 与响应中间态由 Provider 内部处理。
|
|
926
|
+
* @module image/ai-image-types
|
|
927
|
+
*/
|
|
928
|
+
|
|
929
|
+
/** 图片像素尺寸 */
|
|
930
|
+
interface ImageSize {
|
|
931
|
+
/** 宽度(像素) */
|
|
932
|
+
width: number;
|
|
933
|
+
/** 高度(像素) */
|
|
934
|
+
height: number;
|
|
935
|
+
}
|
|
936
|
+
/** 可选参考图;Provider 会转换为对应厂商的传输格式 */
|
|
937
|
+
interface ReferenceImage {
|
|
938
|
+
/** 图片二进制内容 */
|
|
939
|
+
data: Uint8Array;
|
|
940
|
+
/** 图片 MIME 类型,例如 `image/png`、`image/jpeg` */
|
|
941
|
+
mimeType: string;
|
|
942
|
+
}
|
|
943
|
+
/** 文生图请求 */
|
|
944
|
+
interface GenerateImageRequest {
|
|
945
|
+
/** 图片内容与风格提示词 */
|
|
946
|
+
prompt: string;
|
|
947
|
+
/** 模型 ID;不传时使用配置中的默认文生图模型 */
|
|
948
|
+
model?: string;
|
|
949
|
+
/** 输出像素尺寸;不传时由模型决定 */
|
|
950
|
+
size?: ImageSize;
|
|
951
|
+
/** 用于图生图、编辑或风格参考的一张或多张图片 */
|
|
952
|
+
referenceImages?: ReferenceImage[];
|
|
953
|
+
/** 请求取消信号 */
|
|
954
|
+
signal?: AbortSignal;
|
|
955
|
+
}
|
|
956
|
+
/** 标准化后的单张图片 */
|
|
957
|
+
interface GeneratedImage {
|
|
958
|
+
/** 图片二进制内容 */
|
|
959
|
+
data: Uint8Array;
|
|
960
|
+
/** 图片 MIME 类型 */
|
|
961
|
+
mimeType: string;
|
|
962
|
+
/** 实际宽度(厂商返回时提供) */
|
|
963
|
+
width?: number;
|
|
964
|
+
/** 实际高度(厂商返回时提供) */
|
|
965
|
+
height?: number;
|
|
966
|
+
}
|
|
967
|
+
/** 文生图结果 */
|
|
968
|
+
interface GenerateImageResult {
|
|
969
|
+
/** 厂商实际返回的图片;通常为一张 */
|
|
970
|
+
images: GeneratedImage[];
|
|
971
|
+
}
|
|
972
|
+
/** 文生图操作接口(通过 `ai.image` 访问) */
|
|
973
|
+
interface ImageOperations {
|
|
974
|
+
/** 根据文本提示生成图片 */
|
|
975
|
+
generate: (request: GenerateImageRequest) => Promise<HaiResult<GenerateImageResult>>;
|
|
976
|
+
}
|
|
977
|
+
|
|
921
978
|
/**
|
|
922
979
|
* @h-ai/ai — MCP 子功能类型
|
|
923
980
|
*
|
|
@@ -1414,6 +1471,12 @@ declare const HaiAIError: {
|
|
|
1414
1471
|
readonly AUDIO_TIMEOUT: _h_ai_core.HaiErrorDef;
|
|
1415
1472
|
readonly AUDIO_INPUT_TOO_LARGE: _h_ai_core.HaiErrorDef;
|
|
1416
1473
|
readonly AUDIO_CANCELLED: _h_ai_core.HaiErrorDef;
|
|
1474
|
+
readonly IMAGE_INVALID_REQUEST: _h_ai_core.HaiErrorDef;
|
|
1475
|
+
readonly IMAGE_MODEL_NOT_FOUND: _h_ai_core.HaiErrorDef;
|
|
1476
|
+
readonly IMAGE_PROVIDER_NOT_FOUND: _h_ai_core.HaiErrorDef;
|
|
1477
|
+
readonly IMAGE_UPSTREAM_ERROR: _h_ai_core.HaiErrorDef;
|
|
1478
|
+
readonly IMAGE_PROTOCOL_ERROR: _h_ai_core.HaiErrorDef;
|
|
1479
|
+
readonly IMAGE_CANCELLED: _h_ai_core.HaiErrorDef;
|
|
1417
1480
|
readonly CONTEXT_COMPRESS_FAILED: _h_ai_core.HaiErrorDef;
|
|
1418
1481
|
readonly CONTEXT_SUMMARIZE_FAILED: _h_ai_core.HaiErrorDef;
|
|
1419
1482
|
readonly CONTEXT_TOKEN_ESTIMATE_FAILED: _h_ai_core.HaiErrorDef;
|
|
@@ -1522,6 +1585,8 @@ interface AIFunctions {
|
|
|
1522
1585
|
readonly a2a: A2AOperations;
|
|
1523
1586
|
/** Audio 操作(语音识别 / 语音合成),需要先调用 `init()` 并配置 `audio` */
|
|
1524
1587
|
readonly audio: AudioOperations;
|
|
1588
|
+
/** Image 操作(文生图),需要先调用 `init()` 并配置 `image` */
|
|
1589
|
+
readonly image: ImageOperations;
|
|
1525
1590
|
}
|
|
1526
1591
|
|
|
1527
1592
|
/** 统一语音入口的默认路径(相对 API 前缀) */
|
|
@@ -1689,4 +1754,4 @@ interface AudioWsEndMessage {
|
|
|
1689
1754
|
/** 服务端 JSON 消息(合成音频以二进制帧返回,不走 JSON) */
|
|
1690
1755
|
type AudioWsServerMessage = AudioWsSpeechMessage | AudioWsTranscriptMessage | AudioWsSegmentStartedMessage | AudioWsSegmentDoneMessage | AudioWsErrorMessage | AudioWsEndMessage;
|
|
1691
1756
|
|
|
1692
|
-
export { type
|
|
1757
|
+
export { type FileParseOptions as $, type AIFunctions as A, type CompressResult as B, type CompressionStrategy as C, type ConsolidateOptions as D, type ConsolidateResult as E, type ContextChatOptions as F, type GenerateImageRequest as G, HaiAIError as H, type ImageOperations as I, type ContextChatResult as J, type ContextDeps as K, type ContextManager as L, type McpServerOptions as M, type ContextManagerOptions as N, type ContextOperations as O, type ContextResetOptions as P, type ContextStreamEvent as Q, type ReferenceImage as R, type ConversationTurn as S, type ConversationTurnStatus as T, type EmbeddingItem as U, type EmbeddingOperations as V, type EmbeddingProvider as W, type EmbeddingRequest as X, type EmbeddingResponse as Y, type FileOperations as Z, type FileParseMethod as _, type AIInitOptions as a, type FileParseRequest as a0, type FileParseResult as a1, type MCPContext as a2, type MCPOperations as a3, type MCPPrompt as a4, type MCPPromptArgument as a5, type MCPPromptContent as a6, type MCPPromptMessage as a7, type MCPProvider as a8, type MCPResource as a9, type MCPResourceContent as aa, type MCPToolDefinition as ab, type MCPToolHandler as ac, type OutputFormat as ad, type PersonaOperations as ae, type PersonaProfile as af, type PersonaProfileInput as ag, type PersonaProfileUpdate as ah, type PersonaScopeOptions as ai, type RerankDocument as aj, type RerankItem as ak, type RerankOperations as al, type RerankRequest as am, type RerankResponse as an, type SummaryOperations as ao, type SummaryOptions as ap, type SummaryResult as aq, type TokenOperations as ar, AUDIO_WS_PATH as b, AudioFormatSchema as c, type AudioWsClientMessage as d, AudioWsClientMessageSchema as e, type AudioWsDoneMessage as f, AudioWsDoneMessageSchema as g, type AudioWsEndMessage as h, type AudioWsErrorMessage as i, type AudioWsSegmentDoneMessage as j, type AudioWsSegmentStartedMessage as k, type AudioWsServerMessage as l, type AudioWsSpeechMessage as m, type AudioWsStartMessage as n, AudioWsStartMessageSchema as o, type AudioWsTextMessage as p, AudioWsTextMessageSchema as q, type AudioWsTranscriptMessage as r, CompressionStrategySchema as s, type GenerateImageResult as t, type GeneratedImage as u, type ImageSize as v, type AIMCPFunctionsDeps as w, type CommitTurnInput as x, type CompressOperations as y, type CompressOptions as z };
|
|
@@ -2880,6 +2880,81 @@ interface ResolvedAudioModel {
|
|
|
2880
2880
|
* @returns 成功返回已解析模型;无匹配模型返回 `AUDIO_MODEL_NOT_FOUND`;缺少凭据返回 `CONFIGURATION_ERROR`
|
|
2881
2881
|
*/
|
|
2882
2882
|
declare function resolveAudioModel(audioConfig: AudioConfig, operation: 'transcribe' | 'synthesize', explicit?: string): HaiResult<ResolvedAudioModel>;
|
|
2883
|
+
/**
|
|
2884
|
+
* 文生图平台枚举
|
|
2885
|
+
*
|
|
2886
|
+
* - `openai` — OpenAI GPT Image(Image API)
|
|
2887
|
+
* - `google` — Google Gemini Image / Nano Banana(Generate Content API)
|
|
2888
|
+
* - `qwen` — 阿里云百炼 Qwen-Image 2.0 / 3.0
|
|
2889
|
+
* - `seedream` — 火山方舟 Seedream 4.x / 5.x
|
|
2890
|
+
* - `pollinations` — Pollinations 免费额度图片 API
|
|
2891
|
+
*/
|
|
2892
|
+
declare const ImageProviderSchema: z.ZodEnum<{
|
|
2893
|
+
openai: "openai";
|
|
2894
|
+
qwen: "qwen";
|
|
2895
|
+
google: "google";
|
|
2896
|
+
seedream: "seedream";
|
|
2897
|
+
pollinations: "pollinations";
|
|
2898
|
+
}>;
|
|
2899
|
+
/** 文生图平台类型 */
|
|
2900
|
+
type ImageProviderName = z.infer<typeof ImageProviderSchema>;
|
|
2901
|
+
/** 文生图模型条目 Schema */
|
|
2902
|
+
declare const ImageModelEntrySchema: z.ZodObject<{
|
|
2903
|
+
id: z.ZodString;
|
|
2904
|
+
provider: z.ZodEnum<{
|
|
2905
|
+
openai: "openai";
|
|
2906
|
+
qwen: "qwen";
|
|
2907
|
+
google: "google";
|
|
2908
|
+
seedream: "seedream";
|
|
2909
|
+
pollinations: "pollinations";
|
|
2910
|
+
}>;
|
|
2911
|
+
model: z.ZodString;
|
|
2912
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
2913
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2914
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
2915
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
2916
|
+
}, z.core.$strip>;
|
|
2917
|
+
/** 文生图模型条目类型 */
|
|
2918
|
+
type ImageModelEntry = z.infer<typeof ImageModelEntrySchema>;
|
|
2919
|
+
/** 文生图配置 Schema */
|
|
2920
|
+
declare const ImageConfigSchema: z.ZodObject<{
|
|
2921
|
+
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2922
|
+
id: z.ZodString;
|
|
2923
|
+
provider: z.ZodEnum<{
|
|
2924
|
+
openai: "openai";
|
|
2925
|
+
qwen: "qwen";
|
|
2926
|
+
google: "google";
|
|
2927
|
+
seedream: "seedream";
|
|
2928
|
+
pollinations: "pollinations";
|
|
2929
|
+
}>;
|
|
2930
|
+
model: z.ZodString;
|
|
2931
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
2932
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
2933
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
2934
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
2935
|
+
}, z.core.$strip>>>;
|
|
2936
|
+
generateModel: z.ZodOptional<z.ZodString>;
|
|
2937
|
+
}, z.core.$strip>;
|
|
2938
|
+
/** 文生图配置类型 */
|
|
2939
|
+
type ImageConfig = z.infer<typeof ImageConfigSchema>;
|
|
2940
|
+
/** 已解析的文生图模型 */
|
|
2941
|
+
interface ResolvedImageModel {
|
|
2942
|
+
id: string;
|
|
2943
|
+
provider: ImageProviderName;
|
|
2944
|
+
model: string;
|
|
2945
|
+
apiKey: string;
|
|
2946
|
+
baseUrl: string;
|
|
2947
|
+
workspaceId?: string;
|
|
2948
|
+
timeout: number;
|
|
2949
|
+
}
|
|
2950
|
+
/**
|
|
2951
|
+
* 解析文生图模型配置
|
|
2952
|
+
*
|
|
2953
|
+
* @param imageConfig - 文生图配置
|
|
2954
|
+
* @param explicit - 请求显式模型 ID 或厂商模型名
|
|
2955
|
+
* @returns 已解析模型;模型或凭据缺失时返回 HaiResult 错误
|
|
2956
|
+
*/
|
|
2957
|
+
declare function resolveImageModel(imageConfig: ImageConfig, explicit?: string): HaiResult<ResolvedImageModel>;
|
|
2883
2958
|
/**
|
|
2884
2959
|
* AI 配置 Schema
|
|
2885
2960
|
*
|
|
@@ -3106,6 +3181,24 @@ declare const AIConfigSchema: z.ZodObject<{
|
|
|
3106
3181
|
maxAudioBytes: z.ZodDefault<z.ZodNumber>;
|
|
3107
3182
|
maxStreamDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
3108
3183
|
}, z.core.$strip>>;
|
|
3184
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
3185
|
+
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3186
|
+
id: z.ZodString;
|
|
3187
|
+
provider: z.ZodEnum<{
|
|
3188
|
+
openai: "openai";
|
|
3189
|
+
qwen: "qwen";
|
|
3190
|
+
google: "google";
|
|
3191
|
+
seedream: "seedream";
|
|
3192
|
+
pollinations: "pollinations";
|
|
3193
|
+
}>;
|
|
3194
|
+
model: z.ZodString;
|
|
3195
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
3196
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
3197
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
3198
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
3199
|
+
}, z.core.$strip>>>;
|
|
3200
|
+
generateModel: z.ZodOptional<z.ZodString>;
|
|
3201
|
+
}, z.core.$strip>>;
|
|
3109
3202
|
}, z.core.$strip>;
|
|
3110
3203
|
/** AI 配置类型(校验后的完整类型) */
|
|
3111
3204
|
type AIConfig = z.infer<typeof AIConfigSchema>;
|
|
@@ -3643,4 +3736,4 @@ interface ReasoningOperations {
|
|
|
3643
3736
|
runStream: (query: string, options?: ReasoningOptions) => AsyncIterable<ReasoningStreamEvent>;
|
|
3644
3737
|
}
|
|
3645
3738
|
|
|
3646
|
-
export { type
|
|
3739
|
+
export { type ResolvedAudioModel as $, type A2AConfig as A, ImageModelEntrySchema as B, type CompressConfig as C, type ImageProviderName as D, type EmbeddingConfig as E, type FileConfig as F, ImageProviderSchema as G, KnowledgeConfigSchema as H, type ImageConfig as I, LLMConfigSchema as J, type KnowledgeConfig as K, type LLMConfig as L, type MCPConfig as M, MCPConfigSchema as N, type MCPServerCapabilities as O, MCPServerCapabilitiesSchema as P, type MCPServerConfig as Q, MCPServerConfigSchema as R, type MemoryConfig as S, MemoryConfigSchema as T, type MemoryType as U, MemoryTypeSchema as V, type ModelEntry as W, ModelEntrySchema as X, type ModelScenario as Y, ModelScenarioSchema as Z, type ResolveRequiredModelEntryOptions as _, A2AConfigSchema as a, type KnowledgeDocumentInfo as a$, type ResolvedImageModel as a0, type ResolvedModelConfig as a1, type RetrievalConfig as a2, RetrievalConfigSchema as a3, type RetrievalSourceConfig as a4, RetrievalSourceSchema as a5, type SummaryConfig as a6, SummaryConfigSchema as a7, type SynthesisEvent as a8, type SynthesisRequest as a9, type AILLMFunctionsDeps as aA, type AIRelStore as aB, type AIRelStoreOptions as aC, type AIStoreProvider as aD, type AIVectorBackend as aE, type AIVectorStore as aF, type AskOptions as aG, type AssistantMessage as aH, type ChatCompletionChoice as aI, type ChatCompletionChunk as aJ, type ChatCompletionDelta as aK, type ChatCompletionRequest as aL, type ChatCompletionResponse as aM, type ChatHistoryOptions as aN, type ChatMessage as aO, type ChatRecord as aP, type Citation as aQ, type DefineToolOptions as aR, type DeveloperMessage as aS, type EntityDocumentRelation as aT, type EntityDocumentResult as aU, type EntityListOptions as aV, type EntityQueryOptions as aW, type GenerateObjectRequest as aX, type ImageContent as aY, type KnowledgeAskOptions as aZ, type KnowledgeAskResult as a_, type SynthesisResult as aa, type SynthesisStreamRequest as ab, type SynthesisTextSegment as ac, type TokenConfig as ad, TokenConfigSchema as ae, type TranscriptionEvent as af, type TranscriptionRequest as ag, type TranscriptionResult as ah, type TranscriptionStreamRequest as ai, resolveAudioModel as aj, resolveImageModel as ak, resolveModelApi as al, resolveModelEntry as am, type InteractionScope as an, type A2AAgentCardConfig as ao, type A2AApiKeySecurity as ap, type A2AAuthenticator as aq, type A2ACallOptions as ar, type A2ACallResult as as, type A2ACallerIdentity as at, type A2AContextInfo as au, type A2AHandleResult as av, type A2AMessageRecord as aw, type A2AOperations as ax, type A2ASecurityConfig as ay, type A2ATaskFilter as az, A2ASkillConfigSchema as b, type TextContent as b$, type KnowledgeDocumentListOptions as b0, type KnowledgeDocumentRemoveOptions as b1, type KnowledgeEntity as b2, type KnowledgeIngestBatchProgress as b3, type KnowledgeIngestBatchResult as b4, type KnowledgeIngestFileInput as b5, type KnowledgeIngestInput as b6, type KnowledgeIngestResult as b7, type KnowledgeOperations as b8, type KnowledgeRetrieveItem as b9, type RagResult as bA, type RagStreamEvent as bB, type ReasoningOperations as bC, type ReasoningOptions as bD, type ReasoningResult as bE, type ReasoningStep as bF, type ReasoningStepType as bG, type ReasoningStrategy as bH, type ReasoningStreamEvent as bI, type RetrievalOperations as bJ, type RetrievalRequest as bK, type RetrievalResult as bL, type RetrievalResultItem as bM, type RetrievalSource as bN, type SSEDecoder as bO, type SSEEvent as bP, type ScopedMemoryBinding as bQ, type ScopedMemoryOperations as bR, type SessionInfo as bS, type StoreFilter as bT, type StorePage as bU, type StoreScope as bV, type StreamOperations as bW, type StreamProcessor as bX, type StreamResult as bY, type SystemMessage as bZ, type TempModelConfig as b_, type KnowledgeRetrieveOptions as ba, type KnowledgeRetrieveResult as bb, type KnowledgeSetupOptions as bc, type KnowledgeStore as bd, type LLMOperations as be, type LLMProvider as bf, type MemoryAccessScope as bg, type MemoryAdminOperations as bh, type MemoryClearAllOptions as bi, type MemoryClearOptions as bj, type MemoryCoreOperations as bk, type MemoryEntry as bl, type MemoryEntryInput as bm, type MemoryExtractOptions as bn, type MemoryInjectionOptions as bo, type MemoryListOptions as bp, type MemoryListPageOptions as bq, type MemoryOperations as br, type MemoryRecallOptions as bs, type MemoryUpdateInput as bt, type MessageContent as bu, type MessageRole as bv, type ObjectRef as bw, type RagContextItem as bx, type RagOperations as by, type RagOptions as bz, type AIConfig as c, type TokenUsage as c0, type Tool as c1, type ToolAuthorizationRequest as c2, type ToolAuthorizer as c3, type ToolCall as c4, type ToolDefinition as c5, type ToolErrorType as c6, type ToolExecutionContext as c7, type ToolExecutionOptions as c8, type ToolMessage as c9, type ToolRegistryOperations as ca, type ToolRegistryOptions as cb, type ToolsOperations as cc, type UserMessage as cd, type WhereClause as ce, type WhereOperator as cf, type WhereValue as cg, type AIConfigInput as d, AIConfigSchema as e, type ApiType as f, ApiTypeSchema as g, type AudioCapabilitiesRequest as h, type AudioConfig as i, AudioConfigSchema as j, type AudioContent as k, type AudioFormat as l, type AudioInputStream as m, type AudioModelCapabilities as n, type AudioModelEntry as o, AudioModelEntrySchema as p, type AudioOperations as q, type AudioProviderName as r, AudioProviderSchema as s, CompressConfigSchema as t, EmbeddingConfigSchema as u, type EntityType as v, EntityTypeSchema as w, FileConfigSchema as x, ImageConfigSchema as y, type ImageModelEntry as z };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as A2AConfig, a as A2AConfigSchema, b as A2ASkillConfigSchema, c as AIConfig, d as AIConfigInput, e as AIConfigSchema, f as ApiType, g as ApiTypeSchema, h as AudioCapabilitiesRequest, i as AudioConfig, j as AudioConfigSchema, k as AudioContent, l as AudioFormat, m as AudioInputStream, n as AudioModelCapabilities, o as AudioModelEntry, p as AudioModelEntrySchema, q as AudioOperations, r as AudioProviderName, s as AudioProviderSchema, C as CompressConfig, t as CompressConfigSchema, E as EmbeddingConfig, u as EmbeddingConfigSchema, v as EntityType, w as EntityTypeSchema, F as FileConfig, x as FileConfigSchema, K as KnowledgeConfig,
|
|
2
|
-
export { A as AIFunctions, a as AIInitOptions, b as AUDIO_WS_PATH, c as AudioFormatSchema, d as AudioWsClientMessage, e as AudioWsClientMessageSchema, f as AudioWsDoneMessage, g as AudioWsDoneMessageSchema, h as AudioWsEndMessage, i as AudioWsErrorMessage, j as AudioWsSegmentDoneMessage, k as AudioWsSegmentStartedMessage, l as AudioWsServerMessage, m as AudioWsSpeechMessage, n as AudioWsStartMessage, o as AudioWsStartMessageSchema, p as AudioWsTextMessage, q as AudioWsTextMessageSchema, r as AudioWsTranscriptMessage, C as CompressionStrategy, s as CompressionStrategySchema, H as HaiAIError } from './ai-audio-ws-protocol-
|
|
1
|
+
export { A as A2AConfig, a as A2AConfigSchema, b as A2ASkillConfigSchema, c as AIConfig, d as AIConfigInput, e as AIConfigSchema, f as ApiType, g as ApiTypeSchema, h as AudioCapabilitiesRequest, i as AudioConfig, j as AudioConfigSchema, k as AudioContent, l as AudioFormat, m as AudioInputStream, n as AudioModelCapabilities, o as AudioModelEntry, p as AudioModelEntrySchema, q as AudioOperations, r as AudioProviderName, s as AudioProviderSchema, C as CompressConfig, t as CompressConfigSchema, E as EmbeddingConfig, u as EmbeddingConfigSchema, v as EntityType, w as EntityTypeSchema, F as FileConfig, x as FileConfigSchema, I as ImageConfig, y as ImageConfigSchema, z as ImageModelEntry, B as ImageModelEntrySchema, D as ImageProviderName, G as ImageProviderSchema, K as KnowledgeConfig, H as KnowledgeConfigSchema, L as LLMConfig, J as LLMConfigSchema, M as MCPConfig, N as MCPConfigSchema, O as MCPServerCapabilities, P as MCPServerCapabilitiesSchema, Q as MCPServerConfig, R as MCPServerConfigSchema, S as MemoryConfig, T as MemoryConfigSchema, U as MemoryType, V as MemoryTypeSchema, W as ModelEntry, X as ModelEntrySchema, Y as ModelScenario, Z as ModelScenarioSchema, _ as ResolveRequiredModelEntryOptions, $ as ResolvedAudioModel, a0 as ResolvedImageModel, a1 as ResolvedModelConfig, a2 as RetrievalConfig, a3 as RetrievalConfigSchema, a4 as RetrievalSourceConfig, a5 as RetrievalSourceSchema, a6 as SummaryConfig, a7 as SummaryConfigSchema, a8 as SynthesisEvent, a9 as SynthesisRequest, aa as SynthesisResult, ab as SynthesisStreamRequest, ac as SynthesisTextSegment, ad as TokenConfig, ae as TokenConfigSchema, af as TranscriptionEvent, ag as TranscriptionRequest, ah as TranscriptionResult, ai as TranscriptionStreamRequest, aj as resolveAudioModel, ak as resolveImageModel, al as resolveModelApi, am as resolveModelEntry } from './ai-reasoning-types-CiIOPCQw.js';
|
|
2
|
+
export { A as AIFunctions, a as AIInitOptions, b as AUDIO_WS_PATH, c as AudioFormatSchema, d as AudioWsClientMessage, e as AudioWsClientMessageSchema, f as AudioWsDoneMessage, g as AudioWsDoneMessageSchema, h as AudioWsEndMessage, i as AudioWsErrorMessage, j as AudioWsSegmentDoneMessage, k as AudioWsSegmentStartedMessage, l as AudioWsServerMessage, m as AudioWsSpeechMessage, n as AudioWsStartMessage, o as AudioWsStartMessageSchema, p as AudioWsTextMessage, q as AudioWsTextMessageSchema, r as AudioWsTranscriptMessage, C as CompressionStrategy, s as CompressionStrategySchema, G as GenerateImageRequest, t as GenerateImageResult, u as GeneratedImage, H as HaiAIError, I as ImageOperations, v as ImageSize, R as ReferenceImage } from './ai-audio-ws-protocol-DrFmoxAc.js';
|
|
3
3
|
export { A2AClientOperations, AIApiAdapter, AIClient, AIClientConfig, AudioClientConfig, AudioClientOperations, AudioTicketRequest, StreamOptions, StreamProgress, collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE } from './client/index.js';
|
|
4
4
|
import '@a2a-js/sdk/server';
|
|
5
5
|
import '@h-ai/core';
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A2AConfigSchema, A2ASkillConfigSchema, AIConfigSchema, AUDIO_WS_PATH, ApiTypeSchema, AudioConfigSchema, AudioFormatSchema, AudioModelEntrySchema, AudioProviderSchema, AudioWsClientMessageSchema, AudioWsDoneMessageSchema, AudioWsStartMessageSchema, AudioWsTextMessageSchema, CompressConfigSchema, CompressionStrategySchema, EmbeddingConfigSchema, EntityTypeSchema, FileConfigSchema, KnowledgeConfigSchema, LLMConfigSchema, MCPConfigSchema, MCPServerCapabilitiesSchema, MCPServerConfigSchema, MemoryConfigSchema, MemoryTypeSchema, ModelEntrySchema, ModelScenarioSchema, RetrievalConfigSchema, RetrievalSourceSchema, SummaryConfigSchema, TokenConfigSchema, resolveAudioModel, resolveModelApi, resolveModelEntry } from './chunk-
|
|
2
|
-
export { collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE } from './chunk-
|
|
3
|
-
export { HaiAIError } from './chunk-
|
|
1
|
+
export { A2AConfigSchema, A2ASkillConfigSchema, AIConfigSchema, AUDIO_WS_PATH, ApiTypeSchema, AudioConfigSchema, AudioFormatSchema, AudioModelEntrySchema, AudioProviderSchema, AudioWsClientMessageSchema, AudioWsDoneMessageSchema, AudioWsStartMessageSchema, AudioWsTextMessageSchema, CompressConfigSchema, CompressionStrategySchema, EmbeddingConfigSchema, EntityTypeSchema, FileConfigSchema, ImageConfigSchema, ImageModelEntrySchema, ImageProviderSchema, KnowledgeConfigSchema, LLMConfigSchema, MCPConfigSchema, MCPServerCapabilitiesSchema, MCPServerConfigSchema, MemoryConfigSchema, MemoryTypeSchema, ModelEntrySchema, ModelScenarioSchema, RetrievalConfigSchema, RetrievalSourceSchema, SummaryConfigSchema, TokenConfigSchema, resolveAudioModel, resolveImageModel, resolveModelApi, resolveModelEntry } from './chunk-GKFOJPSQ.js';
|
|
2
|
+
export { collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE } from './chunk-6RWS5OWJ.js';
|
|
3
|
+
export { HaiAIError } from './chunk-JC7QBT3C.js';
|
|
4
4
|
//# sourceMappingURL=browser.js.map
|
|
5
5
|
//# sourceMappingURL=browser.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HaiAIError } from './chunk-
|
|
1
|
+
import { HaiAIError } from './chunk-JC7QBT3C.js';
|
|
2
2
|
|
|
3
3
|
// src/client/ai-a2a-client.ts
|
|
4
4
|
var A2A_PATH = {
|
|
@@ -574,5 +574,5 @@ async function collectStreamContent(stream) {
|
|
|
574
574
|
}
|
|
575
575
|
|
|
576
576
|
export { collectStreamContent, createA2AClient, createAIClient, createAudioClient, createUnconfiguredAudioClient, parseSSE };
|
|
577
|
-
//# sourceMappingURL=chunk-
|
|
578
|
-
//# sourceMappingURL=chunk-
|
|
577
|
+
//# sourceMappingURL=chunk-6RWS5OWJ.js.map
|
|
578
|
+
//# sourceMappingURL=chunk-6RWS5OWJ.js.map
|