@jossuealcala/madre 1.0.4 → 1.1.0

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 (273) hide show
  1. package/ADDITIONAL-TERMS.md +7 -2
  2. package/CHANGELOG.en.md +152 -1
  3. package/CHANGELOG.md +152 -1
  4. package/CONTRIBUTING.md +2 -2
  5. package/LICENSE +111 -661
  6. package/NOTICE +59 -24
  7. package/README.en.md +36 -204
  8. package/README.md +36 -210
  9. package/SECURITY.md +1 -0
  10. package/TRADEMARKS.en.md +13 -14
  11. package/TRADEMARKS.md +42 -26
  12. package/bin/madre.cjs +2 -2
  13. package/bin/madre.mjs +114 -42
  14. package/docs/REFERENCE.md +53 -6
  15. package/docs/SDK.md +44 -5
  16. package/docs/en/REFERENCE.md +53 -6
  17. package/docs/en/SDK.md +43 -4
  18. package/docs/madre-banner.png +0 -0
  19. package/docs/sdk/hello-module.mjs +3 -0
  20. package/package.json +3 -2
  21. package/public/abduction.js +6 -6
  22. package/public/activity.js +425 -0
  23. package/public/app.js +3519 -647
  24. package/public/assets/abduction-cat-blink.webp +0 -0
  25. package/public/assets/abduction-cat-control-left.webp +0 -0
  26. package/public/assets/abduction-cat-control-right.webp +0 -0
  27. package/public/assets/abduction-cat.webp +0 -0
  28. package/public/assets/manual/shots/en-agents.webp +0 -0
  29. package/public/assets/manual/shots/en-chats.webp +0 -0
  30. package/public/assets/manual/shots/en-code.webp +0 -0
  31. package/public/assets/manual/shots/en-composer.webp +0 -0
  32. package/public/assets/manual/shots/en-connectors.webp +0 -0
  33. package/public/assets/manual/shots/en-continuity.webp +0 -0
  34. package/public/assets/manual/shots/en-coordinator.webp +0 -0
  35. package/public/assets/manual/shots/en-copilot.webp +0 -0
  36. package/public/assets/manual/shots/en-diagnostics.webp +0 -0
  37. package/public/assets/manual/shots/en-home.webp +0 -0
  38. package/public/assets/manual/shots/en-local.webp +0 -0
  39. package/public/assets/manual/shots/en-market.webp +0 -0
  40. package/public/assets/manual/shots/en-memory.webp +0 -0
  41. package/public/assets/manual/shots/en-modes.webp +0 -0
  42. package/public/assets/manual/shots/en-notes.webp +0 -0
  43. package/public/assets/manual/shots/en-settings.webp +0 -0
  44. package/public/assets/manual/shots/en-welcome.webp +0 -0
  45. package/public/assets/manual/shots/en-windows.webp +0 -0
  46. package/public/assets/manual/shots/es-agents.webp +0 -0
  47. package/public/assets/manual/shots/es-chats.webp +0 -0
  48. package/public/assets/manual/shots/es-code.webp +0 -0
  49. package/public/assets/manual/shots/es-composer.webp +0 -0
  50. package/public/assets/manual/shots/es-connectors.webp +0 -0
  51. package/public/assets/manual/shots/es-continuity.webp +0 -0
  52. package/public/assets/manual/shots/es-coordinator.webp +0 -0
  53. package/public/assets/manual/shots/es-copilot.webp +0 -0
  54. package/public/assets/manual/shots/es-diagnostics.webp +0 -0
  55. package/public/assets/manual/shots/es-home.webp +0 -0
  56. package/public/assets/manual/shots/es-local.webp +0 -0
  57. package/public/assets/manual/shots/es-market.webp +0 -0
  58. package/public/assets/manual/shots/es-memory.webp +0 -0
  59. package/public/assets/manual/shots/es-modes.webp +0 -0
  60. package/public/assets/manual/shots/es-notes.webp +0 -0
  61. package/public/assets/manual/shots/es-settings.webp +0 -0
  62. package/public/assets/manual/shots/es-welcome.webp +0 -0
  63. package/public/assets/manual/shots/es-windows.webp +0 -0
  64. package/public/assets/news/1.1/en/chats.webp +0 -0
  65. package/public/assets/news/1.1/en/home.webp +0 -0
  66. package/public/assets/news/1.1/en/maps.webp +0 -0
  67. package/public/assets/news/1.1/en/market.webp +0 -0
  68. package/public/assets/news/1.1/en/permissions.webp +0 -0
  69. package/public/assets/news/1.1/en/privacy.webp +0 -0
  70. package/public/assets/news/1.1/en/welcome.webp +0 -0
  71. package/public/assets/news/1.1/es/chats.webp +0 -0
  72. package/public/assets/news/1.1/es/home.webp +0 -0
  73. package/public/assets/news/1.1/es/maps.webp +0 -0
  74. package/public/assets/news/1.1/es/market.webp +0 -0
  75. package/public/assets/news/1.1/es/permissions.webp +0 -0
  76. package/public/assets/news/1.1/es/privacy.webp +0 -0
  77. package/public/assets/news/1.1/es/welcome.webp +0 -0
  78. package/public/attribution.js +15 -16
  79. package/public/brands.js +2 -2
  80. package/public/code-tools.js +2 -2
  81. package/public/editor.js +13 -13
  82. package/public/en.js +483 -0
  83. package/public/es.js +1817 -598
  84. package/public/hardware.js +2 -2
  85. package/public/i18n.js +47 -9
  86. package/public/icons.js +158 -0
  87. package/public/index.html +68 -51
  88. package/public/inquiry.js +2 -2
  89. package/public/loader.js +271 -2
  90. package/public/macroverso.js +60 -21
  91. package/public/manual-content.js +900 -0
  92. package/public/manual-shots.js +47 -0
  93. package/public/manual.css +246 -0
  94. package/public/manual.html +15 -0
  95. package/public/manual.js +427 -0
  96. package/public/market-art.js +99 -41
  97. package/public/market-view.js +243 -47
  98. package/public/market.js +139 -26
  99. package/public/mcp-catalog.js +62 -0
  100. package/public/neural.js +64 -8
  101. package/public/nostromo-engine.js +709 -40
  102. package/public/page-errors.js +29 -0
  103. package/public/power.js +350 -11
  104. package/public/remedy.js +89 -0
  105. package/public/resay.js +4 -2
  106. package/public/review-ask.js +12 -7
  107. package/public/routing.js +3 -3
  108. package/public/salas-mac.css +875 -48
  109. package/public/salas-mac.html +27 -15
  110. package/public/salas-mac.js +1668 -338
  111. package/public/salas.css +2 -2
  112. package/public/salas.html +3 -3
  113. package/public/salas.js +3 -3
  114. package/public/styles.css +2694 -323
  115. package/public/syntax.js +2 -2
  116. package/public/terms.js +152 -0
  117. package/public/touch.js +2 -2
  118. package/public/tour-chapters.js +100 -92
  119. package/public/tour.js +118 -28
  120. package/public/troubleshooting.js +327 -21
  121. package/public/wallpaper.js +4 -3
  122. package/public/welcome.js +923 -0
  123. package/src/activity.mjs +85 -0
  124. package/src/adapters/claude.mjs +61 -35
  125. package/src/adapters/codex.mjs +18 -5
  126. package/src/adapters/cursor.mjs +60 -9
  127. package/src/adapters/gemini.mjs +17 -4
  128. package/src/adapters/madre.mjs +30 -9
  129. package/src/adapters/opencode.mjs +73 -10
  130. package/src/adapters/process.mjs +19 -15
  131. package/src/adapters/subagents.mjs +159 -0
  132. package/src/asking.mjs +8 -2
  133. package/src/auth-probe.mjs +47 -11
  134. package/src/bridge/devices.mjs +2 -2
  135. package/src/bridge/handoff.mjs +2 -2
  136. package/src/bridge/host.mjs +2 -2
  137. package/src/bridge/network.mjs +2 -2
  138. package/src/bridge/policy.mjs +3 -3
  139. package/src/bridge/qr.mjs +2 -2
  140. package/src/bridge/server.mjs +3 -3
  141. package/src/builtin-updates.mjs +87 -0
  142. package/src/capabilities.mjs +5 -5
  143. package/src/chats.mjs +51 -2
  144. package/src/checkpoint.mjs +67 -9
  145. package/src/choices.mjs +2 -2
  146. package/src/cli-args.mjs +2 -2
  147. package/src/cold.mjs +2 -2
  148. package/src/commands.mjs +2 -2
  149. package/src/config.mjs +2 -2
  150. package/src/conversation-context.mjs +2 -2
  151. package/src/credentials.mjs +80 -18
  152. package/src/dataset.mjs +2 -2
  153. package/src/directives.mjs +2 -2
  154. package/src/distiller.mjs +2 -2
  155. package/src/embeddings.mjs +2 -2
  156. package/src/enlaces.mjs +2 -2
  157. package/src/environment.mjs +147 -0
  158. package/src/event-store.mjs +2 -2
  159. package/src/exam.mjs +2 -2
  160. package/src/extensions.mjs +2 -2
  161. package/src/eyecat-watch.mjs +2 -2
  162. package/src/eyecat.mjs +2 -2
  163. package/src/file-ops.mjs +2 -2
  164. package/src/files.mjs +2 -2
  165. package/src/github.mjs +2 -2
  166. package/src/heartbeat.mjs +2 -2
  167. package/src/history.mjs +76 -0
  168. package/src/i18n.mjs +32 -3
  169. package/src/image-studio.mjs +2 -2
  170. package/src/install-metrics.mjs +109 -0
  171. package/src/json-file.mjs +2 -2
  172. package/src/launch.mjs +2 -2
  173. package/src/lease.mjs +15 -4
  174. package/src/lobby-work.mjs +11 -4
  175. package/src/local-ai.mjs +12 -4
  176. package/src/looks.mjs +19 -7
  177. package/src/market-check.mjs +165 -0
  178. package/src/market-key.mjs +10 -2
  179. package/src/market-license.mjs +104 -0
  180. package/src/market-remote.mjs +71 -13
  181. package/src/maturity.mjs +2 -2
  182. package/src/mcp/connect.mjs +2 -2
  183. package/src/mcp/github-server.mjs +2 -2
  184. package/src/mcp/image-server.mjs +2 -2
  185. package/src/mcp/memory-server.mjs +2 -2
  186. package/src/mcp/proxy.mjs +16 -5
  187. package/src/mcp/smtp-server.mjs +2 -2
  188. package/src/memory-dashboard.mjs +2 -2
  189. package/src/memory-tools.mjs +2 -2
  190. package/src/memory.mjs +2 -2
  191. package/src/models.mjs +115 -12
  192. package/src/module-scope.mjs +2 -2
  193. package/src/modules/ahp.mjs +2 -2
  194. package/src/modules/ash-policy.mjs +2 -2
  195. package/src/modules/ash.mjs +2 -2
  196. package/src/modules/bishop-exam.mjs +2 -2
  197. package/src/modules/bishop-plan.mjs +2 -2
  198. package/src/modules/bishop.mjs +9 -3
  199. package/src/modules/choices.mjs +2 -2
  200. package/src/modules/correo.mjs +2 -2
  201. package/src/modules/enlaces.mjs +2 -2
  202. package/src/modules/git-pulse.mjs +2 -2
  203. package/src/modules/github.mjs +2 -2
  204. package/src/modules/helpers.mjs +2 -2
  205. package/src/modules/image-studio.mjs +2 -2
  206. package/src/modules/index.mjs +92 -5
  207. package/src/modules/intents-calibration.mjs +2 -2
  208. package/src/modules/intents-desk.mjs +4 -3
  209. package/src/modules/intents-observe.mjs +2 -2
  210. package/src/modules/intents-policy.mjs +2 -2
  211. package/src/modules/intents-try.mjs +2 -2
  212. package/src/modules/intents.mjs +2 -2
  213. package/src/modules/local-models.mjs +41 -10
  214. package/src/modules/mcp-connect.mjs +2 -2
  215. package/src/modules/notes.mjs +281 -0
  216. package/src/modules/ollama.mjs +48 -13
  217. package/src/modules/playwright.mjs +16 -5
  218. package/src/modules/reminders.mjs +664 -0
  219. package/src/modules/ripley.mjs +3 -3
  220. package/src/modules/runs.mjs +2 -2
  221. package/src/modules/sdk.mjs +57 -9
  222. package/src/modules/updates.mjs +2 -2
  223. package/src/mother.mjs +13 -3
  224. package/src/npm-launch.mjs +2 -2
  225. package/src/ollama.mjs +8 -6
  226. package/src/opencode-health.mjs +83 -0
  227. package/src/outbound.mjs +35 -3
  228. package/src/override.mjs +27 -22
  229. package/src/ports.mjs +2 -2
  230. package/src/prices.mjs +2 -2
  231. package/src/privacy.mjs +2 -2
  232. package/src/quota-monitor.mjs +2 -2
  233. package/src/quota-sources.mjs +2 -2
  234. package/src/request-guard.mjs +2 -2
  235. package/src/review-ask.mjs +4 -3
  236. package/src/room/archivist.mjs +2 -2
  237. package/src/room/attachments.mjs +2 -2
  238. package/src/room/budget.mjs +2 -2
  239. package/src/room/context.mjs +2 -2
  240. package/src/room/control.mjs +2 -2
  241. package/src/room/copilot.mjs +2 -2
  242. package/src/room/economy.mjs +2 -2
  243. package/src/room/escalation.mjs +2 -2
  244. package/src/room/ghost.mjs +2 -2
  245. package/src/room/guard.mjs +6 -4
  246. package/src/room/prompt.mjs +3 -3
  247. package/src/room/returns.mjs +2 -2
  248. package/src/room/runs.mjs +6 -4
  249. package/src/room/vectors.mjs +2 -2
  250. package/src/room.mjs +144 -36
  251. package/src/router.mjs +2 -2
  252. package/src/runs.mjs +2 -2
  253. package/src/runtime-detection.mjs +36 -6
  254. package/src/salas.mjs +31 -6
  255. package/src/sentinel-errors.mjs +17 -7
  256. package/src/server-sentinel.mjs +2 -2
  257. package/src/server.mjs +980 -139
  258. package/src/setup-trouble.mjs +33 -0
  259. package/src/setup.mjs +4 -4
  260. package/src/smtp.mjs +2 -2
  261. package/src/telemetry.mjs +266 -0
  262. package/src/terms.mjs +43 -0
  263. package/src/tour.mjs +60 -7
  264. package/src/uninstall.mjs +225 -0
  265. package/src/updates.mjs +2 -2
  266. package/src/usage-sentinel.mjs +2 -2
  267. package/src/vault.mjs +2 -2
  268. package/src/verdict.mjs +13 -10
  269. package/src/whats-new.mjs +97 -3
  270. package/public/assets/abduction-cat-blink.png +0 -0
  271. package/public/assets/abduction-cat-control-left.png +0 -0
  272. package/public/assets/abduction-cat-control-right.png +0 -0
  273. package/public/assets/abduction-cat.png +0 -0
