toyon 0.21.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.
Files changed (105) hide show
  1. package/README.md +2 -2
  2. package/dist/CHANGELOG.md +26 -0
  3. package/dist/bridge.js +1 -1
  4. package/dist/cli.js +2 -2
  5. package/dist/daemon.js +216 -72
  6. package/dist/shell/assets/{Editor-D_bxx8PL.js → Editor-1fCgxkUp.js} +177 -177
  7. package/dist/shell/assets/Editor-1fCgxkUp.js.br +0 -0
  8. package/dist/shell/assets/Editor-1fCgxkUp.js.gz +0 -0
  9. package/dist/shell/assets/{XTerm-DNFNsoHC.js → XTerm-B_hkTWne.js} +1 -1
  10. package/dist/shell/assets/XTerm-B_hkTWne.js.br +0 -0
  11. package/dist/shell/assets/XTerm-B_hkTWne.js.gz +0 -0
  12. package/dist/shell/assets/{cssMode-BxHmuU8y.js → cssMode-1LqDnQzX.js} +1 -1
  13. package/dist/shell/assets/cssMode-1LqDnQzX.js.br +0 -0
  14. package/dist/shell/assets/cssMode-1LqDnQzX.js.gz +0 -0
  15. package/dist/shell/assets/{freemarker2-Cx9ZoWdp.js → freemarker2-BJFDEJKJ.js} +1 -1
  16. package/dist/shell/assets/freemarker2-BJFDEJKJ.js.br +0 -0
  17. package/dist/shell/assets/freemarker2-BJFDEJKJ.js.gz +0 -0
  18. package/dist/shell/assets/{grammar-DlhzivAk.js → grammar-DVeERVO3.js} +1 -1
  19. package/dist/shell/assets/grammar-DVeERVO3.js.br +0 -0
  20. package/dist/shell/assets/grammar-DVeERVO3.js.gz +0 -0
  21. package/dist/shell/assets/{handlebars-D0MhpM71.js → handlebars-BGFLy2DH.js} +1 -1
  22. package/dist/shell/assets/handlebars-BGFLy2DH.js.br +0 -0
  23. package/dist/shell/assets/handlebars-BGFLy2DH.js.gz +0 -0
  24. package/dist/shell/assets/{html-Da9gyCH4.js → html-CPJflvc5.js} +1 -1
  25. package/dist/shell/assets/html-CPJflvc5.js.br +0 -0
  26. package/dist/shell/assets/html-CPJflvc5.js.gz +0 -0
  27. package/dist/shell/assets/{htmlMode-CGo3ddCJ.js → htmlMode-CjqzceBV.js} +1 -1
  28. package/dist/shell/assets/htmlMode-CjqzceBV.js.br +0 -0
  29. package/dist/shell/assets/htmlMode-CjqzceBV.js.gz +0 -0
  30. package/dist/shell/assets/index-DdrVWdNt.js +292 -0
  31. package/dist/shell/assets/index-DdrVWdNt.js.br +0 -0
  32. package/dist/shell/assets/index-DdrVWdNt.js.gz +0 -0
  33. package/dist/shell/assets/index-Dx-i3szQ.css +1 -0
  34. package/dist/shell/assets/index-Dx-i3szQ.css.br +0 -0
  35. package/dist/shell/assets/index-Dx-i3szQ.css.gz +0 -0
  36. package/dist/shell/assets/{javascript-BXQxakKJ.js → javascript-B4CelO-C.js} +1 -1
  37. package/dist/shell/assets/{jsonMode-DT4ON4ij.js → jsonMode-C2JxYuT6.js} +1 -1
  38. package/dist/shell/assets/jsonMode-C2JxYuT6.js.br +0 -0
  39. package/dist/shell/assets/jsonMode-C2JxYuT6.js.gz +0 -0
  40. package/dist/shell/assets/{liquid-Bm6Hq-FF.js → liquid-BfXRgBm_.js} +1 -1
  41. package/dist/shell/assets/liquid-BfXRgBm_.js.br +0 -0
  42. package/dist/shell/assets/liquid-BfXRgBm_.js.gz +0 -0
  43. package/dist/shell/assets/{lspLanguageFeatures-DWvAzXxS.js → lspLanguageFeatures-CAi6hRgs.js} +1 -1
  44. package/dist/shell/assets/lspLanguageFeatures-CAi6hRgs.js.br +0 -0
  45. package/dist/shell/assets/lspLanguageFeatures-CAi6hRgs.js.gz +0 -0
  46. package/dist/shell/assets/{mdx-DNcDUEs7.js → mdx-DeBYGdge.js} +1 -1
  47. package/dist/shell/assets/mdx-DeBYGdge.js.br +0 -0
  48. package/dist/shell/assets/mdx-DeBYGdge.js.gz +0 -0
  49. package/dist/shell/assets/{python-BgETNCIe.js → python-CFhHKm43.js} +1 -1
  50. package/dist/shell/assets/python-CFhHKm43.js.br +0 -0
  51. package/dist/shell/assets/python-CFhHKm43.js.gz +0 -0
  52. package/dist/shell/assets/{razor-Cf_D69YI.js → razor-C-gkU4Y9.js} +1 -1
  53. package/dist/shell/assets/razor-C-gkU4Y9.js.br +0 -0
  54. package/dist/shell/assets/razor-C-gkU4Y9.js.gz +0 -0
  55. package/dist/shell/assets/{tsMode-BQA_zU_Q.js → tsMode-8E7grKbo.js} +1 -1
  56. package/dist/shell/assets/tsMode-8E7grKbo.js.br +0 -0
  57. package/dist/shell/assets/tsMode-8E7grKbo.js.gz +0 -0
  58. package/dist/shell/assets/{xml-DrZtVQVT.js → xml-CBoTF2r1.js} +1 -1
  59. package/dist/shell/assets/xml-CBoTF2r1.js.br +0 -0
  60. package/dist/shell/assets/xml-CBoTF2r1.js.gz +0 -0
  61. package/dist/shell/assets/{yaml-CzR4Kx36.js → yaml-CyKxhzxl.js} +1 -1
  62. package/dist/shell/assets/yaml-CyKxhzxl.js.br +0 -0
  63. package/dist/shell/assets/yaml-CyKxhzxl.js.gz +0 -0
  64. package/dist/shell/index.html +2 -2
  65. package/package.json +1 -1
  66. package/dist/shell/assets/Editor-D_bxx8PL.js.br +0 -0
  67. package/dist/shell/assets/Editor-D_bxx8PL.js.gz +0 -0
  68. package/dist/shell/assets/XTerm-DNFNsoHC.js.br +0 -0
  69. package/dist/shell/assets/XTerm-DNFNsoHC.js.gz +0 -0
  70. package/dist/shell/assets/cssMode-BxHmuU8y.js.br +0 -0
  71. package/dist/shell/assets/cssMode-BxHmuU8y.js.gz +0 -0
  72. package/dist/shell/assets/freemarker2-Cx9ZoWdp.js.br +0 -0
  73. package/dist/shell/assets/freemarker2-Cx9ZoWdp.js.gz +0 -0
  74. package/dist/shell/assets/grammar-DlhzivAk.js.br +0 -0
  75. package/dist/shell/assets/grammar-DlhzivAk.js.gz +0 -0
  76. package/dist/shell/assets/handlebars-D0MhpM71.js.br +0 -0
  77. package/dist/shell/assets/handlebars-D0MhpM71.js.gz +0 -0
  78. package/dist/shell/assets/html-Da9gyCH4.js.br +0 -0
  79. package/dist/shell/assets/html-Da9gyCH4.js.gz +0 -0
  80. package/dist/shell/assets/htmlMode-CGo3ddCJ.js.br +0 -0
  81. package/dist/shell/assets/htmlMode-CGo3ddCJ.js.gz +0 -0
  82. package/dist/shell/assets/index-DJ0qL1Ze.css +0 -1
  83. package/dist/shell/assets/index-DJ0qL1Ze.css.br +0 -0
  84. package/dist/shell/assets/index-DJ0qL1Ze.css.gz +0 -0
  85. package/dist/shell/assets/index-DMDdU-hM.js +0 -288
  86. package/dist/shell/assets/index-DMDdU-hM.js.br +0 -0
  87. package/dist/shell/assets/index-DMDdU-hM.js.gz +0 -0
  88. package/dist/shell/assets/jsonMode-DT4ON4ij.js.br +0 -0
  89. package/dist/shell/assets/jsonMode-DT4ON4ij.js.gz +0 -0
  90. package/dist/shell/assets/liquid-Bm6Hq-FF.js.br +0 -0
  91. package/dist/shell/assets/liquid-Bm6Hq-FF.js.gz +0 -0
  92. package/dist/shell/assets/lspLanguageFeatures-DWvAzXxS.js.br +0 -0
  93. package/dist/shell/assets/lspLanguageFeatures-DWvAzXxS.js.gz +0 -0
  94. package/dist/shell/assets/mdx-DNcDUEs7.js.br +0 -0
  95. package/dist/shell/assets/mdx-DNcDUEs7.js.gz +0 -0
  96. package/dist/shell/assets/python-BgETNCIe.js.br +0 -0
  97. package/dist/shell/assets/python-BgETNCIe.js.gz +0 -0
  98. package/dist/shell/assets/razor-Cf_D69YI.js.br +0 -0
  99. package/dist/shell/assets/razor-Cf_D69YI.js.gz +0 -0
  100. package/dist/shell/assets/tsMode-BQA_zU_Q.js.br +0 -0
  101. package/dist/shell/assets/tsMode-BQA_zU_Q.js.gz +0 -0
  102. package/dist/shell/assets/xml-DrZtVQVT.js.br +0 -0
  103. package/dist/shell/assets/xml-DrZtVQVT.js.gz +0 -0
  104. package/dist/shell/assets/yaml-CzR4Kx36.js.br +0 -0
  105. package/dist/shell/assets/yaml-CzR4Kx36.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
  ![Toyon with four chats on a plant shop, each changing its own copy. The desk opens a code, a phone signs in with it and starts a copy of its own, both screens follow that chat, and both end on the last copy with its Wildflowers filter pressed, ready to land](https://raw.githubusercontent.com/toyon-dev/toyon/main/docs/images/toyon.gif)
10
10
 
@@ -100,7 +100,7 @@ Copies start when you open them, and stop their servers when nobody has looked a
100
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.
101
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.
102
102
 
103
- ## Somewhere other than your laptop
103
+ ## Your own server
104
104
 
105
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.
106
106
 
package/dist/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
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
+
5
31
  ## 0.21.0 (2026-11-02)
6
32
 
7
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.
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}});
package/dist/cli.js CHANGED
@@ -5290,7 +5290,7 @@ function parseVersion(v) {
5290
5290
  // package.json
5291
5291
  var package_default = {
5292
5292
  name: "toyon",
5293
- version: "0.21.0",
5293
+ version: "0.22.0",
5294
5294
  description: "Toyon is where coding agents work on your web app while you check each change by using it. Every chat gets its own running copy with a live preview.",
5295
5295
  license: "MIT",
5296
5296
  type: "module",
@@ -6311,7 +6311,7 @@ function agentLines(agents) {
6311
6311
  continue;
6312
6312
  const state = a.installed === null ? `${a.id} ${a.pinned} is not installed` : `${a.id} runs ${a.installed}, not the pinned ${a.pinned}`;
6313
6313
  if (a.error)
6314
- lines.push(line(false, "agents", `${state}: ${a.error}. The agent's install button in Settings or \`${restartCmd}\` tries again`));
6314
+ lines.push(line(false, "agents", a.held ? `${state}: ${a.error}. The agent's install anyway button in Settings runs it past the rule` : `${state}: ${a.error}. The agent's install button in Settings or \`${restartCmd}\` tries again`));
6315
6315
  else
6316
6316
  lines.push(line(true, "agents", `${state}; it may still be installing`));
6317
6317
  }