@jossuealcala/madre 1.1.2 → 1.1.3

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 (101) hide show
  1. package/CHANGELOG.en.md +21 -1
  2. package/CHANGELOG.md +21 -1
  3. package/README.en.md +3 -3
  4. package/README.md +3 -3
  5. package/SECURITY.md +11 -6
  6. package/bin/madre.mjs +74 -11
  7. package/docs/REFERENCE.md +13 -7
  8. package/docs/SDK.md +8 -8
  9. package/docs/en/REFERENCE.md +10 -6
  10. package/docs/en/SDK.md +8 -8
  11. package/docs/en/training/README.md +1 -1
  12. package/docs/sdk/connector-module.mjs +1 -1
  13. package/docs/sdk/hello-module.mjs +1 -1
  14. package/docs/training/README.md +1 -1
  15. package/docs/training/train.sh +3 -0
  16. package/package.json +4 -2
  17. package/public/activity.js +9 -0
  18. package/public/app.js +988 -171
  19. package/public/attribution.js +9 -0
  20. package/public/brands.js +27 -13
  21. package/public/en.js +1 -2
  22. package/public/es.js +834 -257
  23. package/public/index.html +3 -0
  24. package/public/macroverso.js +24 -5
  25. package/public/manual-content.js +32 -2
  26. package/public/market-view.js +116 -9
  27. package/public/market.js +15 -0
  28. package/public/news-scenes.js +185 -0
  29. package/public/notices.js +66 -0
  30. package/public/power.js +1 -1
  31. package/public/resay.js +3 -0
  32. package/public/salas-mac.css +229 -26
  33. package/public/salas-mac.html +3 -0
  34. package/public/salas-mac.js +454 -37
  35. package/public/styles.css +393 -17
  36. package/public/tips.js +124 -0
  37. package/public/tour-chapters.js +75 -75
  38. package/public/tour.js +36 -8
  39. package/public/troubleshooting.js +215 -22
  40. package/public/welcome-scene.js +358 -0
  41. package/public/welcome.js +514 -273
  42. package/src/adapters/gemini-rest.mjs +236 -0
  43. package/src/adapters/gemini.mjs +9 -7
  44. package/src/adapters/grok.mjs +288 -0
  45. package/src/adapters/process.mjs +14 -3
  46. package/src/auth-probe.mjs +32 -0
  47. package/src/bridge/policy.mjs +1 -1
  48. package/src/capabilities.mjs +30 -0
  49. package/src/checkpoint.mjs +115 -1
  50. package/src/codex-route.mjs +113 -0
  51. package/src/credentials.mjs +46 -8
  52. package/src/dataset.mjs +18 -7
  53. package/src/event-store.mjs +10 -2
  54. package/src/ficha.mjs +142 -0
  55. package/src/files.mjs +36 -2
  56. package/src/lease.mjs +5 -0
  57. package/src/market-check.mjs +1 -1
  58. package/src/market-remote.mjs +135 -1
  59. package/src/mcp/image-server.mjs +1 -1
  60. package/src/mcp/memory-server.mjs +10 -0
  61. package/src/memory-tools.mjs +3 -0
  62. package/src/memory.mjs +29 -4
  63. package/src/models.mjs +21 -3
  64. package/src/modules/ahp.mjs +8 -3
  65. package/src/modules/bishop-exam.mjs +41 -12
  66. package/src/modules/bishop.mjs +2 -2
  67. package/src/modules/choices.mjs +12 -10
  68. package/src/modules/fetch-alone.mjs +7 -0
  69. package/src/modules/helpers.mjs +23 -5
  70. package/src/modules/image-studio.mjs +13 -27
  71. package/src/modules/index.mjs +54 -11
  72. package/src/modules/isolated.mjs +160 -0
  73. package/src/modules/ollama.mjs +35 -6
  74. package/src/modules/playwright.mjs +46 -17
  75. package/src/modules/run-alone.mjs +122 -0
  76. package/src/modules/runs.mjs +11 -8
  77. package/src/modules/sdk.mjs +4 -2
  78. package/src/notices-key.mjs +8 -0
  79. package/src/notices.mjs +185 -0
  80. package/src/ollama.mjs +57 -15
  81. package/src/outbound.mjs +45 -8
  82. package/src/room/archivist.mjs +30 -5
  83. package/src/room/busy.mjs +16 -0
  84. package/src/room/control.mjs +36 -6
  85. package/src/room/guard.mjs +32 -2
  86. package/src/room/prompt.mjs +32 -5
  87. package/src/room/vectors.mjs +7 -1
  88. package/src/room.mjs +94 -28
  89. package/src/router.mjs +1 -1
  90. package/src/runs.mjs +39 -0
  91. package/src/runtime-detection.mjs +46 -6
  92. package/src/salas.mjs +151 -15
  93. package/src/server.mjs +577 -80
  94. package/src/service.mjs +116 -0
  95. package/src/setup-trouble.mjs +20 -1
  96. package/src/skill-check.mjs +269 -0
  97. package/src/skills-import.mjs +128 -0
  98. package/src/skills.mjs +492 -0
  99. package/src/tour.mjs +14 -3
  100. package/src/whats-new.mjs +48 -0
  101. package/src/rumbo.mjs +0 -337
package/public/index.html CHANGED
@@ -5,6 +5,9 @@
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
7
7
  <title>MADRE</title>
