@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.
- package/ADDITIONAL-TERMS.md +7 -2
- package/CHANGELOG.en.md +152 -1
- package/CHANGELOG.md +152 -1
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +111 -661
- package/NOTICE +59 -24
- package/README.en.md +36 -204
- package/README.md +36 -210
- package/SECURITY.md +1 -0
- package/TRADEMARKS.en.md +13 -14
- package/TRADEMARKS.md +42 -26
- package/bin/madre.cjs +2 -2
- package/bin/madre.mjs +114 -42
- package/docs/REFERENCE.md +53 -6
- package/docs/SDK.md +44 -5
- package/docs/en/REFERENCE.md +53 -6
- package/docs/en/SDK.md +43 -4
- package/docs/madre-banner.png +0 -0
- package/docs/sdk/hello-module.mjs +3 -0
- package/package.json +3 -2
- package/public/abduction.js +6 -6
- package/public/activity.js +425 -0
- package/public/app.js +3519 -647
- package/public/assets/abduction-cat-blink.webp +0 -0
- package/public/assets/abduction-cat-control-left.webp +0 -0
- package/public/assets/abduction-cat-control-right.webp +0 -0
- package/public/assets/abduction-cat.webp +0 -0
- package/public/assets/manual/shots/en-agents.webp +0 -0
- package/public/assets/manual/shots/en-chats.webp +0 -0
- package/public/assets/manual/shots/en-code.webp +0 -0
- package/public/assets/manual/shots/en-composer.webp +0 -0
- package/public/assets/manual/shots/en-connectors.webp +0 -0
- package/public/assets/manual/shots/en-continuity.webp +0 -0
- package/public/assets/manual/shots/en-coordinator.webp +0 -0
- package/public/assets/manual/shots/en-copilot.webp +0 -0
- package/public/assets/manual/shots/en-diagnostics.webp +0 -0
- package/public/assets/manual/shots/en-home.webp +0 -0
- package/public/assets/manual/shots/en-local.webp +0 -0
- package/public/assets/manual/shots/en-market.webp +0 -0
- package/public/assets/manual/shots/en-memory.webp +0 -0
- package/public/assets/manual/shots/en-modes.webp +0 -0
- package/public/assets/manual/shots/en-notes.webp +0 -0
- package/public/assets/manual/shots/en-settings.webp +0 -0
- package/public/assets/manual/shots/en-welcome.webp +0 -0
- package/public/assets/manual/shots/en-windows.webp +0 -0
- package/public/assets/manual/shots/es-agents.webp +0 -0
- package/public/assets/manual/shots/es-chats.webp +0 -0
- package/public/assets/manual/shots/es-code.webp +0 -0
- package/public/assets/manual/shots/es-composer.webp +0 -0
- package/public/assets/manual/shots/es-connectors.webp +0 -0
- package/public/assets/manual/shots/es-continuity.webp +0 -0
- package/public/assets/manual/shots/es-coordinator.webp +0 -0
- package/public/assets/manual/shots/es-copilot.webp +0 -0
- package/public/assets/manual/shots/es-diagnostics.webp +0 -0
- package/public/assets/manual/shots/es-home.webp +0 -0
- package/public/assets/manual/shots/es-local.webp +0 -0
- package/public/assets/manual/shots/es-market.webp +0 -0
- package/public/assets/manual/shots/es-memory.webp +0 -0
- package/public/assets/manual/shots/es-modes.webp +0 -0
- package/public/assets/manual/shots/es-notes.webp +0 -0
- package/public/assets/manual/shots/es-settings.webp +0 -0
- package/public/assets/manual/shots/es-welcome.webp +0 -0
- package/public/assets/manual/shots/es-windows.webp +0 -0
- package/public/assets/news/1.1/en/chats.webp +0 -0
- package/public/assets/news/1.1/en/home.webp +0 -0
- package/public/assets/news/1.1/en/maps.webp +0 -0
- package/public/assets/news/1.1/en/market.webp +0 -0
- package/public/assets/news/1.1/en/permissions.webp +0 -0
- package/public/assets/news/1.1/en/privacy.webp +0 -0
- package/public/assets/news/1.1/en/welcome.webp +0 -0
- package/public/assets/news/1.1/es/chats.webp +0 -0
- package/public/assets/news/1.1/es/home.webp +0 -0
- package/public/assets/news/1.1/es/maps.webp +0 -0
- package/public/assets/news/1.1/es/market.webp +0 -0
- package/public/assets/news/1.1/es/permissions.webp +0 -0
- package/public/assets/news/1.1/es/privacy.webp +0 -0
- package/public/assets/news/1.1/es/welcome.webp +0 -0
- package/public/attribution.js +15 -16
- package/public/brands.js +2 -2
- package/public/code-tools.js +2 -2
- package/public/editor.js +13 -13
- package/public/en.js +483 -0
- package/public/es.js +1817 -598
- package/public/hardware.js +2 -2
- package/public/i18n.js +47 -9
- package/public/icons.js +158 -0
- package/public/index.html +68 -51
- package/public/inquiry.js +2 -2
- package/public/loader.js +271 -2
- package/public/macroverso.js +60 -21
- package/public/manual-content.js +900 -0
- package/public/manual-shots.js +47 -0
- package/public/manual.css +246 -0
- package/public/manual.html +15 -0
- package/public/manual.js +427 -0
- package/public/market-art.js +99 -41
- package/public/market-view.js +243 -47
- package/public/market.js +139 -26
- package/public/mcp-catalog.js +62 -0
- package/public/neural.js +64 -8
- package/public/nostromo-engine.js +709 -40
- package/public/page-errors.js +29 -0
- package/public/power.js +350 -11
- package/public/remedy.js +89 -0
- package/public/resay.js +4 -2
- package/public/review-ask.js +12 -7
- package/public/routing.js +3 -3
- package/public/salas-mac.css +875 -48
- package/public/salas-mac.html +27 -15
- package/public/salas-mac.js +1668 -338
- package/public/salas.css +2 -2
- package/public/salas.html +3 -3
- package/public/salas.js +3 -3
- package/public/styles.css +2694 -323
- package/public/syntax.js +2 -2
- package/public/terms.js +152 -0
- package/public/touch.js +2 -2
- package/public/tour-chapters.js +100 -92
- package/public/tour.js +118 -28
- package/public/troubleshooting.js +327 -21
- package/public/wallpaper.js +4 -3
- package/public/welcome.js +923 -0
- package/src/activity.mjs +85 -0
- package/src/adapters/claude.mjs +61 -35
- package/src/adapters/codex.mjs +18 -5
- package/src/adapters/cursor.mjs +60 -9
- package/src/adapters/gemini.mjs +17 -4
- package/src/adapters/madre.mjs +30 -9
- package/src/adapters/opencode.mjs +73 -10
- package/src/adapters/process.mjs +19 -15
- package/src/adapters/subagents.mjs +159 -0
- package/src/asking.mjs +8 -2
- package/src/auth-probe.mjs +47 -11
- package/src/bridge/devices.mjs +2 -2
- package/src/bridge/handoff.mjs +2 -2
- package/src/bridge/host.mjs +2 -2
- package/src/bridge/network.mjs +2 -2
- package/src/bridge/policy.mjs +3 -3
- package/src/bridge/qr.mjs +2 -2
- package/src/bridge/server.mjs +3 -3
- package/src/builtin-updates.mjs +87 -0
- package/src/capabilities.mjs +5 -5
- package/src/chats.mjs +51 -2
- package/src/checkpoint.mjs +67 -9
- package/src/choices.mjs +2 -2
- package/src/cli-args.mjs +2 -2
- package/src/cold.mjs +2 -2
- package/src/commands.mjs +2 -2
- package/src/config.mjs +2 -2
- package/src/conversation-context.mjs +2 -2
- package/src/credentials.mjs +80 -18
- package/src/dataset.mjs +2 -2
- package/src/directives.mjs +2 -2
- package/src/distiller.mjs +2 -2
- package/src/embeddings.mjs +2 -2
- package/src/enlaces.mjs +2 -2
- package/src/environment.mjs +147 -0
- package/src/event-store.mjs +2 -2
- package/src/exam.mjs +2 -2
- package/src/extensions.mjs +2 -2
- package/src/eyecat-watch.mjs +2 -2
- package/src/eyecat.mjs +2 -2
- package/src/file-ops.mjs +2 -2
- package/src/files.mjs +2 -2
- package/src/github.mjs +2 -2
- package/src/heartbeat.mjs +2 -2
- package/src/history.mjs +76 -0
- package/src/i18n.mjs +32 -3
- package/src/image-studio.mjs +2 -2
- package/src/install-metrics.mjs +109 -0
- package/src/json-file.mjs +2 -2
- package/src/launch.mjs +2 -2
- package/src/lease.mjs +15 -4
- package/src/lobby-work.mjs +11 -4
- package/src/local-ai.mjs +12 -4
- package/src/looks.mjs +19 -7
- package/src/market-check.mjs +165 -0
- package/src/market-key.mjs +10 -2
- package/src/market-license.mjs +104 -0
- package/src/market-remote.mjs +71 -13
- package/src/maturity.mjs +2 -2
- package/src/mcp/connect.mjs +2 -2
- package/src/mcp/github-server.mjs +2 -2
- package/src/mcp/image-server.mjs +2 -2
- package/src/mcp/memory-server.mjs +2 -2
- package/src/mcp/proxy.mjs +16 -5
- package/src/mcp/smtp-server.mjs +2 -2
- package/src/memory-dashboard.mjs +2 -2
- package/src/memory-tools.mjs +2 -2
- package/src/memory.mjs +2 -2
- package/src/models.mjs +115 -12
- package/src/module-scope.mjs +2 -2
- package/src/modules/ahp.mjs +2 -2
- package/src/modules/ash-policy.mjs +2 -2
- package/src/modules/ash.mjs +2 -2
- package/src/modules/bishop-exam.mjs +2 -2
- package/src/modules/bishop-plan.mjs +2 -2
- package/src/modules/bishop.mjs +9 -3
- package/src/modules/choices.mjs +2 -2
- package/src/modules/correo.mjs +2 -2
- package/src/modules/enlaces.mjs +2 -2
- package/src/modules/git-pulse.mjs +2 -2
- package/src/modules/github.mjs +2 -2
- package/src/modules/helpers.mjs +2 -2
- package/src/modules/image-studio.mjs +2 -2
- package/src/modules/index.mjs +92 -5
- package/src/modules/intents-calibration.mjs +2 -2
- package/src/modules/intents-desk.mjs +4 -3
- package/src/modules/intents-observe.mjs +2 -2
- package/src/modules/intents-policy.mjs +2 -2
- package/src/modules/intents-try.mjs +2 -2
- package/src/modules/intents.mjs +2 -2
- package/src/modules/local-models.mjs +41 -10
- package/src/modules/mcp-connect.mjs +2 -2
- package/src/modules/notes.mjs +281 -0
- package/src/modules/ollama.mjs +48 -13
- package/src/modules/playwright.mjs +16 -5
- package/src/modules/reminders.mjs +664 -0
- package/src/modules/ripley.mjs +3 -3
- package/src/modules/runs.mjs +2 -2
- package/src/modules/sdk.mjs +57 -9
- package/src/modules/updates.mjs +2 -2
- package/src/mother.mjs +13 -3
- package/src/npm-launch.mjs +2 -2
- package/src/ollama.mjs +8 -6
- package/src/opencode-health.mjs +83 -0
- package/src/outbound.mjs +35 -3
- package/src/override.mjs +27 -22
- package/src/ports.mjs +2 -2
- package/src/prices.mjs +2 -2
- package/src/privacy.mjs +2 -2
- package/src/quota-monitor.mjs +2 -2
- package/src/quota-sources.mjs +2 -2
- package/src/request-guard.mjs +2 -2
- package/src/review-ask.mjs +4 -3
- package/src/room/archivist.mjs +2 -2
- package/src/room/attachments.mjs +2 -2
- package/src/room/budget.mjs +2 -2
- package/src/room/context.mjs +2 -2
- package/src/room/control.mjs +2 -2
- package/src/room/copilot.mjs +2 -2
- package/src/room/economy.mjs +2 -2
- package/src/room/escalation.mjs +2 -2
- package/src/room/ghost.mjs +2 -2
- package/src/room/guard.mjs +6 -4
- package/src/room/prompt.mjs +3 -3
- package/src/room/returns.mjs +2 -2
- package/src/room/runs.mjs +6 -4
- package/src/room/vectors.mjs +2 -2
- package/src/room.mjs +144 -36
- package/src/router.mjs +2 -2
- package/src/runs.mjs +2 -2
- package/src/runtime-detection.mjs +36 -6
- package/src/salas.mjs +31 -6
- package/src/sentinel-errors.mjs +17 -7
- package/src/server-sentinel.mjs +2 -2
- package/src/server.mjs +980 -139
- package/src/setup-trouble.mjs +33 -0
- package/src/setup.mjs +4 -4
- package/src/smtp.mjs +2 -2
- package/src/telemetry.mjs +266 -0
- package/src/terms.mjs +43 -0
- package/src/tour.mjs +60 -7
- package/src/uninstall.mjs +225 -0
- package/src/updates.mjs +2 -2
- package/src/usage-sentinel.mjs +2 -2
- package/src/vault.mjs +2 -2
- package/src/verdict.mjs +13 -10
- package/src/whats-new.mjs +97 -3
- package/public/assets/abduction-cat-blink.png +0 -0
- package/public/assets/abduction-cat-control-left.png +0 -0
- package/public/assets/abduction-cat-control-right.png +0 -0
- package/public/assets/abduction-cat.png +0 -0
package/public/manual.js
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
|
|
3
|
+
// The user manual's page (/manual, 1.0.5): the text of public/manual-content.js drawn with MADRE's
|
|
4
|
+
// look, in the room's language or the one asked for (?lang=es|en). Each section shows MADRE itself
|
|
5
|
+
// (public/manual-shots.js, scripts/manual-shots.mjs) with a numbered mark on what each step presses;
|
|
6
|
+
// a step and its mark light up together. The same page is printed to the PDF (scripts/manual-pdf.mjs,
|
|
7
|
+
// ?print=1): light, as the brand asks of long documents, with a cover. It reads nothing but its own
|
|
8
|
+
// files, so it opens without a network.
|
|
9
|
+
|
|
10
|
+
import { hostWords, keyWords } from './i18n.js';
|
|
11
|
+
import { MANUAL } from './manual-content.js';
|
|
12
|
+
import { GESTURES } from './tour-chapters.js';
|
|
13
|
+
import { SHOTS } from './manual-shots.js';
|
|
14
|
+
import { trazoDrawing } from './icons.js';
|
|
15
|
+
|
|
16
|
+
const asked = new URLSearchParams(location.search);
|
|
17
|
+
const printing = asked.get('print') === '1';
|
|
18
|
+
const pick = (value) => (value === 'en' || value === 'es' ? value : null);
|
|
19
|
+
const browser = String(navigator.languages?.[0] ?? navigator.language ?? '').toLowerCase().startsWith('es') ? 'es' : 'en';
|
|
20
|
+
|
|
21
|
+
const ICONS = {
|
|
22
|
+
home: trazoDrawing('home'),
|
|
23
|
+
chat: trazoDrawing('chat'),
|
|
24
|
+
shield: trazoDrawing('shield-check'),
|
|
25
|
+
robot: trazoDrawing('robot'),
|
|
26
|
+
code: trazoDrawing('code'),
|
|
27
|
+
note: trazoDrawing('note'),
|
|
28
|
+
grid: trazoDrawing('modules'),
|
|
29
|
+
plug: trazoDrawing('plug'),
|
|
30
|
+
chip: trazoDrawing('chip'),
|
|
31
|
+
orbit: trazoDrawing('map'),
|
|
32
|
+
windows: trazoDrawing('window'),
|
|
33
|
+
gear: trazoDrawing('settings'),
|
|
34
|
+
download: trazoDrawing('download'),
|
|
35
|
+
agents: trazoDrawing('agents'),
|
|
36
|
+
stars: trazoDrawing('spark'),
|
|
37
|
+
loop: trazoDrawing('sync'),
|
|
38
|
+
warning: trazoDrawing('warning'),
|
|
39
|
+
keys: trazoDrawing('keyboard'),
|
|
40
|
+
help: trazoDrawing('help'),
|
|
41
|
+
list: trazoDrawing('list'),
|
|
42
|
+
market: trazoDrawing('market-key'),
|
|
43
|
+
book: trazoDrawing('book'),
|
|
44
|
+
check: trazoDrawing('check'),
|
|
45
|
+
trash: trazoDrawing('trash'),
|
|
46
|
+
running: trazoDrawing('running'),
|
|
47
|
+
};
|
|
48
|
+
const icon = (name) => `<svg viewBox="0 0 20 20" aria-hidden="true">${ICONS[name] ?? ICONS.help}</svg>`;
|
|
49
|
+
|
|
50
|
+
const el = (tag, className = null, text = null) => {
|
|
51
|
+
const node = document.createElement(tag);
|
|
52
|
+
if (className) node.className = className;
|
|
53
|
+
if (text !== null) node.textContent = text;
|
|
54
|
+
return node;
|
|
55
|
+
};
|
|
56
|
+
// Said of the computer and the keyboard in front of the person (i18n.js).
|
|
57
|
+
const plain = (text) => hostWords(keyWords(String(text ?? '')));
|
|
58
|
+
const keyChip = (how) => el('kbd', null, plain(how));
|
|
59
|
+
// A line of the manual with its keys as keys (⌘ P, ⌥ ↵) and what to type to an agent (“…”) as it
|
|
60
|
+
// looks in the chat, a green bubble.
|
|
61
|
+
const KEYS = /([⌘⌥⇧⌃]\s?(?:[A-Z]|[,./↵])|↵)/;
|
|
62
|
+
function rich(text) {
|
|
63
|
+
const line = el('span');
|
|
64
|
+
for (const part of plain(text).split(/(“[^”]+”|`[^`]+`)/)) {
|
|
65
|
+
if (!part) continue;
|
|
66
|
+
if (part.startsWith('“')) { line.append(el('q', 'manual-say', part.slice(1, -1))); continue; }
|
|
67
|
+
if (part.startsWith('`')) { line.append(el('code', null, part.slice(1, -1))); continue; }
|
|
68
|
+
for (const bit of part.split(KEYS)) {
|
|
69
|
+
if (!bit) continue;
|
|
70
|
+
line.append(KEYS.test(bit) && bit.length <= 3 ? el('kbd', null, bit) : document.createTextNode(bit));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return line;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// MADRE, photographed, with a numbered mark on what each step presses. The marks come in one after
|
|
77
|
+
// the other the first time the picture is in sight; on paper they are simply there.
|
|
78
|
+
function shot(id, lang, title) {
|
|
79
|
+
const known = SHOTS[lang]?.[id] ?? SHOTS.es?.[id];
|
|
80
|
+
if (!known) return null;
|
|
81
|
+
// A tall one (a panel of Settings) narrower, so it does not fill a whole screen.
|
|
82
|
+
const picture = el('figure', `manual-shot${known.height > known.width ? ' tall' : ''}`);
|
|
83
|
+
const frame = el('div', 'manual-shot-frame');
|
|
84
|
+
frame.style.aspectRatio = `${known.width} / ${known.height}`;
|
|
85
|
+
frame.style.setProperty('--ratio', String(known.width / known.height));
|
|
86
|
+
const image = el('img');
|
|
87
|
+
image.src = `/assets/manual/shots/${SHOTS[lang]?.[id] ? lang : 'es'}-${id}.webp`;
|
|
88
|
+
image.alt = title;
|
|
89
|
+
image.width = known.width;
|
|
90
|
+
image.height = known.height;
|
|
91
|
+
image.decoding = 'async';
|
|
92
|
+
if (!printing) image.loading = 'lazy';
|
|
93
|
+
frame.append(image);
|
|
94
|
+
known.marks.forEach((box, at) => {
|
|
95
|
+
if (!box) return;
|
|
96
|
+
const [left, top, width, height, place = top < 5 ? 'below' : null] = box;
|
|
97
|
+
// Its number over its middle; under it at the picture's top edge, or where the picture said,
|
|
98
|
+
// when marks stand close together.
|
|
99
|
+
const mark = el('span', `manual-pin${place ? ` ${place}` : ''}`);
|
|
100
|
+
mark.dataset.step = String(at + 1);
|
|
101
|
+
mark.style.cssText = `left:${left}%;top:${top}%;width:${width}%;height:${height}%;--at:${at}`;
|
|
102
|
+
mark.append(el('b', null, String(at + 1)));
|
|
103
|
+
frame.append(mark);
|
|
104
|
+
});
|
|
105
|
+
picture.append(frame);
|
|
106
|
+
return picture;
|
|
107
|
+
}
|
|
108
|
+
// A step and its mark, lit together while the pointer is on either.
|
|
109
|
+
function pairUp(part) {
|
|
110
|
+
const light = (step, on) => {
|
|
111
|
+
part.classList.toggle('pointing', on);
|
|
112
|
+
for (const one of part.querySelectorAll(`[data-step="${step}"]`)) one.classList.toggle('lit', on);
|
|
113
|
+
};
|
|
114
|
+
for (const one of part.querySelectorAll('[data-step]')) {
|
|
115
|
+
one.addEventListener('pointerenter', () => light(one.dataset.step, true));
|
|
116
|
+
one.addEventListener('pointerleave', () => light(one.dataset.step, false));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Each number goes where there is room for it (2026-10-21): outside its mark — above, to the left,
|
|
120
|
+
// to the right or below, in that order unless the picture asked for one first (`place`) — inside
|
|
121
|
+
// the picture and clear of the numbers already placed; the mark's corner only when nothing else
|
|
122
|
+
// fits. Placed once the picture has its size, and again when the page changes width.
|
|
123
|
+
const SIDES = ['above', 'left', 'right', 'below', 'corner'];
|
|
124
|
+
export function placeNumbers(frame) {
|
|
125
|
+
const width = frame.clientWidth;
|
|
126
|
+
const height = frame.clientHeight;
|
|
127
|
+
if (!width || !height) return;
|
|
128
|
+
const taken = [];
|
|
129
|
+
// Every mark's own box: a number never sits on another step's mark.
|
|
130
|
+
const marks = [...frame.querySelectorAll('.manual-pin')].map((one) => ({ pin: one, x: one.offsetLeft, y: one.offsetTop, w: one.offsetWidth, h: one.offsetHeight }));
|
|
131
|
+
for (const pin of frame.querySelectorAll('.manual-pin')) {
|
|
132
|
+
const badge = pin.querySelector('b');
|
|
133
|
+
if (!badge) continue;
|
|
134
|
+
// The number grows with the picture: on a phone the marks are about 20 px tall and a full-size
|
|
135
|
+
// number would sit on the next one.
|
|
136
|
+
const size = Math.round(Math.min(26, Math.max(18, width * 0.045)));
|
|
137
|
+
Object.assign(badge.style, { width: `${size}px`, height: `${size}px`, fontSize: `${Math.max(10, Math.round(size * 0.5))}px` });
|
|
138
|
+
const gap = 5;
|
|
139
|
+
const box = { x: pin.offsetLeft, y: pin.offsetTop, w: pin.offsetWidth, h: pin.offsetHeight };
|
|
140
|
+
const spot = {
|
|
141
|
+
above: [box.x + box.w / 2 - size / 2, box.y - size - gap],
|
|
142
|
+
left: [box.x - size - gap, box.y + box.h / 2 - size / 2],
|
|
143
|
+
right: [box.x + box.w + gap, box.y + box.h / 2 - size / 2],
|
|
144
|
+
below: [box.x + box.w / 2 - size / 2, box.y + box.h + gap],
|
|
145
|
+
corner: [box.x - size / 3, box.y - size / 3],
|
|
146
|
+
// When the four sides are taken: the ends of a side, the outer corners, and last the mark's
|
|
147
|
+
// own corner from inside, if it is big enough to keep part of the mark in view.
|
|
148
|
+
aboveStart: [box.x, box.y - size - gap],
|
|
149
|
+
aboveEnd: [box.x + box.w - size, box.y - size - gap],
|
|
150
|
+
belowStart: [box.x, box.y + box.h + gap],
|
|
151
|
+
belowEnd: [box.x + box.w - size, box.y + box.h + gap],
|
|
152
|
+
outsideTopLeft: [box.x - size - gap, box.y - size - gap],
|
|
153
|
+
outsideTopRight: [box.x + box.w + gap, box.y - size - gap],
|
|
154
|
+
outsideBottomLeft: [box.x - size - gap, box.y + box.h + gap],
|
|
155
|
+
outsideBottomRight: [box.x + box.w + gap, box.y + box.h + gap],
|
|
156
|
+
...(box.w >= size * 2 && box.h >= size * 1.6 ? {
|
|
157
|
+
insideTopLeft: [box.x + 4, box.y + 4],
|
|
158
|
+
insideTopRight: [box.x + box.w - size - 4, box.y + 4],
|
|
159
|
+
insideBottomLeft: [box.x + 4, box.y + box.h - size - 4],
|
|
160
|
+
insideBottomRight: [box.x + box.w - size - 4, box.y + box.h - size - 4],
|
|
161
|
+
} : {}),
|
|
162
|
+
};
|
|
163
|
+
const more = Object.keys(spot).filter((one) => !SIDES.includes(one));
|
|
164
|
+
const asked = SIDES.find((side) => pin.classList.contains(side));
|
|
165
|
+
const order = [...(asked ? [asked, ...SIDES.filter((side) => side !== asked && side !== 'corner')] : SIDES.slice(0, -1)), ...more, 'corner'];
|
|
166
|
+
const fits = ([x, y]) => x >= 2 && y >= 2 && x + size <= width - 2 && y + size <= height - 2;
|
|
167
|
+
const clear = ([x, y]) => taken.every(([tx, ty]) => Math.abs(tx - x) > size + 3 || Math.abs(ty - y) > size + 3);
|
|
168
|
+
// A mark that holds this one (a switch inside its card) is not in the way: its number is bound to sit on it.
|
|
169
|
+
const holds = (one) => one.x <= box.x && one.y <= box.y && one.x + one.w >= box.x + box.w && one.y + one.h >= box.y + box.h;
|
|
170
|
+
// How much of the other marks a number at (x, y) would cover; two pixels of edge do not count.
|
|
171
|
+
const covers = ([x, y]) => marks.reduce((sum, one) => (one.pin === pin || holds(one) ? sum
|
|
172
|
+
: sum + Math.max(0, Math.min(x + size, one.x + one.w) - Math.max(x, one.x) - 2) * Math.max(0, Math.min(y + size, one.y + one.h) - Math.max(y, one.y) - 2)), 0);
|
|
173
|
+
const offMarks = (at) => covers(at) === 0;
|
|
174
|
+
// Nowhere free: the place that covers the least of the other marks.
|
|
175
|
+
const least = order.filter((one) => fits(spot[one]) && clear(spot[one])).sort((a, b) => covers(spot[a]) - covers(spot[b]))[0];
|
|
176
|
+
const side = order.find((one) => fits(spot[one]) && clear(spot[one]) && offMarks(spot[one])) ?? least ?? order.find((one) => fits(spot[one])) ?? 'corner';
|
|
177
|
+
const [x, y] = spot[side];
|
|
178
|
+
const left = Math.min(Math.max(x, 2), width - size - 2);
|
|
179
|
+
const top = Math.min(Math.max(y, 2), height - size - 2);
|
|
180
|
+
taken.push([left, top]);
|
|
181
|
+
Object.assign(badge.style, { left: `${left - box.x}px`, top: `${top - box.y}px`, translate: 'none' });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// Every picture's numbers, once its image has its size: what printing waits for.
|
|
185
|
+
async function placeAll(root) {
|
|
186
|
+
// The frame keeps the picture's shape before it loads, so they can be placed at once; each one
|
|
187
|
+
// is placed again when its image is in (a lazy image far down comes in later).
|
|
188
|
+
const frames = [...root.querySelectorAll('.manual-shot-frame')];
|
|
189
|
+
frames.forEach(placeNumbers);
|
|
190
|
+
await Promise.all(frames.map((frame) => Promise.resolve(frame.querySelector('img')?.decode?.()).catch(() => null).then(() => placeNumbers(frame))));
|
|
191
|
+
}
|
|
192
|
+
function watchShots(root) {
|
|
193
|
+
if (!('IntersectionObserver' in window)) { for (const one of root.querySelectorAll('.manual-shot')) one.classList.add('shown'); return; }
|
|
194
|
+
const seen = new IntersectionObserver((entries) => {
|
|
195
|
+
for (const entry of entries) {
|
|
196
|
+
if (!entry.isIntersecting) continue;
|
|
197
|
+
entry.target.classList.add('shown');
|
|
198
|
+
seen.unobserve(entry.target);
|
|
199
|
+
}
|
|
200
|
+
}, { threshold: 0.45 });
|
|
201
|
+
for (const one of root.querySelectorAll('.manual-shot')) seen.observe(one);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function roomLanguage() {
|
|
205
|
+
try {
|
|
206
|
+
const answer = await fetch('/api/state', { cache: 'no-store' }).then((response) => (response.ok ? response.json() : null));
|
|
207
|
+
return pick(answer?.language);
|
|
208
|
+
} catch { return null; }
|
|
209
|
+
}
|
|
210
|
+
async function version() {
|
|
211
|
+
try {
|
|
212
|
+
const answer = await fetch('/api/version', { cache: 'no-store' }).then((response) => (response.ok ? response.json() : null));
|
|
213
|
+
return answer?.current ?? null;
|
|
214
|
+
} catch { return null; }
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function draw(lang, madre) {
|
|
218
|
+
const copy = MANUAL[lang];
|
|
219
|
+
const other = lang === 'es' ? 'en' : 'es';
|
|
220
|
+
document.documentElement.lang = lang;
|
|
221
|
+
document.title = `MADRE · ${copy.title}`;
|
|
222
|
+
const root = document.getElementById('manual');
|
|
223
|
+
root.replaceChildren();
|
|
224
|
+
|
|
225
|
+
// Over the page, on screen only: the other language and the PDF.
|
|
226
|
+
if (!printing) {
|
|
227
|
+
const bar = el('nav', 'manual-bar');
|
|
228
|
+
const brand = el('span', 'manual-brand');
|
|
229
|
+
brand.innerHTML = '<img src="/assets/brand/madre-app.svg" alt="" width="22" height="22">'; // trusted: our own markup
|
|
230
|
+
brand.append(el('b', null, 'MADRE'));
|
|
231
|
+
const keys = el('div', 'manual-keys');
|
|
232
|
+
const swap = el('a', 'manual-key', copy.language);
|
|
233
|
+
swap.href = `?lang=${other}`;
|
|
234
|
+
const pdf = el('a', 'manual-key primary', copy.pdf);
|
|
235
|
+
pdf.href = `/assets/manual/madre-manual-${lang}.pdf`;
|
|
236
|
+
pdf.setAttribute('download', '');
|
|
237
|
+
keys.append(swap, pdf);
|
|
238
|
+
bar.append(brand, keys);
|
|
239
|
+
root.append(bar);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// The cover.
|
|
243
|
+
const cover = el('header', 'manual-cover');
|
|
244
|
+
const mark = el('img', 'manual-mark');
|
|
245
|
+
mark.src = '/assets/brand/madre-app.svg';
|
|
246
|
+
mark.alt = '';
|
|
247
|
+
cover.append(mark, el('h1', null, copy.title), el('p', 'manual-subtitle', copy.subtitle));
|
|
248
|
+
if (madre) cover.append(el('p', 'manual-version', `MADRE ${madre}`));
|
|
249
|
+
const intro = el('div', 'manual-intro');
|
|
250
|
+
for (const line of copy.intro) intro.append(el('p', null, plain(line)));
|
|
251
|
+
cover.append(intro);
|
|
252
|
+
root.append(cover);
|
|
253
|
+
|
|
254
|
+
// The four words the rest is said with.
|
|
255
|
+
const words = el('section', 'manual-words');
|
|
256
|
+
words.append(el('h2', null, copy.words.title));
|
|
257
|
+
const grid = el('dl');
|
|
258
|
+
for (const [term, what] of copy.words.list) {
|
|
259
|
+
const one = el('div');
|
|
260
|
+
one.append(el('dt', null, term), el('dd', null, plain(what)));
|
|
261
|
+
grid.append(one);
|
|
262
|
+
}
|
|
263
|
+
words.append(grid);
|
|
264
|
+
root.append(words);
|
|
265
|
+
|
|
266
|
+
// The contents, each a link to its section.
|
|
267
|
+
const contents = el('nav', 'manual-contents');
|
|
268
|
+
contents.append(el('h2', null, copy.contents));
|
|
269
|
+
// In four parts, in the order someone new needs them: getting started, working, more, help.
|
|
270
|
+
const entry = (href, iconName, title) => {
|
|
271
|
+
const item = el('li');
|
|
272
|
+
const link = el('a');
|
|
273
|
+
link.href = href;
|
|
274
|
+
const badge = el('span', 'manual-icon');
|
|
275
|
+
badge.innerHTML = icon(iconName); // trusted: our own SVG
|
|
276
|
+
link.append(badge, el('span', null, title));
|
|
277
|
+
item.append(link);
|
|
278
|
+
return item;
|
|
279
|
+
};
|
|
280
|
+
for (const [part, name] of Object.entries(copy.parts)) {
|
|
281
|
+
const group = el('div', 'manual-part');
|
|
282
|
+
group.append(el('h3', null, name));
|
|
283
|
+
const list = el('ol');
|
|
284
|
+
for (const section of copy.sections.filter((one) => one.part === part)) list.append(entry(`#${section.id}`, section.icon, section.title));
|
|
285
|
+
if (part === 'help') list.append(entry('#atajos', 'keys', copy.shortcuts));
|
|
286
|
+
group.append(list);
|
|
287
|
+
contents.append(group);
|
|
288
|
+
}
|
|
289
|
+
root.append(contents);
|
|
290
|
+
|
|
291
|
+
copy.sections.forEach((section, index) => {
|
|
292
|
+
const part = el('section', 'manual-section');
|
|
293
|
+
part.id = section.id;
|
|
294
|
+
const head = el('header', 'manual-section-head');
|
|
295
|
+
const badge = el('span', 'manual-icon');
|
|
296
|
+
badge.innerHTML = icon(section.icon); // trusted: our own SVG
|
|
297
|
+
const words = el('div');
|
|
298
|
+
words.append(el('span', 'manual-number', String(index + 1).padStart(2, '0')), el('h2', null, section.title));
|
|
299
|
+
head.append(badge, words);
|
|
300
|
+
part.append(head, el('p', 'manual-lead', plain(section.lead)));
|
|
301
|
+
// What it looks like, its steps numbered as the marks on it, then one thing to try and what is
|
|
302
|
+
// worth knowing once the basics are there.
|
|
303
|
+
const body = el('div', 'manual-body');
|
|
304
|
+
const picture = section.shot ? shot(section.shot, lang, section.title) : null;
|
|
305
|
+
if (picture) body.append(picture);
|
|
306
|
+
// What to paste in the Terminal, with its key to copy it.
|
|
307
|
+
const terminalOf = (lines) => {
|
|
308
|
+
const terminal = el('div', 'manual-terminal');
|
|
309
|
+
terminal.append(el('span', 'manual-terminal-dots'));
|
|
310
|
+
for (const line of lines) {
|
|
311
|
+
const row = el('div', 'manual-terminal-line');
|
|
312
|
+
row.append(el('span', 'manual-terminal-prompt', '$'), el('code', null, line));
|
|
313
|
+
if (!printing) {
|
|
314
|
+
const take = el('button', 'manual-copy', copy.copy);
|
|
315
|
+
take.type = 'button';
|
|
316
|
+
take.addEventListener('click', async () => {
|
|
317
|
+
try { await navigator.clipboard.writeText(line); take.textContent = copy.copied; setTimeout(() => { take.textContent = copy.copy; }, 1600); } catch { /* the line stays selectable */ }
|
|
318
|
+
});
|
|
319
|
+
row.append(take);
|
|
320
|
+
}
|
|
321
|
+
terminal.append(row);
|
|
322
|
+
}
|
|
323
|
+
return terminal;
|
|
324
|
+
};
|
|
325
|
+
if (section.code?.length) body.append(terminalOf(section.code));
|
|
326
|
+
// «Start here» (2026-10-28): the way in for each system, side by side — what it says first, its
|
|
327
|
+
// steps, the command, and one thing worth knowing there.
|
|
328
|
+
if (section.systems?.length) {
|
|
329
|
+
const systems = el('div', 'manual-systems');
|
|
330
|
+
for (const system of section.systems) {
|
|
331
|
+
const card = el('article', 'manual-system');
|
|
332
|
+
// A system with an anchor of its own (#windows: bin/madre.mjs and the mail point there).
|
|
333
|
+
if (system.id) card.id = system.id;
|
|
334
|
+
card.append(el('h3', null, plain(system.name)));
|
|
335
|
+
if (system.note) card.append(el('p', 'manual-system-note', plain(system.note)));
|
|
336
|
+
if (system.steps?.length) {
|
|
337
|
+
const list = el('ol', 'manual-system-steps');
|
|
338
|
+
for (const step of system.steps) { const item = el('li'); item.append(rich(step)); list.append(item); }
|
|
339
|
+
card.append(list);
|
|
340
|
+
}
|
|
341
|
+
if (system.code?.length) card.append(terminalOf(system.code));
|
|
342
|
+
if (system.tip) { const tip = el('p', 'manual-system-tip'); tip.append(rich(system.tip)); card.append(tip); }
|
|
343
|
+
systems.append(card);
|
|
344
|
+
}
|
|
345
|
+
body.append(systems);
|
|
346
|
+
}
|
|
347
|
+
// What goes wrong most often: what the person sees, and what to do.
|
|
348
|
+
if (section.problems?.length) {
|
|
349
|
+
const table = el('div', 'manual-problems');
|
|
350
|
+
const head = el('div', 'manual-problem head');
|
|
351
|
+
head.append(el('span', 'manual-label', copy.problem[0]), el('span', 'manual-label', copy.problem[1]));
|
|
352
|
+
table.append(head);
|
|
353
|
+
for (const [seen, fix] of section.problems) {
|
|
354
|
+
const row = el('div', 'manual-problem');
|
|
355
|
+
row.append(el('b', null, plain(seen)), rich(fix));
|
|
356
|
+
table.append(row);
|
|
357
|
+
}
|
|
358
|
+
body.append(table);
|
|
359
|
+
}
|
|
360
|
+
const side = el('div', 'manual-side');
|
|
361
|
+
const steps = el('ol', 'manual-steps');
|
|
362
|
+
(section.steps ?? []).forEach((step, at) => {
|
|
363
|
+
const item = el('li');
|
|
364
|
+
item.dataset.step = String(at + 1);
|
|
365
|
+
item.append(el('b', null, String(at + 1)), rich(step));
|
|
366
|
+
steps.append(item);
|
|
367
|
+
});
|
|
368
|
+
if (section.steps?.length) side.append(steps);
|
|
369
|
+
if (section.tryIt) {
|
|
370
|
+
const tryIt = el('aside', 'manual-try');
|
|
371
|
+
tryIt.append(el('span', 'manual-label', copy.tryIt), rich(section.tryIt));
|
|
372
|
+
side.append(tryIt);
|
|
373
|
+
}
|
|
374
|
+
if (side.childElementCount) body.append(side);
|
|
375
|
+
part.append(body);
|
|
376
|
+
const expert = el('aside', 'manual-expert');
|
|
377
|
+
expert.append(el('span', 'manual-label', copy.expert), rich(section.expert));
|
|
378
|
+
part.append(expert);
|
|
379
|
+
if (!printing) pairUp(part);
|
|
380
|
+
root.append(part);
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// Every shortcut, as the sheet `?` opens.
|
|
384
|
+
const keysPart = el('section', 'manual-section manual-shortcuts');
|
|
385
|
+
keysPart.id = 'atajos';
|
|
386
|
+
const keysHead = el('header', 'manual-section-head');
|
|
387
|
+
const keysBadge = el('span', 'manual-icon');
|
|
388
|
+
keysBadge.innerHTML = icon('keys'); // trusted: our own SVG
|
|
389
|
+
const keysWords = el('div');
|
|
390
|
+
keysWords.append(el('span', 'manual-number', String(copy.sections.length + 1).padStart(2, '0')), el('h2', null, copy.shortcuts));
|
|
391
|
+
keysHead.append(keysBadge, keysWords);
|
|
392
|
+
keysPart.append(keysHead);
|
|
393
|
+
const groups = el('div', 'manual-shortcut-groups');
|
|
394
|
+
for (const [group, rows] of GESTURES) {
|
|
395
|
+
const box = el('div', 'manual-shortcut-group');
|
|
396
|
+
box.append(el('h3', null, group[lang] ?? group.es));
|
|
397
|
+
const table = el('dl', 'manual-keys-table');
|
|
398
|
+
for (const [what, how] of rows) {
|
|
399
|
+
const dd = el('dd');
|
|
400
|
+
dd.append(keyChip(typeof how === 'string' ? how : how[lang] ?? how.es));
|
|
401
|
+
table.append(el('dt', null, what[lang] ?? what.es), dd);
|
|
402
|
+
}
|
|
403
|
+
box.append(table);
|
|
404
|
+
groups.append(box);
|
|
405
|
+
}
|
|
406
|
+
keysPart.append(groups);
|
|
407
|
+
root.append(keysPart);
|
|
408
|
+
|
|
409
|
+
const foot = el('footer', 'manual-foot');
|
|
410
|
+
foot.append(el('p', null, copy.closing), el('p', 'manual-copy', `MADRE${madre ? ` ${madre}` : ''} · © 2026 Jossue Alcalá`));
|
|
411
|
+
root.append(foot);
|
|
412
|
+
if (printing) for (const one of root.querySelectorAll('.manual-shot')) one.classList.add('shown');
|
|
413
|
+
else watchShots(root);
|
|
414
|
+
// The numbers once the pictures have their size, and again when the page changes width.
|
|
415
|
+
// On paper the page is ready once every number is placed; on screen at once (a lazy picture far
|
|
416
|
+
// down loads only when it is near).
|
|
417
|
+
const placed = placeAll(root);
|
|
418
|
+
if (printing) void placed.then(() => { document.documentElement.dataset.ready = '1'; });
|
|
419
|
+
else document.documentElement.dataset.ready = '1';
|
|
420
|
+
let resized = 0;
|
|
421
|
+
window.addEventListener('resize', () => { clearTimeout(resized); resized = setTimeout(() => root.querySelectorAll('.manual-shot-frame').forEach(placeNumbers), 120); });
|
|
422
|
+
if (location.hash) document.getElementById(location.hash.slice(1))?.scrollIntoView();
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (printing) document.documentElement.classList.add('printing');
|
|
426
|
+
const [room, madre] = await Promise.all([roomLanguage(), version()]);
|
|
427
|
+
draw(pick(asked.get('lang')) ?? room ?? browser, asked.get('version') ?? madre);
|
package/public/market-art.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// SPDX-License-Identifier:
|
|
2
|
-
// MADRE · © 2026 Jossue Alcalá ·
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
// MADRE · © 2026 Jossue Alcalá · Business Source License 1.1: LICENSE
|
|
3
3
|
// The Market's pictures (2026-10-18): drawn here, in code, not photographed. One scene for each
|
|
4
4
|
// module the carousel features — what it does, shown the way a person would see it happen — and a
|
|
5
5
|
// poster made from the icon for every other module. No words inside the drawings, so they read the
|
|
@@ -60,20 +60,20 @@ function handoffScene() {
|
|
|
60
60
|
return svg(`<defs>${shadow(`${id}s`)}
|
|
61
61
|
<linearGradient id="${id}a" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#fbbf24"/><stop offset="1" stop-color="#ea580c"/></linearGradient>
|
|
62
62
|
<linearGradient id="${id}b" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#818cf8"/><stop offset="1" stop-color="#7c3aed"/></linearGradient></defs>
|
|
63
|
-
<path d="M120 150C150 80 200 70 236 82" fill="none" stroke="
|
|
64
|
-
<path d="M376 300c40 30 70 22 92-6" fill="none" stroke="
|
|
63
|
+
<path d="M120 150C150 80 200 70 236 82" fill="none" stroke="currentColor" stroke-opacity=".35" stroke-width="3" stroke-dasharray="2 10" stroke-linecap="round"/>
|
|
64
|
+
<path d="M376 300c40 30 70 22 92-6" fill="none" stroke="currentColor" stroke-opacity=".35" stroke-width="3" stroke-dasharray="2 10" stroke-linecap="round"/>
|
|
65
65
|
<g filter="url(#${id}s)">
|
|
66
66
|
<path d="M176 84h66l14 16h112a20 20 0 0 1 20 20v188a20 20 0 0 1-20 20H176a20 20 0 0 1-20-20V104a20 20 0 0 1 20-20z" fill="#ffffff"/>
|
|
67
67
|
<rect x="182" y="118" width="70" height="22" rx="11" fill="#ecfdf5"/>
|
|
68
68
|
<text x="217" y="133.5" text-anchor="middle" font-family="ui-monospace, Menlo, monospace" font-size="12.5" font-weight="700" fill="#047857">.ahp/</text>
|
|
69
69
|
${row(170)}${row(214)}${row(258)}${row(302, false)}
|
|
70
70
|
</g>
|
|
71
|
-
<g filter="url(#${id}s)"><circle cx="96" cy="182" r="40" fill="
|
|
71
|
+
<g filter="url(#${id}s)"><circle cx="96" cy="182" r="40" fill="#f59e0b"/></g>
|
|
72
72
|
<path d="M96 164l5 12.5 13 5.5-13 5.5-5 12.5-5-12.5-13-5.5 13-5.5z" fill="#ffffff"/>
|
|
73
|
-
<g filter="url(#${id}s)"><circle cx="474" cy="262" r="40" fill="
|
|
73
|
+
<g filter="url(#${id}s)"><circle cx="474" cy="262" r="40" fill="#7c5cf0"/></g>
|
|
74
74
|
<path d="M458 262l10 10 20-22" fill="none" stroke="#ffffff" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
75
75
|
<g filter="url(#${id}s)" transform="rotate(-18 432 112)"><rect x="404" y="98" width="62" height="26" rx="13" fill="#ffffff"/>${bar(418, 108, 34, 6, '#10b981', .9)}</g>
|
|
76
|
-
<circle cx="470" cy="70" r="5" fill="
|
|
76
|
+
<circle cx="470" cy="70" r="5" fill="currentColor" fill-opacity=".18"/><circle cx="74" cy="300" r="4" fill="currentColor" fill-opacity=".15"/><circle cx="520" cy="170" r="3" fill="currentColor" fill-opacity=".15"/>`);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// IMAGES: what was asked, in a line, and what came back: the picture, with its other takes beside it.
|
|
@@ -103,59 +103,117 @@ function imagesScene() {
|
|
|
103
103
|
<rect x="56" y="116" width="304" height="232" rx="18" fill="none" stroke="#ffffff" stroke-width="5"/>
|
|
104
104
|
</g>
|
|
105
105
|
${take(116, 't1')}${take(198, 't2', true)}${take(280, 't3')}
|
|
106
|
-
<path d="M30 150l3 7.5 7.5 3-7.5 3-3 7.5-3-7.5-7.5-3 7.5-3z" fill="
|
|
107
|
-
<path d="M530 116l2.2 5.4 5.4 2.2-5.4 2.2-2.2 5.4-2.2-5.4-5.4-2.2 5.4-2.2z" fill="
|
|
108
|
-
<path d="M352 104l1.8 4.4 4.4 1.8-4.4 1.8-1.8 4.4-1.8-4.4-4.4-1.8 4.4-1.8z" fill="
|
|
106
|
+
<path d="M30 150l3 7.5 7.5 3-7.5 3-3 7.5-3-7.5-7.5-3 7.5-3z" fill="currentColor" fill-opacity=".4"/>
|
|
107
|
+
<path d="M530 116l2.2 5.4 5.4 2.2-5.4 2.2-2.2 5.4-2.2-5.4-5.4-2.2 5.4-2.2z" fill="currentColor" fill-opacity=".35"/>
|
|
108
|
+
<path d="M352 104l1.8 4.4 4.4 1.8-4.4 1.8-1.8 4.4-1.8-4.4-4.4-1.8 4.4-1.8z" fill="currentColor" fill-opacity=".35"/>`);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
// LOCAL AI:
|
|
112
|
-
//
|
|
111
|
+
// LOCAL AI (2026-10-27): a laptop drawn as one — a dark screen in its bezel, a thin base with its notch —
|
|
112
|
+
// with the conversation answered on it by the two sparkles, and beside it what that means: no
|
|
113
|
+
// internet needed, nothing leaves. Its accents are the module's flat colour.
|
|
114
|
+
const FLAT = 'var(--mk-flat, var(--mk-b, #334155))';
|
|
113
115
|
function localScene() {
|
|
114
116
|
const id = `mka${++drawn}`;
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const net = links.map(([a, b]) => `<line x1="${nodes[a][0]}" y1="${nodes[a][1]}" x2="${nodes[b][0]}" y2="${nodes[b][1]}" stroke="#86efac" stroke-opacity=".55" stroke-width="2"/>`).join('')
|
|
118
|
-
+ nodes.map(([x, y], index) => (index === 6 ? `<circle cx="${x}" cy="${y}" r="22" fill="#4ade80" fill-opacity=".22"/><circle cx="${x}" cy="${y}" r="13" fill="#4ade80"/>` : `<circle cx="${x}" cy="${y}" r="7" fill="#bbf7d0"/>`)).join('');
|
|
119
|
-
return svg(`<defs>${shadow(`${id}s`)}<radialGradient id="${id}g" cx=".5" cy=".45" r=".6"><stop offset="0" stop-color="#14532d"/><stop offset="1" stop-color="#052e16"/></radialGradient></defs>
|
|
117
|
+
const sparkle = (x, y, k) => `<path d="M${x} ${y - 10 * k}Q${x + 1.4 * k} ${y - 1.4 * k} ${x + 10 * k} ${y}Q${x + 1.4 * k} ${y + 1.4 * k} ${x} ${y + 10 * k}Q${x - 1.4 * k} ${y + 1.4 * k} ${x - 10 * k} ${y}Q${x - 1.4 * k} ${y - 1.4 * k} ${x} ${y - 10 * k}z"/>`;
|
|
118
|
+
return svg(`<defs>${shadow(`${id}s`)}</defs>
|
|
120
119
|
<g filter="url(#${id}s)">
|
|
121
|
-
<rect x="
|
|
122
|
-
<rect x="
|
|
123
|
-
<path d="
|
|
120
|
+
<rect x="110" y="52" width="340" height="226" rx="16" fill="#1c1f24"/>
|
|
121
|
+
<rect x="122" y="64" width="316" height="198" rx="8" fill="#0f1216"/>
|
|
122
|
+
<path d="M78 284h404a6 6 0 0 1 6 6v4a14 14 0 0 1-14 14H86a14 14 0 0 1-14-14v-4a6 6 0 0 1 6-6z" fill="#d5d9df"/>
|
|
123
|
+
<path d="M244 284h72a0 0 0 0 1 0 0v2a6 6 0 0 1-6 6h-60a6 6 0 0 1-6-6v-2z" fill="#aab1ba"/>
|
|
124
124
|
</g>
|
|
125
|
-
|
|
125
|
+
<rect x="140" y="80" width="280" height="22" rx="6" fill="#ffffff" fill-opacity=".06"/>
|
|
126
|
+
${bar(150, 88, 60, 6, '#ffffff', .35)}
|
|
127
|
+
<rect x="300" y="116" width="106" height="30" rx="14" fill="#ffffff" fill-opacity=".14"/>${bar(312, 128, 80, 6, '#ffffff', .6)}
|
|
128
|
+
<g style="fill:${FLAT}">${sparkle(160, 178, 1.15)}${sparkle(176, 160, .55)}</g>
|
|
129
|
+
<rect x="186" y="160" width="188" height="64" rx="14" fill="#ffffff" fill-opacity=".09"/>
|
|
130
|
+
${bar(200, 174, 150, 6, '#ffffff', .62)}${bar(200, 188, 128, 6, '#ffffff', .45)}${bar(200, 202, 96, 6, '#ffffff', .35)}
|
|
131
|
+
<rect x="140" y="236" width="280" height="16" rx="8" fill="#ffffff" fill-opacity=".07"/>
|
|
126
132
|
<g filter="url(#${id}s)">
|
|
127
|
-
<rect x="
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<path d="M14 8l70 52" stroke="#15803d" stroke-width="6" stroke-linecap="round"/>
|
|
135
|
-
</g>
|
|
136
|
-
<g filter="url(#${id}s)"><circle cx="80" cy="282" r="34" fill="#ffffff"/></g>
|
|
137
|
-
<rect x="66" y="280" width="28" height="22" rx="5" fill="#15803d"/><path d="M71 280v-6a9 9 0 0 1 18 0v6" fill="none" stroke="#15803d" stroke-width="4.5"/>
|
|
138
|
-
<circle cx="80" cy="290" r="3" fill="#ffffff"/>`);
|
|
133
|
+
<rect x="404" y="164" width="138" height="44" rx="22" fill="#ffffff"/>
|
|
134
|
+
<g transform="translate(418 174)" fill="none" stroke="#0f172a" stroke-width="2" stroke-linecap="round"><path d="M2 9a16 16 0 0 1 20 0M6 13.5a9.5 9.5 0 0 1 12 0"/><circle cx="12" cy="18" r="1.4" fill="#0f172a" stroke="none"/><path d="M3 2l18 20"/></g>
|
|
135
|
+
${bar(450, 182, 76, 8, '#0f172a', .6)}
|
|
136
|
+
<rect x="18" y="200" width="122" height="44" rx="22" fill="#ffffff"/>
|
|
137
|
+
<g transform="translate(32 210)"><rect x="3" y="10" width="18" height="13" rx="3.5" style="fill:${FLAT}"/><path d="M7 10V7a5 5 0 0 1 10 0v3" fill="none" style="stroke:${FLAT}" stroke-width="2.4"/></g>
|
|
138
|
+
${bar(64, 218, 60, 8, '#0f172a', .6)}
|
|
139
|
+
</g>`);
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
const SCENES = { playwright: browserScene, ahp: handoffScene, 'image-studio': imagesScene, ollama: localScene };
|
|
142
143
|
|
|
143
|
-
// Every other module: its
|
|
144
|
+
// Every other module (2026-10-27): its app tile, large, in its flat colour with its drawing in white,
|
|
145
|
+
// and two cards of what it does floating round it, on the shot's own ground.
|
|
144
146
|
function poster(item) {
|
|
145
147
|
const id = `mka${++drawn}`;
|
|
146
148
|
const face = moduleFace(item);
|
|
147
|
-
return svg(`<defs>${shadow(`${id}s`)}
|
|
148
|
-
<circle cx="280" cy="200" r="
|
|
149
|
+
return svg(`<defs>${shadow(`${id}s`)}</defs>
|
|
150
|
+
<circle cx="280" cy="200" r="150" fill="none" stroke="currentColor" stroke-opacity=".1" stroke-width="1.5"/>
|
|
151
|
+
<circle cx="280" cy="200" r="110" fill="none" stroke="currentColor" stroke-opacity=".08" stroke-width="1.5"/>
|
|
152
|
+
<g filter="url(#${id}s)">
|
|
153
|
+
<rect x="58" y="78" width="148" height="70" rx="16" fill="#ffffff"/>${bar(76, 96, 76, 8, '#0f172a', .6)}${bar(76, 112, 104, 6, '#94a3b8', .55)}${bar(76, 126, 64, 6, '#94a3b8', .4)}
|
|
154
|
+
<rect x="356" y="254" width="148" height="70" rx="16" fill="#ffffff"/>${bar(374, 272, 76, 8, '#0f172a', .6)}${bar(374, 288, 104, 6, '#94a3b8', .55)}${bar(374, 302, 64, 6, '#94a3b8', .4)}
|
|
155
|
+
<rect x="210" y="130" width="140" height="140" rx="33" style="fill:${FLAT}"/>
|
|
156
|
+
</g>
|
|
157
|
+
<g transform="translate(224 144) scale(5.6)" color="#ffffff">${face.icon}</g>`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// THE MODULE AT WORK (1.0.5): a project as a person sees it — the conversation, the bar with the
|
|
161
|
+
// module's key lit, and its window open beside, switched on. Drawn from the module's own icon.
|
|
162
|
+
function roomScene(item) {
|
|
163
|
+
const id = `mka${++drawn}`;
|
|
164
|
+
const face = moduleFace(item);
|
|
165
|
+
return svg(`<defs>${shadow(`${id}s`)}</defs>
|
|
149
166
|
<g filter="url(#${id}s)">
|
|
150
|
-
<rect x="
|
|
151
|
-
<rect x="
|
|
152
|
-
|
|
167
|
+
<rect x="40" y="40" width="480" height="320" rx="20" fill="#ffffff" fill-opacity=".94"/>
|
|
168
|
+
<rect x="58" y="56" width="444" height="34" rx="12" fill="#eef2f1"/>
|
|
169
|
+
${bar(72, 69, 56, 8, '#0f172a', .55)}
|
|
170
|
+
<circle cx="300" cy="73" r="10" fill="#e2e8f0"/><circle cx="326" cy="73" r="10" fill="#e2e8f0"/>
|
|
171
|
+
<rect x="342" y="61" width="24" height="24" rx="8" style="fill:${FLAT}"/>
|
|
172
|
+
<g transform="translate(346 65) scale(.8)" color="#ffffff">${face.icon}</g>
|
|
173
|
+
<circle cx="384" cy="73" r="10" fill="#e2e8f0"/><circle cx="476" cy="73" r="10" fill="#e2e8f0"/>
|
|
174
|
+
<rect x="72" y="112" width="190" height="44" rx="16" fill="#f1f5f9"/>${bar(88, 126, 130, 7, '#64748b', .55)}${bar(88, 140, 96, 7, '#64748b', .4)}
|
|
175
|
+
<rect x="132" y="170" width="140" height="34" rx="14" fill="#16a34a" fill-opacity=".85"/>${bar(148, 184, 96, 7, '#ffffff', .9)}
|
|
176
|
+
<rect x="72" y="218" width="200" height="58" rx="16" fill="#f1f5f9"/>${bar(88, 234, 150, 7, '#64748b', .55)}${bar(88, 248, 168, 7, '#64748b', .45)}${bar(88, 262, 90, 7, '#64748b', .35)}
|
|
177
|
+
<rect x="72" y="300" width="200" height="38" rx="14" fill="#ffffff" stroke="#e2e8f0"/>${bar(88, 316, 110, 6, '#94a3b8', .5)}
|
|
153
178
|
</g>
|
|
154
|
-
<g
|
|
155
|
-
|
|
179
|
+
<g filter="url(#${id}s)">
|
|
180
|
+
<rect x="296" y="112" width="206" height="226" rx="18" fill="#ffffff"/>
|
|
181
|
+
<rect x="314" y="130" width="40" height="40" rx="12" style="fill:${FLAT}"/>
|
|
182
|
+
<g transform="translate(320 136) scale(1.4)" color="#ffffff">${face.icon}</g>
|
|
183
|
+
${bar(366, 140, 86, 9, '#0f172a', .65)}${bar(366, 156, 62, 6, '#94a3b8', .55)}
|
|
184
|
+
<rect x="314" y="190" width="170" height="40" rx="12" fill="#f1f5f9"/>${bar(328, 207, 70, 7, '#475569', .55)}
|
|
185
|
+
<rect x="440" y="200" width="34" height="20" rx="10" fill="#16a34a"/><circle cx="464" cy="210" r="7" fill="#ffffff"/>
|
|
186
|
+
${bar(314, 248, 160, 7, '#94a3b8', .5)}${bar(314, 264, 140, 7, '#94a3b8', .4)}${bar(314, 280, 118, 7, '#94a3b8', .35)}
|
|
187
|
+
<rect x="314" y="300" width="80" height="24" rx="12" fill="#0f172a" fill-opacity=".08"/>
|
|
188
|
+
</g>`);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// THREE STEPS (1.0.5): find it in the Market, switch it on, and it is working. No words: a basket,
|
|
192
|
+
// a switch and the module's own icon with a check, joined by the way they follow each other.
|
|
193
|
+
function stepsScene(item) {
|
|
194
|
+
const id = `mka${++drawn}`;
|
|
195
|
+
const face = moduleFace(item);
|
|
196
|
+
const card = (x) => `<rect x="${x}" y="130" width="140" height="150" rx="22" fill="#ffffff" fill-opacity=".94"/>`;
|
|
197
|
+
const arrow = (x) => `<path d="M${x} 205h26m-8-8 8 8-8 8" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" opacity=".4"/>`;
|
|
198
|
+
const basket = '<g fill="none" stroke="#0f172a" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="4.4" y="5.2" width="3.4" height="3.4" rx="1"/><circle cx="10" cy="5.3" r="1.8"/><rect x="12.2" y="5.2" width="3.4" height="3.4" rx="1"/><path d="M2.8 10.4h14.4l-1.5 5.4a1.6 1.6 0 0 1-1.6 1.2H5.9a1.6 1.6 0 0 1-1.6-1.2z"/></g>';
|
|
199
|
+
return svg(`<defs>${shadow(`${id}s`)}</defs>
|
|
200
|
+
<g filter="url(#${id}s)">${card(46)}${card(210)}${card(374)}</g>
|
|
201
|
+
<g transform="translate(86 165) scale(3)">${basket}</g>${bar(86, 246, 60, 7, '#94a3b8', .55)}
|
|
202
|
+
<rect x="244" y="184" width="72" height="40" rx="20" fill="#16a34a"/><circle cx="296" cy="204" r="15" fill="#ffffff"/>${bar(250, 246, 60, 7, '#94a3b8', .55)}
|
|
203
|
+
<rect x="404" y="160" width="80" height="80" rx="22" style="fill:${FLAT}"/>
|
|
204
|
+
<g transform="translate(420 176) scale(2.4)" color="#ffffff">${face.icon}</g>
|
|
205
|
+
<circle cx="478" cy="166" r="15" fill="#16a34a" stroke="#ffffff" stroke-width="3"/><path d="M471 166l5 5 9-10" fill="none" stroke="#ffffff" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
206
|
+
${bar(414, 256, 60, 7, '#94a3b8', .55)}
|
|
207
|
+
${arrow(190)}${arrow(354)}`);
|
|
156
208
|
}
|
|
157
209
|
|
|
158
210
|
// The picture of a module: its own scene when it has one — drawn here, or sent with the catalog
|
|
159
211
|
// (kept to the shapes a drawing needs, market.js) — and its poster otherwise.
|
|
160
212
|
export const marketArt = (item) => (SCENES[item?.id] ? SCENES[item.id]() : cleanSvg(remoteEntry(item?.id)?.art) ?? poster(item));
|
|
161
213
|
export const hasScene = (item) => Boolean(SCENES[item?.id] || remoteEntry(item?.id)?.art);
|
|
214
|
+
// Its gallery (1.0.5): its picture, then two more — the ones its catalog entry sends (`shots`,
|
|
215
|
+
// drawings kept to their shapes), or the module at work and its three steps.
|
|
216
|
+
export function marketGallery(item) {
|
|
217
|
+
const sent = (remoteEntry(item?.id)?.shots ?? []).map((one) => cleanSvg(one)).filter(Boolean).slice(0, 2);
|
|
218
|
+
return [marketArt(item), sent[0] ?? roomScene(item), sent[1] ?? stepsScene(item)];
|
|
219
|
+
}
|