openlearn-next 0.3.3 → 0.3.4

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 (29) hide show
  1. package/dist/assets/{BatchPickerModal-2jsnyMYM.js → BatchPickerModal-CY5i3NQK.js} +1 -1
  2. package/dist/assets/{ClassesView-DUnZ5nFa.js → ClassesView-CnH8J5qP.js} +1 -1
  3. package/dist/assets/{CloudDriveModal-DXJktxoq.js → CloudDriveModal-CDIeKEs0.js} +1 -1
  4. package/dist/assets/{CourseManagement-ChHr_wNd.js → CourseManagement-DtpcoEym.js} +1 -1
  5. package/dist/assets/{CourseWizardModal-RAaltA_q.js → CourseWizardModal-CxT0II5U.js} +1 -1
  6. package/dist/assets/{Dashboard-BMXQhpnj.js → Dashboard-bLZ4SuB2.js} +1 -1
  7. package/dist/assets/{ExportWeightModal-BwW76Kqo.js → ExportWeightModal-DKWU7X1K.js} +1 -1
  8. package/dist/assets/{HelpView-BqUqq-QE.js → HelpView-DREbhrK_.js} +2 -2
  9. package/dist/assets/{ImportLessonsModal-DHLxg68P.js → ImportLessonsModal-CZuiK5N1.js} +1 -1
  10. package/dist/assets/{InteractiveCoursewareViewer-C8uZcebL.js → InteractiveCoursewareViewer-BbnRpnsW.js} +1 -1
  11. package/dist/assets/{InteractiveWhiteboard-C2HAx6zv.js → InteractiveWhiteboard-S80ZfeL0.js} +1 -1
  12. package/dist/assets/{LazyCourseware-C1bH8aKj.js → LazyCourseware-m3sBCM3Y.js} +1 -1
  13. package/dist/assets/{LazyWhiteboard-DE9sMBUF.js → LazyWhiteboard-Madzjeuh.js} +1 -1
  14. package/dist/assets/{LessonEditorView-mIxHUfYb.js → LessonEditorView-DtcWzFob.js} +1 -1
  15. package/dist/assets/{LiveClassroomView-DNGZaCC8.js → LiveClassroomView-DNTEVhxr.js} +1 -1
  16. package/dist/assets/{NotificationDetailModal-CPrHxHcC.js → NotificationDetailModal-CW42lyh0.js} +1 -1
  17. package/dist/assets/{PluginView-DSLBfNDj.js → PluginView-D70yD5sS.js} +1 -1
  18. package/dist/assets/{QuizGeneratorModal-CoeGXKck.js → QuizGeneratorModal-Vmdm_KlA.js} +1 -1
  19. package/dist/assets/{StudentAssignmentView-V7Kp6TnP.js → StudentAssignmentView-D036KnMv.js} +1 -1
  20. package/dist/assets/{StudentLessonView-IZVXM5kz.js → StudentLessonView-DFsfAhgG.js} +1 -1
  21. package/dist/assets/{StudentPreviewModal-DwumAjWX.js → StudentPreviewModal-B_ITJvkQ.js} +1 -1
  22. package/dist/assets/{StudentView-3mCaDwFB.js → StudentView-BSfVCBSV.js} +1 -1
  23. package/dist/assets/{SystemResourceLibraryModal-B6ms798K.js → SystemResourceLibraryModal-Cxjj_pd-.js} +1 -1
  24. package/dist/assets/{TeacherView-BVd_ZMFH.js → TeacherView-B7FWfCWx.js} +1 -1
  25. package/dist/assets/{index-Vr-_Vpp3.js → index-BER4YuRi.js} +1 -1
  26. package/dist/assets/{index-Cwf8LQbY.js → index-BWsJ_lVr.js} +3 -3
  27. package/dist/index.html +1 -1
  28. package/dist/server.cjs +55 -57
  29. package/package.json +1 -1
package/dist/index.html CHANGED
@@ -15,7 +15,7 @@
15
15
  }
