@jossuealcala/madre 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.en.md +40 -1
  2. package/CHANGELOG.md +40 -1
  3. package/README.en.md +3 -3
  4. package/README.md +3 -3
  5. package/SECURITY.md +11 -6
  6. package/TRADEMARKS.md +6 -2
  7. package/bin/madre.mjs +76 -11
  8. package/docs/REFERENCE.md +16 -10
  9. package/docs/SDK.md +36 -9
  10. package/docs/en/REFERENCE.md +12 -8
  11. package/docs/en/SDK.md +34 -8
  12. package/docs/en/training/README.md +1 -1
  13. package/docs/sdk/connector-module.mjs +1 -1
  14. package/docs/sdk/hello-module.mjs +39 -4
  15. package/docs/training/README.md +1 -1
  16. package/docs/training/train.sh +3 -0
  17. package/habilidades/explicamelo-facil/HABILIDAD.md +19 -0
  18. package/habilidades/hojas-de-calculo/HABILIDAD.md +18 -0
  19. package/habilidades/mensajes-a-clientes/HABILIDAD.md +19 -0
  20. package/habilidades/publicaciones-para-redes/HABILIDAD.md +19 -0
  21. package/habilidades/resumen-y-pendientes/HABILIDAD.md +18 -0
  22. package/habilidades/tu-pagina-paso-a-paso/HABILIDAD.md +19 -0
  23. package/package.json +7 -4
  24. package/public/activity.js +66 -22
  25. package/public/app.js +4947 -894
  26. package/public/assets/brand/OFL-SpaceGrotesk.txt +93 -0
  27. package/public/assets/brand/SpaceGrotesk-latin-ext.woff2 +0 -0
  28. package/public/assets/brand/SpaceGrotesk-latin.woff2 +0 -0
  29. package/public/assets/brand/madre-app-180.png +0 -0
  30. package/public/assets/brand/madre-app-192.png +0 -0
  31. package/public/assets/brand/madre-app-512.png +0 -0
  32. package/public/assets/brand/madre-app.svg +1 -1
  33. package/public/assets/brand/madre-favicon.svg +1 -1
  34. package/public/attribution.js +29 -19
  35. package/public/auto-open.js +102 -0
  36. package/public/brands.js +36 -19
  37. package/public/changes.js +63 -0
  38. package/public/en.js +1085 -102
  39. package/public/es.js +2940 -1656
  40. package/public/i18n.js +11 -0
  41. package/public/index.html +31 -27
  42. package/public/loader.js +322 -117
  43. package/public/macroverso.js +57 -355
  44. package/public/manual-content.js +69 -9
  45. package/public/manual.js +21 -6
  46. package/public/market-view.js +298 -84
  47. package/public/market.js +25 -2
  48. package/public/mcp-catalog.js +7 -2
  49. package/public/missions.js +169 -0
  50. package/public/news-scenes.js +292 -0
  51. package/public/nostromo-engine.js +935 -654
  52. package/public/notices.js +78 -0
  53. package/public/notifications.js +119 -0
  54. package/public/power.js +1 -1
  55. package/public/provider-marks.js +170 -0
  56. package/public/provider-pick.js +147 -0
  57. package/public/resay.js +4 -0
  58. package/public/review-ask.js +16 -13
  59. package/public/routing.js +29 -3
  60. package/public/salas-mac.css +467 -47
  61. package/public/salas-mac.html +8 -5
  62. package/public/salas-mac.js +805 -109
  63. package/public/salas.css +2 -2
  64. package/public/salas.html +2 -2
  65. package/public/salas.js +1 -1
  66. package/public/starters.js +128 -0
  67. package/public/styles.css +3036 -340
  68. package/public/subscription.js +303 -0
  69. package/public/terms-field.js +170 -0
  70. package/public/terms.js +117 -19
  71. package/public/tips.js +158 -0
  72. package/public/tour-chapters.js +88 -88
  73. package/public/tour.js +364 -46
  74. package/public/troubleshooting.js +313 -27
  75. package/public/welcome-scene.js +446 -0
  76. package/public/welcome.js +827 -282
  77. package/src/adapters/claude.mjs +2 -1
  78. package/src/adapters/codex.mjs +2 -1
  79. package/src/adapters/cursor.mjs +9 -6
  80. package/src/adapters/gemini-rest.mjs +236 -0
  81. package/src/adapters/gemini.mjs +13 -7
  82. package/src/adapters/grok.mjs +290 -0
  83. package/src/adapters/madre.mjs +71 -23
  84. package/src/adapters/opencode.mjs +15 -2
  85. package/src/adapters/process.mjs +14 -3
  86. package/src/adapters/steps.mjs +176 -0
  87. package/src/app-invite.mjs +90 -0
  88. package/src/auth-probe.mjs +32 -0
  89. package/src/billing-key.mjs +8 -0
  90. package/src/billing.mjs +317 -0
  91. package/src/bridge/policy.mjs +1 -1
  92. package/src/capabilities.mjs +46 -10
  93. package/src/chats.mjs +44 -2
  94. package/src/checkpoint.mjs +119 -1
  95. package/src/codex-route.mjs +113 -0
  96. package/src/commands.mjs +5 -2
  97. package/src/credentials.mjs +46 -8
  98. package/src/dataset.mjs +18 -7
  99. package/src/directives.mjs +1 -0
  100. package/src/event-store.mjs +25 -2
  101. package/src/extensions.mjs +5 -1
  102. package/src/ficha.mjs +158 -0
  103. package/src/files.mjs +36 -2
  104. package/src/image-studio.mjs +13 -3
  105. package/src/install-metrics.mjs +9 -3
  106. package/src/lease.mjs +6 -1
  107. package/src/looks.mjs +4 -1
  108. package/src/market-check.mjs +1 -1
  109. package/src/market-remote.mjs +135 -1
  110. package/src/mcp/image-server.mjs +59 -90
  111. package/src/mcp/memory-server.mjs +10 -0
  112. package/src/memory-tools.mjs +3 -0
  113. package/src/memory.mjs +29 -4
  114. package/src/models.mjs +21 -3
  115. package/src/modules/ahp.mjs +10 -4
  116. package/src/modules/bishop-exam.mjs +41 -12
  117. package/src/modules/bishop.mjs +2 -2
  118. package/src/modules/choices.mjs +12 -10
  119. package/src/modules/fetch-alone.mjs +7 -0
  120. package/src/modules/github.mjs +6 -2
  121. package/src/modules/helpers.mjs +23 -5
  122. package/src/modules/image-providers.mjs +281 -0
  123. package/src/modules/image-studio.mjs +106 -39
  124. package/src/modules/index.mjs +61 -12
  125. package/src/modules/intents-observe.mjs +3 -1
  126. package/src/modules/isolated.mjs +160 -0
  127. package/src/modules/ollama.mjs +35 -6
  128. package/src/modules/playwright.mjs +78 -20
  129. package/src/modules/reminders.mjs +42 -2
  130. package/src/modules/ripley.mjs +2 -1
  131. package/src/modules/run-alone.mjs +122 -0
  132. package/src/modules/runs.mjs +11 -8
  133. package/src/modules/sdk.mjs +10 -3
  134. package/src/notices-key.mjs +8 -0
  135. package/src/notices.mjs +185 -0
  136. package/src/ollama.mjs +57 -15
  137. package/src/opencode-health.mjs +1 -1
  138. package/src/outbound.mjs +124 -13
  139. package/src/quota-sources.mjs +148 -3
  140. package/src/review-ask.mjs +55 -31
  141. package/src/room/archivist.mjs +30 -5
  142. package/src/room/busy.mjs +16 -0
  143. package/src/room/changes.mjs +79 -0
  144. package/src/room/control.mjs +36 -6
  145. package/src/room/economy.mjs +1 -1
  146. package/src/room/guard.mjs +39 -2
  147. package/src/room/prompt.mjs +49 -6
  148. package/src/room/vectors.mjs +7 -1
  149. package/src/room.mjs +181 -49
  150. package/src/router.mjs +1 -1
  151. package/src/runs.mjs +39 -0
  152. package/src/runtime-detection.mjs +46 -6
  153. package/src/salas.mjs +181 -18
  154. package/src/server.mjs +1101 -118
  155. package/src/service.mjs +116 -0
  156. package/src/setup-trouble.mjs +20 -1
  157. package/src/setup.mjs +1 -1
  158. package/src/skill-check.mjs +269 -0
  159. package/src/skills-import.mjs +128 -0
  160. package/src/skills.mjs +502 -0
  161. package/src/terms.mjs +23 -5
  162. package/src/tour.mjs +31 -5
  163. package/src/updates.mjs +47 -4
  164. package/src/web-preview.mjs +181 -0
  165. package/src/whats-new.mjs +121 -1
  166. package/src/rumbo.mjs +0 -337
