pi-roundtable-web 0.26.0 → 0.26.2

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 (226) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +32 -12
  3. package/dist/chunk-account-nhpd9j90.js +1 -0
  4. package/dist/chunk-action-menu-ec9jqtxq.js +1 -0
  5. package/dist/chunk-agent-d1xfrawq.js +1 -0
  6. package/dist/chunk-arranged-rooms-bga8yk2v.js +1 -0
  7. package/dist/chunk-character-creator-k67f77w5.js +1 -0
  8. package/dist/chunk-codeeditor-jm2sm333.js +2 -0
  9. package/dist/chunk-confirm-wc5xraev.js +1 -0
  10. package/dist/chunk-connectors-mhnw6d79.js +1 -0
  11. package/dist/chunk-conversations-yjyq4g1y.js +1 -0
  12. package/dist/{chunk-drag-v41gx2mc.js → chunk-drag-nyq52ck7.js} +1 -1
  13. package/dist/chunk-entry-red1597w.js +1 -0
  14. package/dist/chunk-folder-list-x56y26yq.js +1 -0
  15. package/dist/chunk-folds-3p7s2nvx.js +1 -0
  16. package/dist/{chunk-gate-8k61stsc.js → chunk-gate-h41bv4y9.js} +1 -1
  17. package/dist/chunk-group-scene-7eb6jyev.js +1 -0
  18. package/dist/chunk-group-table-rca48kt0.js +1 -0
  19. package/dist/chunk-host-icons-x318gjqp.js +1 -0
  20. package/dist/chunk-host-picture-xswcakgy.js +1 -0
  21. package/dist/chunk-host-state-bpahvk54.js +1 -0
  22. package/dist/chunk-host-ui-tsbwwk38.js +1 -0
  23. package/dist/{chunk-index-hby0ap91.js → chunk-index-029209sy.js} +2 -2
  24. package/dist/chunk-index-066vzexw.js +2 -0
  25. package/dist/chunk-index-0h4h76kw.js +2 -0
  26. package/dist/chunk-index-0n6ja7my.js +1 -0
  27. package/dist/chunk-index-0q15ysrb.js +1 -0
  28. package/dist/chunk-index-0xj30mzw.js +13 -0
  29. package/dist/{chunk-index-rhtvcbsq.js → chunk-index-1f0j335v.js} +2 -2
  30. package/dist/chunk-index-2f5nfekb.js +8 -0
  31. package/dist/chunk-index-31ays46f.js +2 -0
  32. package/dist/chunk-index-43k1rjmx.js +2 -0
  33. package/dist/chunk-index-4gk88a0x.js +4 -0
  34. package/dist/chunk-index-4jf4jvfd.css +1 -0
  35. package/dist/chunk-index-4mf29sbx.js +2 -0
  36. package/dist/chunk-index-51n20yhb.js +2 -0
  37. package/dist/{chunk-index-014rjv9k.js → chunk-index-6tpr6r6d.js} +2 -2
  38. package/dist/{chunk-index-e5sd30xy.js → chunk-index-7bbqtdce.js} +2 -2
  39. package/dist/chunk-index-84v7j6vh.js +50 -0
  40. package/dist/chunk-index-8f9jer8r.js +2 -0
  41. package/dist/chunk-index-91z3g774.js +1 -0
  42. package/dist/{chunk-index-dhpt8qr9.js → chunk-index-934zgd18.js} +2 -2
  43. package/dist/{chunk-index-awx6nnta.js → chunk-index-9nents16.js} +2 -2
  44. package/dist/chunk-index-9w0sar6s.js +2 -0
  45. package/dist/chunk-index-a768zmp6.js +2 -0
  46. package/dist/{chunk-index-nqfkwkfp.js → chunk-index-b7jjca66.js} +2 -2
  47. package/dist/chunk-index-c5x70d9g.js +2 -0
  48. package/dist/chunk-index-cmxs5y22.js +42 -0
  49. package/dist/chunk-index-cwc1vvpw.js +2 -0
  50. package/dist/chunk-index-d85x96q0.js +2 -0
  51. package/dist/chunk-index-datrrs6b.js +2 -0
  52. package/dist/chunk-index-dep2e3f3.js +2 -0
  53. package/dist/chunk-index-dtste2ed.js +2 -0
  54. package/dist/chunk-index-ewj52be9.js +2 -0
  55. package/dist/{chunk-index-pcfhpm8v.js → chunk-index-f3b5nch2.js} +142 -18
  56. package/dist/{chunk-index-km40bhsz.js → chunk-index-frwa2fmc.js} +2 -2
  57. package/dist/chunk-index-grkczq2c.js +2 -0
  58. package/dist/chunk-index-gzvkpe3e.js +2 -0
  59. package/dist/chunk-index-kfv996qe.js +920 -0
  60. package/dist/chunk-index-kw85ajap.js +138 -0
  61. package/dist/chunk-index-satam151.js +2 -0
  62. package/dist/{chunk-index-y8rnq8zf.js → chunk-index-smw1n2pt.js} +5 -5
  63. package/dist/chunk-index-th43f690.js +2 -0
  64. package/dist/chunk-index-ths2hxpe.js +1 -0
  65. package/dist/{chunk-index-wnjp6wv0.js → chunk-index-tmx30r1w.js} +2 -2
  66. package/dist/{chunk-index-hssjbr1k.js → chunk-index-y00wke93.js} +2 -2
  67. package/dist/chunk-index-y4sqmenv.js +2 -0
  68. package/dist/{chunk-index-66nskrdj.js → chunk-index-yrhbhmxz.js} +2 -2
  69. package/dist/chunk-index-zd76pr2k.js +2 -0
  70. package/dist/chunk-lang-css-fa7c0zfj.js +1 -0
  71. package/dist/{chunk-lang-dockerfile-hrav55t7.js → chunk-lang-dockerfile-46rk929v.js} +1 -1
  72. package/dist/{chunk-lang-go-x9ahv6e5.js → chunk-lang-go-qb0qdpg7.js} +3 -3
  73. package/dist/chunk-lang-html-47mf2y0v.js +1 -0
  74. package/dist/chunk-lang-javascript-d32qrvxz.js +1 -0
  75. package/dist/{chunk-lang-json-hsemyd0r.js → chunk-lang-json-1q4fp694.js} +1 -1
  76. package/dist/{chunk-lang-markdown-zkwb4c9n.js → chunk-lang-markdown-5w7t28wa.js} +4 -4
  77. package/dist/{chunk-lang-python-tewx7006.js → chunk-lang-python-3dq0p4rf.js} +2 -2
  78. package/dist/{chunk-lang-rust-0ydx84s1.js → chunk-lang-rust-70pa0agr.js} +1 -1
  79. package/dist/{chunk-lang-shell-gq1tmdz4.js → chunk-lang-shell-4pxt7hf4.js} +1 -1
  80. package/dist/{chunk-lang-sql-xt1qyycg.js → chunk-lang-sql-kgcbh2a9.js} +2 -2
  81. package/dist/{chunk-lang-toml-0hamc5fc.js → chunk-lang-toml-99t95pab.js} +1 -1
  82. package/dist/chunk-lang-typescript-4k1d8z7s.js +1 -0
  83. package/dist/{chunk-lang-xml-wf6h5pt2.js → chunk-lang-xml-mnbv9yfa.js} +1 -1
  84. package/dist/{chunk-lang-yaml-7vk521h1.js → chunk-lang-yaml-2by9g1dy.js} +1 -1
  85. package/dist/chunk-layout-actions-cgghzj1w.js +1 -0
  86. package/dist/chunk-menu-items-24cfwawa.js +2 -0
  87. package/dist/chunk-mode-toggle-v4baz3r1.js +1 -0
  88. package/dist/chunk-note-row-72n6cqyk.js +75 -0
  89. package/dist/chunk-notes-83s3tsey.js +1 -0
  90. package/dist/chunk-notice-bell-a4ty5h1p.js +1 -0
  91. package/dist/chunk-notices-evny44be.js +1 -0
  92. package/dist/chunk-onboarding-q1avjbrx.js +1 -0
  93. package/dist/chunk-overview-42h45ehd.js +1 -0
  94. package/dist/chunk-palette-e44qepmh.js +1 -0
  95. package/dist/chunk-placement-items-v466t0sv.js +1 -0
  96. package/dist/chunk-profile-bqcgkgk4.js +1 -0
  97. package/dist/chunk-prompt-history-hgbtcn4b.js +1 -0
  98. package/dist/chunk-prompts-czs8y6r1.js +1 -0
  99. package/dist/chunk-room-confirms-h8cdj3ng.js +1 -0
  100. package/dist/chunk-room-menu-7s0feajw.js +1 -0
  101. package/dist/chunk-rooms-menu-button-gawqvpsr.js +1 -0
  102. package/dist/{chunk-schedules-2ft6xxyw.js → chunk-schedules-zba7krac.js} +1 -1
  103. package/dist/{chunk-seat-menu-d3npdtx1.js → chunk-seat-menu-ca5p4e9q.js} +1 -1
  104. package/dist/chunk-sheet-hosts-ssbz6hf2.js +1 -0
  105. package/dist/chunk-skill-editor-n0y9pd90.js +8 -0
  106. package/dist/chunk-skills-ea4vb2s4.js +1 -0
  107. package/dist/chunk-switcher-list-pj5csqr9.js +1 -0
  108. package/dist/chunk-tab-dot-4tkpxqeh.js +1 -0
  109. package/dist/chunk-table-j8nmtdnn.js +1 -0
  110. package/dist/chunk-table-seats-qeytqe0m.js +1 -0
  111. package/dist/chunk-table2d-18y029k9.js +1 -0
  112. package/dist/chunk-table3d-q2s31ae0.js +4220 -0
  113. package/dist/chunk-thread-actions-w3eadnh7.js +1 -0
  114. package/dist/chunk-thread-cards-fbpky3c9.js +1 -0
  115. package/dist/chunk-thread-list-pghe84be.js +1 -0
  116. package/dist/chunk-transcript-eqzxgqys.js +1 -0
  117. package/dist/chunk-where-ygyr4jdj.js +1 -0
  118. package/dist/chunk-workspace-h0p32ygy.js +578 -0
  119. package/dist/chunk-zh-tw-k6xx1hp2.js +1 -0
  120. package/dist/index.html +1 -2
  121. package/dist/sw.js +1 -1
  122. package/package.json +2 -2
  123. package/src/api-types.ts +63 -3
  124. package/src/app/api-http.ts +1 -1
  125. package/src/app/app.ts +5 -0
  126. package/src/app/room-log.ts +16 -4
  127. package/src/app/rooms.ts +39 -0
  128. package/src/app/routes.ts +96 -2
  129. package/src/app/socket.ts +45 -9
  130. package/src/app/surface-threads.ts +1 -1
  131. package/src/app/surface.ts +2 -1
  132. package/src/app/threads.ts +51 -2
  133. package/src/auth/authenticator.ts +18 -5
  134. package/src/auth/login-page.ts +4 -2
  135. package/src/auth/oidc-pages.ts +2 -0
  136. package/src/auth/oidc.ts +39 -1
  137. package/src/auth/sessions.ts +10 -3
  138. package/src/authz.ts +2 -1
  139. package/src/console-server.ts +32 -6
  140. package/src/host/cards.ts +18 -5
  141. package/src/host/context.ts +72 -25
  142. package/src/host/forms.ts +3 -0
  143. package/src/host/frames.ts +8 -1
  144. package/src/host/host-app.ts +6 -4
  145. package/src/host/host-routes.ts +36 -3
  146. package/src/host/room-views.ts +6 -6
  147. package/src/host/rooms-service.ts +16 -1
  148. package/src/host/views.ts +3 -0
  149. package/src/i18n/zh-tw.ts +103 -79
  150. package/src/index.ts +15 -1
  151. package/src/options.ts +37 -1
  152. package/src/page-presentation.ts +47 -2
  153. package/src/pwa.ts +32 -4
  154. package/src/web-app.ts +47 -3
  155. package/src/web-plugin.ts +32 -10
  156. package/dist/chunk-account-hw49gd0d.js +0 -1
  157. package/dist/chunk-action-menu-rm5cyqkj.js +0 -1
  158. package/dist/chunk-agent-b017vswv.js +0 -1
  159. package/dist/chunk-arranged-rooms-q5v3dm1r.js +0 -1
  160. package/dist/chunk-character-creator-5dxcvd16.js +0 -1
  161. package/dist/chunk-codeeditor-pyt09fwg.js +0 -2
  162. package/dist/chunk-confirm-521yqmta.js +0 -1
  163. package/dist/chunk-connectors-hrm06nx8.js +0 -1
  164. package/dist/chunk-conversations-e26rrf01.js +0 -1
  165. package/dist/chunk-entry-jxxb3ath.js +0 -1
  166. package/dist/chunk-folder-list-b97xk12b.js +0 -1
  167. package/dist/chunk-folds-b8q7eags.js +0 -1
  168. package/dist/chunk-group-scene-dx6wt19m.js +0 -1
  169. package/dist/chunk-group-table-e4jr8r3a.js +0 -1
  170. package/dist/chunk-host-state-g7e7c0k5.js +0 -1
  171. package/dist/chunk-host-ui-x7k6n07v.js +0 -939
  172. package/dist/chunk-index-2d0kg096.js +0 -2
  173. package/dist/chunk-index-2qd81wbx.js +0 -2
  174. package/dist/chunk-index-2stynxw6.css +0 -1
  175. package/dist/chunk-index-459drsft.js +0 -2
  176. package/dist/chunk-index-4mfj596y.js +0 -2
  177. package/dist/chunk-index-bbsytycb.js +0 -2
  178. package/dist/chunk-index-c07p8k0x.js +0 -4
  179. package/dist/chunk-index-cq1e9xdz.js +0 -2
  180. package/dist/chunk-index-d1prgfbp.js +0 -2
  181. package/dist/chunk-index-g351921r.js +0 -1
  182. package/dist/chunk-index-k2qq1gdj.js +0 -2
  183. package/dist/chunk-index-ke9ynm0n.js +0 -2
  184. package/dist/chunk-index-kpscvg85.js +0 -2
  185. package/dist/chunk-index-m0d100mg.js +0 -2
  186. package/dist/chunk-index-mb72snk9.js +0 -2
  187. package/dist/chunk-index-mjqqver5.js +0 -4
  188. package/dist/chunk-index-nwqk447w.js +0 -2
  189. package/dist/chunk-index-q8h8xzbm.js +0 -2
  190. package/dist/chunk-index-r5vszgfs.js +0 -2
  191. package/dist/chunk-index-rjv7vrwd.js +0 -13
  192. package/dist/chunk-index-v23m38p6.js +0 -50
  193. package/dist/chunk-index-va0g7d88.js +0 -1
  194. package/dist/chunk-index-xgkd15n3.js +0 -2
  195. package/dist/chunk-index-z3k18atc.js +0 -2
  196. package/dist/chunk-lang-css-6bepqpnx.js +0 -1
  197. package/dist/chunk-lang-html-8jc72zt4.js +0 -1
  198. package/dist/chunk-lang-javascript-2p2qtbnf.js +0 -1
  199. package/dist/chunk-lang-typescript-82xf7z2e.js +0 -1
  200. package/dist/chunk-layout-actions-zh7bezk7.js +0 -1
  201. package/dist/chunk-menu-items-1n9qargb.js +0 -2
  202. package/dist/chunk-notes-t15bh04m.js +0 -1
  203. package/dist/chunk-notice-bell-w3y0h0sr.js +0 -1
  204. package/dist/chunk-notices-fa3g7qze.js +0 -1
  205. package/dist/chunk-onboarding-34v3nr17.js +0 -1
  206. package/dist/chunk-overview-km5vq375.js +0 -1
  207. package/dist/chunk-palette-a8txdgd0.js +0 -1
  208. package/dist/chunk-placement-items-wgaxsbvs.js +0 -1
  209. package/dist/chunk-profile-ypxdbsk1.js +0 -1
  210. package/dist/chunk-prompt-history-wm9dsy6s.js +0 -1
  211. package/dist/chunk-prompts-7mhhq7zs.js +0 -1
  212. package/dist/chunk-room-confirms-t11a1gsw.js +0 -1
  213. package/dist/chunk-room-menu-2tm2xtfx.js +0 -1
  214. package/dist/chunk-rooms-menu-button-wxnsxjwc.js +0 -1
  215. package/dist/chunk-sheet-hosts-vngvp7wv.js +0 -1
  216. package/dist/chunk-skill-editor-65n2hsq4.js +0 -8
  217. package/dist/chunk-skills-shkdwes8.js +0 -1
  218. package/dist/chunk-switcher-list-g6hhmr1t.js +0 -1
  219. package/dist/chunk-table-1b6bsq2y.js +0 -1
  220. package/dist/chunk-table-seats-vy1qhdks.js +0 -1
  221. package/dist/chunk-table2d-n26b7gd0.js +0 -1
  222. package/dist/chunk-table3d-8aysyf56.js +0 -4220
  223. package/dist/chunk-transcript-355faceq.js +0 -1
  224. package/dist/chunk-where-j5qdt8a4.js +0 -1
  225. package/dist/chunk-workspace-vrbs6zx1.js +0 -1
  226. package/dist/chunk-zh-tw-zeg600bk.js +0 -1