@@ -1,5 +1,5 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
2
- // MADRE · © 2026 Jossue Alcalá · GNU AGPL v3 with additional terms (Section 7): ADDITIONAL-TERMS.md
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
3
3
  // THE MARKET, full screen (2026-10-18). The same store in Home and in every project, shaped like the
4
4
  // stores people already know: the featured modules in a carousel with their pictures, shelves by
5
5
  // what they are for, a page per module with its one key, and — in Home — MODULES, where what is on
@@ -15,8 +15,9 @@
15
15
  // `openProject(projectId, item)` (Home), `toast(text)` and `changed()`.
16
16
 
17
17
  import { t, language } from './i18n.js';
18
- import { appIcon, inMarket, loadMarket, marketEntry, marketExtras, marketFeatured, marketShelves, moduleFace } from './market.js';
19
- import { marketArt } from './market-art.js';
18
+ import { appIcon, communityOf, forSale, inMarket, isBought, loadMarket, marketEntry, marketExtras, marketFeatured, marketShelves, moduleFace, remoteEntry } from './market.js';
19
+ import { marketArt, marketGallery } from './market-art.js';
20
+ import { trazo } from './icons.js';
20
21
 
21
22
  const el = (tag, className = null, text = null) => {
22
23
  const node = document.createElement(tag);
@@ -33,23 +34,29 @@ const button = (className, text, onClick) => {
33
34
  const post = async (url, payload = {}) => {
34
35
  try {
35
36
  const response = await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(payload) });
36
- return { ok: response.ok, body: await response.json().catch(() => ({})) };
37
- } catch (error) { return { ok: false, body: { error: error.message } }; }
37
+ const body = await response.json().catch(() => ({}));
38
+ if (typeof body.error === 'string') body.error = t(body.error);
39
+ return { ok: response.ok, body };
40
+ } catch { return { ok: false, body: { error: t('MADRE did not answer. Check that it is still open.') } }; }
38
41
  };