8
+ <!-- The ficha (src/ficha.mjs): a 401 that asks for it means this tab's was replaced (MADRE started
9
+ again and opened a new one); the page reloads into the page that says where to open MADRE. -->
10
+ <script>(function () { var ask = window.fetch; window.fetch = function () { return ask.apply(this, arguments).then(function (answer) { if (answer.status === 401 && answer.headers.get('x-madre-ficha') === 'needed') location.reload(); return answer; }); }; })();</script>
8
11
  <link rel="icon" type="image/svg+xml" href="/assets/brand/madre-favicon.svg">
9
12
  <link rel="stylesheet" href="/styles.css">
10
13
  <!-- MADRE's ground over the page from the first frame until the page is ready (2026-10-30, loader.js
@@ -544,6 +544,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
544
544
  paintLegend(on);
545
545
  layer.querySelector('.neural-invite')?.remove();
546
546
  const now = performance.now() / 1000;
547
+ if (core.sprite) core.dirty = true;
547
548
  for (const one of universes) {
548
549
  if (!one.sprite?.scene) continue;
549
550
  if (one.room.open && !reducedMotion()) one.sprite.engine.setNeural(on, now);
@@ -566,6 +567,15 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
566
567
  function layout(all) {
567
568
  // BISHOP's own room is the centre, not a universe on an orbit.
568
569
  core.room = bishop ? all.find((room) => room.id === bishop.id) ?? null : null;
570
+ // The Coordinator's own memories round its body (2026-11-07), read and painted as a universe's are:
571
+ // its room is a project like the others. Read again only when what it holds has changed.
572
+ if (core.room) {
573
+ const face = `${core.room.open ? 1 : 0}:${JSON.stringify(core.room.glance?.census ?? null)}`;
574
+ if (core.face !== face || core.dpr !== view.dpr) { core.dirty = true; if (core.face !== face) { core.data = null; core.full = null; core.loading = null; } }
575
+ core.face = face;
576
+ core.dpr = view.dpr;
577
+ core.reach = reachOf(core.room);
578
+ }
569
579
  const list = bishop ? all.filter((room) => room.id !== bishop.id) : all;
570
580
  const kept = new Map(universes.map((one) => [one.room.id, one]));
571
581
  const open = list.filter((room) => room.open);
@@ -634,7 +644,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
634
644
  .then((response) => (response.ok ? response.json() : null))
635
645
  .catch(() => null)
636
646
  .then((answer) => {
637
- const now = universes.find((item) => item.room.id === one.room.id);
647
+ const now = one.centre ? (core.room?.id === one.room.id ? core : null) : universes.find((item) => item.room.id === one.room.id);
638
648
  if (!now || now.face !== one.face) return null;
639
649
  now[key] = answer ?? { unreachable: true };
640
650
  if (now.loading) delete now.loading[key];
@@ -642,7 +652,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
642
652
  // A saturated machine can miss one read while the room is still alive. Do not keep
643
653
  // that transient failure as the universe's permanent texture.
644
654
  if (now[key].unreachable || now[key].outdated) setTimeout(() => {
645
- const current = universes.find((item) => item.room.id === one.room.id);
655
+ const current = one.centre ? (core.room?.id === one.room.id ? core : null) : universes.find((item) => item.room.id === one.room.id);
646
656
  if (!current || current.face !== one.face || (!current[key]?.unreachable && !current[key]?.outdated)) return;
647
657
  current[key] = null;
648
658
  if (full) { if (focus === current && !live) enterLive(current); }
@@ -656,7 +666,7 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
656
666
 
657
667
  // One universe is painted a frame, the chosen one first, so a Mac with many rooms never stalls.
658
668
  function paintNext() {
659
- const next = [focus, ...universes].find((one) => one && one.dirty);
669
+ const next = [focus, core.room ? core : null, ...universes].find((one) => one && one.dirty);
660
670
  if (!next) return false;
661
671
  if (!next.data) { if (!next.loading?.data) void load(next); return false; }
662
672
  next.sprite = paintUniverse(next, view.dpr, next.shown ?? null, neural);
@@ -671,11 +681,11 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
671
681
  magmaMap(12);
672
682
  if (texturesReady()) {
673
683
  textures.ready = true;
674
- for (const one of universes) if (one.sprite && !one.sprite.ready) one.dirty = true;
684
+ for (const one of [core, ...universes]) if (one.sprite && !one.sprite.ready) one.dirty = true;
675
685
  }
676
686
  }
677
687
  paintNext();
678
- return !textures.ready || universes.some((one) => one.dirty && (one.data || one.loading?.data));
688
+ return !textures.ready || [core.room ? core : null, ...universes].some((one) => one && one.dirty && (one.data || one.loading?.data));
679
689
  }
680
690
 
681
691
  // Where a universe is now: on its orbit round the Mac, the far side smaller and fainter.
@@ -978,6 +988,15 @@ export function openMacroverso({ host, rooms, here, enlaces = [], accent = '#9bf
978
988
  const p = { x: centre.x, y: centre.y + float * Math.max(0.6, camera.zoom) };
979
989
  const r = 30 * clamp(camera.zoom, 0.75, 1.8);
980
990
  core.screen = { x: p.x, y: p.y, r: r * (neural ? 1.8 : 1.3) };
991
+ // Its memories first, round where its body floats: the same sprite a project's universe wears.
992
+ if (core.sprite && core.reach) {
993
+ // Wide enough that its memories sit round its body and are not hidden under it.
994
+ const side = Math.max(core.reach * 2 * camera.zoom, r * 12);
995
+ core.shown = side;
996
+ ctx.globalAlpha = awake ? 1 : 0.6;
997
+ ctx.drawImage(core.sprite.canvas, p.x - side / 2, p.y - side / 2, side, side);
998
+ ctx.globalAlpha = 1;
999
+ }
981
1000
  // Neural mode: the centre of the brain, its bulb, in the Coordinator's violet; no eye, no gas.
982
1001
  if (neural) {
983
1002
  const ignite = neuralSince === null ? 1 : clamp((clock - neuralSince) / NEURAL_IGNITION, 0, 1);
@@ -218,8 +218,8 @@ export const MANUAL = {
218
218
  part: 'work',
219
219
  icon: 'running',
220
220
  title: 'Lo que está pasando',
221
- lead: 'En marcha te muestra todo lo que MADRE está haciendo en tus proyectos abiertos, sin abrir una terminal, y te deja detenerlo.',
222
- tryIt: 'Pídele algo largo a un agente y abre En marcha mientras trabaja.',
221
+ lead: 'Plan actual te muestra todo lo que MADRE está haciendo en tus proyectos abiertos, sin abrir una terminal, y te deja detenerlo.',
222
+ tryIt: 'Pídele algo largo a un agente y abre Plan actual mientras trabaja.',
223
223
  steps: [
224
224
  'Busca en la barra de arriba la línea de pulso. Su número dice cuántas cosas corren, y la línea late mientras algo trabaja.',
225
225
  'Púlsala. En «Ahora» ves cada agente respondiendo, sus planes, los servidores y lo que se instala. Abajo están lo que terminó hace poco y los recordatorios que vienen.',
@@ -287,6 +287,21 @@ export const MANUAL = {
287
287
  ],
288
288
  expert: 'Lo que obtienes en el Mercado de un proyecto es para ese proyecto. Los módulos de la comunidad dicen quién los hizo y su licencia; MADRE revisa su firma antes de instalarlos.',
289
289
  },
290
+ {
291
+ id: 'habilidades',
292
+ part: 'more',
293
+ icon: 'market',
294
+ title: 'Habilidades: cómo trabajas tú',
295
+ lead: 'Una habilidad le dice a tus agentes cómo trabajas: tu plantilla de cotización, el orden de tus informes, qué preguntar antes de dar un precio. La escribes una vez y la siguen los seis — Codex, Claude, Gemini, OpenCode, Cursor y Grok — porque es MADRE la que les habla.',
296
+ tryIt: 'Escribe en la conversación: /habilidad cuando te pida una cotización, usa mi plantilla y pon el IVA aparte. El agente la escribe, tú la lees y la guardas.',
297
+ steps: [
298
+ 'Escribe /habilidad y lo que quieres que hagan, en tus palabras. Hace falta el modo #2.',
299
+ 'El agente la escribe y MADRE te la ofrece en la conversación. Pulsa «Léela» antes de guardarla: es una página, se lee en un minuto.',
300
+ 'En Módulos → Habilidades eliges cuándo entra: cuando venga al caso, siempre encendida o apagada.',
301
+ 'Si ya tienes habilidades de Claude o de Codex, pulsa «Trae las que ya tienes» y elige cuáles.',
302
+ ],
303
+ expert: 'Una habilidad no da permiso: no sube el modo del turno ni ensancha lo que un agente puede tocar. Si lleva programas, solo un agente puede correrlos y solo en #4; MADRE nunca corre uno. En la conversación ves una píldora con por qué entró. Y puedes mandarla al Mercado para que la use cualquiera: el autor de MADRE la lee y la firma.',
304
+ },
290
305
  {
291
306
  id: 'continuidad',
292
307
  part: 'more',
@@ -726,6 +741,21 @@ export const MANUAL = {
726
741
  ],
727
742
  expert: 'What you get in a project\'s Market is for that project. Community modules say who made them and their license; MADRE checks their signature before installing them.',
728
743
  },
744
+ {
745
+ id: 'habilidades',
746
+ part: 'more',
747
+ icon: 'market',
748
+ title: 'Skills: the way you work',
749
+ lead: 'A skill tells your agents how you work: your quote template, the order of your reports, what to ask before giving a price. You write it once and all six follow it — Codex, Claude, Gemini, OpenCode, Cursor and Grok — because MADRE is the one that talks to them.',
750
+ tryIt: 'Type in the conversation: /habilidad when I ask for a quote, use my template and put the tax apart. The agent writes it, you read it and keep it.',
751
+ steps: [
752
+ 'Type /habilidad and what you want them to do, in your own words. It needs mode #2.',
753
+ 'The agent writes it and MADRE offers it in the conversation. Press «Read it» before keeping it: it is one page, a minute to read.',
754
+ 'In Modules → Skills you choose when it comes in: when it fits, always on, or off.',
755
+ 'If you already have skills from Claude or Codex, press «Bring over what you already have» and pick.',
756
+ ],
757
+ expert: 'A skill gives no permission: it does not raise the mode of the turn and does not widen what an agent may touch. If it carries programs, only an agent can run them and only in #4; MADRE never runs one. The conversation shows a pill saying why it came in. And you can send it to the Market for anyone to use: the author of MADRE reads it and signs it.',
758
+ },
729
759
  {
730
760
  id: 'continuidad',
731
761
  part: 'more',
@@ -15,7 +15,7 @@
15
15
  // `openProject(projectId, item)` (Home), `toast(text)` and `changed()`.
16
16
 
17
17
  import { t, language } from './i18n.js';
18
- import { appIcon, communityOf, forSale, inMarket, isBought, loadMarket, marketEntry, marketExtras, marketFeatured, marketShelves, moduleFace, remoteEntry } from './market.js';
18
+ import { appIcon, communityOf, forSale, inMarket, isBought, loadMarket, marketEntry, marketExtras, marketFeatured, marketShelves, marketSkills, moduleFace, remoteEntry, skillHere } from './market.js';
19
19
  import { marketArt, marketGallery } from './market-art.js';
20
20
  import { trazo } from './icons.js';
21
21
 
@@ -99,7 +99,7 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
99
99
  if (home) {
100
100
  const seg = el('div', 'mk-tabs');
101
101
  seg.setAttribute('role', 'tablist');
102
- for (const [id, label] of [['shop', t('Market')], ['mine', t('Modules')]]) {
102
+ for (const [id, label] of [['shop', t('Market')], ['skills', t('Skills')], ['mine', t('Modules')]]) {
103
103
  const key = button('mk-tab', label, () => go({ tab: id }));
104
104
  key.setAttribute('role', 'tab');
105
105
  tabs[id] = key;
@@ -109,7 +109,16 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
109
109
  } else {
110
110
  const here = el('span', 'mk-here');
111
111
  here.append(el('b', null, t('Market')), el('span', null, t('for {project}', { project: project?.name ?? t('this project') })));
112
- middle.append(here);
112
+ // A skill is not a module and does not share a shelf with one (H-8): its own tab, here too.
113
+ const seg = el('div', 'mk-tabs');
114
+ seg.setAttribute('role', 'tablist');
115
+ for (const [id, label] of [['shop', t('Modules')], ['skills', t('Skills')]]) {
116
+ const key = button('mk-tab', label, () => go({ tab: id }));
117
+ key.setAttribute('role', 'tab');
118
+ tabs[id] = key;
119
+ seg.append(key);
120
+ }
121
+ middle.append(here, seg);
113
122
  }
114
123
  // The same search as every other one in MADRE (styles.css, .settings-search).
115
124
  const search = glyph(el('label', 'settings-search mk-search'), 'search');
@@ -150,7 +159,7 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
150
159
  // A module from the catalog is got first — its signed file, checked, for every project — and
151
160
  // then turned on wherever the person said.
152
161
  // BEFORE IT IS INSTALLED (2026-10-25): what the module declares, read from its signed file, and the
153
- // one thing every module is — code that runs with the person's permissions. Nothing is installed
162
+ // one thing every module is — code that needs the person's review. Nothing is installed
154
163
  // until the person says so, and then it is that same file (its sha256).
155
164
  let reviewing = null;
156
165
  const reviewLines = (declares) => {
@@ -174,7 +183,7 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
174
183
  head.append(appIcon(item, 44), el('h2', null, t('Before installing {name}', { name: nameOf(item) })));
175
184
  const list = el('ul', 'mk-review-list');
176
185
  for (const line of reviewLines(review.declares)) list.append(el('li', null, line));
177
- const warn = el('p', 'mk-review-warn', t('A module runs inside MADRE with your permissions. MADRE checks its signature and what it declares, not everything its code does: install only what you trust.'));
186
+ const warn = el('p', 'mk-review-warn', t('A module runs in a separate process with limited permissions. MADRE checks its signature and declarations; Node cannot guarantee containment of malicious code. Review the file and its network destinations before installing it.'));
178
187
  const keys = el('div', 'mk-review-keys');
179
188
  const done = (yes) => { reviewing = null; sheet.remove(); resolve(yes); };
180
189
  const no = button('mk-get big quiet', t('Not now'), () => done(false));
@@ -678,20 +687,118 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
678
687
  return box;
679
688
  };
680
689
 
690
+ // ---- SKILLS (H-8). Their own tab, because a skill is not a module: it adds no button and no
691
+ // page, it tells whichever agent answers how the person works. So no tiles and no carousel — a
692
+ // row with its sentence, and a page with the whole text before anything is kept.
693
+ //
694
+ // Getting one is two steps, as a module's is: MADRE fetches every file and checks it against the
695
+ // signature, shows what it says and what it carries, and only then — on the very seal that was
696
+ // read — keeps it. Nothing of it runs: a program it carries could only ever run inside #4.
697
+ const skillsPage = (focus) => {
698
+ const page = el('div', 'mk-page mk-skills');
699
+ const all = marketSkills();
700
+ const one = focus ? all.find((skill) => skill.id === focus) : null;
701
+ if (one) return skillPage(one);
702
+ const head = el('header', 'mk-shelf-head');
703
+ head.append(el('h2', null, t('Skills')), el('p', null, t('Ways of working, handed to whichever agent answers. The same one works for Codex, Claude, Gemini, OpenCode, Cursor and Grok, because MADRE is the one that writes the briefing.')));
704
+ // Bringing over the ones your agents already keep was only at the foot of Modules, where nobody
705
+ // looked for it (2026-11-08): the shelf of skills offers it too, where a project can take it.
706
+ if (host.importSkills) head.append(button('mk-get mk-skill-import', t('Bring over what you already have'), () => host.importSkills()));
707
+ page.append(head);
708
+ if (!all.length) {
709
+ page.append(el('p', 'mk-empty', t('None in the Market yet. You can write your own: type /habilidad in the conversation.')));
710
+ return page;
711
+ }
712
+ const list = el('div', 'mk-skill-list');
713
+ for (const skill of all) {
714
+ const row = el('article', 'mk-skill-row');
715
+ const words = el('div', 'mk-skill-words');
716
+ const top = el('div', 'mk-skill-top');
717
+ top.append(el('b', null, skill.name));
718
+ if (skill.community && skill.author?.name) top.append(communityTag(), el('span', 'mk-skill-by', t('by {name}', { name: skill.author.name })));
719
+ if (skill.version) top.append(el('span', 'mk-skill-tag', skill.version));
720
+ words.append(top, el('p', 'mk-skill-line', skill.line || skill.summary));
721
+ const have = skillHere(skill.id);
722
+ const key = have
723
+ ? button('mk-get on', t('Yours'), () => go({ tab: 'skills', focus: skill.id }))
724
+ : button('mk-get', t('Read it'), () => go({ tab: 'skills', focus: skill.id }));
725
+ row.append(words, key);
726
+ list.append(row);
727
+ }
728
+ page.append(list);
729
+ return page;
730
+ };
731
+
732
+ // One skill's page: what it tells the agents, whole, before it is kept. Read it and you have read
733
+ // the review — which is the one thing a module's page can never offer.
734
+ const skillPage = (skill) => {
735
+ const page = el('div', 'mk-page mk-skill-page');
736
+ page.append(glyph(button('mk-back', t('Skills'), () => go({ tab: 'skills' })), 'back'));
737
+ const head = el('header', 'mk-skill-head');
738
+ head.append(el('h2', null, skill.name));
739
+ const meta = el('div', 'mk-skill-meta');
740
+ for (const word of [skill.version, skill.author?.name ? t('by {name}', { name: skill.author.name }) : null, skill.spdx, skill.credit ? t('Idea by {name}', { name: skill.credit }) : null].filter(Boolean)) meta.append(el('span', null, word));
741
+ if (skill.community) meta.append(communityTag());
742
+ head.append(el('p', 'mk-skill-line', skill.summary || skill.line), meta);
743
+ page.append(head);
744
+ const have = skillHere(skill.id);
745
+ if (have) page.append(el('p', 'mk-skill-have', t('You have it, version {version}. It comes in when it fits; you decide that in MODULES → Skills.', { version: have.version })));
746
+ if (!fits(madre, skill.minMadre)) {
747
+ page.append(el('p', 'mk-skill-warn', t('It needs MADRE {version} or newer.', { version: skill.minMadre })));
748
+ return page;
749
+ }
750
+ const body = el('div', 'mk-skill-read');
751
+ const said = el('p', 'mk-skill-said');
752
+ const keep = button('mk-get', have ? t('Get it again') : t('Keep it'), null);
753
+ keep.hidden = true;
754
+ const read = button('mk-get', t('Read what it tells my agents'), async () => {
755
+ read.disabled = true;
756
+ said.textContent = t('Reading it…');
757
+ const { ok, body: payload } = await post('/api/market/skills/install', { id: skill.id, review: true });
758
+ read.disabled = false;
759
+ if (!ok) { said.textContent = payload.error ?? t('It could not be read.'); return; }
760
+ said.textContent = '';
761
+ read.hidden = true;
762
+ body.replaceChildren();
763
+ if (payload.declares?.when) body.append(el('p', 'mk-skill-when', `${t('It comes in when:')} ${payload.declares.when}`));
764
+ body.append(el('pre', 'mk-skill-body', payload.body));
765
+ const carries = (payload.declares?.references ?? []).filter((path) => !/^(HABILIDAD|SKILL)\.md$/.test(path));
766
+ if (carries.length) body.append(el('p', 'mk-skill-files', t('It carries: {list}', { list: carries.join(', ') })));
767
+ if (payload.declares?.scripts?.length) {
768
+ body.append(el('p', 'mk-skill-warn', `${t('It carries programs: {list}', { list: payload.declares.scripts.join(', ') })} ${t('MADRE never runs one. Only an agent can, and only in #4 AIRLOCK: in every other mode they do nothing. Read one before you open that mode.')}`));
769
+ }
770
+ keep.hidden = false;
771
+ keep.onclick = async () => {
772
+ keep.disabled = true;
773
+ said.textContent = t('Keeping it…');
774
+ const done = await post('/api/market/skills/install', { id: skill.id, accept: payload.seal });
775
+ keep.disabled = false;
776
+ if (!done.ok) { said.textContent = done.body.error ?? t('It could not be kept.'); return; }
777
+ said.textContent = '';
778
+ notice(t('{name} is yours now. It comes in when it fits; change that in MODULES.', { name: skill.name }));
779
+ host.changed?.();
780
+ await refresh();
781
+ go({ tab: 'skills', focus: skill.id });
782
+ };
783
+ });
784
+ page.append(read, body, keep, said);
785
+ return page;
786
+ };
787
+
681
788
  // WHERE IT IS: a view, the address that reopens it, and the page scrolled to the top.
682
789
  const render = () => {
683
790
  if (!current) return;
684
791
  for (const [id, key] of Object.entries(tabs)) key.setAttribute('aria-selected', String(id === view.tab));
685
- search.hidden = view.tab === 'mine' || Boolean(view.focus);
792
+ search.hidden = view.tab === 'mine' || view.tab === 'skills' || Boolean(view.focus);
686
793
  const item = view.focus ? items.find((one) => one.id === view.focus) : null;
687
- const page = view.tab === 'mine' ? mine(view.focus) : item ? detail(item, { choose: view.choose }) : shop();
794
+ const page = view.tab === 'skills' ? skillsPage(view.focus) : view.tab === 'mine' ? mine(view.focus) : item ? detail(item, { choose: view.choose }) : shop();
688
795
  main.replaceChildren(page);
689
796
  if (view.tab === 'mine' && view.focus) requestAnimationFrame(() => document.getElementById(`mk-card-${view.focus}`)?.scrollIntoView({ block: 'center' }));
690
- const hash = view.tab === 'mine' ? '#modulos' : item ? `#mercado=${encodeURIComponent(item.id)}` : '#mercado';
797
+ const hash = view.tab === 'skills' ? (view.focus ? `#habilidades=${encodeURIComponent(view.focus)}` : '#habilidades') : view.tab === 'mine' ? '#modulos' : item ? `#mercado=${encodeURIComponent(item.id)}` : '#mercado';
691
798
  try { history.replaceState(history.state, '', `${location.pathname}${location.search}${hash}`); } catch { /* the address stays as it was */ }
692
799
  };
693
800
  const go = ({ tab: nextTab = view.tab, focus: nextFocus = null, choose = false } = {}) => {
694
- view = { tab: home ? nextTab : 'shop', focus: nextFocus, choose };
801
+ view = { tab: home || nextTab === 'skills' ? nextTab : 'shop', focus: nextFocus, choose };
695
802
  main.scrollTop = 0;
696
803
  render();
697
804
  };
package/public/market.js CHANGED
@@ -224,6 +224,20 @@ 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;
227
241
  // THE PAID MODULES (src/market-license.mjs): which ones this computer bought, as /api/market says
228
242
  // (never the keys), and whether one still has to be bought before it can be got.
229
243
  let bought = {};
@@ -270,6 +284,7 @@ export async function loadMarket({ toast = null, open = null } = {}) {
270
284
  if (!answer) return null;
271
285
  setMarketCatalog(answer.catalog);
272
286
  setMarketLicensed(answer.licensed);
287
+ setMarketSkills(answer.skills);
273
288
  if (!toast) return answer;
274
289
  const updated = answer.news ?? [];
275
290
  if (updated.length) {
@@ -0,0 +1,185 @@
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
+ };
34
+
35
+ const node = (tag, cls, text) => {
36
+ const n = document.createElement(tag);
37
+ if (cls) n.className = cls;
38
+ if (text != null) n.textContent = text;
39
+ return n;
40
+ };
41
+
42
+ // An agent in its own colours with its official mark (brands.js), as the room draws it.
43
+ function face(id, cls = 'ns-face') {
44
+ const brand = brandOf(id);
45
+ const n = node('span', cls);
46
+ n.style.setProperty('--ns-brand', brand.gradient ?? brand.color);
47
+ n.style.setProperty('--ns-ink', brand.ink ?? '#111');
48
+ n.innerHTML = brand.mark(); // trusted: our own SVG strings from brands.js
49
+ return n;
50
+ }
51
+
52
+ const icon = (name, cls) => {
53
+ const n = node('span', cls);
54
+ n.innerHTML = trazo(name); // trusted: our own SVG strings from icons.js
55
+ return n;
56
+ };
57
+
58
+ const SCENES = {
59
+ // «Teach it once how you work»: a skill is written, then each AI picks it up.
60
+ skills(stage) {
61
+ const doc = node('div', 'ns-doc');
62
+ const head = node('div', 'ns-doc-head');
63
+ head.append(icon('book', 'ns-doc-icon'), node('b', null, pick(WORDS.skill)));
64
+ doc.append(head);
65
+ for (let i = 0; i < 3; i += 1) {
66
+ const line = node('i', 'ns-line');
67
+ line.style.setProperty('--i', i);
68
+ doc.append(line);
69
+ }
70
+ doc.append(node('span', 'ns-tag', pick(WORDS.skillTag)));
71
+ const agents = node('div', 'ns-agents');
72
+ ['claude', 'codex', 'grok'].forEach((id, i) => {
73
+ const row = node('div', 'ns-row');
74
+ row.style.setProperty('--i', i);
75
+ const pill = node('span', 'ns-pill');
76
+ pill.append(node('span', null, pick(WORDS.skill)), icon('check', 'ns-check'));
77
+ row.append(face(id), pill);
78
+ agents.append(row);
79
+ });
80
+ stage.append(doc, agents);
81
+ return [400, 1500, 2700, 3700];
82
+ },
83
+
84
+ // «Grok, now among your AIs»: it joins the dock, bounces once and says what it can do.
85
+ newagent(stage) {
86
+ const dock = node('div', 'ns-dock');
87
+ for (const id of ['codex', 'claude', 'gemini', 'opencode']) dock.append(face(id, 'ns-app'));
88
+ dock.append(face('grok', 'ns-app ns-new'));
89
+ const status = node('div', 'ns-status');
90
+ status.append(node('i', 'ns-dot'), node('span', null, pick(WORDS.joined)));
91
+ const can = node('div', 'ns-can');
92
+ WORDS.can.forEach((word, i) => {
93
+ const chip = node('span', 'ns-chip', pick(word));
94
+ chip.style.setProperty('--i', i);
95
+ can.append(chip);
96
+ });
97
+ stage.append(dock, status, can);
98
+ return [700, 1500, 2300, 2900];
99
+ },
100
+
101
+ // «MADRE explains each thing»: a first click opens its note, and the AI shows its plan in bars.
102
+ tips(stage) {
103
+ const win = node('div', 'ns-win');
104
+ const bar = node('div', 'ns-bar');
105
+ const brand = icon('mother', 'ns-brand');
106
+ const keys = node('div', 'ns-keys');
107
+ const target = icon('running', 'ns-key ns-target');
108
+ keys.append(icon('attach', 'ns-key'), target, icon('agents', 'ns-key'));
109
+ bar.append(brand, keys);
110
+ const body = node('div', 'ns-body');
111
+ const plan = node('div', 'ns-plan');
112
+ const meters = node('div', 'ns-meters');
113
+ [[WORDS.hours, 0.42], [WORDS.week, 0.18]].forEach(([label, share], i) => {
114
+ const meter = node('div', 'ns-meter');
115
+ meter.style.setProperty('--share', share);
116
+ meter.style.setProperty('--i', i);
117
+ meter.append(node('span', null, pick(label)), node('i'));
118
+ meters.append(meter);
119
+ });
120
+ plan.append(face('claude'), meters);
121
+ body.append(plan);
122
+ const hint = node('div', 'ns-hint');
123
+ hint.append(node('b', null, pick(WORDS.hintTitle)), node('span', null, pick(WORDS.hintLine)));
124
+ // The arrow is drawn by CSS (styles.css, .ns-pointer::before): icons come from icons.js only.
125
+ const pointer = node('span', 'ns-pointer');
126
+ win.append(bar, body, hint);
127
+ stage.append(win, pointer);
128
+ return [500, 1500, 1800, 3700];
129
+ },
130
+ };
131
+
132
+ export const NEWS_SCENES = Object.keys(SCENES);
133
+
134
+ // One stage. `stop()` clears its timers when the sheet closes.
135
+ export function createNewsScene(id) {
136
+ const stage = node('div', `ns ns-${id}`);
137
+ stage.setAttribute('aria-hidden', 'true');
138
+ const beats = SCENES[id]?.(stage) ?? [];
139
+ const timers = new Set();
140
+ const later = (ms, fn) => { const timer = setTimeout(() => { timers.delete(timer); fn(); }, ms); timers.add(timer); };
141
+ const still = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches;
142
+ const HOLD = 3200;
143
+ // Measured, because the frame's size decides where things are: where the skill card starts, where
144
+ // the pointer goes and where the note's arrow points.
145
+ const aim = () => {
146
+ // The skill card starts in the middle of the frame: as far right as half of what comes beside it.
147
+ const agents = stage.querySelector('.ns-agents');
148
+ if (agents?.offsetWidth) stage.style.setProperty('--ns-doc-shift', `${(agents.offsetWidth + parseFloat(getComputedStyle(stage).columnGap || 0)) / 2}px`);
149
+ const pointer = stage.querySelector('.ns-pointer');
150
+ const target = stage.querySelector('.ns-target');
151
+ const hint = stage.querySelector('.ns-hint');
152
+ if (!pointer || !target) return;
153
+ const from = pointer.getBoundingClientRect();
154
+ const to = target.getBoundingClientRect();
155
+ if (!to.width) return;
156
+ stage.style.setProperty('--ns-to-x', `${to.left + to.width * 0.55 - from.left}px`);
157
+ stage.style.setProperty('--ns-to-y', `${to.top + to.height * 0.55 - from.top}px`);
158
+ if (hint) {
159
+ const box = hint.getBoundingClientRect();
160
+ const em = parseFloat(getComputedStyle(hint).fontSize) || 10;
161
+ stage.style.setProperty('--ns-arrow', `${box.right - (to.left + to.width / 2) - 0.35 * em}px`);
162
+ }
163
+ };
164
+ // Measured just before the first beat, not at creation: the stage is put on the page after it is
165
+ // made, and while nothing shows yet a change of place is not seen.
166
+ const run = () => {
167
+ later(Math.max(0, (beats[0] ?? 0) - 200), aim);
168
+ beats.forEach((ms, i) => later(ms, () => stage.classList.add(`b${i + 1}`)));
169
+ const end = (beats.at(-1) ?? 0) + HOLD;
170
+ later(end, () => stage.classList.add('out'));
171
+ later(end + 420, () => {
172
+ stage.classList.add('reset');
173
+ beats.forEach((_, i) => stage.classList.remove(`b${i + 1}`));
174
+ void stage.offsetWidth; // the reset lands before the stage comes back
175
+ stage.classList.remove('reset', 'out');
176
+ run();
177
+ });
178
+ };
179
+ if (still) beats.forEach((_, i) => stage.classList.add(`b${i + 1}`));
180
+ else run();
181
+ return {
182
+ node: stage,
183
+ stop() { for (const timer of timers) clearTimeout(timer); timers.clear(); },
184
+ };
185
+ }
@@ -0,0 +1,66 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
+ // The author's notices, on the page (Q-11, src/notices.mjs). Home shows every notice for this copy;
4
+ // a project only the important and security ones, as a thin strip above the conversation. Each stays
5
+ // until the person presses «Got it». Text only: a notice is never HTML, and its one link goes to
6
+ // madre.run (the server checked the signature and the link before it came here).
7
+
8
+ import { language, t } from './i18n.js';
9
+
10
+ const el = (tag, className = null, text = null) => {
11
+ const node = document.createElement(tag);
12
+ if (className) node.className = className;
13
+ if (text !== null && text !== undefined) node.textContent = text;
14
+ return node;
15
+ };
16
+ const pickWords = (pair) => (pair && typeof pair === 'object' ? pair[language()] ?? pair.es ?? pair.en ?? '' : String(pair ?? ''));
17
+ const LEVEL_WORDS = { info: () => t('Notice from MADRE'), important: () => t('Important notice from MADRE'), security: () => t('Security notice from MADRE') };
18
+
19
+ // Draws the notices into `host` and asks again every few minutes while the page is open.
20
+ // `levels`: which ones this page shows. Returns a function that asks again at once.
21
+ export function mountNotices(host, { levels = ['info', 'important', 'security'], every = 5 * 60_000 } = {}) {
22
+ if (!host) return () => {};
23
+ host.classList.add('madre-notices');
24
+ host.setAttribute('aria-live', 'polite');
25
+ let drawn = '';
26
+ const draw = (notices) => {
27
+ const shown = notices.filter((one) => !one.seen && levels.includes(one.level));
28
+ const key = JSON.stringify(shown.map((one) => one.id)) + language();
29
+ if (key === drawn) return;
30
+ drawn = key;
31
+ host.replaceChildren();
32
+ host.hidden = !shown.length;
33
+ for (const notice of shown) {
34
+ const card = el('section', `madre-notice is-${notice.level}`);
35
+ card.setAttribute('role', notice.level === 'security' ? 'alert' : 'status');
36
+ const words = el('div', 'madre-notice-words');
37
+ words.append(el('small', 'madre-notice-kind', LEVEL_WORDS[notice.level]?.() ?? LEVEL_WORDS.info()), el('b', 'madre-notice-title', pickWords(notice.title)), el('p', 'madre-notice-body', pickWords(notice.body)));
38
+ if (notice.link) {
39
+ const link = el('a', 'madre-notice-link', t('Read more'));
40
+ link.href = notice.link;
41
+ link.target = '_blank';
42
+ link.rel = 'noopener noreferrer';
43
+ words.append(link);
44
+ }
45
+ const done = el('button', 'madre-notice-done', t('Got it'));
46
+ done.type = 'button';
47
+ done.addEventListener('click', async () => {
48
+ done.disabled = true;
49
+ await fetch('/api/notices/seen', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: notice.id }) }).catch(() => null);
50
+ card.remove();
51
+ if (!host.querySelector('.madre-notice')) host.hidden = true;
52
+ });
53
+ card.append(words, done);
54
+ host.append(card);
55
+ }
56
+ };
57
+ const ask = async () => {
58
+ if (document.hidden) return;
59
+ const answer = await fetch('/api/notices', { cache: 'no-store' }).then((response) => (response.ok ? response.json() : null)).catch(() => null);
60
+ if (answer && Array.isArray(answer.notices)) draw(answer.notices);
61
+ };
62
+ void ask();
63
+ setInterval(() => void ask(), every);
64
+ document.addEventListener('visibilitychange', () => { if (!document.hidden) void ask(); });
65
+ return () => { drawn = ''; void ask(); };
66
+ }
package/public/power.js CHANGED
@@ -286,7 +286,7 @@ export async function askCloseProject() {
286
286
  cancel.disabled = true;
287
287
  go.textContent = t('Closing…');
288
288
  try {
289
- const response = await fetch('/api/room/close', { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' });
289
+ const response = await fetch('/api/room/close', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ forget: true }) });
290
290
  if (!response.ok) throw new Error(t('MADRE did not answer. Check that it is still open.'));
291
291
  } catch (error) {
292
292
  reply.textContent = error.name === 'TypeError' ? t('MADRE did not answer. Check that it is still open.') : error.message;
package/public/resay.js CHANGED
@@ -32,8 +32,11 @@ const SAID = [
32
32
  '{label} was interrupted before it started: {why}.',
33
33
  '{label} was interrupted: {why}.',
34
34
  '{label} did not respond before the timeout ({seconds}s).',
35
+ 'This computer does not have git, which MADRE needs to take the restore point before @{agent} writes, so nothing was changed. Install git and send it again.',
36
+ '{label} closed the connection before answering ({code}). Check in Settings › Local AI that Ollama is still running.',
35
37
  '{label} exited with code {code}.',
36
38
  ' Last output: {output}',
39
+ ' (also tried {model})',
37
40
  'MADRE is shutting down',
38
41
  'STOPALL by the human',
39
42
  '{label} does not know the model `{model}`.',