@jossuealcala/madre 1.0.3 → 1.0.5

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 (106) hide show
  1. package/CHANGELOG.en.md +113 -1
  2. package/CHANGELOG.md +113 -1
  3. package/NOTICE +30 -0
  4. package/README.en.md +59 -156
  5. package/README.md +60 -161
  6. package/TRADEMARKS.md +18 -0
  7. package/bin/madre.mjs +2 -2
  8. package/docs/REFERENCE.md +1 -1
  9. package/docs/SDK.md +25 -4
  10. package/docs/en/REFERENCE.md +1 -1
  11. package/docs/en/SDK.md +22 -2
  12. package/docs/madre-banner.png +0 -0
  13. package/package.json +1 -1
  14. package/public/app.js +1087 -247
  15. package/public/assets/manual/madre-manual-en.pdf +0 -0
  16. package/public/assets/manual/madre-manual-es.pdf +0 -0
  17. package/public/assets/manual/shots/en-agents.webp +0 -0
  18. package/public/assets/manual/shots/en-code.webp +0 -0
  19. package/public/assets/manual/shots/en-composer.webp +0 -0
  20. package/public/assets/manual/shots/en-connectors.webp +0 -0
  21. package/public/assets/manual/shots/en-continuity.webp +0 -0
  22. package/public/assets/manual/shots/en-coordinator.webp +0 -0
  23. package/public/assets/manual/shots/en-copilot.webp +0 -0
  24. package/public/assets/manual/shots/en-diagnostics.webp +0 -0
  25. package/public/assets/manual/shots/en-home.webp +0 -0
  26. package/public/assets/manual/shots/en-local.webp +0 -0
  27. package/public/assets/manual/shots/en-memory.webp +0 -0
  28. package/public/assets/manual/shots/en-modes.webp +0 -0
  29. package/public/assets/manual/shots/en-modules.webp +0 -0
  30. package/public/assets/manual/shots/en-notes.webp +0 -0
  31. package/public/assets/manual/shots/en-settings.webp +0 -0
  32. package/public/assets/manual/shots/en-windows.webp +0 -0
  33. package/public/assets/manual/shots/es-agents.webp +0 -0
  34. package/public/assets/manual/shots/es-code.webp +0 -0
  35. package/public/assets/manual/shots/es-composer.webp +0 -0
  36. package/public/assets/manual/shots/es-connectors.webp +0 -0
  37. package/public/assets/manual/shots/es-continuity.webp +0 -0
  38. package/public/assets/manual/shots/es-coordinator.webp +0 -0
  39. package/public/assets/manual/shots/es-copilot.webp +0 -0
  40. package/public/assets/manual/shots/es-diagnostics.webp +0 -0
  41. package/public/assets/manual/shots/es-home.webp +0 -0
  42. package/public/assets/manual/shots/es-local.webp +0 -0
  43. package/public/assets/manual/shots/es-memory.webp +0 -0
  44. package/public/assets/manual/shots/es-modes.webp +0 -0
  45. package/public/assets/manual/shots/es-modules.webp +0 -0
  46. package/public/assets/manual/shots/es-notes.webp +0 -0
  47. package/public/assets/manual/shots/es-settings.webp +0 -0
  48. package/public/assets/manual/shots/es-windows.webp +0 -0
  49. package/public/en.js +74 -0
  50. package/public/es.js +495 -137
  51. package/public/i18n.js +45 -7
  52. package/public/index.html +2 -3
  53. package/public/manual-content.js +657 -0
  54. package/public/manual-shots.js +43 -0
  55. package/public/manual.css +228 -0
  56. package/public/manual.html +15 -0
  57. package/public/manual.js +398 -0
  58. package/public/market-art.js +56 -0
  59. package/public/market-view.js +140 -22
  60. package/public/market.js +25 -14
  61. package/public/mcp-catalog.js +62 -0
  62. package/public/resay.js +1 -0
  63. package/public/salas-mac.css +185 -30
  64. package/public/salas-mac.html +5 -5
  65. package/public/salas-mac.js +475 -68
  66. package/public/styles.css +306 -42
  67. package/public/tour-chapters.js +98 -90
  68. package/public/tour.js +63 -21
  69. package/public/troubleshooting.js +145 -10
  70. package/src/adapters/cursor.mjs +56 -7
  71. package/src/adapters/gemini.mjs +12 -1
  72. package/src/adapters/madre.mjs +27 -6
  73. package/src/adapters/process.mjs +5 -2
  74. package/src/auth-probe.mjs +22 -3
  75. package/src/bridge/policy.mjs +1 -1
  76. package/src/bridge/server.mjs +1 -1
  77. package/src/capabilities.mjs +3 -3
  78. package/src/credentials.mjs +24 -2
  79. package/src/history.mjs +76 -0
  80. package/src/i18n.mjs +23 -1
  81. package/src/local-ai.mjs +10 -2
  82. package/src/looks.mjs +17 -5
  83. package/src/market-license.mjs +104 -0
  84. package/src/market-remote.mjs +17 -1
  85. package/src/mcp/notes-server.mjs +120 -0
  86. package/src/mcp/proxy.mjs +14 -3
  87. package/src/models.mjs +82 -9
  88. package/src/modules/index.mjs +3 -1
  89. package/src/modules/local-models.mjs +28 -0
  90. package/src/modules/notes.mjs +142 -0
  91. package/src/modules/ollama.mjs +39 -10
  92. package/src/modules/playwright.mjs +14 -3
  93. package/src/modules/reminders.mjs +345 -0
  94. package/src/modules/sdk.mjs +21 -5
  95. package/src/mother.mjs +11 -1
  96. package/src/ollama.mjs +2 -2
  97. package/src/opencode-health.mjs +63 -0
  98. package/src/outbound.mjs +25 -1
  99. package/src/ports.mjs +4 -6
  100. package/src/reminder-time.mjs +127 -0
  101. package/src/room.mjs +19 -7
  102. package/src/runtime-detection.mjs +6 -2
  103. package/src/sentinel-errors.mjs +4 -3
  104. package/src/server-sentinel.mjs +7 -3
  105. package/src/server.mjs +302 -70
  106. package/src/tour.mjs +24 -5