39
42
  const getJson = (url) => fetch(url, { cache: 'no-store' }).then((response) => (response.ok ? response.json() : null)).catch(() => null);
40
43
 
41
44
  const GLYPH = {
42
- close: '<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 5.5l9 9M14.5 5.5l-9 9" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',
43
- back: '<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M12.5 4.5L7 10l5.5 5.5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/></svg>',
44
- next: '<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M7.5 4.5L13 10l-5.5 5.5" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/></svg>',
45
- search: '<svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="9" cy="9" r="5.2" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M13 13l3.5 3.5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>',
45
+ close: trazo('close'),
46
+ back: trazo('back'),
47
+ next: trazo('next'),
48
+ search: trazo('search'),
46
49
  };
47
50
  const glyph = (node, name) => { node.insertAdjacentHTML('afterbegin', GLYPH[name]); return node; }; // trusted: our own SVG strings
48
51
 
49
52
  // A module from the catalog says its name and what it does in the room's language (market.js).
50
53
  const nameOf = (item) => moduleFace(item).name ?? t(item.name ?? item.id);
51
- const summaryOf = (item) => moduleFace(item).summary ?? t(item.summary ?? '');
54
+ const summaryOf = (item) => (moduleFace(item).summary ? t(moduleFace(item).summary) : t(item.summary ?? ''));
52
55
  const lineOf = (item) => (moduleFace(item).line ? t(moduleFace(item).line) : t(item.summary ?? ''));
