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