@jossuealcala/madre 1.0.4 → 1.1.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.
Files changed (273) hide show
  1. package/ADDITIONAL-TERMS.md +7 -2
  2. package/CHANGELOG.en.md +152 -1
  3. package/CHANGELOG.md +152 -1
  4. package/CONTRIBUTING.md +2 -2
  5. package/LICENSE +111 -661
  6. package/NOTICE +59 -24
  7. package/README.en.md +36 -204
  8. package/README.md +36 -210
  9. package/SECURITY.md +1 -0
  10. package/TRADEMARKS.en.md +13 -14
  11. package/TRADEMARKS.md +42 -26
  12. package/bin/madre.cjs +2 -2
  13. package/bin/madre.mjs +114 -42
  14. package/docs/REFERENCE.md +53 -6
  15. package/docs/SDK.md +44 -5
  16. package/docs/en/REFERENCE.md +53 -6
  17. package/docs/en/SDK.md +43 -4
  18. package/docs/madre-banner.png +0 -0
  19. package/docs/sdk/hello-module.mjs +3 -0
  20. package/package.json +3 -2
  21. package/public/abduction.js +6 -6
  22. package/public/activity.js +425 -0
  23. package/public/app.js +3519 -647
  24. package/public/assets/abduction-cat-blink.webp +0 -0
  25. package/public/assets/abduction-cat-control-left.webp +0 -0
  26. package/public/assets/abduction-cat-control-right.webp +0 -0
  27. package/public/assets/abduction-cat.webp +0 -0
  28. package/public/assets/manual/shots/en-agents.webp +0 -0
  29. package/public/assets/manual/shots/en-chats.webp +0 -0
  30. package/public/assets/manual/shots/en-code.webp +0 -0
  31. package/public/assets/manual/shots/en-composer.webp +0 -0
  32. package/public/assets/manual/shots/en-connectors.webp +0 -0
  33. package/public/assets/manual/shots/en-continuity.webp +0 -0
  34. package/public/assets/manual/shots/en-coordinator.webp +0 -0
  35. package/public/assets/manual/shots/en-copilot.webp +0 -0
  36. package/public/assets/manual/shots/en-diagnostics.webp +0 -0
  37. package/public/assets/manual/shots/en-home.webp +0 -0
  38. package/public/assets/manual/shots/en-local.webp +0 -0
  39. package/public/assets/manual/shots/en-market.webp +0 -0
  40. package/public/assets/manual/shots/en-memory.webp +0 -0
  41. package/public/assets/manual/shots/en-modes.webp +0 -0
  42. package/public/assets/manual/shots/en-notes.webp +0 -0
  43. package/public/assets/manual/shots/en-settings.webp +0 -0
  44. package/public/assets/manual/shots/en-welcome.webp +0 -0
  45. package/public/assets/manual/shots/en-windows.webp +0 -0
  46. package/public/assets/manual/shots/es-agents.webp +0 -0
  47. package/public/assets/manual/shots/es-chats.webp +0 -0
  48. package/public/assets/manual/shots/es-code.webp +0 -0
  49. package/public/assets/manual/shots/es-composer.webp +0 -0
  50. package/public/assets/manual/shots/es-connectors.webp +0 -0
  51. package/public/assets/manual/shots/es-continuity.webp +0 -0
  52. package/public/assets/manual/shots/es-coordinator.webp +0 -0
  53. package/public/assets/manual/shots/es-copilot.webp +0 -0
  54. package/public/assets/manual/shots/es-diagnostics.webp +0 -0
  55. package/public/assets/manual/shots/es-home.webp +0 -0
  56. package/public/assets/manual/shots/es-local.webp +0 -0
  57. package/public/assets/manual/shots/es-market.webp +0 -0
  58. package/public/assets/manual/shots/es-memory.webp +0 -0
  59. package/public/assets/manual/shots/es-modes.webp +0 -0
  60. package/public/assets/manual/shots/es-notes.webp +0 -0
  61. package/public/assets/manual/shots/es-settings.webp +0 -0
  62. package/public/assets/manual/shots/es-welcome.webp +0 -0
  63. package/public/assets/manual/shots/es-windows.webp +0 -0
  64. package/public/assets/news/1.1/en/chats.webp +0 -0
  65. package/public/assets/news/1.1/en/home.webp +0 -0
  66. package/public/assets/news/1.1/en/maps.webp +0 -0
  67. package/public/assets/news/1.1/en/market.webp +0 -0
  68. package/public/assets/news/1.1/en/permissions.webp +0 -0
  69. package/public/assets/news/1.1/en/privacy.webp +0 -0
  70. package/public/assets/news/1.1/en/welcome.webp +0 -0
  71. package/public/assets/news/1.1/es/chats.webp +0 -0
  72. package/public/assets/news/1.1/es/home.webp +0 -0
  73. package/public/assets/news/1.1/es/maps.webp +0 -0
  74. package/public/assets/news/1.1/es/market.webp +0 -0
  75. package/public/assets/news/1.1/es/permissions.webp +0 -0
  76. package/public/assets/news/1.1/es/privacy.webp +0 -0
  77. package/public/assets/news/1.1/es/welcome.webp +0 -0
  78. package/public/attribution.js +15 -16
  79. package/public/brands.js +2 -2
  80. package/public/code-tools.js +2 -2
  81. package/public/editor.js +13 -13
  82. package/public/en.js +483 -0
  83. package/public/es.js +1817 -598
  84. package/public/hardware.js +2 -2
  85. package/public/i18n.js +47 -9
  86. package/public/icons.js +158 -0
  87. package/public/index.html +68 -51
  88. package/public/inquiry.js +2 -2
  89. package/public/loader.js +271 -2
  90. package/public/macroverso.js +60 -21
  91. package/public/manual-content.js +900 -0
  92. package/public/manual-shots.js +47 -0
  93. package/public/manual.css +246 -0
  94. package/public/manual.html +15 -0
  95. package/public/manual.js +427 -0
  96. package/public/market-art.js +99 -41
  97. package/public/market-view.js +243 -47
  98. package/public/market.js +139 -26
  99. package/public/mcp-catalog.js +62 -0
  100. package/public/neural.js +64 -8
  101. package/public/nostromo-engine.js +709 -40
  102. package/public/page-errors.js +29 -0
  103. package/public/power.js +350 -11
  104. package/public/remedy.js +89 -0
  105. package/public/resay.js +4 -2
  106. package/public/review-ask.js +12 -7
  107. package/public/routing.js +3 -3
  108. package/public/salas-mac.css +875 -48
  109. package/public/salas-mac.html +27 -15
  110. package/public/salas-mac.js +1668 -338
  111. package/public/salas.css +2 -2
  112. package/public/salas.html +3 -3
  113. package/public/salas.js +3 -3
  114. package/public/styles.css +2694 -323
  115. package/public/syntax.js +2 -2
  116. package/public/terms.js +152 -0
  117. package/public/touch.js +2 -2
  118. package/public/tour-chapters.js +100 -92
  119. package/public/tour.js +118 -28
  120. package/public/troubleshooting.js +327 -21
  121. package/public/wallpaper.js +4 -3
  122. package/public/welcome.js +923 -0
  123. package/src/activity.mjs +85 -0
  124. package/src/adapters/claude.mjs +61 -35
  125. package/src/adapters/codex.mjs +18 -5
  126. package/src/adapters/cursor.mjs +60 -9
  127. package/src/adapters/gemini.mjs +17 -4
  128. package/src/adapters/madre.mjs +30 -9
  129. package/src/adapters/opencode.mjs +73 -10
  130. package/src/adapters/process.mjs +19 -15
  131. package/src/adapters/subagents.mjs +159 -0
  132. package/src/asking.mjs +8 -2
  133. package/src/auth-probe.mjs +47 -11
  134. package/src/bridge/devices.mjs +2 -2
  135. package/src/bridge/handoff.mjs +2 -2
  136. package/src/bridge/host.mjs +2 -2
  137. package/src/bridge/network.mjs +2 -2
  138. package/src/bridge/policy.mjs +3 -3
  139. package/src/bridge/qr.mjs +2 -2
  140. package/src/bridge/server.mjs +3 -3
  141. package/src/builtin-updates.mjs +87 -0
  142. package/src/capabilities.mjs +5 -5
  143. package/src/chats.mjs +51 -2
  144. package/src/checkpoint.mjs +67 -9
  145. package/src/choices.mjs +2 -2
  146. package/src/cli-args.mjs +2 -2
  147. package/src/cold.mjs +2 -2
  148. package/src/commands.mjs +2 -2
  149. package/src/config.mjs +2 -2
  150. package/src/conversation-context.mjs +2 -2
  151. package/src/credentials.mjs +80 -18
  152. package/src/dataset.mjs +2 -2
  153. package/src/directives.mjs +2 -2
  154. package/src/distiller.mjs +2 -2
  155. package/src/embeddings.mjs +2 -2
  156. package/src/enlaces.mjs +2 -2
  157. package/src/environment.mjs +147 -0
  158. package/src/event-store.mjs +2 -2
  159. package/src/exam.mjs +2 -2
  160. package/src/extensions.mjs +2 -2
  161. package/src/eyecat-watch.mjs +2 -2
  162. package/src/eyecat.mjs +2 -2
  163. package/src/file-ops.mjs +2 -2
  164. package/src/files.mjs +2 -2
  165. package/src/github.mjs +2 -2
  166. package/src/heartbeat.mjs +2 -2
  167. package/src/history.mjs +76 -0
  168. package/src/i18n.mjs +32 -3
  169. package/src/image-studio.mjs +2 -2
  170. package/src/install-metrics.mjs +109 -0
  171. package/src/json-file.mjs +2 -2
  172. package/src/launch.mjs +2 -2
  173. package/src/lease.mjs +15 -4
  174. package/src/lobby-work.mjs +11 -4
  175. package/src/local-ai.mjs +12 -4
  176. package/src/looks.mjs +19 -7
  177. package/src/market-check.mjs +165 -0
  178. package/src/market-key.mjs +10 -2
  179. package/src/market-license.mjs +104 -0
  180. package/src/market-remote.mjs +71 -13
  181. package/src/maturity.mjs +2 -2
  182. package/src/mcp/connect.mjs +2 -2
  183. package/src/mcp/github-server.mjs +2 -2
  184. package/src/mcp/image-server.mjs +2 -2
  185. package/src/mcp/memory-server.mjs +2 -2
  186. package/src/mcp/proxy.mjs +16 -5
  187. package/src/mcp/smtp-server.mjs +2 -2
  188. package/src/memory-dashboard.mjs +2 -2
  189. package/src/memory-tools.mjs +2 -2
  190. package/src/memory.mjs +2 -2
  191. package/src/models.mjs +115 -12
  192. package/src/module-scope.mjs +2 -2
  193. package/src/modules/ahp.mjs +2 -2
  194. package/src/modules/ash-policy.mjs +2 -2
  195. package/src/modules/ash.mjs +2 -2
  196. package/src/modules/bishop-exam.mjs +2 -2
  197. package/src/modules/bishop-plan.mjs +2 -2
  198. package/src/modules/bishop.mjs +9 -3
  199. package/src/modules/choices.mjs +2 -2
  200. package/src/modules/correo.mjs +2 -2
  201. package/src/modules/enlaces.mjs +2 -2
  202. package/src/modules/git-pulse.mjs +2 -2
  203. package/src/modules/github.mjs +2 -2
  204. package/src/modules/helpers.mjs +2 -2
  205. package/src/modules/image-studio.mjs +2 -2
  206. package/src/modules/index.mjs +92 -5
  207. package/src/modules/intents-calibration.mjs +2 -2
  208. package/src/modules/intents-desk.mjs +4 -3
  209. package/src/modules/intents-observe.mjs +2 -2
  210. package/src/modules/intents-policy.mjs +2 -2
  211. package/src/modules/intents-try.mjs +2 -2
  212. package/src/modules/intents.mjs +2 -2
  213. package/src/modules/local-models.mjs +41 -10
  214. package/src/modules/mcp-connect.mjs +2 -2
  215. package/src/modules/notes.mjs +281 -0
  216. package/src/modules/ollama.mjs +48 -13
  217. package/src/modules/playwright.mjs +16 -5
  218. package/src/modules/reminders.mjs +664 -0
  219. package/src/modules/ripley.mjs +3 -3
  220. package/src/modules/runs.mjs +2 -2
  221. package/src/modules/sdk.mjs +57 -9
  222. package/src/modules/updates.mjs +2 -2
  223. package/src/mother.mjs +13 -3
  224. package/src/npm-launch.mjs +2 -2
  225. package/src/ollama.mjs +8 -6
  226. package/src/opencode-health.mjs +83 -0
  227. package/src/outbound.mjs +35 -3
  228. package/src/override.mjs +27 -22
  229. package/src/ports.mjs +2 -2
  230. package/src/prices.mjs +2 -2
  231. package/src/privacy.mjs +2 -2
  232. package/src/quota-monitor.mjs +2 -2
  233. package/src/quota-sources.mjs +2 -2
  234. package/src/request-guard.mjs +2 -2
  235. package/src/review-ask.mjs +4 -3
  236. package/src/room/archivist.mjs +2 -2
  237. package/src/room/attachments.mjs +2 -2
  238. package/src/room/budget.mjs +2 -2
  239. package/src/room/context.mjs +2 -2
  240. package/src/room/control.mjs +2 -2
  241. package/src/room/copilot.mjs +2 -2
  242. package/src/room/economy.mjs +2 -2
  243. package/src/room/escalation.mjs +2 -2
  244. package/src/room/ghost.mjs +2 -2
  245. package/src/room/guard.mjs +6 -4
  246. package/src/room/prompt.mjs +3 -3
  247. package/src/room/returns.mjs +2 -2
  248. package/src/room/runs.mjs +6 -4
  249. package/src/room/vectors.mjs +2 -2
  250. package/src/room.mjs +144 -36
  251. package/src/router.mjs +2 -2
  252. package/src/runs.mjs +2 -2
  253. package/src/runtime-detection.mjs +36 -6
  254. package/src/salas.mjs +31 -6
  255. package/src/sentinel-errors.mjs +17 -7
  256. package/src/server-sentinel.mjs +2 -2
  257. package/src/server.mjs +980 -139
  258. package/src/setup-trouble.mjs +33 -0
  259. package/src/setup.mjs +4 -4
  260. package/src/smtp.mjs +2 -2
  261. package/src/telemetry.mjs +266 -0
  262. package/src/terms.mjs +43 -0
  263. package/src/tour.mjs +60 -7
  264. package/src/uninstall.mjs +225 -0
  265. package/src/updates.mjs +2 -2
  266. package/src/usage-sentinel.mjs +2 -2
  267. package/src/vault.mjs +2 -2
  268. package/src/verdict.mjs +13 -10
  269. package/src/whats-new.mjs +97 -3
  270. package/public/assets/abduction-cat-blink.png +0 -0
  271. package/public/assets/abduction-cat-control-left.png +0 -0
  272. package/public/assets/abduction-cat-control-right.png +0 -0
  273. package/public/assets/abduction-cat.png +0 -0
