dsh-nerd-mode 0.4.5 → 0.5.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.md +10 -5
- package/README.zh.md +10 -5
- package/client.js +491 -52
- package/lib/index.js +63 -0
- package/lib/study-sessions.js +283 -0
- package/package.json +70 -70
- package/skills/study/SKILL.md +1 -1
- package/skills/study-plus/SKILL.md +7 -7
- package/skills/study-plus/scripts/book-client.js +8 -10
- package/skills/study-plus/scripts/build-book.mjs +9 -3
package/README.md
CHANGED
|
@@ -48,7 +48,8 @@ A chat lesson ends when the answer arrives. Nothing checks that you understood i
|
|
|
48
48
|
- **Graded checks.** Unseen questions and a graded teach-back, with the rubric written before the question. Only an answer you produced changes the record.
|
|
49
49
|
- **A record that outlives the chat.** Graph, states, and dated log survive restarts, and the HTML Book has full-text search.
|
|
50
50
|
- **Progress without opening a file.** The Study tab reads the Tracker for this conversation and shows one progress percentage, the previous, current, and next Section, the shaky Concepts, and the three most recent Concept cycles. It never writes.
|
|
51
|
-
- **Lectures you can find again.** The Lectures tab
|
|
51
|
+
- **Lectures you can find again.** The Lectures tab keeps the course picker in the page header, lists only the courses that exist, and marks each lecture as a draft, a dated lecture, or an archived one. The archived lectures fold behind a count.
|
|
52
|
+
- **Your study conversations in one place.** The Study Sessions panel in the left sidebar lists every conversation where Nerd Mode was switched on at least once, in three groups: In-depth, Quick, and Past. Each group folds from its heading, In-depth and Quick start open, Past starts closed, and a click opens that conversation.
|
|
52
53
|
|
|
53
54
|
## Install
|
|
54
55
|
|
|
@@ -225,10 +226,11 @@ package.json
|
|
|
225
226
|
│ ├── dsh-nerd-mode → lib/index.js
|
|
226
227
|
│ │ ├── session projection — on/off state, folded from the session log
|
|
227
228
|
│ │ ├── prompt section — assets/section.md at order 550, while on
|
|
228
|
-
│ │
|
|
229
|
+
│ │ ├── /nerd-mode — the switch
|
|
230
|
+
│ │ └── GET /api/study-sessions — the read-only session index
|
|
229
231
|
│ ├── study-plus-skills — skills/ as a filesystem skill provider
|
|
230
232
|
│ └── goal packages — disabled
|
|
231
|
-
└── dsh.client → client.js: pill, Study tab, Lectures tab, Settings section
|
|
233
|
+
└── dsh.client → client.js: pill, Study tab, Lectures tab, Study Sessions panel, Settings section
|
|
232
234
|
```
|
|
233
235
|
|
|
234
236
|
**State** lives in a session projection. It folds from the session log, so compaction, resume, and fork keep it. The prompt section has text only while that state is on.
|
|
@@ -237,6 +239,8 @@ package.json
|
|
|
237
239
|
|
|
238
240
|
**Settings** reach the model as a short defaults block appended to that section, only during a tracked session. They never change the tool set.
|
|
239
241
|
|
|
242
|
+
**Session history** is a second, read-only store. `lib/study-sessions.js` scans the conversation logs in chunks, keys each file by its size and modification time, and writes `~/.dsh/study-sessions-index.json`, which sits outside every workspace. The panel reads it through one route that answers only GET, refuses a request with no session cookie (401) and a foreign host or origin (403).
|
|
243
|
+
|
|
240
244
|
**Patch scope** covers the whole profile. It loads `skills/` with a `!!js` expression, so review patch changes as host-process code. It also disables the three goal packages, because the built-in goal tool turns one study answer into an auto-continuing run.
|
|
241
245
|
|
|
242
246
|
## What the switch changes
|
|
@@ -277,9 +281,10 @@ npm run check
|
|
|
277
281
|
|
|
278
282
|
| Path | Holds |
|
|
279
283
|
|---|---|
|
|
280
|
-
| `lib/index.js` | plugin entry: projection, prompt section, command, session defaults |
|
|
284
|
+
| `lib/index.js` | plugin entry: projection, prompt section, command, session defaults, session index route |
|
|
281
285
|
| `lib/fold.js` | the state fold and its constants |
|
|
282
|
-
| `
|
|
286
|
+
| `lib/study-sessions.js` | the session history scan and its index |
|
|
287
|
+
| `client.js` | composer pill, Study and Lectures tabs, Study Sessions panel, Settings section |
|
|
283
288
|
| `assets/section.md` | the teaching policy prompt |
|
|
284
289
|
| `skills/` | bundled skills |
|
|
285
290
|
| `test/` | one file per surface, run by `node --test` |
|
package/README.zh.md
CHANGED
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
- **有评分的检查。** 没见过的题加上要评分的复述,评分标准在出题之前就写好。只有你自己答出来的内容才会改写记录。
|
|
49
49
|
- **记录比对话活得久。** 概念图、状态和带日期的日志能跨重启保留,HTML 书支持全文搜索。
|
|
50
50
|
- **不用翻文件就能看进度。** Study 标签页读当前对话的记录文件,显示进度百分比,上一节、当前节、下一节三格,状态是 shaky 的概念,以及最近三轮概念循环。它只读,不写。
|
|
51
|
-
- **讲义找得回来。** Lectures
|
|
51
|
+
- **讲义找得回来。** Lectures 标签页把课程下拉放在页头,只列出真实存在的 Course,并把每份讲义标成草稿、带日期或已归档。已归档的讲义收在一个折叠区里,标题旁显示数量。
|
|
52
|
+
- **学习会话都在一处。** 左侧边栏的 Study Sessions 面板列出所有至少打开过一次 Nerd Mode 的会话,分「深入」「快速」「过去」三组。每组都能点标题折叠,深入和快速默认展开,过去默认收起,点一行就打开那个会话。
|
|
52
53
|
|
|
53
54
|
## 安装
|
|
54
55
|
|
|
@@ -225,10 +226,11 @@ package.json
|
|
|
225
226
|
│ ├── dsh-nerd-mode → lib/index.js
|
|
226
227
|
│ │ ├── session projection — 开关状态,从会话日志折叠出来
|
|
227
228
|
│ │ ├── prompt section — assets/section.md,顺序 550,只在开着时注入
|
|
228
|
-
│ │
|
|
229
|
+
│ │ ├── /nerd-mode — 开关
|
|
230
|
+
│ │ └── GET /api/study-sessions — 只读的学习会话索引
|
|
229
231
|
│ ├── study-plus-skills — skills/ 作为文件系统技能来源
|
|
230
232
|
│ └── goal packages — 已禁用
|
|
231
|
-
└── dsh.client → client.js:胶囊、Study 标签页、Lectures
|
|
233
|
+
└── dsh.client → client.js:胶囊、Study 标签页、Lectures 标签页、Study Sessions 面板、设置页
|
|
232
234
|
```
|
|
233
235
|
|
|
234
236
|
**状态**存在一个 session projection 里,从会话日志折叠出来,所以压缩上下文、恢复会话、分叉都不丢。只有那个状态是「开着」时,提示段落才有内容。
|
|
@@ -237,6 +239,8 @@ package.json
|
|
|
237
239
|
|
|
238
240
|
**设置**只在带记录的会话里,以一小段默认值附在那段提示后面。它们从不改变工具目录。
|
|
239
241
|
|
|
242
|
+
**会话历史**是第二份只读记录。`lib/study-sessions.js` 分块扫描会话日志,按文件大小和修改时间记账,写到 `~/.dsh/study-sessions-index.json`,这个文件在每个工作区之外。面板通过一条路由读它:只接受 GET,没有会话 cookie 的请求返回 401,主机名或来源不对返回 403。
|
|
243
|
+
|
|
240
244
|
**补丁范围**覆盖整个 profile。补丁用 `!!js` 表达式加载 `skills/`,改之前要按宿主进程代码来审。补丁还禁用了三个 goal 包,因为内置的 goal 工具会把一次讲解变成自动续跑的循环。
|
|
241
245
|
|
|
242
246
|
## 开关改了什么
|
|
@@ -277,9 +281,10 @@ npm run check
|
|
|
277
281
|
|
|
278
282
|
| 路径 | 内容 |
|
|
279
283
|
|---|---|
|
|
280
|
-
| `lib/index.js` |
|
|
284
|
+
| `lib/index.js` | 插件入口:投影、提示段落、命令、会话默认值、会话索引路由 |
|
|
281
285
|
| `lib/fold.js` | 状态折叠与常量 |
|
|
282
|
-
| `
|
|
286
|
+
| `lib/study-sessions.js` | 会话历史扫描与索引 |
|
|
287
|
+
| `client.js` | 输入框胶囊、Study 与 Lectures 标签页、Study Sessions 面板、设置页 |
|
|
283
288
|
| `assets/section.md` | 教学策略提示词 |
|
|
284
289
|
| `skills/` | 随包的技能 |
|
|
285
290
|
| `test/` | 每个界面一个文件,由 `node --test` 运行 |
|