openlearn-next 0.3.9 → 0.3.10

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.
Files changed (34) hide show
  1. package/README.md +9 -5
  2. package/cli-cleaner.mjs +72 -27
  3. package/cli-data.mjs +10 -0
  4. package/cli-doctor.mjs +471 -12
  5. package/cli.mjs +282 -159
  6. package/dist/assets/{BatchPickerModal-C7hweQi7.js → BatchPickerModal-BhIFzqMZ.js} +1 -1
  7. package/dist/assets/{ClassesView-f7h7q1me.js → ClassesView-BWzkFR-C.js} +1 -1
  8. package/dist/assets/{CloudDriveModal-y1cqaYjU.js → CloudDriveModal-Dy_toaqC.js} +1 -1
  9. package/dist/assets/{CourseManagement-Bwfdk7Hi.js → CourseManagement-DTIt-D1_.js} +1 -1
  10. package/dist/assets/{CourseWizardModal-DwKB919Y.js → CourseWizardModal-DEx5wbVt.js} +1 -1
  11. package/dist/assets/{Dashboard-7ElGQEot.js → Dashboard-DrD2ZUG2.js} +1 -1
  12. package/dist/assets/{ExportWeightModal-Dor_2k5X.js → ExportWeightModal-D3bGjA61.js} +1 -1
  13. package/dist/assets/{HelpView-Blq21AX9.js → HelpView-DOQ_FtPQ.js} +1 -1
  14. package/dist/assets/{ImportLessonsModal-BNb6POIc.js → ImportLessonsModal-R3T0dy5k.js} +1 -1
  15. package/dist/assets/{InteractiveCoursewareViewer-DZQNSStZ.js → InteractiveCoursewareViewer-CL1yz-wN.js} +1 -1
  16. package/dist/assets/{InteractiveWhiteboard-B-6-PHls.js → InteractiveWhiteboard-Cua0Ksff.js} +1 -1
  17. package/dist/assets/{LazyCourseware-YQTwc8Xc.js → LazyCourseware-CjwoXy7i.js} +1 -1
  18. package/dist/assets/{LazyWhiteboard-DNwlH8kJ.js → LazyWhiteboard-C1kc33rY.js} +1 -1
  19. package/dist/assets/{LessonEditorView-Biw7dyfp.js → LessonEditorView-K0YB64km.js} +1 -1
  20. package/dist/assets/{LiveClassroomView-D2ZyINSZ.js → LiveClassroomView-D4IQGl2d.js} +1 -1
  21. package/dist/assets/{NotificationDetailModal-TJSWdZgO.js → NotificationDetailModal-C7n-UNti.js} +1 -1
  22. package/dist/assets/{PluginView-B2m35ykl.js → PluginView-4aUL9Ma3.js} +4 -4
  23. package/dist/assets/{QuizGeneratorModal-XNW646aZ.js → QuizGeneratorModal-Cwv80A2_.js} +1 -1
  24. package/dist/assets/{StudentAssignmentView-C7qnbBVV.js → StudentAssignmentView-DTFVSpw7.js} +1 -1
  25. package/dist/assets/{StudentLessonView-DItUU7Zd.js → StudentLessonView-CETCftTC.js} +1 -1
  26. package/dist/assets/{StudentPreviewModal-CjxvwHUc.js → StudentPreviewModal-CIQx5-dG.js} +1 -1
  27. package/dist/assets/{StudentView-Bg6tAP5x.js → StudentView-DtWzM17Q.js} +1 -1
  28. package/dist/assets/{SystemResourceLibraryModal-Cf2XJ6sf.js → SystemResourceLibraryModal-Bv3wwXDH.js} +1 -1
  29. package/dist/assets/{TeacherView-Baq66mut.js → TeacherView-BEXx-Vwl.js} +1 -1
  30. package/dist/assets/{index-KP_ep5bf.js → index-PM-cSFwO.js} +1 -1
  31. package/dist/assets/{index-B7B4Vq2l.js → index-kqgYec9C.js} +3 -3
  32. package/dist/index.html +1 -1
  33. package/dist/server.cjs +41 -7
  34. package/package.json +2 -2
package/dist/index.html CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  }
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-B7B4Vq2l.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-kqgYec9C.js"></script>
19
19
  <link rel="stylesheet" crossorigin href="/assets/index-B-YxO39A.css">
20
20
  </head>
21
21
  <body>