@@ -0,0 +1,225 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
+ // UNINSTALLING MADRE (2026-10-29), from Home's Settings: what MADRE put on this computer goes, and
4
+ // nothing else. Asked first (`uninstallPlan`, said in full on the page before anything happens),
5
+ // done last (`removeMadre`), once Home and every open project have closed the way «Turn MADRE off»
6
+ // closes them, so nothing writes again into a folder that is being taken away.
7
+ //
8
+ // What goes:
9
+ // · MADRE's own folder (~/.pulse, or PULSE_HOME): conversations, memory, settings, modules, the
10
+ // catalog, the identifier of this copy, and the AIs MADRE installed in its own folder (tools/).
11
+ // · Inside each project MADRE knows, its folder `.pulse/` — except `.pulse/out/`, where the AIs
12
+ // put what they created at #2, unless the person asks for that to go too.
13
+ // · Each of those projects' restore points (the shadow repository in the temporary folder).
14
+ // · The copy of MADRE npx downloaded. A global or a project install is npm's to remove: the page
15
+ // says the command.
16
+ // What stays: the projects and their files, `.madre/` inside a project (modules a person wrote),
17
+ // the AIs installed elsewhere and their sign-ins, Ollama and its models, npm's own cache.
18
+ import { readFileSync } from 'node:fs';
19
+ import { chmod, lstat, readdir, readFile, rm, rmdir } from 'node:fs/promises';
20
+ import { homedir } from 'node:os';
21
+ import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
22
+ import { execFile } from 'node:child_process';
23
+ import { promisify } from 'node:util';
24
+ import { CHECKPOINT_REF, isGitRepo, legacyShadowFolderFor, shadowFolderFor } from './checkpoint.mjs';
25
+ import { insideFolder, isSalasRoom, knownRooms } from './salas.mjs';
26
+
27
+ const KEEP_INSIDE = 'out';
28
+ // Something MADRE always writes in its folder: a folder with none of these is not taken for it.
29
+ const MADRE_MARKS = ['install-id', 'config.json', 'rooms', 'salas'];
30
+
31
+ const folderAt = async (path) => {
32
+ const found = await lstat(path).catch(() => null);
33
+ return Boolean(found?.isDirectory() && !found.isSymbolicLink());
34
+ };
35
+
36
+ // How many files are under a folder, links not followed. Counted to say it, never read.
37
+ async function countFiles(folder, limit = 100000) {
38
+ let count = 0;
39
+ const walk = async (dir) => {
40
+ const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
41
+ for (const entry of entries) {
42
+ if (count >= limit) return;
43
+ if (entry.isDirectory()) await walk(join(dir, entry.name));
44
+ else count += 1;
45
+ }
46
+ };
47
+ await walk(folder);
48
+ return count;
49
+ }
50
+
51
+ // The state folder is taken away whole, so it has to be MADRE's beyond doubt: absolute, never the
52
+ // home folder or one above it, never the root, and with something MADRE always writes in it.
53
+ export async function checkStateRoot(stateRoot, { home = homedir() } = {}) {
54
+ if (typeof stateRoot !== 'string' || !isAbsolute(stateRoot)) return false;
55
+ const root = resolve(stateRoot);
56
+ if (root === dirname(root) || insideFolder(resolve(home), root)) return false;
57
+ if (!(await folderAt(root))) return false;
58
+ const names = await readdir(root).catch(() => []);
59
+ return MADRE_MARKS.some((mark) => names.includes(mark));
60
+ }
61
+
62
+ // The folders npx made for this package: `…/_npx/<hash>/` whose own package.json asks for it and
63
+ // for nothing else. One per version ever run with npx, the running one among them.
64
+ export async function npxFolders({ script = process.argv[1] ?? '', name }) {
65
+ const path = String(script);
66
+ const at = path.replace(/\\/g, '/').indexOf('/_npx/');
67
+ if (at < 0 || !name) return [];
68
+ const base = path.slice(0, at + '/_npx'.length);
69
+ const out = [];
70
+ for (const hash of await readdir(base).catch(() => [])) {
71
+ if (!/^[0-9a-f]{8,}$/i.test(hash)) continue;
72
+ const folder = join(base, hash);
73
+ const wanted = await readFile(join(folder, 'package.json'), 'utf8').then((text) => Object.keys(JSON.parse(text).dependencies ?? {}), () => []);
74
+ if (wanted.length === 1 && wanted[0] === name && await folderAt(folder)) out.push(folder);
75
+ }
76
+ return out;
77
+ }
78
+
79
+ const execFileAsync = promisify(execFile);
80
+ // The repositories of a project that keep MADRE's restore points (QA 1.1.0, ACT-03). A turn in a
81
+ // git project photographs it under refs/madre/checkpoints/<id> inside its own .git, .env included,
82
+ // and those stayed after uninstalling: a `git push --mirror` would have published them. The
83
+ // project and the repositories nested in it (a few levels down; dependencies are not looked into).
84
+ const NOT_INTO = new Set(['node_modules', '.git', '.pulse', '.madre', 'vendor', 'dist', 'build', '.venv', 'venv', 'target']);
85
+ async function restoreRefs(root, depth = 0) {
86
+ const found = [];
87
+ if (await isGitRepo(root)) {
88
+ const listed = await execFileAsync('git', ['-C', root, 'for-each-ref', '--format=%(refname)', `${CHECKPOINT_REF}/`], { timeout: 10000 }).catch(() => ({ stdout: '' }));
89
+ const refs = String(listed.stdout).split('\n').map((line) => line.trim()).filter((line) => line.startsWith(`${CHECKPOINT_REF}/`));
90
+ if (refs.length) found.push({ repo: root, refs });
91
+ }
92
+ if (depth >= 3) return found;
93
+ for (const entry of await readdir(root, { withFileTypes: true }).catch(() => [])) {
94
+ if (!entry.isDirectory() || entry.isSymbolicLink() || NOT_INTO.has(entry.name)) continue;
95
+ found.push(...await restoreRefs(join(root, entry.name), depth + 1));
96
+ }
97
+ return found;
98
+ }
99
+ // A shadow folder from before 1.1.0 (madre-shadow/<hash>, shared /tmp on Linux): this user's only.
100
+ async function oursAt(path) {
101
+ const found = await lstat(path).catch(() => null);
102
+ if (!found?.isDirectory() || found.isSymbolicLink()) return false;
103
+ const uid = process.getuid?.();
104
+ return uid === undefined || found.uid === uid;
105
+ }
106
+
107
+ // What uninstalling would do, said before anything is done. Paths are this computer's own and only
108
+ // travel to a page of this computer.
109
+ export async function uninstallPlan({ stateRoot, install = 'npx', script = process.argv[1] ?? '', name = packageName(), home = homedir(), toolsBin = join(stateRoot, 'tools', 'bin') }) {
110
+ if (!(await checkStateRoot(stateRoot, { home }))) return { ok: false, error: 'This is not a MADRE folder MADRE would take away.' };
111
+ const root = resolve(stateRoot);
112
+ const projects = [];
113
+ for (const room of await knownRooms(root)) {
114
+ if (!room.root || isSalasRoom(room.root, root) || insideFolder(resolve(room.root), root)) continue;
115
+ const pulse = join(room.root, '.pulse');
116
+ const there = await folderAt(pulse);
117
+ const shadow = shadowFolderFor(room.root);
118
+ const legacy = legacyShadowFolderFor(room.root);
119
+ const refs = await restoreRefs(room.root);
120
+ projects.push({
121
+ name: room.name,
122
+ root: room.root,
123
+ pulse: there ? pulse : null,
124
+ made: there ? await countFiles(join(pulse, KEEP_INSIDE)) : 0,
125
+ shadow: (await folderAt(shadow)) ? shadow : null,
126
+ legacyShadow: legacy && (await oursAt(legacy)) ? legacy : null,
127
+ refs,
128
+ restorePoints: refs.reduce((sum, one) => sum + one.refs.length, 0),
129
+ modules: await folderAt(join(room.root, '.madre')),
130
+ });
131
+ }
132
+ const tools = (await readdir(toolsBin).catch(() => [])).filter((one) => !one.startsWith('.')).sort();
133
+ const npx = install === 'npx' ? await npxFolders({ script, name }) : [];
134
+ const program = install === 'npx' ? { install, command: null }
135
+ : install === 'global' ? { install, command: `npm uninstall -g ${name}` }
136
+ : install === 'project' ? { install, command: `npm uninstall ${name}` }
137
+ : { install: 'source', command: null, folder: sourceFolder(script) };
138
+ return {
139
+ ok: true,
140
+ stateRoot: root,
141
+ projects,
142
+ made: projects.reduce((sum, one) => sum + one.made, 0),
143
+ tools,
144
+ npx,
145
+ program,
146
+ modules: projects.filter((one) => one.modules).map((one) => one.name),
147
+ };
148
+ }
149
+
150
+ function packageName() {
151
+ try { return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).name; } catch { return '@jossuealcala/madre'; }
152
+ }
153
+ const sourceFolder = (script) => (script ? dirname(dirname(resolve(script))) : null);
154
+
155
+ // Takes a folder away whole. A turn's guard can leave folders read-only (src/room/guard.mjs), and
156
+ // a read-only folder keeps what is inside it: those are opened for this user first, then removed.
157
+ async function removeTree(path) {
158
+ try {
159
+ await rm(path, { recursive: true, force: true, maxRetries: 2 });
160
+ } catch (error) {
161
+ if (error?.code !== 'EACCES' && error?.code !== 'EPERM' && error?.code !== 'ENOTEMPTY') throw error;
162
+ await openForRemoval(path);
163
+ await rm(path, { recursive: true, force: true, maxRetries: 2 });
164
+ }
165
+ }
166
+ async function openForRemoval(dir) {
167
+ const found = await lstat(dir).catch(() => null);
168
+ if (!found?.isDirectory() || found.isSymbolicLink()) return;
169
+ await chmod(dir, 0o700).catch(() => null);
170
+ for (const entry of await readdir(dir, { withFileTypes: true }).catch(() => [])) {
171
+ if (entry.isDirectory()) await openForRemoval(join(dir, entry.name));
172
+ }
173
+ }
174
+
175
+ // Does what the plan says. `made`: the person asked for `.pulse/out/` to go too. Each step on its
176
+ // own: one that fails is said, and the others still happen.
177
+ export async function removeMadre(plan, { made = false } = {}) {
178
+ const removed = [];
179
+ const failed = [];
180
+ const take = async (path) => {
181
+ try { await removeTree(path); removed.push(path); } catch (error) { failed.push({ path, error: String(error?.message ?? error).slice(0, 200) }); }
182
+ };
183
+ if (!plan?.ok) return { removed, failed: [{ path: null, error: plan?.error ?? 'no plan' }] };
184
+ for (const project of plan.projects) {
185
+ if (project.pulse) {
186
+ if (made || project.made === 0) await take(project.pulse);
187
+ else for (const name of await readdir(project.pulse).catch(() => [])) if (name !== KEEP_INSIDE) await take(join(project.pulse, name));
188
+ }
189
+ if (project.shadow) await take(project.shadow);
190
+ if (project.legacyShadow) await take(project.legacyShadow);
191
+ // The restore points inside the project's own git: the references go, the project's history
192
+ // and branches are not touched. What they pointed at is left unreachable for git to collect.
193
+ for (const { repo, refs } of project.refs ?? []) {
194
+ let gone = 0;
195
+ for (const ref of refs) {
196
+ try { await execFileAsync('git', ['-C', repo, 'update-ref', '-d', ref], { timeout: 10000 }); gone += 1; } catch (error) { failed.push({ path: `${repo} ${ref}`, error: String(error?.message ?? error).slice(0, 200) }); }
197
+ }
198
+ if (gone) removed.push(`${repo} (${gone} restore points)`);
199
+ }
200
+ }
201
+ // The shadows' own folder, once nothing of anyone else's is in it.
202
+ const shadows = plan.projects.map((one) => one.shadow).filter(Boolean);
203
+ if (shadows.length) await rmdir(dirname(shadows[0])).catch(() => null);
204
+ await take(plan.stateRoot);
205
+ for (const folder of plan.npx) await take(folder);
206
+ return { removed, failed };
207
+ }
208
+
209
+ // The plan as the page shows it: names and counts, and paths with the home folder said as ~.
210
+ export function planView(plan, { home = homedir() } = {}) {
211
+ if (!plan?.ok) return plan;
212
+ const tilde = (path) => (path && insideFolder(resolve(path), resolve(home)) ? `~${resolve(path).slice(resolve(home).length) || ''}` : path);
213
+ return {
214
+ ok: true,
215
+ stateRoot: tilde(plan.stateRoot),
216
+ projects: plan.projects.map((one) => ({ name: one.name, root: tilde(one.root), pulse: Boolean(one.pulse), made: one.made, shadow: Boolean(one.shadow || one.legacyShadow), restorePoints: one.restorePoints ?? 0 })),
217
+ restorePoints: plan.projects.reduce((sum, one) => sum + (one.restorePoints ?? 0), 0),
218
+ made: plan.made,
219
+ tools: plan.tools,
220
+ npx: plan.npx.length > 0,
221
+ program: { install: plan.program.install, command: plan.program.command, folder: tilde(plan.program.folder ?? null) },
222
+ modules: plan.modules,
223
+ name: basename(plan.stateRoot),
224
+ };
225
+ }
package/src/updates.mjs CHANGED
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // MADRE · © 2026 Jossue Alcalá · GNU AGPL v3 with additional terms (Section 7): ADDITIONAL-TERMS.md
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
3
  // Release channel: is there a newer MADRE on npm? One read of the public registry, at most