56
+ // Who made it: the catalog entry's author (a community module's, or one of the author's own, like
57
+ // Antes de subir, by Claude) or what a module says of itself.
58
+ const makerOf = (item) => remoteEntry(item.id)?.author?.name ?? item.credit ?? null;
59
+ const communityTag = () => el('span', 'mk-community', t('Community'));
53
60
  const priceOf = (item) => (marketEntry(item.id).price ? `$${marketEntry(item.id).price}` : t('Free'));
54
61
  const shelfOf = (item) => marketShelves().find((shelf) => shelf.id === marketEntry(item.id).shelf) ?? null;
55
62
  // What its key does: a switch MADRE flips, a folder it writes into, or Local AI's own settings. A
@@ -71,10 +78,12 @@ export const marketOpen = () => Boolean(current);
71
78
  export function closeMarket() { current?.close(); }
72
79
 
73
80
  export function openMarket({ where = 'home', tab = 'shop', focus = null, project = null, host = {} } = {}) {
74
- if (current) { current.go({ tab, focus }); return current; }
81
+ if (current) { current.raise?.(); current.go({ tab, focus }); return current; }
75
82
  const home = where === 'home';
76
83
  const before = document.activeElement;
77
- const root = el('div', 'mk');
84
+ // The flat store (2026-10-27): the chat shell's canvas, hairlines and flat icons, laid out as the
85
+ // App Store on a phone. The classic room (port 4316) keeps the store it had.
86
+ const root = el('div', globalThis.location?.port === '4316' ? 'mk' : 'mk flat');
78
87
  root.setAttribute('role', 'dialog');
79
88
  root.setAttribute('aria-modal', 'true');
80
89
  root.setAttribute('aria-label', t('Market'));
@@ -114,7 +123,11 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
114
123
  const main = el('main', 'mk-main');
115
124
  root.append(bar, main);
116
125
  document.body.append(root);
117
- document.documentElement.classList.add('mk-open');
126
+ // In a project the Market is one more window of the room (2026-10-27): carried by its bar, sized by
127
+ // its edges, arranged and set aside with the others (app.js, marketAsWindow). Without that — Home —
128
+ // it takes the whole screen, as before.
129
+ const framed = host.window?.({ root, bar, close: () => close() }) ?? null;
130
+ if (!framed) document.documentElement.classList.add('mk-open');
118
131
  requestAnimationFrame(() => root.classList.add('in'));
119
132
 
120
133
  let items = [];
@@ -136,10 +149,53 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
136
149
  };
137
150
  // A module from the catalog is got first — its signed file, checked, for every project — and
138
151
  // then turned on wherever the person said.
