@jossuealcala/madre 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.en.md +20 -1
  2. package/CHANGELOG.md +20 -1
  3. package/TRADEMARKS.md +6 -2
  4. package/bin/madre.mjs +4 -2
  5. package/docs/REFERENCE.md +3 -3
  6. package/docs/SDK.md +28 -1
  7. package/docs/en/REFERENCE.md +2 -2
  8. package/docs/en/SDK.md +26 -0
  9. package/docs/sdk/hello-module.mjs +38 -3
  10. package/habilidades/explicamelo-facil/HABILIDAD.md +19 -0
  11. package/habilidades/hojas-de-calculo/HABILIDAD.md +18 -0
  12. package/habilidades/mensajes-a-clientes/HABILIDAD.md +19 -0
  13. package/habilidades/publicaciones-para-redes/HABILIDAD.md +19 -0
  14. package/habilidades/resumen-y-pendientes/HABILIDAD.md +18 -0
  15. package/habilidades/tu-pagina-paso-a-paso/HABILIDAD.md +19 -0
  16. package/package.json +4 -3
  17. package/public/activity.js +57 -22
  18. package/public/app.js +3998 -762
  19. package/public/assets/brand/OFL-SpaceGrotesk.txt +93 -0
  20. package/public/assets/brand/SpaceGrotesk-latin-ext.woff2 +0 -0
  21. package/public/assets/brand/SpaceGrotesk-latin.woff2 +0 -0
  22. package/public/assets/brand/madre-app-180.png +0 -0
  23. package/public/assets/brand/madre-app-192.png +0 -0
  24. package/public/assets/brand/madre-app-512.png +0 -0
  25. package/public/assets/brand/madre-app.svg +1 -1
  26. package/public/assets/brand/madre-favicon.svg +1 -1
  27. package/public/attribution.js +28 -27
  28. package/public/auto-open.js +102 -0
  29. package/public/brands.js +9 -6
  30. package/public/changes.js +63 -0
  31. package/public/en.js +1085 -101
  32. package/public/es.js +2395 -1688
  33. package/public/i18n.js +11 -0
  34. package/public/index.html +28 -27
  35. package/public/loader.js +322 -117
  36. package/public/macroverso.js +33 -350
  37. package/public/manual-content.js +37 -7
  38. package/public/manual.js +21 -6
  39. package/public/market-view.js +212 -105
  40. package/public/market.js +10 -2
  41. package/public/mcp-catalog.js +7 -2
  42. package/public/missions.js +169 -0
  43. package/public/news-scenes.js +110 -3
  44. package/public/nostromo-engine.js +935 -654
  45. package/public/notices.js +14 -2
  46. package/public/notifications.js +119 -0
  47. package/public/provider-marks.js +170 -0
  48. package/public/provider-pick.js +147 -0
  49. package/public/resay.js +1 -0
  50. package/public/review-ask.js +16 -13
  51. package/public/routing.js +29 -3
  52. package/public/salas-mac.css +257 -40
  53. package/public/salas-mac.html +5 -5
  54. package/public/salas-mac.js +376 -97
  55. package/public/salas.css +2 -2
  56. package/public/salas.html +2 -2
  57. package/public/salas.js +1 -1
  58. package/public/starters.js +128 -0
  59. package/public/styles.css +2656 -336
  60. package/public/subscription.js +303 -0
  61. package/public/terms-field.js +170 -0
  62. package/public/terms.js +117 -19
  63. package/public/tips.js +41 -7
  64. package/public/tour-chapters.js +35 -35
  65. package/public/tour.js +333 -43
  66. package/public/troubleshooting.js +100 -7
  67. package/public/welcome-scene.js +117 -29
  68. package/public/welcome.js +364 -60
  69. package/src/adapters/claude.mjs +2 -1
  70. package/src/adapters/codex.mjs +2 -1
  71. package/src/adapters/cursor.mjs +9 -6
  72. package/src/adapters/gemini.mjs +4 -0
  73. package/src/adapters/grok.mjs +6 -4
  74. package/src/adapters/madre.mjs +71 -23
  75. package/src/adapters/opencode.mjs +15 -2
  76. package/src/adapters/steps.mjs +176 -0
  77. package/src/app-invite.mjs +90 -0
  78. package/src/billing-key.mjs +8 -0
  79. package/src/billing.mjs +317 -0
  80. package/src/bridge/policy.mjs +1 -1
  81. package/src/capabilities.mjs +17 -11
  82. package/src/chats.mjs +44 -2
  83. package/src/checkpoint.mjs +5 -1
  84. package/src/commands.mjs +5 -2
  85. package/src/directives.mjs +1 -0
  86. package/src/event-store.mjs +15 -0
  87. package/src/extensions.mjs +5 -1
  88. package/src/ficha.mjs +16 -0
  89. package/src/image-studio.mjs +13 -3
  90. package/src/install-metrics.mjs +9 -3
  91. package/src/lease.mjs +1 -1
  92. package/src/looks.mjs +4 -1
  93. package/src/mcp/image-server.mjs +59 -90
  94. package/src/modules/ahp.mjs +2 -1
  95. package/src/modules/github.mjs +6 -2
  96. package/src/modules/image-providers.mjs +281 -0
  97. package/src/modules/image-studio.mjs +100 -19
  98. package/src/modules/index.mjs +7 -1
  99. package/src/modules/intents-observe.mjs +3 -1
  100. package/src/modules/playwright.mjs +33 -4
  101. package/src/modules/reminders.mjs +42 -2
  102. package/src/modules/ripley.mjs +2 -1
  103. package/src/modules/sdk.mjs +6 -1
  104. package/src/opencode-health.mjs +1 -1
  105. package/src/outbound.mjs +80 -6
  106. package/src/quota-sources.mjs +148 -3
  107. package/src/review-ask.mjs +55 -31
  108. package/src/room/changes.mjs +79 -0
  109. package/src/room/economy.mjs +1 -1
  110. package/src/room/guard.mjs +8 -1
  111. package/src/room/prompt.mjs +20 -4
  112. package/src/room.mjs +87 -21
  113. package/src/salas.mjs +30 -3
  114. package/src/server.mjs +545 -59
  115. package/src/setup.mjs +1 -1
  116. package/src/skills.mjs +10 -0
  117. package/src/terms.mjs +23 -5
  118. package/src/tour.mjs +18 -3
  119. package/src/updates.mjs +47 -4
  120. package/src/web-preview.mjs +181 -0
  121. package/src/whats-new.mjs +76 -4