4
4
  // once a day, cached in ~/.pulse/updates.json. It sends the package name and nothing else,
5
5
  // the same request `npx` makes; PULSE_UPDATE_CHECK=0 or the switch in MU/TH/UR turns it off.
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // MADRE · © 2026 Jossue Alcalá · GNU AGPL v3 with additional terms (Section 7): ADDITIONAL-TERMS.md
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
3
  import { t } from './i18n.mjs';
4
4
 
5
5
  const severity = { normal: 0, warning: 1, critical: 2, exhausted: 3 };
package/src/vault.mjs CHANGED
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // MADRE · © 2026 Jossue Alcalá · GNU AGPL v3 with additional terms (Section 7): ADDITIONAL-TERMS.md
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
3
  // The vault: where a connector's secret lives.
4
4
  //
5
5
  // Until now MADRE held none. A key for Gemini or OpenCode is written where THAT CLI looks for it
package/src/verdict.mjs CHANGED
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // MADRE · © 2026 Jossue Alcalá · GNU AGPL v3 with additional terms (Section 7): ADDITIONAL-TERMS.md
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
3
  // One sentence about where a room stands, and one thing to do about it.
4
4
  //
5
5
  // Everything needed to say it was already being measured: six readings of what the archive is
@@ -17,6 +17,9 @@ import { t } from './i18n.mjs';
17
17
 