package/public/i18n.js CHANGED
@@ -14,7 +14,7 @@
14
14
  // English, whole, rather than as a hole or an id: half a translated screen is a screen, and a
15
15
  // screen full of MISSING_KEY_47 is a bug report.
16
16
  //
17
- // What varies inside a sentence travels as a named slot, `t('{n} blocks', { n })`, so the
17
+ // What varies inside a sentence travels as a named slot, «{n}» filled from `{ n }`, so the
18
18
  // Spanish can put it where Spanish puts it rather than where English did.
19
19
  //
20
20
  // And what is already DATA — the troubleshooting catalogue, the console's inquiries, the
@@ -24,10 +24,12 @@
24
24
  // Nothing here is a framework. It is a lookup, a fallback and a switch.
25
25
 
26
26
  import { ES } from './es.js';
27
+ import { EN } from './en.js';
27
28
 
28
29
  export const LANGUAGES = { es: { id: 'es', name: 'ESPAÑOL', other: 'en' }, en: { id: 'en', name: 'ENGLISH', other: 'es' } };
29
30
  export const DEFAULT_LANGUAGE = 'es';
30
- const CATALOGUES = { es: ES, en: {} };
31
+ // English has a catalogue too (en.js): the words people use where the source's are not.
32
+ const CATALOGUES = { es: ES, en: EN };
31
33
 
32
34
  let current = DEFAULT_LANGUAGE;
33
35
 
