dsh-plugin-lookatstudy 0.8.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LookatStudy Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # dsh-plugin-lookatstudy
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/LookatStudy): per-concept knowledge tracking, mastery-driven progression, spaced repetition, mastery proposals, friction awareness, learner memory, a Cornell notebook, and an in-chat proposal card. Learning engine modules are vendored from LookatStudy (MIT).
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ dsh plugin add dsh-plugin-lookatstudy # from npm
9
+ # or from a tarball:
10
+ dsh plugin add ./dsh-plugin-lookatstudy-0.2.1.tgz
11
+ ```
12
+
13
+ Works with any profile. In the `web` profile the plugin additionally serves the study tab's HTTP API and loads its browser half; headless profiles get the plain tool surface.
14
+
15
+ ## The two surfaces
16
+
17
+ **1. The tutor (chat).** Talk to the agent: *"import https://github.com/microsoft/AI-For-Beginners and teach me lesson 1"*, *"what reviews are due today?"*. The tutor persona (stable core + one of three souls — `guide` 引导 / `direct` 精讲 / `practice` 实战) drives the full LookatStudy loop:
18
+
19
+ - **Knowledge components (KC)** — on first teaching a lesson the tutor derives 2–7 concepts (`study_define_concepts`); every graded answer is attributed (`study_record_answer` with `concept`); per-concept BKT runs and **lesson mastery is the weakest concept** — quizzes target ⚡weak ones first.
20
+ - **Mastery-driven progression** — ≥50% unlocks the next lesson early; ≥90% graduates and schedules the first SM-2 review; answers also nudge the review schedule.
21
+ - **Mastery proposals (propose → apply)** — at ≥85% plus a convincing Feynman-style explanation the tutor proposes early graduation and **waits for the learner's yes/no**; only the explicit decision applies it.
22
+ - **Friction awareness** — confusion/blocks/frustration are silently logged (`study_report_friction`) and surface as ⚡😣 weak spots.
23
+ - **Learner memory** — three slots (global style / per-course pattern / per-lesson gap), read-merge-write (`study_remember`).
24
+ - A dynamic **learner snapshot** (focus, strategy band, weak concepts, friction, memory, due count, pending proposal) is injected as runtime context every turn.
25
+
26
+ **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:
27
+
28
+ | Column | What you get |
29
+ |---|---|
30
+ | 左 · 课程 | 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 |
31
+ | 中 · 老师 | 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 |
32
+ | 右 · 黑板 | The focus lesson's 讲解 (server-sanitized markdown) and the Cornell 笔记 three zones |
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ ## Tool surface (19)
39
+
40
+ Import: `study_import_markdown` / `study_import_folder` (9 doc + 30+ code formats; PDF/PPTX unsupported) / `study_import_github` (jsDelivr CDN, works where github.com is unreachable)
41
+ Learn: `study_courses`, `study_map`, `study_lesson`
42
+ Progress: `study_define_concepts`, `study_record_answer`, `study_complete_lesson`
43
+ Proposals: `study_propose_mastery`, `study_resolve_proposal`
44
+ Reviews: `study_due_reviews`, `study_record_review`
45
+ Awareness: `study_report_friction`, `study_remember`, `study_notes`, `study_note_save`
46
+ Misc: `study_set_mode`, `study_delete_course`
47
+
48
+ ## Configuration (cordis.yml patch layer)
49
+
50
+ ```yaml
51
+ - id: lookatstudy
52
+ name: dsh-plugin-lookatstudy
53
+ config:
54
+ mode: guide # direct | guide | practice — initial soul; persists in state afterwards
55
+ statePath: '' # default: $DSH_HOME/lookatstudy-plugin/state.json
56
+ ```
57
+
58
+ ## What is intentionally not restored
59
+
60
+ LookatStudy's Electron-native experiences have no host surface in dsh: persistent text highlighting with DOM anchors, celebration particles, streak/XP gamification (its effect depends on that UI), exam mode, and multimodal lesson images. Everything else — engine, contracts, data models — is ported.
61
+
62
+ ## Development
63
+
64
+ ```sh
65
+ pnpm exec tsdown # build lib/ (host + client entries, peers external)
66
+ pnpm test # 48 node:test cases over the real source (no key needed)
67
+
68
+ # iterate against a live dsh (from a deepseek-harness checkout):
69
+ pnpm dsh web --patch ./lookatstudy-plugin/cordis.dev.yml
70
+ # then open http://127.0.0.1:3080/ and switch to the 学习 tab
71
+ ```
72
+
73
+ 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).
74
+
75
+ 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).
76
+
77
+ ## License
78
+
79
+ MIT. Engine modules vendored from LookatStudy (MIT).
@@ -0,0 +1,5 @@
1
+ # Bundle patch: references the package by NAME (not a source path) so Node
2
+ # module resolution finds the installed code. See dsh docs/user/develop/basic/publish.md.
3
+ - insert:
4
+ - id: lookatstudy
5
+ name: dsh-plugin-lookatstudy