dsh-tingdong 0.5.0 → 0.5.1

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
@@ -1,8 +1,26 @@
1
1
  # 听懂 · dsh-tingdong
2
2
 
3
- 把英文有声读物(MP3)变成听力课,练到**听到英文就知道是什么意思**。
3
+ [![npm version](https://img.shields.io/npm/v/dsh-tingdong.svg?style=flat-square)](https://www.npmjs.com/package/dsh-tingdong)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-tingdong.svg?style=flat-square)](https://www.npmjs.com/package/dsh-tingdong)
5
+ [![license](https://img.shields.io/npm/l/dsh-tingdong.svg?style=flat-square)](LICENSE)
6
+ [![Listed on dsh-plugin.org](https://dsh-plugin.org/badges/listed.svg)](https://dsh-plugin.org/plugins/aicivilization/dsh-tingdong)
7
+
8
+ 把英文有声读物(MP3)或英文文档变成听力课,练到**听到英文就知道是什么意思**。
4
9
  [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)插件,也能脱离 DSH 单独用。
5
10
 
11
+ ## 安装
12
+
13
+ ```bash
14
+ dsh plugin --profile desktop add dsh-tingdong # 装进 DSH(把 desktop 换成你的 profile 名,先完全退出 DSH)
15
+ npm i -g dsh-tingdong # 命令行版:不开 DSH 也能用
16
+ dsh plugin --profile desktop add github:AIcivilization/dsh-tingdong # 源码安装
17
+ ```
18
+
19
+ - **能力分类**:工具与能力(英语听力学习)
20
+ - **运行要求**:Node.js ≥ 20;DSH web / desktop profile;解码 MP3 需要 [ffmpeg](https://ffmpeg.org)(Mac:`brew install ffmpeg`)
21
+ - **许可证**:[MIT](LICENSE)
22
+ - **数据边界**:课程和学习进度都在本机 `~/.dsh/dsh-tingdong/`;识别用 DSH 自带语音输入模型(音频不上传);讲解和朗读用你在 DSH 里选的大模型;Edge 语音组件需联网(文字会发到微软服务器,详见下方导出说明)
23
+
6
24
  ## 它做什么
7
25
 
8
26
  首页有两个入口:**导入音频**(有声书、讲座、引导音频)和**导入文档**(文章、手册、书)。
@@ -70,7 +88,7 @@
70
88
  装进 DSH(把 `desktop` 换成你的 profile 名;先完全退出 DSH):
71
89
 
72
90
  ```bash
73
- dsh plugin --profile desktop add /path/to/dsh-go
91
+ dsh plugin --profile desktop add dsh-tingdong
74
92
  ```
75
93
 
76
94
  重新打开 DSH,在对话页打开右侧栏,选「听懂 · 英文听力」。设置里的「听懂」分区会显示 ffmpeg、识别模型、翻译模型是否就绪。
@@ -138,3 +156,14 @@ npm test
138
156
  - `lib/drill.js` 磨耳朵音频;`lib/lookup.js` 点词查意思、重新讲解;`lib/vps.js` 经 SSH 发送到 VPS
139
157
  - `plugin/` DSH 宿主端(路由、AI 工具)和界面入口(右侧栏、设置);路由先过 DSH 的 `connection.requestRejection()` 登录校验
140
158
  - `web/` 学习面板(原生 JS 模块,无构建):`panel.js` 路由和首页 · `study.js` 精听、复习、今日学习 · `listen.js` 连续听、磨耳朵、词汇 · `edit.js` 改句子、查词 · `core.js` 播放器和公共状态
159
+
160
+ ## 许可
161
+
162
+ [MIT](LICENSE) · Copyright © 2026 AIcivilization
163
+
164
+ ## 收录渠道
165
+
166
+ - [DSH Plugin Hub(dsh-plugin.org 社区插件市场)](https://dsh-plugin.org/plugins/aicivilization/dsh-tingdong)
167
+ - [awesome-dsh-plugin 精选列表](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
168
+ - dsh-plugin-shop 插件商店(每日自动收录)
169
+ - 52DSH / tuofangzhe 插件目录(证据分级收录)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tingdong",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "听懂:把英文有声读物(MP3)或英文文档变成听力课。本地识别 / AI 朗读每一句英文、AI 翻译讲解,再用盲听、精听、间隔复习把它练到「一听就懂」。DeepSeek Harness (dsh) 插件。",
5
5
  "keywords": [
6
6
  "dsh-plugin",
package/plugin/manage.js CHANGED
@@ -54,7 +54,8 @@ const ALREADY = '这个版本的 DSH 不能在运行中升级已装的插件。
54
54
  export function createManager(o) {
55
55
  let running = ''
56
56
  const readPkg = async () => { try { return JSON.parse(await readFile(join(o.pkgRoot, 'package.json'), 'utf8')) } catch { return {} } }
57
- readPkg().then(p => { running = p.version || '' })
57
+ // 初始包信息读取:info()/update() 开先 await 它,避免 running 还没读到就比版本
58
+ const pkgReady = readPkg().then(p => { running = p.version || '' })
58
59
 
59
60
  let cache = null
60
61
  async function latest(force) {
@@ -79,6 +80,7 @@ export function createManager(o) {
79
80
  return {
80
81
  /** 版本信息:正在运行的、磁盘上装好的、npm 上最新的 */
81
82
  async info(force) {
83
+ await pkgReady
82
84
  const [pkg, newest] = await Promise.all([readPkg(), latest(force)])
83
85
  const installed = pkg.version || ''
84
86
  const current = compareVersions(installed, running) > 0 ? installed : running
@@ -96,6 +98,7 @@ export function createManager(o) {
96
98
  }
97
99
  },
98
100
  async update() {
101
+ await pkgReady
99
102
  const newest = await latest(true)
100
103
  const cmd = command(`add ${PACKAGE}@${newest || 'latest'}`)
101
104
  if (!newest) return { ok: false, message: '查不到 npm 上的最新版本,检查网络后再试', command: cmd }