deep-read-summarize 0.3.15 → 0.3.16
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/CHANGELOG.md +41 -0
- package/README.en.md +28 -0
- package/README.md +28 -0
- package/cordis.patch.yml +3 -0
- package/docs/RELEASE.md +2 -1
- package/index.js +4 -2
- package/lib/workflow-script.txt +40 -12
- package/package.json +1 -1
- package/skills/deep-read-summarize/SKILL.md +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,47 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
5
5
|
|
|
6
|
+
## [0.3.16] — 2026-10-19
|
|
7
|
+
|
|
8
|
+
新增 `options.frontmatter` 三档,解决 frontmatter 在 Hugo 里的语义冲突。**默认档与历史行为逐字一致**,不构成破坏性变更。
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`options.frontmatter`:`obsidian`(默认)/ `generic` / `minimal`**。
|
|
13
|
+
- `obsidian`:`title` / `aliases` / `author` / `year` / `type` / `url` / `tags` / `created` / `status` —— 与 0.3.15 及更早逐字一致,现有 Dataview 查询不受影响。
|
|
14
|
+
- `generic`:把 Hugo 的保留键换掉 —— `type` → `docType`、`url` → `sourceUrl`、`created` → `date`,并去掉 `aliases`。
|
|
15
|
+
- `minimal`:只留 `title` / `date` / `sourceUrl` / `tags`。
|
|
16
|
+
- 非法值 → **FATAL 终止**(与 `type` 的失败纪律一致,不静默降级)。
|
|
17
|
+
|
|
18
|
+
### Why
|
|
19
|
+
|
|
20
|
+
`type`、`aliases`、`url` 在 Hugo 里都是保留键,语义与 Obsidian 完全不同 —— 把笔记直接丢进 Hugo 会**改变渲染行为**,而不是多出几个无害字段:
|
|
21
|
+
|
|
22
|
+
| 键 | Hugo 里的含义 |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `type` | 内容类型,决定用哪套 layout(`type: video` 会让它去找 `layouts/video/`) |
|
|
25
|
+
| `aliases` | 一组会重定向到本页的旧 URL |
|
|
26
|
+
| `url` | 覆盖页面自身的路径 —— 来源链接会变成文章永久链接 |
|
|
27
|
+
| `created` | 不是 Hugo/Jekyll 的键;`date` 才是 |
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- `index.js` 白名单补 `frontmatter`;`cordis.patch.yml` / `SKILL.md` / README ×2 同步说明。
|
|
32
|
+
- 修 `screenshots.json`:4 个路径由相对路径改成**绝对 `raw.githubusercontent.com` URL** —— 市场客户端的截图白名单只接受 GitHub 图床的绝对 https 地址,相对路径会被静默丢弃。该文件**不随 npm 包发布**:截图来自 registry(GitHub 侧索引),不是 npm 包。
|
|
33
|
+
|
|
34
|
+
### Added(测试)
|
|
35
|
+
|
|
36
|
+
- 4 条回归测试(`node:test` 48 → 52):默认档保留全部 9 个键;`generic` 必须去掉 `aliases` / `type` / `url` / `created` 并改用 `docType` / `sourceUrl` / `date`;`minimal` 恰好 4 个键;非法档位必须报错而不是静默忽略。
|
|
37
|
+
|
|
38
|
+
### Compatibility
|
|
39
|
+
|
|
40
|
+
- **无破坏性变更**:不传 `frontmatter` 时产物与 0.3.15 逐字相同。
|
|
41
|
+
|
|
42
|
+
### 升级提醒
|
|
43
|
+
|
|
44
|
+
- 想直接放进 Hugo / Jekyll 又不改渲染行为:设 `options.frontmatter: "generic"`。
|
|
45
|
+
- 已生成的笔记不受影响,新选项只作用于之后的生成。
|
|
46
|
+
|
|
6
47
|
## [0.3.15] — 2026-10-18
|
|
7
48
|
|
|
8
49
|
这一版动的是**工程卫生**,外加一处提示词措辞。运行时只有一处可感知变化(提示词不再绑定 Obsidian),见「升级提醒」。
|
package/README.en.md
CHANGED
|
@@ -196,6 +196,7 @@ Pass this JSON to DSH's workflow tool:
|
|
|
196
196
|
"language": "zh", // video ASR language: use "en" for English-only videos
|
|
197
197
|
"device": "cpu", // ASR device: cpu (default) | auto | cuda; auto/cuda needs a CUDA runtime and falls back to cpu
|
|
198
198
|
"maxRetries": 0, // quality-check retries (default 0 = no retry; retrying is noticeably slower)
|
|
199
|
+
"frontmatter": "obsidian", // key set: obsidian (default, for Dataview) | generic (drops the keys Hugo reserves) | minimal
|
|
199
200
|
"requireCitations": true, // whether key conclusions must carry citations
|
|
200
201
|
"includeTimestamps": false,
|
|
201
202
|
"outputDir": "./output", // note output directory (can point at your Obsidian vault or a static-site content folder)
|
|
@@ -215,6 +216,33 @@ Examples:
|
|
|
215
216
|
|
|
216
217
|
Notes are written to `options.outputDir` (default `./output`, can point at your Obsidian vault or a static-site content folder), with the filename taken from the content title.
|
|
217
218
|
|
|
219
|
+
### Frontmatter profiles (`options.frontmatter`)
|
|
220
|
+
|
|
221
|
+
The default is `obsidian`, byte-for-byte what earlier versions produced. Profiles exist because `type`, `aliases` and `url` are **reserved keys in Hugo** with different meanings -- dropping an Obsidian note into Hugo changes how the page renders, rather than adding a few harmless fields.
|
|
222
|
+
|
|
223
|
+
| Key | `obsidian` (default) | `generic` | `minimal` |
|
|
224
|
+
|---|---|---|---|
|
|
225
|
+
| `title` | yes | yes | yes |
|
|
226
|
+
| `aliases` | yes | -- | -- |
|
|
227
|
+
| `author` / `year` | yes | yes | -- |
|
|
228
|
+
| `type` | yes | -- | -- |
|
|
229
|
+
| `docType` | -- | yes | -- |
|
|
230
|
+
| `url` | yes | -- | -- |
|
|
231
|
+
| `sourceUrl` | -- | yes | yes |
|
|
232
|
+
| `tags` | yes | yes | yes |
|
|
233
|
+
| `created` | yes | -- | -- |
|
|
234
|
+
| `date` | -- | yes | yes |
|
|
235
|
+
| `status` | yes | yes | -- |
|
|
236
|
+
|
|
237
|
+
Why `generic` renames things:
|
|
238
|
+
|
|
239
|
+
- `type` in Hugo selects the **layout** (`type: video` makes it look for `layouts/video/`)
|
|
240
|
+
- `aliases` in Hugo is **a list of old URLs that redirect to this page**
|
|
241
|
+
- `url` in Hugo **overrides the page's own path** -- the source link would become the article's permalink
|
|
242
|
+
- `date` is the time key both Hugo and Jekyll understand; `created` is just a custom field
|
|
243
|
+
|
|
244
|
+
An unknown value is fatal rather than silently ignored, matching how `type` is handled.
|
|
245
|
+
|
|
218
246
|
### Video: full transcript (subtitles first, auto-transcription when none)
|
|
219
247
|
|
|
220
248
|
Video text extraction is a **unified pipeline** (the old "three tiers" are gone): the goal is to get the **full transcript**, then deep-read it.
|
package/README.md
CHANGED
|
@@ -195,6 +195,7 @@ parsers: book, paper, video, web
|
|
|
195
195
|
"language": "zh", // 视频转写语言:纯英文视频可设 "en"
|
|
196
196
|
"device": "cpu", // 转写设备:cpu(默认)| auto | cuda;auto/cuda 需自备 CUDA 运行库,失败自动回退 cpu
|
|
197
197
|
"maxRetries": 0, // 质量校验重试次数(默认 0 = 不重试,重试会明显变慢)
|
|
198
|
+
"frontmatter": "obsidian", // frontmatter 键集:obsidian(默认,配 Dataview)| generic(换掉 Hugo 保留键)| minimal
|
|
198
199
|
"requireCitations": true, // 关键结论是否必须标注出处
|
|
199
200
|
"includeTimestamps": false,
|
|
200
201
|
"outputDir": "./output", // 笔记输出目录(可指向 Obsidian 仓库或静态站点内容目录)
|
|
@@ -214,6 +215,33 @@ parsers: book, paper, video, web
|
|
|
214
215
|
|
|
215
216
|
笔记写到 `options.outputDir` 指定的目录(默认 `./output`,可指向你的 Obsidian 仓库或静态站点内容目录),文件名取自内容标题。
|
|
216
217
|
|
|
218
|
+
### frontmatter 三档(`options.frontmatter`)
|
|
219
|
+
|
|
220
|
+
默认 `obsidian`,与历史版本**逐字一致**。之所以要分档:`type`、`aliases`、`url` 在 Hugo 里是**保留键**,语义和 Obsidian 完全不同——直接丢进 Hugo 会改变渲染行为,而不是多几个无害字段。
|
|
221
|
+
|
|
222
|
+
| 键 | `obsidian`(默认) | `generic` | `minimal` |
|
|
223
|
+
|---|---|---|---|
|
|
224
|
+
| `title` | ✓ | ✓ | ✓ |
|
|
225
|
+
| `aliases` | ✓ | — | — |
|
|
226
|
+
| `author` / `year` | ✓ | ✓ | — |
|
|
227
|
+
| `type` | ✓ | — | — |
|
|
228
|
+
| `docType` | — | ✓ | — |
|
|
229
|
+
| `url` | ✓ | — | — |
|
|
230
|
+
| `sourceUrl` | — | ✓ | ✓ |
|
|
231
|
+
| `tags` | ✓ | ✓ | ✓ |
|
|
232
|
+
| `created` | ✓ | — | — |
|
|
233
|
+
| `date` | — | ✓ | ✓ |
|
|
234
|
+
| `status` | ✓ | ✓ | — |
|
|
235
|
+
|
|
236
|
+
为什么 `generic` 要换键:
|
|
237
|
+
|
|
238
|
+
- `type` 在 Hugo 里决定**用哪套 layout**(`type: video` 会让它去找 `layouts/video/`)
|
|
239
|
+
- `aliases` 在 Hugo 里是**一组会重定向到本页的旧 URL**
|
|
240
|
+
- `url` 在 Hugo 里会**覆盖页面自身的路径**——来源链接会变成文章的永久链接
|
|
241
|
+
- `date` 才是 Hugo/Jekyll 都认的时间键;`created` 只是自定义字段
|
|
242
|
+
|
|
243
|
+
非法值直接 FATAL 终止(与 `type` 的失败纪律一致,不静默降级)。
|
|
244
|
+
|
|
217
245
|
### 视频:完整逐字稿(字幕优先,无字幕自动转写)
|
|
218
246
|
|
|
219
247
|
视频取文本是**统一流水线**(已去掉「三档」):目标 = 拿到**完整逐字稿**再精读。
|
package/cordis.patch.yml
CHANGED
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
# language: 'zh' # transcription language (default: zh)
|
|
27
27
|
# device: 'cpu' # cpu | auto | cuda; GPU needs a CUDA runtime (default: cpu)
|
|
28
28
|
# maxRetries: 0 # quality-check retry rounds (default: 0)
|
|
29
|
+
# frontmatter: 'obsidian' # obsidian | generic | minimal (default: obsidian)
|
|
30
|
+
# # generic swaps the keys Hugo reserves: type -> docType,
|
|
31
|
+
# # url -> sourceUrl, created -> date; minimal keeps four keys
|
|
29
32
|
#
|
|
30
33
|
# Idempotency is deliberately NOT a plugin config key: the workflow script runs
|
|
31
34
|
# without a filesystem, so it cannot write a fingerprint record. Programmatic
|
package/docs/RELEASE.md
CHANGED
|
@@ -116,7 +116,8 @@ npm view deep-read-summarize --prefer-online # 验证线
|
|
|
116
116
|
| v0.3.12 | npm 已发布 | 文档:定位改为「标准 Markdown」;删 dsh.so 一节;macOS 真机验证转写通过 |
|
|
117
117
|
| v0.3.13 | npm 已发布 | 声明:补 `engines.dsh`(此前的 `dsh.minVersion` 非公开字段,市场不读,判定一直是 `undeclared`) |
|
|
118
118
|
| v0.3.14 | npm 已发布 | 修:路径尾分隔符、本地日期、config 白名单;README 测试数 |
|
|
119
|
-
|
|
|
119
|
+
| v0.3.15 | npm 已发布 | 工程卫生:锁定 LF、脚本正文独立成文、lint 扩检查、包瘦身、提示词改「标准 Markdown」 |
|
|
120
|
+
| **v0.3.16** | **npm 已发布(当前)** | 新增 `options.frontmatter` 三档(obsidian / generic / minimal),解决 Hugo 保留键冲突;默认档不变 |
|
|
120
121
|
| v1.0.0 | 计划 | API 稳定后发布 |
|
|
121
122
|
|
|
122
123
|
> 早期迭代用 0.x 表达不稳定;API 稳定后再发 1.0.0。
|
package/index.js
CHANGED
|
@@ -37,7 +37,8 @@ const DEFAULT_OPTIONS = {
|
|
|
37
37
|
whisperModel: 'small',
|
|
38
38
|
language: 'zh',
|
|
39
39
|
device: 'cpu',
|
|
40
|
-
maxRetries: 0
|
|
40
|
+
maxRetries: 0,
|
|
41
|
+
frontmatter: 'obsidian'
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
const OPTION_TYPES = {
|
|
@@ -52,7 +53,8 @@ const OPTION_TYPES = {
|
|
|
52
53
|
whisperModel: 'string',
|
|
53
54
|
language: 'string',
|
|
54
55
|
device: 'string',
|
|
55
|
-
maxRetries: 'number'
|
|
56
|
+
maxRetries: 'number',
|
|
57
|
+
frontmatter: 'string'
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
/**
|
package/lib/workflow-script.txt
CHANGED
|
@@ -22,6 +22,14 @@ const tempFile = tempDir.replace(/[\\/]+$/, "") + "/input.txt";
|
|
|
22
22
|
const whisperModel = options.whisperModel || "small";
|
|
23
23
|
const transcribeLanguage = options.language || "zh";
|
|
24
24
|
const transcribeDevice = options.device || "cpu";
|
|
25
|
+
// frontmatter 档位。默认 obsidian = 历史行为,逐字不变(现有用户的 Dataview 查询依赖 type / status)。
|
|
26
|
+
// generic 档换掉三个「Hugo 保留键」:type -> docType、url -> sourceUrl、created -> date(date 才是标准键);
|
|
27
|
+
// minimal 档只留 title / date / sourceUrl / tags。
|
|
28
|
+
const FM_PROFILES = ["obsidian", "generic", "minimal"];
|
|
29
|
+
const fmProfile = String(options.frontmatter || "obsidian").toLowerCase();
|
|
30
|
+
if (FM_PROFILES.indexOf(fmProfile) === -1) {
|
|
31
|
+
throw new Error("[FATAL] options.frontmatter 非法:" + options.frontmatter + "(可用:" + FM_PROFILES.join("|") + ")");
|
|
32
|
+
}
|
|
25
33
|
|
|
26
34
|
// 幂等不在这里做:脚本沙箱没有文件系统,写不了指纹记录。
|
|
27
35
|
// 需要幂等的调用方请用 lib/cache.js(fingerprint / hasProcessed / markProcessed)。
|
|
@@ -144,26 +152,46 @@ const extraSections = fastMode ? [] : [
|
|
|
144
152
|
"## 7. 延伸阅读(相关主题/作者其他作品/参考文献)", ""
|
|
145
153
|
];
|
|
146
154
|
|
|
155
|
+
// frontmatter 按档位组装。obsidian 档与历史版本逐字一致,不动既有用户的 Dataview 查询。
|
|
156
|
+
const fm = ["---"];
|
|
157
|
+
if (fmProfile === "obsidian") {
|
|
158
|
+
fm.push('title: ' + yamlStr("《" + finalTitle + "》深度精读笔记"));
|
|
159
|
+
fm.push("aliases: [" + yamlStr(finalTitle) + "]");
|
|
160
|
+
fm.push("author: " + yamlStr(metadata.author));
|
|
161
|
+
fm.push("year: " + yamlStr(metadata.year));
|
|
162
|
+
fm.push("type: " + yamlStr(kind));
|
|
163
|
+
fm.push("url: " + yamlStr(metadata.url || input));
|
|
164
|
+
fm.push("tags: [精读, " + (kindNames[kind] || kind) + "]");
|
|
165
|
+
fm.push("created: " + today);
|
|
166
|
+
fm.push("status: 已完成");
|
|
167
|
+
} else if (fmProfile === "generic") {
|
|
168
|
+
fm.push('title: ' + yamlStr("《" + finalTitle + "》深度精读笔记"));
|
|
169
|
+
fm.push("date: " + today);
|
|
170
|
+
fm.push("author: " + yamlStr(metadata.author));
|
|
171
|
+
fm.push("year: " + yamlStr(metadata.year));
|
|
172
|
+
fm.push("docType: " + yamlStr(kind));
|
|
173
|
+
fm.push("sourceUrl: " + yamlStr(metadata.url || input));
|
|
174
|
+
fm.push("tags: [精读, " + (kindNames[kind] || kind) + "]");
|
|
175
|
+
fm.push("status: 已完成");
|
|
176
|
+
} else {
|
|
177
|
+
fm.push('title: ' + yamlStr("《" + finalTitle + "》深度精读笔记"));
|
|
178
|
+
fm.push("date: " + today);
|
|
179
|
+
fm.push("sourceUrl: " + yamlStr(metadata.url || input));
|
|
180
|
+
fm.push("tags: [精读, " + (kindNames[kind] || kind) + "]");
|
|
181
|
+
}
|
|
182
|
+
fm.push("---");
|
|
183
|
+
|
|
147
184
|
const draftPrompt = [
|
|
148
185
|
"将以下多块精读结果整合为完整的结构化精读笔记,只输出标准 Markdown(含 YAML frontmatter)。",
|
|
149
|
-
"模板:"
|
|
150
|
-
|
|
151
|
-
"aliases: [" + yamlStr(finalTitle) + "]",
|
|
152
|
-
"author: " + yamlStr(metadata.author),
|
|
153
|
-
"year: " + yamlStr(metadata.year),
|
|
154
|
-
"type: " + yamlStr(kind),
|
|
155
|
-
"url: " + yamlStr(metadata.url || input),
|
|
156
|
-
"tags: [精读, " + (kindNames[kind] || kind) + "]",
|
|
157
|
-
"created: " + today,
|
|
158
|
-
"status: 已完成",
|
|
159
|
-
"---",
|
|
186
|
+
"模板:"
|
|
187
|
+
].concat(fm, [
|
|
160
188
|
"# 《" + finalTitle + "》深度精读笔记", "",
|
|
161
189
|
"> 一句话核心概括。", "",
|
|
162
190
|
"## 1. 概述(约500字:主题/背景/核心问题/总体结论)", "",
|
|
163
191
|
"## 2. 结构拆解(按主题组织,含详细要点;关键结论标注原文出处)", "",
|
|
164
192
|
"## 3. 关键概念与术语表(表格)", "",
|
|
165
193
|
"## 4. 关键引用(仅关键结论" + (requireCitations ? ",必须标注页码/章节/段落" : "") + ")",
|
|
166
|
-
]
|
|
194
|
+
], extraSections, [
|
|
167
195
|
"---",
|
|
168
196
|
"*笔记整理于 " + today + "*", "",
|
|
169
197
|
"硬性要求:总篇幅≥" + minWords + "字;语言与原文一致;术语统一;引用必须真实;视频" + (includeTimestamps ? "标注时间戳" : "不标注时间戳") + "。",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deep-read-summarize",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "Deep reading & summarization for DSH: books/papers/videos/web → structured Markdown notes (Obsidian / Logseq / static sites). Plugin parsers, MapReduce deep-read, JSON Schema-constrained sub-tasks.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|
|
@@ -23,7 +23,14 @@ whenToUse: 用户提供一本书、论文(arXiv/PDF)、视频链接(YouTub
|
|
|
23
23
|
## 输入
|
|
24
24
|
|
|
25
25
|
用户提供:内容链接或本地文件路径。
|
|
26
|
-
可选参数:`type`(auto/book/paper/video/web)、`options`(minWords / fastMode / maxChunks / maxRetries / requireCitations / includeTimestamps / transcribe / whisperModel / language / device / outputDir / tempDir)。
|
|
26
|
+
可选参数:`type`(auto/book/paper/video/web)、`options`(minWords / fastMode / maxChunks / maxRetries / requireCitations / includeTimestamps / transcribe / whisperModel / language / device / outputDir / tempDir / frontmatter)。
|
|
27
|
+
|
|
28
|
+
`options.frontmatter` 决定 frontmatter 用哪套键(默认 `obsidian`,与历史行为一致):
|
|
29
|
+
- `obsidian`:title / aliases / author / year / type / url / tags / created / status —— 配 Dataview 用这套
|
|
30
|
+
- `generic`:把 Hugo 的保留键换掉(`type` → `docType`、`url` → `sourceUrl`、`created` → `date`),可直接放进 Hugo / Jekyll
|
|
31
|
+
- `minimal`:只留 title / date / sourceUrl / tags
|
|
32
|
+
|
|
33
|
+
**为什么要分档**:`type`、`aliases`、`url` 在 Hugo 里是保留键且语义不同(分别决定 layout、URL 重定向、页面路径),把 Obsidian 的写法直接丢给 Hugo 会改变渲染行为,而不是多出几个无害字段。
|
|
27
34
|
|
|
28
35
|
## 执行步骤
|
|
29
36
|
|