@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
@@ -37,6 +37,9 @@ const whereOf = (project) => (project.home ? t('Coordinator') : project.name ??
37
37
  // What runs, counted for the key: a plan once (its steps are inside it), never an outdated project.
38
38
  const counted = (one) => one.kind !== 'turn' || !one.planId;
39
39
 
40
+ // A step's permission in the words the box uses (#1 Just chat … #4 Full access).
41
+ const MODE_WORDS = { 0: () => t('Not saved'), 1: () => t('Just chat'), 2: () => t('Can create'), 3: () => t('Can edit'), 4: () => t('Full access') };
42
+
40
43
  function avatar(agent, { busy = false } = {}) {
41
44
  const brand = brandOf(agent);
42
45
  const face = el('span', `ap-av${busy ? ' busy' : ''}`);
@@ -59,7 +62,7 @@ function sysAvatar(icon, { busy = false } = {}) {
59
62
  */
60
63
  export function mountActivity({ key, badge, openChat, toast = () => {} }) {
61
64
  if (!key) return null;
62
- const state = { data: null, said: '', open: false, timer: 0, ticking: 0, opened: new Set(), confirmAll: 0, failing: 0, pressing: false, stale: false };
65
+ const state = { data: null, said: '', open: false, timer: 0, ticking: 0, opened: new Set(), seen: new Set(), confirmAll: 0, failing: 0, pressing: false, stale: false };
63
66
  const panel = el('div', 'activity-panel');
64
67
  panel.setAttribute('role', 'dialog');
65
68
  panel.setAttribute('aria-label', t('Running now'));
@@ -216,39 +219,69 @@ export function mountActivity({ key, badge, openChat, toast = () => {} }) {
216
219
  progress: item.timeoutMs ? () => since(item.startedAt)() / item.timeoutMs : null,
217
220
  more: (inside) => {
218
221
  if (helpers.length) inside.append(subChips(helpers));
219
- inside.append(el('p', 'ap-meta', item.timeoutMs ? t('With your permission #{mode} · the limit counts from when it started', { mode: item.mode ?? 1 }) : t('With your permission #{mode}', { mode: item.mode ?? 1 })));
222
+ inside.append(el('p', 'ap-meta', `${t('Permission: {mode}', { mode: `#${item.mode ?? 1} ${MODE_WORDS[item.mode ?? 1]?.() ?? ''}`.trim() })}${item.timeoutMs ? ` · ${t('it has up to {limit} to answer', { limit: clock(item.timeoutMs) })}` : ''}`));
220
223
  inside.append(actions([t('Go to the chat'), 'go', () => goTo(project, item.chat, item.messageId)], [t('Stop'), 'stop', () => stop(project, item)]));
221
224
  },
222
225
  });
223
226
  }
224
227
  if (item.kind === 'plan') {
228
+ // A plan reads as a road (2026-11-14, the author: «Plan actual is very confusing»): who made it
229
+ // and what it is for, one segment per step on a bar, and each step on a line of its own — the
230
+ // AI's face, what it was asked, with which permission, and whether it is done, at work or
231
+ // waiting its turn. Open by default the first time it shows.
232
+ if (!state.seen.has(uid)) { state.seen.add(uid); state.opened.add(uid); }
233
+ const listed = item.steps ?? [];
234
+ const closes = item.total > listed.length;
235
+ const stepNow = Math.max(1, item.step);
236
+ const working = steps[0] ? brandOf(steps[0].agent).label : null;
237
+ const others = new Set(listed.map((one) => one.agent).filter((one) => one !== item.orchestrator));
225
238
  return row({
226
239
  id: uid, face: avatar(item.orchestrator, { busy: true }), tint: brandOf(item.orchestrator).color,
227
- title: t('Plan by {agent} · {n} steps', { agent: brandOf(item.orchestrator).label, n: item.total }),
228
- sub: `${where} · ${t('Step {step} of {total}', { step: Math.max(1, item.step), total: item.total })}${steps.length ? ` · ${t('{agent} is answering', { agent: brandOf(steps[0].agent).label })}` : ''}`,
240
+ title: others.size ? t('{agent} puts {n} AIs to work', { agent: brandOf(item.orchestrator).label, n: others.size }) : t('Plan by {agent} · {n} steps', { agent: brandOf(item.orchestrator).label, n: item.total }),
241
+ sub: `${where} · ${t('Step {step} of {total}', { step: stepNow, total: item.total })}${working ? ` · ${t('{agent} is answering', { agent: working })}` : ''}`,
229
242
  time: () => clock(since(item.startedAt)()),
230
243
  progress: () => Math.max(0, item.step - 1) / Math.max(1, item.total),
231
244
  more: (inside) => {
232
- const list = el('ol', 'ap-steps');
233
- (item.steps ?? []).forEach((step, index) => {
234
- const li = el('li', index + 1 < item.step ? 'done' : index + 1 === item.step ? 'now' : '');
235
- li.append(el('b', null, brandOf(step.agent).label), document.createTextNode(` ${step.text}`));
236
- list.append(li);
245
+ inside.classList.add('ap-plan');
246
+ inside.append(el('p', 'ap-plan-lead', t('{agent} split the request into {n} steps. Each AI works when the one before it finishes, and its answer reaches the next.', { agent: brandOf(item.orchestrator).label, n: item.total })));
247
+ const road = [...listed.map((step) => ({ agent: step.agent, text: step.text, mode: step.mode })), ...(closes ? [{ agent: item.orchestrator, text: t('reads the answers and gives you the final answer'), closing: true }] : [])];
248
+ // One segment per step, in each AI's colour: full when done, breathing while at work.
249
+ const segs = el('div', 'ap-segs');
250
+ segs.setAttribute('aria-hidden', 'true');
251
+ road.forEach((step, index) => {
252
+ const seg = el('i', index + 1 < stepNow ? 'done' : index + 1 === stepNow ? 'now' : 'wait');
253
+ seg.style.setProperty('--seg', brandOf(step.agent).color);
254
+ segs.append(seg);
237
255
  });
238
- // The last step is the one who made the plan reading the answers: counted, so it is listed.
239
- const listed = item.steps?.length ?? 0;
240
- if (item.total > listed) {
241
- const li = el('li', item.step > listed ? 'now' : '');
242
- li.append(el('b', null, brandOf(item.orchestrator).label), document.createTextNode(` ${t('reads the answers and closes the plan')}`));
256
+ inside.append(segs);
257
+ const list = el('ol', 'ap-road');
258
+ road.forEach((step, index) => {
259
+ const at = index + 1 < stepNow ? 'done' : index + 1 === stepNow ? 'now' : 'wait';
260
+ const li = el('li', `ap-step ${at}${step.closing ? ' closing' : ''}`);
261
+ const mark = el('span', 'ap-step-mark');
262
+ mark.append(avatar(step.agent, { busy: at === 'now' }));
263
+ const badge = el('span', `ap-step-badge ${at}`);
264
+ if (at === 'done') badge.innerHTML = trazo('check'); // trusted: our own SVG
265
+ else badge.textContent = String(index + 1);
266
+ mark.append(badge);
267
+ const words = el('div', 'ap-step-words');
268
+ const head = el('div', 'ap-step-head');
269
+ head.append(el('b', null, brandOf(step.agent).label));
270
+ if (Number.isInteger(step.mode)) head.append(el('span', `ap-step-mode m${step.mode}`, MODE_WORDS[step.mode]?.() ?? `#${step.mode}`));
271
+ const said = el('span', `ap-step-state ${at}`);
272
+ const turn = at === 'now' ? steps.find((one) => one.agent === step.agent) : null;
273
+ const sayState = () => (at === 'done' ? t('Done') : at === 'now' ? (turn ? t('Working · {time}', { time: clock(since(turn.startedAt)()) }) : t('Starting…')) : t('Waits its turn'));
274
+ said.textContent = sayState();
275
+ if (at === 'now' && turn) state.tickers.push(() => { said.textContent = sayState(); });
276
+ head.append(said);
277
+ const text = el('p', 'ap-step-text', step.text);
278
+ text.title = step.text;
279
+ words.append(head, text);
280
+ if (turn?.subagents?.length) words.append(subChips(turn.subagents));
281
+ li.append(mark, words);
243
282
  list.append(li);
244
- }
283
+ });
245
284
  inside.append(list);
246
- for (const turn of steps) {
247
- const said = el('p', 'ap-meta', t('{agent} is answering step {step} · {time}', { agent: brandOf(turn.agent).label, step: item.step, time: clock(since(turn.startedAt)()) }));
248
- state.tickers.push(() => { said.textContent = t('{agent} is answering step {step} · {time}', { agent: brandOf(turn.agent).label, step: item.step, time: clock(since(turn.startedAt)()) }); });
249
- inside.append(said);
250
- if (turn.subagents?.length) inside.append(subChips(turn.subagents));
251
- }
252
285
  inside.append(actions([t('Go to the chat'), 'go', () => goTo(project, item.chat)], [t('Stop the plan'), 'stop', () => stop(project, item)]));
253
286
  },
254
287
  });
@@ -276,10 +309,19 @@ export function mountActivity({ key, badge, openChat, toast = () => {} }) {
276
309
  const title = what.startsWith('agent:') ? t('Installing {name}', { name: brandOf(what.slice(6)).label })
277
310
  : what === 'ollama' ? (item.model ? t('Downloading {name}', { name: item.model }) : t('Installing {name}', { name: 'Ollama' }))
278
311
  : t('Installing the module {name}', { name: what });
312
+ // Opened, it says what the installer said last and how far it got; a model downloading can be
313
+ // stopped from here, as in the welcome. It opened onto nothing before (2026-11-06, the author).
314
+ const percent = (() => { const all = [...String(item.line ?? '').matchAll(/(\d{1,3}(?:\.\d+)?)\s?%/g)]; return all.length ? Math.min(100, Number(all.at(-1)[1])) : null; })();
279
315
  return row({
280
316
  id: uid, face: sysAvatar('download', { busy: true }), title,
281
317
  sub: `${project.home ? t('Home') : whereOf(project)} · ${t('It ends on its own; you can keep working.')}`,
282
318
  time: item.startedAt ? () => clock(since(item.startedAt)()) : '',
319
+ progress: percent === null ? null : () => percent / 100,
320
+ more: (inside) => {
321
+ inside.append(el('p', 'ap-meta', t('It ends on its own; you can keep working.')));
322
+ if (item.line) inside.append(el('pre', 'ap-out', item.line));
323
+ if (item.stoppable) inside.append(actions([t('Stop the download'), 'stop', () => stop(project, item)]));
324
+ },
283
325
  });
284
326
  }
285
327
 
@@ -416,7 +458,9 @@ export function mountActivity({ key, badge, openChat, toast = () => {} }) {
416
458
  }
417
459
  key.addEventListener('click', () => (state.open ? close() : openPanel()));
418
460
  document.addEventListener?.('keydown', (event) => { if (event.key === 'Escape' && state.open) { close(); key.focus(); } });
419
- document.addEventListener?.('pointerdown', (event) => { if (state.open && !panel.contains(event.target) && !key.contains(event.target)) close(); }, true);
461
+ // A press on a first-time card (its «Entendido») is not a press outside the panel: closing the card
462
+ // closed «Plan actual» with it (2026-11-17, the author).
463
+ document.addEventListener?.('pointerdown', (event) => { if (state.open && !panel.contains(event.target) && !key.contains(event.target) && !event.target?.closest?.('.hint-card')) close(); }, true);
420
464
  globalThis.addEventListener?.('resize', () => { if (state.open) place(); });
421
465
 
422
466
  void load();