@bongos/core 1.24.27 → 1.24.29

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.
Files changed (41) hide show
  1. package/.bongos-core.json +53 -58
  2. package/.claude/skills/builder-claim/SKILL.md +1 -1
  3. package/.claude/skills/builder-ship/SKILL.md +1 -1
  4. package/docs/copy-inventory.md +173 -203
  5. package/docs/copy-registry.json +350 -622
  6. package/docs/module-api-changelog.md +4 -0
  7. package/docs/page-inventory.json +8 -8
  8. package/docs/page-readings.json +346 -331
  9. package/modules/builder-settings/interaction-prefs.js +2 -2
  10. package/modules/hall-ui/public/my-agents.css +72 -1
  11. package/modules/hall-ui/public/my-agents.html +30 -6
  12. package/modules/hall-ui/public/my-agents.js +98 -56
  13. package/modules/hall-ui/public/my-agents.states.json +18 -0
  14. package/modules/hall-ui/public/palette.js +8 -0
  15. package/modules/hall-ui/public/settings-moved.js +41 -0
  16. package/modules/hall-ui/public/settings.css +4 -158
  17. package/modules/hall-ui/public/settings.html +19 -147
  18. package/modules/hall-ui/public/settings.js +20 -215
  19. package/modules/hall-ui/public/settings.states.json +2 -4
  20. package/modules/hall-ui/public/speciality-tools.css +140 -0
  21. package/modules/hall-ui/public/{settings-specialities.js → speciality-tools.js} +83 -6
  22. package/modules/hall-ui/records/my-agents.md +5 -2
  23. package/modules/hall-ui/records/panel-family.md +4 -0
  24. package/modules/lifecycle/ship-card.js +2 -2
  25. package/package-lock.json +2 -2
  26. package/package.json +1 -1
  27. package/release-notes.json +12 -0
  28. package/scripts/hall-preview/server.js +4 -0
  29. package/src/module-api.js +1 -1
  30. package/tests/government_tidy_up.mjs +21 -24
  31. package/tests/hall_loading.mjs +3 -1
  32. package/tests/hall_my_agents.mjs +190 -2
  33. package/tests/hall_palette.mjs +12 -0
  34. package/tests/hall_settings_world.mjs +64 -100
  35. package/tests/helpers.mjs +162 -0
  36. package/tests/interaction_posture.mjs +3 -1
  37. package/tests/speciality_offer_ui.mjs +183 -149
  38. package/tests/speciality_walkthrough_ui.mjs +182 -161
  39. package/modules/hall-ui/public/settings-interaction.js +0 -132
  40. package/modules/hall-ui/public/settings-law-locks.js +0 -53
  41. package/modules/hall-ui/public/settings-render.js +0 -138