152
+ // BEFORE IT IS INSTALLED (2026-10-25): what the module declares, read from its signed file, and the
153
+ // one thing every module is — code that runs with the person's permissions. Nothing is installed
154
+ // until the person says so, and then it is that same file (its sha256).
155
+ let reviewing = null;
156
+ const reviewLines = (declares) => {
157
+ const lines = [];
158
+ for (const reach of declares?.reaches ?? []) lines.push(reach.to ? t('Connects to {to} ({host}).', { to: reach.to, host: reach.host ?? '?' }) : t('Connects to {host}.', { host: reach.host ?? '?' }));
159
+ if (!(declares?.reaches ?? []).length) lines.push(t('It declares no address outside this computer.'));
160
+ for (const secret of declares?.secrets ?? []) lines.push(t('Asks for a key: {label}. MADRE keeps it in its vault, only for this module.', { label: secret.label }));
161
+ if (declares?.tools) lines.push(t('Hands tools to your agents during their turns.'));
162
+ if (declares?.reads) lines.push(t('Reads the messages of your chats while it is on.'));
163
+ if (declares?.commands?.length) lines.push(t('Adds commands to the box: {commands}.', { commands: declares.commands.join(', ') }));
164
+ if (declares?.pages) lines.push(t('Serves pages of its own inside MADRE.'));
165
+ if (declares?.writes) lines.push(t('Writes in your project, with a command you read and confirm before it runs.'));
166
+ return lines;
167
+ };
168
+ const askToInstall = (item, review) => new Promise((resolve) => {
169
+ const sheet = el('div', 'mk-review');
170
+ sheet.setAttribute('role', 'alertdialog');
171
+ sheet.setAttribute('aria-modal', 'true');
172
+ const card = el('div', 'mk-review-card');
173
+ const head = el('div', 'mk-review-head');
174
+ head.append(appIcon(item, 44), el('h2', null, t('Before installing {name}', { name: nameOf(item) })));
175
+ const list = el('ul', 'mk-review-list');
176
+ for (const line of reviewLines(review.declares)) list.append(el('li', null, line));
177
+ const warn = el('p', 'mk-review-warn', t('A module runs inside MADRE with your permissions. MADRE checks its signature and what it declares, not everything its code does: install only what you trust.'));
178
+ const keys = el('div', 'mk-review-keys');
179
+ const done = (yes) => { reviewing = null; sheet.remove(); resolve(yes); };
180
+ const no = button('mk-get big quiet', t('Not now'), () => done(false));
181
+ const yes = button('mk-get big', t('Install'), () => done(true));
182
+ keys.append(no, yes);
183
+ const made = communityOf(item.id) ? t('Version {version} · made by {name}, from the community; the author of MADRE read it and signed it.', { version: review.version ?? '?', name: communityOf(item.id).author.name }) : t('Version {version}', { version: review.version ?? '?' });
184
+ card.append(head, el('p', 'mk-review-version', made), list, warn, keys);
185
+ sheet.append(card);
186
+ sheet.addEventListener('click', (event) => { if (event.target === sheet) done(false); });
187
+ reviewing = () => done(false);
188
+ root.append(sheet);
189
+ yes.focus();
190
+ });
139
191
  const fetchFirst = async (item, line) => {
140
192
  if (item.kind !== 'remote') return item;
193
+ said(line, t('Reading what {name} does…', { name: nameOf(item) }));
194
+ const review = await post('/api/market/install', { id: item.id, review: true });
195
+ if (!review.ok) throw new Error(review.body.error ?? t('{name} could not be installed.', { name: nameOf(item) }));
196
+ if (!(await askToInstall(item, review.body))) throw Object.assign(new Error(''), { declined: true });
141
197
  said(line, t('Getting {name} from the Market…', { name: nameOf(item) }));
142
- const answer = await post('/api/market/install', { id: item.id });
198
+ const answer = await post('/api/market/install', { id: item.id, accept: review.body.sha256 });
143
199
  if (!answer.ok) throw new Error(answer.body.error ?? t('{name} could not be installed.', { name: nameOf(item) }));
144
200
  await load();
145
201
  return items.find((one) => one.id === item.id && one.kind !== 'remote') ?? item;
@@ -164,24 +220,62 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
164
220
  const refresh = async () => { await load(); host.changed?.(); render(); };
165
221
 
166
222
  // ACTIONS. Each says what happened in the line under the key, and on the page when it went well.
223
+ // Getting a module looks like getting it (2026-10-20): its key fills as a download does while
224
+ // MADRE turns it on, a tick takes its place when it is done, and on its page the module's icon
225
+ // drops into place with the tick on it. Turning one off is only a moment.
226
+ const TICK = trazo('check');
227
+ const still = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
228
+ const startGetting = (key) => {
229
+ key.classList.add('getting');
230
+ key.dataset.from = String(Date.now());
231
+ key.dataset.was = key.textContent;
232
+ key.textContent = t('Getting it…');
233
+ };
234
+ const landed = async (key) => {
235
+ // A module turned on in an instant still shows its download for a moment: a key that blinks
236
+ // from «Get» to the tick read as nothing having happened.
237
+ const shown = Date.now() - Number(key.dataset.from || 0);
238
+ if (!still() && shown < 700) await new Promise((resolve) => setTimeout(resolve, 700 - shown));
239
+ key.classList.remove('getting');
240
+ key.classList.add('got');
241
+ key.innerHTML = TICK; // trusted: our own SVG string
242
+ key.append(el('span', null, t('Done')));
243
+ const icon = key.closest('.mk-product')?.querySelector('.mk-product-top > .mk-icon');
244
+ if (icon) {
245
+ icon.classList.add('landed');
246
+ const badge = el('span', 'mk-got-badge');
247
+ badge.innerHTML = TICK; // trusted: our own SVG string
248
+ icon.append(badge);
249
+ }
250
+ await new Promise((resolve) => setTimeout(resolve, still() ? 300 : 1100));
251
+ };
252
+ const stopGetting = (key) => {
253
+ if (!key.classList.contains('getting')) return;
254
+ key.classList.remove('getting');
255
+ key.textContent = key.dataset.was ?? key.textContent;
256
+ };
167
257
  const turnHere = async (given, on, line, key) => {
168
258
  key.disabled = true;
259
+ if (on) startGetting(key);
169
260
  let item = given;
170
- try { item = await fetchFirst(given, line); } catch (error) { key.disabled = false; said(line, error.message, 'bad'); return; }
261
+ try { item = await fetchFirst(given, line); } catch (error) { key.disabled = false; stopGetting(key); said(line, error.message, error.declined ? '' : 'bad'); return; }
171
262
  said(line, on && item.id === 'playwright' ? t('Getting the test browser ready: MADRE downloads what it is missing. It can take a few minutes.') : t('One moment…'));
172
263
  const answer = await post(`/api/extensions/${encodeURIComponent(item.id)}/install`, { confirm: true });
173
- if (!answer.ok) { key.disabled = false; said(line, answer.body.error ?? t('{name} could not be turned on or off.', { name: nameOf(item) }), 'bad'); return; }
264
+ if (!answer.ok) { key.disabled = false; stopGetting(key); said(line, answer.body.error ?? t('{name} could not be turned on or off.', { name: nameOf(item) }), 'bad'); return; }
265
+ if (on) await landed(key);
174
266
  notice(on ? t('{name} is on in this project.', { name: nameOf(item) }) : t('{name} is off in this project.', { name: nameOf(item) }));
175
267
  await refresh();
176
268
  };
177
269
  const turnScope = async (given, change, line, key) => {
178
270
  key.disabled = true;
179
- let item = given;
180
- try { item = await fetchFirst(given, line); } catch (error) { key.disabled = false; said(line, error.message, 'bad'); return false; }
181
271
  const turningOn = change.all === true || Object.values(change.rooms ?? {}).includes(true);
272
+ if (turningOn) startGetting(key);
273
+ let item = given;
274
+ try { item = await fetchFirst(given, line); } catch (error) { key.disabled = false; stopGetting(key); said(line, error.message, error.declined ? '' : 'bad'); return false; }
182
275
  said(line, turningOn && item.id === 'playwright' ? t('Getting the test browser ready: MADRE downloads what it is missing. It can take a few minutes.') : t('One moment…'));
183
276
  const answer = await post(`/api/extensions/${encodeURIComponent(item.id)}/scope`, { ...change, confirm: true });
184
- if (!answer.ok) { key.disabled = false; said(line, answer.body.error ?? t('{name} could not be turned on or off.', { name: nameOf(item) }), 'bad'); return false; }
277
+ if (!answer.ok) { key.disabled = false; stopGetting(key); said(line, answer.body.error ?? t('{name} could not be turned on or off.', { name: nameOf(item) }), 'bad'); return false; }
278
+ if (turningOn) await landed(key);
185
279
  await refresh();
186
280
  return true;
187
281
  };
@@ -194,6 +288,8 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
194
288
  if (!onPage) {
195
289
  // On a shelf the key is short: what is on says so and opens its page; what is off gets it.
196
290
  if (on) return button('mk-get on', kind === 'install' ? t('Installed') : t('Turned on'), () => go({ tab: 'shop', focus: item.id }));
291
+ // A paid module not bought yet is bought on its page, where it says what it costs and how.
292
+ if (unpaid(item)) return button('mk-get', t('Buy'), () => go({ tab: 'shop', focus: item.id }));
197
293
  if (!home && kind === 'switch') {
198
294
  const key = button('mk-get', t('Get'), async (event) => { event.stopPropagation(); const line = el('span'); await turnHere(item, true, line, key); if (line.dataset.tone === 'bad') { notice(line.textContent); key.disabled = false; } });
199
295
  return key;
@@ -208,7 +304,9 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
208
304
  const line = el('div', 'mk-row');
209
305
  const open = button('mk-row-open', null, () => go({ tab: 'shop', focus: item.id }));
210
306
  const words = el('span', 'mk-row-words');
211
- words.append(el('b', null, nameOf(item)), el('span', null, lineOf(item)));
307
+ const title = el('b', null, nameOf(item));
308
+ if (communityOf(item.id)) title.append(communityTag());
309
+ words.append(title, el('span', null, lineOf(item)));
212
310
  open.append(appIcon(item, 58), words);
213
311
  const side = el('span', 'mk-row-side');
214
312
  side.append(getKey(item), el('small', null, isOn(item) ? '' : priceOf(item)));
@@ -234,7 +332,7 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
234
332
  const get = el('div', 'mk-slide-get');
235
333
  const who = el('span', 'mk-slide-who');
236
334
  who.append(el('b', null, nameOf(item)), el('span', null, isOn(item) ? reach(item) : priceOf(item)));
237
- get.append(appIcon(item, 48), who, button('mk-get light', isOn(item) ? t('See it') : kindOf(item) === 'install' ? t('Install') : kindOf(item) === 'local' ? t('Open') : t('Get'), (event) => { event.stopPropagation(); go({ tab: 'shop', focus: item.id, choose: !isOn(item) }); }));
335
+ get.append(appIcon(item, 48), who, button('mk-get light', isOn(item) ? t('See it') : unpaid(item) ? t('Buy') : kindOf(item) === 'install' ? t('Install') : kindOf(item) === 'local' ? t('Open') : t('Get'), (event) => { event.stopPropagation(); go({ tab: 'shop', focus: item.id, choose: !isOn(item) }); }));
238
336
  words.append(el('small', null, t('Featured')), el('h2', null, nameOf(item)), el('p', null, t(marketEntry(item.id).pitch ?? lineOf(item))), get);
239
337
  const art = el('div', 'mk-slide-art');
240
338
  art.innerHTML = marketArt(item); // trusted: our own drawings (market-art.js)
@@ -245,13 +343,22 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
245
343
  dot.setAttribute('aria-label', t('{n} of {total}', { n: at + 1, total: featured.length }));
246
344
  dots.append(dot);
247
345
  });
346
+ // A slide is as wide as the track, or — in the flat store — a little narrower, with the next one
347
+ // peeking at the edge: either way each one starts where it starts, not at a multiple of the width.
348
+ const startOf = (at) => (track.children[at]?.offsetLeft ?? 0) - (track.children[0]?.offsetLeft ?? 0);
248
349
  const show = (at, smooth = true) => {
249
350
  index = (at + featured.length) % featured.length;
250
- track.scrollTo({ left: index * track.clientWidth, behavior: smooth && !reducedMotion() ? 'smooth' : 'auto' });
351
+ track.scrollTo({ left: startOf(index), behavior: smooth && !reducedMotion() ? 'smooth' : 'auto' });
251
352
  mark();
252
353
  };
253
354
  const mark = () => { [...dots.children].forEach((dot, at) => dot.setAttribute('aria-current', String(at === index))); };
254
- track.addEventListener('scroll', () => { const at = Math.round(track.scrollLeft / Math.max(1, track.clientWidth)); if (at !== index) { index = at; mark(); } }, { passive: true });
355
+ track.addEventListener('scroll', () => {
356
+ let at = 0;
357
+ featured.forEach((_, one) => { if (Math.abs(startOf(one) - track.scrollLeft) < Math.abs(startOf(at) - track.scrollLeft)) at = one; });
358
+ if (at !== index) { index = at; mark(); }
359
+ }, { passive: true });
360
+ // A window sized narrower or wider keeps the card it showed in place, never half of two.
361
+ if (typeof ResizeObserver === 'function') new ResizeObserver(() => { if (track.isConnected) track.scrollTo({ left: startOf(index), behavior: 'auto' }); }).observe(track);
255
362
  const prev = glyph(button('mk-arrow prev', null, () => show(index - 1)), 'back');
256
363
  const next = glyph(button('mk-arrow next', null, () => show(index + 1)), 'next');
257
364
  prev.setAttribute('aria-label', t('Previous'));
@@ -280,8 +387,8 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
280
387
  }
