dsh-plugin-lookatstudy 0.18.0 → 0.20.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 +3 -3
- package/lib/client.js +793 -5573
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +65 -27
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -123,12 +123,18 @@ const ZH = {
|
|
|
123
123
|
"map.node.locked": "锁定 — 先完成前面的课时",
|
|
124
124
|
"map.node.due": "到了复习时间",
|
|
125
125
|
"map.exam.locked": "考试未解锁 — 本章节全部课时掌握度 ≥50% 后开放",
|
|
126
|
-
"map.tab.map": "
|
|
126
|
+
"map.tab.map": "课程",
|
|
127
127
|
"map.tab.import": "导入",
|
|
128
128
|
"map.world.study": "学习",
|
|
129
129
|
"map.world.practice": "实操",
|
|
130
130
|
"map.empty.practice": "这个课程暂无实操练习内容",
|
|
131
131
|
"map.streaming.notice": "导师正在回复…",
|
|
132
|
+
"note.src.ai": "AI 记录",
|
|
133
|
+
"note.src.content": "原文摘录",
|
|
134
|
+
"note.src.chat": "对话摘录",
|
|
135
|
+
"note.src.learner": "我的笔记",
|
|
136
|
+
"error.send": "消息没有送达——请稍后再试一次。",
|
|
137
|
+
"error.action": "操作没有完成——请稍后再试。",
|
|
132
138
|
"thread.streamingBadge": "AI 正在输出",
|
|
133
139
|
"map.search.label": "搜索",
|
|
134
140
|
"map.review.label": "复习",
|
|
@@ -145,15 +151,6 @@ const ZH = {
|
|
|
145
151
|
"quiz.submit": "提交",
|
|
146
152
|
"proposal.applied": "《{lesson}》已采纳提前毕业提议",
|
|
147
153
|
"proposal.rejected": "《{lesson}》提议已忽略,继续保持练习",
|
|
148
|
-
"companion.poke": "戳一戳伴学伙伴",
|
|
149
|
-
"companion.poked": "伴学伙伴向你眨了眨眼",
|
|
150
|
-
"companion.form.ember": "小焰",
|
|
151
|
-
"companion.form.frost": "霜绒",
|
|
152
|
-
"companion.form.moss": "苔芽",
|
|
153
|
-
"companion.form.star": "星尘",
|
|
154
|
-
"companion.form.ink": "墨墨",
|
|
155
|
-
"settings.companion": "伴学伙伴",
|
|
156
|
-
"settings.companion.hint": "选择学习面板右下角的伴学生物形态。",
|
|
157
154
|
"quiz.msg.explain-wrong": "我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。",
|
|
158
155
|
"quiz.msg.retry": "再来一组类似的题巩固一下。",
|
|
159
156
|
"quiz.msg.go-deeper": "这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。",
|
|
@@ -210,10 +207,17 @@ const ZH = {
|
|
|
210
207
|
"palette.courses": "课程",
|
|
211
208
|
"palette.review": "开始复习",
|
|
212
209
|
"palette.study": "开始学习",
|
|
210
|
+
"palette.kind.action": "操作",
|
|
213
211
|
"palette.empty": "没有匹配项",
|
|
212
|
+
"threads.open": "{n} 条对话",
|
|
213
|
+
"threads.now": "当前",
|
|
214
214
|
"threads.label": "课时线程",
|
|
215
215
|
"meter.label": "上下文用量",
|
|
216
|
-
"meter.
|
|
216
|
+
"meter.aria": "上下文已用 {pct}%",
|
|
217
|
+
"meter.brk.system": "系统提示",
|
|
218
|
+
"meter.brk.tools": "工具",
|
|
219
|
+
"meter.brk.messages": "对话",
|
|
220
|
+
"meter.estimate.note": "按事件字符估算",
|
|
217
221
|
"model.unknown": "当前模型",
|
|
218
222
|
"model.switched": "已切换到 {model}",
|
|
219
223
|
"model.switchFailed": "切换失败——请看宿主模型设置",
|
|
@@ -277,9 +281,9 @@ const ZH = {
|
|
|
277
281
|
"row.thinking.title": "导师正在推理,回复马上就来",
|
|
278
282
|
"quiz.title": "点击选项作答,也可以直接打字回答",
|
|
279
283
|
"quiz.answer": "选 {letter}:{text}",
|
|
280
|
-
"tutor.dormant": "学习模式已关闭 —
|
|
284
|
+
"tutor.dormant": "学习模式已关闭 — 在下方对话区点「开始学习」即可唤醒导师。",
|
|
281
285
|
"tutor.empty": "对话会出现在这里",
|
|
282
|
-
"tutor.empty.hint": "
|
|
286
|
+
"tutor.empty.hint": "和导师聊聊这一课",
|
|
283
287
|
"proposal.text": "导师提议你已掌握「{lesson}」:{rationale}",
|
|
284
288
|
"proposal.accept": "接受",
|
|
285
289
|
"proposal.decline": "再练练",
|
|
@@ -462,12 +466,18 @@ const EN = {
|
|
|
462
466
|
"map.node.locked": "Locked — finish the previous lessons first",
|
|
463
467
|
"map.node.due": "Due for review",
|
|
464
468
|
"map.exam.locked": "Exam locked — every lesson in this section needs ≥50% mastery",
|
|
465
|
-
"map.tab.map": "
|
|
469
|
+
"map.tab.map": "Courses",
|
|
466
470
|
"map.tab.import": "Import",
|
|
467
471
|
"map.world.study": "Learn",
|
|
468
472
|
"map.world.practice": "Practice",
|
|
469
473
|
"map.empty.practice": "No practice content in this course yet",
|
|
470
474
|
"map.streaming.notice": "The tutor is responding…",
|
|
475
|
+
"note.src.ai": "AI note",
|
|
476
|
+
"note.src.content": "From the lesson",
|
|
477
|
+
"note.src.chat": "From the chat",
|
|
478
|
+
"note.src.learner": "My note",
|
|
479
|
+
"error.send": "The message did not go through — please try again.",
|
|
480
|
+
"error.action": "The action did not complete — please try again.",
|
|
471
481
|
"thread.streamingBadge": "AI is responding",
|
|
472
482
|
"map.search.label": "Search",
|
|
473
483
|
"map.review.label": "Review",
|
|
@@ -484,15 +494,6 @@ const EN = {
|
|
|
484
494
|
"quiz.submit": "Submit",
|
|
485
495
|
"proposal.applied": "Graduation proposal for \"{lesson}\" accepted",
|
|
486
496
|
"proposal.rejected": "Proposal for \"{lesson}\" declined — keep practicing",
|
|
487
|
-
"companion.poke": "Poke the companion",
|
|
488
|
-
"companion.poked": "The companion winks at you",
|
|
489
|
-
"companion.form.ember": "Ember",
|
|
490
|
-
"companion.form.frost": "Frost",
|
|
491
|
-
"companion.form.moss": "Moss",
|
|
492
|
-
"companion.form.star": "Stardust",
|
|
493
|
-
"companion.form.ink": "Ink",
|
|
494
|
-
"settings.companion": "Companion",
|
|
495
|
-
"settings.companion.hint": "Choose the companion creature in the study panel corner.",
|
|
496
497
|
"quiz.msg.explain-wrong": "I got some questions wrong — walk me through why and the right line of thinking.",
|
|
497
498
|
"quiz.msg.retry": "Give me another similar set to consolidate.",
|
|
498
499
|
"quiz.msg.go-deeper": "I did well on this set — go deeper into the principles and common confusions.",
|
|
@@ -549,10 +550,17 @@ const EN = {
|
|
|
549
550
|
"palette.courses": "Course",
|
|
550
551
|
"palette.review": "Start review",
|
|
551
552
|
"palette.study": "Start studying",
|
|
553
|
+
"palette.kind.action": "Action",
|
|
552
554
|
"palette.empty": "No matches",
|
|
553
555
|
"threads.label": "Lesson threads",
|
|
556
|
+
"threads.open": "{n} threads",
|
|
557
|
+
"threads.now": "current",
|
|
554
558
|
"meter.label": "Context usage",
|
|
555
|
-
"meter.
|
|
559
|
+
"meter.aria": "{pct}% of context used",
|
|
560
|
+
"meter.brk.system": "System prompt",
|
|
561
|
+
"meter.brk.tools": "Tools",
|
|
562
|
+
"meter.brk.messages": "Messages",
|
|
563
|
+
"meter.estimate.note": "Char-volume estimate",
|
|
556
564
|
"model.unknown": "Current model",
|
|
557
565
|
"model.switched": "Switched to {model}",
|
|
558
566
|
"model.switchFailed": "Switch failed — check the host model settings",
|
|
@@ -616,7 +624,7 @@ const EN = {
|
|
|
616
624
|
"row.thinking.title": "The tutor is reasoning; the reply is coming",
|
|
617
625
|
"quiz.title": "Click an option to answer, or just type",
|
|
618
626
|
"quiz.answer": "Choose {letter}: {text}",
|
|
619
|
-
"tutor.dormant": "Study mode is off — click \"
|
|
627
|
+
"tutor.dormant": "Study mode is off — click \"Start learning\" in the conversation pane below to wake the tutor.",
|
|
620
628
|
"tutor.empty": "The conversation will appear here",
|
|
621
629
|
"tutor.empty.hint": "Talk to the tutor in the input below",
|
|
622
630
|
"proposal.text": "The tutor proposes you have mastered \"{lesson}\": {rationale}",
|
|
@@ -2659,6 +2667,16 @@ function readJsonBody(req) {
|
|
|
2659
2667
|
* @returns the disposer removing every route.
|
|
2660
2668
|
*/
|
|
2661
2669
|
function registerDashboard(webServer, deps) {
|
|
2670
|
+
let modelCache = null;
|
|
2671
|
+
const modelInfo = async () => {
|
|
2672
|
+
if (modelCache !== null && Date.now() - modelCache.at < 3e4) return modelCache.value;
|
|
2673
|
+
const value = await deps.modelInfo().catch(() => null);
|
|
2674
|
+
modelCache = {
|
|
2675
|
+
at: Date.now(),
|
|
2676
|
+
value
|
|
2677
|
+
};
|
|
2678
|
+
return value;
|
|
2679
|
+
};
|
|
2662
2680
|
const disposeRoutes = webServer.register({
|
|
2663
2681
|
kind: "prefix",
|
|
2664
2682
|
path: "/lookatstudy",
|
|
@@ -2668,7 +2686,8 @@ function registerDashboard(webServer, deps) {
|
|
|
2668
2686
|
sendJson(res, 200, {
|
|
2669
2687
|
...workbenchState(deps.store.get(), /* @__PURE__ */ new Date()),
|
|
2670
2688
|
statePath: deps.statePath,
|
|
2671
|
-
version: pluginVersion()
|
|
2689
|
+
version: pluginVersion(),
|
|
2690
|
+
model: await modelInfo()
|
|
2672
2691
|
});
|
|
2673
2692
|
return;
|
|
2674
2693
|
}
|
|
@@ -8867,6 +8886,24 @@ function apply(ctx, config) {
|
|
|
8867
8886
|
});
|
|
8868
8887
|
cmdCtx.effect(() => disposeCommand, "lookatstudy.studyCommand()");
|
|
8869
8888
|
});
|
|
8889
|
+
let resolveModelInfo = null;
|
|
8890
|
+
ctx.inject(["agentDefaultModel", "llm"], (modelCtx) => {
|
|
8891
|
+
const faces = modelCtx;
|
|
8892
|
+
resolveModelInfo = async () => {
|
|
8893
|
+
try {
|
|
8894
|
+
const selection = faces.agentDefaultModel.currentSelection();
|
|
8895
|
+
const info = await faces.llm.resolveModelInfo(selection.provider, selection.model);
|
|
8896
|
+
return {
|
|
8897
|
+
id: info.id,
|
|
8898
|
+
provider: selection.provider,
|
|
8899
|
+
contextWindow: info.context?.contextWindow ?? null
|
|
8900
|
+
};
|
|
8901
|
+
} catch {
|
|
8902
|
+
return null;
|
|
8903
|
+
}
|
|
8904
|
+
};
|
|
8905
|
+
});
|
|
8906
|
+
const modelInfo = async () => resolveModelInfo === null ? null : resolveModelInfo();
|
|
8870
8907
|
ctx.inject(["webServer"], (webCtx) => {
|
|
8871
8908
|
const studyAreaPath = join(dirname(statePath), "study-area");
|
|
8872
8909
|
mkdirSync(studyAreaPath, { recursive: true });
|
|
@@ -8874,7 +8911,8 @@ function apply(ctx, config) {
|
|
|
8874
8911
|
store,
|
|
8875
8912
|
studyAreaPath,
|
|
8876
8913
|
statePath,
|
|
8877
|
-
onActiveChange: surface.sync
|
|
8914
|
+
onActiveChange: surface.sync,
|
|
8915
|
+
modelInfo
|
|
8878
8916
|
});
|
|
8879
8917
|
webCtx.effect(() => disposeDashboard, "lookatstudy.dashboard()");
|
|
8880
8918
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-lookatstudy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"packageManager": "pnpm@11.7.0",
|
|
5
5
|
"description": "Turn any markdown, local folder, or GitHub learning repo into a guided course inside DeepSeek Harness: gated skill-tree progression, BKT mastery tracking, SM-2 spaced repetition.",
|
|
6
6
|
"type": "module",
|