16
16
  }
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-Cwf8LQbY.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-BWsJ_lVr.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
@@ -2819,11 +2819,12 @@ parentPort.on('message', async function(msg) {
2819
2819
  });
2820
2820
  `;
2821
2821
  }
2822
- var import_node_worker_threads, import_fs4, import_uuid12, ALL_SERVICE_TOKENS, MAX_WORKERS, ACTIVATE_TIMEOUT_MS, ACTIVATE_PROGRESS_SLIDE_MS, WorkerRegistry, WorkerManager;
2822
+ var import_node_worker_threads, import_fs4, import_node_path2, import_uuid12, ALL_SERVICE_TOKENS, MAX_WORKERS, ACTIVATE_TIMEOUT_MS, ACTIVATE_PROGRESS_SLIDE_MS, WorkerRegistry, WorkerManager;
2823
2823
  var init_worker_manager = __esm({
2824
2824
  "packages/core/worker-runtime/worker-manager.ts"() {
2825
2825
  import_node_worker_threads = require("node:worker_threads");
2826
2826
  import_fs4 = __toESM(require("fs"), 1);
2827
+ import_node_path2 = __toESM(require("node:path"), 1);
2827
2828
  init_transport();
2828
2829
  init_service_host();
2829
2830
  init_logger();
@@ -3116,12 +3117,13 @@ var init_worker_manager = __esm({
3116
3117
  const bootstrapDataUrl = `data:text/javascript;base64,${encodedBootstrap}`;
3117
3118
  let worker;
3118
3119
  try {
3120
+ const resolvedPluginDir = pluginDir && import_fs4.default.existsSync(import_node_path2.default.join(pluginDir, "index.js")) ? pluginDir : void 0;
3119
3121
  worker = new import_node_worker_threads.Worker(new URL(bootstrapDataUrl), {
3120
3122
  // Pass both the DB id (`pluginId` — used as the actor/registry key)
3121
3123
  // and `manifestId` (used as the namespace prefix for command types).
3122
3124
  // The two diverge for ZIP-uploaded plugins whose DB id is a generated
3123
3125
  // UUID while manifest.id is the plugin author's chosen name.
3124
- workerData: { pluginId, manifestId: manifest.id, serviceTokens, pluginDir },
3126
+ workerData: { pluginId, manifestId: manifest.id, serviceTokens, pluginDir: resolvedPluginDir },
3125
3127
  eval: false,
3126
3128
  stdout: true,
3127
3129
  stderr: true,
@@ -3335,7 +3337,6 @@ __export(server_exports, {
3335
3337
  module.exports = __toCommonJS(server_exports);
3336
3338
  var import_express3 = __toESM(require("express"), 1);
3337
3339
  var import_path15 = __toESM(require("path"), 1);
3338
- var import_fs14 = __toESM(require("fs"), 1);
3339
3340
  var import_dotenv = __toESM(require("dotenv"), 1);
3340
3341
  var import_http = require("http");
3341
3342
  var import_socket = require("socket.io");
@@ -4418,7 +4419,7 @@ var VfsPlugin = {
4418
4419
  "@openlearn/core:IDatabase@^1.0.0"
4419
4420
  ],
4420
4421
  capabilitiesProposed: ["vfs:read", "vfs:write"],
4421
- engines: { openlearn: "^0.2.5" }
4422
+ engines: { openlearn: ">=0.2.5" }
4422
4423
  },
4423
4424
  activate: async (ctx) => {
4424
4425
  const commandBus = ctx.services.commandBus;
@@ -4584,7 +4585,7 @@ var ProcessPlugin = {
4584
4585
  "@openlearn/core:IDatabase@^1.0.0"
4585
4586
  ],
4586
4587
  capabilitiesProposed: ["process:read", "process:write"],
4587
- engines: { openlearn: "^0.2.5" }
4588
+ engines: { openlearn: ">=0.2.5" }
4588
4589
  },
4589
4590
  activate: async (ctx) => {
4590
4591
  const commandBus = ctx.services.commandBus;
@@ -4715,7 +4716,7 @@ var ManagementPlugin = {
4715
4716
  "@openlearn/core:IDatabase@^1.0.0"
4716
4717
  ],
4717
4718
  capabilitiesProposed: ["class:read", "class:write", "student:read", "student:write"],
4718
- engines: { openlearn: "^0.2.5" }
4719
+ engines: { openlearn: ">=0.2.5" }
4719
4720
  },
4720
4721
  activate: async (ctx) => {
4721
4722
  const commandBus = ctx.services.commandBus;
@@ -5614,7 +5615,7 @@ var AiSubmitInjectorPlugin = {
5614
5615
  "@openlearn/core:IAIService@^1.0.0"
5615
5616
  ],
5616
5617
  capabilitiesProposed: [],
5617
- engines: { openlearn: "^0.2.5" }
5618
+ engines: { openlearn: ">=0.2.5" }
5618
5619
  },
5619
5620
  activate: async (ctx) => {
5620
5621
  const eventBus = ctx.services.eventBus;
@@ -5706,7 +5707,7 @@ var BuiltinPlugin = {
5706
5707
  "@openlearn/core:IPluginHost@^1.0.0"
5707
5708
  ],
5708
5709
  capabilitiesProposed: ["lesson:read", "lesson:write", "whiteboard:read", "whiteboard:write"],
5709
- engines: { openlearn: "^0.2.5" }
5710
+ engines: { openlearn: ">=0.2.5" }
5710
5711
  },
5711
5712
  activate: async (ctx) => {
5712
5713
  const commandBus = ctx.services.commandBus;
@@ -7125,7 +7126,7 @@ var AiPlannerPlugin = {
7125
7126
  "@openlearn/core:IEventBusService@^1.0.0"
7126
7127
  ],
7127
7128
  capabilitiesProposed: ["process:write", "lesson:write", "assignment:write"],
7128
- engines: { openlearn: "^0.2.5" }
7129
+ engines: { openlearn: ">=0.2.5" }
7129
7130
  },
7130
7131
  activate: async (ctx) => {
7131
7132
  const commandBus = ctx.services.commandBus;
@@ -7311,7 +7312,7 @@ var AssignmentEvalPlugin = {
7311
7312
  "@openlearn/core:ISemesterGradeService@^1.0.0"
7312
7313
  ],
7313
7314
  capabilitiesProposed: ["lesson:read", "lesson:write"],
7314
- engines: { openlearn: "^0.2.5" }
7315
+ engines: { openlearn: ">=0.2.5" }
7315
7316
  },
7316
7317
  activate: async (ctx) => {
7317
7318
  const commandBus = ctx.services.commandBus;
@@ -8252,6 +8253,10 @@ var HotReloadActivationError = class extends HotReloadError {
8252
8253
  // packages/core/plugin-host/index.ts
8253
8254
  init_interfaces();
8254
8255
 
8256
+ // packages/core/version.ts
8257
+ var PLATFORM_VERSION = "0.3.4";
8258
+ var OPENLEARN_VERSION = PLATFORM_VERSION;
8259
+
8255
8260
  // packages/core/plugin-host/plugin-runtime-composition.ts
8256
8261
  var PluginRuntimeComposition = class {
8257
8262
  constructor(pluginHost, workerManager) {
@@ -8259,7 +8264,7 @@ var PluginRuntimeComposition = class {
8259
8264
  this.workerManager = workerManager;
8260
8265
  this.id = "srv_plugin_runtime_composition";
8261
8266
  this.name = "PluginRuntimeComposition";
8262
- this.version = "0.2.5";
8267
+ this.version = PLATFORM_VERSION;
8263
8268
  this._isStarted = false;
8264
8269
  }
8265
8270
  get isStarted() {
@@ -8313,7 +8318,7 @@ var PluginLifecycleManager = class {
8313
8318
  this.pluginHost = pluginHost;
8314
8319
  this.id = "srv_plugin_lifecycle_manager";
8315
8320
  this.name = "PluginLifecycleManager";
8316
- this.version = "0.2.5";
8321
+ this.version = PLATFORM_VERSION;
8317
8322
  }
8318
8323
  getPluginState(pluginId) {
8319
8324
  return this.pluginHost.getPluginState(pluginId);
@@ -8360,7 +8365,7 @@ var PluginCapabilityGateway = class {
8360
8365
  this.capabilityRegistry = capabilityRegistry;
8361
8366
  this.id = "srv_plugin_capability_gateway";
8362
8367
  this.name = "PluginCapabilityGateway";
8363
- this.version = "0.2.5";
8368
+ this.version = PLATFORM_VERSION;
8364
8369
  }
8365
8370
  listCapabilities() {
8366
8371
  const rawCaps = this.capabilityRegistry.listCapabilities();
@@ -8414,7 +8419,7 @@ var UnifiedExtensionRegistry = class {
8414
8419
  constructor() {
8415
8420
  this.id = "srv_unified_extension_registry";
8416
8421
  this.name = "UnifiedExtensionRegistry";
8417
- this.version = "0.2.5";
8422
+ this.version = PLATFORM_VERSION;
8418
8423
  this._extensions = /* @__PURE__ */ new Map();
8419
8424
  }
8420
8425
  registerExtension(category, id, impl, meta) {
@@ -8519,7 +8524,7 @@ var PluginDistributionManager = class {
8519
8524
  this.pluginHost = pluginHost;
8520
8525
  this.id = "srv_plugin_distribution_manager";
8521
8526
  this.name = "PluginDistributionManager";
8522
- this.version = "0.2.5";
8527
+ this.version = PLATFORM_VERSION;
8523
8528
  this._repositories = /* @__PURE__ */ new Map();
8524
8529
  }
8525
8530
  registerRepository(repo) {
@@ -8558,11 +8563,11 @@ var PluginDistributionManager = class {
8558
8563
  return;
8559
8564
  }
8560
8565
  const filePath = this.pluginHost.getPluginFilePath(this.pluginHost.resolvePluginUuid(pluginId));
8561
- const fs16 = await import("node:fs");
8562
- if (!fs16.existsSync(filePath)) {
8566
+ const fs15 = await import("node:fs");
8567
+ if (!fs15.existsSync(filePath)) {
8563
8568
  throw new Error(`Cannot reload plugin "${pluginId}": source file missing at ${filePath}`);
8564
8569
  }
8565
- const code = fs16.readFileSync(filePath, "utf-8");
8570
+ const code = fs15.readFileSync(filePath, "utf-8");
8566
8571
  await this.pluginHost.reloadPlugin(pluginId, code);
8567
8572
  }
8568
8573
  async updateFromZip(zipBuffer, options = {}) {
@@ -8608,7 +8613,6 @@ function validatePluginStateTransition(currentState, nextState, pluginId) {
8608
8613
  }
8609
8614
  var ACTIVATION_TIMEOUT_MS = 5e3;
8610
8615
  var DEACTIVATION_TIMEOUT_MS = 5e3;
8611
- var OPENLEARN_VERSION = "0.2.5";
8612
8616
  function createPluginStaticMiddleware(absDir) {
8613
8617
  return [
8614
8618
  (_req, res, next) => {
@@ -10708,8 +10712,8 @@ var HotReloadController = class {
10708
10712
  const timer = setTimeout(async () => {
10709
10713
  this.debounceTimers.delete(pluginId);
10710
10714
  try {
10711
- const fs16 = await import("fs/promises");
10712
- const newSourceCode = await fs16.readFile(filePath, "utf-8");
10715
+ const fs15 = await import("fs/promises");
10716
+ const newSourceCode = await fs15.readFile(filePath, "utf-8");
10713
10717
  console.log(
10714
10718
  `[HotReload] File changed: ${filePath} \u2192 triggering reload for "${pluginId}"`
10715
10719
  );
@@ -16252,7 +16256,7 @@ var StartupTimeoutError = class extends PlatformBootstrapError {
16252
16256
  this.name = "StartupTimeoutError";
16253
16257
  }
16254
16258
  };
16255
- var PLATFORM_VERSION = "0.2.5";
16259
+ var PLATFORM_VERSION2 = "0.3.4";
16256
16260
  var BOOTSTRAP_STAGE_NAMES = Object.freeze([
16257
16261
  "Created" /* Created */,
16258
16262
  "Configuring" /* Configuring */,
@@ -16629,7 +16633,7 @@ var PlatformBuilder = class _PlatformBuilder {
16629
16633
  this._logger.info("Build Started");
16630
16634
  const platformContext = {
16631
16635
  platformId: `plt_${globalThis.crypto.randomUUID()}`,
16632
- version: PLATFORM_VERSION,
16636
+ version: PLATFORM_VERSION2,
16633
16637
  namespace: "openlearn.core",
16634
16638
  mode: this._config.mode,
16635
16639
  environment: {
@@ -16651,7 +16655,7 @@ var PlatformBuilder = class _PlatformBuilder {
16651
16655
  arch: process.arch,
16652
16656
  processId: process.pid,
16653
16657
  memoryUsage: process.memoryUsage(),
16654
- buildVersion: PLATFORM_VERSION
16658
+ buildVersion: PLATFORM_VERSION2
16655
16659
  },
16656
16660
  bootstrapState: "Bootstrapping",
16657
16661
  logger: this._logger,
@@ -16690,7 +16694,7 @@ var PlatformBuilder = class _PlatformBuilder {
16690
16694
  buildDurationMs,
16691
16695
  validation,
16692
16696
  metadata: Object.fromEntries(this._metadata.entries()),
16693
- builderVersion: PLATFORM_VERSION
16697
+ builderVersion: PLATFORM_VERSION2
16694
16698
  };
16695
16699
  return result;
16696
16700
  }
@@ -16954,10 +16958,10 @@ var PluginCompositionModule = class {
16954
16958
  const realPluginHost = options?.infrastructureRefs?.get("pluginHost") ?? { name: "PluginHostService", isReady: true, pluginsCount: 0 };
16955
16959
  const realContributionRegistry = options?.infrastructureRefs?.get("contributionRegistry") ?? { name: "ContributionRegistry", slotsCount: 0 };
16956
16960
  const realRuntimeComposition = options?.infrastructureRefs?.get("runtimeComposition") ?? { name: "PluginRuntimeComposition", isStarted: true };
16957
- const realLifecycleManager = options?.infrastructureRefs?.get("lifecycleManager") ?? { name: "PluginLifecycleManager", version: "0.2.5" };
16958
- const realCapabilityGateway = options?.infrastructureRefs?.get("capabilityGateway") ?? { name: "PluginCapabilityGateway", version: "0.2.5" };
16959
- const realExtensionRegistry = options?.infrastructureRefs?.get("extensionRegistry") ?? { name: "UnifiedExtensionRegistry", version: "0.2.5" };
16960
- const realDistributionManager = options?.infrastructureRefs?.get("distributionManager") ?? { name: "PluginDistributionManager", version: "0.2.5" };
16961
+ const realLifecycleManager = options?.infrastructureRefs?.get("lifecycleManager") ?? { name: "PluginLifecycleManager", version: PLATFORM_VERSION };
16962
+ const realCapabilityGateway = options?.infrastructureRefs?.get("capabilityGateway") ?? { name: "PluginCapabilityGateway", version: PLATFORM_VERSION };
16963
+ const realExtensionRegistry = options?.infrastructureRefs?.get("extensionRegistry") ?? { name: "UnifiedExtensionRegistry", version: PLATFORM_VERSION };
16964
+ const realDistributionManager = options?.infrastructureRefs?.get("distributionManager") ?? { name: "PluginDistributionManager", version: PLATFORM_VERSION };
16961
16965
  registerOrReplace({
16962
16966
  id: "srv_plugin_host",
16963
16967
  lifetime: "Singleton",
@@ -24669,6 +24673,28 @@ async function startServer() {
24669
24673
  registerPluginsRoutes(ctx);
24670
24674
  setupRealtimeBridge({ eventBus: kernelContainer.eventBus, io, db: kernelContainer.db });
24671
24675
  setupPresence({ io, eventBus: kernelContainer.eventBus });
24676
+ const startTime = Date.now();
24677
+ const platformVersion = PLATFORM_VERSION;
24678
+ app.get("/health", (_req, res) => {
24679
+ res.json({ status: "ok", uptime: Math.floor((Date.now() - startTime) / 1e3), version: platformVersion });
24680
+ });
24681
+ app.get("/health/ready", (_req, res) => {
24682
+ try {
24683
+ kernelContainer.db.prepare("SELECT 1").get();
24684
+ const workerCount = kernelContainer.workerManager?.registry?.activeCount ?? 0;
24685
+ res.json({ status: "ready", db: "connected", workers: workerCount });
24686
+ } catch (e) {
24687
+ res.status(503).json({ status: "not_ready", error: e.message });
24688
+ }
24689
+ });
24690
+ app.get("/metrics", requireAuth("administrator"), (_req, res) => {
24691
+ const mem = process.memoryUsage();
24692
+ res.json({
24693
+ uptime: Math.floor((Date.now() - startTime) / 1e3),
24694
+ memory: { rss: Math.round(mem.rss / 1024 / 1024) + "MB", heapUsed: Math.round(mem.heapUsed / 1024 / 1024) + "MB" },
24695
+ nodeVersion: process.version
24696
+ });
24697
+ });
24672
24698
  if (process.env.NODE_ENV !== "production") {
24673
24699
  const { createServer: createViteServer } = await import("vite");
24674
24700
  const vite = await createViteServer({
@@ -24701,34 +24727,6 @@ async function startServer() {
24701
24727
  console.error("HTTP Server error:", err);
24702
24728
  }
24703
24729
  });
24704
- const startTime = Date.now();
24705
- let platformVersion = "0.0.0";
24706
- try {
24707
- const pkgPath = import_path15.default.join(process.cwd(), "package.json");
24708
- const pkg = JSON.parse(import_fs14.default.readFileSync(pkgPath, "utf-8"));
24709
- platformVersion = pkg.version ?? platformVersion;
24710
- } catch {
24711
- }
24712
- app.get("/health", (_req, res) => {
24713
- res.json({ status: "ok", uptime: Math.floor((Date.now() - startTime) / 1e3), version: platformVersion });
24714
- });
24715
- app.get("/health/ready", (_req, res) => {
24716
- try {
24717
- kernelContainer.db.prepare("SELECT 1").get();
24718
- const workerCount = kernelContainer.workerManager?.registry?.activeCount ?? 0;
24719
- res.json({ status: "ready", db: "connected", workers: workerCount });
24720
- } catch (e) {
24721
- res.status(503).json({ status: "not_ready", error: e.message });
24722
- }
24723
- });
24724
- app.get("/metrics", requireAuth("administrator"), (_req, res) => {
24725
- const mem = process.memoryUsage();
24726
- res.json({
24727
- uptime: Math.floor((Date.now() - startTime) / 1e3),
24728
- memory: { rss: Math.round(mem.rss / 1024 / 1024) + "MB", heapUsed: Math.round(mem.heapUsed / 1024 / 1024) + "MB" },
24729
- nodeVersion: process.version
24730
- });
24731
- });
24732
24730
  httpServer.listen(PORT, "0.0.0.0", () => {
24733
24731
  const url = `http://localhost:${PORT}`;
24734
24732
  const OSC = "\x1B]8;;";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openlearn-next",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "private": false,
5
5
  "description": "A plugin-driven Educational OS / LMS platform with AI agent teaching assistant",
6
6
  "keywords": [