281
388
  const head = el('section', 'mk-head');
282
389
  head.append(el('h1', null, t('Market')), el('p', null, home
283
- ? t('Modules add what MADRE does: more for your agents, less for the terminal. Free for now. From Home you choose: every project, or only one.')
284
- : t('Modules add what MADRE does: more for your agents, less for the terminal. Free for now. What you get here is for this project.')));
390
+ ? t('Modules add what MADRE does: more for your agents, less for the terminal. From Home you choose: every project, or only one.')
391
+ : t('Modules add what MADRE does: more for your agents, less for the terminal. What you get here is for this project.')));
285
392
  page.append(head);
286
393
  const featured = carousel();
287
394
  if (featured) page.append(featured);
@@ -317,16 +424,50 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
317
424
  const facts = el('dl', 'mk-facts');
318
425
  const fact = (label, value) => { const one = el('div'); one.append(el('dt', null, label), el('dd', null, value)); facts.append(one); };
319
426
  fact(t('Price'), priceOf(item));
427
+ if (forSale(item.id) && isBought(item.id)) {
428
+ const held = el('span', 'mk-license-held', t('Active on this computer'));
429
+ const release = button('mk-link', t('Release'), async () => {
430
+ release.disabled = true;
431
+ const answer = await post('/api/market/license/release', { id: item.id });
432
+ if (!answer.ok) { release.disabled = false; notice(answer.body.error ?? t('The license could not be released.')); return; }
433
+ notice(t('License released: you can activate it on another computer. {name} stays installed here, without the Market\'s updates.', { name: nameOf(item) }));
434
+ await refresh();
435
+ });
436
+ release.title = t('Gives this computer\'s activation back, to use the key on another one.');
437
+ const value = el('span');
438
+ value.append(held, ' ', release);
439
+ const one = el('div');
440
+ one.append(el('dt', null, t('License')), el('dd', null, ''));
441
+ one.lastChild.append(value);
442
+ facts.append(one);
443
+ }
320
444
  fact(home ? t('Where') : t('Here'), reach(item));
