dsh-plugin-lookatstudy 0.13.0 → 0.14.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 CHANGED
@@ -1,12 +1,12 @@
1
1
  # dsh-plugin-lookatstudy
2
2
 
3
- Turn any markdown document, local folder, or GitHub learning repository into a guided course inside [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) — your dsh agent becomes a full AI tutor with the interaction design of [LookatStudy](https://github.com/Kaiji-Z/LookatStudy): per-concept knowledge tracking, mastery-driven progression, spaced repetition, mastery proposals, friction awareness, learner memory, a Cornell notebook, an in-chat proposal card, exam mode with star grades, XP & streak, bilingual lessons, and a rich blackboard (KaTeX math, syntax-highlighted code, mermaid diagrams, mindmap & concept-map views). Learning engine modules are vendored from LookatStudy (MIT).
3
+ Turn any markdown document, local folder, or GitHub learning repository into a guided course inside [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) — your dsh agent becomes a full AI tutor with the interaction design of [LookatStudy](https://github.com/Kaiji-Z/LookatStudy): per-concept knowledge tracking, mastery-driven progression, spaced repetition, mastery proposals, friction awareness, learner memory, a Cornell notebook, an in-chat proposal card, exam mode with star grades, XP & streak, bilingual lessons, read-aloud (Edge TTS with a system-voice fallback), and a rich blackboard (KaTeX math, syntax-highlighted code, mermaid diagrams, mindmap & concept-map views). Learning engine modules are vendored from LookatStudy (MIT).
4
4
 
5
5
  ## Screenshots
6
6
 
7
7
  | | |
8
8
  |---|---|
9
- | ![Three-column study tab: course rail, tutor, blackboard](docs/media/overview.png) | **The 学习 tab** — course rail (progress, mastery bars, due box), the live tutor conversation, and the focus lesson's blackboard, all inside one dsh conversation view. |
9
+ | ![Three-column study tab: course rail, tutor, blackboard](docs/media/overview.png) | **The 学习 panel** — course rail (progress, mastery bars, due box), the tutor chat with its own composer, and the focus lesson's blackboard; opened from the sidebar's 学习 row (0.14.0 screenshot pending — the shot shows the 0.13 tab arrangement of the same three columns). |
10
10
  | ![Lesson page with rendered math, code and diagrams](docs/media/blackboard-lesson.png) | **讲解** — server-sanitized markdown rendered rich on demand: KaTeX formulas, syntax-highlighted code, mermaid diagrams (CDN loaders, silent degrade offline). |
11
11
  | ![Concept map view](docs/media/concept-map.png) | **🕸 概念图** — the lesson's knowledge components laid out as a draw.io-style concept graph (bundled ELK layout, no external service). |
12
12
  | ![Course rail with lesson tree](docs/media/course-rail.png) | **课程栏** — sections, gating, mastery bars, ⚡ weak spots, exam stars, XP & streak. |
@@ -32,28 +32,28 @@ Works with any profile. In the `web` profile the plugin additionally serves the
32
32
  - **Learner memory** — three slots (global style / per-course pattern / per-lesson gap), read-merge-write (`study_remember`).
33
33
  - A dynamic **learner snapshot** (focus, strategy band, weak concepts, friction, memory, due count, pending proposal) is injected as runtime context every turn.
34
34
 
35
- **2. The study tab (`dsh.client`).** The whole plugin lives in ONE conversation view tab 「学习」 a simplified LookatStudy in three columns, styled entirely with dsh's `--dsw-*` tokens; nothing outside the tab modifies dsh chrome:
35
+ **2. The study panel (`dsh.client`).** A 「学习」 row in the dsh sidebar (below 新会话, alongside other plugin entries) opens a full-takeover panel arranged like upstream LookatStudy's own app — three columns styled entirely with dsh's `--dsw-*` tokens; closing it (or navigating to any session) hands the center column straight back to the host:
36
36
 
37
37
  | Column | What you get |
38
38
  |---|---|
39
39
  | 左 · 课程 | Course picker, progress, due box with one-click review kickoff, lesson tree (gating, mastery bars, ⚡😣 weak spots, clickable focus), one-click demo import when empty |
40
- | 中 · 老师 | A read-only mini transcript of the live tutor conversation (assistant replies rendered through the plugin's markdown pipeline, tool calls as chips, streaming included) plus the soul pills (直讲/引导/实战), the focus lesson's starters, and the mastery-proposal banner (接受/再练练). Typing happens in dsh's own composer below the tab the plugin never ships its own input; every button lands its text in that native composer and submits through the same path as the Send button |
41
- | 右 · 黑板 | The focus lesson's 讲解 (server-sanitized markdown, rendered rich on demand: KaTeX / syntax highlighting / mermaid), a 🧠 mindmap and 🕸 concept-map view of the same lesson, and the Cornell 笔记 three zones |
40
+ | 中 · 导师 | The tutor conversation with its OWN composer — the panel never touches dsh's host composer. Sending (or tapping a starter) is the single entry into a lesson thread: the panel activates the study surface if dormant, creates the lesson's session on the host, and prompts through the host's session face; replies stream back from the session's event window and render through the plugin's markdown pipeline. Soul pills (直讲/引导/实战) ride the column head; the tutor's quiz options (A–D) render as clickable answer buttons under the latest reply |
41
+ | 右 · 黑板 | The focus lesson's 讲解 (server-sanitized markdown, rendered rich on demand: KaTeX / syntax highlighting / mermaid), a 🕸 concept-map view of the same lesson, the Cornell 笔记 three zones (each note deletable with an armed confirm), and the read-aloud bar — 朗读本课 speaks the lesson sentence-by-sentence through Microsoft's Edge neural voices (host-side synthesis, disk-cached; falls back to the browser's system voice offline) with the current sentence highlighted |
42
42
 
43
- The tutor column is a learning surface, not a generic chat: the tutor's quiz options (A–D) render as clickable answer buttons under the latest reply (clicking sends the answer through the native composer), graded answers show as ✓/✗ chips with the tested concept, and every course-tree glyph, tag, and mastery bar carries a hover tooltip explaining its meaning. All content text runs at the dsh chat transcript's own 16 px.
43
+ Clicking a lesson in the rail only FOCUSES it progress updates, the blackboard switches, zero model traffic (upstream's exact interaction). The tutor engages only when you send. Every course-tree glyph, tag, and mastery bar carries a hover tooltip explaining its meaning.
44
44
 
45
- All study state comes from one shared 3 s poll over `/lookatstudy/api/state`; input is dsh's native composer from the first turn (no activation step). Columns stack below 1024 px.
45
+ All study state comes from one shared 3 s poll over `/lookatstudy/api/state`. The host is exactly the conversation-model + agent-turn engine; the panel owns the UI, the host owns the loop.
46
46
 
47
47
  ## dsh-native surfaces
48
48
 
49
49
  Beyond the tab, the plugin rides the host's own integration points:
50
50
 
51
- - **Bilingual UI** — the whole client half registers a `lookatstudy` locale namespace (zh/en, key parity enforced); switch the host language and the study tab follows.
51
+ - **Bilingual UI** — the whole client half registers a `lookatstudy` locale namespace (zh/en, key parity enforced); switch the host language and the study panel follows.
52
52
  - **Settings page** — a `settings.section` entry in the host settings shell: teaching style, study mode on/off, read-only stats (courses/XP/streak) and the state-file path.
53
53
  - **`/study` command** — bare `/study` activates a dormant install and queues the kickoff prompt; `/study <text>` queues that request. Works wherever slash commands do.
54
54
  - **Composer dock pill** — `conversation.composer.dock` entry showing ⚡due · 🔥streak · Lv while active (renders nothing while dormant).
55
55
  - **Tool cards in the conversation tab** — keyed `tool.call.toolview` entries for `study_record_answer` (✓/✗ + concept), `study_lesson`, `study_due_reviews`, `study_exam_result`.
56
- - **Boot-tier prefetch** — `dsh.client.immediately: true`, so the study tab's first open pays no bundle fetch.
56
+ - **Boot-tier prefetch** — `dsh.client.immediately: true`, so the sidebar 学习 row renders on first paint with no bundle fetch.
57
57
 
58
58
  ## Tool surface (25)
59
59
 
@@ -78,20 +78,20 @@ Misc: `study_set_mode`, `study_delete_course`
78
78
 
79
79
  ## What is intentionally not restored
80
80
 
81
- LookatStudy's Electron-native experiences have no host surface in dsh: the 伴学/voice companion line, persistent text highlighting with DOM anchors, and celebration particles. Everything else — engine, contracts, data models, exam mode with star grades, XP & streak, bilingual translation, image inlining, math/code/diagram rendering — is ported (diagram renderers load from CDN on demand and degrade silently offline).
81
+ LookatStudy's Electron-native experiences have no host surface in dsh: the 伴学 companion creature and its celebration particles, and persistent text highlighting with DOM anchors (the read-aloud bar highlights in its own strip instead). Read-aloud itself IS ported (0.13.0) — Edge neural voices synthesized host-side with the browser's speechSynthesis as fallback. Everything else — engine, contracts, data models, exam mode with star grades, XP & streak, bilingual translation, image inlining, math/code/diagram rendering — is ported (diagram renderers load from CDN on demand and degrade silently offline).
82
82
 
83
83
  ## Development
84
84
 
85
85
  ```sh
86
86
  pnpm exec tsdown # build lib/ (host + client entries, peers external)
87
- pnpm test # 48 node:test cases over the real source (no key needed)
87
+ pnpm test # node:test cases over the real source (no key needed)
88
88
 
89
- # iterate against a live dsh (this repo lives beside a deepseek-harness checkout):
89
+ # iterate against a live dsh (needs a deepseek-harness checkout):
90
90
  pnpm dsh web --patch ../dsh-plugin-lookatstudy/cordis.dev.yml # run from the harness checkout
91
- # then open http://127.0.0.1:3080/ and switch to the 学习 tab
91
+ # then open the served URL and click the 学习 row in the sidebar
92
92
  ```
93
93
 
94
- Layout: persona + snapshot context in `src/index.ts`, tools in `src/tools.ts`, state transitions in `src/state.ts`, the study tab's HTTP API in `src/dashboard.ts`, sanitized markdown in `src/markdown.ts` (shared by the host routes and the client bundle), the browser half in `src/client/` (`index.ts` tab registration, `views.tsx` the three-column tab plus the pure `transcriptRows` fold, `data.ts` shared poll store, `styles.ts` injected `--dsw-*` stylesheet), UI card projections in `src/cards.ts`, vendored zero-dependency engine in `src/vendor/` (see each file's provenance header; the one local modification to the folder scanner's dedup key is documented there).
94
+ Layout: persona + snapshot context in `src/index.ts`, tools in `src/tools.ts`, state transitions in `src/state.ts`, the study panel's HTTP API in `src/dashboard.ts`, sanitized markdown in `src/markdown.ts` (shared by the host routes and the client bundle), the browser half in `src/client/` (`index.ts` registrations, `shell-entry.ts` the DOM sidebar row + center-column takeover, `panel.tsx` the upstream-arranged three columns, `session-feed.ts` the session-event-window → chat-rows fold, `data.ts` shared poll store, `styles.ts` injected `--dsw-*` stylesheet), UI card projections in `src/cards.ts`, vendored zero-dependency engine in `src/vendor/` (see each file's provenance header; the one local modification to the folder scanner's dedup key is documented there).
95
95
 
96
96
  Publishing note: `exports` must keep `"./package.json": "./package.json"` — the web bundle's client-module scanner resolves it to discover the `dsh.client` browser half. When re-installing a rebuilt tarball into a profile, remove the old one first or bump the version (pnpm reuses same-spec tarballs).
97
97