samagotchi 0.167.0 → 0.168.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 +27 -1
- data/docs/cli.md +14 -10
- data/docs/guardrails.md +2 -3
- data/docs/internals/web-frontend.md +56 -16
- data/docs/testing.md +2 -3
- data/lib/samagotchi/bundle_command.rb +19 -4
- data/lib/samagotchi/bundles/system/manifest.yml +1 -1
- data/lib/samagotchi/compat.rb +1 -5
- data/lib/samagotchi/guardrails/approvals.rb +5 -29
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/public/dock_reserve.js +12 -2
- data/lib/samagotchi/web/public/history_end.js +16 -0
- data/lib/samagotchi/web/public/index.html +39 -13
- data/lib/samagotchi/web/public/question_cards.js +1 -1
- data/lib/samagotchi/web/public/refs.js +4 -1
- data/lib/samagotchi/web/public/reload_check.js +5 -4
- data/lib/samagotchi/web/public/stage_cards.js +20 -0
- data/lib/samagotchi/web/public/stage_frame.js +14 -16
- data/lib/samagotchi/web/public/stage_model.js +11 -4
- data/lib/samagotchi/web/public/stage_opened.js +229 -0
- data/lib/samagotchi/web/public/stage_slots.js +2 -3
- data/lib/samagotchi/web/public/stage_view.js +219 -147
- data/lib/samagotchi/web/public/stage_watch.js +8 -4
- data/lib/samagotchi/web/public/turn_block.js +14 -2
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6bc9c5e654d2f08b834fbfac7be6b27f308a4a5c0753fe1c2472ef73e2b7c38a
|
|
4
|
+
data.tar.gz: 44d7d0b2790f7182625a876b45e5e3172f41ce4cadd41209df3b7851f8b9d725
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1424a5719445c61ac2a1904bb4cd6b097b7f7426b3bcfb1c7454f912edc2c14bda5a2574de21fb00f3ed3610e7ebaae2fe3bb3684fbc7f7b7f5c694115f7726
|
|
7
|
+
data.tar.gz: 9fa6dba73441bad02e5f278c374208bb9e7aef298c4b23413a3a367d7190234e935d091bfb4b511978568ed7c68edc41ff539557bcd136a18a9026e95b11d930
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,31 @@ and commands may change between minor versions. How releases are made:
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.168.0] - 2026-11-11
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Stored approvals from chi 0.166 and before (a list in `guardrails/approvals.json`) are no longer read: such a file is
|
|
16
|
+
set aside as `approvals.json.corrupt-*` and those calls ask again once.
|
|
17
|
+
- chi web: when the model asks its own question after a reply, the reply is a bubble in the conversation (`chi · step N
|
|
18
|
+
· asking you`) and the stage keeps only the question's card above the composer, so you can scroll back through the
|
|
19
|
+
conversation while it waits; the turn's prompt and steps move into the conversation with it, and the card's
|
|
20
|
+
`↑ its reason` leads back to the reply. Answered, the card sits under the reply; when the turn ends the reply folds
|
|
21
|
+
into the card's two lines as before. The same after a reload while the card waits or after it was answered. The
|
|
22
|
+
question's own room and its `❓ Answer ↓` pill are gone. Approvals, relayed and hook questions are unchanged.
|
|
23
|
+
- chi web: in a session the running turn's stage and the composer are as wide as the conversation's column (at most
|
|
24
|
+
960 px, centred, and clear of an always-shown scrollbar), so a wide window no longer draws them wider than the
|
|
25
|
+
messages above.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- chi web: after a reload mid-turn, a question answered earlier in the running turn keeps the reply that asked it (its
|
|
30
|
+
two muted lines), as it does live.
|
|
31
|
+
- chi web: the opt-in reload check (`web.reload_check`) no longer reports every turn with a question as different.
|
|
32
|
+
- `chi bundle list`, `status` and `diff`: an extra argument is refused (exit 2) instead of ignored.
|
|
33
|
+
|
|
34
|
+
Update with `chi update`, then restart chi web and running sessions (`chi sessions restart`).
|
|
35
|
+
|
|
11
36
|
## [0.167.0] - 2026-11-11
|
|
12
37
|
|
|
13
38
|
### Added
|
|
@@ -6214,7 +6239,8 @@ and long-lived sessions.
|
|
|
6214
6239
|
- A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
|
|
6215
6240
|
hotkey panel that send selected text or the clipboard to your sessions.
|
|
6216
6241
|
|
|
6217
|
-
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.
|
|
6242
|
+
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.168.0...HEAD
|
|
6243
|
+
[0.168.0]: https://github.com/dm1try/samagotchi/compare/v0.167.0...v0.168.0
|
|
6218
6244
|
[0.167.0]: https://github.com/dm1try/samagotchi/compare/v0.166.0...v0.167.0
|
|
6219
6245
|
[0.166.0]: https://github.com/dm1try/samagotchi/compare/v0.165.0...v0.166.0
|
|
6220
6246
|
[0.165.0]: https://github.com/dm1try/samagotchi/compare/v0.164.0...v0.165.0
|
data/docs/cli.md
CHANGED
|
@@ -1262,20 +1262,24 @@ the step's reasoning), the running tool with what it does, and the last
|
|
|
1262
1262
|
three calls. A plugin's or hook's notice and a plugin's nudge ("check-in
|
|
1263
1263
|
nudged the model") show ahead of those calls for about 4 s, as their rows
|
|
1264
1264
|
wait in the closed block. A card that needs you (a question, an approval, check-in)
|
|
1265
|
-
sits in the stage too.
|
|
1266
|
-
the
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
the
|
|
1271
|
-
|
|
1272
|
-
|
|
1265
|
+
sits in the stage too. When the model asks its own question after a reply,
|
|
1266
|
+
the turn moves into the conversation: your prompt, its steps (closed; they
|
|
1267
|
+
open in place) and the reply that asked, as a bubble labelled `chi · step N
|
|
1268
|
+
· asking you`, read from its first line; the stage keeps only the card, and
|
|
1269
|
+
the conversation scrolls freely behind it (the card's `↑ its reason` leads
|
|
1270
|
+
back to the reply). Answered, the card sits under that reply and the stage
|
|
1271
|
+
goes back to the running turn. While an approval, a delegate's relayed
|
|
1272
|
+
question or a hook's question waits, the stage shows the whole text of the
|
|
1273
|
+
reply that asked it (in place of its newest sentence) above the card, until
|
|
1274
|
+
you answer. Once answered, the model's
|
|
1273
1275
|
question or its own approval keeps that reply (a delegate's relayed
|
|
1274
1276
|
approval, a hook's question and the step limit don't): two muted lines
|
|
1275
1277
|
under its `question → answer` line, the whole text when you open the card,
|
|
1276
|
-
live and after a reload
|
|
1278
|
+
live and after a reload (the reply's bubble folds into those two lines when
|
|
1279
|
+
the turn moves into the history). The chip at the stage's bottom edge, `N steps · M tool
|
|
1277
1280
|
calls` with one tick per call, opens the turn block right above it (newest step first
|
|
1278
|
-
while it runs; a tick opens its step)
|
|
1281
|
+
while it runs; a tick opens its step); once a question moved the turn into the
|
|
1282
|
+
conversation, the chip and its ticks open the steps there instead, in order. Below the chip, past a dashed rule, wait the
|
|
1279
1283
|
messages queued for after the turn and the commands queued for its end; they go into
|
|
1280
1284
|
the history after the turn's answer. `▾` folds the stage to its status
|
|
1281
1285
|
row, remembered in this browser. The stage keeps its height while a turn
|
data/docs/guardrails.md
CHANGED
|
@@ -115,9 +115,8 @@ once, session and repo, while `git merge y && git push` offers once, as `git-mer
|
|
|
115
115
|
Two rules with one id (a config.yml copy of a bundle's rule) are one rule; a core ask followed by a rule's (the
|
|
116
116
|
[child boundary's](#a-delegate-childs-boundary)) keeps its own scopes.
|
|
117
117
|
The file is a versioned store (`{"version": 1, "approvals": [...]}`, `Approvals::FORMAT`); a write keeps its version,
|
|
118
|
-
the keys this chi doesn't know and an entry with no `scope`.
|
|
119
|
-
|
|
120
|
-
(a read-only state dir) is read as it is. Chi 0.165 and before set a versioned store aside, so restart their sessions
|
|
118
|
+
the keys this chi doesn't know and an entry with no `scope`. A bare list of entries, as chi 0.166 and before wrote it, is no longer read: it is set aside as
|
|
119
|
+
`approvals.json.corrupt-*` like an unreadable file, so those calls ask once more. Chi 0.165 and before set a versioned store aside, so restart their sessions
|
|
121
120
|
(`chi sessions restart`); a downgrade to 0.165 or before moves the store to a recoverable `approvals.json.corrupt-*`.
|
|
122
121
|
A file that doesn't parse, or a versioned store whose `approvals` isn't a list, is moved aside to
|
|
123
122
|
`approvals.json.corrupt-<UTC time>` with one warning, and chi starts with no stored approvals (more asks, nothing lost).
|
|
@@ -28,7 +28,7 @@ page. A factory dep a new version stops passing is the same hazard the other way
|
|
|
28
28
|
out of `send_turn.js`, `session_actions.js` and `lists_view.js`); a page loaded before keeps all its old modules
|
|
29
29
|
until a reload, so the risk is a mixed cache, not an open tab. `answer_fold.js`, `details_motion.js`,
|
|
30
30
|
`turn_range.js`, `history_reveal.js`, `latest.js`, `session_payload.js`, `method_api.js`, `session_store.js`,
|
|
31
|
-
`session_fields.js`, `feature_gates.js`, `revise_stack.js`, `revise_switch.js`, `shell_command.js`, `stale_params.js`, `popover_modal.js`, `more_sheet.js`, `hash_intent.js` (what the hash asks for: session, all, start or keep), `worker_features.js`, `version_notices.js`, `owner_claim.js`, `owner_verify.js`, `composer_mode.js`, `strip_hidden.js`, `block_open.js`, `text_roots.js`, `block_source.js`, `block_frame.js`, `block_host.js`, `block_watch.js`, `card_stamps.js`, `recap_stamp.js` (a saved recap's place by its `opening_id` stamp, else its count), `inline_widgets.js`, `widget_walk.js`, `widget_picks.js`, `history_shape.js` (the history's shape, live against a reload: the e2e reload checks and the opt-in reload check share its normalizer and its `ACCEPTED` allowlist), `turn_pieces.js` (a finished turn's one order and its answer rule: the live hand-off's `handOffOrder` and `turnEnded`, and a reload's `turnHistoryNodes`), `reload_check.js` (the opt-in `web.reload_check`: after the stage's hand-off, the turn against a reload of it, the counts posted), `turn_drawing.js` (a finished turn's drawing, `turn_drawings` in the show: its fold into steps and its end kind; `turn_block.js` draws it), `stage_stall.js` (the stage's quiet signal), `resync_reach.js` (a re-read that can't reach chi web keeps the drawn history; the status chip says retrying / offline, outside a turn), `session_sync.js` (the open session's sync: `select`, `resync` and its retries, the stream's life; the stream handle and the re-read bookkeeping are its own), `session_view.js` (the open session's view: `renderSessionView` draws a read, `forgetSession` resets the page for another session, `readTurnEnd`, `endTurnView`; app.js makes both right after the cards, each reaching the other and the later views through getters), `no_contact_fill.js` (a text field that isn't a contact form: autocomplete off and a name with no contact word, against iOS Safari's AutoFill Contact bar; a template's fields carry the same attributes, and its spec checks the page's markup for them) and the `objectives_*.js` modules are new modules for that reason. The last four `block_*` draw fenced blocks (`block_watch.js` finds and watches them, `block_host.js` is its frame drawer for a bundle's renderers): [block-renderers.md](block-renderers.md). `inline_widgets.js` is its core drawer for `chi-ui` blocks, drawing `widget_walk.js`'s and `widget_picks.js`'s widgets in a shadow root styled by `widgets.css`: [inline-widgets.md](inline-widgets.md).
|
|
31
|
+
`session_fields.js`, `feature_gates.js`, `revise_stack.js`, `revise_switch.js`, `shell_command.js`, `stale_params.js`, `popover_modal.js`, `more_sheet.js`, `hash_intent.js` (what the hash asks for: session, all, start or keep), `worker_features.js`, `version_notices.js`, `owner_claim.js`, `owner_verify.js`, `composer_mode.js`, `strip_hidden.js`, `block_open.js`, `text_roots.js`, `block_source.js`, `block_frame.js`, `block_host.js`, `block_watch.js`, `card_stamps.js`, `recap_stamp.js` (a saved recap's place by its `opening_id` stamp, else its count), `inline_widgets.js`, `widget_walk.js`, `widget_picks.js`, `history_shape.js` (the history's shape, live against a reload: the e2e reload checks and the opt-in reload check share its normalizer and its `ACCEPTED` allowlist), `turn_pieces.js` (a finished turn's one order and its answer rule: the live hand-off's `handOffOrder` and `turnEnded`, and a reload's `turnHistoryNodes`), `reload_check.js` (the opt-in `web.reload_check`: after the stage's hand-off, the turn against a reload of it, the counts posted), `turn_drawing.js` (a finished turn's drawing, `turn_drawings` in the show: its fold into steps and its end kind; `turn_block.js` draws it), `stage_stall.js` (the stage's quiet signal), `history_end.js` (the stage's one move of pieces to the history's end), `stage_opened.js` (a running turn opened in the history while the model's own question waits: the reason bubble, the moves, the end fold), `stage_cards.js` (the cards that wait in the stage: `PENDING`, `ASKS`, `waitsInStage`, read by `stage_model.js placeKind`), `resync_reach.js` (a re-read that can't reach chi web keeps the drawn history; the status chip says retrying / offline, outside a turn), `session_sync.js` (the open session's sync: `select`, `resync` and its retries, the stream's life; the stream handle and the re-read bookkeeping are its own), `session_view.js` (the open session's view: `renderSessionView` draws a read, `forgetSession` resets the page for another session, `readTurnEnd`, `endTurnView`; app.js makes both right after the cards, each reaching the other and the later views through getters), `no_contact_fill.js` (a text field that isn't a contact form: autocomplete off and a name with no contact word, against iOS Safari's AutoFill Contact bar; a template's fields carry the same attributes, and its spec checks the page's markup for them) and the `objectives_*.js` modules are new modules for that reason. The last four `block_*` draw fenced blocks (`block_watch.js` finds and watches them, `block_host.js` is its frame drawer for a bundle's renderers): [block-renderers.md](block-renderers.md). `inline_widgets.js` is its core drawer for `chi-ui` blocks, drawing `widget_walk.js`'s and `widget_picks.js`'s widgets in a shadow root styled by `widgets.css`: [inline-widgets.md](inline-widgets.md).
|
|
32
32
|
|
|
33
33
|
## Two pages, two models
|
|
34
34
|
|
|
@@ -55,7 +55,7 @@ change.
|
|
|
55
55
|
| **`store.current`** (`session_state.js`: `emptySessionState` / `sessionStateFrom`; per field: `session_fields.js FIELDS`) | the open session's fields, about 40 (info bar, chips, verdicts, timing, worker, stream cursor) | `store.update` / `setStatus` from app.js, `stream_handlers.js`, `session_sync.js`, `session_view.js`, `send_turn.js` (`firstPreview`, `owner`), `session_actions.js` (`status`), `owner_verify.js` (`verdicts`, `verifyFresh`); `forgetSession`'s `replaceCurrent` (`session_view.js`). Two writers in place, on purpose (D8 in `FIELDS`): live_timing.js's `activeTurn`, verdict_fresh.js's running list | the store runs the field's redraws (`FIELDS[key].redraws`) |
|
|
56
56
|
| **`store.sessions`** (the hub's projection) | every card | `store.update({sessions})` from app.js: `openSessionEvents` (`applySessionEvent`), `refresh` (the list fallback), `addCreatedSession`, `applyView` (re-sorted), `replaceSelectedCard` (`setLiveStatus` through `setStatus`, `readTurnEnd`, `setUsedMemories`), the stream's close (`withoutWorker`); `session_actions.js` (`setSessions`) | the store: `lists` and `infoBar`. **Always a new array**; an entry is replaced, never changed in place. `followSelectedSession` copies the open one's owner and worker (`fieldsFromCard`) and, when not streaming, its status (`setStatus(…, "hub")`) into `store.current` |
|
|
57
57
|
| **Factory closures**: the `create*` factories (popovers, panels, views) | each component's own state: open-for, busy, error, its own fetched list | the factory | an `onChange` hook back into app.js, or a getter the factory reads at draw time |
|
|
58
|
-
| **The history DOM** | the conversation as drawn: which turn a bubble belongs to (`data-turn-id`, `data-answer-turn`), what opens a turn (`TURN_PROMPT`, `bubbles.js`: a prompt or a wake's note, the same turns `Steer.turn_opening?` counts for a card's `turns_since`), an opening's id for a card's and the saved recap's stamp (`data-turn-id` on a prompt, `data-opening-id` on a wake's note or `/continue no`'s reason line; `card_stamps.js` places a snapshot's card after the stamped opening, `recap_stamp.js` the saved recap after the last turn it covers, each by its count (`turns_since`) only without one), kept command bubbles, which texts were shown, unnamed badges, folded answers and long prompts (`.folded`), Revise stamps (`data-revises` on a prompt; a Verify turn's `data-verify`) and the stacks' folded versions (`.stack-hidden`, `.stack-stub.open`); the switcher's version on view is `revise_stack.js`'s own (a copy `.stack-view` before the top answer, the top `.stack-swapped`; never stored) | `bubbles.js`, `cards_place.js`, `question_cards.js`, `turn_block.js`/`stage_view.js`, `answer_fold.js`, `revise_stack.js`, `stream_handlers.js` (a live `turn_completed`'s `revises` and `verify` onto its prompt) | read back as state: `turn_range.js turnElements` (one walker for a turn's elements), `keptCommandBubbles`, `seedSeenFromDom`, `nameUnnamedBadges`/`nameVerdictCards`, `answer_fold.js` and `revise_stack.js` (their observers decorate every path that fills `#history`; the stacks are `stacks()` of the stamps, read again on each change, never a store field), `history_reveal.js revealInHistory` (the one way a jump unfolds what hides its target) |
|
|
58
|
+
| **The history DOM** | the conversation as drawn (a running turn's reason bubble, `.bubble.said`, is live only: see A turn opened in the history): which turn a bubble belongs to (`data-turn-id`, `data-answer-turn`), what opens a turn (`TURN_PROMPT`, `bubbles.js`: a prompt or a wake's note, the same turns `Steer.turn_opening?` counts for a card's `turns_since`), an opening's id for a card's and the saved recap's stamp (`data-turn-id` on a prompt, `data-opening-id` on a wake's note or `/continue no`'s reason line; `card_stamps.js` places a snapshot's card after the stamped opening, `recap_stamp.js` the saved recap after the last turn it covers, each by its count (`turns_since`) only without one), kept command bubbles, which texts were shown, unnamed badges, folded answers and long prompts (`.folded`), Revise stamps (`data-revises` on a prompt; a Verify turn's `data-verify`) and the stacks' folded versions (`.stack-hidden`, `.stack-stub.open`); the switcher's version on view is `revise_stack.js`'s own (a copy `.stack-view` before the top answer, the top `.stack-swapped`; never stored) | `bubbles.js`, `cards_place.js`, `question_cards.js`, `turn_block.js`/`stage_view.js`, `answer_fold.js`, `revise_stack.js`, `stream_handlers.js` (a live `turn_completed`'s `revises` and `verify` onto its prompt) | read back as state: `turn_range.js turnElements` (one walker for a turn's elements), `keptCommandBubbles`, `seedSeenFromDom`, `nameUnnamedBadges`/`nameVerdictCards`, `answer_fold.js` and `revise_stack.js` (their observers decorate every path that fills `#history`; the stacks are `stacks()` of the stamps, read again on each change, never a store field), `history_reveal.js revealInHistory` (the one way a jump unfolds what hides its target) |
|
|
59
59
|
| **A drawn turn** (`turn_drawings` of the full read) | every finished turn, as live drew it: `turnGroups` groups by the stamps only, a turn's stamped items (`drawn: <turn_id>`) one group, and `turnHistoryNodes` draws it by feeding its drawing's events to a live turn block offscreen (`turn_block.js drawnTurnNodes`: the block's own handlers, as the stage's), the stage's extras (a reminder, merged lines, a card that asks or warns) and end as live, then the answer, the merged lines and the steps' texts from their saved items (markdown, refs). Each of its top-level elements carries `data-drawn`: `cards_place.js` leaves that turn's in-turn CardStore entries (`of_turn`) to it, and a kept reminder bubble of that turn (`data-turn-id`) stays out after a resync. chi web sends a drawing for every finished turn (one made from its messages where live wrote none): `drawnGroup` pairs the record the end names (`end.record_id`, by place for a turn saved before turn ids), else by the turn's id, and the answer's `data-answer-turn` is the end's own `turn_id` only (a made-up id, `m…` or `…~N`, keys none: no Revise). Nothing is rebuilt from messages: an item that comes unstamped is a `plain` group drawn as a plain row of its text (its prompt or answer bubble, no steps), the running turn's as expected (`runningTurnId`, the show's `current_turn`: it has no line yet), any other a miss, marked `data-undrawn`, logged once per render (`console.warn`) and counted by the reload check (`undrawn`), never a throw; a drawing with no parts (a minimal line) draws its prompt, answer and end | chi web (the show) | `renderHistory`, the reload check's render |
|
|
60
60
|
| **localStorage** (`storage.js` `readStored`/`writeStored`, guarded) | per-browser choices only | the module that owns the choice | read at start (see Storage keys) |
|
|
61
61
|
| **SSE** | see Streams | the server | owner page: events go into the DOM directly; participant page: an event marks the data stale |
|
|
@@ -277,20 +277,60 @@ as Chromium has no insets. The theme-color metas are tokens.css's `--bg-top` per
|
|
|
277
277
|
|
|
278
278
|
## The stage's height
|
|
279
279
|
|
|
280
|
-
`stage_frame.js` is the one writer. The cap is a ceiling: 60% of the page, 80% with the cloud open, 85%
|
|
281
|
-
|
|
282
|
-
`--dock-bottom`, and 16px). The frame is grow-only while a turn runs, so a change inside the stage
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
280
|
+
`stage_frame.js` is the one writer. The cap is a ceiling: 60% of the page, 80% with the cloud open, 85% with a raised
|
|
281
|
+
cap, and never above the session panel (less the card, its offset from the panel's bottom as computed: index.html
|
|
282
|
+
`--dock-bottom`, and 16px). The frame is grow-only while a turn runs, so a change inside the stage never moves its top
|
|
283
|
+
edge, with **two allowed shrinks, once per question and once per answer** (`forgetContent`):
|
|
284
|
+
- **the asking form**: each model's own question that opens (or, the second one on, finds opened) the turn in the history
|
|
285
|
+
(below): the stage shows that card alone (`stage_view.js place`, in the card's task);
|
|
286
|
+
- **the next step after a blocking card's answer** (`stage_view.js releaseHeldWait`, from `generationStarted`). The
|
|
287
|
+
`held-wait` class says it is due: set with `waiting`, cleared there, so a later step, which calls it again, does
|
|
288
|
+
nothing. What goes together: the live slots' waiting height, a raised cap, the tallest content seen. At the tap nothing
|
|
289
|
+
moves: the card collapses to its line inside the held frame and the stage's scroll stays, unless the line would be above
|
|
290
|
+
the view (a reader who scrolled down a card taller than the stage), when it comes back to the view's top
|
|
291
|
+
(`settleAnsweredCard`).
|
|
292
|
+
|
|
293
|
+
One card raises the cap: a blocking approval too tall for the stage's view, a delegate's relayed one too
|
|
294
|
+
(`raiseForApproval`, `stage_frame.js fitsCap`). It opens at its question and command (`revealTop`). A model's own
|
|
295
|
+
question gets no room and no pill: its reply is in the history.
|
|
296
|
+
|
|
297
|
+
## A turn opened in the history
|
|
298
|
+
|
|
299
|
+
When the model's own question blocks the turn after a reply (`ASK_CARD`: `data-kind="question"`, not relayed, placed in
|
|
300
|
+
the extras before the turn's end, with a reply from `stage_view.js askingGen`: live, the step whose call runs; in a
|
|
301
|
+
replay, below), the stage opens the turn in the history
|
|
302
|
+
(`stage_view.js openTurn`, `stage_opened.js`). Approvals, relayed and hook questions, a question with no reply, plugin
|
|
303
|
+
asking cards and the step limit keep the stage as it was (the asking slot, `drawAsking`).
|
|
304
|
+
|
|
305
|
+
| Piece | Where, from the opening to the turn's end |
|
|
306
|
+
|---|---|
|
|
307
|
+
| The prompt, the steps block (closed; its steps in order from now on, `turn_block.js inOrder`) and the rows the extras held | the history's end, in `handOffOrder`'s order (`history_end.js moveToHistoryEnd`) |
|
|
308
|
+
| The reply that asked: `.bubble.said` (`data-question-id`, `data-said-turn`, never `data-turn-id`: that marks an opening) | the history's end, in the card's task; raw, then its markdown; `.pending` ("asking you", the amber edge) while its card waits |
|
|
309
|
+
| Rows that arrive (`placeFor` `"opened"`: notes, steered prompts, commands, a card that stopped waiting) | the history's end, in arrival order |
|
|
310
|
+
| A card that waits (`stage_cards.js waitsInStage`: `PENDING`, `ASKS`, a warning) | the stage, as before; a promoted one shows the asking form (`.asking-form`: the status row and the card; the prompt, the live slots with the working set and the chip hidden) and a "↑ its reason" link in its summary |
|
|
311
|
+
| A promoted card answered or cancelled | right under its reason (`settle`), also after the turn's end; its own clamp is hidden while the reason is there (CSS) |
|
|
312
|
+
| Live slots, the streaming answer, the end line, the queued slot | the stage, as before; the hand-off appends what it still holds |
|
|
313
|
+
|
|
314
|
+
A turn released without its end (a lost `turn_completed`, the next turn's start) drops its reasons (`stage_opened.js
|
|
315
|
+
drop`) and leaves the rest; a late recap goes above an opened turn (`place`). The reload check's turn starts at its
|
|
316
|
+
opening: its prompt, else a wake's note (`data-opening-id`) right before it, notes that reached the history mid-turn
|
|
317
|
+
included (`wholeTurn`).
|
|
318
|
+
|
|
319
|
+
The stage says where the block is (`blockPlace`: cloud, answer, history; `data-block="history"` on the stage for
|
|
320
|
+
`refs.js turnBlockOf`); the chip and a tick reveal the block or a step in the history. **Follow:** every row that reaches
|
|
321
|
+
the history follows a reader who was at its end (`atHistoryEnd`, read before the change); a reason is read from its first
|
|
322
|
+
line instead, and the history is marked `data-reading` until that scroll ends so the bottom reserve's own follow
|
|
323
|
+
(`dock_reserve.js`) doesn't take the end back. A reader scrolled up is never moved. **The end fold** (`finishFold`, after
|
|
324
|
+
the pieces, in their task): the reasons go and each answered card's two-line clamp says it, as the turn reloads; the first
|
|
325
|
+
row in view after a reason keeps its place when the history has room to scroll. The hand-off also waits while the pointer
|
|
326
|
+
or a selection is in a reason (`stage_watch.js alsoWatched`). The reload check gets the turn from its opening (`wholeTurn`).
|
|
327
|
+
**A reload or a resync** draws the same picture: `renderSessionView` replays the running turn (`data.replay`), in which
|
|
328
|
+
the asking call has completed when its `question_requested` comes (`TurnAccumulator.join_events`), so the asking step is
|
|
329
|
+
the last one whose last call is `ask_user_question` and whose reply no question card of this page took yet
|
|
330
|
+
(`stage_view.js askingGen`, `asked`: a later card of that step never reuses it; live, the step whose call runs). The
|
|
331
|
+
replayed card opens the turn as live; a question answered earlier in the turn settles under its reason with the
|
|
332
|
+
replayed `question_answered`, and `releaseHeldWait` reads a pending card, not the `waiting` class the replay's one task
|
|
333
|
+
hasn't refreshed yet.
|
|
294
334
|
|
|
295
335
|
## Frames
|
|
296
336
|
|
data/docs/testing.md
CHANGED
|
@@ -158,9 +158,8 @@ continue's `context/sessions/<id>/left.json`, stored approvals
|
|
|
158
158
|
(`guardrails/approvals.json`), and a participant's grant
|
|
159
159
|
(`web-grants/grants.json`) with its `participants.json` sidecar, and the chi
|
|
160
160
|
home (`home.json`). A corpus from
|
|
161
|
-
0.164.0 or before has none of those and skips them; a later one must hold them. 0.165.0's and 0.166.0's approvals
|
|
162
|
-
|
|
163
|
-
later chi writes; the corpus is always read from a copy, since a reader may rewrite what it reads.
|
|
161
|
+
0.164.0 or before has none of those and skips them; a later one must hold them. 0.165.0's and 0.166.0's approvals are a list, which chi no longer reads: the main read skips them and a spec there
|
|
162
|
+
checks that the file is set aside. The corpus is always read from a copy, since a reader may rewrite or move what it reads.
|
|
164
163
|
A corpus recorded after 0.165.0 also holds `wire/`: a worker's replies to `GET state`, `snapshot` (after a turn, and
|
|
165
164
|
mid-turn with a prompt queued behind it) and `tail`, each `{route, status, body}`, and the session file it saved,
|
|
166
165
|
recorded from a real Engine and Bridge (`script/release/compat_wire.rb`, `CompatWire`: a scripted kernel, read over the
|
|
@@ -541,7 +541,7 @@ module Samagotchi
|
|
|
541
541
|
end
|
|
542
542
|
|
|
543
543
|
def status(rest)
|
|
544
|
-
parsed = parse_flags(NO_FLAGS, rest, "status", help: STATUS_HELP)
|
|
544
|
+
parsed = parse_flags(NO_FLAGS, rest, "status", help: STATUS_HELP, max_positionals: 1, noun: "bundle")
|
|
545
545
|
return parsed if parsed.is_a?(Integer)
|
|
546
546
|
|
|
547
547
|
name = parsed.args.first
|
|
@@ -644,7 +644,7 @@ module Samagotchi
|
|
|
644
644
|
def status_scope(st) = st.scope_error ? "#{st.scope} (unknown)" : st.scope
|
|
645
645
|
|
|
646
646
|
def diff(rest)
|
|
647
|
-
parsed = parse_flags(NO_FLAGS, rest, "diff", help: DIFF_HELP)
|
|
647
|
+
parsed = parse_flags(NO_FLAGS, rest, "diff", help: DIFF_HELP, max_positionals: 2)
|
|
648
648
|
return parsed if parsed.is_a?(Integer)
|
|
649
649
|
|
|
650
650
|
args = parsed.args
|
|
@@ -756,7 +756,7 @@ module Samagotchi
|
|
|
756
756
|
end
|
|
757
757
|
|
|
758
758
|
def list(rest)
|
|
759
|
-
parsed = parse_flags(NO_FLAGS, rest, "list", help: LIST_HELP)
|
|
759
|
+
parsed = parse_flags(NO_FLAGS, rest, "list", help: LIST_HELP, max_positionals: 0)
|
|
760
760
|
return parsed if parsed.is_a?(Integer)
|
|
761
761
|
|
|
762
762
|
listing = Samagotchi::MemoryBundle::Listing
|
|
@@ -1026,7 +1026,7 @@ module Samagotchi
|
|
|
1026
1026
|
# @return [CLI::Flags::Result, Integer] the result, or the exit status
|
|
1027
1027
|
# after the help or an unknown flag (a value flag without its value
|
|
1028
1028
|
# reads as one)
|
|
1029
|
-
def parse_flags(flags, rest, sub, help:)
|
|
1029
|
+
def parse_flags(flags, rest, sub, help:, max_positionals: nil, noun: "argument")
|
|
1030
1030
|
parsed = flags.parse(rest)
|
|
1031
1031
|
if parsed.help
|
|
1032
1032
|
@stdout.puts help
|
|
@@ -1036,6 +1036,21 @@ module Samagotchi
|
|
|
1036
1036
|
@stderr.puts "Unknown bundle #{sub} flag: #{parsed.error.arg}"
|
|
1037
1037
|
return CLI::Exit::USAGE
|
|
1038
1038
|
end
|
|
1039
|
+
if max_positionals && parsed.args.size > max_positionals
|
|
1040
|
+
extra = parsed.args[max_positionals..]
|
|
1041
|
+
count = if max_positionals == 1
|
|
1042
|
+
"one"
|
|
1043
|
+
else
|
|
1044
|
+
max_positionals == 2 ? "two" : max_positionals.to_s
|
|
1045
|
+
end
|
|
1046
|
+
allowed = if max_positionals.zero?
|
|
1047
|
+
"no #{noun}s"
|
|
1048
|
+
else
|
|
1049
|
+
"at most #{count} #{max_positionals == 1 ? noun : "#{noun}s"}"
|
|
1050
|
+
end
|
|
1051
|
+
@stderr.puts "chi bundle #{sub} takes #{allowed} (unexpected #{extra.join(", ")})"
|
|
1052
|
+
return CLI::Exit::USAGE
|
|
1053
|
+
end
|
|
1039
1054
|
parsed
|
|
1040
1055
|
end
|
|
1041
1056
|
|
data/lib/samagotchi/compat.rb
CHANGED
|
@@ -18,11 +18,7 @@ module Samagotchi
|
|
|
18
18
|
Shim.new(id: :cards_v1_seed, added_in: "0.151.0", remove_after: "0.170.0",
|
|
19
19
|
files: ["lib/samagotchi/bridge/card_store.rb"],
|
|
20
20
|
what: "CardStore#seed_v1 reads a cards.json from before the turn log; its comment says a retention " \
|
|
21
|
-
"period after the release that wrote version 2 (0.151.0, 2026-11-05)")
|
|
22
|
-
Shim.new(id: :approvals_array_read, added_in: "0.166.0", remove_after: "0.167.0",
|
|
23
|
-
files: ["lib/samagotchi/guardrails/approvals.rb"],
|
|
24
|
-
what: "Approvals#parse reads approvals.json as the list 0.165 and before write, beside the versioned " \
|
|
25
|
-
"store, and #version_list rewrites it versioned on that first read")
|
|
21
|
+
"period after the release that wrote version 2 (0.151.0, 2026-11-05)")
|
|
26
22
|
].freeze
|
|
27
23
|
|
|
28
24
|
module_function
|
|
@@ -30,9 +30,8 @@ module Samagotchi
|
|
|
30
30
|
#
|
|
31
31
|
# The file is a versioned store, {"version", "approvals": [...]}
|
|
32
32
|
# (FORMAT); a write keeps its version and the keys this chi doesn't
|
|
33
|
-
# know. A list of entries (what 0.
|
|
34
|
-
#
|
|
35
|
-
# read (compat shim approvals_array_read).
|
|
33
|
+
# know. A bare list of entries (what 0.166 and before wrote) is not
|
|
34
|
+
# a versioned store: it is set aside like an unreadable file.
|
|
36
35
|
class Approvals
|
|
37
36
|
FILE = "approvals.json"
|
|
38
37
|
COLLECTION = "approvals"
|
|
@@ -168,12 +167,11 @@ module Samagotchi
|
|
|
168
167
|
|
|
169
168
|
# @param locked [Boolean] the caller holds the store's lock
|
|
170
169
|
# @return [Array(Array<Hash>, StateFormat::Document)] the entries and,
|
|
171
|
-
#
|
|
170
|
+
# its document (nil when there is no file)
|
|
172
171
|
def read(locked: false)
|
|
173
172
|
return [[], nil] unless File.exist?(@path)
|
|
174
173
|
|
|
175
|
-
|
|
176
|
-
document ? [list, document] : version_list(locked: locked) || [list, nil]
|
|
174
|
+
parse(File.read(@path))
|
|
177
175
|
rescue JSON::ParserError, SystemCallError => e
|
|
178
176
|
aside = begin
|
|
179
177
|
locked ? set_aside : with_lock { set_aside }
|
|
@@ -201,32 +199,10 @@ module Samagotchi
|
|
|
201
199
|
# An entry it can't read (no scope) is kept as it is: it matches
|
|
202
200
|
# nothing, and a write keeps it for the chi that wrote it.
|
|
203
201
|
[document.entries.map(&:raw).select { |e| e.is_a?(Hash) }, document]
|
|
204
|
-
|
|
205
|
-
when Array then [data.select { |e| e.is_a?(Hash) }, nil]
|
|
206
|
-
else raise JSON::ParserError, "not a list or a versioned store"
|
|
202
|
+
else raise JSON::ParserError, "not a versioned store"
|
|
207
203
|
end
|
|
208
204
|
end
|
|
209
205
|
|
|
210
|
-
# compat shim approvals_array_read: rewrite a list as the versioned
|
|
211
|
-
# store, under the lock, if it is still a list. One that can't be
|
|
212
|
-
# written (a read-only state dir) or changed meanwhile is read as it
|
|
213
|
-
# is this time.
|
|
214
|
-
# @return [Array(Array<Hash>, StateFormat::Document), nil] as #read's; nil when not rewritten
|
|
215
|
-
def version_list(locked:)
|
|
216
|
-
locked ? version_list! : with_lock { version_list! }
|
|
217
|
-
rescue JSON::ParserError, SystemCallError
|
|
218
|
-
nil
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
def version_list!
|
|
222
|
-
list, document = parse(File.read(@path))
|
|
223
|
-
return [list, document] if document
|
|
224
|
-
|
|
225
|
-
document = FORMAT.read({ COLLECTION => list }, collection: COLLECTION)
|
|
226
|
-
write(document)
|
|
227
|
-
[list, document]
|
|
228
|
-
end
|
|
229
|
-
|
|
230
206
|
def write(document)
|
|
231
207
|
AtomicFile.write(@path, JSON.pretty_generate(FORMAT.write(document, collection: COLLECTION, updated_at: nil)))
|
|
232
208
|
end
|
data/lib/samagotchi/version.rb
CHANGED
|
@@ -45,9 +45,11 @@ export function createDockReserve({
|
|
|
45
45
|
// A reader at the end stays there when the reserve changes: at once for the
|
|
46
46
|
// composer card, eased for the stage (+fromStage+: it appeared, grew or
|
|
47
47
|
// leaves), so the history glides rather than jumps. An eased follow running
|
|
48
|
-
// counts as at the end.
|
|
48
|
+
// counts as at the end. Not while the history is marked data-reading (a
|
|
49
|
+
// reason bubble read from its first line, stage_opened.js).
|
|
49
50
|
function updateReserve({ fromStage = false } = {}) {
|
|
50
|
-
const
|
|
51
|
+
const reading = historyEl.dataset.reading !== undefined;
|
|
52
|
+
const follow = !reading && (atHistoryEnd() || historyEl.dataset.following !== undefined);
|
|
51
53
|
const leaving = stageEl.classList.contains("leaving");
|
|
52
54
|
centerEl.classList.toggle("reserve-easing", leaving);
|
|
53
55
|
const reserve = `${dockReserve()}px`;
|
|
@@ -94,6 +96,14 @@ export function createDockReserve({
|
|
|
94
96
|
updateReserve({ fromStage: true });
|
|
95
97
|
}).observe(stageEl, { attributes: true, attributeFilter: ["class", "hidden"] });
|
|
96
98
|
win.addEventListener("resize", () => placeToast());
|
|
99
|
+
// The dock is on the history's column (index.html): a classic scrollbar
|
|
100
|
+
// (always shown) narrows the history's content box on the right, and the
|
|
101
|
+
// dock's right edge follows it (--history-sb, 0 with overlay scrollbars).
|
|
102
|
+
function scrollbarGutter() {
|
|
103
|
+
const sb = `${Math.max(0, historyEl.offsetWidth - historyEl.clientWidth)}px`;
|
|
104
|
+
if (centerEl.style.getPropertyValue("--history-sb") !== sb) centerEl.style.setProperty("--history-sb", sb);
|
|
105
|
+
}
|
|
106
|
+
new win.ResizeObserver(() => scrollbarGutter()).observe(historyEl);
|
|
97
107
|
// The model panel opening, closing or changing height (its list filters).
|
|
98
108
|
new win.ResizeObserver(() => placeToast()).observe(modelPanelEl);
|
|
99
109
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// The one way the stage moves a turn's pieces into the history
|
|
2
|
+
// (stage_view.js): to its end, in the order given (the hand-off's
|
|
3
|
+
// handOffOrder, or what a turn opened in the history sends there as it
|
|
4
|
+
// arrives). The original nodes move (their ref bindings, selection and late
|
|
5
|
+
// updates with them); the empty history's hint goes first. +animate+: each
|
|
6
|
+
// piece arrives with .ts-arrive (gone at its animationend).
|
|
7
|
+
export function moveToHistoryEnd(historyEl, pieces, { animate = false } = {}) {
|
|
8
|
+
historyEl.querySelector(":scope > .hint")?.remove();
|
|
9
|
+
for (const el of pieces) {
|
|
10
|
+
historyEl.appendChild(el);
|
|
11
|
+
if (animate) {
|
|
12
|
+
el.classList.add("ts-arrive");
|
|
13
|
+
el.addEventListener("animationend", () => el.classList.remove("ts-arrive"), { once: true });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -450,6 +450,28 @@ button.system-one-wrong,.system-one-wrong.marked{flex:none;padding:1px 6px;borde
|
|
|
450
450
|
selectable. */
|
|
451
451
|
.bubble.question>summary .question-said{max-width:72ch;margin:2px 0 1px 1.05em;font-size:12.5px;font-weight:400;line-height:1.5;color:var(--text-muted);white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
|
|
452
452
|
.bubble.question[open]>summary .question-said{display:none}
|
|
453
|
+
/* A turn opened in the history (stage_opened.js): while the turn runs, a card answered under its reason doesn't repeat it;
|
|
454
|
+
the reason goes at the hand-off and the card's clamp says it then. The card's way back to its reason sits at the right of its
|
|
455
|
+
title line while it waits. */
|
|
456
|
+
.bubble.said+.bubble.question :is(.question-said,.question-said-full){display:none}
|
|
457
|
+
/* Its asking step in the steps block doesn't repeat the reason either (stage_opened.js data-said, until the hand-off). */
|
|
458
|
+
.turn-work>details.gen[data-said]>.gen-text{display:none}
|
|
459
|
+
.question-reason-link{float:right;margin-left:12px;padding:0;border:0;background:none;color:var(--accent);font-size:12.5px;font-weight:500;line-height:inherit}
|
|
460
|
+
@media(hover:hover){.question-reason-link:hover:not(:disabled){filter:none;text-decoration:underline}}
|
|
461
|
+
/* The reply that asked the model's own question, a conversation bubble while its turn runs (live only): a label line ("chi ·
|
|
462
|
+
step N", "asking you" while its card waits), the text at the answer's size; the edge amber while it waits, neutral after. */
|
|
463
|
+
.bubble.said{border-left:3px solid var(--border-strong);font-size:15px;line-height:1.55;color:var(--text)}
|
|
464
|
+
.bubble.said.pending{border-left-color:var(--warn)}
|
|
465
|
+
.said-label{display:flex;gap:8px;margin-bottom:4px;font-size:12px;line-height:1.4;color:var(--text-faint);white-space:normal}
|
|
466
|
+
.said-asking{color:var(--warn-text);font-weight:600}
|
|
467
|
+
.bubble.said:not(.pending) .said-asking{display:none}
|
|
468
|
+
.said-text{white-space:pre-wrap;overflow-wrap:anywhere}
|
|
469
|
+
.said-text.md-compact{
|
|
470
|
+
--md-heading-size:16px;--md-heading-color:var(--text-bright);
|
|
471
|
+
--md-subheading-size:15px;--md-subheading-color:var(--text-2);
|
|
472
|
+
--md-strong-color:var(--text-bright);--md-blockquote-color:var(--text-muted);--md-code-color:var(--text);
|
|
473
|
+
--md-pre-size:13px;--md-cell-size:13.5px
|
|
474
|
+
}
|
|
453
475
|
.question-said-full{margin:4px 0 6px;font-size:13px;line-height:1.55;color:var(--text-muted);white-space:pre-wrap;overflow-wrap:anywhere}
|
|
454
476
|
.question-said-full.md-compact{
|
|
455
477
|
--md-heading-size:13.5px;--md-heading-color:var(--text-2);
|
|
@@ -469,7 +491,7 @@ button.system-one-wrong,.system-one-wrong.marked{flex:none;padding:1px 6px;borde
|
|
|
469
491
|
--md-strong-color:var(--text);--md-blockquote-color:var(--text-muted);--md-code-color:var(--text);
|
|
470
492
|
--md-pre-size:12.5px;--md-cell-size:13px
|
|
471
493
|
}
|
|
472
|
-
.md-compact:is(.ts-asking,.question-said-full,.gen-text){white-space:normal}
|
|
494
|
+
.md-compact:is(.ts-asking,.question-said-full,.gen-text,.said-text){white-space:normal}
|
|
473
495
|
.md-compact :is(h1,h2,h3,h4,h5,h6){font-size:var(--md-heading-size);font-weight:600;line-height:1.4;margin:8px 0 2px;color:var(--md-heading-color)}
|
|
474
496
|
.md-compact :is(h4,h5,h6){font-size:var(--md-subheading-size);color:var(--md-subheading-color)}
|
|
475
497
|
.md-compact :is(p,ul,ol,blockquote,table,pre){margin:0 0 6px}
|
|
@@ -682,8 +704,11 @@ body.has-session #center{background:color-mix(in srgb,var(--bg) 35%,transparent)
|
|
|
682
704
|
body.has-session #stage,body.has-session #history{background:transparent}
|
|
683
705
|
@media (prefers-reduced-transparency:reduce){body.has-session #center{background:var(--bg);border-color:var(--border)}}
|
|
684
706
|
body.no-glass.has-session #center{background:var(--bg);border-color:var(--border)}
|
|
685
|
-
/* --dock-bottom: the card's offset from the panel's bottom (16px; a phone's is below). stage_frame.js fitCap reads it.
|
|
686
|
-
|
|
707
|
+
/* --dock-bottom: the card's offset from the panel's bottom (16px; a phone's is below). stage_frame.js fitCap reads it.
|
|
708
|
+
Its sides are the history's column (#history's padding, both in #center): the stage and the composer are as wide as
|
|
709
|
+
the conversation, so a text moved from the stage into the history keeps its line breaks. A classic scrollbar on the
|
|
710
|
+
history narrows its column on the right: --history-sb (dock_reserve.js) moves the dock's right edge with it. */
|
|
711
|
+
body.has-session #dock{position:absolute;left:max(16px,calc((100% - 960px)/2));right:calc(max(16px,calc((100% - 960px)/2)) + var(--history-sb,0px));bottom:var(--dock-bottom,16px);margin:0;z-index:3}
|
|
687
712
|
body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 16px + var(--dock-bottom,16px))}
|
|
688
713
|
/* A phone's session panel runs edge to edge: its sides, corners and bottom line go (main's 16px side padding is taken
|
|
689
714
|
back), so only the message cards are framed and an answer gets the width. The history, the objectives' strip and the
|
|
@@ -695,7 +720,7 @@ body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 16px + var(-
|
|
|
695
720
|
body.has-session #center{margin:0 -16px;border-width:1px 0 0;border-radius:0}
|
|
696
721
|
body.has-session #history{padding-left:8px;padding-right:8px}
|
|
697
722
|
body.has-session #objectivesStrip{padding-left:8px;padding-right:8px}
|
|
698
|
-
body.has-session #dock{left:8px;right:8px}
|
|
723
|
+
body.has-session #dock{left:8px;right:calc(8px + var(--history-sb,0px))}
|
|
699
724
|
}
|
|
700
725
|
/* The delivery line (delivery_line.js): above a phone's width, a session's row above the text field, always there so the composer never changes height: the key hint while idle; while a turn runs, where a message typed now goes in, then the cut and queue links. One quiet row, ellipsised. A phone has no such row (its composer is shorter, and as steady): while a turn runs the line, its short text and chips, lies over the session bar's left, where status, ctx and speed are (hidden while it shows), up to ⚙, only while you type or have a choice armed (below). */
|
|
701
726
|
#deliveryLine{display:flex;align-items:center;gap:10px}
|
|
@@ -879,10 +904,16 @@ body.stage-view .turn-stage{position:absolute;left:0;right:0;bottom:100%;margin-
|
|
|
879
904
|
text, then its markdown when web.markdown is on (.markdown, stage_slots.js drawAsking); capped so the card keeps
|
|
880
905
|
its room, read from the top. */
|
|
881
906
|
.ts-asking{max-height:calc(var(--stage-max,60vh) * .35);overflow:auto;scrollbar-width:thin;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.55;color:var(--narr);border-left:2px solid var(--border-strong);padding-left:10px}
|
|
882
|
-
/* The
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
.turn-stage.
|
|
907
|
+
/* The asking form (stage_view.js, a turn opened in the history while the model's own question waits): its reply is a
|
|
908
|
+
bubble in the conversation (.bubble.said), the stage shows the status row and the card alone; the prompt, the live
|
|
909
|
+
slots (the working set's rail with them) and the steps chip come back with the working form after the answer. */
|
|
910
|
+
.turn-stage.asking-form :is(.ts-prompt,.ts-live,.ts-foot){display:none}
|
|
911
|
+
/* It is one box (the mock-up's option A): the stage's frame takes the card's look (the card's tint, no glass; its amber edge
|
|
912
|
+
is the waiting phase's), the status row is the box's first line, and the card inside drops its own box, so there is no
|
|
913
|
+
box in a box and no second amber edge. */
|
|
914
|
+
.turn-stage.asking-form{background:color-mix(in srgb,var(--warn) 7%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none;border-radius:12px}
|
|
915
|
+
.turn-stage.asking-form .ts-scroll{padding-top:6px}
|
|
916
|
+
.turn-stage.asking-form .ts-extras>.bubble.question{border:0;border-radius:0;background:transparent;padding:0}
|
|
886
917
|
.turn-stage.asking .ts-headline{display:none}
|
|
887
918
|
@keyframes ts-fade{from{opacity:.35}}
|
|
888
919
|
.ts-now{height:var(--ts-now-h);display:flex;align-items:center;gap:8px;min-width:0;padding:0 9px;border-radius:8px;background:var(--accent-tint);font-size:13px}
|
|
@@ -952,11 +983,6 @@ body.stage-view .turn-stage{position:absolute;left:0;right:0;bottom:100%;margin-
|
|
|
952
983
|
/* The cloud: one chip (steps, calls, a tick per call), the turn block behind it. */
|
|
953
984
|
/* The footer: the chip at the stage's bottom edge (the cloud's steps open above it, the scroller's last slot). */
|
|
954
985
|
.ts-foot{position:relative;flex:none;padding:0 14px 10px}
|
|
955
|
-
/* The question room's jump pill (stage_view.js drawPill): at the scroller's bottom edge, above the chip, while the waiting
|
|
956
|
-
card is out of the stage's view; absolute, so the frame never counts it. */
|
|
957
|
-
.ts-room-pill{position:absolute;bottom:100%;right:14px;margin-bottom:6px;padding:4px 11px;border:1px solid var(--warn-border);border-radius:999px;background:var(--warn-bg);color:var(--warn-text);font-size:12.5px;font-weight:600;line-height:1.4;white-space:nowrap;box-shadow:0 2px 8px var(--shadow-strong);animation:ts-fade .2s ease}
|
|
958
|
-
@media(hover:hover){.ts-room-pill:hover:not(:disabled){filter:none;color:var(--warn-bright);border-color:var(--warn);background:var(--warn-bg)}}
|
|
959
|
-
.ts-room-pill[hidden]{display:none}
|
|
960
986
|
/* Below the turn's card: the lines queued for after it (each a turn of its own), apart from the turn by a dashed rule. */
|
|
961
987
|
.ts-queued{flex:none;display:flex;flex-direction:column;gap:6px;padding:8px 14px 10px;border-top:1px dashed var(--border-strong);max-height:calc(var(--stage-max,60vh) * .3);overflow:auto;scrollbar-width:thin}
|
|
962
988
|
.ts-queued:empty{display:none}
|
|
@@ -95,7 +95,7 @@ export function createQuestionCards({
|
|
|
95
95
|
const card = doc.createElement("details");
|
|
96
96
|
card.className = approval ? "bubble question approval" : stepLimit ? "bubble question step-limit" : "bubble question";
|
|
97
97
|
card.dataset.qid = pq.id;
|
|
98
|
-
// What asks (
|
|
98
|
+
// What asks (a model's own question opens its turn in the history,
|
|
99
99
|
// stage_view.js): the kind, and a delegate's question relayed here.
|
|
100
100
|
card.dataset.kind = pq.kind || "question";
|
|
101
101
|
if (relayView(pq)) card.dataset.relay = "1";
|
|
@@ -381,8 +381,11 @@ export function turnRowFor(target) {
|
|
|
381
381
|
// history). null when there is none.
|
|
382
382
|
function turnBlockOf(el) {
|
|
383
383
|
const own = el.closest(".turn-work, .turn-stage");
|
|
384
|
-
if (own) return own;
|
|
385
384
|
const doc = el.ownerDocument;
|
|
385
|
+
// A turn opened in the history (stage_view.js): its block is the
|
|
386
|
+
// history's last one, the stage's rows are that turn's.
|
|
387
|
+
if (own?.dataset.block === "history") return [...doc.querySelectorAll("#history .turn-work")].at(-1) || null;
|
|
388
|
+
if (own) return own;
|
|
386
389
|
const block = [...doc.querySelectorAll(".turn-work")].filter((b) => precedes(b, el)).at(-1);
|
|
387
390
|
if (!block) return null;
|
|
388
391
|
const prompt = [...doc.querySelectorAll(".bubble.user")].some((u) => precedes(block, u) && precedes(u, el));
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
// fallback, data-undrawn): 0 unless chi web missed one. Fire-and-forget: no toast, no
|
|
14
14
|
// store write, a failure is dropped.
|
|
15
15
|
//
|
|
16
|
-
// Cards are left out on both sides: a reload
|
|
17
|
-
// (CardStore's stamps
|
|
18
|
-
//
|
|
16
|
+
// Cards and answered question cards are left out on both sides: a reload
|
|
17
|
+
// places them after the render (CardStore's stamps and the snapshot's
|
|
18
|
+
// questions, cards_place.js placeResolvedQuestion), which the offscreen
|
|
19
|
+
// render doesn't run; the e2e reload checks compare them.
|
|
19
20
|
import { compareShapes, historyShape } from "./history_shape.js";
|
|
20
21
|
import { turnElements } from "./turn_range.js";
|
|
21
22
|
|
|
@@ -29,7 +30,7 @@ function openingId(el) {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
function withoutCards(shape) {
|
|
32
|
-
return shape.filter((item) => item.kind !== "card");
|
|
33
|
+
return shape.filter((item) => item.kind !== "card" && item.kind !== "question");
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// @param enabled () => whether the check is on (the body's attribute)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// The cards that wait in the stage (stage_view.js, stage_model.js
|
|
2
|
+
// placeKind): what blocks the turn or asks the user stays in the stage
|
|
3
|
+
// whatever the turn's form, also when the turn is opened in the history
|
|
4
|
+
// (stage_opened.js).
|
|
5
|
+
|
|
6
|
+
// A card that waits for the user: a question or approval not answered, a
|
|
7
|
+
// continue offer not resolved.
|
|
8
|
+
export const PENDING = ".bubble.question:not(.answered):not(.cancelled), .bubble.continue:not(.resolved)";
|
|
9
|
+
// A running turn's card with actions (check-in's Nudge / Keep going / Stop)
|
|
10
|
+
// asks the user too, but the turn goes on: it waits only while the turn runs
|
|
11
|
+
// and never holds the hand-off (a turn cut short can leave it open).
|
|
12
|
+
export const ASKS = ".plugin-card[data-in-turn] .card-action";
|
|
13
|
+
// A plugin's warning stays in sight in the stage until the turn's end.
|
|
14
|
+
export const WARN_CARD = ".plugin-card.warn";
|
|
15
|
+
|
|
16
|
+
// +el+ waits in the stage: a pending card, an asking card's actions, a
|
|
17
|
+
// plugin's warning.
|
|
18
|
+
export function waitsInStage(el) {
|
|
19
|
+
return !!(el?.matches?.(PENDING) || el?.querySelector?.(ASKS) || el?.matches?.(WARN_CARD));
|
|
20
|
+
}
|