321
445
  if (shelfOf(item)) fact(t('Shelf'), t(shelfOf(item).title));
322
- fact(t('Version'), item.version ? `v${String(item.version).replace(/^v/, '')}` : '—');
446
+ // MADRE's own modules have no version of their own: they are the version of MADRE they come with.
447
+ fact(t('Version'), item.version ? `v${String(item.version).replace(/^v/, '')}` : madre ? t('Comes with MADRE {version}', { version: madre }) : t('Comes with MADRE'));
448
+ // Who developed it, when a module or its catalog entry says (Reminders, 2026-10-20), only here: not
449
+ // again under its name (2026-10-30).
450
+ if (makerOf(item)) {
451
+ fact(t('Developer'), makerOf(item));
452
+ if (communityOf(item.id)) facts.lastChild.lastChild.prepend(communityTag(), ' ');
453
+ }
454
+ // A community module's author, and where to find them: their GitHub user, under their name.
455
+ const github = communityOf(item.id)?.author.github;
456
+ if (github) facts.lastChild.lastChild.append(el('small', 'mk-handle', `@${github}`));
457
+ if (communityOf(item.id)?.spdx) fact(t('Code license'), communityOf(item.id).spdx);
323
458
  page.append(facts);
324
459
 
460
+ // Three pictures (1.0.5), side by side and swiped like a store's: what it does, the module at
461
+ // work in a project, and the three steps to use it.
325
462
  const gallery = el('section', 'mk-section');
326
463
  gallery.append(el('h2', null, t('Preview')));
327
- const shot = hueOf(el('div', 'mk-shot'), item);
328
- shot.innerHTML = marketArt(item); // trusted: our own drawings (market-art.js)
329
- gallery.append(shot);
464
+ const strip = el('div', 'mk-gallery');
465
+ for (const drawing of marketGallery(item)) {
466
+ const shot = hueOf(el('div', 'mk-shot'), item);
467
+ shot.innerHTML = drawing; // trusted: our own drawings, or the catalog's kept to their shapes (market-art.js)
468
+ strip.append(shot);
469
+ }
470
+ gallery.append(strip);
330
471
  page.append(gallery);
331
472
  if (summaryOf(item)) {
332
473
  const about = el('section', 'mk-section');
@@ -351,6 +492,40 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
351
492
  for (const id of ids) { const option = el('option', null, projectName(id)); option.value = id; select.append(option); }
352
493
  return select;
353
494
  };
