dsh-reading-inbox 0.2.1 → 0.3.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.
- package/README.en.md +211 -208
- package/README.md +211 -208
- package/VERIFY.md +133 -126
- package/index.js +80 -80
- package/package.json +83 -83
- package/src/config.js +44 -44
- package/src/fetch.js +173 -173
- package/src/markdown.js +309 -309
- package/src/routes.js +276 -254
- package/src/search.js +109 -0
- package/src/store.js +741 -647
- package/src/tools.js +441 -438
- package/web/app.js +912 -785
- package/web/index.html +83 -74
- package/web/style.css +814 -739
package/VERIFY.md
CHANGED
|
@@ -1,126 +1,133 @@
|
|
|
1
|
-
# 在真实 DSH 里验证 dsh-reading-inbox
|
|
2
|
-
|
|
3
|
-
这份清单给有 DSH 环境的机器用。目标:确认插件能装、能出现在侧栏、能剪藏、能被 Agent 调用。
|
|
4
|
-
|
|
5
|
-
## 0. 准备
|
|
6
|
-
|
|
7
|
-
- DSH **0.2.0 – 0.2.x**,Node.js >= 22.12(DSH 0.2.2 自身要求 >= 24.9)。
|
|
8
|
-
- 一个可写的 profile,例如 `web`。建议先用测试 profile,避免影响主环境:
|
|
9
|
-
|
|
10
|
-
```sh
|
|
11
|
-
dsh plugin --profile inbox-test add file:C:/path/to/dsh-reading-inbox
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
> 注意:`inbox-test` 是全新 profile 时只有 base,没有 `webServer`,插件会 pending。测试侧栏请用 web 模板创建 profile,或直接装进 `web`。
|
|
15
|
-
|
|
16
|
-
从 web 模板创建测试 profile:
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
dsh --profile inbox-web --from-default-profile web --dump-config
|
|
20
|
-
dsh plugin --profile inbox-web add file:C:/path/to/dsh-reading-inbox
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## 1. 启动
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
dsh --profile inbox-web --no-open --port 4191
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
打开终端打印的 `http://127.0.0.1:4191/?token=...`。
|
|
30
|
-
|
|
31
|
-
## 2. 侧栏
|
|
32
|
-
|
|
33
|
-
- 左侧栏应出现 **阅读收件箱**。
|
|
34
|
-
- 点开后应看到顶部“粘贴网页链接”输入框、左侧列表、右侧空状态。
|
|
35
|
-
- 如果侧栏没有出现:
|
|
36
|
-
- 看启动日志里 `dsh-reading-inbox` 是否 `pending` / `failed`;
|
|
37
|
-
- 确认 profile 有 `webServer`(web 模板);
|
|
38
|
-
- 确认 `client/client.js` 存在(`npm run build:client`)。
|
|
39
|
-
|
|
40
|
-
## 3. 手动剪藏
|
|
41
|
-
|
|
42
|
-
1. 粘贴一个公开文章 URL,例如 `https://example.com/`。
|
|
43
|
-
2. 点“保存”。
|
|
44
|
-
3. 期望:右侧出现文章标题和正文;左侧列表出现条目;`~/.dsh-reading-inbox/clips/<id>/` 下有 `article.md`、`original.html`、`meta.json`。
|
|
45
|
-
4. 点“导出 Markdown”,应下载带 YAML frontmatter 的 `.md`。
|
|
46
|
-
|
|
47
|
-
如果 `example.com` 正文太短,换一篇真实文章。错误应显示在底部 toast,而不是空白。
|
|
48
|
-
|
|
49
|
-
### 3.1 高亮与批注
|
|
50
|
-
|
|
51
|
-
1. 在正文里选中一段文字,应浮出高亮工具栏。
|
|
52
|
-
2. 点一个颜色、写一条批注(可选),点“保存高亮”。
|
|
53
|
-
3. 期望:正文出现彩色高亮,右侧出现“批注”区块;`clips/<id>/annotations.json` 生成;详情头部显示批注数。
|
|
54
|
-
4. 点批注列表里的“定位”,应滚回原文高亮处。
|
|
55
|
-
5. 点“导出 Markdown”,下载文件里应出现 `## 批注` 和刚才的引文/笔记。
|
|
56
|
-
6. 直接访问 `http://127.0.0.1:4191/dsh-reading-inbox/api/items/<id>/annotations`,应返回 `{ ok: true, annotations: [...] }`。
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
# 在真实 DSH 里验证 dsh-reading-inbox
|
|
2
|
+
|
|
3
|
+
这份清单给有 DSH 环境的机器用。目标:确认插件能装、能出现在侧栏、能剪藏、能被 Agent 调用。
|
|
4
|
+
|
|
5
|
+
## 0. 准备
|
|
6
|
+
|
|
7
|
+
- DSH **0.2.0 – 0.2.x**,Node.js >= 22.12(DSH 0.2.2 自身要求 >= 24.9)。
|
|
8
|
+
- 一个可写的 profile,例如 `web`。建议先用测试 profile,避免影响主环境:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
dsh plugin --profile inbox-test add file:C:/path/to/dsh-reading-inbox
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
> 注意:`inbox-test` 是全新 profile 时只有 base,没有 `webServer`,插件会 pending。测试侧栏请用 web 模板创建 profile,或直接装进 `web`。
|
|
15
|
+
|
|
16
|
+
从 web 模板创建测试 profile:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
dsh --profile inbox-web --from-default-profile web --dump-config
|
|
20
|
+
dsh plugin --profile inbox-web add file:C:/path/to/dsh-reading-inbox
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 1. 启动
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
dsh --profile inbox-web --no-open --port 4191
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
打开终端打印的 `http://127.0.0.1:4191/?token=...`。
|
|
30
|
+
|
|
31
|
+
## 2. 侧栏
|
|
32
|
+
|
|
33
|
+
- 左侧栏应出现 **阅读收件箱**。
|
|
34
|
+
- 点开后应看到顶部“粘贴网页链接”输入框、左侧列表、右侧空状态。
|
|
35
|
+
- 如果侧栏没有出现:
|
|
36
|
+
- 看启动日志里 `dsh-reading-inbox` 是否 `pending` / `failed`;
|
|
37
|
+
- 确认 profile 有 `webServer`(web 模板);
|
|
38
|
+
- 确认 `client/client.js` 存在(`npm run build:client`)。
|
|
39
|
+
|
|
40
|
+
## 3. 手动剪藏
|
|
41
|
+
|
|
42
|
+
1. 粘贴一个公开文章 URL,例如 `https://example.com/`。
|
|
43
|
+
2. 点“保存”。
|
|
44
|
+
3. 期望:右侧出现文章标题和正文;左侧列表出现条目;`~/.dsh-reading-inbox/clips/<id>/` 下有 `article.md`、`original.html`、`meta.json`。
|
|
45
|
+
4. 点“导出 Markdown”,应下载带 YAML frontmatter 的 `.md`。
|
|
46
|
+
|
|
47
|
+
如果 `example.com` 正文太短,换一篇真实文章。错误应显示在底部 toast,而不是空白。
|
|
48
|
+
|
|
49
|
+
### 3.1 高亮与批注
|
|
50
|
+
|
|
51
|
+
1. 在正文里选中一段文字,应浮出高亮工具栏。
|
|
52
|
+
2. 点一个颜色、写一条批注(可选),点“保存高亮”。
|
|
53
|
+
3. 期望:正文出现彩色高亮,右侧出现“批注”区块;`clips/<id>/annotations.json` 生成;详情头部显示批注数。
|
|
54
|
+
4. 点批注列表里的“定位”,应滚回原文高亮处。
|
|
55
|
+
5. 点“导出 Markdown”,下载文件里应出现 `## 批注` 和刚才的引文/笔记。
|
|
56
|
+
6. 直接访问 `http://127.0.0.1:4191/dsh-reading-inbox/api/items/<id>/annotations`,应返回 `{ ok: true, annotations: [...] }`。
|
|
57
|
+
|
|
58
|
+
### 3.2 检索语法与保存视图
|
|
59
|
+
|
|
60
|
+
1. 搜索框输入 `is:unread`,列表只应剩下未读文章。
|
|
61
|
+
2. 输入 `tag:测试` 或 `site:example.com`,应只返回对应文章;搜索结果卡片应显示命中片段(snippet)。
|
|
62
|
+
3. 点搜索框下方的“+ 视图”,输入名称并保存;应出现视图 chip。
|
|
63
|
+
4. 清空搜索后点该 chip,搜索框应恢复保存的查询,列表回到同一组结果;点 chip 上的 × 可删除视图。
|
|
64
|
+
|
|
65
|
+
## 4. Agent 工具
|
|
66
|
+
|
|
67
|
+
在对话里说:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
把 https://example.com/article 收藏到阅读收件箱,标签:测试
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
期望:模型调用 `reading_clip`,返回 `id`、标题、字数、标签。
|
|
74
|
+
|
|
75
|
+
再问:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
搜索我收藏的“测试”,读出来
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
期望:模型调用 `reading_search`,再调用 `reading_read`,回答里引用收藏内容。
|
|
82
|
+
|
|
83
|
+
再问:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
把刚才那篇标记为已读
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
期望:`reading_update` 成功,收件箱里状态变为“已读”。
|
|
90
|
+
|
|
91
|
+
再问:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
把刚才那篇里的“阅读不是收藏”划线,批注:这是全文的核心
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
期望:模型调用 `reading_highlight`(`action: create`),收件箱里出现对应高亮和批注。
|
|
98
|
+
|
|
99
|
+
## 5. 斜杠命令
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
/inbox https://example.com/article 测试
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
期望:界面显示“已保存《…》到阅读收件箱”,不把全文塞进模型上下文。
|
|
106
|
+
|
|
107
|
+
## 6. 安全检查
|
|
108
|
+
|
|
109
|
+
- 在浏览器地址栏直接访问 `http://127.0.0.1:4191/dsh-reading-inbox/api/health`,应返回 JSON。
|
|
110
|
+
- 从另一个源(例如 `http://localhost:3000` 的页面)fetch 这个地址,应被 403 / CORS 拦截。
|
|
111
|
+
- 让 Agent 剪藏 `http://127.0.0.1:4191/`、`http://169.254.169.254/` 或 `http://[::ffff:127.0.0.1]/`,应被 SSRF 检查拒绝(除非显式设置 `DSH_READING_INBOX_ALLOW_PRIVATE=1`)。
|
|
112
|
+
- 如果机器使用 Clash/Mihomo TUN fake-IP,再设置 `DSH_READING_INBOX_BLOCK_FAKE_IP=1` 重启,剪藏公网页面应报解析到 `198.18.x.x` 并拒绝;确认严格模式生效后再按需关闭。
|
|
113
|
+
- 剪藏一个超过 `DSH_READING_INBOX_MAX_BYTES` 的页面,应报“页面超过大小上限”。
|
|
114
|
+
|
|
115
|
+
## 7. 清理
|
|
116
|
+
|
|
117
|
+
测试 profile 可以保留,也可以删除:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
rm -rf ~/.dsh/profiles/inbox-web
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
数据在 `~/.dsh-reading-inbox/`;确认不需要后再删除。
|
|
124
|
+
|
|
125
|
+
## 结果记录
|
|
126
|
+
|
|
127
|
+
在 issue / PR 里请附:
|
|
128
|
+
|
|
129
|
+
- DSH 版本(`dsh --version`)
|
|
130
|
+
- 操作系统
|
|
131
|
+
- 侧栏是否出现
|
|
132
|
+
- 手动剪藏、Agent 工具、斜杠命令各自的结果
|
|
133
|
+
- 失败时的启动日志片段(不要贴 token)
|
package/index.js
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url'
|
|
2
|
-
import { loadConfig } from './src/config.js'
|
|
3
|
-
import { createRoutes } from './src/routes.js'
|
|
4
|
-
import { ReadingInbox } from './src/store.js'
|
|
5
|
-
import { registerTools } from './src/tools.js'
|
|
6
|
-
|
|
7
|
-
export const name = 'dsh-reading-inbox'
|
|
8
|
-
export const inject = ['webServer', 'tools', 'commands', 'systemPrompt']
|
|
9
|
-
|
|
10
|
-
const webDir = fileURLToPath(new URL('./web/', import.meta.url))
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Mount the reading inbox: storage under ~/.dsh-reading-inbox, a web panel on
|
|
14
|
-
* the host webserver, six reading_* tools, a /inbox command, and one system
|
|
15
|
-
* prompt section so the model knows when to clip, search, and annotate.
|
|
16
|
-
*/
|
|
17
|
-
export function apply(ctx) {
|
|
18
|
-
const config = loadConfig()
|
|
19
|
-
const inbox = new ReadingInbox(config)
|
|
20
|
-
|
|
21
|
-
void inbox.ready().catch(error => {
|
|
22
|
-
console.error(`[dsh-reading-inbox] 初始化失败:${error instanceof Error ? error.message : String(error)}`)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
registerTools(ctx, { inbox })
|
|
26
|
-
|
|
27
|
-
ctx.effect(() => {
|
|
28
|
-
const routes = createRoutes({ inbox, webDir })
|
|
29
|
-
const disposers = routes.map(route => ctx.webServer.register(route))
|
|
30
|
-
return () => {
|
|
31
|
-
for (const dispose of disposers) dispose()
|
|
32
|
-
}
|
|
33
|
-
}, 'dsh-reading-inbox: web routes')
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
ctx.effect(() => ctx.commands.register({
|
|
37
|
-
name: 'inbox',
|
|
38
|
-
description: '保存网页到阅读收件箱(也可从侧栏打开收件箱)',
|
|
39
|
-
input: { hint: '<url> [tag1,tag2]' },
|
|
40
|
-
async handler({ rawInput }) {
|
|
41
|
-
const input = String(rawInput ?? '').trim()
|
|
42
|
-
if (input === '') {
|
|
43
|
-
return { kind: 'error', text: '用法:/inbox <url> [tag1,tag2];也可以从侧栏打开“阅读收件箱”。' }
|
|
44
|
-
}
|
|
45
|
-
const [url, ...rest] = input.split(/\s+/)
|
|
46
|
-
const tags = rest.join(' ').split(/[,,]/).map(value => value.trim()).filter(Boolean)
|
|
47
|
-
try {
|
|
48
|
-
const result = await inbox.clip(url, { tags })
|
|
49
|
-
if (result.duplicate) {
|
|
50
|
-
return { kind: 'success', text: `《${result.title}》已经在收件箱里(${result.id})。` }
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
kind: 'success',
|
|
54
|
-
text: `已保存《${result.title}》到阅读收件箱(${result.id},${result.wordCount} 字)。从侧栏打开“阅读收件箱”即可阅读。`,
|
|
55
|
-
}
|
|
56
|
-
} catch (error) {
|
|
57
|
-
return { kind: 'error', text: `剪藏失败:${error instanceof Error ? error.message : String(error)}` }
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
}), 'dsh-reading-inbox: /inbox command')
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.warn(`[dsh-reading-inbox] /inbox command unavailable: ${error instanceof Error ? error.message : String(error)}`)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
ctx.effect(() => ctx.systemPrompt.section({
|
|
67
|
-
name: 'plugin:reading-inbox',
|
|
68
|
-
order: 150,
|
|
69
|
-
text: [
|
|
70
|
-
'本机已安装阅读收件箱(dsh-reading-inbox)。',
|
|
71
|
-
'当用户说“收藏 / 剪藏 / 稍后读 / 保存这个链接”时,调用 reading_clip。',
|
|
72
|
-
'回答关于已保存文章的问题前,先用 reading_search 找到 clip id,再用 reading_read 读原文。',
|
|
73
|
-
'当用户要求划线、高亮、批注、标记重点时,调用 reading_highlight:create 传 clip id 和原文中的 quote,可选 note/color;list 查看已有批注;update/delete 需要 annotationId。',
|
|
74
|
-
'不要编造收件箱里没有的内容;如果搜索没有结果,明确说没有保存过。',
|
|
75
|
-
].join(''),
|
|
76
|
-
}), 'dsh-reading-inbox: system prompt')
|
|
77
|
-
} catch (error) {
|
|
78
|
-
console.warn(`[dsh-reading-inbox] system prompt section unavailable: ${error instanceof Error ? error.message : String(error)}`)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
import { loadConfig } from './src/config.js'
|
|
3
|
+
import { createRoutes } from './src/routes.js'
|
|
4
|
+
import { ReadingInbox } from './src/store.js'
|
|
5
|
+
import { registerTools } from './src/tools.js'
|
|
6
|
+
|
|
7
|
+
export const name = 'dsh-reading-inbox'
|
|
8
|
+
export const inject = ['webServer', 'tools', 'commands', 'systemPrompt']
|
|
9
|
+
|
|
10
|
+
const webDir = fileURLToPath(new URL('./web/', import.meta.url))
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Mount the reading inbox: storage under ~/.dsh-reading-inbox, a web panel on
|
|
14
|
+
* the host webserver, six reading_* tools, a /inbox command, and one system
|
|
15
|
+
* prompt section so the model knows when to clip, search, and annotate.
|
|
16
|
+
*/
|
|
17
|
+
export function apply(ctx) {
|
|
18
|
+
const config = loadConfig()
|
|
19
|
+
const inbox = new ReadingInbox(config)
|
|
20
|
+
|
|
21
|
+
void inbox.ready().catch(error => {
|
|
22
|
+
console.error(`[dsh-reading-inbox] 初始化失败:${error instanceof Error ? error.message : String(error)}`)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
registerTools(ctx, { inbox })
|
|
26
|
+
|
|
27
|
+
ctx.effect(() => {
|
|
28
|
+
const routes = createRoutes({ inbox, webDir })
|
|
29
|
+
const disposers = routes.map(route => ctx.webServer.register(route))
|
|
30
|
+
return () => {
|
|
31
|
+
for (const dispose of disposers) dispose()
|
|
32
|
+
}
|
|
33
|
+
}, 'dsh-reading-inbox: web routes')
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
ctx.effect(() => ctx.commands.register({
|
|
37
|
+
name: 'inbox',
|
|
38
|
+
description: '保存网页到阅读收件箱(也可从侧栏打开收件箱)',
|
|
39
|
+
input: { hint: '<url> [tag1,tag2]' },
|
|
40
|
+
async handler({ rawInput }) {
|
|
41
|
+
const input = String(rawInput ?? '').trim()
|
|
42
|
+
if (input === '') {
|
|
43
|
+
return { kind: 'error', text: '用法:/inbox <url> [tag1,tag2];也可以从侧栏打开“阅读收件箱”。' }
|
|
44
|
+
}
|
|
45
|
+
const [url, ...rest] = input.split(/\s+/)
|
|
46
|
+
const tags = rest.join(' ').split(/[,,]/).map(value => value.trim()).filter(Boolean)
|
|
47
|
+
try {
|
|
48
|
+
const result = await inbox.clip(url, { tags })
|
|
49
|
+
if (result.duplicate) {
|
|
50
|
+
return { kind: 'success', text: `《${result.title}》已经在收件箱里(${result.id})。` }
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
kind: 'success',
|
|
54
|
+
text: `已保存《${result.title}》到阅读收件箱(${result.id},${result.wordCount} 字)。从侧栏打开“阅读收件箱”即可阅读。`,
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
return { kind: 'error', text: `剪藏失败:${error instanceof Error ? error.message : String(error)}` }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
}), 'dsh-reading-inbox: /inbox command')
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.warn(`[dsh-reading-inbox] /inbox command unavailable: ${error instanceof Error ? error.message : String(error)}`)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
ctx.effect(() => ctx.systemPrompt.section({
|
|
67
|
+
name: 'plugin:reading-inbox',
|
|
68
|
+
order: 150,
|
|
69
|
+
text: [
|
|
70
|
+
'本机已安装阅读收件箱(dsh-reading-inbox)。',
|
|
71
|
+
'当用户说“收藏 / 剪藏 / 稍后读 / 保存这个链接”时,调用 reading_clip。',
|
|
72
|
+
'回答关于已保存文章的问题前,先用 reading_search 找到 clip id,再用 reading_read 读原文。',
|
|
73
|
+
'当用户要求划线、高亮、批注、标记重点时,调用 reading_highlight:create 传 clip id 和原文中的 quote,可选 note/color;list 查看已有批注;update/delete 需要 annotationId。',
|
|
74
|
+
'不要编造收件箱里没有的内容;如果搜索没有结果,明确说没有保存过。',
|
|
75
|
+
].join(''),
|
|
76
|
+
}), 'dsh-reading-inbox: system prompt')
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.warn(`[dsh-reading-inbox] system prompt section unavailable: ${error instanceof Error ? error.message : String(error)}`)
|
|
79
|
+
}
|
|
80
|
+
}
|
package/package.json
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-reading-inbox",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DeepSeek Harness 的阅读收件箱:网页剪藏、Markdown 存档、划线批注、标签、全文检索与 Agent 工具。",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./index.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./index.js",
|
|
9
|
-
"./client": {
|
|
10
|
-
"default": "./client/client.js"
|
|
11
|
-
},
|
|
12
|
-
"./package.json": "./package.json"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"index.js",
|
|
16
|
-
"src",
|
|
17
|
-
"client",
|
|
18
|
-
"web",
|
|
19
|
-
"docs",
|
|
20
|
-
"cordis.patch.yml",
|
|
21
|
-
"README.md",
|
|
22
|
-
"README.en.md",
|
|
23
|
-
"VERIFY.md",
|
|
24
|
-
"LICENSE"
|
|
25
|
-
],
|
|
26
|
-
"dsh": {
|
|
27
|
-
"bundle": {
|
|
28
|
-
"patch": "./cordis.patch.yml"
|
|
29
|
-
},
|
|
30
|
-
"client": {
|
|
31
|
-
"inject": [],
|
|
32
|
-
"platform": "web"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=22.12.0",
|
|
37
|
-
"dsh": ">=0.2.0 <0.3.0"
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"pretest": "npm run build:client",
|
|
41
|
-
"test": "node --test",
|
|
42
|
-
"verify": "node scripts/verify.mjs",
|
|
43
|
-
"dev": "node scripts/dev-server.mjs",
|
|
44
|
-
"seed": "node scripts/seed-demo.mjs",
|
|
45
|
-
"build:client": "node scripts/build-client.mjs",
|
|
46
|
-
"prepare": "node scripts/build-client.mjs"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"iconv-lite": "^0.7.0",
|
|
51
|
-
"js-yaml": "^5.5.0",
|
|
52
|
-
"linkedom": "^0.18.15",
|
|
53
|
-
"marked": "^18.3.0",
|
|
54
|
-
"minisearch": "^7.2.0",
|
|
55
|
-
"sanitize-html": "^2.18.2",
|
|
56
|
-
"turndown": "^7.2.5",
|
|
57
|
-
"turndown-plugin-gfm": "^1.0.2",
|
|
58
|
-
"undici": "^7.30.2"
|
|
59
|
-
},
|
|
60
|
-
"devDependencies": {
|
|
61
|
-
"esbuild": "^0.28.2"
|
|
62
|
-
},
|
|
63
|
-
"keywords": [
|
|
64
|
-
"dsh-plugin",
|
|
65
|
-
"deepseek-harness",
|
|
66
|
-
"read-later",
|
|
67
|
-
"web-clipper",
|
|
68
|
-
"markdown",
|
|
69
|
-
"reading",
|
|
70
|
-
"inbox",
|
|
71
|
-
"highlights",
|
|
72
|
-
"annotations"
|
|
73
|
-
],
|
|
74
|
-
"license": "MIT",
|
|
75
|
-
"repository": {
|
|
76
|
-
"type": "git",
|
|
77
|
-
"url": "git+https://github.com/Bit0620/dsh-reading-inbox.git"
|
|
78
|
-
},
|
|
79
|
-
"publishConfig": {
|
|
80
|
-
"access": "public",
|
|
81
|
-
"registry": "https://registry.npmjs.org/"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-reading-inbox",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "DeepSeek Harness 的阅读收件箱:网页剪藏、Markdown 存档、划线批注、标签、全文检索与 Agent 工具。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js",
|
|
9
|
+
"./client": {
|
|
10
|
+
"default": "./client/client.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"index.js",
|
|
16
|
+
"src",
|
|
17
|
+
"client",
|
|
18
|
+
"web",
|
|
19
|
+
"docs",
|
|
20
|
+
"cordis.patch.yml",
|
|
21
|
+
"README.md",
|
|
22
|
+
"README.en.md",
|
|
23
|
+
"VERIFY.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"dsh": {
|
|
27
|
+
"bundle": {
|
|
28
|
+
"patch": "./cordis.patch.yml"
|
|
29
|
+
},
|
|
30
|
+
"client": {
|
|
31
|
+
"inject": [],
|
|
32
|
+
"platform": "web"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22.12.0",
|
|
37
|
+
"dsh": ">=0.2.0 <0.3.0"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"pretest": "npm run build:client",
|
|
41
|
+
"test": "node --test",
|
|
42
|
+
"verify": "node scripts/verify.mjs",
|
|
43
|
+
"dev": "node scripts/dev-server.mjs",
|
|
44
|
+
"seed": "node scripts/seed-demo.mjs",
|
|
45
|
+
"build:client": "node scripts/build-client.mjs",
|
|
46
|
+
"prepare": "node scripts/build-client.mjs"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@mozilla/readability": "^0.6.0",
|
|
50
|
+
"iconv-lite": "^0.7.0",
|
|
51
|
+
"js-yaml": "^5.5.0",
|
|
52
|
+
"linkedom": "^0.18.15",
|
|
53
|
+
"marked": "^18.3.0",
|
|
54
|
+
"minisearch": "^7.2.0",
|
|
55
|
+
"sanitize-html": "^2.18.2",
|
|
56
|
+
"turndown": "^7.2.5",
|
|
57
|
+
"turndown-plugin-gfm": "^1.0.2",
|
|
58
|
+
"undici": "^7.30.2"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"esbuild": "^0.28.2"
|
|
62
|
+
},
|
|
63
|
+
"keywords": [
|
|
64
|
+
"dsh-plugin",
|
|
65
|
+
"deepseek-harness",
|
|
66
|
+
"read-later",
|
|
67
|
+
"web-clipper",
|
|
68
|
+
"markdown",
|
|
69
|
+
"reading",
|
|
70
|
+
"inbox",
|
|
71
|
+
"highlights",
|
|
72
|
+
"annotations"
|
|
73
|
+
],
|
|
74
|
+
"license": "MIT",
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "git+https://github.com/Bit0620/dsh-reading-inbox.git"
|
|
78
|
+
},
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public",
|
|
81
|
+
"registry": "https://registry.npmjs.org/"
|
|
82
|
+
}
|
|
83
|
+
}
|