@@ -1 +0,0 @@
1
- import{j}from"./chunk-index-v23m38p6.js";var i="roundtable-console:folders-collapsed";function a(){try{let e=localStorage.getItem(i),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=j(),n=()=>(l??=a(),l);function s(e){l=e;try{localStorage.setItem(i,JSON.stringify([...e]))}catch{}d()}var lr=()=>c(n);function cr(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function ur(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function dr(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{lr,cr,ur,dr};
@@ -1,2 +0,0 @@
1
- import{a,r,u,ne}from"./chunk-index-v23m38p6.js";function Oe(o,e){let{version:s}=ne(),[t,i]=r({data:void 0,error:void 0,subject:e});return a(()=>{let n=!0;return o().then((d)=>{if(n)i({data:d,error:void 0,subject:e})},(d)=>{if(n)i((f)=>({data:f.subject===e?f.data:void 0,error:u(d),subject:e}))}),()=>{n=!1}},[e,s]),t.subject===e?{data:t.data,error:t.error}:{data:void 0,error:void 0}}
2
- export{Oe};
@@ -1,2 +0,0 @@
1
- import{w,f,u,m}from"./chunk-index-v23m38p6.js";import{wt,or,an}from"./chunk-index-459drsft.js";import{us}from"./chunk-index-4mfj596y.js";import{Ue,ms,Os,gs,ys,bs}from"./chunk-index-2qd81wbx.js";var n={createFolder:(e)=>f("folders",{method:"POST",body:JSON.stringify({name:e})}),changeFolder:(e,t)=>f(`folders/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),deleteFolder:(e)=>f(`folders/${encodeURIComponent(e)}`,{method:"DELETE"}),muteFolder:(e,t)=>f(`folders/${encodeURIComponent(e)}/mute`,{method:"PUT",body:JSON.stringify({muted:t})}),placeRoom:(e,t,o)=>f(`rooms/${encodeURIComponent(e)}/folder`,{method:"PUT",body:JSON.stringify({folder:t,before:o})}),pinRoom:(e,t,o)=>f(`rooms/${encodeURIComponent(e)}/pin`,{method:"PUT",body:JSON.stringify({pinned:t,before:o})})};var l=(e)=>m(e,"danger"),d=(e)=>w.dispatch({type:"layout_loaded",pins:e.pins,folders:e.folders});async function i(e,t,o=l){let r=or();try{d(e(r))}catch{}try{let s=await t();return d(s),s}catch(s){d(r),w.dispatch({type:"changed"}),o(u(s));return}}var as=(e,t,o=null)=>i((r)=>bs(r,e,t,o),()=>n.pinRoom(e,t,o)),zt=(e,t,o=null)=>i((r)=>ys(r,e,t,o),()=>n.placeRoom(e,t,o));function wi(e,t){let o=wt(an(),e);if(o.kind==="rest")return;let r=Ue(o.siblings,e,t);if(!r)return;return o.kind==="pinned"?as(e,!0,r.before):zt(e,o.folder,r.before)}async function ir(e,t=l){try{let o=await n.createFolder(e);return d(o),o.folders.at(-1)?.id}catch(o){t(u(o));return}}var rr=(e,t,o)=>i((r)=>ms(r,e,t),()=>n.changeFolder(e,{name:t}),o),ks=(e,t)=>i((o)=>Os(o,e,t),()=>n.changeFolder(e,{before:t}));function Ps(e,t){let o=Ue(or().folders.map((r)=>r.id),e,t);return o?ks(e,o.before):void 0}var sr=(e,t)=>i((o)=>gs(o,e),()=>n.deleteFolder(e),t);async function Qs(e,t){try{let o=await n.muteFolder(e,t);for(let r of o.rooms)w.dispatch({type:"room_muted",room:r,muted:o.muted});return!0}catch(o){return l(u(o)),!1}}function Ms(e,t){let o=us(wt(an(),e),e,t);if(!o)return;if(o.kind==="pin")return as(e,!0,o.before);if(o.kind==="folder")return zt(e,o.folder,o.before);return zt(e,null)}
2
- export{as,zt,wi,ir,rr,ks,Ps,sr,Qs,Ms};
@@ -1 +0,0 @@
1
- import"./chunk-index-rjv7vrwd.js";import"./chunk-index-nqfkwkfp.js";import{_n}from"./chunk-index-km40bhsz.js";var r=()=>_n();export{r as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-rjv7vrwd.js";import"./chunk-index-nqfkwkfp.js";import{Sn}from"./chunk-index-wnjp6wv0.js";import"./chunk-index-km40bhsz.js";import"./chunk-index-y8rnq8zf.js";import"./chunk-index-hby0ap91.js";var t=()=>Sn();export{t as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-rjv7vrwd.js";import"./chunk-index-nqfkwkfp.js";import{kt}from"./chunk-index-y8rnq8zf.js";import"./chunk-index-hby0ap91.js";var t=()=>kt({jsx:!0});export{t as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-rjv7vrwd.js";import"./chunk-index-nqfkwkfp.js";import{kt}from"./chunk-index-y8rnq8zf.js";import"./chunk-index-hby0ap91.js";var r=()=>kt({typescript:!0,jsx:!0});export{r as language};
@@ -1 +0,0 @@
1
- import{as,zt,wi,ir,rr,ks,Ps,sr,Qs,Ms}from"./chunk-index-z3k18atc.js";import"./chunk-index-459drsft.js";export{ir as createFolder,sr as deleteFolder,Ms as dropRoom,zt as moveRoom,Qs as muteFolder,Ps as nudgeFolder,wi as nudgeRoom,as as pinRoom,ks as placeFolderBefore,rr as renameFolderTo};
@@ -1,2 +0,0 @@
1
- import{t,Gt,w,m,Yr,ge,Fe,St,Me,ht}from"./chunk-index-v23m38p6.js";import"./chunk-index-nwqk447w.js";import{ar}from"./chunk-index-mb72snk9.js";import{Ge}from"./chunk-index-bbsytycb.js";import"./chunk-index-459drsft.js";var p=(e)=>e();async function s(e){try{await navigator.clipboard.writeText(e),m(t("Copied"))}catch{m(t("Could not copy."),"danger")}}async function c(e){try{await navigator.share(e)}catch(n){if(n instanceof DOMException&&n.name==="AbortError")return;m(t("Could not share."),"danger")}}var f=()=>typeof navigator.share==="function";function I(e,n=p){let i=w.getState().rooms[e],o=i?.view;if(!o||o.kind==="thread")return;let l=i.mode,a=o.home?[]:ar(e,n);if(o.kind==="agent"){let r=o.name;a.push({id:"edit",label:t("Edit agent"),icon:"profile",run:()=>n(()=>Fe(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>n(()=>Fe(r,{look:!0}))})}if(o.kind==="group"){let r=o.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>n(()=>ht({kind:"group",name:r}))})}if(a.push({id:"notifications",label:t("Notifications"),icon:o.muted?"bell-off":"bell",checked:!o.muted,run:async()=>{let r=o.muted!==!0;if(!await Ge(e,r))return;m(r?t("Notifications are off for {name}",{name:o.displayName}):t("Notifications are on for {name}",{name:o.displayName}))}}),!o.readOnly)a.push({id:"yolo",label:t("Yolo mode"),icon:"bolt",tone:"yolo",checked:l.yolo,run:()=>{if(l.yolo)return St(e,{yolo:!1});Me({kind:"yolo",room:e,name:o.displayName})}},{id:"long",label:t("Long-running mode"),icon:"timer",tone:"long",checked:l.longRunning,run:()=>St(e,{longRunning:!l.longRunning})},{id:"start-over",label:t("Start over"),icon:"reset",tone:"danger",run:()=>Me({kind:"start-over",room:e,name:o.displayName})});if(!o.readOnly&&!o.coordinator)a.push({id:"archive",label:o.kind==="group"?t("Archive group"):t("Archive agent"),icon:"archive",tone:"danger",run:()=>Me({kind:"archive",room:e,name:o.displayName})});return{title:o.displayName,items:a}}function h(e=p){return{title:t("Add"),items:[{id:"new-agent",label:t("New agent"),icon:"profile",run:()=>e(()=>ht({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>ht({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>ht({kind:"archive"}))}]}}function P(e,n){let i=e.getBoundingClientRect();ge({...h(n),at:{x:i.left,y:i.bottom},via:"key",source:e})}function O(e){let n=w.getState().rooms[e]?.view;if(n?.kind!=="agent")return;return{title:n.displayName,items:[{id:"leave",label:t("Leave the table"),icon:"bell-off",run:async()=>{if(!await Ge(e,!0))return;m(t("{name} left the table",{name:n.displayName}))}}]}}function u(e,n){let i=e.querySelector(".bubble > .prose");if(!i)return n;return(i.innerText||i.textContent||n).trim()}function g(e){if(!e)return;let n=window.getSelection();if(!n)return;let i=document.createRange();i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i)}function b(e){let n=window.getSelection();if(!n||n.isCollapsed)return"";return(n.anchorNode&&e.contains(n.anchorNode)?n.toString():"").trim()}function H(e,n,i){let o=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>s(b(n)||u(n,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>s(e.text)}];if(i)o.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>Yr(e.room,e.text)});if(o.push({id:"select",label:t("Select text"),icon:"list",run:()=>g(n.querySelector(".bubble"))}),f())o.push({id:"share",label:t("Share"),icon:"send",run:()=>c({text:u(n,e.text)})});return{title:e.author,items:o}}function D(e,n){return{title:n,items:[{id:"profile",label:t("Agent profile"),icon:"profile",run:()=>Fe(e)}]}}var d=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((n)=>n.description?`- ${n.label}: ${n.description}`:`- ${n.label}`)];function y(e){let n=[e.title];switch(e.kind){case"approval":{n.push("",e.message);let{approval:i}=e;if(i){if(n.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)n.push(JSON.stringify(i.input,null,2));for(let o of i.files??[])n.push(o.path)}break}case"ask":n.push("",...d({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)n.push("",...d(i));break}return n.join(`
2
- `)}function Q(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>s(y(e))}]}}function v(e){let n=document.createElement("a");n.href=Gt(e),n.download=e.name,n.hidden=!0,document.body.append(n),n.click(),n.remove()}async function M(e){let n=new URL(Gt(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(n);if(i.ok){let o=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[o]})){await c({files:[o],title:e.name});return}}}catch{}await c({title:e.name,url:n})}function j(e){let n=[{id:"download",label:t("Download"),icon:"download",run:()=>v(e)}];if(f())n.push({id:"share",label:t("Share"),icon:"send",run:()=>M(e)});return{title:e.name,items:n}}export{h as addMenu,D as avatarMenu,y as cardDetails,Q as cardMenu,s as copyText,j as fileMenu,H as messageMenu,P as openAddMenu,I as roomMenu,O as seatMenu};
@@ -1 +0,0 @@
1
- import{X,a,o,r,t,c,e,n,y,u,v,h,_,P,k,Hr,ne}from"./chunk-index-v23m38p6.js";import{Oe}from"./chunk-index-xgkd15n3.js";import{ue}from"./chunk-index-r5vszgfs.js";import"./chunk-index-awx6nnta.js";var L=[{kind:"core",label:c("Core"),hint:c("Carried into every turn.")},{kind:"note",label:c("Note"),hint:c("Searched when the assistant needs them.")},{kind:"event",label:c("Events"),hint:c("Carried into every turn until their date.")}],B=300;function ee(){let{timeZone:m}=k(),{version:l}=ne(),[s,g]=r("core"),[f,D]=r(""),[b,S]=r(),[d,R]=r(),[N,w]=r(),[E,x]=r(),[C,W]=r(),V=Oe(()=>y.principals(),"principals").data,A=o(0),K=X(async(i)=>{let p=++A.current;try{let I=await y.notes(i.trim(),C);if(p!==A.current)return;S(I),R(void 0)}catch(I){if(p===A.current)R(u(I))}},[C]);a(()=>{let i=setTimeout(()=>void K(f),B);return()=>clearTimeout(i)},[f,K,l]);let T=(b??[]).filter((i)=>i.kind===s).sort((i,p)=>s==="event"?(i.eventDate??"").localeCompare(p.eventDate??""):i.id-p.id),q=Hr(m);return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Notes")}),e("p",{className:"hint",children:t("What the assistant remembers. A change applies from the next turn.")})]}),e("button",{type:"button",onClick:()=>w({draft:{kind:s,fact:"",eventDate:""}}),children:t("Add")})]}),V&&V.principals.length>1?e(F,{people:V,shown:C,choose:(i)=>{S(void 0),W(i)}}):null,n("div",{className:"toolbar",children:[e("div",{className:"tabs",role:"tablist",children:L.map((i)=>n("button",{type:"button",role:"tab","aria-selected":s===i.kind,onClick:()=>g(i.kind),children:[t(i.label),b?` ${b.filter((p)=>p.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:f,onChange:(i)=>D(i.target.value)})]}),e("p",{className:"hint",children:t(L.find((i)=>i.kind===s)?.hint??"")}),d?e(h,{message:d}):null,!b?e(v,{}):T.length===0?e(_,{children:f?t("No matching notes."):t("Nothing of this kind yet.")}):T.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[n("div",{children:[i.eventDate?n("p",{className:"meta",children:[i.eventDate," ",i.eventDate<q?e(P,{children:t("past")}):null]}):null,e("p",{className:"text",children:i.fact})]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>w({note:i,draft:{kind:i.kind,fact:i.fact,eventDate:i.eventDate??""}}),children:t("Edit")}),e("button",{type:"button",className:"danger",onClick:()=>x(i),children:t("Delete")})]})]})},i.id)),e(ue,{open:N!==void 0,title:N?.note?t("Edit note"):t("Add note"),onClose:()=>w(void 0),children:N?e(H,{initial:N.draft,save:async(i)=>{if(N.note)await y.updateNote(N.note.id,i,C);else await y.addNote(i,C);w((p)=>p===N?void 0:p),await K(f)},cancel:()=>w(void 0)}):null}),e(ue,{open:E!==void 0,title:t("Delete this note?"),onClose:()=>x(void 0),children:E?e(M,{text:E.fact,run:async()=>{await y.deleteNote(E.id,C),x((i)=>i===E?void 0:i),await K(f)},cancel:()=>x(void 0)}):null})]})}function F(m){let{people:l}=m;return n("label",{className:"inline",children:[t("Whose notes")," ",e("select",{value:m.shown??l.self,onChange:(s)=>m.choose(s.target.value===l.self?void 0:s.target.value),children:l.principals.map((s)=>e("option",{value:s.id,children:s.id===l.self?t("{name} (you)",{name:s.name}):s.disabled?t("{name} (disabled)",{name:s.name}):s.name},s.id))})]})}function H(m){let[l,s]=r(m.initial),[g,f]=r(!1),[D,b]=r(),S=async()=>{f(!0),b(void 0);try{await m.save({kind:l.kind,fact:l.fact,...l.kind==="event"&&l.eventDate?{eventDate:l.eventDate}:{}})}catch(d){b(u(d)),f(!1)}};return n("form",{className:"stack",onSubmit:(d)=>{d.preventDefault(),S()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:L.map((d)=>e("button",{type:"button","aria-pressed":l.kind===d.kind,onClick:()=>s({...l,kind:d.kind}),children:t(d.label)},d.kind))})]}),l.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:l.eventDate,onChange:(d)=>s({...l,eventDate:d.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:l.fact,onChange:(d)=>s({...l,fact:d.target.value})})]}),D?e(h,{message:D}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:m.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:g,children:g?t("Saving…"):t("Save")})]})]})}function M(m){let[l,s]=r(!1),[g,f]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:m.text}),g?e(h,{message:g}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:m.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:l,onClick:()=>{s(!0),m.run().catch((D)=>{f(u(D)),s(!1)})},children:l?t("Deleting…"):t("Delete")})]})]})}export{ee as NotesPage};
@@ -1 +0,0 @@
1
- import"./chunk-index-m0d100mg.js";import{t,e,n,s,x}from"./chunk-index-v23m38p6.js";import{Rn}from"./chunk-index-q8h8xzbm.js";function r({current:a}){let{badge:o}=Rn();return n("a",{className:"icon-button bell",href:x("notices"),"aria-current":a?"page":void 0,"aria-label":o>0?t("Notices, {count} waiting",{count:o}):t("Notices"),children:[e(s,{name:"bell"}),o>0?e("span",{className:"bell-count","aria-hidden":"true",children:o>99?"99+":o}):null]})}export{r as default};
@@ -1 +0,0 @@
1
- import{a,r,t,e,n,s,u,h,_,P}from"./chunk-index-v23m38p6.js";import"./chunk-index-m0d100mg.js";import{Rn,Qr,Mr}from"./chunk-index-q8h8xzbm.js";function p(o,l){let i=Math.max(0,Math.round((l-Date.parse(o))/60000));if(i<1)return t("just now");if(i<60)return t("{count} min ago",{count:i});let c=Math.round(i/60);if(c<24)return t("{count} h ago",{count:c});return t("{count} d ago",{count:Math.round(c/24)})}function g({notice:o}){let[l,i]=r(!1),[c,m]=r();return n("li",{className:"card stack notice","data-urgent":o.urgency==="high"||void 0,children:[n("div",{className:"card-head",children:[e("strong",{children:o.title}),o.urgency==="high"?e(P,{tone:"warn",children:t("Urgent")}):null]}),o.body?e("p",{children:o.body}):null,e("p",{className:"meta",children:p(o.raisedAt,Date.now())}),c?e(h,{message:c}):null,n("div",{className:"actions",children:[o.open?e("a",{className:"button",href:Mr(o.open),children:t("Open")}):null,o.ackable?o.acked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Handled")]}):e("button",{type:"button",className:"secondary",disabled:l,onClick:async()=>{i(!0),m(void 0);try{await Qr(o.tag)}catch(d){m(u(d))}finally{i(!1)}},children:t("Handled")}):null]})]})}function E(){let{notices:o,known:l}=Rn(),[,i]=r(0);return a(()=>{let c=setInterval(()=>i((m)=>m+1),60000);return()=>clearInterval(c)},[]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Notices")})}),o.length===0?e(_,{children:l?t("Nothing needs you."):t("Loading…")}):e("ul",{className:"stack notices",children:o.map((c)=>e(g,{notice:c},c.tag))})]})}export{E as NoticesPage};
@@ -1 +0,0 @@
1
- import{X,a,o,r,t,p,e,n,s,x,u,v,h,bn,Oi}from"./chunk-index-v23m38p6.js";import{H}from"./chunk-index-e5sd30xy.js";import{le}from"./chunk-index-m0d100mg.js";import{dn,Ut}from"./chunk-index-hssjbr1k.js";import"./chunk-index-awx6nnta.js";var M=90000,A=2000,C=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),_=()=>/iPhone|iPad/.test(navigator.userAgent);function F({step:i,view:w,refresh:m}){let[l,c]=r(),[d,g]=r(i.done?"arrived":"idle"),[k,b]=r(),[S,y]=r(!1),[V,T]=r(!1),N=o(void 0);a(()=>(bn().then(c,()=>c("unsupported")),()=>clearTimeout(N.current)),[]),a(()=>{if(i.done)g("arrived")},[i.done]);let I=X((f)=>{let P=async()=>{if((await m())?.steps.find((E)=>E.id===i.id)?.done){g("arrived");return}if(Date.now()-f>M){g("late");return}N.current=setTimeout(P,A)};N.current=setTimeout(P,A)},[m,i.id]),L=async()=>{y(!0),b(void 0),g("sending");try{await le.pushTest(),g("waiting"),I(Date.now())}catch(f){g("idle"),b(u(f))}finally{y(!1)}},D=async()=>{y(!0),b(void 0);try{await Oi(),c(await bn()),await m()}catch(f){b(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):u(f)),c(await bn().catch(()=>"unsupported"))}finally{y(!1)}},O=l==="unsupported"&&_()&&!C();return n("section",{className:"card stack","aria-labelledby":`step-${i.id}`,children:[n("div",{className:"card-head",children:[e("h2",{id:`step-${i.id}`,children:dn(i)}),i.done?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:Ut(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":l==="on"||O===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:O?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):C()?t("This page is installed on this device."):t("On a phone, add it to the home screen from the browser's menu so notifications reach you when it is closed.")})]}),n("li",{"data-done":l==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),l==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):l==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):l==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:S||l===void 0,onClick:D,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),d==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(p,{children:[e("button",{type:"button",className:"secondary",disabled:S||l!=="on"||d==="waiting",onClick:L,children:d==="waiting"?t("Waiting for it…"):t("Send a test notification")}),d==="late"?e("span",{className:"meta",children:t("It has not arrived. Check that notifications are allowed for this app, then send another.")}):null]})]})]}),k?e(h,{message:k}):null,i.waiver&&!i.done&&!i.waived?n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>T(!0),children:t(i.waiver.label)}),e(H,{open:V,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>T(!1),onConfirm:async()=>{await le.waive(i.id),await m()},children:e("p",{children:t(i.waiver.confirm)})})]}):null,w.push.devices>0&&!i.done?e("p",{className:"meta",children:t("{count} device(s) will get notifications.",{count:w.push.devices})}):null]})}function j(){let[i,w]=r(),[m,l]=r(),c=X(async()=>{try{let d=await le.onboarding();return w(d),d}catch(d){l(u(d));return}},[]);if(a(()=>{c()},[c]),m&&!i)return e(h,{message:m});if(!i)return e(v,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),i.steps.map((d)=>d.builtin==="push"?e(F,{step:d,view:i,refresh:c},d.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:dn(d)}),d.done||d.waived?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",d.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:x(d.open.page),children:t("Open")})]}),e("p",{className:"meta",children:Ut(d)})]},d.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{j as OnboardingPage};
@@ -1 +0,0 @@
1
- import{r,t,c,p,e,n,x,y,u,v,h,_,P,k,Ne,te,_e,li,Wt,Vn,ne}from"./chunk-index-v23m38p6.js";import{Oe}from"./chunk-index-xgkd15n3.js";import{ue}from"./chunk-index-r5vszgfs.js";import"./chunk-index-awx6nnta.js";function f(a){let{cleanup:s}=k(),[d,g]=r(),[l,o]=r(!1),[m,i]=r();if(!s)return null;let b=()=>{if(!l)g(void 0),i(void 0)};return n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>g("start-over"),children:t("Start over")}),a.deletable?e("button",{type:"button",className:"danger",onClick:()=>g("delete"),children:t("Delete")}):null,n(ue,{open:d!==void 0,title:d==="delete"?t("Permanently delete {name}?",{name:a.title}):t("Start over {name}?",{name:a.title}),onClose:b,children:[e("p",{children:d==="delete"?t("The live conversation and all archives will be permanently deleted. Memory and schedules are preserved."):t("The current conversation will be archived; the next message starts a new one. Long-term memory is preserved. Active turns finish first.")}),m?e(h,{message:m}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l,onClick:b,children:t("Cancel")}),e("button",{type:"button",className:d==="delete"?"danger":"",disabled:l,onClick:async()=>{if(!d)return;o(!0),i(void 0);try{if(d==="delete")await y.deleteConversation(a.channel);else await y.startOver(a.channel);g(void 0),a.refresh()}catch(I){i(u(I))}finally{o(!1)}},children:l?d==="delete"?t("Deleting…"):a.busy?t("Waiting for this turn…"):t("Starting over…"):d==="delete"?t("Delete permanently"):t("Start over")})]})]})]})}function K(){let a=k(),{now:s}=ne(),[d,g]=r(0),l=()=>g((i)=>i+1),{data:o,error:m}=Oe(()=>y.overview(),`overview:${d}`);if(!o)return m?e(h,{message:m}):e(v,{});return n(p,{children:[m?e(h,{message:m}):null,n("section",{className:"stack",children:[e("h2",{children:t("Agent server")}),e("p",{className:"hint",children:t("Agent and group status; starting over archives the conversation and preserves memory.")}),o.agents.length+o.groups.length===0?e(_,{children:t("No agents.")}):null,o.agents.map((i)=>e(A,{agent:i,groups:o.groups,agents:o.agents,guildId:o.guildId,now:s,refresh:l},i.name)),o.groups.map((i)=>e(C,{group:i,guildId:o.guildId,now:s,timeZone:a.timeZone,refresh:l},i.name))]}),n("section",{className:"stack",children:[e("h2",{children:t("My workspaces")}),e("p",{className:"hint",children:t("Direct messages and channels where you mention the assistant. Start over archives; delete removes every archive permanently.")}),o.workspaces?.length?o.workspaces.map((i)=>e(N,{conversation:i,schedules:i.schedules,now:s,refresh:l},i.key)):e(_,{children:t("No workspaces.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Outside-agent conversations")}),e("p",{className:"hint",children:t("Conversations opened through remote MCP; after deletion the session ID cannot be resumed.")}),o.outside?.length?o.outside.map((i)=>e(N,{conversation:i,now:s,refresh:l},i.key)):e(_,{children:t("No outside-agent conversations.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Party channels")}),e("p",{className:"hint",children:t("Starting over stops the container and archives role conversations; each speaker's memory is preserved.")}),o.party?.length?o.party.map((i)=>e(B,{party:i,now:s,refresh:l},i.key)):e(_,{children:t("No party channels.")})]})]})}function w({busy:a}){return e(P,{tone:a?"busy":"plain",children:a===0?t("idle"):a===1?t("Working"):t("Working, {count} waiting",{count:a-1})})}function C(a){let{group:s,now:d,timeZone:g}=a;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[s.channelId?e("a",{href:Vn(s.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:s.displayName}):e("strong",{children:s.displayName}),e(P,{children:t("Group")}),e(w,{busy:s.busy})]}),e("p",{children:t("Members: {members} | Host: {host}",{members:s.members.join(", "),host:s.host})}),n("p",{className:"hint",children:[t("Last active")," ",Ne(s.lastActive,d,g)]}),s.channelId?e(f,{channel:`discord:${s.channelId}`,title:s.displayName,busy:s.busy>0,refresh:a.refresh}):null]})}function A(a){let{agent:s}=a,{timeZone:d,panes:g}=k(),l=a.groups.find((i)=>i.channelId===s.workingIn),o=a.agents.find((i)=>i.channelId===s.workingIn),m=!s.workingIn?void 0:s.workingIn===s.channelId?t("Working in own channel"):l?t("Working in group {name}",{name:l.displayName}):o?t("Replying in {name}'s channel",{name:o.displayName}):t("Replying in another channel");return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:s.channelId?e("a",{href:Vn(s.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:s.displayName}):s.displayName}),e(P,{children:"agent"}),s.workingIn?e(w,{busy:1+s.waiting}):s.waiting>0?e(P,{tone:"busy",children:t("{count} waiting",{count:s.waiting})}):e(P,{children:t("idle")})]}),m?e("p",{children:m}):null,n("dl",{className:"facts",children:[n("div",{children:[e("dt",{children:t("Model")}),n("dd",{children:[s.model," · thinking ",s.thinking]})]}),n("div",{children:[e("dt",{children:t("Context")}),e("dd",{children:s.context?s.context.tokens===null?t("Just compacted (limit {limit})",{limit:li(s.context.contextWindow)}):`${li(s.context.tokens)} / ${li(s.context.contextWindow)} (${Math.round(s.context.tokens/s.context.contextWindow*100)}%)`:"—"})]}),n("div",{children:[e("dt",{children:t("Schedules")}),e("dd",{children:s.schedules})]}),n("div",{children:[e("dt",{children:t("Last active")}),e("dd",{children:Ne(s.lastActive,a.now,d)})]})]}),s.channelId?n(p,{children:[e(f,{channel:`discord:${s.channelId}`,title:s.displayName,busy:!!s.workingIn||s.waiting>0,refresh:a.refresh}),g.includes("conversations")?e("a",{href:x("conversations",`discord:${s.channelId}`),children:t("transcript")}):null]}):null]})}function N({conversation:a,schedules:s,now:d,refresh:g}){let{timeZone:l,panes:o}=k(),{title:m,detail:i}=a.kind==="outside"?{title:a.firstMessage||t("(No messages)"),detail:a.id}:Wt(a.channel,a.id);return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel&&a.channel.kind!=="gone"?e("a",{href:Vn(a.id,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:m}):m}),e(w,{busy:a.busy})]}),i?e("p",{className:"hint",children:i}):null,e("p",{children:a.liveBytes>0?t("Conversation {size} · Archives {count}",{size:_e(a.liveBytes),count:a.archives}):t("No live conversation · Archives {count}",{count:a.archives})}),a.startedAt?n("p",{children:[t("Started")," ",te(a.startedAt,l)]}):null,n("p",{className:"hint",children:[s!==void 0?`${t("Schedules")} ${s} · `:"",t("Last active")," ",Ne(a.lastActive,d,l)]}),e(f,{channel:a.key,title:m,busy:a.busy>0,deletable:!0,refresh:g}),o.includes("conversations")?e("a",{href:x("conversations",a.key),children:t("transcript")}):null]})}function B({party:a,now:s,refresh:d}){let{timeZone:g}=k(),{title:l,detail:o}=Wt(a.channel,a.channelId),m={running:c("Container running"),stopped:c("Container stopped"),missing:c("No container yet"),unknown:c("Container status unknown")};return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel.kind!=="gone"?e("a",{href:Vn(a.channelId,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:l}):l}),e(P,{children:a.profile}),e(P,{children:t(m[a.container])}),e(w,{busy:a.busy})]}),o?e("p",{className:"hint",children:o}):null,e("p",{children:t("Enabled by {name} at {time}",{name:a.enabledBy,time:te(a.enabledAt,g)})}),n("p",{className:"hint",children:[t("Last active")," ",Ne(a.lastActive,s,g)]}),e(f,{channel:a.key,title:l,busy:a.busy>0,refresh:d})]})}export{K as OverviewPage};
@@ -1 +0,0 @@
1
- import{a,A,o,r,t,e,n,s,x,K,d,Yt,de}from"./chunk-index-v23m38p6.js";import{Nn}from"./chunk-index-014rjv9k.js";import{I}from"./chunk-index-awx6nnta.js";function F(m){let[f,v]=r(""),[p,h]=r(0),g=o(null),b=d((l)=>l.order.flatMap((i)=>{let c=l.rooms[i]?.view;return c?[{key:i,name:c.displayName,agent:c.name,character:c.character,kind:c.kind}]:[]})),u=A(()=>[...b.map((i)=>({id:i.key,label:i.name,hint:i.kind==="agent"?t("Agent"):i.kind==="group"?t("Group"):t("Thread"),room:!0,...i.kind==="agent"?{avatar:{name:i.agent,character:i.character}}:{icon:"conversations"},go:()=>K("room",i.key)})),...m.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>K(i.pane)}))].flatMap((i)=>{let c=Nn(f,i.label);return c===void 0?[]:[{target:i,score:c}]}).sort((i,c)=>c.score-i.score).map((i)=>i.target).slice(0,12),[b,m.pages,f]);a(()=>h(0),[f]),a(()=>{if(m.open)v(""),requestAnimationFrame(()=>g.current?.focus())},[m.open]);let y=(l)=>{if(!l)return;m.onClose(),l.go()};return e(I,{open:m.open,title:t("Find a room"),onClose:m.onClose,variant:"palette",children:n("div",{className:"palette-box",children:[n("div",{className:"palette-input",children:[e(s,{name:"search",size:18}),e("input",{ref:g,value:f,placeholder:t("Find a room or page"),"aria-label":t("Find a room or page"),role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":u[p]?`palette-${p}`:void 0,onChange:(l)=>v(l.target.value),onKeyDown:(l)=>{if(Yt(l.nativeEvent))return;if(l.key==="ArrowDown")l.preventDefault(),h((i)=>Math.min(u.length-1,i+1));else if(l.key==="ArrowUp")l.preventDefault(),h((i)=>Math.max(0,i-1));else if(l.key==="Enter")l.preventDefault(),y(u[p])}}),e("kbd",{children:"Esc"})]}),n("ul",{className:"palette-list",children:[u.length===0?e("li",{className:"palette-empty",children:t("Nothing matches.")}):null,u.map((l,i)=>e("li",{"data-active":i===p||void 0,children:n("a",{href:l.room?x("room",l.id):x(l.id),onClick:(c)=>{c.preventDefault(),y(l)},onMouseMove:()=>h(i),"aria-current":i===p?"true":void 0,children:[l.avatar?e(de,{spec:l.avatar.character,name:l.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(s,{name:l.icon??"list",size:16})}),e("span",{className:"palette-label",children:l.label}),e("span",{className:"meta",children:l.hint})]})},l.id))]})]})})}export{F as Palette};
@@ -1 +0,0 @@
1
- import{ar,Rs}from"./chunk-index-mb72snk9.js";import"./chunk-index-nwqk447w.js";import"./chunk-index-459drsft.js";export{Rs as folderMenu,ar as placementItems};
@@ -1 +0,0 @@
1
- import{X,a,o,r,t,c,p,e,n,s,y,u,v,h,P,gi}from"./chunk-index-v23m38p6.js";import{H}from"./chunk-index-e5sd30xy.js";import{le}from"./chunk-index-m0d100mg.js";import"./chunk-index-awx6nnta.js";var B=3000;function R({profile:i}){return n("div",{className:"who",children:[i.picture?e("img",{className:"who-picture",src:`api/people/${encodeURIComponent(i.principal)}/picture`,alt:""}):e("span",{className:"who-initial","aria-hidden":"true",children:Array.from(i.name)[0]??"?"}),n("div",{className:"stack",children:[e("strong",{children:i.name}),i.tier?n("span",{className:"meta",children:[e(s,{name:"shield",size:14})," ",t(F[i.tier])]}):null]})]})}function E({link:i,labels:V,changed:d}){let[l,m]=r(),[f,N]=r(!1),[C,S]=r(),[w,k]=r(!1),L=i.pending!==void 0||l!==void 0,I=o(void 0);a(()=>{if(!L||i.linked)return;return I.current=setInterval(()=>{le.links().then((b)=>{let A=b.links.find((T)=>T.provider===i.provider);if(A)d(A)},()=>{return})},B),()=>clearInterval(I.current)},[L,i.linked,i.provider,d]);let q=async(b)=>{N(!0),S(void 0);try{await b()}catch(A){S(u(A))}finally{N(!1)}},g=i.blockedBy.length>0;return n("li",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:i.label}),i.linked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Linked"),i.linked.displayName?` · ${i.linked.displayName}`:""]}):i.step==="required"?e(P,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(P,{children:t("Recommended")}):null]}),C?e(h,{message:C}):null,i.linked?i.linked.locked?e("p",{className:"meta",children:t("The server's configuration links this account.")}):n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>k(!0),children:t("Unlink")}),e(H,{open:w,title:t("Unlink {name}?",{name:i.label}),confirmLabel:t("Unlink"),tone:"danger",onClose:()=>k(!1),onConfirm:async()=>{d(await le.unlink(i.provider)),m(void 0)},children:e("p",{children:t("The app will no longer know this account is yours. You can link it again later.")})})]}):L?n("div",{className:"stack",children:[l?n(p,{children:[e("p",{children:l.instructions}),e("p",{className:"meta",children:t("Your code")}),e("code",{className:"link-code",children:l.code}),e("p",{className:"meta",children:t("The code works until {time}.",{time:new Date(l.expiresAt).toLocaleTimeString()})})]}):e("p",{className:"meta",children:t("A code is waiting to be used.")}),i.pending?.redeemedBy?n("p",{children:[e(s,{name:"check",size:14})," ",t("{name} used the code. Confirm that this is you.",{name:i.pending.redeemedBy.displayName})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>q(async()=>{d(await le.cancelLink(i.provider)),m(void 0)}),children:t("Cancel")}),e("button",{type:"button",disabled:f,onClick:()=>q(async()=>{let b=l?.request??i.pending?.request;if(!b)return;d(await le.confirmLink(i.provider,b)),m(void 0)}),children:t("I did it")})]})]}):n("div",{className:"stack",children:[g?e("p",{className:"meta",children:t("Link {name} first.",{name:i.blockedBy.map((b)=>V[b]??b).join(", ")})}):null,e("div",{className:"actions",children:e("button",{type:"button",disabled:f||g,onClick:()=>q(async()=>{m(await le.issueLink(i.provider)),d((await le.links()).links.find((b)=>b.provider===i.provider)??i)}),children:t("Link")})})]})]})}function O(){let i=Intl.DateTimeFormat().resolvedOptions().timeZone,[V,d]=r(),[l,m]=r({start:"22:00",end:"07:00"}),[f,N]=r(!1),[C,S]=r(!1),[w,k]=r(),[L,I]=r();a(()=>{le.pushPrefs().then((g)=>{if(d(g.quiet),g.quiet)m(g.quiet);N(!0)},()=>N(!0))},[]);let q=async(g)=>{S(!0),I(void 0),k(void 0);try{await g()}catch(b){I(u(b))}finally{S(!1)}};if(!f)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:t("In your quiet hours a normal notice waits in the bell instead of ringing your phone. An urgent one still rings.")}),n("div",{className:"quiet-row",children:[n("label",{children:[t("From")," ",e("input",{type:"time",value:l.start,onChange:(g)=>m({...l,start:g.target.value})})]}),n("label",{children:[t("To")," ",e("input",{type:"time",value:l.end,onChange:(g)=>m({...l,end:g.target.value})})]}),e("span",{className:"meta",children:i})]}),L?e(h,{message:L}):null,w?e("p",{className:"meta",children:w}):null,n("div",{className:"actions",children:[V?e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>q(async()=>{await le.setPushPrefs(null),d(void 0)}),children:t("Turn off quiet hours")}):null,e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>q(async()=>{await le.pushTest(),k(t("A test notification is on its way."))}),children:t("Send a test notification")}),e("button",{type:"button",disabled:C||l.start===l.end,onClick:()=>q(async()=>{let g=await le.setPushPrefs({...l,timeZone:i});d(g.quiet)}),children:t("Save")})]})]})}function z({profile:i,changed:V}){let[d,l]=r();if(i.sources.length===0)return null;let m=async(f)=>{l(void 0);try{V(await le.chooseSource(f))}catch(N){l(u(N))}};return n("section",{className:"card stack",children:[e("h2",{children:t("Shown as")}),e("p",{className:"meta",children:t("The name and picture of this account are what others see in the app.")}),n("fieldset",{className:"choice",children:[e("legend",{className:"visually-hidden",children:t("Shown as")}),n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===void 0,onChange:()=>m(null)}),t("Automatic")]}),i.sources.map((f)=>n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===f.provider,onChange:()=>m(f.provider)}),t(f.label)]},f.provider))]}),d?e(h,{message:d}):null]})}function W(){let[i,V]=r(),[d,l]=r(),[m,f]=r(),[N,C]=r();a(()=>{y.session().then(V,(w)=>C(u(w))),le.profile().then(l,()=>{return}),le.links().then(f,()=>{return})},[]);let S=X((w)=>{f((k)=>k?{links:k.links.map((L)=>L.provider===w.provider?w:L)}:k),le.profile().then(l,()=>{return})},[]);if(N)return e(h,{message:N});if(!i)return e(v,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Profile")})}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),d?e(R,{profile:d}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(gi,{auth:i.auth})]}),m&&m.links.length>0?n("section",{className:"stack",children:[e("h2",{children:t("Your accounts")}),e("ul",{className:"stack notices",children:m.links.map((w)=>e(E,{link:w,labels:Object.fromEntries(m.links.map((k)=>[k.provider,k.label])),changed:S},w.provider))})]}):null,d?e(z,{profile:d,changed:l}):null,i.push?e(O,{}):null]})}var F={owner:c("Owner"),admin:c("Admin"),member:c("Member")};export{W as ProfilePage};
@@ -1 +0,0 @@
1
- import{a,r,t,e,n,u,v,h,_,P,k,te}from"./chunk-index-v23m38p6.js";import{et}from"./chunk-index-c07p8k0x.js";import{I}from"./chunk-index-awx6nnta.js";function U(i){let{open:m,load:y}=i,{timeZone:N}=k(),[s,f]=r(),[c,p]=r(),[g,b]=r();a(()=>{if(!m)return;let o=!0;return f(void 0),p(void 0),b(void 0),y().then((d)=>o&&f(d),(d)=>o&&p(u(d))),()=>{o=!1}},[m]);let l=s?.find((o)=>o.id===g);return e(I,{open:m,title:i.title,size:"wide",onClose:i.onClose,children:n("div",{className:"stack history",children:[c?e(h,{message:c}):null,!s&&!c?e(v,{}):null,s?.length===0?e(_,{children:t("No changes have been kept yet.")}):null,s&&s.length>0?e("ul",{className:"menu",children:s.map((o)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":o.id===g,onClick:()=>b(o.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:o.by}),e("span",{className:"meta",children:te(o.at,N)})]}),o.revert?e(P,{children:t("Back to the file version")}):null]})},o.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(et,{label:t("This change"),before:l.previous,after:l.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>i.onUse(l.text),children:t("Use this text")})})]}):null]})})}export{U as HistorySheet};
@@ -1 +0,0 @@
1
- import{O,C,S,X,a,D,r,t,c,p,e,n,s,oe,u,m,v,h,_,P,k,te}from"./chunk-index-v23m38p6.js";import{Qe,et}from"./chunk-index-c07p8k0x.js";import{I}from"./chunk-index-awx6nnta.js";var G={"Shared prompt":c("Shared prompt"),"Guest prompt":c("Guest prompt"),"The base every agent's prompt starts with, the main assistant's included.":c("The base every agent's prompt starts with, the main assistant's included."),"Used instead of the shared prompt when the person speaking is not the owner.":c("Used instead of the shared prompt when the person speaking is not the owner.")},x=(l)=>t(G[l]??l);var M=S(()=>(O("wm9dsy6s"),import("./chunk-prompt-history-wm9dsy6s.js")).then((l)=>({default:l.HistorySheet}))),Z=S(()=>(O("521yqmta"),import("./chunk-confirm-521yqmta.js")).then((l)=>({default:l.Confirm})));function me(){let{timeZone:l}=k(),[N,i]=r(),[f,y]=r(),[g,w]=r(),R=X(()=>{Qe.prompts().then((d)=>i(d.documents),(d)=>y(u(d)))},[]);return a(R,[R]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the assistant and the agents start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),f?e(h,{message:f}):null,!N&&!f?e(v,{}):null,N?.length===0?e(_,{children:t("No prompts to edit.")}):null,N?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:x(d.label)}),d.differs?e(P,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(P,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:x(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:te(d.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>w(d.id),children:t("Edit")})})]},d.id)),g?e(q,{id:g,onClose:()=>{w(void 0),R()}}):null]})}function q({id:l,onClose:N}){let[i,f]=r(),[y,g]=r(""),[w,R]=r(),[d,E]=r(!1),[T,H]=r(!1),[V,B]=r(!1),[F,z]=r(!1),A=D();a(()=>{let o=!0;return Qe.prompt(l).then((b)=>{if(!o)return;f(b),g(b.text)},(b)=>o&&R(u(b))),()=>{o=!1}},[l]);let L=async()=>{if(!i)return;H(!0);try{let o=await Qe.savePrompt(l,{text:y,base:i.text});f(o),g(o.text),E(!1),m(t("Saved."))}catch(o){if(o instanceof oe&&o.status===409){let{current:b}=o.body;f(b),m(o.message,"danger")}else m(u(o),"danger")}finally{H(!1)}},U=i!==void 0&&y!==i.text;return n(I,{open:!0,title:i?x(i.label):t("Main prompts"),size:"full",onClose:N,children:[w?e(h,{message:w}):null,!i&&!w?e(v,{}):null,i?.broken?e(h,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(P,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(et,{label:t("Prompt"),before:i.text,after:y}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:T,onClick:()=>E(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:T,onClick:L,children:T?t("Saving…"):t("Save")})]})]}):n(p,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:A,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>B(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:A,className:"prompt-full",value:y,maxLength:i.maxChars,onChange:(o)=>g(o.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>z(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!U||!y.trim(),onClick:()=>E(!0),children:t("Review changes")})]})]}),V?e(C,{fallback:null,children:e(M,{open:V,title:t("History of {name}",{name:x(i.label)}),load:async()=>(await Qe.promptHistory(l)).versions.map((o)=>({id:o.id,text:o.text,previous:o.previous,by:o.by,at:o.at,revert:o.action==="revert"})),onUse:(o)=>{g(o),E(!1),B(!1)},onClose:()=>B(!1)})}):null,F?e(C,{fallback:null,children:e(Z,{open:F,title:t("Revert {name} to the file version?",{name:x(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let o=await Qe.revertPrompt(l,{base:i.text});f(o),g(o.text),E(!1),m(t("Back to the file version."))}catch(o){if(!(o instanceof oe&&o.status===409))throw o;let{current:b}=o.body;f(b),m(o.message,"danger")}},onClose:()=>z(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{me as PromptsPage};
@@ -1 +0,0 @@
1
- import{Mi}from"./chunk-index-kpscvg85.js";import"./chunk-index-r5vszgfs.js";import"./chunk-index-e5sd30xy.js";import"./chunk-index-awx6nnta.js";import"./chunk-index-z3k18atc.js";import"./chunk-index-nwqk447w.js";import"./chunk-index-459drsft.js";export{Mi as RoomConfirmHost};
@@ -1 +0,0 @@
1
- import{O,r,t,p,e,n,s,x,d,k,Fe,St,Me,ht}from"./chunk-index-v23m38p6.js";import{Te}from"./chunk-index-nwqk447w.js";import{nt}from"./chunk-index-rhtvcbsq.js";import{I}from"./chunk-index-awx6nnta.js";import{Ge}from"./chunk-index-bbsytycb.js";var g="room-menu-yolo",h="room-menu-long",N="room-menu-mute";function T(a){let[l,m]=r(!1),i=k().app?.modes!==!1,f=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),u=d((o)=>o.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},b=async(o)=>{m(!0),await St(a.room,{longRunning:o}),m(!1)};return e(I,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:x("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the agent that started this thread.")})]}),e(s,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon",children:e(s,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(nt,{id:N,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{m(!0),await Ge(a.room,!o),m(!1)},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:g,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(s,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(nt,{id:g,checked:c.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else m(!0),St(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:h,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(s,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(nt,{id:h,checked:c.longRunning,label:t("Long-running mode"),onChange:b,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Fe(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit agent")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(s,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),ht({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(s,{name:"chevron",size:16})]})}):null,a.readOnly||!f?null:n(p,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(O("zh7bezk7"),import("./chunk-layout-actions-zh7bezk7.js")).then((o)=>o.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(s,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:u?t("Unpin"):t("Pin")}),e("span",{className:"meta",children:t("Keep this room at the top of the list.")})]})]})}),e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Te({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(s,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(s,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),Me({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive agent")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{T as RoomMenu};
@@ -1 +0,0 @@
1
- import{t,e,s,d}from"./chunk-index-v23m38p6.js";import"./chunk-index-nwqk447w.js";import{En}from"./chunk-index-cq1e9xdz.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>En(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
@@ -1 +0,0 @@
1
- import{O,C,S,X,a,D,A,o,r,t,c,p,e,n,s,K,d,oe,y,u,m,v,h,_,Jt,Kr,Jr,Me,Fn,ns,de,yn}from"./chunk-index-v23m38p6.js";import{H}from"./chunk-index-e5sd30xy.js";import"./chunk-index-nwqk447w.js";import"./chunk-index-z3k18atc.js";import{be,dt,Mi}from"./chunk-index-kpscvg85.js";import{sn}from"./chunk-index-66nskrdj.js";import{Qe,et}from"./chunk-index-c07p8k0x.js";import"./chunk-index-r5vszgfs.js";import{nt}from"./chunk-index-rhtvcbsq.js";import{I}from"./chunk-index-awx6nnta.js";import{Ge}from"./chunk-index-bbsytycb.js";import"./chunk-index-459drsft.js";function ie(l){return n("fieldset",{className:"field",children:[e("legend",{children:l.label}),e("div",{className:"option-chips",children:l.options.map((f)=>e("button",{type:"button","aria-pressed":f.value===l.value,className:"option-chip",onClick:()=>l.onChange(f.value),children:f.label},f.value))})]})}var Fe=S(()=>(O("wm9dsy6s"),import("./chunk-prompt-history-wm9dsy6s.js")).then((l)=>({default:l.HistorySheet}))),Re=S(()=>(O("5dxcvd16"),import("./chunk-character-creator-5dxcvd16.js")).then((l)=>({default:l.CharacterCreator}))),Te=["default","off","minimal","low","medium","high","xhigh"],ve={default:c("Follow the assistant (automatic)"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},B="default",me=(l)=>t(ve[l]??l),he=(l)=>({displayName:l.displayName,prompt:l.prompt,model:l.model??B,thinking:l.thinking??B});function ge(l,f){return{...f.displayName!==l.displayName?{displayName:f.displayName}:{},...f.prompt!==l.prompt?{prompt:f.prompt}:{},...f.model!==(l.model??B)?{model:f.model}:{},...f.thinking!==(l.thinking??B)?{thinking:f.thinking}:{}}}function ye(){let l=Jr(),f=o(l);if(l)f.current=l;let i=f.current,w=l!==void 0;if(a(()=>{if(!w)return;let P=window.location.href,L=()=>{if(window.location.href!==P)Jt()};return window.addEventListener("popstate",L),window.addEventListener("hashchange",L),()=>{window.removeEventListener("popstate",L),window.removeEventListener("hashchange",L)}},[w]),!i)return null;return e(I,{open:l!==void 0,title:t("Edit agent"),size:"wide",onClose:Jt,children:e(xe,{name:i.name,opened:i.id},i.name)})}function xe({name:l,opened:f}){let[i,w]=r(),[P,L]=r([]),[k,z]=r(),[E,x]=r(),[g,T]=r(!1),[R,G]=r(!1),[ee,Q]=r(!1),[U,q]=r(!1),te=yn(i?.room??""),W=o(null),Y=i!==void 0,j=d((N)=>i?N.rooms[i.room]?.view?.muted===!0:!1,i?.room??""),[ae,V]=r(!1),ne=d((N)=>i?N.rooms[i.room]?.view?.coordinator===!0:!1,i?.room??""),J=D(),Z=D(),M=D();a(()=>{if(!Y||!Kr()?.look)return;W.current?.scrollIntoView({block:"start"}),W.current?.focus({preventScroll:!0})},[Y,f]);let b=o({});b.current={profile:i,draft:E},a(()=>{let N=!0;return Promise.all([y.agent(l),y.models()]).then(([re,De])=>{if(!N)return;let{profile:fe,draft:le}=b.current,Pe=fe&&le&&Object.keys(ge(fe,le)).length>0;w(re),L(De.models),x(Pe?le:he(re))},(re)=>N&&z(u(re))),()=>{N=!1}},[l,f]);let F=A(()=>i&&E?ge(i,E):{},[i,E]);if(k)return e(h,{message:k});if(!i||!E)return e(v,{});let pe=Object.keys(F).length>0,Ie=Array.from(new Set([B,...P,E.model])),ue=async()=>{T(!0);try{let N=await y.updateAgent(l,F);w(N),x(he(N)),G(!1),m(t("Saved."))}catch(N){m(u(N),"danger")}finally{T(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(de,{spec:i.character,name:i.name,size:72,state:te,label:i.displayName}),n("div",{children:[e("h3",{children:i.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:i.effective.model,thinking:me(i.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:M,children:[e("span",{className:"menu-icon",children:e(s,{name:j?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(nt,{id:M,checked:!j,label:t("Notifications"),busy:ae,onChange:async(N)=>{V(!0),await Ge(i.room,!N),V(!1)}})]})})}),R?e($e,{profile:i,draft:E,saving:g,onBack:()=>G(!1),onSave:ue}):n("form",{className:"stack form",onSubmit:(N)=>{if(N.preventDefault(),!pe)return;if(F.prompt!==void 0)G(!0);else ue()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:E.displayName,onChange:(N)=>x({...E,displayName:N.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:J,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>q(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>Q(!0),children:[e(Oe,{}),t("Full screen")]})]})]}),e("textarea",{id:J,rows:8,value:E.prompt,onChange:(N)=>x({...E,prompt:N.target.value})})]}),e(ie,{label:t("Model"),value:E.model,onChange:(N)=>x({...E,model:N}),options:Ie.map((N)=>({value:N,label:N===B?t("Follow the assistant"):N}))}),e(ie,{label:t("Thinking level"),value:E.thinking,onChange:(N)=>x({...E,thinking:N}),options:Te.map((N)=>({value:N,label:t(ve[N])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!pe||g,children:g?t("Saving…"):F.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(He,{name:l,opened:f}),n("section",{className:"card stack",ref:W,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(C,{fallback:e(v,{}),children:e(Re,{name:i.name,displayName:i.displayName,prompt:i.prompt,character:i.character,onSaved:(N)=>w(N)})})]}),ne?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived agent stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{Jt(),Me({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive {name}",{name:i.displayName})})})]}),U?e(C,{fallback:null,children:e(Fe,{open:U,title:t("History of the prompt"),load:async()=>(await Qe.agentPromptHistory(l)).versions.map((N)=>({id:N.id,text:N.text,previous:N.previous,by:N.by,at:N.at})),onUse:(N)=>{x({...E,prompt:N}),q(!1)},onClose:()=>q(!1)})}):null,e(I,{open:ee,title:t("Prompt"),size:"full",onClose:()=>Q(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:E.prompt,onChange:(N)=>x({...E,prompt:N.target.value})})})]})}function He({name:l,opened:f}){let[i,w]=r(),[P,L]=r(),[k,z]=r(),E=D();if(a(()=>{let g=!0;return be.skills(l).then((T)=>g&&w(T),(T)=>{if(g&&!(T instanceof oe&&T.status===404))z(u(T))}),()=>{g=!1}},[l,f]),k)return e(h,{message:k});if(!i)return null;let x=async(g,T)=>{L(g);try{w(await be.setSkills(l,T?{add:[g]}:{remove:[g]}))}catch(R){m(u(R),"danger")}finally{L(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),children:[e("h3",{children:t("Skills")}),e("p",{className:"meta",children:t("What the agent can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:i.skills.map((g,T)=>{let R=`${E}-${T}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:R,children:[n("span",{className:"menu-text",children:[e("strong",{children:g.name}),e("span",{className:"meta",children:g.missing?t("Its file cannot be read."):g.builtin?t("Built in: every agent carries it."):g.description??""})]}),e(nt,{id:R,checked:g.carried,label:g.name,busy:P===g.name,disabled:g.builtin,onChange:(G)=>x(g.name,G)})]})},g.name)})})]})}var Oe=()=>e("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e("path",{d:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"})});function $e(l){let{profile:f,draft:i}=l,w=o(null);a(()=>w.current?.focus(),[]);let P=[];if(i.displayName!==f.displayName)P.push({label:t("Name"),before:f.displayName,after:i.displayName});let L=(k)=>k===B?t("Follow the assistant"):k;if(i.model!==(f.model??B))P.push({label:t("Model"),before:L(f.model??B),after:L(i.model)});if(i.thinking!==(f.thinking??B))P.push({label:t("Thinking level"),before:me(f.thinking??B),after:me(i.thinking)});return n("section",{ref:w,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),P.length?e("ul",{className:"review-fields",children:P.map((k)=>n("li",{children:[e("strong",{children:k.label}),e("span",{className:"review-before",children:k.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:k.after})]},k.label))}):null,e(et,{label:t("Prompt"),before:f.prompt,after:i.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l.saving,onClick:l.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:l.saving,onClick:l.onSave,children:l.saving?t("Saving…"):t("Save")})]})]})}function Ne(){let[l,f]=r(),[i,w]=r(),[P,L]=r(),[k,z]=r(),E=X(async()=>{try{f((await be.archive()).entries),w(void 0)}catch(g){w(u(g))}},[]);a(()=>{E()},[E]);let x=async(g)=>{L(g.name);try{if(g.kind==="agent")await be.restoreAgent(g.name);else await be.restoreGroup(g.name);await dt(),m(t("Restored {name}.",{name:g.displayName})),await E()}catch(T){m(u(T),"danger")}finally{L(void 0)}};if(i&&!l)return e(h,{message:i});if(!l)return e(v,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived agents and groups no longer answer. Their history is kept until you delete them.")}),l.length===0?e(_,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:l.map((g)=>n("li",{className:"menu-item",children:[e("span",{className:"menu-icon",children:e(s,{name:g.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:g.displayName}),n("span",{className:"meta",children:[g.kind==="agent"?t("Agent"):t("Group")," ·"," ",g.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:P===g.name,onClick:()=>x(g),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:P===g.name,onClick:()=>z(g),children:t("Delete")})]},`${g.kind}:${g.name}`))}),e(H,{open:k!==void 0,title:t("Delete {name}?",{name:k?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>z(void 0),onConfirm:async()=>{if(!k)return;if(k.kind==="agent")await be.deleteAgent(k.name);else await be.deleteGroup(k.name);await dt(),m(t("Deleted {name}.",{name:k.displayName})),await E()},children:e("p",{children:t("{name} and its messages in this app are deleted for good, and the name can be used again. This cannot be undone.",{name:k?.displayName??""})})})]})}var we=/^[a-z0-9-]{1,32}$/,ke=2,Ce=6,se="\x00";function Ve(){let l=d((f)=>f.order.flatMap((i)=>{let w=f.rooms[i]?.view;return w?.kind==="agent"?[`${w.name}${se}${w.displayName}`]:[]}).join(`${se}${se}`));return A(()=>l===""?[]:l.split(`${se}${se}`).map((f)=>{let[i="",w=""]=f.split(se);return{name:i,displayName:w}}),[l])}function Se(l){let f=Ve(),[i,w]=r(),[P,L]=r(),[k,z]=r(""),[E,x]=r(""),[g,T]=r(!1),[R,G]=r([]),[ee,Q]=r(""),[U,q]=r(!1),[te,W]=r(l.name===void 0),Y=D(),j=D();a(()=>{let M=l.name;if(M===void 0)return;let b=!0;return be.group(M).then((F)=>{if(!b)return;w(F),z(F.displayName),G(F.members),Q(F.host),W(!0)},(F)=>b&&L(u(F))),()=>{b=!1}},[l.name]);let ae=(M)=>f.find((b)=>b.name===M)?.displayName??M,V=R.includes(ee)?ee:R[0]??"",ne=i===void 0?!0:k.trim()!==i.displayName||R.join(",")!==i.members.join(",")||V!==i.host,J=k.trim()!==""&&R.length>=ke&&R.length<=Ce&&(i!==void 0||we.test(E));if(P&&!te)return e(h,{message:P});if(!te)return e(v,{});let Z=async()=>{q(!0),L(void 0);try{if(i){await be.updateGroup(i.name,{...k.trim()!==i.displayName?{displayName:k.trim()}:{},...R.join(",")!==i.members.join(",")?{members:R}:{},...V!==i.host?{host:V}:{}}),await dt(),m(t("Saved.")),l.onDone();return}let M=await be.createGroup({name:E,displayName:k.trim(),members:R,host:V});await dt(),m(t("Made {name}.",{name:M.displayName})),l.onDone(),K("room",M.room)}catch(M){L(u(M))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(M)=>{if(M.preventDefault(),J&&ne&&!U)Z()},children:[n("label",{htmlFor:Y,children:[t("Name"),e("input",{id:Y,value:k,autoComplete:"off",onChange:(M)=>{if(z(M.target.value),!i&&!g)x(M.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),i?null:n("label",{htmlFor:j,children:[t("Permanent name"),e("input",{id:j,value:E,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":E!==""&&!we.test(E),onChange:(M)=>{T(!0),x(M.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 6 agents. They take turns in the order picked.")}),e("ul",{className:"menu",children:f.map((M)=>{let b=R.includes(M.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:b,disabled:!b&&R.length>=Ce,onChange:()=>G(b?R.filter((F)=>F!==M.name):[...R,M.name])}),e("span",{className:"menu-text",children:e("strong",{children:M.displayName})})]})},M.name)})})]}),R.length>=ke?e(ie,{label:t("Host"),value:V,onChange:Q,options:R.map((M)=>({value:M,label:ae(M)}))}):null,P?e(h,{message:P}):null,n("div",{className:"actions",children:[i?e("button",{type:"button",className:"danger",onClick:()=>{l.onDone(),Me({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!J||!ne||U,children:U?t("Saving…"):i?t("Save"):t("Make group")})]})]})}var ze=S(()=>(O("5dxcvd16"),import("./chunk-character-creator-5dxcvd16.js")).then((l)=>({default:l.CharacterCreator}))),Ae=/^[a-z0-9-]{1,32}$/,ce="default";function Be(l){let f=[];for(let i of l){let w=i.indexOf("/"),P=w>0?i.slice(0,w):"",L=f.find((k)=>k.provider===P&&P!=="");if(L)L.models.push(i);else f.push({provider:P,models:[i]})}return f}var Ke=(l)=>l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Ee({onDone:l}){let[f,i]=r(""),[w,P]=r(""),[L,k]=r(!1),[z,E]=r(""),[x,g]=r(ce),[T,R]=r(""),[G,ee]=r(),[Q,U]=r(!1),[q,te]=r([]),[W,Y]=r(),[j,ae]=r(!1),V=[D(),D(),D(),D(),D()];a(()=>{let b=!0;return y.models().then((F)=>b&&te(F.models),()=>{return}),()=>{b=!1}},[]);let ne=A(()=>sn({name:w,displayName:f,prompt:z}),[w,f,z]),J=G?.spec??ne,Z=Ae.test(w)&&f.trim()!==""&&z.trim()!=="";if(Q)return e(C,{fallback:e(v,{}),children:e(ze,{name:w||"new",displayName:f,prompt:z,character:J,onPick:(b,F)=>{ee({input:b,spec:F}),U(!1)},onCancel:()=>U(!1)})});let M=async()=>{ae(!0),Y(void 0);try{let b={name:w,displayName:f.trim(),prompt:z,...x!==ce?{model:x}:{},...T.trim()?{task:T.trim()}:{},...G?{character:G.input}:{}},F=await be.createAgent(b);await dt(),m(t("Made {name}.",{name:F.displayName})),l(),K("room",F.room)}catch(b){Y(b instanceof oe&&b.field?`${b.field}: ${u(b)}`:u(b))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),Z&&!j)M()},children:[n("label",{htmlFor:V[0],children:[t("Name"),e("input",{id:V[0],value:f,autoComplete:"off",onChange:(b)=>{if(i(b.target.value),!L)P(Ke(b.target.value))}})]}),n("label",{htmlFor:V[1],children:[t("Permanent name"),e("input",{id:V[1],value:w,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":w!==""&&!Ae.test(w),onChange:(b)=>{k(!0),P(b.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:V[2],children:[t("Prompt"),e("textarea",{id:V[2],rows:6,value:z,onChange:(b)=>E(b.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:V[4],children:[t("Model"),n("select",{id:V[4],value:x,onChange:(b)=>g(b.target.value),children:[e("option",{value:ce,children:t("Follow the assistant")}),Be(q).map((b)=>b.provider===""?b.models.map((F)=>e("option",{value:F,children:F},F)):e("optgroup",{label:b.provider,children:b.models.map((F)=>e("option",{value:F,children:F},F))},b.provider))]})]}),n("label",{htmlFor:V[3],children:[t("Opening task"),e("textarea",{id:V[3],rows:3,value:T,onChange:(b)=>R(b.target.value)}),e("span",{className:"meta",children:t("Optional. The agent starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(de,{spec:J,name:w||"new",size:72,label:f}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:G?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>U(!0),children:t("Choose a look")})]})]}),W?e(h,{message:W}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||j,children:j?t("Making…"):t("Make agent")})})]})}var Ue=(l)=>l.kind==="new-agent"?t("New agent"):l.kind==="archive"?t("Archived"):l.name===void 0?t("New group"):t("Edit group");function Le(){let l=ns(),f=o(l);if(l)f.current=l;let i=f.current,w=l!==void 0;if(a(()=>{if(!w)return;let P=window.location.href,L=()=>{if(window.location.href!==P)Fn()};return window.addEventListener("popstate",L),window.addEventListener("hashchange",L),()=>{window.removeEventListener("popstate",L),window.removeEventListener("hashchange",L)}},[w]),!i)return null;return e(I,{open:l!==void 0,title:Ue(i),size:"wide",onClose:Fn,children:e("div",{className:"stack agent-sheet",children:i.kind==="new-agent"?e(Ee,{onDone:Fn}):i.kind==="archive"?e(Ne,{}):e(Se,{...i.name===void 0?{}:{name:i.name},onDone:Fn})},i.id)})}function ma(){return n(p,{children:[e(Mi,{}),e(ye,{}),e(Le,{})]})}export{ma as SheetHosts};
@@ -1,8 +0,0 @@
1
- import{O,C,S,a,D,r,t,p,e,n,s,oe,u,m,v,h}from"./chunk-index-v23m38p6.js";import{Qe,et}from"./chunk-index-c07p8k0x.js";import{I}from"./chunk-index-awx6nnta.js";var M=S(()=>(O("wm9dsy6s"),import("./chunk-prompt-history-wm9dsy6s.js")).then((c)=>({default:c.HistorySheet}))),B=`---
2
- name: my-skill
3
- description: "Use when "
4
- ---
5
-
6
- # My skill
7
-
8
- `;function _(c){let{name:d}=c,[l,k]=r(),[f,b]=r(d?"":B),[g,R]=r(),[z,y]=r(!1),[w,x]=r(!1),[A,H]=r(!1),[T,N]=r(!1),L=D();a(()=>{if(!d)return;let i=!0;return Qe.skillDocument(d).then((o)=>{if(!i)return;k(o),b(o.text)},(o)=>i&&R(u(o))),()=>{i=!1}},[d]);let E=l?.text??"",U=f!==E,F=d!==void 0&&!l&&!g,V=async()=>{x(!0);try{if(l){let i=await Qe.saveSkillDocument(l.name,{text:f,baseHash:l.hash});k(i),b(i.text),y(!1),H(!1),m(t("Saved.")),c.onSaved()}else await Qe.createSkillDocument({text:f}),m(t("Skill created.")),c.onSaved(),c.onClose()}catch(i){if(i instanceof oe&&i.status===409){let{current:o}=i.body;k(o),H(!0)}else m(u(i),"danger")}finally{x(!1)}};return n(I,{open:!0,title:d??t("New skill"),size:"full",onClose:c.onClose,children:[g?e(h,{message:g}):null,F?e(v,{}):null,l&&!l.writable?e(h,{message:t("This skill cannot be edited here.")}):null,!F&&!g&&(!l||l.writable)?n("div",{className:"stack",children:[z?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),A?e(h,{message:t("This skill changed while you were editing it. The changes below are against the version there now; save again to replace it, or go back to edit.")}):null,e(et,{label:"SKILL.md",before:E,after:f}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:w,onClick:()=>y(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:w,onClick:V,children:w?t("Saving…"):l?t("Save"):t("Create skill")})]})]}):n(p,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:L,children:"SKILL.md"}),l?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>N(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:L,className:"prompt-full",spellCheck:!1,value:f,onChange:(i)=>b(i.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!U||!f.trim(),onClick:()=>y(!0),children:t("Review changes")})})]}),T&&l?e(C,{fallback:null,children:e(M,{open:T,title:t("History of {name}",{name:l.name}),load:async()=>{let{versions:i}=await Qe.skillHistory(l.name);return i.map((o,K)=>({id:o.id,text:o.text,previous:i[K+1]?.text??"",by:o.by,at:o.at}))},onUse:(i)=>{b(i),y(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
@@ -1 +0,0 @@
1
- import{O,zi,C,S,a,r,t,p,e,n,s,y,u,v,h,_,P,Nt,vt}from"./chunk-index-v23m38p6.js";import{Oe}from"./chunk-index-xgkd15n3.js";import{ue}from"./chunk-index-r5vszgfs.js";import"./chunk-index-awx6nnta.js";function b({source:i}){return e("div",{className:"prose document",children:e(Nt,{remarkPlugins:[vt],components:{a:({href:o,children:d})=>o&&/^https?:\/\//.test(o)?e("a",{href:o,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:o})=>e("span",{children:o}),pre:({children:o})=>e("div",{className:"code-block",children:e("pre",{children:o})}),table:({children:o})=>e("div",{className:"table-wrap",children:e("table",{children:o})})},children:i})})}var N=S(()=>(O("65n2hsq4"),import("./chunk-skill-editor-65n2hsq4.js")).then((i)=>({default:i.SkillEditor})));function q(){let[i,o]=r(0),{data:d,error:l}=Oe(()=>y.skills(),`skills:${i}`),[k,w]=r(),[m,g]=r();a(()=>{y.session().then(w,()=>{return})},[]);let f=k?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),f?n("button",{type:"button",className:"secondary",onClick:()=>g({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:f?t("Registered skills and their carriers. A skill an agent wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask an agent on Discord to edit their contents.")}),l?e(h,{message:l}):null,!d&&!l?e(v,{}):null,d?.length===0?e(_,{children:t("No skills.")}):null,d?.map((c)=>e(D,{skill:c,onEdit:f&&c.source.kind==="written"?()=>g({name:c.name}):void 0},`${c.name}:${i}`)),m?e(C,{fallback:null,children:e(N,{name:m.name,onSaved:()=>o((c)=>c+1),onClose:()=>g(void 0)},m.name??"")}):null]})}function E(i){switch(i.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:i.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${i.repo}:${i.path}`});default:return}}function D({skill:i,onEdit:o}){let[d,l]=r(!1),[k,w]=r(),[m,g]=r(),f=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Assistant-written"):i.source.kind==="package"?i.source.package:`${i.source.repo}:${i.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(P,{children:f}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(p,{children:[o?e("button",{type:"button",className:"secondary",onClick:o,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!k)g(void 0),y.skill(i.name).then(w).catch((c)=>g(u(c)))},children:"SKILL.md"})]})]}),e("p",{children:i.missing??i.description}),i.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(s,{name:"lock",size:14}),e("span",{children:E(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All agents"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(ue,{open:d,title:i.name,size:"wide",onClose:()=>l(!1),children:m?e(h,{message:m}):!k?e(v,{}):e(V,{title:i.name,detail:k})})]})}function V({title:i,detail:o}){let d=o.metadata.filter((l)=>!(l.key==="name"&&l.value===i));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((l)=>n(zi,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(b,{source:o.body})]})}export{q as SkillsPage};
@@ -1 +0,0 @@
1
- import{A,o,r,t,ve,p,e,n,s,x,K,st,d,Yt,Lt,en,ze,rn,pi}from"./chunk-index-v23m38p6.js";import{Cn,An,$n,Rt}from"./chunk-index-pcfhpm8v.js";import{Nn}from"./chunk-index-014rjv9k.js";import{ls,_t}from"./chunk-index-459drsft.js";Cn();function v(){let l=d((c)=>JSON.stringify(ls(c,(a)=>_t(c,a),(a)=>st(c,a)>0,!0).map((a)=>({id:a.id,...a.title===void 0?{}:{title:a.title},entries:a.keys.map((u)=>({key:u,name:c.rooms[u]?.view?.displayName??u,waiting:st(c,u)>0}))})))),m=$n(),y=o(l);if(!m)y.current=l;let f=y.current;return A(()=>JSON.parse(f),[f])}function b(l){let{key:m,name:y}=l.entry,f=d((i)=>i.rooms[m]),c=d((i)=>st(i,m)),a=f?.view,u=ze(a?.character),g=Rt(()=>Lt(m,l.onLeave),l.liftable&&!a?.home?An(m):void 0);if(!a)return null;return e("li",{...l.liftable&&!a.home?{"data-drop-item":"","data-key":m}:{},children:n("a",{className:"switcher-row",...g,href:x("room",m),"aria-current":m===l.current?"page":void 0,style:u,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(m)},children:[n("span",{className:"switcher-picture",children:[e(rn,{view:a,size:40}),c?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:y}),f?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(pi,{room:m}),c?e("span",{className:"badge badge-warn",children:ve(c,"{count} card waiting","{count} cards waiting")}):null,a.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[m,y]=r(""),f=v(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>Nn(m,h.name)!==void 0)})).filter((i)=>i.entries.length>0||m===""),a=(i)=>l.close(i===l.current?void 0:()=>K("room",i)),u=f.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),g=c.filter((i)=>i.entries.length>0).length>1;return n(p,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:m,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>y(i.target.value),onKeyDown:(i)=>{let h=c.flatMap((w)=>w.entries)[0];if(i.key==="Enter"&&h&&!Yt(i.nativeEvent))a(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>en(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.map((i)=>{let h=i.id==="waiting",w=i.id==="pinned"?"pinned":i.id==="rest"?"rest":h||i.id==="home"?void 0:"folder";return n("section",{"aria-label":h?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...w?{"data-drop-zone":w,"data-zone-id":i.id,...w==="folder"?{"data-folder":i.id}:{}}:{},children:[h?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):g||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(b,{entry:N,current:l.current,onPick:a,onLeave:l.close,liftable:!h&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
@@ -1 +0,0 @@
1
- import{O,C,S,a,r,t,e,n,rt,K,d,ge,is}from"./chunk-index-v23m38p6.js";import{si,zn,$t}from"./chunk-index-mjqqver5.js";import{Br,Xn}from"./chunk-index-d1prgfbp.js";import"./chunk-index-awx6nnta.js";var A=S(()=>(O("vy1qhdks"),import("./chunk-table-seats-vy1qhdks.js")).then((s)=>({default:s.TableSeatsSheet}))),E=300;function H(s){let[c,u]=r(!1);return a(()=>{if(!s){u(!1);return}if(rt()){u(!0);return}let i=setTimeout(()=>u(!0),E);return()=>clearTimeout(i)},[s]),c}function v(s,c,u,i){is(s).then((f)=>{if(f)ge({...f,at:c,via:u,source:i})},()=>{return})}function _({focus:s}){let[c,u]=r(),i=si(void 0),f=zn(),[k,g]=r(!1),[T,M]=r(!1),h=d((o)=>o.listed),l=Br(s,i),p=i.find((o)=>o.name===l);a(()=>{if(s&&h&&l===null)K("table",void 0,{replace:!0})},[s,h,l]);let R=H(l!==null),b=(o)=>{if(o===l)return;K("table",o??void 0,{replace:l!==null})},y=()=>{M(!0),g(!0)},N=i.length===0&&f.length>0;return n("div",{className:"table-page","data-focused":l!==null||void 0,children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[c?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>b(null),children:t("Reset view")}):null,f.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:y,children:t("Who's at the table")}):null]})]}),n("div",{className:"table-frame","data-focused":l!==null||void 0,children:[N?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("Every agent has left the table. Choose who sits down.")}),e("button",{type:"button",onClick:y,children:t("Who's at the table")})]}):e($t,{onHandle:u,focus:l,onFocus:b,onSeat:b,onSeatMenu:(o)=>{let m=i.find((w)=>w.name===o.id);if(m)v(m.key,o.at,o.via,o.source)}}),p?e(Xn,{roomKey:p.key,open:R,onBack:()=>b(null),onMenu:(o)=>{let m=o.getBoundingClientRect();v(p.key,{x:m.left,y:m.bottom},"key",o)}},p.key):null]}),T?e(C,{fallback:null,children:e(A,{open:k,onClose:()=>g(!1)})}):null]})}export{_ as TablePage};
@@ -1 +0,0 @@
1
- import{D,r,t,e,n,rn}from"./chunk-index-v23m38p6.js";import{zn}from"./chunk-index-mjqqver5.js";import{nt}from"./chunk-index-rhtvcbsq.js";import{I}from"./chunk-index-awx6nnta.js";import{Ge}from"./chunk-index-bbsytycb.js";function u({view:s}){let o=D(),[a,m]=r(!1),l=s.muted===!0;return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",htmlFor:o,children:[e(rn,{view:s,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:s.displayName}),l?e("span",{className:"meta",children:t("Off the table")}):null]}),e(nt,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await Ge(s.key,!i),m(!1)}})]})})}function g(s){let o=zn();return e(I,{open:s.open,title:t("Who's at the table"),onClose:s.onClose,children:n("div",{className:"stack table-seats",children:[e("p",{className:"meta",children:t("An agent who leaves the table is muted: its room stops pushing to you. A card that waits for you is always pushed.")}),e("ul",{className:"menu",children:o.map((a)=>e(u,{view:a},a.key))})]})})}export{g as TableSeatsSheet};
@@ -1 +0,0 @@
1
- import{fn,Ci,Ai,gt,qt,Bt,Ln}from"./chunk-index-2d0kg096.js";import{At}from"./chunk-index-k2qq1gdj.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[v,R]of Object.entries(i))y.setAttribute(v,String(R));return p?.appendChild(y),y},ce=(d)=>{let i=/<svg[^>]*\swidth=/.test(d)?d:d.replace("<svg",'<svg width="256" height="256"');return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`},de=0;function fe(d,i){let p=i||d<=6?1:2;return{rows:p,perRow:Math.max(1,Math.ceil(d/p))}}function ye(d,i){let p=`t2d${++de}`,y=window.matchMedia("(prefers-reduced-motion: reduce)"),v=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??At,{theme:O,scheme:I}=i,S=[],_=new Map,L=new Map,E=i.focus??null,M=document.createElement("div");M.className="t2d";let f=t("svg",{role:"group","aria-label":R.table});if(M.appendChild(f),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(M);function X(e,s,c){let o=Math.max(1.6,c*0.022),g=o+Math.max(1.2,c*0.014),a=t("filter",{id:`${p}-rim`,x:"-15%",y:"-15%",width:"130%",height:"130%"},e);t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:g,result:"far"},a),t("feFlood",{"flood-color":s.ink,result:"ink"},a),t("feComposite",{in:"ink",in2:"far",operator:"in",result:"line"},a),t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:o,result:"near"},a),t("feFlood",{"flood-color":s.paper,result:"paper"},a),t("feComposite",{in:"paper",in2:"near",operator:"in",result:"rim"},a);let l=t("feMerge",{},a);for(let w of["line","rim","SourceGraphic"])t("feMergeNode",{in:w},l)}function x(){let e=fn(O,I);M.classList.toggle("reduced",v),M.classList.toggle("focus",E!==null),M.classList.toggle("dim",S.some((r)=>L.get(r.id)==="speaking"));let s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);f.setAttribute("viewBox",`0 0 ${c} ${o}`),f.replaceChildren();let g=Math.max(S.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},f);let w=t("defs",{},f),T=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:T,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},f),!s)t("ellipse",{cx:T,cy:N,rx:c*0.3,ry:o*0.2,fill:"none",stroke:e.css.ring,"stroke-width":3,opacity:e.night?0.9:0.7},f);let F=c/l,q=s?o*0.95:o/(a+0.6),m=Math.max(46,Math.min(F*0.94,132,q*1.05)),h=m*0.72,n=m*1.05;X(w,e,n),S.forEach((r,b)=>{let k=t("radialGradient",{id:`${p}-h${b}`},w);t("stop",{offset:0,"stop-color":r.color,"stop-opacity":0.95},k),t("stop",{offset:1,"stop-color":r.color,"stop-opacity":0},k)});let te=(r)=>{if(s)return o*0.92;return a===1?o*0.62:o*(0.46+r*0.3)};if(S.forEach((r,b)=>{let k=Math.floor(b/l),oe=Math.min(l,g-k*l),ne=b-k*l,re=c/oe*(ne+0.5),ie=te(k),H=L.get(r.id)??"idle",u=t("g",{class:"seat","data-seat":r.id,"data-state":H,...E===r.id?{"data-focus":""}:{},transform:`translate(${re.toFixed(1)} ${ie.toFixed(1)})`,tabindex:i.listBelow?-1:0,role:"button","aria-label":R.seat(r.name,H),color:e.css.text,...i.listBelow?{"aria-hidden":"true"}:{}},f);t("ellipse",{cx:0,cy:3,rx:m*0.55,ry:m*0.1,fill:"#000",opacity:0.35},u),t("ellipse",{class:"halo",cx:0,cy:-h-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},u),t("polygon",{class:"beam",points:`${-n*0.12},${-n*2.1} ${n*0.12},${-n*2.1} ${n*0.5},0 ${-n*0.5},0`,fill:r.color,opacity:0.2},u);let B=t("g",{class:"lift"},u),Y=_.get(r.id);if(Y)t("image",{href:ce(Y),x:-n/2,y:-h-n*0.78,width:n,height:n*0.88,filter:`url(#${p}-rim)`,...r.dim?{opacity:0.55}:{}},B);else{t("circle",{cx:0,cy:-h-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);let A=t("text",{x:0,y:-h-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":gt},B);A.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let Z=h*0.22;t("path",{d:`M ${-m*0.5} ${-h} L ${m*0.5} ${-h} L ${m*0.42} 0 L ${-m*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},u),t("rect",{x:-m*0.54,y:-h-Z*0.2,width:m*1.08,height:Z,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},u);let C=Math.max(11,Math.min(15,m*0.14)),K=Math.min(Math.max(m*0.9,C*5.5+14),Math.max(m*0.9,r.name.length*C*0.62+18),F*0.98),se=C+8;t("rect",{class:"plate",x:-K/2,y:-h*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},u);let ae=t("text",{x:0,y:-h*0.78+C+1.5,"text-anchor":"middle","font-size":C,"font-weight":700,"font-family":gt,fill:e.plateInk},u);ae.textContent=Ai(r.name,(K-8)/C);let J=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-h-n*0.78})`},u)),V=H==="done",D=H==="error",P=e.gold;if(V)P=Ci.done;else if(D)P=Ci.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},J);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":gt,fill:V||D?"#fff":e.ink},J);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let Q=t("g",{class:"orbit"},u);t("circle",{cx:n*0.4,cy:-h-n*0.5,r:n*0.05,fill:r.color},Q),t("circle",{cx:-n*0.4,cy:-h-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},Q),u.addEventListener("click",()=>i.onSeatClick({id:r.id,name:r.name})),u.addEventListener("keydown",(A)=>{if(A.key==="Enter"||A.key===" ")A.preventDefault(),i.onSeatClick({id:r.id,name:r.name})})}),!s){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:T-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},f);let k=t("text",{x:T,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":gt,fill:e.gold},f);k.textContent=Ai(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=fn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.add(l)};for(let g of e.joining){let a=[...f.querySelectorAll("g.seat[data-seat]")].find((l)=>l.getAttribute("data-seat")===g);if(!a)continue;a.classList.add("seat-in"),a.prepend(t("ellipse",{class:"seat-ring",rx:44,ry:12,cy:4,stroke:c.css.ring})),o(()=>{a.classList.remove("seat-in"),a.querySelector(".seat-ring")?.remove()},Bt)}for(let g of e.leaving){let a=s.get(g);if(!a)continue;let l=a.cloneNode(!0);l.classList.add("seat-out");for(let w of["data-seat","tabindex","role","aria-label"])l.removeAttribute(w);l.setAttribute("aria-hidden","true");for(let[w,[T,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:T,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}f.appendChild(l),o(()=>l.remove(),qt)}},W=new ResizeObserver(x);W.observe(d);let j=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",j);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=S.map((o)=>o.id),c=new Map([...f.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));S=e;for(let o of e)if(L.set(o.id,o.state??"idle"),o.avatarSvg)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(Ln(s,e.map((o)=>o.id),v),c)},setState(e,s){if(L.get(e)===s)return;L.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){v=e,x()},resetCamera(){E=null,x(),i.onFocus?.(null)},focus(e){if(e===E)return;E=e,x()},focused:()=>E,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:v,loop:"idle",seats:S.length,renders:0}},dispose(){for(let e of G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",j),M.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};