@jossuealcala/madre 1.1.3 → 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 (121) hide show
  1. package/CHANGELOG.en.md +20 -1
  2. package/CHANGELOG.md +20 -1
  3. package/TRADEMARKS.md +6 -2
  4. package/bin/madre.mjs +4 -2
  5. package/docs/REFERENCE.md +3 -3
  6. package/docs/SDK.md +28 -1
  7. package/docs/en/REFERENCE.md +2 -2
  8. package/docs/en/SDK.md +26 -0
  9. package/docs/sdk/hello-module.mjs +38 -3
  10. package/habilidades/explicamelo-facil/HABILIDAD.md +19 -0
  11. package/habilidades/hojas-de-calculo/HABILIDAD.md +18 -0
  12. package/habilidades/mensajes-a-clientes/HABILIDAD.md +19 -0
  13. package/habilidades/publicaciones-para-redes/HABILIDAD.md +19 -0
  14. package/habilidades/resumen-y-pendientes/HABILIDAD.md +18 -0
  15. package/habilidades/tu-pagina-paso-a-paso/HABILIDAD.md +19 -0
  16. package/package.json +4 -3
  17. package/public/activity.js +57 -22
  18. package/public/app.js +3998 -762
  19. package/public/assets/brand/OFL-SpaceGrotesk.txt +93 -0
  20. package/public/assets/brand/SpaceGrotesk-latin-ext.woff2 +0 -0
  21. package/public/assets/brand/SpaceGrotesk-latin.woff2 +0 -0
  22. package/public/assets/brand/madre-app-180.png +0 -0
  23. package/public/assets/brand/madre-app-192.png +0 -0
  24. package/public/assets/brand/madre-app-512.png +0 -0
  25. package/public/assets/brand/madre-app.svg +1 -1
  26. package/public/assets/brand/madre-favicon.svg +1 -1
  27. package/public/attribution.js +28 -27
  28. package/public/auto-open.js +102 -0
  29. package/public/brands.js +9 -6
  30. package/public/changes.js +63 -0
  31. package/public/en.js +1085 -101
  32. package/public/es.js +2395 -1688
  33. package/public/i18n.js +11 -0
  34. package/public/index.html +28 -27
  35. package/public/loader.js +322 -117
  36. package/public/macroverso.js +33 -350
  37. package/public/manual-content.js +37 -7
  38. package/public/manual.js +21 -6
  39. package/public/market-view.js +212 -105
  40. package/public/market.js +10 -2
  41. package/public/mcp-catalog.js +7 -2
  42. package/public/missions.js +169 -0
  43. package/public/news-scenes.js +110 -3
  44. package/public/nostromo-engine.js +935 -654
  45. package/public/notices.js +14 -2
  46. package/public/notifications.js +119 -0
  47. package/public/provider-marks.js +170 -0
  48. package/public/provider-pick.js +147 -0
  49. package/public/resay.js +1 -0
  50. package/public/review-ask.js +16 -13
  51. package/public/routing.js +29 -3
  52. package/public/salas-mac.css +257 -40
  53. package/public/salas-mac.html +5 -5
  54. package/public/salas-mac.js +376 -97
  55. package/public/salas.css +2 -2
  56. package/public/salas.html +2 -2
  57. package/public/salas.js +1 -1
  58. package/public/starters.js +128 -0
  59. package/public/styles.css +2656 -336
  60. package/public/subscription.js +303 -0
  61. package/public/terms-field.js +170 -0
  62. package/public/terms.js +117 -19
  63. package/public/tips.js +41 -7
  64. package/public/tour-chapters.js +35 -35
  65. package/public/tour.js +333 -43
  66. package/public/troubleshooting.js +100 -7
  67. package/public/welcome-scene.js +117 -29
  68. package/public/welcome.js +364 -60
  69. package/src/adapters/claude.mjs +2 -1
  70. package/src/adapters/codex.mjs +2 -1
  71. package/src/adapters/cursor.mjs +9 -6
  72. package/src/adapters/gemini.mjs +4 -0
  73. package/src/adapters/grok.mjs +6 -4
  74. package/src/adapters/madre.mjs +71 -23
  75. package/src/adapters/opencode.mjs +15 -2
  76. package/src/adapters/steps.mjs +176 -0
  77. package/src/app-invite.mjs +90 -0
  78. package/src/billing-key.mjs +8 -0
  79. package/src/billing.mjs +317 -0
  80. package/src/bridge/policy.mjs +1 -1
  81. package/src/capabilities.mjs +17 -11
  82. package/src/chats.mjs +44 -2
  83. package/src/checkpoint.mjs +5 -1
  84. package/src/commands.mjs +5 -2
  85. package/src/directives.mjs +1 -0
  86. package/src/event-store.mjs +15 -0
  87. package/src/extensions.mjs +5 -1
  88. package/src/ficha.mjs +16 -0
  89. package/src/image-studio.mjs +13 -3
  90. package/src/install-metrics.mjs +9 -3
  91. package/src/lease.mjs +1 -1
  92. package/src/looks.mjs +4 -1
  93. package/src/mcp/image-server.mjs +59 -90
  94. package/src/modules/ahp.mjs +2 -1
  95. package/src/modules/github.mjs +6 -2
  96. package/src/modules/image-providers.mjs +281 -0
  97. package/src/modules/image-studio.mjs +100 -19
  98. package/src/modules/index.mjs +7 -1
  99. package/src/modules/intents-observe.mjs +3 -1
  100. package/src/modules/playwright.mjs +33 -4
  101. package/src/modules/reminders.mjs +42 -2
  102. package/src/modules/ripley.mjs +2 -1
  103. package/src/modules/sdk.mjs +6 -1
  104. package/src/opencode-health.mjs +1 -1
  105. package/src/outbound.mjs +80 -6
  106. package/src/quota-sources.mjs +148 -3
  107. package/src/review-ask.mjs +55 -31
  108. package/src/room/changes.mjs +79 -0
  109. package/src/room/economy.mjs +1 -1
  110. package/src/room/guard.mjs +8 -1
  111. package/src/room/prompt.mjs +20 -4
  112. package/src/room.mjs +87 -21
  113. package/src/salas.mjs +30 -3
  114. package/src/server.mjs +545 -59
  115. package/src/setup.mjs +1 -1
  116. package/src/skills.mjs +10 -0
  117. package/src/terms.mjs +23 -5
  118. package/src/tour.mjs +18 -3
  119. package/src/updates.mjs +47 -4
  120. package/src/web-preview.mjs +181 -0
  121. package/src/whats-new.mjs +76 -4