package/public/tour.js CHANGED
@@ -21,6 +21,8 @@ import { LOADER_MARK, MADRE_LOGO, finishLoader, makeLoader, setLoader } from './
21
21
  import { hostWords, keyWords, language, t } from './i18n.js';
22
22
  import { CHAPTERS, GESTURES, ORDER } from './tour-chapters.js';
23
23
  import { trazo } from './icons.js';
24
+ import { brandOf } from './brands.js';
25
+ import { MISSIONS, missionsLeft, missionsState, onMissions, openMissions, setMissions } from './missions.js';
24
26
 
25
27
  const say = (pair) => (typeof pair === 'string' ? pair : pair?.[language()] ?? pair?.es ?? '');
26
28
  // The chapters' own words, said of the computer and the keyboard in front of the person: «tu Mac» is
@@ -31,8 +33,9 @@ const still = () => typeof matchMedia === 'function' && matchMedia('(prefers-red
31
33
  // Up, turned for down: the way to a hint whose place is out of view.
32
34
  const ARROW_UP = trazo('arrow-up');
33
35
  const CLOSE_ICON = trazo('close');
34
- const FOLDER = '<svg viewBox="0 0 32 26" aria-hidden="true"><path d="M2 5.5A2.5 2.5 0 0 1 4.5 3h7.2l3 3.2h12.8A2.5 2.5 0 0 1 30 8.7v12.8a2.5 2.5 0 0 1-2.5 2.5h-23A2.5 2.5 0 0 1 2 21.5z" fill="currentColor"/></svg>';
35
- const ROBOT = trazo('robot');
36
+ // The × of every window of MADRE (2026-11-13): the same key, in the same channel, as the Market's,
37
+ // Modules' and Settings' — not a round plate of its own.
38
+ const closeKeys = (close) => { const keys = document.createElement('span'); keys.className = 'surface-modes window-close'; keys.append(close); return keys; };
36
39
 
37
40
  function el(tag, className = null, text = null) {
38
41
  const node = document.createElement(tag);
@@ -53,36 +56,297 @@ const tourApi = {
53
56
  .then((response) => (response.ok ? response.json() : null)).catch(() => null),
54
57
  };
55
58
 
56
- // The scenes: one short drawing per chapter, made of a few shapes that move once and loop slowly.
57
- // With reduced motion they stand still and say the same.
59
+ // ---- The scenes (2026-11-14). Each chapter opens on the piece of MADRE it speaks of, drawn small
60
+ // the way the room and Home look today (the chat shell): the sidebar, the conversation with its green
61
+ // bubble and the answer's chip, the box with its chips, the row of AIs with their official marks
62
+ // (brands.js), the tools that open at the side and the windows that float. Not a screenshot, which
63
+ // ages with every change, and not abstract points, which say nothing (the pictures of What's new,
64
+ // news-scenes.js, 2026-11-08): the piece itself, acting out what it does in a few beats.
65
+ //
66
+ // A beat adds a class to the scene (`b1`, `b2`…) and styles.css (.ts-*) moves what that beat moves;
67
+ // after the last one the picture rests, fades and starts again, slowly. With reduced motion it stands
68
+ // still on the beat that says the most. Its few words are MADRE's own labels from the catalogue, so
69
+ // the picture says what the screen says, in the person's language.
70
+ const h = (tag, className, ...kids) => {
71
+ const node = el(tag, className);
72
+ for (const kid of kids.flat()) if (kid !== null && kid !== undefined && kid !== false) node.append(kid);
73
+ return node;
74
+ };
75
+ const glyph = (name, className = 'ts-i') => {
76
+ const node = el('span', className);
77
+ node.innerHTML = trazo(name); // trusted: our own SVG strings (icons.js)
78
+ return node;
79
+ };
80
+ const set = (node, vars) => { for (const [name, value] of Object.entries(vars)) node.style.setProperty(`--${name}`, String(value)); return node; };
81
+ // Words not written out: a line of text, as long as a share of its room.
82
+ const line = (width, className = 'ts-l') => set(el('i', className), { w: width });
83
+ // An AI as the room draws it: its own colour and its official mark (brands.js).
84
+ function face(id, className = 'ts-face') {
85
+ const brand = brandOf(id);
86
+ const node = el('span', className);
87
+ set(node, { 'ts-brand': brand.solid ?? brand.gradient ?? brand.color, 'ts-brand-ink': brand.ink ?? '#111' });
88
+ node.innerHTML = brand.mark(); // trusted: our own SVG strings (brands.js)
89
+ return node;
90
+ }
91
+ const CREW = ['codex', 'claude', 'gemini', 'opencode', 'grok'];
92
+ const ROOM_KEYS = ['running', 'brain', 'puzzle', 'mother', 'code', 'globe'];
93
+ const HOME_KEYS = ['running', 'links', 'map', 'market', 'puzzle', 'widgets'];
94
+
95
+ // The sidebar: the logo, the ways in (Home's own in Home), the chats and the projects.
96
+ function sidebar({ home = false, on = null, chats = 2, projects = 3 } = {}) {
97
+ const logo = el('span', 'ts-logo');
98
+ logo.innerHTML = MADRE_LOGO; // trusted: our own SVG string
99
+ const side = h('div', 'ts-side', h('span', 'ts-side-head', logo));
100
+ const ways = home ? [['add', 'Add a project'], ['home', 'Home'], ['coordinator', 'Coordinator'], ['market', 'Market']] : [['add', 'New chat'], ['home', 'Home'], ['market', 'Market']];
101
+ for (const [icon, words] of ways) side.append(h('span', `ts-row ts-way w-${icon}${on === icon ? ' on' : ''}`, glyph(icon), el('span', 'ts-w', t(words))));
102
+ if (!home && chats) {
103
+ side.append(el('span', 'ts-sec', t('Chats')));
104
+ for (let i = 0; i < chats; i += 1) side.append(h('span', `ts-row ts-chat c${i}${i === 0 && on === 'chat' ? ' on' : ''}`, line([0.82, 0.64, 0.72][i] ?? 0.7)));
105
+ }
106
+ side.append(el('span', 'ts-sec', t('Projects')));
107
+ for (let i = 0; i < projects; i += 1) side.append(h('span', `ts-row ts-proj p${i}`, el('i', 'ts-dot'), line([0.56, 0.7, 0.48][i] ?? 0.6)));
108
+ return side;
109
+ }
110
+ // The bar over the conversation: its title, the row of AIs and the keys of the tools.
111
+ function topBar({ title = null, keys = ROOM_KEYS, lit = null } = {}) {
112
+ return h('div', 'ts-top',
113
+ title ?? line(0.2, 'ts-l ts-title-l'),
114
+ h('span', 'ts-crew', CREW.map((id) => face(id))), glyph('agents', 'ts-i ts-crew-key'),
115
+ h('span', 'ts-keys', keys.map((name) => glyph(name, `ts-i k-${name}${name === lit ? ' lit' : ''}`))));
116
+ }
117
+ // The box at the bottom and its chips: who answers, the mode, the model and how hard it thinks.
118
+ function composer({ typed = null, agent = 'claude' } = {}) {
119
+ const effort = h('span', 'ts-effort', [0, 1, 2, 3].map(() => el('i')));
120
+ return h('div', 'ts-box',
121
+ h('div', 'ts-box-text', typed ?? line(0.42, 'ts-l ts-hold')),
122
+ h('div', 'ts-box-chips', face(agent),
123
+ h('span', 'ts-chip ts-mode', el('span', 'ts-cw', t('Just chat')), glyph('chevron')),
124
+ h('span', 'ts-chip ts-model', el('span', 'ts-cw', t('Recommended model')), glyph('chevron')),
125
+ h('span', 'ts-chip', effort, glyph('chevron')),
126
+ glyph('robot', 'ts-i ts-extra'), glyph('attach', 'ts-i ts-extra'), el('span', 'ts-gap'), glyph('return')));
127
+ }
128
+ // What the person wrote: the green bubble on the right, and who it went to under it.
129
+ const mine = (widths, to) => h('div', 'ts-mine', h('div', 'ts-bubble', widths.map((width) => line(width))), to ? el('span', 'ts-to', `→ @${to}`) : null);
130
+ // An answer as the room writes it: the AI's chip and its tokens, the words, its keys.
131
+ function answer(id, widths) {
132
+ const brand = brandOf(id);
133
+ const who = set(el('b', 'ts-who', brand.label), { 'ts-who': brand.color, 'ts-who-l': brand.colorLight ?? brand.color });
134
+ return h('div', 'ts-answer',
135
+ h('div', 'ts-answer-head', who, el('span', 'ts-tokens', '312↓ 268↑')),
136
+ h('div', 'ts-answer-text', widths.map((width, i) => set(line(width), { i }))),
137
+ h('div', 'ts-answer-keys', face(id), glyph('copy'), glyph('good', 'ts-i ts-rate'), glyph('reply')));
138
+ }
139
+ const card = (className, ...kids) => h('div', `ts-card ${className}`, ...kids);
140
+ const meter = (share, words = null) => h('span', 'ts-meter', h('span', 'ts-track', set(el('i'), { share })), words ? el('em', null, words) : null);
141
+ const switchKey = () => h('i', 'ts-switch', el('i'));
142
+
58
143
  const SCENES = {
59
- moved: () => '',
60
- home: () => `<div class="ts-bar"><i class="ts-logo"></i><span class="ts-pin"></span><span class="ts-pin"></span><span class="ts-pin ts-arrive"></span></div>
61
- <div class="ts-grid"><span class="ts-card"></span><span class="ts-card ts-lift"></span><span class="ts-card"></span><span class="ts-card ts-dim"></span></div>`,
62
- project: () => `<div class="ts-bar"><i class="ts-logo"></i><span style="flex:1"></span><span class="ts-key"></span><span class="ts-key ts-lamp"></span><span class="ts-key"></span><span class="ts-key"></span></div>
63
- <div class="ts-switch"><span class="ts-tile"><i>${FOLDER}</i></span><span class="ts-tile on"><i>${FOLDER}</i></span><span class="ts-tile"><i>${FOLDER}</i></span></div>`,
64
- talk: () => `<div class="ts-bubble"></div><div class="ts-bubble mine"></div>
65
- <div class="ts-box"><span class="ts-type"><b>@codex</b><b>#2</b><b>!app.js</b><b>/gh</b></span></div>`,
66
- modes: () => `<div class="ts-modes">${[0, 1, 2, 3, 4].map((n) => `<span class="ts-mode m${n}">#${n}${n >= 3 ? '<i class="ts-lock"></i>' : ''}</span>`).join('')}</div>`,
67
- coordinator: () => `<svg class="ts-wires" viewBox="0 0 320 150" preserveAspectRatio="none" aria-hidden="true"><path id="ts-c1" d="M160 75L60 40"/><path id="ts-c2" d="M160 75L262 42"/><path id="ts-c3" d="M160 75L160 132"/>
68
- ${still() ? '' : ['ts-c1', 'ts-c2', 'ts-c3'].map((id, index) => `<path d="M0 0h0" class="ts-note"><animateMotion dur="2.6s" begin="${index * 0.8}s" repeatCount="indefinite"><mpath href="#${id}"/></animateMotion></path>`).join('')}</svg>
69
- <span class="ts-node" style="left:18.75%;top:26.6%">${FOLDER}</span><span class="ts-node" style="left:81.9%;top:28%">${FOLDER}</span><span class="ts-node" style="left:50%;top:88%">${FOLDER}</span>
70
- <span class="ts-hub">${ROBOT}</span>`,
71
- links: () => `<svg class="ts-wires" viewBox="0 0 320 150" preserveAspectRatio="none" aria-hidden="true"><path id="ts-l1" class="ts-dash" d="M86 75C140 50 180 100 234 75"/>
72
- ${still() ? '' : [0, 0.9, 1.8].map((lag) => `<path d="M0 0h0" class="ts-note"><animateMotion dur="2.7s" begin="${lag}s" repeatCount="indefinite"><mpath href="#ts-l1"/></animateMotion></path>`).join('')}</svg>
73
- <span class="ts-node big" style="left:23%;top:50%">${FOLDER}</span><span class="ts-node big" style="left:77%;top:50%">${FOLDER}</span>`,
74
- maps: () => `<div class="ts-orbit"><i class="ts-core"></i>${[0, 1, 2, 3, 4, 5].map((n) => `<b class="ts-star s${n}"></b>`).join('')}</div>`,
75
- settings: () => `<div class="ts-window"><span class="ts-search"><i></i><em></em></span><div class="ts-tiles"><span></span><span></span><span></span><span></span><span></span><span></span></div></div><span class="ts-cap">⌘ ,</span>`,
76
- modules: () => `<div class="ts-modules">${[0, 1, 2, 3, 4, 5].map((n) => `<span class="ts-module m${n}"><i></i></span>`).join('')}</div>`,
77
- phone: () => `<span class="ts-mac"><i></i></span><svg class="ts-wires" viewBox="0 0 320 150" preserveAspectRatio="none" aria-hidden="true"><path id="ts-p1" class="ts-dash" d="M206 80C178 62 150 62 124 76"/>
78
- ${still() ? '' : '<path d="M0 0h0" class="ts-note"><animateMotion dur="2.4s" repeatCount="indefinite" keyPoints="0;1;0" keyTimes="0;.5;1" calcMode="linear"><mpath href="#ts-p1"/></animateMotion></path>'}</svg>
79
- <span class="ts-phone"><i class="ts-qr"></i></span>`,
80
- board: () => SCENES.home(),
81
- widgets: () => `<div class="ts-grid ts-widgets"><span class="ts-card"><i style="--w:.62"></i><i style="--w:.34"></i></span><span class="ts-card"><i style="--w:.8"></i><i style="--w:.5"></i></span><span class="ts-card"><i style="--w:.4"></i><i style="--w:.7"></i></span><span class="ts-card ts-dim"><i style="--w:.25"></i><i style="--w:.55"></i></span></div>`,
82
- local: () => SCENES.modules(),
83
- gestures: () => `<div class="ts-caps"><span class="ts-cap c0">⌘ ,</span><span class="ts-cap c1">Esc</span><span class="ts-cap c2">?</span></div>`,
144
+ // Home: every project on one board, the Coordinator and what needs you; a click on one and you
145
+ // are in it — its conversation where the board was, and it lit in the sidebar.
146
+ home(stage) {
147
+ const tiles = [0, 1, 2].map((i) => h('div', `ts-tile t${i}`,
148
+ line([0.62, 0.5, 0.7][i], 'ts-l ts-strong'), line(0.86, 'ts-l ts-path'),
149
+ h('span', 'ts-state', el('i', 'ts-dot'), line(0.42)),
150
+ h('span', 'ts-open', t('Open'), i === 1 ? glyph('pointer', 'ts-ptr') : null)));
151
+ const board = h('div', 'ts-board',
152
+ card('ts-coord', h('span', 'ts-coord-head', face('bishop'), h('span', 'ts-coord-words', el('b', null, t('Coordinator')), line(0.5))), el('i', 'ts-cta')),
153
+ card('ts-needs', el('b', null, t('Needs you')), el('span', 'ts-big', '0')),
154
+ h('div', 'ts-tiles', tiles));
155
+ const room = h('div', 'ts-room', h('div', 'ts-thread', mine([0.7], 'claude'), answer('claude', [0.9, 0.62])), composer());
156
+ const title = h('span', 'ts-titles', el('b', 'ts-title ts-at-home', t('Home')), line(0.5, 'ts-l ts-title-l ts-at-room'));
157
+ stage.append(h('div', 'ts-win ts-home', sidebar({ home: true, on: 'home' }), h('div', 'ts-main', topBar({ title, keys: HOME_KEYS }), board, room)));
158
+ // Still, it is the board with a project about to open: what Home is.
159
+ return Object.assign([250, 1300, 2200, 2800], { rest: 2 });
160
+ },
161
+
162
+ // Home as a board: a card carried to another place, another one's menu, and it changes its size.
163
+ board(stage) {
164
+ const cards = [0, 1, 2, 3, 4, 5].map((i) => h('div', `ts-card ts-slot s${i}`,
165
+ h('span', 'ts-slot-head', glyph(['gauge', 'server', 'brain', 'chip', 'coordinator', 'inbox'][i]), line(0.46, 'ts-l ts-strong')),
166
+ line([0.8, 0.6, 0.7, 0.5, 0.74, 0.66][i]), line([0.5, 0.7, 0.44, 0.62, 0.4, 0.54][i]),
167
+ i === 0 ? glyph('pointer', 'ts-ptr') : null));
168
+ const menu = h('div', 'ts-menu ts-ctx', [['move', 0.6], ['sliders', 0.74], ['trash', 0.5]].map(([icon, width], i) => h('span', `ts-option o${i}`, glyph(icon), line(width))));
169
+ stage.append(h('div', 'ts-win ts-boardwin', h('div', 'ts-main', topBar({ title: el('b', 'ts-title', t('Home')), keys: HOME_KEYS }), h('div', 'ts-grid6', cards, menu))));
170
+ return [250, 1100, 2000, 3100, 4000];
171
+ },
172
+
173
+ // Widgets: small cards of Home that say how the computer and each project are doing.
174
+ widgets(stage) {
175
+ const widget = (i, icon, ...body) => set(card(`ts-widget w${i}`, h('span', 'ts-widget-head', glyph(icon), line(0.5, 'ts-l ts-strong')), ...body), { i });
176
+ stage.append(h('div', 'ts-widgets',
177
+ widget(0, 'gauge', meter(0.34, '34%'), meter(0.62, '62%')),
178
+ widget(1, 'server', h('span', 'ts-serve', el('i', 'ts-dot'), el('em', null, ':5173')), h('span', 'ts-serve s2', el('i', 'ts-dot'), el('em', null, ':3000'))),
179
+ widget(2, 'brain', meter(0.74, '74%'), line(0.62)),
180
+ widget(3, 'chip', h('span', 'ts-count', el('b', null, '8'), el('em', null, '/300')), meter(0.08))));
181
+ return [250, 700, 1150, 1600];
182
+ },
183
+
184
+ // Inside a project: the conversations, the files beside them and every project in the sidebar,
185
+ // where a light says an AI is working and then that it finished.
186
+ project(stage) {
187
+ const files = h('div', 'ts-tool',
188
+ h('div', 'ts-tool-tabs', h('span', 'ts-tab', el('span', null, t('Files')), glyph('close'))),
189
+ h('div', 'ts-tool-body', [['folder', 0.5, 0], ['folder', 0.36, 0], ['file-new', 0.44, 1], ['file-new', 0.56, 1], ['file-new', 0.4, 0]].map(([icon, width, deep], i) => set(h('span', `ts-file${deep ? ' deep' : ''}`, glyph(icon), line(width)), { i }))));
190
+ stage.append(h('div', 'ts-win ts-project', sidebar({ on: 'chat', chats: 1 }), h('div', 'ts-main', topBar({}), h('div', 'ts-thread', mine([0.6], 'claude'), answer('claude', [0.92, 0.7])), composer()), files));
191
+ return [250, 1100, 2300, 3500];
192
+ },
193
+
194
+ // Talking: written in the box, it goes up as your green bubble; the AI you chose answers under
195
+ // its chip, with its tokens and the keys to copy, rate or reply.
196
+ talk(stage) {
197
+ const typed = h('span', 'ts-typed', el('b', 'ts-at', '@claude'), line(0.46, 'ts-l ts-grow'), el('i', 'ts-caret'));
198
+ stage.append(h('div', 'ts-win ts-talk', sidebar({ on: 'chat', projects: 2 }), h('div', 'ts-main', topBar({}), h('div', 'ts-thread', mine([0.66], 'claude'), answer('claude', [0.94, 0.8, 0.5])), composer({ typed }))));
199
+ return [250, 1700, 2500, 3200, 4200];
200
+ },
201
+
202
+ // Modes: the box's mode chip opens its five levels; #3 and #4 open only once you confirm, #4 twice.
203
+ modes(stage) {
204
+ // The box's own names for the five levels (public/app.js, MODES), so the scene reads like the box.
205
+ const words = ['Not saved', 'Just chat', 'Can create', 'Can edit', 'Full access'];
206
+ const options = words.map((word, n) => h('span', `ts-option o${n}`, el('b', 'ts-n', `#${n}`), el('span', 'ts-w', t(word)), el('span', 'ts-gap'),
207
+ n >= 3 ? h('span', 'ts-lockset', glyph('lock', 'ts-i ts-shut'), glyph('lock-open', 'ts-i ts-opened')) : null,
208
+ n === 4 ? h('span', 'ts-twice', el('i'), el('i')) : null));
209
+ const menu = h('div', 'ts-menu ts-levels', el('i', 'ts-pick'), options);
210
+ const chip = h('span', 'ts-chip ts-mode-chip', h('span', 'ts-mc-words ts-cw', words.map((word, n) => el('span', `ts-mc m${n}`, `#${n} ${t(word)}`))), glyph('chevron'));
211
+ stage.append(h('div', 'ts-modes', menu, h('div', 'ts-box ts-box-small', h('div', 'ts-box-chips', face('claude'), chip, el('span', 'ts-gap'), glyph('return')))));
212
+ return [250, 1300, 2500, 3700];
213
+ },
214
+
215
+ // Settings: ⌘ , opens them, / finds a setting, a change shows at once — light to dark here —, and
216
+ // Diagnostics says what to do when something fails.
217
+ settings(stage) {
218
+ const nav = [['appearance', 'Appearance'], ['agents', 'Agents'], ['shield', 'Permissions'], ['chip', 'Local AI'], ['mother', 'Diagnostics']];
219
+ const looks = h('div', 'ts-looks', ['light', 'dark', 'auto'].map((look) => h('span', `ts-look ${look}`, el('i'), el('em', null, t({ light: 'Light', dark: 'Dark', auto: 'Automatic' }[look])))));
220
+ const sheet = h('div', 'ts-sheet ts-settings',
221
+ h('div', 'ts-sheet-head', el('b', null, t('Settings')), h('span', 'ts-search', glyph('search'), el('em', 'ts-slash', '/'), line(0.5, 'ts-l ts-grow')), glyph('close', 'ts-i ts-x')),
222
+ h('div', 'ts-sheet-body',
223
+ h('div', 'ts-nav', el('i', 'ts-pick'), nav.map(([icon, word], i) => h('span', `ts-row n${i}`, glyph(icon), el('span', 'ts-w', t(word))))),
224
+ h('div', 'ts-pane',
225
+ h('div', 'ts-pane-look', el('b', 'ts-pane-title', t('Appearance')), looks, line(0.7), line(0.46)),
226
+ h('div', 'ts-pane-diag', el('b', 'ts-pane-title', t('Diagnostics')), h('div', 'ts-remedy', glyph('mother', 'ts-i ts-beat'), h('span', 'ts-remedy-words', line(0.9), line(0.6)), glyph('check', 'ts-i ts-fix'))))));
227
+ stage.append(sheet, el('kbd', 'ts-cap ts-cmd', keyWords('⌘ ,')));
228
+ // Still, it is Settings in the page's own look, a search under way and Appearance open.
229
+ return Object.assign([250, 900, 1900, 2900, 4300], { rest: 3 });
230
+ },
231
+
232
+ // Modules: a board of tiles, each with its switch; pressed first, switched on, and some open in a
233
+ // window of their own.
234
+ modules(stage) {
235
+ const icons = ['mod-ash', 'mod-intents', 'mod-github', 'mod-notes', 'mod-reminders', 'mod-mcp'];
236
+ const tiles = icons.map((icon, i) => set(h('div', `ts-mod m${i}`, glyph(icon, 'ts-i ts-mod-icon'), h('span', 'ts-mod-words', line(0.7, 'ts-l ts-strong'), line(0.9)), switchKey(), i === 0 ? glyph('pointer', 'ts-ptr') : null), { i }));
237
+ const note = h('div', 'ts-float', h('span', 'ts-float-head', glyph('mod-notes'), el('b', null, t('Notes')), el('span', 'ts-gap'), glyph('close')), line(0.86), line(0.62), line(0.74));
238
+ stage.append(h('div', 'ts-sheet ts-modules', h('div', 'ts-sheet-head', el('b', null, t('Modules')), h('span', 'ts-search', glyph('search'), line(0.4))), h('div', 'ts-mods', tiles)), note);
239
+ return [250, 1100, 1800, 2800];
240
+ },
241
+
242
+ // Local AI: a model that fits the computer comes down once, and you choose which projects use it.
243
+ local(stage) {
244
+ const size = `7B · ${(4.7).toLocaleString(language())} GB`;
245
+ const ai = card('ts-local',
246
+ h('span', 'ts-local-head', face('madre'), h('span', 'ts-local-words', el('b', null, t('Local AI')), line(0.7))),
247
+ h('span', 'ts-model', glyph('chip'), el('em', null, size)), meter(1));
248
+ const projects = h('div', 'ts-uses', [0, 1, 2].map((i) => set(card(`ts-use u${i}`, glyph('folder'), line([0.62, 0.5, 0.72][i], 'ts-l ts-strong'), el('span', 'ts-gap'), switchKey(), el('i', 'ts-wire')), { i })));
249
+ stage.append(h('div', 'ts-localset', ai, projects));
250
+ return [250, 800, 2500, 3200];
251
+ },
252
+
253
+ // The Coordinator: it sees every project and carries an order from one to another, up to #2 on
254
+ // its own; from any project you ask it with /bishop.
255
+ coordinator(stage) {
256
+ const projects = h('div', 'ts-row3', [0, 1, 2].map((i) => card(`ts-pc c${i}`, glyph('folder'), line([0.62, 0.5, 0.7][i], 'ts-l ts-strong'), el('i', 'ts-dot'))));
257
+ const wires = '<svg class="ts-wires" viewBox="0 0 320 150" preserveAspectRatio="none" aria-hidden="true"><path d="M160 50L66 100"/><path d="M160 50L160 100"/><path d="M160 50L254 100"/></svg>';
258
+ const hub = h('div', 'ts-hub', face('bishop', 'ts-face ts-bishop'), el('span', 'ts-said', '/bishop'), el('span', 'ts-limit', '#2'));
259
+ const order = h('span', 'ts-order', line(0.7), line(0.5));
260
+ const stageWires = el('div', 'ts-wireset');
261
+ stageWires.innerHTML = wires; // trusted: our own markup
262
+ stage.append(h('div', 'ts-coordset', stageWires, hub, projects, order));
263
+ return [250, 1100, 2100, 3100];
264
+ },
265
+
266
+ // Connections: two projects joined with your signature; notes already in use go across, the files
267
+ // and the conversations stay where they are.
268
+ links(stage) {
269
+ const project = (side) => card(`ts-lp ${side}`,
270
+ h('span', 'ts-lp-head', glyph('folder'), line(0.6, 'ts-l ts-strong')),
271
+ [0, 1, 2].map((i) => set(h('span', `ts-note n${i}`, el('i', 'ts-dot'), line([0.8, 0.6, 0.7][i])), { i })),
272
+ h('span', 'ts-files', glyph('lock'), line(0.5)));
273
+ const link = h('div', 'ts-link', el('i', 'ts-wire'), h('span', 'ts-seal', glyph('links')), [0, 1, 2].map((i) => set(el('i', 'ts-flow'), { i })));
274
+ stage.append(h('div', 'ts-links', project('a'), link, project('b')));
275
+ return [250, 1100, 2000, 3000];
276
+ },
277
+
278
+ // The maps: what a project remembers, one star each; and the projects, joined by carrying one
279
+ // onto another.
280
+ maps(stage) {
281
+ const STARS = [[24, 30], [70, 22], [80, 58], [62, 80], [30, 74], [14, 52], [46, 14], [88, 36], [40, 88], [56, 42], [36, 46], [72, 70]];
282
+ const memory = h('div', 'ts-map ts-memory', el('i', 'ts-core'), STARS.map(([x, y], i) => set(el('i', `ts-star${i % 4 === 1 ? ' acc' : ''}`), { x: `${x}%`, y: `${y}%`, i })), el('span', 'ts-map-name', t('Memory map')));
283
+ const NODES = [[22, 34], [58, 26], [78, 66], [34, 72]];
284
+ const wires = el('div', 'ts-wireset');
285
+ wires.innerHTML = '<svg class="ts-wires" viewBox="0 0 320 150" preserveAspectRatio="none" aria-hidden="true"><path d="M70 51L186 39"/><path class="ts-new" d="M109 108L186 39"/></svg>'; // trusted: our own markup
286
+ const nodes = NODES.map(([x, y], i) => set(h('span', `ts-node n${i}`, glyph('folder'), i === 3 ? glyph('pointer', 'ts-ptr') : null), { x: `${x}%`, y: `${y}%` }));
287
+ const projects = h('div', 'ts-map ts-projmap', wires, nodes, el('span', 'ts-map-name', t('Project map')));
288
+ stage.append(h('div', 'ts-maps', memory, projects));
289
+ return [250, 900, 2000, 2900];
290
+ },
291
+
292
+ // The phone: a code joins it to the computer; up to #2 from there, and what you start on one goes
293
+ // on on the other.
294
+ phone(stage) {
295
+ // A code, not an icon: a few squares in a fixed pattern, its three corners as a code's.
296
+ const QR = '1110101111001010110111100011110100101001111101011100101001101111';
297
+ const code = h('div', 'ts-qr', [...QR].map((bit) => el('i', bit === '1' ? 'on' : null)));
298
+ const mac = h('div', 'ts-win ts-mac', sidebar({ on: 'chat', chats: 1, projects: 1 }), h('div', 'ts-main', topBar({ keys: ['phone', 'code', 'globe'], lit: 'phone' }), h('div', 'ts-thread', mine([0.6]), answer('claude', [0.8, 0.5]), h('div', 'ts-mine ts-later', h('div', 'ts-bubble', line(0.7))))), h('div', 'ts-qrcard', code));
299
+ const phone = h('div', 'ts-phone', h('span', 'ts-phone-top', line(0.4, 'ts-l ts-strong')), h('div', 'ts-thread', mine([0.7]), answer('claude', [0.9, 0.6]), h('div', 'ts-mine ts-later', h('div', 'ts-bubble', line(0.7)))), h('span', 'ts-phone-box', el('span', 'ts-limit', '#2'), el('span', 'ts-gap'), glyph('return')));
300
+ stage.append(h('div', 'ts-phoneset', mac, h('span', 'ts-air', [0, 1, 2].map((i) => set(el('i'), { i }))), phone));
301
+ return [250, 1000, 2000, 3100];
302
+ },
303
+
304
+ // Gestures: ? opens the sheet of every shortcut, anywhere.
305
+ gestures(stage) {
306
+ const groups = [['⌘ ,', 'Esc', '?'], ['↵', '⌥ ↵', '@ # ! /'], ['⌘ P', '⌘ S', '⌘ F']];
307
+ const sheet = h('div', 'ts-sheet ts-gest',
308
+ h('div', 'ts-sheet-head', el('b', null, t('Gestures and shortcuts')), el('span', 'ts-gap'), glyph('close', 'ts-i ts-x')),
309
+ h('div', 'ts-groups', groups.map((rows, g) => h('div', `ts-group g${g}`, line(0.42, 'ts-l ts-strong'), rows.map((cap, i) => set(h('span', `ts-krow${g === 0 && i === 0 ? ' first' : ''}`, line([0.7, 0.5, 0.6][i]), el('kbd', null, keyWords(cap))), { i: g * 3 + i }))))));
310
+ stage.append(el('kbd', 'ts-cap ts-q', '?'), sheet);
311
+ return [250, 900, 1600, 2800];
312
+ },
84
313
  };
85
314
 
315
+ // The beats of the scene in sight. One plays at a time: a new chapter stops the last one, and so does
316
+ // closing the window; a scene taken off the page stops on its own.
317
+ const SCENE_HOLD = 3400;
318
+ const sceneTimers = new Set();
319
+ function stopScene() {
320
+ for (const timer of sceneTimers) clearTimeout(timer);
321
+ sceneTimers.clear();
322
+ }
323
+ function playScene(scene, id) {
324
+ stopScene();
325
+ const stage = el('div', 'ts-stage');
326
+ scene.append(stage);
327
+ const beats = SCENES[id]?.(stage) ?? [];
328
+ if (!beats.length) return;
329
+ // Standing still it shows the beat that says the most (`rest`), the last one unless it says another.
330
+ if (still()) { for (let i = 0; i < (beats.rest ?? beats.length); i += 1) scene.classList.add(`b${i + 1}`); return; }
331
+ const later = (ms, act) => {
332
+ const timer = setTimeout(() => { sceneTimers.delete(timer); if (scene.isConnected) act(); }, ms);
333
+ sceneTimers.add(timer);
334
+ };
335
+ const run = () => {
336
+ beats.forEach((ms, i) => later(ms, () => scene.classList.add(`b${i + 1}`)));
337
+ const end = beats.at(-1) + SCENE_HOLD;
338
+ later(end, () => scene.classList.add('out'));
339
+ later(end + 460, () => {
340
+ scene.classList.add('reset');
341
+ beats.forEach((_, i) => scene.classList.remove(`b${i + 1}`));
342
+ void scene.offsetWidth; // the reset lands before the picture comes back
343
+ scene.classList.remove('reset', 'out');
344
+ run();
345
+ });
346
+ };
347
+ run();
348
+ }
349
+
86
350
  // What a first-time card speaks of, lit, and the rest of the page a shade quieter: the card needs
87
351
  // no beak to say where it points (2026-10-15). A ring laid over the place, never the place itself
88
352
  // lifted (a key inside the bar cannot leave the bar's layer). `place()` follows it when it moves;
@@ -117,7 +381,7 @@ export function spotlight(node) {
117
381
  // `phone`: none of it here (a phone, or the right half of a split window); `device`: this page is a
118
382
  // phone, which gets one card the first time instead of the bonjour.
119
383
  // `hidden`: the chapters whose thing is not offered on this copy; they are not told at all.
120
- export function startTour({ page, go = {}, ready = () => true, phone = false, device = false, pillSlot = null, welcome = null, onProjects = null, onChange = null, hidden = () => [] } = {}) {
384
+ export function startTour({ page, go = {}, ready = () => true, phone = false, device = false, pillSlot = null, welcome = null, onProjects = null, onChange = null, hidden = () => [], missions = null } = {}) {
121
385
  let info = null;
122
386
  let state = null;
123
387
  let windowNode = null;
@@ -127,13 +391,14 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
127
391
  const loaded = (phone ? Promise.resolve(null) : tourApi.read()).then((answer) => {
128
392
  info = answer;
129
393
  state = answer?.state ?? null;
394
+ setMissions(state);
130
395
  paintPill();
131
396
  onChange?.(state);
132
397
  return answer;
133
398
  });
134
399
  const keep = async (change) => {
135
400
  const answer = await tourApi.change(change);
136
- if (answer?.state) state = answer.state;
401
+ if (answer?.state) { state = answer.state; setMissions(state); }
137
402
  paintPill();
138
403
  onChange?.(state);
139
404
  return state;
@@ -215,10 +480,24 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
215
480
  }
216
481
  if (device) setTimeout(phoneCard, 1200);
217
482
 
218
- // ---- The pill: «Continue the tour · 4 of 12», while there is a tour to continue.
483
+ // ---- The pill: «Your first steps · 2 of 5» while there are missions to do (2026-11-11, missions.js),
484
+ // and «Continue the tour · 4 of 12» once they are done or put away and the tour is still unread.
485
+ // A mission done in another tab or project is seen here when the pill is drawn again.
486
+ onMissions(() => paintPill());
487
+ const missionsWanted = () => Boolean(missions) && !phone && Boolean(state?.welcome?.finished || state?.bonjourAt) && !missionsState().missionsHidden && missionsLeft() > 0;
219
488
  function paintPill() {
220
489
  if (!pillSlot) return;
221
490
  pillSlot.replaceChildren();
491
+ if (missionsWanted()) {
492
+ pillSlot.hidden = false;
493
+ const doneCount = MISSIONS.length - missionsLeft();
494
+ const pill = el('span', 'tour-pill missions-pill');
495
+ const go = key('tour-pill-go', fill(t('Your first steps · {n} of {total}'), { n: doneCount, total: MISSIONS.length }), () => openMissions({ ...missions, openTour: () => openChapters(state?.at ?? null) }));
496
+ go.dataset.short = fill(t('Steps · {n}/{total}'), { n: doneCount, total: MISSIONS.length });
497
+ pill.append(go);
498
+ pillSlot.append(pill);
499
+ return;
500
+ }
222
501
  const list = chapters();
223
502
  const show = state?.bonjourAt && !state.finished && !windowNode?.open && !phone;
224
503
  pillSlot.hidden = !show;
@@ -373,10 +652,10 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
373
652
  logo.innerHTML = MADRE_LOGO; // trusted: our own SVG string
374
653
  words.append(logo, el('span', 'wn-eyebrow'), title);
375
654
  // The ✕ every window of MADRE has (1.1): it turns and goes red under the pointer.
376
- const close = key('tour-close x-close x-only', null, () => windowNode.close());
655
+ const close = key('surface-mode close x-close x-only', null, () => windowNode.close());
377
656
  close.innerHTML = `<span class="x-icon">${CLOSE_ICON}</span>`; // trusted: our own SVG string
378
657
  close.setAttribute('aria-label', t('Close'));
379
- head.append(words, close);
658
+ head.append(words, closeKeys(close));
380
659
  const body = el('div', 'tour-body');
381
660
  const nav = el('ol', 'tour-nav');
382
661
  nav.setAttribute('aria-label', t('Chapters'));
@@ -386,6 +665,7 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
386
665
  sheet.append(head, body);
387
666
  windowNode.append(sheet);
388
667
  windowNode.addEventListener('close', () => {
668
+ stopScene();
389
669
  letGoIfDone();
390
670
  const list = chapters();
391
671
  const all = list.every((chapter) => state?.done.includes(chapter.id));
@@ -436,7 +716,7 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
436
716
  table.append(line);
437
717
  }
438
718
  scene.append(table);
439
- } else scene.innerHTML = SCENES[chapter.id]?.() ?? ''; // trusted: our own markup
719
+ } else playScene(scene, chapter.id);
440
720
  const words = el('div', 'tour-words');
441
721
  words.append(el('span', 'tour-step', fill(t('{n} of {total}'), { n: index + 1, total: list.length })), el('h3', null, say(chapter.title)));
442
722
  // Whoever came from 0.7.2 reads first what is new or different here.
@@ -489,7 +769,8 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
489
769
  page2.append(scene, words);
490
770
  main.replaceChildren(page2);
491
771
  main.scrollTop = 0;
492
- acts.querySelector('.tour-btn.primary')?.focus({ preventScroll: true });
772
+ // Ready for ↵, not shown as chosen: no ring until the keyboard is used (2026-11-13).
773
+ focusQuietly(acts.querySelector('.tour-btn.primary'));
493
774
  }
494
775
 
495
776
  // The key that goes on holds the focus, so ↵ presses it, without wearing the focus ring nobody
@@ -501,7 +782,7 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
501
782
  const wake = () => button.classList.remove('quiet-focus');
502
783
  button.addEventListener('keydown', wake, { once: true });
503
784
  button.addEventListener('blur', wake, { once: true });
504
- button.focus({ focusVisible: false });
785
+ button.focus({ focusVisible: false, preventScroll: true });
505
786
  }
506
787
  // ---- `?`: the sheet of gestures, anywhere. Its keys are the keyboard's in front of the person:
507
788
  // ⌘ on a Mac, Ctrl+ anywhere else.
@@ -529,10 +810,10 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
529
810
  const title = el('h2', null, t('Gestures and shortcuts'));
530
811
  title.id = 'tour-gestures-title';
531
812
  words.append(title);
532
- const close = key('tour-close x-close x-only', null, () => sheetNode.close());
813
+ const close = key('surface-mode close x-close x-only', null, () => sheetNode.close());
533
814
  close.innerHTML = `<span class="x-icon">${CLOSE_ICON}</span>`; // trusted: our own SVG string
534
815
  close.setAttribute('aria-label', t('Close'));
535
- head.append(words, close);
816
+ head.append(words, closeKeys(close));
536
817
  const body = el('div', 'tour-gesture-body');
537
818
  body.append(gestureGrid());
538
819
  sheet.append(head, body);
@@ -604,7 +885,7 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
604
885
  // card of its own beside the window — on its right, else on its left, else over its top corner.
605
886
  // It belongs to the window (so the window does not make it unreachable) and leaves with it.
606
887
  if (inside) {
607
- const dialog = anchor.closest('dialog') ?? anchor;
888
+ const dialog = anchor.closest('dialog') ?? anchor.closest('[role="dialog"][aria-modal="true"]') ?? anchor;
608
889
  card.classList.remove('inline');
609
890
  card.classList.add('beside-window');
610
891
  if (typeof card.showPopover === 'function') card.popover = 'manual';
@@ -618,14 +899,21 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
618
899
  const framed = whole.width >= window.innerWidth - 4 && dialog.firstElementChild ? dialog.firstElementChild.getBoundingClientRect() : whole;
619
900
  const height = card.getBoundingClientRect().height;
620
901
  const top = Math.max(12, Math.min(window.innerHeight - height - 12, framed.top));
902
+ // With no room on either side, in the window's bottom corner: its top is its bar, its name and
903
+ // its search, which the hint covered.
621
904
  let left = framed.right - width - 16;
622
- let at = top + 16;
905
+ let at = Math.max(top + 16, Math.min(window.innerHeight - height - 12, framed.bottom - height - 16));
623
906
  if (window.innerWidth - framed.right >= width + 28) { left = framed.right + 16; at = top; } else if (framed.left >= width + 28) { left = framed.left - width - 16; at = top; }
624
907
  Object.assign(card.style, { position: 'fixed', margin: '0', left: `${left}px`, top: `${at}px` });
625
908
  };
626
909
  placeBeside();
627
910
  window.addEventListener('resize', placeBeside);
628
- dialog.addEventListener('close', () => { window.removeEventListener('resize', placeBeside); done(); }, { once: true });
911
+ const leave = () => { window.removeEventListener('resize', placeBeside); done(); };
912
+ if (dialog.matches('dialog')) dialog.addEventListener('close', leave, { once: true });
913
+ else {
914
+ // A window of the page's own is taken away, not closed: the hint goes with it.
915
+ const gone = setInterval(() => { if (!card.isConnected) { clearInterval(gone); if (hintNode === card) leave(); else window.removeEventListener('resize', placeBeside); } }, 400);
916
+ }
629
917
  return true;
630
918
  }
631
919
  if (typeof card.showPopover === 'function') card.popover = 'manual';
@@ -714,7 +1002,9 @@ export function startTour({ page, go = {}, ready = () => true, phone = false, de
714
1002
  if (state?.hints?.[id]) return;
715
1003
  setTimeout(() => {
716
1004
  const box = opened();
717
- const modal = Boolean(box?.closest?.('dialog')?.matches?.(':modal'));
1005
+ // A window of the page's own (the Market and Modules: a div that says it is modal) is a
1006
+ // window too: the hint sits beside it, not over its bar (2026-11-13, Modules the first time).
1007
+ const modal = Boolean(box?.closest?.('dialog')?.matches?.(':modal') || box?.closest?.('[role="dialog"][aria-modal="true"]'));
718
1008
  const into = modal ? (inside?.(box) ?? box) : null;
719
1009
  void hint(id, into ?? box ?? node, { title: title(), text: text(), inside: modal });
720
1010
  }, after);