@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/CHANGELOG.en.md CHANGED
@@ -4,7 +4,26 @@ Every published version of `@jossuealcala/madre`. Dates in ISO format.
4
4
 
5
5
  A version closes when it is on npm: until then its section is called **Unreleased** and it can keep growing. Each published version has exactly one `vX.Y.Z` tag, one GitHub release and one section here; the patch number can reach two digits (`0.2.10`) before the minor goes up. See `docs/ROADMAP.md` for the criteria on what bumps each number. This is the English translation of [CHANGELOG.md](CHANGELOG.md); the Spanish file is the original.
6
6
 
7
- ## 1.1.4 · Unreleased
7
+ ## 1.1.5 · Unreleased
8
+
9
+ ## 1.1.4 · 2026-11-19
10
+
11
+ - **MADRE is an app now (first beta).** For Mac, signed by Apple: it opens from your applications with no terminal, tells you when an AI finishes, brings its own browser (showing its size as you change the width, and the page's errors one click away) and its terminal, and updates from madre.run with your permission. Its icon turns light or dark with your system's theme. It is free for you under its personal license. If you use MADRE in the browser, after updating it asks whether you stay there or download the app; your projects come along as they are.
12
+ - **You see what changed in every answer.** Under every answer that touches your project, a card says in plain words what changed, with «View» and «Undo» (which asks first). What an AI makes, a page, an image, a PDF or a sheet, opens by itself beside the conversation.
13
+ - **Learn by doing.** First steps offers you five short things instead of a tour: make your first page, ask two AIs the same thing, undo a change, talk to your computer's AI and use something from the Market.
14
+ - **A clearer MADRE.** One emerald accent across the interface; «Before you start» says what MADRE is in three lines and in the opening; the welcome says why it looks at your computer; each answer's header is one line, with what it answers and what it used; notices open and close in one movement; Files keeps its keys fixed on top; and you can rename a project from Home without touching its folder.
15
+ - **Fixes from testing the app.** An AI with «Can create» can now start while another has full access; a panel coming back from a window returns beside the conversation; a double click on the window keys counts as one; Modules no longer overflows long names; and no more stray tips in the second chat.
16
+ - **What people's copies said.** Diagnostics now recognises and explains: Codex asking to sign in again because its token was already used, Cursor without a session, a Gemini model retired for new accounts, an AI's provider answering «Bad Gateway», OpenRouter with no provider that fits your data policy or no models that take tools, Codex unable to start its helper, and Grok on Linux without `bubblewrap`. When an AI ends without writing anything, MADRE says so with its card, and for OpenCode also why: the model only thought, kept using tools or ran out of room. An installer that cannot run says why instead of never answering, and if a project's folder disappears while it is open, its conversation keeps being saved.
17
+ - **Writing a module without guessing.** The SDK guide gives the whole shape of routes, of a card's link and of status, and the `hello` example uses them, working, so your AI no longer has to ask you to search MADRE's code. A route written as an expression starting with `^` is no longer refused when the module is installed, and a module you install answers only at its own addresses (`/api/x/<id>/`), never MADRE's.
18
+ - **Undo no longer leaves behind what an AI creates as its turn begins.** On Linux, a file written in the first milliseconds of the turn, in a folder git ignores, could fall out of the list of what was created and of Undo.
19
+ - **Answers read better.** If an AI gives you a table, you sort it with a click on the header. Code comes with its file name and a button to copy it. Charts and diagrams are drawn right there, and a list of links turns into cards with title and price. The jumping around while an answer comes in is gone too, and a plan now reads step by step.
20
+ - **Images with the keys you already have.** The Images module draws with Gemini, OpenAI or Grok. It finds your key where your AIs already keep it, so it doesn't ask you for it.
21
+ - **Pick how your code looks.** Appearance has three styles for the terminal and the editor: Coldbrew, Oldcode and Simple, each in light and dark. Coldbrew is the house style, emerald green on almost black.
22
+ - **MADRE talks to you more clearly.** Almost a thousand sentences changed. It now says «your AIs» instead of «agents», explains permissions the way a person would and calls memory memory. While we were at it, the memory map draws each memory as a planet, and Settings fits any window size.
23
+ - **@madre doesn't get fooled anymore.** If something it quotes carries a hidden order, it no longer follows it. It sometimes answered just «Noted» because it copied it from a quote, and «room» slipped into its Spanish. Not anymore. Opening a new conversation no longer waits for the last one to finish its summary, and when Diagnostics flags something, your AIs no longer all start answering at once.
24
+ - **Small fixes you'll notice.** Reminders understands exact dates: «November 16 at 10:30» is now the 16th, not today. You can send a message of up to 1 MB, like a whole log pasted in. The access key is no longer written in logs other people on your computer can read. And if Ollama doesn't answer when you open a project, MADRE tries again on its own.
25
+ - **The app is ready for its subscription.** It isn't switched on yet, so today the app is still free. Once it is, you get 30 days free with everything, no card needed. After that it's MXN 109 a month, VAT included. If you decide not to subscribe, MADRE keeps working for free with one active project at a time, and nothing of yours is deleted. A subscription works on up to two computers. On the second one you type the email you paid with, a button arrives and that's it, nothing to copy or paste.
26
+ - **It asks if you like it once you've really used it.** The prompt to leave a review comes after 30 minutes with your AIs working, not just for having the window open. From the app it takes you to write a review. If you installed with npm, it invites you to star it on GitHub, since npm has no reviews.
8
27
 
9
28
  ## 1.1.3 · 2026-11-09
10
29
 
package/CHANGELOG.md CHANGED
@@ -4,7 +4,26 @@ Todas las versiones publicadas de `@jossuealcala/madre`. Fechas en ISO.
4
4
 
5
5
  Una versión se cierra cuando está en npm: hasta entonces su sección se llama **Sin publicar** y puede crecer. Cada versión publicada tiene exactamente una etiqueta `vX.Y.Z`, una release en GitHub y una sección aquí; el parche puede llegar a dos dígitos (`0.2.10`) antes de subir el menor. Ver `docs/ROADMAP.md` para el criterio de qué sube cada número.
6
6
 
7
- ## 1.1.4 · Sin publicar
7
+ ## 1.1.5 · Sin publicar
8
+
9
+ ## 1.1.4 · 2026-11-19
10
+
11
+ - **MADRE ya es una app (primera beta).** Para Mac, firmada por Apple: se abre desde tus aplicaciones sin terminal, te avisa cuando una IA termina, trae su propio navegador (con sus medidas al cambiar el ancho y los errores de la página a un clic) y su terminal, y se actualiza desde madre.run con tu permiso. Su ícono cambia a claro u oscuro con el tema de tu sistema. Es gratis para ti con su licencia personal. Si usas MADRE en el navegador, después de actualizar te pregunta si te quedas ahí o bajas la app; tus proyectos llegan tal como están.
12
+ - **Ves qué cambió en cada respuesta.** Bajo cada respuesta que toca tu proyecto, una tarjeta dice en palabras simples qué cambió, con «Ver» y «Deshacer» (que pregunta antes). Lo que una IA crea, una página, una imagen, un PDF o una hoja, se abre solo al lado de la conversación.
13
+ - **Aprende haciendo.** Primeros pasos te propone cinco cosas cortas en vez de un recorrido: crea tu primera página, pregúntale lo mismo a dos IAs, deshaz un cambio, habla con la IA de tu computadora y usa algo del Mercado.
14
+ - **Una MADRE más clara.** Un solo acento esmeralda en toda la interfaz; «Antes de empezar» explica qué es MADRE en tres líneas y en la entrada; la bienvenida dice para qué revisa tu computadora; la cabecera de cada respuesta va en una línea, con a qué responde y lo que gastó; los avisos se abren y cierran en un solo movimiento; Archivos deja sus botones fijos arriba; y puedes renombrar un proyecto desde Inicio sin tocar su carpeta.
15
+ - **Arreglos de la prueba en la app.** Una IA con «Puede crear» ya puede empezar mientras otra tiene acceso total; el panel que vuelve de ventana regresa al lado de la conversación; un doble clic en los botones de ventana cuenta como uno; Módulos ya no desborda nombres largos; y se acabaron los globos sueltos en el segundo chat.
16
+ - **Lo que dijeron las copias de la gente.** Diagnóstico ya reconoce y explica: Codex que pide volver a iniciar sesión porque su token ya se usó, Cursor sin sesión, un modelo de Gemini retirado para cuentas nuevas, el proveedor de una IA que contesta «Bad Gateway», OpenRouter sin proveedor que cumpla tu política de datos o sin modelos que acepten herramientas, Codex que no pudo arrancar su ayudante y Grok en Linux sin `bubblewrap`. Cuando una IA termina sin escribir nada, MADRE lo dice con su ficha, y en OpenCode también por qué: si el modelo solo pensó, se quedó usando herramientas o se quedó sin espacio. Un instalador que no se puede ejecutar dice por qué en vez de quedarse sin contestar, y si la carpeta de un proyecto desaparece mientras está abierto, su conversación se sigue guardando.
17
+ - **Escribir un módulo sin adivinar.** La guía del SDK trae completas las formas de las rutas, del enlace de una tarjeta y del estado, y el ejemplo `hello` las usa funcionando, así que tu IA ya no tiene que pedirte que busques en el código de MADRE. Una ruta escrita como expresión que empieza con `^` ya no se rechaza al instalar el módulo, y un módulo que instalas solo contesta en sus propias direcciones (`/api/x/<id>/`), nunca en las de MADRE.
18
+ - **Deshacer no deja atrás lo que una IA crea al empezar su turno.** En Linux, un archivo escrito en los primeros milisegundos del turno, en una carpeta que git ignora, podía quedar fuera de la lista de lo creado y de Deshacer.
19
+ - **Las respuestas se leen mejor.** Si una IA te da una tabla, la ordenas con un clic en el encabezado. El código llega con el nombre de su archivo y un botón para copiarlo. Las gráficas y los diagramas se dibujan ahí mismo, y una lista de enlaces se vuelve tarjetas con título y precio. También se acabaron los brincos mientras llega una respuesta, y un plan ya se lee paso a paso.
20
+ - **Imágenes con las llaves que ya tienes.** El módulo Imágenes dibuja con Gemini, OpenAI o Grok. Encuentra tu llave donde tus IAs ya la guardan, así que no te la pide.
21
+ - **Elige cómo se ve tu código.** En Apariencia hay tres estilos para la terminal y el editor: Coldbrew, Oldcode y Simple, cada uno en claro y en oscuro. Coldbrew es el de la casa, verde esmeralda sobre casi negro.
22
+ - **MADRE te habla más claro.** Cambiaron casi mil frases. Ahora dice «tus IAs» y no «agentes», explica los permisos como lo haría una persona y a la memoria le dice memoria. De paso, el Mapa de memoria dibuja cada recuerdo como un planeta, y Ajustes se acomoda a cualquier tamaño de ventana.
23
+ - **@madre ya no se deja engañar.** Si algo que cita trae una orden escondida, ya no la sigue. A veces contestaba solo «Anotado» porque lo copiaba de una cita, y se le colaba «room» en español. Ya no. Abrir una conversación nueva ya no espera a que la anterior termine su resumen, y cuando Diagnóstico avisa algo, tus IAs ya no se ponen a contestar todas a la vez.
24
+ - **Arreglos chicos que se notan.** Recordatorios entiende fechas exactas: «16 de noviembre a las 10:30» ya es el 16 y no hoy. Puedes mandar un mensaje de hasta 1 MB, como un registro pegado completo. La llave de acceso ya no queda escrita en registros que otras personas de tu computadora pueden leer. Y si Ollama no responde cuando abres un proyecto, MADRE vuelve a intentarlo sola.
25
+ - **La app ya está lista para su suscripción.** Todavía no se activa, así que hoy la app sigue gratis. Cuando se active, tendrás 30 días gratis con todo, sin dar tarjeta. Después cuesta $109 MXN al mes, con IVA incluido. Si decides no suscribirte, MADRE sigue funcionando gratis con un proyecto activo a la vez y no se borra nada tuyo. Una suscripción sirve en hasta dos computadoras. En la segunda escribes el correo con el que pagaste, te llega un botón y listo, sin copiar ni pegar nada.
26
+ - **Te pregunta si te gusta cuando ya la usaste de verdad.** El aviso para dejar una reseña sale después de 30 minutos con tus IAs trabajando, no por tener la ventana abierta. Desde la app te lleva a escribir una reseña. Si instalaste con npm, te invita a darle una estrella en GitHub, porque npm no tiene reseñas.
8
27
 
9
28
  ## 1.1.3 · 2026-11-09
10
29
 
package/TRADEMARKS.md CHANGED
@@ -49,7 +49,9 @@ GitHub, Stripe y los demás— son marcas de sus dueños. MADRE los muestra solo
49
49
  servicio se conecta cada conector (uso nominativo), no porque esos dueños respalden a MADRE ni
50
50
  tengan relación con ella. Los dibujos vienen de [Simple Icons](https://simpleicons.org) (CC0 1.0)
51
51
  con sus colores oficiales; los que Simple Icons no dibuja, de CoreUI Brands y SVG Logos (CC0 1.0) y
52
- de VSCode Icons (MIT). Si
52
+ de VSCode Icons (MIT). Los logos de los proveedores de OpenCode (Anthropic, OpenAI, Google, Groq y
53
+ los demás) y los de los agentes vienen de [Lobe Icons](https://lobehub.com/icons) (MIT), en su
54
+ versión de un solo color y sin alterar, solo para decir de qué proveedor es cada llave. Si
53
55
  eres dueño de una de esas marcas y prefieres que no aparezca, escribe y se quita.
54
56
 
55
57
  ## Si tienes duda
@@ -92,7 +94,9 @@ tools (MCP) — Notion, GitHub, Stripe and the rest — are their owners' tradem
92
94
  only to say which service a connector reaches (nominative use), not because their owners endorse
93
95
  or are affiliated with MADRE. The drawings come from [Simple Icons](https://simpleicons.org)
94
96
  (CC0 1.0) with their official colors; the ones Simple Icons does not draw, from CoreUI Brands and
95
- SVG Logos (CC0 1.0) and VSCode Icons (MIT). If
97
+ SVG Logos (CC0 1.0) and VSCode Icons (MIT). The logos of OpenCode's providers (Anthropic, OpenAI,
98
+ Google, Groq and the rest) and of the agents come from [Lobe Icons](https://lobehub.com/icons) (MIT),
99
+ in their one-colour version and unaltered, only to say which provider each key is for. If
96
100
  you own one of those marks and would rather it not appear, write and it is taken off.
97
101
 
98
102
  In doubt, contact Jossue Alcalá at [jossuealcala.com](https://jossuealcala.com) before publishing.
package/bin/madre.mjs CHANGED
@@ -15,7 +15,7 @@ import { isOnline, runSetup } from '../src/setup.mjs';
15
15
  import { parseArgs } from '../src/cli-args.mjs';
16
16
  import { choosePort, ensureSalasProject, isSalasRoom, keptPorts, projectRootFor } from '../src/salas.mjs';
17
17
  import { forgetNpxLaunch } from '../src/npm-launch.mjs';
18
- import { fichaHeaders, readFicha, withFicha } from '../src/ficha.mjs';
18
+ import { fichaHeaders, fichaShown, readFicha, withFicha, withoutFicha } from '../src/ficha.mjs';
19
19
  import { createServer } from 'node:net';
20
20
 
21
21
  // Before anything is run: what npx left about the call that started MADRE is not passed on to the
@@ -67,7 +67,9 @@ const option = (name, fallback) => cli.option(name.replace(/^--/, ''), fallback)
67
67
  // opened unless --no-open.
68
68
  async function showOpen(url, { openBrowser = true, openPath = '' } = {}) {
69
69
  const address = withFicha(`${url}${openPath}`, await readFicha(salasHome));
70
- console.log(`\n${t('MADRE is already open for this project')}\n\n ${address}\n ${t('Project:')} ${projectRoot}\n ${t('Close that room first if you want a fresh one.')}\n`);
70
+ // The key only where a person or the app reads it (L-15, src/ficha.mjs).
71
+ const shown = fichaShown() ? address : withoutFicha(address);
72
+ console.log(`\n${t('MADRE is already open for this project')}\n\n ${shown}\n ${t('Project:')} ${projectRoot}\n ${t('Close that room first if you want a fresh one.')}\n`);
71
73
  if (openBrowser) await openUrl(address);
72
74
  }
73
75
 
package/docs/REFERENCE.md CHANGED
@@ -118,9 +118,9 @@ Cada mensaje sale con un modo. Tu modo es el techo de cualquier plan que ese men
118
118
  | **OpenCode** | sí | `-f` | permisos `edit` por patrón | sí, con **Imágenes** | webfetch / websearch |
119
119
  | **@madre** | la memoria | no | no | no | no |
120
120
 
121
- **Imágenes** es un módulo de MADRE: un servidor MCP propio que expone `generate_image` sobre los modelos de imagen de la API de Gemini, con tu propia key y tus créditos. Hoy **solo Gemini**, y por una razón: es la única cuenta de los agentes cuya llave MADRE ya encuentra sin pedirte una nueva, y tiene capa gratis. Anthropic no genera imágenes —Claude las lee, no las hace—, la cuenta de ChatGPT con la que se firma Codex no da acceso a la API de imágenes, y OpenCode depende del proveedor al que lo apuntes. Se conecta a Claude, Gemini y OpenCode solo dentro de un permiso CREAR con el alcance de imágenes encendido, en sus homes aislados, y la imagen cae en la carpeta del turno como cualquier artefacto. `/image <petición>` arma el permiso y enruta al agente que puede generar. Con los cuatro agentes puedes pedir una imagen; Codex la hace con lo suyo, los demás con Imágenes.
121
+ **Imágenes** es un módulo de MADRE: un servidor MCP propio que expone `generate_image` sobre el modelo de imágenes que elijas en Módulos › Imágenes —Gemini (Google), GPT Image (OpenAI) o Grok Imagine (xAI)—, con tu propia llave y tu saldo; todos cobran cada imagen, ninguno tiene nivel gratis para imágenes. La página del módulo, «Con qué dibuja», muestra lo que ya tienes sin preguntarte: la llave de Gemini que usa Gemini CLI (`~/.gemini/.env` o el llavero), las de OpenAI, xAI o Google que usa OpenCode (su `auth.json`), la de OpenAI con la que entró Codex, y `GEMINI_API_KEY`, `OPENAI_API_KEY` o `XAI_API_KEY` si MADRE se abrió con ellas. Lo que no tienes aparece con qué es, dónde se consigue la llave y un campo para pegarla: la de Gemini se guarda donde la lee Gemini CLI; la de OpenAI o xAI, en la bóveda de MADRE (`~/.pulse/credentials/image-studio.json`, `0600`), después de preguntarle al proveedor si la acepta (lista modelos, no gasta saldo). Mientras no elijas, dibuja el primero cuya llave encuentre. El servidor lee la llave él mismo al dibujar: no viaja en su entorno, que en Claude Code va en los argumentos. Ollama dibujó un tiempo solo en Mac y hoy no lo hace, así que no se ofrece. Se conecta a Claude, Gemini y OpenCode solo dentro de un permiso CREAR con el alcance de imágenes encendido, en sus homes aislados, y la imagen cae en la carpeta del turno como cualquier artefacto. `/image <petición>` arma el permiso y enruta al agente que puede generar. Codex y Grok dibujan con su propia cuenta; los demás, con Imágenes.
122
122
 
123
- El acceso web es un permiso permanente por agente, apagado por defecto, que se enciende en Ajustes → Agentes, con Acceso a la web.
123
+ El acceso web es un permiso permanente por agente, encendido por defecto, que se apaga en Ajustes → Agentes, con Acceso a la web.
124
124
 
125
125
  ### Subagentes de cada IA
126
126
 
@@ -225,7 +225,7 @@ El botón de la barra abre la pantalla de diagnóstico. Escribe un síntoma, un
225
225
  | Módulo | Qué añade |
226
226
  |---|---|
227
227
  | **Git** | `/git status`, `/git log [n]`, `/git diff`, `/git branches`: hechos del repositorio como tarjeta en el hilo, que los agentes también leen. `/git commit "mensaje"` y `/git push confirm`: tu mano sobre el repositorio, con vista previa de lo que saldría |
228
- | **Imágenes** | `generate_image` para Claude, Gemini y OpenCode, con tu key de Gemini, dentro de CREAR |
228
+ | **Imágenes** | `generate_image` para Claude, Gemini y OpenCode, con tu llave de Gemini, OpenAI o xAI, dentro de CREAR |
229
229
  | **Vista previa** | El visor renderiza HTML, SVG y Markdown en un marco sellado, con recarga automática |
230
230
  | **IA local** | Búsqueda inteligente, archivista y `@madre` en local, gratis y sin cuenta. Se instala, se despierta y descarga su modelo desde Conecta tus agentes |
231
231
  | **Navegador de pruebas** | Un navegador headless en los turnos que piden ver, probar o capturar una página. Solo alcanza esta MADRE y los servidores que arrancaste desde COMANDOS: abrir la Vista previa o la app servida, hacer clic, leer consola, capturas al borrador del turno. Al encenderlo, MADRE comprueba que el servidor arranque con su navegador. Requiere `@playwright/mcp` |
package/docs/SDK.md CHANGED
@@ -54,7 +54,7 @@ export default ({ defineModule }) => defineModule({
54
54
 
55
55
  ## Lo que un módulo puede declarar
56
56
 
57
- Esta tabla es **el contrato completo**: 41 campos, ni uno más. Cualquier otro que escribas MADRE
57
+ Esta tabla es **el contrato completo**: 42 campos, ni uno más. Cualquier otro que escribas MADRE
58
58
  te lo dice al instalar («no entendí estos campos») en vez de ignorarlo en silencio. Una prueba de
59
59
  la suite compara esta tabla contra el código, así que si alguna vez se separan, es un fallo.
60
60
 
@@ -75,6 +75,7 @@ la suite compara esta tabla contra el código, así que si alguna vez se separan
75
75
  | `ready(ctx)` | Lo que pides antes de encender, en un proyecto o en todos (desde el Mercado también): `null` si está listo, `{ status, body: { error } }` si no. Apagar nunca lo pregunta |
76
76
  | `footer` | Hasta dos teclas junto a la versión de MADRE, abajo a la derecha, mientras tu módulo está encendido: `[{ icon: 'heart' \| 'star' \| 'link', label, text, action, url }]`. Los textos pueden ser una frase o `{ es, en }`; `url` tiene que ser https y se abre en otra pestaña. MADRE la dibuja: al pasar el ratón muestra `text` y un botón con `action` |
77
77
  | `credit` | De quién fue la idea, si no fue tuya: un nombre. MADRE lo dice en la ficha del módulo y en el Mercado («Idea de …») |
78
+ | `notifies` | Su permiso para avisar por las notificaciones del sistema: `{ label, note }`, qué avisa y cuándo (por ejemplo, Recordatorios: «Vence un recordatorio»). Un módulo nunca toca macOS ni el navegador: MADRE lo lista en Ajustes › Notificaciones con su interruptor y es quien manda el aviso, si la persona lo deja |
78
79
  | `icon` | El ícono de tu módulo: `{ svg, color }`. `svg` es el dibujo —sus formas (`<path d="…"/>`) o un `<svg>` entero, en la cuadrícula que quieras— y `color` el de su mosaico, `#rrggbb`. MADRE lo ajusta solo para que se vea como los suyos: lo centra y lo escala al mismo cuadro, lo pinta en blanco y de un solo color, usa el color de MADRE más parecido al tuyo y quita lo que no sea dibujo (scripts, imágenes, enlaces, estilos, degradados). Sin `icon`, tu módulo lleva la pieza de rompecabezas en gris. Hasta 8000 caracteres |
79
80
  | `slash` | Comandos `/nombre` que corren en el servidor con tu `ctx` y devuelven `{ ok, title, text, link }`. La sala los muestra como tarjeta y los agentes los leen. `link` es opcional: `{ href, label }` con una ruta tuya (`/api/x/<id>/…`), y la tarjeta la ofrece como botón que abre otra pestaña; una dirección fuera de tus rutas se ignora |
80
81
  | `toolsForTurn(ctx, turn)` | Servidores MCP para el turno de un agente: `[{ name, command, args, env, tools, sends, brief }]`. Para un módulo tuyo, `command` debe ser Node y el primer argumento debe ser **el mismo archivo del módulo**; MADRE lo arranca con el mismo cerco de permisos. Un ejecutable diferente no se ofrece al agente. `turn` trae el agente, el modo, el arriendo, la carpeta, el puerto y `turn.turn`: el id de la respuesta que ese turno escribirá |
@@ -96,6 +97,32 @@ la suite compara esta tabla contra el código, así que si alguna vez se separan
96
97
  | `preflight(ctx)`, `detect(ctx)`, `installCommand(ctx)` | **Herencia**, de cuando un módulo solo podía ser un instalador. Siguen funcionando; para algo nuevo, devuelve `preflight` desde `status(ctx)` como arriba |
97
98
  | `describe(ctx)` | Lo arma MADRE con todo lo anterior. **No lo declares**: está en la lista porque el objeto lo lleva, no porque tengas que escribirlo |
98
99
 
100
+ ### Rutas, enlace y estado, exactos
101
+
102
+ Las tres formas que un agente no debe adivinar, tal como MADRE las lee. `docs/sdk/hello-module.mjs` las trae funcionando.
103
+
104
+ **Rutas.** Cada una es `{ method, path, handler }`. `path` es la dirección completa y vive siempre debajo de `/api/x/<id>/`: un texto, que se compara exacto, o una expresión regular (puede empezar con `^`), cuyas capturas llegan en `params` como lista, en orden. Un módulo que instalas solo contesta debajo de su `/api/x/<id>/`, diga lo que diga su expresión.
105
+
106
+ ```js
107
+ routes: [
108
+ { method: 'GET', path: '/api/x/informe/hoy', async handler(ctx) { return { status: 200, body: { ok: true } }; } },
109
+ { method: 'GET', path: /^\/api\/x\/informe\/dia\/(\d{4}-\d{2}-\d{2})$/, async handler(ctx, { params }) {
110
+ const [dia] = params;
111
+ return { status: 200, html: `<!doctype html><meta charset="utf-8"><h1>Informe del ${dia}</h1>` };
112
+ } },
113
+ ],
114
+ ```
115
+
116
+ El segundo argumento del `handler` es `{ payload, params, url, request, viaPhone }`. `payload` es el cuerpo JSON de un `POST` (`{}` en lo demás), `url` un `URL`, `request` solo `{ method, headers }` y `viaPhone` es `true` si llega desde un teléfono enlazado. Se responde `{ status, body }` para JSON o `{ status, html }` para una página.
117
+
118
+ **El enlace de una tarjeta.** Un comando de `slash` devuelve `{ ok, title, text, link }`. `link` es opcional: `{ href, label }`, donde `href` es una ruta tuya (empieza con `/api/x/<id>/`, sin espacios ni comillas, hasta 400 caracteres) y `label` se corta en 80. La tarjeta lo ofrece como botón que abre otra pestaña, ya con la ficha de MADRE; un enlace a otro lado se ignora sin avisar.
119
+
120
+ ```js
121
+ return { ok: true, title: 'Informe', text: `Listo el informe del ${dia}.`, link: { href: `/api/x/informe/dia/${dia}`, label: 'Abrir el informe' } };
122
+ ```
123
+
124
+ **El estado.** `status(ctx)` devuelve `{ status: { installed, detail } }`; `detail` es la frase junto a «Activo». Opcionales: `preflight: { ok, problems: [] }` (lo que falta antes de usarlo, en frases), `install: { display }` y `runs: [{ name, version, target }]` si envuelve un programa de fuera.
125
+
99
126
  ### ¿Se puede conectar con *X*?
100
127
 
101
128
  No depende de MADRE. Un módulo puede hacer lo que pueda hacer un proceso de Node en tu
@@ -118,7 +118,7 @@ Every message goes out with a mode. Your mode is the ceiling of any plan that me
118
118
  | **OpenCode** | yes | `-f` | per-pattern `edit` permissions | yes, with **Images** | webfetch / websearch |
119
119
  | **@madre** | the memory | no | no | no | no |
120
120
 
121
- **Images** is a MADRE module: its own MCP server that exposes `generate_image` on top of the Gemini API's image models, with your own key and your credits. Today **only Gemini**, and for a reason: it is the only agent account whose key MADRE already finds without asking you for a new one, and it has a free tier. Anthropic does not generate images —Claude reads them, it does not make them—, the ChatGPT account Codex signs in with does not give access to the images API, and OpenCode depends on the provider you point it at. It is connected to Claude, Gemini and OpenCode only inside a CREATE permission with the image scope turned on, in their isolated homes, and the image lands in the turn's folder like any artifact. `/image <petición>` sets up the permission and routes to the agent that can generate. With all four agents you can ask for an image; Codex makes it with its own tools, the others with Images.
121
+ **Images** is a MADRE module: its own MCP server that exposes `generate_image` on top of the image model you choose in Modules › Images —Gemini (Google), GPT Image (OpenAI) or Grok Imagine (xAI)—, with your own key and your credit; all of them charge each image, none has a free tier for images. The module's page, «With what it draws», shows what you already have without asking: the Gemini key Gemini CLI uses (`~/.gemini/.env` or the keychain), the OpenAI, xAI or Google keys OpenCode uses (its `auth.json`), the OpenAI key Codex signed in with, and `GEMINI_API_KEY`, `OPENAI_API_KEY` or `XAI_API_KEY` if MADRE was opened with them. What you do not have appears with what it is, where the key is made and a field to paste it: a Gemini key is kept where Gemini CLI reads it; an OpenAI or xAI key in MADRE's vault (`~/.pulse/credentials/image-studio.json`, `0600`), after the provider is asked whether it takes it (it lists models and spends no credit). Until you choose, the first provider whose key is found draws. The server reads the key itself when it draws: it does not travel in its environment, which Claude Code receives in its arguments. Ollama drew for a while, on the Mac only, and does not today, so it is not offered. It is connected to Claude, Gemini and OpenCode only inside a CREATE permission with the image scope turned on, in their isolated homes, and the image lands in the turn's folder like any artifact. `/image <petición>` sets up the permission and routes to the agent that can generate. Codex and Grok draw with their own account; the others, with Images.
122
122
 
123
123
  Web access is a permanent per-agent permission, off by default, turned on in Settings → Agents, with Web access.
124
124
 
@@ -225,7 +225,7 @@ The button in the bar opens the diagnostics screen. Type a symptom, an agent or
225
225
  | Module | What it adds |
226
226
  |---|---|
227
227
  | **Git** | `/git status`, `/git log [n]`, `/git diff`, `/git branches`: facts about the repository as a card in the thread, which the agents also read. `/git commit "mensaje"` and `/git push confirm`: your hand on the repository, with a preview of what would go out |
228
- | **Images** | `generate_image` for Claude, Gemini and OpenCode, with your Gemini key, inside CREATE |
228
+ | **Images** | `generate_image` for Claude, Gemini and OpenCode, with your Gemini, OpenAI or xAI key, inside CREATE |
229
229
  | **Preview** | The viewer renders HTML, SVG and Markdown in a sealed frame, with automatic reload |
230
230
  | **Local AI** | Smart search, archivist and `@madre` locally, free and without an account. It is installed, woken up and downloads its model from Connect your agents |
231
231
  | **Test browser** | A headless browser in turns that ask to see, test or capture a page. It only reaches this MADRE and the servers you started from COMMANDS: open the Preview or the served app, click, read the console, screenshots to the turn's scratch area. When you turn it on, MADRE checks that the server starts with its browser. Requires `@playwright/mcp` |
package/docs/en/SDK.md CHANGED
@@ -96,6 +96,32 @@ the suite compares this table against the code, so if they ever drift apart, it'
96
96
  | `preflight(ctx)`, `detect(ctx)`, `installCommand(ctx)` | **Legacy**, from when a module could only be an installer. They still work; for something new, return `preflight` from `status(ctx)` as above |
97
97
  | `describe(ctx)` | MADRE builds it from everything above. **Don't declare it**: it is on the list because the object carries it, not because you have to write it |
98
98
 
99
+ ### Routes, link and status, exactly
100
+
101
+ The three shapes an agent must not guess, as MADRE reads them. `docs/sdk/hello-module.mjs` has them working.
102
+
103
+ **Routes.** Each is `{ method, path, handler }`. `path` is the whole address and always lives under `/api/x/<id>/`: a string, matched exactly, or a regular expression (it may start with `^`), whose captures arrive in `params` as a list, in order. A module you install only answers under its `/api/x/<id>/`, whatever its expression says.
104
+
105
+ ```js
106
+ routes: [
107
+ { method: 'GET', path: '/api/x/report/today', async handler(ctx) { return { status: 200, body: { ok: true } }; } },
108
+ { method: 'GET', path: /^\/api\/x\/report\/day\/(\d{4}-\d{2}-\d{2})$/, async handler(ctx, { params }) {
109
+ const [day] = params;
110
+ return { status: 200, html: `<!doctype html><meta charset="utf-8"><h1>Report for ${day}</h1>` };
111
+ } },
112
+ ],
113
+ ```
114
+
115
+ The handler's second argument is `{ payload, params, url, request, viaPhone }`. `payload` is the JSON body of a `POST` (`{}` otherwise), `url` a `URL`, `request` only `{ method, headers }`, and `viaPhone` is `true` when it comes from a paired phone. Answer `{ status, body }` for JSON or `{ status, html }` for a page.
116
+
117
+ **A card's link.** A `slash` command returns `{ ok, title, text, link }`. `link` is optional: `{ href, label }`, where `href` is a route of yours (it starts with `/api/x/<id>/`, no spaces or quotes, up to 400 characters) and `label` is cut at 80. The card offers it as a key that opens another tab, already with MADRE's ficha; a link anywhere else is dropped without a word.
118
+
119
+ ```js
120
+ return { ok: true, title: 'Report', text: `The report for ${day} is ready.`, link: { href: `/api/x/report/day/${day}`, label: 'Open the report' } };
121
+ ```
122
+
123
+ **Status.** `status(ctx)` returns `{ status: { installed, detail } }`; `detail` is the line beside «On». Optional: `preflight: { ok, problems: [] }` (what is missing before it can be used, in sentences), `install: { display }`, and `runs: [{ name, version, target }]` if it wraps an outside program.
124
+
99
125
  ### Can it connect to *X*?
100
126
 
101
127
  That doesn't depend on MADRE. A module can do whatever a Node process can do on your
@@ -20,7 +20,7 @@ export default {
20
20
  name: 'HELLO', // how MODULES shows it
21
21
  vendor: 'you', // a person, a team, a company
22
22
  version: '0.1.0',
23
- summary: 'Greets the room from the composer. The smallest possible module: a switch, one setting, one slash command.',
23
+ summary: 'Greets the room from the composer. A small module with everything in its place: a switch, one setting, one slash command with its link, and two routes.',
24
24
  creates: ['nothing in the project'],
25
25
  requires: [],
26
26
  settings: { enabled: false, greeting: 'hola' }, // defaults; the human changes them in config.json
@@ -28,7 +28,9 @@ export default {
28
28
  // nearest of its own tile colors, so draw it on any grid and do not worry about its size.
29
29
  icon: { svg: '<path d="M4 10.5c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6H4z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>', color: '#0f766e' },
30
30
 
31
- // What MODULES shows for this module. ctx.settings already has the defaults applied.
31
+ // What MODULES shows for this module. ctx.settings already has the defaults applied. The whole
32
+ // shape: { status: { installed, detail }, preflight: { ok, problems }, install: { display },
33
+ // runs: [{ name, version, target }] }; only `status` is needed, `detail` is the line beside «On».
32
34
  async status(ctx) {
33
35
  return { status: { installed: Boolean(ctx.settings.enabled), detail: ctx.settings.enabled ? `on · says "${ctx.settings.greeting}"` : 'off' } };
34
36
  },
@@ -40,9 +42,42 @@ export default {
40
42
  name: 'hello',
41
43
  usage: '/hello [name]',
42
44
  summary: 'Greets someone in the room.',
45
+ // The answer: { ok, title, text, link }. `link` is optional: { href, label }, where href is one
46
+ // of this module's own routes (/api/x/<id>/…, no spaces or quotes, up to 400 characters) and
47
+ // label is cut at 80. The card offers it as a key that opens another tab, already with MADRE's
48
+ // ficha. A link anywhere else is dropped without a word.
43
49
  async execute(ctx, args) {
44
50
  const who = args[0] ?? 'crew';
45
- return { ok: true, title: 'HELLO', text: `${ctx.settings.greeting}, ${who}. Project: ${ctx.projectRoot.split('/').pop()}. Agents online: ${ctx.agents.filter((agent) => agent.ready).map((agent) => `@${agent.id}`).join(', ') || 'none'}.` };
51
+ const page = /^[a-z0-9-]{1,40}$/i.test(who) ? who.toLowerCase() : 'crew';
52
+ return {
53
+ ok: true,
54
+ title: 'HELLO',
55
+ text: `${ctx.settings.greeting}, ${who}. Project: ${ctx.projectRoot.split('/').pop()}. Agents online: ${ctx.agents.filter((agent) => agent.ready).map((agent) => `@${agent.id}`).join(', ') || 'none'}.`,
56
+ link: { href: `/api/x/hello/card/${page}`, label: 'Open the greeting' },
57
+ };
58
+ },
59
+ },
60
+ ],
61
+
62
+ // Routes of its own: { method, path, handler(ctx, { payload, params, url, request, viaPhone }) }.
63
+ // `path` is the whole address and always lives under /api/x/<id>/: a string, matched exactly, or a
64
+ // pattern, whose captures arrive in `params` as a list, in order. `payload` is the JSON body of a
65
+ // POST ({} otherwise), `url` a URL, `request` only { method, headers }, `viaPhone` true when it comes
66
+ // from a paired phone. Answer { status, body } for JSON or { status, html } for a page.
67
+ routes: [
68
+ {
69
+ method: 'GET',
70
+ path: '/api/x/hello/greeting',
71
+ async handler(ctx) {
72
+ return { status: 200, body: { greeting: ctx.settings.greeting } };
73
+ },
74
+ },
75
+ {
76
+ method: 'GET',
77
+ path: /^\/api\/x\/hello\/card\/([a-z0-9-]{1,40})$/,
78
+ async handler(ctx, { params }) {
79
+ const [who] = params;
80
+ return { status: 200, html: `<!doctype html><meta charset="utf-8"><title>HELLO</title><p>${ctx.settings.greeting}, ${who}.</p>` };
46
81
  },
47
82
  },
48
83
  ],
@@ -0,0 +1,19 @@
1
+ ---
2
+ id: explicamelo-facil
3
+ name: { es: "Explícamelo fácil", en: "Explain it simply" }
4
+ line: { es: "Te explica cualquier cosa con palabras de todos los días, sin tecnicismos.", en: "Explains anything in everyday words, without jargon." }
5
+ icon: help
6
+ when: { es: "La persona no entiende algo y pide que se lo expliquen: explícame, explícamelo, explica, explicación, entiendo, entiende, entender, significa, significado, ¿qué es?, ¿cómo funciona?, ¿para qué sirve?, soy nueva, soy nuevo, principiante, no sé programar. Solo para explicar.", en: "The person does not understand something and asks for an explanation: explain, explanation, understand, means, meaning, what is it, how does it work, what is it for, beginner, new to this, cannot code. Only to explain." }
7
+ version: 1.0.0
8
+ minMadre: 1.1.4
9
+ ---
10
+
11
+ Quien pregunta está empezando: no programa y apenas conoce la IA. Explícale como a una persona lista que no es del tema.
12
+
13
+ - Contesta en su idioma, con palabras de todos los días. Si tienes que usar una palabra técnica, dila una vez y explícala en la misma oración: «el repositorio, que es la carpeta del proyecto con su historial».
14
+ - Empieza por lo que le sirve: qué es y para qué le importa, en una o dos líneas. Los detalles van después y solo si ayudan.
15
+ - Usa una comparación de la vida diaria cuando aclare (una receta, una tienda, una libreta), nunca más de una.
16
+ - Si hay pasos, numéralos y que cada paso sea una sola acción.
17
+ - Muestra un ejemplo real del proyecto en lugar de uno inventado cuando lo tengas a la mano.
18
+ - No le pidas que abra la terminal ni que escriba comandos: si algo hay que correr, dilo y ofrécete a hacerlo tú cuando el modo lo permita.
19
+ - Termina con una sola pregunta corta para saber si quedó claro o qué quiere hacer después.
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: hojas-de-calculo
3
+ name: { es: "Tablas y hojas de cálculo", en: "Tables and spreadsheets" }
4
+ line: { es: "Ordena tus hojas de cálculo, saca totales y te explica las fórmulas.", en: "Tidies your spreadsheets, gets totals and explains the formulas." }
5
+ icon: bars
6
+ when: { es: "La persona trabaja con una hoja de cálculo, excel, csv, tabla, columnas, fórmula, fórmulas, total, totales, suma, sumar, promedio, gastos, ventas, inventario, reporte o control de números.", en: "The person works with a spreadsheet, excel, csv, table, columns, formula, formulas, total, totals, sum, average, expenses, sales, stock, inventory, report or tracking numbers." }
7
+ version: 1.0.0
8
+ minMadre: 1.1.4
9
+ ---
10
+
11
+ Quien pregunta usa hojas de cálculo, no programa.
12
+
13
+ - Antes de cambiar un archivo, di en una línea qué vas a hacer y en qué columnas. Nunca borres filas sin decirlo; si limpias datos, guarda una copia o deja el original intacto.
14
+ - Cuando des un total o una conclusión, di de qué filas sale para que la persona lo pueda comprobar.
15
+ - Si propones una fórmula, escríbela lista para pegar (para Excel o Google Sheets, la que use) y explica qué hace en una oración.
16
+ - Prefiere columnas claras: fecha, concepto, cantidad, monto. Fechas en un solo formato, montos sin símbolos mezclados.
17
+ - Para un reporte, primero tres o cuatro números que importan y luego la tabla, no al revés.
18
+ - Si ves algo raro (montos negativos, fechas imposibles, duplicados), señálalo antes de seguir.
@@ -0,0 +1,19 @@
1
+ ---
2
+ id: mensajes-a-clientes
3
+ name: { es: "Mensajes y correos a clientes", en: "Messages and emails to customers" }
4
+ line: { es: "Correos y WhatsApp a clientes, listos para copiar y mandar.", en: "Emails and WhatsApp messages to customers, ready to copy and send." }
5
+ icon: chat
6
+ when: { es: "La persona pide escribir o contestar un correo, mail, email, mensaje, whatsapp, respuesta, recordatorio de pago, cobro, disculpa o aviso para un cliente, clienta, proveedor o contacto.", en: "The person asks to write or answer an email, mail, message, whatsapp, reply, payment reminder, apology or notice for a customer, client, supplier or contact." }
7
+ version: 1.0.0
8
+ minMadre: 1.1.4
9
+ ---
10
+
11
+ Escribe mensajes que la persona pueda copiar y mandar tal cual.
12
+
13
+ - Primero el mensaje listo, en un bloque aparte para copiarlo fácil. Después, si hace falta, una línea de por qué lo escribiste así.
14
+ - Corto y claro: saludo, lo importante en las dos primeras líneas, qué se espera del otro, cierre. Un WhatsApp cabe en la pantalla sin bajar.
15
+ - Tono cálido y profesional, sin sonar a robot ni a plantilla. Nunca grosero aunque el cliente lo haya sido.
16
+ - Cobrar o decir que no también se hace con amabilidad: firme en lo que se pide, suave en cómo se pide.
17
+ - Si falta un dato que el mensaje necesita (un monto, una fecha, un nombre), deja un espacio claro como [fecha] y dilo, en lugar de inventarlo.
18
+ - Si la persona dio un borrador, respeta su voz: mejora sin reescribirlo de cero.
19
+ - Ofrece, en una línea, una versión más formal o más breve si puede servir.
@@ -0,0 +1,19 @@
1
+ ---
2
+ id: publicaciones-para-redes
3
+ name: { es: "Publicaciones para redes", en: "Social media posts" }
4
+ line: { es: "Ideas y textos para tus redes que no suenan a anuncio genérico.", en: "Ideas and texts for your social media that do not sound like a generic ad." }
5
+ icon: image
6
+ when: { es: "La persona pide ideas o textos para redes sociales: publicación, publicaciones, post, posts, instagram, facebook, tiktok, linkedin, historias, reels, hashtags, caption, anuncio, calendario de publicaciones, contenido.", en: "The person asks for ideas or texts for social media: post, posts, instagram, facebook, tiktok, linkedin, stories, reels, hashtags, caption, ad, posting calendar, content." }
7
+ version: 1.0.0
8
+ minMadre: 1.1.4
9
+ ---
10
+
11
+ Ayuda a un negocio pequeño o a una persona a publicar sin que suene a anuncio genérico.
12
+
13
+ - Antes de escribir, usa lo que sepas del proyecto (qué vende, a quién, en qué ciudad). Si no sabes nada, pregunta solo eso, en una línea.
14
+ - Cada publicación: un gancho en la primera línea, el valor para quien la lee, y una sola invitación clara (comentar, escribir por mensaje, visitar).
15
+ - Escribe para la red que te pidieron: Instagram más visual y corto, LinkedIn más explicativo, TikTok como guion de pocos segundos.
16
+ - Máximo cinco hashtags, de los que la gente de verdad busca, nunca una lista larga.
17
+ - Si piden varias, varía el tipo: una que enseña, una que muestra el producto, una de detrás de cámaras, una con una pregunta.
18
+ - Cuando sirva, sugiere la imagen o el video en una línea («foto de la taza en la mano, luz de mañana»).
19
+ - No prometas resultados ni inventes datos, precios o testimonios.
@@ -0,0 +1,18 @@
1
+ ---
2
+ id: resumen-y-pendientes
3
+ name: { es: "Resúmenes y pendientes", en: "Summaries and to-dos" }
4
+ line: { es: "Convierte lo largo en lo decidido, lo pendiente y las dudas.", en: "Turns something long into what was decided, what is pending and what is open." }
5
+ icon: list
6
+ when: { es: "La persona pide un resumen, resumir, resume, resúmeme, pendientes, decisiones, puntos importantes, minuta, junta, reunión, notas o ponerse al día con algo largo.", en: "The person asks for a summary, summarize, sum up, to-dos, decisions, key points, minutes, meeting, notes or catching up on something long." }
7
+ version: 1.0.0
8
+ minMadre: 1.1.4
9
+ ---
10
+
11
+ Convierte lo largo en algo que se lee en un minuto.
12
+
13
+ - Empieza con una o dos líneas de qué es y de qué trata.
14
+ - Luego tres apartados cortos, solo los que tengan algo: **Decidido**, **Pendiente** (con quién y para cuándo, si se sabe) y **Dudas** que siguen abiertas.
15
+ - Usa las palabras del documento para lo importante; no inventes fechas, nombres ni compromisos que no estén ahí. Si algo no está claro, dilo como duda.
16
+ - Viñetas de una línea. Nada de párrafos largos.
17
+ - Si el texto es muy largo, avisa qué partes leíste.
18
+ - Al final, ofrece en una línea convertir los pendientes en recordatorios o en un mensaje para mandar.
@@ -0,0 +1,19 @@
1
+ ---
2
+ id: tu-pagina-paso-a-paso
3
+ name: { es: "Tu página, paso a paso", en: "Your website, step by step" }
4
+ line: { es: "Cambia tu página web en pasos pequeños, sin que tengas que programar.", en: "Changes your website in small steps, without you having to code." }
5
+ icon: globe
6
+ when: { es: "La persona quiere hacer o cambiar su página, página web, sitio, tienda en línea, landing, sección, botón, colores, fotos, textos de la página, formulario o que se vea bien en el celular, sin saber programar.", en: "The person wants to make or change their page, website, site, online store, landing, section, button, colours, photos, page texts, form or how it looks on a phone, without knowing how to code." }
7
+ version: 1.0.0
8
+ minMadre: 1.1.4
9
+ ---
10
+
11
+ Quien pide esto no programa: trabaja con su página como lo haría con una diseñadora.
12
+
13
+ - Cambios pequeños y de uno en uno. Antes de tocar un archivo, di en palabras qué va a cambiar en la página («el botón verde de abajo dirá Escríbenos»), no qué línea de código.
14
+ - Después de cada cambio, di cómo verlo: qué página abrir y dónde mirar. Si MADRE puede mostrarla en la vista previa, sugiere abrirla ahí.
15
+ - No cambies el diseño completo si te pidieron un detalle. Si ves algo que convendría arreglar, propónlo al final en una línea, sin hacerlo.
16
+ - Textos de la página: claros, con lo que el visitante busca primero (qué ofreces, precio o cómo pedir, cómo contactar).
17
+ - Si algo puede romper la página (borrar secciones, cambiar la estructura), pide confirmación antes.
18
+ - Nunca pongas datos privados, llaves ni contraseñas en la página.
19
+ - Al terminar, resume en dos o tres viñetas lo que cambió, para que la persona lo pueda revisar.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jossuealcala/madre",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "MADRE · one local room where the AI coding agents already on your machine (Codex, Claude Code, Gemini CLI, Cursor, OpenCode, Grok) work on your project together, share one memory you can see and explore, and answer to you. Read-only by default, with per-message permission modes and checkpoints you can undo. Nothing leaves your machine on its own.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -43,6 +43,7 @@
43
43
  "!src/madre-logs.mjs",
44
44
  "!src/rumbo.mjs",
45
45
  "public",
46
+ "habilidades",
46
47
  "!public/assets/manual/*.pdf",
47
48
  "README.md",
48
49
  "CHANGELOG.md",
@@ -68,8 +69,8 @@
68
69
  "docs/en/training"
69
70
  ],
70
71
  "bin": {
71
- "madre": "./bin/madre.cjs",
72
- "pulse": "./bin/madre.cjs"
72
+ "madre": "bin/madre.cjs",
73
+ "pulse": "bin/madre.cjs"
73
74
  },
74
75
  "engines": {
75
76
  "node": ">=22.5.0"
@@ -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
  });
@@ -425,7 +458,9 @@ export function mountActivity({ key, badge, openChat, toast = () => {} }) {
425
458
  }
426
459
  key.addEventListener('click', () => (state.open ? close() : openPanel()));
427
460
  document.addEventListener?.('keydown', (event) => { if (event.key === 'Escape' && state.open) { close(); key.focus(); } });
428
- 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);
429
464
  globalThis.addEventListener?.('resize', () => { if (state.open) place(); });
430
465
 
431
466
  void load();