deep-read-summarize 0.6.3 → 0.6.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/CHANGELOG.md +16 -4
- package/README.en.md +7 -0
- package/README.md +7 -0
- package/cordis.patch.yml +1 -0
- package/docs/RELEASE.md +2 -1
- package/index.js +11 -3
- package/lib/options.js +8 -1
- package/lib/workflow-script.txt +37 -2
- package/package.json +1 -1
- package/skills/deep-read-summarize/SKILL.md +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,12 +5,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.6.4] — 2026-11-15
|
|
9
|
+
|
|
10
|
+
让未通过核验的笔记保留清晰状态与原因,并支持直接请求简洁精读笔记。
|
|
11
|
+
|
|
8
12
|
### Changed
|
|
9
13
|
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
- 质量未通过时,在保存的笔记中保留质量提示、失败分块和最多五项问题;Obsidian 与 generic 模板中可安全识别的完成状态改为“待核验”。原始 `qualityIssues` 完整保留;无法明确识别的成稿不被丢弃,通过核验的笔记正文保持不变。
|
|
15
|
+
- 新增可显式调用的 `lengthMode: "concise"`:默认 `minWords: 500`、`fastMode: true`,独立原文核验不变。单独指定的篇幅和章节设置优先于预设;成稿模板不再固定要求概述约 500 字。`minWords` 是最低计数,不是输出上限。
|
|
16
|
+
- **补充中文项目描述与关键词**:更新 `package.json` 中的项目描述与关键词,并同步更新 GitHub 仓库描述。
|
|
17
|
+
|
|
18
|
+
### Verification
|
|
19
|
+
|
|
20
|
+
- 增加模拟工作流回归测试,覆盖三种 frontmatter、核验失败、失败分块、异常内容、CRLF 与含 Markdown/HTML 的核验问题,以及简洁模式、参数优先级和独立核验;通过结果和未能提取的原始成稿仍受回归测试保护。
|
|
21
|
+
- 本次未运行真实模型端到端调用;对话中的简洁请求仍取决于宿主代理遵循技能说明。
|
|
22
|
+
|
|
23
|
+
### Compatibility
|
|
24
|
+
|
|
25
|
+
- 标准模式的默认篇幅、章节和核验门槛不变;简洁模式按需启用。质量未通过时,返回的 `note` 会包含程序追加的提示,且模板状态可能从“已完成”变为“待核验”;通过时不添加提示。
|
|
14
26
|
|
|
15
27
|
## [0.6.3] — 2026-11-12
|
|
16
28
|
|
package/README.en.md
CHANGED
|
@@ -63,6 +63,8 @@ https://arxiv.org/abs/2307.09042
|
|
|
63
63
|
|
|
64
64
|
You can also provide a local file, web page, or video link. If needed, specify an output location, sections to retain, or whether you want timestamps.
|
|
65
65
|
|
|
66
|
+
For a shorter note, ask for “a concise reading note with key points, terminology, and quotations.” The main agent can select concise mode, which defaults to a minimum count of 500 and omits sections 5–7 while retaining source review. Ask explicitly if you also want critical analysis or the other optional sections. The minimum is not a length cap; the model determines the actual output length.
|
|
67
|
+
|
|
66
68
|
Hosts with plugin-tool support register `deep_read_summarize`; older hosts use the bundled skill and workflow entry point. The tool returns the note and a suggested path; **the main agent must write the file**. Check that the file was saved and whether the result reports gaps or quality issues.
|
|
67
69
|
|
|
68
70
|
When an identifiable note is extracted from a wrapper, the optional `draftContext` field records the extraction and retains any surrounding text. That text is not part of the note reviewed against the source.
|
|
@@ -89,6 +91,8 @@ When an identifiable note is extracted from a wrapper, the optional `draftContex
|
|
|
89
91
|
|
|
90
92
|
The workflow normalizes chunk ranges and checks coverage of known source line numbers. After drafting, code checks format and length, and an independent review agent reads the obtained text to check chunk coverage and key quotations. Results are available through `qualityPassed`, `qualityChecks`, and `qualityEvidence`.
|
|
91
93
|
|
|
94
|
+
When quality checks fail, the saved note includes a notice, failed chunks, and up to five issues. The completion status in the default Obsidian and generic templates is changed to “pending review” when it can be identified safely. The complete issue list remains in `qualityIssues`.
|
|
95
|
+
|
|
92
96
|
These checks have limits:
|
|
93
97
|
|
|
94
98
|
- **`qualityPassed` does not prove factual accuracy.** Coverage and source authenticity still depend on the reviewing agent reading and evaluating the source. Check important claims, numbers, and quotations yourself.
|
|
@@ -100,6 +104,7 @@ These checks have limits:
|
|
|
100
104
|
|
|
101
105
|
| Option | Default | Purpose |
|
|
102
106
|
| --- | --- | --- |
|
|
107
|
+
| `lengthMode` | `standard` | Set to `concise` for the preset: `minWords: 500` and `fastMode: true` by default |
|
|
103
108
|
| `minWords` | `2500` | Minimum length; the check counts Chinese characters and words in other text |
|
|
104
109
|
| `fastMode` | `false` | Omit the critical analysis, personal applications, and further-reading sections |
|
|
105
110
|
| `maxChunks` | `4` | Chunk-count limit, capped at 12; this is not the concurrency setting |
|
|
@@ -115,6 +120,8 @@ These checks have limits:
|
|
|
115
120
|
| `parallelQuality` | `false` | Opt in to parallel source review; the original review path remains the default |
|
|
116
121
|
| `readCache` | `false` | Optional cross-run chunk cache; supported by the plugin tool only |
|
|
117
122
|
|
|
123
|
+
For a direct call, use `options: { "lengthMode": "concise" }`. Explicit `minWords` and `fastMode` values in that call override the preset; for example, `"fastMode": false` retains all sections. Concise mode aims near the minimum but does not impose a maximum length.
|
|
124
|
+
|
|
118
125
|
To enable `readCache`, also set `readCacheIdentity` to include the provider, pinned model version, and output-affecting settings; change it whenever those change. The caller supplies this identity, and the host cannot verify it automatically. Cache entries are local plaintext and may contain source excerpts; cache hits still receive independent source review.
|
|
119
126
|
|
|
120
127
|
Other options include `frontmatter` (`obsidian`, `generic`, or `minimal`) and `tempDir`. See the [advanced reference](https://github.com/PensiveFei/deep-read-summarize/blob/main/docs/README-reference.en.md) for detailed options, supported formats, and transcription and cache behavior.
|
package/README.md
CHANGED
|
@@ -63,6 +63,8 @@ https://arxiv.org/abs/2307.09042
|
|
|
63
63
|
|
|
64
64
|
你也可以提供本地文件路径、网页或视频链接。如果需要,可以在请求中说明输出位置、希望保留的章节或是否需要时间戳。
|
|
65
65
|
|
|
66
|
+
想要短一些,可以说“请生成简洁笔记,保留要点、术语和关键引用”。主代理可选择简洁模式,默认最低计数为 500 并省略第 5–7 节,仍保留原文核验;如需批判分析等章节,可以在请求中说明。最低篇幅并非字数上限,实际长度仍由模型决定。
|
|
67
|
+
|
|
66
68
|
支持插件工具的宿主会注册 `deep_read_summarize`;旧宿主使用插件提供的技能和 workflow 入口。精读工具返回笔记正文及建议路径,**实际写入文件需要由主代理完成**。生成后请确认文件已保存,并检查结果中是否报告内容缺口或质量问题。
|
|
67
69
|
|
|
68
70
|
当工作流提取被包装的笔记时,可选字段 `draftContext` 会记录提取方式,以及模型在笔记前后附带的额外说明。这些额外文字不是经过原文核验的笔记正文。
|
|
@@ -89,6 +91,8 @@ https://arxiv.org/abs/2307.09042
|
|
|
89
91
|
|
|
90
92
|
工作流会规范化分块范围,检查已知原文行号的覆盖情况;成稿后,程序检查格式和篇幅,并由独立核验代理读取取得的文本,检查分块覆盖与关键引文。核验结果可通过 `qualityPassed`、`qualityChecks` 和 `qualityEvidence` 查看。
|
|
91
93
|
|
|
94
|
+
质量未通过时,保存的笔记开头会保留提示、失败分块及最多 5 项问题;默认 Obsidian 和 generic 模板中的完成状态会在可安全识别时改为“待核验”。完整问题列表仍在 `qualityIssues` 中。
|
|
95
|
+
|
|
92
96
|
这些检查有边界:
|
|
93
97
|
|
|
94
98
|
- **`qualityPassed` 不是事实正确性的证明。**覆盖和原文真实性判断仍依赖核验代理实际读取与判断;重要结论、数字和引用请自行复核。
|
|
@@ -100,6 +104,7 @@ https://arxiv.org/abs/2307.09042
|
|
|
100
104
|
|
|
101
105
|
| 选项 | 默认值 | 用途 |
|
|
102
106
|
| --- | --- | --- |
|
|
107
|
+
| `lengthMode` | `standard` | 设为 `concise` 使用简洁预设,默认 `minWords: 500`、`fastMode: true` |
|
|
103
108
|
| `minWords` | `2500` | 最低篇幅要求;检查规则按中文字符和其他文字的词计算 |
|
|
104
109
|
| `fastMode` | `false` | 开启后省略批判性分析、个人应用和延伸阅读章节 |
|
|
105
110
|
| `maxChunks` | `4` | 分块数量上限,最大为 12;不是并发数 |
|
|
@@ -115,6 +120,8 @@ https://arxiv.org/abs/2307.09042
|
|
|
115
120
|
| `parallelQuality` | `false` | 显式启用并行原文核验;默认保留原核验路径 |
|
|
116
121
|
| `readCache` | `false` | 可选的跨次精读缓存;仅插件工具入口支持 |
|
|
117
122
|
|
|
123
|
+
直接调用时可用 `options: { "lengthMode": "concise" }`。同一次调用显式提供的 `minWords`、`fastMode` 优先于预设;例如加上 `"fastMode": false` 可保留完整章节。简洁模式尽量接近最低篇幅,但不限制最大字数。
|
|
124
|
+
|
|
118
125
|
开启 `readCache` 时,还必须提供 `readCacheIdentity`,写明供应商、固定模型版本及影响输出的设置;这些信息变化时需更换身份。该身份由调用者提供,宿主无法自动验证。缓存为本地明文,可能包含原文摘录;命中后仍会执行独立原文核验。
|
|
119
126
|
|
|
120
127
|
其他选项包括 `frontmatter`(`obsidian`、`generic`、`minimal`)和 `tempDir`。高级选项、取值范围、转写缓存和自定义解析器可参考[完整配置与技术参考](https://github.com/PensiveFei/deep-read-summarize/blob/main/docs/README-reference.zh.md)。
|
package/cordis.patch.yml
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
# customParsersDir: './custom-parsers' # optional plugin-level parser directory (not a workflow option)
|
|
18
18
|
# outputDir: './output' # where notes are written (default: ./output)
|
|
19
19
|
# tempDir: './.tmp' # temp files for chunked content (default: ./.tmp)
|
|
20
|
+
# lengthMode: 'standard' # standard | concise; concise defaults to 500 and fastMode
|
|
20
21
|
# minWords: 2500 # minimum output length (default: 2500)
|
|
21
22
|
# fastMode: false # skip sections 5-7 for speed (default: false)
|
|
22
23
|
# maxChunks: 4 # chunk cap; also caps sub-agent count (1-12, default: 4)
|
package/docs/RELEASE.md
CHANGED
|
@@ -158,7 +158,8 @@ npm view deep-read-summarize --prefer-online # 验证线
|
|
|
158
158
|
| v0.6.0 | npm 已发布 | 新增可配置并发、字符均衡分块与可选的并行原文核验和跨次精读缓存,保留原有默认核验路径。 |
|
|
159
159
|
| v0.6.1 | npm 已发布 | 修复普通执行路径的结果序列化错误,避免已生成的精读笔记在返回宿主时被丢弃。 |
|
|
160
160
|
| v0.6.2 | npm 已发布 | 修复成稿包含前言或外层 Markdown 围栏时,笔记被误判为格式、篇幅和引用不合格的问题。 |
|
|
161
|
-
|
|
|
161
|
+
| v0.6.3 | npm 已发布 | 修复获取阶段把「子代理没有返回结构化结果」误报成内容获取失败的问题,并让获取提示词的 JSON 示例合法、可被结构化输出接受。 |
|
|
162
|
+
| **v0.6.4** | **npm 已发布(当前)** | 让未通过核验的笔记保留清晰状态与原因,并支持直接请求简洁精读笔记。 |
|
|
162
163
|
| v1.0.0 | 计划 | API 稳定后发布 |
|
|
163
164
|
|
|
164
165
|
> 早期迭代用 0.x 表达不稳定;API 稳定后再发 1.0.0。
|
package/index.js
CHANGED
|
@@ -62,7 +62,7 @@ function buildSkillContent(config = {}, runtime = {}) {
|
|
|
62
62
|
if (runtime.toolName) {
|
|
63
63
|
return [body.trim(), '', '## 调用精读工具',
|
|
64
64
|
'调用 `' + runtime.toolName + '`,只提交 input / type / options。工具返回完整 note 与建议 filePath;必须按上文执行同名文件询问、落盘和质量报告。',
|
|
65
|
-
'args 示例(options 是本 profile
|
|
65
|
+
'args 示例(options 是本 profile 的默认值;选择 lengthMode 预设时,省略用户未明确指定的 minWords 和 fastMode,以免示例默认值覆盖预设):',
|
|
66
66
|
'```json', JSON.stringify(argsExample, null, 2), '```'].join('\n');
|
|
67
67
|
}
|
|
68
68
|
return [
|
|
@@ -81,7 +81,7 @@ function buildSkillContent(config = {}, runtime = {}) {
|
|
|
81
81
|
workflow.buildSelfContainedScript(runtime.registry || configuredRegistry(config)),
|
|
82
82
|
'```',
|
|
83
83
|
'',
|
|
84
|
-
'args 示例(options 是本 profile
|
|
84
|
+
'args 示例(options 是本 profile 的默认值;选择 lengthMode 预设时,省略用户未明确指定的 minWords 和 fastMode,以免示例默认值覆盖预设):',
|
|
85
85
|
'```json',
|
|
86
86
|
JSON.stringify(argsExample, null, 2),
|
|
87
87
|
'```'
|
|
@@ -118,7 +118,15 @@ function readingTool(engine, defaults, registry) {
|
|
|
118
118
|
if (typeof args.input !== 'string' || !args.input.trim()) throw new Error('[FATAL] args.input 必须是非空字符串');
|
|
119
119
|
if (args.type !== undefined && typeof args.type !== 'string') throw new Error('[FATAL] args.type 必须是字符串');
|
|
120
120
|
if (args.options !== undefined && (!args.options || typeof args.options !== 'object' || Array.isArray(args.options))) throw new Error('[FATAL] options 必须是对象');
|
|
121
|
-
const
|
|
121
|
+
const overrides = args.options || {};
|
|
122
|
+
const merged = Object.assign({}, defaults, overrides);
|
|
123
|
+
// Selecting a preset for this invocation replaces the profile's length
|
|
124
|
+
// defaults, but explicit per-invocation choices still take precedence.
|
|
125
|
+
if (Object.prototype.hasOwnProperty.call(overrides, 'lengthMode') && overrides.lengthMode !== undefined) {
|
|
126
|
+
if (overrides.minWords === undefined) delete merged.minWords;
|
|
127
|
+
if (overrides.fastMode === undefined) delete merged.fastMode;
|
|
128
|
+
}
|
|
129
|
+
const options = normalizeWorkflowOptions(merged);
|
|
122
130
|
if (!exec || !exec.agent) throw new Error('deep_read_summarize requires a calling agent');
|
|
123
131
|
if (exec.signal && exec.signal.aborted) throw new Error('deep_read_summarize was cancelled before start');
|
|
124
132
|
const startArgs = { input: args.input, type: args.type || 'auto', options: options };
|
package/lib/options.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** Kept self-contained: the exact same validator is embedded in the workflow. */
|
|
4
4
|
function normalizeWorkflowOptions(raw, behavior) {
|
|
5
5
|
const defaults = {
|
|
6
|
-
minWords: 2500, fastMode: false, maxChunks: 4, readConcurrency: 3, parallelQuality: false, transcribe: true,
|
|
6
|
+
lengthMode: 'standard', minWords: 2500, fastMode: false, maxChunks: 4, readConcurrency: 3, parallelQuality: false, transcribe: true,
|
|
7
7
|
requireCitations: true, includeTimestamps: false, outputDir: './output',
|
|
8
8
|
tempDir: './.tmp', whisperModel: 'small', language: 'zh', device: 'cpu',
|
|
9
9
|
maxRetries: 0, frontmatter: 'obsidian', cpuThreads: 0, transcriptCache: true,
|
|
@@ -22,6 +22,12 @@ function normalizeWorkflowOptions(raw, behavior) {
|
|
|
22
22
|
invalid('', 'expected an options object');
|
|
23
23
|
return result;
|
|
24
24
|
}
|
|
25
|
+
// Apply the preset before the individual fields so explicit settings win.
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(raw, 'lengthMode') && typeof raw.lengthMode === 'string' &&
|
|
27
|
+
!/[\u0000\r\n]/.test(raw.lengthMode) && raw.lengthMode.trim().toLowerCase() === 'concise') {
|
|
28
|
+
result.minWords = 500;
|
|
29
|
+
result.fastMode = true;
|
|
30
|
+
}
|
|
25
31
|
const keys = Object.keys(defaults);
|
|
26
32
|
const unknown = Object.keys(raw).filter(function (key) { return keys.indexOf(key) < 0; });
|
|
27
33
|
if (unknown.length) {
|
|
@@ -56,6 +62,7 @@ function normalizeWorkflowOptions(raw, behavior) {
|
|
|
56
62
|
reason = 'expected a non-empty string without NUL or line breaks';
|
|
57
63
|
} else if (key !== 'outputDir' && key !== 'tempDir') {
|
|
58
64
|
value = value.trim().toLowerCase();
|
|
65
|
+
if (key === 'lengthMode' && ['standard', 'concise'].indexOf(value) < 0) reason = 'expected standard|concise';
|
|
59
66
|
if (key === 'frontmatter' && ['obsidian', 'generic', 'minimal'].indexOf(value) < 0) reason = 'expected obsidian|generic|minimal';
|
|
60
67
|
if (key === 'device' && ['cpu', 'auto', 'cuda'].indexOf(value) < 0) reason = 'expected cpu|auto|cuda';
|
|
61
68
|
if (key === 'whisperModel' && models.indexOf(value) < 0) reason = 'unsupported Whisper model';
|
package/lib/workflow-script.txt
CHANGED
|
@@ -24,6 +24,7 @@ if (args && args.type !== undefined && typeof args.type !== "string") throw new
|
|
|
24
24
|
const input = (args && args.input || "").trim();
|
|
25
25
|
const forcedType = ((args && args.type) || "auto").toLowerCase();
|
|
26
26
|
const options = normalizeWorkflowOptions(args && args.options);
|
|
27
|
+
const lengthMode = options.lengthMode;
|
|
27
28
|
const minWords = options.minWords;
|
|
28
29
|
const fastMode = options.fastMode;
|
|
29
30
|
const maxChunks = options.maxChunks;
|
|
@@ -389,7 +390,7 @@ const draftPrompt = [
|
|
|
389
390
|
].concat(fm, [
|
|
390
391
|
"# 《" + finalTitle + "》深度精读笔记", "",
|
|
391
392
|
"> 一句话核心概括。", "",
|
|
392
|
-
"## 1.
|
|
393
|
+
"## 1. 概述(主题/背景/核心问题/总体结论,篇幅与整篇笔记相协调)", "",
|
|
393
394
|
"## 2. 结构拆解(按主题组织,含详细要点;关键结论标注原文出处)", "",
|
|
394
395
|
"## 3. 关键概念与术语表(表格)", "",
|
|
395
396
|
"## 4. 关键引用(仅关键结论" + (requireCitations ? ",必须标注页码/章节/段落" : "") + ")",
|
|
@@ -398,6 +399,7 @@ const draftPrompt = [
|
|
|
398
399
|
"---",
|
|
399
400
|
"*笔记整理于 " + today + "*", "",
|
|
400
401
|
"硬性要求:总篇幅≥" + minWords + "字;语言与原文一致;术语统一;引用必须真实;视频" + (includeTimestamps ? "标注时间戳" : "不标注时间戳") + "。",
|
|
402
|
+
lengthMode === "concise" ? "简洁模式:在满足最低篇幅、关键内容和引文要求的前提下尽量接近最低篇幅;不要为凑长度重复或添加无原文依据的内容。" : "",
|
|
401
403
|
"输出前自检:1)覆盖所有块 2)frontmatter完整 3)各小节齐全 4)引用真实 5)篇幅达标 6)语言一致。",
|
|
402
404
|
"",
|
|
403
405
|
"各块精读结果:",
|
|
@@ -605,10 +607,43 @@ if (!sourceComplete) {
|
|
|
605
607
|
.filter(function (line) { return line.trim() !== sourceNotice; }).join("\n").replace(/^\s*\n/, "");
|
|
606
608
|
verified = prefix + sourceNotice + "\n\n" + body;
|
|
607
609
|
}
|
|
610
|
+
if (!passed) {
|
|
611
|
+
// Keep the quality result with the saved note, including when the main
|
|
612
|
+
// agent's chat response is no longer available. A malformed draft is kept
|
|
613
|
+
// verbatim after the notice; only the known template status is changed.
|
|
614
|
+
const front = verified.match(/^\s*---[ \t]*\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/);
|
|
615
|
+
let prefix = front ? front[0] : "";
|
|
616
|
+
let body = front ? verified.slice(front[0].length).replace(/^\r?\n/, "") : verified;
|
|
617
|
+
if (front && fmProfile !== "minimal" && (prefix.match(/^status:[^\r\n]*/gm) || []).length === 1) {
|
|
618
|
+
prefix = prefix.replace(/^(status:[ \t]*)(?:"已完成"|'已完成'|已完成)([ \t]*(?:#[^\r\n]*)?)(\r?)$/m, "$1待核验$2$3");
|
|
619
|
+
}
|
|
620
|
+
// The existing video-source disclosure must remain first and appear once.
|
|
621
|
+
let sourcePrefix = "";
|
|
622
|
+
if (!sourceComplete && body.indexOf(sourceNotice) === 0) {
|
|
623
|
+
sourcePrefix = sourceNotice + "\n\n";
|
|
624
|
+
body = body.slice(sourceNotice.length).replace(/^\r?\n\r?\n/, "");
|
|
625
|
+
}
|
|
626
|
+
function displayIssue(value) {
|
|
627
|
+
let line = value.replace(/[\u0000-\u001f\u007f\u2028\u2029]+/g, " ").replace(/\s+/g, " ").trim();
|
|
628
|
+
if (line.length > 240) line = line.slice(0, 240) + "…";
|
|
629
|
+
// Issues may be supplied by a model: keep them inside the blockquote and
|
|
630
|
+
// render markup as text rather than allowing injected headings or HTML.
|
|
631
|
+
return line.replace(/([\\`*_[\]{}<>!#])/g, "\\$1");
|
|
632
|
+
}
|
|
633
|
+
const visibleIssues = issues.filter(function (issue) { return typeof issue === "string" && issue.trim(); });
|
|
634
|
+
const notice = ["> **质量提示:本笔记未通过检查,请对照原文复核。**"];
|
|
635
|
+
if (failedChunkIds.length) notice.push("> 未成功精读的分块:" + failedChunkIds.join("、") + "。");
|
|
636
|
+
if (visibleIssues.length) {
|
|
637
|
+
notice.push(">", "> 需要复核:");
|
|
638
|
+
visibleIssues.slice(0, 5).forEach(function (issue) { notice.push("> - " + displayIssue(issue)); });
|
|
639
|
+
if (visibleIssues.length > 5) notice.push("> - 另有 " + (visibleIssues.length - 5) + " 项,请查看本次精读结果中的完整问题列表。");
|
|
640
|
+
} else notice.push("> 请查看本次精读结果中的质量详情。");
|
|
641
|
+
verified = (prefix ? prefix.replace(/[\r\n]+$/, "") + "\n\n" : "") + sourcePrefix + notice.join("\n") + "\n\n" + body;
|
|
642
|
+
}
|
|
608
643
|
timings.quality = Date.now() - qualityStartedAt;
|
|
609
644
|
return timedResult({
|
|
610
645
|
ok: true, kind: kind, title: finalTitle,
|
|
611
|
-
filePath: mdPath, chunksCount: chunkPlan.length, fastMode: fastMode,
|
|
646
|
+
filePath: mdPath, chunksCount: chunkPlan.length, lengthMode: lengthMode, minWords: minWords, fastMode: fastMode,
|
|
612
647
|
qualityPassed: passed, qualityIssues: issues,
|
|
613
648
|
qualityChecks: qualityChecks, qualityEvidence: qualityEvidence,
|
|
614
649
|
failedChunks: failedChunks,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deep-read-summarize",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "DSH 精读插件:书籍精读、论文精读、视频总结、网页摘要 → 结构化 Markdown 读书笔记(YAML frontmatter,可放进 Obsidian / Logseq)。English: deep reading & summarization for DSH — books, papers, videos and web pages into structured Markdown notes.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|
|
@@ -23,10 +23,12 @@ whenToUse: 用户提供一本书、论文(arXiv/PDF)、视频链接(YouTub
|
|
|
23
23
|
## 输入
|
|
24
24
|
|
|
25
25
|
用户提供:内容链接或本地文件路径。
|
|
26
|
-
可选参数:`type`(auto/book/paper/video/web)、`options`(minWords / fastMode / maxChunks / readConcurrency / parallelQuality / readCache / readCacheIdentity / maxRetries / requireCitations / includeTimestamps / transcribe / whisperModel / language / device / cpuThreads / transcriptCache / outputDir / tempDir / frontmatter)。
|
|
26
|
+
可选参数:`type`(auto/book/paper/video/web)、`options`(lengthMode / minWords / fastMode / maxChunks / readConcurrency / parallelQuality / readCache / readCacheIdentity / maxRetries / requireCitations / includeTimestamps / transcribe / whisperModel / language / device / cpuThreads / transcriptCache / outputDir / tempDir / frontmatter)。
|
|
27
27
|
|
|
28
28
|
优先调用插件提供的 `deep_read_summarize` 工具,参数为 `{ input, type, options }`。如果当前宿主没有这个工具,按技能末尾提供的 meta / script / args 调用 `workflow` 工具。两种入口执行相同的获取、精读与质量核验。
|
|
29
29
|
|
|
30
|
+
如果用户明确要求“简洁笔记”或“简短精读”,可使用 `options: { "lengthMode": "concise" }`。它默认使用 `minWords: 500` 和 `fastMode: true`,并要求成稿避免无依据的扩写;原文和引文核验仍会执行。用户明确给出的设置优先:单独传入 `minWords` 可覆盖最低篇幅,要保留第 5–7 节则传入 `fastMode: false`。选择模式时不要照抄下方默认示例中的 `minWords: 2500` 或 `fastMode: false`,除非用户明确要求。`minWords` 是最低计数而不是字数上限,不能承诺输出恰好或不超过某个字数。
|
|
31
|
+
|
|
30
32
|
`options.frontmatter` 决定 frontmatter 用哪套键(默认 `obsidian`,与历史行为一致):
|
|
31
33
|
- `obsidian`:title / aliases / author / year / type / url / tags / created / status —— 配 Dataview 用这套
|
|
32
34
|
- `generic`:把 Hugo 的保留键换掉(`type` → `docType`、`url` → `sourceUrl`、`created` → `date`),可直接放进 Hugo / Jekyll
|
|
@@ -50,7 +52,7 @@ whenToUse: 用户提供一本书、论文(arXiv/PDF)、视频链接(YouTub
|
|
|
50
52
|
|
|
51
53
|
## 输出
|
|
52
54
|
|
|
53
|
-
精读工具返回 `{ ok, filePath, note, qualityPassed, qualityIssues, qualityChecks, qualityEvidence, failedChunks, coverageComplete, sourceComplete, textSource, timings, readTimings }`;可选 `draftContext` 记录成稿或修订稿的提取方式(`stage`、`kind`)及笔记前后额外文字(`before`、`after`),`kind` 为 `fenced` 或 `preamble
|
|
55
|
+
精读工具返回 `{ ok, filePath, note, lengthMode, minWords, fastMode, qualityPassed, qualityIssues, qualityChecks, qualityEvidence, failedChunks, coverageComplete, sourceComplete, textSource, timings, readTimings }`;可选 `draftContext` 记录成稿或修订稿的提取方式(`stage`、`kind`)及笔记前后额外文字(`before`、`after`),`kind` 为 `fenced` 或 `preamble`。质量未通过时,`note` 开头保留提示和最多 5 项问题;obsidian/generic 模板中可安全识别的 `status: 已完成` 会改为 `status: 待核验`。其余问题仍在 `qualityIssues` 中。`coverageComplete: false` 表示缺少有效总行数,无法确认尾部覆盖;`sourceComplete: false` 表示视频仅有简介或来源未确认,笔记会保留来源限制且质量降级。来源完整性仍依据获取代理声明,不能当作视频真实内容已全部证明。`timings` 提供 detect/fetch/read/draft/quality/total 毫秒耗时;`readTimings` 提供精读块的行号、毫秒耗时、成功状态及缓存命中状态,不能由此推测未提供的 token 用量。
|
|
54
56
|
|
|
55
57
|
> ⚠️ **`note` 就是完整笔记正文,`filePath` 只是建议路径**:脚本运行在无文件系统的沙箱里(DSH 的 workflow 契约:脚本只负责协调子代理),**它不会替你写文件**。必须由你(主代理)在拿到结果后用 `write` 工具把它写到 `filePath`——默认 `./output/`,可用 `options.outputDir` 指向 Obsidian 仓库或静态站点的内容目录。
|
|
56
58
|
|