pi-roundtable-web 0.24.1 → 0.25.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 +37 -0
- package/README.md +51 -9
- package/dist/chunk-action-menu-qe839g4b.js +1 -0
- package/dist/chunk-agent-0pm9p3nn.js +1 -0
- package/dist/chunk-arranged-rooms-enpfswmg.js +1 -0
- package/dist/chunk-character-creator-6yf29xwx.js +1 -0
- package/dist/chunk-codeeditor-gdbdg7rp.js +2 -0
- package/dist/chunk-confirm-xrw7d732.js +1 -0
- package/dist/chunk-connectors-anhghy3k.js +1 -0
- package/dist/chunk-conversations-ry228aes.js +1 -0
- package/dist/chunk-drag-q4fx9b22.js +1 -0
- package/dist/chunk-entry-he1embgp.js +1 -0
- package/dist/chunk-folder-list-5cp8stna.js +1 -0
- package/dist/chunk-folds-hff104tk.js +1 -0
- package/dist/chunk-group-scene-h228jdat.js +1 -0
- package/dist/chunk-index-0p5h2kdz.js +2 -0
- package/dist/chunk-index-0pt08yd9.js +1 -0
- package/dist/chunk-index-12bw9yj8.js +2 -0
- package/dist/chunk-index-18gxy79n.js +47 -0
- package/dist/{chunk-index-mpm90318.js → chunk-index-27qca4mr.js} +2 -2
- package/dist/chunk-index-2ad17eh4.js +2 -0
- package/dist/chunk-index-31wh5twj.js +52 -0
- package/dist/chunk-index-4dy94pbz.js +2 -0
- package/dist/chunk-index-4ecjtdy8.js +13 -0
- package/dist/chunk-index-4v1b7ks9.js +2 -0
- package/dist/chunk-index-5d8yjj4m.js +2 -0
- package/dist/chunk-index-89ajmxh7.js +2 -0
- package/dist/chunk-index-9b1kt7qw.css +1 -0
- package/dist/chunk-index-9jqcskb4.js +14 -0
- package/dist/chunk-index-b9ny4623.js +2 -0
- package/dist/chunk-index-bvfqjh77.js +2 -0
- package/dist/chunk-index-d5abvq7v.js +2 -0
- package/dist/chunk-index-e1dr6g10.js +2 -0
- package/dist/chunk-index-gpkzhq1g.js +2 -0
- package/dist/chunk-index-hk3xyy20.js +2 -0
- package/dist/chunk-index-jm23vn03.js +4 -0
- package/dist/chunk-index-k7gh0jvz.js +2 -0
- package/dist/{chunk-index-6t68gbex.js → chunk-index-krtk6nn2.js} +2 -2
- package/dist/chunk-index-ky42ev0b.js +2 -0
- package/dist/chunk-index-pa2yyqh0.js +2 -0
- package/dist/chunk-index-pcvt668q.js +2 -0
- package/dist/chunk-index-pqw27eye.js +1 -0
- package/dist/chunk-index-s681nny9.js +2 -0
- package/dist/chunk-index-wmbmmrd4.js +302 -0
- package/dist/chunk-index-ymbjrsp6.js +2 -0
- package/dist/chunk-index-zfd00hwb.js +2 -0
- package/dist/chunk-lang-css-t85r8rz0.js +1 -0
- package/dist/{chunk-lang-dockerfile-ey0nvhhm.js → chunk-lang-dockerfile-d5mzxs60.js} +1 -1
- package/dist/{chunk-lang-go-403qsw9f.js → chunk-lang-go-830fmhba.js} +3 -3
- package/dist/chunk-lang-html-n6jparge.js +1 -0
- package/dist/chunk-lang-javascript-xj00cp97.js +1 -0
- package/dist/chunk-lang-json-5eaarz7j.js +1 -0
- package/dist/chunk-lang-markdown-zxx8eke8.js +6 -0
- package/dist/{chunk-lang-python-9jk5a49y.js → chunk-lang-python-fjw84w10.js} +2 -2
- package/dist/chunk-lang-rust-5rbp2zdk.js +1 -0
- package/dist/{chunk-lang-shell-cgq6q0kj.js → chunk-lang-shell-vzagpym3.js} +1 -1
- package/dist/chunk-lang-sql-0c2w9c2y.js +2 -0
- package/dist/{chunk-lang-toml-xh45nm68.js → chunk-lang-toml-yr9fv6eb.js} +1 -1
- package/dist/chunk-lang-typescript-8f6yywt3.js +1 -0
- package/dist/{chunk-lang-xml-1mh879j9.js → chunk-lang-xml-eze08p42.js} +1 -1
- package/dist/{chunk-lang-yaml-jac98srt.js → chunk-lang-yaml-c4b6ft3y.js} +1 -1
- package/dist/chunk-layout-actions-bv0chj41.js +1 -0
- package/dist/chunk-menu-items-jrwxycr1.js +2 -0
- package/dist/chunk-notes-9b7pgqfe.js +1 -0
- package/dist/chunk-overview-8yw71esz.js +1 -0
- package/dist/chunk-palette-frms7axe.js +1 -0
- package/dist/chunk-placement-items-fvfy9m0y.js +1 -0
- package/dist/chunk-prompt-history-yrqehads.js +1 -0
- package/dist/chunk-prompts-g6609tqx.js +1 -0
- package/dist/chunk-room-confirms-0a2y0925.js +1 -0
- package/dist/chunk-room-menu-g11q97br.js +1 -0
- package/dist/chunk-rooms-menu-button-h9qge48n.js +1 -0
- package/dist/chunk-schedules-ezmacrbj.js +1 -0
- package/dist/chunk-seat-menu-jv4s7hmj.js +1 -0
- package/dist/chunk-sheet-hosts-b0azyfhb.js +1 -0
- package/dist/chunk-skill-editor-h6k6whwg.js +8 -0
- package/dist/chunk-skills-gqcfhq56.js +1 -0
- package/dist/chunk-switcher-list-mcpamqnj.js +1 -0
- package/dist/chunk-table-s8cde1xz.js +1 -0
- package/dist/chunk-table-seats-wqkjn8bc.js +1 -0
- package/dist/chunk-table2d-4sje1fr0.js +1 -0
- package/dist/chunk-table3d-h64skazp.js +4220 -0
- package/dist/chunk-transcript-c59c6mpm.js +1 -0
- package/dist/chunk-workspace-0cyspkk4.js +1 -0
- package/dist/chunk-zh-tw-nc93jm10.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 +214 -2
- package/src/app/api-http.ts +66 -0
- package/src/app/app.ts +18 -1
- package/src/app/card-log.ts +6 -0
- package/src/app/layout-routes.ts +239 -0
- package/src/app/layout.ts +133 -0
- package/src/app/prompt-routes.ts +167 -0
- package/src/app/room-log.ts +7 -0
- package/src/app/rooms.ts +23 -0
- package/src/app/routes.ts +155 -131
- package/src/app/skill-doc-routes.ts +122 -0
- package/src/app/team-routes.ts +457 -0
- package/src/app/threads.ts +14 -0
- package/src/i18n/zh-tw.ts +177 -10
- package/src/layout-order.ts +210 -0
- package/src/push/mutes.ts +17 -0
- package/src/web-plugin.ts +25 -0
- package/dist/chunk-action-menu-7v5fce2v.js +0 -1
- package/dist/chunk-agent-2rw4ydw2.js +0 -1
- package/dist/chunk-agent-sheet-2q24dkkf.js +0 -3
- package/dist/chunk-character-creator-8q6ympxj.js +0 -1
- package/dist/chunk-codeeditor-fgmq298t.js +0 -2
- package/dist/chunk-connectors-mr53r7fh.js +0 -1
- package/dist/chunk-conversations-4vy2z6w9.js +0 -1
- package/dist/chunk-entry-jg1eem82.js +0 -1
- package/dist/chunk-group-scene-na95b1te.js +0 -1
- package/dist/chunk-index-11rjg8a8.js +0 -1
- package/dist/chunk-index-1y50d6sj.js +0 -2
- package/dist/chunk-index-5y2r0eaj.js +0 -47
- package/dist/chunk-index-7fphxxzd.js +0 -14
- package/dist/chunk-index-80f1zkp6.css +0 -1
- package/dist/chunk-index-87h45frg.js +0 -2
- package/dist/chunk-index-bnwmssyn.js +0 -2
- package/dist/chunk-index-ckgbszwt.js +0 -51
- package/dist/chunk-index-fmjjekhd.js +0 -2
- package/dist/chunk-index-t1m65yn6.js +0 -13
- package/dist/chunk-index-t711t17m.js +0 -2
- package/dist/chunk-index-txv7qvyy.js +0 -2
- package/dist/chunk-index-wr3dg24d.js +0 -2
- package/dist/chunk-index-yx683d5n.js +0 -2
- package/dist/chunk-lang-css-fkdg3x8x.js +0 -1
- package/dist/chunk-lang-html-v8h9g977.js +0 -1
- package/dist/chunk-lang-javascript-ykb2vhaa.js +0 -1
- package/dist/chunk-lang-json-2rze3rpy.js +0 -1
- package/dist/chunk-lang-markdown-6w2htnfc.js +0 -6
- package/dist/chunk-lang-rust-24fggcqx.js +0 -1
- package/dist/chunk-lang-sql-gjywb9ke.js +0 -2
- package/dist/chunk-lang-typescript-qh6rebyb.js +0 -1
- package/dist/chunk-menu-items-zjpyj51b.js +0 -2
- package/dist/chunk-notes-sjba7kw3.js +0 -1
- package/dist/chunk-overview-26r77kb6.js +0 -1
- package/dist/chunk-room-confirms-851184ep.js +0 -1
- package/dist/chunk-room-menu-8y9c026y.js +0 -1
- package/dist/chunk-skills-56s4hdbn.js +0 -1
- package/dist/chunk-table-qykpvp32.js +0 -1
- package/dist/chunk-table2d-k60ressj.js +0 -1
- package/dist/chunk-table3d-bv2ajk39.js +0 -4220
- package/dist/chunk-transcript-vekz1mh6.js +0 -1
- package/dist/chunk-workspace-hevefd0d.js +0 -1
- package/dist/chunk-zh-tw-5r2wjre0.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,43 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.25.0] - 2026-10-29
|
|
9
|
+
|
|
10
|
+
The core peer range is now `>=0.25.0 <0.26.0`.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Make, archive and arrange agents. The **+** button of the room list and of the switcher drawer opens a menu: **New agent**, **New group** and **Archived**. New agent takes a name, the permanent name (`^[a-z0-9-]{1,32}$`, filled in from the name until typed by hand), the prompt, a model, an optional opening task and a look (the one its role suggests, or one picked in the character creator, which opens in place of the form), and opens the new agent's room. A bad or taken name, an unusable model, a bad look field (`400 {error, field}`) and an unknown skill are refused with the agent server's words before anything is made.
|
|
15
|
+
- Archive and restore. **Archive agent** and **Archive group** are in the agent sheet, the room's ⋯ menu and the long-press menu of a row (not on the coordinator's room, which cannot be archived), and ask first, naming what they archive. **Archived** lists archived agents and groups with Restore and Delete; Delete is only for an archived one, asks first and names it, frees the name, and clears the room's messages, cards, mute and modes in this app, and the dispatch threads under it with their messages and cards. Restoring an agent does not put it back in its groups; a group is restored only while all its members are active.
|
|
16
|
+
- Skills. The agent sheet lists the host's skills (the Skills pane's catalog when the host supplies one, else the skills addon's) with a switch each, applied as it is flipped. Built-in skills stay on; a host without the skills addon shows no section.
|
|
17
|
+
- Groups. **New group** and **Edit group** (the group's header name, its ⋯ menu, its row's menu) take a name, 2 to 6 members in the order picked, and the host; Edit sends only what changed.
|
|
18
|
+
- New owner-only routes, with the tier read again, the console `Origin` on every write, `404` for an agent, group or room that does not exist and `400` for a bad body or what the agent server refuses: `POST api/agents` (`201`, the profile), `POST api/agents/<name>/archive`, `POST api/agents/<name>/restore`, `DELETE api/agents/<name>`, `GET` and `PUT api/agents/<name>/skills` (`{add?, remove?}`, one change), `POST api/groups` (`201`), `GET`, `PATCH` and `DELETE api/groups/<name>`, `POST api/groups/<name>/archive` and `restore`, and `GET api/archive`. They call `AgentTeam.createAgent`, `archive`, `restore`, `remove`, `createGroup` and `updateGroup` and the skill registry's `attach`, and tell the open pages to read the room list again. Needs `pi-roundtable` with those methods.
|
|
19
|
+
- The new sheets (the new agent form, the group editor and the archive) are one chunk that loads when first opened; the creator takes an `onPick` mode that hands back the look instead of saving it.
|
|
20
|
+
- Main prompts. **Main prompts** (a link in Settings, shown only on a host with prompt documents) lists the documents the host registered through `PROMPTS` (`shared` and `guest` from `prompts.*`, and a plugin's own, such as a persona), each with a "Differs from the file version" badge and who set the override and when. One opens in a full-screen sheet with the text in force, **Review changes** (a line diff against what the text was read as, nothing is saved before it), **Save**, **History** (each change newest first, read against the version before it, **Use this text** takes it into the editor to be reviewed again) and **Revert to the file version**, which asks first and names the document. A save sends the text it was edited from (`base`); when the document changed meanwhile the server answers `409 {error, conflict: "changed", current}`, and the page reads the diff again against the text there now and keeps the draft. The override applies from the agent's next turn.
|
|
21
|
+
- Agent prompt history. The agent sheet gains **History** for the prompt: the versions of that agent's prompt, who changed it and when, and **Use this text**, which puts a version into the editor to be reviewed like any edit. An agent has no override layer; its saved prompt is the text in force. A prompt change from the sheet is kept under the owner's name.
|
|
22
|
+
- Skills editing. The Skills page edits an agent-written skill's whole SKILL.md (frontmatter and body) in a full-screen sheet, with the same frontmatter and size rules as the skill tools (the server's words are shown), a diff to read before **Save**, a history of versions and a `409` that reads the diff again against the version there now (the file is read with its SHA-256 hash and saved with it as `baseHash`). **New skill** starts from a template, reads as an all-added diff and creates the skill, attached to no agent. A built-in, package or linked skill shows a lock and where it comes from instead of **Edit**. Deleting a skill is not offered: the registry has no safe delete, and an agent still carrying one would lose it silently. A page without the owner app keeps the old hint.
|
|
23
|
+
- New owner-only routes, with the tier read again, the console `Origin` on every write, `404` for a prompt or skill that does not exist and `400` for a bad body or what the host refuses: `GET api/prompts` (`{documents}`; a document whose file version cannot be read has `broken`, the reason, and the others are listed as usual; the page marks it **File version cannot be read** and shows the reason instead of an editor), `GET` and `PUT api/prompts/<id>` (`{text, base}`; `409` with `current` when `base` is not the text in force), `POST api/prompts/<id>/revert` (`{base}`, with the same `409`), `GET api/prompts/<id>/history`, `GET api/agents/<name>/prompt-history`, `GET` and `PUT api/skill-docs/<name>` (`{text, baseHash}`), `POST api/skill-docs` (`{text}`; `201`) and `GET api/skill-docs/<name>/history`. `GET api/session` carries `prompts: true` when the host has prompt documents and `skillEdit: true` when it has the skills addon; the flags follow the host only, and each route reads the tier again and answers `403` below the owner. The body of a prompt write may be as large as the document's `maxChars` needs for the new text and for `base` (6 bytes a character at most), more than a plugin's roomy document would fit in a fixed 128 KiB; a larger body is `413`. Needs `pi-roundtable` with `PROMPTS` and the skill registry's documents.
|
|
24
|
+
- The editors (prompts and skills) are chunks that load when first opened; the page's first load does not grow.
|
|
25
|
+
- Pins and folders for the room list. The owners arrange it together, one layout for the whole app that every device shows: Home first, the pinned rooms in the owners' order, the owners' folders in theirs, and the rest (Ungrouped) by latest activity. A room is pinned or in one folder, not both. A room's menu (and the room header's ⋯) gains Pin or Unpin, Move to folder… and, in the list, Move up or Move down; a folder's header folds (per device, in `localStorage`; the folder with the open room shows open, and a folded folder still shows its rooms' waiting cards and working dots) and has a menu to rename, mute or unmute the whole folder, step and delete (after a question; its rooms go to Ungrouped); the list's ⋯ adds a folder and turns on arrange mode, which shows a ⋯ beside each row. The switcher drawer follows the same order with a heading for each folder.
|
|
26
|
+
- Reordering by hand: a finger that rests on a row lifts it, and dragging reorders it within its list or moves it into another folder, the pinned list or Ungrouped (a folded folder opens after the finger rests on it); a held folder header moves the folder. The rows make room, the list scrolls near its edges, the drop place is outlined, and Escape or a drop outside every list cancels. A mouse drags once it moves with the button down; a touch within 32 px of a screen edge never lifts a row. Ungrouped stays by activity, so a row dragged within it goes back. The lists keep their order while a row is lifted, the pinned list and empty folders appear as places to drop, and on Android the browser's own long press is the hold. The arranged list, its folders and styles, the lift code (hand-rolled on pointer events, about 5 KB minified) and the drawer's rows are chunks of their own, so a page with nothing arranged downloads next to nothing for them; Move up and Move down are the keyboard way.
|
|
27
|
+
- `GET api/rooms` also answers `pins` and `folders`; new owner-only routes `PUT rooms/<key>/pin`, `PUT rooms/<key>/folder`, `POST api/folders`, `PATCH` and `DELETE api/folders/<id>`, and `PUT api/folders/<id>/mute`, which mutes or unmutes every room of a folder through the rooms' own mutes in one step. Each write rereads the person's tier, needs the console's own `Origin`, takes one advisory lock, answers with the whole layout and sends `changed` to the other pages. Three additive tables, `web_room_folders`, `web_room_folder_rooms` and `web_room_pins`, in the new migration `web-room-layout`; nothing is dropped, and a room that no longer exists keeps its place and is not shown. Types `FolderView` and `LayoutView`, and `RoomsView` extends the latter.
|
|
28
|
+
- Deleting an agent or a group also drops its pin or folder place.
|
|
29
|
+
- Who sits at the round table. A **Who's at the table** button in the page's header opens a sheet (a bottom sheet under 720 px, a dialog wider) that lists every agent with its picture and a switch. Taking an agent off the table is muting its room's push (`PUT rooms/<key>/mute`, shared by every owner and device) and putting it back is unmuting it, so the table, the agent sheet and the room menu share one switch: the table seats exactly the agents whose room is not muted, and muting a room anywhere takes its agent off the table. **Leave the table** is also in a seat's menu (long press, right click or the Menu key; the scene's new `onSeatMenu` option and `seatAt`) and in the dialogue box's ⋯ button. The table re-seats at once and keeps the camera still unless it was on the agent who left, when it returns to `#/table` in place. With everyone off the table the page shows an empty state with the sheet's button; an off-table agent stays in the rooms list with its bell-slash; a group room's table still seats all its members. Traditional Chinese for the new wording.
|
|
30
|
+
- Leaving and joining play a short show in the hall's style. A leaving seat squashes and vanishes in flat, outlined smoke clouds that drift up with a few sparkles (about 0.7 s), the others glide to their new places, and a joining seat rises out of a small rune circle with a bounce and a column of light (about 0.85 s). The pictures are drawn on small canvases and disposed when the show ends. Under reduced motion the picture only dips and returns; the 2D fallback fades in over a ring and out inside a puff with CSS. A seat's picture is kept across rings, so the others do not flicker while the ring is rebuilt.
|
|
31
|
+
- Traditional Chinese for the new wording.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- The search palette (⌘K) and the schedules pane are lazy chunks, and the question and sheet hosts (agent, team, confirms) share one, so the page loads them after the first screen instead of with it.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- The round table's overview keeps every seat and its name in the picture on a phone. It left half a name's width clear of the sides (the names are page text, about 44 px each side of a seat) and counted the standee's emphasis strokes, which stand wider than its board; a window resized during a camera turn now ends that turn on the new picture's overview.
|
|
40
|
+
|
|
41
|
+
## [0.24.2] - 2026-10-29
|
|
42
|
+
|
|
43
|
+
- Release in lockstep with pi-roundtable 0.24.2; no package-specific behavior changes. The core peer range stays `>=0.24.0 <0.25.0`.
|
|
44
|
+
|
|
8
45
|
## [0.24.1] - 2026-10-29
|
|
9
46
|
|
|
10
47
|
- Release in lockstep with pi-roundtable 0.24.1; no package-specific behavior changes. The core peer range stays `>=0.24.0 <0.25.0`.
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Then only a person whose principal holds the owner role gets in.
|
|
|
20
20
|
## Contents
|
|
21
21
|
|
|
22
22
|
- [Requirements](#requirements) and [Install](#install)
|
|
23
|
-
- [The owner app](#the-owner-app): rooms, cards, [modes](#modes-yolo-and-long-running), [dispatch threads](#dispatch-threads), [uploads](#uploads), [characters](#characters-in-the-page), [the Camelot look](#the-camelot-look), [the round table](#the-round-table), [the files pane](#the-files-pane)
|
|
23
|
+
- [The owner app](#the-owner-app): rooms, cards, [modes](#modes-yolo-and-long-running), [dispatch threads](#dispatch-threads), [pins and folders](#pins-and-folders), [uploads](#uploads), [characters](#characters-in-the-page), [the Camelot look](#the-camelot-look), [the round table](#the-round-table), [the files pane](#the-files-pane)
|
|
24
24
|
- [Install on a device](#install-on-a-device) and [Notifications](#notifications)
|
|
25
25
|
- [Authentication](#authentication) and the [threat model](#threat-model)
|
|
26
26
|
- [Options](#options), [the console's panes](#the-consoles-panes) and [host feature ports](#host-feature-ports)
|
|
@@ -28,7 +28,7 @@ Then only a person whose principal holds the owner role gets in.
|
|
|
28
28
|
|
|
29
29
|
## Requirements
|
|
30
30
|
|
|
31
|
-
- Bun 1.4.4 or later, and pi-roundtable `>=0.
|
|
31
|
+
- Bun 1.4.4 or later, and pi-roundtable `>=0.25.0 <0.26.0` as a peer dependency.
|
|
32
32
|
- 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/`.
|
|
33
33
|
- 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.
|
|
34
34
|
- 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.
|
|
@@ -104,14 +104,15 @@ The page is built for a phone first: a bottom tab bar under 720 px, a side rail
|
|
|
104
104
|
|
|
105
105
|
| Where | What it does |
|
|
106
106
|
|---|---|
|
|
107
|
-
| **Rooms** | Home first, then
|
|
107
|
+
| **Rooms** | Home first, then the pinned rooms, the owners' folders and the rest by latest activity, each with its dispatch threads, with badges for working, a card waiting, yolo and long-running (see [Pins and folders](#pins-and-folders)). |
|
|
108
108
|
| **A room** | Each message with its author's picture and name, Markdown (raw HTML is shown as text), files, and a live progress strip with the streamed text and tool chips. A sticky composer with upload and Stop. The header menu holds the mode switches, Profile and Start over. |
|
|
109
109
|
| **Cards** | Inline in the room: an approval with the call's details and a copy button; a question with options, an "Other" field and Cancel; a questionnaire; and the card at a turn's time limit. Answered cards show the answer given. |
|
|
110
|
-
| **Agent
|
|
110
|
+
| **Agent sheet** | Display name, prompt (with its History), model and thinking level, the skills it carries, Notifications, the character creator (see [Characters in the page](#characters-in-the-page)) and Archive. See [Making and arranging agents](#making-and-arranging-agents). |
|
|
111
111
|
| **Schedules** | Every schedule of the team, labelled by room or channel, with a confirmed cancel. |
|
|
112
112
|
| **Table** | The round table (see [The round table](#the-round-table)). |
|
|
113
113
|
| **Files** | The agents' workspace: a tree, highlighted files and an editor (see [The files pane](#the-files-pane)). |
|
|
114
|
-
| **
|
|
114
|
+
| **Main prompts** | The prompt documents of the host (shared, guest, a plugin's own) with their file versions, overrides and history (see [Editing prompts and skills](#editing-prompts-and-skills)). From Settings. |
|
|
115
|
+
| **Settings** | Color scheme and look, the link to Main prompts, install, notifications for this device, and Log out (password mode). |
|
|
115
116
|
|
|
116
117
|
**Sending and stopping.** A message goes to the agent as the owner's. **Stop** ends the turn.
|
|
117
118
|
A message that cannot go shows "Not sent" with Try again and Discard; a lost connection shows a banner under the header and the page reconnects with backoff, then fetches what it missed.
|
|
@@ -146,6 +147,45 @@ The app hosts the core's dispatch threads (`ChatSurface.threads`). A background
|
|
|
146
147
|
|
|
147
148
|
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`.
|
|
148
149
|
|
|
150
|
+
|
|
151
|
+
### Making and arranging agents
|
|
152
|
+
|
|
153
|
+
An owner changes the team from the app. Everything goes through the agent server's own operations (`AgentTeam`), the ones the `agent_create`, `archive` and `group_*` tools use, so an agent made here is the one an agent would make, and an archived one is the one the `archive` tool leaves.
|
|
154
|
+
|
|
155
|
+
- **New agent.** The **+** button of the room list and of the drawer opens a menu with New agent, New group and Archived. New agent asks for a name, the permanent name (lowercase letters, digits and dashes, which names the room and cannot be changed; it follows the name until typed by hand), the prompt, a model, an optional opening task and a look. The look is the one its role suggests until the creator picks another. On success the new agent's room opens. A bad or taken name, an unusable model, a bad look and an unknown skill are refused with the agent server's words before anything is made.
|
|
156
|
+
- **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.
|
|
157
|
+
- **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.
|
|
158
|
+
- **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.
|
|
159
|
+
- **Groups.** New group and Edit group (the group's header name, its ⋯ menu and its row menu) take a name, 2 to 6 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.
|
|
160
|
+
|
|
161
|
+
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.
|
|
162
|
+
|
|
163
|
+
### Editing prompts and skills
|
|
164
|
+
|
|
165
|
+
An owner edits the texts that shape the agents from the app. Both editors are full-screen sheets that load when first opened, and in both nothing is saved before **Review changes** has shown the lines that change.
|
|
166
|
+
|
|
167
|
+
- **Main prompts.** Settings links to the list (on a host that has prompt documents). Each document is a text the host reads from a file or the configuration, with an override the owner stores in the app: the core's `shared` (the base of every agent's prompt) and `guest` (used when the speaker is not the owner), and any a plugin registers through `PROMPTS`. A document that differs from its file version has a badge with who set it and when. **History** lists each change, newest first, and a version can be read against the one before and taken into the editor. **Revert to the file version** asks first, names the document and drops the override. The override applies from the agent's next turn, with no restart, and the host logs a warning at start for each document that differs from its file. Saving sends the text the sheet was edited from; if someone changed the document meanwhile, the sheet reads the diff again against the new text and keeps the draft.
|
|
168
|
+
- **Agent prompts.** An agent's prompt is edited in its sheet as before; **History** there lists the earlier versions and who saved them. There is no override layer for an agent: the saved prompt is the text in force.
|
|
169
|
+
- **Skills.** The Skills page has **Edit** on a skill an agent wrote and **New skill**. The sheet holds the whole SKILL.md, frontmatter included, checked by the same rules as the skill tools; a refusal is shown in the server's words. A save is checked against the hash the file was read with (`409` and a new diff when it changed), and each save is kept as a version in **History**. A built-in, package or linked skill shows a lock and where it comes from, and is changed there. Deleting a skill is not offered here.
|
|
170
|
+
|
|
171
|
+
All of it is for owners: the tier is read again on each call, a change needs the console's `Origin`, and a prompt or skill that does not exist is a 404.
|
|
172
|
+
### Pins and folders
|
|
173
|
+
|
|
174
|
+
The owners arrange the room list together: one layout for the whole app, kept on the server and shown the same on every owner's phone and desktop. The order is **Home** (always first), the **pinned** rooms in the owners' order, the owners' **folders** in theirs, and **Ungrouped**, which holds the rest by latest activity. Until there is a folder, the rest keeps its Agents and Groups headings. A room is in one place: pinning a room takes it out of its folder and putting it in a folder unpins it. Home and dispatch threads (which follow their room) cannot be pinned or filed. The room switcher drawer on a phone lists the rooms in the same order, with a heading for each folder, and the rooms with a card waiting stay on top.
|
|
175
|
+
|
|
176
|
+
| Where | What it does |
|
|
177
|
+
|---|---|
|
|
178
|
+
| A room's menu (long press, right click, or the Menu key; the **⋯** beside a row in arrange mode; or the **⋯** in the room's header) | **Pin** or **Unpin**, **Move to folder…** (a sheet with the folders, Ungrouped and **New folder…**), and **Move up** or **Move down** within the pinned list or the folder. |
|
|
179
|
+
| A folder's header | Fold or unfold it (kept per device in `localStorage`, `roundtable-console:folders-collapsed`; the folder that holds the open room shows open, and a folded folder still shows its rooms' waiting cards and working dots). Its **⋯** (or a long press, right click or the Menu key) offers **Rename**, **Mute the whole folder** or **Unmute the whole folder**, **Move up**, **Move down** and **Delete folder** (after a question; its rooms move to Ungrouped, no room is deleted). A bell-slash shows when every room in it is muted, a fainter one when some are. |
|
|
180
|
+
| The list's **⋯** | **Add a folder**, and **Arrange**, which shows a **⋯** beside every row and a bar to add a folder until **Done**. |
|
|
181
|
+
| A room row or a folder header, held or dragged | A finger that rests on a row lifts it (a short vibration where the phone has one); dragging then reorders it within its list, moves it into another folder, the pinned list or Ungrouped, and a folded folder opens after the finger rests on it. A held folder header moves the whole folder among the folders. The rows make room as you drag, the list scrolls near its edges, the place it lands is outlined, and Escape or a drop outside every list puts everything back. Letting go without moving opens the row's menu as before. A mouse lifts a row once it moves with the button down. A touch within 32 px of a screen edge never lifts a row (the system keeps that edge), so the menu is the way there. While a row is lifted the lists keep their order, so a message that arrives does not move rows under the finger, and the pinned list and empty folders show as places to drop even when they hold nothing yet. On Android the browser's own long press (its `contextmenu`, at about 400 ms) counts as the hold. Ungrouped is ordered by activity, so a row dragged within it goes back; pin it or put it in a folder to place it. The lift code is a chunk of its own that loads on the first press. |
|
|
182
|
+
|
|
183
|
+
Folders have 1 to 40 characters (code points) in their name, no control characters, a name that no other folder has (case does not matter), and there are at most 50. The routes are owner-only, as the mute route is: the person's tier is read again, a write needs the console's own `Origin`, and `GET api/rooms` carries the layout with the rooms so the two never disagree. A stored place of a room that is gone (an archived agent) is kept and not shown, so the room returns to it when it comes back. Folder mute is the rooms' own mute (`web_push_muted_rooms`) set for every room in the folder at once, and a room moved into the folder later keeps its own.
|
|
184
|
+
|
|
185
|
+
Until the owners arrange something, the page is the plain list it always was; the arranged list (folders, the lift, their styles) is a set of chunks that load once there is a pin or a folder, or when the list's **⋯** is used, and the drawer's rows load with the drawer, so the first load costs almost nothing for the feature.
|
|
186
|
+
|
|
187
|
+
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.
|
|
188
|
+
|
|
149
189
|
### Uploads
|
|
150
190
|
|
|
151
191
|
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.
|
|
@@ -178,7 +218,7 @@ Every agent is drawn as its composed character (`pi-roundtable/characters`). The
|
|
|
178
218
|
|
|
179
219
|
### The round table
|
|
180
220
|
|
|
181
|
-
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each active agent (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. More than twelve agents show twelve and a "+N" podium that opens the list.
|
|
221
|
+
The `table` pane is a council hall: a ring of tall dark-wood podiums, one for each active agent whose room is not muted (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. More than twelve agents show twelve and a "+N" podium that opens the list.
|
|
182
222
|
|
|
183
223
|
- **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.
|
|
184
224
|
- **Talking in the scene.** A tap on a podium (or on its name, a button over the plate) turns the camera to that agent and slides up a dialogue box on the agent's own room: a nameplate tab in the agent's color with its 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 own message box, with its unsent text kept per room. **Log** opens the room's whole message list as a sheet over the scene. The address is `#/table/<agent>` (the agent's name or the key of its room): Back returns to the whole ring, a link opens the scene at that agent, and an address that names nobody seated goes back to `#/table`.
|
|
@@ -186,6 +226,8 @@ The `table` pane is a council hall: a ring of tall dark-wood podiums, one for ea
|
|
|
186
226
|
- **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. The seats are also listed as buttons with more than ten seats.
|
|
187
227
|
- **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.
|
|
188
228
|
- **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).
|
|
229
|
+
- **Who sits.** With many agents the table can be thinned out. **Who's at the table** (a button in the page's header) opens a sheet, a bottom sheet on a phone and a dialog elsewhere, that lists every agent with its picture and a switch; an agent switched off leaves the table, and switched on sits down again. Leaving the table *is* muting the agent's room push (the per-room mute, `PUT rooms/<key>/mute`, shared by every owner and device), so there is one switch behind the table, the agent sheet and the room menu: the table seats exactly the agents whose room is not muted, and muting a room anywhere takes its agent off the table. A seat's menu (a long press, a right click or the Menu key) and the ⋯ button of the dialogue box also offer **Leave the table**. An agent off the table stays in the rooms list with its bell-slash, and the table re-seats at once, the camera staying where it was unless it was on the agent who left, when it goes back to the whole ring (`#/table`, in place). With everyone off the table the page says so and offers the sheet. A group room's table is not affected: it seats all its members, muted or not.
|
|
230
|
+
- **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.
|
|
189
231
|
- **Group rooms.** A group room's 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.
|
|
190
232
|
|
|
191
233
|
### The files pane
|
|
@@ -444,7 +486,7 @@ It may be asynchronous; a thrown error or a rejected promise counts as a refusal
|
|
|
444
486
|
|
|
445
487
|
**What the app protects.**
|
|
446
488
|
The conversations hold everything the host's people said to the assistant and what the assistant answered, including tool calls and their results, and the memory notes shape every later turn.
|
|
447
|
-
The app serves that to the host's owners and nobody else, and since 0.23 it also acts for them: a signed-in session can run turns, approve held actions, switch yolo mode on, send files
|
|
489
|
+
The app serves that to the host's owners and nobody else, and since 0.23 it also acts for them: a signed-in session can run turns, approve held actions, switch yolo mode on, send files, change an agent's prompt, model and skills, make, archive and delete agents and groups.
|
|
448
490
|
So the authentication guards the owner's power over the agents, not only their reading.
|
|
449
491
|
Every write, over REST or the WebSocket, needs an authenticated owner whose tier is read again, and an open socket closes (`4401`, `4403`) when the credential lapses or the person stops being an owner.
|
|
450
492
|
Every owner sees every conversation and can read and change every principal's notes; it has no per-user views for members, and no audit trail beyond the host's log, which records only that a request was refused and why.
|
|
@@ -587,7 +629,7 @@ Rooms and Schedules belong to the [owner app](#the-owner-app), and the Round tab
|
|
|
587
629
|
| Overview | Every active agent with its model, thinking level, state (working where, waiting, or idle), context use, schedule count, and last activity; every group with its members, host, and busy count. An agent links to its Discord channel and its transcript, and a group to its Discord channel. |
|
|
588
630
|
| Conversations | Every conversation stored on disk, in four sections: owner channels (direct messages and channels where the owner talks to the assistant), agent channels, group conversations (each member's conversation inside a group), and outside-agent conversations opened over MCP. Each row shows the channel's name (when the host has a Discord connection), when it was last active, its size, and how many archives it has. An outside-agent conversation shows its first message, when it appears in the first 256 KB of the file, and when it began. A conversation the host's registry records also shows whose it is, by their display name, and whether it is private to them or shared. Every owner sees every conversation. |
|
|
589
631
|
| Notes | A principal's memory in three tabs, core, notes, and events, with search: the signed-in owner's own by default, and any principal's the host knows through a picker that appears when there is more than one. The owner can add a note, edit its text, kind, and date, and delete it after a confirmation, in whichever memory is shown. The memory addon's own validation applies, so a refusal shows its reason and saves nothing. |
|
|
590
|
-
| Skills | The full host catalog, source, groups and carriers; each available skill opens its ordered frontmatter and Markdown body. |
|
|
632
|
+
| Skills | The full host catalog, source, groups and carriers; each available skill opens its ordered frontmatter and Markdown body, and an owner edits an agent-written skill or makes a new one. |
|
|
591
633
|
| Connectors | Upstream gateway enabled/reachable/tool status, virtual-server tool lists, and the agents or profiles that use them; an optional administration link. |
|
|
592
634
|
| Files | The agents' workspace: a tree, highlighted files, an editor with conflict-checked saves, and a restorable trash (see [The files pane](#the-files-pane)). Needs `rooms` and a place to show. |
|
|
593
635
|
| Round table | Every active agent at a podium of one council hall, the coordinator first, each in the state its room is in; a seat turns the camera to its agent and opens a dialogue box on the agent's room (see [The round table](#the-round-table)). Needs `rooms`. |
|
|
@@ -670,7 +712,7 @@ The `rooms` pane's page and any client of your own talk to the host in this prot
|
|
|
670
712
|
|
|
671
713
|
- 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}`.
|
|
672
714
|
- 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`.
|
|
673
|
-
- 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), `POST rooms/<key>/start-over`, `POST uploads`, `DELETE uploads/<id>`, `files/<id>`, `schedules` (`GET`, and `DELETE schedules/<id>`), `agents/<name>` (`GET`, `PATCH`), `PUT agents/<name>/character` (body `{character}`, at most 4 KiB; `400 {error, field}` for a look that is not a character), `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`.
|
|
715
|
+
- 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`.
|
|
674
716
|
- Beside the API: `<mount>/manifest.webmanifest`, `<mount>/sw.js`, `<mount>/icons/<name>.png`, `<mount>/theme-init.js`, and in password mode `<mount>/login`, `POST <mount>/auth/login` and `POST <mount>/auth/logout`.
|
|
675
717
|
|
|
676
718
|
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`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s,Ht,l,r,p,e,n,a,zt,ar}from"./chunk-index-31wh5twj.js";import{N}from"./chunk-index-5d8yjj4m.js";var k=()=>typeof matchMedia==="function"&&matchMedia("(max-width: 719px)").matches,x={rtMenu:!0},g=()=>Boolean(window.history.state?.rtMenu),E=8,y=(t)=>t?.isConnected?t:null;function b(t){return t.items.map((o)=>n("button",{type:"button",role:o.checked===void 0?"menuitem":"menuitemcheckbox",...o.checked===void 0?{}:{"aria-checked":o.checked},className:"menu-item menu-link","data-tone":o.tone,onClick:()=>t.onChoose(o),children:[o.icon?e("span",{className:"menu-icon","data-tone":o.tone,children:e(a,{name:o.icon,size:18})}):null,e("span",{className:"menu-text",children:e("strong",{children:o.label})}),o.checked?e(a,{name:"check",size:18,className:"menu-check"}):null]},o.id))}function H({menu:t}){let o=l(void 0);if(t)o.current=t;let i=o.current,m=l(!1),v=l(void 0),h=t?.serial;return s(()=>{if(h===void 0)return;return window.history.pushState(x,"",window.location.href),m.current=!0,()=>{if(m.current)m.current=!1,window.history.back()}},[h]),s(()=>{let f=()=>{if(!m.current||g())return;m.current=!1,zt();let M=v.current;v.current=void 0,M?.()};return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]),e(N,{open:t!==void 0,title:i?.title??"",onClose:zt,restoreFocus:()=>y(i?.source??null),children:i?e("div",{className:"menu action-items",role:"menu","aria-label":i.title,children:e(b,{items:i.items,onChoose:(f)=>{if(!m.current){zt(),f.run();return}v.current=f.run,window.history.back()}})}):null})}function T({menu:t}){let o=l(null),[i,m]=r(t.at),{source:v}=t,h=(u)=>{y(v)?.focus(),zt(),u?.()},f=l(h);f.current=h,Ht(()=>{let u=o.current;if(!u)return;let c=u.getBoundingClientRect();m({x:Math.max(E,Math.min(t.at.x,window.innerWidth-c.width-E)),y:Math.max(E,Math.min(t.at.y,window.innerHeight-c.height-E))}),u.querySelector('[role^="menuitem"]')?.focus()},[t.serial]),s(()=>{let u=(d)=>{if(d.target instanceof Node&&o.current?.contains(d.target))return;zt()},c=()=>zt();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",c),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("wheel",u,!0),document.removeEventListener("touchmove",u,!0),window.removeEventListener("resize",c)}},[]);let M=(u)=>{let c=[...o.current?.querySelectorAll('[role^="menuitem"]')??[]],d=c.indexOf(document.activeElement),w=(L)=>{u.preventDefault(),c[(L+c.length)%c.length]?.focus()};switch(u.key){case"Escape":u.preventDefault(),u.stopPropagation(),f.current();return;case"ArrowDown":return w(d+1);case"ArrowUp":return w(d<0?-1:d-1);case"Tab":return w(u.shiftKey?d<0?-1:d-1:d+1);case"Home":return w(0);case"End":return w(-1)}};return e("div",{ref:o,className:"action-popover",role:"menu","aria-label":t.title,tabIndex:-1,style:{left:`${i.x}px`,top:`${i.y}px`},onKeyDown:M,children:e(b,{items:t.items,onChoose:(u)=>h(u.run)})})}function O(){let t=ar(),o=l(void 0);if(t&&o.current?.serial!==t.serial)o.current={serial:t.serial,sheet:k()};let i=Boolean(t&&o.current?.sheet);return n(p,{children:[e(H,{menu:i?t:void 0}),t&&!i?e(T,{menu:t},t.serial):null]})}export{O as ActionMenuHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s,e,H,d,x,De}from"./chunk-index-31wh5twj.js";function g({name:o}){let i=d((t)=>t.listed),r=d((t)=>Object.values(t.rooms).find((m)=>m.view?.kind==="agent"&&m.view.name===o)?.view?.key,o);return s(()=>{if(r)H("room",r,{replace:!0}),De(o);else if(i)H("rooms",void 0,{replace:!0})},[r,i,o]),e("div",{className:"page",children:e(x,{})})}export{g as AgentPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O,W,P,de,X,l,t,p,e,n,a,d,_,Q,se,Oe,kt,Dt,Wn,Pn,xi,en,Qn}from"./chunk-index-31wh5twj.js";import{Se}from"./chunk-index-12bw9yj8.js";import{fn,pn,mn,wt}from"./chunk-index-wmbmmrd4.js";import{yn}from"./chunk-index-89ajmxh7.js";import{Et,gt}from"./chunk-index-gpkzhq1g.js";fn();var T=P(()=>(O("5cp8stna"),import("./chunk-folder-list-5cp8stna.js")).then((o)=>({default:o.FolderList}))),D=de(function(i){let{view:r}=i,g=wt(()=>kt(r.key),r.home?void 0:pn(r.key));return e(xi,{...i,press:g,item:{...r.home?{}:{"data-drop-item":"","data-key":r.key},...i.arranging?{"data-arranging":""}:{}},after:i.arranging?e("button",{type:"button",className:"icon-button row-more","aria-haspopup":"menu","aria-label":t("Room menu"),onClick:(c)=>{let m=c.currentTarget;kt(r.key).then((u)=>{if(!u)return;let f=m.getBoundingClientRect();Oe({...u,at:{x:f.left,y:f.bottom},via:"key",source:m})},()=>{return})},children:e(a,{name:"more",size:18})}):null})});function z(o){let{now:i}=se(),{timeZone:r}=Q(),g=en(o.rooms);return e("ul",{className:"room-list",children:g.map(({key:c,...m})=>{let u=o.threads[c];return e(D,{...m,active:c===o.active,now:i,timeZone:r,arranging:o.arranging,...u?{threads:e(Qn,{open:u.open,closed:u.closed,active:o.active})}:{}},c)})})}function v(o){let r=en(o.rooms).length===0;if(r&&o.zone?.kind!=="pinned")return null;return n("section",{className:"stack",...r?{"data-empty":""}:{},...o.zone?{"data-drop-zone":o.zone.kind,"data-zone-id":o.zone.id}:{},children:[e("h2",{className:"section-title",children:o.title}),r?null:e(z,{rooms:o.rooms,threads:o.threads,active:o.active,arranging:o.arranging})]})}function oe(o){let i=d((s)=>JSON.stringify({listed:s.listed,...Et(s,(L)=>gt(s,L))})),r=mn(),g=l(i);if(!r)g.current=i;let c=g.current,{listed:m,...u}=X(()=>JSON.parse(c),[c]),{home:f,pinned:N,folders:y,restAgents:A,restGroups:S,rest:R,threads:w,orphans:h}=u,k=Wn(),C=f.length+N.length+R.length===0&&y.every((s)=>s.rooms.length===0)&&h.open.length+h.closed.length===0,b={threads:w,active:o.active,arranging:k};return n("div",{className:"page","data-column":o.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:o.onSearch,children:[e(a,{name:"search",size:16}),e("span",{children:t("Find a room")}),e("kbd",{children:"⌘K"})]}),m?e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(s)=>yn(s.currentTarget),children:e(a,{name:"more",size:18})}):null,e("button",{type:"button",className:"header-button icon-button","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(s)=>Dt(s.currentTarget),children:e(a,{name:"plus"})})]})]}),k?n("div",{className:"arrange-bar",children:[n("button",{type:"button",className:"secondary",onClick:()=>Se({kind:"new"}),children:[e(a,{name:"plus",size:16}),e("span",{children:t("Add a folder")})]}),e("button",{type:"button",onClick:()=>Pn(!1),children:t("Done")})]}):null,m&&C?e(_,{children:t("No rooms yet. Rooms appear when the team has an agent.")}):null,!m?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:f,...b}),e(v,{title:t("Pinned"),rooms:N,zone:{kind:"pinned",id:"pinned"},...b}),y.length>0?e("div",{className:"stack folder-list","data-folder-list":"",children:e(W,{fallback:e("div",{className:"skeleton","aria-busy":"true"}),children:e(T,{folders:y,active:o.active,listed:m,rooms:(s)=>e(z,{rooms:s,threads:w,active:o.active,arranging:k})})})}):null,y.length>0?e(v,{title:t("Ungrouped"),rooms:R,zone:{kind:"rest",id:"rest"},...b}):n(p,{children:[e(v,{title:t("Agents"),rooms:A,zone:{kind:"rest",id:"rest-agents"},...b}),e(v,{title:t("Groups"),rooms:S,zone:{kind:"rest",id:"rest-groups"},...b})]}),h.open.length+h.closed.length>0?n("section",{className:"stack",children:[e("h2",{className:"section-title",children:t("Dispatch threads")}),e(Qn,{open:h.open,closed:h.closed,active:o.active})]}):null]})}export{oe as ArrangedRoomsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ce,Tt,V,Mn,Vt}from"./chunk-index-18gxy79n.js";import{de,Oi,s,D,X,l,r,t,c,p,e,n,xn,h,me,m,f,Ie,jt,oe,$e}from"./chunk-index-31wh5twj.js";import{re}from"./chunk-index-ky42ev0b.js";import{N}from"./chunk-index-5d8yjj4m.js";var ue={"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"},x=(a)=>a.charAt(0).toUpperCase()+a.slice(1);function P(a,o){let b=`character.${a}.${o}`,g=t(b);if(g!==b)return g;if(a==="class")return V.classes[o]?.label??x(o);return ue[`${a}.${o}`]??x(o)}function Q(a){let o=`character.jobs.${a}`,b=t(o);return b!==o?b:V.classes[a]?.jobs??""}var M=[{field:"hat",title:c("Hat"),ids:V.hats},{field:"outfit",title:c("Outfit"),ids:V.outfits},{field:"prop",title:c("Prop"),ids:V.props},{field:"hair",title:c("Hair"),ids:V.hair},{field:"beard",title:c("Beard"),ids:["none",...V.beards]},{field:"accessory",title:c("Accessory"),ids:["none",...V.accessories]}],fe=new Set(["class","colors","palette","build","skin","hairColor",...M.map((a)=>a.field)]),te=Object.keys(V.palettes),Y={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 O(a){return{class:a.class,outfit:a.outfit,hat:a.hat,prop:a.prop,hair:a.hair,beard:a.beard,accessory:a.accessory,build:a.build,skin:a.skin,hairColor:a.hairColor,colors:{...a.colors}}}var Z=(a)=>JSON.stringify(O(a)),C=(a)=>a[Math.floor(Math.random()*a.length)];function be(){return{class:C(Ce),outfit:C(V.outfits),hat:C(V.hats),prop:C(V.props),hair:C(V.hair),beard:C(["none",...V.beards]),accessory:C(["none",...V.accessories]),build:C(["slim","regular","stout"]),skin:C([0,1,2,3,4,5]),hairColor:C(V.hairColors),palette:C(te)}}var ae=de(function(o){return n("button",{type:"button",className:"creator-tile","aria-pressed":o.pressed,title:o.hint?`${o.label} — ${o.hint}`:o.label,onClick:o.onPick,...o.data,children:[e(oe,{spec:o.spec,size:o.size,live:!1}),e("span",{children:o.label})]})});function ge(a,o,b){let g=JSON.stringify({...a,[o]:0});return X(()=>b.map((d)=>({...a,[o]:d})),[g,o,b])}function pe(){let a=l(null),[o,b]=r();return s(()=>{let g=a.current;if(!g)return;let d=()=>{let S=g.scrollLeft>1,w=g.scrollLeft+g.clientWidth<g.scrollWidth-1;b(S&&w?"both":w?"end":S?"start":void 0)};d(),g.addEventListener("scroll",d,{passive:!0});let y=typeof ResizeObserver>"u"?void 0:new ResizeObserver(d);return y?.observe(g),()=>{g.removeEventListener("scroll",d),y?.disconnect()}},[]),[a,o]}function ye(a){let{part:o}=a,b=ge(a.shown,o.field,o.ids),[g,d]=pe();return e("div",{className:"creator-strip",ref:g,"data-more":d,children:o.ids.map((y,S)=>e(ae,{data:{[`data-${o.field}`]:y},spec:b[S],size:44,label:P(o.field,y),pressed:a.draft[o.field]===y,onPick:()=>a.onPick(y)},y))})}function K(a){return e("button",{type:"button",className:"creator-swatch","aria-pressed":a.pressed,"aria-label":a.label,title:a.label,style:{background:a.background},onClick:a.onPick,...a.data})}function L(a){return n("div",{className:"creator-field","data-field":a.field,children:[a.title?e("h3",{children:a.title}):null,a.children,a.error?e("p",{className:"field-error",role:"alert",children:a.error}):null]})}function Oe(a){let[o,b]=r(a.character),g=Oi(o),[d,y]=r({}),[S,w]=r(!1),[R,ie]=r("idle"),[z,T]=r(),[I,W]=r(),U=Ie("(max-width: 719px)"),_=l(null),F=D(),ne=$e(o),se=jt(),A=Z(o)!==Z(a.character);s(()=>b(a.character),[a.character]),s(()=>{if(!A||a.onPick)return;let i=(k)=>k.preventDefault(),u=(k)=>{if(k.button!==0||k.metaKey||k.ctrlKey||k.shiftKey||k.altKey)return;let E=k.target instanceof Element?k.target.closest("a"):null;if(!E||E.target||E.hasAttribute("download"))return;if(_.current?.contains(E))return;k.preventDefault(),k.stopPropagation(),T({kind:"link",anchor:E})},H=xn((k)=>T({kind:"navigate",proceed:k}));return window.addEventListener("beforeunload",i),document.addEventListener("click",u,!0),()=>{H(),window.removeEventListener("beforeunload",i),document.removeEventListener("click",u,!0)}},[A,a.onPick]);let v=(i)=>{y({}),b((u)=>Mn(i,u))},le=async()=>{if(a.onPick){a.onPick(O(o),o);return}w(!0),y({});try{let i=await m.setCharacter(a.name,O(o));a.onSaved?.(i),h(t("Saved."))}catch(i){let u=i instanceof me&&i.field?i.field.split(".")[0]:void 0,H=u&&fe.has(u)?u:"*";y({[H]:f(i)})}finally{w(!1)}},ce=async()=>{let i=z;if(b(a.character),y({}),i?.kind==="link")setTimeout(()=>i.anchor.click(),0);else if(i?.kind==="navigate")i.proceed()},j=e(L,{field:"class",title:t("Class"),error:d.class,children:e("div",{className:"creator-grid",children:Ce.map((i)=>e(ke,{id:i,base:g,pressed:o.class===i,onPick:()=>v({class:i,colors:o.colors})},i))})}),G=n(L,{field:"colors",title:t("Colors"),error:d.colors??d.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),te.map((i)=>{let u=V.palettes[i];return e(K,{data:{"data-palette":i},label:P("palette",i),pressed:o.palette===i,background:`linear-gradient(135deg, ${u.primary} 52%, ${u.trim} 52%)`,onPick:()=>v({palette:i})},i)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((i)=>n("label",{children:[e("span",{children:i==="primary"?t("Primary (the accent)"):i==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:o.colors[i],onChange:(u)=>v({colors:{[i]:u.target.value}})})]},i))})]}),J=M.map((i)=>e(L,{field:i.field,title:t(i.title),error:d[i.field],children:e(ye,{part:i,draft:o,shown:g,onPick:(u)=>v({[i.field]:u})})},i.field)),q=n(p,{children:[e(L,{field:"build",title:t("Build"),error:d.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((i)=>n("label",{"data-checked":o.build===i,children:[e("input",{type:"radio",name:`${F}-build`,checked:o.build===i,onChange:()=>v({build:i})}),ee(i)]},i))]})}),e(L,{field:"skin",title:t("Skin tone"),error:d.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),(se??V.skins).map((i,u)=>e(K,{data:{"data-skin":String(u)},label:t("Skin tone {n}",{n:u+1}),pressed:o.skin===u,background:i,onPick:()=>v({skin:u})},u))]})}),e(L,{field:"hairColor",title:t("Hair color"),error:d.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),V.hairColors.map((i,u)=>e(K,{data:{"data-hair-color":i},label:t("Hair color {n}",{n:u+1}),pressed:o.hairColor===i,background:i,onPick:()=>v({hairColor:i})},i)),e("input",{type:"color","aria-label":t("Hair color"),value:o.hairColor,onChange:(i)=>v({hairColor:i.target.value})})]})})]}),B=[{id:"class",title:t("Class"),summary:P("class",o.class),error:d.class,node:j},{id:"colors",title:t("Colors"),summary:o.palette?P("palette",o.palette):o.colors.primary,error:d.colors??d.palette,node:G},...M.map((i,u)=>({id:i.field,title:t(i.title),summary:P(i.field,o[i.field]),error:d[i.field],node:J[u]})),{id:"body",title:t("Body"),summary:ee(o.build),error:d.build??d.skin??d.hairColor,node:q}];return n("form",{ref:_,className:"creator",style:ne,"aria-labelledby":F,onSubmit:(i)=>{if(i.preventDefault(),(A||a.onPick)&&!S)le()},children:[e("h2",{id:F,className:"visually-hidden",children:t("Character of {name}",{name:a.displayName})}),n("div",{className:"creator-preview",children:[e(oe,{spec:o,name:a.name,state:R,size:176,label:t("{name}, {state}",{name:a.displayName,state:t(Y[R])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>ie((i)=>Tt[(Tt.indexOf(i)+1)%Tt.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(Y[R])})]}),n("div",{className:"creator-body",children:[d["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:d["*"]}):null,U?e("ul",{className:"creator-sections",children:B.map((i)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>W(i.id),children:[e("strong",{children:i.title}),e("span",{className:"meta",children:i.summary}),i.error?e("span",{className:"field-error",role:"alert",children:i.error}):null]})},i.id))}):n(p,{children:[j,G,J,q]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{y({}),b(Vt({name:a.name,displayName:a.displayName,prompt:a.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>v(be()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(a.onCancel)a.onCancel();else if(A)T({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!A&&!a.onPick||S,children:S?t("Saving…"):a.onPick?t("Use this look"):t("Save")})]})]}),e(N,{open:U&&I!==void 0,title:B.find((i)=>i.id===I)?.title??"",onClose:()=>W(void 0),children:e("div",{className:"stack",children:B.find((i)=>i.id===I)?.node})}),e(re,{open:z!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>T(void 0),onConfirm:ce,children:e("p",{children:t("The new look for {name} has not been saved.",{name:a.displayName})})})]})}var ee=(a)=>t(he[a]);function ke(a){let o=a.base.colors,b=X(()=>Mn({class:a.id,colors:o}),[a.id,o]);return e(ae,{data:{"data-class":a.id},spec:b,size:56,label:P("class",a.id),hint:Q(a.id),pressed:a.pressed,onPick:a.onPick})}export{Oe as CharacterCreator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{z,le,Cn,Ii,An,Fe,ce,o,g,ve,Pe,bt,Qe,U,te,ne,A,et,tt,Me,ue,k,K,xe,u,ot,Di,Ui,Vi,$n,ln,Bi,qi,Fi,Gi,v,i,T,Xe,St,dn,si,Zt,Wt,Yi,Hi,Ze}from"./chunk-index-4ecjtdy8.js";import{O}from"./chunk-index-31wh5twj.js";var on=(e)=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Le(e.state,n.from);return r.line?sn(e):r.block?an(e):!1};function Ae(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let l=e(t,n);if(!l)return!1;return r(n.update(l)),!0}}var sn=Ae(fn,0);var cn=Ae(nt,0);var an=Ae((e,t)=>nt(e,t,hn(t)),0);function Le(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}var V=50;function un(e,{open:t,close:n},r,l){let s=e.sliceDoc(r-V,r),c=e.sliceDoc(l,l+V),a=/\s*$/.exec(s)[0].length,h=/^\s*/.exec(c)[0].length,d=s.length-a;if(s.slice(d-t.length,d)==t&&c.slice(h,h+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:l+h,margin:h&&1}};let f,m;if(l-r<=2*V)f=m=e.sliceDoc(r,l);else f=e.sliceDoc(r,r+V),m=e.sliceDoc(l-V,l);let p=/^\s*/.exec(f)[0].length,E=/\s*$/.exec(m)[0].length,M=m.length-E-n.length;if(f.slice(p,p+t.length)==t&&m.slice(M,M+n.length)==n)return{open:{pos:r+p+t.length,margin:/\s/.test(f.charAt(p+t.length))?1:0},close:{pos:l-E-n.length,margin:/\s/.test(m.charAt(M-1))?1:0}};return null}function hn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),l=n.to<=r.to?r:e.doc.lineAt(n.to);if(l.from>r.from&&l.from==n.to)l=n.to==r.to+1?r:e.doc.lineAt(n.to-1);let s=t.length-1;if(s>=0&&t[s].to>r.from)t[s].to=l.to;else t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:l.to})}return t}function nt(e,t,n=t.selection.ranges){let r=n.map((s)=>Le(t,s.from).block);if(!r.every((s)=>s))return null;let l=n.map((s,c)=>un(t,r[c],s.from,s.to));if(e!=2&&!l.every((s)=>s))return{changes:t.changes(n.map((s,c)=>{if(l[c])return[];return[{from:s.from,insert:r[c].open+" "},{from:s.to,insert:" "+r[c].close}]}))};else if(e!=1&&l.some((s)=>s)){let s=[];for(let c=0,a;c<l.length;c++)if(a=l[c]){let h=r[c],{open:d,close:f}=a;s.push({from:d.pos-h.open.length,to:d.pos+d.margin},{from:f.pos-f.margin,to:f.pos+h.close.length})}return{changes:s}}return null}function fn(e,t,n=t.selection.ranges){let r=[],l=-1;e:for(let{from:s,to:c}of n){let a=r.length,h=1e9,d;for(let f=s;f<=c;){let m=t.doc.lineAt(f);if(d==null){if(d=Le(t,m.from).line,!d)continue e}if(m.from>l&&(s==c||c>m.from)){l=m.from;let p=/^\s*/.exec(m.text)[0].length,E=p==m.length,M=m.text.slice(p,p+d.length)==d?p:-1;if(p<m.text.length&&p<h)h=p;r.push({line:m,comment:M,token:d,indent:p,empty:E,single:!1})}f=m.to+1}if(h<1e9){for(let f=a;f<r.length;f++)if(r[f].indent<r[f].line.text.length)r[f].indent=h}if(r.length==a+1)r[a].single=!0}if(e!=2&&r.some((s)=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:h,indent:d,empty:f,single:m}of r)if(m||!f)s.push({from:a.from+d,insert:h+" "});let c=t.changes(s);return{changes:c,selection:t.selection.map(c,1)}}else if(e!=1&&r.some((s)=>s.comment>=0)){let s=[];for(let{line:c,comment:a,token:h}of r)if(a>=0){let d=c.from+a,f=d+h.length;if(c.text[f-c.from]==" ")f++;s.push({from:d,to:f})}return{changes:s}}return null}var ke=Qe.define(),mn=Qe.define(),pn=g.define(),rt=g.define({combine(e){return et(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,l)=>t(r,l)||n(r,l)})}}),lt=ve.define({create(){return D.empty},update(e,t){let n=t.state.facet(rt),r=t.annotation(ke);if(r){let h=x.fromTransaction(t,r.selection),d=r.side,f=d==0?e.undone:e.done;if(h)f=j(f,f.length,n.minDepth,h);else f=ct(f,t.startState.selection);return new D(d==0?r.rest:f,d==0?f:r.rest)}let l=t.annotation(mn);if(l=="full"||l=="before")e=e.isolate();if(t.annotation(te.addToHistory)===!1)return!t.changes.empty?e.addMapping(t.changes.desc):e;let s=x.fromTransaction(t),c=t.annotation(te.time),a=t.annotation(te.userEvent);if(s)e=e.addChanges(s,c,a,n,t);else if(t.selection)e=e.addSelection(t.startState.selection,c,a,n.newGroupDelay);if(l=="full"||l=="after")e=e.isolate();return e},toJSON(e){return{done:e.done.map((t)=>t.toJSON()),undone:e.undone.map((t)=>t.toJSON())}},fromJSON(e){return new D(e.done.map(x.fromJSON),e.undone.map(x.fromJSON))}});function it(e={}){return[lt,rt.of(e),u.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Y:t.inputType=="historyRedo"?G:null;if(!r)return!1;return t.preventDefault(),r(n)}})]}function X(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let l=n.field(lt,!1);if(!l)return!1;let s=l.pop(e,n,t);if(!s)return!1;return r(s),!0}}var Y=X(0,!1),G=X(1,!1),gn=X(0,!0),yn=X(1,!0);class x{constructor(e,t,n,r,l){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=l}setSelAfter(e){return new x(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((r)=>r.toJSON())}}static fromJSON(e){return new x(e.changes&&ce.fromJSON(e.changes),[],e.mapped&&Fe.fromJSON(e.mapped),e.startSelection&&o.fromJSON(e.startSelection),e.selectionsAfter.map(o.fromJSON))}static fromTransaction(e,t){let n=b;for(let r of e.startState.facet(pn)){let l=r(e);if(l.length)n=n.concat(l)}if(!n.length&&e.changes.empty)return null;return new x(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,b)}static selection(e){return new x(void 0,b,void 0,void 0,e)}}function j(e,t,n,r){let l=t+1>n+20?t-n-1:0,s=e.slice(l,t);return s.push(r),s}function xn(e,t){let n=[],r=!1;return e.iterChangedRanges((l,s)=>n.push(l,s)),t.iterChangedRanges((l,s,c,a)=>{for(let h=0;h<n.length;){let d=n[h++],f=n[h++];if(a>=d&&c<=f)r=!0}}),r}function Sn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function st(e,t){return!e.length?t:!t.length?e:e.concat(t)}var b=[],kn=200;function ct(e,t){if(!e.length)return[x.selection([t])];else{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-kn));if(r.length&&r[r.length-1].eq(t))return e;return r.push(t),j(e,e.length-1,1e9,n.setSelAfter(r))}}function vn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Se(e,t){if(!e.length)return e;let n=e.length,r=b;while(n){let l=bn(e[n-1],t,r);if(l.changes&&!l.changes.empty||l.effects.length){let s=e.slice(0,n);return s[n-1]=l,s}else t=l.mapped,n--,r=l.selectionsAfter}return r.length?[x.selection(r)]:b}function bn(e,t,n){let r=st(e.selectionsAfter.length?e.selectionsAfter.map((a)=>a.map(t)):b,n);if(!e.changes)return x.selection(r);let l=e.changes.map(t),s=t.mapDesc(e.changes,!0),c=e.mapped?e.mapped.composeDesc(s):s;return new x(l,U.mapEffects(e.effects,t),c,e.startSelection.map(s),r)}var Mn=/^(input\.type|delete)($|\.)/;class D{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new D(this.done,this.undone):this}addChanges(e,t,n,r,l){let s=this.done,c=s[s.length-1];if(c&&c.changes&&!c.changes.empty&&e.changes&&(!n||Mn.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(l,xn(c.changes,e.changes))||n=="input.type.compose"))s=j(s,s.length-1,r.minDepth,new x(e.changes.compose(c.changes),st(U.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,b));else s=j(s,s.length,r.minDepth,e);return new D(s,b,t,n)}addSelection(e,t,n,r){let l=this.done.length?this.done[this.done.length-1].selectionsAfter:b;if(l.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&Sn(l[l.length-1],e))return this;return new D(ct(this.done,e),this.undone,t,n)}addMapping(e){return new D(Se(this.done,e),Se(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let l=r[r.length-1],s=l.selectionsAfter[0]||(l.startSelection?l.startSelection.map(l.changes.invertedDesc,1):t.selection);if(n&&l.selectionsAfter.length)return t.update({selection:l.selectionsAfter[l.selectionsAfter.length-1],annotations:ke.of({side:e,rest:vn(r),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});else if(!l.changes)return null;else{let c=r.length==1?b:r.slice(0,r.length-1);if(l.mapped)c=Se(c,l.mapped);return t.update({changes:l.changes,selection:l.startSelection,effects:l.effects,annotations:ke.of({side:e,rest:c,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}}}D.empty=new D(b,b);var at=[{key:"Mod-z",run:Y,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:G,preventDefault:!0},{linux:"Ctrl-Shift-z",run:G,preventDefault:!0},{key:"Mod-u",run:gn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:yn,preventDefault:!0}];function I(e,t){return o.create(e.ranges.map(t),e.mainIndex)}function L(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function B({state:e,dispatch:t},n){let r=I(e.selection,n);if(r.eq(e.selection,!0))return!1;return t(L(e,r)),!0}function Z(e,t){return o.cursor(t?e.to:e.from)}function ut(e,t){return B(e,(n)=>n.empty?e.moveByChar(n,t):Z(n,t))}function y(e){return e.textDirectionAt(e.state.selection.main.head)==K.LTR}var ht=(e)=>ut(e,!y(e)),ft=(e)=>ut(e,y(e));function dt(e,t){return B(e,(n)=>n.empty?e.moveByGroup(n,t):Z(n,t))}var Ln=(e)=>dt(e,!y(e)),Bn=(e)=>dt(e,y(e));var Qr=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Dn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ee(e,t,n){let r=T(e).resolveInner(t.head),l=n?v.closedBy:v.openedBy;for(let h=t.head;;){let d=n?r.childAfter(h):r.childBefore(h);if(!d)break;if(Dn(e,d,l))r=d;else h=n?d.to:d.from}let s=r.type.prop(l),c,a;if(s&&(c=n?Ze(e,r.from,1):Ze(e,r.to,-1))&&c.matched)a=n?c.end.to:c.end.from;else a=n?r.to:r.from;return o.cursor(a,n?-1:1)}var En=(e)=>B(e,(t)=>ee(e.state,t,!y(e))),Tn=(e)=>B(e,(t)=>ee(e.state,t,y(e)));function mt(e,t){return B(e,(n)=>{if(!n.empty)return Z(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}var pt=(e)=>mt(e,!1),gt=(e)=>mt(e,!0);function yt(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,l;if(t){for(let s of e.state.facet(u.scrollMargins)){let c=s(e);if(c===null||c===void 0?void 0:c.top)n=Math.max(c===null||c===void 0?void 0:c.top,n);if(c===null||c===void 0?void 0:c.bottom)r=Math.max(c===null||c===void 0?void 0:c.bottom,r)}l=e.scrollDOM.clientHeight-n-r}else l=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,l-5)}}function xt(e,t){let n=yt(e),{state:r}=e,l=I(r.selection,(c)=>c.empty?e.moveVertically(c,t,n.height):Z(c,t));if(l.eq(r.selection))return!1;let s;if(n.selfScroll){let c=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),h=a.top+n.marginTop,d=a.bottom-n.marginBottom;if(c&&c.top>h&&c.bottom<d)s=u.scrollIntoView(l.main.head,{y:"start",yMargin:c.top-h})}return e.dispatch(L(r,l),{effects:s}),!0}var ze=(e)=>xt(e,!1),be=(e)=>xt(e,!0);function w(e,t,n){let r=e.lineBlockAt(t.head),l=e.moveToLineBoundary(t,n);if(l.head==t.head&&l.head!=(n?r.to:r.from))l=e.moveToLineBoundary(t,n,!1);if(!n&&l.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;if(s&&t.head!=r.from+s)l=o.cursor(r.from+s)}return l}var wn=(e)=>B(e,(t)=>w(e,t,!0)),Wn=(e)=>B(e,(t)=>w(e,t,!1)),Rn=(e)=>B(e,(t)=>w(e,t,!y(e))),On=(e)=>B(e,(t)=>w(e,t,y(e))),Fn=(e)=>B(e,(t)=>e.moveToLineBoundary(t,!1,!1)),In=(e)=>B(e,(t)=>e.moveToLineBoundary(t,!0,!1));function Pn(e,t,n){let r=!1,l=I(e.selection,(s)=>{let c=Ze(e,s.head,-1)||Ze(e,s.head,1)||s.head>0&&Ze(e,s.head-1,1)||s.head<e.doc.length&&Ze(e,s.head+1,-1);if(!c||!c.end)return s;r=!0;let a=c.start.from==s.head?c.end.to:c.end.from;return n?o.range(s.anchor,a):o.cursor(a)});if(!r)return!1;return t(L(e,l)),!0}var Nn=({state:e,dispatch:t})=>Pn(e,t,!1);function C(e,t,n){let r=I(e.state.selection,(l)=>{if(l.undirectional&&l.head>=l.anchor!=t)l=o.range(l.head,l.anchor);let s=n(l);return o.range(l.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});if(r.eq(e.state.selection))return!1;return e.dispatch(L(e.state,r)),!0}function kt(e,t){return C(e,t,(n)=>e.moveByChar(n,t))}var vt=(e)=>kt(e,!y(e)),Ct=(e)=>kt(e,y(e));function Mt(e,t){return C(e,t,(n)=>e.moveByGroup(n,t))}var qn=(e)=>Mt(e,!y(e)),Vn=(e)=>Mt(e,y(e));var Gn=(e)=>{let t=!y(e);return C(e,t,(n)=>ee(e.state,n,t))},Un=(e)=>{let t=y(e);return C(e,t,(n)=>ee(e.state,n,t))};function At(e,t){return C(e,t,(n)=>e.moveVertically(n,t))}var Lt=(e)=>At(e,!1),Bt=(e)=>At(e,!0);function Dt(e,t){return C(e,t,(n)=>e.moveVertically(n,t,yt(e).height))}var _e=(e)=>Dt(e,!1),Je=(e)=>Dt(e,!0),zn=(e)=>C(e,!0,(t)=>w(e,t,!0)),_n=(e)=>C(e,!1,(t)=>w(e,t,!1)),Jn=(e)=>{let t=!y(e);return C(e,t,(n)=>w(e,n,t))},Kn=(e)=>{let t=y(e);return C(e,t,(n)=>w(e,n,t))},Hn=(e)=>C(e,!1,(t)=>o.cursor(e.lineBlockAt(t.head).from)),Qn=(e)=>C(e,!0,(t)=>o.cursor(e.lineBlockAt(t.head).to)),$e=({state:e,dispatch:t})=>(t(L(e,{anchor:0})),!0),Ke=({state:e,dispatch:t})=>(t(L(e,{anchor:e.doc.length})),!0),He=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:0})),!0),je=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),jn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Xn=({state:e,dispatch:t})=>{let n=re(e).map(({from:r,to:l})=>o.undirectionalRange(r,Math.min(l+1,e.doc.length)));return t(e.update({selection:o.create(n),userEvent:"select"})),!0},Yn=({state:e,dispatch:t})=>{let n=I(e.selection,(r)=>{let l=T(e),s=l.resolveStack(r.from,1);if(r.empty){let c=l.resolveStack(r.from,-1);if(c.node.from>=s.node.from&&c.node.to<=s.node.to)s=c}for(let c=s;c;c=c.next){let{node:a}=c;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&c.next)return o.undirectionalRange(a.from,a.to)}return r});if(n.eq(e.selection))return!1;return t(L(e,n)),!0};function Et(e,t){let{state:n}=e,r=n.selection,l=n.selection.ranges.slice();for(let s of n.selection.ranges){let c=n.doc.lineAt(s.head);if(t?c.to<e.state.doc.length:c.from>0)for(let a=s;;){let h=e.moveVertically(a,t);if(h.head<c.from||h.head>c.to){if(!l.some((d)=>d.head==h.head))l.push(h);break}else if(h.head==a.head)break;else a=h}}if(l.length==r.ranges.length)return!1;return e.dispatch(L(n,o.create(l,l.length-1))),!0}var Zn=(e)=>Et(e,!1),er=(e)=>Et(e,!0),tr=({state:e,dispatch:t})=>{let n=e.selection,r=null;if(n.ranges.length>1)r=o.create([n.main]);else if(!n.main.empty)r=o.create([o.cursor(n.main.head)]);if(!r)return!1;return t(L(e,r)),!0};function _(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,l=r.changeByRange((s)=>{let{from:c,to:a}=s;if(c==a){let h=t(s);if(h<c)n="delete.backward",h=Q(e,h,!1);else if(h>c)n="delete.forward",h=Q(e,h,!0);c=Math.min(c,h),a=Math.max(a,h)}else c=Q(e,c,!1),a=Q(e,a,!0);return c==a?{range:s}:{changes:{from:c,to:a},range:o.cursor(c,c<s.head?-1:1)}});if(l.changes.empty)return!1;return e.dispatch(r.update(l,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?u.announce.of(r.phrase("Selection deleted")):void 0})),!0}function Q(e,t,n){if(e instanceof u)for(let r of e.state.facet(u.atomicRanges).map((l)=>l(e)))r.between(t,t,(l,s)=>{if(l<t&&s>t)t=n?s:l});return t}var Tt=(e,t,n)=>_(e,(r)=>{let l=r.from,{state:s}=e,c=s.doc.lineAt(l),a,h;if(n&&!t&&l>c.from&&l<c.from+200&&!/[^ \t]/.test(a=c.text.slice(0,l-c.from))){if(a[a.length-1]=="\t")return l-1;let d=Me(a,s.tabSize),f=d%St(s)||St(s);for(let m=0;m<f&&a[a.length-1-m]==" ";m++)l--;h=l}else if(h=le(c.text,l-c.from,t,t)+c.from,h==l&&c.number!=(t?s.doc.lines:1))h+=t?1:-1;else if(!t&&/[\ufe00-\ufe0f]/.test(c.text.slice(h-c.from,l-c.from)))h=le(c.text,h-c.from,!1,!1)+c.from;return h}),Ce=(e)=>Tt(e,!1,!0);var wt=(e)=>Tt(e,!0,!1),Rt=(e,t)=>_(e,(n)=>{let r=n.head,{state:l}=e,s=l.doc.lineAt(r),c=l.charCategorizer(r);for(let a=null;;){if(r==(t?s.to:s.from)){if(r==n.head&&s.number!=(t?l.doc.lines:1))r+=t?1:-1;break}let h=le(s.text,r-s.from,t)+s.from,d=s.text.slice(Math.min(r,h)-s.from,Math.max(r,h)-s.from),f=c(d);if(a!=null&&f!=a)break;if(d!=" "||r!=n.head)a=f;r=h}return r}),Ot=(e)=>Rt(e,!1),nr=(e)=>Rt(e,!0);var rr=(e)=>_(e,(t)=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)});var or=(e)=>_(e,(t)=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),lr=(e)=>_(e,(t)=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)});var ir=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((r)=>({changes:{from:r.from,to:r.to,insert:z.of(["",""])},range:o.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},sr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((r)=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let l=r.from,s=e.doc.lineAt(l),c=l==s.from?l-1:le(s.text,l-s.from,!1)+s.from,a=l==s.to?l+1:le(s.text,l-s.from,!0)+s.from;return{changes:{from:c,to:a,insert:e.doc.slice(l,a).append(e.doc.slice(c,l))},range:o.cursor(a)}});if(n.changes.empty)return!1;return t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0};function re(e){let t=[],n=-1;for(let r of e.selection.ranges){let l=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from)s=e.doc.lineAt(r.to-1);if(n>=l.number){let c=t[t.length-1];c.to=s.to,c.ranges.push(r)}else t.push({from:l.from,to:s.to,ranges:[r]});n=s.number+1}return t}function Ft(e,t,n){if(e.readOnly)return!1;let r=[],l=[];for(let s of re(e)){if(n?s.to==e.doc.length:s.from==0)continue;let c=e.doc.lineAt(n?s.to+1:s.from-1),a=c.length+1;if(n){r.push({from:s.to,to:c.to},{from:s.from,insert:c.text+e.lineBreak});for(let h of s.ranges)l.push(o.range(Math.min(e.doc.length,h.anchor+a),Math.min(e.doc.length,h.head+a)))}else{r.push({from:c.from,to:s.from},{from:s.to,insert:e.lineBreak+c.text});for(let h of s.ranges)l.push(o.range(h.anchor-a,h.head-a))}}if(!r.length)return!1;return t(e.update({changes:r,scrollIntoView:!0,selection:o.create(l,e.selection.mainIndex),userEvent:"move.line"})),!0}var cr=({state:e,dispatch:t})=>Ft(e,t,!1),ar=({state:e,dispatch:t})=>Ft(e,t,!0);function It(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of re(e))if(n)r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak});else r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let l=e.changes(r);return t(e.update({changes:l,selection:e.selection.map(l,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var ur=({state:e,dispatch:t})=>It(e,t,!1),hr=({state:e,dispatch:t})=>It(e,t,!0),fr=(e)=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(re(t).map(({from:l,to:s})=>{if(l>0)l--;else if(s<t.doc.length)s++;return{from:l,to:s}})),r=I(t.selection,(l)=>{let s=void 0;if(e.lineWrapping){let c=e.lineBlockAt(l.head),a=e.coordsAtPos(l.head,l.assoc||1);if(a)s=c.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2}return e.moveVertically(l,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function dr(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=T(e).resolveInner(t),r=n.childBefore(t),l=n.childAfter(t),s;if(r&&l&&r.to<=t&&l.from>=t&&(s=r.type.prop(v.closedBy))&&s.indexOf(l.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(l.from).from&&!/\S/.test(e.sliceDoc(r.to,l.from)))return{from:r.to,to:l.from};return null}var Ye=Pt(!1),mr=Pt(!0);function Pt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange((l)=>{let{from:s,to:c}=l,a=t.doc.lineAt(s),h=!e&&s==c&&dr(t,s);if(e)s=c=(c<=a.to?a:t.doc.lineAt(c)).to;let d=new Zt(t,{simulateBreak:s,simulateDoubleBreak:!!h}),f=si(d,s);if(f==null)f=Me(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize);while(c<a.to&&/\s/.test(a.text[c-a.from]))c++;if(h)({from:s,to:c}=h);else if(s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s)))s=a.from;let m=["",dn(t,f)];if(h)m.push(dn(t,d.lineIndent(a.from,-1)));return{changes:{from:s,to:c,insert:z.of(m)},range:o.cursor(s+1+m[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Be(e,t){let n=-1;return e.changeByRange((r)=>{let l=[];for(let c=r.from;c<=r.to;){let a=e.doc.lineAt(c);if(a.number>n&&(r.empty||r.to>a.from))t(a,l,r),n=a.number;c=a.to+1}let s=e.changes(l);return{changes:l,range:o.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}var pr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Zt(e,{overrideIndentation:(s)=>{let c=n[s];return c==null?-1:c}}),l=Be(e,(s,c,a)=>{let h=si(r,s.from);if(h==null)return;if(!/\S/.test(s.text))h=0;let d=/^\s*/.exec(s.text)[0],f=dn(e,h);if(d!=f||a.from<s.from+d.length)n[s.from]=h,c.push({from:s.from,to:s.from+d.length,insert:f})});if(!l.changes.empty)t(e.update(l,{userEvent:"indent"}));return!0},oe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;return t(e.update(Be(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Xe)})}),{userEvent:"input.indent"})),!0},Nt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;return t(e.update(Be(e,(n,r)=>{let l=/^\s*/.exec(n.text)[0];if(!l)return;let s=Me(l,e.tabSize),c=0,a=dn(e,Math.max(0,s-St(e)));while(c<l.length&&c<a.length&&l.charCodeAt(c)==a.charCodeAt(c))c++;r.push({from:n.from+c,to:n.from+l.length,insert:a.slice(c)})}),{userEvent:"delete.dedent"})),!0},gr=(e)=>(e.setTabFocusMode(),!0);var yr=[{key:"Ctrl-b",run:ht,shift:vt,preventDefault:!0},{key:"Ctrl-f",run:ft,shift:Ct},{key:"Ctrl-p",run:pt,shift:Lt},{key:"Ctrl-n",run:gt,shift:Bt},{key:"Ctrl-a",run:Fn,shift:Hn},{key:"Ctrl-e",run:In,shift:Qn},{key:"Ctrl-d",run:wt},{key:"Ctrl-h",run:Ce},{key:"Ctrl-k",run:rr},{key:"Ctrl-Alt-h",run:Ot},{key:"Ctrl-o",run:ir},{key:"Ctrl-t",run:sr},{key:"Ctrl-v",run:be}],xr=[{key:"ArrowLeft",run:ht,shift:vt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Ln,shift:qn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Rn,shift:Jn,preventDefault:!0},{key:"ArrowRight",run:ft,shift:Ct,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Bn,shift:Vn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:On,shift:Kn,preventDefault:!0},{key:"ArrowUp",run:pt,shift:Lt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:$e,shift:He},{mac:"Ctrl-ArrowUp",run:ze,shift:_e},{key:"ArrowDown",run:gt,shift:Bt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ke,shift:je},{mac:"Ctrl-ArrowDown",run:be,shift:Je},{key:"PageUp",run:ze,shift:_e},{key:"PageDown",run:be,shift:Je},{key:"Home",run:Wn,shift:_n,preventDefault:!0},{key:"Mod-Home",run:$e,shift:He},{key:"End",run:wn,shift:zn,preventDefault:!0},{key:"Mod-End",run:Ke,shift:je},{key:"Enter",run:Ye,shift:Ye},{key:"Mod-a",run:jn},{key:"Backspace",run:Ce,shift:Ce,preventDefault:!0},{key:"Delete",run:wt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ot,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:nr,preventDefault:!0},{mac:"Mod-Backspace",run:or,preventDefault:!0},{mac:"Mod-Delete",run:lr,preventDefault:!0}].concat(yr.map((e)=>({mac:e.key,run:e.run,shift:e.shift}))),qt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:En,shift:Gn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Tn,shift:Un},{key:"Alt-ArrowUp",run:cr},{key:"Shift-Alt-ArrowUp",run:ur},{key:"Alt-ArrowDown",run:ar},{key:"Shift-Alt-ArrowDown",run:hr},{key:"Mod-Alt-ArrowUp",run:Zn},{key:"Mod-Alt-ArrowDown",run:er},{key:"Escape",run:tr},{key:"Mod-Enter",run:mr},{key:"Alt-l",mac:"Ctrl-l",run:Xn},{key:"Mod-i",run:Yn,preventDefault:!0},{key:"Mod-[",run:Nt},{key:"Mod-]",run:oe},{key:"Mod-Alt-\\",run:pr},{key:"Shift-Mod-k",run:fr},{key:"Shift-Mod-\\",run:Nn},{key:"Mod-/",run:on},{key:"Alt-A",mac:"Ctrl-A",run:cn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gr}].concat(xr),Vt={key:"Tab",run:oe,shift:Nt};var Gt=typeof String.prototype.normalize=="function"?(e)=>e.normalize("NFKD"):(e)=>e;class R{constructor(e,t,n=0,r=e.length,l,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=l?(c)=>l(Gt(c)):Gt,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Cn(this.buffer,this.bufferPos)}next(){while(this.matches.length)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ii(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=An(e);let r=this.normalize(t);if(r.length)for(let l=0,s=n,c=!0;;l++){let a=r.charCodeAt(l),h=this.match(a,s,c,this.bufferPos+this.bufferStart,l==r.length-1);if(h)return this.value=h,this;if(l==r.length-1)break;if(c&&l<t.length&&t.charCodeAt(l)==a)s++;else c=!1}}}match(e,t,n,r,l){let s=null;for(let c=0;c<this.matches.length;){let a=this.matches[c],h=!1;if(this.query.charCodeAt(a.index)==e)if(a.index==this.query.length-1)s={from:a.from,to:r,precise:l&&a.precise};else a.index++,h=!0;if(h)c++;else this.matches.splice(c,1)}if(this.query.charCodeAt(0)==e)if(this.query.length==1)s={from:t,to:r,precise:n&&l};else this.matches.push({from:t,index:1,precise:n});if(s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart))s=null;return s}}if(typeof Symbol<"u")R.prototype[Symbol.iterator]=function(){return this};var _t={from:-1,to:-1,match:/.*/.exec(""),precise:!0},we="gm"+(/x/.unicode==null?"":"u");class We{constructor(e,t,n,r=0,l=e.length){if(this.text=e,this.to=l,this.curLine="",this.done=!1,this.value=_t,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Re(e,t,n,r,l);this.re=new RegExp(t,we+((n===null||n===void 0?void 0:n.ignoreCase)?"i":"")),this.test=n===null||n===void 0?void 0:n.test,this.iter=e.iter();let s=e.lineAt(r);this.curLineStart=s.from,this.matchPos=he(e,r),this.getLine(this.curLineStart)}getLine(e){if(this.iter.next(e),this.iter.lineBreak)this.curLine="";else{if(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to)this.curLine=this.curLine.slice(0,this.to-this.curLineStart);this.iter.next()}}nextLine(){if(this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to)this.curLine="";else this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=he(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length)this.nextLine();if((n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}var De=new WeakMap;class q{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=De.get(e);if(!r||r.from>=n||r.to<=t){let c=new q(t,e.sliceString(t,n));return De.set(e,c),c}if(r.from==t&&r.to==n)return r;let{text:l,from:s}=r;if(s>t)l=e.sliceString(t,s)+l,s=t;if(r.to<n)l+=e.sliceString(r.to,n);return De.set(e,new q(s,l)),new q(t,l.slice(t-s,n-s))}}class Re{constructor(e,t,n,r,l){this.text=e,this.to=l,this.done=!1,this.value=_t,this.matchPos=he(e,r),this.re=new RegExp(t,we+((n===null||n===void 0?void 0:n.ignoreCase)?"i":"")),this.test=n===null||n===void 0?void 0:n.test,this.flat=q.get(e,r,this.chunkEnd(r+5000))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e)this.re.lastIndex=e+1,t=this.re.exec(this.flat.text);if(t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this.matchPos=he(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=q.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}if(typeof Symbol<"u")We.prototype[Symbol.iterator]=Re.prototype[Symbol.iterator]=function(){return this};function Sr(e){try{return new RegExp(e,we),!0}catch(t){return!1}}function he(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;while(t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344)t++;return t}var kr=(e)=>{let t=qi(e,"cm-goto-line");if(t){let c=t.dom.querySelector("input[type=text]");if(c)c.select();return!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:l,result:s}=Bi(e,{class:"cm-goto-line",label:n.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:n.phrase("go")});return s.then((c)=>{let a=c&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(c.elements.line.value);if(!a){e.dispatch({effects:l});return}let h=n.doc.lineAt(n.selection.main.head),[,d,f,m,p]=a,E=m?+m.slice(1):0,M=f?+f:h.number;if(f&&p){let ye=M/100;if(d)ye=ye*(d=="-"?-1:1)+h.number/n.doc.lines;M=Math.round(n.doc.lines*ye)}else if(f&&d)M=M*(d=="-"?-1:1)+h.number;let Ge=n.doc.line(Math.max(1,Math.min(n.doc.lines,M))),Ue=o.cursor(Ge.from+Math.max(0,Math.min(E,Ge.length)));e.dispatch({effects:[l,u.scrollIntoView(Ue.from,{y:"center"})],selection:Ue})}),!0},vr={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Jt=g.define({combine(e){return et(e,vr,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function $t(e){let t=[Lr,Ar];if(e)t.push(Jt.of(e));return t}var br=k.mark({class:"cm-selectionMatch"}),Cr=k.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ut(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ne.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ne.Word)}function Mr(e,t,n,r){return e(t.sliceDoc(n,n+1))==ne.Word&&e(t.sliceDoc(r-1,r))==ne.Word}var Ar=xe.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){if(e.selectionSet||e.docChanged||e.viewportChanged)this.decorations=this.getDeco(e.view)}getDeco(e){let t=e.state.facet(Jt),{state:n}=e,r=n.selection;if(r.ranges.length>1)return k.none;let l=r.main,s,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return k.none;let h=n.wordAt(l.head);if(!h)return k.none;c=n.charCategorizer(l.head),s=n.sliceDoc(h.from,h.to)}else{let h=l.to-l.from;if(h<t.minSelectionLength||h>200)return k.none;if(t.wholeWords){if(s=n.sliceDoc(l.from,l.to),c=n.charCategorizer(l.head),!(Ut(c,n,l.from,l.to)&&Mr(c,n,l.from,l.to)))return k.none}else if(s=n.sliceDoc(l.from,l.to),!s)return k.none}let a=[];for(let h of e.visibleRanges){let d=new R(n.doc,s,h.from,h.to);while(!d.next().done){let{from:f,to:m}=d.value;if(!c||Ut(c,n,f,m)){if(l.empty&&f<=l.from&&m>=l.to)a.push(Cr.range(f,m));else if(f>=l.to||m<=l.from)a.push(br.range(f,m));if(a.length>t.maxMatches)return k.none}}}return k.set(a)}},{decorations:(e)=>e.decorations}),Lr=u.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Br=({state:e,dispatch:t})=>{let{selection:n}=e,r=o.create(n.ranges.map((l)=>e.wordAt(l.head)||o.cursor(l.head)),n.mainIndex);if(r.eq(n))return!1;return t(e.update({selection:r})),!0};function Dr(e,t){let{main:n,ranges:r}=e.selection,l=e.wordAt(n.head),s=l&&l.from==n.from&&l.to==n.to;for(let c=!1,a=new R(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(c)return null;a=new R(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),c=!0}else{if(c&&r.some((h)=>h.from==a.value.from))continue;if(s){let h=e.wordAt(a.value.from);if(!h||h.from!=a.value.from||h.to!=a.value.to)continue}return a.value}}var Er=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((s)=>s.from===s.to))return Br({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((s)=>e.sliceDoc(s.from,s.to)!=r))return!1;let l=Dr(e,r);if(!l)return!1;return t(e.update({selection:e.selection.addRange(o.range(l.from,l.to),!1),effects:u.scrollIntoView(l.to)})),!0},F=g.define({combine(e){return et(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:(t)=>new tn(t),scrollToMatch:(t)=>u.scrollIntoView(t)})}});function Kt(e){return e?[F.of(e),Te]:Te}class Oe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Sr(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
|
|
2
|
+
`:n=="r"?"\r":n=="t"?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Qt(this):new Ht(this)}getCursor(e,t=0,n){let r=e.doc?e:A.create({doc:e});if(n==null)n=r.doc.length;return this.regexp?N(this,r,t,n):P(this,r,t,n)}}class Ie{constructor(e){this.spec=e}}function Tr(e,t,n){return(r,l,s,c)=>{if(n&&!n(r,l,s,c))return!1;let a=r>=c&&l<=c+s.length?s.slice(r-c,l-c):t.doc.sliceString(r,l);return e(a,t,r,l)}}function P(e,t,n,r){let l;if(e.wholeWord)l=wr(t.doc,t.charCategorizer(t.selection.main.head));if(e.test)l=Tr(e.test,t,l);return new R(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:(s)=>s.toLowerCase(),l)}function wr(e,t){return(n,r,l,s)=>{if(s>n||s+l.length<r)s=Math.max(0,n-2),l=e.sliceString(s,Math.min(e.length,r+2));return(t(fe(l,n-s))!=ne.Word||t(de(l,n-s))!=ne.Word)&&(t(de(l,r-s))!=ne.Word||t(fe(l,r-s))!=ne.Word)}}class Ht extends Ie{constructor(e){super(e)}nextMatch(e,t,n){let r=P(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let l=Math.min(e.doc.length,t+this.spec.unquoted.length);r=P(this.spec,e,0,l).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let l=Math.max(t,r-1e4-this.spec.unquoted.length),s=P(this.spec,e,l,r),c=null;while(!s.nextOverlapping().done)c=s.value;if(c)return c;if(l==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);if(!r)r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length);return r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=P(this.spec,e,0,e.doc.length),r=[];while(!n.next().done){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let l=P(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));while(!l.next().done)r(l.value.from,l.value.to)}}function Wr(e,t,n){return(r,l,s)=>(!n||n(r,l,s))&&e(s[0],t,r,l)}function N(e,t,n,r){let l;if(e.wholeWord)l=Rr(t.charCategorizer(t.selection.main.head));if(e.test)l=Wr(e.test,t,l);return new We(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:l},n,r)}function fe(e,t){return e.slice(le(e,t,!1),t)}function de(e,t){return e.slice(t,le(e,t))}function Rr(e){return(t,n,r)=>!r[0].length||(e(fe(r.input,r.index))!=ne.Word||e(de(r.input,r.index))!=ne.Word)&&(e(de(r.input,r.index+r[0].length))!=ne.Word||e(fe(r.input,r.index+r[0].length))!=ne.Word)}class Qt extends Ie{nextMatch(e,t,n){let r=N(this.spec,e,n,e.doc.length).next();if(r.done)r=N(this.spec,e,0,t).next();return r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let l=Math.max(t,n-r*1e4),s=N(this.spec,e,l,n),c=null;while(!s.next().done)c=s.value;if(c&&(l==t||c.from>l+10))return c;if(l==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let l=+n.slice(0,r);if(l>0&&l<e.match.length)return e.match[l]+n.slice(r)}return t})}matchAll(e,t){let n=N(this.spec,e,0,e.doc.length),r=[];while(!n.next().done){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let l=N(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));while(!l.next().done)r(l.value.from,l.value.to)}}var J=U.define(),Ne=U.define(),W=ve.define({create(e){return new ae(Ee(e).create(),null)},update(e,t){for(let n of t.effects)if(n.is(J))e=new ae(n.value.create(),e.panel);else if(n.is(Ne))e=new ae(e.query,n.value?qe:null);return e},provide:(e)=>ln.from(e,(t)=>t.panel)});class ae{constructor(e,t){this.query=e,this.panel=t}}var Or=k.mark({class:"cm-searchMatch"}),Fr=k.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ir=xe.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(W))}update(e){let t=e.state.field(W);if(t!=e.startState.field(W)||e.docChanged||e.selectionSet||e.viewportChanged)this.decorations=this.highlight(t)}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return k.none;let{view:n}=this,r=new tt;for(let l=0,s=n.visibleRanges,c=s.length;l<c;l++){let{from:a,to:h}=s[l];while(l<c-1&&h>s[l+1].from-500)h=s[++l].to;e.highlight(n.state,a,h,(d,f)=>{let m=n.state.selection.ranges.some((p)=>p.from==d&&p.to==f);r.add(d,f,m?Fr:Or)})}return r.finish()}},{decorations:(e)=>e.decorations});function H(e){return(t)=>{let n=t.state.field(W,!1);return n&&n.query.spec.valid?e(t,n):ge(t)}}var me=H((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let l=o.single(r.from,r.to),s=e.state.facet(F);return e.dispatch({selection:l,effects:[Ve(e,r),s.scrollToMatch(l.main,e)],userEvent:"select.search"}),Xt(e),!0}),pe=H((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,l=t.prevMatch(n,r,r);if(!l)return!1;let s=o.single(l.from,l.to),c=e.state.facet(F);return e.dispatch({selection:s,effects:[Ve(e,l),c.scrollToMatch(s.main,e)],userEvent:"select.search"}),Xt(e),!0}),Pr=H((e,{query:t})=>{let n=t.matchAll(e.state,1000);if(!n||!n.length)return!1;return e.dispatch({selection:o.create(n.map((r)=>o.range(r.from,r.to))),userEvent:"select.search.matches"}),!0}),Nr=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:l}=n.main,s=[],c=0;for(let a=new R(e.doc,e.sliceDoc(r,l));!a.next().done;){if(s.length>1000)return!1;if(a.value.from==r)c=s.length;s.push(o.range(a.value.from,a.value.to))}return t(e.update({selection:o.create(s,c),userEvent:"select.search.matches"})),!0},zt=H((e,{query:t})=>{let{state:n}=e,{from:r,to:l}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,r,r);if(!s)return!1;let c=s,a=[],h,d,f=[];if(!c.precise)c=t.nextMatch(n,c.from,c.to);else if(c.from==r&&c.to==l)d=n.toText(t.getReplacement(c)),a.push({from:c.from,to:c.to,insert:d}),c=t.nextMatch(n,c.from,c.to),f.push(u.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."));let m=e.state.changes(a);if(c)h=o.single(c.from,c.to).map(m),f.push(Ve(e,c)),f.push(n.facet(F).scrollToMatch(h.main,e));return e.dispatch({changes:m,selection:h,effects:f,userEvent:"input.replace"}),!0}),qr=H((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let l of t.matchAll(e.state,1e9)){let{from:s,to:c,precise:a}=l;if(a)n.push({from:s,to:c,insert:t.getReplacement(l)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:u.announce.of(r),userEvent:"input.replace.all"}),!0});function qe(e){return e.state.facet(F).createPanel(e)}function Ee(e,t){var n,r,l,s,c;let a=e.selection.main,h=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!h)return t;let d=e.facet(F);return new Oe({search:((n=t===null||t===void 0?void 0:t.literal)!==null&&n!==void 0?n:d.literal)?h:h.replace(/\n/g,"\\n"),caseSensitive:(r=t===null||t===void 0?void 0:t.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(l=t===null||t===void 0?void 0:t.literal)!==null&&l!==void 0?l:d.literal,regexp:(s=t===null||t===void 0?void 0:t.regexp)!==null&&s!==void 0?s:d.regexp,wholeWord:(c=t===null||t===void 0?void 0:t.wholeWord)!==null&&c!==void 0?c:d.wholeWord})}function jt(e){let t=$n(e,qe);return t&&t.dom.querySelector("[main-field]")}function Xt(e){let t=jt(e);if(t&&t==e.root.activeElement)t.select()}var ge=(e)=>{let t=e.state.field(W,!1);if(t&&t.panel){let n=jt(e);if(n&&n!=e.root.activeElement){let r=Ee(e.state,t.query.spec);if(r.valid)e.dispatch({effects:J.of(r)});n.focus(),n.select()}}else e.dispatch({effects:[Ne.of(!0),t?J.of(Ee(e.state,t.query.spec)):U.appendConfig.of(Te)]});return!0},Yt=(e)=>{let t=e.state.field(W,!1);if(!t||!t.panel)return!1;let n=$n(e,qe);if(n&&n.dom.contains(e.root.activeElement))e.focus();return e.dispatch({effects:Ne.of(!1)}),!0},en=[{key:"Mod-f",run:ge,scope:"editor search-panel"},{key:"F3",run:me,shift:pe,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:me,shift:pe,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Yt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Nr},{key:"Mod-Alt-g",run:kr},{key:"Mod-d",run:Er,preventDefault:!0}];class tn{constructor(e){this.view=e;let t=this.query=e.state.field(W).query.spec;this.commit=this.commit.bind(this),this.searchField=ue("input",{value:t.search,placeholder:S(e,"Find"),"aria-label":S(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ue("input",{value:t.replace,placeholder:S(e,"Replace"),"aria-label":S(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ue("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ue("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ue("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,l,s){return ue("button",{class:"cm-button",name:r,onclick:l,type:"button"},s)}this.dom=ue("div",{onkeydown:(r)=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>me(e),[S(e,"next")]),n("prev",()=>pe(e),[S(e,"previous")]),n("select",()=>Pr(e),[S(e,"all")]),ue("label",null,[this.caseField,S(e,"match case")]),ue("label",null,[this.reField,S(e,"regexp")]),ue("label",null,[this.wordField,S(e,"by word")]),...e.state.readOnly?[]:[ue("br"),this.replaceField,n("replace",()=>zt(e),[S(e,"replace")]),n("replaceAll",()=>qr(e),[S(e,"replace all")])],ue("button",{name:"close",onclick:()=>Yt(e),"aria-label":S(e,"close"),type:"button"},["×"])])}commit(){let e=new Oe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});if(!e.eq(this.query))this.query=e,this.view.dispatch({effects:J.of(e)})}keydown(e){if(Di(this.view,e,"search-panel"))e.preventDefault();else if(e.keyCode==13&&e.target==this.searchField)e.preventDefault(),(e.shiftKey?pe:me)(this.view);else if(e.keyCode==13&&e.target==this.replaceField)e.preventDefault(),zt(this.view)}update(e){for(let t of e.transactions)for(let n of t.effects)if(n.is(J)&&!n.value.eq(this.query))this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(F).top}}function S(e,t){return e.state.phrase(t)}var ie=30,se=/[\s\.,:;?!]/;function Ve(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),l=e.state.doc.lineAt(n).to,s=Math.max(r.from,t-ie),c=Math.min(l,n+ie),a=e.state.sliceDoc(s,c);if(s!=r.from){for(let h=0;h<ie;h++)if(!se.test(a[h+1])&&se.test(a[h])){a=a.slice(h);break}}if(c!=l){for(let h=a.length-1;h>a.length-ie;h--)if(!se.test(a[h-1])&&se.test(a[h])){a=a.slice(0,h);break}}return u.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}var Vr=u.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Te=[W,Pe.low(Ir),Vr];var Gr=u.theme({"&":{color:"var(--code-fg)",backgroundColor:"var(--code-bg)",height:"100%",fontSize:"var(--code-size, 13px)"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:"var(--font-mono)",lineHeight:"1.55",overflow:"auto"},".cm-content":{caretColor:"var(--code-fg)",padding:"0.5rem 0"},".cm-line":{padding:"0 0.75rem"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--code-fg)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--code-selection)"},".cm-activeLine":{backgroundColor:"var(--code-active-line)"},".cm-gutters":{backgroundColor:"var(--code-gutter-bg)",color:"var(--code-gutter)",border:"none",borderRight:"1px solid var(--border)"},".cm-activeLineGutter":{backgroundColor:"var(--code-active-line)",color:"var(--code-fg)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5rem 0 0.5rem",minWidth:"2.25rem"},".cm-matchingBracket, .cm-nonmatchingBracket":{backgroundColor:"var(--code-selection)",outline:"1px solid var(--border-strong)"},".cm-searchMatch":{backgroundColor:"var(--warn-soft)",outline:"1px solid var(--warn)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--accent-soft)",outline:"1px solid var(--accent)"},".cm-panels":{backgroundColor:"var(--surface-2)",color:"var(--text)",borderColor:"var(--border)",fontFamily:"var(--font)"},".cm-panels-top":{borderBottom:"1px solid var(--border)"},".cm-panel.cm-search":{padding:"0.5rem 2rem 0.5rem 0.5rem"},".cm-panel.cm-search input, .cm-panel.cm-search button, .cm-panel.cm-search label":{fontSize:"0.875rem"},".cm-panel.cm-search input[type=text]":{backgroundColor:"var(--surface)",color:"var(--text)",border:"1px solid var(--control-border)",borderRadius:"var(--radius-sm)",padding:"0.25rem 0.5rem"},".cm-panel.cm-search button":{backgroundColor:"var(--surface-3)",color:"var(--text)",border:"1px solid var(--border-strong)",borderRadius:"var(--radius-sm)",backgroundImage:"none",padding:"0.25rem 0.625rem"},".cm-panel.cm-search [name=close]":{color:"var(--muted)"}}),Ur=Wt.define([{tag:[i.keyword,i.modifier,i.operatorKeyword,i.controlKeyword],color:"var(--code-keyword)"},{tag:[i.string,i.regexp,i.special(i.string),i.inserted],color:"var(--code-string)"},{tag:[i.number,i.bool,i.null,i.atom,i.literal],color:"var(--code-number)"},{tag:[i.comment,i.lineComment,i.blockComment,i.docComment],color:"var(--code-comment)",fontStyle:"italic"},{tag:[i.typeName,i.className,i.namespace,i.tagName,i.standard(i.tagName)],color:"var(--code-type)"},{tag:[i.function(i.variableName),i.function(i.propertyName),i.definition(i.variableName),i.labelName],color:"var(--code-function)"},{tag:[i.meta,i.processingInstruction,i.annotation,i.attributeName,i.propertyName,i.heading],color:"var(--code-meta)"},{tag:i.heading,fontWeight:"bold"},{tag:i.strong,fontWeight:"bold"},{tag:i.emphasis,fontStyle:"italic"},{tag:i.strikethrough,textDecoration:"line-through"},{tag:i.link,color:"var(--code-function)",textDecoration:"underline"},{tag:i.url,color:"var(--code-function)"},{tag:i.invalid,color:"var(--danger)"},{tag:i.deleted,color:"var(--danger)"}]),nn=[Gr,Yi(Ur)];var zr={typescript:()=>(O("8f6yywt3"),import("./chunk-lang-typescript-8f6yywt3.js")),javascript:()=>(O("xj00cp97"),import("./chunk-lang-javascript-xj00cp97.js")),json:()=>(O("5eaarz7j"),import("./chunk-lang-json-5eaarz7j.js")),markdown:()=>(O("zxx8eke8"),import("./chunk-lang-markdown-zxx8eke8.js")),css:()=>(O("t85r8rz0"),import("./chunk-lang-css-t85r8rz0.js")),html:()=>(O("n6jparge"),import("./chunk-lang-html-n6jparge.js")),python:()=>(O("fjw84w10"),import("./chunk-lang-python-fjw84w10.js")),yaml:()=>(O("c4b6ft3y"),import("./chunk-lang-yaml-c4b6ft3y.js")),go:()=>(O("830fmhba"),import("./chunk-lang-go-830fmhba.js")),rust:()=>(O("5rbp2zdk"),import("./chunk-lang-rust-5rbp2zdk.js")),sql:()=>(O("0c2w9c2y"),import("./chunk-lang-sql-0c2w9c2y.js")),xml:()=>(O("eze08p42"),import("./chunk-lang-xml-eze08p42.js")),shell:()=>(O("vzagpym3"),import("./chunk-lang-shell-vzagpym3.js")),toml:()=>(O("yr9fv6eb"),import("./chunk-lang-toml-yr9fv6eb.js")),dockerfile:()=>(O("d5mzxs60"),import("./chunk-lang-dockerfile-d5mzxs60.js"))};async function rn(e){if(e==="plain")return;try{return(await zr[e]()).language()}catch(t){console.warn("a language for the editor failed to load",t);return}}function _r(e){if(typeof e.attachShadow!=="function"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in Document.prototype))return{parent:e,root:void 0};let t=e.shadowRoot??e.attachShadow({mode:"open"}),n=new CSSStyleSheet;return n.replaceSync(":host{display:flex;flex-direction:column;min-height:0}.cm-editor{flex:1;min-height:0}"),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],{parent:t,root:t}}async function mo(e){let t=new bt,n=new bt,r=new bt,l=await rn(e.language),s=(m)=>[A.readOnly.of(!m),u.editable.of(m)],c={editable:e.editable,wrap:e.wrap,language:l??[]},a,h=(m)=>[Fi(),Vi(),Gi(),it(),Ui(),Hi(),$t(),Kt({top:!0}),Xe.of(" "),A.phrases.of(e.phrases),nn,ot.of([{key:"Mod-s",preventDefault:!0,run:()=>(e.onSave(),!0)},{key:"Escape",run:()=>(e.onEscape(),!0)},Vt,...en,...at,...qt]),A.lineSeparator.of(m),t.of(s(c.editable)),n.of(c.wrap?u.lineWrapping:[]),r.of(c.language),u.updateListener.of((p)=>{if(p.docChanged)e.onChange()})],d=_r(e.parent),f=new u({parent:d.parent,root:d.root,state:A.create({doc:e.text,extensions:h(e.eol)})});return a=f.state.doc,{text:()=>f.state.doc.sliceString(0,void 0,f.state.lineBreak),dirty:()=>a===void 0||!f.state.doc.eq(a),snapshot:()=>f.state.doc,markSaved:(m)=>{a=m??f.state.doc},replace:(m,p)=>{let E=f.scrollDOM.scrollTop;f.setState(A.create({doc:m,extensions:h(p)})),a=f.state.doc,f.scrollDOM.scrollTop=E},setEditable:(m)=>{c.editable=m,f.dispatch({effects:t.reconfigure(s(m))})},setWrap:(m)=>{c.wrap=m,f.dispatch({effects:n.reconfigure(m?u.lineWrapping:[])})},setLanguage:async(m)=>{c.language=await rn(m)??[],f.dispatch({effects:r.reconfigure(c.language)})},undo:()=>{Y(f)},redo:()=>{G(f)},find:()=>{ge(f)},tab:()=>{oe(f)},focus:()=>f.focus(),scrollTop:()=>f.scrollDOM.scrollTop,scrollTo:(m)=>{f.scrollDOM.scrollTop=m},destroy:()=>f.destroy()}}export{mo as createEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{re}from"./chunk-index-ky42ev0b.js";import"./chunk-index-5d8yjj4m.js";export{re as Confirm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p,e,n,x,y,_,L,m,Q}from"./chunk-index-31wh5twj.js";import{fe}from"./chunk-index-hk3xyy20.js";function g(){let{connectorAdminUrl:o}=Q(),{data:r,error:s}=fe(()=>m.connectors(),"connectors");return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Connectors")}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the assistant.")})]}),o?e("a",{href:o,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),s?e(y,{message:s}):null,!r&&!s?e(x,{}):null,r?n(p,{children:[e("h3",{children:t("Upstream gateways")}),r.gateways.length===0?e(_,{children:t("No gateways.")}):null,r.gateways.map((a)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(L,{children:a.enabled?t("Enabled"):t("Disabled")}),e(L,{tone:a.reachable?"plain":"warn",children:a.reachable?t("Reachable"):t("Unreachable")}),e(L,{children:t("{count} tools",{count:a.tools})})]})},a.name)),e("h3",{children:t("Virtual servers")}),r.servers.length===0?e(_,{children:t("No virtual servers.")}):null,r.servers.map((a)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(L,{children:t("{count} tools",{count:a.tools.length})})]}),n("p",{children:[t("Used by"),": ",a.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:a.tools.map((l)=>e("li",{children:l},l))})]})]},a.name))]}):null]})}export{g as ConnectorsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,c,p,e,n,C,x,y,_,L,m,Q,se,Ke,J,we,Nt,wn}from"./chunk-index-31wh5twj.js";import{fe}from"./chunk-index-hk3xyy20.js";var u=[{kind:"owner",title:c("Owner channels"),note:c("Direct messages and channels where the owner talks to the assistant.")},{kind:"agent",title:c("Agent channels"),note:c("The agent server's one-to-one channels.")},{kind:"group",title:c("Group channels"),note:c("The agent server's group channels.")},{kind:"outside",title:c("Outside agents"),note:c("Conversations an agent outside Discord holds over MCP.")},{kind:"plugin",title:c("Plugin conversations"),note:c("Conversations a plugin runs, such as a web chat, as the host recorded them.")}];function Z(){let{timeZone:o}=Q(),{now:i}=se(),{data:s,error:a}=fe(()=>m.conversations(),"conversations"),d=s?.conversations;if(!d)return a?e(y,{message:a}):e(x,{});return n(p,{children:[a?e(y,{message:a}):null,u.map((r)=>{let h=d.filter((l)=>l.kind===r.kind);return n("section",{className:"stack",children:[e("h2",{children:t(r.title)}),e("p",{className:"hint",children:t(r.note)}),h.length===0?e(_,{children:t("None stored.")}):null,h.map((l)=>e(g,{item:l,now:i,timeZone:o},l.key))]},r.kind)})]})}function g(o){let{item:i}=o,s=Nt(i.channel,i.id),a=wn(i);return n("a",{className:"card card-link",href:C("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:a}),i.busy>0?e(L,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(L,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${J(i.startedAt,o.timeZone)} · `:s.detail?`${s.detail} · `:"",i.principal?`${i.visibility==="private"?t("Private to {name}",{name:i.principal.name}):t("Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",Ke(i.lastActive,o.now,o.timeZone)," ·"," ",we(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{Z as ConversationsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi}from"./chunk-index-31wh5twj.js";import{hi}from"./chunk-index-wmbmmrd4.js";import{Qr,Rr,$i,Ni,Er,Cr}from"./chunk-index-e1dr6g10.js";var ne=yi,re=(a)=>{for(let n=a;n;n=n.parentElement){let{overflowY:l}=getComputedStyle(n);if((l==="auto"||l==="scroll")&&n.scrollHeight>n.clientHeight)return n}return document.scrollingElement??document.documentElement};function se(a){let{item:n,root:l,key:u,mode:C}=a,c=re(l),O=c===document.scrollingElement||c===document.documentElement,k=()=>O?0:c.getBoundingClientRect().top,X=()=>O?window.innerHeight:c.clientHeight,x=(e)=>e-k()+c.scrollTop,p=(e)=>{let t=e.getBoundingClientRect();return{top:x(t.top),height:t.height}},y=document.createElement("div");y.className="drop-line",y.setAttribute("aria-hidden","true");let z=[],P=[],g=[],h=[],R=[],B={top:0,bottom:0},D=()=>{let e=[...l.querySelectorAll("[data-drop-item], [data-folder-block]")].map((t)=>[t,t.style.transform]);for(let[t]of e)t.style.removeProperty("transform");try{j()}finally{for(let[t,r]of e)if(r)t.style.transform=r}},j=()=>{if(C==="room"){P=[...l.querySelectorAll("[data-drop-zone]")],z=P.map((t)=>{let{top:r,height:H}=p(t);return{id:t.dataset.zoneId??"",kind:t.dataset.dropZone,...t.dataset.folder?{folder:t.dataset.folder}:{},top:r,bottom:r+H,items:t.dataset.collapsed===void 0?[...t.querySelectorAll("[data-drop-item]")].map((o)=>({key:o.dataset.key??"",...p(o)})):[]}});return}g=[...l.querySelectorAll(":scope > [data-folder-block]")],h=g.map((t)=>({key:t.dataset.key??"",...p(t)})),R=g.map((t)=>({key:t.dataset.key??"",...p(t.querySelector("[data-folder-head]")??t)}));let e=p(l);B={top:e.top,bottom:e.top+e.height}};hi(!0);let G=n.getBoundingClientRect().top;n.setAttribute("data-lifted",""),l.setAttribute("data-reordering","");let F=n.getBoundingClientRect().top-G;if(F)c.scrollTop+=F;D();let J=x(a.y),I={x:0,y:a.y},Z=!1,f=0,w,d,q={type:"cancel"};try{n.setPointerCapture(a.pointerId)}catch{}let _=()=>{f=0;let e=x(I.y),t=e-J;if(Math.abs(t)>ne)Z=!0;n.style.transform=`translate3d(0, ${t}px, 0)`;let r;if(C==="room"){let o=Qr(z,u,e);q=o?{type:"room",drop:o}:{type:"cancel"};let M=o?z.indexOf(o.zone):-1;r=P[M];let E=r?.contains(n)??!1,s=o?o.zone.items:[],m=E?[...r.querySelectorAll("[data-drop-item]")]:[],v=s.findIndex((i)=>i.key===u),W=o?Ni(s.map((i)=>i.key),u,o.before):0,ee=s.length>1?Math.max(0,(s[1]?.top??0)-(s[0]?.top??0)-(s[0]?.height??0)):0,U=E&&v>=0?$i(s,v,W,ee):[];for(let i of document.querySelectorAll("[data-drop-item]:not([data-lifted])"))i.style.removeProperty("transform");if(m.forEach((i,A)=>{if(U[A])i.style.transform=`translate3d(0, ${U[A]}px, 0)`}),r&&o&&!E){let i=o.before===null?void 0:o.zone.items.find((oe)=>oe.key===o.before),A=p(r).top,te=i?i.top-A:o.zone.items.length?p(r).height:0;y.style.top=`${te}px`,r.append(y)}else y.remove();if(o?.zone.kind==="folder"&&o.zone.items.length===0&&r?.dataset.collapsed!==void 0){if(d?.zone!==o.zone.id){if(d)clearTimeout(d.timer);let i=o.zone.folder??"";d={zone:o.zone.id,timer:setTimeout(()=>{a.open(i),requestAnimationFrame(()=>requestAnimationFrame(()=>{D(),L()}))},Cr)}}}else if(d)clearTimeout(d.timer),d=void 0}else{let o=Rr(R,B,u,e);q=o?{type:"folder",before:o.before}:{type:"cancel"};let M=h.findIndex((m)=>m.key===u),E=o?Ni(h.map((m)=>m.key),u,o.before):M,s=$i(h,M,E,12);g.forEach((m,v)=>{if(m!==n)m.style.transform=s[v]?`translate3d(0, ${s[v]}px, 0)`:""})}if(r!==w)w?.removeAttribute("data-drop-target"),r?.setAttribute("data-drop-target",""),w=r;let H=Er(I.y,k(),k()+X());if(H)c.scrollTop+=H,L()},L=()=>{if(!f)f=requestAnimationFrame(_)},b=(e)=>{Q(),a.done(e)},S=(e)=>e.pointerId===a.pointerId,K=(e)=>{if(!S(e))return;e.stopPropagation(),e.preventDefault(),I={x:e.clientX,y:e.clientY},L()},N=(e)=>{if(!S(e))return;if(e.stopPropagation(),f)cancelAnimationFrame(f),_();b(Z?q:{type:"tap"})},V=(e)=>{if(S(e))b({type:"cancel"})},Y=(e)=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation(),b({type:"cancel"})},T=(e)=>e.preventDefault();function Q(){if(hi(!1),window.removeEventListener("pointermove",K,!0),window.removeEventListener("pointerup",N,!0),window.removeEventListener("pointercancel",V,!0),window.removeEventListener("keydown",Y,!0),window.removeEventListener("touchmove",T,!0),window.removeEventListener("contextmenu",T,!0),f)cancelAnimationFrame(f);if(d)clearTimeout(d.timer);w?.removeAttribute("data-drop-target"),y.remove(),n.removeAttribute("data-lifted"),n.style.removeProperty("transform"),l.removeAttribute("data-reordering");for(let e of l.querySelectorAll("[data-drop-item], [data-folder-block]"))e.style.removeProperty("transform");try{n.releasePointerCapture(a.pointerId)}catch{}}return window.addEventListener("pointermove",K,!0),window.addEventListener("pointerup",N,!0),window.addEventListener("pointercancel",V,!0),window.addEventListener("keydown",Y,!0),window.addEventListener("touchmove",T,{capture:!0,passive:!1}),window.addEventListener("contextmenu",T,!0),L(),()=>b({type:"cancel"})}export{se as lift};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O}from"./chunk-index-31wh5twj.js";import{Mt}from"./chunk-index-2ad17eh4.js";function C(){try{let c=document.createElement("canvas");return!!(c.getContext("webgl2")||c.getContext("webgl"))}catch{return!1}}function H(c,n){return[c,n.includes("?")?n.slice(n.indexOf("?")):""].some((r)=>{let d=new URLSearchParams(r).get("nogl");return d!==null&&d!=="0"&&d!=="false"})}async function B(c,n,g){let r=n.variant==="compact",d=n.labels??Mt,l=new Map,T=(e)=>{l.clear();for(let t of e)l.set(t.id,{...t})};T(n.seats);let m={t:n.theme,s:n.scheme},a=null,o=document.createElement("div");o.className="rt-table",o.dataset.variant=r?"compact":"full";let f=document.createElement("div");f.className="rt-table-stage",o.appendChild(f);let i=null,h=!1,L=()=>!r&&(Boolean(n.listBelow)||h);c.appendChild(o);let u=new Map,S=()=>{if(!L()){i?.remove(),i=null,u.clear(),delete o.dataset.list;return}if(!i)i=document.createElement("ul"),i.className="rt-table-list",i.setAttribute("aria-label",d.table),o.appendChild(i),o.dataset.list="";for(let e of[...u.keys()])if(!l.has(e))u.delete(e);for(let e of l.values()){let t=u.get(e.id);if(!t){t=document.createElement("button"),t.type="button",t.dataset.seat=e.id;let s=e.id;t.addEventListener("click",()=>{let b=l.get(s);if(b)n.onSeatClick({id:b.id,name:b.name})}),u.set(e.id,t)}t.textContent=d.seat(e.name,e.state??"idle"),t.style.setProperty("--seat",e.color)}i.replaceChildren(...[...l.values()].map((e)=>{let t=document.createElement("li"),s=u.get(e.id);if(s)t.appendChild(s);return t}))};S();let E=(e)=>{h=!e,S(),n.onNames?.(e)},p=async()=>{let{createTable2D:e}=await (O("4sje1fr0"),import("./chunk-table2d-4sje1fr0.js"));a=e(f,{...n,theme:m.t,scheme:m.s,seats:[...l.values()]}),E(!0)},M=async()=>{let{createTable3D:e}=await (O("h64skazp"),import("./chunk-table3d-h64skazp.js"));a=e(f,{...n,theme:m.t,scheme:m.s,seats:[...l.values()],onNames:E},()=>{a?.dispose(),p()})};if(r||g==="svg"||g!=="webgl"&&(H(location.search,location.hash)||!C()))await p();else try{await M()}catch{await p()}let y,w=n.onSeatMenu;if(w&&!r){let{attachSeatMenu:e}=await (O("jv4s7hmj"),import("./chunk-seat-menu-jv4s7hmj.js"));y=e(o,(t,s,b)=>{let A=t instanceof Element?t.closest("[data-seat]")?.dataset.seat:void 0,v=l.get(A??a?.seatAt?.(s,b)??"");return v?{id:v.id,name:v.name}:void 0},w)}return{get kind(){return a.kind},setTheme(e,t){m={t:e,s:t},a.setTheme(e,t)},setSeats(e){T(e),S(),a.setSeats(e)},setState(e,t){let s=l.get(e);if(s)s.state=t;S(),a.setState(e,t)},setAvatar(e,t){let s=l.get(e);if(s)s.avatarSvg=t;return a.setAvatar(e,t)},setReducedMotion:(e)=>a.setReducedMotion(e),resetCamera:()=>a.resetCamera(),focus:(e,t)=>a.focus(e,t),focused:()=>a.focused(),seatAt:(e,t)=>a.seatAt?.(e,t)??null,getStats:()=>a.getStats(),dispose(){y?.(),a?.dispose(),o.remove()}}}export{B as mountRoundTable};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O,s,D,t,ut,p,e,n,a,je,d,Oe,Yn,Hn}from"./chunk-index-31wh5twj.js";import{li,ci,ui,di}from"./chunk-index-0pt08yd9.js";import{wt}from"./chunk-index-wmbmmrd4.js";import{En}from"./chunk-index-gpkzhq1g.js";var k=()=>(O("bv0chj41"),import("./chunk-layout-actions-bv0chj41.js")),y=(r)=>(O("fvfy9m0y"),import("./chunk-placement-items-fvfy9m0y.js")).then((o)=>o.folderMenu(r)),v=(r)=>({mode:"folder",key:r,item:(o)=>o.closest("[data-folder-block]"),root:(o)=>o.closest("[data-folder-block]")?.parentElement??null,onDrop:(o)=>{if(o.type==="folder")k().then((i)=>i.placeFolderBefore(r,o.before))},open:ui});function b(r){let{id:o,name:i}=r,m=li().has(o),l=r.holdsActive||!m,f=D(),h=wt(()=>y(o),v(o)),N=(c)=>{y(o).then((u)=>{if(!u)return;let g=c.getBoundingClientRect();Oe({...u,at:{x:g.left,y:g.bottom},via:"key",source:c})},()=>{return})};return n("section",{className:"folder","aria-label":i,"data-folder-block":"","data-key":o,"data-drop-zone":"folder","data-zone-id":o,"data-folder":o,"data-collapsed":l?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...h,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":l,"aria-controls":f,"aria-label":l?t("Collapse {name}",{name:i}):t("Expand {name}",{name:i}),onClick:()=>ci(o),children:[e(a,{name:"chevron",size:16,className:"folder-chevron","data-open":l||void 0}),e(a,{name:"folder",size:18}),e("strong",{children:i}),e("span",{className:"meta",children:ut(r.count,"{count} room","{count} rooms")})]}),r.muted==="none"?null:e(a,{name:"bell-off",size:14,className:"muted-mark","data-partial":r.muted==="some"||void 0,role:"img","aria-hidden":!1,"aria-label":r.muted==="all"?t("Notifications are off"):t("Some notifications are off")}),l?null:r.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(c)=>N(c.currentTarget),children:e(a,{name:"more",size:18})})]}),e("div",{id:f,className:"folder-body",hidden:!l,children:l?r.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):r.children:null})]})}function F(r){let o=d((i)=>({waiting:r.rooms.reduce((m,l)=>m+je(i,l),0),typing:r.rooms.some((m)=>i.rooms[m]?.typing)}),r.rooms.join(","));return n(p,{children:[o.typing?e(Yn,{}):null,o.waiting?e(Hn,{count:o.waiting}):null]})}function M(r){return d((o)=>En(r,(i)=>o.rooms[i]?.view?.muted===!0),r.join(","))}function G(r){let o=r.folders.map((i)=>i.id).join(",");return s(()=>{if(r.listed)di(o?o.split(","):[])},[r.listed,o]),e(p,{children:r.folders.map((i)=>e(R,{folder:i,...r},i.id))})}function R(r){let{folder:o}=r,i=M(o.rooms);return e(b,{id:o.id,name:o.name,count:o.rooms.length,holdsActive:r.active!==void 0&&o.rooms.includes(r.active),muted:i,summary:e(F,{rooms:o.rooms}),children:r.rooms(o.rooms)})}export{G as FolderList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{li,ci,ui,di}from"./chunk-index-0pt08yd9.js";export{ui as expandFolder,di as pruneCollapsed,ci as toggleCollapsed,li as useCollapsed};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,e,n,Xt}from"./chunk-index-31wh5twj.js";import{Ki,Ji,fi,gn}from"./chunk-index-4dy94pbz.js";import"./chunk-index-5d8yjj4m.js";function b(i){let{roomKey:o,members:m}=i,{line:s}=fi(o),[l,a]=r(),u=Ji(Ki(s,m),s?.id,l),t=(f)=>a({lineId:s?.id,member:f});return n("div",{className:"table-frame room-scene","data-focused":"",children:[e(Xt,{members:m,groupRoom:o,variant:"full",focus:u,onFocus:t,onSeat:t}),e(gn,{roomKey:o,open:!0,streams:!1})]})}export{b as GroupScene};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var Ar=40;class l extends Error{code;constructor(e){super(e);this.code=e;this.name="LayoutError"}}function rn(e,n,r){if(r===n&&e.includes(n))return[...e];let t=e.filter((o)=>o!==n),i=r===null||r===void 0?-1:t.indexOf(r);if(i<0)return[...t,n];return[...t.slice(0,i),n,...t.slice(i)]}function Ne(e,n,r){let t=e.indexOf(n);if(t<0)return;if(r==="up")return t===0?void 0:{before:e[t-1]??null};return t===e.length-1?void 0:{before:e[t+2]??null}}function Li(e){let n=e.trim(),r=Array.from(n).length;if(r<1||r>40||/\p{Cc}/u.test(n))throw new l("bad-name");return n}var c=(e,n)=>e.toLocaleLowerCase()===n.toLocaleLowerCase();function u(e,n){let r=e.folders.findIndex((t)=>t.id===n);if(r<0)throw new l("no-folder");return r}var f=(e,n)=>({pins:e.pins,folders:n});function $r(e,n,r){let t=u(e,n),i=Li(r);if(e.folders.some((o)=>o.id!==n&&c(o.name,i)))throw new l("duplicate");return f(e,e.folders.map((o,s)=>s===t?{...o,name:i}:o))}function Nr(e,n,r){let t=u(e,n),i=e.folders[t],o=rn(e.folders.map((s)=>s.id),n,r);return f(e,o.map((s)=>s===n?i:e.folders.find((a)=>a.id===s)))}function Lr(e,n){return u(e,n),f(e,e.folders.filter((r)=>r.id!==n))}var d=(e,n)=>({pins:e.pins.filter((r)=>r!==n),folders:e.folders.map((r)=>r.rooms.includes(n)?{...r,rooms:r.rooms.filter((t)=>t!==n)}:r)});function Xr(e,n,r,t){if(r!==null)u(e,r);let i=d(e,n);if(r===null)return i;return f(i,i.folders.map((o)=>o.id===r?{...o,rooms:rn(o.rooms,n,t)}:o))}function zr(e,n,r,t){let i=d(e,n);if(!r)return i;return{pins:rn(e.pins.filter((o)=>o!==n),n,t),folders:i.folders}}
|
|
2
|
+
export{Ar,rn,Ne,Li,$r,Nr,Lr,Xr,zr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j}from"./chunk-index-31wh5twj.js";var i="roundtable-console:folders-collapsed";function a(){try{let e=localStorage.getItem(i),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=j(),n=()=>(l??=a(),l);function s(e){l=e;try{localStorage.setItem(i,JSON.stringify([...e]))}catch{}d()}var li=()=>c(n);function ci(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function ui(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function di(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{li,ci,ui,di};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{tr,j}from"./chunk-index-31wh5twj.js";var i={pin:"M9 4h6l-1 6 3 3H7l3-3-1-6ZM12 13v7",folder:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z",up:"M6 15l6-6 6 6",down:"M6 9l6 6 6-6",edit:"M4 20h4L19 9l-4-4L4 16v4ZM13.5 6.5l4 4"};tr(i);var o,{emit:e,use:r}=j();function Se(n){o=n,e()}function bn(){if(!o)return;o=void 0,e()}var er=()=>r(()=>o);
|
|
2
|
+
export{Se,bn,er};
|