Repository navigation
DSSH v1.1 — 语音问 AI(L+START)
v1.0 把语音输入做完了;v1.1 加了一条与 SSH 平行的语音 AI 问答通道——按住 L+START 说一句问题,底屏弹出问答 modal,DeepSeek 答案直接出现,不打扰顶屏正在跑的 yazi / vim / tmux / claude-code。
🎤 → 🤖 Voice AI ask(v1.1 新增)
[L + START] 录音 32 秒上限
│
▼ 16 kHz PCM → 服务器 shim --ask
[Whisper Turbo] 转写
│
▼ 转出来的中文 → DeepSeek-Chat(带 history)
[DeepSeek] 回答(6-15 句,markdown)
│
▼ JSON 返回 3DS
[底屏 modal 0.5s 淡入]
│
├─ A 关闭 + 保留 history(追问)
└─ B / 触屏 关闭 + 清空 history(新对话)
用户体验:
- 顶屏 SSH 完全不动——问 AI 不打断 yazi / vim 状态
- Markdown 渲染:
# 标题黄色、`code`青色、- 列表→• 列表、**bold**隐式 strip 不丢内容 - History 追问:A 关 modal 时保留当前 Q&A,下次 L+START 接续;B 重置开新对话;上限 5 轮 FIFO
- 录音上限从 8 秒升到 32 秒——多句话问题也塞得下
- 触发手势:L+START(区别于普通 START 的语音 IME)
服务器端配置——还是一条命令
需要两把 API key(OpenRouter + DeepSeek,均有免费额度):
git clone https://github.com/Fishason/DSSH.git ~/dssh-repo
bash ~/dssh-repo/tools/install_whisper_api.sh
# ↑ 交互式提示输入两把 key或者非交互式:
OPENROUTER_API_KEY="sk-or-v1-..." \
DEEPSEEK_API_KEY="sk-..." \
bash ~/dssh-repo/tools/install_whisper_api.sh| Key | 申请地址 | 用途 | 必需性 |
|---|---|---|---|
| OpenRouter | openrouter.ai/settings/keys | Whisper Turbo(语音→文字) | 必需 |
| DeepSeek | platform.deepseek.com/api_keys | DeepSeek-Chat(AI 回答) | L+START 必需,纯语音 IME 不需要 |
费用:Whisper Turbo `$0.04/音频小时` + DeepSeek `~$0.0001/次问答`,个人用月成本几美分。
详细安装文档见 README — 语音输入。
🛠 其它改动(自 v1.0)
- modal 渲染 z-order 修复:之前 `renderer_draw_text_px` 内部硬编码 z=0.5,比 modal bg z=0.51 低,文字被背景覆盖看不见。新增 `renderer_draw_text_px_z(x, y, z, text, rgba)` API 让 modal 用 z=0.62 画文字稳压 bg
- Aux channel drain loop:voice.c phase 2 改成单帧内 drain 完所有 readable bytes 再判 EOF,避免分包到达时 EOF 早判导致 JSON 截断
- shim --ask 模式:每条 error path 都走兜底 JSON 输出,3DS 永不收到完全空 reply
- 诊断日志:`/tmp/dssh-ai-debug.log` 记录每次 L+START 的 PCM 长度 / 转写文本 / DeepSeek 回答 / 输出 JSON,调试一目了然
📦 安装
| 想要的 | 下载 |
|---|---|
| Homebrew Launcher 启动 | `3dssh.3dsx` |
| HOME 菜单图标启动(推荐) | `DSSH.cia` |
| v1.0 拼音 IME 演示视频(v1.1 兼容) | `demo.mp4` |
🔄 从 v1.0 升级
3DS 端:直接用新 `.cia` 覆盖。
服务器端:
```bash
cd ~/dssh-repo && git pull
bash tools/install_whisper_api.sh
已有 OpenRouter key 不会再问;新提示输入 DeepSeek key
```
旧的纯语音 IME 仍然可用,只是 L+START 多了一个 AI 问答路径。如果不想用,跳过 DeepSeek key 就行——L+START 会优雅 fail(modal 显示 "no API key" 错误)。
🐛 已知边界
- modal 答案区约 14 行 × 50 字符;超长答案末尾自动 `...` 截断
- `bold` 在 6×12 像素字体下没法做加粗效果——syntax 隐去、内容仍显示,但没有视觉强调