samagotchi 0.136.1 → 0.137.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -1
- data/docs/architecture.md +2 -2
- data/docs/cli.md +12 -4
- data/docs/guardrails.md +12 -5
- data/docs/internals/engine.md +4 -4
- data/docs/internals/web-frontend.md +19 -9
- data/docs/sessions.md +1 -1
- data/docs/testing.md +2 -1
- data/lib/samagotchi/bridge.rb +4 -0
- data/lib/samagotchi/bundles/system/manifest.yml +1 -1
- data/lib/samagotchi/desktop/macos.rb +3 -2
- data/lib/samagotchi/engine.rb +6 -1
- data/lib/samagotchi/guardrail_wiring.rb +3 -1
- data/lib/samagotchi/guardrails/chi_dirs.rb +2 -2
- data/lib/samagotchi/guardrails/outside.rb +5 -5
- data/lib/samagotchi/guardrails/pair_boundary.rb +11 -4
- data/lib/samagotchi/guardrails/pair_command.rb +3 -19
- data/lib/samagotchi/guardrails/protected_paths.rb +5 -2
- data/lib/samagotchi/guardrails/review_paths.rb +32 -2
- data/lib/samagotchi/guardrails/shell_paths.rb +0 -4
- data/lib/samagotchi/guardrails/verdict.rb +1 -1
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/message_display.rb +6 -3
- data/lib/samagotchi/web/participant_review.rb +2 -1
- data/lib/samagotchi/web/public/answer_fold.js +24 -6
- data/lib/samagotchi/web/public/app.js +7 -1
- data/lib/samagotchi/web/public/chip_popover.js +20 -42
- data/lib/samagotchi/web/public/context_chips.js +16 -6
- data/lib/samagotchi/web/public/copy.js +8 -5
- data/lib/samagotchi/web/public/families_view.js +15 -6
- data/lib/samagotchi/web/public/index.html +55 -35
- data/lib/samagotchi/web/public/info_bar.js +1 -1
- data/lib/samagotchi/web/public/lists_view.js +1 -0
- data/lib/samagotchi/web/public/participants_panel.js +1 -1
- data/lib/samagotchi/web/public/popover_modal.js +57 -0
- data/lib/samagotchi/web/public/revise_stack.js +76 -6
- data/lib/samagotchi/web/public/revise_switch.js +55 -0
- data/lib/samagotchi/web/public/scope.js +3 -3
- data/lib/samagotchi/web/public/send_turn.js +4 -2
- data/lib/samagotchi/web/public/settings_chip.js +2 -2
- data/lib/samagotchi/web/public/stale_params.js +26 -0
- data/lib/samagotchi/web/public/start_settings.js +1 -1
- data/lib/samagotchi/web/public/start_toolkit.js +1 -1
- data/lib/samagotchi/web/public/stream_handlers.js +10 -5
- data/lib/samagotchi/web/public/working_set_rail.js +2 -0
- data/lib/samagotchi/web/public/working_set_view.js +2 -2
- metadata +4 -1
|
@@ -50,13 +50,13 @@ export function scopeTemplate(scope, { error = null, where = () => ({ hash: "" }
|
|
|
50
50
|
const at = where();
|
|
51
51
|
const allHref = () => allScopeHref(where().hash, scope.dir);
|
|
52
52
|
const all = html`<a class="scope-all" href=${allScopeHref(at.hash, scope.dir)} title=${"Sessions of every project"} @click=${(e) => { e.currentTarget.href = allHref(); }}>all</a>`;
|
|
53
|
-
if (error) return html`<button id="scopePick" class="scope-name error" type="button" aria-haspopup="dialog" title=${error}>folder not found</button>${all}`;
|
|
54
|
-
if (scope.projectName) return html`<button id="scopePick" class="scope-name" type="button" aria-haspopup="dialog" title=${`Sessions of ${scope.projectDir}`}>${scope.projectName}</button>${all}`;
|
|
53
|
+
if (error) return html`<button id="scopePick" class="scope-name error" type="button" aria-haspopup="dialog" aria-expanded="false" title=${error}>folder not found</button>${all}`;
|
|
54
|
+
if (scope.projectName) return html`<button id="scopePick" class="scope-name" type="button" aria-haspopup="dialog" aria-expanded="false" title=${`Sessions of ${scope.projectDir}`}>${scope.projectName}</button>${all}`;
|
|
55
55
|
const dir = scope.dir || scope.serverDir;
|
|
56
56
|
const backHref = () => projectScopeHref(scope.backDir, where().hash);
|
|
57
57
|
const back = scope.backName
|
|
58
58
|
? html`<a class="scope-all scope-back" href=${projectScopeHref(scope.backDir, at.hash)} title=${`Sessions of ${scope.backName} only`} @click=${(e) => { e.currentTarget.href = backHref(); }}>← ${scope.backName}</a>`
|
|
59
59
|
: nothing;
|
|
60
60
|
const newSession = dir ? html`<span class="scope-where" title=${`New sessions start in ${dir}`}>new session in<span class="path"><bdi>${dir}</bdi></span></span>` : nothing;
|
|
61
|
-
return html`<button id="scopePick" class="scope-name" type="button" aria-haspopup="dialog" title="Sessions of every project">all projects</button>${back}${newSession}`;
|
|
61
|
+
return html`<button id="scopePick" class="scope-name" type="button" aria-haspopup="dialog" aria-expanded="false" title="Sessions of every project">all projects</button>${back}${newSession}`;
|
|
62
62
|
}
|
|
@@ -121,8 +121,10 @@ export function createSendTurn({
|
|
|
121
121
|
turnDom.handOff({ immediate: true });
|
|
122
122
|
const sending = composer.chips().slice();
|
|
123
123
|
// Into a running turn the echo says what it waits for (its delivery); a
|
|
124
|
-
// line with images always waits for the turn's
|
|
125
|
-
|
|
124
|
+
// line with images, or a Verify or a Revise, always waits for the turn's
|
|
125
|
+
// end (the worker queues it).
|
|
126
|
+
const anchored = !!verify() || !!revise();
|
|
127
|
+
const shownDelivery = isRunning ? (sending.length || anchored ? "queue" : delivery || "next_step") : null;
|
|
126
128
|
const echo = makeUserBubble(prompt, { state: "queued", own: true, images: sending, delivery: shownDelivery });
|
|
127
129
|
if (!turnDom.holds()) historyEl.scrollTop = historyEl.scrollHeight;
|
|
128
130
|
if (!store.current.firstPreview || store.current.firstPreview === "—") {
|
|
@@ -77,7 +77,7 @@ export function chipTemplate(summaries) {
|
|
|
77
77
|
const chip = summaries && chipModel(summaries);
|
|
78
78
|
if (!chip) return nothing;
|
|
79
79
|
return html`<button type="button" class=${`model settings-chip${chip.own ? " own" : ""}`} title=${chip.title}
|
|
80
|
-
aria-label=${chip.label} aria-haspopup="dialog" data-settings-chip><span class="chip-icon sc-gear" aria-hidden="true">⚙</span>${
|
|
80
|
+
aria-label=${chip.label} aria-haspopup="dialog" aria-expanded="false" data-settings-chip><span class="chip-icon sc-gear" aria-hidden="true">⚙</span>${
|
|
81
81
|
chip.text ? html`<span class="sc-own"> ${chip.text}</span>` : nothing}</button>`;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -197,7 +197,7 @@ export function createSettingsControl({ el, summaries, session = () => null, run
|
|
|
197
197
|
};
|
|
198
198
|
const shell = createChipPopover({
|
|
199
199
|
id, className: "ctx-popover start-settings session-settings", width: 440, el, anchor, summary: present, session,
|
|
200
|
-
show, sheet: true, sheetShare: SHEET_TALL,
|
|
200
|
+
show, sheet: true, sheetShare: SHEET_TALL, label: PANEL_LABEL, onOpen: focusInside,
|
|
201
201
|
onClose: () => { shown = null; error = null; }, onSubmit: submit, onAct: act, doc, win,
|
|
202
202
|
});
|
|
203
203
|
// An edit makes the disclosure Set's error stale.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Query parameters the page no longer reads, dropped from the address bar
|
|
2
|
+
// as it loads (app.js, history.replaceState), so a bookmark or a link kept
|
|
3
|
+
// from an older chi stops carrying them: ?view= (the turn view, removed in
|
|
4
|
+
// 0.135.0). The rest of the query stays as written (?dir='s readable
|
|
5
|
+
// slashes too), in its order.
|
|
6
|
+
//
|
|
7
|
+
// A module of its own: static JS is cached at unversioned URLs, and a new
|
|
8
|
+
// export on an old module would blank the page.
|
|
9
|
+
|
|
10
|
+
export const STALE_PARAMS = ["view"];
|
|
11
|
+
|
|
12
|
+
// A query part's name ("view" of "view=turn"), decoded as URLSearchParams
|
|
13
|
+
// reads it.
|
|
14
|
+
function nameOf(part) {
|
|
15
|
+
const raw = part.split("=", 1)[0].replace(/\+/g, " ");
|
|
16
|
+
try { return decodeURIComponent(raw); } catch { return raw; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// +search+ (a location.search) without the stale parameters, "?…" or "";
|
|
20
|
+
// null when it has none (nothing to replace).
|
|
21
|
+
export function withoutStaleParams(search) {
|
|
22
|
+
const parts = String(search || "").replace(/^\?/, "").split("&").filter(Boolean);
|
|
23
|
+
const kept = parts.filter((part) => !STALE_PARAMS.includes(nameOf(part)));
|
|
24
|
+
if (kept.length === parts.length) return null;
|
|
25
|
+
return kept.length ? `?${kept.join("&")}` : "";
|
|
26
|
+
}
|
|
@@ -190,7 +190,7 @@ export function createStartSettings({ el, button, openers = `#${button.id}`, thi
|
|
|
190
190
|
id: "startSettingsPopover", className: "ctx-popover start-settings", width: 440, el, anchor: `#${button.id}`, openers,
|
|
191
191
|
// Taller than a plain sheet: the Apply and budget fields or the review
|
|
192
192
|
// form would push the note under the edge of a 60 % one.
|
|
193
|
-
summary: () => ({}), sheet: true, sheetShare: SHEET_TALL,
|
|
193
|
+
summary: () => ({}), sheet: true, sheetShare: SHEET_TALL, label: PANEL_LABEL, doc, win,
|
|
194
194
|
show: (_data, opening) => {
|
|
195
195
|
if (opening) {
|
|
196
196
|
const choice = llmContext.choice();
|
|
@@ -109,7 +109,7 @@ export function createStartToolkit({ el, button, openers = `#${button.id}`, tool
|
|
|
109
109
|
|
|
110
110
|
const shell = createChipPopover({
|
|
111
111
|
id: "startToolkitPopover", className: "ctx-popover start-toolkit", width: 380, el, anchor: `#${button.id}`, openers,
|
|
112
|
-
summary: () => toolkits(), sheet: true,
|
|
112
|
+
summary: () => toolkits(), sheet: true, label: LIST_LABEL, doc, win,
|
|
113
113
|
show: () => draw(),
|
|
114
114
|
onOpen: focusInside,
|
|
115
115
|
onClose: () => { error = null; },
|
|
@@ -185,7 +185,8 @@ export function createStreamHandlers(deps) {
|
|
|
185
185
|
liveTurn.timing.start(data.started_at, data.turn_id || null);
|
|
186
186
|
}),
|
|
187
187
|
turn_completed: async (data) => {
|
|
188
|
-
// The turn's id: the event names
|
|
188
|
+
// The turn's id: the event names it (an older worker names
|
|
189
|
+
// none: its turn_started did).
|
|
189
190
|
const turnId = data.turn_id || liveTurn.timing.turnId || null;
|
|
190
191
|
activityEnded();
|
|
191
192
|
// A participant's turn: their spend and turns in the panel moved.
|
|
@@ -194,11 +195,15 @@ export function createStreamHandlers(deps) {
|
|
|
194
195
|
const out = turnOutput(data);
|
|
195
196
|
if (out) appendChunk(out);
|
|
196
197
|
if (data.verdict) deps.placeVerdict?.(data.verdict);
|
|
197
|
-
//
|
|
198
|
-
//
|
|
199
|
-
|
|
198
|
+
// Its prompt takes the turn's stamps, as a reload draws them
|
|
199
|
+
// (revise_stack.js follows the DOM): a Revise turn that revised
|
|
200
|
+
// (the stack folds), and a Verify turn (no Revise on its answer, for
|
|
201
|
+
// every viewer, verdict or not; the sender's echo had it already).
|
|
202
|
+
if ((data.revises?.turn_id || data.verify) && turnId) {
|
|
200
203
|
for (const prompt of findInTurnRoots(".bubble.user[data-turn-id]")) {
|
|
201
|
-
if (prompt.dataset.turnId
|
|
204
|
+
if (prompt.dataset.turnId !== turnId) continue;
|
|
205
|
+
if (data.revises?.turn_id) prompt.dataset.revises = data.revises.turn_id;
|
|
206
|
+
if (data.verify) prompt.dataset.verify = "1";
|
|
202
207
|
}
|
|
203
208
|
}
|
|
204
209
|
// after_turn hooks are running and may present the answer: its
|
|
@@ -100,6 +100,8 @@ export function createRing(parent) {
|
|
|
100
100
|
export function createWorkingSetRail({ live, stage, onOpen, onChange }) {
|
|
101
101
|
const rail = el("div", "ts-ws", live);
|
|
102
102
|
rail.setAttribute("role", "button");
|
|
103
|
+
rail.setAttribute("aria-haspopup", "dialog");
|
|
104
|
+
rail.setAttribute("aria-expanded", "false");
|
|
103
105
|
rail.tabIndex = 0;
|
|
104
106
|
const head = el("div", "ws-head", rail);
|
|
105
107
|
const name = el("span", "ws-name", head);
|
|
@@ -105,7 +105,7 @@ export function footprintTemplate(items, ordinal) {
|
|
|
105
105
|
const sep = html` <span class="sep">·</span> `;
|
|
106
106
|
const parts = fp.labels.map((l, i) => html`${i ? sep : nothing}<span class=${`l ${l.kind}${l.state && l.state !== "live" ? ` ${l.state}` : ""}`} title=${labelTitle(l)}>${l.glyph ? html`<span class="k">${l.glyph}</span> ` : nothing}${labelText({ ...l, glyph: "" })}</span>${footTag(l)}`);
|
|
107
107
|
const text = footprintText(items, BUDGETS.footprint);
|
|
108
|
-
return html`<div class="ws-foot" role="button" tabindex="0" data-ws-turn=${ordinal} data-ws-sig=${footSig(items)} aria-label=${`Working set of this turn: ${text.replace(/^touched /, "")}. Open the list.`}><span class="w">touched</span> ${parts}${fp.tail ? html`${sep}<span class="w">${fp.tail}</span>` : nothing}${fp.edited ? html`${sep}<span class="e">edited ${fp.edited}</span>` : nothing}${fp.stale ? html`${sep}<span class="s">${fp.stale} stale</span>` : nothing}${fp.forgotten ? html`${sep}<span class="f">${fp.forgotten} forgotten</span>` : nothing}${fp.dropped ? html`${sep}<span class="f">${fp.dropped} dropped</span>` : nothing}</div>`;
|
|
108
|
+
return html`<div class="ws-foot" role="button" tabindex="0" aria-haspopup="dialog" aria-expanded="false" data-ws-turn=${ordinal} data-ws-sig=${footSig(items)} aria-label=${`Working set of this turn: ${text.replace(/^touched /, "")}. Open the list.`}><span class="w">touched</span> ${parts}${fp.tail ? html`${sep}<span class="w">${fp.tail}</span>` : nothing}${fp.edited ? html`${sep}<span class="e">edited ${fp.edited}</span>` : nothing}${fp.stale ? html`${sep}<span class="s">${fp.stale} stale</span>` : nothing}${fp.forgotten ? html`${sep}<span class="f">${fp.forgotten} forgotten</span>` : nothing}${fp.dropped ? html`${sep}<span class="f">${fp.dropped} dropped</span>` : nothing}</div>`;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// What a footprint shows that can change after it is drawn: its items'
|
|
@@ -186,7 +186,7 @@ export function createWorkingSet({ historyEl, stageRoot = () => null, state, ses
|
|
|
186
186
|
|
|
187
187
|
const popover = createChipPopover({
|
|
188
188
|
id: "workingSetPopover", className: "ctx-popover ws-popover", width: 420, el: infoEl, anchor: ".ws-chip",
|
|
189
|
-
openers: ".ws-chip, .ts-ws, .ws-foot", sheet: true,
|
|
189
|
+
openers: ".ws-chip, .ts-ws, .ws-foot", sheet: true, label: "Working set",
|
|
190
190
|
// The chip opens the session's scope; the rail and a footprint set
|
|
191
191
|
// theirs before they open it.
|
|
192
192
|
summary: (anchor) => {
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: samagotchi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.137.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Dedov
|
|
@@ -843,6 +843,7 @@ files:
|
|
|
843
843
|
- lib/samagotchi/web/public/participant_names.js
|
|
844
844
|
- lib/samagotchi/web/public/participants_panel.js
|
|
845
845
|
- lib/samagotchi/web/public/plain_line.js
|
|
846
|
+
- lib/samagotchi/web/public/popover_modal.js
|
|
846
847
|
- lib/samagotchi/web/public/project_picker.js
|
|
847
848
|
- lib/samagotchi/web/public/prompt_history.js
|
|
848
849
|
- lib/samagotchi/web/public/push.js
|
|
@@ -859,6 +860,7 @@ files:
|
|
|
859
860
|
- lib/samagotchi/web/public/review_history.js
|
|
860
861
|
- lib/samagotchi/web/public/review_start.js
|
|
861
862
|
- lib/samagotchi/web/public/revise_stack.js
|
|
863
|
+
- lib/samagotchi/web/public/revise_switch.js
|
|
862
864
|
- lib/samagotchi/web/public/route.js
|
|
863
865
|
- lib/samagotchi/web/public/scope.js
|
|
864
866
|
- lib/samagotchi/web/public/scroll.js
|
|
@@ -881,6 +883,7 @@ files:
|
|
|
881
883
|
- lib/samagotchi/web/public/stage_slots.js
|
|
882
884
|
- lib/samagotchi/web/public/stage_view.js
|
|
883
885
|
- lib/samagotchi/web/public/stage_watch.js
|
|
886
|
+
- lib/samagotchi/web/public/stale_params.js
|
|
884
887
|
- lib/samagotchi/web/public/start_page.js
|
|
885
888
|
- lib/samagotchi/web/public/start_settings.js
|
|
886
889
|
- lib/samagotchi/web/public/start_toolkit.js
|