495
+ // A PAID MODULE (src/market-license.mjs): bought once at its checkout, then its key pasted here.
496
+ // Until then it cannot be got; after, it is got like any other.
497
+ const unpaid = (item) => item.kind === 'remote' && Boolean(forSale(item.id)) && !isBought(item.id);
498
+ const drawPurchase = (item, keys, line) => {
499
+ const sale = forSale(item.id);
500
+ const buy = button('mk-get big', t('Buy · {price}', { price: priceOf(item) }), () => { globalThis.open?.(sale.checkout, '_blank', 'noopener'); said(line, t('The purchase opened in your browser. The license key arrives by email: paste it here with «I have a license».'), 'note'); });
501
+ const have = button('mk-get big quiet', t('I have a license'), () => {
502
+ have.remove();
503
+ const form = el('form', 'mk-license');
504
+ const field = el('input');
505
+ field.type = 'text';
506
+ field.autocomplete = 'off';
507
+ field.spellcheck = false;
508
+ field.placeholder = t('License key');
509
+ field.setAttribute('aria-label', t('License key'));
510
+ const activate = button('mk-get big', t('Activate'));
511
+ activate.type = 'submit';
512
+ form.addEventListener('submit', async (event) => {
513
+ event.preventDefault();
514
+ activate.disabled = true;
515
+ said(line, t('Checking the license with Lemon Squeezy…'));
516
+ const answer = await post('/api/market/license', { id: item.id, key: field.value });
517
+ activate.disabled = false;
518
+ if (!answer.ok) { said(line, answer.body.error ?? t('The license could not be activated.'), 'bad'); return; }
519
+ notice(t('License activated: {name} is yours.', { name: nameOf(item) }));
520
+ await refresh();
521
+ });
522
+ form.append(field, activate);
523
+ keys.append(form);
524
+ field.focus();
525
+ });
526
+ keys.append(buy, have);
527
+ said(line, t('Paid once, through Lemon Squeezy. Its code is open like MADRE\'s: what you pay for is getting it from the Market, its updates and its support.'), 'note');
528
+ };
354
529
  const drawKeys = (item, keys, line, { choose = false } = {}) => {
355
530
  keys.replaceChildren();
356
531
  const kind = kindOf(item);
@@ -359,6 +534,7 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
359
534
  // A module from the catalog that asks for a newer MADRE says so, and waits for it.
360
535
  const needs = item.kind === 'remote' ? item.remote?.minMadre : null;
361
536
  if (needs && madre && !fits(madre, needs)) { keys.append(button('mk-get big', t('Needs MADRE {version}', { version: needs }))); keys.lastChild.disabled = true; said(line, t('Update MADRE to get this module.'), 'note'); return; }
537
+ if (unpaid(item)) { drawPurchase(item, keys, line); return; }
362
538
  if (kind === 'local') { keys.append(button('mk-get big', t('Open Local AI'), () => { close(); host.localAi?.(); })); return; }
363
539
  if (!home) {
364
540
  if (kind === 'install') {
@@ -394,17 +570,32 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
394
570
  const off = button('mk-get big quiet', t('Turn off in every project'), () => turnScope(item, { all: false }, line, off));
395
571
  keys.append(off);
396
572
  } else {
397
- const all = button('mk-get big', t('Get it for all your projects'), async () => { if (await turnScope(item, { all: true }, line, all)) notice(t('{name} is on in all your projects.', { name: nameOf(item) })); });
398
- keys.append(all);
573
+ // Where it goes, asked as a question with its two answers side by side (2026-10-20): every
574
+ // project — the ones added later too — or one, chosen by its name. Three keys in a row with
575
+ // no question («for all», «or only in», «only in this one», «project by project») read as one
576
+ // choice said three ways.
577
+ const where = el('div', 'mk-where');
578
+ where.append(el('b', 'mk-where-title', t('Where do you want it?')));
579
+ const options = el('div', 'mk-where-options');
580
+ const everyBox = el('div', 'mk-where-option');
581
+ const all = button('mk-get big', t('In all my projects'), async () => { if (await turnScope(item, { all: true }, line, all)) notice(t('{name} is on in all your projects.', { name: nameOf(item) })); });
582
+ everyBox.append(all, el('small', null, t('Also in the ones you add later.')));
583
+ options.append(everyBox);
399
584
  const left = ids.filter((id) => !mine.on.includes(id));
400
585
  if (left.length) {
401
- const only = el('div', 'mk-only');
586
+ const oneBox = el('div', 'mk-where-option');
587
+ const pick = el('div', 'mk-only');
402
588
  const select = projectPicker(left);
403
- const key = button('mk-get', t('Only in this one'), async () => { const name = projectName(select.value); if (await turnScope(item, { rooms: { [select.value]: true } }, line, key)) notice(t('{name} is on in {project}.', { name: nameOf(item), project: name })); });
404
- only.append(el('span', null, t('or only in')), select, key);
405
- keys.append(only);
406
- if (choose) requestAnimationFrame(() => all.focus());
589
+ const key = button('mk-get big quiet', t('Only in one'), async () => { const name = projectName(select.value); if (await turnScope(item, { rooms: { [select.value]: true } }, line, key)) notice(t('{name} is on in {project}.', { name: nameOf(item), project: name })); });
590
+ pick.append(key, select);
591
+ oneBox.append(pick, el('small', null, t('Choose which one. The others stay as they are.')));
592
+ options.append(oneBox);
407
593
  }
594
+ where.append(options);
595
+ if (ids.length > 1) where.append(button('mk-link', t('Or decide project by project'), () => go({ tab: 'mine', focus: item.id })));
596
+ keys.append(where);
597
+ if (choose) requestAnimationFrame(() => all.focus());
598
+ return;
408
599
  }
409
600
  if (ids.length) keys.append(button('mk-link', t('Choose project by project'), () => go({ tab: 'mine', focus: item.id })));
410
601
  };
@@ -415,8 +606,11 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
415
606
  const head = el('section', 'mk-head');
416
607
  head.append(el('h1', null, t('Modules')), el('p', null, t('What you have on or installed, and in which projects. A change here reaches each project with its next message.')));
417
608
  page.append(head);
418
- const onNow = items.filter((item) => isOn(item));
419
- const offNow = items.filter((item) => !isOn(item));
609
+ // Local AI and the connectors are MADRE's own, set in Settings (2026-10-28), as a project's
610
+ // Modules leaves them out (app.js, IN_SETTINGS): not a module to turn on here.
611
+ const offered = items.filter((item) => item.card !== 'settings' && item.id !== 'ollama');
612
+ const onNow = offered.filter((item) => isOn(item));
613
+ const offNow = offered.filter((item) => !isOn(item));
420
614
  if (onNow.length) {
421
615
  const group = el('section', 'mk-section');
422
616
  group.append(el('h2', null, t('What is on')));
@@ -454,13 +648,13 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
454
648
  if (kind === 'local') {
455
649
  head.append(button('mk-get', t('Local AI settings'), () => { close(); host.localAi?.(); }));
456
650
  } else if (kind === 'install') {
457
- head.append(button('mk-get', t('Install in another'), () => go({ tab: 'shop', focus: item.id })));
458
- const on = scopeOf(item)?.on ?? [];
459
- if (on.length) {
460
- const chips = el('div', 'mk-chips');
461
- for (const id of on) chips.append(el('span', 'mk-chip on', projectName(id)));
462
- box.append(chips);
463
- }
651
+ // The projects it is in and the key to put it in another, on one line (2026-10-30): stacked, the
652
+ // key and the project read as two keys of different sizes, one under the other.
653
+ const foot = el('div', 'mk-card-foot');
654
+ const chips = el('div', 'mk-chips');
655
+ for (const id of scopeOf(item)?.on ?? []) chips.append(el('span', 'mk-chip on', projectName(id)));
656
+ foot.append(chips, button('mk-get', t('Install in another'), () => go({ tab: 'shop', focus: item.id })));
657
+ box.append(foot);
464
658
  } else {
465
659
  const mineScope = scopeOf(item) ?? { all: false, on: [], everywhere: false };
466
660
  const allOn = mineScope.everywhere || (mineScope.all && !scope.projects.length);
@@ -505,6 +699,7 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
505
699
  if (!current) return;
506
700
  clearInterval(timer);
507
701
  current = null;
702
+ framed?.drop();
508
703
  document.documentElement.classList.remove('mk-open');
509
704
  root.classList.remove('in');
510
705
  try { history.replaceState(history.state, '', `${location.pathname}${location.search}`); } catch { /* fine */ }
@@ -516,12 +711,13 @@ export function openMarket({ where = 'home', tab = 'shop', focus = null, project
516
711
  if (event.key !== 'Escape') return;
517
712
  event.stopPropagation();
518
713
  event.preventDefault();
714
+ if (reviewing) { reviewing(); return; }
519
715
  if (input.value && document.activeElement === input) { input.value = ''; render(); return; }
520
716
  if (view.focus && view.tab === 'shop') go({ tab: 'shop' });
521
717
  else close();
522
718
  });
523
719
 
524
- current = { close, go };
720
+ current = { close, go, raise: () => framed?.raise() };
525
721
  main.append(el('p', 'mk-empty', t('Looking…')));
526
722
  root.focus();
527
723
  void load().then(() => { if (current) go({ tab, focus, choose: false }); });