create-pmos 0.448.0 → 0.450.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/package.json +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/adler-seasons-art-test.js +9 -2
- package/workspace/adler-seasons-test.js +1 -1
- package/workspace/changelog.json +24 -0
- package/workspace/guide/adler.md +15 -15
- package/workspace/lib/grill-api.js +146 -0
- package/workspace/lib/grill-runs.js +14 -2
- package/workspace/lib/grill.js +3 -0
- package/workspace/lib/page-build.js +8 -0
- package/workspace/package-lock.json +84 -2
- package/workspace/package.json +2 -1
- package/workspace/public/pm/adler/01_expressions/celebrating.png +0 -0
- package/workspace/public/pm/adler/01_expressions/handled.png +0 -0
- package/workspace/public/pm/adler/01_expressions/honest.png +0 -0
- package/workspace/public/pm/adler/01_expressions/needs_you.png +0 -0
- package/workspace/public/pm/adler/01_expressions/resting.png +0 -0
- package/workspace/public/pm/adler/01_expressions/thinking.png +0 -0
- package/workspace/public/pm/adler/02_moments/headphones_honest.png +0 -0
- package/workspace/public/pm/adler/02_moments/headphones_listening.png +0 -0
- package/workspace/public/pm/adler/02_moments/headphones_resting.png +0 -0
- package/workspace/public/pm/adler/02_moments/hello_wave.png +0 -0
- package/workspace/public/pm/adler/02_moments/honest_full_figure.png +0 -0
- package/workspace/public/pm/adler/02_moments/leaf_tips_peeking.png +0 -0
- package/workspace/public/pm/adler/02_moments/morning_stretch.png +0 -0
- package/workspace/public/pm/adler/02_moments/peeking_up.png +0 -0
- package/workspace/public/pm/adler/02_moments/tea_mug.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/clipboard.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/laptop_alert.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/laptop_resting.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/sprout_large.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/sprout_medium.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/sprout_none.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/sprout_small.png +0 -0
- package/workspace/public/pm/adler/03_growth_activity/telescope.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/cloud_large.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/cloud_medium.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/cloud_small.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/crescent_stars.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/leaf_green.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/leaf_orange.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/leaf_pink.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/rain_cloud.png +0 -0
- package/workspace/public/pm/adler/04_weather_leaves/sun.png +0 -0
- package/workspace/public/pm/adler/05_space/lunar_ground.png +0 -0
- package/workspace/public/pm/adler/05_space/planet_cloud.png +0 -0
- package/workspace/public/pm/adler/05_space/planet_crater.png +0 -0
- package/workspace/public/pm/adler/05_space/planet_glass.png +0 -0
- package/workspace/public/pm/adler/05_space/planet_smooth.png +0 -0
- package/workspace/public/pm/adler/05_space/rocket_flying.png +0 -0
- package/workspace/public/pm/adler/05_space/rocket_idle.png +0 -0
- package/workspace/public/pm/adler/05_space/rocket_liftoff.png +0 -0
- package/workspace/public/pm/adler/05_space/satellite.png +0 -0
- package/workspace/public/pm/adler/05_space/satellite_dish.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/beach.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/deciduous_forest.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/desert_large.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/desert_small.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/floating_island_large.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/floating_island_small.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/lake.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/pine_forest.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/snow_forest.png +0 -0
- package/workspace/public/pm/adler/06_landscapes/snow_mountains.png +0 -0
- package/workspace/public/pm/adler/07_wearables/astronaut_helmet.png +0 -0
- package/workspace/public/pm/adler/07_wearables/beanie_blue.png +0 -0
- package/workspace/public/pm/adler/07_wearables/beanie_red.png +0 -0
- package/workspace/public/pm/adler/07_wearables/hard_hat.png +0 -0
- package/workspace/public/pm/adler/07_wearables/headband.png +0 -0
- package/workspace/public/pm/adler/07_wearables/party_hat_blue.png +0 -0
- package/workspace/public/pm/adler/07_wearables/party_hat_multicolor.png +0 -0
- package/workspace/public/pm/adler/07_wearables/pencil.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_black_white.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_blue.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_blue_white.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_green_red.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_green_white.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_red_white.png +0 -0
- package/workspace/public/pm/adler/07_wearables/scarf_yellow.png +0 -0
- package/workspace/public/pm/adler/07_wearables/straw_hat.png +0 -0
- package/workspace/public/pm/adler/07_wearables/yellow_flowers.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/apple.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/cooking_pot.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/cupcake.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/diya.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/egg.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/heart_mug.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/ketupat.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/lotus.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/mandarins.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/mooncake.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/pie.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/pinwheel.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/popcorn.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/red_lantern.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/tangyuan.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/watering_can.png +0 -0
- package/workspace/public/pm/adler/08_food_festival/zongzi.png +0 -0
- package/workspace/public/pm/adler/09_celebration/bunting.png +0 -0
- package/workspace/public/pm/adler/09_celebration/clapperboard.png +0 -0
- package/workspace/public/pm/adler/09_celebration/fireworks.png +0 -0
- package/workspace/public/pm/adler/09_celebration/flower_garland.png +0 -0
- package/workspace/public/pm/adler/09_celebration/gift.png +0 -0
- package/workspace/public/pm/adler/09_celebration/lantern_pair.png +0 -0
- package/workspace/public/pm/adler/09_celebration/moon_cloud.png +0 -0
- package/workspace/public/pm/adler/09_celebration/pumpkin.png +0 -0
- package/workspace/public/pm/adler/09_celebration/soccer_ball.png +0 -0
- package/workspace/public/pm/adler/09_celebration/string_lights.png +0 -0
- package/workspace/public/pm/adler/09_celebration/umbrella.png +0 -0
- package/workspace/public/pm/adler/10_marks/attention_marks.png +0 -0
- package/workspace/public/pm/adler/10_marks/gold_heart.png +0 -0
- package/workspace/public/pm/adler/10_marks/gold_sparkles.png +0 -0
- package/workspace/public/pm/adler/10_marks/gold_star.png +0 -0
- package/workspace/public/pm/adler/10_marks/question_mark.png +0 -0
- package/workspace/public/pm/adler/10_marks/sleep_curls.png +0 -0
- package/workspace/public/pm/adler/manifest.json +2668 -0
- package/workspace/public/pm/cozy-adler.css +5 -5
- package/workspace/public/pm/cozy-adler.js +194 -414
- package/workspace/public/pm/cozy-settings.js +2 -2
- package/workspace/run-tests.js +47 -5
- package/workspace/server.js +5 -2
- package/workspace/test-lists/adler-png-art.json +10 -0
|
@@ -105,7 +105,7 @@ const dmy = (ms) => new Date(ms).toLocaleDateString('en-GB', { day: 'numeric', m
|
|
|
105
105
|
/** The Adler row's second line: what he wears now, or the next one, or why he does not dress. */
|
|
106
106
|
function dressLine() {
|
|
107
107
|
const P = dp();
|
|
108
|
-
if (P['adler.dress.on'] === false) return 'Off. He
|
|
108
|
+
if (P['adler.dress.on'] === false) return 'Off. He is plain every day.';
|
|
109
109
|
if (P['adler.amount'] !== 'full') return 'He dresses only when How much Adler is Full.';
|
|
110
110
|
const now = SE.charmToday(Date.now(), P), nx = now ? null : SE.nextCharm(Date.now(), P);
|
|
111
111
|
return now ? `Today: ${now.name}, until ${dmy(now.until)}.` : nx ? `Next: ${nx.name}, from ${dmy(nx.from)}.` : 'For festivals and seasons where you live.';
|
|
@@ -115,7 +115,7 @@ function dressSec() {
|
|
|
115
115
|
const P = dp(), place = SE.placeOf(P), on = P['adler.dress.on'] !== false, full = P['adler.amount'] === 'full';
|
|
116
116
|
const now = on && full ? SE.charmToday(Date.now(), P) : null, nx = on && full && !now ? SE.nextCharm(Date.now(), P) : null, c = now || nx;
|
|
117
117
|
const head = `<div class="ev-dr-hd"><button type="button" class="ev-ib" data-ev-dress="back" aria-label="Back to Adler" title="Back">${svg(BACK, 18)}</button><h4 class="ev-grow">Dress for the day</h4>${dsw('adler.dress.on', on, 'Dress for the day')}</div>`;
|
|
118
|
-
if (!on) return head + '<p class="ev-small ev-mut">Adler
|
|
118
|
+
if (!on) return head + '<p class="ev-small ev-mut">Adler is plain every day.</p>';
|
|
119
119
|
const banner = !full ? '<p class="ev-small ev-mut">How much Adler is not Full, so he does not dress up.</p>'
|
|
120
120
|
: c ? `<div class="ev-dr-now">${AD.adler('handled', 48, { charm: c.key, label: false })}<p><b>${esc(now ? 'Today: ' + now.name : 'Next: ' + nx.name)}</b><span class="ev-small ev-mut">${esc(now ? 'He wears it until ' + dmy(now.until) + '.' : 'He wears it from ' + dmy(nx.from) + '.')}</span></p></div>` : '';
|
|
121
121
|
const hol = SE.DAYS.filter((e) => e.group === 'holidays' && (e.where === '*' || e.where.includes(place.country)));
|
package/workspace/run-tests.js
CHANGED
|
@@ -355,10 +355,22 @@ function traceChanges(changes, ctx) {
|
|
|
355
355
|
if (b) { const w = routes(b.keys, `server.js:${n}`); if (w) return w; continue; }
|
|
356
356
|
const own = fnAt(n);
|
|
357
357
|
if (own && own.name !== 'handleRequest') { const w = useOf(own.name); if (w) return `${own.name} (server.js:${n}) is used by ${w}`; continue; }
|
|
358
|
+
const mod = wiringOf(n);
|
|
359
|
+
if (mod) { nameHits(mod).forEach((x) => picked.add(x)); if (inList.has('test.js')) picked.add('test.js'); continue; } // start-up wiring of one lib module: the suites that name it, and the server boot suite
|
|
358
360
|
return `server.js:${n}, outside every route and function`;
|
|
359
361
|
}
|
|
360
362
|
return null;
|
|
361
363
|
};
|
|
364
|
+
// A line inside a top-level statement that builds one lib module (`const x = require('./lib/m.js').create({ ... })`): the module's file.
|
|
365
|
+
const wiringOf = (n) => {
|
|
366
|
+
const { C } = parseServer();
|
|
367
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
368
|
+
if (!C[i].trim() || /^\s/.test(C[i])) continue; // inside the statement: keep going up to its first line
|
|
369
|
+
const m = /^(?:const|let)\s+\w+\s*=\s*require\(\s*'\.\/(lib\/[\w.-]+)'\s*\)\.\w+\(\{\s*$/.exec(C[i]);
|
|
370
|
+
return m ? m[1] : null;
|
|
371
|
+
}
|
|
372
|
+
return null;
|
|
373
|
+
};
|
|
362
374
|
const useOf = (name) => { // the routes that use the top-level `name` of server.js
|
|
363
375
|
if (used.has(name)) return null;
|
|
364
376
|
used.add(name);
|
|
@@ -385,7 +397,9 @@ function traceChanges(changes, ctx) {
|
|
|
385
397
|
return w;
|
|
386
398
|
};
|
|
387
399
|
const users1 = (f) => {
|
|
388
|
-
|
|
400
|
+
// a path or a file name: './x', '/x.js' or 'x.js'. A bare quoted word ('grill') is a string, not a use of lib/grill.js.
|
|
401
|
+
const re = new RegExp(`[/'"\`]${reEsc(stemOf(f))}\\.m?js['"\`]|/${reEsc(stemOf(f))}['"\`]`);
|
|
402
|
+
const pathRe = new RegExp(`/${reEsc(stemOf(f))}(?:\\.m?js)?['"\`]`);
|
|
389
403
|
let n = 0;
|
|
390
404
|
for (const g of code) {
|
|
391
405
|
if (g === f) continue;
|
|
@@ -396,14 +410,21 @@ function traceChanges(changes, ctx) {
|
|
|
396
410
|
if (WIDE.has(g)) return `${f} is used by ${g}`;
|
|
397
411
|
if (g.startsWith('public/')) { viaPublic(g); continue; }
|
|
398
412
|
if (g === 'server.js') {
|
|
399
|
-
const names = []; const inline = [];
|
|
413
|
+
const names = []; const inline = []; const factories = [];
|
|
400
414
|
t.split('\n').forEach((line, i) => {
|
|
401
|
-
if (!re.test(line)) return;
|
|
415
|
+
if (!re.test(line) || !pathRe.test(line)) return; // a bare quoted word ('grill') is not a path
|
|
402
416
|
if (/'\/lib\//.test(line)) return; // served to the browser: the public graph has it
|
|
403
417
|
const m = /^(?:const|let|var)\s+(?:\{([^}]*)\}|(\w+))\s*=\s*require\(/.exec(line);
|
|
404
|
-
if (m
|
|
418
|
+
if (m && /require\([^)]*\)\.create\(/.test(line)) factories.push(m[2]); // a service built at start-up: only a route that calls it can reach a page
|
|
419
|
+
else if (m) names.push(...(m[1] ? m[1].split(',').map((x) => x.split(':').pop().trim()).filter(Boolean) : [m[2]]));
|
|
405
420
|
else inline.push(i + 1); // a require inside a function or a route: that line
|
|
406
421
|
});
|
|
422
|
+
for (const name of factories.filter(Boolean)) { // only the uses inside a route block; a timer or a start-up call is the boot suite's
|
|
423
|
+
if (used.has(name)) continue; used.add(name);
|
|
424
|
+
const { C, blockAt } = parseServer(); const re = new RegExp(`\\b${reEsc(name)}\\b`);
|
|
425
|
+
for (let i = 0; i < C.length; i++) { const b = re.test(C[i]) ? blockAt(i + 1) : null; if (b) { const w = routes(b.keys, `server.js:${i + 1}`); if (w) return w; } }
|
|
426
|
+
if (inList.has('test.js')) picked.add('test.js');
|
|
427
|
+
}
|
|
407
428
|
for (const name of names) { const w = useOf(name); if (w) return w; }
|
|
408
429
|
const w = serverLines(inline); if (w) return w;
|
|
409
430
|
continue;
|
|
@@ -472,9 +493,30 @@ function changedSuites(list, ref, { exact = false } = {}) {
|
|
|
472
493
|
});
|
|
473
494
|
const read = (f) => { try { return fs.readFileSync(path.join(DIR, f), 'utf8'); } catch { return null; } };
|
|
474
495
|
const browser = new Set([...FILES.panels, ...FILES.ui]);
|
|
496
|
+
const deps = changedDeps(git('diff', '-U0', base, '--', path.join(DIR, 'package.json')), changes.some((c) => c.file === 'package.json'));
|
|
497
|
+
if (deps) { // a dependency was added or bumped: only the files that require it, and the install check, can be reached by it
|
|
498
|
+
for (let i = changes.length - 1; i >= 0; i--) if (changes[i].file === 'package.json' || changes[i].file === 'package-lock.json') changes.splice(i, 1);
|
|
499
|
+
const hit = (f) => /\.m?js$/.test(f) && deps.some((d) => new RegExp(`require\\(\\s*['"]${reEsc(d)}(?:/[^'"]*)?['"]\\s*\\)|from\\s+['"]${reEsc(d)}['"]`).test(read(f) || ''));
|
|
500
|
+
for (const f of all) if (hit(f) && !changes.some((c) => c.file === f)) changes.push({ file: f });
|
|
501
|
+
changes.push({ file: 'offline-tarball.test.js' });
|
|
502
|
+
}
|
|
475
503
|
return { files, ...traceChanges(changes, { list, read, files: [...new Set([...all, ...files])], browser }) };
|
|
476
504
|
}
|
|
477
505
|
|
|
506
|
+
/* The dependency names a package.json diff adds or bumps, when that is ALL it changes (a script, the engines or any other line returns null:
|
|
507
|
+
* then package.json stays wide). `changed` is false when package.json is not in the diff. package-lock.json then follows it. */
|
|
508
|
+
function changedDeps(diff, changed) {
|
|
509
|
+
if (!changed || diff == null) return null;
|
|
510
|
+
const names = [];
|
|
511
|
+
for (const line of diff.split('\n')) {
|
|
512
|
+
if (!/^[+-]/.test(line) || /^(\+\+\+|---)/.test(line)) continue;
|
|
513
|
+
const m = /^[+-]\s*"(@?[\w./-]+)"\s*:\s*"[^"]*",?\s*$/.exec(line);
|
|
514
|
+
if (!m || /^(name|version|description|license|main|bin|start|test|engines|node)$/.test(m[1]) || /^(test|start|doctor)/.test(m[1])) return null;
|
|
515
|
+
names.push(m[1]);
|
|
516
|
+
}
|
|
517
|
+
return names.length ? [...new Set(names)] : null;
|
|
518
|
+
}
|
|
519
|
+
|
|
478
520
|
/* The new-side line numbers a `git diff -U0` touches. A pure removal counts the lines on both sides of where it was. */
|
|
479
521
|
function diffLines(diff) {
|
|
480
522
|
const out = [];
|
|
@@ -637,4 +679,4 @@ async function main() {
|
|
|
637
679
|
}
|
|
638
680
|
|
|
639
681
|
if (require.main === module) main().catch((e) => { console.error(e); process.exitCode = 1; });
|
|
640
|
-
else module.exports = { traceChanges, diffLines, strip, WIDE };
|
|
682
|
+
else module.exports = { traceChanges, diffLines, strip, changedDeps, WIDE };
|
package/workspace/server.js
CHANGED
|
@@ -2953,6 +2953,7 @@ const grillRuns = require('./lib/grill-runs.js').create({
|
|
|
2953
2953
|
open: deepOpenNow,
|
|
2954
2954
|
headlessOff: () => headlessLib.switchedOff(process.env),
|
|
2955
2955
|
env: process.env,
|
|
2956
|
+
api: require('./lib/grill-api.js'),
|
|
2956
2957
|
promptFor: (skillId) => { const h = homeWorkspace(); const t = taskById(skillId, h ? h.root : SELF_ROOT); return t && t.prompt ? t.prompt : null; },
|
|
2957
2958
|
spawn: (spec) => orchSpawn.spawn({ name: spec.name, agent: 'claude', ws: spec.ws, origin: spec.origin, initialInput: spec.initialInput, initiative: spec.initiative, extraEnv: spec.env, autoDelete: undefined, onDone: spec.onDone }),
|
|
2958
2959
|
stop: (s) => { if (s && s.child) stopHeadless(s); },
|
|
@@ -6629,7 +6630,7 @@ function fsList(dir) {
|
|
|
6629
6630
|
// ── HTTP: static assets + the file/gate APIs. Headers never logged (D08). ─────────────
|
|
6630
6631
|
const TYPES = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8',
|
|
6631
6632
|
'.css': 'text/css; charset=utf-8', '.json': 'application/json', '.map': 'application/json',
|
|
6632
|
-
'.svg': 'image/svg+xml', '.woff2': 'font/woff2' };
|
|
6633
|
+
'.svg': 'image/svg+xml', '.png': 'image/png', '.woff2': 'font/woff2' };
|
|
6633
6634
|
// Compression and validators (workspace-event-loop-lag). The app shell is 5.7 MB of script and style and a library answer
|
|
6634
6635
|
// is about 1 MB of JSON, and none of it was compressed, so a phone or an Online-address visit paid for every byte on every
|
|
6635
6636
|
// load. A response is gzipped only when the client asks for it and the body is text over the threshold. Gzip runs on the
|
|
@@ -6978,7 +6979,9 @@ async function handleRequest(req, res) {
|
|
|
6978
6979
|
if (p.startsWith('/pm/')) {
|
|
6979
6980
|
const rel = p.slice('/pm/'.length);
|
|
6980
6981
|
const file = path.resolve(PM_DIR, rel);
|
|
6981
|
-
|
|
6982
|
+
// The one other kind of file: Adler's pictures, in pm/adler/<category>/ (page-build.js counts them in the build, so they are kept like a module).
|
|
6983
|
+
const art = path.extname(file) === '.png' && file.startsWith(path.join(PM_DIR, 'adler') + path.sep);
|
|
6984
|
+
if (!file.startsWith(PM_DIR + path.sep) || !(art || ['.js', '.css', '.json'].includes(path.extname(file)))) {
|
|
6982
6985
|
res.writeHead(404); return res.end('not found');
|
|
6983
6986
|
}
|
|
6984
6987
|
// Under the current build prefix, a file whose bytes are the ones the prefix names is kept for good (lib/page-build.js).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "The blue Adler's PNG set (pm/adler/, manifest.json) behind pm/cozy-adler.js: the art table matches the manifest and its hashes, every drawing resolves to a file in the set, and each mood, prop and sprout stage has its own PNG. Pure; no browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"adler-png-art.test.js"
|
|
5
|
+
],
|
|
6
|
+
"panels": [],
|
|
7
|
+
"seconds": {
|
|
8
|
+
"adler-png-art.test.js": 2
|
|
9
|
+
}
|
|
10
|
+
}
|