@@ -56,21 +58,43 @@ export function fill(text, vars) {
56
58
 
57
59
  // «Mac» only where MADRE runs on one (2026-10-15). It installs on Linux too, so a sentence about
58
60
  // the machine it runs on («this Mac», «tu Mac», «la Mac») says «computer»/«computadora» anywhere
59
- // else. The page is always opened on the machine that serves it (127.0.0.1), so the browser's own
60
- // platform is that machine's. Hardware named on purpose — «a Mac with an M chip» — has no article
61
- // in front and is left as it is.
62
- let hostIsMac = /mac/i.test(String(globalThis.navigator?.userAgentData?.platform ?? globalThis.navigator?.platform ?? ''));
61
+ // else, and from 2026-10-20 it says the machine's own name: «Encontrados en cotizapp2». The machine is
62
+ // the one MADRE runs on, which the server writes into the page (<meta name="madre-host">): a page
63
+ // looked at from another computer — a Linux box reached from a Mac — used to take the browser's
64
+ // platform for the server's and said «esta Mac» on Linux. Hardware named on purpose — «a Mac with
65
+ // an M chip» — has no article in front and is left as it is.
66
+ const servedBy = (() => { try { return JSON.parse(globalThis.document?.querySelector?.('meta[name="madre-host"]')?.content ?? 'null'); } catch { return null; } })();
67
+ let hostIsMac = servedBy ? servedBy.os === 'darwin' : /mac/i.test(String(globalThis.navigator?.userAgentData?.platform ?? globalThis.navigator?.platform ?? ''));
68
+ let hostName = typeof servedBy?.name === 'string' && servedBy.name.trim() ? servedBy.name.trim().slice(0, 64) : null;
63
69
  export const setHostIsMac = (value) => { hostIsMac = Boolean(value); return hostIsMac; };
70
+ export const setHostName = (value) => { hostName = typeof value === 'string' && value.trim() ? value.trim().slice(0, 64) : null; return hostName; };
71
+ export const hostLabel = () => hostName;
64
72
  export function hostWords(text) {
65
73
  if (hostIsMac || typeof text !== 'string' || !text.includes('Mac')) return text;
74
+ // With the machine's own name (2026-10-20) a sentence about it names it: «Found on cotizapp2».
75
+ if (hostName) {
76
+ return text
77
+ .replace(/\b(on|in|from|to) (this|your|the) Mac\b/g, `$1 ${hostName}`)
78
+ .replace(/\b(this|your|the|This|Your|The) Mac\b/g, hostName)
79
+ .replace(/(^|[^\p{L}])(en|de|a|desde) (esta|tu|la) Mac\b/gu, `$1$2 ${hostName}`)
80
+ .replace(/(^|[^\p{L}])(esta|tu|la|Esta|Tu|La) Mac\b/gu, `$1${hostName}`);
81
+ }
66
82
  return text
67
83
  .replace(/\b(this|your|the|This|Your|The) Mac\b/g, '$1 computer')
68
84
  .replace(/(^|[^\p{L}])(esta|tu|la|Esta|Tu|La) Mac\b/gu, '$1$2 computadora');
69
85
  }
70
86
 
87
+ // The keys a sentence names are the ones of the keyboard in front of the person, which is the
88
+ // browser's, not the server's: «⌘S» on a Mac, «Ctrl+S» anywhere else (2026-10-20).
89
+ const keysAreMac = /mac|iphone|ipad/i.test(String(globalThis.navigator?.userAgentData?.platform ?? globalThis.navigator?.platform ?? 'mac'));
90
+ export function keyWords(text) {
91
+ if (keysAreMac || typeof text !== 'string' || !text.includes('⌘')) return text;
92
+ return text.replace(/⌘\s?/g, 'Ctrl+');
93
+ }
94
+
71
95
  export function t(text, vars = null) {
72
96
  const said = CATALOGUES[current]?.[text] ?? text;
73
- return fill(hostWords(said), vars);
97
+ return fill(keyWords(hostWords(said)), vars);
74
98
  }
75
99
 
76
100
  // A table that carries both languages: `{ en: …, es: … }` anywhere inside it. Whole objects,
@@ -88,3 +112,17 @@ export function pick(value) {
88
112
  // What the catalogue holds, for the test that keeps it honest: every key it has must be a
89
113
  // sentence the product actually says, and every sentence the product asks for must be in it.
90
114
  export const catalogue = (id = current) => CATALOGUES[id] ?? {};
115
+
116
+ // What an agent's own CLI says about its session (src/auth-probe.mjs), in the reader's language
117
+ // (2026-10-20): its words were shown as they came, «not logged in» in a Spanish room. When they only
118
+ // repeat what the card's lamp already says, nothing is added.
119
+ const SESSION_REPEATS = new Set(['not logged in', 'never signed in', 'logged in']);
120
+ export function sessionDetail(session) {
121
+ const detail = String(session?.detail ?? '').trim();
122
+ if (!detail || SESSION_REPEATS.has(detail)) return null;
123
+ const via = detail.match(/^via (.+)$/);
124
+ if (via) return t('via {method}', { method: t(via[1]) });
125
+ const as = detail.match(/^as (.+)$/);
126
+ if (as) return t('as {who}', { who: as[1] });
127
+ return t(detail);
128
+ }
package/public/index.html CHANGED
@@ -40,7 +40,7 @@
40
40
  <span id="tour-pill-slot" class="tour-pill-slot" hidden></span>
41
41
  <button id="handoff-pill" class="stop-all handoff-pill" type="button" hidden><svg class="bar-glyph" viewBox="0 0 20 20" aria-hidden="true"><rect x="6" y="2.8" width="8" height="14.4" rx="2.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 14.6h2" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg><span class="handoff-words"></span></button>
42
42
  <button id="update-pill" class="stop-all update-pill" type="button" hidden title="A newer MADRE is on npm"></button>
43
- <button id="stop-all" class="stop-all" type="button" title="STOP ALL · halt every plan and every agent turn" hidden>
43
+ <button id="stop-all" class="mother-button stop-all" type="button" title="STOP ALL · halt every plan and every agent turn" hidden>
44
44
  <svg class="bar-glyph" viewBox="0 0 20 20" aria-hidden="true"><rect class="ic-f" x="4" y="4" width="12" height="12" rx="3.4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>STOP ALL
45
45
  </button>
46
46
  <button id="code-button" class="mother-button code-button" type="button" title="Code · your files, the editor and the preview beside the conversation" aria-pressed="false">
@@ -363,13 +363,12 @@
363
363
  <span class="viewer-spacer" aria-hidden="true"></span>
364
364
  <button id="viewer-edit" class="viewer-review viewer-edit" type="button" hidden>EDIT</button>
365
365
  <button id="viewer-mode" class="viewer-review viewer-mode" type="button" hidden>SOURCE</button>
366
- <button id="viewer-review" class="viewer-review" type="button" hidden>REVIEW WITH ▾</button>
366
+ <button id="viewer-review" class="viewer-review" type="button" hidden>ASK ▾</button>
367
367
  <a id="viewer-open" class="viewer-open" target="_blank" rel="noopener noreferrer">OPEN RAW ↗</a>
368
368
  <button id="viewer-close" class="mother-close" type="button">CLOSE ×</button>
369
369
  </header>
370
370
  <div id="viewer-errors" class="viewer-errors" hidden></div>
371
371
  <div id="viewer-body" class="viewer-body"></div>
372
- <div id="viewer-menu" class="viewer-menu" role="menu" hidden></div>
373
372
  </dialog>
374
373
  </div>
375
374
  <script type="module" src="/app.js"></script>