package/public/market.js CHANGED
@@ -19,7 +19,7 @@ export const MODULE_FACES = {
19
19
  ash: { line: 'Shorter answers, fewer tokens', summary: 'Asks every agent to go straight to the point: no long introductions and no repeating what you already know. You spend less of your plan and read faster. Turn it off whenever you want the long answer.', wide: true, window: true, hue: ['#38bdf8', '#0369a1'], icon: trazoDrawing('mod-ash') },
20
20
  intents: { line: 'How hard each question should think', summary: 'Before you send, it suggests the thinking level your question needs: low for a quick question, high for a hard bug. It learns from your own project and never changes anything without you.', wide: true, window: true, hue: ['#a78bfa', '#6d28d9'], icon: trazoDrawing('mod-intents') },
21
21
  ollama: { line: 'AI that runs on your own computer', summary: 'A small AI model on your computer, with Ollama. It finds things in your project\'s memory by meaning, summarizes your conversations and answers as @madre. Free, private and it works without internet.', wide: true, window: true, hue: ['#4ade80', '#15803d'], icon: trazoDrawing('spark') },
22
- 'image-studio': { line: 'Logos and banners by your agents', summary: 'Ask in the conversation for a logo, a banner or an illustration and the agent makes it with your own Gemini key. The images are saved in your project.', hue: ['#fb7185', '#c026d3'], icon: trazoDrawing('mod-image') },
22
+ 'image-studio': { line: 'Logos and banners made by your AIs', summary: 'Ask in the conversation for a logo, a banner or an illustration and your AI makes it with the image model you choose: Gemini, OpenAI or Grok, on your own key. MADRE finds the keys you already have. The images are saved in your project.', hue: ['#fb7185', '#c026d3'], icon: trazoDrawing('mod-image') },
23
23
  playwright: { line: 'Your agents open your page and look at it', summary: 'The agents open your page in a browser of their own, click through it, read its errors and bring back screenshots: they check their work the way a person would.', hue: ['#60a5fa', '#1d4ed8'], icon: trazoDrawing('mod-browser') },
24
24
  ripley: { line: 'See your pages beside the conversation', summary: 'Shows web pages, drawings (SVG) and documents (Markdown) beside the conversation, updated while the agents work.', hue: ['#fbbf24', '#ea580c'], icon: trazoDrawing('mod-viewer') },
25
25
  'git-pulse': { line: 'Your repository, at a glance', summary: 'Shows how your repository stands: what changed, the last commits and the branch you are on. It only reads; it never commits for you.', hue: ['#94a3b8', '#475569'], icon: trazoDrawing('mod-git') },
@@ -147,7 +147,7 @@ export const MARKET = {
147
147
  ahp: { shelf: 'no-terminal', scope: 'project', price: 0, featured: 2, pitch: 'Hand work from one agent to another without losing the thread: the project keeps its state beside the code.' },
148
148
  runs: { shelf: 'no-terminal', scope: 'everywhere', price: 0 },
149
149
  github: { shelf: 'no-terminal', scope: 'everywhere', price: 0 },
150
- 'image-studio': { shelf: 'create', scope: 'everywhere', price: 0, featured: 3, pitch: 'Ask for a logo, a banner or an illustration, and the agents make it with your own key.' },
150
+ 'image-studio': { shelf: 'create', scope: 'everywhere', price: 0, featured: 3, pitch: 'Ask for a logo, a banner or an illustration, and your AIs make it with your own key.' },
151
151
  ripley: { shelf: 'create', scope: 'everywhere', price: 0 },
152
152
  choices: { shelf: 'create', scope: 'everywhere', price: 0 },
153
153
  notes: { shelf: 'organize', scope: 'everywhere', price: 0 },
@@ -224,6 +224,26 @@ export function setMarketCatalog(catalog) {
224
224
  remote = catalog && Array.isArray(catalog.modules) ? { ...catalog, byId: new Map(catalog.modules.map((entry) => [entry.id, entry])) } : null;
225
225
  }
226
226
  export const remoteEntry = (id) => remote?.byId.get(id) ?? null;
227
+ // THE SKILLS of the catalog (2026-11-08, H-8): a list of its own, never mixed with the modules —
228
+ // a module adds buttons and pages, a skill tells the agents how the person works. Their words come
229
+ // in both languages like everything else here.
230
+ export const marketSkills = () => (Array.isArray(remote?.skills) ? remote.skills : []).map((entry) => ({
231
+ ...entry,
232
+ name: pick(entry.name) ?? entry.id,
233
+ line: pick(entry.line) ?? '',
234
+ summary: pick(entry.summary) ?? '',
235
+ changes: pick(entry.changes),
236
+ }));
237
+ // Which of them this computer got, as /api/market says: version and when.
238
+ let skillsHere = {};
239
+ export const setMarketSkills = (installed) => { skillsHere = installed && typeof installed === 'object' ? installed : {}; };
240
+ export const skillHere = (id) => skillsHere[id] ?? null;
241
+ // The skills that come with MADRE (1.1.4): already here, nothing to get.
242
+ let skillsIncluded = [];
243
+ export const includedSkills = () => skillsIncluded;
244
+ // And the ones this person already keeps: theirs, brought over, or got from the Market.
245
+ let skillsYours = [];
246
+ export const yourSkills = () => skillsYours;
227
247
  // THE PAID MODULES (src/market-license.mjs): which ones this computer bought, as /api/market says
228
248
  // (never the keys), and whether one still has to be bought before it can be got.
229
249
  let bought = {};
@@ -270,6 +290,9 @@ export async function loadMarket({ toast = null, open = null } = {}) {
270
290
  if (!answer) return null;
271
291
  setMarketCatalog(answer.catalog);
272
292
  setMarketLicensed(answer.licensed);
293
+ setMarketSkills(answer.skills);
294
+ skillsIncluded = Array.isArray(answer.included) ? answer.included : [];
295
+ skillsYours = Array.isArray(answer.yours) ? answer.yours : [];
273
296
  if (!toast) return answer;
274
297
  const updated = answer.news ?? [];
275
298
  if (updated.length) {
@@ -12,8 +12,10 @@
12
12
  // 'signin' with your account: MADRE found its sign-in (OAuth, with registration of new apps open),
13
13
  // which is the part MADRE does; the tools are read the moment you sign in;
14
14
  // 'token' with a token you make on its page: MADRE checks it as soon as you paste it.
15
- // Asana and HubSpot answered that they only accept apps they already know; they are left out until
16
- // they do. Every name and mark below is its maker's trademark, shown only to say which service a
15
+ // HubSpot asks for an app of its own made on its developer page (no open registration, checked
16
+ // 2026-11-11); it is left out until it opens one. Asana opened registration in its v2 server; Airtable
17
+ // and Mercado Pago publish theirs (2026-11-11). Google's Drive and Gmail servers are a developer
18
+ // preview that asks for a Google Cloud project; Shopify has none for a store's owner: both wait. Every name and mark below is its maker's trademark, shown only to say which service a
17
19
  // connector reaches (nominative use), never to suggest that its maker endorses MADRE. The marks are
18
20
  // Simple Icons' drawings (simple-icons@16.35.0, CC0-1.0) with their official colors. Five it does not
19
21
  // draw come from other free sets, through Iconify: Microsoft and Canva from CoreUI Brands (CC0-1.0),
@@ -41,6 +43,8 @@ export const MCP_CATALOG = [
41
43
  { id: 'atlassian', label: 'Jira · Confluence', maker: 'Atlassian', group: 'work', hue: '#3b82f6', url: 'https://mcp.atlassian.com/v1/mcp', auth: 'oauth', checked: 'signin', brand: '#0052CC', logo: 'M7.12 11.084a.683.683 0 00-1.16.126L.075 22.974a.703.703 0 00.63 1.018h8.19a.678.678 0 00.63-.39c1.767-3.65.696-9.203-2.406-12.52zM11.434.386a15.515 15.515 0 00-.906 15.317l3.95 7.9a.703.703 0 00.628.388h8.19a.703.703 0 00.63-1.017L12.63.38a.664.664 0 00-1.196.006z', about: 'Your Jira tickets and Confluence pages, in the conversation.' },
42
44
  { id: 'monday', label: 'monday.com', maker: 'monday.com', group: 'work', hue: '#f43f5e', url: 'https://mcp.monday.com/mcp', auth: 'oauth', checked: 'signin', brand: '#ffffff', logoBox: '0 0 256 156', logoMarkup: '<path fill="#f62b54" d="M31.846 153.489a31.97 31.97 0 0 1-27.86-16.167a30.91 30.91 0 0 1 .875-31.823l57.373-90.096A31.99 31.99 0 0 1 90.556.015a31.93 31.93 0 0 1 27.41 16.896c5.349 10.113 4.68 22.28-1.725 31.774L58.904 138.78a31.98 31.98 0 0 1-27.058 14.709"/><path fill="#fc0" d="M130.256 153.488c-11.572 0-22.22-6.187-27.812-16.13a30.81 30.81 0 0 1 .875-31.737l57.264-89.89A31.94 31.94 0 0 1 188.93.016c11.669.255 22.244 6.782 27.592 16.993a30.81 30.81 0 0 1-2.066 31.92l-57.252 89.889a31.93 31.93 0 0 1-26.948 14.671"/><ellipse cx="226.466" cy="125.324" fill="#00ca72" rx="29.538" ry="28.918"/>', about: 'Your boards and items: read them and update them.' },
43
45
  { id: 'zapier', label: 'Zapier', maker: 'Zapier', group: 'work', hue: '#fb923c', url: 'https://mcp.zapier.com/api/mcp/mcp', auth: 'oauth', checked: 'signin', brand: '#FF4F00', logo: 'M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z', about: 'Thousands of apps through the actions you choose in Zapier.' },
46
+ { id: 'airtable', label: 'Airtable', maker: 'Airtable', group: 'work', hue: '#38bdf8', url: 'https://mcp.airtable.com/mcp', auth: 'oauth', checked: 'signin', brand: '#18BFFF', logo: 'M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z', about: 'Your bases and their records: look things up, add rows and keep lists up to date.' },
47
+ { id: 'asana', label: 'Asana', maker: 'Asana', group: 'work', hue: '#f87171', url: 'https://mcp.asana.com/v2/mcp', auth: 'oauth', checked: 'signin', brand: '#F06A6A', logo: 'M18.78 12.653c-2.882 0-5.22 2.336-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.34 5.22-5.22-2.336-5.22-5.22-5.22zm-13.56 0c-2.88 0-5.22 2.337-5.22 5.22s2.338 5.22 5.22 5.22 5.22-2.338 5.22-5.22-2.336-5.22-5.22-5.22zm12-6.525c0 2.883-2.337 5.22-5.22 5.22-2.882 0-5.22-2.337-5.22-5.22 0-2.88 2.338-5.22 5.22-5.22 2.883 0 5.22 2.34 5.22 5.22z', about: 'Your projects and tasks: what is due, who has it, and new tasks from a conversation.' },
44
48
  { id: 'sentry', label: 'Sentry', maker: 'Sentry', group: 'dev', hue: '#8b5cf6', url: 'https://mcp.sentry.dev/mcp', auth: 'oauth', checked: 'signin', brand: '#362D59', logo: 'M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z', about: 'The errors your app had in production, with what caused them.' },
45
49
  { id: 'vercel', label: 'Vercel', maker: 'Vercel', group: 'dev', hue: '#e5e5e5', url: 'https://mcp.vercel.com', auth: 'oauth', checked: 'signin', brand: '#000000', logo: 'm12 1.608 12 20.784H0Z', about: 'Your projects, deploys and their logs.' },
46
50
  { id: 'netlify', label: 'Netlify', maker: 'Netlify', group: 'dev', hue: '#14b8a6', url: 'https://mcp.netlify.com/mcp', auth: 'oauth', checked: 'signin', brand: '#00C7B7', logo: 'M6.49 19.04h-.23L5.13 17.9v-.23l1.73-1.71h1.2l.15.15v1.2L6.5 19.04ZM5.13 6.31V6.1l1.13-1.13h.23L8.2 6.68v1.2l-.15.15h-1.2L5.13 6.31Zm9.96 9.09h-1.65l-.14-.13v-3.83c0-.68-.27-1.2-1.1-1.23-.42 0-.9 0-1.43.02l-.07.08v4.96l-.14.14H8.9l-.13-.14V8.73l.13-.14h3.7a2.6 2.6 0 0 1 2.61 2.6v4.08l-.13.14Zm-8.37-2.44H.14L0 12.82v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14Zm17.14 0h-6.58l-.14-.14v-1.64l.14-.14h6.58l.14.14v1.64l-.14.14ZM11.05 6.55V1.64l.14-.14h1.65l.14.14v4.9l-.14.14h-1.65l-.14-.13Zm0 15.81v-4.9l.14-.14h1.65l.14.13v4.91l-.14.14h-1.65l-.14-.14Z', about: 'Create, deploy and manage your Netlify sites.' },
@@ -53,6 +57,7 @@ export const MCP_CATALOG = [
53
57
  { id: 'canva', label: 'Canva', maker: 'Canva', group: 'business', hue: '#06b6d4', url: 'https://mcp.canva.com/mcp', auth: 'oauth', checked: 'signin', brand: '#00c4cc', logoBox: '0 0 32 32', logo: 'M16 0C7.161 0 0 7.161 0 16s7.161 16 16 16s16-7.161 16-16S24.839 0 16 0M9.281 10.24c1.005 0 1.787.733 1.875 1.599c.095.781-.229 1.464-1.093 1.875c-.459.229-.641.229-.735.093c-.047-.093 0-.181.093-.276c.824-.681.824-1.233.729-2.009c-.047-.505-.411-.824-.776-.824c-1.604 0-3.885 3.563-3.568 6.172c.141 1.005.735 2.193 2.011 2.193c.412 0 .871-.136 1.281-.317c.667-.355 1.068-.625 1.464-1.068c-.099-1.183.937-2.729 2.468-2.729c.688 0 1.235.276 1.281.781c.089.683-.505.776-.687.776s-.505-.047-.505-.229c-.041-.183.411-.093.369-.505c-.047-.276-.323-.364-.593-.364c-.964 0-1.511 1.328-1.375 2.145c.047.369.228.735.599.735c.271 0 .683-.412.817-1.005c.093-.412.459-.688.781-.688c.136 0 .224.047.271.229v.183c-.041.183-.183.735-.135.869c0 .095.047.229.228.229c.12 0 .579-.24 1.037-.615c.151-.787.333-1.729.333-1.807c.047-.323.183-.641.823-.641c.14 0 .229.047.276.229v.183l-.183.823c.595-.776 1.464-1.323 2.011-1.323c.229 0 .412.135.412.364c0 .136 0 .365-.095.595c-.181.5-.411 1.281-.547 1.963c0 .183.047.365.276.365s.912-.271 1.459-1.005l.011-.005c0-.089-.011-.177-.011-.265c0-.552.047-1.005.141-1.328c.093-.365.547-.683.823-.683c.135 0 .276.088.276.224c0 .047 0 .14-.047.183c-.183.599-.324 1.145-.324 1.692c0 .323.048.776.141 1.052c0 .047.041.093.088.093c.095 0 .735-.593 1.188-1.375c-.412-.271-.641-.729-.641-1.276c0-.963.6-1.464 1.147-1.464c.459 0 .823.319.823.959c0 .412-.136.871-.364 1.281h.135c.292.011.579-.109.776-.317a.4.4 0 0 1 .183-.156c.448-.568 1.104-.989 1.88-.989c.64 0 1.229.276 1.276.776c.093.687-.505.823-.688.823c-.181 0-.504-.047-.504-.229s.411-.093.369-.5c-.047-.276-.323-.369-.599-.369c-.912 0-1.505 1.187-1.371 2.151c.047.364.229.776.595.776c.276 0 .687-.412.869-1.005c.088-.364.459-.688.776-.688c.14 0 .229.047.276.229c0 .095 0 .276-.183.871c-.229.411-.229.64-.181.823c.041.364.224.64.411.776a1 1 0 0 1 .089.135c0 .095-.048.188-.183.188c-.047 0-.089 0-.136-.047c-.687-.276-.963-.735-1.052-1.193c-.276.323-.593.505-.963.505c-.595 0-1.183-.547-1.276-1.235a2.1 2.1 0 0 1 .099-.864c-.271.172-.563.271-.833.271h-.224c-.599.869-1.24 1.464-1.693 1.735a1.2 1.2 0 0 1-.505.14c-.088 0-.228-.047-.271-.14c-.129-.203-.208-.521-.26-.885c-.641.697-1.527 1.072-1.937 1.072c-.459 0-.729-.276-.776-.733v-.5c.135-1.005.505-1.604.505-1.787a.105.105 0 0 0-.095-.093c-.317 0-1.369 1.099-1.552 1.833l-.14.593c-.089.411-.5.687-.776.687c-.136 0-.229-.047-.271-.228v-.183l.057-.312c-.579.411-1.157.676-1.433.676c-.411 0-.64-.229-.681-.552c-.276.371-.595.552-1.005.552c-.475 0-.932-.323-1.151-.791c-.329.369-.699.739-1.136 1.02c-.64.412-1.369.729-2.24.729c-.776 0-1.463-.412-1.828-.776c-.552-.505-.869-1.281-.916-2.011c-.271-2.239 1.099-5.12 3.197-6.401c.505-.276 1.011-.457 1.511-.457zm13.026 4.391c-.135 0-.228.229-.228.452c0 .371.181.781.411 1.011a2.3 2.3 0 0 0 .141-.781c0-.452-.183-.681-.324-.681z', about: 'Find, create and export your Canva designs.' },
54
58
  { id: 'webflow', label: 'Webflow', maker: 'Webflow', group: 'business', hue: '#4f46e5', url: 'https://mcp.webflow.com/mcp', auth: 'oauth', checked: 'signin', brand: '#146EF5', logo: 'm24 4.515-7.658 14.97H9.149l3.205-6.204h-.144C9.566 16.713 5.621 18.973 0 19.485v-6.118s3.596-.213 5.71-2.435H0V4.515h6.417v5.278l.144-.001 2.622-5.277h4.854v5.244h.144l2.72-5.244H24Z', about: 'Your Webflow sites, their pages and CMS collections.' },
55
59
  { id: 'wix', label: 'Wix', maker: 'Wix', group: 'business', hue: '#a855f7', url: 'https://mcp.wix.com/mcp', auth: 'oauth', checked: 'signin', brand: '#0C6EFC', logo: 'm0 7.354 2.113 9.292h.801a1.54 1.54 0 0 0 1.506-1.218l1.351-6.34a.171.171 0 0 1 .167-.137c.08 0 .15.058.167.137l1.352 6.34a1.54 1.54 0 0 0 1.506 1.218h.805l2.113-9.292h-.565c-.62 0-1.159.43-1.296 1.035l-1.26 5.545-1.106-5.176a1.76 1.76 0 0 0-2.19-1.324c-.639.176-1.113.716-1.251 1.365l-1.094 5.127-1.26-5.537A1.33 1.33 0 0 0 .563 7.354H0zm13.992 0a.951.951 0 0 0-.951.95v8.342h.635a.952.952 0 0 0 .951-.95V7.353h-.635zm1.778 0 3.158 4.66-3.14 4.632h1.325c.368 0 .712-.181.918-.486l1.756-2.59a.12.12 0 0 1 .197 0l1.754 2.59c.206.305.55.486.918.486h1.326l-3.14-4.632L24 7.354h-1.326c-.368 0-.712.181-.918.486l-1.772 2.617a.12.12 0 0 1-.197 0L18.014 7.84a1.108 1.108 0 0 0-.918-.486H15.77z', about: 'Your Wix sites and what they sell.' },
60
+ { id: 'mercadopago', label: 'Mercado Pago', maker: 'Mercado Pago', group: 'business', hue: '#0ea5e9', url: 'https://mcp.mercadopago.com/mcp', auth: 'oauth', checked: 'signin', brand: '#00B1EA', logo: 'M11.115 16.479a.93.927 0 0 1-.939-.886c-.002-.042-.006-.155-.103-.155-.04 0-.074.023-.113.059-.112.103-.254.206-.46.206a.816.814 0 0 1-.305-.066c-.535-.214-.542-.578-.521-.725.006-.038.007-.08-.02-.11l-.032-.03h-.034c-.027 0-.055.012-.093.039a.788.786 0 0 1-.454.16.7.699 0 0 1-.253-.05c-.708-.27-.65-.928-.617-1.126.005-.041-.005-.072-.03-.092l-.05-.04-.047.043a.728.726 0 0 1-.505.203.73.728 0 0 1-.732-.725c0-.4.328-.722.732-.722.364 0 .675.27.721.63l.026.195.11-.165c.01-.018.307-.46.852-.46.102 0 .21.016.316.05.434.13.508.52.519.68.008.094.075.1.09.1.037 0 .064-.024.083-.045a.746.744 0 0 1 .54-.225c.128 0 .263.03.402.09.69.293.379 1.158.374 1.167-.058.144-.061.207-.005.244l.027.013h.02c.03 0 .07-.014.134-.035.093-.032.235-.08.367-.08a.944.942 0 0 1 .94.93.936.934 0 0 1-.94.928zm7.302-4.171c-1.138-.98-3.768-3.24-4.481-3.77-.406-.302-.685-.462-.928-.533a1.559 1.554 0 0 0-.456-.07c-.182 0-.376.032-.58.095-.46.145-.918.505-1.362.854l-.023.018c-.414.324-.84.66-1.164.73a1.986 1.98 0 0 1-.43.049c-.362 0-.687-.104-.81-.258-.02-.025-.007-.066.04-.125l.008-.008 1-1.067c.783-.774 1.525-1.506 3.23-1.545h.085c1.062 0 2.12.469 2.24.524a7.03 7.03 0 0 0 3.056.724c1.076 0 2.188-.263 3.354-.795a9.135 9.11 0 0 0-.405-.317c-1.025.44-2.003.66-2.946.66-.962 0-1.925-.229-2.858-.68-.05-.022-1.22-.567-2.44-.57-.032 0-.065 0-.096.002-1.434.033-2.24.536-2.782.976-.528.013-.982.138-1.388.25-.361.1-.673.186-.979.185-.125 0-.35-.01-.37-.012-.35-.01-2.115-.437-3.518-.962-.143.1-.28.203-.415.31 1.466.593 3.25 1.053 3.812 1.089.157.01.323.027.491.027.372 0 .744-.103 1.104-.203.213-.059.446-.123.692-.17l-.196.194-1.017 1.087c-.08.08-.254.294-.14.557a.705.703 0 0 0 .268.292c.243.162.677.27 1.08.271.152 0 .297-.015.43-.044.427-.095.874-.448 1.349-.82.377-.296.913-.672 1.323-.782a1.494 1.49 0 0 1 .37-.05.611.61 0 0 1 .095.005c.27.034.533.125 1.003.472.835.62 4.531 3.815 4.566 3.846.002.002.238.203.22.537-.007.186-.11.352-.294.466a.902.9 0 0 1-.484.15.804.802 0 0 1-.428-.124c-.014-.01-1.28-1.157-1.746-1.543-.074-.06-.146-.115-.22-.115a.122.122 0 0 0-.096.045c-.073.09.01.212.105.294l1.48 1.47c.002 0 .184.17.204.395.012.244-.106.447-.35.606a.957.955 0 0 1-.526.171.766.764 0 0 1-.42-.127l-.214-.206a21.035 20.978 0 0 0-1.08-1.009c-.072-.058-.148-.112-.221-.112a.127.127 0 0 0-.094.038c-.033.037-.056.103.028.212a.698.696 0 0 0 .075.083l1.078 1.198c.01.01.222.26.024.511l-.038.048a1.18 1.178 0 0 1-.1.096c-.184.15-.43.164-.527.164a.8.798 0 0 1-.147-.012c-.106-.018-.178-.048-.212-.089l-.013-.013c-.06-.06-.602-.609-1.054-.98-.059-.05-.133-.11-.21-.11a.128.128 0 0 0-.096.042c-.09.096.044.24.1.293l.92 1.003a.204.204 0 0 1-.033.062c-.033.044-.144.155-.479.196a.91.907 0 0 1-.122.007c-.345 0-.712-.164-.902-.264a1.343 1.34 0 0 0 .13-.576 1.368 1.365 0 0 0-1.42-1.357c.024-.342-.025-.99-.697-1.274a1.455 1.452 0 0 0-.575-.125c-.146 0-.287.025-.42.075a1.153 1.15 0 0 0-.671-.564 1.52 1.515 0 0 0-.494-.085c-.28 0-.537.08-.767.242a1.168 1.165 0 0 0-.903-.43 1.173 1.17 0 0 0-.82.335c-.287-.217-1.425-.93-4.467-1.613a17.39 17.344 0 0 1-.692-.189 4.822 4.82 0 0 0-.077.494l.67.157c3.108.682 4.136 1.391 4.309 1.525a1.145 1.142 0 0 0-.09.442 1.16 1.158 0 0 0 1.378 1.132c.096.467.406.821.879 1.003a1.165 1.162 0 0 0 .415.08c.09 0 .179-.012.266-.034.086.22.282.493.722.668a1.233 1.23 0 0 0 .457.094c.122 0 .241-.022.355-.063a1.373 1.37 0 0 0 1.269.841c.37.002.726-.147.985-.41.221.121.688.341 1.163.341.06 0 .118-.002.175-.01.47-.059.689-.24.789-.382a.571.57 0 0 0 .048-.078c.11.032.234.058.373.058.255 0 .501-.086.75-.265.244-.174.418-.424.444-.637v-.01c.083.017.167.026.251.026.265 0 .527-.082.773-.242.48-.31.562-.715.554-.98a1.28 1.279 0 0 0 .978-.194 1.04 1.04 0 0 0 .502-.808 1.088 1.085 0 0 0-.16-.653c.804-.342 2.636-1.003 4.795-1.483a4.734 4.721 0 0 0-.067-.492 27.742 27.667 0 0 0-5.049 1.62zm5.123-.763c0 4.027-5.166 7.293-11.537 7.293-6.372 0-11.538-3.266-11.538-7.293 0-4.028 5.165-7.293 11.539-7.293 6.371 0 11.537 3.265 11.537 7.293zm.46.004c0-4.272-5.374-7.755-12-7.755S.002 7.277.002 11.55L0 12.004c0 4.533 4.695 8.203 11.999 8.203 7.347 0 12-3.67 12-8.204z', about: 'Your Mercado Pago integration: payments, its documentation and checking how it is set up.' },
56
61
  ];
57
62
 
58
63
  // The tile's two letters: the label's words, or its first two letters.
@@ -0,0 +1,169 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
+ // THE FIRST WEEK'S MISSIONS (2026-11-11, the author: «missions instead of a tour»; the ideas in
4
+ // docs/private/TEXTOS-PARA-LA-GENTE.md). The tour told where things are; a person who is new learns
5
+ // by doing something real. Five missions, each a result the person sees, each teaching a piece of
6
+ // MADRE on the way:
7
+ //
8
+ // page a page made by an AI, opened beside the conversation → asking, the permission to create
9
+ // two-ais the same question to two AIs → talking to each one with @
10
+ // undo a change, and Undo → nothing breaks for good
11
+ // local-ai a question to the AI on the computer → @madre, no internet, no cost
12
+ // market anything from the Market: a module, a skill, a connector → MADRE grows with what you add
13
+ //
14
+ // Done is never claimed by a key: each one is seen happening (app.js and market-view.js call
15
+ // `markMission` from the room's own events), kept in ~/.pulse/tour.json (src/tour.mjs, MISSIONS), the
16
+ // same for every project and port. The page hands in what only it can do (`host`): write a message in
17
+ // the box, which AIs are connected, open the Market or Settings.
18
+
19
+ import { t } from './i18n.js';
20
+ import { trazo } from './icons.js';
21
+
22
+ export const MISSIONS = ['page', 'two-ais', 'undo', 'local-ai', 'market'];
23
+
24
+ const el = (tag, className = null, text = null) => {
25
+ const node = document.createElement(tag);
26
+ if (className) node.className = className;
27
+ if (text !== null && text !== undefined) node.textContent = text;
28
+ return node;
29
+ };
30
+ const button = (className, text, onClick) => {
31
+ const node = el('button', className, text);
32
+ node.type = 'button';
33
+ if (onClick) node.addEventListener('click', onClick);
34
+ return node;
35
+ };
36
+
37
+ // What each one is, in the person's words: what to do, and what it teaches.
38
+ const CARDS = {
39
+ page: { icon: 'globe', title: () => t('Make your first page'), teaches: () => t('Ask an AI for a page and watch it appear. You learn how to ask, and how to let it create files.') },
40
+ 'two-ais': { icon: 'agents', title: () => t('Ask two AIs the same thing'), teaches: () => t('Compare their answers side by side. You learn to talk to each one with @ and its name.') },
41
+ undo: { icon: 'reset', title: () => t('Undo a change'), teaches: () => t('Ask for a change and take it back with Undo. You learn that nothing breaks for good.') },
42
+ 'local-ai': { icon: 'chip', title: () => t('Talk to the AI on your computer'), teaches: () => t('@madre answers with what your project remembers, with no internet and at no cost.') },
43
+ market: { icon: 'spark', title: () => t('Get something from the Market'), teaches: () => t('A module, a skill or a connector, with one click. You learn that MADRE grows with what you add.') },
44
+ };
45
+
46
+ let state = { missions: {}, missionsHidden: null };
47
+ let listeners = new Set();
48
+ const done = (id) => Boolean(state.missions?.[id]);
49
+ export const missionsLeft = () => MISSIONS.filter((id) => !done(id)).length;
50
+ export const missionsState = () => state;
51
+ export const onMissions = (fn) => { listeners.add(fn); return () => listeners.delete(fn); };
52
+ const told = () => { for (const fn of listeners) { try { fn(state); } catch { /* a listener that fails does not stop the others */ } } };
53
+
54
+ // What the tour file says now (the tour reads it for its own reasons; it hands it here too).
55
+ export function setMissions(tour) {
56
+ if (!tour) return;
57
+ state = { missions: tour.missions ?? {}, missionsHidden: tour.missionsHidden ?? null };
58
+ told();
59
+ }
60
+
61
+ const post = (change) => fetch('/api/tour', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(change) })
62
+ .then((response) => (response.ok ? response.json() : null)).catch(() => null);
63
+
64
+ // A mission seen happening. Said once: the first time is the one that counts, and a second call is
65
+ // nothing to write. The person hears it in one line, and the last one is celebrated.
66
+ export async function markMission(id, { quiet = false, say = null } = {}) {
67
+ if (!MISSIONS.includes(id) || done(id)) return false;
68
+ state = { ...state, missions: { ...state.missions, [id]: new Date().toISOString() } };
69
+ told();
70
+ const answer = await post({ mission: id });
71
+ const kept = answer?.state ?? answer;
72
+ if (kept?.missions) state = { missions: kept.missions, missionsHidden: kept.missionsHidden ?? null };
73
+ if (!quiet && say) say(missionsLeft() ? t('Step done: {name}. {n} to go.', { name: CARDS[id].title(), n: missionsLeft() }) : t('You did all five. You know what matters in MADRE.'));
74
+ told();
75
+ return true;
76
+ }
77
+ export async function hideMissions(hidden = true) {
78
+ state = { ...state, missionsHidden: hidden ? new Date().toISOString() : null };
79
+ told();
80
+ await post({ missionsHidden: hidden });
81
+ }
82
+
83
+ // THE SHEET: the five, what each teaches, and one key to start it where it can be done.
84
+ let open = null;
85
+ export function openMissions(host = {}) {
86
+ if (open) { open.focus(); return open; }
87
+ const dialog = el('dialog', 'missions');
88
+ dialog.setAttribute('aria-labelledby', 'missions-title');
89
+ const card = el('div', 'missions-card');
90
+ dialog.append(card);
91
+ const close = () => { dialog.close(); };
92
+ dialog.addEventListener('close', () => { stop(); dialog.remove(); open = null; });
93
+ dialog.addEventListener('click', (event) => { if (event.target === dialog) close(); });
94
+
95
+ const paint = () => {
96
+ const left = missionsLeft();
97
+ const head = el('header', 'missions-head');
98
+ const title = el('h2', null, left ? t('Your first steps') : t('You did all five'));
99
+ title.id = 'missions-title';
100
+ // The × of every window of MADRE (2026-11-13): the same key in the same channel, not a bare mark.
101
+ const x = button('surface-mode close x-close x-only', null, close);
102
+ x.innerHTML = `<span class="x-icon">${trazo('close')}</span>`; // trusted: our own SVG string
103
+ x.setAttribute('aria-label', t('Close'));
104
+ const keys = el('span', 'surface-modes window-close');
105
+ keys.append(x);
106
+ head.append(title, keys);
107
+ const lead = el('p', 'missions-lead', left
108
+ ? t('Five things to get to know MADRE by doing something real. Each one takes a couple of minutes, and you can do them in any order.')
109
+ : t('You know what matters in MADRE: asking, letting it create, comparing AIs, undoing and adding what you need. From here on, it is yours.'));
110
+ const bar = el('div', 'missions-bar');
111
+ bar.setAttribute('role', 'progressbar');
112
+ bar.setAttribute('aria-valuemin', '0');
113
+ bar.setAttribute('aria-valuemax', String(MISSIONS.length));
114
+ bar.setAttribute('aria-valuenow', String(MISSIONS.length - left));
115
+ // How far, from the left, whichever ones were done.
116
+ for (let at = 0; at < MISSIONS.length; at += 1) bar.append(el('i', at < MISSIONS.length - left ? 'on' : null));
117
+ const list = el('ol', 'missions-list');
118
+ for (const id of MISSIONS) {
119
+ const one = CARDS[id];
120
+ const item = el('li', `mission${done(id) ? ' done' : ''}`);
121
+ const mark = el('span', 'mission-icon');
122
+ mark.setAttribute('aria-hidden', 'true');
123
+ mark.innerHTML = trazo(done(id) ? 'check' : one.icon); // trusted: our own SVG string
124
+ const words = el('div', 'mission-words');
125
+ words.append(el('b', null, one.title()), el('small', null, one.teaches()));
126
+ item.append(mark, words);
127
+ if (done(id)) item.append(el('span', 'mission-done', t('Done')));
128
+ else {
129
+ const action = actionFor(id, host);
130
+ if (action) item.append(button('mission-go', action.label, () => { close(); action.run(); }));
131
+ if (action?.note) words.append(el('small', 'mission-note', action.note));
132
+ }
133
+ list.append(item);
134
+ }
135
+ const foot = el('footer', 'missions-foot');
136
+ if (host.openTour) foot.append(button('missions-link', t('See where everything is'), () => { close(); host.openTour(); }));
137
+ foot.append(el('span', 'missions-grow'));
138
+ if (left) foot.append(button('missions-link quiet', t('Hide the first steps'), () => { void hideMissions(true); close(); }));
139
+ else foot.append(button('missions-ok', t('Got it'), () => { void hideMissions(true); close(); }));
140
+ card.replaceChildren(head, lead, bar, list, foot);
141
+ };
142
+ const stop = onMissions(() => { if (dialog.isConnected) paint(); });
143
+ paint();
144
+ document.body.append(dialog);
145
+ dialog.showModal();
146
+ open = dialog;
147
+ return dialog;
148
+ }
149
+
150
+ // What the key of each mission does here. A project writes the message in its own box; Home opens a
151
+ // project with it written (host.draft decides). With what a mission needs missing — a second AI, the
152
+ // AI on the computer — the key goes where it is set up instead, and says so.
153
+ function actionFor(id, host) {
154
+ const agents = host.agents?.() ?? [];
155
+ const write = (text) => () => host.draft?.(text);
156
+ if (id === 'page') return { label: t('Do it'), run: write(t('#2 Make me a simple page with a title, a short welcome and a button. Explain how to open it.')) };
157
+ if (id === 'two-ais') {
158
+ const two = agents.filter((agent) => agent !== 'madre').slice(0, 2);
159
+ if (two.length < 2) return { label: t('Connect another AI'), run: () => host.settings?.('agents'), note: t('You need two AIs connected.') };
160
+ return { label: t('Do it'), run: write(t('@{a} @{b} What would you improve first in this project? Your own idea, in three lines at most.', { a: two[0], b: two[1] })) };
161
+ }
162
+ if (id === 'undo') return { label: t('Do it'), run: write(t('#2 Create a file called note.txt that says hello. Then I will undo it.')), note: t('When it answers, press Undo on its reply.') };
163
+ if (id === 'local-ai') {
164
+ if (!host.localReady?.()) return { label: t('Get it ready'), run: () => host.settings?.('local'), note: t('First the AI on your computer has to be there.') };
165
+ return { label: t('Do it'), run: write(t('@madre What do you remember about this project?')) };
166
+ }
167
+ if (id === 'market') return { label: t('Open the Market'), run: () => host.market?.('shop') };
168
+ return null;
169
+ }
@@ -0,0 +1,292 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
+ // The moving pictures of «what's new» (1.1.3).
4
+ //
5
+ // Each card shows the thing itself, small: MADRE's own pieces (a card, a dock of agents, a window
6
+ // with its hint) acted out in a few beats, the way a phone shows you a new feature. Not a
7
+ // screenshot, which ages with every change of the interface, and not abstract points, which said
8
+ // nothing to the author (2026-11-08). The agents wear their official marks, untouched (brands.js).
9
+ //
10
+ // A scene is a run of beats: each adds a class to the stage (`b1`, `b2`…) and CSS moves what that
11
+ // beat moves (styles.css, `.ns`). At the end the stage fades, the beats are taken back and it
12
+ // starts again. With reduced motion it shows the last beat and stays still.
13
+ //
14
+ // The few words a scene says are data in both languages, chosen with pick() like the notes are.
15
+
16
+ import { brandOf } from './brands.js';
17
+ import { trazo } from './icons.js';
18
+ import { pick } from './i18n.js';
19
+
20
+ const WORDS = {
21
+ skill: { es: 'Así cotizo', en: 'How I quote' },
22
+ skillTag: { es: 'Habilidad', en: 'Skill' },
23
+ joined: { es: 'Conectado con tu cuenta', en: 'Connected with your account' },
24
+ can: [
25
+ { es: 'Lee y escribe', en: 'Reads and writes' },
26
+ { es: 'Busca en internet', en: 'Searches the web' },
27
+ { es: 'Hace imágenes', en: 'Makes images' },
28
+ ],
29
+ hintTitle: { es: 'Plan actual', en: 'Running now' },
30
+ hintLine: { es: 'Lo que hace cada IA, en vivo.', en: 'What each AI is doing, live.' },
31
+ hours: { es: '5 h', en: '5 h' },
32
+ week: { es: '7 días', en: '7 days' },
33
+ // The app (2026-11-10, the choice after an update on Home).
34
+ tab: { es: 'MADRE', en: 'MADRE' },
35
+ address: { es: '127.0.0.1:4317', en: '127.0.0.1:4317' },
36
+ finished: { es: 'Claude terminó', en: 'Claude finished' },
37
+ finishedLine: { es: 'Tu página ya está lista.', en: 'Your page is ready.' },
38
+ // What changed, and what an AI makes opening by itself (1.1.4).
39
+ changedTitle: { es: 'Qué cambió', en: 'What changed' },
40
+ changedLine: { es: 'Agregué tu botón de WhatsApp', en: 'I added your WhatsApp button' },
41
+ view: { es: 'Ver', en: 'View' },
42
+ undo: { es: 'Deshacer', en: 'Undo' },
43
+ pageButton: { es: 'Escríbenos', en: 'Message us' },
44
+ // First steps (1.1.4): three of the five, checked one after another.
45
+ stepsTitle: { es: 'Primeros pasos', en: 'First steps' },
46
+ steps: [
47
+ { es: 'Crea tu primera página', en: 'Make your first page' },
48
+ { es: 'Pregúntale a dos IAs', en: 'Ask two AIs' },
49
+ { es: 'Deshaz un cambio', en: 'Undo a change' },
50
+ ],
51
+ };
52
+
53
+ const node = (tag, cls, text) => {
54
+ const n = document.createElement(tag);
55
+ if (cls) n.className = cls;
56
+ if (text != null) n.textContent = text;
57
+ return n;
58
+ };
59
+
60
+ // An agent in its own colours with its official mark (brands.js), as the room draws it.
61
+ function face(id, cls = 'ns-face') {
62
+ const brand = brandOf(id);
63
+ const n = node('span', cls);
64
+ n.style.setProperty('--ns-brand', brand.gradient ?? brand.color);
65
+ n.style.setProperty('--ns-ink', brand.ink ?? '#111');
66
+ n.innerHTML = brand.mark(); // trusted: our own SVG strings from brands.js
67
+ return n;
68
+ }
69
+
70
+ const icon = (name, cls) => {
71
+ const n = node('span', cls);
72
+ n.innerHTML = trazo(name); // trusted: our own SVG strings from icons.js
73
+ return n;
74
+ };
75
+
76
+ const SCENES = {
77
+ // «Teach it once how you work»: a skill is written, then each AI picks it up.
78
+ skills(stage) {
79
+ const doc = node('div', 'ns-doc');
80
+ const head = node('div', 'ns-doc-head');
81
+ head.append(icon('book', 'ns-doc-icon'), node('b', null, pick(WORDS.skill)));
82
+ doc.append(head);
83
+ for (let i = 0; i < 3; i += 1) {
84
+ const line = node('i', 'ns-line');
85
+ line.style.setProperty('--i', i);
86
+ doc.append(line);
87
+ }
88
+ doc.append(node('span', 'ns-tag', pick(WORDS.skillTag)));
89
+ const agents = node('div', 'ns-agents');
90
+ ['claude', 'codex', 'grok'].forEach((id, i) => {
91
+ const row = node('div', 'ns-row');
92
+ row.style.setProperty('--i', i);
93
+ const pill = node('span', 'ns-pill');
94
+ pill.append(node('span', null, pick(WORDS.skill)), icon('check', 'ns-check'));
95
+ row.append(face(id), pill);
96
+ agents.append(row);
97
+ });
98
+ stage.append(doc, agents);
99
+ return [400, 1500, 2700, 3700];
100
+ },
101
+
102
+ // «Grok, now among your AIs»: it joins the dock, bounces once and says what it can do.
103
+ newagent(stage) {
104
+ const dock = node('div', 'ns-dock');
105
+ for (const id of ['codex', 'claude', 'gemini', 'opencode']) dock.append(face(id, 'ns-app'));
106
+ dock.append(face('grok', 'ns-app ns-new'));
107
+ const status = node('div', 'ns-status');
108
+ status.append(node('i', 'ns-dot'), node('span', null, pick(WORDS.joined)));
109
+ const can = node('div', 'ns-can');
110
+ WORDS.can.forEach((word, i) => {
111
+ const chip = node('span', 'ns-chip', pick(word));
112
+ chip.style.setProperty('--i', i);
113
+ can.append(chip);
114
+ });
115
+ stage.append(dock, status, can);
116
+ return [700, 1500, 2300, 2900];
117
+ },
118
+
119
+ // «MADRE explains each thing»: a first click opens its note, and the AI shows its plan in bars.
120
+ tips(stage) {
121
+ const win = node('div', 'ns-win');
122
+ const bar = node('div', 'ns-bar');
123
+ const brand = icon('mother', 'ns-brand');
124
+ const keys = node('div', 'ns-keys');
125
+ const target = icon('running', 'ns-key ns-target');
126
+ keys.append(icon('attach', 'ns-key'), target, icon('agents', 'ns-key'));
127
+ bar.append(brand, keys);
128
+ const body = node('div', 'ns-body');
129
+ const plan = node('div', 'ns-plan');
130
+ const meters = node('div', 'ns-meters');
131
+ [[WORDS.hours, 0.42], [WORDS.week, 0.18]].forEach(([label, share], i) => {
132
+ const meter = node('div', 'ns-meter');
133
+ meter.style.setProperty('--share', share);
134
+ meter.style.setProperty('--i', i);
135
+ meter.append(node('span', null, pick(label)), node('i'));
136
+ meters.append(meter);
137
+ });
138
+ plan.append(face('claude'), meters);
139
+ body.append(plan);
140
+ const hint = node('div', 'ns-hint');
141
+ hint.append(node('b', null, pick(WORDS.hintTitle)), node('span', null, pick(WORDS.hintLine)));
142
+ // The arrow is drawn by CSS (styles.css, .ns-pointer::before): icons come from icons.js only.
143
+ const pointer = node('span', 'ns-pointer');
144
+ win.append(bar, body, hint);
145
+ stage.append(win, pointer);
146
+ return [500, 1500, 1800, 3700];
147
+ },
148
+ };
149
+
150
+ // «MADRE as an app» (2026-11-10): MADRE in a browser window loses the browser around it and becomes an
151
+ // app of the person's own computer, then drops into where that computer keeps its apps, and an AI's
152
+ // notice arrives where that computer shows them. Each desktop as it is (`os`):
153
+ // mac the three lights on the left, the Dock at the bottom, notices top right;
154
+ // windows minimise, maximise and close on the right, the taskbar along the bottom, notices bottom
155
+ // right, over it;
156
+ // linux one close key on the right, a bar along the top, the dock on the left, notices top centre.
157
+ // Used by the choice Home offers after an update (salas-mac.js, offerApp).
158
+ SCENES.desktopapp = (stage, { os = 'mac' } = {}) => {
159
+ stage.classList.add(`os-${os}`);
160
+ const win = node('div', 'ns-aw');
161
+ const chrome = node('div', 'ns-aw-chrome');
162
+ const tab = node('span', 'ns-aw-tab');
163
+ tab.append(node('i', 'ns-aw-fav'), node('span', null, pick(WORDS.tab)));
164
+ chrome.append(tab, node('span', 'ns-aw-url', pick(WORDS.address)));
165
+ // The window's own keys: the Mac's lights, or Windows' and Linux's keys on the right.
166
+ const keys = node('div', `ns-aw-keys ${os}`);
167
+ const count = os === 'mac' ? 3 : os === 'windows' ? 3 : 1;
168
+ for (let i = 0; i < count; i += 1) keys.append(node('i'));
169
+ const body = node('div', 'ns-aw-body');
170
+ const side = node('div', 'ns-aw-side');
171
+ for (let i = 0; i < 4; i += 1) side.append(node('i'));
172
+ const chat = node('div', 'ns-aw-chat');
173
+ chat.append(node('i', 'ns-aw-msg mine'), node('i', 'ns-aw-msg'), node('i', 'ns-aw-msg short'), node('i', 'ns-aw-box'));
174
+ body.append(side, chat);
175
+ win.append(chrome, keys, body);
176
+ // Where that computer keeps its apps: the Dock, the taskbar, the dock on the side.
177
+ const shelf = node('div', `ns-aw-dock ${os}`);
178
+ const apps = os === 'windows' ? ['search', 'folder', 'globe'] : ['folder', 'globe', 'chat'];
179
+ for (const name of apps) shelf.append(icon(name, 'ns-aw-app'));
180
+ const madre = node('img', 'ns-aw-madre');
181
+ // Versioned (2026-11-13): the mark changed and pages keep images a day; a copy updated today kept the old one.
182
+ madre.src = '/assets/brand/madre-app.svg?v=2';
183
+ madre.alt = '';
184
+ shelf.append(madre);
185
+ if (os === 'linux') { const top = node('div', 'ns-aw-topbar'); top.append(node('span', null, '10:24')); stage.append(top); }
186
+ const toast = node('div', 'ns-aw-toast');
187
+ const words = node('span', 'ns-aw-toast-words');
188
+ words.append(node('b', null, pick(WORDS.finished)), node('span', null, pick(WORDS.finishedLine)));
189
+ toast.append(face('claude'), words);
190
+ stage.append(win, shelf, toast);
191
+ return [300, 1400, 2500, 3500];
192
+ };
193
+
194
+ // «You see what changed» (1.1.4): an AI answers, the card of what it changed comes under the answer
195
+ // with «View» and «Undo», and the page it made opens beside, by itself.
196
+ SCENES.changes = (stage) => {
197
+ const left = node('div', 'ns-ans');
198
+ const msg = node('div', 'ns-ans-msg');
199
+ const lines = node('div', 'ns-ans-lines');
200
+ for (let i = 0; i < 2; i += 1) lines.append(node('i'));
201
+ msg.append(face('claude'), lines);
202
+ const card = node('div', 'ns-cc');
203
+ const head = node('div', 'ns-cc-head');
204
+ head.append(icon('pencil', 'ns-cc-icon'), node('b', null, pick(WORDS.changedTitle)));
205
+ const keys = node('div', 'ns-cc-keys');
206
+ keys.append(node('span', 'ns-cc-key view', pick(WORDS.view)), node('span', 'ns-cc-key', pick(WORDS.undo)));
207
+ card.append(head, node('span', 'ns-cc-line', pick(WORDS.changedLine)), keys);
208
+ left.append(msg, card);
209
+ const page = node('div', 'ns-page');
210
+ page.append(node('i', 'ns-page-bar'), node('i', 'ns-page-hero'), node('i', 'ns-page-line'), node('i', 'ns-page-line short'));
211
+ const cta = node('span', 'ns-page-btn');
212
+ cta.append(icon('chat', 'ns-page-btn-icon'), node('span', null, pick(WORDS.pageButton)));
213
+ page.append(cta);
214
+ stage.append(left, page);
215
+ return [300, 1200, 2200, 2900];
216
+ };
217
+
218
+ // «Learn by doing» (1.1.4): First steps, three of its five checked one after another, the bar filling.
219
+ SCENES.missions = (stage) => {
220
+ const box = node('div', 'ns-steps');
221
+ const head = node('div', 'ns-steps-head');
222
+ head.append(node('b', null, pick(WORDS.stepsTitle)), node('span', 'ns-steps-count'));
223
+ const bar = node('div', 'ns-progress');
224
+ bar.append(node('i'));
225
+ const list = node('div', 'ns-step-list');
226
+ WORDS.steps.forEach((word, i) => {
227
+ const row = node('div', 'ns-step');
228
+ row.style.setProperty('--i', i);
229
+ row.append(icon('check', 'ns-step-box'), node('span', null, pick(word)));
230
+ list.append(row);
231
+ });
232
+ box.append(head, bar, list);
233
+ stage.append(box);
234
+ return [300, 1200, 2000, 2800];
235
+ };
236
+
237
+ export const NEWS_SCENES = Object.keys(SCENES);
238
+
239
+ // One stage. `stop()` clears its timers when the sheet closes. `options` go to the scene (`os`).
240
+ export function createNewsScene(id, options = {}) {
241
+ const stage = node('div', `ns ns-${id}`);
242
+ stage.setAttribute('aria-hidden', 'true');
243
+ // The desktop this page is on, for the scene of the app (1.1.4: the news board does not say it).
244
+ const desk = /Mac/i.test(globalThis.navigator?.platform ?? '') ? 'mac' : /Win/i.test(globalThis.navigator?.platform ?? '') ? 'windows' : /Linux|X11/i.test(globalThis.navigator?.platform ?? '') ? 'linux' : 'mac';
245
+ const beats = SCENES[id]?.(stage, { os: desk, ...options }) ?? [];
246
+ const timers = new Set();
247
+ const later = (ms, fn) => { const timer = setTimeout(() => { timers.delete(timer); fn(); }, ms); timers.add(timer); };
248
+ const still = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches;
249
+ const HOLD = 3200;
250
+ // Measured, because the frame's size decides where things are: where the skill card starts, where
251
+ // the pointer goes and where the note's arrow points.
252
+ const aim = () => {
253
+ // The skill card starts in the middle of the frame: as far right as half of what comes beside it.
254
+ const agents = stage.querySelector('.ns-agents');
255
+ if (agents?.offsetWidth) stage.style.setProperty('--ns-doc-shift', `${(agents.offsetWidth + parseFloat(getComputedStyle(stage).columnGap || 0)) / 2}px`);
256
+ const pointer = stage.querySelector('.ns-pointer');
257
+ const target = stage.querySelector('.ns-target');
258
+ const hint = stage.querySelector('.ns-hint');
259
+ if (!pointer || !target) return;
260
+ const from = pointer.getBoundingClientRect();
261
+ const to = target.getBoundingClientRect();
262
+ if (!to.width) return;
263
+ stage.style.setProperty('--ns-to-x', `${to.left + to.width * 0.55 - from.left}px`);
264
+ stage.style.setProperty('--ns-to-y', `${to.top + to.height * 0.55 - from.top}px`);
265
+ if (hint) {
266
+ const box = hint.getBoundingClientRect();
267
+ const em = parseFloat(getComputedStyle(hint).fontSize) || 10;
268
+ stage.style.setProperty('--ns-arrow', `${box.right - (to.left + to.width / 2) - 0.35 * em}px`);
269
+ }
270
+ };
271
+ // Measured just before the first beat, not at creation: the stage is put on the page after it is
272
+ // made, and while nothing shows yet a change of place is not seen.
273
+ const run = () => {
274
+ later(Math.max(0, (beats[0] ?? 0) - 200), aim);
275
+ beats.forEach((ms, i) => later(ms, () => stage.classList.add(`b${i + 1}`)));
276
+ const end = (beats.at(-1) ?? 0) + HOLD;
277
+ later(end, () => stage.classList.add('out'));
278
+ later(end + 420, () => {
279
+ stage.classList.add('reset');
280
+ beats.forEach((_, i) => stage.classList.remove(`b${i + 1}`));
281
+ void stage.offsetWidth; // the reset lands before the stage comes back
282
+ stage.classList.remove('reset', 'out');
283
+ run();
284
+ });
285
+ };
286
+ if (still) beats.forEach((_, i) => stage.classList.add(`b${i + 1}`));
287
+ else run();
288
+ return {
289
+ node: stage,
290
+ stop() { for (const timer of timers) clearTimeout(timer); timers.clear(); },
291
+ };
292
+ }