@somecat/ai-assist-sdk 1.2.2 → 1.2.4

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/dist/index.mjs CHANGED
@@ -1,47 +1,32 @@
1
- import { V as t, a as o, b as r, c as n, d as i, e as g, f as C, g as p, h as c, i as u, j as A, k as E, l as N, m as _, n as l, o as T, p as d, q as f, r as h, s as v, t as x, u as M, v as S, w as m, x as O, y as R, z as D, A as L, B as V, C as I, D as y } from "./chunks/engine-DxdqzC3A.mjs";
2
- const e = {
3
- /** 中文普通话,弱标点(逗号、句号) */
4
- CN_NORMAL_WEAK: 1537,
5
- /** 中文普通话,加强标点(逗号、句号、问号、感叹号)—— 推荐 */
6
- CN_NORMAL_STRONG: 15372,
7
- /** 中文多方言,弱标点(支持粤语、四川话、东北话) */
8
- CN_DIALECT: 15376,
9
- /** 英语,无标点 */
10
- EN_NORMAL_WEAK: 1737,
11
- /** 英语,加强标点(逗号、句号、问号) */
12
- EN_NORMAL_STRONG: 17372
13
- };
1
+ import { V as a, m as t, t as o, b as n, c as r, k as i, e as g, v as p, h as u, x as C, f as c, j as f, g as h, y as l, l as v, z as d, A as m, B as x, C as S, r as T, D as E, n as y, q as A, E as M, s as w, F as D, d as Q, u as b, w as k } from "./chunks/index-Bqxc2mD6.mjs";
14
2
  export {
15
- e as VOICE_DEV_PID,
16
- t as VoiceClient,
17
- o as VoiceEngine,
18
- r as VoiceRecorder,
19
- n as applyTheme,
20
- i as chatQuery,
21
- g as createAuthAxios,
22
- C as createConversation,
23
- p as deleteConversation,
24
- c as ensureTitleConversation,
25
- u as extractPlainText,
26
- A as formatQuestions,
27
- E as getAppConfig,
28
- N as getConfig,
29
- _ as getConversationList,
30
- l as getConversationMessages,
31
- T as getMessageInfo,
32
- d as getPersonalInfo,
33
- f as getSuggestedQuestions,
34
- h as http,
35
- v as parseSSEData,
36
- x as processSSEData,
37
- M as renderMarkdown,
38
- S as request,
39
- m as resolveTheme,
40
- O as setConfig,
41
- R as statusText,
42
- D as stopMessage,
43
- L as textError,
44
- V as updateConversation,
45
- I as useClipboard,
46
- y as watchSystemTheme
3
+ a as VoiceEngine,
4
+ t as applyTheme,
5
+ o as chatQuery,
6
+ n as createAuthAxios,
7
+ r as createConversation,
8
+ i as deleteConversation,
9
+ g as ensureTitleConversation,
10
+ p as extractPlainText,
11
+ u as formatQuestions,
12
+ C as getAppConfig,
13
+ c as getConfig,
14
+ f as getConversationList,
15
+ h as getConversationMessages,
16
+ l as getMessageInfo,
17
+ v as getPersonalInfo,
18
+ d as getSuggestedQuestions,
19
+ m as http,
20
+ x as parseSSEData,
21
+ S as processSSEData,
22
+ T as renderMarkdown,
23
+ E as request,
24
+ y as resolveTheme,
25
+ A as setConfig,
26
+ M as statusText,
27
+ w as stopMessage,
28
+ D as textError,
29
+ Q as updateConversation,
30
+ b as useClipboard,
31
+ k as watchSystemTheme
47
32
  };
@@ -1,15 +1,22 @@
1
1
  import { default as React } from 'react';
2
- import { VoiceConfig, VoiceStatus, VoiceResult, VoiceError } from '../../core/voice';
2
+ import { VoiceStatus, VoiceResult, VoiceError } from '../../core/voice';
3
+ import { AiAssistTheme } from '../../core/types';
3
4
  export interface VoiceInputProps {
4
- /** 百度实时语音识别配置 */
5
- config: VoiceConfig;
5
+ /** 识别语言(BCP-47),默认 'zh-CN' */
6
+ lang?: string;
7
+ /** 是否连续识别,默认 true */
8
+ continuous?: boolean;
9
+ /** 是否返回临时结果,默认 true */
10
+ interimResults?: boolean;
11
+ /** 主题模式 */
12
+ theme?: AiAssistTheme;
6
13
  /** 占位提示文案 */
7
14
  placeholder?: string;
8
15
  /** 按钮文案:开始录音 */
9
16
  startText?: string;
10
17
  /** 按钮文案:停止录音 */
11
18
  stopText?: string;
12
- /** 按钮文案:连接中 */
19
+ /** 按钮文案:启动中 */
13
20
  connectingText?: string;
14
21
  /** 按钮文案:识别中 */
15
22
  stoppingText?: string;
@@ -1,5 +1,9 @@
1
- /** 智能体/工具调用状态条 */
1
+ /** 智能体/工具调用状态条(集中固定一处,仅提示状态) */
2
2
  declare const AgentThoughtBlock: React.FC<{
3
3
  isDone?: boolean;
4
+ /** 已完成的工具调用次数 */
5
+ count?: number;
6
+ /** 工具调用总耗时(秒) */
7
+ duration?: number;
4
8
  }>;
5
9
  export default AgentThoughtBlock;
@@ -1,13 +1,19 @@
1
1
  /**
2
2
  * 深度思考区块 — 可折叠展示深度思考内容
3
3
  *
4
- * 流式输出时带逐字打字机效果(RAF 驱动,与 StreamingMarkdown 同模型):
5
- * - 基准速率 CPS_BASE,积压越多速率越快(不设上限,适配大批量 SSE)
6
- * - 跨帧小数累加器保证低速率下均匀推进
7
- * - isStreaming 结束时自动 flush 全量内容
4
+ * 打字机输出规则(RAF 驱动,恒定速率 CPS):
5
+ * - 恒定速率逐字输出,不随积压量加速。后端 SSE 中转会把大量 think_message 合并成
6
+ * 一帧批量写入,组件挂载时 content 往往已是全量 —— 因此流式中挂载必须从第 0 个
7
+ * 字符开始重放,否则会整段闪现。
8
+ * - 只有整条消息结束(messageDone=true,即 COMPLETED/STOP)才 flush 全量补齐。
9
+ * 单个思考段结束(isStreaming=false)不 flush,仅自动收起;若该段后续仍被追加
10
+ * 内容,继续按固定节奏慢慢输出。
11
+ * - 流式中 content 被替换且变短(重新生成等)→ 从头重放。
8
12
  */
9
13
  declare const ThinkingBlock: React.FC<{
10
14
  content: string;
11
15
  isStreaming?: boolean;
16
+ /** 整条消息是否已结束(COMPLETED/STOP),结束才允许全量补齐 */
17
+ messageDone?: boolean;
12
18
  }>;
13
19
  export default ThinkingBlock;