@flowingspring/dsh-voco 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/bundle/voice-app/README.md
5
+ README.md: 552f06d2b0684bc0e6a8c7279d7f17051f58862c
6
+ README.zh.md: e9c15081c447823ddb5996f052a8587a9dea2cb8
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # `@flowingspring/dsh-voco`
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ Browser PCM uses lightweight local silence detection and is uploaded as WAV to SiliconFlow after 1.5 seconds of silence.
6
+
7
+ The `dsh-voco` patch-layer bundle attaches provider transport directly to the current source Session and restores recent conversation from durable `voice/utterance-end` events. A lightweight frontend model answers ordinary conversation directly and delegates only tool-requiring work. Delegations from one source Session continuously reuse one ordinary task Agent Session. `voice/agent-binding-state` persists the Voice conversation, background Agent, workspace, last task, last-used time, and status; restart recovery prefers that complete record while remaining compatible with `voice/task-session-bound`. Full results and progress remain in the task UI, while an independent model rewrites the final result and user-actionable questions or warnings against the original request. Progress updates stay in the folded task trace and do not create extra Voice-window messages or TTS requests. The background Agent cannot directly specify spoken text. Root-owned audio continues across navigation, and the browser history index exposes saved Voice Sessions in the sidebar.
8
+
9
+ ## Model Experience
10
+
11
+ ### Voice profile composition
12
+
13
+ #### What the model sees
14
+
15
+ Voice-initiated work reaches the source Session's fixed background task Agent only as an accepted `realtime_delegation` envelope and exact-id updates. That task Agent alone receives the scoped `send_voice_message` backend tool for structured `progress | result | warning | error | question` events; the bridge creates or resumes the exact target directly, so no project-listing tool is added. The local provider owns speech input and output while the bridge exposes only task orchestration tools.
16
+
17
+ #### Token effect
18
+
19
+ The lightweight frontend route consumes one model call per new utterance. Delegated work additionally consumes task-model tokens for execution, backend reporting, and auxiliary event rewrites; local VAD, ASR, and TTS add no per-minute voice API charge.
20
+
21
+ #### KV Cache effect
22
+
23
+ Only accepted commands extend the continuously reused task Agent history. Durable binding state restores that exact Agent Session after restart, while recent Voice Session utterances restore the local conversation.
24
+
25
+ ## Known Limitations and Deferred Work
26
+
27
+ - The shipped provider is local CPU speech; the service seam keeps model details out of the assistant consumer.
28
+ - Raw audio remains process-local; a fresh provider connection restores bounded context from durable completed utterance text.
29
+ - An active task is persisted as `interrupted` when the service stops. Recovery reports its last spoken progress without automatically replaying the task or any side-effecting command.
30
+ - The filtered Voice history index is browser-local; clearing site data does not delete the underlying Sessions.
31
+ - The browser client surface targets the dsh Web UI: it is emitted by the copied dsh client tsdown preset and loads through the dsh web runtime's `window.__ModuleLoader__` contract. The server-side packages are transport-agnostic, but the microphone/playback UI is not a standalone browser plugin.
package/README.zh.md ADDED
@@ -0,0 +1,31 @@
1
+ # `@flowingspring/dsh-voco`
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 浏览器 PCM 只在本地做轻量静音检测,连续静音三秒后以 WAV 上传硅基流动完成识别。
6
+
7
+ `dsh-voco` 的 `voice` profile patch-layer bundle。它把 provider transport 直接挂到当前来源 Session,并从持久化的 `voice/utterance-end` 事件恢复最近对话。轻量前台模型直接回答普通对话,只委派需要工具的工作。同一来源 Session 的委派持续复用并持久绑定一个普通 Task Agent Session;`voice/agent-binding-state` 保存语音会话、后台 Agent、工作区、最后任务、最近使用时间和状态,服务重启后优先从该记录恢复,并兼容旧的 `voice/task-session-bound`。完整结果和进度保留在任务界面;独立模型结合用户原话重写最终结果以及需要用户处理的问题或警告。进度只显示在折叠任务详情中,不会额外创建语音消息或 TTS 请求。后台 Agent 不能直接指定播报文本。root 持有的音频在跳转期间持续运行,浏览器历史索引从侧栏展示已保存的 Voice Session。
8
+
9
+ ## 模型体验
10
+
11
+ ### 语音 profile 组合
12
+
13
+ #### 模型看到什么
14
+
15
+ 语音发起的工作只以已接受的 `realtime_delegation` 信封与准确 id 更新到达来源 Session 所绑定的固定后台 Task Agent。只有该 Task Agent 收到作用域内的 `send_voice_message` 后台工具,用于发送结构化的 `progress | result | warning | error | question` 事件;桥接层直接创建或恢复准确目标,因此不增加 project 列举工具。本地 provider 负责语音输入输出,桥接层只暴露任务编排工具。
16
+
17
+ #### Token 影响
18
+
19
+ 每个新的前台话语会消耗一次轻量模型路由调用。被委派的工作还会消耗任务执行、后台回报和辅助事件改写的模型 token;本地 VAD、ASR、TTS 不产生按分钟的语音 API 费用。
20
+
21
+ #### KV Cache 影响
22
+
23
+ 只有已接受的 command 扩展持续复用的 Task Agent 历史。持久绑定状态会在重启后恢复同一个 Agent Session;Voice Session 的最近话语用于恢复本地语音对话。
24
+
25
+ ## 已知限制与后续工作
26
+
27
+ - 随附的 provider 是本地 CPU 语音;service seam 保证 assistant consumer 不依赖模型细节。
28
+ - 原始音频仍限于当前进程;新的 provider 连接会从已完成的持久 utterance 文本恢复有界上下文。
29
+ - 服务停止时,活跃任务会持久标记为 `interrupted`。恢复时只告知最后一次已播报进度,不会自动重放任务或任何有副作用的命令。
30
+ - 筛选后的语音历史索引只属于当前浏览器;清除站点数据不会删除底层 Session。
31
+ - 浏览器客户端界面面向 dsh Web UI:它由复制而来的 dsh client tsdown 预设构建,并通过 dsh web 运行时的 `window.__ModuleLoader__` 契约加载。服务端包与传输无关,但麦克风/播放 UI 不是独立浏览器插件。
@@ -0,0 +1,43 @@
1
+ # Voice interaction mode layered after dsh-base and dsh-web-app.
2
+ - insert:
3
+ - id: llm-tool-call-compat
4
+ name: '@flowingspring/dsh-voco/llm-tool-call-compat'
5
+
6
+ - id: voice
7
+ name: '@flowingspring/dsh-voco/voice'
8
+ config:
9
+ provider: local
10
+
11
+ - id: voice-local
12
+ name: '@flowingspring/dsh-voco/voice-local'
13
+ config:
14
+ interactionMode: frontend-agent
15
+ inputSampleRate: 16000
16
+ outputSampleRate: 48000
17
+ ttsRate: '+20%'
18
+ silenceDurationMs: 1500
19
+ speechThreshold: 0.015
20
+ minSpeechDurationMs: 250
21
+ maxUtteranceMs: 60000
22
+
23
+ - id: voice-assistant
24
+ name: '@flowingspring/dsh-voco/voice-assistant'
25
+ config:
26
+ maxPendingObservations: 64
27
+ restoreConversation: true
28
+ maxRestoredUtterances: 24
29
+ taskSessionPolicy: continuous
30
+ completedAnnouncement: 任务已完成。
31
+ failedAnnouncement: 任务失败了,请查看屏幕上的错误信息。
32
+ cancelledAnnouncement: 任务已取消。
33
+ interruptedAnnouncement: 上次任务因服务关闭而中断,没有自动重放。你可以告诉我是否继续。
34
+
35
+ - id: voice-web
36
+ name: '@flowingspring/dsh-voco/voice-web'
37
+ inject: [webRuntime]
38
+ config:
39
+ trustedHosts: !!js ctx.webRuntime.trustedHosts
40
+ maxAudioFrameBytes: 65536
41
+
42
+ - id: ui-voice
43
+ name: '@flowingspring/dsh-voco'