pi-roundtable-web 0.26.2 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +34 -12
- package/dist/chunk-account-1ecx5kt7.js +1 -0
- package/dist/chunk-action-menu-zh2n0ahf.js +1 -0
- package/dist/chunk-agent-ynm2tcbx.js +1 -0
- package/dist/chunk-arranged-rooms-qnz8vese.js +1 -0
- package/dist/chunk-bulk-actions-pr0mw0kc.js +1 -0
- package/dist/chunk-character-creator-caj4pmg4.js +1 -0
- package/dist/{chunk-codeeditor-jm2sm333.js → chunk-codeeditor-dga6s78p.js} +2 -2
- package/dist/chunk-confirm-g76v5d9r.js +1 -0
- package/dist/{chunk-connectors-mhnw6d79.js → chunk-connectors-j79ze3j1.js} +1 -1
- package/dist/{chunk-conversations-yjyq4g1y.js → chunk-conversations-2farn72g.js} +1 -1
- package/dist/chunk-council-sheet-s9sz1bzf.js +2 -0
- package/dist/{chunk-drag-nyq52ck7.js → chunk-drag-45e8222r.js} +1 -1
- package/dist/chunk-entry-q11n47h9.js +1 -0
- package/dist/chunk-folder-list-4gcj7g7h.js +1 -0
- package/dist/chunk-folds-ten4ykfw.js +1 -0
- package/dist/chunk-gate-kcv1a4t0.js +1 -0
- package/dist/chunk-group-scene-12ghcvzd.js +1 -0
- package/dist/chunk-group-table-t458kdgn.js +1 -0
- package/dist/chunk-host-icons-h1k9k96a.js +1 -0
- package/dist/chunk-host-picture-3p0wzn3v.js +1 -0
- package/dist/chunk-host-state-7mdve7cb.js +1 -0
- package/dist/chunk-host-ui-bdgwa6sf.js +1 -0
- package/dist/chunk-index-02vfshtt.js +2 -0
- package/dist/{chunk-index-31ays46f.js → chunk-index-0a81da8z.js} +2 -2
- package/dist/{chunk-index-y00wke93.js → chunk-index-0w4bfjb5.js} +2 -2
- package/dist/chunk-index-12zyshae.js +2 -0
- package/dist/chunk-index-18pgxxw3.js +2 -0
- package/dist/chunk-index-2e4am3hw.js +50 -0
- package/dist/{chunk-index-1f0j335v.js → chunk-index-2fdns8tn.js} +2 -2
- package/dist/{chunk-index-934zgd18.js → chunk-index-2t30xwed.js} +2 -2
- package/dist/{chunk-index-cmxs5y22.js → chunk-index-31x6krbs.js} +3 -3
- package/dist/{chunk-index-b7jjca66.js → chunk-index-3d8s3565.js} +2 -2
- package/dist/chunk-index-5bfqek1d.js +2 -0
- package/dist/chunk-index-64rsz6pf.js +2 -0
- package/dist/chunk-index-6bkcq9ka.js +2 -0
- package/dist/{chunk-index-9nents16.js → chunk-index-8d81qy69.js} +2 -2
- package/dist/chunk-index-92zgb7my.js +2 -0
- package/dist/chunk-index-aamhjg5n.js +2 -0
- package/dist/{chunk-index-ewj52be9.js → chunk-index-ac1ktr56.js} +2 -2
- package/dist/{chunk-index-6tpr6r6d.js → chunk-index-ak6ecqy3.js} +2 -2
- package/dist/{chunk-index-yrhbhmxz.js → chunk-index-b73y2gc0.js} +2 -2
- package/dist/chunk-index-b8cpvr7y.js +2 -0
- package/dist/{chunk-index-tmx30r1w.js → chunk-index-bhqczxr3.js} +2 -2
- package/dist/{chunk-index-0xj30mzw.js → chunk-index-cbqhzf40.js} +12 -12
- package/dist/chunk-index-cdctnw71.js +2 -0
- package/dist/chunk-index-dj0tbfyb.js +2 -0
- package/dist/chunk-index-dnjftvtq.js +2 -0
- package/dist/chunk-index-e2dqjde8.js +1 -0
- package/dist/{chunk-index-frwa2fmc.js → chunk-index-ebg48jgy.js} +2 -2
- package/dist/{chunk-index-smw1n2pt.js → chunk-index-ek5mek4j.js} +5 -5
- package/dist/chunk-index-f6q0stqx.js +2 -0
- package/dist/{chunk-index-kw85ajap.js → chunk-index-ffbrm6tr.js} +3 -3
- package/dist/chunk-index-g1awv7rk.js +2 -0
- package/dist/chunk-index-g3wrs02w.js +1 -0
- package/dist/chunk-index-j0m16cj1.js +2 -0
- package/dist/chunk-index-j4kk1m59.js +2 -0
- package/dist/chunk-index-j4x9dq30.css +1 -0
- package/dist/{chunk-index-7bbqtdce.js → chunk-index-jgzygbt8.js} +2 -2
- package/dist/chunk-index-kb3w11mn.js +7 -0
- package/dist/chunk-index-kbrg32sx.js +2 -0
- package/dist/chunk-index-msqhgvfx.js +2 -0
- package/dist/chunk-index-pefwfm26.js +2 -0
- package/dist/chunk-index-pyfx77cj.js +2 -0
- package/dist/{chunk-index-kfv996qe.js → chunk-index-q7g62sgm.js} +35 -3
- package/dist/chunk-index-qfgkfq86.js +2 -0
- package/dist/chunk-index-rh0x9rzf.js +2 -0
- package/dist/{chunk-index-029209sy.js → chunk-index-sm7m4fej.js} +2 -2
- package/dist/chunk-index-sv9qpmhv.js +1 -0
- package/dist/chunk-index-t998yg8y.js +2 -0
- package/dist/chunk-index-tk4se135.js +4 -0
- package/dist/chunk-index-v6smgw77.js +2 -0
- package/dist/chunk-index-w42rcbx1.js +2 -0
- package/dist/chunk-index-x4enmj72.js +2 -0
- package/dist/chunk-index-xq84gg8w.js +2 -0
- package/dist/{chunk-index-f3b5nch2.js → chunk-index-xxeb2xp0.js} +3 -3
- package/dist/{chunk-index-0n6ja7my.js → chunk-index-zyvwhxga.js} +1 -1
- package/dist/chunk-lang-css-y9133ktr.js +1 -0
- package/dist/{chunk-lang-dockerfile-46rk929v.js → chunk-lang-dockerfile-cnwqn660.js} +1 -1
- package/dist/{chunk-lang-go-qb0qdpg7.js → chunk-lang-go-yy6kgsxv.js} +3 -3
- package/dist/chunk-lang-html-r2xmryek.js +1 -0
- package/dist/chunk-lang-javascript-1r6wd177.js +1 -0
- package/dist/{chunk-lang-json-1q4fp694.js → chunk-lang-json-dx56g11y.js} +1 -1
- package/dist/{chunk-lang-markdown-5w7t28wa.js → chunk-lang-markdown-fpcf2dfq.js} +5 -5
- package/dist/{chunk-lang-python-3dq0p4rf.js → chunk-lang-python-zzp95955.js} +2 -2
- package/dist/{chunk-lang-rust-70pa0agr.js → chunk-lang-rust-214fh7sp.js} +1 -1
- package/dist/{chunk-lang-shell-4pxt7hf4.js → chunk-lang-shell-1rpgtepw.js} +1 -1
- package/dist/{chunk-lang-sql-kgcbh2a9.js → chunk-lang-sql-vvp46hpj.js} +2 -2
- package/dist/{chunk-lang-toml-99t95pab.js → chunk-lang-toml-tbj7467c.js} +1 -1
- package/dist/chunk-lang-typescript-y5w4tt4g.js +1 -0
- package/dist/{chunk-lang-xml-mnbv9yfa.js → chunk-lang-xml-tbcqmedk.js} +1 -1
- package/dist/{chunk-lang-yaml-2by9g1dy.js → chunk-lang-yaml-jh56t3sv.js} +1 -1
- package/dist/chunk-layout-actions-y73mpsh1.js +1 -0
- package/dist/chunk-menu-items-bza16bw6.js +2 -0
- package/dist/chunk-mode-toggle-nj9gnt3b.js +1 -0
- package/dist/chunk-note-row-6fmhrdng.js +75 -0
- package/dist/chunk-notes-wv0e6ssf.js +1 -0
- package/dist/chunk-notice-bell-9z27epd2.js +1 -0
- package/dist/{chunk-notices-evny44be.js → chunk-notices-fte9f196.js} +1 -1
- package/dist/chunk-onboarding-c5twahc3.js +1 -0
- package/dist/{chunk-overview-42h45ehd.js → chunk-overview-k4ccprax.js} +1 -1
- package/dist/chunk-palette-9rbp2fab.js +1 -0
- package/dist/chunk-placement-items-me598wsb.js +1 -0
- package/dist/{chunk-profile-bqcgkgk4.js → chunk-profile-s7r7fcvz.js} +1 -1
- package/dist/chunk-prompt-history-hf296e7v.js +1 -0
- package/dist/chunk-prompts-c8s0nhkm.js +1 -0
- package/dist/chunk-room-confirms-ga2sbvhc.js +1 -0
- package/dist/chunk-room-menu-7h4jym2b.js +1 -0
- package/dist/chunk-rooms-menu-button-pgtaanb6.js +1 -0
- package/dist/chunk-schedules-mbnwcxpc.js +1 -0
- package/dist/{chunk-seat-menu-ca5p4e9q.js → chunk-seat-menu-r0k0eawr.js} +1 -1
- package/dist/chunk-sheet-hosts-a5dfevy9.js +1 -0
- package/dist/chunk-shortcut-help-a6pkjcq7.js +26 -0
- package/dist/chunk-shortcuts-cgt87jkz.js +1 -0
- package/dist/chunk-skill-editor-67yk4x7t.js +8 -0
- package/dist/chunk-skills-rewemey4.js +1 -0
- package/dist/chunk-switcher-list-t8rbay2y.js +1 -0
- package/dist/{chunk-tab-dot-4tkpxqeh.js → chunk-tab-dot-vr11dfrw.js} +1 -1
- package/dist/chunk-table-52nh0azk.js +1 -0
- package/dist/chunk-table2d-g57vr6h0.js +1 -0
- package/dist/chunk-table3d-rp0w6kt4.js +4220 -0
- package/dist/chunk-thread-actions-qcxt1y1g.js +1 -0
- package/dist/chunk-thread-cards-c2mrp2gj.js +1 -0
- package/dist/chunk-thread-list-0071q455.js +217 -0
- package/dist/chunk-transcript-789yqysq.js +1 -0
- package/dist/chunk-where-hmwmme9e.js +1 -0
- package/dist/{chunk-workspace-h0p32ygy.js → chunk-workspace-wr1qrtsh.js} +2 -2
- package/dist/chunk-zh-tw-z5p5mpph.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/api-types.ts +73 -0
- package/src/app/app.ts +38 -4
- package/src/app/helper-routes.ts +106 -0
- package/src/app/rooms.ts +18 -3
- package/src/app/routes.ts +125 -2
- package/src/app/surface.ts +18 -1
- package/src/app/team-routes.ts +21 -1
- package/src/app/threads.ts +11 -0
- package/src/host/host-app.ts +15 -1
- package/src/host/read-all.ts +80 -0
- package/src/host/reads.ts +67 -0
- package/src/i18n/zh-tw.ts +64 -13
- package/dist/chunk-account-nhpd9j90.js +0 -1
- package/dist/chunk-action-menu-ec9jqtxq.js +0 -1
- package/dist/chunk-agent-d1xfrawq.js +0 -1
- package/dist/chunk-arranged-rooms-bga8yk2v.js +0 -1
- package/dist/chunk-character-creator-k67f77w5.js +0 -1
- package/dist/chunk-confirm-wc5xraev.js +0 -1
- package/dist/chunk-entry-red1597w.js +0 -1
- package/dist/chunk-folder-list-x56y26yq.js +0 -1
- package/dist/chunk-folds-3p7s2nvx.js +0 -1
- package/dist/chunk-gate-h41bv4y9.js +0 -1
- package/dist/chunk-group-scene-7eb6jyev.js +0 -1
- package/dist/chunk-group-table-rca48kt0.js +0 -1
- package/dist/chunk-host-icons-x318gjqp.js +0 -1
- package/dist/chunk-host-picture-xswcakgy.js +0 -1
- package/dist/chunk-host-state-bpahvk54.js +0 -1
- package/dist/chunk-host-ui-tsbwwk38.js +0 -1
- package/dist/chunk-index-066vzexw.js +0 -2
- package/dist/chunk-index-0h4h76kw.js +0 -2
- package/dist/chunk-index-2f5nfekb.js +0 -8
- package/dist/chunk-index-43k1rjmx.js +0 -2
- package/dist/chunk-index-4gk88a0x.js +0 -4
- package/dist/chunk-index-4jf4jvfd.css +0 -1
- package/dist/chunk-index-4mf29sbx.js +0 -2
- package/dist/chunk-index-51n20yhb.js +0 -2
- package/dist/chunk-index-84v7j6vh.js +0 -50
- package/dist/chunk-index-8f9jer8r.js +0 -2
- package/dist/chunk-index-91z3g774.js +0 -1
- package/dist/chunk-index-9w0sar6s.js +0 -2
- package/dist/chunk-index-a768zmp6.js +0 -2
- package/dist/chunk-index-c5x70d9g.js +0 -2
- package/dist/chunk-index-cwc1vvpw.js +0 -2
- package/dist/chunk-index-d85x96q0.js +0 -2
- package/dist/chunk-index-datrrs6b.js +0 -2
- package/dist/chunk-index-dep2e3f3.js +0 -2
- package/dist/chunk-index-dtste2ed.js +0 -2
- package/dist/chunk-index-grkczq2c.js +0 -2
- package/dist/chunk-index-gzvkpe3e.js +0 -2
- package/dist/chunk-index-satam151.js +0 -2
- package/dist/chunk-index-th43f690.js +0 -2
- package/dist/chunk-index-ths2hxpe.js +0 -1
- package/dist/chunk-index-y4sqmenv.js +0 -2
- package/dist/chunk-index-zd76pr2k.js +0 -2
- package/dist/chunk-lang-css-fa7c0zfj.js +0 -1
- package/dist/chunk-lang-html-47mf2y0v.js +0 -1
- package/dist/chunk-lang-javascript-d32qrvxz.js +0 -1
- package/dist/chunk-lang-typescript-4k1d8z7s.js +0 -1
- package/dist/chunk-layout-actions-cgghzj1w.js +0 -1
- package/dist/chunk-menu-items-24cfwawa.js +0 -2
- package/dist/chunk-mode-toggle-v4baz3r1.js +0 -1
- package/dist/chunk-note-row-72n6cqyk.js +0 -75
- package/dist/chunk-notes-83s3tsey.js +0 -1
- package/dist/chunk-notice-bell-a4ty5h1p.js +0 -1
- package/dist/chunk-onboarding-q1avjbrx.js +0 -1
- package/dist/chunk-palette-e44qepmh.js +0 -1
- package/dist/chunk-placement-items-v466t0sv.js +0 -1
- package/dist/chunk-prompt-history-hgbtcn4b.js +0 -1
- package/dist/chunk-prompts-czs8y6r1.js +0 -1
- package/dist/chunk-room-confirms-h8cdj3ng.js +0 -1
- package/dist/chunk-room-menu-7s0feajw.js +0 -1
- package/dist/chunk-rooms-menu-button-gawqvpsr.js +0 -1
- package/dist/chunk-schedules-zba7krac.js +0 -1
- package/dist/chunk-sheet-hosts-ssbz6hf2.js +0 -1
- package/dist/chunk-skill-editor-n0y9pd90.js +0 -8
- package/dist/chunk-skills-ea4vb2s4.js +0 -1
- package/dist/chunk-switcher-list-pj5csqr9.js +0 -1
- package/dist/chunk-table-j8nmtdnn.js +0 -1
- package/dist/chunk-table-seats-qeytqe0m.js +0 -1
- package/dist/chunk-table2d-18y029k9.js +0 -1
- package/dist/chunk-table3d-q2s31ae0.js +0 -4220
- package/dist/chunk-thread-actions-w3eadnh7.js +0 -1
- package/dist/chunk-thread-cards-fbpky3c9.js +0 -1
- package/dist/chunk-thread-list-pghe84be.js +0 -1
- package/dist/chunk-transcript-eqzxgqys.js +0 -1
- package/dist/chunk-where-ygyr4jdj.js +0 -1
- package/dist/chunk-zh-tw-k6xx1hp2.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,48 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.27.0] - 2026-10-31
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Temp knights in the owner app. A knight's temp knights (see the core changelog) hang under it in the room list, in the plain and the arranged list alike, each with a small face, its name and a state: a pulsing dot while it works, the card badge while it waits for you, and a dimmed "Ended" with the time once finished. They follow the knight's pin and folder and have no drag handle; the group of them is unfolded while one is at work and folded when all have ended, per device. `RoomView.helper` (`{ parent, parentName, finished? }`) marks them, on the agent view and the profile too; the round table, the council tick list, the group editor and the switcher leave them out, and their push is held back by default since their answers reach the knight's room (a card still pushes).
|
|
13
|
+
- **Clear finished temp knights** in the room list's menu, a folder's menu and a knight's menu, left out when nothing has ended. It archives at once, with no confirmation, through `POST api/rooms/archive-finished-helpers` (`{ rooms? }`, owner only), and the notice's Undo calls `POST api/rooms/restore-helpers` (`{ names }`) with exactly the names that were archived. A temp knight's own menu has **Archive this temp knight** the same way, and its room header reads "Temp knight · Made by <knight>" with a link to the knight. When a knight clears its own with `helper_end`, its room shows a line naming them with an Undo. The archive page lists each temp knight right after its knight.
|
|
14
|
+
- The round table is a council. The owners' table shows one agent group with its members (2 to 8) at the podiums and the group's room in the dialogue box, so a message sent there starts a round under the group's rules; there is no second store. A header chip (**Council: <name> ▾**) opens the council sheet: the saved councils (the groups), a tick list of the knights with a counter (**3 of 8 picked**; the ninth tick is refused), **Done** to save the ticks into the council on the table in place, and **Save as a new council** to make another group (which opens its Discord channel like every group). `#/table/<group>` is the council; without an address the table shows the council this device chose last, or the first group. With no group yet the table says *No council yet* and the sheet starts from the knights that were not muted. `FIXTURE_COUNCIL` sizes the fixture's group.
|
|
15
|
+
- A seat's menu (long press, right click, Menu key) has **Private chat** and **Remove from the council** (it saves the group without the knight; the last two members cannot be removed, the council is offered for archiving).
|
|
16
|
+
- Turn-taking in a group round. A `round` frame (and `RoomView.round` for a page that opens mid-round) tells who speaks, who is next, who has spoken, the reply count out of 8 and how the round ended. An **order strip** on top of the group's dialogue box shows the faces in that order (spoken dimmed with a check, the speaker larger, next numbered) with a chip (*Reply 3 of 8*, *Limit reached*, *Round stopped*), and says when your message waits for the next round; while it runs the seats wear the same check or ① to ⑧ before their names (`TableHandle.setMark`), the seat the round names speaks, and the camera turns to the speaker as its turn starts. The same strip is in a group room's table view.
|
|
17
|
+
- A hosted table (a member or an admin) has an **All rooms** button in the header that opens the room list.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- The core peer range moves to `>=0.27.0 <0.28.0`.
|
|
22
|
+
- Stop in a group room ends the whole round (see the core changelog), and its button reads **Stop the round**.
|
|
23
|
+
- A group holds 2 to 8 members (it was 2 to 6), on the web and on Discord. A round still holds at most 8 replies.
|
|
24
|
+
- A tap on a seat turns the camera to that knight and no longer opens the knight's room; the address stays as it was. Hold the seat for the private chat.
|
|
25
|
+
- Mute only stops push. It no longer takes a knight off the table: who sits is the council's members. Owners who used mute to thin out the table see their first group, or the empty state, after this change.
|
|
26
|
+
- The table seats at most 8 and never shows a "+N" podium, on the owners' table and on a hosted one (the hosted table seats the 8 newest rooms; the rest are in the room list).
|
|
27
|
+
- The owners' table no longer seats host rooms (a support desk's tickets, say); they are in the room list and the notices. A hosted table is unchanged otherwise.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- The **Who's at the table** sheet and the seat menu's **Leave the table**.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- `pi-roundtable-web`: the owner app's small visual faults from the 0.26.2 pass. A popover opened near the window's right edge (the ⋯ menu on a finished thread card) is placed by its own width and keeps the edge's 8px margin, where it used to be measured while squeezed against the edge and sat about 4px from it. A thread card's time moved to its status row, so a long title keeps the whole row above it and no longer truncates beside "1 minute ago" on a phone. A thread named inside a message (the "Started …" line a dispatch posts) is a plain inline link again: it had taken the thread card's block layout, which cut the sentence into fragments in the round table's dialogue box; the box also keeps the newest words of a long line in view while it is typed out, until the person scrolls up. At phone widths every text input, textarea and select is 16px or larger, including the controls inside a label and the full-screen prompt and SKILL.md editor, so iOS no longer zooms in on focus; a test reads the page's styles and fails on any rule that sets a text control smaller.
|
|
36
|
+
|
|
37
|
+
## [0.26.3] - 2026-10-30
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **Mark all as read.** The room list's menu and each folder's menu have **Mark all as read**, left out when nothing in its scope is unread (a folder's scope is its rooms and the threads under them). It sets the person's read cursor to the newest message in every room they may read, agent, group, thread and host rooms, in one call: `POST api/rooms/read-all` with `{ "rooms": [...] }` (at most 500; left out, every room the list shows), owners only, with rooms the person may not read passed over. The unread badges, the tab title's count and the tab icon's dot clear at once, the person's other pages and devices hear of it through the `read` frames a single read sends and a `changed` frame, and a notice offers Undo for five seconds: `{ "restore": [...] }` to the same route puts each cursor back unless the person has read on since. Nothing asks first
|
|
42
|
+
- **Clear all finished threads.** The same two menus have **Clear all finished threads**, which hides every finished dispatch thread under every room of the list, or under the folder's rooms, in one call: `POST api/rooms/dismiss-finished-threads` with `{ "rooms": [...] }`, owners only, open threads never touched. The answer names the threads cleared by room, and the notice's Undo puts exactly those back through `undismiss-threads`
|
|
43
|
+
- Keyboard shortcuts in the owner app. Alt+↑ / Alt+↓ (Option on a Mac) go to the previous or next room in the order the room list shows (folders respected, a folded folder skipped unless it holds the open room, threads after their room, no wrapping), and Alt+Shift+↑ / Alt+Shift+↓ to the previous or next room with unread messages. Switching uses the router as a click does and scrolls the open room's row into view; it works on a page with no list too. In a text field the arrows act only when the field is empty or the caret is at the very start (up) or very end (down) with nothing selected, and nothing acts while an input method composes. Esc closes the topmost menu or sheet and otherwise lets go of the message box without touching its text. `?` outside a text field opens a sheet that lists the keys (a lazy chunk; en and zh-TW wording). Ctrl/⌘ K, which opens the search, now also ignores an input method's composition. The handler is a part that loads after the first paint, about 0.1 KB gzipped more in the first load.
|
|
44
|
+
- A message nobody has seen yet wears an unread frame: a soft ring and glow in the accent colour, uniform on every side (no thick or one-sided border), in the modern and camelot looks, light and dark. It marks the messages past the person's read marker as the room opened, and those that arrive while the tab is hidden or the log is scrolled away from its end, in agent, group, thread and host rooms. The person's own messages, lines the server wrote, internal notes and a message that arrives while they are watching the end of the log do not get one. Passing a pointer over a message, focusing it with the keyboard, or tapping it clears its frame, each message on its own; on a touch screen a frame also clears once the message has stood at least half in view (or half of the screen, for a long one) for one and a half seconds, through one IntersectionObserver. It is only a look: what the server counts as read, the read API and the "New messages" divider are unchanged, a cleared frame stays cleared until the page is reloaded, and `prefers-reduced-motion: reduce` removes it without the fade. The code and its styles load with the read marks (the lazy host chunk), not with the first page.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- Clearing finished dispatch threads no longer asks first, however many there are: **Clear finished** in a room's list of threads and the new menu items clear at once, and the notice's Undo is the way back
|
|
49
|
+
|
|
8
50
|
## [0.26.2] - 2026-10-30
|
|
9
51
|
|
|
10
52
|
### Added
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Then only a person whose principal holds the owner role gets in.
|
|
|
30
30
|
|
|
31
31
|
## Requirements
|
|
32
32
|
|
|
33
|
-
- Bun 1.4.4 or later, and pi-roundtable `>=0.
|
|
33
|
+
- Bun 1.4.4 or later, and pi-roundtable `>=0.27.0 <0.28.0` as a peer dependency.
|
|
34
34
|
- The host must run on the machine that holds its data directory: the console reads `<dataDir>/sessions` from disk, and the app keeps its files and keys under `<dataDir>/web/`.
|
|
35
35
|
- An agent team: `agents` in the configuration, with or without `discord`. Without Discord the host also needs a surface that hosts rooms, and this plugin is one; the start fails otherwise, naming the fix.
|
|
36
36
|
- A way to authenticate the owners (see [Authentication](#authentication)): a password, Cloudflare Access or a verifier of your own in front of the listener, or `none` on a listener only the owner reaches.
|
|
@@ -149,7 +149,15 @@ The app hosts the core's dispatch threads (`ChatSurface.threads`). A background
|
|
|
149
149
|
|
|
150
150
|
A thread's room is read only: a `send` to it is refused with `read_only`, and it has no modes. Its cards are the dispatch's own, such as a coding job's approvals, and any owner answers them there as in any room. Agents post in it under their own names. A closed thread stays readable (the list keeps the 30 newest closed ones), and the host closes the threads a restart left open, with a restart notice. `GET api/rooms` lists a thread with `parent` and, once closed, `closed: true`; opening and closing one sends `changed`.
|
|
151
151
|
|
|
152
|
-
Each thread is a card in that list: its title, its room's knight, a badge (in progress or finished), the time of its last post and its unread count. A going-on thread wears its knight's tint and a finished one rests. An owner clears a finished thread off the list by swiping its card to the right (the card slides out, the list closes the gap, and a notice offers Undo for five seconds), by pressing the menu button on the card, by holding it or right-clicking it (**Clear this thread**, **Clear all finished**), or with Delete on a focused card; **Clear finished** in the header of the finished threads does the same for all of them,
|
|
152
|
+
Each thread is a card in that list: its title, its room's knight, a badge (in progress or finished), the time of its last post and its unread count. A going-on thread wears its knight's tint and a finished one rests. An owner clears a finished thread off the list by swiping its card to the right (the card slides out, the list closes the gap, and a notice offers Undo for five seconds), by pressing the menu button on the card, by holding it or right-clicking it (**Clear this thread**, **Clear all finished**), or with Delete on a focused card; **Clear finished** in the header of the finished threads does the same for all of them. Nothing asks first, however many there are: the notice's Undo is the way back. A going-on thread does not swipe: the card gives a little and springs back. Clearing hides a thread and does not delete it: it leaves the list for every owner and every open page at once, and stays readable by its address and through the links in its room. The routes are `POST api/rooms/<thread>/dismiss` (409 while the thread is open), `POST api/rooms/<room>/dismiss-threads` (every finished thread of the room), their undos `POST api/rooms/<thread>/undismiss` and `POST api/rooms/<room>/undismiss-threads` (body `{ "threads": [<keys>] }`, at most 100, those that hang under the room), and `GET api/rooms/<thread>` for the view of a thread the list does not carry. All of them are the owners' like the rest of `api/rooms`.
|
|
153
|
+
|
|
154
|
+
The room list's menu (the button beside the search) and each folder's menu clear every finished thread at once: **Clear all finished threads** takes the finished threads of every room in the list, or of the folder's rooms. The route is `POST api/rooms/dismiss-finished-threads` with `{ "rooms": [<keys>] }` (at most 500; left out, every room the list shows). It answers with the number cleared and the cleared threads' keys by room (`{ "dismissed": 3, "threads": { "<room>": [<keys>] } }`), which the notice's Undo sends back through `undismiss-threads`, room by room. Open threads are never cleared, and the item is left out of the menu when no finished thread is listed.
|
|
155
|
+
|
|
156
|
+
#### Temp knights
|
|
157
|
+
|
|
158
|
+
A knight's temp knights (the helpers it makes with `helper_create`, see the core guide) hang under its row like threads: a small face, the name, and a state, a pulsing dot while it works, the card badge while it waits for you, and a dimmed **Ended** with the time once it has nothing running, queued or waiting. The group of them is unfolded while one is at work and folded when all have ended, as the person last chose on this device. They follow the knight's pin and folder, have no drag handle and no seat at the round table, are left out of groups, the council tick list and the switcher, and their push is held back by default because their answers reach the knight's room (a card still pushes). A temp knight's room works like any other room: you may write to it directly, and its header reads "Temp knight · Made by <knight>" with a link to the knight.
|
|
159
|
+
**Clear finished temp knights** is in the room list's menu, a folder's menu and a knight's menu, and is left out when nothing has ended. It archives at once, with no confirmation, and the notice's Undo restores exactly those. A temp knight's own menu has **Archive this temp knight**, with the same notice. When a knight clears its own with `helper_end`, its room shows a line naming them with an Undo. The archive page lists each temp knight right after its knight.
|
|
160
|
+
The routes are `POST api/rooms/archive-finished-helpers` (body `{ "rooms": [<keys>] }` of knights' rooms, at most 500; left out, every knight's; answers `{ "archived": [{ "room", "names" }] }`) and `POST api/rooms/restore-helpers` (body `{ "names": [<names>] }`, at most 500; answers `{ "restored": [<names>] }`; a name that is not a temp knight is refused with `400` and named, and one that is no longer archived is passed over). Both are the owners', like the rest of `api/rooms`. `RoomView.helper` is `{ parent, parentName, finished? }` on a temp knight's room.
|
|
153
161
|
|
|
154
162
|
|
|
155
163
|
### Making and arranging agents
|
|
@@ -160,7 +168,7 @@ An owner changes the team from the app. Everything goes through the agent server
|
|
|
160
168
|
- **Archive and restore.** Archive is in the agent sheet and in the ⋯ menu and long-press menu of a room (the coordinator's room has none). It asks first, naming the agent or group. An archived agent stops answering, its schedules are cancelled and it leaves its groups; its history is kept. **Archived** in the **+** menu lists what is archived with Restore and Delete. Restoring an agent does not put it back in its groups; restoring a group needs all its members active, otherwise it is refused and stays archived.
|
|
161
169
|
- **Delete.** Only an archived agent or group can be deleted, from the archive, after a question that names it. Deleting frees the name, removes the agent's group cursors and detaches its skills, and clears what this app kept of the room (its messages, its cards, its mute and its modes). A Discord channel, if the agent had one, stays under Archive with its history, since Discord is never asked to delete a channel.
|
|
162
170
|
- **Skills.** The agent sheet lists the host's skills (the Skills pane's catalog when the host supplies it, else the skills addon's own) with a switch each, applied as it is flipped and from the agent's next turn. Built-in skills are carried by every agent and stay on. A host without the skills addon shows nothing.
|
|
163
|
-
- **Groups.** New group and Edit group (the group's header name, its ⋯ menu and its row menu) take a name, 2 to
|
|
171
|
+
- **Groups.** New group and Edit group (the group's header name, its ⋯ menu and its row menu) take a name, 2 to 8 members in the order they are picked, and the host who answers when nobody else fits; Edit sends only what changed. Archive group asks first.
|
|
164
172
|
|
|
165
173
|
All of it is for owners: the owner's tier is read again on each call, a change needs the console's `Origin`, and a room or agent that does not exist is a 404. Every change tells the open pages to read the room list again.
|
|
166
174
|
|
|
@@ -190,6 +198,18 @@ Until the owners arrange something, the page is the plain list it always was; th
|
|
|
190
198
|
|
|
191
199
|
The layout lives in three additive tables created by the plugin's migration `web-room-layout`: `web_room_folders`, `web_room_folder_rooms` and `web_room_pins`. Every write takes one advisory lock and rewrites the positions densely, so two devices editing at once leave no gap and no duplicate.
|
|
192
200
|
|
|
201
|
+
### Keyboard shortcuts
|
|
202
|
+
|
|
203
|
+
| Keys (Mac / elsewhere) | What they do |
|
|
204
|
+
|---|---|
|
|
205
|
+
| ⌥↑ / ⌥↓, Alt+↑ / Alt+↓ | The previous or next room, in the order the room list shows: Home, the pinned rooms, the folders (a folded folder is skipped unless it holds the open room), the rest, with a room's open threads after it and its finished threads only while their fold is open. The run does not wrap. On a page that shows no list, such as a room open full screen on a phone, the same order applies; from a page that is no room, the first key press opens the first or the last room. Hosts' own room kinds are not in the run. |
|
|
206
|
+
| ⌥⇧↑ / ⌥⇧↓, Alt+Shift+↑ / Alt+Shift+↓ | The previous or next room with unread messages, in the same order; folded folders and finished threads are searched too. |
|
|
207
|
+
| ⌘K, Ctrl+K | Find a room (the search sheet), from anywhere, a message box included. |
|
|
208
|
+
| Esc | Closes the topmost menu or sheet; with none open, the message box lets go of focus. Typed text is never discarded. |
|
|
209
|
+
| ? | Opens the list of these shortcuts, a sheet that loads on the first press. Typing `?` in a text field types it. |
|
|
210
|
+
|
|
211
|
+
Switching goes through the same router as a click on the row, so it adds a history entry, uses the same view transition, and scrolls the open room's row into view in the list. Nothing here acts while an input method is composing. In a text field Option/Alt with the up and down arrows is paragraph navigation on a Mac, so the room keys act only when the field is empty or the caret rests at its very start (up) or very end (down) with nothing selected; Shift, Ctrl/Cmd and plain arrows are never taken. While a menu, sheet or the room drawer is open the room keys leave the page alone.
|
|
212
|
+
|
|
193
213
|
### Uploads
|
|
194
214
|
|
|
195
215
|
An owner may send a file of any kind in a room, up to four to a message: the button, a paste (a copied image, say) or a drop. `POST <mount>/api/uploads` takes one file as `multipart/form-data` (field `file`) and answers `{id, name, type, size}`; the message then names it in `uploads`. A long text goes as a file too: the page turns a paste of 4,000 characters or more into a `pasted-text-<n>.txt` chip, and a message over 32,000 characters into `message.txt` with the line "(long text attached)"; the server still refuses a text over 32,000 characters.
|
|
@@ -222,21 +242,22 @@ Every agent is drawn as its composed character (`pi-roundtable/characters`). The
|
|
|
222
242
|
|
|
223
243
|
### The round table
|
|
224
244
|
|
|
225
|
-
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each
|
|
245
|
+
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each member of the council on the table, at most eight (the coordinator first), and one low lip at the near edge for you, under torches, banners and a stained-glass window, around a glowing rune circle. The hall is drawn in the characters' own flat, outlined style (a stepped tone gradient and a dark line round every shape, no photographic textures). Dark is the hall at night, light the same hall by day; the Modern and Camelot looks change the banners and the trim, not the hall. Each agent stands behind its podium as a waist-up standee: the character without its frame, cut out with a thin light rim, a dark line and a visible board thickness, turning to the camera within limits. A seat's state comes from the same rules as the room list (`sleepy` sits as `idle`): a thinking seat shows a "…" badge and bobs, a seat with a card waiting a gold "!", a speaking seat has a light on its podium and the concept art's three gold emphasis strokes beside its head; a change of face redraws that one picture once it has stood for 300 ms. The table never shows a "+N" podium: a council has eight members at most, and an agent that is not a member is not drawn.
|
|
226
246
|
|
|
227
|
-
|
|
247
|
+
The table is a **council**: one agent group (the same group as the group chat, with no second store) shown with its members. Host rooms (a support desk's ticket rooms, say) are not on the owners' table; they are in the room list and the notices. Only a member's or an admin's table, below, seats host rooms.
|
|
228
248
|
|
|
229
249
|
This section describes the owners' table. A member or an admin is served the table only when the host names it for their tier, and theirs seats host rooms instead of agents: see [What each tier is served](#what-each-tier-is-served).
|
|
230
250
|
|
|
231
251
|
- **Cameras.** The overview stands behind your podium, raised. A drag or swipe turns it round the ring and snaps to a podium; the wheel or a pinch moves in on the podium across the ring and back out. A close-up of a speaker stands low inside the ring, tilted a little, with thin speed lines flashing for 400 ms on a new speaker. A turn follows the ring the shorter way and takes 450 to 650 ms. A swipe never starts within 32 px of the screen's edge. Under `prefers-reduced-motion` the camera cuts, with no speed lines, bob or flicker.
|
|
232
|
-
- **Talking in the scene.**
|
|
252
|
+
- **Talking in the scene.** The dialogue box at the bottom is the council's group room: a nameplate tab in the speaker's color with their picture, the line being said (Markdown, typed out while it streams, a tap shows it whole), the cards waiting for an answer, and the room's message box, with its unsent text kept per room. A message sent there starts a round under the group's rules. A tap on a podium (or on its name, a button over the plate) turns the camera to that member until the next line comes; **Reset view** brings it back to the whole ring; holding a seat (a long press, a right click or the Menu key) opens its menu with **Private chat** (the knight's own room) and **Remove from the council**. **Log** opens the room's whole message list as a sheet over the scene. The address is `#/table/<group>` (the group's name or the key of its room): without one the table shows the council this device chose last (kept in the browser's storage), or the first group, and an address that names no group goes back to `#/table`.
|
|
233
253
|
- **Names.** A seat's name is a button laid over its podium's nameplate, at least 12 px on the screen at any distance, in a font stack that carries Chinese (`system-ui`, PingFang TC, Noto Sans TC, Microsoft JhengHei); the podium's own plate is lettered the same way. The seat's full name and state are its accessible name. Where the names stand over each other (many seats on a phone) the agents are also listed as buttons under the scene.
|
|
234
|
-
- **Phones.** Held upright, the scene fills the top 55 % and the dialogue box the rest, and the box collapses to its nameplate line; on its side the scene is whole and the box lies over its bottom third.
|
|
254
|
+
- **Phones.** Held upright, the scene fills the top 55 % and the dialogue box the rest, and the box collapses to its nameplate line; on its side the scene is whole and the box lies over its bottom third.
|
|
235
255
|
- **Fallback.** Without WebGL (or after a lost context) the same ring is drawn as SVG in the same palette, with the same standees, plates and dialogue box, never a blank pane. `?nogl` in the page address (`/console/?nogl`, or `#/table?nogl`) draws it on a browser that has WebGL, to try that path; `nogl=0` and `nogl=false` leave the choice to the browser.
|
|
236
256
|
- **Performance.** The WebGL scene is a chunk of its own, fetched when the view first opens and cached by the service worker, never precached. It stops drawing while the page is hidden or the table is off screen, draws a few frames a second while nothing moves (so a torch flickers without keeping the GPU busy), and caps the pixel ratio at 2 (1.5 on phones).
|
|
237
|
-
- **
|
|
257
|
+
- **The council.** The header's chip (**Council: <name> ▾**) opens a sheet, a bottom sheet on a phone and a dialog elsewhere. It lists the saved councils (the groups, with their members' faces; pressing one puts it on the table, with the same puff, glide and rise as a seat leaving or joining), and a tick list of every knight with a counter (**3 of 8 picked**): the ninth tick is refused and the sheet says *At most 8 knights*. Ticks keep the order they were made in, which is the group's tie order, and the host is chosen among the ticked. **Done** saves the ticks into the council on the table in place (`PATCH api/groups/<name>`); **Save as a new council** asks for a name and makes another group (`POST api/groups`), which opens its Discord channel as every group does. With no group yet the table says *No council yet* and the sheet starts from the knights that were not muted, the coordinator first, at most eight, to be named and saved. Who sits is no longer mute's say: mute only stops a room's push, stays in the knight's sheet and the room menu, and a muted knight sits when the council has it. Owners who used mute to take knights off the table see their first group (or the empty state) after this change.
|
|
238
258
|
- **Leaving and joining.** An agent who leaves goes in a manga-style puff: the standee squashes a little, flat outlined clouds pop up round it and hide it, then drift up and fade with a few sparkles (about 0.7 s). The other seats then glide to their new places with the camera. An agent who sits down is called up out of a small rune circle in the hall's teal that glows on the floor at its new place; the podium rises out of it with a slight bounce, under a column of light (about 0.85 s), once the others have opened the gap. The pictures are drawn on small canvases in the hall's style and given back when the show ends. Under `prefers-reduced-motion` the picture only dips and comes back (0.16 s each way), with no smoke or rise; the 2D fallback fades the seat in over a ring and out inside a puff with CSS.
|
|
239
|
-
- **Group rooms.**
|
|
259
|
+
- **Group rooms.** The same scene is a group room's: its header has a "Table" button that switches the room between its list and the scene; the choice is kept per room. In the scene the whole conversation runs in the dialogue box, the camera turns to whoever replies, and it rests on the whole ring while you speak; a member that starts thinking shows its badge wherever the camera is, and a speaker change never takes the focus from your message box. Under the Camelot look a compact strip of the members stands under the header in the list, with the speaker lit.
|
|
260
|
+
- **Turn-taking.** A group round is the members' answers to one message, one after another. The server tells the page where it stands in a `round` frame (`{ type: "round", room, round }`, and `RoomView.round` for a page that opens mid-round): `id` (the group message that opened it), `state`, `current`, `next` (the queue, a handoff appended), `spoken`, `replies` and `limit` (8), `ended` (`done`, `limit` or `stopped`) and `queued` (your messages waiting for the next round). An **order strip** on top of the dialogue box shows the faces in that order: those who spoke dimmed with a check, the one speaking larger, those who are next numbered, and a chip, *Reply 3 of 8*, that reads *Limit reached*, *Round stopped* or *n of 8 replies* once it ended; the strip of the last round stays until the next starts. While it runs the seats wear the same signs before their names (a check, or ① to ⑧; a round that ended leaves them bare), the seat of the member the round says speaks is lit, and the camera turns to it as soon as its turn starts, not when its line arrives; a camera you turned by hand stays until the next line or the next speaker. While a message of yours waits, the strip says so. The box's stop button reads **Stop the round**: it stops the member speaking and the ones waiting do not speak, on the web and in Discord alike.
|
|
240
261
|
|
|
241
262
|
### The files pane
|
|
242
263
|
|
|
@@ -324,7 +345,7 @@ A member's socket receives nothing from an agent room, neither as it happens nor
|
|
|
324
345
|
|
|
325
346
|
`panes` takes a list for the owners and, with `admission: "access"`, `{ owner, admin?, member }` to choose per tier. The default gives a member `rooms` (the host's own rooms only), `conversations`, `notes`, `schedules` and `profile`, of those the host serves; an admin's list is the member's unless given. A member is never served `overview`, `workspace`, `skills` or `connectors`, and naming one for them stops the start. `table` is the one pane whose name a host may give a member or an admin (it needs that tier's `rooms` pane, and the owners' list must have it too): the default lists leave it out, so it is served only where the host names it.
|
|
326
347
|
|
|
327
|
-
- **The round table for members and admins**: the agent rooms are the owners', so a member's or an admin's table seats none of them. It seats the host rooms of every kind they may list (`GET api/host/<kind>`, the same lists and the same kind `access` as their room list, so a room the kind does not give them is no seat), newest first, in the same ring and the same looks. No new route is added: the table asks only for those lists. A seat is lit from its room's own frames, which the page follows by `subscribe` for the seats the scene draws (at most
|
|
348
|
+
- **The round table for members and admins**: the agent rooms are the owners', so a member's or an admin's table seats none of them. It seats the host rooms of every kind they may list (`GET api/host/<kind>`, the same lists and the same kind `access` as their room list, so a room the kind does not give them is no seat), newest first, in the same ring and the same looks. No new route is added: the table asks only for those lists. A seat is lit from its room's own frames, which the page follows by `subscribe` for the seats the scene draws (at most eight), and a follow is answered only for a room the person may read now: `activity` (thinking, working, a turn already running when they follow) and the cards are addressed to the room's readers, as they are in the room, and a room they may not read sends nothing, however they ask. A room that asks for something in the kind's list (`attention`) sits as waiting. A tap on a seat opens that room's own page, where what the person may write (a note, a turn to the agent, or nothing) and press is decided by the kind's `access` as everywhere else, so the table has no dialogue box, no seat menu and no council sheet for them (those arrange agent groups, which are the owners'), and an address `#/table/<seat>` goes back to the whole ring. A header button, **All rooms**, opens the room list; the table never shows a "+N" podium. The table sends the person nothing of the overview, the files pane, the skills or the presence of the team, and the owners' view is unchanged.
|
|
328
349
|
- **Conversations**: a member lists and reads only the private conversations the registry records as theirs, found by the registry; `exclude(key, record)` is asked on every list and every transcript read.
|
|
329
350
|
- **Notes**: their own only. Asking for another person's is `403`. The pane is left out, with a warning, when the host keeps no memory (`MEMORY`); naming it with none is an error.
|
|
330
351
|
- **Schedules**: their own, whichever of the 0.8 and the current id the schedule names them by; an owner sees every schedule.
|
|
@@ -861,6 +882,7 @@ A room's key is `<surface>:<kind>.<id>`, with an id of 8 to 64 letters, digits,
|
|
|
861
882
|
- **Pages.** A page is at `<mount>/p/<id>` and is built from sections: Markdown, a list of rows (each may open a link and carry buttons), a form with an action, and a card. `place` is `main` (the navigation), `settings` (the Settings pane) or `hidden`. `visible(viewer)` is asked on every fetch and action; a page that is not visible is a `404`. `app.pages.changed(id?)` sends the viewers who may see it a `page_changed` frame and their page fetches the view again.
|
|
862
883
|
- **Retention.** A kind's `retention: { textDays, fileDays }` deletes its messages, author names, host cards and files that old, counted from each message's `at` (a card's from when it was first posted). Without it nothing is deleted. A card the host still wants, such as a ticket's pinned card while the ticket is open, carries `keep: true` in `card` and `updateCard`: the sweep skips it for as long as the host passes `keep: true`, and `updateCard` without it makes the card an ordinary one again.
|
|
863
884
|
- **Read marks.** The page tells the app how far a person has read (the newest message in view, at most once a second, never while the page is hidden). The app keeps one cursor per person and room, for host rooms and agent rooms alike (among owners), and computes each room's `unread` from it; the list and the drawer show the count, an attention dot where the host sets `attention`, and the room opens with a "new messages" divider where the person stopped. Under each message the people who have read up to it are named: "Seen by 2", with their pictures; a person's own mark is not shown to them.
|
|
885
|
+
- **Mark all as read.** The room list's menu and each folder's menu have **Mark all as read**, left out when nothing in its scope is unread (a folder's scope is its rooms and the threads under them). It reads every room the person may read, agent, group, thread and host rooms, up to the newest message in one call: `POST api/rooms/read-all` with `{ "rooms": [<keys>] }` (at most 500; left out, every room the list shows, host rooms excepted), owners only like the rest of `api/rooms`. Rooms the person may not read are passed over as if they were not named. The answer lists the cursors that moved, `{ "moved": [{ "room", "from", "to" }] }`; sending them back as `{ "restore": [...] }` to the same route puts each cursor back where it was, unless the person has read on since. The unread badges, the tab title's count and the tab icon's dot clear at once, the person's other pages and devices hear of it through the same `read` frames a single read sends (and a `changed` frame for the lists), and a notice offers Undo for five seconds. Nothing asks first.
|
|
864
886
|
- **The page is lazy.** The room, the lists and the pages load as separate chunks when first opened, so the app's first load is the same size as before.
|
|
865
887
|
|
|
866
888
|
## App protocol
|
|
@@ -869,7 +891,7 @@ The `rooms` pane's page and any client of your own talk to the host in this prot
|
|
|
869
891
|
|
|
870
892
|
- Page to server: `hello {visible, focus?}`, `visibility`, `focus {room?}`, `send {id, room, text, uploads?}`, `stop {room}`, `approval {prompt, approved}`, `answer {prompt, answer}`, `answers {prompt, answers, note?}`, `cancel {prompt}`; for a host room also `subscribe {room}`, `unsubscribe {room}`, `act {id, room, action, card?, input?}` and `read {room, upTo}`.
|
|
871
893
|
- Server to page: `ready {protocol, principal, name, uploads: {perMessage, maxBytes}}` (then every open card), `accepted`, `refused {id?, prompt?, code}` (`id` names a refused `send`, `prompt` a refused answer to a card), `message`, `progress` (only for the focused room), `activity {room, typing, stoppable, phase?, agent?, outcome?}` (`phase` is `working` during a tool call and `thinking` otherwise; `agent` names the member speaking in a group round; `outcome` is `done` or `failed` and comes only on the frame where `typing` turns false), `presence {agents: {<name>: {busy}}}` (after `ready` and when it changes; `busy` includes work in Discord channels), `edited` (a stored message changed its text, such as a thread's start line once the thread exists), `prompt`, `prompt_closed {prompt, outcome, note?, by?, answer?, closedAt?}`, `mode`, `auto_approved`, `changed`.
|
|
872
|
-
- REST under `<mount>/api/`: `session`, `rooms`, `rooms/<key>/messages?before=&limit=` (`{messages, more, cards}`: the cards of the room that opened within the page's span, from the first message's time on, or from the beginning when `more` is false, and before the first message of the next page), `PUT rooms/<key>/mode`, `PUT rooms/<key>/mute` (body `{muted: boolean}`; the room's push is off for every owner while true; a waiting card still pushes), `PUT rooms/<key>/pin` (body `{pinned: boolean, before?: key | null}`) and `PUT rooms/<key>/folder` (body `{folder: id | null, before?: key | null}`; `before` is the room it goes before, none or an unknown room for the end; `400` for Home and a dispatch thread, `404` for an unknown room or folder), `POST folders` (body `{name}`, `201`), `PATCH folders/<id>` (body `{name?, before?: id | null}`), `DELETE folders/<id>`, `PUT folders/<id>/mute` (body `{muted: boolean}`; answers `{muted, rooms}`), all of which answer with the whole layout `{pins, folders}` (except the mute), and `GET rooms` answering `{rooms, pins, folders}`, `POST rooms/<key>/start-over`, `POST uploads`, `DELETE uploads/<id>`, `files/<id>`, `schedules` (`GET`, and `DELETE schedules/<id>`), `agents/<name>` (`GET`, `PATCH`), `GET agents/<name>/prompt-history` (`{versions}`, newest first), `GET prompts` (`{documents}`), `GET` and `PUT prompts/<id>` (body `{text, base}`; `409 {error, conflict, current}` when `base` is not the text in force), `POST prompts/<id>/revert` (body `{base}`; the same `409`), `GET prompts/<id>/history`, `GET` and `PUT skill-docs/<name>` (body `{text, baseHash}`; `409` with `current`), `POST skill-docs` (body `{text}`; `201`), `GET skill-docs/<name>/history`, `PUT agents/<name>/character` (body `{character}`, at most 4 KiB; `400 {error, field}` for a look that is not a character), `POST agents` (body `{name, displayName, prompt, model?, thinking?, task?, character?, skills?}`; `201` with the profile; `400` for what the agent server refuses, `{error, field}` for a look), `POST agents/<name>/archive`, `POST agents/<name>/restore` (the profile), `DELETE agents/<name>` (an archived agent only; `400` for an active one), `GET` and `PUT agents/<name>/skills` (`{skills: [{name, description?, source, builtin, carried, missing?}]}`; the body of `PUT` is `{add?, remove?}`, one change that an unknown or built-in name refuses whole; `404` when the host has no skills), `POST groups` (body `{name, displayName, members, host?}`; `201`), `GET`, `PATCH` (`{displayName?, members?, host?}`) and `DELETE groups/<name>`, `POST groups/<name>/archive` and `POST groups/<name>/restore`, `GET archive` (`{entries}`: the archived agents and groups), `models`, `workspace` (the [files pane](#the-files-pane)'s calls), and for push `GET push/key`, `GET`, `POST` and `DELETE push/subscriptions` and `DELETE push/subscriptions/<id>`. The agents' pictures are at `<mount>/avatars/<hash>.png`.
|
|
894
|
+
- REST under `<mount>/api/`: `session`, `rooms`, `rooms/<key>/messages?before=&limit=` (`{messages, more, cards}`: the cards of the room that opened within the page's span, from the first message's time on, or from the beginning when `more` is false, and before the first message of the next page), `PUT rooms/<key>/mode`, `PUT rooms/<key>/mute` (body `{muted: boolean}`; the room's push is off for every owner while true; a waiting card still pushes), `PUT rooms/<key>/pin` (body `{pinned: boolean, before?: key | null}`) and `PUT rooms/<key>/folder` (body `{folder: id | null, before?: key | null}`; `before` is the room it goes before, none or an unknown room for the end; `400` for Home and a dispatch thread, `404` for an unknown room or folder), `POST folders` (body `{name}`, `201`), `PATCH folders/<id>` (body `{name?, before?: id | null}`), `DELETE folders/<id>`, `PUT folders/<id>/mute` (body `{muted: boolean}`; answers `{muted, rooms}`), all of which answer with the whole layout `{pins, folders}` (except the mute), and `GET rooms` answering `{rooms, pins, folders}`, `POST rooms/<key>/start-over`, `POST rooms/archive-finished-helpers` and `POST rooms/restore-helpers` (see [Temp knights](#temp-knights)), `POST uploads`, `DELETE uploads/<id>`, `files/<id>`, `schedules` (`GET`, and `DELETE schedules/<id>`), `agents/<name>` (`GET`, `PATCH`), `GET agents/<name>/prompt-history` (`{versions}`, newest first), `GET prompts` (`{documents}`), `GET` and `PUT prompts/<id>` (body `{text, base}`; `409 {error, conflict, current}` when `base` is not the text in force), `POST prompts/<id>/revert` (body `{base}`; the same `409`), `GET prompts/<id>/history`, `GET` and `PUT skill-docs/<name>` (body `{text, baseHash}`; `409` with `current`), `POST skill-docs` (body `{text}`; `201`), `GET skill-docs/<name>/history`, `PUT agents/<name>/character` (body `{character}`, at most 4 KiB; `400 {error, field}` for a look that is not a character), `POST agents` (body `{name, displayName, prompt, model?, thinking?, task?, character?, skills?}`; `201` with the profile; `400` for what the agent server refuses, `{error, field}` for a look), `POST agents/<name>/archive`, `POST agents/<name>/restore` (the profile), `DELETE agents/<name>` (an archived agent only; `400` for an active one), `GET` and `PUT agents/<name>/skills` (`{skills: [{name, description?, source, builtin, carried, missing?}]}`; the body of `PUT` is `{add?, remove?}`, one change that an unknown or built-in name refuses whole; `404` when the host has no skills), `POST groups` (body `{name, displayName, members, host?}`; `201`), `GET`, `PATCH` (`{displayName?, members?, host?}`) and `DELETE groups/<name>`, `POST groups/<name>/archive` and `POST groups/<name>/restore`, `GET archive` (`{entries}`: the archived agents and groups, a temp knight's entry carrying its `parent`), `models`, `workspace` (the [files pane](#the-files-pane)'s calls), and for push `GET push/key`, `GET`, `POST` and `DELETE push/subscriptions` and `DELETE push/subscriptions/<id>`. The agents' pictures are at `<mount>/avatars/<hash>.png`.
|
|
873
895
|
- Beside the API: `<mount>/manifest.webmanifest`, `<mount>/sw.js`, `<mount>/icons/<name>.png` (and `mark.svg`), `<mount>/theme-init.js`, and in password mode `<mount>/login`, `POST <mount>/auth/login` and `POST <mount>/auth/logout`.
|
|
874
896
|
|
|
875
897
|
A room key from a page must be one of the app's rooms whose agent or group exists; every other key, Discord's included, is refused. Every write needs an owner, whose tier is read again, and REST writes also need the console's `Origin`. A card can be answered by any owner, except a card that is the speaker's alone, which only the speaker's principal answers. After `cardGraceSeconds` (default 120) a turn goes on without the answer and the card stays open for a day; an answer then starts a new turn in the room. The types are in `src/api-types.ts`.
|
|
@@ -914,7 +936,7 @@ The fixture host has two owners, so the Notes pane shows its principal picker.
|
|
|
914
936
|
|
|
915
937
|
`bun run fixture:app` starts the owner app over a scratch PostgreSQL database (`ROUNDTABLE_TEST_DATABASE_URL`, whose server may create a database; the fixture makes one and drops it when it stops) with two scripted agents and a group, no Discord, and no authentication on a loopback port (4180).
|
|
916
938
|
Start a message with a keyword and the agent acts it out: `approve` (a held action with details), `ask`, `quiz` (a questionnaire), `timeout` (the time-limit card), `late` (a card the turn stops waiting on), `stream` (streamed text and tool chips), `dispatch` (a coding job in a thread) or `exchange` (the agent asks the scout in a thread).
|
|
917
|
-
`LOOK=camelot` starts the host in the Camelot look,
|
|
939
|
+
`LOOK=camelot` starts the host in the Camelot look, `FIXTURE_AGENTS` gives the host up to twelve agents, and `FIXTURE_COUNCIL` makes the group `crew`, the council on the round table, up to eight members of them.
|
|
918
940
|
The header of `scripts/fixture-app.ts` lists the control port that sends a message as the owner and sets a room's modes.
|
|
919
941
|
|
|
920
942
|
The page is React, bundled with Bun's bundler into relative URLs, so it works under any `mountPath`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,Q,S,e,w}from"./chunk-index-2e4am3hw.js";var a={profile:S(()=>(h("s7r7fcvz"),import("./chunk-profile-s7r7fcvz.js")).then((o)=>({default:o.ProfilePage}))),notices:S(()=>(h("fte9f196"),import("./chunk-notices-fte9f196.js")).then((o)=>({default:o.NoticesPage}))),onboarding:S(()=>(h("c5twahc3"),import("./chunk-onboarding-c5twahc3.js")).then((o)=>({default:o.OnboardingPage})))};function n({pane:o}){let t=a[o];return t?e(Q,{fallback:e(w,{}),children:e(t,{})}):null}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s,Qe,a,r,m,e,n,o,St,Xo}from"./chunk-index-2e4am3hw.js";import{L}from"./chunk-index-8d81qy69.js";var x=()=>typeof matchMedia==="function"&&matchMedia("(max-width: 719px)").matches,g={rtMenu:!0},H=()=>Boolean(window.history.state?.rtMenu),y=8,M=(t)=>t?.isConnected?t:null;function b(t){return t.items.map((i)=>n("button",{type:"button",role:i.checked===void 0?"menuitem":"menuitemcheckbox",...i.checked===void 0?{}:{"aria-checked":i.checked},className:"menu-item menu-link","data-tone":i.tone,onClick:()=>t.onChoose(i),children:[i.icon?e("span",{className:"menu-icon","data-tone":i.tone,children:e(o,{name:i.icon,size:18})}):null,e("span",{className:"menu-text",children:e("strong",{children:i.label})}),i.checked?e(o,{name:"check",size:18,className:"menu-check"}):null]},i.id))}function T({menu:t}){let i=a(void 0);if(t)i.current=t;let l=i.current,f=a(!1),v=a(void 0),h=t?.serial;return s(()=>{if(h===void 0)return;return window.history.pushState(g,"",window.location.href),f.current=!0,()=>{if(f.current)f.current=!1,window.history.back()}},[h]),s(()=>{let p=()=>{if(!f.current||H())return;f.current=!1,St();let E=v.current;v.current=void 0,E?.()};return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[]),e(L,{open:t!==void 0,title:l?.title??"",onClose:St,restoreFocus:()=>M(l?.source??null),children:l?e("div",{className:"menu action-items",role:"menu","aria-label":l.title,children:e(b,{items:l.items,onChoose:(p)=>{if(!f.current){St(),p.run();return}v.current=p.run,window.history.back()}})}):null})}function D({menu:t}){let i=a(null),[l,f]=r(t.at),{source:v}=t,h=(u)=>{M(v)?.focus(),St(),u?.()},p=a(h);p.current=h,Qe(()=>{let u=i.current;if(!u)return;let d={left:u.style.left,top:u.style.top};u.style.left="0px",u.style.top="0px";let c={width:u.offsetWidth,height:u.offsetHeight};u.style.left=d.left,u.style.top=d.top,f({x:Math.max(y,Math.min(t.at.x,window.innerWidth-c.width-y)),y:Math.max(y,Math.min(t.at.y,window.innerHeight-c.height-y))}),u.querySelector('[role^="menuitem"]')?.focus()},[t.serial]),s(()=>{let u=(c)=>{if(c.target instanceof Node&&i.current?.contains(c.target))return;St()},d=()=>St();return document.addEventListener("pointerdown",u,!0),document.addEventListener("wheel",u,{capture:!0,passive:!0}),document.addEventListener("touchmove",u,{capture:!0,passive:!0}),window.addEventListener("resize",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("wheel",u,!0),document.removeEventListener("touchmove",u,!0),window.removeEventListener("resize",d)}},[]);let E=(u)=>{let d=[...i.current?.querySelectorAll('[role^="menuitem"]')??[]],c=d.indexOf(document.activeElement),w=(k)=>{u.preventDefault(),d[(k+d.length)%d.length]?.focus()};switch(u.key){case"Escape":u.preventDefault(),u.stopPropagation(),p.current();return;case"ArrowDown":return w(c+1);case"ArrowUp":return w(c<0?-1:c-1);case"Tab":return w(u.shiftKey?c<0?-1:c-1:c+1);case"Home":return w(0);case"End":return w(-1)}};return e("div",{ref:i,className:"action-popover",role:"menu","aria-label":t.title,tabIndex:-1,style:{left:`${l.x}px`,top:`${l.y}px`},onKeyDown:E,children:e(b,{items:t.items,onChoose:(u)=>h(u.run)})})}function O(){let t=Xo(),i=a(void 0);if(t&&i.current?.serial!==t.serial)i.current={serial:t.serial,sheet:x()};let l=Boolean(t&&i.current?.sheet);return n(m,{children:[e(T,{menu:l?t:void 0}),t&&!l?e(D,{menu:t},t.serial):null]})}export{O as ActionMenuHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s,e,D,u,w,rt}from"./chunk-index-2e4am3hw.js";function c({name:o}){let i=u((t)=>t.listed),r=u((t)=>Object.values(t.rooms).find((m)=>m.view?.kind==="agent"&&m.view.name===o)?.view?.key,o);return s(()=>{if(r)D("room",r,{replace:!0}),rt(o);else if(i)D("rooms",void 0,{replace:!0})},[r,i,o]),e("div",{className:"page",children:e(w,{})})}export{c as AgentPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,Q,S,J,M,a,t,m,e,n,o,ke,u,_,k,pe,Wt,On,ne,Ji,yi,Mr,At,bi,Rr}from"./chunk-index-2e4am3hw.js";import{Ce}from"./chunk-index-j4kk1m59.js";import{si}from"./chunk-index-02vfshtt.js";import"./chunk-index-e2dqjde8.js";import"./chunk-index-kbrg32sx.js";import{Jn}from"./chunk-index-pefwfm26.js";import{ri,oi}from"./chunk-index-xxeb2xp0.js";import{Bt}from"./chunk-index-12zyshae.js";import"./chunk-index-b8cpvr7y.js";import"./chunk-index-rh0x9rzf.js";import{ot}from"./chunk-index-g1awv7rk.js";ri();var F=S(()=>(h("4gcj7g7h"),import("./chunk-folder-list-4gcj7g7h.js")).then((s)=>({default:s.FolderList}))),O=J(function(d){let{view:r}=d,p=Bt(()=>Wt(r.key),r.home?void 0:oi(r.key));return e(Mr,{...d,press:p,item:{...r.home?{}:{"data-drop-item":"","data-key":r.key},...d.arranging?{"data-arranging":""}:{}},after:d.arranging?e("button",{type:"button",className:"icon-button row-more","aria-haspopup":"menu","aria-label":t("Room menu"),onClick:(c)=>{let g=c.currentTarget;Wt(r.key).then((i)=>{if(!i)return;let y=g.getBoundingClientRect();pe({...i,at:{x:y.left,y:y.bottom},via:"key",source:g})},()=>{return})},children:e(o,{name:"more",size:18})}):null})});function L(s){let{now:d}=ne(),{timeZone:r}=k(),p=At(s.rooms);return e("ul",{className:"room-list",children:p.map(({key:c,...g})=>{let i=s.threads[c];return e(O,{...g,active:c===s.active,now:d,timeZone:r,arranging:s.arranging,...i?{threads:e(bi,{open:i.open,closed:i.closed,active:s.active,parent:c})}:{}},c)})})}function v(s){let r=At(s.rooms).length===0;if(r&&s.zone?.kind!=="pinned")return null;return n("section",{className:"stack",...r?{"data-empty":""}:{},...s.zone?{"data-drop-zone":s.zone.kind,"data-zone-id":s.zone.id}:{},children:[e("h2",{className:"section-title",children:s.title}),r?null:e(L,{rooms:s.rooms,threads:s.threads,active:s.active,arranging:s.arranging})]})}function re(s){let d=Boolean(k().kinds?.length),r=u((l)=>JSON.stringify({listed:l.listed,...ot(l,(K)=>ke(l,K))})),p=si(),c=a(r);if(!p)c.current=r;let g=c.current,{listed:i,...y}=M(()=>JSON.parse(g),[g]),{home:w,pinned:z,folders:N,restAgents:P,restGroups:T,rest:A,threads:C,orphans:f}=y,R=Ji(),D=w.length+z.length+A.length===0&&N.every((l)=>l.rooms.length===0)&&f.open.length+f.closed.length===0,b={threads:C,active:s.active,arranging:R};return n("div",{className:"page","data-column":s.active?"":void 0,"data-drop-root":"",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Rooms")}),n("div",{className:"actions",children:[n("button",{type:"button",className:"header-button search-button",onClick:s.onSearch,children:[e(o,{name:"search",size:16}),e("span",{children:t("Find a room")}),e("kbd",{children:"⌘K"})]}),i?e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(l)=>Jn(l.currentTarget),children:e(o,{name:"more",size:18})}):null,e("button",{type:"button",className:"header-button icon-button","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(l)=>On(l.currentTarget),children:e(o,{name:"plus"})})]})]}),R?n("div",{className:"arrange-bar",children:[n("button",{type:"button",className:"secondary",onClick:()=>Ce({kind:"new"}),children:[e(o,{name:"plus",size:16}),e("span",{children:t("Add a folder")})]}),e("button",{type:"button",onClick:()=>yi(!1),children:t("Done")})]}):null,i&&D&&!d?e(_,{children:t("No rooms yet. Rooms appear when the team has a knight.")}):null,!i?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,e(v,{title:t("Home"),rooms:w,...b}),e(v,{title:t("Pinned"),rooms:z,zone:{kind:"pinned",id:"pinned"},...b}),N.length>0?e("div",{className:"stack folder-list","data-folder-list":"",children:e(Q,{fallback:e("div",{className:"skeleton","aria-busy":"true"}),children:e(F,{folders:N,active:s.active,listed:i,rooms:(l)=>e(L,{rooms:l,threads:C,active:s.active,arranging:R})})})}):null,N.length>0?e(v,{title:t("Ungrouped"),rooms:A,zone:{kind:"rest",id:"rest"},...b}):n(m,{children:[e(v,{title:t("Knights"),rooms:P,zone:{kind:"rest",id:"rest-agents"},...b}),e(v,{title:t("Groups"),rooms:T,zone:{kind:"rest",id:"rest-groups"},...b})]}),f.open.length+f.closed.length>0?n("section",{className:"stack",children:[e("h2",{className:"section-title",children:t("Dispatch threads")}),e(bi,{open:f.open,closed:f.closed,active:s.active})]}):null,e(Rr,{active:s.active})]})}export{re as ArrangedRoomsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,te,y,d,f}from"./chunk-index-2e4am3hw.js";import{nn}from"./chunk-index-kbrg32sx.js";import"./chunk-index-e2dqjde8.js";import{Sn,Lr}from"./chunk-index-6bkcq9ka.js";import{ee}from"./chunk-index-cdctnw71.js";import{Wr}from"./chunk-index-b8cpvr7y.js";import"./chunk-index-rh0x9rzf.js";var s=500,c=(n)=>{let r=[];for(let e=0;e<n.length;e+=s)r.push(n.slice(e,e+s));return r},i=()=>y.dispatch({type:"changed"});async function P(n){let r=Wr(n),e=Object.keys(r);if(e.length===0)return;let a=[];try{for(let o of c(e))a.push(...(await Sn.readAll(o)).moved)}catch(o){f(d(o),"danger"),i();return}nn(Object.fromEntries(e.map((o)=>[o,0]))),f(te(e.length,"Marked {count} room as read","Marked {count} rooms as read"),"info",a.length?{label:t("Undo"),run:()=>void m(a,r)}:void 0)}async function m(n,r){try{for(let e of c(n)){let{restored:a}=await Sn.unreadAll(e);nn(Object.fromEntries(a.map((o)=>[o,r[o]??0])))}}catch(e){f(d(e),"danger")}i()}var R=(n)=>Lr(n);async function l(n){try{await Sn.restoreHelpers(n)}catch(r){f(d(r),"danger")}i()}async function T(n){let r;try{r=(await Sn.archiveFinishedHelpers(n)).archived.flatMap((a)=>a.names)}catch(e){f(d(e),"danger"),i();return}if(i(),r.length===0)return;f(te(r.length,"Archived {count} temp knight","Archived {count} temp knights"),"info",{label:t("Undo"),run:()=>void l(r)})}async function x(n,r){try{await ee.archiveAgent(n)}catch(e){f(d(e),"danger"),i();return}i(),f(t("Archived {name}",{name:r}),"info",{label:t("Undo"),run:()=>void l([n])})}export{x as archiveHelper,R as clearAllFinished,T as clearFinishedHelpers,P as markAllRead,l as putBackHelpers};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ze,Ht,G,vi,xn}from"./chunk-index-b73y2gc0.js";import{J,xr,s,N,M,a,r,t,c,m,e,n,di,ce,O,d,f,yn,ue,We,He}from"./chunk-index-2e4am3hw.js";import{K}from"./chunk-index-jgzygbt8.js";import{L}from"./chunk-index-8d81qy69.js";var fe={"hat.none":"No hat","hat.goggcap":"Leather cap","hat.tallcap":"Burgundian felt cap","hat.softcap":"Soft cap","hat.hardhat":"Iron skullcap","hat.fcap":"Hunter's cap","hat.winghelm":"Winged helm","hat.helm":"Helm","hat.mortar":"Biretta","hat.beret":"Chaperon","hat.goggles":"Pointed cap","hat.tricorn":"Pilgrim hat","hat.sailor":"Straw hat","hat.kettle":"Kettle hat","hat.cavalier":"Feathered hat","hat.toque":"Linen cook's cap","hair.none":"No hair","beard.none":"No beard","accessory.none":"No accessory","prop.beads":"Prayer beads","prop.marotte":"Marotte","prop.map":"Chart","prop.flask":"Alchemist's phial","prop.telescope":"Astrolabe","prop.wrench":"Dividers","outfit.surplice":"Surplice","outfit.overalls":"Work jerkin","outfit.armor":"Mail hauberk","outfit.apron":"Smith's apron","outfit.chef":"Cook's tunic","outfit.coat":"Doublet","outfit.vest":"Pourpoint","outfit.sailor":"Mariner's tunic","hair.bob":"Bob","hair.bun":"Bun","hair.ponytail":"Ponytail"},Y=(i)=>i.charAt(0).toUpperCase()+i.slice(1);function S(i,l){let b=`character.${i}.${l}`,g=t(b);if(g!==b)return g;if(i==="class")return G.classes[l]?.label??Y(l);return fe[`${i}.${l}`]??Y(l)}function Z(i){let l=`character.jobs.${i}`,b=t(l);return b!==l?b:G.classes[i]?.jobs??""}var z=[{field:"hat",title:c("Hat"),ids:G.hats},{field:"outfit",title:c("Outfit"),ids:G.outfits},{field:"prop",title:c("Prop"),ids:G.props},{field:"hair",title:c("Hair"),ids:G.hair},{field:"beard",title:c("Beard"),ids:["none",...G.beards]},{field:"accessory",title:c("Accessory"),ids:["none",...G.accessories]}],me=new Set(["class","colors","palette","build","skin","hairColor",...z.map((i)=>i.field)]),re=Object.keys(G.palettes),ee={idle:c("Idle"),thinking:c("Thinking"),working:c("Working"),waiting:c("Waiting for you"),done:c("Done"),error:c("Error"),sleepy:c("Sleepy")},he={slim:c("Slim"),regular:c("Regular"),stout:c("Stout")};function W(i){return{class:i.class,outfit:i.outfit,hat:i.hat,prop:i.prop,hair:i.hair,beard:i.beard,accessory:i.accessory,build:i.build,skin:i.skin,hairColor:i.hairColor,colors:{...i.colors}}}var te=(i)=>JSON.stringify(W(i)),k=(i)=>i[Math.floor(Math.random()*i.length)];function be(){return{class:k(Ze),outfit:k(G.outfits),hat:k(G.hats),prop:k(G.props),hair:k(G.hair),beard:k(["none",...G.beards]),accessory:k(["none",...G.accessories]),build:k(["slim","regular","stout"]),skin:k([0,1,2,3,4,5]),hairColor:k(G.hairColors),palette:k(re)}}var ie=J(function(l){return n("button",{type:"button",className:"creator-tile","aria-pressed":l.pressed,title:l.hint?`${l.label} — ${l.hint}`:l.label,onClick:l.onPick,...l.data,children:[e(ue,{spec:l.spec,size:l.size,live:!1}),e("span",{children:l.label})]})});function ge(i,l,b){let g=JSON.stringify({...i,[l]:0});return M(()=>b.map((u)=>({...i,[l]:u})),[g,l,b])}function pe(){let i=a(null),[l,b]=r();return s(()=>{let g=i.current;if(!g)return;let u=()=>{let v=g.scrollLeft>1,w=g.scrollLeft+g.clientWidth<g.scrollWidth-1;b(v&&w?"both":w?"end":v?"start":void 0)};u(),g.addEventListener("scroll",u,{passive:!0});let p=typeof ResizeObserver>"u"?void 0:new ResizeObserver(u);return p?.observe(g),()=>{g.removeEventListener("scroll",u),p?.disconnect()}},[]),[i,l]}function ye(i){let{part:l}=i,b=ge(i.shown,l.field,l.ids),[g,u]=pe();return e("div",{className:"creator-strip",ref:g,"data-more":u,children:l.ids.map((p,v)=>e(ie,{data:{[`data-${l.field}`]:p},spec:b[v],size:44,label:S(l.field,p),pressed:i.draft[l.field]===p,onPick:()=>i.onPick(p)},p))})}function H(i){return e("button",{type:"button",className:"creator-swatch","aria-pressed":i.pressed,"aria-label":i.label,title:i.label,style:{background:i.background},onClick:i.onPick,...i.data})}function P(i){return n("div",{className:"creator-field","data-field":i.field,children:[i.title?e("h3",{children:i.title}):null,i.children,i.error?e("p",{className:"field-error",role:"alert",children:i.error}):null]})}function Me(i){let[l,b]=r(i.character),g=xr(l),[u,p]=r({}),[v,w]=r(!1),[R,ne]=r("idle"),[U,T]=r(),[I,_]=r(),j=He("(max-width: 719px)"),V=a(null),D=N(),oe=We(l),se=yn(),A=te(l)!==te(i.character);s(()=>b(i.character),[i.character]),s(()=>{if(!A||i.onPick)return;let o=(y)=>y.preventDefault(),h=(y)=>{if(y.button!==0||y.metaKey||y.ctrlKey||y.shiftKey||y.altKey)return;let E=y.target instanceof Element?y.target.closest("a"):null;if(!E||E.target||E.hasAttribute("download"))return;if(V.current?.contains(E))return;y.preventDefault(),y.stopPropagation(),T({kind:"link",anchor:E})},B=di((y)=>T({kind:"navigate",proceed:y}));return window.addEventListener("beforeunload",o),document.addEventListener("click",h,!0),()=>{B(),window.removeEventListener("beforeunload",o),document.removeEventListener("click",h,!0)}},[A,i.onPick]);let C=(o)=>{p({}),b((h)=>vi(o,h))},le=async()=>{if(i.onPick){i.onPick(W(l),l);return}w(!0),p({});try{let o=await O.setCharacter(i.name,W(l));i.onSaved?.(o),f(t("Saved."))}catch(o){let h=o instanceof ce&&o.field?o.field.split(".")[0]:void 0,B=h&&me.has(h)?h:"*";p({[B]:d(o)})}finally{w(!1)}},de=async()=>{let o=U;if(b(i.character),p({}),o?.kind==="link")setTimeout(()=>o.anchor.click(),0);else if(o?.kind==="navigate")o.proceed()},q=e(P,{field:"class",title:t("Class"),error:u.class,children:e("div",{className:"creator-grid",children:Ze.map((o)=>e(ke,{id:o,base:g,pressed:l.class===o,onPick:()=>C({class:o,colors:l.colors})},o))})}),x=n(P,{field:"colors",title:t("Colors"),error:u.colors??u.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),re.map((o)=>{let h=G.palettes[o];return e(H,{data:{"data-palette":o},label:S("palette",o),pressed:l.palette===o,background:`linear-gradient(135deg, ${h.primary} 52%, ${h.trim} 52%)`,onPick:()=>C({palette:o})},o)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((o)=>n("label",{children:[e("span",{children:o==="primary"?t("Primary (the accent)"):o==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:l.colors[o],onChange:(h)=>C({colors:{[o]:h.target.value}})})]},o))})]}),Q=z.map((o)=>e(P,{field:o.field,title:t(o.title),error:u[o.field],children:e(ye,{part:o,draft:l,shown:g,onPick:(h)=>C({[o.field]:h})})},o.field)),X=n(m,{children:[e(P,{field:"build",title:t("Build"),error:u.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((o)=>n("label",{"data-checked":l.build===o,children:[e("input",{type:"radio",name:`${D}-build`,checked:l.build===o,onChange:()=>C({build:o})}),ae(o)]},o))]})}),e(P,{field:"skin",title:t("Skin tone"),error:u.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),(se??G.skins).map((o,h)=>e(H,{data:{"data-skin":String(h)},label:t("Skin tone {n}",{n:h+1}),pressed:l.skin===h,background:o,onPick:()=>C({skin:h})},h))]})}),e(P,{field:"hairColor",title:t("Hair color"),error:u.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),G.hairColors.map((o,h)=>e(H,{data:{"data-hair-color":o},label:t("Hair color {n}",{n:h+1}),pressed:l.hairColor===o,background:o,onPick:()=>C({hairColor:o})},o)),e("input",{type:"color","aria-label":t("Hair color"),value:l.hairColor,onChange:(o)=>C({hairColor:o.target.value})})]})})]}),F=[{id:"class",title:t("Class"),summary:S("class",l.class),error:u.class,node:q},{id:"colors",title:t("Colors"),summary:l.palette?S("palette",l.palette):l.colors.primary,error:u.colors??u.palette,node:x},...z.map((o,h)=>({id:o.field,title:t(o.title),summary:S(o.field,l[o.field]),error:u[o.field],node:Q[h]})),{id:"body",title:t("Body"),summary:ae(l.build),error:u.build??u.skin??u.hairColor,node:X}];return n("form",{ref:V,className:"creator",style:oe,"aria-labelledby":D,onSubmit:(o)=>{if(o.preventDefault(),(A||i.onPick)&&!v)le()},children:[e("h2",{id:D,className:"visually-hidden",children:t("Character of {name}",{name:i.displayName})}),n("div",{className:"creator-preview",children:[e(ue,{spec:l,name:i.name,state:R,size:176,label:t("{name}, {state}",{name:i.displayName,state:t(ee[R])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>ne((o)=>Ht[(Ht.indexOf(o)+1)%Ht.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(ee[R])})]}),n("div",{className:"creator-body",children:[u["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:u["*"]}):null,j?e("ul",{className:"creator-sections",children:F.map((o)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>_(o.id),children:[e("strong",{children:o.title}),e("span",{className:"meta",children:o.summary}),o.error?e("span",{className:"field-error",role:"alert",children:o.error}):null]})},o.id))}):n(m,{children:[q,x,Q,X]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{p({}),b(xn({name:i.name,displayName:i.displayName,prompt:i.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>C(be()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(i.onCancel)i.onCancel();else if(A)T({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!A&&!i.onPick||v,children:v?t("Saving…"):i.onPick?t("Use this look"):t("Save")})]})]}),e(L,{open:j&&I!==void 0,title:F.find((o)=>o.id===I)?.title??"",onClose:()=>_(void 0),children:e("div",{className:"stack",children:F.find((o)=>o.id===I)?.node})}),e(K,{open:U!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>T(void 0),onConfirm:de,children:e("p",{children:t("The new look for {name} has not been saved.",{name:i.displayName})})})]})}var ae=(i)=>t(he[i]);function ke(i){let l=i.base.colors,b=M(()=>vi({class:i.id,colors:l}),[i.id,l]);return e(ie,{data:{"data-class":i.id},spec:b,size:56,label:S("class",i.id),hint:Z(i.id),pressed:i.pressed,onPick:i.onPick})}export{Me as CharacterCreator};
|