18
18
  export const WHERE = { nostromo: 'MEMORY MAP', ask: 'MEMORY MAP · ASK', room: 'THE PROJECT', tests: 'MEMORY REVIEW' };
19
19
  const where = (key) => t(WHERE[key]);
20
+ // And what the page's key does there (2026-10-28): the place, or for a thin reading the act itself.
21
+ // `go` is read by public/app.js (memNextKey); `where` stays for a page too old to know it.
22
+ const to = (key, go = key) => ({ where: where(key), go });
20
23
 
21
24
  export function verdictFor({ maturity = null, exams = {}, cold = null, asks = 0 } = {}) {
22
25
  const consistency = exams.consistency ?? null;
@@ -30,7 +33,7 @@ export function verdictFor({ maturity = null, exams = {}, cold = null, asks = 0
30
33
  return {
31
34
  headline: stage?.label ?? null,
32
35
  says: consistency.says,
33
- next: { text: (consistency.open === 1 ? t('Settle the contradiction the memory reviewer found. Until it is settled, everything built on this memory inherits it.') : t('Settle the {n} contradictions the memory reviewer found. Until they are settled, everything built on this memory inherits them.', { n: consistency.open })), where: where('nostromo') },
36
+ next: { text: (consistency.open === 1 ? t('Settle the contradiction the memory reviewer found. Until it is settled, everything built on this memory inherits it.') : t('Settle the {n} contradictions the memory reviewer found. Until they are settled, everything built on this memory inherits them.', { n: consistency.open })), ...to('nostromo') },
34
37
  };
35
38
  }
36
39
 
@@ -41,15 +44,15 @@ export function verdictFor({ maturity = null, exams = {}, cold = null, asks = 0
41
44
  headline: stage?.label ?? null,
42
45
  says: coverage.says,
43
46
  next: asks
44
- ? { text: t('Answer the {n} questions the project wrote for itself. They are the holes this test is finding.', { n: asks }), where: where('ask') }
45
- : { text: t('Keep working in the project. The archive fills where the work happens, and this test measures exactly that.'), where: where('room') },
47
+ ? { text: t('Answer the {n} questions the project wrote for itself. They are the holes this test is finding.', { n: asks }), ...to('ask') }
48
+ : { text: t('Keep working in the project. The archive fills where the work happens, and this test measures exactly that.'), ...to('room') },
46
49
  };
47
50
  }
48
51
 
49
52
  // 3 · Then whatever the readings say is thinnest. That advice is already written where the
50
53
  // reading is taken, so it is quoted rather than invented here.
51
54
  if (weakest && weakest.value < 0.6) {
52
- return { headline: stage?.label ?? null, says: `${weakest.label.toLowerCase()}: ${weakest.detail}.`, next: { text: weakest.next, where: where('room') } };
55
+ return { headline: stage?.label ?? null, says: `${weakest.label.toLowerCase()}: ${weakest.detail}.`, next: { text: weakest.next, ...to('room', weakest.id === 'judgement' ? 'rate' : 'room') } };
53
56
  }
54
57
 
55
58
  // 4 · And when nothing is wrong, the only honest thing left is the test nobody has run.
@@ -57,7 +60,7 @@ export function verdictFor({ maturity = null, exams = {}, cold = null, asks = 0
57
60
  return {
58
61
  headline: stage?.label ?? null,
59
62
  says: coverage?.ran ? coverage.says : t('Nothing contradicts anything and the archive answers what this project asks.'),
60
- next: { text: t('Run the third test: it puts real questions from this project back to the local model and says whether it lands where the agents landed.'), where: where('tests') },
63
+ next: { text: t('Run the third test: it puts real questions from this project back to the local model and says whether it lands where the agents landed.'), ...to('tests') },
61
64
  };
62
65
  }
63
66
 
@@ -69,8 +72,8 @@ export function verdictFor({ maturity = null, exams = {}, cold = null, asks = 0
69
72
  : match.says,
70
73
  next: match.passed
71
74
  ? (dead
72
- ? { text: t('Nothing is wrong. {n} memories have had every chance and were never the answer: look at them and decide.', { n: dead }), where: where('nostromo') }
73
- : { text: t('Nothing to fix. Keep using the project; the archive grows where the work is.'), where: where('room') })
74
- : { text: t('The local model does not land where the agents land yet. Keep the archive growing and run this test again in a week.'), where: where('tests') },
75
+ ? { text: t('Nothing is wrong. {n} memories have had every chance and were never the answer: look at them and decide.', { n: dead }), ...to('nostromo') }
76
+ : { text: t('Nothing to fix. Keep using the project; the archive grows where the work is.'), ...to('room') })
77
+ : { text: t('The local model does not land where the agents land yet. Keep the archive growing and run this test again in a week.'), ...to('tests') },
75
78
  };
76
79
  }
package/src/whats-new.mjs CHANGED
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // MADRE · © 2026 Jossue Alcalá · GNU AGPL v3 with additional terms (Section 7): ADDITIONAL-TERMS.md
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
3
  // What a version brings, said to the person who just got it.
4
4
  //
5
5
  // After an update the room opens once on a sheet of what is new: a few things, each said plainly,
@@ -28,9 +28,103 @@ const FILE = 'whats-new.json';
28
28
  // From 1.0 a sheet is a board: each item also has an `id`, a picture (`image`, under
29
29
  // /assets/news/<major.minor>/, whitelisted in server.mjs) and an `action`, the place «Take me
30
30
  // there» opens, or null when there is nowhere to go. The page knows exactly these places.
31
- export const NEWS_ACTIONS = ['settings', 'mother', 'intents', 'permissions', 'github', 'bar', 'modules', 'nostromo', 'room', 'looks', 'finder'];
31
+ export const NEWS_ACTIONS = ['settings', 'errors', 'mother', 'intents', 'permissions', 'github', 'bar', 'modules', 'nostromo', 'room', 'looks', 'finder'];
32
32
 
33
33
  export const NOTES = {
34
+ // 1.1 (2026-10-28): said to whoever comes from 1.0.x, on Home — the first screen of `npx madre` —
35
+ // and in a project if Home was not opened first. Few things, the ones that change how MADRE looks.
36
+ '1.1.0': {
37
+ intro: {
38
+ es: 'MADRE 1.1 se ordena como una app de chat: Inicio para todo, tus conversaciones a un lado y un Mercado para sumar funciones. Desde esta versión usa la licencia BSL: sigue gratis para personas y equipos de hasta 10. El diseño nuevo no lleva fondo: el que elegiste se queda guardado.',
39
+ en: 'MADRE 1.1 is laid out like a chat app: Home for everything, your conversations to one side and a Market to add features. From this version it uses the BSL license: still free for individuals and teams of up to 10. The new design has no wallpaper: the one you chose stays saved.',
40
+ },
41
+ items: [
42
+ {
43
+ id: 'home',
44
+ icon: 'home',
45
+ image: { es: '/assets/news/1.1/es/home.webp', en: '/assets/news/1.1/en/home.webp' },
46
+ title: { es: 'Inicio: todo en un lugar', en: 'Home: everything in one place' },
47
+ body: {
48
+ es: 'Al abrir MADRE llegas a Inicio: tus proyectos, el Coordinador y lo que te espera. A la izquierda tienes tus chats y tus proyectos, como en las apps de chat.',
49
+ en: 'Opening MADRE takes you to Home: your projects, the Coordinator and what is waiting for you. Your chats and projects are on the left, like in chat apps.',
50
+ },
51
+ where: { es: 'Lo primero que ves al abrir MADRE', en: 'The first thing you see when you open MADRE' },
52
+ action: null,
53
+ },
54
+ {
55
+ id: 'chats',
56
+ icon: 'list',
57
+ image: { es: '/assets/news/1.1/es/chats.webp', en: '/assets/news/1.1/en/chats.webp' },
58
+ title: { es: 'Tus conversaciones, a un lado', en: 'Your conversations, to one side' },
59
+ body: {
60
+ es: 'Cada proyecto guarda sus chats en la columna de la izquierda. Puedes abrir dos lado a lado, o uno en su propia ventana.',
61
+ en: 'Each project keeps its chats in the column on the left. You can open two side by side, or one in its own window.',
62
+ },
63
+ where: { es: 'La columna de la izquierda de cada proyecto', en: 'The left column of every project' },
64
+ action: null,
65
+ },
66
+ {
67
+ id: 'market',
68
+ icon: 'grid',
69
+ image: { es: '/assets/news/1.1/es/market.webp', en: '/assets/news/1.1/en/market.webp' },
70
+ title: { es: 'El Mercado', en: 'The Market' },
71
+ body: {
72
+ es: 'Suma funciones con un clic: Notas, Recordatorios, Vista previa, Antes de subir y más. Cada módulo te dice qué hace antes de instalarlo.',
73
+ en: 'Add features in one click: Notes, Reminders, Preview, Before you push and more. Every module tells you what it does before you install it.',
74
+ },
75
+ where: { es: 'Mercado, en la columna de la izquierda', en: 'Market, in the left column' },
76
+ action: 'modules',
77
+ },
78
+ {
79
+ id: 'welcome',
80
+ icon: 'check',
81
+ image: { es: '/assets/news/1.1/es/welcome.webp', en: '/assets/news/1.1/en/welcome.webp' },
82
+ title: { es: 'Una bienvenida paso a paso', en: 'A step-by-step welcome' },
83
+ body: {
84
+ es: 'Conecta tus agentes, pon una IA gratis en tu computadora y prepara la memoria, sin usar la terminal. Puedes volver a verla cuando quieras.',
85
+ en: 'Connect your agents, put a free AI on your computer and get the memory ready, without the terminal. You can see it again whenever you like.',
86
+ },
87
+ where: { es: 'Ajustes de Inicio › Ver la bienvenida otra vez', en: 'Home settings › See the welcome again' },
88
+ action: null,
89
+ },
90
+ {
91
+ id: 'permissions',
92
+ icon: 'lock',
93
+ image: { es: '/assets/news/1.1/es/permissions.webp', en: '/assets/news/1.1/en/permissions.webp' },
94
+ title: { es: 'Permisos más simples', en: 'Simpler permissions' },
95
+ body: {
96
+ es: '#3 Editar te pide confirmar y #4 Acceso total, confirmar dos veces. También puedes dejarlos abiertos más tiempo, para trabajar sin interrupciones.',
97
+ en: '#3 Edit asks you to confirm and #4 Full access, to confirm twice. You can also leave them open for longer, to work without interruptions.',
98
+ },
99
+ where: { es: 'El botón de permiso, junto a la caja donde escribes', en: 'The permission button, next to the box you type in' },
100
+ action: 'permissions',
101
+ },
102
+ {
103
+ id: 'maps',
104
+ icon: 'orbit',
105
+ image: { es: '/assets/news/1.1/es/maps.webp', en: '/assets/news/1.1/en/maps.webp' },
106
+ title: { es: 'Mapas que crecen con lo que saben', en: 'Maps that grow with what they know' },
107
+ body: {
108
+ es: 'Tus proyectos y tus memorias se ven como planetas o como neuronas, y crecen mientras más saben.',
109
+ en: 'Your projects and memories show as planets or as neurons, and grow the more they know.',
110
+ },
111
+ where: { es: 'Mapa de memoria y Mapa de proyectos', en: 'Memory map and Project map' },
112
+ action: 'nostromo',
113
+ },
114
+ {
115
+ id: 'privacy',
116
+ icon: 'bell',
117
+ image: { es: '/assets/news/1.1/es/privacy.webp', en: '/assets/news/1.1/en/privacy.webp' },
118
+ title: { es: 'Errores anónimos para mejorar MADRE', en: 'Anonymous errors to improve MADRE' },
119
+ body: {
120
+ es: 'MADRE manda cada día qué falló y cuánto se usa, sin nada de lo que escribes ni de tus proyectos. Lo apagas cuando quieras.',
121
+ en: 'Once a day MADRE sends what failed and how much it is used, with nothing you write and nothing from your projects. Turn it off whenever you like.',
122
+ },
123
+ where: { es: 'Ajustes › Actualizaciones y errores', en: 'Settings › Updates and errors' },
124
+ action: 'errors',
125
+ },
126
+ ],
127
+ },
34
128
  '1.0.0': {
35
129
  intro: {
36
130
  es: 'MADRE 1.0 se ve y se usa como un producto: todo lo que configuras en un solo lugar, ayudas que aprenden de cómo trabajas y un proyecto que acomodas a tu gusto.',
Binary file