@bongos/core 1.24.45 → 1.24.46
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/.bongos-core.json +140 -105
- package/clients/bongos-client/README.md +1 -1
- package/clients/bongos-client/bongos-client.global.js +4 -0
- package/clients/bongos-client/index.cjs +4 -0
- package/clients/bongos-client/index.d.ts +8 -0
- package/clients/bongos-client/index.mjs +4 -0
- package/docs/adr/0307-autobongos-a-deterministic-supervisor-and-agentic-workers.md +15 -0
- package/docs/api/openapi.json +152 -3
- package/docs/api-reference.md +4 -2
- package/docs/copy-inventory.md +1102 -1102
- package/docs/copy-registry.json +1538 -1538
- package/docs/module-api-changelog.md +2 -0
- package/docs/onboarding/diagrams/assertions.json +2 -2
- package/docs/page-inventory.json +11 -0
- package/docs/page-readings.json +724 -724
- package/migrations/core_295_runner_logins.sql +50 -0
- package/modules/government/session-scopes.json +5 -0
- package/modules/hall-ui/public/ai-studio.states.json +2 -0
- package/modules/hall-ui/public/atlas.states.json +2 -0
- package/modules/hall-ui/public/board-room.states.json +2 -0
- package/modules/hall-ui/public/city.states.json +2 -0
- package/modules/hall-ui/public/collab.states.json +2 -0
- package/modules/hall-ui/public/commands.states.json +2 -0
- package/modules/hall-ui/public/copy-desk.states.json +2 -0
- package/modules/hall-ui/public/deploy.states.json +2 -0
- package/modules/hall-ui/public/goal-map.states.json +2 -0
- package/modules/hall-ui/public/goals.css +1 -0
- package/modules/hall-ui/public/goals.states.json +2 -0
- package/modules/hall-ui/public/government.states.json +2 -0
- package/modules/hall-ui/public/idea.states.json +2 -0
- package/modules/hall-ui/public/ideas.states.json +2 -0
- package/modules/hall-ui/public/index-founding.states.json +2 -0
- package/modules/hall-ui/public/index-genesis-decide.states.json +2 -0
- package/modules/hall-ui/public/index-genesis-demo.states.json +2 -0
- package/modules/hall-ui/public/index-genesis.states.json +2 -0
- package/modules/hall-ui/public/index.states.json +5 -0
- package/modules/hall-ui/public/market-watch-item.states.json +2 -0
- package/modules/hall-ui/public/market-watch-rules.states.json +2 -0
- package/modules/hall-ui/public/market-watch.states.json +2 -0
- package/modules/hall-ui/public/modules.states.json +2 -0
- package/modules/hall-ui/public/money.states.json +2 -0
- package/modules/hall-ui/public/my-agents.states.json +2 -0
- package/modules/hall-ui/public/notes-panel.css +1 -1
- package/modules/hall-ui/public/primer.states.json +2 -0
- package/modules/hall-ui/public/profile.states.json +2 -0
- package/modules/hall-ui/public/roster.states.json +2 -0
- package/modules/hall-ui/public/settings.states.json +2 -0
- package/modules/hall-ui/public/street-card.states.json +2 -0
- package/modules/hall-ui/public/street.states.json +2 -0
- package/modules/hall-ui/public/studio.states.json +2 -0
- package/modules/hall-ui/public/style.css +27 -24
- package/modules/hall-ui/public/task.states.json +2 -0
- package/modules/hall-ui/public/thinking.states.json +2 -0
- package/modules/hall-ui/public/tweak-editor.states.json +2 -0
- package/modules/hall-ui/public/watch.states.json +2 -0
- package/modules/hall-ui/public/welcome-boot.js +6 -2
- package/modules/hall-ui/public/work-founding.states.json +2 -0
- package/modules/hall-ui/public/work.states.json +3 -1
- package/modules/lifecycle/db-claims.js +6 -3
- package/modules/lifecycle/routes/claims.js +10 -0
- package/modules/lifecycle/routes/tasks.js +1 -1
- package/modules/lifecycle/runner-self-guard.js +19 -10
- package/modules/platform-identity/platform-identity.js +1 -1
- package/modules/platform-identity/tests/platform-identity.mjs +13 -2
- package/modules/provisioning/core-upgrade-authz.js +8 -0
- package/modules/public-landing/public/account.html +1 -0
- package/modules/public-landing/public/community.html +1 -0
- package/modules/public-landing/public/connections.html +1 -0
- package/modules/public-landing/public/contact.html +1 -0
- package/modules/public-landing/public/guild.html +1 -0
- package/modules/public-landing/public/index.html +1 -0
- package/modules/public-landing/public/invitations.html +1 -0
- package/modules/public-landing/public/privacy.html +1 -0
- package/modules/public-landing/public/projects.html +1 -0
- package/modules/public-landing/public/terms.html +1 -0
- package/modules/raise/views/gate.html +1 -0
- package/modules/raise/views/nda.html +1 -0
- package/modules/raise/views/page.html +1 -0
- package/modules/status-ui/public/index.html +1 -0
- package/modules/ui-design/kit/README.md +1 -1
- package/modules/ui-design/kit/fixtures/versions.json +1 -0
- package/modules/ui-design/kit/lib.js +48 -3
- package/modules/ui-design/kit/probe.js +1 -0
- package/modules/ui-design/kit/render.js +2 -0
- package/modules/ui-design/kit/serve.js +1 -0
- package/modules/ui-design/module.json +1 -1
- package/modules/ui-design/public/tokens.css +125 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +14 -0
- package/scripts/bongos/fitness.js +1 -1
- package/scripts/bongos/run-unit-tests.js +3 -0
- package/src/bongos/auth.js +25 -4
- package/src/bongos/route-rank-check.js +5 -0
- package/src/bongos/routes/auth.js +48 -0
- package/src/bongos/runner-login.js +151 -0
- package/src/bongos/serve-internal.js +6 -1
- package/src/module-api.js +1 -1
- package/tests/autobongos_runner_login.mjs +296 -0
- package/tests/autobongos_runner_login_db.mjs +105 -0
- package/tests/design_tokens_shared.mjs +183 -0
- package/tests/government_session_scope.mjs +2 -1
- package/tests/hall_reading_world.mjs +5 -1
- package/tests/hall_tokens.mjs +22 -3
- package/tests/ui_design_kit.mjs +30 -0
- package/tests/welcome_boot_browser.mjs +4 -0
package/tests/hall_tokens.mjs
CHANGED
|
@@ -82,6 +82,21 @@ const contractTier = declarations(bodyAt(src.indexOf('{', bareRoots[0].index)));
|
|
|
82
82
|
const darkExplicit = declarations(blockAfter('html[data-theme="dark"] {'));
|
|
83
83
|
const darkMedia = declarations(blockAfter('html:not([data-theme]) {'));
|
|
84
84
|
|
|
85
|
+
// THE SHARED TOKEN SHEET (task 1005081). style.css @imports
|
|
86
|
+
// modules/ui-design/public/tokens.css first, so its scales (--ds-*) sit UNDER the
|
|
87
|
+
// hall's own declarations, and the hall's scale names (--radius, --sp-*, --z-*,
|
|
88
|
+
// --shadow-pop, --line, --label-size) are aliases onto it. Its :root and its dark
|
|
89
|
+
// switch rule are read here so the resolver sees what the browser sees.
|
|
90
|
+
const SHARED_SRC = fs.readFileSync(path.join(ROOT, 'modules', 'ui-design', 'public', 'tokens.css'), 'utf8');
|
|
91
|
+
const sharedBlock = (marker) => {
|
|
92
|
+
const at = SHARED_SRC.indexOf(marker);
|
|
93
|
+
assert.notEqual(at, -1, `tokens.css no longer contains ${marker} — update this test`);
|
|
94
|
+
const open = SHARED_SRC.indexOf('{', at);
|
|
95
|
+
return declarations(SHARED_SRC.slice(open + 1, SHARED_SRC.indexOf('}', open)));
|
|
96
|
+
};
|
|
97
|
+
const sharedRoot = sharedBlock(':root {');
|
|
98
|
+
const sharedDark = sharedBlock('html[data-theme="dark"]');
|
|
99
|
+
|
|
85
100
|
// THE CASCADE THAT ACTUALLY SHIPS. injectBrandingInto splices the pack's theme
|
|
86
101
|
// <style> at the END of <head> — after style.css's <link> — as a plain :root.
|
|
87
102
|
// Equal specificity, later in document order, so for the tokens the pack emits
|
|
@@ -112,8 +127,8 @@ const NIGHT_TINT = process.env.UI_DESIGN_TINT === '1'
|
|
|
112
127
|
: {};
|
|
113
128
|
|
|
114
129
|
const RAW = {
|
|
115
|
-
light: { ...contractTier, ...PACK },
|
|
116
|
-
dark: { ...contractTier, ...PACK, ...darkExplicit, ...NIGHT_TINT },
|
|
130
|
+
light: { ...sharedRoot, ...contractTier, ...PACK },
|
|
131
|
+
dark: { ...sharedRoot, ...contractTier, ...PACK, ...sharedDark, ...darkExplicit, ...NIGHT_TINT },
|
|
117
132
|
};
|
|
118
133
|
|
|
119
134
|
// ── color resolution ─────────────────────────────────────────────────────────
|
|
@@ -319,7 +334,10 @@ test('--line is a width, not a colour', () => {
|
|
|
319
334
|
// DESIGN.md warns about this exact name: --line is a 1px WIDTH here and a
|
|
320
335
|
// hairline COLOUR in the hub's sheet. Page sheets that treated it as a colour
|
|
321
336
|
// were repointed at --rule / --rule-soft in task 1003303.
|
|
322
|
-
|
|
337
|
+
// an alias onto the shared sheet since task 1005081 — follow it one step
|
|
338
|
+
const alias = /^var\((--[\w-]+)\)$/.exec(contractTier['--line']);
|
|
339
|
+
const line = alias ? sharedRoot[alias[1]] : contractTier['--line'];
|
|
340
|
+
assert.match(String(line), /^\d+px$/, '--line must resolve to a length');
|
|
323
341
|
const sheets = fs.readdirSync(HALL).filter((f) => f.endsWith('.css'));
|
|
324
342
|
const misuse = sheets.filter((f) => /var\(--line\s*,/.test(fs.readFileSync(path.join(HALL, f), 'utf8')));
|
|
325
343
|
assert.deepEqual(misuse, [], 'a colour fallback on --line means the sheet thinks it is a colour');
|
|
@@ -346,6 +364,7 @@ test('every token a hall stylesheet references is defined', () => {
|
|
|
346
364
|
const sheets = fs.readdirSync(HALL).filter((f) => f.endsWith('.css'));
|
|
347
365
|
const defined = new Set([
|
|
348
366
|
...Object.keys(contractTier), ...Object.keys(darkExplicit), ...Object.keys(PACK),
|
|
367
|
+
...Object.keys(sharedRoot), // the shared token sheet the hall @imports (task 1005081)
|
|
349
368
|
]);
|
|
350
369
|
// A sheet may define its own private tokens (atlas.css's --ab-* family), and
|
|
351
370
|
// a page script may set one inline on the element (roadmap.js writes
|
package/tests/ui_design_kit.mjs
CHANGED
|
@@ -125,6 +125,36 @@ test('the page argument survives Git Bash path conversion of a bare slash', () =
|
|
|
125
125
|
assert.equal(lib.pageName('/'), 'index'); assert.equal(lib.pageName('/builders/ranks'), 'ranks'); assert.equal(lib.pageName('/projects?view=mine'), 'projects');
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
test('a page at the surface root reads index.states.json (task 1005080)', () => {
|
|
129
|
+
const hall = path.join(ROOT, 'modules', 'hall-ui', 'public');
|
|
130
|
+
assert.equal(lib.sidecarPath(hall, '/builders/', 'states'), path.join(hall, 'index.states.json'), 'the hall Home has no last segment of its own');
|
|
131
|
+
assert.equal(lib.sidecarPath(hall, '/builders/work', 'states'), path.join(hall, 'work.states.json'), 'a named page keeps its own file');
|
|
132
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'kit-root-'));
|
|
133
|
+
assert.equal(lib.sidecarPath(tmp, '/builders/', 'states'), path.join(tmp, 'builders.states.json'), 'no index file: the old name stands, so the miss is reported by name');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('storage: a states or probes file may seed browser storage, and a bad shape is refused (task 1005080)', () => {
|
|
137
|
+
const ok = { page: '/x', storage: { session: { a: '1' }, local: { b: 'x' } }, states: { s: { storage: { session: { c: '2' } } } } };
|
|
138
|
+
assert.deepEqual(lib.validateStatesFile(ok).errors, []);
|
|
139
|
+
assert.ok(lib.validateStatesFile({ page: '/x', storage: { cookie: {} }, states: { s: {} } }).errors.some((e) => /storage\.cookie/.test(e)), 'only session and local');
|
|
140
|
+
assert.ok(lib.validateStatesFile({ page: '/x', storage: { session: { a: 1 } }, states: { s: {} } }).errors.some((e) => /storage\.session/.test(e)), 'values are strings');
|
|
141
|
+
assert.ok(lib.validateStatesFile({ page: '/x', states: { s: { storage: [] } } }).errors.some((e) => /states\.s\.storage/.test(e)), 'a state may carry its own');
|
|
142
|
+
assert.ok(lib.validateProbesFile({ page: '/x', storage: 'yes', probes: [{ name: 'p', expect: { visible: ['a'] } }] }).errors.some((e) => /^storage/.test(e)), 'a probes file too');
|
|
143
|
+
assert.deepEqual(lib.mergeStorage({ session: { a: '1', b: '1' } }, undefined, { session: { b: '2' }, local: { c: '3' } }), { session: { a: '1', b: '2' }, local: { c: '3' } }, 'a state layers over the file');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test('every hall sidecar renders the page a returning builder sees, not the first-visit mode picker (task 1005080)', () => {
|
|
147
|
+
const hall = path.join(ROOT, 'modules', 'hall-ui', 'public');
|
|
148
|
+
const files = fs.readdirSync(hall).filter((n) => /\.(states|probes)\.json$/.test(n));
|
|
149
|
+
assert.ok(files.length > 30);
|
|
150
|
+
for (const n of files) {
|
|
151
|
+
const json = JSON.parse(fs.readFileSync(path.join(hall, n), 'utf8'));
|
|
152
|
+
assert.equal(json.storage && json.storage.session && json.storage.session['hall-craft-asked'], '1', `${n}: seeds the picker as already asked`);
|
|
153
|
+
}
|
|
154
|
+
// the key is craft-mode.js's own; a rename there must break this pin, not silently bring the picker back
|
|
155
|
+
assert.match(fs.readFileSync(path.join(hall, 'craft-mode.js'), 'utf8'), /var ASKED_KEY = 'hall-craft-asked';/);
|
|
156
|
+
});
|
|
157
|
+
|
|
128
158
|
// ── the mock checker: platform rules vs the instance's taste ──────────────────
|
|
129
159
|
const GOOD_MOCK = `<!doctype html><html><head><style>
|
|
130
160
|
body{--pad:8px;color:var(--ink);background:var(--bg)}
|
|
@@ -89,6 +89,8 @@ test('first visit of the day: the welcome, not the craft picker; Skip brings the
|
|
|
89
89
|
await signIn(page);
|
|
90
90
|
assert.deepEqual(await state(page), { welcome: true, picker: false, craft: null, asked: '1' },
|
|
91
91
|
'the welcome shows, the picker is marked asked and does not stack on it');
|
|
92
|
+
assert.equal(await page.evaluate(() => document.querySelector('.wb__banner').tagName), 'DIV',
|
|
93
|
+
'over a signed-in hall the shell keeps the one <header>; the banner is a plain block (task 1005080)');
|
|
92
94
|
// The painting loads and its motion is laid over it.
|
|
93
95
|
await page.waitForFunction(() => { const i = document.querySelector('#welcome-boot .wb__img'); return i && i.complete && i.naturalWidth === 1024; });
|
|
94
96
|
assert.equal(await page.isVisible('[data-wb-skip]'), true);
|
|
@@ -135,9 +137,11 @@ test('a visitor who is not signed in gets the Welcome on Home with a sign-in but
|
|
|
135
137
|
roles: !!document.querySelector('[data-wb-roles]'),
|
|
136
138
|
keys: Object.keys(localStorage).filter((k) => k.startsWith('hall-welcome-day') || k === 'hall-welcome-signin'),
|
|
137
139
|
picker: !!document.getElementById('craft-picker'),
|
|
140
|
+
banner: document.querySelector('.wb__banner').tagName,
|
|
138
141
|
}));
|
|
139
142
|
assert.match(s.hi, /^Welcome to /);
|
|
140
143
|
assert.deepEqual([s.signin, s.roles, s.keys, s.picker], [true, false, [], false]);
|
|
144
|
+
assert.equal(s.banner, 'HEADER', 'for a visitor the welcome is the page, so its banner is the one <header> (task 1005080)');
|
|
141
145
|
await ctx.close();
|
|
142
146
|
});
|
|
143
147
|
|