@@ -1,138 +0,0 @@
1
- // modules/hall-ui/public/settings-render.js — the "Rendering" panel on
2
- // /builders/settings: how rich the deterministic session cards should be
3
- // (task 1279's on/off toggle, a four-rung ladder since task 1002518).
4
- //
5
- // WHY ITS OWN FILE. It began as one row with one switch inside settings.js. As a
6
- // ladder it needs a labelled option per rung plus a line explaining what the
7
- // default resolved to and why — and settings.js sits against the 1500-line size
8
- // ratchet, so the panel moved out on the settings-sessions.js / settings-
9
- // interaction.js precedent. Extracting it took settings.js from 1493 to 1425.
10
- //
11
- // THE SHAPE WORTH KNOWING: unlike every other picker on this page, "default"
12
- // here is not a constant — it is DERIVED from the builder's interaction profile
13
- // (render-prefs.js maps technical level, machinery and reply length onto a
14
- // rung). So the default option cannot just say "default"; it has to say which
15
- // rung it landed on and which profile fields put it there, or the reader sees a
16
- // choice the system made for reasons it never stated. The server ships both
17
- // facts (`derived_level`, `derived_reason`) precisely so this panel can.
18
- //
19
- // PATCH body is { widgets: <level> | null } — null clears the override and
20
- // returns the builder to the derived rung. The route still accepts the legacy
21
- // boolean, which is what lets an older hall build keep working against a newer
22
- // core; this panel only ever sends levels or null.
23
-
24
- (() => {
25
- 'use strict';
26
-
27
- const API = '/api/bongos';
28
- const { escapeHtml, $ } = window.OTB;
29
- const toast = (msg) => window.OTB.toast(msg);
30
- const api = window.BongosClient.createClient({ baseUrl: '', credentials: 'same-origin', throwOnError: false });
31
-
32
- const toAuth = () => window.location.assign(`${API}/auth/web/start`);
33
-
34
- // The "let the profile decide" option carries the sentinel value '' rather
35
- // than a level, so the change handler can tell "clear my override" from
36
- // "pin me to the rung that happens to be the derived one today". They differ:
37
- // a pinned rung survives a later change to the interaction profile.
38
- const USE_DEFAULT = '';
39
-
40
- function labelForLevel(data, level) {
41
- const found = (Array.isArray(data && data.levels) ? data.levels : []).find((l) => l.value === level);
42
- return (found && found.label) || level;
43
- }
44
-
45
- function render(data) {
46
- const wrap = $('#render-rows');
47
- if (!wrap) return;
48
- const levels = Array.isArray(data && data.levels) ? data.levels : [];
49
- if (levels.length === 0) {
50
- wrap.innerHTML = window.OTBKit.emptyStateHtml('No rendering options registered.');
51
- return;
52
- }
53
- const override = data.override_level || null;
54
- const derived = data.derived_level;
55
-
56
- // The default row first, so the reader meets "you already have a sensible
57
- // answer, here is what it is" before the list of ways to overrule it.
58
- const defaultRow =
59
- `<label class="prow prow--pick" for="render-default">` +
60
- `<input class="pradio" type="radio" name="render-level" id="render-default"` +
61
- ` value="${USE_DEFAULT}"${override === null ? ' checked' : ''}>` +
62
- '<span class="prow__main">' +
63
- `<span class="prow__label">Match my interaction profile` +
64
- `<span class="prow__tag">default (${escapeHtml(labelForLevel(data, derived))})</span></span>` +
65
- `<span class="prow__desc">${escapeHtml(data.derived_reason || '')} Change that profile and this follows it.</span>` +
66
- '</span></label>';
67
-
68
- const rows = levels.map((l) => {
69
- const id = `render-level-${l.value}`;
70
- return (
71
- `<label class="prow prow--pick" for="${id}">` +
72
- `<input class="pradio" type="radio" name="render-level" id="${id}"` +
73
- ` value="${escapeHtml(l.value)}"${override === l.value ? ' checked' : ''}>` +
74
- '<span class="prow__main">' +
75
- `<span class="prow__label">${escapeHtml(l.label)}</span>` +
76
- `<span class="prow__desc">${escapeHtml(l.blurb)}</span>` +
77
- '</span></label>'
78
- );
79
- }).join('');
80
-
81
- wrap.innerHTML =
82
- '<fieldset class="pgroup" id="render-level-group">' +
83
- '<legend class="prow__label">Session card richness</legend>' +
84
- '<p class="prow__desc">How much the claim and ship cards show. Richer cards explain more and cost more tokens; the confirmation line is always there whichever you pick.</p>' +
85
- defaultRow + rows +
86
- '</fieldset>';
87
- }
88
-
89
- async function save(value, input) {
90
- const status = $('#render-status');
91
- if (status) status.textContent = 'Saving…';
92
- if (input) input.disabled = true;
93
- try {
94
- // The sentinel becomes an explicit null — the route's clear-the-override
95
- // signal. Anything else is a level and is stored as the override.
96
- const body = { widgets: value === USE_DEFAULT ? null : value };
97
- const res = await api.request('PATCH', `${API}/me/render`, { body });
98
- if (res.status === 401) { toAuth(); return; }
99
- if (!res.ok) throw new Error(`render PATCH → ${res.status}`);
100
- render(res.data);
101
- const msg = value === USE_DEFAULT
102
- ? `Saved — following your interaction profile (${labelForLevel(res.data, res.data.derived_level)}).`
103
- : `Saved — ${labelForLevel(res.data, value)}.`;
104
- if (status) status.textContent = msg;
105
- toast(msg);
106
- } catch (err) {
107
- console.error('[settings] save render failed', err);
108
- if (status) status.textContent = 'Could not save. Try again.';
109
- toast('Could not save your rendering preference. Try again.');
110
- if (input) input.disabled = false;
111
- }
112
- }
113
-
114
- async function setup() {
115
- try {
116
- const res = await api.request('GET', `${API}/me/render`);
117
- if (res.status === 401) { toAuth(); return; }
118
- if (!res.ok) throw new Error(`render GET → ${res.status}`);
119
- render(res.data);
120
- $('#render-scroll').hidden = false;
121
- // Delegate the change so post-render radios stay wired.
122
- $('#render-rows').addEventListener('change', (e) => {
123
- const r = e.target.closest('.pradio');
124
- if (!r || r.disabled || !r.checked) return;
125
- save(r.value, r);
126
- });
127
- } catch (err) {
128
- // Its own try/catch, like every other section: a failing endpoint shows
129
- // this panel's own error rather than taking the settings page down.
130
- console.error('[settings] failed to load render', err);
131
- $('#render-scroll').hidden = false;
132
- $('#render-rows').innerHTML =
133
- '<p class="voices-empty">Your rendering preference could not be loaded. Reload the page to try again.</p>';
134
- }
135
- }
136
-
137
- setup();
138
- })();