package/dist/server.cjs CHANGED
@@ -8262,7 +8262,7 @@ var HotReloadActivationError = class extends HotReloadError {
8262
8262
  init_interfaces();
8263
8263
 
8264
8264
  // packages/core/version.ts
8265
- var PLATFORM_VERSION = "0.3.9";
8265
+ var PLATFORM_VERSION = "0.3.10";
8266
8266
  var OPENLEARN_VERSION = PLATFORM_VERSION;
8267
8267
 
8268
8268
  // packages/core/plugin-host/plugin-runtime-composition.ts
@@ -23733,6 +23733,7 @@ ${examsText}
23733
23733
  var import_express2 = __toESM(require("express"), 1);
23734
23734
  var import_path14 = __toESM(require("path"), 1);
23735
23735
  var import_fs13 = __toESM(require("fs"), 1);
23736
+ var import_semver3 = __toESM(require("semver"), 1);
23736
23737
 
23737
23738
  // server/services/version-fetcher.ts
23738
23739
  var import_child_process2 = require("child_process");
@@ -23889,6 +23890,26 @@ async function checkVersion(source, installedVersion) {
23889
23890
  }
23890
23891
 
23891
23892
  // server/routes/plugins.ts
23893
+ function findLocalPluginSource(manifestId) {
23894
+ const root = import_path14.default.resolve(process.cwd(), "v2_plugins");
23895
+ if (!import_fs13.default.existsSync(root)) return null;
23896
+ let best = null;
23897
+ try {
23898
+ for (const entry of import_fs13.default.readdirSync(root, { withFileTypes: true })) {
23899
+ if (!entry.isDirectory()) continue;
23900
+ const manifestPath = import_path14.default.join(root, entry.name, "manifest.json");
23901
+ if (!import_fs13.default.existsSync(manifestPath)) continue;
23902
+ try {
23903
+ const m = JSON.parse(import_fs13.default.readFileSync(manifestPath, "utf-8"));
23904
+ if (m?.id !== manifestId || !m?.version) continue;
23905
+ if (!best || import_semver3.default.gt(m.version, best.version)) best = { dir: entry.name, version: m.version };
23906
+ } catch {
23907
+ }
23908
+ }
23909
+ } catch {
23910
+ }
23911
+ return best;
23912
+ }
23892
23913
  function isSafeExternalUrl(urlStr) {
23893
23914
  try {
23894
23915
  const parsed = new URL(urlStr);
@@ -24040,6 +24061,20 @@ function registerPluginsRoutes(ctx) {
24040
24061
  }
24041
24062
  const src = manifest.updateSource;
24042
24063
  if (!src?.type || !src?.repo) {
24064
+ const local = findLocalPluginSource(manifest.id);
24065
+ if (local) {
24066
+ const installed = manifest.version || "0.0.0";
24067
+ const hasUpdate = import_semver3.default.gt(local.version, installed);
24068
+ return res.json({
24069
+ success: true,
24070
+ hasUpdate,
24071
+ installedVersion: installed,
24072
+ latestVersion: local.version,
24073
+ downloadUrl: null,
24074
+ updateSource: "local-v2_plugins",
24075
+ changelog: hasUpdate ? `\u672C\u5730\u6E90 v2_plugins/${local.dir} \u63D0\u4F9B\u65B0\u7248\u672C v${local.version}\uFF0C\u8BF7\u91CD\u65B0\u6784\u5EFA ZIP \u540E\u901A\u8FC7\u4E0A\u4F20\u66F4\u65B0` : void 0
24076
+ });
24077
+ }
24043
24078
  return res.json({ success: true, hasUpdate: false, message: "\u8BE5\u63D2\u4EF6\u672A\u58F0\u660E\u66F4\u65B0\u6E90" });
24044
24079
  }
24045
24080
  const result = await checkVersion(src, manifest.version || "0.0.0");
@@ -24084,12 +24119,11 @@ function registerPluginsRoutes(ctx) {
24084
24119
  });
24085
24120
  }
24086
24121
  } else {
24087
- const zipPath = import_path14.default.resolve(process.cwd(), "v2_plugins/research-workflow/aymwoo-plugin-research-workflow.zip");
24088
- if (import_fs13.default.existsSync(zipPath)) {
24089
- zipBuffer = import_fs13.default.readFileSync(zipPath);
24090
- } else {
24091
- return res.status(404).json({ success: false, error: "\u672A\u627E\u5230\u66F4\u65B0\u5B89\u88C5\u5305" });
24092
- }
24122
+ return res.status(400).json({
24123
+ success: false,
24124
+ error: "\u7F3A\u5C11 downloadUrl\uFF1A\u8BF7\u5148\u6267\u884C\u68C0\u67E5\u66F4\u65B0\u83B7\u53D6\u4E0B\u8F7D\u5730\u5740\uFF0C\u6216\u901A\u8FC7 ZIP \u4E0A\u4F20\u66F4\u65B0",
24125
+ fallbackToClient: true
24126
+ });
24093
24127
  }
24094
24128
  const result = await kernelContainer.pluginDistributionManager.updateFromZip(zipBuffer, {
24095
24129
  targetPluginId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openlearn-next",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "private": false,
5
5
  "description": "A plugin-driven Educational OS / LMS platform with AI agent teaching assistant",
6
6
  "keywords": [
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@google/genai": "^2.4.0",
61
- "@openlearn/plugin-sdk": "^3.5.2",
61
+ "@openlearn/plugin-sdk": "3.6.0",
62
62
  "@types/reveal.js": "^5.2.2",
63
63
  "bcryptjs": "^3.0.3",
64
64
  "better-sqlite3": "^12.11.1",