aboutsummaryrefslogtreecommitdiff
path: root/course/chapters/05-modules.json
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-10-18 14:05:18 +0200
committerAgando <roduccomm@gmail.com>2026-10-18 14:05:18 +0200
commit0d0d936e7b5cd41a31773069540b1ddb8836ef44 (patch)
tree273e7ee9a72453655119bf0f63efb9b61e193d7f /course/chapters/05-modules.json
parent526c420f4591f0a58f805b473fa76d3da2981eae (diff)
newOS4: interactive AI course (terminal module, portal, atlas, telemetry, daily maintenance+cron) + free store card
Diffstat (limited to 'course/chapters/05-modules.json')
-rw-r--r--course/chapters/05-modules.json115
1 files changed, 115 insertions, 0 deletions
diff --git a/course/chapters/05-modules.json b/course/chapters/05-modules.json
new file mode 100644
index 0000000..4b68f42
--- /dev/null
+++ b/course/chapters/05-modules.json
@@ -0,0 +1,115 @@
+{
+ "id": "05-modules",
+ "title": "Modules & packages",
+ "icon": "🧩",
+ "level": "intermediate",
+ "lessons": [
+ {
+ "id": "5.1",
+ "title": "Browse and install modules",
+ "objective": "See what is loaded and install from the WebX11 package index.",
+ "minutes": 8,
+ "commands": [
+ "modules",
+ "wpm",
+ "load-local"
+ ],
+ "blocks": [
+ {
+ "type": "text",
+ "text": "`wpm` is the package manager for terminal modules: list the index, install a module from `packages.json` or a URL."
+ },
+ {
+ "type": "cmd",
+ "text": "wpm list"
+ },
+ {
+ "type": "cmd",
+ "text": "modules"
+ },
+ {
+ "type": "text",
+ "text": "Every ext module in the default build auto-loads. There is no separate “needs loadmod” tier."
+ },
+ {
+ "type": "cmd",
+ "text": "load-local modules/ext/calc.js"
+ }
+ ],
+ "exercise": {
+ "instruction": "List available packages.",
+ "accept": [
+ "wpm list"
+ ],
+ "check": {
+ "type": "command"
+ },
+ "hint": "Type: wpm list"
+ },
+ "quiz": {
+ "q": "What does wpm install?",
+ "options": [
+ "terminal modules",
+ "system packages",
+ "browser extensions"
+ ],
+ "answer": 0
+ },
+ "sources": [
+ "modules/ext/wpm.js",
+ "packages.json",
+ "modules/core/module-loader.js"
+ ]
+ },
+ {
+ "id": "5.2",
+ "title": "Module anatomy (a complete mini module)",
+ "objective": "Read the contract every module follows: class, commands map, help info, registration.",
+ "minutes": 12,
+ "commands": [
+ "load-local"
+ ],
+ "blocks": [
+ {
+ "type": "text",
+ "text": "A module is a class with `commands`, `registerCommands()`, `getHelpInfo()` and optionally `init(terminal)`. The module manager injects `terminal` before calling `registerCommands()`."
+ },
+ {
+ "type": "code",
+ "text": "class HelloModule {\n constructor(){ this.commands = {}; }\n getHelpInfo(){ return { hello: 'hello — print a greeting' }; }\n registerCommands(){ this.commands['hello'] = () => this.terminal.print('hello newOS4'); }\n}"
+ },
+ {
+ "type": "tip",
+ "text": "Tier-3 modules register at the end with `webx11.moduleManager.registerModule(new HelloModule(), url)`."
+ },
+ {
+ "type": "cmd",
+ "text": "modules"
+ }
+ ],
+ "exercise": {
+ "instruction": "Open the module list and find a module you have not used.",
+ "accept": [
+ "modules"
+ ],
+ "check": {
+ "type": "command"
+ },
+ "hint": "Type: modules"
+ },
+ "quiz": {
+ "q": "What does the module manager inject before registerCommands()?",
+ "options": [
+ "the terminal",
+ "the database",
+ "nothing"
+ ],
+ "answer": 0
+ },
+ "sources": [
+ "modules/core/module-manager.js",
+ "modules/ext/kanban.js"
+ ]
+ }
+ ]
+} \ No newline at end of file