@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
@@ -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.js';
4
4
 
5
5
  // MU/TH/UR knowledge base: known conditions, how to recognise them in the
@@ -8,10 +8,15 @@ import { t } from './i18n.js';
8
8
  // Pure module (no DOM) so the catalog can be unit-tested and reused by the CLI.
9
9
 
10
10
  // The two MADRE is tested on. Every remedy below is a command written for one of these two
11
- // shells; a third set that nobody has ever run would be worse than none.
11
+ // shells; a third set that nobody has ever run would be worse than none. Since 2026-10-28 (D-001,
12
+ // docs/WINDOWS.md) two more columns are read from those: WSL is Linux inside Windows, so it reads
13
+ // Linux's unless a card has a line of its own; and Windows says one thing — on Windows MADRE runs
14
+ // inside WSL2 (1.1.0) — before Linux's commands (fixesFor).
12
15
  export const PLATFORMS = {
13
16
  darwin: { label: 'macOS', shell: 'zsh' },
14
17
  linux: { label: 'Linux', shell: 'bash' },
18
+ wsl: { label: 'WSL', shell: 'bash' },
19
+ win32: { label: 'Windows', shell: 'PowerShell · WSL' },
15
20
  };
16
21
 
17
22
  const envExport = (name, value) => ({
@@ -144,9 +149,9 @@ export const CONDITIONS = [
144
149
  severity: 'transient',
145
150
  title: 'Gemini model under high demand (503)',
146
151
  match: /status 503|high demand|UNAVAILABLE/i,
147
- diagnosis: 'Google is shedding load on the selected model (HTTP 503). The CLI would retry with backoff for minutes; MADRE stops it after 15 s of that and retries once on gemini-2.5-flash. The turn failed only if the fallback model was refused too.',
148
- remedy: 'Ask again in a minute, pick an explicit model from the Write box\'s model menu, or hand the question to another agent. PULSE_GEMINI_FALLBACK_MODEL changes the fallback.',
149
- fixes: same(['# wait, then resend — or continue with @codex / @claude / @opencode', 'PULSE_GEMINI_FALLBACK_MODEL=gemini-2.5-flash-lite madre start']),
152
+ diagnosis: 'Google is shedding load on the selected model (HTTP 503). The CLI would retry with backoff for minutes; MADRE stops it after 15 s of that and retries once on gemini-3-flash-preview. The turn failed only if that spare model failed too; the message is still the one about the model you chose.',
153
+ remedy: 'Ask again in a minute, pick an explicit model from the Write box\'s model menu, or hand the question to another agent. PULSE_GEMINI_FALLBACK_MODEL changes the spare model; left empty, there is none.',
154
+ fixes: same(['# wait, then resend — or continue with @codex / @claude / @opencode', 'PULSE_GEMINI_FALLBACK_MODEL= madre start']),
150
155
  },
151
156
  {
152
157
  id: 'opencode-default-provider',
@@ -163,6 +168,40 @@ export const CONDITIONS = [
163
168
  linux: ['npx @jossuealcala/madre setup', '# press [m] and pick a provider/model that has a session', 'PULSE_OPENCODE_MODEL=openai/gpt-5.6-sol npx @jossuealcala/madre start', 'opencode auth logout anthropic']
164
169
  },
165
170
  },
171
+ {
172
+ // Seen in a real project (2026-10-19): OpenCode's default model was Anthropic's, through an API
173
+ // key with no balance, and every turn of a plan failed with the provider's words in English.
174
+ id: 'provider-credit-exhausted',
175
+ code: 'MU-059',
176
+ severity: 'blocking',
177
+ title: 'The API account behind this agent has no credit left',
178
+ match: /credit balance is too low|purchase credits|insufficient_quota|exceeded your current quota|billing_hard_limit_reached/i,
179
+ diagnosis: 'The provider refused the turn because the API key it was sent with has no balance left. An API key is billed apart from a subscription: a Claude Pro or Max plan, or ChatGPT, does not pay for it. In OpenCode it is the provider of the model the turn asked for, and a turn that named none ran on the default model of Settings › Agents › OpenCode.',
180
+ remedy: 'Top up that API account, or give OpenCode a model whose provider has a session that works: your ChatGPT account (openai/…), GitHub Copilot, or OpenCode\'s own free models (opencode/…). Change the default in Settings › Agents › OpenCode, or pick another model in the Write box for one turn.',
181
+ fixes: same(['# Anthropic API: https://console.anthropic.com/settings/billing', '# OpenAI API: https://platform.openai.com/settings/organization/billing', '# OpenCode, one turn on its own free model:', 'PULSE_OPENCODE_MODEL=opencode/big-pickle madre start', '# or take the key with no balance out of OpenCode:', 'opencode auth logout anthropic']),
182
+ },
183
+ {
184
+ id: 'opencode-free-limit',
185
+ code: 'MU-073',
186
+ agent: 'opencode',
187
+ severity: 'blocking',
188
+ title: 'OpenCode\'s free models have run out for now',
189
+ match: /Free usage limit reached|free use of OpenCode ran out/i,
190
+ diagnosis: 'OpenCode\'s own free models (opencode/…) answer without an account, but only up to a limit; when it is reached OpenCode retries in silence and never answers. MADRE now stops the turn as soon as OpenCode says so, instead of waiting for the clock. Nothing in the project is wrong.',
191
+ remedy: 'Connect a provider of yours to OpenCode in Settings › Agents › OpenCode (your ChatGPT account, GitHub Copilot or an API key), ask another agent, or ask @madre, which runs on this computer. The free use comes back after a while.',
192
+ fixes: same(['# the providers OpenCode can use:', 'opencode auth login', '# subscription for more free use: https://opencode.ai/go']),
193
+ },
194
+ {
195
+ id: 'cursor-usage-limit',
196
+ code: 'MU-060',
197
+ agent: 'cursor',
198
+ severity: 'blocking',
199
+ title: 'Cursor\'s plan has reached its usage limit',
200
+ match: /hit your usage limit|ActionRequiredError/i,
201
+ diagnosis: 'Your Cursor account has used up the agent usage its plan gives for this period, and Cursor refuses every turn until it renews or the plan changes. It is Cursor\'s limit, not MADRE\'s: nothing in the project is wrong.',
202
+ remedy: 'Wait for the usage to renew, change the Cursor plan, or ask another agent in the meantime.',
203
+ fixes: same(['# plan and usage: https://cursor.com/dashboard', 'cursor-agent status']),
204
+ },
166
205
  {
167
206
  id: 'not-signed-in',
168
207
  code: 'MU-008',
@@ -171,7 +210,7 @@ export const CONDITIONS = [
171
210
  title: 'Agent installed but signed out',
172
211
  match: /not logged in|sign in required|Error authenticating|unauthorized|please (?:log|sign) ?in|no credentials/i,
173
212
  diagnosis: 'The CLI is on this computer but has no session for its provider. MADRE never stores credentials; each agent keeps its own.',
174
- remedy: 'Press Sign in on the agent: at first the project opens on the Connect your agents screen, with the button on each card, and later it lives in Settings → Agents, which the row below opens. Codex and Claude sign in with a browser flow MADRE runs for you; Gemini and OpenCode hand you their command. `madre setup` does the same from a terminal.',
213
+ remedy: 'This agent has no session yet. Connect it once in Settings › Agents (MADRE runs its sign-in for you, nothing to type in a terminal), or ask the same of an agent that is connected.',
175
214
  fixes: same(['npx @jossuealcala/madre setup', '# or directly:', 'codex login', 'claude auth login', 'opencode auth login', 'gemini # then /auth']),
176
215
  perAgent: loginAgent,
177
216
  },
@@ -250,7 +289,8 @@ export const CONDITIONS = [
250
289
  code: 'MU-015',
251
290
  severity: 'informational',
252
291
  title: 'Where the usage numbers come from',
253
- match: /ring|quota|limit window|resets|rollout|oauth usage|window reset|limits-real/i,
292
+ // «ring» as a word: inside «answering» or «string» it filed a question about silence here.
293
+ match: /\bring\b|quota|limit window|resets|rollout|oauth usage|window reset|limits-real/i,
254
294
  diagnosis: 'Each sphere\'s usage shows the provider\'s real limit when the CLI publishes it: Codex writes its 5-hour and weekly windows (used %, reset time) into every session rollout under ~/.codex/sessions; Claude Code\'s /usage comes from Anthropic\'s OAuth usage endpoint; MADRE can ask it with the token Claude Code keeps in the keychain when you start with PULSE_CLAUDE_USAGE=1 (macOS may ask once to allow the keychain read). Gemini and OpenCode publish nothing locally, so their usage shows MADRE\'s own rolling 5-hour window of budget tokens. A window whose reset time has passed counts as empty until the CLI reports again, and the failure monitor says "clear" when a full window resets.',
255
295
  remedy: 'Click a sphere to see both windows and when they reset. If a sphere\'s usage looks stale, run one turn with that agent: Codex only rewrites its limits when it runs. Set PULSE_OFFICIAL_QUOTA=0 to stop reading provider limits altogether.',
256
296
  fixes: same(['# click the sphere → 5h / 7d windows and reset times', 'PULSE_CLAUDE_USAGE=1 madre start # also read Claude Code\'s usage windows', 'PULSE_OFFICIAL_QUOTA=0 madre start # local window only']),
@@ -362,7 +402,7 @@ export const CONDITIONS = [
362
402
  severity: 'informational',
363
403
  title: 'Commands and mentions in the Write box',
364
404
  match: /slash|command|\/git|\/ahp|mention|@agent/i,
365
- diagnosis: 'Type "/" for the project\'s commands: /create turns on permission to create, /image routes an image request to an agent that can draw, /stopall is the brake, /git (Git) and /ahp (Continuity) run read-only in the project and post a fact card everyone, agents included, can read. Type "@" to mention an agent; the name becomes a label. Type "!" to point at a project file ("!src/room.mjs:12-20" for lines): the agent reads it first. In the viewer, click a line number (Shift+click for a range) and REVIEW WITH sends those lines to an agent.',
405
+ diagnosis: 'Type "/" for the project\'s commands: /create turns on permission to create, /image routes an image request to an agent that can draw, /stopall is the brake, /git (Git) and /ahp (Continuity) run read-only in the project and post a fact card everyone, agents included, can read. Type "@" to mention an agent; the name becomes a label. Type "!" to point at a project file ("!src/room.mjs:12-20" for lines): the agent reads it first. In the viewer, click a line number (Shift+click for a range) and ASK offers what to ask about those lines, and whom.',
366
406
  remedy: 'A struck-through command is a module that is not available in this project: open Modules to install it or turn it on (Git needs a git repository; Continuity needs to be installed).',
367
407
  fixes: same(['# type / or @ in the Write box', '/git status', '/git log 10', '/ahp check', '/image a poster for the launch']),
368
408
  },
@@ -509,7 +549,7 @@ export const CONDITIONS = [
509
549
  // Older rooms recorded @madre leaving as "madre is not installed": it is this condition, not MU-009.
510
550
  match: /@madre|madre-local|needs Ollama running with a chat model|\bmadre is not installed on this computer|@madre left the (room|project)/i,
511
551
  diagnosis: 'When Ollama runs with a chat model, a fifth agent joins the project: @madre. It answers from the whole archive (distilled notes and exact quotes, cited as [#n]) and from what the message carries, locally, for free. It never writes, draws, browses or makes plans; when the project never discussed something it says so. Other agents may give it a plan step to check what was decided. It leaves the project when Ollama stops, and Diagnostics says so.',
512
- remedy: 'Start Ollama and download a chat model from Local AI in Modules; its @madre in the project switch turns the agent off if you do not want it. Ask it "what did we decide about …" or "did we ever discuss …".',
552
+ remedy: 'Start Ollama and download a chat model in Settings › Local AI; its @madre switch there turns the agent off if you do not want it. Ask it "what did we decide about …" or "did we ever discuss …".',
513
553
  fixes: same(['ollama serve', 'ollama pull qwen2.5:3b', '@madre what did we decide about the webhook?']),
514
554
  },
515
555
  {
@@ -519,10 +559,10 @@ export const CONDITIONS = [
519
559
  severity: 'informational',
520
560
  title: 'Ollama: local smart search and a local archivist',
521
561
  match: /ollama|11434|local model|nomic-embed|qwen|llama3/i,
522
- diagnosis: 'When Ollama runs on this machine with an embedding model and a chat model, MADRE embeds the memory locally (recall by meaning without any key) and distils memories with the local model first, before Gemini and the others. Nothing leaves the machine for remembering. Off or absent, everything falls back to the providers. The Local AI module, in Modules, shows what Ollama has, downloads the recommended models, and switches each role.',
523
- remedy: 'Install Ollama (ollama.com), start it, then open Local AI in Modules, press RECHECK and download the models it suggests. Set PULSE_OLLAMA_MODEL or PULSE_OLLAMA_EMBED_MODEL to prefer others; PULSE_EMBED_PROVIDER=gemini keeps embeddings on Gemini even with Ollama running.',
562
+ diagnosis: 'When Ollama runs on this machine with an embedding model and a chat model, MADRE embeds the memory locally (recall by meaning without any key) and distils memories with the local model first, before Gemini and the others. Nothing leaves the machine for remembering. Off or absent, everything falls back to the providers. Local AI, in Settings, shows what Ollama has, downloads the recommended models, and switches each role.',
563
+ remedy: 'Install Ollama (ollama.com), start it, then open Settings › Local AI and download the models it suggests. Set PULSE_OLLAMA_MODEL or PULSE_OLLAMA_EMBED_MODEL to prefer others; PULSE_EMBED_PROVIDER=gemini keeps embeddings on Gemini even with Ollama running.',
524
564
  fixes: {
525
- darwin: ['brew install ollama', 'ollama serve', 'ollama pull nomic-embed-text', 'ollama pull qwen2.5:3b'],
565
+ darwin: ['# the official app, which opens by itself with the Mac: https://ollama.com/download', '# or with Homebrew:', 'brew install ollama', 'ollama serve', 'ollama pull nomic-embed-text', 'ollama pull qwen2.5:3b'],
526
566
  linux: ['curl -fsSL https://ollama.com/install.sh | sh', 'ollama serve', 'ollama pull nomic-embed-text', 'ollama pull qwen2.5:3b']
527
567
  },
528
568
  },
@@ -681,6 +721,154 @@ export const CONDITIONS = [
681
721
  'PULSE_UPDATE_CHECK=0 madre start # no version checks at all',
682
722
  ]),
683
723
  },
724
+ // THE WELCOME OF 1.0.6 (2026-10-28, docs/private/BIENVENIDA-1.0.6.md): what goes wrong on the way
725
+ // from `npx madre` to a MADRE that is ready, each with the steps for the system it happens on. The
726
+ // welcome and Home open these from the step where it went wrong («See how to fix it»).
727
+ {
728
+ id: 'no-browser',
729
+ code: 'MU-061',
730
+ severity: 'common',
731
+ title: 'The browser did not open',
732
+ match: /could not open (?:the|a) browser|no browser (?:opened|found)|Open this address in (?:a browser on this computer|your Windows browser)|xdg-open|wslview/i,
733
+ diagnosis: 'MADRE opens its page in the browser of the computer it runs on. A Linux without a screen has none, a virtual machine may have none, and from inside WSL it asks Windows for its own, which does not always answer. When no browser opens, the terminal prints the address to open by hand: MADRE is running all the same.',
734
+ remedy: 'Copy the address the terminal printed (it ends in /salas) and open it in your browser. In WSL, open it in your Windows browser, with localhost instead of 127.0.0.1.',
735
+ fixes: {
736
+ darwin: ['# the port is the one the terminal printed', 'open http://127.0.0.1:5317/salas'],
737
+ linux: ['# the port is the one the terminal printed', 'xdg-open http://127.0.0.1:5317/salas', '# with no screen here, open that address in a browser on this computer'],
738
+ wsl: ['# the port is the one the terminal printed', 'explorer.exe http://localhost:5317/salas', '# so MADRE opens it by itself next time:', 'sudo apt install wslu'],
739
+ },
740
+ },
741
+ {
742
+ id: 'ssh-tunnel',
743
+ code: 'MU-062',
744
+ severity: 'informational',
745
+ title: 'MADRE runs on another computer (SSH)',
746
+ match: /\bSSH_CONNECTION\b|connected to this computer from another one|the browser is over there|ssh -L \d+:127\.0\.0\.1/i,
747
+ diagnosis: 'You reached the computer where MADRE runs from another one, over SSH. MADRE listens only on its own computer (127.0.0.1), on purpose: nothing on your network can reach it. So the browser on your computer needs a tunnel, which SSH makes with one command. The terminal printed it with your user, your server and the port.',
748
+ remedy: 'On your own computer, open a new terminal, paste the command, leave it open, and open the address in your browser. Each project you open uses one more port: add it to the same command.',
749
+ fixes: same(['# on YOUR computer, in a new terminal (leave it open):', 'ssh -L 5317:127.0.0.1:5317 user@server', '# then open http://127.0.0.1:5317/salas', '# one more -L for each open project:', 'ssh -L 5317:127.0.0.1:5317 -L 5318:127.0.0.1:5318 user@server']),
750
+ },
751
+ {
752
+ id: 'tunnel-ipv6',
753
+ code: 'MU-063',
754
+ severity: 'common',
755
+ title: 'The tunnel connects but the page does not load',
756
+ match: /channel \d+: open failed|connect failed: Connection refused|bind \[::1\]|cannot assign requested address/i,
757
+ diagnosis: 'A tunnel written with «localhost» can land on the server\'s IPv6 address (::1), where MADRE does not listen: SSH says «open failed» and the browser stays blank. MADRE listens on 127.0.0.1.',
758
+ remedy: 'Write 127.0.0.1 in the tunnel instead of localhost, and open http://127.0.0.1 with the same port in your browser.',
759
+ fixes: same(['# 127.0.0.1, not localhost, on both sides of the tunnel:', 'ssh -L 5317:127.0.0.1:5317 user@server']),
760
+ },
761
+ {
762
+ id: 'install-offline',
763
+ code: 'MU-064',
764
+ severity: 'transient',
765
+ title: 'An install could not download',
766
+ match: /ENOTFOUND|EAI_AGAIN|getaddrinfo|ECONNRESET|network (?:is )?unreachable|unable to get local issuer certificate|self[- ]signed certificate in certificate chain|request to https?:\/\/registry\.npmjs\.org\S* failed/i,
767
+ diagnosis: 'Installing an agent or a model downloads it from the internet: agents from npm, models from Ollama. The download did not get through: there is no connection, the server\'s name could not be found, or something on this network (a VPN, a proxy, a company firewall) stopped it. Nothing was left half installed.',
768
+ remedy: 'Check that this computer has internet and try again. On a company network or a VPN, try from another one, or ask whoever runs it to allow registry.npmjs.org and ollama.com.',
769
+ fixes: same(['npm ping', 'curl -I https://registry.npmjs.org', '# behind a proxy, npm has to be told:', 'npm config set proxy http://proxy:port']),
770
+ },
771
+ {
772
+ id: 'node-missing',
773
+ code: 'MU-065',
774
+ severity: 'blocking',
775
+ title: 'An agent needs Node and npm',
776
+ match: /spawn npm(?:\.cmd)? ENOENT|npm(?:\.cmd)?: (?:command )?not found|'npm' is not recognized|command not found: npm/i,
777
+ diagnosis: 'Codex, Claude, Gemini and OpenCode install with npm, the installer that comes with Node, and this computer does not have it where MADRE looks.',
778
+ remedy: 'Install Node 22 or newer (it brings npm), open MADRE again, and press Install.',
779
+ fixes: {
780
+ darwin: ['brew install node', '# or the installer from https://nodejs.org'],
781
+ linux: ['# Node 22 or newer (the one in your system\'s packages may be older):', 'curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -', 'sudo apt install -y nodejs', '# or nvm, with no administrator: https://github.com/nvm-sh/nvm'],
782
+ },
783
+ },
784
+ {
785
+ id: 'sign-in-unfinished',
786
+ code: 'MU-066',
787
+ severity: 'transient',
788
+ title: 'The sign-in did not finish',
789
+ match: /sign-in (?:was )?cancell?ed|login (?:was )?cancell?ed|sign-in timed out|login timed out|device code (?:has )?expired|authorization (?:was )?denied/i,
790
+ diagnosis: 'Connecting an agent opens its page and waits for you to finish there. It stops if it waits too long (15 minutes), if you cancel it, or if the page was opened on another computer and its code never came back. Nothing is wrong with the account.',
791
+ remedy: 'Start it again from Settings › Agents and finish it on the page that opens. If MADRE runs on another computer, choose «With a code» (Codex) or paste back the code the page gives you (Claude); for Gemini, paste an API key instead.',
792
+ fixes: same(['# Home → Settings → Agents → Sign in again', '# or in a terminal on the computer where MADRE runs:', 'codex login --device-auth', 'claude auth login']),
793
+ },
794
+ {
795
+ id: 'ollama-not-starting',
796
+ code: 'MU-067',
797
+ severity: 'blocking',
798
+ title: 'Ollama does not start',
799
+ match: /Ollama did not answer|listen tcp 127\.0\.0\.1:11434: bind|address already in use[^\n]*11434|could not connect to ollama/i,
800
+ diagnosis: 'Ollama is installed but nothing answers on its port (11434). Usually it is closed (on a Mac, the app is not open), another copy of Ollama already holds the port, or on Linux its service did not start.',
801
+ remedy: 'On a Mac, open the Ollama app. On Linux, start its service. Then press «I did it», or Check again in Settings › Local AI.',
802
+ fixes: {
803
+ darwin: ['open -a Ollama', 'curl http://127.0.0.1:11434/api/version'],
804
+ linux: ['sudo systemctl start ollama', 'systemctl status ollama --no-pager', '# without systemd (WSL without it, a container):', 'ollama serve', 'curl http://127.0.0.1:11434/api/version'],
805
+ },
806
+ },
807
+ {
808
+ id: 'model-download',
809
+ code: 'MU-068',
810
+ severity: 'transient',
811
+ title: 'A model download stopped',
812
+ match: /Ollama pull HTTP|pull model manifest|max retries exceeded/i,
813
+ diagnosis: 'Models are big (from half a GB to dozens) and come down in pieces. A cut connection or a full disk stops the download; what already arrived stays, and trying again picks up where it stopped.',
814
+ remedy: 'Try again from the same place. If it stops at the same point, check the free space (the model needs its size plus some room) or choose a smaller model.',
815
+ fixes: same(['ollama pull qwen2.5:3b # the model you chose; it resumes where it stopped', 'ollama list', 'df -h ~']),
816
+ },
817
+ {
818
+ id: 'disk-full',
819
+ code: 'MU-069',
820
+ severity: 'blocking',
821
+ title: 'Not enough free space',
822
+ match: /ENOSPC|no space left on device/i,
823
+ diagnosis: 'The computer ran out of room while installing or downloading. An AI on your computer takes the most: each model is a file of one to several GB, kept by Ollama in its own folder.',
824
+ remedy: 'Free some space, or remove models you do not use, and try again. A smaller model needs less.',
825
+ fixes: {
826
+ darwin: ['df -h ~', 'du -sh ~/.ollama/models', 'ollama list', 'ollama rm qwen2.5:7b # a model you do not use'],
827
+ linux: ['df -h ~', 'du -sh ~/.ollama/models /usr/share/ollama/.ollama/models 2>/dev/null', 'ollama list', 'ollama rm qwen2.5:7b # a model you do not use'],
828
+ },
829
+ },
830
+ {
831
+ id: 'ollama-remote',
832
+ code: 'MU-070',
833
+ severity: 'common',
834
+ title: 'Another computer\'s Ollama does not answer',
835
+ match: /Nothing answers at http|Expose Ollama to the network|OLLAMA_HOST=0\.0\.0\.0/i,
836
+ diagnosis: 'MADRE can use the AI of another computer on your network: Windows\' own from inside WSL, or one with a graphics card. Ollama only listens on its own computer unless it is told otherwise, and a firewall may close its port (11434).',
837
+ remedy: 'On the computer with Ollama, turn on «Expose Ollama to the network» in the app\'s settings (or start it with OLLAMA_HOST=0.0.0.0), let port 11434 through its firewall, and test the address again in Settings › Local AI.',
838
+ fixes: {
839
+ darwin: ['# on the computer that has Ollama:', 'OLLAMA_HOST=0.0.0.0 ollama serve', '# from here, check that it answers:', 'curl http://192.168.1.40:11434/api/version'],
840
+ linux: ['# on the computer that has Ollama:', 'OLLAMA_HOST=0.0.0.0 ollama serve', '# from here, check that it answers:', 'curl http://192.168.1.40:11434/api/version'],
841
+ wsl: ['# in Windows: the Ollama app → Settings → Expose Ollama to the network', '# from Ubuntu, Windows is where WSL\'s network goes out (the address after «via»):', 'ip route show default', 'curl http://172.28.80.1:11434/api/version # with that address'],
842
+ },
843
+ },
844
+ {
845
+ id: 'wsl-windows-folder',
846
+ code: 'MU-071',
847
+ severity: 'degraded',
848
+ title: 'A project in a Windows folder (/mnt/c)',
849
+ match: /\/mnt\/[a-z]\//i,
850
+ diagnosis: 'Inside WSL, the Windows disk shows up as /mnt/c. It works, but every file goes through a bridge between the two systems: MADRE reads slower there, and the protections Linux gives a project (which agent may write where) do not hold on Windows files.',
851
+ remedy: 'Keep projects inside Linux, in your folder in /home. Copy the project once and add the copy in Home.',
852
+ fixes: {
853
+ darwin: ['# this only happens inside WSL, on Windows'],
854
+ linux: ['# inside WSL: keep the project in Linux', 'mkdir -p ~/projects', 'cp -r "/mnt/c/Users/<you>/<project>" ~/projects/', '# then add ~/projects/<project> in Home'],
855
+ },
856
+ },
857
+ {
858
+ id: 'windows-use-wsl',
859
+ code: 'MU-072',
860
+ severity: 'informational',
861
+ title: 'MADRE on Windows',
862
+ match: /\bwin32\b|native Windows|Windows nativo|wsl --install/i,
863
+ diagnosis: 'On Windows, MADRE runs inside WSL2 (Windows Subsystem for Linux), the Linux that comes with Windows 10 and 11. Inside it MADRE works as on any Linux, and opens in your Windows browser. It does not run on Windows directly.',
864
+ remedy: 'Install WSL once (it asks for an administrator and a restart), open Ubuntu from the Start menu, and start MADRE there. Keep your projects inside Linux, not in /mnt/c.',
865
+ fixes: {
866
+ darwin: ['# this is for Windows'],
867
+ linux: ['# this is for Windows'],
868
+ wsl: ['# you are already in WSL: MADRE runs here as on any Linux'],
869
+ win32: ['# in PowerShell, as administrator, once:', 'wsl --install', '# restart, open «Ubuntu» from the Start menu, and in it:', 'curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -', 'sudo apt install -y nodejs', 'npx @jossuealcala/madre'],
870
+ },
871
+ },
684
872
  ];
685
873
 
686
874
  // Which of the two sets of commands to show first. Anything else gets macOS, and the panel says
@@ -710,30 +898,148 @@ export function said(condition) {
710
898
  export const allConditions = () => CONDITIONS.map(said);
711
899
 
712
900
  // Lowercase and without accents: «limite» finds «límite», and a person types what they type.
713
- const fold = (text) => String(text ?? '').normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase();
901
+ const fold = (text) => String(text ?? '').normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase();
714
902
  const AGENT_WORDS = new Set(['codex', 'claude', 'gemini', 'opencode', 'cursor', 'madre', 'ollama']);
903
+ const named = (words) => words.find((word) => AGENT_WORDS.has(word.replace(/^@/, '')))?.replace(/^@/, '') ?? null;
904
+ const wordsOf = (query) => fold(query).split(/[^a-z0-9#.@_-]+/).filter(Boolean);
905
+
906
+ // Cards that belong to an agent without being only its own: @madre lives on Ollama.
907
+ const BELONGS = { madre: ['madre-agent', 'ollama', 'local-ready'], ollama: ['ollama', 'madre-agent', 'local-ready'] };
908
+ const belongsTo = (condition, agent) => Boolean(agent) && (condition.agent === agent || Boolean(BELONGS[agent]?.includes(condition.id)));
909
+ // An agent's name narrows to that agent and the general cards, and puts its own first.
910
+ const forAgent = (conditions, agent) => {
911
+ if (!agent) return conditions;
912
+ const kept = conditions.filter((condition) => !condition.agent || condition.agent === agent);
913
+ return [...kept.filter((condition) => belongsTo(condition, agent)), ...kept.filter((condition) => !belongsTo(condition, agent))];
914
+ };
915
+
916
+ // How people say it, not how a CLI prints it. A person does not paste «HTTP 429»: they write
917
+ // «Gemini no contesta», and every word of that sat in the wrong card — «un agente no contesta»
918
+ // opened the restart card and «agent does not answer» the install one. Each symptom is a few
919
+ // patterns over the folded text, in both languages, and the cards that most often explain it, in
920
+ // that order. Cards owned by another agent or by @madre only count when that agent is named.
921
+ const SYMPTOMS = [
922
+ {
923
+ id: 'signed-out',
924
+ says: [
925
+ /\b(?:sign(?:ed)?|log(?:ged)?)[ -]?(?:in|out)\b|\blog[ -]?in\b|\bauthenticat|\bcredential|\bpassword|\bre-?auth/,
926
+ /\b(?:inici\w*|cerr\w*|abr\w*|pide\w*)(?: la| una| mi| de)? sesion|\bsesion (?:cerrada|expirada|vencida)|\bsin sesion|\bautentic|\bcredencial|\bcontrasena|\bme pide (?:entrar|la cuenta|mi cuenta)/,
927
+ ],
928
+ cards: ['not-signed-in', 'gemini-ineligible-tier', 'opencode-default-provider', 'custom-agent-endpoint'],
929
+ },
930
+ {
931
+ id: 'no-credit',
932
+ says: [
933
+ /\b(?:out of (?:credit|credits|balance|money|tokens)|no (?:credit|credits|balance|money) left|ran out of (?:credit|credits|balance|money|tokens)|(?:credit|balance) (?:is )?(?:too low|exhausted|empty)|billing|top ?up|prepaid)\b/,
934
+ /\b(?:sin (?:credito|creditos|saldo|fondos|tokens)|se (?:me |le )?(?:acab|termin)\w* (?:el |los |la |mi |mis |su |sus )?(?:credito|creditos|saldo|fondos|tokens)|saldo|recarga\w*|facturacion|prepago)\b/,
935
+ ],
936
+ cards: ['provider-credit-exhausted', 'gemini-credits-depleted', 'cursor-usage-limit', 'budget-exhausted'],
937
+ },
938
+ {
939
+ id: 'rate-limited',
940
+ says: [
941
+ /\b(?:rate[ -]?limit\w*|usage limit|limit reached|quota|too many requests|429)\b/,
942
+ /\b(?:cuota|limite de uso|limite de (?:peticiones|solicitudes|mensajes)|demasiadas (?:peticiones|solicitudes)|(?:llego|alcanzo|lleg\w*) (?:al|a su|a mi) limite|se (?:me |le )?acab\w* (?:el |la |mi |su )?(?:cuota|uso|plan))\b/,
943
+ ],
944
+ cards: ['gemini-rate-limited', 'cursor-usage-limit', 'gemini-high-demand', 'provider-credit-exhausted', 'gemini-credits-depleted', 'budget-exhausted', 'limits-real'],
945
+ },
946
+ {
947
+ id: 'silent',
948
+ says: [
949
+ /\b(?:no|not|never|doesn'?t|don'?t|didn'?t|won'?t|isn'?t|aren'?t|wasn'?t|can'?t|cannot)\s+(?:\w+\s+)?(?:answer|respond|repl|react|say anything|do anything|finish|come back)/,
950
+ /\bstopped (?:answering|responding|replying|talking|working)|\b(?:hangs?|hanging|hung|stuck|frozen|freez\w*|silent|silence)\b|\bkeeps (?:thinking|loading|spinning|waiting)|\btakes (?:forever|ages|too long)|\bnothing (?:happens|comes back)|\btime ?out|\btimed out|\btime limit/,
951
+ /\b(?:no|nunca|ya no)\s+(?:me\s+|nos\s+|le\s+|te\s+)?(?:contest|respond|reaccion|termin|regres|devuelv|hace nada|dice nada|sale nada|escrib)|\bdej\w* de (?:contestar|responder|escribir)|\bsin respuesta|\bno hay respuesta/,
952
+ /\b(?:se )?qued\w* (?:pensando|cargando|callad\w*|colgad\w*|trabad\w*|atorad\w*|congelad\w*|esperando|en silencio)|\bse (?:colg|trab|ator|congel|pasm)\w*|\btarda (?:mucho|demasiado|horas|una eternidad)|\btiempo limite/,
953
+ ],
954
+ cards: ['timeout', 'not-signed-in', 'provider-credit-exhausted', 'gemini-rate-limited', 'gemini-high-demand', 'gemini-credits-depleted', 'gemini-ineligible-tier', 'cursor-usage-limit', 'opencode-default-provider', 'opencode-server-error', 'madre-agent', 'ollama', 'stream-reconnecting', 'runaway-room', 'interrupted'],
955
+ },
956
+ {
957
+ id: 'broken',
958
+ says: [
959
+ /\b(?:doesn'?t|does not|isn'?t|is not|not|won'?t|stopped) work\w*|\bbroken\b|\bfail(?:s|ed|ing)?\b/,
960
+ /\bno (?:funciona|jala|sirve|anda|arranca|abre)\b|\bfall(?:a|o|ando)\b|\bdej\w* de funcionar|\besta roto\b/,
961
+ ],
962
+ cards: ['not-signed-in', 'not-installed', 'timeout', 'provider-credit-exhausted', 'gemini-rate-limited', 'gemini-ineligible-tier', 'cursor-usage-limit', 'opencode-default-provider', 'madre-agent', 'ollama', 'adapter-pending'],
963
+ },
964
+ ];
965
+
966
+ // The cards a symptom points to, in the order the symptoms are listed, for that agent if one is named.
967
+ export function symptomConditions(query) {
968
+ const text = fold(query);
969
+ const agent = named(wordsOf(query));
970
+ const ids = [...new Set(SYMPTOMS.filter((symptom) => symptom.says.some((pattern) => pattern.test(text))).flatMap((symptom) => symptom.cards))];
971
+ const owners = (id) => Object.keys(BELONGS).filter((owner) => BELONGS[owner].includes(id));
972
+ const cards = ids.map((id) => CONDITIONS.find((condition) => condition.id === id)).filter(Boolean)
973
+ .filter((condition) => !owners(condition.id).length || owners(condition.id).includes(agent));
974
+ return forAgent(cards, agent).map(said);
975
+ }
715
976
 
716
977
  export function searchConditions(query) {
717
- const words = fold(query).split(/[^a-z0-9#.@_-]+/).filter(Boolean);
978
+ const words = wordsOf(query);
718
979
  const all = allConditions();
719
980
  if (!words.length) return all;
720
981
  // A symptom is a few words, not a phrase to be found whole. An agent's name narrows the list to
721
982
  // that agent's conditions and the general ones; every other word has to appear somewhere in the
722
983
  // condition, read in the language it is shown in, in either language's original, or in its fixes.
723
984
  // «claude tiempo limite» used to find nothing, and only «timeout» found the timeout card.
724
- const agent = words.find((word) => AGENT_WORDS.has(word.replace(/^@/, '')))?.replace(/^@/, '') ?? null;
985
+ const agent = named(words);
725
986
  const rest = words.filter((word) => !AGENT_WORDS.has(word.replace(/^@/, '')));
726
- return all.filter((condition) => {
987
+ return forAgent(all.filter((condition) => {
727
988
  if (agent && condition.agent && condition.agent !== agent) return false;
728
989
  const source = CONDITIONS.find((one) => one.id === condition.id);
729
990
  const haystack = fold([condition.id, condition.code, condition.title, condition.diagnosis, condition.remedy, condition.agent ?? '', source?.title, source?.diagnosis, ...Object.values(condition.fixes ?? {}).flat()].join(' '));
730
991
  if (!rest.length) return !agent || condition.agent === agent || haystack.includes(agent);
731
992
  return rest.every((word) => haystack.includes(word));
732
- });
993
+ }), agent);
994
+ }
995
+
996
+ // A symptom is said in the words a person has, not the catalogue's. When no condition holds every
997
+ // word, the ones sharing the most of them come first: «codex no responde timeout» still finds the
998
+ // timeout. An agent's name keeps to that agent and the general ones; little words do not count.
999
+ const LOOSE_SKIP = new Set(['the', 'and', 'not', 'for', 'with', 'que', 'los', 'las', 'del', 'por', 'una', 'uno', 'con', 'sin', 'esta', 'este', 'muy', 'mas', 'pero']);
1000
+ export function looseConditions(query) {
1001
+ const words = wordsOf(query).map((word) => word.replace(/^@/, '')).filter((word) => word.length >= 3 && !LOOSE_SKIP.has(word));
1002
+ const agent = words.find((word) => AGENT_WORDS.has(word)) ?? null;
1003
+ const rest = words.filter((word) => !AGENT_WORDS.has(word));
1004
+ if (!rest.length) return [];
1005
+ return allConditions()
1006
+ .filter((condition) => !agent || !condition.agent || condition.agent === agent)
1007
+ .map((condition) => {
1008
+ const haystack = fold([condition.id, condition.code, condition.title, condition.diagnosis, condition.remedy].join(' '));
1009
+ return { condition, score: rest.filter((word) => haystack.includes(word)).length + (agent && condition.agent === agent ? 0.5 : 0) };
1010
+ })
1011
+ .filter((entry) => entry.score >= 1)
1012
+ .sort((a, b) => b.score - a.score)
1013
+ .map((entry) => entry.condition);
1014
+ }
1015
+
1016
+ // What Diagnosis shows for what was written, most probable first. A pasted error names its own
1017
+ // cause, so those cards lead — except the ones that only explain something, which a stray word
1018
+ // can match. Then what the words mean as a symptom, then the cards that hold every word, and only
1019
+ // when nothing did, the ones holding the most of them. One card appears once.
1020
+ export function findConditions(query) {
1021
+ const agent = named(wordsOf(query));
1022
+ const byError = forAgent(diagnose(query, agent), agent);
1023
+ const found = [
1024
+ ...byError.filter((condition) => condition.severity !== 'informational'),
1025
+ ...symptomConditions(query),
1026
+ ...byError.filter((condition) => condition.severity === 'informational'),
1027
+ ...searchConditions(query),
1028
+ ];
1029
+ const seen = new Set();
1030
+ const unique = found.filter((condition) => !seen.has(condition.id) && seen.add(condition.id));
1031
+ return unique.length ? unique : looseConditions(query);
733
1032
  }
734
1033
 
1034
+ // A column of commands for a system: its own, or for WSL and Windows Linux's, which is what runs
1035
+ // there; macOS's only when nothing else was written.
1036
+ const columnFor = (fixes, platform) => fixes?.[platform] ?? (platform === 'wsl' || platform === 'win32' ? fixes?.linux : null) ?? fixes?.darwin ?? null;
1037
+ // On Windows a card that has no line of its own says first where those commands run (D-001).
1038
+ export const WINDOWS_FIRST = ['# On Windows, MADRE runs inside WSL2, Linux inside Windows: see «MADRE on Windows».', '# in Ubuntu (WSL):'];
735
1039
  export function fixesFor(condition, platform, agent = null) {
736
- const base = condition.fixes?.[platform] ?? condition.fixes?.darwin ?? [];
737
- const perAgent = condition.perAgent?.[agent]?.[platform];
738
- return perAgent ? [...perAgent, ...(base.length && !base[0].startsWith('#') ? base : [])] : base;
1040
+ const base = columnFor(condition.fixes, platform) ?? [];
1041
+ const perAgent = condition.perAgent?.[agent] ? columnFor(condition.perAgent[agent], platform) : null;
1042
+ const lines = perAgent ? [...perAgent, ...(base.length && !base[0].startsWith('#') ? base : [])] : base;
1043
+ const ownWindows = condition.fixes?.win32 || condition.perAgent?.[agent]?.win32;
1044
+ return platform === 'win32' && !ownWindows && lines.length ? [...WINDOWS_FIRST, ...lines] : lines;
739
1045
  }
@@ -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
  // Your own wallpaper (1.0.3): a picture of yours behind MADRE, fitted to the screen like the ones
4
4
  // that ship. The page does here what was done by hand for each of those (wallpapers/ →
5
5
  // public/assets/wallpapers, and their colours in styles.css): it reads the picture, keeps its
@@ -7,13 +7,14 @@
7
7
  // server keeps it once for every page (src/looks.mjs); each page still chooses it or not. Shared by
8
8
  // the room (app.js) and Home (salas-mac.js), which each draw it with their own keys.
9
9
  import { t } from './i18n.js';
10
+ import { trazo } from './icons.js';
10
11
 
11
12
  export const CUSTOM_WALL = 'custom';
12
13
  const SIDE = 2880;
13
14
  const READ_MAX = 40 * 1024 * 1024;
14
15
  const SEND_MAX = 8 * 1024 * 1024;
15
16
  const META_KEY = 'pulse.wallpaper.custom';
16
- const PLUS_ICON = '<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 4.5v11M4.5 10h11" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>';
17
+ const PLUS_ICON = trazo('add');
17
18
 
18
19
  const node = (tag, className, text) => {
19
20
  const made = document.createElement(tag);