dsh-plugin-lookatstudy 0.24.0 → 0.25.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/client.js +79 -8
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +14 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -163,6 +163,7 @@ const ZH = {
|
|
|
163
163
|
"toast.close": "关闭",
|
|
164
164
|
"composer.busy": "导师正在回复…",
|
|
165
165
|
"rail.empty.demo": "导入示例课程",
|
|
166
|
+
"import.session.title": "课程导入",
|
|
166
167
|
"import.cta": "导入新课程",
|
|
167
168
|
"import.tab.url": "URL",
|
|
168
169
|
"import.tab.md": "MD",
|
|
@@ -534,6 +535,7 @@ const EN = {
|
|
|
534
535
|
"toast.close": "Close",
|
|
535
536
|
"composer.busy": "The tutor is replying…",
|
|
536
537
|
"rail.empty.demo": "Import the demo course",
|
|
538
|
+
"import.session.title": "Course import",
|
|
537
539
|
"import.cta": "Import a new course",
|
|
538
540
|
"import.tab.url": "URL",
|
|
539
541
|
"import.tab.md": "MD",
|
|
@@ -2353,7 +2355,18 @@ function recordAnswer(state, lessonId, correct, concept, now) {
|
|
|
2353
2355
|
function setCourseThreadScope(state, courseId, scope) {
|
|
2354
2356
|
const course = state.courses.find((c) => c.id === courseId);
|
|
2355
2357
|
if (course === void 0) throw new Error(`lookatstudy-plugin: unknown course id ${JSON.stringify(courseId)}`);
|
|
2358
|
+
if ((course.threadScope === "course" ? "course" : "lesson") === scope) return;
|
|
2356
2359
|
course.threadScope = scope;
|
|
2360
|
+
const courseKey = `course:${courseId}`;
|
|
2361
|
+
const focusLessonId = state.focus?.lessonId ?? null;
|
|
2362
|
+
if (focusLessonId === null || !course.sections.some((s) => s.lessons.some((l) => l.id === focusLessonId))) return;
|
|
2363
|
+
const lessonKey = focusLessonId;
|
|
2364
|
+
const src = scope === "course" ? state.lessonThreads[lessonKey] : state.lessonThreads[courseKey];
|
|
2365
|
+
const dst = scope === "course" ? state.lessonThreads[courseKey] : state.lessonThreads[lessonKey];
|
|
2366
|
+
if (src === void 0 || src.threads.length === 0) return;
|
|
2367
|
+
if (dst !== void 0 && (dst.active !== null || dst.threads.length > 0)) return;
|
|
2368
|
+
state.lessonThreads[scope === "course" ? courseKey : lessonKey] = src;
|
|
2369
|
+
delete state.lessonThreads[scope === "course" ? lessonKey : courseKey];
|
|
2357
2370
|
}
|
|
2358
2371
|
/**
|
|
2359
2372
|
* Resolve the thread-group map key a send from `lessonId` belongs to — the
|
|
@@ -7366,7 +7379,7 @@ function studyTools(store, deps = {}) {
|
|
|
7366
7379
|
};
|
|
7367
7380
|
const designOrImportedRender = (_args, value) => [{
|
|
7368
7381
|
type: "text",
|
|
7369
|
-
text: value.status === "design_required" ? pendingDesign === null ? "Course design required — the brief is no longer pending; call the import tool again to re-fetch it." : typeof value.designSeq === "number" && value.designSeq !== designSeq ? "This design brief is STALE — a newer import replaced the pending design. Call the import tool again for the fresh brief; do not design against this one." : renderDesignBrief(pendingDesign, pendingPart) : `Imported course “${value.title}” (${value.sections} sections, ${value.lessons} lessons). First lesson: “${value.firstLessonTitle}” (id ${value.firstLessonId}).`
|
|
7382
|
+
text: value.status === "design_required" ? pendingDesign === null ? "Course design required — the brief is no longer pending; call the import tool again to re-fetch it." : typeof value.designSeq === "number" && value.designSeq !== designSeq ? "This design brief is STALE — a newer import replaced the pending design. Call the import tool again for the fresh brief; do not design against this one." : renderDesignBrief(pendingDesign, pendingPart) + (store.get().interfaceLang === void 0 && (pendingDesign.availableLangs?.length ?? 0) > 0 ? "\nNote: the learner's interface language is not recorded — when applying, pass translationLang explicitly as the language the learner writes to you in (e.g. \"zh-CN\" for Chinese), so the translation mirrors pair." : "") : `Imported course “${value.title}” (${value.sections} sections, ${value.lessons} lessons). First lesson: “${value.firstLessonTitle}” (id ${value.firstLessonId}).`
|
|
7370
7383
|
}];
|
|
7371
7384
|
const designOrImportedPresentationMeta = (_args, value) => value.status === "design_required" ? designBriefLines(value) : importLines(value);
|
|
7372
7385
|
const designOrImportedPresent = { presentResult: (_args, result) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-lookatstudy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.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",
|