dsh-deeptutor 0.1.8 → 0.1.10
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/{skills → .agents/skills}/html-doc/scripts/md-to-html.js +3 -3
- package/README.md +87 -39
- package/README.zh.md +64 -31
- package/docs/demo/en-final-answer.png +0 -0
- package/docs/demo/en-study-page.png +0 -0
- package/docs/demo/final-answer.png +0 -0
- package/docs/demo/study-page.png +0 -0
- package/lib/index.d.ts +2 -1
- package/package.json +12 -8
- package/scripts/install-profile.mjs +3 -3
- package/scripts/md-to-html.js +3 -3
- package/scripts/sync-skills.mjs +7 -6
- package/src/index.ts +2 -1
- /package/{skills → .agents/skills}/deeptutor/README.md +0 -0
- /package/{skills → .agents/skills}/deeptutor/SKILL.md +0 -0
- /package/{skills → .agents/skills}/html-doc/SKILL.md +0 -0
- /package/{skills → .agents/skills}/html-doc/assets/template.html +0 -0
|
@@ -349,11 +349,11 @@ function main() {
|
|
|
349
349
|
: "";
|
|
350
350
|
|
|
351
351
|
const generated = new Date().toISOString().slice(0, 10);
|
|
352
|
-
// The same converter ships in two locations (skills/html-doc/scripts/
|
|
353
|
-
// package-root scripts/ copy); resolve the template wherever we are.
|
|
352
|
+
// The same converter ships in two locations (.agents/skills/html-doc/scripts/
|
|
353
|
+
// and a package-root scripts/ copy); resolve the template wherever we are.
|
|
354
354
|
const templateCandidates = [
|
|
355
355
|
path.join(import.meta.dirname, "..", "assets", "template.html"),
|
|
356
|
-
path.join(import.meta.dirname, "..", "skills", "html-doc", "assets", "template.html"),
|
|
356
|
+
path.join(import.meta.dirname, "..", ".agents", "skills", "html-doc", "assets", "template.html"),
|
|
357
357
|
];
|
|
358
358
|
const templatePath = templateCandidates.find((p) => fs.existsSync(p));
|
|
359
359
|
if (!templatePath) {
|
package/README.md
CHANGED
|
@@ -2,18 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
**English** | [简体中文](https://github.com/TecFancy/dsh-deeptutor/blob/main/README.zh.md)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
A **learning-assistant extension for DeepSeek Harness (dsh)**. It connects your
|
|
6
|
+
agent to a [HKUDS/DeepTutor](https://github.com/HKUDS/DeepTutor) tutoring
|
|
7
|
+
service, so a dsh session can explain topics in depth, quiz you, plan learning
|
|
8
|
+
paths, search your personal knowledge bases, and keep a study notebook — all
|
|
9
|
+
without leaving the harness.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
Ask the agent *"teach me async/await"* and it can run a deep-solve, render the
|
|
12
|
+
answer as a self-contained HTML study page you can open in a browser, and
|
|
13
|
+
archive a summary into your notebook.
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
Migrated from the pi coding-agent extension
|
|
16
|
+
(`TecFancy/pi-extensions`, `extensions/deeptutor` + `skills/deeptutor`).
|
|
17
|
+
|
|
18
|
+
## What it adds
|
|
19
|
+
|
|
20
|
+
Three agent-facing tools that the model uses whenever you ask for learning help:
|
|
21
|
+
|
|
22
|
+
| Tool | What it does |
|
|
13
23
|
|---|---|
|
|
14
|
-
| `deeptutor_run` |
|
|
15
|
-
| `deeptutor_kb` |
|
|
16
|
-
| `deeptutor_note` |
|
|
24
|
+
| `deeptutor_run` | Runs one learning capability: `deep_solve` (in-depth explanation), `deep_question` (self-test questions), `deep_research`, `chat`, `mastery_path` (learning-path planning), `visualize` / `math_animator` (visualization). Can mount your knowledge bases (`kbs`) and tools (`rag`, `web_search`, `reason`, `code_execution`, …); returns a `session_id` so later turns continue the same context. |
|
|
25
|
+
| `deeptutor_kb` | Lists, searches, and inspects your personal knowledge bases (RAG) |
|
|
26
|
+
| `deeptutor_note` | Archives Markdown study notes (plans, summaries, wrong answers) into a server notebook |
|
|
17
27
|
|
|
18
28
|
The seven capabilities above are the fixed enum accepted by `deeptutor_run`.
|
|
19
29
|
The underlying DeepTutor CLI may expose more — enumerate the full command set
|
|
@@ -22,9 +32,37 @@ instructs the agent to discover commands this way and, when the tool's enum
|
|
|
22
32
|
doesn't cover a capability, to drive the CLI directly (local binary or over
|
|
23
33
|
SSH).
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
## Example session
|
|
36
|
+
|
|
37
|
+
A typical flow when you ask your agent for learning help:
|
|
38
|
+
|
|
39
|
+
1. **Ask** — *"Explain C# generics covariance using my dotnet knowledge base, and generate a study page."*
|
|
40
|
+
2. The agent grounds the answer in your own material: `deeptutor_kb` (`action=search`, `kb=dotnet`).
|
|
41
|
+
3. It runs a deep-solve: `deeptutor_run` (`capability=deep_solve`, `kbs=[dotnet]`, `html=data/study/csharp-covariance.html`) — the answer comes back and a self-contained HTML page (plus the `.md` source) is written to disk.
|
|
42
|
+
4. It files a summary: `deeptutor_note` (`notebook=dotnet-learning`, `type=solve`).
|
|
43
|
+
|
|
44
|
+
Nothing here is a fixed script — the agent picks the tools and parameters based
|
|
45
|
+
on what you ask for.
|
|
46
|
+
|
|
47
|
+
A real recording of exactly this flow (deep-solve on the async/await state
|
|
48
|
+
machine, mounted on a `dotnet-csharp` knowledge base, rendered to an HTML
|
|
49
|
+
study page, then archived to a notebook):
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
- A working DeepSeek Harness (dsh) install, 0.1.0-rc.6 or any 0.2.x release
|
|
58
|
+
(compatibility re-verified on dsh 0.2.1-rc.2 / 0.2.1-rc.3). Bundle
|
|
59
|
+
auto-registration via `dsh plugin add` is verified on dsh CLI 0.1.0-rc.6 +
|
|
60
|
+
pnpm 8.15.6.
|
|
61
|
+
- A DeepTutor deployment, either:
|
|
62
|
+
- **Local** — `deeptutor serve` running on this machine, or the `deeptutor`
|
|
63
|
+
CLI on `PATH` (used as fallback);
|
|
64
|
+
- **Remote** — DeepTutor on a server, reached through an auto-started SSH
|
|
65
|
+
tunnel (with SSH CLI fallback).
|
|
28
66
|
|
|
29
67
|
## Install into a profile (bundle)
|
|
30
68
|
|
|
@@ -46,7 +84,7 @@ node scripts/install-profile.mjs --profile web
|
|
|
46
84
|
Or run the underlying command yourself — `dsh plugin add` forwards to pnpm
|
|
47
85
|
and then reconciles the profile's `dsh.profile.bundles` against the installed
|
|
48
86
|
state, so a `dsh.bundle`-declaring package like this one is registered
|
|
49
|
-
automatically
|
|
87
|
+
automatically:
|
|
50
88
|
|
|
51
89
|
```sh
|
|
52
90
|
dsh plugin --profile web add dsh-deeptutor -w
|
|
@@ -108,30 +146,10 @@ dsh web --patch ./overlay.yml
|
|
|
108
146
|
The bundle manifest (`dsh.bundle.patch → cordis.patch.yml`) inserts the plugin
|
|
109
147
|
row; later patch layers can override or disable it by id.
|
|
110
148
|
|
|
111
|
-
## Develop against a checkout (no publish needed)
|
|
112
|
-
|
|
113
|
-
```sh
|
|
114
|
-
dsh web --patch /path/to/dsh-deeptutor/cordis.yml
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Build & publish
|
|
118
|
-
|
|
119
|
-
```sh
|
|
120
|
-
npm install
|
|
121
|
-
npm run build # tsc → lib/ (relative .ts imports rewritten to .js)
|
|
122
|
-
npm run typecheck
|
|
123
|
-
npm pack # inspect dsh-deeptutor-0.1.0.tgz
|
|
124
|
-
npm publish # set a scope/registry of your choice first
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Node ≥ 22.6 (type stripping) is needed to load the raw `src/*.ts` via
|
|
128
|
-
`--patch`; the published bundle ships compiled `lib/`, so installed profiles
|
|
129
|
-
run on plain Node ≥ 20 ESM.
|
|
130
|
-
|
|
131
149
|
## Skills
|
|
132
150
|
|
|
133
|
-
Two skills ship inside this package (
|
|
134
|
-
|
|
151
|
+
Two skills ship inside this package (`.agents/skills/deeptutor` and
|
|
152
|
+
`.agents/skills/html-doc`) and the bundled installer copies them to
|
|
135
153
|
`<DSH_HOME>/skills/<name>/` (auto-discovered by dsh) whenever it runs — so
|
|
136
154
|
`pnpm dlx dsh-deeptutor` installs the bundle **and** the skills in one shot:
|
|
137
155
|
|
|
@@ -143,9 +161,10 @@ Two skills ship inside this package (`skills/deeptutor` and
|
|
|
143
161
|
Installing a newer package version overwrites skill files in place; files not
|
|
144
162
|
shipped by the package are never deleted.
|
|
145
163
|
|
|
146
|
-
The files under
|
|
147
|
-
`TecFancy/pi-extensions` (single source of truth, agent-neutral).
|
|
148
|
-
after upstream edits with
|
|
164
|
+
The files under `.agents/skills/` are byte-identical copies of the same
|
|
165
|
+
skills in `TecFancy/pi-extensions` (single source of truth, agent-neutral).
|
|
166
|
+
Sync them after upstream edits with
|
|
167
|
+
`node scripts/sync-skills.mjs ../pi-extensions`.
|
|
149
168
|
|
|
150
169
|
## Configuration (env vars, agent-agnostic)
|
|
151
170
|
|
|
@@ -163,6 +182,35 @@ export DEEPTUTOR_REMOTE_HOME="/home/ubuntu/my-deeptutor"
|
|
|
163
182
|
|
|
164
183
|
Restart dsh after changing env vars.
|
|
165
184
|
|
|
185
|
+
## How it works
|
|
186
|
+
|
|
187
|
+
The plugin auto-detects the deployment: if a DeepTutor API is reachable (local
|
|
188
|
+
`serve`, or a remote server via tunnel), learning turns run over HTTP/WebSocket;
|
|
189
|
+
otherwise it falls back to the CLI — the local `deeptutor` binary, or the remote
|
|
190
|
+
binary over SSH. Remote mode starts the SSH tunnel on demand and tears it down
|
|
191
|
+
when the plugin unloads.
|
|
192
|
+
|
|
193
|
+
## Develop against a checkout (no publish needed)
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
dsh web --patch /path/to/dsh-deeptutor/cordis.yml
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Build & publish
|
|
200
|
+
|
|
201
|
+
```sh
|
|
202
|
+
npm install
|
|
203
|
+
npm run build # tsc → lib/ (relative .ts imports rewritten to .js)
|
|
204
|
+
npm run typecheck
|
|
205
|
+
npm test # node:test + type stripping
|
|
206
|
+
npm pack # inspect dsh-deeptutor-<version>.tgz
|
|
207
|
+
npm publish # set a scope/registry of your choice first
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Node ≥ 22.6 (type stripping) is needed to load the raw `src/*.ts` via
|
|
211
|
+
`--patch`; the published bundle ships compiled `lib/`, so installed profiles
|
|
212
|
+
run on plain Node ≥ 20 ESM.
|
|
213
|
+
|
|
166
214
|
## Layout
|
|
167
215
|
|
|
168
216
|
```
|
|
@@ -170,7 +218,7 @@ src/ # TypeScript sources (dev loading, typecheck)
|
|
|
170
218
|
lib/ # compiled ESM (published entry, from `npm run build`)
|
|
171
219
|
scripts/md-to-html.js # zero-dependency Markdown → HTML converter
|
|
172
220
|
scripts/install-profile.mjs # one-shot profile installer (exposed as the `dsh-deeptutor` binary)
|
|
173
|
-
skills/
|
|
221
|
+
.agents/skills/ # bundled skills: deeptutor/ + html-doc/ (installed to <DSH_HOME>/skills/)
|
|
174
222
|
cordis.yml # dev overlay: insert src/index.ts by absolute path
|
|
175
223
|
cordis.patch.yml # bundle patch: insert the package by name
|
|
176
224
|
```
|
package/README.zh.md
CHANGED
|
@@ -2,23 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
[English](https://github.com/TecFancy/dsh-deeptutor/blob/main/README.md) | **简体中文**
|
|
4
4
|
|
|
5
|
-
面向 **DeepSeek Harness (dsh)**
|
|
5
|
+
面向 **DeepSeek Harness (dsh)** 的**学习辅助扩展**。它将 [HKUDS/DeepTutor](https://github.com/HKUDS/DeepTutor) 辅导服务接入你的 agent,让 dsh 会话能够深度讲解知识点、出题自测、规划学习路径、检索你的个人知识库,并把学习笔记归档到 notebook —— 全程不出 harness。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
只要对 agent 说 *"给我讲讲 async/await"*,它就能跑一次 deep-solve,把答案渲染成可在浏览器打开的自包含 HTML 学习页,再把摘要归档进你的笔记本。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
本扩展由 pi 编码 agent 扩展迁移而来(`TecFancy/pi-extensions`,`extensions/deeptutor` + `skills/deeptutor`)。
|
|
10
|
+
|
|
11
|
+
## 它带来什么
|
|
12
|
+
|
|
13
|
+
三个 agent 可见工具,当你请求学习帮助时由模型调用:
|
|
14
|
+
|
|
15
|
+
| 工具 | 作用 |
|
|
10
16
|
|---|---|
|
|
11
|
-
| `deeptutor_run` |
|
|
12
|
-
| `deeptutor_kb` | 列出 / 搜索 /
|
|
13
|
-
| `deeptutor_note` |
|
|
17
|
+
| `deeptutor_run` | 执行一次学习调用: `deep_solve`(深度讲解)/ `deep_question`(自测题)/ `deep_research` / `chat` / `mastery_path`(学习路径规划)/ `visualize` / `math_animator`(可视化)。可挂载你的知识库(`kbs`)与工具(`rag`、`web_search`、`reason`、`code_execution` 等);返回 `session_id`,后续轮次可延续同一上下文。 |
|
|
18
|
+
| `deeptutor_kb` | 列出 / 搜索 / 查看你的个人知识库(RAG) |
|
|
19
|
+
| `deeptutor_note` | 把 Markdown 学习笔记(计划、总结、错题等)归档到服务器 notebook |
|
|
20
|
+
|
|
21
|
+
上表 7 个 capability 是 `deeptutor_run` 工具接受的固定枚举。底层 DeepTutor CLI 可能支持更多命令 —— 用 `deeptutor --help` / `deeptutor <cmd> --help` 可枚举完整命令集。`deeptutor` skill 会指示 agent 以这种方式动态发现命令;当工具的枚举未覆盖某能力时,agent 可直接调用 CLI(本地二进制或经 SSH)来驱动。
|
|
22
|
+
|
|
23
|
+
## 示例会话
|
|
24
|
+
|
|
25
|
+
一次典型的"求学习帮助"流程:
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
1. **提问** —— *"用我的 dotnet 知识库讲讲 C# 泛型协变,并生成学习页。"*
|
|
28
|
+
2. agent 先检索你的自有资料:`deeptutor_kb`(`action=search`,`kb=dotnet`)。
|
|
29
|
+
3. 再执行深度讲解:`deeptutor_run`(`capability=deep_solve`,`kbs=[dotnet]`,`html=data/study/csharp-covariance.html`)—— 答案返回的同时,自包含 HTML 学习页(及配套 `.md` 源文件)写入磁盘。
|
|
30
|
+
4. 最后归档摘要:`deeptutor_note`(`notebook=dotnet-learning`,`type=solve`)。
|
|
16
31
|
|
|
17
|
-
|
|
32
|
+
以上不是固定脚本 —— agent 会根据你的提问自由选择工具与参数。
|
|
33
|
+
|
|
34
|
+
以下是该流程的真实录制(async/await 状态机 deep-solve,挂载 `dotnet-csharp` 知识库,渲染 HTML 学习页,归档笔记本):
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
## 环境要求
|
|
41
|
+
|
|
42
|
+
- 可用的 DeepSeek Harness (dsh) 安装,0.1.0-rc.6 或任意 0.2.x 版本(已在 dsh 0.2.1-rc.2 / 0.2.1-rc.3 上重新验证兼容性)。`dsh plugin add` 自动登记 bundle 已在 dsh CLI 0.1.0-rc.6 + pnpm 8.15.6 上验证。
|
|
43
|
+
- 一个 DeepTutor 部署,二选一:
|
|
44
|
+
- **本地** —— 本机运行 `deeptutor serve`,或 PATH 上有 `deeptutor` CLI(作为回退);
|
|
45
|
+
- **远程** —— DeepTutor 在服务器上,通过自动建立的 SSH 隧道访问(含 SSH CLI 回退)。
|
|
18
46
|
|
|
19
47
|
## 安装到 profile(bundle 方式)
|
|
20
48
|
|
|
21
|
-
包已发布到 npm(`dsh-deeptutor`)
|
|
49
|
+
包已发布到 npm(`dsh-deeptutor`)。推荐一条命令 —— 运行随包发布的安装器(`scripts/install-profile.mjs`,以 `dsh-deeptutor` 二进制暴露),它包装 `dsh plugin add` 并自动处理下文所述的 pnpm workspace-root 检查:
|
|
22
50
|
|
|
23
51
|
```sh
|
|
24
52
|
pnpm dlx dsh-deeptutor --profile web
|
|
@@ -30,7 +58,7 @@ pnpm dlx dsh-deeptutor --profile web
|
|
|
30
58
|
node scripts/install-profile.mjs --profile web
|
|
31
59
|
```
|
|
32
60
|
|
|
33
|
-
或者自己执行底层命令:`dsh plugin add` 会转发给 pnpm 安装依赖,并把 profile 的 `dsh.profile.bundles` 与已安装状态对账,因此声明了 `dsh.bundle` 的包(如本插件)
|
|
61
|
+
或者自己执行底层命令:`dsh plugin add` 会转发给 pnpm 安装依赖,并把 profile 的 `dsh.profile.bundles` 与已安装状态对账,因此声明了 `dsh.bundle` 的包(如本插件)会被自动登记:
|
|
34
62
|
|
|
35
63
|
```sh
|
|
36
64
|
dsh plugin --profile web add dsh-deeptutor -w
|
|
@@ -38,7 +66,7 @@ dsh plugin --profile web add dsh-deeptutor -w
|
|
|
38
66
|
|
|
39
67
|
> **坑:pnpm workspace-root 检查。** dsh 的 profile 脚手架**总是**写入 `pnpm-workspace.yaml`(`packages: ["."]`、`nodeLinker: hoisted`),profile 目录本身就是 pnpm workspace 根。在 pnpm ≥ 8 上,`pnpm add` 在 workspace 根目录执行会因 `ERR_PNPM_ADDING_TO_ROOT` 中止,必须显式加 workspace-root 标志,所以上面的命令追加了 `-w`/`--workspace-root`(注意:Windows 上 pnpm 把这条错误打在 **stdout**,看起来像警告,实际是失败)。两种处理方式:
|
|
40
68
|
>
|
|
41
|
-
> 1. 使用安装器 / 命令保留 `-w`(
|
|
69
|
+
> 1. 使用安装器 / 命令保留 `-w`(推荐 —— 安装器先试裸命令,只有检查触发时才自动补 `-w`)。
|
|
42
70
|
> 2. 或者永久放行裸命令:在 `~/.dsh/profiles/<name>/pnpm-workspace.yaml` 中加入 `ignore-workspace-root-check: true`,之后 `dsh plugin --profile web add dsh-deeptutor` 按原样即可。
|
|
43
71
|
|
|
44
72
|
验证挂载,然后重启 dsh(bundle 列表在启动时解析):
|
|
@@ -73,27 +101,9 @@ dsh web --patch ./overlay.yml
|
|
|
73
101
|
|
|
74
102
|
bundle 清单(`dsh.bundle.patch → cordis.patch.yml`)负责插入插件行;上层 patch 层可按 id 覆盖或禁用。
|
|
75
103
|
|
|
76
|
-
## 源码开发(无需发布)
|
|
77
|
-
|
|
78
|
-
```sh
|
|
79
|
-
dsh web --patch /path/to/dsh-deeptutor/cordis.yml
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## 构建与发布
|
|
83
|
-
|
|
84
|
-
```sh
|
|
85
|
-
npm install
|
|
86
|
-
npm run build # tsc → lib/(相对 .ts import 改写为 .js)
|
|
87
|
-
npm run typecheck
|
|
88
|
-
npm pack # 检查 dsh-deeptutor-0.1.0.tgz
|
|
89
|
-
npm publish
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
通过 `--patch` 直接加载 `src/*.ts` 需要 Node ≥ 22.6(type stripping);发布的 bundle 自带编译后的 `lib/`,安装到 profile 后仅需普通 Node ≥ 20 ESM。
|
|
93
|
-
|
|
94
104
|
## Skills
|
|
95
105
|
|
|
96
|
-
本包携带两个 skill(
|
|
106
|
+
本包携带两个 skill(`.agents/skills/deeptutor` 与 `.agents/skills/html-doc`),随包安装器每次运行时都会把它们复制到 `<DSH_HOME>/skills/<name>/`(dsh 自动发现)—— 所以 `pnpm dlx dsh-deeptutor` 一次装齐插件 **和** skill:
|
|
97
107
|
|
|
98
108
|
- `deeptutor` — 面向 agent 的学习工作流(`~/.dsh/skills/deeptutor/SKILL.md`)
|
|
99
109
|
- `html-doc` — 将学习内容渲染为自包含 HTML 页面(`~/.dsh/skills/html-doc/`);`deeptutor_run` 传入 `html` 路径时,插件内部使用同一转换器(`scripts/md-to-html.js`)
|
|
@@ -118,6 +128,29 @@ export DEEPTUTOR_REMOTE_HOME="/home/ubuntu/my-deeptutor"
|
|
|
118
128
|
|
|
119
129
|
修改环境变量后需重启 dsh。
|
|
120
130
|
|
|
131
|
+
## 工作原理
|
|
132
|
+
|
|
133
|
+
插件自动适配部署模式:若 DeepTutor API 可达(本地 `serve`,或经隧道的远程服务器),学习回合走 HTTP/WebSocket;否则回退到 CLI —— 本地的 `deeptutor` 二进制,或经 SSH 的远程二进制。远程模式按需启动 SSH 隧道,插件卸载时自动拆除。
|
|
134
|
+
|
|
135
|
+
## 源码开发(无需发布)
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
dsh web --patch /path/to/dsh-deeptutor/cordis.yml
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 构建与发布
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
npm install
|
|
145
|
+
npm run build # tsc → lib/(相对 .ts import 改写为 .js)
|
|
146
|
+
npm run typecheck
|
|
147
|
+
npm test # node:test + type stripping
|
|
148
|
+
npm pack # 检查 dsh-deeptutor-<version>.tgz
|
|
149
|
+
npm publish
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
通过 `--patch` 直接加载 `src/*.ts` 需要 Node ≥ 22.6(type stripping);发布的 bundle 自带编译后的 `lib/`,安装到 profile 后仅需普通 Node ≥ 20 ESM。
|
|
153
|
+
|
|
121
154
|
## 目录结构
|
|
122
155
|
|
|
123
156
|
```
|
|
@@ -125,7 +158,7 @@ src/ # TypeScript 源码(开发加载、类型检查)
|
|
|
125
158
|
lib/ # 编译产物(发布入口,由 npm run build 生成)
|
|
126
159
|
scripts/md-to-html.js # 零依赖 Markdown → HTML 转换器
|
|
127
160
|
scripts/install-profile.mjs # 一键 profile 安装器(以 `dsh-deeptutor` 二进制暴露)
|
|
128
|
-
skills/
|
|
161
|
+
.agents/skills/ # 随包 skill:deeptutor/ + html-doc/(安装到 <DSH_HOME>/skills/)
|
|
129
162
|
cordis.yml # 开发 overlay:按绝对路径插入 src/index.ts
|
|
130
163
|
cordis.patch.yml # bundle patch:按包名插入插件
|
|
131
164
|
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* automatically to reach the API; if the tunnel is unavailable, falls back to the SSH CLI.
|
|
15
15
|
*
|
|
16
16
|
* Env config (agent-agnostic): DEEPTUTOR_SSH_HOST / DEEPTUTOR_API_BASE / DEEPTUTOR_LOCAL_BIN /
|
|
17
|
-
* DEEPTUTOR_REMOTE_BIN / DEEPTUTOR_REMOTE_HOME — see src/config.ts and
|
|
17
|
+
* DEEPTUTOR_REMOTE_BIN / DEEPTUTOR_REMOTE_HOME — see src/config.ts and
|
|
18
|
+
* .agents/skills/deeptutor/SKILL.md.
|
|
18
19
|
*/
|
|
19
20
|
import type { Context } from "@deepseek-ai/cordis";
|
|
20
21
|
export declare const name = "dsh-deeptutor";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-deeptutor",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.10",
|
|
4
|
+
"description": "Learning assistant extension for DeepSeek Harness (dsh): DeepTutor tutoring for your agent — deep explanations, self-test questions, learning paths, personal knowledge-base search (RAG), and note archiving (HTTP/WS first, CLI fallback; auto-adapts local/remote deployment).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
7
7
|
"dsh-plugin",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"url": "https://github.com/TecFancy/dsh-deeptutor/issues"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=20.11"
|
|
24
|
+
"node": ">=20.11",
|
|
25
|
+
"dsh": "^0.1.0-rc.6 || ^0.2.0-rc.1"
|
|
25
26
|
},
|
|
26
27
|
"type": "module",
|
|
27
28
|
"main": "./lib/index.js",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
38
39
|
"./scripts/*": "./scripts/*",
|
|
39
|
-
"
|
|
40
|
+
"./.agents/skills/*": "./.agents/skills/*",
|
|
40
41
|
"./src/*": "./src/*",
|
|
41
42
|
"./package.json": "./package.json"
|
|
42
43
|
},
|
|
@@ -44,7 +45,8 @@
|
|
|
44
45
|
"lib",
|
|
45
46
|
"src",
|
|
46
47
|
"scripts",
|
|
47
|
-
"skills",
|
|
48
|
+
".agents/skills",
|
|
49
|
+
"docs",
|
|
48
50
|
"cordis.patch.yml",
|
|
49
51
|
"README.md",
|
|
50
52
|
"README.zh.md"
|
|
@@ -63,12 +65,14 @@
|
|
|
63
65
|
},
|
|
64
66
|
"peerDependencies": {
|
|
65
67
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
66
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6"
|
|
68
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1"
|
|
67
69
|
},
|
|
68
70
|
"devDependencies": {
|
|
69
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
70
|
-
"@deepseek-ai/dsh-tools": "^0.1
|
|
71
|
+
"@deepseek-ai/cordis": "^4.0.5",
|
|
72
|
+
"@deepseek-ai/dsh-tools": "^0.2.1-rc.3",
|
|
71
73
|
"@types/node": "^24.0.0",
|
|
74
|
+
"@types/semver": "^7.8.0",
|
|
75
|
+
"semver": "^7.8.5",
|
|
72
76
|
"typescript": "^5.9.3"
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* -h, --help show this help
|
|
21
21
|
*
|
|
22
22
|
* Besides installing the bundle, the installer copies the package's bundled
|
|
23
|
-
* skills (
|
|
23
|
+
* skills (`.agents/skills/deeptutor`, `.agents/skills/html-doc`) into
|
|
24
24
|
* `<DSH_HOME>/skills/<name>/`, where dsh auto-discovers them. Existing files
|
|
25
25
|
* are overwritten; files not shipped by the package are never deleted.
|
|
26
26
|
*/
|
|
@@ -33,7 +33,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
33
33
|
const PKG = 'dsh-deeptutor';
|
|
34
34
|
const NAME = 'dsh-deeptutor-install';
|
|
35
35
|
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
|
|
36
|
-
const SKILLS_DIR = join(SCRIPT_DIR, '..', 'skills');
|
|
36
|
+
const SKILLS_DIR = join(SCRIPT_DIR, '..', '.agents', 'skills');
|
|
37
37
|
|
|
38
38
|
const USAGE = `usage: dsh-deeptutor [--profile <name>]
|
|
39
39
|
|
|
@@ -213,7 +213,7 @@ next steps:
|
|
|
213
213
|
*/
|
|
214
214
|
function installSkills() {
|
|
215
215
|
if (!existsSync(SKILLS_DIR)) {
|
|
216
|
-
console.error(`\n${NAME}: warning: no skills/ directory in this package — skill install skipped (old version?)`);
|
|
216
|
+
console.error(`\n${NAME}: warning: no .agents/skills/ directory in this package — skill install skipped (old version?)`);
|
|
217
217
|
return '';
|
|
218
218
|
}
|
|
219
219
|
const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh');
|
package/scripts/md-to-html.js
CHANGED
|
@@ -349,11 +349,11 @@ function main() {
|
|
|
349
349
|
: "";
|
|
350
350
|
|
|
351
351
|
const generated = new Date().toISOString().slice(0, 10);
|
|
352
|
-
// The same converter ships in two locations (skills/html-doc/scripts/
|
|
353
|
-
// package-root scripts/ copy); resolve the template wherever we are.
|
|
352
|
+
// The same converter ships in two locations (.agents/skills/html-doc/scripts/
|
|
353
|
+
// and a package-root scripts/ copy); resolve the template wherever we are.
|
|
354
354
|
const templateCandidates = [
|
|
355
355
|
path.join(import.meta.dirname, "..", "assets", "template.html"),
|
|
356
|
-
path.join(import.meta.dirname, "..", "skills", "html-doc", "assets", "template.html"),
|
|
356
|
+
path.join(import.meta.dirname, "..", ".agents", "skills", "html-doc", "assets", "template.html"),
|
|
357
357
|
];
|
|
358
358
|
const templatePath = templateCandidates.find((p) => fs.existsSync(p));
|
|
359
359
|
if (!templatePath) {
|
package/scripts/sync-skills.mjs
CHANGED
|
@@ -16,14 +16,15 @@ const piRoot = resolve(process.argv[2] ?? join(here, "..", "pi-extensions"));
|
|
|
16
16
|
|
|
17
17
|
// [pi source, this-repo destination]
|
|
18
18
|
// The bundle uses the root scripts/ copy at runtime (src/html-render.ts);
|
|
19
|
-
// the skill copy ships inside the package. Both must
|
|
19
|
+
// the skill copy ships inside the package under .agents/skills/. Both must
|
|
20
|
+
// stay identical.
|
|
20
21
|
const FILES = [
|
|
21
|
-
["skills/deeptutor/SKILL.md", "skills/deeptutor/SKILL.md"],
|
|
22
|
-
["skills/deeptutor/README.md", "skills/deeptutor/README.md"],
|
|
23
|
-
["skills/html-doc/SKILL.md", "skills/html-doc/SKILL.md"],
|
|
24
|
-
["skills/html-doc/assets/template.html", "skills/html-doc/assets/template.html"],
|
|
22
|
+
["skills/deeptutor/SKILL.md", ".agents/skills/deeptutor/SKILL.md"],
|
|
23
|
+
["skills/deeptutor/README.md", ".agents/skills/deeptutor/README.md"],
|
|
24
|
+
["skills/html-doc/SKILL.md", ".agents/skills/html-doc/SKILL.md"],
|
|
25
|
+
["skills/html-doc/assets/template.html", ".agents/skills/html-doc/assets/template.html"],
|
|
25
26
|
["skills/html-doc/scripts/md-to-html.js", "scripts/md-to-html.js"],
|
|
26
|
-
["skills/html-doc/scripts/md-to-html.js", "skills/html-doc/scripts/md-to-html.js"],
|
|
27
|
+
["skills/html-doc/scripts/md-to-html.js", ".agents/skills/html-doc/scripts/md-to-html.js"],
|
|
27
28
|
];
|
|
28
29
|
|
|
29
30
|
let failures = 0;
|
package/src/index.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* automatically to reach the API; if the tunnel is unavailable, falls back to the SSH CLI.
|
|
15
15
|
*
|
|
16
16
|
* Env config (agent-agnostic): DEEPTUTOR_SSH_HOST / DEEPTUTOR_API_BASE / DEEPTUTOR_LOCAL_BIN /
|
|
17
|
-
* DEEPTUTOR_REMOTE_BIN / DEEPTUTOR_REMOTE_HOME — see src/config.ts and
|
|
17
|
+
* DEEPTUTOR_REMOTE_BIN / DEEPTUTOR_REMOTE_HOME — see src/config.ts and
|
|
18
|
+
* .agents/skills/deeptutor/SKILL.md.
|
|
18
19
|
*/
|
|
19
20
|
import type { Context } from "@deepseek-ai/cordis";
|
|
20
21
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|