dsh-plugin-lookatstudy 0.19.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/lib/index.mjs CHANGED
@@ -135,7 +135,6 @@ const ZH = {
135
135
  "note.src.learner": "我的笔记",
136
136
  "error.send": "消息没有送达——请稍后再试一次。",
137
137
  "error.action": "操作没有完成——请稍后再试。",
138
- "thread.label": "「{title}」的对话",
139
138
  "thread.streamingBadge": "AI 正在输出",
140
139
  "map.search.label": "搜索",
141
140
  "map.review.label": "复习",
@@ -152,15 +151,6 @@ const ZH = {
152
151
  "quiz.submit": "提交",
153
152
  "proposal.applied": "《{lesson}》已采纳提前毕业提议",
154
153
  "proposal.rejected": "《{lesson}》提议已忽略,继续保持练习",
155
- "companion.poke": "戳一戳伴学伙伴",
156
- "companion.poked": "伴学伙伴向你眨了眨眼",
157
- "companion.form.ember": "小焰",
158
- "companion.form.frost": "霜绒",
159
- "companion.form.moss": "苔芽",
160
- "companion.form.star": "星尘",
161
- "companion.form.ink": "墨墨",
162
- "settings.companion": "伴学伙伴",
163
- "settings.companion.hint": "选择学习面板右下角的伴学生物形态。",
164
154
  "quiz.msg.explain-wrong": "我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。",
165
155
  "quiz.msg.retry": "再来一组类似的题巩固一下。",
166
156
  "quiz.msg.go-deeper": "这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。",
@@ -219,9 +209,15 @@ const ZH = {
219
209
  "palette.study": "开始学习",
220
210
  "palette.kind.action": "操作",
221
211
  "palette.empty": "没有匹配项",
212
+ "threads.open": "{n} 条对话",
213
+ "threads.now": "当前",
222
214
  "threads.label": "课时线程",
223
215
  "meter.label": "上下文用量",
224
- "meter.estimate": " {n} tok(按事件字符估算)",
216
+ "meter.aria": "上下文已用 {pct}%",
217
+ "meter.brk.system": "系统提示",
218
+ "meter.brk.tools": "工具",
219
+ "meter.brk.messages": "对话",
220
+ "meter.estimate.note": "按事件字符估算",
225
221
  "model.unknown": "当前模型",
226
222
  "model.switched": "已切换到 {model}",
227
223
  "model.switchFailed": "切换失败——请看宿主模型设置",
@@ -287,7 +283,7 @@ const ZH = {
287
283
  "quiz.answer": "选 {letter}:{text}",
288
284
  "tutor.dormant": "学习模式已关闭 — 在下方对话区点「开始学习」即可唤醒导师。",
289
285
  "tutor.empty": "对话会出现在这里",
290
- "tutor.empty.hint": "在下方输入框和导师说话",
286
+ "tutor.empty.hint": "和导师聊聊这一课",
291
287
  "proposal.text": "导师提议你已掌握「{lesson}」:{rationale}",
292
288
  "proposal.accept": "接受",
293
289
  "proposal.decline": "再练练",
@@ -482,7 +478,6 @@ const EN = {
482
478
  "note.src.learner": "My note",
483
479
  "error.send": "The message did not go through — please try again.",
484
480
  "error.action": "The action did not complete — please try again.",
485
- "thread.label": "Conversation · {title}",
486
481
  "thread.streamingBadge": "AI is responding",
487
482
  "map.search.label": "Search",
488
483
  "map.review.label": "Review",
@@ -499,15 +494,6 @@ const EN = {
499
494
  "quiz.submit": "Submit",
500
495
  "proposal.applied": "Graduation proposal for \"{lesson}\" accepted",
501
496
  "proposal.rejected": "Proposal for \"{lesson}\" declined — keep practicing",
502
- "companion.poke": "Poke the companion",
503
- "companion.poked": "The companion winks at you",
504
- "companion.form.ember": "Ember",
505
- "companion.form.frost": "Frost",
506
- "companion.form.moss": "Moss",
507
- "companion.form.star": "Stardust",
508
- "companion.form.ink": "Ink",
509
- "settings.companion": "Companion",
510
- "settings.companion.hint": "Choose the companion creature in the study panel corner.",
511
497
  "quiz.msg.explain-wrong": "I got some questions wrong — walk me through why and the right line of thinking.",
512
498
  "quiz.msg.retry": "Give me another similar set to consolidate.",
513
499
  "quiz.msg.go-deeper": "I did well on this set — go deeper into the principles and common confusions.",
@@ -567,8 +553,14 @@ const EN = {
567
553
  "palette.kind.action": "Action",
568
554
  "palette.empty": "No matches",
569
555
  "threads.label": "Lesson threads",
556
+ "threads.open": "{n} threads",
557
+ "threads.now": "current",
570
558
  "meter.label": "Context usage",
571
- "meter.estimate": "~{n} tok (char-volume estimate)",
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",
572
564
  "model.unknown": "Current model",
573
565
  "model.switched": "Switched to {model}",
574
566
  "model.switchFailed": "Switch failed — check the host model settings",
@@ -2675,6 +2667,16 @@ function readJsonBody(req) {
2675
2667
  * @returns the disposer removing every route.
2676
2668
  */
2677
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
+ };
2678
2680
  const disposeRoutes = webServer.register({
2679
2681
  kind: "prefix",
2680
2682
  path: "/lookatstudy",
@@ -2684,7 +2686,8 @@ function registerDashboard(webServer, deps) {
2684
2686
  sendJson(res, 200, {
2685
2687
  ...workbenchState(deps.store.get(), /* @__PURE__ */ new Date()),
2686
2688
  statePath: deps.statePath,
2687
- version: pluginVersion()
2689
+ version: pluginVersion(),
2690
+ model: await modelInfo()
2688
2691
  });
2689
2692
  return;
2690
2693
  }
@@ -8883,6 +8886,24 @@ function apply(ctx, config) {
8883
8886
  });
8884
8887
  cmdCtx.effect(() => disposeCommand, "lookatstudy.studyCommand()");
8885
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();
8886
8907
  ctx.inject(["webServer"], (webCtx) => {
8887
8908
  const studyAreaPath = join(dirname(statePath), "study-area");
8888
8909
  mkdirSync(studyAreaPath, { recursive: true });
@@ -8890,7 +8911,8 @@ function apply(ctx, config) {
8890
8911
  store,
8891
8912
  studyAreaPath,
8892
8913
  statePath,
8893
- onActiveChange: surface.sync
8914
+ onActiveChange: surface.sync,
8915
+ modelInfo
8894
8916
  });
8895
8917
  webCtx.effect(() => disposeDashboard, "lookatstudy.dashboard()");
8896
8918
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-lookatstudy",
3
- "version": "0.19.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",