package/public/salas.css CHANGED
@@ -5,7 +5,7 @@
5
5
  the accent, and the edges of the screen kept clear of the notch and the home bar. */
6
6
  body.salas {
7
7
  --s-acc: var(--acc, var(--phosphor));
8
- --s-acc-ink: var(--acc-ink, var(--phosphor-ink, #0a1405));
8
+ --s-acc-ink: var(--acc-ink, var(--phosphor-ink, #022c22));
9
9
  min-height: 100dvh; margin: 0; background: var(--bg); color: var(--text);
10
10
  font-family: var(--read); font-size: 15px; line-height: 1.45;
11
11
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
@@ -14,7 +14,7 @@ body.salas {
14
14
  .salas-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); }
15
15
  /* The brand as the bar draws it on the Mac, drawn once and then still. */
16
16
  .salas-brand { display: inline-flex; align-items: center; flex: none; }
17
- .salas-brand .brand-logo { height: 15px; }
17
+ .salas-brand .brand-logo { height: 20px; }
18
18
  .salas-mac { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
19
19
  .salas-stop { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 11px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--terror, #ff4d4d) 14%, transparent); color: var(--terror, #ff4d4d); font-size: 13px !important; font-weight: 600; cursor: pointer; }
20
20
  .salas-stop svg { width: 15px; height: 15px; }
package/public/salas.html CHANGED
@@ -12,14 +12,14 @@
12
12
  <title>MADRE</title>
13
13
  <link rel="manifest" href="/bridge/manifest.webmanifest">
14
14
  <link rel="icon" type="image/svg+xml" href="/assets/brand/madre-favicon.svg">
15
- <link rel="apple-touch-icon" href="/assets/brand/madre-app-180.png">
15
+ <link rel="apple-touch-icon" href="/assets/brand/madre-app-180.png?v=2">
16
16
  <link rel="stylesheet" href="/bridge/styles.css">
17
17
  <link rel="stylesheet" href="/bridge/salas.css">
18
18
  </head>
19
19
  <body class="salas">
20
20
  <header class="salas-top">
21
21
  <span class="salas-brand" aria-label="MADRE">
22
- <svg class="brand-logo" viewBox="-4.8 -4.8 377.1 49.6" aria-hidden="true"><g fill="none" stroke-linecap="round" stroke-linejoin="round"><g class="pulse" transform="translate(0 0) scale(2.5) translate(0 -2)"><path class="beat" d="M1 10H16L20 10L23.5 2L28 18L32 10L35 10L37 6L39 10H52" stroke-width="1.92" pathLength="100"/><circle class="beat-dot" cx="60" cy="10" r="3" stroke="none"/></g><g class="word" transform="translate(193.5 7)" stroke-width="4.8"><path d="M0 26V0L14 14.3L28 0V26"/><path transform="translate(36.5 0)" d="M0 26V7.8A7.8 7.8 0 0 1 7.8 0H17.2A7.8 7.8 0 0 1 25 7.8V26M0 15.6H25"/><path transform="translate(71.5 0)" d="M0 0H16A12 12 0 0 1 28 12V14A12 12 0 0 1 16 26H0Z"/><path transform="translate(110.5 0)" d="M0 26V0H20.85A7.15 7.15 0 0 1 28 7.15V7.15A7.15 7.15 0 0 1 20.85 14.3H0M15.12 14.3L28 26"/><path transform="translate(146 0)" d="M28 0H0V26H28M0 13H21"/></g></g></svg>
22
+ <svg class="brand-logo" viewBox="12 17.5 281.5 74" aria-hidden="true"><g class="pulse" fill="none" stroke-linecap="round" stroke-linejoin="round"><path class="beat" d="M20 82V42C20 21 41 21 46 39L50 52L54 39C59 21 80 21 80 42V60" stroke-width="14.5" pathLength="100"/><circle class="beat-dot" cx="80" cy="81" r="9.5" stroke="none"/></g><text class="word" x="116.7" y="71.4" font-size="62" letter-spacing="-2.17">madre</text></svg>
23
23
  </span>
24
24
  <span id="salas-mac" class="salas-mac"></span>
25
25
  <button id="salas-stop" class="salas-stop" type="button" hidden>
package/public/salas.js CHANGED
@@ -61,7 +61,7 @@ async function openRoom(id, { carry = false, chat = null } = {}) {
61
61
  }
62
62
 
63
63
  // The modes as the room names them (app.js, MODES): asked when shown, so the language is the page's.
64
- const modeName = (n) => [t('INCOGNITO'), t('CHAT ONLY'), t('CREATE'), t('EDIT'), t('FULL ACCESS')][n] ?? '';
64
+ const modeName = (n) => [t('Not saved'), t('Just chat'), t('Can create'), t('Can edit'), t('Full access')][n] ?? '';
65
65
  // What an agent is waiting for, in one line.
66
66
  function askLine(ask) {
67
67
  if (ask.kind === 'mode') return t('@{agent} asks for #{n} {label}', { agent: ask.agent, n: ask.mode, label: modeName(ask.mode) });
@@ -0,0 +1,128 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
+ // THE FIRST MESSAGES OF AN EMPTY CHAT (2026-11-10, asked by the author): three chips written for this
4
+ // project and this person, never the same three sentences for everyone. What is in the project's
5
+ // folder decides them — its spreadsheets, documents, presentations, a store or web page, pictures,
6
+ // code — and they name its own files. A folder with nothing in it yet is a project being born: then
7
+ // what the person said MADRE is for, in the welcome (src/tour.mjs, WELCOME_PROFILES), decides.
8
+ //
9
+ // Only names are read (the first level of the folder, from /api/tree), never what a file says. Words
10
+ // in English, as every word of the page; i18n.js says them in the room's language. A chip that ends
11
+ // in «: » is for the person to finish (app.js leaves the cursor at its end).
12
+
13
+ const ext = (name) => (String(name).match(/\.([a-z0-9]+)$/i)?.[1] ?? '').toLowerCase();
14
+ const SHEETS = new Set(['csv', 'tsv', 'xlsx', 'xls', 'xlsm', 'numbers', 'ods']);
15
+ const DOCS = new Set(['md', 'docx', 'doc', 'pdf', 'txt', 'pages', 'odt', 'rtf']);
16
+ const SLIDES = new Set(['pptx', 'ppt', 'key', 'odp']);
17
+ const IMAGES = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'heic', 'psd', 'ai', 'fig', 'sketch']);
18
+ const CODE_FILES = new Set(['package.json', 'pyproject.toml', 'requirements.txt', 'cargo.toml', 'go.mod', 'composer.json', 'gemfile', 'pom.xml', 'build.gradle', 'deno.json', 'pubspec.yaml', 'makefile']);
19
+ const CODE_EXT = new Set(['py', 'js', 'mjs', 'ts', 'tsx', 'jsx', 'php', 'rb', 'java', 'go', 'rs', 'swift', 'kt', 'c', 'cpp', 'cs', 'vue', 'svelte']);
20
+ const CODE_DIRS = new Set(['src', 'lib', 'app', 'node_modules', 'tests', 'test']);
21
+ // A store's theme (Shopify) or a site (WordPress, a folder of pages).
22
+ const WEB_DIRS = new Set(['layout', 'templates', 'sections', 'snippets', 'wp-content', 'public', 'site', 'www']);
23
+ // What every project has and says nothing of what it is about.
24
+ const PAPERWORK = /^(readme|leeme|license|licen[cs]e|licencia|changelog|cambios|contributing|code_of_conduct|security|agents|claude|gemini|credits|authors|notice|creditos|autores)(\.|$)/i;
25
+
26
+ // What the first level of the folder holds, by kind; each list keeps the files' names in order.
27
+ export function readFolder(entries = []) {
28
+ const kinds = { sheets: [], docs: [], slides: [], images: [], web: [], code: [] };
29
+ for (const entry of entries) {
30
+ const name = String(entry?.name ?? '');
31
+ if (!name || name.startsWith('.')) continue;
32
+ const lower = name.toLowerCase();
33
+ if (entry.kind === 'dir') {
34
+ if (CODE_DIRS.has(lower)) kinds.code.push(name);
35
+ if (WEB_DIRS.has(lower)) kinds.web.push(name);
36
+ continue;
37
+ }
38
+ const type = ext(name);
39
+ if (CODE_FILES.has(lower) || CODE_EXT.has(type)) kinds.code.push(name);
40
+ else if (type === 'html' || type === 'htm' || type === 'liquid') kinds.web.push(name);
41
+ else if (SHEETS.has(type)) kinds.sheets.push(name);
42
+ else if (SLIDES.has(type)) kinds.slides.push(name);
43
+ else if (IMAGES.has(type)) kinds.images.push(name);
44
+ else if (DOCS.has(type) && !PAPERWORK.test(name)) kinds.docs.push(name);
45
+ }
46
+ return kinds;
47
+ }
48
+
49
+ // Each kind's chips, best first: [icon, words, values].
50
+ const GROUPS = {
51
+ sheets: (file) => [
52
+ ['bars', 'Read {file} and tell me the most important thing its numbers show.', { file }],
53
+ ['trending', 'With {file}, put together a summary of the month: what goes up, what goes down and what you would do.', { file }],
54
+ ],
55
+ docs: (file) => [
56
+ ['note', 'Sum up {file} in five points and tell me what is still to be decided.', { file }],
57
+ ['pencil', 'Improve the writing of {file} without changing what it says.', { file }],
58
+ ],
59
+ slides: (file) => [
60
+ ['card', 'Go through {file} and tell me which slide is not needed and what is missing.', { file }],
61
+ ],
62
+ web: (_, project) => [
63
+ ['globe', 'Look at the main page of {project} and suggest three changes so it brings in more customers.', { project }],
64
+ ['search', 'Check the texts of {project}: spelling mistakes, confusing sentences and anything that is not clear.', { project }],
65
+ ],
66
+ images: (_, project) => [
67
+ ['image', 'Sort the pictures in {project} by subject and suggest clear names for them.', { project }],
68
+ ],
69
+ code: (_, project) => [
70
+ ['code', 'Explain {project} to me as to someone who does not program: what it does and how it is used.', { project }],
71
+ ['running', 'How do I open it on my computer? Give me the steps one by one.', {}],
72
+ ['warning', 'Go through {project} and tell me what is most urgent to fix, and why.', { project }],
73
+ ],
74
+ };
75
+ const ANY = (project) => [
76
+ ['help', 'What is in {project}, and how can you help me with it?', { project }],
77
+ ['list', 'Make a list of what is in {project}, folder by folder.', { project }],
78
+ ];
79
+
80
+ // A folder with nothing in it: what the person uses MADRE for (the welcome's `profile`). Since
81
+ // 2026-11-11 every one is whole (the author: «"I want to start an app:…" should help more»): it
82
+ // says what to make and asks the AI to ask first, so whoever does not know how to begin can send it.
83
+ const BORN = {
84
+ business: [['globe', 'Make me a simple page for my business with what I sell, my opening hours and a WhatsApp button. Ask me first for the details you need.', {}], ['calendar', 'Make me a list of what to do this week to get my business going.', {}]],
85
+ social: [['image', 'Plan my posts for this month: ask me what I sell and who it is for, and give me one idea a week with its text ready to publish.', {}], ['calendar', 'Make me a calendar of posts for the next two weeks.', {}]],
86
+ numbers: [['bars', 'Make me a sheet to keep my sales and expenses for the month.', {}]],
87
+ office: [['note', 'Help me put together a clear report: ask me the topic, who will read it and what they need to decide.', {}], ['card', 'Make me the outline of a ten-slide presentation: ask me first the topic and who it is for.', {}]],
88
+ study: [['book', 'I want to learn something new step by step: ask me what and how much I already know, and make me a plan for the week.', {}], ['list', 'Make me a study plan for this week with what I have to learn.', {}]],
89
+ notes: [['note', 'Help me put my ideas in order: I will paste them and you group them by topic in a document, with a title for each.', {}]],
90
+ code: [['code', 'I want to start an app. Ask me what it should do and who will use it, and propose the simplest first version we can build today.', {}], ['compose', 'Before writing anything, ask me what I want to build and propose a plan in steps.', {}]],
91
+ curious: [['spark', 'What could you do for me in an empty folder? Give me three ideas.', {}]],
92
+ };
93
+ const BORN_ANY = [['compose', 'I want to start a project here. Ask me three questions about what I want to achieve, and then propose the first three steps.', {}], ['spark', 'What could you do for me in an empty folder? Give me three ideas.', {}], ['compose', 'Before writing anything, ask me what I want to build and propose a plan in steps.', {}]];
94
+
95
+ // Round and round the groups, the first chip of each, then the second…, until there are `count`.
96
+ function weave(groups, count) {
97
+ const out = [];
98
+ const seen = new Set();
99
+ for (let round = 0; out.length < count && groups.some((group) => group.length > round); round += 1) {
100
+ for (const group of groups) {
101
+ const chip = group[round];
102
+ if (!chip || seen.has(chip[1]) || out.length >= count) continue;
103
+ seen.add(chip[1]);
104
+ out.push(chip);
105
+ }
106
+ }
107
+ return out;
108
+ }
109
+
110
+ // The chips: [{ icon, text, open }], `text` already in the room's language through `t`.
111
+ export function startersFor({ entries = [], profile = [], project = 'this project', t = (words, values = {}) => words.replace(/\{(\w+)\}/g, (_, key) => values[key] ?? `{${key}}`), count = 3 } = {}) {
112
+ const kinds = readFolder(entries);
113
+ const empty = !entries.some((entry) => !String(entry?.name ?? '').startsWith('.'));
114
+ let chosen;
115
+ if (empty) {
116
+ const own = profile.filter((id) => BORN[id]).map((id) => BORN[id]);
117
+ chosen = weave([...own, BORN_ANY], count);
118
+ } else {
119
+ // Code leads where there is code; the rest of what the folder holds follows, in this order.
120
+ const order = kinds.code.length ? ['code', 'sheets', 'docs', 'slides', 'images'] : ['sheets', 'docs', 'slides', 'web', 'images'];
121
+ const groups = order.filter((kind) => kinds[kind].length).map((kind) => GROUPS[kind](kinds[kind][0], project));
122
+ chosen = weave([...groups, ANY(project)], count);
123
+ }
124
+ return chosen.map(([icon, words, values]) => {
125
+ const text = t(words, values);
126
+ return { icon, text, open: text.endsWith(': ') };
127
+ });
128
+ }