@jossuealcala/madre 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.en.md +37 -1
- package/CHANGELOG.md +37 -1
- package/README.en.md +2 -6
- package/README.md +2 -6
- package/bin/madre.mjs +21 -22
- package/docs/REFERENCE.md +2 -1
- package/docs/en/REFERENCE.md +2 -1
- package/package.json +1 -1
- package/public/app.js +11 -5
- package/public/en.js +1 -1
- package/public/es.js +154 -12
- package/public/macroverso.js +4 -1
- package/public/manual-content.js +24 -20
- package/public/market.js +13 -2
- package/public/page-errors.js +2 -0
- package/public/salas-mac.css +69 -0
- package/public/salas-mac.js +313 -3
- package/public/troubleshooting.js +20 -4
- package/public/welcome.js +40 -12
- package/src/dataset.mjs +4 -2
- package/src/embeddings.mjs +2 -2
- package/src/file-ops.mjs +9 -3
- package/src/github.mjs +5 -3
- package/src/market-remote.mjs +35 -2
- package/src/mcp/memory-server.mjs +12 -3
- package/src/mcp/proxy.mjs +31 -8
- package/src/memory-tools.mjs +9 -2
- package/src/memory.mjs +16 -0
- package/src/modules/check-alone.mjs +25 -0
- package/src/modules/index.mjs +41 -7
- package/src/modules/ollama.mjs +14 -8
- package/src/mother.mjs +6 -1
- package/src/outbound.mjs +11 -3
- package/src/room/archivist.mjs +7 -1
- package/src/room/context.mjs +6 -3
- package/src/room/copilot.mjs +22 -28
- package/src/room.mjs +4 -4
- package/src/rumbo.mjs +337 -0
- package/src/salas.mjs +103 -1
- package/src/sentinel-errors.mjs +4 -1
- package/src/server.mjs +135 -20
- package/src/setup-trouble.mjs +2 -0
- package/src/tour.mjs +2 -2
- package/src/whats-new.mjs +23 -0
package/public/salas-mac.js
CHANGED
|
@@ -61,6 +61,8 @@ let arming = 0;
|
|
|
61
61
|
let data = null;
|
|
62
62
|
let macro = null; // the macroverse, while it is open
|
|
63
63
|
let welcomed = false; // the welcome was offered this visit (public/welcome.js)
|
|
64
|
+
// Whether this copy is owed the invitation to a first project (2026-11-01, homeInvite), asked once.
|
|
65
|
+
const inviteAsk = fetch('/api/invite/project', { cache: 'no-store' }).then((response) => (response.ok ? response.json() : null)).catch(() => null);
|
|
64
66
|
let welcomeSeen = null; // where the welcome is (src/tour.mjs, `welcome`), as last saved
|
|
65
67
|
let agentsSeen = null; // what /api/settings said of the agents, last time it was asked
|
|
66
68
|
let localSeen = null; // what /api/salas/local-ai said: the mode and which projects use the local AI
|
|
@@ -507,7 +509,14 @@ function draw() {
|
|
|
507
509
|
// An empty Home opens the welcome where it was left, or at the project when it was finished
|
|
508
510
|
// without one; someone new meets it in place of the bonjour (public/tour.js).
|
|
509
511
|
// Not for whoever updated from before 1.1.0: they meet the news, and «Add project» is on Home (2026-10-30).
|
|
510
|
-
|
|
512
|
+
// After an update with no project yet (2026-11-01), the invitation to add one takes the welcome's place.
|
|
513
|
+
if (!all.length && !welcomed) {
|
|
514
|
+
welcomed = true;
|
|
515
|
+
void Promise.all([homeTour.loaded, inviteAsk]).then(([answer, invite]) => {
|
|
516
|
+
if (invite?.show) { void homeInvite(); return; }
|
|
517
|
+
if (!answer?.owed && !answer?.upgraded) openHomeWelcome({ at: answer?.state?.welcome?.finished ? 'project' : null });
|
|
518
|
+
});
|
|
519
|
+
}
|
|
511
520
|
welcomeHome();
|
|
512
521
|
// Home is drawn: the ground over its first frame goes (loader.js, bootDone) — unless the welcome is
|
|
513
522
|
// about to open, whose opening comes first; then it goes as the welcome opens (openHomeWelcome).
|
|
@@ -1522,6 +1531,9 @@ const WIDGETS = {
|
|
|
1522
1531
|
'w-live': { kind: 'live', owner: true, name: () => t('MADRE live'), about: () => t('How many copies of MADRE are on right now, and how many of this month\'s are off. Only you see this.'), size: 4, rows: 3 },
|
|
1523
1532
|
'w-installs': { kind: 'installs', owner: true, name: () => t('Installs'), about: () => t('Installs, updates and uninstalls of MADRE by day, the last 30 days. Only you see this.'), size: 8, rows: 3 },
|
|
1524
1533
|
'w-environments': { kind: 'environments', owner: true, name: () => t('Where MADRE runs'), about: () => t('The systems, memory, agents, projects per copy and modules of the copies this month. Only you see this.'), size: 8, rows: 5 },
|
|
1534
|
+
// MADRE's course (2026-11-01, src/rumbo.mjs): the variables that decide where the project goes,
|
|
1535
|
+
// from madre.run's funnel, GitHub and npm. Only in the author's copy run from source.
|
|
1536
|
+
'w-rumbo': { kind: 'rumbo', owner: true, name: () => t('MADRE\'s course'), about: () => t('The variables that decide where MADRE goes: from a visit to a habit, what the numbers decide, and GitHub and npm. Only you see this.'), size: 12, sizes: [12] },
|
|
1525
1537
|
'w-models': { kind: 'models', name: () => t('Local models'), about: () => t('Ollama, its models, and how close each project is to its own.'), size: 4, rows: 3 },
|
|
1526
1538
|
// Your agenda (2026-10-28): every project's reminders by when they are due — late, today, tomorrow,
|
|
1527
1539
|
// this week, later —, each settled here, and a new one written as you would say it. Read from the
|
|
@@ -1553,6 +1565,7 @@ const TILE_ICONS = {
|
|
|
1553
1565
|
'w-live': trazo('broadcast'),
|
|
1554
1566
|
'w-installs': trazo('download'),
|
|
1555
1567
|
'w-environments': trazo('globe'),
|
|
1568
|
+
'w-rumbo': trazo('trending'),
|
|
1556
1569
|
};
|
|
1557
1570
|
const tileIcon = (id) => { const box = el('span', 'sm-tile-icon'); box.innerHTML = TILE_ICONS[id] ?? ''; return box; }; // trusted: our own SVG strings
|
|
1558
1571
|
const known = (id) => Object.hasOwn(HOME_TILES, id) || Object.hasOwn(WIDGETS, id);
|
|
@@ -2153,6 +2166,255 @@ const WIDGET_PAINT = {
|
|
|
2153
2166
|
}
|
|
2154
2167
|
body.append(box);
|
|
2155
2168
|
},
|
|
2169
|
+
// MADRE's course (2026-11-01, src/rumbo.mjs): the week's north star, the funnel from a visit to a
|
|
2170
|
+
// habit with its leak marked, what the numbers decide, every variable with how sure it is, the
|
|
2171
|
+
// weeks, and the project's record on GitHub and npm. Read again every 20 s; each source keeps its
|
|
2172
|
+
// own clock on the server.
|
|
2173
|
+
rumbo(body, reading) {
|
|
2174
|
+
if (!reading.available) { body.append(el('p', 'sm-hint', reading.status ? t('madre.run answered {status}.', { status: reading.status }) : t('madre.run could not be reached.'))); return; }
|
|
2175
|
+
const n = (value) => (value === null || value === undefined ? '—' : Number(value).toLocaleString());
|
|
2176
|
+
const signed = (value) => (value === null || value === undefined ? '—' : `${value > 0 ? '+' : ''}${Math.round(value * 100)}%`);
|
|
2177
|
+
const shortDay = (day) => new Date(`${day}T12:00:00Z`).toLocaleDateString(document.documentElement.lang === 'en' ? 'en-US' : 'es-MX', { day: 'numeric', month: 'short' });
|
|
2178
|
+
const section = (title, line) => { const head = el('div', 'sm-rumbo-head'); head.append(el('b', null, title)); if (line) head.append(el('small', null, line)); return head; };
|
|
2179
|
+
const byId = Object.fromEntries((reading.variables ?? []).map((one) => [one.id, one]));
|
|
2180
|
+
|
|
2181
|
+
// The north star: copies that asked an AI something this week.
|
|
2182
|
+
const north = reading.north;
|
|
2183
|
+
if (north) {
|
|
2184
|
+
const lead = el('div', 'sm-usage-lead');
|
|
2185
|
+
const change = north.before ? (north.activated - north.before) / north.before : null;
|
|
2186
|
+
const trend = change === null ? t('the first week the diagnostics can tell') : change === 0 ? t('same as the week before') : change > 0 ? t('{n}% more than the week before', { n: Math.round(change * 100) }) : t('{n}% fewer than the week before', { n: Math.round(-change * 100) });
|
|
2187
|
+
lead.append(el('b', 'sm-w-big', n(north.activated)), el('span', null, t('copies asked an AI something this week')), el('small', `sm-usage-trend${change > 0 ? ' up' : change < 0 ? ' down' : ''}`, `${trend} · ${t('{active} copies on this week, {fresh} of them new', { active: n(north.active), fresh: n(north.new) })}`));
|
|
2188
|
+
body.append(lead);
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
const grid = el('div', 'sm-rumbo');
|
|
2192
|
+
const left = el('div', 'sm-rumbo-col');
|
|
2193
|
+
const right = el('div', 'sm-rumbo-col');
|
|
2194
|
+
grid.append(left, right);
|
|
2195
|
+
body.append(grid);
|
|
2196
|
+
|
|
2197
|
+
// THE FUNNEL: each step against the one before it; the leak in red.
|
|
2198
|
+
const LEAK = { ready: 'ready', firstProject: 'used', readyToUse: 'used', d1: 'back', habit: 'habit' };
|
|
2199
|
+
const leak = LEAK[(reading.decisions ?? []).find((one) => one.id === 'bottleneck')?.verdict] ?? null;
|
|
2200
|
+
const STAGES = {
|
|
2201
|
+
visits: [t('GitHub visitors'), t('people, 14 days')],
|
|
2202
|
+
downloads: [t('npm downloads'), t('14 days, mirrors included')],
|
|
2203
|
+
new: [t('New copies'), t('30 days')],
|
|
2204
|
+
told: [t('With diagnostics'), t('1.1.0 or newer')],
|
|
2205
|
+
ready: [t('An AI ready'), null],
|
|
2206
|
+
used: [t('Asked an AI'), null],
|
|
2207
|
+
back: [t('Came back another day'), null],
|
|
2208
|
+
habit: [t('Used it on 2 days'), null],
|
|
2209
|
+
};
|
|
2210
|
+
const funnel = el('div', 'sm-rumbo-funnel');
|
|
2211
|
+
const stages = (reading.funnel ?? []).filter((one) => one.n !== null);
|
|
2212
|
+
const top = Math.max(1, ...stages.filter((one) => !one.side).map((one) => one.n));
|
|
2213
|
+
let before = null;
|
|
2214
|
+
for (const stage of stages) {
|
|
2215
|
+
const [label, line] = STAGES[stage.id] ?? [stage.id, null];
|
|
2216
|
+
const row = el('div', `sm-rumbo-stage${stage.side ? ' side' : ''}${leak === stage.id ? ' is-leak' : ''}`);
|
|
2217
|
+
const words = el('span', 'sm-rumbo-stage-words');
|
|
2218
|
+
words.append(el('b', null, label));
|
|
2219
|
+
const of = stage.of ? t('of {n} at least a day old', { n: n(stage.of) }) : line;
|
|
2220
|
+
if (of) words.append(el('small', null, of));
|
|
2221
|
+
const base = stage.of ?? before;
|
|
2222
|
+
const share = base && !stage.side && !['visits', 'new'].includes(stage.id) ? stage.n / base : null;
|
|
2223
|
+
row.append(words, meter(stage.side ? stage.n / Math.max(stage.n, top) : stage.n / top, leak === stage.id ? 'hot' : null), el('b', 'sm-rumbo-n', n(stage.n)), el('small', 'sm-rumbo-pct', share === null ? '' : `${Math.round(share * 100)}%`));
|
|
2224
|
+
if (leak === stage.id) row.title = t('The leak to fix first');
|
|
2225
|
+
funnel.append(row);
|
|
2226
|
+
if (!stage.side && stage.id !== 'visits') before = stage.n;
|
|
2227
|
+
}
|
|
2228
|
+
left.append(section(t('From a visit to a habit'), t('% is of the step before')), funnel);
|
|
2229
|
+
|
|
2230
|
+
// WHAT THE NUMBERS DECIDE.
|
|
2231
|
+
const pctOf = (value) => (value === null || value === undefined ? '—' : `${Math.round(value * 100)}%`);
|
|
2232
|
+
const BARS = {
|
|
2233
|
+
activatedWeek: (one) => t('{value} of {need} copies asking an AI a week', { value: n(one.value), need: n(one.need) }),
|
|
2234
|
+
d7: (one) => t('{value} of {need} back after 7 days', { value: pctOf(one.value), need: pctOf(one.need) }),
|
|
2235
|
+
habit: (one) => t('{value} of {need} using it on 2 days', { value: pctOf(one.value), need: pctOf(one.need) }),
|
|
2236
|
+
heavy: (one) => t('{value} of {need} with 2 projects or more', { value: pctOf(one.value), need: pctOf(one.need) }),
|
|
2237
|
+
weeksGrowing: (one) => t('{value} of {need} weeks growing in a row', { value: n(one.value), need: n(one.need) }),
|
|
2238
|
+
};
|
|
2239
|
+
const SAYS = {
|
|
2240
|
+
bottleneck: [t('Where people are lost'), (d) => ({
|
|
2241
|
+
ready: t('Setting up an AI: only {pct} of new copies get one ready. The way to a first AI is the leak to fix first.', { pct: pctOf(d.figures.value) }),
|
|
2242
|
+
firstProject: t('Opening a project: {n} of {total} copies never opened one. Without a project there is nothing to ask; the way to a first project is the leak to fix first.', { n: n(d.figures.noProject), total: n(d.figures.projectsKnown) }),
|
|
2243
|
+
readyToUse: t('The first question: {pct} of the copies with an AI ready never asked it anything.', { pct: pctOf(1 - (d.figures.value ?? 0)) }),
|
|
2244
|
+
d1: t('Coming back: only {pct} return after the first day.', { pct: pctOf(d.figures.value) }),
|
|
2245
|
+
habit: t('Habit: only {pct} used an AI on two days or more.', { pct: pctOf(d.figures.value) }),
|
|
2246
|
+
})[d.verdict]],
|
|
2247
|
+
focus: [t('Product or reach'), (d) => ({
|
|
2248
|
+
product: t('Product first: {used} of new copies ask an AI something and {d1} come back. More visitors now would only fill the leak.', { used: pctOf(d.figures.used), d1: pctOf(d.figures.d1) }),
|
|
2249
|
+
reach: t('Reach: new copies use it and come back, but the week did not grow. Time to tell more people.'),
|
|
2250
|
+
both: t('Both hold: copies use it, come back and the week grows.'),
|
|
2251
|
+
})[d.verdict]],
|
|
2252
|
+
windows: [t('Windows and the native app'), (d) => ({
|
|
2253
|
+
priority: t('{share} of new copies come from Windows, and {win} of them ask an AI (the rest, {rest}). Windows is the main door: the native app weighs on the course.', { share: pctOf(d.figures.share), win: pctOf(d.figures.winUse), rest: pctOf(d.figures.restUse) }),
|
|
2254
|
+
relevant: t('{share} of new copies come from Windows ({win} ask an AI; the rest, {rest}).', { share: pctOf(d.figures.share), win: pctOf(d.figures.winUse), rest: pctOf(d.figures.restUse) }),
|
|
2255
|
+
minor: t('Windows is {share} of new copies: not the main door yet.', { share: pctOf(d.figures.share) }),
|
|
2256
|
+
})[d.verdict]],
|
|
2257
|
+
pro: [t('Charging for MADRE Pro'), (d) => ({
|
|
2258
|
+
ready: t('The four bars are met: there is a base to charge for Pro.'),
|
|
2259
|
+
close: t('{met} of 4 bars met.', { met: d.figures.met }),
|
|
2260
|
+
early: t('Not yet: {met} of 4 bars met.', { met: d.figures.met }),
|
|
2261
|
+
})[d.verdict]],
|
|
2262
|
+
invest: [t('Traction to show'), (d) => ({
|
|
2263
|
+
ready: t('Growing week after week with people who stay: there is traction to show.'),
|
|
2264
|
+
waiting: t('It takes two weeks with diagnostics to tell whether it grows week after week.'),
|
|
2265
|
+
close: t('{met} of 3 bars met.', { met: d.figures.met }),
|
|
2266
|
+
early: t('Not yet: {met} of 3 bars met.', { met: d.figures.met }),
|
|
2267
|
+
})[d.verdict]],
|
|
2268
|
+
english: [t('English'), (d) => ({
|
|
2269
|
+
invest: t('{share} of copies speak English: worth building for it.', { share: pctOf(d.figures.share) }),
|
|
2270
|
+
keep: t('{share} of copies speak English: keep it working, Spanish leads.', { share: pctOf(d.figures.share) }),
|
|
2271
|
+
spanish: t('{share} of copies speak English: Spanish is where MADRE is used.', { share: pctOf(d.figures.share) }),
|
|
2272
|
+
})[d.verdict]],
|
|
2273
|
+
quality: [t('Failures'), (d) => ({
|
|
2274
|
+
fix: t('{share} of copies met a failure ({k} of {n}): fix before spreading MADRE further.', { share: pctOf(d.figures.value), k: n(d.figures.k), n: n(d.figures.n) }),
|
|
2275
|
+
watch: t('{share} of copies met a failure ({k} of {n}): keep an eye on MADRE errors.', { share: pctOf(d.figures.value), k: n(d.figures.k), n: n(d.figures.n) }),
|
|
2276
|
+
fine: t('{share} of copies met a failure: it holds up.', { share: pctOf(d.figures.value) }),
|
|
2277
|
+
})[d.verdict]],
|
|
2278
|
+
};
|
|
2279
|
+
const decisions = el('div', 'sm-rumbo-decisions');
|
|
2280
|
+
for (const one of reading.decisions ?? []) {
|
|
2281
|
+
const [question, say] = SAYS[one.id] ?? [];
|
|
2282
|
+
if (!question) continue;
|
|
2283
|
+
const row = el('div', `sm-rumbo-decision is-${one.signal}`);
|
|
2284
|
+
const words = el('div', 'sm-rumbo-decision-words');
|
|
2285
|
+
words.append(el('b', null, question), el('span', null, say(one) ?? ''));
|
|
2286
|
+
if (one.figures?.bars) {
|
|
2287
|
+
const chips = el('div', 'sm-rumbo-bars');
|
|
2288
|
+
for (const bar of one.figures.bars) chips.append(el('small', bar.met ? 'met' : null, `${bar.met ? '✓' : '·'} ${BARS[bar.id]?.(bar) ?? bar.id}`));
|
|
2289
|
+
words.append(chips);
|
|
2290
|
+
}
|
|
2291
|
+
row.append(el('i', 'sm-rumbo-dot'), words);
|
|
2292
|
+
decisions.append(row);
|
|
2293
|
+
}
|
|
2294
|
+
right.append(section(t('What the numbers say'), t('Green holds, amber to watch, red to act on')), decisions);
|
|
2295
|
+
|
|
2296
|
+
// THE VARIABLES, each with its band: where the true figure lies nine times out of ten.
|
|
2297
|
+
const NAMES = {
|
|
2298
|
+
ready: t('New copies with an AI ready'),
|
|
2299
|
+
used: t('New copies that asked an AI'),
|
|
2300
|
+
readyToUse: t('With an AI ready, asked it'),
|
|
2301
|
+
firstProject: t('Copies with a project'),
|
|
2302
|
+
d1: t('Back after a day'),
|
|
2303
|
+
d7: t('Back after 7 days'),
|
|
2304
|
+
habit: t('Used it on 2 days or more'),
|
|
2305
|
+
growth: t('Copies asking an AI, week on week'),
|
|
2306
|
+
newGrowth: t('New copies, week on week'),
|
|
2307
|
+
starGrowth: t('Stars, week on week'),
|
|
2308
|
+
starRate: t('Stars per GitHub visitor'),
|
|
2309
|
+
failing: t('Copies that met a failure'),
|
|
2310
|
+
uninstall: t('Uninstalls per install'),
|
|
2311
|
+
windowsShare: t('New copies from Windows'),
|
|
2312
|
+
englishShare: t('Copies in English'),
|
|
2313
|
+
coverage: t('New copies with diagnostics'),
|
|
2314
|
+
topSource: t('Visitors from the top source'),
|
|
2315
|
+
};
|
|
2316
|
+
const GROUPS = { activation: t('Activation'), retention: t('Retention'), momentum: t('Momentum'), quality: t('Quality'), market: t('Market') };
|
|
2317
|
+
const SURE = { high: t('sure'), medium: t('fairly sure'), low: t('small sample') };
|
|
2318
|
+
const table = el('div', 'sm-rumbo-vars');
|
|
2319
|
+
for (const [group, title] of Object.entries(GROUPS)) {
|
|
2320
|
+
const mine = (reading.variables ?? []).filter((one) => one.group === group);
|
|
2321
|
+
if (!mine.length) continue;
|
|
2322
|
+
table.append(el('span', 'sm-rumbo-group', title));
|
|
2323
|
+
for (const one of mine) {
|
|
2324
|
+
const row = el('div', `sm-rumbo-var is-${one.signal}`);
|
|
2325
|
+
const name = one.id === 'topSource' && one.source ? `${NAMES[one.id]} · ${one.source}` : NAMES[one.id] ?? one.id;
|
|
2326
|
+
const value = one.kind === 'change' ? signed(one.value) : pctOf(one.value);
|
|
2327
|
+
const band = el('span', 'sm-rumbo-band');
|
|
2328
|
+
if (one.kind === 'rate' && one.interval) {
|
|
2329
|
+
const fill = el('i');
|
|
2330
|
+
fill.style.left = `${one.interval.low * 100}%`;
|
|
2331
|
+
fill.style.width = `${Math.max(1, (one.interval.high - one.interval.low) * 100)}%`;
|
|
2332
|
+
const dot = el('b');
|
|
2333
|
+
dot.style.left = `${(one.value ?? 0) * 100}%`;
|
|
2334
|
+
band.append(fill, dot);
|
|
2335
|
+
if (one.threshold) for (const at of [one.threshold.bad, one.threshold.good]) { const tick = el('em'); tick.style.left = `${at * 100}%`; band.append(tick); }
|
|
2336
|
+
band.title = t('Between {low} and {high}, nine times out of ten', { low: pctOf(one.interval.low), high: pctOf(one.interval.high) });
|
|
2337
|
+
}
|
|
2338
|
+
const count = one.kind === 'change' ? t('{now} vs {before}', { now: n(one.now), before: n(one.before) }) : t('{k} of {n}', { k: n(one.k), n: n(one.n) });
|
|
2339
|
+
row.append(el('i', 'sm-rumbo-dot'), el('span', 'sm-rumbo-var-name', name), el('b', 'sm-rumbo-n', value), band, el('small', null, `${count} · ${SURE[one.confidence] ?? ''}`));
|
|
2340
|
+
if (one.threshold) row.title = one.threshold.lower ? t('Good at {good} or less, red over {bad}', { good: pctOf(one.threshold.good), bad: pctOf(one.threshold.bad) }) : one.kind === 'change' ? t('Good from {good}, red under {bad}', { good: signed(one.threshold.good), bad: signed(one.threshold.bad) }) : t('Good from {good}, red under {bad}', { good: pctOf(one.threshold.good), bad: pctOf(one.threshold.bad) });
|
|
2341
|
+
table.append(row);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
body.append(section(t('The variables'), t('The band is where the true figure lies nine times out of ten; the ticks, where it turns amber and green')), table);
|
|
2345
|
+
|
|
2346
|
+
// THE WEEKS: on, new, and the ones that asked an AI.
|
|
2347
|
+
const weeks = (reading.weeks ?? []).filter((one, i, all) => one.active || all.slice(0, i).some((before) => before.active));
|
|
2348
|
+
const lower = el('div', 'sm-rumbo');
|
|
2349
|
+
if (weeks.length) {
|
|
2350
|
+
const peak = Math.max(1, ...weeks.map((one) => one.active));
|
|
2351
|
+
const chart = el('div', 'sm-rumbo-weeks');
|
|
2352
|
+
chart.setAttribute('role', 'img');
|
|
2353
|
+
chart.setAttribute('aria-label', t('Copies on, new and asking an AI, week by week'));
|
|
2354
|
+
for (const one of weeks) {
|
|
2355
|
+
const week = el('span');
|
|
2356
|
+
for (const [field, tone] of [['active', 'on'], ['new', 'new'], ['activated', 'used']]) {
|
|
2357
|
+
const bar = el('i', tone);
|
|
2358
|
+
bar.style.setProperty('--h', String(one[field] / peak));
|
|
2359
|
+
week.append(bar);
|
|
2360
|
+
}
|
|
2361
|
+
week.append(el('small', null, shortDay(one.start)));
|
|
2362
|
+
week.title = t('Week of {day}: {active} on · {fresh} new · {used} asked an AI', { day: shortDay(one.start), active: one.active, fresh: one.new, used: one.activated });
|
|
2363
|
+
chart.append(week);
|
|
2364
|
+
}
|
|
2365
|
+
const box = el('div', 'sm-rumbo-col');
|
|
2366
|
+
const legend = el('small', 'sm-usage-legend');
|
|
2367
|
+
legend.append(el('i', 'is-on'), t('on'), el('i', 'is-new'), t('new'), el('i', 'is-used'), t('asked an AI'));
|
|
2368
|
+
box.append(section(t('Week by week'), null), chart, legend);
|
|
2369
|
+
lower.append(box);
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
// THE RECORD: GitHub and npm since the start.
|
|
2373
|
+
const record = reading.record ?? {};
|
|
2374
|
+
const facts = el('div', 'sm-usage-lines sm-rumbo-record');
|
|
2375
|
+
const lines = [];
|
|
2376
|
+
if (record.stars !== null && record.stars !== undefined) lines.push([t('Stars'), t('{n} · {week} this week · {forks} forks', { n: n(record.stars), week: n(record.stars7), forks: n(record.forks) })]);
|
|
2377
|
+
if (record.visits) lines.push([t('GitHub, 14 days'), t('{v} visits from {u} people · {c} clones', { v: n(record.visits.count), u: n(record.visits.uniques), c: n(record.clones?.count) })]);
|
|
2378
|
+
if (record.installer) lines.push([t('Windows installer'), t('{n} downloads from GitHub', { n: n(record.installer.total) })]);
|
|
2379
|
+
if (record.npm) lines.push([t('npm'), t('{week} last week · {total} in 90 days · {top}', { week: n(record.npm.lastWeek), total: n(record.npm.total), top: (record.npm.byVersion ?? []).slice(0, 3).map((one) => `${one.version} ${n(one.n)}`).join(' · ') })]);
|
|
2380
|
+
const sources = byId.topSource?.sources ?? [];
|
|
2381
|
+
if (sources.length) lines.push([t('Visitors come from'), sources.map((one) => `${one.name} ${n(one.n)}`).join(' · ')]);
|
|
2382
|
+
for (const [label, said] of lines) {
|
|
2383
|
+
const row = el('div', 'sm-w-line');
|
|
2384
|
+
row.append(el('b', null, label), el('small', null, said));
|
|
2385
|
+
facts.append(row);
|
|
2386
|
+
}
|
|
2387
|
+
// Stars by day since the first one: the project's own history.
|
|
2388
|
+
const stars = record.starsByDay ?? [];
|
|
2389
|
+
const box = el('div', 'sm-rumbo-col');
|
|
2390
|
+
box.append(section(t('GitHub and npm'), null), facts);
|
|
2391
|
+
if (stars.length) {
|
|
2392
|
+
const first = Date.parse(`${stars[0].day}T12:00:00Z`);
|
|
2393
|
+
const span = Math.max(1, Math.round((Date.now() - first) / 86_400_000) + 1);
|
|
2394
|
+
const perDay = new Map(stars.map((one) => [one.day, one.n]));
|
|
2395
|
+
const values = Array.from({ length: span }, (_, i) => perDay.get(new Date(first + i * 86_400_000).toISOString().slice(0, 10)) ?? 0);
|
|
2396
|
+
const peak = Math.max(1, ...values);
|
|
2397
|
+
const strip = el('div', 'sm-rumbo-strip');
|
|
2398
|
+
strip.style.setProperty('--days', String(span));
|
|
2399
|
+
strip.setAttribute('role', 'img');
|
|
2400
|
+
strip.setAttribute('aria-label', t('Stars each day since the first'));
|
|
2401
|
+
values.forEach((value, i) => { const bar = el('i'); bar.style.setProperty('--h', String(value / peak)); bar.title = `${shortDay(new Date(first + i * 86_400_000).toISOString().slice(0, 10))}: ${value}`; strip.append(bar); });
|
|
2402
|
+
const axis = el('div', 'sm-usage-axis');
|
|
2403
|
+
axis.append(el('small', null, shortDay(stars[0].day)), el('small', null, t('stars each day')), el('small', null, t('today')));
|
|
2404
|
+
box.append(strip, axis);
|
|
2405
|
+
}
|
|
2406
|
+
lower.append(box);
|
|
2407
|
+
body.append(lower);
|
|
2408
|
+
|
|
2409
|
+
// Where each figure came from, and when.
|
|
2410
|
+
const said = reading.sources ?? {};
|
|
2411
|
+
const when = (one) => (one?.at ? ago(one.at) : t('never'));
|
|
2412
|
+
const foot = el('small', 'sm-w-foot', t('Read: madre.run {a} · GitHub {b} · npm {c}', { a: when(said.madre), b: when(said.github), c: when(said.npm) }));
|
|
2413
|
+
body.append(foot);
|
|
2414
|
+
if (said.madre?.failed && !said.madre.at) body.append(el('p', 'sm-hint', t('madre.run does not give the funnel yet (it answered {status}): publish the site so it has /api/rumbo.', { status: said.madre.status || '—' })));
|
|
2415
|
+
else if (said.madre?.failed) body.append(el('p', 'sm-hint', t('madre.run did not answer just now: these are its last figures.')));
|
|
2416
|
+
if (!said.github?.at) body.append(el('p', 'sm-hint', t('GitHub is read with your gh session: sign in with gh auth login to see stars and visits.')));
|
|
2417
|
+
},
|
|
2156
2418
|
usage(body, reading) {
|
|
2157
2419
|
if (!reading.available) { body.append(el('p', 'sm-hint', reading.status ? t('madre.run answered {status}.', { status: reading.status }) : t('madre.run could not be reached.'))); return; }
|
|
2158
2420
|
const n = (value) => Number(value ?? 0).toLocaleString();
|
|
@@ -2461,6 +2723,7 @@ const WIDGET_GUIDE = {
|
|
|
2461
2723
|
live: () => t('Copies on right now: a copy is on when it said so in the last ten minutes. Off are the ones used this month that are not on now. It reads again every minute.'),
|
|
2462
2724
|
installs: () => t('Installs, updates and uninstalls by day. An uninstall counts only when made from Settings; whoever simply stops using MADRE shows as off.'),
|
|
2463
2725
|
environments: () => t('Each copy once, by what it said last this month: its system, memory, agents, how many projects and which modules. Copies from before 1.1.0 say less.'),
|
|
2726
|
+
rumbo: () => t('The model of what decides MADRE\'s course: the funnel from a GitHub visit to using it on two days, with its leak in red; what the numbers say about product or reach, Windows, Pro, traction, English and failures; and every variable with how sure it is. It reads itself again on its own.'),
|
|
2464
2727
|
agenda: () => t('Your reminders from every project, by day. ✓ settles one, «Later» moves it, and the box below sets a new one as you would say it.'),
|
|
2465
2728
|
};
|
|
2466
2729
|
function guideWidget(node, kind) {
|
|
@@ -2616,7 +2879,11 @@ function openLinkSheet({ reader = null, source = null } = {}) {
|
|
|
2616
2879
|
// Coordinator as the one that shares, the two change places; it never reads both ways.
|
|
2617
2880
|
const coordinator = (id) => Boolean(data.salas) && id === data.salas;
|
|
2618
2881
|
if (coordinator(pick.source)) [pick.reader, pick.source] = [pick.source, pick.reader];
|
|
2619
|
-
|
|
2882
|
+
// One project and the Coordinator, asked from the project's card (it as the one that reads):
|
|
2883
|
+
// nobody else could share, so the project shares and the Coordinator reads. Without this the
|
|
2884
|
+
// sheet started with no source and broke on its first paint (1.1.0 diagnostics, 3 copies).
|
|
2885
|
+
if (!pick.source && pick.reader && !coordinator(pick.reader) && rooms.some((room) => coordinator(room.id))) [pick.source, pick.reader] = [pick.reader, data.salas];
|
|
2886
|
+
const settle =() => { if (coordinator(pick.source) && !coordinator(pick.reader)) [pick.reader, pick.source] = [pick.source, pick.reader]; if (coordinator(pick.source) || coordinator(pick.reader)) pick.both = false; };
|
|
2620
2887
|
const roomOf = (id) => rooms.find((room) => room.id === id) ?? null;
|
|
2621
2888
|
const nameOf = (id) => { const room = roomOf(id); return room ? roomLabel(room) : ''; };
|
|
2622
2889
|
// Orders only with BISHOP on one side; they would go into the other.
|
|
@@ -2754,7 +3021,7 @@ function openLinkSheet({ reader = null, source = null } = {}) {
|
|
|
2754
3021
|
return node;
|
|
2755
3022
|
}
|
|
2756
3023
|
function paintEnd(node, id, role) {
|
|
2757
|
-
if (node.dataset.room !== id) {
|
|
3024
|
+
if (node.dataset.room !== id || !node.lastChild) {
|
|
2758
3025
|
node.dataset.room = id;
|
|
2759
3026
|
node.replaceChildren();
|
|
2760
3027
|
const body = id === data.salas ? mark('bishop', 46) : (() => { const disc = el('span', 'lw-room-mark'); disc.innerHTML = FOLDER_GLYPH; return disc; })(); // trusted: drawn here
|
|
@@ -3086,6 +3353,47 @@ async function homeNews(tries = 0) {
|
|
|
3086
3353
|
void fetch('/api/whats-new/seen', { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' }).catch(() => null);
|
|
3087
3354
|
}
|
|
3088
3355
|
|
|
3356
|
+
// THE INVITATION TO A FIRST PROJECT (2026-11-01): whoever updates MADRE and still has no project is
|
|
3357
|
+
// asked once per version, on Home, to add one. 90 of 147 copies never opened a project, and MADRE does
|
|
3358
|
+
// nothing without one. Two ways in, the folder they work in or the project to try (src/salas.mjs,
|
|
3359
|
+
// createSampleProject), which opens straight on its first messages; and «Not now». Never over the
|
|
3360
|
+
// news, the welcome or another window. What they choose is counted with the anonymous diagnostics.
|
|
3361
|
+
const tellInvite = (answer) => fetch('/api/invite/project', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ answer }) }).catch(() => null);
|
|
3362
|
+
async function homeInvite(tries = 0) {
|
|
3363
|
+
if (welcomeOpen() || document.querySelector('dialog[open]')) { if (tries < 120) setTimeout(() => void homeInvite(tries + 1), 3000); return; }
|
|
3364
|
+
const dialog = el('dialog', 'sm-sheet sm-invite');
|
|
3365
|
+
const inner = el('div', 'sm-sheet-body');
|
|
3366
|
+
const head = el('header', 'sm-sheet-head');
|
|
3367
|
+
let answered = false;
|
|
3368
|
+
const answer = (said) => { if (answered) return; answered = true; void tellInvite(said); };
|
|
3369
|
+
head.append(el('h3', null, t('Add your first project')), closeKey(() => dialog.close()));
|
|
3370
|
+
const lead = el('p', null, t('MADRE works inside a project: a folder with your store, your website or your documents. There your AIs read, remember what you decide and show you every change.'));
|
|
3371
|
+
const hint = el('p', 'hint', t('You have none yet. Choose a folder you already work in, or make one to try: a page with a list of tasks, to ask your AIs for changes without fear of breaking anything.'));
|
|
3372
|
+
const keys = el('div', 'sm-invite-keys');
|
|
3373
|
+
const later = button('sm-btn', t('Not now'), () => dialog.close());
|
|
3374
|
+
const sample = button('sm-btn', t('Make the project to try'), async () => {
|
|
3375
|
+
sample.disabled = true;
|
|
3376
|
+
answer('sample');
|
|
3377
|
+
const made = await fetch('/api/salas/new', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ sample: true, language }) })
|
|
3378
|
+
.then(async (response) => ({ ok: response.ok, body: await response.json().catch(() => ({})) })).catch(() => ({ ok: false, body: {} }));
|
|
3379
|
+
const room = made.ok ? made.body.added?.[0] : null;
|
|
3380
|
+
if (!room) { hint.textContent = made.body?.error ?? t('The project to try MADRE could not be made.'); sample.disabled = false; return; }
|
|
3381
|
+
dialog.close();
|
|
3382
|
+
await refresh();
|
|
3383
|
+
await startRoom(room, { enter: true });
|
|
3384
|
+
});
|
|
3385
|
+
const pick = button('sm-btn primary', t('Choose a folder'), () => { answer('picked'); dialog.close(); openAddSheet(); });
|
|
3386
|
+
keys.append(later, sample, pick);
|
|
3387
|
+
inner.append(head, wizardScene('projects'), lead, hint, keys);
|
|
3388
|
+
dialog.append(inner);
|
|
3389
|
+
dialog.addEventListener('close', () => { answer('later'); dialog.remove(); });
|
|
3390
|
+
document.body.append(dialog);
|
|
3391
|
+
dialog.showModal();
|
|
3392
|
+
bootDone();
|
|
3393
|
+
void tellInvite('shown');
|
|
3394
|
+
pick.focus({ preventScroll: true });
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3089
3397
|
// Home in another language, without a reload: what it says now, and every widget and the tour's pill.
|
|
3090
3398
|
function sayIn(code) {
|
|
3091
3399
|
language = setLanguage(code);
|
|
@@ -4535,6 +4843,7 @@ const TROUBLE_WORDS = {
|
|
|
4535
4843
|
permission: () => t('This computer did not let MADRE install it. Try again; if it fails again, install it from a terminal (below).'),
|
|
4536
4844
|
disk: () => t('There is not enough free space on this computer to install it.'),
|
|
4537
4845
|
'npm-missing': () => t('Installing it needs Node and npm, and this computer does not have them. Install Node from nodejs.org, then try again.'),
|
|
4846
|
+
'zstd-missing': () => t('Installing it needs zstd, which this Linux does not have. In a terminal: sudo apt install -y zstd, then try again.'),
|
|
4538
4847
|
timeout: () => t('It took too long and was stopped. Try again.'),
|
|
4539
4848
|
unknown: () => t('It did not install.'),
|
|
4540
4849
|
},
|
|
@@ -4904,6 +5213,7 @@ const welcomeHost = {
|
|
|
4904
5213
|
chapters: () => homeTour.openChapters('home'),
|
|
4905
5214
|
saved: (welcome) => { welcomeSeen = welcome; drawAttention(); },
|
|
4906
5215
|
closed: () => { void loadAgents(); void refresh(); },
|
|
5216
|
+
refresh: () => refresh(),
|
|
4907
5217
|
};
|
|
4908
5218
|
function openHomeWelcome({ at = null, then = null } = {}) {
|
|
4909
5219
|
welcomed = true;
|
|
@@ -202,13 +202,27 @@ export const CONDITIONS = [
|
|
|
202
202
|
remedy: 'Wait for the usage to renew, change the Cursor plan, or ask another agent in the meantime.',
|
|
203
203
|
fixes: same(['# plan and usage: https://cursor.com/dashboard', 'cursor-agent status']),
|
|
204
204
|
},
|
|
205
|
+
{
|
|
206
|
+
// Seen in the diagnostics of 1.1.0 (2026-10-31): Codex on a free ChatGPT account ran out and
|
|
207
|
+
// the room called it an unknown failure.
|
|
208
|
+
id: 'codex-usage-limit',
|
|
209
|
+
code: 'MU-074',
|
|
210
|
+
agent: 'codex',
|
|
211
|
+
severity: 'blocking',
|
|
212
|
+
title: 'Codex has reached its usage limit',
|
|
213
|
+
match: /hit your usage limit|usage limit reached|Upgrade to (?:Plus|Pro) to continue/i,
|
|
214
|
+
diagnosis: 'Your ChatGPT account has used up the Codex usage its plan gives for this period, and Codex refuses every turn until it renews. Codex says when that is at the end of its message. It is OpenAI\'s limit, not MADRE\'s: nothing in the project is wrong.',
|
|
215
|
+
remedy: 'Wait until the date Codex gives, change your ChatGPT plan, or ask another agent in the meantime.',
|
|
216
|
+
fixes: same(['# plan and usage: https://chatgpt.com/codex/settings/usage']),
|
|
217
|
+
},
|
|
205
218
|
{
|
|
206
219
|
id: 'not-signed-in',
|
|
207
220
|
code: 'MU-008',
|
|
208
221
|
solvedIn: 'connections',
|
|
209
222
|
severity: 'blocking',
|
|
210
223
|
title: 'Agent installed but signed out',
|
|
211
|
-
|
|
224
|
+
// «set an Auth method»: Gemini with no account chosen exits with code 41 (1.1.0 diagnostics).
|
|
225
|
+
match: /not logged in|sign in required|Error authenticating|unauthorized|please (?:log|sign) ?in|no credentials|set an Auth method/i,
|
|
212
226
|
diagnosis: 'The CLI is on this computer but has no session for its provider. MADRE never stores credentials; each agent keeps its own.',
|
|
213
227
|
remedy: 'This agent has no session yet. Connect it once in Settings › Agents (MADRE runs its sign-in for you, nothing to type in a terminal), or ask the same of an agent that is connected.',
|
|
214
228
|
fixes: same(['npx @jossuealcala/madre setup', '# or directly:', 'codex login', 'claude auth login', 'opencode auth login', 'gemini # then /auth']),
|
|
@@ -411,7 +425,9 @@ export const CONDITIONS = [
|
|
|
411
425
|
code: 'MU-023',
|
|
412
426
|
severity: 'informational',
|
|
413
427
|
title: 'Permission modes: #0 INCOGNITO · #1 CHAT ONLY · #2 CREATE · #3 EDIT · #4 FULL ACCESS',
|
|
414
|
-
|
|
428
|
+
// \bmodes?\b: a bare «mode» also matched «model», and any agent failure that named its model
|
|
429
|
+
// was filed as this help card (1.1.0 diagnostics, MU-023 from Codex and OpenCode).
|
|
430
|
+
match: /\bmodes?\b|ghost|exchange|control|airlock|deploy|despleg|producci|override|designation|max mode|#[0-4]\b/i,
|
|
415
431
|
diagnosis: 'Every message goes out at a mode, chosen in the chip after TO @agent (or typed as #2 in the text). #0 INCOGNITO is off the record: nothing is saved, no other agent remembers it, gone on reload, no plan. #1 CHAT ONLY is the default: read and coordinate. #2 CREATE lets the agent add new files and folders anywhere in the project, where they belong; whatever existed before is put back after the turn and the project says so. #3 EDIT puts one agent in command of the project itself: a git restore point is taken first, every change is listed afterwards, writes into .git, .pulse or .env files are reverted on the spot, and UNDO goes back to the restore point. One holder at a time; it needs Max mode #3 and a git repository. Your mode is the ceiling of any plan the message starts, and #3 is never given to a plan step. Each agent has a Max mode in Settings → Permissions; above it, #2 is answered read-only and #3 is refused. When a #1 plan reaches a step that wants to create something, the project pauses and asks you: GRANT ONCE, GRANT FOR PLAN or DENY, with a 3-minute clock; silence denies. #4 FULL ACCESS is EDIT plus commands: tests, builds, git push, deploys with the CLIs and sessions already on this machine. Files still come back with UNDO; what leaves the machine does not, so the unlock asks for the project name twice. An agent that says it needs a "production mode" or "permission to run commands" is asking for #4.',
|
|
416
432
|
remedy: 'Pick the mode in the chip, or type #0..#4 in the message. Raise an agent\'s Max mode in Settings → Permissions, under Who may do what. EDIT asks for the project name (the folder name) in the unlock; FULL ACCESS asks for it twice.',
|
|
417
433
|
fixes: same(['# chip: TO @codex #1 CHAT ONLY ▾ → choose', '@codex #2 create the poster', '@opencode #4 run the tests and deploy to preview', '# Settings → Permissions → Who may do what']),
|
|
@@ -861,12 +877,12 @@ export const CONDITIONS = [
|
|
|
861
877
|
title: 'MADRE on Windows',
|
|
862
878
|
match: /\bwin32\b|native Windows|Windows nativo|wsl --install/i,
|
|
863
879
|
diagnosis: 'On Windows, MADRE runs inside WSL2 (Windows Subsystem for Linux), the Linux that comes with Windows 10 and 11. Inside it MADRE works as on any Linux, and opens in your Windows browser. It does not run on Windows directly.',
|
|
864
|
-
remedy: '
|
|
880
|
+
remedy: 'Download MADRE\'s installer from madre.run/windows and open it with a double click: it turns WSL on, prepares MADRE\'s Linux and leaves MADRE in the Start menu, with no terminal. Keep your projects inside Linux, not in /mnt/c.',
|
|
865
881
|
fixes: {
|
|
866
882
|
darwin: ['# this is for Windows'],
|
|
867
883
|
linux: ['# this is for Windows'],
|
|
868
884
|
wsl: ['# you are already in WSL: MADRE runs here as on any Linux'],
|
|
869
|
-
win32: ['# in PowerShell, as administrator, once:', 'wsl --install', '# restart, open «Ubuntu» from the Start menu, and in it:', 'curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -', 'sudo apt install -y nodejs', 'npx @jossuealcala/madre'],
|
|
885
|
+
win32: ['# the installer, a double click and no terminal:', 'https://madre.run/windows', '# or by hand: in PowerShell, as administrator, once:', 'wsl --install', '# restart, open «Ubuntu» from the Start menu, and in it:', 'curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -', 'sudo apt install -y nodejs zstd', 'npx @jossuealcala/madre'],
|
|
870
886
|
},
|
|
871
887
|
},
|
|
872
888
|
];
|
package/public/welcome.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
//
|
|
13
13
|
// The host page hands in what only it can do: `agentsPanel(options)` and `projectPicker(options)`
|
|
14
14
|
// (Home's own), `mark(id, size)`, `closeKey(onClick)`, `projects()`, `openProject(room)`,
|
|
15
|
-
// `setLanguage(code)`, `agentState(agent, answer)`, `openLinks()`, `openMarket()`, `saved(welcome)
|
|
16
|
-
// and `closed()`.
|
|
15
|
+
// `setLanguage(code)`, `agentState(agent, answer)`, `openLinks()`, `openMarket()`, `saved(welcome)`,
|
|
16
|
+
// `refresh()` (Home's projects read again) and `closed()`.
|
|
17
17
|
|
|
18
18
|
import { t, language } from './i18n.js';
|
|
19
19
|
import { platformOf, remedyKey } from './remedy.js';
|
|
@@ -43,7 +43,10 @@ const post = async (url, payload = {}) => {
|
|
|
43
43
|
const getJson = (url) => fetch(url, { cache: 'no-store' }).then((response) => (response.ok ? response.json() : null)).catch(() => null);
|
|
44
44
|
const number = (value) => new Intl.NumberFormat(language(), { maximumFractionDigits: 1 }).format(value);
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
// The project comes right after the agents (2026-11-01): 90 of 147 copies never opened one, and
|
|
47
|
+
// the AI on the computer and the memory, heavy and optional, stood in front of it.
|
|
48
|
+
export const WELCOME_STEPS = ['hello', 'machine', 'agents', 'project', 'ai', 'memory', 'ready'];
|
|
49
|
+
const stepOf = (id) => WELCOME_STEPS.indexOf(id) + 1;
|
|
47
50
|
const STEP_NAMES = {
|
|
48
51
|
hello: () => t('Hello'), machine: () => t('Your computer'), agents: () => t('Your agents'), ai: () => t('AI on your computer'),
|
|
49
52
|
memory: () => t('Memory'), project: () => t('Your project'), ready: () => t('Ready'),
|
|
@@ -266,9 +269,9 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
266
269
|
const list = el('div', 'wl-card wl-checks');
|
|
267
270
|
for (const [title, sub] of [
|
|
268
271
|
[t('Your agents'), t('The AIs that work in your projects (Claude, Codex, Gemini…). We install and connect them here.')],
|
|
272
|
+
[t('Your first project'), t('A folder you work in. It is ready when we finish.')],
|
|
269
273
|
[t('AI on your computer'), t('If your computer can carry it, a free and private AI that works without internet.')],
|
|
270
274
|
[t('Memory'), t('So MADRE finds what it remembers even when you ask in other words.')],
|
|
271
|
-
[t('Your first project'), t('A folder you work in. It is ready when we finish.')],
|
|
272
275
|
]) {
|
|
273
276
|
const row = el('div', 'wl-check');
|
|
274
277
|
const tick = el('span', 'wl-tick');
|
|
@@ -310,7 +313,7 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
310
313
|
fact(t('Free space'), env.disk ? t('{n} GB free', { n: number(env.disk.freeGb) }) : null);
|
|
311
314
|
const notes = [];
|
|
312
315
|
const carry = canCarry();
|
|
313
|
-
if (carry === 'yes') notes.push(note('ok', t('Your computer can run its own AI. We recommend a model in step
|
|
316
|
+
if (carry === 'yes') notes.push(note('ok', t('Your computer can run its own AI. We recommend a model in step {n}.', { n: stepOf('ai') })));
|
|
314
317
|
else if (carry === 'slow') notes.push(note('warn', t('Your computer can run a small AI, but slowly: it has no graphics card the AI can use.')));
|
|
315
318
|
else notes.push(note('warn', t('This computer does not have enough memory for an AI of its own. MADRE works just the same with your agents.')));
|
|
316
319
|
if (env.place === 'wsl') notes.push(note('', t('MADRE runs here on Linux, inside Windows (WSL). Your Windows browser opens it directly.')));
|
|
@@ -320,7 +323,7 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
320
323
|
if (env.vm && env.vm !== 'macOS') notes.push(note('warn', t('MADRE runs in a virtual machine: an AI here runs slower than on the computer itself. If that computer runs Windows, MADRE works better in WSL.')));
|
|
321
324
|
if (env.place === 'ssh') notes.push(note('', t('You\'re connected from another computer. Some agents connect with a code instead of opening a page; each one says so.'), fix('ssh-tunnel')));
|
|
322
325
|
if (env.place === 'container') notes.push(note('', t('MADRE runs inside a container: what it installs stays in that container.')));
|
|
323
|
-
if (env.disk && env.disk.freeGb < 10) notes.push(note('warn', t('Only {n} GB free. Agents fit, but an AI of its own needs more room: free some up before step
|
|
326
|
+
if (env.disk && env.disk.freeGb < 10) notes.push(note('warn', t('Only {n} GB free. Agents fit, but an AI of its own needs more room: free some up before step {step}.', { n: number(env.disk.freeGb), step: stepOf('ai') })));
|
|
324
327
|
content.replaceChildren(...head(t('Here is what we found'), t('We use it to recommend what works best on your computer. It never leaves your computer.')), grid, ...notes);
|
|
325
328
|
footer();
|
|
326
329
|
}
|
|
@@ -360,7 +363,7 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
360
363
|
for (const node of actions.querySelectorAll('.wl-skipnote, [data-skip]')) node.hidden = Boolean(s.ready);
|
|
361
364
|
}
|
|
362
365
|
|
|
363
|
-
// ----
|
|
366
|
+
// ---- 5 · AI ON YOUR COMPUTER: install Ollama, download the model, try it — or use another
|
|
364
367
|
// computer's, or leave it for later.
|
|
365
368
|
function aiChoices() {
|
|
366
369
|
const env = s.env ?? {};
|
|
@@ -669,7 +672,7 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
669
672
|
return box;
|
|
670
673
|
}
|
|
671
674
|
|
|
672
|
-
// ----
|
|
675
|
+
// ---- 6 · MEMORY: search by meaning on this computer, with Gemini, or exact words.
|
|
673
676
|
let memoryBody = null;
|
|
674
677
|
function memoryStep() {
|
|
675
678
|
memoryBody = el('div', 'wl-memory');
|
|
@@ -697,7 +700,7 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
697
700
|
const pick = (value) => { s.memoryChoice = value; if (value === 'local' && !hasModel(EMBED_MODEL) && !s.pulls.get(EMBED_MODEL)?.running) void startPull(EMBED_MODEL); paintMemory(); };
|
|
698
701
|
const embedReady = hasModel(EMBED_MODEL);
|
|
699
702
|
const group = choices(t('Memory'),
|
|
700
|
-
choice('memory', 'local', s.memoryChoice, s.ollama?.host && !localHost(s.ollama.host) ? t('With your Ollama') : t('On your computer'), local ? (embedReady ? (s.ollama?.host && !localHost(s.ollama.host) ? t('With the Ollama of the other computer, on your network. Its memory model is already there. Free and private.') : t('With Ollama. Its memory model is already here. Free and private.')) : t('With Ollama. Downloads a memory model of {mb} MB. Free and private.', { mb: EMBED_MB })) : t('Needs the AI on your computer (step
|
|
703
|
+
choice('memory', 'local', s.memoryChoice, s.ollama?.host && !localHost(s.ollama.host) ? t('With your Ollama') : t('On your computer'), local ? (embedReady ? (s.ollama?.host && !localHost(s.ollama.host) ? t('With the Ollama of the other computer, on your network. Its memory model is already there. Free and private.') : t('With Ollama. Its memory model is already here. Free and private.')) : t('With Ollama. Downloads a memory model of {mb} MB. Free and private.', { mb: EMBED_MB })) : t('Needs the AI on your computer (step {n}).', { n: stepOf('ai') }), pick, { badge: local ? t('Recommended') : null, disabled: !local }),
|
|
701
704
|
choice('memory', 'gemini', s.memoryChoice, t('With Gemini'), s.geminiKey ? t('Uses your Gemini key, already on this computer. Paid per use, very little. What it searches is sent to Google.') : t('Needs your Gemini key: paste it in step 3, in Gemini.'), pick, { badge: !local && s.geminiKey ? t('Recommended') : null }),
|
|
702
705
|
choice('memory', 'off', s.memoryChoice, t('Exact words only'), t('Nothing extra. It finds what you ask for with the same words.'), pick),
|
|
703
706
|
);
|
|
@@ -727,7 +730,7 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
727
730
|
});
|
|
728
731
|
}
|
|
729
732
|
|
|
730
|
-
// ----
|
|
733
|
+
// ---- 4 · YOUR PROJECT: a new one or a folder that already is one.
|
|
731
734
|
function project() {
|
|
732
735
|
const had = host.projects?.() ?? [];
|
|
733
736
|
const lead = t('A project is a folder you work in: a store, a website, your documents. Each one has its own conversations and its own memory.');
|
|
@@ -749,6 +752,20 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
749
752
|
},
|
|
750
753
|
});
|
|
751
754
|
if (picker) parts.push(picker.node);
|
|
755
|
+
// No project at hand (2026-11-01): one made to try MADRE, a page with a list of tasks and a README
|
|
756
|
+
// with what to ask. «I do not know what I would do with MADRE» is answered by having something.
|
|
757
|
+
const sample = el('div', 'wl-card wl-sample');
|
|
758
|
+
const said = el('p', 'wl-muted', t('No project at hand? Make one to try: a page with a list of tasks, to ask your AIs for changes without fear of breaking anything.'));
|
|
759
|
+
const make = button('wl-btn small', t('Make the project to try'), async () => {
|
|
760
|
+
make.disabled = true;
|
|
761
|
+
const answer = await post('/api/salas/new', { sample: true, language: language() });
|
|
762
|
+
if (!answer.ok) { said.textContent = answer.body?.error ?? t('The project to try MADRE could not be made.'); make.disabled = false; return; }
|
|
763
|
+
s.added = [...s.added, ...(answer.body.added ?? [])];
|
|
764
|
+
await host.refresh?.();
|
|
765
|
+
if (stepId() === 'project') go(s.step + 1, 'done');
|
|
766
|
+
});
|
|
767
|
+
sample.append(said, make);
|
|
768
|
+
parts.push(sample);
|
|
752
769
|
content.replaceChildren(...parts);
|
|
753
770
|
footer({
|
|
754
771
|
nextOff: !had.length,
|
|
@@ -815,8 +832,19 @@ export function openWelcome({ at = null, then = null, host = {} } = {}) {
|
|
|
815
832
|
}
|
|
816
833
|
content.replaceChildren(...head(t('MADRE is ready'), t('Here is what is ready. Anything you left for later has its button.')), summary, el('p', 'wl-eyebrow wl-gap', t('What comes next')), nextCards, trainCard);
|
|
817
834
|
const learn = button('wl-btn', t('Get to know MADRE'), () => { const after = then ?? host.chapters; finish(); after?.(); });
|
|
818
|
-
//
|
|
819
|
-
//
|
|
835
|
+
// Into the project when there is one and an agent to answer (2026-11-01): 90 of 147 copies never
|
|
836
|
+
// opened a project, and the welcome ended in Home with the Market and connections as what comes
|
|
837
|
+
// next. The project opens on its blank page, with three first messages to press. Without a
|
|
838
|
+
// project or an agent, Home as before (2026-10-30), whose first-time cards walk the person there.
|
|
839
|
+
if (room && connected.length) {
|
|
840
|
+
const home = button('wl-btn ghost', t('Go to Home'), () => finish());
|
|
841
|
+
footer({
|
|
842
|
+
next: t('Open {name} and write your first message', { name: room.name }),
|
|
843
|
+
onNext: () => { finish(); void host.openProject?.(room); },
|
|
844
|
+
extra: (() => { const keys = el('span', 'wl-keys'); keys.append(learn, home); return keys; })(),
|
|
845
|
+
});
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
820
848
|
footer({
|
|
821
849
|
next: t('Go to Home'),
|
|
822
850
|
onNext: () => finish(),
|
package/src/dataset.mjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { mkdir, readFile, readdir, rm, writeFile } from 'node:fs/promises';
|
|
11
11
|
import { join } from 'node:path';
|
|
12
12
|
import { redact } from './sentinel-errors.mjs';
|
|
13
|
-
import { ABERRATION, VERDICTS, NEGATIVE_VERDICTS, POSITIVE_VERDICTS } from './memory.mjs';
|
|
13
|
+
import { ABERRATION, VERDICTS, NEGATIVE_VERDICTS, POSITIVE_VERDICTS, travels } from './memory.mjs';
|
|
14
14
|
|
|
15
15
|
const MIN_ANSWER_CHARS = 40;
|
|
16
16
|
|
|
@@ -107,7 +107,9 @@ export function readiness(events, notes = [], { target = DATASET_TARGET } = {})
|
|
|
107
107
|
// below, where being wrong is the point.
|
|
108
108
|
export function pairsFromNotes(notes, { project = 'project', home, user, privacy = null } = {}) {
|
|
109
109
|
const clean = guard(privacy);
|
|
110
|
-
|
|
110
|
+
// Nor one the human quarantined or put out (2026-11-01, external review #14): the recall stopped
|
|
111
|
+
// handing it over, and training on it would teach the model what the room stopped believing.
|
|
112
|
+
return notes.filter((note) => note.kind !== ABERRATION && !note.refutedBy && (!note.zone || travels(note))).map((note) => ({
|
|
111
113
|
kind: 'note',
|
|
112
114
|
agent: 'madre',
|
|
113
115
|
mode: 1,
|