@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.
- package/CHANGELOG.en.md +20 -1
- package/CHANGELOG.md +20 -1
- package/TRADEMARKS.md +6 -2
- package/bin/madre.mjs +4 -2
- package/docs/REFERENCE.md +3 -3
- package/docs/SDK.md +28 -1
- package/docs/en/REFERENCE.md +2 -2
- package/docs/en/SDK.md +26 -0
- package/docs/sdk/hello-module.mjs +38 -3
- package/habilidades/explicamelo-facil/HABILIDAD.md +19 -0
- package/habilidades/hojas-de-calculo/HABILIDAD.md +18 -0
- package/habilidades/mensajes-a-clientes/HABILIDAD.md +19 -0
- package/habilidades/publicaciones-para-redes/HABILIDAD.md +19 -0
- package/habilidades/resumen-y-pendientes/HABILIDAD.md +18 -0
- package/habilidades/tu-pagina-paso-a-paso/HABILIDAD.md +19 -0
- package/package.json +4 -3
- package/public/activity.js +57 -22
- package/public/app.js +3998 -762
- package/public/assets/brand/OFL-SpaceGrotesk.txt +93 -0
- package/public/assets/brand/SpaceGrotesk-latin-ext.woff2 +0 -0
- package/public/assets/brand/SpaceGrotesk-latin.woff2 +0 -0
- package/public/assets/brand/madre-app-180.png +0 -0
- package/public/assets/brand/madre-app-192.png +0 -0
- package/public/assets/brand/madre-app-512.png +0 -0
- package/public/assets/brand/madre-app.svg +1 -1
- package/public/assets/brand/madre-favicon.svg +1 -1
- package/public/attribution.js +28 -27
- package/public/auto-open.js +102 -0
- package/public/brands.js +9 -6
- package/public/changes.js +63 -0
- package/public/en.js +1085 -101
- package/public/es.js +2395 -1688
- package/public/i18n.js +11 -0
- package/public/index.html +28 -27
- package/public/loader.js +322 -117
- package/public/macroverso.js +33 -350
- package/public/manual-content.js +37 -7
- package/public/manual.js +21 -6
- package/public/market-view.js +212 -105
- package/public/market.js +10 -2
- package/public/mcp-catalog.js +7 -2
- package/public/missions.js +169 -0
- package/public/news-scenes.js +110 -3
- package/public/nostromo-engine.js +935 -654
- package/public/notices.js +14 -2
- package/public/notifications.js +119 -0
- package/public/provider-marks.js +170 -0
- package/public/provider-pick.js +147 -0
- package/public/resay.js +1 -0
- package/public/review-ask.js +16 -13
- package/public/routing.js +29 -3
- package/public/salas-mac.css +257 -40
- package/public/salas-mac.html +5 -5
- package/public/salas-mac.js +376 -97
- package/public/salas.css +2 -2
- package/public/salas.html +2 -2
- package/public/salas.js +1 -1
- package/public/starters.js +128 -0
- package/public/styles.css +2656 -336
- package/public/subscription.js +303 -0
- package/public/terms-field.js +170 -0
- package/public/terms.js +117 -19
- package/public/tips.js +41 -7
- package/public/tour-chapters.js +35 -35
- package/public/tour.js +333 -43
- package/public/troubleshooting.js +100 -7
- package/public/welcome-scene.js +117 -29
- package/public/welcome.js +364 -60
- package/src/adapters/claude.mjs +2 -1
- package/src/adapters/codex.mjs +2 -1
- package/src/adapters/cursor.mjs +9 -6
- package/src/adapters/gemini.mjs +4 -0
- package/src/adapters/grok.mjs +6 -4
- package/src/adapters/madre.mjs +71 -23
- package/src/adapters/opencode.mjs +15 -2
- package/src/adapters/steps.mjs +176 -0
- package/src/app-invite.mjs +90 -0
- package/src/billing-key.mjs +8 -0
- package/src/billing.mjs +317 -0
- package/src/bridge/policy.mjs +1 -1
- package/src/capabilities.mjs +17 -11
- package/src/chats.mjs +44 -2
- package/src/checkpoint.mjs +5 -1
- package/src/commands.mjs +5 -2
- package/src/directives.mjs +1 -0
- package/src/event-store.mjs +15 -0
- package/src/extensions.mjs +5 -1
- package/src/ficha.mjs +16 -0
- package/src/image-studio.mjs +13 -3
- package/src/install-metrics.mjs +9 -3
- package/src/lease.mjs +1 -1
- package/src/looks.mjs +4 -1
- package/src/mcp/image-server.mjs +59 -90
- package/src/modules/ahp.mjs +2 -1
- package/src/modules/github.mjs +6 -2
- package/src/modules/image-providers.mjs +281 -0
- package/src/modules/image-studio.mjs +100 -19
- package/src/modules/index.mjs +7 -1
- package/src/modules/intents-observe.mjs +3 -1
- package/src/modules/playwright.mjs +33 -4
- package/src/modules/reminders.mjs +42 -2
- package/src/modules/ripley.mjs +2 -1
- package/src/modules/sdk.mjs +6 -1
- package/src/opencode-health.mjs +1 -1
- package/src/outbound.mjs +80 -6
- package/src/quota-sources.mjs +148 -3
- package/src/review-ask.mjs +55 -31
- package/src/room/changes.mjs +79 -0
- package/src/room/economy.mjs +1 -1
- package/src/room/guard.mjs +8 -1
- package/src/room/prompt.mjs +20 -4
- package/src/room.mjs +87 -21
- package/src/salas.mjs +30 -3
- package/src/server.mjs +545 -59
- package/src/setup.mjs +1 -1
- package/src/skills.mjs +10 -0
- package/src/terms.mjs +23 -5
- package/src/tour.mjs +18 -3
- package/src/updates.mjs +47 -4
- package/src/web-preview.mjs +181 -0
- package/src/whats-new.mjs +76 -4
|
@@ -179,6 +179,24 @@ export const CONDITIONS = [
|
|
|
179
179
|
linux: ['npx @jossuealcala/madre setup', '# press [m] and pick a provider/model that has a session', 'PULSE_OPENCODE_MODEL=openai/gpt-5.6-sol npx @jossuealcala/madre start', 'opencode auth logout anthropic']
|
|
180
180
|
},
|
|
181
181
|
},
|
|
182
|
+
{
|
|
183
|
+
// The QA of the app (2026-11-13): with no model chosen, OpenCode picked one its provider does not
|
|
184
|
+
// have (anthropic/claude-fable-5-1) and every turn ended in «APIError: Not Found», read by the
|
|
185
|
+
// person as a sign-in that would not work. Same way out as MU-007: a model that answers.
|
|
186
|
+
id: 'opencode-default-model-missing',
|
|
187
|
+
code: 'MU-094',
|
|
188
|
+
solvedIn: 'connections',
|
|
189
|
+
agent: 'opencode',
|
|
190
|
+
severity: 'blocking',
|
|
191
|
+
title: 'The model OpenCode picked does not exist at its provider',
|
|
192
|
+
match: /APIError:\s*Not Found|Error:\s*Not Found\b|model[^\n]{0,40}not found/i,
|
|
193
|
+
diagnosis: 'With no model chosen in MADRE, OpenCode picks one by itself, and its provider answered that it does not have it. Your sign-in is fine: the model is what fails.',
|
|
194
|
+
remedy: 'Retry on a model that works (MADRE offers one under the error), or choose OpenCode\'s model in Settings › Agents › OpenCode.',
|
|
195
|
+
fixes: {
|
|
196
|
+
darwin: ['npx @jossuealcala/madre setup', '# press [m] and pick a model that answers, e.g. openai/gpt-5.6-sol or opencode/big-pickle', '# one-off alternative:', 'PULSE_OPENCODE_MODEL=opencode/big-pickle npx @jossuealcala/madre start'],
|
|
197
|
+
linux: ['npx @jossuealcala/madre setup', '# press [m] and pick a model that answers', 'PULSE_OPENCODE_MODEL=opencode/big-pickle npx @jossuealcala/madre start'],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
182
200
|
{
|
|
183
201
|
// Seen in a real project (2026-10-19): OpenCode's default model was Anthropic's, through an API
|
|
184
202
|
// key with no balance, and every turn of a plan failed with the provider's words in English.
|
|
@@ -237,7 +255,7 @@ export const CONDITIONS = [
|
|
|
237
255
|
agent: 'gemini',
|
|
238
256
|
severity: 'blocking',
|
|
239
257
|
title: 'This Gemini model is not available for your key',
|
|
240
|
-
match: /does not exist or is not available for this key|no existe o no está disponible para esta llave|is not found for API version|is not supported for generateContent/i,
|
|
258
|
+
match: /does not exist or is not available for this key|no existe o no está disponible para esta llave|is not found for API version|is not supported for generateContent|is no longer available to new users/i,
|
|
241
259
|
diagnosis: 'Gemini answers through its API with your key, and Google says the model chosen in the box does not exist or this key cannot use it. It happens with a model Google retired, a preview your key has no access to, or a name written by hand.',
|
|
242
260
|
remedy: 'Choose another Gemini model in the box, or leave the default one. If you need that model, check in AI Studio that your key has access to it.',
|
|
243
261
|
fixes: same(['# the models your key opens: https://aistudio.google.com/app/apikey']),
|
|
@@ -267,6 +285,81 @@ export const CONDITIONS = [
|
|
|
267
285
|
remedy: 'Ask the module\'s author for a version made for MADRE 1.1.3, which asks MADRE for what it needs instead of doing it itself. Meanwhile, turn it off in Modules.',
|
|
268
286
|
fixes: same(['# Modules › the module › turn it off']),
|
|
269
287
|
},
|
|
288
|
+
{
|
|
289
|
+
// The sentinel's first reading (S-2, 2026-11-09): OpenCode's provider answered 502.
|
|
290
|
+
id: 'provider-bad-gateway',
|
|
291
|
+
code: 'MU-088',
|
|
292
|
+
severity: 'transient',
|
|
293
|
+
title: 'The AI\'s provider did not answer (Bad Gateway)',
|
|
294
|
+
match: /APIError: Bad Gateway|\bBad Gateway\b|HTTP 502\b/i,
|
|
295
|
+
diagnosis: 'The server of the company behind this AI answered with a 502: it could not reach its own model in that moment. It is on their side, not in MADRE or in the project.',
|
|
296
|
+
remedy: 'Try again in a moment. If it keeps happening, choose another model or ask another agent meanwhile.',
|
|
297
|
+
fixes: same(['# try again in a moment, or choose another model in the box']),
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
// S-5: OpenCode through OpenRouter, with privacy settings that leave no provider for the model.
|
|
301
|
+
id: 'opencode-provider-policy',
|
|
302
|
+
code: 'MU-089',
|
|
303
|
+
agent: 'opencode',
|
|
304
|
+
severity: 'blocking',
|
|
305
|
+
title: 'No provider of this model fits your data policy',
|
|
306
|
+
match: /guardrail restrictions and data policy|No endpoints found matching your data policy/i,
|
|
307
|
+
diagnosis: 'OpenCode asks OpenRouter for this model, and OpenRouter has no provider of it that fits the privacy settings of your account (for example, providers that may train on your prompts are excluded). Nothing in MADRE or the project is wrong.',
|
|
308
|
+
remedy: 'Choose another model in the box, or allow more providers in OpenRouter\'s privacy settings.',
|
|
309
|
+
fixes: same(['# OpenRouter › Settings › Privacy: https://openrouter.ai/settings/privacy']),
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
// S-15: a model whose providers do not take tools; MADRE's OpenCode works with tools.
|
|
313
|
+
id: 'opencode-model-no-tools',
|
|
314
|
+
code: 'MU-090',
|
|
315
|
+
agent: 'opencode',
|
|
316
|
+
severity: 'blocking',
|
|
317
|
+
title: 'This model does not take tools, and OpenCode needs them',
|
|
318
|
+
match: /No endpoints found that support tool use/i,
|
|
319
|
+
diagnosis: 'Inside MADRE, OpenCode reads the project with tools (reading files, searching). The model chosen has no provider that accepts tools, so the turn cannot start.',
|
|
320
|
+
remedy: 'Choose another model in the box: most current models take tools.',
|
|
321
|
+
fixes: same(['# the box › OpenCode\'s sphere › choose another model']),
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
// S-20 (1.1.1): Codex could not start the helper it runs inside itself.
|
|
325
|
+
id: 'codex-app-server',
|
|
326
|
+
code: 'MU-091',
|
|
327
|
+
agent: 'codex',
|
|
328
|
+
severity: 'blocking',
|
|
329
|
+
title: 'Codex could not start its own helper',
|
|
330
|
+
match: /failed to initialize in-process app-server client/i,
|
|
331
|
+
diagnosis: 'Before answering, Codex starts a helper inside itself, and the system did not let it («Operation not permitted»). It usually comes from a Codex half updated, or from a Codex folder its user cannot write.',
|
|
332
|
+
remedy: 'Update Codex and try again. If it keeps happening, sign Codex in again.',
|
|
333
|
+
fixes: same(['npm install -g @openai/codex@latest', 'codex --version', '# if it keeps happening:', 'codex logout', 'codex login']),
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
// S-4 (1.1.3): Grok on Linux enforces what it may not touch with bubblewrap, and refuses to start
|
|
337
|
+
// without it.
|
|
338
|
+
id: 'grok-needs-bubblewrap',
|
|
339
|
+
code: 'MU-092',
|
|
340
|
+
agent: 'grok',
|
|
341
|
+
severity: 'blocking',
|
|
342
|
+
title: 'Grok needs bubblewrap on Linux',
|
|
343
|
+
match: /bwrap exec failed|Install bubblewrap|could not enforce its deny list/i,
|
|
344
|
+
diagnosis: 'On Linux, Grok keeps itself away from what it must not touch with a small program called bubblewrap, and it refuses to start when it is missing. It is a package of the system, nothing in the project.',
|
|
345
|
+
remedy: 'Install bubblewrap and send the message again.',
|
|
346
|
+
fixes: {
|
|
347
|
+
darwin: ['# only Linux needs it; on a Mac this is not the cause'],
|
|
348
|
+
linux: ['sudo apt install -y bubblewrap', 'bwrap --version'],
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
// D-32, S-1 (OpenCode, 1.1.3) and S-10 (Gemini): a clean exit with nothing written. Since this
|
|
353
|
+
// version OpenCode's line also says why, when it can tell (src/adapters/opencode.mjs).
|
|
354
|
+
id: 'empty-answer',
|
|
355
|
+
code: 'MU-093',
|
|
356
|
+
severity: 'transient',
|
|
357
|
+
title: 'The AI ended without writing an answer',
|
|
358
|
+
match: /exited cleanly without an answer|terminó sin errores pero sin respuesta|only thought and wrote no answer|solo pensó y no escribió|stopped before writing an answer|se detuvo antes de escribir|ran out of room before writing|se quedó sin espacio antes de escribir/i,
|
|
359
|
+
diagnosis: 'The AI finished its turn without an error but also without a word: its model only thought, used its tools and stopped, or ran out of room. Free models do it more often. Nothing in MADRE or the project is wrong.',
|
|
360
|
+
remedy: 'Send the message again. If it repeats, choose another model or ask another agent.',
|
|
361
|
+
fixes: same(['# send it again, or choose another model in the box']),
|
|
362
|
+
},
|
|
270
363
|
{
|
|
271
364
|
// Seen in the diagnostics of 1.1.0 (2026-10-31): Codex on a free ChatGPT account ran out and
|
|
272
365
|
// the room called it an unknown failure.
|
|
@@ -380,7 +473,7 @@ export const CONDITIONS = [
|
|
|
380
473
|
// «Update your environment»: Gemini chosen to use an API key with none set, code 41 too (1.1.2, D-7).
|
|
381
474
|
// Gemini's refusal in MADRE's words, in both languages (1.1.2 diagnostics: 4 copies filed «Google
|
|
382
475
|
// rechazó las credenciales de Gemini» as unknown, and no card matched the English either).
|
|
383
|
-
match: /not logged in|Grok is not signed in|Grok no tiene sesión|sign in required|Error authenticating|unauthorized|please (?:log|sign) ?in|no credentials|set an Auth method|Update your environment and try again|rejected the Gemini credentials|rechazó las credenciales de Gemini/i,
|
|
476
|
+
match: /not logged in|Grok is not signed in|Grok no tiene sesión|sign in required|Error authenticating|unauthorized|please (?:log|sign) ?in|no credentials|set an Auth method|Update your environment and try again|rejected the Gemini credentials|rechazó las credenciales de Gemini|refresh token was already used|Please log out and sign in again|Authentication required/i,
|
|
384
477
|
diagnosis: 'The CLI is on this computer but has no session for its provider. MADRE never stores credentials; each agent keeps its own.',
|
|
385
478
|
remedy: 'This agent has no session yet. Connect it once in Settings › Agents (MADRE runs its sign-in for you, nothing to type in a terminal), or ask the same of an agent that is connected.',
|
|
386
479
|
fixes: same(['npx @jossuealcala/madre setup', '# or directly:', 'codex login', 'claude auth login', 'opencode auth login', 'gemini # then /auth']),
|
|
@@ -564,8 +657,8 @@ export const CONDITIONS = [
|
|
|
564
657
|
severity: 'informational',
|
|
565
658
|
title: 'Web access for an agent',
|
|
566
659
|
match: /scope-[a-z]+-web/,
|
|
567
|
-
diagnosis: 'Every CLI can browse: Codex with --search, Claude Code with WebFetch/WebSearch, Gemini with google_web_search/web_fetch, OpenCode with webfetch/websearch. MADRE
|
|
568
|
-
remedy: '
|
|
660
|
+
diagnosis: 'Every CLI can browse: Codex with --search, Claude Code with WebFetch/WebSearch, Gemini with google_web_search/web_fetch, OpenCode with webfetch/websearch. MADRE has it on for every agent; you can turn it off per agent.',
|
|
661
|
+
remedy: 'To turn it off, switch off Web access for that agent in Settings → Agents; it saves at once. It applies to every turn of that agent; content fetched is sent to its provider.',
|
|
569
662
|
fixes: same(['# Settings → Agents → the agent → Web access']),
|
|
570
663
|
},
|
|
571
664
|
{
|
|
@@ -587,8 +680,8 @@ export const CONDITIONS = [
|
|
|
587
680
|
// was filed as this help card (1.1.0 diagnostics, MU-023 from Codex and OpenCode).
|
|
588
681
|
match: /\bmodes?\b|ghost|exchange|control|airlock|deploy|despleg|producci|override|designation|max mode|#[0-4]\b/i,
|
|
589
682
|
diagnosis: 'Every message goes out at a mode, chosen in the chip after TO @agent (or typed as #2 in the text). #0 INCOGNITO is off the record: nothing is saved, no other agent remembers it, gone on reload, no plan. #1 CHAT ONLY is the default: read and coordinate. #2 CREATE lets the agent add new files and folders anywhere in the project, where they belong; whatever existed before is put back after the turn and the project says so. #3 EDIT puts one agent in command of the project itself: a git restore point is taken first, every change is listed afterwards, writes into .git, .pulse or .env files are reverted on the spot, and UNDO goes back to the restore point. One holder at a time; it needs Max mode #3 and a git repository. Your mode is the ceiling of any plan the message starts, and #3 is never given to a plan step. Each agent has a Max mode in Settings → Permissions; above it, #2 is answered read-only and #3 is refused. When a #1 plan reaches a step that wants to create something, the project pauses and asks you: GRANT ONCE, GRANT FOR PLAN or DENY, with a 3-minute clock; silence denies. #4 FULL ACCESS is EDIT plus commands: tests, builds, git push, deploys with the CLIs and sessions already on this machine. Files still come back with UNDO; what leaves the machine does not, so the unlock asks for the project name twice. An agent that says it needs a "production mode" or "permission to run commands" is asking for #4.',
|
|
590
|
-
remedy: 'Pick the mode in the chip, or type #0..#4 in the message. Raise an agent\'s Max mode in Settings → Permissions, under
|
|
591
|
-
fixes: same(['# chip: TO @codex #1 CHAT ONLY ▾ → choose', '@codex #2 create the poster', '@opencode #4 run the tests and deploy to preview', '# Settings → Permissions →
|
|
683
|
+
remedy: 'Pick the mode in the chip, or type #0..#4 in the message. Raise an agent\'s Max mode in Settings → Permissions, under What each AI may do. EDIT asks for the project name (the folder name) in the unlock; FULL ACCESS asks for it twice.',
|
|
684
|
+
fixes: same(['# chip: TO @codex #1 CHAT ONLY ▾ → choose', '@codex #2 create the poster', '@opencode #4 run the tests and deploy to preview', '# Settings → Permissions → What each AI may do']),
|
|
592
685
|
},
|
|
593
686
|
{
|
|
594
687
|
id: 'lease-missing',
|
|
@@ -608,7 +701,7 @@ export const CONDITIONS = [
|
|
|
608
701
|
match: /scope-[a-z]+-write/,
|
|
609
702
|
diagnosis: 'Every CLI can create files inside a permission to create; each agent\'s Max mode says how far it may go, and nothing is created until you press CREATE.',
|
|
610
703
|
remedy: 'Give the agent a Max mode of #2 or more in Settings → Permissions, then arm CREATE in the Write box for the request.',
|
|
611
|
-
fixes: same(['# Settings → Permissions →
|
|
704
|
+
fixes: same(['# Settings → Permissions → What each AI may do → #2', '# Write box → CREATE (lock) → send']),
|
|
612
705
|
},
|
|
613
706
|
{
|
|
614
707
|
id: 'node-version',
|
package/public/welcome-scene.js
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
// project threads from the edge, one per folder chosen, gathering into a ring round the dot
|
|
16
16
|
// ai the points fall in a slow spiral into a core while it downloads, a fine arc saying how
|
|
17
17
|
// much; once there, they settle in three quiet orbits
|
|
18
|
-
// ready the points draw the logo's
|
|
18
|
+
// ready the points draw the logo's M, whole, above the dot, fed from the edge; then a
|
|
19
|
+
// message bubble opens beside the dot and its words are written in, the caret waiting
|
|
19
20
|
//
|
|
20
21
|
// MADRE's own style, from its brand book (madre-landing/brand-kit): the phosphor is the only colour
|
|
21
22
|
// and means something; nothing spins fast, bounces or glows like neon; changes take about 0.4 s and
|
|
@@ -31,25 +32,12 @@ const frac = (x) => x - Math.floor(x);
|
|
|
31
32
|
const easeInOut = (x) => { const v = clamp01(x); return v < 0.5 ? 4 * v * v * v : 1 - Math.pow(-2 * v + 2, 3) / 2; };
|
|
32
33
|
const hash = (n) => frac(Math.sin(n * 127.1 + 311.7) * 43758.5453);
|
|
33
34
|
|
|
34
|
-
// The logo's beat (madre-mark: …H20 L23.5 2 L28 18 L32 10 L35 10 L37 6 L39 10…): along 0…1, the height
|
|
35
|
-
// in units of the beat (negative is up). The `ready` picture draws it with points.
|
|
36
|
-
const BEAT = [[0, 0], [3.5, -1], [8, 1], [12, 0], [15, 0], [17, -0.5], [19, 0]];
|
|
37
|
-
function beatAt(u) {
|
|
38
|
-
if (u <= 0 || u >= 1) return 0;
|
|
39
|
-
const x = u * 19;
|
|
40
|
-
for (let i = 1; i < BEAT.length; i += 1) {
|
|
41
|
-
const [x0, y0] = BEAT[i - 1];
|
|
42
|
-
const [x1, y1] = BEAT[i];
|
|
43
|
-
if (x <= x1) return y0 + ((y1 - y0) * (x - x0)) / (x1 - x0);
|
|
44
|
-
}
|
|
45
|
-
return 0;
|
|
46
|
-
}
|
|
47
35
|
const bezier = (a, c, b, q) => (1 - q) * (1 - q) * a + 2 * (1 - q) * q * c + q * q * b;
|
|
48
36
|
|
|
49
37
|
// The two looks. In the dark the light adds up, as light does; in the light the points are ink.
|
|
50
38
|
const LOOKS = {
|
|
51
|
-
dark: { ground: [5, 6, 5], ink: [
|
|
52
|
-
light: { ground: [238, 240, 234], ink: [
|
|
39
|
+
dark: { ground: [5, 6, 5], ink: [52, 211, 153], soft: [238, 241, 234], glow: 0.075, scan: 0.03, blend: 'lighter', halo: 0.34 },
|
|
40
|
+
light: { ground: [238, 240, 234], ink: [5, 150, 105], soft: [18, 21, 18], glow: 0.06, scan: 0, blend: 'source-over', halo: 0.18 },
|
|
53
41
|
};
|
|
54
42
|
const rgba = ([r, g, b], a) => `rgba(${r},${g},${b},${clamp01(a)})`;
|
|
55
43
|
|
|
@@ -131,6 +119,101 @@ export function createScene({ still = globalThis.matchMedia?.('(prefers-reduced-
|
|
|
131
119
|
// the dot in the same place, a little above the middle, so the eye has one place to rest.
|
|
132
120
|
const centre = () => ({ cx: w * 0.5, cy: h * 0.44, R: Math.min(h * 0.32, w * 0.16) });
|
|
133
121
|
const drift = (p, t, k = 1) => [Math.sin(t * 0.5 + p.seed * 40) * 3 * k * p.z, Math.cos(t * 0.42 + p.seed2 * 40) * 2.4 * k * p.z];
|
|
122
|
+
// The `ready` picture's line: flat, then the logo's M (the rebranding, 2026-11-13), its right leg
|
|
123
|
+
// ending just above the dot, as in the logo. `at(u)` walks it by its length.
|
|
124
|
+
const ON_LINE = 204;
|
|
125
|
+
const cub = (a, b, c, d, n) => Array.from({ length: n }, (_, i) => { const q = (i + 1) / n, r = 1 - q; return [r * r * r * a[0] + 3 * r * r * q * b[0] + 3 * r * q * q * c[0] + q * q * q * d[0], r * r * r * a[1] + 3 * r * r * q * b[1] + 3 * r * q * q * c[1] + q * q * q * d[1]]; });
|
|
126
|
+
const M_POINTS = [[20, 82], [20, 42], ...cub([20, 42], [20, 21], [41, 21], [46, 39], 12), [50, 52], [54, 39], ...cub([54, 39], [59, 21], [80, 21], [80, 42], 12), [80, 60]];
|
|
127
|
+
function pulseLine() {
|
|
128
|
+
const { cx, cy } = centre();
|
|
129
|
+
const x0 = Math.max(18, w * 0.07);
|
|
130
|
+
// The M's top (its arches, 55 above the dot) stays inside the picture with room to spare: sized
|
|
131
|
+
// by the width alone it rose out of the card (2026-11-13).
|
|
132
|
+
const k = Math.min((cy - 16) / 55, (cx - x0) * 0.9 / 61);
|
|
133
|
+
const place = ([mx, my]) => [cx + (mx - 80) * k, cy + (my - 81) * k];
|
|
134
|
+
const m = M_POINTS.map(place);
|
|
135
|
+
const bx = m[0][0];
|
|
136
|
+
const points = [[x0, m[0][1]], ...m];
|
|
137
|
+
const lengths = [0];
|
|
138
|
+
for (let i = 1; i < points.length; i += 1) lengths.push(lengths[i - 1] + Math.hypot(points[i][0] - points[i - 1][0], points[i][1] - points[i - 1][1]));
|
|
139
|
+
const total = lengths[lengths.length - 1] || 1;
|
|
140
|
+
const at = (u) => {
|
|
141
|
+
const d = clamp01(u) * total;
|
|
142
|
+
let i = 1;
|
|
143
|
+
while (i < lengths.length - 1 && lengths[i] < d) i += 1;
|
|
144
|
+
const q = (d - lengths[i - 1]) / ((lengths[i] - lengths[i - 1]) || 1);
|
|
145
|
+
return [points[i - 1][0] + (points[i][0] - points[i - 1][0]) * q, points[i - 1][1] + (points[i][1] - points[i - 1][1]) * q];
|
|
146
|
+
};
|
|
147
|
+
return { x0, x1: m[m.length - 1][0], bx, cy: m[0][1], at };
|
|
148
|
+
}
|
|
149
|
+
// The first message, after the line reaches the dot: a bubble opens to the right of it and its
|
|
150
|
+
// words are written in, as the shape of text (never letters), with a caret that waits at the end.
|
|
151
|
+
// Its words' widths are fixed once, so the message is always the same shape.
|
|
152
|
+
const NOTE_WORDS = [0, 1, 2].map((row) => Array.from({ length: 9 }, (_, k) => 16 + Math.round(hash(row * 31 + k + 7) * 38)));
|
|
153
|
+
function paintNote(data, age) {
|
|
154
|
+
if (scene.id !== 'ready' || !data.note) return;
|
|
155
|
+
const { cx, cy } = centre();
|
|
156
|
+
const open = still ? 1 : easeInOut((age - 1.35) / 0.55);
|
|
157
|
+
if (open <= 0) return;
|
|
158
|
+
const left = cx + 22;
|
|
159
|
+
const right = Math.min(w - 18, left + Math.max(140, w * 0.38));
|
|
160
|
+
const rows = [0.92, 0.74, 0.46];
|
|
161
|
+
const lineH = Math.min(15, h * 0.1);
|
|
162
|
+
const top = cy - lineH * 1.5 - 9;
|
|
163
|
+
const height = lineH * 3 + 18;
|
|
164
|
+
const width = (right - left) * (0.35 + 0.65 * open);
|
|
165
|
+
// The bubble: a fine edge and the faintest fill, its corner nearest the dot pointing at it.
|
|
166
|
+
ctx.globalAlpha = open;
|
|
167
|
+
ctx.fillStyle = rgba(look.ink, look === LOOKS.light ? 0.05 : 0.06);
|
|
168
|
+
ctx.strokeStyle = rgba(look.ink, 0.32);
|
|
169
|
+
ctx.lineWidth = 1;
|
|
170
|
+
const r = 10;
|
|
171
|
+
ctx.beginPath();
|
|
172
|
+
ctx.moveTo(left + 4, cy);
|
|
173
|
+
ctx.lineTo(left + 4, top + r);
|
|
174
|
+
ctx.quadraticCurveTo(left + 4, top, left + 4 + r, top);
|
|
175
|
+
ctx.lineTo(left + width - r, top);
|
|
176
|
+
ctx.quadraticCurveTo(left + width, top, left + width, top + r);
|
|
177
|
+
ctx.lineTo(left + width, top + height - r);
|
|
178
|
+
ctx.quadraticCurveTo(left + width, top + height, left + width - r, top + height);
|
|
179
|
+
ctx.lineTo(left + 4 + r, top + height);
|
|
180
|
+
ctx.quadraticCurveTo(left + 4, top + height, left + 4, top + height - r);
|
|
181
|
+
ctx.lineTo(left + 4, cy + 5);
|
|
182
|
+
ctx.lineTo(left - 2, cy);
|
|
183
|
+
ctx.closePath();
|
|
184
|
+
ctx.fill();
|
|
185
|
+
ctx.stroke();
|
|
186
|
+
// The words, written in one after another.
|
|
187
|
+
const room = width - 28;
|
|
188
|
+
const total = rows.reduce((sum, share) => sum + share * room, 0);
|
|
189
|
+
let written = (still ? 1 : easeInOut((age - 1.75) / 1.9)) * total;
|
|
190
|
+
let caret = null;
|
|
191
|
+
ctx.lineCap = 'round';
|
|
192
|
+
ctx.lineWidth = Math.max(3, lineH * 0.34);
|
|
193
|
+
rows.forEach((share, row) => {
|
|
194
|
+
const y = top + 9 + lineH * (row + 0.5);
|
|
195
|
+
let x = left + 18;
|
|
196
|
+
const end = left + 18 + share * room;
|
|
197
|
+
for (const word of NOTE_WORDS[row]) {
|
|
198
|
+
if (x >= end || written <= 0) break;
|
|
199
|
+
const full = Math.min(word, end - x);
|
|
200
|
+
const len = Math.min(full, written);
|
|
201
|
+
ctx.strokeStyle = rgba(look.soft, 0.22);
|
|
202
|
+
ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + Math.max(0.1, len), y); ctx.stroke();
|
|
203
|
+
written -= full + 7;
|
|
204
|
+
caret = [x + len + 5, y];
|
|
205
|
+
x += full + 7;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
// The caret waits where the writing stopped: the person only has to send it.
|
|
209
|
+
if (caret && (still || frac(age * 0.9) < 0.6)) {
|
|
210
|
+
ctx.strokeStyle = rgba(look.ink, 0.9);
|
|
211
|
+
ctx.lineWidth = 1.6;
|
|
212
|
+
ctx.beginPath(); ctx.moveTo(caret[0], caret[1] - lineH * 0.45); ctx.lineTo(caret[0], caret[1] + lineH * 0.45); ctx.stroke();
|
|
213
|
+
}
|
|
214
|
+
ctx.globalAlpha = 1;
|
|
215
|
+
ctx.lineCap = 'butt';
|
|
216
|
+
}
|
|
134
217
|
const PICTURES = {
|
|
135
218
|
hello(p, t, data) {
|
|
136
219
|
const { cx, cy, R } = centre();
|
|
@@ -233,19 +316,23 @@ export function createScene({ still = globalThis.matchMedia?.('(prefers-reduced-
|
|
|
233
316
|
return [cx + Math.cos(ang) * r * 1.6 + dx, cy + Math.sin(ang) * r * 0.55 + dy, data.state === 'skip' ? 0.07 : 0.15, 0.8];
|
|
234
317
|
},
|
|
235
318
|
ready(p, t, data, age) {
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
const drawn = still ? 1 : easeInOut(age / 1.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
319
|
+
// The logo's M, whole and continuous: almost every point is on it, laid by its length so the
|
|
320
|
+
// steep strokes are as full as the flat ones. It draws itself from the left into the
|
|
321
|
+
// dot; a few points keep arriving along it from the edge — the AIs feeding the project — and a
|
|
322
|
+
// soft brightness runs along it the way a heartbeat travels. Then the first message (paintNote).
|
|
323
|
+
const line = pulseLine();
|
|
324
|
+
const drawn = still ? 1 : easeInOut(age / 1.5);
|
|
325
|
+
if (p.i >= ON_LINE) {
|
|
326
|
+
// The stream: from beyond the left edge, along the flat, into the start of the line.
|
|
327
|
+
const q = frac(t * 0.21 + p.seed * 1.9);
|
|
328
|
+
const x = line.x0 - w * 0.08 + (w * 0.08 + (line.bx - line.x0) * 0.9) * easeInOut(q);
|
|
329
|
+
return [x, line.cy + (p.seed2 - 0.5) * 6 * (1 - q), drawn * 0.7 * Math.sin(q * Math.PI) ** 0.8, 0.8];
|
|
330
|
+
}
|
|
331
|
+
const u = p.i / (ON_LINE - 1);
|
|
332
|
+
if (u > drawn) { const [x, y] = line.at(0); return [x, y, 0, 0.6]; }
|
|
333
|
+
const [x, y] = line.at(u);
|
|
334
|
+
const runner = Math.exp(-(((u - frac(t * 0.24)) / 0.05) ** 2));
|
|
335
|
+
return [x, y, 0.42 + 0.55 * runner, 0.62 + 0.38 * runner];
|
|
249
336
|
},
|
|
250
337
|
};
|
|
251
338
|
const dotOf = (id, data) => {
|
|
@@ -329,6 +416,7 @@ export function createScene({ still = globalThis.matchMedia?.('(prefers-reduced-
|
|
|
329
416
|
ctx.globalAlpha = 1;
|
|
330
417
|
ctx.globalCompositeOperation = 'source-over';
|
|
331
418
|
paintArc(data);
|
|
419
|
+
paintNote(data, age);
|
|
332
420
|
const target = dotOf(scene.id, data);
|
|
333
421
|
dot.a = still ? target : dot.a + (target - dot.a) * 0.06;
|
|
334
422
|
paintDot(t);
|