toyon 0.20.0 → 0.22.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/README.md +5 -3
- package/cloud/Dockerfile +1 -1
- package/dist/CHANGELOG.md +72 -0
- package/dist/bridge.js +1 -1
- package/dist/cli.js +296 -141
- package/dist/daemon.js +4659 -2861
- package/dist/shell/assets/{Editor--Z8ktewC.js → Editor-1fCgxkUp.js} +177 -177
- package/dist/shell/assets/Editor-1fCgxkUp.js.br +0 -0
- package/dist/shell/assets/Editor-1fCgxkUp.js.gz +0 -0
- package/dist/shell/assets/{XTerm-DsUQ0Xew.js → XTerm-B_hkTWne.js} +1 -1
- package/dist/shell/assets/XTerm-B_hkTWne.js.br +0 -0
- package/dist/shell/assets/XTerm-B_hkTWne.js.gz +0 -0
- package/dist/shell/assets/{cssMode-BjAkCPrp.js → cssMode-1LqDnQzX.js} +1 -1
- package/dist/shell/assets/cssMode-1LqDnQzX.js.br +0 -0
- package/dist/shell/assets/cssMode-1LqDnQzX.js.gz +0 -0
- package/dist/shell/assets/{freemarker2-BZCFxXwq.js → freemarker2-BJFDEJKJ.js} +1 -1
- package/dist/shell/assets/{freemarker2-BZCFxXwq.js.br → freemarker2-BJFDEJKJ.js.br} +0 -0
- package/dist/shell/assets/freemarker2-BJFDEJKJ.js.gz +0 -0
- package/dist/shell/assets/{grammar-CQ1uaD6_.js → grammar-DVeERVO3.js} +1 -1
- package/dist/shell/assets/{grammar-CQ1uaD6_.js.br → grammar-DVeERVO3.js.br} +0 -0
- package/dist/shell/assets/grammar-DVeERVO3.js.gz +0 -0
- package/dist/shell/assets/{handlebars-G1zJeDLP.js → handlebars-BGFLy2DH.js} +1 -1
- package/dist/shell/assets/handlebars-BGFLy2DH.js.br +0 -0
- package/dist/shell/assets/handlebars-BGFLy2DH.js.gz +0 -0
- package/dist/shell/assets/{html-CUHSCFMy.js → html-CPJflvc5.js} +1 -1
- package/dist/shell/assets/html-CPJflvc5.js.br +0 -0
- package/dist/shell/assets/html-CPJflvc5.js.gz +0 -0
- package/dist/shell/assets/{htmlMode-gpMedtd9.js → htmlMode-CjqzceBV.js} +1 -1
- package/dist/shell/assets/htmlMode-CjqzceBV.js.br +0 -0
- package/dist/shell/assets/htmlMode-CjqzceBV.js.gz +0 -0
- package/dist/shell/assets/index-DdrVWdNt.js +292 -0
- package/dist/shell/assets/index-DdrVWdNt.js.br +0 -0
- package/dist/shell/assets/index-DdrVWdNt.js.gz +0 -0
- package/dist/shell/assets/index-Dx-i3szQ.css +1 -0
- package/dist/shell/assets/index-Dx-i3szQ.css.br +0 -0
- package/dist/shell/assets/index-Dx-i3szQ.css.gz +0 -0
- package/dist/shell/assets/{javascript-BHWH8gQN.js → javascript-B4CelO-C.js} +1 -1
- package/dist/shell/assets/{jsonMode-DyV5nvVT.js → jsonMode-C2JxYuT6.js} +1 -1
- package/dist/shell/assets/jsonMode-C2JxYuT6.js.br +0 -0
- package/dist/shell/assets/jsonMode-C2JxYuT6.js.gz +0 -0
- package/dist/shell/assets/{liquid-Dy3tUgRC.js → liquid-BfXRgBm_.js} +1 -1
- package/dist/shell/assets/liquid-BfXRgBm_.js.br +0 -0
- package/dist/shell/assets/liquid-BfXRgBm_.js.gz +0 -0
- package/dist/shell/assets/{lspLanguageFeatures-CB_Ow-w5.js → lspLanguageFeatures-CAi6hRgs.js} +1 -1
- package/dist/shell/assets/lspLanguageFeatures-CAi6hRgs.js.br +0 -0
- package/dist/shell/assets/lspLanguageFeatures-CAi6hRgs.js.gz +0 -0
- package/dist/shell/assets/{mdx-DD5jgco_.js → mdx-DeBYGdge.js} +1 -1
- package/dist/shell/assets/mdx-DeBYGdge.js.br +0 -0
- package/dist/shell/assets/mdx-DeBYGdge.js.gz +0 -0
- package/dist/shell/assets/{python-BvLKUXll.js → python-CFhHKm43.js} +1 -1
- package/dist/shell/assets/python-CFhHKm43.js.br +0 -0
- package/dist/shell/assets/python-CFhHKm43.js.gz +0 -0
- package/dist/shell/assets/{razor-B2tUlbzR.js → razor-C-gkU4Y9.js} +1 -1
- package/dist/shell/assets/razor-C-gkU4Y9.js.br +0 -0
- package/dist/shell/assets/razor-C-gkU4Y9.js.gz +0 -0
- package/dist/shell/assets/{tsMode-DMuNnqM7.js → tsMode-8E7grKbo.js} +1 -1
- package/dist/shell/assets/tsMode-8E7grKbo.js.br +0 -0
- package/dist/shell/assets/tsMode-8E7grKbo.js.gz +0 -0
- package/dist/shell/assets/{xml-DdYgb5a2.js → xml-CBoTF2r1.js} +1 -1
- package/dist/shell/assets/xml-CBoTF2r1.js.br +0 -0
- package/dist/shell/assets/xml-CBoTF2r1.js.gz +0 -0
- package/dist/shell/assets/{yaml-BDujJdoL.js → yaml-CyKxhzxl.js} +1 -1
- package/dist/shell/assets/yaml-CyKxhzxl.js.br +0 -0
- package/dist/shell/assets/yaml-CyKxhzxl.js.gz +0 -0
- package/dist/shell/index.html +2 -2
- package/package.json +1 -1
- package/dist/shell/assets/Editor--Z8ktewC.js.br +0 -0
- package/dist/shell/assets/Editor--Z8ktewC.js.gz +0 -0
- package/dist/shell/assets/XTerm-DsUQ0Xew.js.br +0 -0
- package/dist/shell/assets/XTerm-DsUQ0Xew.js.gz +0 -0
- package/dist/shell/assets/cssMode-BjAkCPrp.js.br +0 -0
- package/dist/shell/assets/cssMode-BjAkCPrp.js.gz +0 -0
- package/dist/shell/assets/freemarker2-BZCFxXwq.js.gz +0 -0
- package/dist/shell/assets/grammar-CQ1uaD6_.js.gz +0 -0
- package/dist/shell/assets/handlebars-G1zJeDLP.js.br +0 -0
- package/dist/shell/assets/handlebars-G1zJeDLP.js.gz +0 -0
- package/dist/shell/assets/html-CUHSCFMy.js.br +0 -0
- package/dist/shell/assets/html-CUHSCFMy.js.gz +0 -0
- package/dist/shell/assets/htmlMode-gpMedtd9.js.br +0 -0
- package/dist/shell/assets/htmlMode-gpMedtd9.js.gz +0 -0
- package/dist/shell/assets/index-B3Alj0WH.css +0 -1
- package/dist/shell/assets/index-B3Alj0WH.css.br +0 -0
- package/dist/shell/assets/index-B3Alj0WH.css.gz +0 -0
- package/dist/shell/assets/index-VVd_p5tJ.js +0 -278
- package/dist/shell/assets/index-VVd_p5tJ.js.br +0 -0
- package/dist/shell/assets/index-VVd_p5tJ.js.gz +0 -0
- package/dist/shell/assets/jsonMode-DyV5nvVT.js.br +0 -0
- package/dist/shell/assets/jsonMode-DyV5nvVT.js.gz +0 -0
- package/dist/shell/assets/liquid-Dy3tUgRC.js.br +0 -0
- package/dist/shell/assets/liquid-Dy3tUgRC.js.gz +0 -0
- package/dist/shell/assets/lspLanguageFeatures-CB_Ow-w5.js.br +0 -0
- package/dist/shell/assets/lspLanguageFeatures-CB_Ow-w5.js.gz +0 -0
- package/dist/shell/assets/mdx-DD5jgco_.js.br +0 -0
- package/dist/shell/assets/mdx-DD5jgco_.js.gz +0 -0
- package/dist/shell/assets/python-BvLKUXll.js.br +0 -0
- package/dist/shell/assets/python-BvLKUXll.js.gz +0 -0
- package/dist/shell/assets/razor-B2tUlbzR.js.br +0 -0
- package/dist/shell/assets/razor-B2tUlbzR.js.gz +0 -0
- package/dist/shell/assets/tsMode-DMuNnqM7.js.br +0 -0
- package/dist/shell/assets/tsMode-DMuNnqM7.js.gz +0 -0
- package/dist/shell/assets/xml-DdYgb5a2.js.br +0 -0
- package/dist/shell/assets/xml-DdYgb5a2.js.gz +0 -0
- package/dist/shell/assets/yaml-BDujJdoL.js.br +0 -0
- package/dist/shell/assets/yaml-BDujJdoL.js.gz +0 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Toyon is where you ask for changes to your web app and try them as they happen.
|
|
|
4
4
|
|
|
5
5
|
Each copy runs on your own machine, and the next one is pre-warmed. Works with Claude Code, Codex and OpenCode over the Agent Client Protocol (ACP).
|
|
6
6
|
|
|
7
|
-
[How it works](#how-it-works) · [Install](#install) · [Under the hood](#under-the-hood) · [Trust](#trust) · [Uninstall](#uninstall)
|
|
7
|
+
[toyon.dev](https://toyon.dev) · [How it works](#how-it-works) · [Install](#install) · [Under the hood](#under-the-hood) · [Trust](#trust) · [Uninstall](#uninstall)
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -24,6 +24,8 @@ In Toyon you point at a button in the page and ask for it to be bigger, watch it
|
|
|
24
24
|
|
|
25
25
|
Each copy is a branch and a git worktree with your dependencies and `.env` files; one spare per project is kept warm.
|
|
26
26
|
|
|
27
|
+
One rule sits under all of it: no work happens on main. Main has no chat; your first message in a project starts a copy, and the files you have uncommitted in your checkout can move into that copy with it. Your checkout stays where your editor and terminal already are, runs the servers the copies share, and changes only when you press land. Most of what Toyon does without asking follows from that rule: the spare it keeps warm, the copy it starts for a message, the files it carries over, the servers it stops when nobody is looking, and the push it refuses to let an agent make.
|
|
28
|
+
|
|
27
29
|
Point at anything on the page to talk about it or open the line that draws it, and the design pane maps it to your tokens and components. What the agent is told about the page, and the keys, are in [docs/preview.md](https://github.com/toyon-dev/toyon/blob/main/docs/preview.md).
|
|
28
30
|
|
|
29
31
|
One Toyon holds every project you open, and the list of chats shows which one needs you.
|
|
@@ -48,7 +50,7 @@ npm i -g toyon
|
|
|
48
50
|
toyon ~/projects/app
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
`toyon .` opens the folder you are in and `toyon --help` lists the rest. The install button in the top bar makes Toyon an app of its own in Chrome, Arc, Brave or Edge, with a Dock icon and no browser bar; from then on `toyon .` opens that. A global install keeps itself updated; `TOYON_UPDATES=off` stops it. Run outside a project, Toyon opens with none: describe a new one in a sentence, or give the project picker a git URL to clone.
|
|
53
|
+
`toyon .` opens the folder you are in and `toyon --help` lists the rest. The install button in the top bar makes Toyon an app of its own in Chrome, Arc, Brave or Edge, with a Dock icon and no browser bar; from then on `toyon .` opens that. A global install keeps itself updated; `TOYON_UPDATES=off` stops it. Started with npx, Toyon offers the global install above the chat box once it has answered you. Run outside a project, Toyon opens with none: describe a new one in a sentence, or give the project picker a git URL to clone. `toyon https://github.com/you/app` opens it with that repository ready to clone into the folder you are in; a link to a branch, a file or a pull request on GitHub, GitLab or Codeberg is read back to its repository.
|
|
52
54
|
|
|
53
55
|
You need:
|
|
54
56
|
|
|
@@ -98,7 +100,7 @@ Copies start when you open them, and stop their servers when nobody has looked a
|
|
|
98
100
|
- It does not keep copies apart from services they share. Each copy runs your setup and your commands on its own, so a database or a compose stack they all point at is shared, migrations included. `TOYON_WORKTREE` in every command's environment lets a project give each copy its own (`app_$TOYON_WORKTREE` as the database name); [docs/settings.md](https://github.com/toyon-dev/toyon/blob/main/docs/settings.md#keeping-copies-apart) has the recipes.
|
|
99
101
|
- It does not carry a login between copies. Each preview has its own cookies, so a new chat's app starts signed out, and an OAuth provider cannot redirect into a preview at all.
|
|
100
102
|
|
|
101
|
-
##
|
|
103
|
+
## Your own server
|
|
102
104
|
|
|
103
105
|
Toyon can also run on a box you open from your phone, or on your own Fly account with the laptop closed. This moves Toyon and its copies off your laptop; it does not publish your app. None of it passes through a Toyon server; there is none. `toyon remote` puts a box on your own domain behind Caddy or on your Tailscale tailnet, `toyon deploy fly up` builds a machine on your Fly account and prints the link, and the Dockerfile in the package runs on any host with a disk and a port range. A Fly machine measured about $4-6 a month in ordinary use, plus whatever your agents spend, and its first chat can sign in with your Claude plan. A phone or a second machine pairs by opening the address and being let in from Toyon's window.
|
|
104
106
|
|
package/cloud/Dockerfile
CHANGED
package/dist/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,78 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in each release of Toyon, newest first.
|
|
4
4
|
|
|
5
|
+
## 0.22.0 (2026-11-03)
|
|
6
|
+
|
|
7
|
+
Your own messages and the agent's replies read the same way, with code, links and line breaks drawn as written, and the editor gains a split diff and an SVG preview.
|
|
8
|
+
|
|
9
|
+
### New
|
|
10
|
+
- The diff view has a split and inline toggle. Split closes the chat to make room and brings it back when you turn split off, unless you moved the chat yourself. It is hidden on a phone and for files with no other side.
|
|
11
|
+
- SVG files open in a preview in the editor, drawn from the file text so nothing runs or loads from outside, from the files tab, cmd+P or a tool row. It can expand to full size on a paper ground.
|
|
12
|
+
- Code spans and fenced blocks in your own messages are drawn as code, in the sent bubble and while the message is queued or uploading, with the same colouring the agent's fences get.
|
|
13
|
+
- A reference such as owner/repo#123 in chat links to the issue or pull request on GitHub, and a bare or backticked web address links in both the agent's rows and your own messages.
|
|
14
|
+
- Clicking a blame note in the editor opens the pull request for that line, or the commit page when the commit came without one. A commit the remote does not have gets no link, so nothing opens a 404.
|
|
15
|
+
- Agent adapters install from a private registry such as Artifactory. When a registry's release-age gate holds a package back, the composer says so and offers install anyway, and a certificate error or a 404 gets one sentence with the way out.
|
|
16
|
+
- In the full view of a picture, a double tap zooms about the tapped point and a second one returns; one finger pans while zoomed.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- A single newline in a reply is a line break, as it is in a GitHub comment or Claude Code's terminal, so multi-line quotes no longer run together. Documents such as the markdown preview and the release notes keep their wrapped paragraphs.
|
|
20
|
+
- An open question card no longer counts as work. The idle clock treats a waiting row as a candidate and expires the card when it fires, and the archive sweep, idle stop, auto update and port eviction no longer wait on an open card.
|
|
21
|
+
- The red failed and blue landed row colours show only while a server is up under the row; an asleep row reads as quiet gray until you open it.
|
|
22
|
+
- In zen, cmd+left and cmd+right step back and forward through the page like cmd+[ and cmd+]. Outside zen they still walk the worktrees you viewed.
|
|
23
|
+
- The let-me-in page, opened on localhost, says that running toyon in a terminal on this machine opens the shell already let in.
|
|
24
|
+
- The version chip's menu has a toyon.dev row, and the README leads its links with the site.
|
|
25
|
+
- The docs gained an install page, and the preview, agents and trust pages were rewritten as references in plainer prose.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- A long press on a rail, changes or files row on a touch screen started a drag instead of opening the menu. Rows still drag into the composer where there is a pointer.
|
|
29
|
+
- The purple dot for a commit, land or sync in flight showed only in the rail; the @ menu, transcript marks and worktree chip showed green.
|
|
30
|
+
|
|
31
|
+
## 0.21.0 (2026-11-02)
|
|
32
|
+
|
|
33
|
+
Splitting work is called handoff again and the pieces it starts wake each other as they land, pull request review lands in a page of its own, and the project switcher clones from a URL.
|
|
34
|
+
|
|
35
|
+
### New
|
|
36
|
+
- Pull request review comments show on a page of their own, grouped by file with replies under their parent and a link to GitHub. An add to chat button puts a thread in the composer as a chip without sending it, and the rail ring still lights when new comments arrive.
|
|
37
|
+
- On the PR route, where main merges through a merge queue, landing adds the pull request to the queue and the copy reads as landed once the queue merges it. While GitHub holds a PR, in the queue or on auto-merge with checks running, Toyon asks about it every half minute as long as a window is open.
|
|
38
|
+
- Pasting a git URL into the project switcher, or giving one to the CLI, clones the repository into a folder and opens it as a project. The switcher has a clone from a URL row.
|
|
39
|
+
- The chat says when the agent runs a different model than the one asked for, whether it fell back on its own or the pick was not in its list, and the model chip reads as the agent's choice.
|
|
40
|
+
- A picture named by path in a reply shows as a still on the reply, several in a strip, and a press opens it full size. Before, it drew as a broken image.
|
|
41
|
+
- A working-tree HTML file has an open in preview button in the editor, since the reading frame runs no scripts and a page drawn by script looks empty there. Video clips open in the file viewer with the browser's own controls.
|
|
42
|
+
- Folder links and file:// links in a reply are file links; an outside folder reveals in Finder when the page is on the daemon's machine.
|
|
43
|
+
- When Toyon was started with npx, an offer above the composer runs the global install and says how it went.
|
|
44
|
+
- `toyon doctor` reports whether the GitHub CLI is installed and signed in, and what that means for the PR route.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- The split tool and the `/split` verb are called handoff and `/handoff` again, in the menu, the palette, the picker and the agent's instructions, and handoff has an icon of its own. Older chats are rewritten on the daemon's first start, so lists from 0.18 to 0.20 keep their shape.
|
|
48
|
+
- An agent whose piece waits on another branch is woken by a message once that branch lands, instead of sitting idle until you type. A handoff sibling inherits the origin's agent, model and effort as well as its mode.
|
|
49
|
+
- Answering a handoff card moves the row to the end of the chat and shows your answer as a bubble with your note. The n key adds a note on any row that takes one. When a plan goes back with no, keep planning, each re-proposed piece keeps the fate you pressed last.
|
|
50
|
+
- The handoff card keeps the count in its question and one press that opens the list, like the plan card. A handoff page opens with its title, a list of one gets no track, and a track that overflows scrolls on one line.
|
|
51
|
+
- A message sent while the agent works goes in between its steps instead of cutting off the command it is on. The Claude Code adapter comes from Toyon's fork for this until the change lands upstream; the daemon is on ACP SDK 2, and the Codex and OpenCode adapters are pinned to current releases.
|
|
52
|
+
- Mode and profile picks are kept per project in the daemon rather than in the browser, so new worktrees and handoffs start with the settings you chose. Model and effort picks follow a renamed model and drop a missing one instead of being stamped forever.
|
|
53
|
+
- Landing or creating a PR moves the row to the top of the rail, as a send does, so a landed row is in view to archive. A landed worktree with new uncommitted changes shows its live colour again until it lands again, and once a worktree has landed, archiving no longer asks about a shown plan or an unread reply.
|
|
54
|
+
- The worktree panel toggle sits in the top bar beside the other panel toggles, and the rail list runs to the bottom.
|
|
55
|
+
- The project picker lists open folder or file right after your projects, shows only the name on a project row, and the row menu holds switch, project settings and forget. Forgetting a project with live worktrees archives them, and they come back as restorable when the project is opened again.
|
|
56
|
+
- Enter on a multi-select question ticks the cursor row when nothing is ticked, and moves on once something is. Pickers no longer restate enter and esc, and the search palette accents the matched letters.
|
|
57
|
+
- A plan document is built the same way everywhere it is read, opens at the same height with or without a track, and a plan with its own heading uses it as the title.
|
|
58
|
+
- Links in Toyon Dark and Toyon Light take a calmer colour of the same hue. Links under a command's output take the text colour with a faint underline. Imported VS Code themes bring their own link colour.
|
|
59
|
+
- The composer shows a born from line naming the row that spawned this one, and the argument hint after a command comes from what is typed.
|
|
60
|
+
- Agents are asked to link folders with a trailing slash and to put routes and commands in backticks, and a long command is steered to the background flag instead of nohup.
|
|
61
|
+
|
|
62
|
+
### Fixed
|
|
63
|
+
- A hung quick-model session could pin naming until restart, leaving rows unnamed and faint. The ask now times out, and naming is retried after a turn ends.
|
|
64
|
+
- A saved model the agent no longer lists was sent as is, so the picker showed a stale name; it now follows the listed model or clears. A chat's model was reset to the default whenever an older build's list left it out, and a restarted daemon refused a model another process spelled differently.
|
|
65
|
+
- A confirmed landing was hidden by one stray file. The landed mark now shows while leftovers are still reported.
|
|
66
|
+
- A booked wakeup's row ended when you sent a message; it ends only when the wakeup fires, is rebooked or is stopped.
|
|
67
|
+
- A handoff piece with a long title was refused; it is now cut and the worktree named once it opens. A worktree that received a handoff stayed where it was in the rail, and a sibling started on the adapter's default model when none was set.
|
|
68
|
+
- A piece that waited on a skipped or landed sibling was stuck; it starts.
|
|
69
|
+
- Chat pictures shrank while you typed because the cap followed the composer's height.
|
|
70
|
+
- On touch screens a swipe starting on a question card scrolled the card instead of the transcript and pushed the question under the box's edge.
|
|
71
|
+
- Top bar tooltips were cut off below the bar; they sit beside their control and swap sides when the room runs out. The dot in a tooltip sits on a whole pixel.
|
|
72
|
+
- Switching back to a worktree showed another's plan title when two shared a plan path.
|
|
73
|
+
- On a phone, the swipe back to a worktree you just left answers within 800 ms instead of a second and a half.
|
|
74
|
+
- On some mobile browsers the end of a shining path went blank; the ellipsis keeps its colour.
|
|
75
|
+
- Rendered HTML previews load from a separate origin with a ticket per page, so inline images and styles load without weakening the main origin, and saving a page no longer evicts other pages.
|
|
76
|
+
|
|
5
77
|
## 0.20.0 (2026-10-28)
|
|
6
78
|
|
|
7
79
|
The rail shows work that goes on while the chat is quiet, agents find their sibling worktrees on their own, and the phone moves between the list and a worktree in one swipe.
|
package/dist/bridge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=[{id:"quick-open",key:"p"},{id:"commands",key:"p",shift:!0,bareAlias:"F1"},{id:"search",key:"f",shift:!0},{id:"chats",key:"g"},{id:"changes",key:"b",ctrlAlias:{key:"g",shift:!0}},{id:"files",key:"e",shift:!0},{id:"panel-tab-prev",key:"ArrowLeft",alt:!0,textKeeps:!0},{id:"panel-tab-next",key:"ArrowRight",alt:!0,textKeeps:!0},{id:"composer",key:"l"},{id:"rail",key:"k",shift:!0},{id:"keys",key:","},{id:"terminal",key:"j",ctrlAlias:{key:"`"}},{id:"design",key:"d"},{id:"term-tab",key:"`",ctrl:!0,shift:!0},{id:"pick",key:"e"},{id:"inspect",key:"i"},{id:"zen",key:"."},{id:"new",key:"k",aliases:["n"]},{id:"worktree",key:"1-9"},{id:"wt-prev",key:"ArrowUp",alt:!0,ctrlAlias:{key:"Tab",shift:!0},cmdShiftAlias:["[","{"]},{id:"wt-next",key:"ArrowDown",alt:!0,ctrlAlias:{key:"Tab"},cmdShiftAlias:["]","}"]},{id:"wt-unseen-prev",key:"ArrowUp",alt:!0,shift:!0},{id:"wt-unseen-next",key:"ArrowDown",alt:!0,shift:!0},{id:"wt-archive",key:"Backspace",alt:!0,textKeeps:!0,emptyGives:!0},{id:"mark-unread",key:"u",alt:!0,textKeeps:!0},{id:"project",key:"o",ctrlAlias:{key:"r",hostOnly:!0},cmdShiftAlias:["o"]},{id:"refs",key:"g",shift:!0},{id:"routes",key:"u"},{id:"reload",key:"r"},{id:"back",key:"ArrowLeft",textKeeps:!0},{id:"forward",key:"ArrowRight",textKeeps:!0},{id:"close",key:"w"}],q=new Set(["zen","close","back","forward"]);function z(e,{guest:t=!1}={}){if(e.altKey){if(e.metaKey||e.ctrlKey)return null;let r=v.find((o)=>o.alt&&!!o.shift===e.shiftKey&&(o.key===e.key||o.key.length===1&&e.code===`Key${o.key.toUpperCase()}`));return r&&r.id!=="worktree"?{id:r.id}:null}if(!e.metaKey&&!e.ctrlKey){if(e.shiftKey||t)return null;let r=v.find((o)=>o.bareAlias===e.key);return r&&r.id!=="worktree"?{id:r.id}:null}if(!!e.ctrlKey===e.metaKey)return null;let n=e.key.length===1?e.key.toLowerCase():e.key;if(e.metaKey&&!e.shiftKey&&n>="1"&&n<="9")return{id:"worktree",digit:Number(n)};for(let r of v){if(r.id==="worktree")continue;let o=r.ctrlAlias;if(o&&e.ctrlKey&&o.key===n&&!!o.shift===e.shiftKey&&!(t&&o.hostOnly))return{id:r.id};if(e.metaKey&&e.shiftKey&&r.cmdShiftAlias?.includes(n))return{id:r.id};if(r.alt)continue;if(e.ctrlKey&&!r.ctrl||!!r.shift!==e.shiftKey)continue;if(r.key===n||r.aliases?.includes(n))return{id:r.id}}return null}function Y(e){if(e.altKey||e.key.toLowerCase()!=="s")return!1;return!!e.ctrlKey!==e.metaKey}function V(e){let t=v.find((n)=>n.id===e);if(!t)throw Error(`unknown chord ${e}`);return t}function Z(e){let t=e;if(!t?.tagName)return!1;if(t.isContentEditable||t.tagName==="TEXTAREA")return!0;return t.tagName==="INPUT"&&!["button","checkbox","radio","range","submit","reset"].includes(t.type??"")}var ae=Symbol.for("react.forward_ref"),ce=Symbol.for("react.memo");function J(e){if(e._debugSource?.fileName)return{file:e._debugSource.fileName,line:e._debugSource.lineNumber};let t=e._debugStack?.stack;if(t){let n=t.match(/https?:\/\/[^/]+(\/src\/[^)\s?]+)(?:\?[^:)\s]*)?:(\d+):\d+/);if(n?.[1])return{file:n[1],line:Number(n[2])||void 0}}return null}function _(e){for(let t=e;t;t=t.return){let n=J(t);if(n)return n}return null}function L(e){if(typeof e==="function")return e.displayName||e.name||null;let t=e;if(t?.$$typeof===ae)return t.displayName||L(t.render);if(t?.$$typeof===ce)return t.displayName||L(t.type);return null}var ue=(e)=>typeof e.type==="string"||e.tag===6,de=(e,t)=>!!e&&(e===t||!!e.stateNode&&e.stateNode===t.stateNode);function fe(e){let t=null,n=(r)=>{for(let o=r.child??null;o;o=o.sibling??null)if(ue(o)){if(t)return!1;t=o}else if(!n(o))return!1;return!0};return n(e)?t:null}function pe(e){for(let t=e;t;t=t.return){let n=J(t);if(n)return t._debugOwner===null?null:n}return null}function N(e){let t=_(e),n=null,r=null,o=!1;for(let i=e;i;i=i.return){let s=L(i.type);if(!s)continue;let l=!!e&&de(fe(i),e),c=pe(i);if(n&&!(l&&c))break;if(n=s,r=c,o=l,!l)break}if(r&&t&&r.file===t.file&&r.line===t.line)r=null;return{src:t,comp:n,call:r,wraps:o}}function F({src:e,call:t,wraps:n},r){let o=n?t:e,i=n?e:t;return(r?i??o:o??i)??null}if(window.__toyonBridge)throw Error("Toyon bridge already installed");window.__toyonBridge=!0;var E=window.__toyonShellOrigins??[],R=null,a=(e)=>{try{let t=R?[R]:E.length?E:["*"];for(let n of t)window.parent.postMessage({__toyon:!0,...e},n)}catch{}};a({type:"loaded",url:location.href,title:document.title});var x="#fa891e",ee="#1d2021";window.addEventListener("vite:afterUpdate",()=>a({type:"hmr"}));window.addEventListener("error",(e)=>{a({type:"page-error",message:String(e.message),source:e.filename,line:e.lineno})});window.addEventListener("unhandledrejection",(e)=>{a({type:"page-error",message:`unhandled rejection: ${String(e.reason)}`})});var K=()=>a({type:"navigated",url:location.href,title:document.title}),he=history.pushState.bind(history);history.pushState=(...e)=>{he(...e),H(),K()};var ye=history.replaceState.bind(history);history.replaceState=(...e)=>{ye(...e),K()};window.addEventListener("popstate",K);window.addEventListener("hashchange",K);var me=window.navigation,g=null;function H(){g=me?.currentEntry?.index??null}H();window.addEventListener("popstate",()=>{let e=g;H();let t=e===null||g===null||e===g?void 0:g<e?"back":"forward";a({type:"traversed",...t?{dir:t}:{}})});var ge=performance.getEntriesByType("navigation")[0];if(ge?.type==="back_forward")a({type:"traversed"});window.addEventListener("pageshow",(e)=>{if(e.persisted)a({type:"traversed"})});var O=document.title;if(document.head)new MutationObserver(()=>{if(document.title===O)return;O=document.title,a({type:"title",title:O})}).observe(document.head,{childList:!0,subtree:!0,characterData:!0});var te=!1,B=null;window.addEventListener("keyup",(e)=>{if(window.__toyonShell||e.key!==B)return;B=null,a({type:"key",key:e.key,meta:!1,up:!0})},!0);window.addEventListener("keydown",(e)=>{if(window.__toyonShell)return;if(Y(e))e.preventDefault();let t=z(e,{guest:!0});if(t&&V(t.id).textKeeps&&Z(e.target))return;if(te){if(!t||!q.has(t.id))return}else if(e.key==="Escape"){a({type:"key",key:"Escape",meta:!1});return}else if(!t)return;e.preventDefault(),e.stopPropagation(),a({type:"key",key:e.key,code:e.code,meta:e.metaKey,ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey}),B=e.altKey?"Alt":e.ctrlKey?"Control":e.metaKey?"Meta":null},!0);var I=()=>a({type:"focus",gesture:navigator.userActivation?.isActive??!0});window.addEventListener("focusin",I,!0);window.addEventListener("focus",I);if(document.hasFocus()&&document.activeElement&&document.activeElement!==document.body)I();var W=(e)=>!e.defaultPrevented&&!!e.dataTransfer?.types.includes("Files");window.addEventListener("dragover",(e)=>{if(!W(e))return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect="copy";a({type:"drag-files",over:!0})});window.addEventListener("dragleave",(e)=>{if(W(e))a({type:"drag-files",over:!1})});window.addEventListener("drop",(e)=>{if(!W(e))return;e.preventDefault(),a({type:"drop-files",files:Array.from(e.dataTransfer?.files??[])})});function X(e){for(let t of Object.keys(e))if(t.startsWith("__reactFiber$"))return e[t]??null;return null}var u=null,D=typeof HTMLElement<"u"&&"showPopover"in HTMLElement.prototype;function ke(){if(!u?.isConnected){if(u=document.createElement("div"),u.style.cssText="position:fixed;inset:0;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;overflow:visible;pointer-events:none;z-index:2147483647;",D)u.popover="manual";document.documentElement.appendChild(u)}if(D&&!u.matches(":popover-open"))u.showPopover();return u}function m(){if(!u)return;if(u.innerHTML="",D&&u.matches(":popover-open"))u.hidePopover()}var P=20;function S(e,t,n=!0){let r=document.createElement("div");if(r.style.cssText=`position:fixed;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px;outline:2px solid ${x};outline-offset:-1px;${n?`background:${x}14;`:""}border-radius:2px;`,t){let o=e.top>=P,i=e.bottom+P<=window.innerHeight;if(t.style.top=o?`${-P}px`:i?`${e.height+4}px`:"2px",!o&&!i)t.style.left="2px";r.appendChild(t)}if(ke().appendChild(r),t){let o=t.getBoundingClientRect(),i=o.right-(window.innerWidth-2);if(i>0){let s=Number.parseFloat(t.style.left||"0");t.style.left=`${s-Math.min(i,Math.max(0,o.left-2))}px`}}}function k(e,t){let n=document.createElement("div");if(n.textContent=e,n.style.cssText=`position:absolute;left:0;background:${x};color:${ee};font:11px -apple-system,sans-serif;padding:1px 6px;border-radius:3px;white-space:nowrap;`,t){let r=document.createElement("span");r.textContent=` ${t}`,r.style.opacity="0.55",n.appendChild(r)}return n}var A=!1,f=null,h=!1,p=!1,y=!1,M=(e)=>`${oe(e.file)}${e.line?`:${e.line}`:""}`;function C(e){f=e,m();let t=N(X(e)),{src:n,comp:r,call:o}=t,i=F(t,p),s=i===n?o:n,l=h!==y,c=(...b)=>b.filter(Boolean).join(" ")||void 0,d=l?i?k(`open ${M(i)}`,c(s&&`⇧ ${M(s)}`,y&&"⌥ chat")):k(`find ${Q(e)}`,c(y&&"⌥ chat")):k(r?`<${r} />${i?` · ${M(i)}`:""}`:Q(e),c(!y&&"⌥ code"));S(e.getBoundingClientRect(),d,l)}function Q(e){let t=e.tagName.toLowerCase(),n=e.classList[0];return(e.id?`${t}#${e.id}`:n?`${t}.${n}`:t).slice(0,48)}var we=new Set(["name","placeholder","aria-label","title","alt","for","href","type","role","src"]);function be(e){let t="";for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE)t+=r.textContent??"";let n=[];for(let r of Array.from(e.attributes)){if(n.length===12)break;if(r.value&&(we.has(r.name)||r.name.startsWith("data-")))n.push([r.name.slice(0,40),r.value.slice(0,200)])}return{tag:e.tagName.toLowerCase().slice(0,40),id:e.id.slice(0,200),classes:Array.from(e.classList).slice(0,16).map((r)=>r.slice(0,120)),text:t.replace(/\s+/g," ").trim().slice(0,200),attrs:n}}function ne(e){let t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return;let n=t!==f||e.altKey!==h||e.shiftKey!==p;if(h=e.altKey,p=e.shiftKey,n)C(t)}function re(e){e.preventDefault(),e.stopPropagation();let t=f??document.elementFromPoint(e.clientX,e.clientY),n=N(t?X(t):null),{src:r,comp:o,call:i}=n;p=e.shiftKey;let s=F(n,p),l=e.altKey!==y;if(j(),!t)return;a({type:"picked",verb:l?"code":"chat",site:s&&s===i?"call":"source",component:o,file:r?.file??null,line:r?.line??null,callFile:i?.file??null,callLine:i?.line??null,selector:Ee(t),tag:t.tagName.toLowerCase(),classes:t.className?.toString?.().slice(0,200)??"",text:t.textContent?.trim().slice(0,120)??"",html:t.outerHTML.slice(0,600),route:location.pathname+location.search,element:be(t)})}function T(e){if(e.key==="Escape"&&e.type==="keydown"){e.preventDefault(),e.stopPropagation(),j(),a({type:"pick-cancel"});return}if((e.key==="Alt"||e.key==="Shift")&&(h!==e.altKey||p!==e.shiftKey)){if(h=e.altKey,p=e.shiftKey,f)C(f)}}function ve(e){if(y=e,A){if(f)C(f);return}A=!0,f=null,h=!1,p=!1,document.addEventListener("mousemove",ne,!0),document.addEventListener("click",re,!0),document.addEventListener("keydown",T,!0),document.addEventListener("keyup",T,!0),document.documentElement.style.cursor="crosshair"}function j(){A=!1,y=!1,f=null,h=!1,p=!1,m(),document.removeEventListener("mousemove",ne,!0),document.removeEventListener("click",re,!0),document.removeEventListener("keydown",T,!0),document.removeEventListener("keyup",T,!0),document.documentElement.style.cursor=""}function Ee(e){let t=[],n=e;for(let r=0;n&&n!==document.documentElement&&r<6;r++){if(n.id){t.unshift(`#${CSS.escape(n.id)}`);break}let o=n.parentElement,i=o?Array.from(o.children).indexOf(n)+1:1;t.unshift(`${n.tagName.toLowerCase()}:nth-child(${i})`),n=o}return t.join(" > ")}function oe(e){let t=e.lastIndexOf("/src/");return t>=0?e.slice(t+1):e.split("/").slice(-2).join("/")}function xe(e,t){return e.endsWith(t)||t.endsWith(oe(e))}function Se(e,t){let n=[],r=0;for(let s of Array.from(document.querySelectorAll("*"))){let l=_(X(s));if(l)r++;if(!l||!xe(l.file,e))continue;n.push({el:s,line:l.line??-1})}if(!t||t.length===0)return{matched:n,fromFile:n,withSource:r};if(t.length===1&&t[0][0]===t[0][1]){let s=t[0][0],l=n.filter((d)=>d.line===s);if(l.length>0)return{matched:l,fromFile:n,withSource:r};let c=n.filter((d)=>d.line>0&&d.line<s);return c.sort((d,b)=>b.line-d.line),{matched:c.slice(0,1),fromFile:n,withSource:r}}return{matched:n.filter((s)=>t.some(([l,c])=>s.line>=l-8&&s.line<=c+1)),fromFile:n,withSource:r}}function Ae(e,t){m();let{matched:n,fromFile:r,withSource:o}=Se(e,t),i=0;for(let{el:s}of n){if(i>=40)break;let l=s.getBoundingClientRect();if(l.width>0&&l.height>0)S(l),i++}if(i===0)a({type:"highlight-miss",path:e,fileMatched:r.length,withSource:o,ranges:t})}var ie=!1,w=!1,Te=(e)=>{for(let t=e;t&&t!==document.documentElement;t=t.parentElement){let n=getComputedStyle(t),r=n.overflowX;if((r==="auto"||r==="scroll")&&t.scrollWidth>t.clientWidth+1)return!0;if(window.__toyonShell)continue;let o=n.touchAction;if(o!=="auto"&&o!=="manipulation"&&!o.includes("pan-x"))return!0}return!1},le=(e,t)=>{let n=e.touches[0]??e.changedTouches[0];if(n)a({type:"touch",phase:t,x:n.clientX,y:n.clientY})};window.addEventListener("touchstart",(e)=>{if(w=!1,!ie||e.touches.length!==1)return;let t=e.target instanceof Element?e.target:null;if(t?.closest("input, textarea, [contenteditable]")||Te(t))return;w=!0,le(e,"start")},{capture:!0,passive:!0});var G=(e,t)=>{if(!w)return;setTimeout(()=>{if(!w)return;let n=t==="move"&&(e.defaultPrevented||e.touches.length!==1);if(t!=="move"||n)w=!1;le(e,n?"cancel":t)},0)};window.addEventListener("touchmove",(e)=>G(e,"move"),{passive:!0});window.addEventListener("touchend",(e)=>G(e,"end"),!0);window.addEventListener("touchcancel",(e)=>G(e,"cancel"),!0);window.addEventListener("message",(e)=>{if(e.source!==window.parent)return;if(E.length&&!E.includes(e.origin))return;let t=e.data;if(!t?.__toyon)return;R=e.origin;let n=t;switch(n.type){case"reload":location.reload();break;case"navigate":if(/^[/?#]/.test(n.path))location.assign(n.path);break;case"back":case"forward":{let r=window.navigation;if((n.type==="back"?r?.canGoBack:r?.canGoForward)===!1)break;if(n.type==="back")history.back();else history.forward();break}case"touches":ie=n.on;break;case"links":{let r=new Set,o=[];for(let i of Array.from(document.querySelectorAll("a[href]"))){if(i.origin!==location.origin||i.target==="_blank"||i.hasAttribute("download"))continue;let s=i.pathname+(i.hash.startsWith("#/")?i.hash:"");if(s.startsWith("/__toyon")||r.has(s))continue;r.add(s);let l=(i.textContent||i.getAttribute("aria-label")||"").replace(/\s+/g," ").trim();if(o.push({path:s,text:l.slice(0,80)}),o.length>=200)break}a({type:"links",links:o});break}case"pick-start":ve(n.verb==="code");break;case"pick-mods":if(A&&(h!==n.alt||p!==n.shift)){if(h=n.alt,p=n.shift,f)C(f)}break;case"pick-cancel":j();break;case"highlight-file":Ae(n.path,n.ranges??null);break;case"highlight-computed":{m();let r=/^(color|font|line-height|letter-|text-|word-)/,o=(l)=>{if(/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName))return!0;for(let c=l.firstChild;c;c=c.nextSibling)if(c.nodeType===3&&c.textContent&&c.textContent.trim())return!0;return!1},i=document.querySelectorAll("*"),s=!0;for(let l=0;l<i.length;l++){let c=getComputedStyle(i[l]),d=([U,se])=>c.getPropertyValue(U)===se&&(!r.test(U)||o(i[l]));if(n.match==="any"?n.props.some(d):n.props.every(d))S(i[l].getBoundingClientRect(),s&&n.label?k(n.label):void 0),s=!1}break}case"highlight-selector":{m();try{let r=document.querySelectorAll(n.selector);for(let o=0;o<r.length;o++)S(r[o].getBoundingClientRect(),o===0&&n.label?k(n.label):void 0)}catch{}break}case"highlight-clear":m();break;case"zen":te=n.on;break;case"theme":if(/^#[0-9a-f]{3,8}$/i.test(n.accent))x=n.accent;if(/^#[0-9a-f]{3,8}$/i.test(n.accentFg))ee=n.accentFg;break}});
|
|
1
|
+
var v=[{id:"quick-open",key:"p"},{id:"commands",key:"p",shift:!0,bareAlias:"F1"},{id:"search",key:"f",shift:!0},{id:"chats",key:"g"},{id:"changes",key:"b",ctrlAlias:{key:"g",shift:!0}},{id:"files",key:"e",shift:!0},{id:"panel-tab-prev",key:"ArrowLeft",alt:!0,textKeeps:!0},{id:"panel-tab-next",key:"ArrowRight",alt:!0,textKeeps:!0},{id:"composer",key:"l"},{id:"rail",key:"k",shift:!0},{id:"keys",key:","},{id:"terminal",key:"j",ctrlAlias:{key:"`"}},{id:"design",key:"d"},{id:"term-tab",key:"`",ctrl:!0,shift:!0},{id:"pick",key:"e"},{id:"inspect",key:"i"},{id:"zen",key:"."},{id:"new",key:"k",aliases:["n"]},{id:"worktree",key:"1-9"},{id:"wt-prev",key:"ArrowUp",alt:!0,ctrlAlias:{key:"Tab",shift:!0},cmdShiftAlias:["[","{"]},{id:"wt-next",key:"ArrowDown",alt:!0,ctrlAlias:{key:"Tab"},cmdShiftAlias:["]","}"]},{id:"wt-unseen-prev",key:"ArrowUp",alt:!0,shift:!0},{id:"wt-unseen-next",key:"ArrowDown",alt:!0,shift:!0},{id:"wt-back",key:"ArrowLeft",textKeeps:!0,emptyGives:!0},{id:"wt-forward",key:"ArrowRight",textKeeps:!0,emptyGives:!0},{id:"wt-archive",key:"Backspace",alt:!0,textKeeps:!0,emptyGives:!0},{id:"mark-unread",key:"u",alt:!0,textKeeps:!0},{id:"project",key:"o",ctrlAlias:{key:"r",hostOnly:!0},cmdShiftAlias:["o"]},{id:"refs",key:"g",shift:!0},{id:"routes",key:"u"},{id:"reload",key:"r"},{id:"back",key:"["},{id:"forward",key:"]"},{id:"close",key:"w"}],U=new Set(["zen","close","back","forward","wt-back","wt-forward"]);function q(e,{guest:t=!1}={}){if(e.altKey){if(e.metaKey||e.ctrlKey)return null;let r=v.find((o)=>o.alt&&!!o.shift===e.shiftKey&&(o.key===e.key||o.key.length===1&&e.code===`Key${o.key.toUpperCase()}`));return r&&r.id!=="worktree"?{id:r.id}:null}if(!e.metaKey&&!e.ctrlKey){if(e.shiftKey||t)return null;let r=v.find((o)=>o.bareAlias===e.key);return r&&r.id!=="worktree"?{id:r.id}:null}if(!!e.ctrlKey===e.metaKey)return null;let n=e.key.length===1?e.key.toLowerCase():e.key;if(e.metaKey&&!e.shiftKey&&n>="1"&&n<="9")return{id:"worktree",digit:Number(n)};for(let r of v){if(r.id==="worktree")continue;let o=r.ctrlAlias;if(o&&e.ctrlKey&&o.key===n&&!!o.shift===e.shiftKey&&!(t&&o.hostOnly))return{id:r.id};if(e.metaKey&&e.shiftKey&&r.cmdShiftAlias?.includes(n))return{id:r.id};if(r.alt)continue;if(e.ctrlKey&&!r.ctrl||!!r.shift!==e.shiftKey)continue;if(r.key===n||r.aliases?.includes(n))return{id:r.id}}return null}function Y(e){if(e.altKey||e.key.toLowerCase()!=="s")return!1;return!!e.ctrlKey!==e.metaKey}function Z(e){let t=v.find((n)=>n.id===e);if(!t)throw Error(`unknown chord ${e}`);return t}function V(e){let t=e;if(!t?.tagName)return!1;if(t.isContentEditable||t.tagName==="TEXTAREA")return!0;return t.tagName==="INPUT"&&!["button","checkbox","radio","range","submit","reset"].includes(t.type??"")}var se=Symbol.for("react.forward_ref"),ce=Symbol.for("react.memo");function J(e){if(e._debugSource?.fileName)return{file:e._debugSource.fileName,line:e._debugSource.lineNumber};let t=e._debugStack?.stack;if(t){let n=t.match(/https?:\/\/[^/]+(\/src\/[^)\s?]+)(?:\?[^:)\s]*)?:(\d+):\d+/);if(n?.[1])return{file:n[1],line:Number(n[2])||void 0}}return null}function _(e){for(let t=e;t;t=t.return){let n=J(t);if(n)return n}return null}function L(e){if(typeof e==="function")return e.displayName||e.name||null;let t=e;if(t?.$$typeof===se)return t.displayName||L(t.render);if(t?.$$typeof===ce)return t.displayName||L(t.type);return null}var ue=(e)=>typeof e.type==="string"||e.tag===6,de=(e,t)=>!!e&&(e===t||!!e.stateNode&&e.stateNode===t.stateNode);function fe(e){let t=null,n=(r)=>{for(let o=r.child??null;o;o=o.sibling??null)if(ue(o)){if(t)return!1;t=o}else if(!n(o))return!1;return!0};return n(e)?t:null}function pe(e){for(let t=e;t;t=t.return){let n=J(t);if(n)return t._debugOwner===null?null:n}return null}function N(e){let t=_(e),n=null,r=null,o=!1;for(let i=e;i;i=i.return){let a=L(i.type);if(!a)continue;let l=!!e&&de(fe(i),e),c=pe(i);if(n&&!(l&&c))break;if(n=a,r=c,o=l,!l)break}if(r&&t&&r.file===t.file&&r.line===t.line)r=null;return{src:t,comp:n,call:r,wraps:o}}function F({src:e,call:t,wraps:n},r){let o=n?t:e,i=n?e:t;return(r?i??o:o??i)??null}if(window.__toyonBridge)throw Error("Toyon bridge already installed");window.__toyonBridge=!0;var E=window.__toyonShellOrigins??[],R=null,s=(e)=>{try{let t=R?[R]:E.length?E:["*"];for(let n of t)window.parent.postMessage({__toyon:!0,...e},n)}catch{}};s({type:"loaded",url:location.href,title:document.title});var x="#fa891e",ee="#1d2021";window.addEventListener("vite:afterUpdate",()=>s({type:"hmr"}));window.addEventListener("error",(e)=>{s({type:"page-error",message:String(e.message),source:e.filename,line:e.lineno})});window.addEventListener("unhandledrejection",(e)=>{s({type:"page-error",message:`unhandled rejection: ${String(e.reason)}`})});var C=()=>s({type:"navigated",url:location.href,title:document.title}),he=history.pushState.bind(history);history.pushState=(...e)=>{he(...e),H(),C()};var ye=history.replaceState.bind(history);history.replaceState=(...e)=>{ye(...e),C()};window.addEventListener("popstate",C);window.addEventListener("hashchange",C);var me=window.navigation,g=null;function H(){g=me?.currentEntry?.index??null}H();window.addEventListener("popstate",()=>{let e=g;H();let t=e===null||g===null||e===g?void 0:g<e?"back":"forward";s({type:"traversed",...t?{dir:t}:{}})});var ge=performance.getEntriesByType("navigation")[0];if(ge?.type==="back_forward")s({type:"traversed"});window.addEventListener("pageshow",(e)=>{if(e.persisted)s({type:"traversed"})});var M=document.title;if(document.head)new MutationObserver(()=>{if(document.title===M)return;M=document.title,s({type:"title",title:M})}).observe(document.head,{childList:!0,subtree:!0,characterData:!0});var te=!1,B=null;window.addEventListener("keyup",(e)=>{if(window.__toyonShell||e.key!==B)return;B=null,s({type:"key",key:e.key,meta:!1,up:!0})},!0);window.addEventListener("keydown",(e)=>{if(window.__toyonShell)return;if(Y(e))e.preventDefault();let t=q(e,{guest:!0});if(t&&Z(t.id).textKeeps&&V(e.target))return;if(te){if(!t||!U.has(t.id))return}else if(e.key==="Escape"){s({type:"key",key:"Escape",meta:!1});return}else if(!t)return;e.preventDefault(),e.stopPropagation(),s({type:"key",key:e.key,code:e.code,meta:e.metaKey,ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey}),B=e.altKey?"Alt":e.ctrlKey?"Control":e.metaKey?"Meta":null},!0);var I=()=>s({type:"focus",gesture:navigator.userActivation?.isActive??!0});window.addEventListener("focusin",I,!0);window.addEventListener("focus",I);if(document.hasFocus()&&document.activeElement&&document.activeElement!==document.body)I();var W=(e)=>!e.defaultPrevented&&!!e.dataTransfer?.types.includes("Files");window.addEventListener("dragover",(e)=>{if(!W(e))return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect="copy";s({type:"drag-files",over:!0})});window.addEventListener("dragleave",(e)=>{if(W(e))s({type:"drag-files",over:!1})});window.addEventListener("drop",(e)=>{if(!W(e))return;e.preventDefault(),s({type:"drop-files",files:Array.from(e.dataTransfer?.files??[])})});function G(e){for(let t of Object.keys(e))if(t.startsWith("__reactFiber$"))return e[t]??null;return null}var u=null,D=typeof HTMLElement<"u"&&"showPopover"in HTMLElement.prototype;function ke(){if(!u?.isConnected){if(u=document.createElement("div"),u.style.cssText="position:fixed;inset:0;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;overflow:visible;pointer-events:none;z-index:2147483647;",D)u.popover="manual";document.documentElement.appendChild(u)}if(D&&!u.matches(":popover-open"))u.showPopover();return u}function m(){if(!u)return;if(u.innerHTML="",D&&u.matches(":popover-open"))u.hidePopover()}var O=20;function S(e,t,n=!0){let r=document.createElement("div");if(r.style.cssText=`position:fixed;left:${e.left}px;top:${e.top}px;width:${e.width}px;height:${e.height}px;outline:2px solid ${x};outline-offset:-1px;${n?`background:${x}14;`:""}border-radius:2px;`,t){let o=e.top>=O,i=e.bottom+O<=window.innerHeight;if(t.style.top=o?`${-O}px`:i?`${e.height+4}px`:"2px",!o&&!i)t.style.left="2px";r.appendChild(t)}if(ke().appendChild(r),t){let o=t.getBoundingClientRect(),i=o.right-(window.innerWidth-2);if(i>0){let a=Number.parseFloat(t.style.left||"0");t.style.left=`${a-Math.min(i,Math.max(0,o.left-2))}px`}}}function k(e,t){let n=document.createElement("div");if(n.textContent=e,n.style.cssText=`position:absolute;left:0;background:${x};color:${ee};font:11px -apple-system,sans-serif;padding:1px 6px;border-radius:3px;white-space:nowrap;`,t){let r=document.createElement("span");r.textContent=` ${t}`,r.style.opacity="0.55",n.appendChild(r)}return n}var A=!1,f=null,h=!1,p=!1,y=!1,P=(e)=>`${oe(e.file)}${e.line?`:${e.line}`:""}`;function K(e){f=e,m();let t=N(G(e)),{src:n,comp:r,call:o}=t,i=F(t,p),a=i===n?o:n,l=h!==y,c=(...b)=>b.filter(Boolean).join(" ")||void 0,d=l?i?k(`open ${P(i)}`,c(a&&`⇧ ${P(a)}`,y&&"⌥ chat")):k(`find ${Q(e)}`,c(y&&"⌥ chat")):k(r?`<${r} />${i?` · ${P(i)}`:""}`:Q(e),c(!y&&"⌥ code"));S(e.getBoundingClientRect(),d,l)}function Q(e){let t=e.tagName.toLowerCase(),n=e.classList[0];return(e.id?`${t}#${e.id}`:n?`${t}.${n}`:t).slice(0,48)}var we=new Set(["name","placeholder","aria-label","title","alt","for","href","type","role","src"]);function be(e){let t="";for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE)t+=r.textContent??"";let n=[];for(let r of Array.from(e.attributes)){if(n.length===12)break;if(r.value&&(we.has(r.name)||r.name.startsWith("data-")))n.push([r.name.slice(0,40),r.value.slice(0,200)])}return{tag:e.tagName.toLowerCase().slice(0,40),id:e.id.slice(0,200),classes:Array.from(e.classList).slice(0,16).map((r)=>r.slice(0,120)),text:t.replace(/\s+/g," ").trim().slice(0,200),attrs:n}}function ne(e){let t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return;let n=t!==f||e.altKey!==h||e.shiftKey!==p;if(h=e.altKey,p=e.shiftKey,n)K(t)}function re(e){e.preventDefault(),e.stopPropagation();let t=f??document.elementFromPoint(e.clientX,e.clientY),n=N(t?G(t):null),{src:r,comp:o,call:i}=n;p=e.shiftKey;let a=F(n,p),l=e.altKey!==y;if(X(),!t)return;s({type:"picked",verb:l?"code":"chat",site:a&&a===i?"call":"source",component:o,file:r?.file??null,line:r?.line??null,callFile:i?.file??null,callLine:i?.line??null,selector:Ee(t),tag:t.tagName.toLowerCase(),classes:t.className?.toString?.().slice(0,200)??"",text:t.textContent?.trim().slice(0,120)??"",html:t.outerHTML.slice(0,600),route:location.pathname+location.search,element:be(t)})}function T(e){if(e.key==="Escape"&&e.type==="keydown"){e.preventDefault(),e.stopPropagation(),X(),s({type:"pick-cancel"});return}if((e.key==="Alt"||e.key==="Shift")&&(h!==e.altKey||p!==e.shiftKey)){if(h=e.altKey,p=e.shiftKey,f)K(f)}}function ve(e){if(y=e,A){if(f)K(f);return}A=!0,f=null,h=!1,p=!1,document.addEventListener("mousemove",ne,!0),document.addEventListener("click",re,!0),document.addEventListener("keydown",T,!0),document.addEventListener("keyup",T,!0),document.documentElement.style.cursor="crosshair"}function X(){A=!1,y=!1,f=null,h=!1,p=!1,m(),document.removeEventListener("mousemove",ne,!0),document.removeEventListener("click",re,!0),document.removeEventListener("keydown",T,!0),document.removeEventListener("keyup",T,!0),document.documentElement.style.cursor=""}function Ee(e){let t=[],n=e;for(let r=0;n&&n!==document.documentElement&&r<6;r++){if(n.id){t.unshift(`#${CSS.escape(n.id)}`);break}let o=n.parentElement,i=o?Array.from(o.children).indexOf(n)+1:1;t.unshift(`${n.tagName.toLowerCase()}:nth-child(${i})`),n=o}return t.join(" > ")}function oe(e){let t=e.lastIndexOf("/src/");return t>=0?e.slice(t+1):e.split("/").slice(-2).join("/")}function xe(e,t){return e.endsWith(t)||t.endsWith(oe(e))}function Se(e,t){let n=[],r=0;for(let a of Array.from(document.querySelectorAll("*"))){let l=_(G(a));if(l)r++;if(!l||!xe(l.file,e))continue;n.push({el:a,line:l.line??-1})}if(!t||t.length===0)return{matched:n,fromFile:n,withSource:r};if(t.length===1&&t[0][0]===t[0][1]){let a=t[0][0],l=n.filter((d)=>d.line===a);if(l.length>0)return{matched:l,fromFile:n,withSource:r};let c=n.filter((d)=>d.line>0&&d.line<a);return c.sort((d,b)=>b.line-d.line),{matched:c.slice(0,1),fromFile:n,withSource:r}}return{matched:n.filter((a)=>t.some(([l,c])=>a.line>=l-8&&a.line<=c+1)),fromFile:n,withSource:r}}function Ae(e,t){m();let{matched:n,fromFile:r,withSource:o}=Se(e,t),i=0;for(let{el:a}of n){if(i>=40)break;let l=a.getBoundingClientRect();if(l.width>0&&l.height>0)S(l),i++}if(i===0)s({type:"highlight-miss",path:e,fileMatched:r.length,withSource:o,ranges:t})}var ie=!1,w=!1,Te=(e)=>{for(let t=e;t&&t!==document.documentElement;t=t.parentElement){let n=getComputedStyle(t),r=n.overflowX;if((r==="auto"||r==="scroll")&&t.scrollWidth>t.clientWidth+1)return!0;if(window.__toyonShell)continue;let o=n.touchAction;if(o!=="auto"&&o!=="manipulation"&&!o.includes("pan-x"))return!0}return!1},le=(e,t)=>{let n=e.touches[0]??e.changedTouches[0];if(n)s({type:"touch",phase:t,x:n.clientX,y:n.clientY})};window.addEventListener("touchstart",(e)=>{if(w=!1,!ie||e.touches.length!==1)return;let t=e.target instanceof Element?e.target:null;if(t?.closest("input, textarea, [contenteditable]")||Te(t))return;w=!0,le(e,"start")},{capture:!0,passive:!0});var j=(e,t)=>{if(!w)return;setTimeout(()=>{if(!w)return;let n=t==="move"&&(e.defaultPrevented||e.touches.length!==1);if(t!=="move"||n)w=!1;le(e,n?"cancel":t)},0)};window.addEventListener("touchmove",(e)=>j(e,"move"),{passive:!0});window.addEventListener("touchend",(e)=>j(e,"end"),!0);window.addEventListener("touchcancel",(e)=>j(e,"cancel"),!0);window.addEventListener("message",(e)=>{if(e.source!==window.parent)return;if(E.length&&!E.includes(e.origin))return;let t=e.data;if(!t?.__toyon)return;R=e.origin;let n=t;switch(n.type){case"reload":location.reload();break;case"navigate":if(/^[/?#]/.test(n.path))location.assign(n.path);break;case"back":case"forward":{let r=window.navigation;if((n.type==="back"?r?.canGoBack:r?.canGoForward)===!1)break;if(n.type==="back")history.back();else history.forward();break}case"touches":ie=n.on;break;case"links":{let r=new Set,o=[];for(let i of Array.from(document.querySelectorAll("a[href]"))){if(i.origin!==location.origin||i.target==="_blank"||i.hasAttribute("download"))continue;let a=i.pathname+(i.hash.startsWith("#/")?i.hash:"");if(a.startsWith("/__toyon")||r.has(a))continue;r.add(a);let l=(i.textContent||i.getAttribute("aria-label")||"").replace(/\s+/g," ").trim();if(o.push({path:a,text:l.slice(0,80)}),o.length>=200)break}s({type:"links",links:o});break}case"pick-start":ve(n.verb==="code");break;case"pick-mods":if(A&&(h!==n.alt||p!==n.shift)){if(h=n.alt,p=n.shift,f)K(f)}break;case"pick-cancel":X();break;case"highlight-file":Ae(n.path,n.ranges??null);break;case"highlight-computed":{m();let r=/^(color|font|line-height|letter-|text-|word-)/,o=(l)=>{if(/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName))return!0;for(let c=l.firstChild;c;c=c.nextSibling)if(c.nodeType===3&&c.textContent&&c.textContent.trim())return!0;return!1},i=document.querySelectorAll("*"),a=!0;for(let l=0;l<i.length;l++){let c=getComputedStyle(i[l]),d=([z,ae])=>c.getPropertyValue(z)===ae&&(!r.test(z)||o(i[l]));if(n.match==="any"?n.props.some(d):n.props.every(d))S(i[l].getBoundingClientRect(),a&&n.label?k(n.label):void 0),a=!1}break}case"highlight-selector":{m();try{let r=document.querySelectorAll(n.selector);for(let o=0;o<r.length;o++)S(r[o].getBoundingClientRect(),o===0&&n.label?k(n.label):void 0)}catch{}break}case"highlight-clear":m();break;case"zen":te=n.on;break;case"theme":if(/^#[0-9a-f]{3,8}$/i.test(n.accent))x=n.accent;if(/^#[0-9a-f]{3,8}$/i.test(n.accentFg))ee=n.accentFg;break}});
|