pi-roundtable-web 0.28.0 → 0.29.1

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 (236) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +4 -4
  3. package/dist/chunk-account-66e6ezdq.js +1 -0
  4. package/dist/{chunk-action-menu-qpp9bdxh.js → chunk-action-menu-ap5xn7bf.js} +1 -1
  5. package/dist/chunk-agent-sapt5qhn.js +1 -0
  6. package/dist/chunk-arranged-rooms-n6bk696f.js +1 -0
  7. package/dist/chunk-attachments-p5v9gqyt.js +102 -0
  8. package/dist/chunk-bulk-actions-aze4ewc4.js +1 -0
  9. package/dist/chunk-character-creator-m7tw20ef.js +225 -0
  10. package/dist/{chunk-codeeditor-jgj32247.js → chunk-codeeditor-yy6pq8mv.js} +2 -2
  11. package/dist/chunk-confirm-0cajsfhk.js +1 -0
  12. package/dist/chunk-connectors-tw0tbm21.js +37 -0
  13. package/dist/chunk-conversations-wkm23m5r.js +1 -0
  14. package/dist/chunk-council-sheet-mz7s23nq.js +2 -0
  15. package/dist/chunk-council-view-zgvzxtgn.js +1 -0
  16. package/dist/{chunk-drag-04qfef58.js → chunk-drag-d1bpy8w6.js} +1 -1
  17. package/dist/{chunk-entry-mws704mc.js → chunk-entry-7zr5b1fp.js} +1 -1
  18. package/dist/chunk-folder-list-bs4eh3g9.js +1 -0
  19. package/dist/chunk-folds-eez1q41c.js +1 -0
  20. package/dist/{chunk-gate-vxetvn8t.js → chunk-gate-dt91egcd.js} +1 -1
  21. package/dist/chunk-host-icons-nfe2t8tk.js +1 -0
  22. package/dist/chunk-host-picture-4rtswxwa.js +1 -0
  23. package/dist/chunk-host-state-1vxzmmq6.js +1 -0
  24. package/dist/chunk-host-ui-x38bf0et.js +1 -0
  25. package/dist/{chunk-index-zj0gjcvr.js → chunk-index-0h99xcs3.js} +2 -2
  26. package/dist/{chunk-index-e2gy763y.js → chunk-index-1kb8tv4v.js} +2 -2
  27. package/dist/chunk-index-24cggw6k.js +50 -0
  28. package/dist/chunk-index-2g8xtwqg.js +2 -0
  29. package/dist/chunk-index-3n38xe7m.js +2 -0
  30. package/dist/{chunk-index-n0cmnwd2.js → chunk-index-3tksdmx7.js} +2 -2
  31. package/dist/{chunk-index-2822z600.js → chunk-index-4a1tdadd.js} +3 -3
  32. package/dist/{chunk-index-2syyyjnq.js → chunk-index-53fwc7sc.js} +2 -2
  33. package/dist/chunk-index-55ps4x5n.js +2 -0
  34. package/dist/{chunk-index-q5fyrtx4.js → chunk-index-5j1v2q7w.js} +1 -1
  35. package/dist/chunk-index-5w6tb7p0.js +2 -0
  36. package/dist/chunk-index-6btdp13p.js +2 -0
  37. package/dist/chunk-index-6m7dwsmv.js +1 -0
  38. package/dist/{chunk-index-20xgx0k2.js → chunk-index-6rdywten.js} +2 -2
  39. package/dist/{chunk-index-3gfbhmpb.js → chunk-index-6s2pqwna.js} +2 -2
  40. package/dist/{chunk-index-fepsbhr6.js → chunk-index-7mrkq793.js} +2 -2
  41. package/dist/chunk-index-7xcbpeqz.js +2 -0
  42. package/dist/chunk-index-88wh5eyj.js +2 -0
  43. package/dist/{chunk-index-6cg8xp1c.js → chunk-index-8pbwr3rs.js} +1 -1
  44. package/dist/{chunk-index-jc3r4qam.js → chunk-index-8wpvj7k5.js} +2 -2
  45. package/dist/chunk-index-97dcp1vh.js +1 -0
  46. package/dist/chunk-index-a7e6rhxy.js +2 -0
  47. package/dist/{chunk-index-2tr41qht.js → chunk-index-bxf8eq1s.js} +2 -2
  48. package/dist/chunk-index-c8gm1crh.js +120 -0
  49. package/dist/{chunk-index-2y8r4s4f.js → chunk-index-ce7hsda9.js} +2 -2
  50. package/dist/chunk-index-cfesmk1f.js +2 -0
  51. package/dist/{chunk-index-m81362sc.js → chunk-index-cmzvq3nf.js} +1 -1
  52. package/dist/{chunk-index-7qd604rq.js → chunk-index-d4mx2vvf.js} +1 -1
  53. package/dist/chunk-index-d74tpnkd.js +2 -0
  54. package/dist/chunk-index-d941ae7c.js +2 -0
  55. package/dist/{chunk-index-e35v554x.js → chunk-index-dr0jr7d3.js} +3 -3
  56. package/dist/chunk-index-en728705.js +2 -0
  57. package/dist/chunk-index-fb3kzyyp.js +2 -0
  58. package/dist/{chunk-index-3yy10a5h.js → chunk-index-ffnd0jcj.js} +2 -2
  59. package/dist/chunk-index-fn6305vn.js +3 -0
  60. package/dist/{chunk-index-zcfr8jdv.js → chunk-index-gdh7wsd5.js} +12 -12
  61. package/dist/{chunk-index-2hvn2kte.js → chunk-index-m76gdwnk.js} +2 -2
  62. package/dist/chunk-index-mr391t49.js +2 -0
  63. package/dist/chunk-index-n3khm9fq.js +2 -0
  64. package/dist/{chunk-index-sm7kfb07.js → chunk-index-nn4w6a04.js} +2 -2
  65. package/dist/{chunk-index-gwkhs8s3.js → chunk-index-nr275sa7.js} +2 -2
  66. package/dist/{chunk-index-x60n1me6.js → chunk-index-pgxgq61x.js} +2 -2
  67. package/dist/chunk-index-prq011b6.js +2 -0
  68. package/dist/{chunk-index-v9gbt5tz.js → chunk-index-q4k9vk04.js} +19 -3
  69. package/dist/chunk-index-rgdaec7y.js +2 -0
  70. package/dist/chunk-index-rjs1can6.js +2 -0
  71. package/dist/chunk-index-s4a8e4qm.js +2 -0
  72. package/dist/{chunk-index-s9p27f9b.js → chunk-index-sz381vda.js} +3 -3
  73. package/dist/{chunk-index-5hbq6g2e.css → chunk-index-t7csmbpy.css} +1 -1
  74. package/dist/{chunk-index-rgf4rvns.js → chunk-index-v9jqyr1f.js} +3 -3
  75. package/dist/{chunk-index-rsd8rftk.js → chunk-index-vpq2cj14.js} +2 -2
  76. package/dist/chunk-index-vsaggfns.js +2 -0
  77. package/dist/{chunk-index-p7jkr7gv.js → chunk-index-w17wgjby.js} +5 -5
  78. package/dist/{chunk-index-c7dbvkrq.js → chunk-index-wgrx2ybn.js} +2 -2
  79. package/dist/chunk-index-wsv46y9p.js +2 -0
  80. package/dist/{chunk-index-4t6vnwap.js → chunk-index-xbj816p0.js} +2 -2
  81. package/dist/{chunk-index-s53bxwkk.js → chunk-index-yr758n6t.js} +2 -2
  82. package/dist/{chunk-index-5t2jkecy.js → chunk-index-ysv36nbk.js} +2 -2
  83. package/dist/{chunk-index-zt19fdmc.js → chunk-index-ze9p4npm.js} +2 -2
  84. package/dist/chunk-index-zfdvyrjt.js +2 -0
  85. package/dist/chunk-lang-css-3h22se37.js +1 -0
  86. package/dist/{chunk-lang-dockerfile-n4bt8jbt.js → chunk-lang-dockerfile-y24eejnh.js} +1 -1
  87. package/dist/{chunk-lang-go-9k4y107e.js → chunk-lang-go-qzgv1161.js} +3 -3
  88. package/dist/chunk-lang-html-9rvrmmpg.js +1 -0
  89. package/dist/chunk-lang-javascript-4kv8s3tk.js +1 -0
  90. package/dist/{chunk-lang-json-hr12bzs1.js → chunk-lang-json-99v80v88.js} +1 -1
  91. package/dist/{chunk-lang-markdown-ttzcpgkg.js → chunk-lang-markdown-gn8he877.js} +4 -4
  92. package/dist/{chunk-lang-python-ntj8maem.js → chunk-lang-python-prsw4p4k.js} +2 -2
  93. package/dist/{chunk-lang-rust-gv8y859d.js → chunk-lang-rust-g6xqta16.js} +1 -1
  94. package/dist/{chunk-lang-shell-5zzs09b7.js → chunk-lang-shell-dmpnzc6w.js} +1 -1
  95. package/dist/{chunk-lang-sql-6vmze4pg.js → chunk-lang-sql-wz7ca27b.js} +2 -2
  96. package/dist/{chunk-lang-toml-tt0d4rw9.js → chunk-lang-toml-160prtq4.js} +1 -1
  97. package/dist/chunk-lang-typescript-mp0yw903.js +1 -0
  98. package/dist/{chunk-lang-xml-r2sbqnjv.js → chunk-lang-xml-9htkz2dd.js} +1 -1
  99. package/dist/{chunk-lang-yaml-ex31qbph.js → chunk-lang-yaml-08749wd5.js} +1 -1
  100. package/dist/chunk-layout-actions-tdx896xf.js +1 -0
  101. package/dist/chunk-menu-items-trhybv1g.js +1 -0
  102. package/dist/chunk-mode-toggle-4dtfphq4.js +1 -0
  103. package/dist/{chunk-note-row-40ypghn9.js → chunk-note-row-28e5x7n8.js} +33 -4
  104. package/dist/chunk-notes-5nkayhw8.js +1 -0
  105. package/dist/chunk-notice-bell-xz8a04am.js +1 -0
  106. package/dist/{chunk-notices-tefx93s6.js → chunk-notices-d0cwvk27.js} +1 -1
  107. package/dist/chunk-onboarding-zs4rtea9.js +1 -0
  108. package/dist/{chunk-overview-zrx3bpwf.js → chunk-overview-9sb3ywa8.js} +1 -1
  109. package/dist/chunk-palette-5sfhrv4x.js +1 -0
  110. package/dist/chunk-placement-items-e2neja55.js +1 -0
  111. package/dist/{chunk-profile-tyb48b79.js → chunk-profile-jffhtpqf.js} +1 -1
  112. package/dist/chunk-prompt-history-1jz2gk3v.js +1 -0
  113. package/dist/chunk-prompts-0t30ttd0.js +1 -0
  114. package/dist/chunk-room-confirms-6595921h.js +1 -0
  115. package/dist/{chunk-room-menu-ha1evv71.js → chunk-room-menu-hwkjyxwe.js} +1 -1
  116. package/dist/chunk-rooms-menu-button-k0eq1tcr.js +1 -0
  117. package/dist/{chunk-schedules-a5pewkhd.js → chunk-schedules-e12y8fw2.js} +1 -1
  118. package/dist/{chunk-seat-menu-eh3ymmks.js → chunk-seat-menu-n2bcw0mf.js} +1 -1
  119. package/dist/chunk-sheet-hosts-myvm2vhd.js +29 -0
  120. package/dist/chunk-shortcut-help-434sqnxc.js +26 -0
  121. package/dist/chunk-shortcuts-mjxph0g7.js +1 -0
  122. package/dist/chunk-skill-editor-98492yrt.js +8 -0
  123. package/dist/chunk-skills-mfv8ppfh.js +1 -0
  124. package/dist/chunk-start-over-line-m526193z.js +16 -0
  125. package/dist/{chunk-switcher-list-dtfh87zy.js → chunk-switcher-list-5ngjar24.js} +1 -1
  126. package/dist/{chunk-tab-dot-qd640mjr.js → chunk-tab-dot-tzjkahj5.js} +1 -1
  127. package/dist/chunk-table-xbtbex2z.js +1 -0
  128. package/dist/{chunk-table2d-5nrhfwft.js → chunk-table2d-61bvrykm.js} +1 -1
  129. package/dist/{chunk-table3d-5cb66d99.js → chunk-table3d-5a7vbgyj.js} +172 -172
  130. package/dist/chunk-thread-actions-bf6vf2mt.js +1 -0
  131. package/dist/{chunk-thread-cards-kgt22sbp.js → chunk-thread-cards-n0n603vf.js} +1 -1
  132. package/dist/chunk-thread-list-7bkdn51x.js +227 -0
  133. package/dist/{chunk-transcript-a0p3vwh6.js → chunk-transcript-8ztrkt6g.js} +1 -1
  134. package/dist/chunk-waiting-chip-y83c90v3.js +32 -0
  135. package/dist/chunk-waiting-s273kcgz.js +1 -0
  136. package/dist/chunk-where-jr791gzj.js +1 -0
  137. package/dist/chunk-workspace-dw71mshw.js +586 -0
  138. package/dist/chunk-zh-tw-vm5d0w6j.js +1 -0
  139. package/dist/index.html +1 -1
  140. package/dist/sw.js +1 -1
  141. package/package.json +3 -3
  142. package/src/api-types.ts +51 -0
  143. package/src/app/app.ts +7 -0
  144. package/src/app/card-log.ts +10 -2
  145. package/src/app/protocol.ts +18 -0
  146. package/src/app/queued-delivery.ts +107 -0
  147. package/src/app/queued-frames.ts +115 -0
  148. package/src/app/room-log.ts +39 -7
  149. package/src/app/rooms.ts +30 -2
  150. package/src/app/routes.ts +123 -7
  151. package/src/app/skill-group-routes.ts +126 -0
  152. package/src/app/socket.ts +12 -2
  153. package/src/app/surface.ts +37 -6
  154. package/src/app/zip.ts +124 -0
  155. package/src/auth/sessions.ts +9 -1
  156. package/src/authz.ts +1 -0
  157. package/src/host/cards.ts +10 -3
  158. package/src/host/stored-json.ts +23 -0
  159. package/src/i18n/zh-tw.ts +45 -2
  160. package/src/notices/mount.ts +1 -0
  161. package/src/notices/store.ts +9 -1
  162. package/src/push/channel.ts +1 -0
  163. package/src/web-plugin.ts +5 -1
  164. package/dist/chunk-account-678dgbww.js +0 -1
  165. package/dist/chunk-agent-x0yvvdq2.js +0 -1
  166. package/dist/chunk-arranged-rooms-6rdkk8t1.js +0 -1
  167. package/dist/chunk-bulk-actions-zbwdaxtc.js +0 -1
  168. package/dist/chunk-character-creator-215psy17.js +0 -1
  169. package/dist/chunk-confirm-2pzrt272.js +0 -1
  170. package/dist/chunk-connectors-zha2d834.js +0 -37
  171. package/dist/chunk-conversations-fb071rez.js +0 -1
  172. package/dist/chunk-council-sheet-k5fycefd.js +0 -2
  173. package/dist/chunk-folder-list-qxhmczwv.js +0 -1
  174. package/dist/chunk-folds-b7asegfs.js +0 -1
  175. package/dist/chunk-group-scene-63yhh1mh.js +0 -1
  176. package/dist/chunk-group-table-zy4hmgk3.js +0 -1
  177. package/dist/chunk-host-icons-tyktazzz.js +0 -1
  178. package/dist/chunk-host-picture-ebhejn2k.js +0 -1
  179. package/dist/chunk-host-state-wajep0yr.js +0 -1
  180. package/dist/chunk-host-ui-pc9r24e3.js +0 -1
  181. package/dist/chunk-index-1af8vsyb.js +0 -2
  182. package/dist/chunk-index-254701sm.js +0 -3
  183. package/dist/chunk-index-31m1b2f5.js +0 -2
  184. package/dist/chunk-index-5vatmakn.js +0 -2
  185. package/dist/chunk-index-6yra9kdq.js +0 -2
  186. package/dist/chunk-index-9bdstf8t.js +0 -2
  187. package/dist/chunk-index-acj4xxgq.js +0 -100
  188. package/dist/chunk-index-aexy023z.js +0 -2
  189. package/dist/chunk-index-amxa2bn3.js +0 -2
  190. package/dist/chunk-index-bef0fc2m.js +0 -2
  191. package/dist/chunk-index-c6tphrjr.js +0 -1
  192. package/dist/chunk-index-cn49mawx.js +0 -50
  193. package/dist/chunk-index-gcmmwh8t.js +0 -2
  194. package/dist/chunk-index-h2vhv4kh.js +0 -2
  195. package/dist/chunk-index-h9ccz1r3.js +0 -2
  196. package/dist/chunk-index-n0ejy0wd.js +0 -2
  197. package/dist/chunk-index-nkdg1dfz.js +0 -7
  198. package/dist/chunk-index-qxynr1hf.js +0 -2
  199. package/dist/chunk-index-r7fdgzy1.js +0 -2
  200. package/dist/chunk-index-sdcpf5dp.js +0 -2
  201. package/dist/chunk-index-sw9r4aa4.js +0 -2
  202. package/dist/chunk-index-t5bmsqqd.js +0 -1
  203. package/dist/chunk-index-v8mma5np.js +0 -2
  204. package/dist/chunk-index-vsfsv8hd.js +0 -2
  205. package/dist/chunk-index-wxft0aqb.js +0 -2
  206. package/dist/chunk-index-zvvwxkev.js +0 -2
  207. package/dist/chunk-lang-css-7q1dtpgm.js +0 -1
  208. package/dist/chunk-lang-html-xgvba8rn.js +0 -1
  209. package/dist/chunk-lang-javascript-vgxmgd0a.js +0 -1
  210. package/dist/chunk-lang-typescript-2v652sh5.js +0 -1
  211. package/dist/chunk-layout-actions-bfqtg71d.js +0 -1
  212. package/dist/chunk-menu-items-rztgekfj.js +0 -1
  213. package/dist/chunk-mode-toggle-m5kgb7c7.js +0 -1
  214. package/dist/chunk-notes-a8nqffbf.js +0 -1
  215. package/dist/chunk-notice-bell-rdnfmtf2.js +0 -1
  216. package/dist/chunk-onboarding-wvh0s3vg.js +0 -1
  217. package/dist/chunk-palette-5xtdvy9a.js +0 -1
  218. package/dist/chunk-placement-items-rgyrktvy.js +0 -1
  219. package/dist/chunk-prompt-history-wv0vdsjv.js +0 -1
  220. package/dist/chunk-prompts-75hgb0t0.js +0 -1
  221. package/dist/chunk-room-confirms-bcvhpcry.js +0 -1
  222. package/dist/chunk-rooms-menu-button-ej3a2hyc.js +0 -1
  223. package/dist/chunk-sheet-hosts-d5zbwbbr.js +0 -29
  224. package/dist/chunk-shortcut-help-bh9ntk9s.js +0 -26
  225. package/dist/chunk-shortcuts-6em0atk9.js +0 -1
  226. package/dist/chunk-skill-editor-e43mwz01.js +0 -8
  227. package/dist/chunk-skills-vp107wrp.js +0 -1
  228. package/dist/chunk-start-over-line-xd1v2p0g.js +0 -16
  229. package/dist/chunk-table-svb2xhfd.js +0 -1
  230. package/dist/chunk-thread-actions-926eab0w.js +0 -1
  231. package/dist/chunk-thread-list-j2v1pqkz.js +0 -217
  232. package/dist/chunk-waiting-cdyz7r1g.js +0 -1
  233. package/dist/chunk-waiting-chip-58ttx9av.js +0 -28
  234. package/dist/chunk-where-9jp6g029.js +0 -1
  235. package/dist/chunk-workspace-d34njy4p.js +0 -578
  236. package/dist/chunk-zh-tw-y3jb20wc.js +0 -1
@@ -1,2 +0,0 @@
1
- import{o,r,d,J}from"./chunk-index-cn49mawx.js";function ve(u,e){let{version:s}=J(),[t,i]=r({data:void 0,error:void 0,subject:e});return o(()=>{let n=!0;return u().then((a)=>{if(n)i({data:a,error:void 0,subject:e})},(a)=>{if(n)i((f)=>({data:f.subject===e?f.data:void 0,error:d(a),subject:e}))}),()=>{n=!1}},[e,s]),t.subject===e?{data:t.data,error:t.error}:{data:void 0,error:void 0}}
2
- export{ve};
@@ -1,2 +0,0 @@
1
- import{Pe,I,O,M}from"./chunk-index-cn49mawx.js";var{emit:i,use:s}=M(),o=!1,n;function cn(t){return t.cardOrder.flatMap((e)=>{let r=t.cards[e];return r&&!r.outcome?[{id:e,card:r}]:[]})}function oa(){let t=cn(O.getState()),[e]=t;if(t.length===1&&e)Bi(e.id);else if(t.length>1)o=!0,i()}function qi(){if(!o)return;o=!1,i()}var Rr=()=>s(()=>o);function Bi(t){let e=O.getState().cards[t];if(!e)return;o=!1,n=t,i(),I("room",e.room)}var Cr=()=>s(()=>n);function Er(t){if(n!==t)return;n=void 0,i()}var fi=(t,e)=>[...t?.querySelectorAll("[data-card]")??[]].find((r)=>r.dataset.card===e),c=1600;function Fi(t,e){let r=fi(t,e);if(!r)return!1;r.scrollIntoView?.({block:"center",behavior:Pe()?"auto":"smooth"});let a=r.querySelector(".prompt")??r;return a.tabIndex=-1,a.focus({preventScroll:!0}),r.dataset.lit="",setTimeout(()=>delete r.dataset.lit,c),!0}
2
- export{cn,oa,qi,Rr,Bi,Cr,Er,fi,Fi};
@@ -1,2 +0,0 @@
1
- import{Wn}from"./chunk-index-1af8vsyb.js";var f=12;function m(r,e){let t=r.find((u)=>e>=u.top&&e<=u.bottom);if(t)return t;let n,o=f+1;for(let u of r){let i=e<u.top?u.top-e:e-u.bottom;if(i<o)n=u,o=i}return n}function d(r,e,t){for(let n of r)if(n.key!==e&&n.top+n.height/2>t)return n.key;return null}function hs(r,e,t){let n=m(r,t);return n?{zone:n,before:d(n.items,e,t)}:void 0}function ps(r,e,t){let{zone:n,before:o}=t;if(n.kind==="rest")return r.kind==="rest"?void 0:{kind:"unplace"};if(n.kind==="pinned"&&r.kind==="pinned"||n.kind==="folder"&&r.kind==="folder"&&r.folder===n.folder){let i=r.siblings;if(Wn(i,e,o).every((s,l)=>s===i[l]))return}return n.kind==="pinned"?{kind:"pin",before:o}:{kind:"folder",folder:n.folder,before:o}}function ms(r,e,t,n){if(n<e.top-f*3||n>e.bottom+f*3)return;return{before:d(r,t,n)}}function to(r,e,t,n=0){let o=(r[e]?.height??0)+n;return r.map((u,i)=>{if(i===e)return 0;if(e<t&&i>e&&i<=t)return-o;if(e>t&&i>=t&&i<e)return o;return 0})}function no(r,e,t){return Wn(r,e,t).indexOf(e)}function gs(r,e,t,n=64,o=18){if(r<e+n)return-Math.min(1,(e+n-r)/n)*o;if(r>t-n)return Math.min(1,(r-(t-n))/n)*o;return 0}var Os=600;
2
- export{hs,ps,ms,to,no,gs,Os};
@@ -1,2 +0,0 @@
1
- import{O,h,d,f}from"./chunk-index-cn49mawx.js";import{ps}from"./chunk-index-h9ccz1r3.js";import{vo,Pn}from"./chunk-index-bef0fc2m.js";import{tt,Bs,Fs,Gs,Zs,Ws}from"./chunk-index-1af8vsyb.js";import{Xt}from"./chunk-index-20xgx0k2.js";var n={createFolder:(e)=>h("folders",{method:"POST",body:JSON.stringify({name:e})}),changeFolder:(e,t)=>h(`folders/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),deleteFolder:(e)=>h(`folders/${encodeURIComponent(e)}`,{method:"DELETE"}),muteFolder:(e,t)=>h(`folders/${encodeURIComponent(e)}/mute`,{method:"PUT",body:JSON.stringify({muted:t})}),placeRoom:(e,t,o)=>h(`rooms/${encodeURIComponent(e)}/folder`,{method:"PUT",body:JSON.stringify({folder:t,before:o})}),pinRoom:(e,t,o)=>h(`rooms/${encodeURIComponent(e)}/pin`,{method:"PUT",body:JSON.stringify({pinned:t,before:o})})};var a=(e)=>f(e,"danger"),l=(e)=>O.dispatch({type:"layout_loaded",pins:e.pins,folders:e.folders});async function i(e,t,o=a){let r=vo();try{l(e(r))}catch{}try{let s=await t();return l(s),s}catch(s){l(r),O.dispatch({type:"changed"}),o(d(s));return}}var fs=(e,t,o=null)=>i((r)=>Ws(r,e,t,o),()=>n.pinRoom(e,t,o)),Jt=(e,t,o=null)=>i((r)=>Zs(r,e,t,o),()=>n.placeRoom(e,t,o));function lr(e,t){let o=Xt(Pn(),e);if(o.kind==="rest")return;let r=tt(o.siblings,e,t);if(!r)return;return o.kind==="pinned"?fs(e,!0,r.before):Jt(e,o.folder,r.before)}async function Kr(e,t=a){try{let o=await n.createFolder(e);return l(o),o.folders.at(-1)?.id}catch(o){t(d(o));return}}var Jr=(e,t,o)=>i((r)=>Bs(r,e,t),()=>n.changeFolder(e,{name:t}),o),ta=(e,t)=>i((o)=>Fs(o,e,t),()=>n.changeFolder(e,{before:t}));function sa(e,t){let o=tt(vo().folders.map((r)=>r.id),e,t);return o?ta(e,o.before):void 0}var eo=(e,t)=>i((o)=>Gs(o,e),()=>n.deleteFolder(e),t);async function aa(e,t){try{let o=await n.muteFolder(e,t);for(let r of o.rooms)O.dispatch({type:"room_muted",room:r,muted:o.muted});return!0}catch(o){return a(d(o)),!1}}function la(e,t){let o=ps(Xt(Pn(),e),e,t);if(!o)return;if(o.kind==="pin")return fs(e,!0,o.before);if(o.kind==="folder")return Jt(e,o.folder,o.before);return Jt(e,null)}
2
- export{fs,Jt,lr,Kr,Jr,ta,sa,eo,aa,la};
@@ -1,7 +0,0 @@
1
- import{p,Se,o,C,a,r,t,u,e,Pe,I,l,M,pn,Ln,rt,st,zn,vn,Xe,ls,je,we}from"./chunk-index-cn49mawx.js";import{Ze}from"./chunk-index-2y8r4s4f.js";import{Ie}from"./chunk-index-gwkhs8s3.js";import{_n}from"./chunk-index-r7fdgzy1.js";var xe=8,ke={views:[],attention:{},loaded:!1},le=ke,{emit:Te,use:He}=M(),Cn=()=>He(()=>le);function ri(){let n=Se(rt)?.tier;return n!==void 0&&n!=="owner"}function Ae(n,i){return{key:n.key,kind:"agent",name:`${i}.${n.id}`,displayName:n.title,home:!1,readOnly:!1,mode:{yolo:!1,longRunning:!1},typing:!1,stoppable:!1}}var Ce=(n)=>n.attention===!0,Me=(n,i)=>(i.lastAt??"").localeCompare(n.lastAt??"");async function Ve(n){let i=await Promise.allSettled(n.map((s)=>Ze.list(s))),m=[];i.forEach((s,d)=>{let c=n[d];if(s.status!=="fulfilled"||c===void 0)return;for(let g of s.value.rooms)m.push({room:g,kind:c})}),m.sort((s,d)=>Me(s.room,d.room));let f={};for(let{room:s}of m)if(Ce(s))f[s.key]=!0;return{views:m.map(({room:s,kind:d})=>Ae(s,d)),attention:f,loaded:!0}}function Uo(n){let i=we(),m=l((h)=>h.connects),f=Ie((h)=>h.lists),s=a(0),d=a(0),c=n.join(`
2
- `),{views:g}=Cn();o(()=>{s.current+=1;let h=s.current,b=!0;return Ve(c===""?[]:c.split(`
3
- `)).then((E)=>{if(!b||h<d.current)return;d.current=h,le=E,Te()}),()=>{b=!1}},[c,m,f]);let y=g.slice(0,xe).map((h)=>h.key).join(`
4
- `);o(()=>{let h=y===""?[]:y.split(`
5
- `);for(let b of h)i.send({type:"subscribe",room:b});return()=>{for(let b of h)i.send({type:"unsubscribe",room:b})}},[i,y,m])}var Le=["①","②","③","④","⑤","⑥","⑦","⑧"];function Vo(n){if(!n)return[];return[...n.spoken.map((i)=>({name:i,place:"spoken"})),...n.current===void 0?[]:[{name:n.current,place:"current"}],...n.next.map((i,m)=>({name:i,place:"next",order:m+1}))]}function me(n){let i={};if(n?.state!=="running")return i;for(let f of n.spoken)i[f]="✓";let m=new Set;if(n.next.forEach((f,s)=>{let d=Le[s];if(d===void 0||m.has(f))return;m.add(f),i[f]=d}),n.current!==void 0)delete i[n.current];return i}var En=(n)=>n?.state==="running"?n.current:void 0;function qo(n){let i=n.current===void 0?n.replies:n.replies+1;return Math.min(Math.max(i,0),n.limit)}var Oe=380,Ne="cubic-bezier(0.7, 0, 0.84, 0)",De=2.4,pe=0.35,_e=260,$e="cubic-bezier(0.2, 0.8, 0.2, 1)",Fe=1.06,Ke=700,k;function ge(n){if(k?.host===n&&k.phase==="diving")k.abort()}var Be=(n)=>{if(!n||typeof n.animate!=="function")return;n.animate([{transform:`scale(${Fe})`,opacity:pe},{transform:"scale(1)",opacity:1}],{duration:_e,easing:$e})};function ye(n,i,m,f){if(k)return;let s=n.closest("main.route")??n;if(Pe()||typeof s.animate!=="function"){m();return}f?.();let d=s.getBoundingClientRect(),c=`${i.x-d.left}px ${i.y-d.top}px`,g={overflow:s.style.overflow,events:s.style.pointerEvents};s.style.overflow="hidden",s.style.pointerEvents="none";let y=s.animate([{transformOrigin:c,transform:"scale(1)",opacity:1},{transformOrigin:c,transform:`scale(${De})`,opacity:pe}],{duration:Oe,easing:Ne,fill:"forwards"}),h=document.documentElement,b,E,P=()=>{s.style.overflow=g.overflow,s.style.pointerEvents=g.events,y.cancel()},_=()=>{window.removeEventListener("popstate",T),window.removeEventListener("hashchange",T)},x={host:n,phase:"diving",abort:T};function T(){if(k!==x||x.phase!=="diving")return;_(),P(),k=void 0}let H=(N)=>{if(k!==x)return;if(E?.disconnect(),clearTimeout(b),h.removeAttribute("data-dive"),P(),k=void 0,N)Be(document.querySelector("main.route"))};k=x,window.addEventListener("popstate",T),window.addEventListener("hashchange",T),y.finished.then(()=>{if(k!==x||x.phase!=="diving")return;if(x.phase="committing",_(),h.setAttribute("data-dive",""),m(),!n.isConnected){H(!0);return}E=new MutationObserver(()=>{if(!n.isConnected)H(!0)}),E.observe(s.parentElement??document.body,{childList:!0,subtree:!0}),b=setTimeout(()=>H(!n.isConnected),Ke)},()=>{return})}var qe=(n)=>n==="sleepy"?"idle":n;function ve(n,i){let m={};for(let[s,d]of Object.entries(n))m[s]=qe(d);let f=(s)=>s!==void 0&&(s in m)&&m[s]!=="waiting"&&m[s]!=="error";for(let s of i){let d=s.agent;if(s.typing&&f(d)){let c=m[d];if(c!=="thinking"&&c!=="working")m[d]="thinking"}}for(let s of i)if(f(s.voice))m[s.voice]="speaking";return m}function re(n,i){if(n==="speaking")return"happy";return(i?.STATE_EXPRESSION??ze)[n]}var ze={idle:"neutral",thinking:"thinking",working:"determined",waiting:"curious",done:"proud",error:"apologetic",sleepy:"sleepy"};function oe(n,i){return`s${n}${i.toLowerCase().replace(/[^a-z0-9]/g,"")}`.slice(0,16)}var Ge={x:-7,y:-3,w:114,h:100},B=256;function ne(n,i,m,f,s,d,c){let g=n.composeSvg(i,{bare:!0,look:m,expr:re(f,n),...c?{mouth:c}:{},state:"idle",still:!0,size:B,uid:s,skins:d}),{x:y,y:h,w:b,h:E}=Ge;return g.replace('viewBox="0 0 100 100"',`viewBox="${y} ${h} ${b} ${E}"`).replace(`width="${B}" height="${B}"`,`width="${B}" height="${Math.round(B*E/b)}"`)}function se(n,i,m,f,s,d){if(f!=="speaking")return{avatarSvg:ne(n,i,m,f,s,d)};return{avatarSvg:ne(n,i,m,f,s,d,"closed"),talkSvg:ne(n,i,m,f,s,d,"open")}}function he(n){let i=n.delayMs??300,m=n.timers??{set:(c,g)=>setTimeout(c,g),clear:(c)=>clearTimeout(c)},f=new Map,s=new Map,d=(c)=>{let g=s.get(c);if(g===void 0)return;m.clear(g),s.delete(c)};return{seed(c,g){d(c),f.set(c,re(g))},update(c,g){let y=re(g);if(!f.has(c)){f.set(c,y);return}if(d(c),f.get(c)===y)return;s.set(c,m.set(()=>{s.delete(c),f.set(c,y),n.setAvatar(c,g)},i))},forget(c){d(c),f.delete(c)},dispose(){for(let c of[...s.keys()])d(c);f.clear()}}}var W={},{emit:Ue,use:We}=M();function Or(n,i){if(W[n]===i)return;let m={...W};if(i===void 0)delete m[n];else m[n]=i;W=m,Ue()}var Ye=()=>W;function Re(){return We(Ye)}var Je={idle:u("idle"),thinking:u("thinking"),working:u("working"),waiting:u("waiting"),speaking:u("speaking"),done:u("done"),error:u("error")},Qe=()=>({table:t("Round table"),seat:(n,i)=>t("{name} ({state})",{name:n,state:t(Je[i])})}),et=()=>{je().catch(()=>{return})};function zi(n){let i=ri(),{views:m}=Cn(),f=l((s)=>{let d=s.order.map((g)=>s.rooms[g]?.view).filter((g)=>g!==void 0&&g.kind==="agent"&&!g.helper);return[...n?n.slice(0,_n).map((g)=>d.find((y)=>y.name===g)).filter((g)=>g!==void 0):d].sort((g,y)=>Number(y.home)-Number(g.home)).slice(0,_n)},n?.join(`
6
- `)??"");return i?m.slice(0,_n):f}function oi(){return l((n)=>n.order.map((i)=>n.rooms[i]?.view).filter((i)=>i!==void 0&&i.kind==="agent"&&!i.helper),"agents")}function tt(n){let i=Re(),m=l((f)=>Object.values(f.rooms).filter((s)=>n?s.key===n:s.view?.kind==="group").map((s)=>{let d=En(s.round),c=d??s.agent,g=s.typing&&s.progress.text!=="";return{key:s.key,typing:s.typing||d!==void 0,...c===void 0?{}:{agent:c},...g&&c!==void 0?{streamer:c}:{}}}),n??"");return C(()=>m.map(({key:f,streamer:s,...d})=>{let c=i[f]??s;return c===void 0?d:{...d,voice:c}}),[m,i])}function nt(n){return l((i)=>me(n?i.rooms[n]?.round:void 0),n??"")}function Bt(n){let{variant:i="full",onHandle:m}=n,f=Ln(),s=st(),d=zn(),c=vn(),g=Xe(),y=zi(n.members),h=ls(y.map((S)=>S.key)),b=tt(n.groupRoom),E=nt(n.groupRoom),P=Cn().attention,_=ri(),x=a(_);x.current=_;let T=i==="full"&&n.list===!0,H=C(()=>ve(Object.fromEntries(y.map((S)=>{let v=h[S.key]??"idle";return[S.name,P[S.key]&&(v==="idle"||v==="sleepy")?"waiting":v]})),b),[y,h,b,P]),N=a(H);N.current=H;let A=C(()=>{if(!f)return[];return y.map((S,v)=>{let w=g[S.name]??S.character??pn(f,S);return{id:S.name,name:S.displayName,color:f.accentOf(w,d.look),...se(f,w,d.look,N.current[S.name]??"idle",oe(v,S.name),c)}})},[f,y,g,d.look,c]),X=a(A);X.current=A;let Y=a(y);Y.current=y;let J=a({look:s,scheme:d.scheme});J.current={look:s,scheme:d.scheme};let Q=a(null),V=a(void 0),[F,be]=r(0),j=a(void 0),ie=a(()=>{return});ie.current=(S)=>{let v=y.find((w)=>w.name===S);if(!f||!v)return;return g[S]??v.character??pn(f,v)};let ae=a(d);ae.current=d;let ce=a(c);ce.current=c;let ue=a(f);ue.current=f;let Z=a(m);Z.current=m;let L=a(n);L.current=n;let de=f!==void 0&&A.length>0;o(()=>{let S=Q.current;if(!de||!S)return;let v=!0,w,te=he({setAvatar:(D,q)=>{let O=ie.current(D),R=ue.current,K=Y.current.findIndex((U)=>U.name===D);if(!O||!R||K<0)return;let{avatarSvg:z,talkSvg:G}=se(R,O,ae.current.look,q,oe(K,D),ce.current);w?.setAvatar(D,z,G)}});return j.current=te,(async()=>{let{mountRoundTable:D}=await (p("mws704mc"),import("./chunk-entry-mws704mc.js")),q=X.current.map((R)=>({...R,state:N.current[R.id]??"idle"})),O=await D(S,{theme:J.current.look,scheme:J.current.scheme,seats:q,onSeatClick:({id:R,at:K})=>{let z=L.current.onSeat;if(z){z(R);return}let G=Y.current.find((Ee)=>Ee.name===R);if(!G)return;let U=()=>I("room",G.key),fe=Q.current;if(K&&fe)ye(fe,K,U,x.current?et:void 0);else U()},...L.current.onSeatMenu?{onSeatMenu:(R)=>L.current.onSeatMenu?.(R)}:{},ownerName:L.current.ownerName??t("You"),focus:L.current.focus??null,onFocus:(R)=>L.current.onFocus?.(R),reducedMotion:"auto",lowPower:"auto",variant:i,listBelow:T,labels:Qe()});if(!v){O.dispose();return}w=O,V.current=O;for(let R of q)te.seed(R.id,R.state??"idle");Z.current?.(O),be((R)=>R+1)})(),()=>{v=!1,ge(S),te.dispose(),j.current=void 0,V.current=void 0,Z.current?.(void 0),w?.dispose()}},[de,i,T]);let ee=n.focus??null;if(o(()=>{let S=V.current;if(S&&S.focused()!==ee)S.focus(ee)},[ee,F]),o(()=>{let S=V.current;if(!S||A.length===0)return;let v=N.current;S.setSeats(A.map((w)=>({...w,state:v[w.id]??"idle"})));for(let w of A)j.current?.seed(w.id,v[w.id]??"idle")},[A,F]),o(()=>{let S=V.current;if(!S)return;for(let v of X.current)S.setMark(v.id,E[v.id]??null)},[E,A,F]),o(()=>{let S=V.current;if(S)S.setTheme(s,d.scheme)},[s,d.scheme,F]),o(()=>{let S=V.current;if(!S)return;for(let v of X.current){let w=H[v.id]??"idle";S.setState(v.id,w),j.current?.update(v.id,w)}},[H,F]),y.length===0)return e("p",{className:"table-empty",children:t("No knights are seated yet.")});return e("section",{className:"table-host",ref:Q,"aria-label":t("Round table")})}
7
- export{Cn,ri,Uo,Vo,En,qo,Or,zi,oi,Bt};
@@ -1,2 +0,0 @@
1
- import{r,t,e,n,d,m}from"./chunk-index-cn49mawx.js";import{R}from"./chunk-index-m81362sc.js";function q(o){let[a,l]=r(!1),[s,i]=r(),c=()=>{if(a)return;i(void 0),o.onClose()};return e(R,{open:o.open,title:o.title,onClose:c,...o.restoreFocus?{restoreFocus:o.restoreFocus}:{},children:n("div",{className:"stack",children:[e("div",{className:"prose",children:o.children}),s?e(m,{message:s}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:a,onClick:c,children:o.cancelLabel??t("Cancel")}),e("button",{type:"button",className:o.tone==="danger"?"danger":o.tone==="yolo"?"yolo-action":"",disabled:a,onClick:async()=>{l(!0),i(void 0);try{await o.onConfirm(),o.onClose()}catch(u){i(d(u))}finally{l(!1)}},children:o.confirmLabel})]})]})})}
2
- export{q};
@@ -1,2 +0,0 @@
1
- var nn=Math.PI*2,_n=8;function Tn(n){let t=((n+Math.PI)%nn+nn)%nn-Math.PI;return t===-Math.PI?Math.PI:t}var Gn=(n,t)=>Tn(t-n);function cr(n){let t=Math.min(Math.max(n,0),8);return{count:1+t,seated:t}}var y=0.62,E=(n)=>Math.min(nn/Math.max(n,1),y),rn=(n,t)=>n===0?0:Tn(Math.PI+(n-t/2)*E(t)),Lt=(n)=>Math.max(4.2,2.6/(2*Math.sin(E(n)/2)));function z(n,t){let o=0,e=Number.POSITIVE_INFINITY;for(let r=0;r<t;r+=1){let u=Math.abs(Gn(n,rn(r,t)));if(u<e-0.000000001)e=u,o=r}return o}var oo=(n,t)=>rn(z(n,t),t);function Ts(n,t){if(t.seated===0)return;let o=Tn(n+Math.PI),e,r=Number.POSITIVE_INFINITY;for(let u=1;u<=t.seated;u+=1){let s=Math.abs(Gn(o,rn(u,t.count)));if(s<r-0.000000001)r=s,e=u}return e}var x=1.65,R=1.06,T=44,N=390,v=4.8,p=0.07,d=3;function H(n,t,o){let{position:e,target:r}=so(n),u=S([r[0]-e[0],r[1]-e[1],r[2]-e[2]]),s=S(P(u,[0,1,0])),i=P(s,u),m=[o[0]-e[0],o[1]-e[1],o[2]-e[2]],a=h(m,u),c=Math.tan(ao(n.fov,t)*Math.PI/360),l=a>0.000001?a:Number.NaN;return{x:h(m,s)/(l*c*t),y:h(m,i)/(l*c),depth:a}}var h=(n,t)=>n[0]*t[0]+n[1]*t[1]+n[2]*t[2],P=(n,t)=>[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]],S=(n)=>{let t=Math.hypot(n[0],n[1],n[2])||1;return[n[0]/t,n[1]/t,n[2]/t]};function Y(n){let t=Lt(n),o=[];for(let e=1;e<n;e+=1){let r=rn(e,n),u=Math.cos(r),s=-Math.sin(r);for(let i of[-1,1])for(let m of[0,v])o.push([Math.sin(r)*t+u*i*x,m,Math.cos(r)*t+s*i*x])}return o}function A(n,t,o,e=p,r=e){let u=1-r,s=1-e;return o.every((i)=>{let m=H(n,t,i);return Math.abs(m.x)<=u&&Math.abs(m.y)<=s})}var yt=2.9,D=0.7,X=0.2,O=0.8;function Ps(n,t,o){let e=o[0]-n[0],r=o[2]-n[2],u=Math.hypot(e,r)||1,s=r/u,i=-e/u,m=yt*D/2,a=yt*t,c=n[1]+a/2-a*X,l=n[1]+a/2-a*O,M=[];for(let f of[-1,1])for(let k of[c,l])M.push([n[0]+s*f*m,k,n[2]+i*f*m]);return M}function w(n){let t=Lt(n),o=[];for(let e=1;e<n;e+=1){let r=rn(e,n);o.push([Math.sin(r)*t,R,Math.cos(r)*t])}return o}function g(n,t){return{...n,r:n.lookR+(n.r-n.lookR)*t,y:n.lookY+(n.y-n.lookY)*t}}function Zn(n,t,o=1.6,e=N){let r=Lt(t),u={az:n,r:r+4.4,y:4.4+r*0.1,aim:0,lookR:-1.6,lookY:2.5,roll:0,fov:46};if(!(o>0))return u;let s=Y(t),i=w(t),m=p+T/(Math.max(e,1)/2);for(let a=1;a<=d;a+=0.02){let c=g(u,a);if(A(c,o,s)&&A(c,o,i,p,m))return c}return g(u,d)}function Qs(n,t){let o=Lt(t),e=0.18;return{az:Tn(n+0.18),r:Math.max(o-3.9,0.5),y:1.8,aim:-0.18,lookR:o+0.1,lookY:1.7,roll:-0.16,fov:58}}var b=(n,t,o)=>n+(t-n)*o;function Ms(n,t,o){return{az:Tn(n.az+Gn(n.az,t.az)*o),r:b(n.r,t.r,o),y:b(n.y,t.y,o),aim:b(n.aim,t.aim,o),lookR:b(n.lookR,t.lookR,o),lookY:b(n.lookY,t.lookY,o),roll:b(n.roll,t.roll,o),fov:b(n.fov,t.fov,o)}}var Qi=(n)=>{let t=Math.min(1,Math.max(0,n));return t<0.5?4*t*t*t:1-(-2*t+2)**3/2},Rs=(n)=>{let t=Math.min(1,Math.max(0,n)),o=(u,s,i)=>3*(1-u)*(1-u)*u*s+3*(1-u)*u*u*i+u*u*u,e=0,r=1;for(let u=0;u<24;u++){let s=(e+r)/2;if(o(s,0.7,0.84)<t)e=s;else r=s}return o((e+r)/2,0,0)},F=420,I=450,V=650;function Cs(n,t,o,e=!1){if(o)return{ms:0,cut:!0};if(e)return{ms:F,cut:!1,dive:!0};let r=Math.abs(Gn(n.az,t.az))/Math.PI;return{ms:Math.round(I+(V-I)*r),cut:!1}}function so(n){let t=n.az+n.aim;return{position:[Math.sin(n.az)*n.r,n.y,Math.cos(n.az)*n.r],target:[Math.sin(t)*n.lookR,n.lookY,Math.cos(t)*n.lookR]}}function Es(n,t){let o=rn(n,t),e=Lt(t);return{x:Math.sin(o)*e,z:Math.cos(o)*e,yaw:o+Math.PI}}var As=(n,t)=>-n/Math.max(t,1)*(Math.PI/2),_=32;function $s(n,t,o,e){let r=(u,s,i)=>u-s<_||i-u<_;return r(n,0,e.width)||r(t,0,e.height)||r(n,o.left,o.left+o.width)||r(t,o.top,o.top+o.height)}function Ns(n,t){if(Math.abs(n)<0.000001)return"none";if(n<0)return t?"none":"in";return t?"out":"none"}function ao(n,t){if(!(t>0)||t>=1.2)return n;return Math.min(n*(1+(1.2-t)*0.55),95)}
2
- export{nn,_n,Tn,Gn,cr,rn,Lt,oo,Ts,yt,Ps,Zn,Qs,Ms,Qi,Rs,Cs,so,Es,As,$s,Ns,ao};
@@ -1,2 +0,0 @@
1
- import{M}from"./chunk-index-cn49mawx.js";var o=!1,{emit:e,use:i}=M(),ui=()=>i(()=>o);function kr(t){if(o===t)return;o=t,e()}
2
- export{ui,kr};
@@ -1,2 +0,0 @@
1
- import{e}from"./chunk-index-cn49mawx.js";import{R}from"./chunk-index-m81362sc.js";function ie(t){return e(R,{open:t.open,title:t.title,onClose:t.onClose,...t.size&&t.size!=="default"?{size:t.size}:{},children:t.children})}
2
- export{ie};
@@ -1 +0,0 @@
1
- import{M}from"./chunk-index-cn49mawx.js";var a="roundtable-console:folders-collapsed";function i(){try{let e=localStorage.getItem(a),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}=M(),n=()=>(l??=i(),l);function s(e){l=e;try{localStorage.setItem(a,JSON.stringify([...e]))}catch{}d()}var yr=()=>c(n),br=()=>n();function vr(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function xr(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function Sr(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{yr,br,vr,xr,Sr};
@@ -1,2 +0,0 @@
1
- import{o,a,r,t,g,e,n,s,gi,I,Re,l,y,f,yn,rs,os}from"./chunk-index-cn49mawx.js";import{q}from"./chunk-index-qxynr1hf.js";import{ze,Pi,_s}from"./chunk-index-6yra9kdq.js";import{Jt,lr,Kr,Jr,eo}from"./chunk-index-n0ejy0wd.js";import{ie}from"./chunk-index-sw9r4aa4.js";import{ne,Ee}from"./chunk-index-c7dbvkrq.js";import{qs,tt,xo}from"./chunk-index-1af8vsyb.js";import{at,Xt}from"./chunk-index-20xgx0k2.js";function A(i){let{room:d}=i,m=l((c)=>{let k=at(c,(h)=>Re(c,h)),v=Xt(k,d),b=v.kind==="rest"?[]:v.siblings;return{name:c.rooms[d]?.view?.displayName??d,folder:v.kind==="folder"?v.folder:"",pinned:v.kind==="pinned",canUp:tt(b,d,"up")!==void 0,canDown:tt(b,d,"down")!==void 0}},d),u=l((c)=>c.folders),p=(c)=>{i.onClose(),Jt(d,c)},C=m.folder===""&&!m.pinned;return n("div",{className:"stack",children:[e("p",{className:"meta",children:m.name}),n("fieldset",{children:[e("legend",{className:"visually-hidden",children:t("Move to folder…")}),n("ul",{className:"menu",children:[e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:C,onChange:()=>p(null)}),e("span",{className:"menu-icon",children:e(s,{name:"rooms",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Ungrouped")})})]})}),u.map((c)=>e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:m.folder===c.id,onChange:()=>p(c.id)}),e("span",{className:"menu-icon",children:e(s,{name:"folder",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:c.name})})]})},c.id)),e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>ze({kind:"new",room:d}),children:[e("span",{className:"menu-icon",children:e(s,{name:"plus",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("New folder…")})})]})})]})]}),m.canUp||m.canDown?n("ul",{className:"menu",children:[m.canUp?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),lr(d,"up")},children:[e("span",{className:"menu-icon",children:e(s,{name:"up",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move up")})})]})}):null,m.canDown?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),lr(d,"down")},children:[e("span",{className:"menu-icon",children:e(s,{name:"down",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move down")})})]})}):null]}):null]})}function D(i){return e(ie,{open:i.open,title:t("Move to folder…"),onClose:i.onClose,children:e(A,{room:i.room,onClose:i.onClose})})}function x(i){let{ask:d}=i,[m,u]=r(d.kind==="rename"?d.name:""),[p,C]=r(),[c,k]=r(!1),v=a(null);return o(()=>v.current?.focus(),[]),n("form",{className:"stack",onSubmit:async(h)=>{h.preventDefault();let w;try{w=xo(m)}catch{C(t("Give the folder a name of 1 to 40 characters."));return}k(!0),C(void 0);let N;if(d.kind==="rename")N=await Jr(d.id,w,C)!==void 0;else{let F=await Kr(w,C);if(N=F!==void 0,F&&d.room)await Jt(d.room,F)}if(k(!1),N)i.onClose()},children:[n("div",{className:"field",children:[e("label",{className:"field-label",htmlFor:"folder-name",children:t("Folder name")}),e("input",{id:"folder-name",type:"text",ref:v,value:m,autoComplete:"off",enterKeyHint:"done",maxLength:qs*2,"aria-invalid":p?!0:void 0,onChange:(h)=>u(h.target.value)}),p?e("p",{className:"field-error",role:"alert",children:p}):null]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:c,onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:c,children:d.kind==="rename"?t("Rename"):t("Create")})]})]})}function R(){let i=_s(),d=a(void 0);if(i)d.current=i;let m=d.current;if(!m)return null;let u=m.kind==="new"||m.kind==="rename";return n(g,{children:[u?e(ie,{open:i?.kind==="new"||i?.kind==="rename",title:m.kind==="rename"?t("Rename folder"):t("Add a folder"),onClose:Pi,children:e(x,{ask:m,onClose:Pi})}):null,m.kind==="delete"?e(q,{open:i?.kind==="delete",title:t("Delete folder"),confirmLabel:t("Delete folder"),tone:"danger",onClose:Pi,onConfirm:async()=>{let p="";if(!await eo(m.id,(c)=>{p=c}))throw Error(p)},children:e("p",{children:t("Delete the folder {name}? Its rooms move to Ungrouped; no room is deleted.",{name:m.name})})}):null,m.kind==="move"?e(D,{open:i?.kind==="move",room:m.room,onClose:Pi}):null]})}function E(i){return n(q,{open:i.open,title:t("Turn on yolo mode?"),confirmLabel:t("Turn on yolo mode"),tone:"yolo",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await y.setMode(i.room,{yolo:!0})},children:[e("p",{children:t("In this room, the knight's held actions are approved for you, without a card, as soon as they come up.")}),e("p",{children:t("Risky classes still ask: running as another user, deleting files, force pushes, disk, service and firewall changes, and anything that names its own approvers. The host can add more.")}),e("p",{children:t("Every approval it makes is written into the conversation, and a banner stays up while yolo mode is on.")})]})}function M(i){return e(q,{open:i.open,title:t("Start over {name}?",{name:i.name}),confirmLabel:t("Start over"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await y.startRoomOver(i.room)},children:e("p",{children:t("The current conversation is archived and the next message begins a new one. Long-term memory is kept. A turn that is running finishes first.")})})}function S(i){return e(q,{open:i.open,title:t("Archive {name}?",{name:i.name}),confirmLabel:t("Archive"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{let d=i.room.indexOf("."),m=i.room.slice(d+1);if(i.room.slice(0,d).endsWith(":group"))await ne.archiveGroup(m);else await ne.archiveAgent(m);if(yn(),await Ee(),f(t("Archived {name}.",{name:i.name})),gi().key===i.room)I("rooms")},children:e("p",{children:t("{name} stops answering and its schedules are cancelled. A group loses it as a member. The history is kept, and Archived in the room list restores it.",{name:i.name})})})}function gr(){return n(g,{children:[e(L,{}),e(R,{})]})}function L(){let i=os(),d=a(void 0);if(i)d.current=i;let m=d.current;if(!m)return null;let u={room:m.room,name:m.name,restoreFocus:m.restoreFocus,onClose:rs};return n(g,{children:[e(E,{open:i?.kind==="yolo",...u}),e(M,{open:i?.kind==="start-over",...u}),e(S,{open:i?.kind==="archive",...u})]})}
2
- export{gr};
@@ -1,2 +0,0 @@
1
- import{p,t}from"./chunk-index-cn49mawx.js";import{go}from"./chunk-index-gwkhs8s3.js";import{Ri,Us,Vs}from"./chunk-index-s53bxwkk.js";function uo(e){let n=go();if(!e)return n;let r=new Set([...e,...Us(e)]);return Object.fromEntries(Object.entries(n).filter(([s])=>r.has(s)))}var i=()=>(p("zbwdaxtc"),import("./chunk-bulk-actions-zbwdaxtc.js"));function Mi(e){let n=[];if(Object.keys(uo(e)).length>0)n.push({id:"read-all",label:t("Mark all as read"),icon:"check",run:()=>{i().then((r)=>r.markAllRead(e))}});if(Ri(e).size>0)n.push({id:"clear-finished",label:t("Clear all finished threads"),icon:"trash",tone:"danger",run:()=>{i().then((r)=>r.clearAllFinished(e))}});return n.push(...fo(e)),n}function fo(e){if(Vs(e).size===0)return[];return[{id:"clear-helpers",label:t("Clear finished temp knights"),icon:"trash",tone:"danger",run:()=>{i().then((n)=>n.clearFinishedHelpers(e))}}]}
2
- export{uo,Mi,fo};
@@ -1,2 +0,0 @@
1
- import{M,h}from"./chunk-index-cn49mawx.js";var lo={page:(e,t,o,c=50)=>h(`rooms/${encodeURIComponent(e)}/messages?archive=${t}&limit=${c}${o===void 0?"":`&before=${o}`}`)},n,{emit:r,use:s}=M();function Ls(e,t){n={room:e,until:t},r()}function Xs(){if(!n)return;n=void 0,r()}var zs=()=>s(()=>n),i;function Is(e,t){i={author:e,text:t},r()}function co(){if(!i)return;i=void 0,r()}var Ds=()=>s(()=>i);
2
- export{lo,Ls,Xs,zs,Is,co,Ds};
@@ -1,2 +0,0 @@
1
- import{h}from"./chunk-index-cn49mawx.js";var r=(t,o,e)=>h(t,{method:o,...e===void 0?{}:{body:JSON.stringify(e)}}),i=(t)=>encodeURIComponent(t),_e={agentPromptHistory:(t)=>h(`agents/${i(t)}/prompt-history`),prompts:()=>h("prompts"),prompt:(t)=>h(`prompts/${i(t)}`),savePrompt:(t,o)=>r(`prompts/${i(t)}`,"PUT",o),revertPrompt:(t,o)=>r(`prompts/${i(t)}/revert`,"POST",o),promptHistory:(t)=>h(`prompts/${i(t)}/history`),skillDocument:(t)=>h(`skill-docs/${i(t)}`),saveSkillDocument:(t,o)=>r(`skill-docs/${i(t)}`,"PUT",o),createSkillDocument:(t)=>r("skill-docs","POST",t),deleteSkillDocument:(t)=>r(`skill-docs/${i(t)}`,"DELETE"),skillHistory:(t)=>h(`skill-docs/${i(t)}/history`)};
2
- export{_e};
@@ -1 +0,0 @@
1
- import"./chunk-index-zcfr8jdv.js";import"./chunk-index-e2gy763y.js";import{jn}from"./chunk-index-2syyyjnq.js";var r=()=>jn();export{r as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-zcfr8jdv.js";import"./chunk-index-e2gy763y.js";import{Yn}from"./chunk-index-3yy10a5h.js";import"./chunk-index-2syyyjnq.js";import"./chunk-index-p7jkr7gv.js";import"./chunk-index-4t6vnwap.js";var t=()=>Yn();export{t as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-zcfr8jdv.js";import"./chunk-index-e2gy763y.js";import{zt}from"./chunk-index-p7jkr7gv.js";import"./chunk-index-4t6vnwap.js";var t=()=>zt({jsx:!0});export{t as language};
@@ -1 +0,0 @@
1
- import"./chunk-index-zcfr8jdv.js";import"./chunk-index-e2gy763y.js";import{zt}from"./chunk-index-p7jkr7gv.js";import"./chunk-index-4t6vnwap.js";var r=()=>zt({typescript:!0,jsx:!0});export{r as language};
@@ -1 +0,0 @@
1
- import{fs,Jt,lr,Kr,Jr,ta,sa,eo,aa,la}from"./chunk-index-n0ejy0wd.js";import"./chunk-index-bef0fc2m.js";import"./chunk-index-20xgx0k2.js";export{Kr as createFolder,eo as deleteFolder,la as dropRoom,Jt as moveRoom,aa as muteFolder,sa as nudgeFolder,lr as nudgeRoom,fs as pinRoom,ta as placeFolderBefore,Jr as renameFolderTo};
@@ -1 +0,0 @@
1
- import{Bn,ca,na,ua,da,fa,ha,ia,pa,ma}from"./chunk-index-254701sm.js";import"./chunk-index-9bdstf8t.js";import"./chunk-index-sm7kfb07.js";import"./chunk-index-aexy023z.js";import"./chunk-index-6yra9kdq.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-wxft0aqb.js";import"./chunk-index-c7dbvkrq.js";import"./chunk-index-vsfsv8hd.js";import"./chunk-index-q5fyrtx4.js";import"./chunk-index-s53bxwkk.js";import"./chunk-index-gwkhs8s3.js";import"./chunk-index-bef0fc2m.js";import"./chunk-index-20xgx0k2.js";export{na as addMenu,ha as avatarMenu,ia as cardDetails,pa as cardMenu,Bn as copyText,ma as fileMenu,fa as messageMenu,ua as openAddMenu,ca as roomMenu,da as seatMenu};
@@ -1 +0,0 @@
1
- import{Mr}from"./chunk-index-2822z600.js";export{Mr as ModeToggle};
@@ -1 +0,0 @@
1
- import{A,o,z,a,r,t,u,e,n,y,d,v,m,k,T,_,ts,J}from"./chunk-index-cn49mawx.js";import{ve}from"./chunk-index-gcmmwh8t.js";import{Te}from"./chunk-index-e35v554x.js";import{ie}from"./chunk-index-sw9r4aa4.js";import"./chunk-index-m81362sc.js";var F=[{kind:"core",label:u("Core"),hint:u("Carried into every turn.")},{kind:"note",label:u("Note"),hint:u("Searched when a knight needs them.")},{kind:"event",label:u("Events"),hint:u("Carried into every turn until their date.")}],B=300;function ae(){let{timeZone:p}=_(),{version:s}=J(),[c,l]=r("core"),[g,D]=r(""),[h,S]=r(),[f,L]=r(),[N,w]=r(),[E,x]=r(),[C,W]=r(),P=ve(()=>y.principals(),"principals").data,V=a(0),K=A(async(i)=>{let b=++V.current;try{let I=await y.notes(i.trim(),C);if(b!==V.current)return;S(I),L(void 0)}catch(I){if(b===V.current)L(d(I))}},[C]);o(()=>{let i=setTimeout(()=>void K(g),B);return()=>clearTimeout(i)},[g,K,s]);let R=(h??[]).filter((i)=>i.kind===c).sort((i,b)=>c==="event"?(i.eventDate??"").localeCompare(b.eventDate??""):i.id-b.id),q=ts(p);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 a knight remembers. A change applies from the next turn.")})]}),e("button",{type:"button",onClick:()=>w({draft:{kind:c,fact:"",eventDate:""}}),children:t("Add")})]}),P&&P.principals.length>1?e(H,{people:P,shown:C,choose:(i)=>{S(void 0),W(i)}}):null,n("div",{className:"toolbar",children:[e("div",{className:"tabs",role:"tablist",children:F.map((i)=>n("button",{type:"button",role:"tab","aria-selected":c===i.kind,onClick:()=>l(i.kind),children:[t(i.label),h?` ${h.filter((b)=>b.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:g,onChange:(i)=>D(i.target.value)})]}),e("p",{className:"hint",children:t(F.find((i)=>i.kind===c)?.hint??"")}),f?e(m,{message:f}):null,!h?e(v,{}):R.length===0?e(k,{children:g?t("No matching notes."):t("Nothing of this kind yet.")}):R.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(T,{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(ie,{open:N!==void 0,title:N?.note?t("Edit note"):t("Add note"),onClose:()=>w(void 0),children:N?e(M,{initial:N.draft,save:async(i)=>{if(N.note)await y.updateNote(N.note.id,i,C);else await y.addNote(i,C);w((b)=>b===N?void 0:b),await K(g)},cancel:()=>w(void 0)}):null}),e(ie,{open:E!==void 0,title:t("Delete this note?"),onClose:()=>x(void 0),children:E?e(O,{text:E.fact,run:async()=>{await y.deleteNote(E.id,C),x((i)=>i===E?void 0:i),await K(g)},cancel:()=>x(void 0)}):null})]})}function H(p){let{people:s}=p,c=z();return n("label",{className:"inline",htmlFor:c,children:[t("Whose notes")," ",e(Te,{id:c,value:p.shown??s.self,onChange:(l)=>p.choose(l.target.value===s.self?void 0:l.target.value),children:s.principals.map((l)=>e("option",{value:l.id,children:l.id===s.self?t("{name} (you)",{name:l.name}):l.disabled?t("{name} (disabled)",{name:l.name}):l.name},l.id))})]})}function M(p){let[s,c]=r(p.initial),[l,g]=r(!1),[D,h]=r(),S=async()=>{g(!0),h(void 0);try{await p.save({kind:s.kind,fact:s.fact,...s.kind==="event"&&s.eventDate?{eventDate:s.eventDate}:{}})}catch(f){h(d(f)),g(!1)}};return n("form",{className:"stack",onSubmit:(f)=>{f.preventDefault(),S()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:F.map((f)=>e("button",{type:"button","aria-pressed":s.kind===f.kind,onClick:()=>c({...s,kind:f.kind}),children:t(f.label)},f.kind))})]}),s.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:s.eventDate,onChange:(f)=>c({...s,eventDate:f.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:s.fact,onChange:(f)=>c({...s,fact:f.target.value})})]}),D?e(m,{message:D}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:p.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:l,children:l?t("Saving…"):t("Save")})]})]})}function O(p){let[s,c]=r(!1),[l,g]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:p.text}),l?e(m,{message:l}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:p.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:s,onClick:()=>{c(!0),p.run().catch((D)=>{g(d(D)),c(!1)})},children:s?t("Deleting…"):t("Delete")})]})]})}export{ae as NotesPage};
@@ -1 +0,0 @@
1
- import"./chunk-index-0q15ysrb.js";import{t,e,n,s,x}from"./chunk-index-cn49mawx.js";import{hi}from"./chunk-index-7qd604rq.js";import"./chunk-index-rsd8rftk.js";function r({current:a}){let{badge:o}=hi();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,o,a,r,t,g,e,n,s,x,d,v,m,Un,rr}from"./chunk-index-cn49mawx.js";import{q}from"./chunk-index-qxynr1hf.js";import"./chunk-index-0q15ysrb.js";import{Nn,un}from"./chunk-index-jc3r4qam.js";import"./chunk-index-m81362sc.js";import{he}from"./chunk-index-rsd8rftk.js";var _=90000,C=2000,V=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),F=()=>/iPhone|iPad/.test(navigator.userAgent);function z({step:i,view:w,refresh:p}){let[c,u]=r(),[l,h]=r(i.done?"arrived":"idle"),[k,b]=r(),[S,y]=r(!1),[I,T]=r(!1),N=a(void 0);o(()=>(Un().then(u,()=>u("unsupported")),()=>clearTimeout(N.current)),[]),o(()=>{if(i.done)h("arrived")},[i.done]);let L=A((f)=>{let P=async()=>{if((await p())?.steps.find((M)=>M.id===i.id)?.done){h("arrived");return}if(Date.now()-f>_){h("late");return}N.current=setTimeout(P,C)};N.current=setTimeout(P,C)},[p,i.id]),D=async()=>{y(!0),b(void 0),h("sending");try{await he.pushTest(),h("waiting"),L(Date.now())}catch(f){h("idle"),b(d(f))}finally{y(!1)}},E=async()=>{y(!0),b(void 0);try{await rr(),u(await Un()),await p()}catch(f){b(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):d(f)),u(await Un().catch(()=>"unsupported"))}finally{y(!1)}},O=c==="unsupported"&&F()&&!V();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:Nn(i)}),i.done?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:un(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":c==="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."):V()?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":c==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),c==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):c==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):c==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:S||c===void 0,onClick:E,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),l==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(g,{children:[e("button",{type:"button",className:"secondary",disabled:S||c!=="on"||l==="waiting",onClick:D,children:l==="waiting"?t("Waiting for it…"):t("Send a test notification")}),l==="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(m,{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(q,{open:I,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>T(!1),onConfirm:async()=>{await he.waive(i.id),await p()},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(),[p,c]=r(),u=A(async()=>{try{let l=await he.onboarding();return w(l),l}catch(l){c(d(l));return}},[]);if(o(()=>{u()},[u]),p&&!i)return e(m,{message:p});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((l)=>l.builtin==="push"?e(z,{step:l,view:i,refresh:u},l.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:Nn(l)}),l.done||l.waived?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",l.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:x(l.open.page),children:t("Open")})]}),e("p",{className:"meta",children:un(l)})]},l.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{o,C,a,r,t,e,n,s,x,I,l,ot,fe}from"./chunk-index-cn49mawx.js";import{ci}from"./chunk-index-3gfbhmpb.js";import{R}from"./chunk-index-m81362sc.js";function T(p){let[f,v]=r(""),[u,h]=r(0),g=a(null),b=l((c)=>c.order.flatMap((i)=>{let m=c.rooms[i]?.view;return m?[{key:i,name:m.displayName,agent:m.name,character:m.character,kind:m.kind}]:[]})),d=C(()=>[...b.map((i)=>({id:i.key,label:i.name,hint:i.kind==="agent"?t("Knight"):i.kind==="group"?t("Group"):t("Thread"),room:!0,...i.kind==="agent"?{avatar:{name:i.agent,character:i.character}}:{icon:"conversations"},go:()=>I("room",i.key)})),...p.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>I(i.pane)}))].flatMap((i)=>{let m=ci(f,i.label);return m===void 0?[]:[{target:i,score:m}]}).sort((i,m)=>m.score-i.score).map((i)=>i.target).slice(0,12),[b,p.pages,f]);o(()=>h(0),[f]),o(()=>{if(p.open)v(""),requestAnimationFrame(()=>g.current?.focus())},[p.open]);let y=(c)=>{if(!c)return;p.onClose(),c.go()};return e(R,{open:p.open,title:t("Find a room"),onClose:p.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":d[u]?`palette-${u}`:void 0,onChange:(c)=>v(c.target.value),onKeyDown:(c)=>{if(ot(c.nativeEvent))return;if(c.key==="ArrowDown")c.preventDefault(),h((i)=>Math.min(d.length-1,i+1));else if(c.key==="ArrowUp")c.preventDefault(),h((i)=>Math.max(0,i-1));else if(c.key==="Enter")c.preventDefault(),y(d[u])}}),e("kbd",{children:"Esc"})]}),n("ul",{className:"palette-list",children:[d.length===0?e("li",{className:"palette-empty",children:t("Nothing matches.")}):null,d.map((c,i)=>e("li",{"data-active":i===u||void 0,children:n("a",{href:c.room?x("room",c.id):x(c.id),onClick:(m)=>{m.preventDefault(),y(c)},onMouseMove:()=>h(i),"aria-current":i===u?"true":void 0,children:[c.avatar?e(fe,{spec:c.avatar.character,name:c.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(s,{name:c.icon??"list",size:16})}),e("span",{className:"palette-label",children:c.label}),e("span",{className:"meta",children:c.hint})]})},c.id))]})]})})}export{T as Palette};
@@ -1 +0,0 @@
1
- import{ro,ga}from"./chunk-index-sm7kfb07.js";import"./chunk-index-6yra9kdq.js";import"./chunk-index-vsfsv8hd.js";import"./chunk-index-q5fyrtx4.js";import"./chunk-index-s53bxwkk.js";import"./chunk-index-gwkhs8s3.js";import"./chunk-index-bef0fc2m.js";import"./chunk-index-20xgx0k2.js";export{ga as folderMenu,ro as placementItems};
@@ -1 +0,0 @@
1
- import{o,r,t,e,n,d,v,m,k,T,_,re}from"./chunk-index-cn49mawx.js";import{Ot}from"./chunk-index-rgf4rvns.js";import{R}from"./chunk-index-m81362sc.js";function U(a){let{open:u,load:y}=a,{timeZone:N}=_(),[i,p]=r(),[c,g]=r(),[h,b]=r();o(()=>{if(!u)return;let s=!0;return p(void 0),g(void 0),b(void 0),y().then((f)=>s&&p(f),(f)=>s&&g(d(f))),()=>{s=!1}},[u]);let l=i?.find((s)=>s.id===h);return e(R,{open:u,title:a.title,size:"wide",onClose:a.onClose,children:n("div",{className:"stack history",children:[c?e(m,{message:c}):null,!i&&!c?e(v,{}):null,i?.length===0?e(k,{children:t("No changes have been kept yet.")}):null,i&&i.length>0?e("ul",{className:"menu",children:i.map((s)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":s.id===h,onClick:()=>b(s.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:s.by}),e("span",{className:"meta",children:re(s.at,N)})]}),s.revert?e(T,{children:t("Back to the file version")}):null]})},s.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(Ot,{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:()=>a.onUse(l.text),children:t("Use this text")})})]}):null]})})}export{U as HistorySheet};
@@ -1 +0,0 @@
1
- import{p,Q,S,A,o,z,r,t,u,g,e,n,s,de,d,f,v,m,k,T,_,re}from"./chunk-index-cn49mawx.js";import{_e}from"./chunk-index-zvvwxkev.js";import{Ot}from"./chunk-index-rgf4rvns.js";import{R}from"./chunk-index-m81362sc.js";var M={"Shared prompt":u("Shared prompt"),"Guest prompt":u("Guest prompt"),"The base every knight's prompt starts with, the main knight's included.":u("The base every knight's prompt starts with, the main knight's included."),"Used instead of the shared prompt when the person speaking is not the owner.":u("Used instead of the shared prompt when the person speaking is not the owner.")},C=(l)=>t(M[l]??l);var O=S(()=>(p("wv0vdsjv"),import("./chunk-prompt-history-wv0vdsjv.js")).then((l)=>({default:l.HistorySheet}))),Z=S(()=>(p("2pzrt272"),import("./chunk-confirm-2pzrt272.js")).then((l)=>({default:l.Confirm})));function pe(){let{timeZone:l}=_(),[N,i]=r(),[h,w]=r(),[b,x]=r(),P=A(()=>{_e.prompts().then((c)=>i(c.documents),(c)=>w(d(c)))},[]);return o(P,[P]),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 main knight and the other knights 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.")}),h?e(m,{message:h}):null,!N&&!h?e(v,{}):null,N?.length===0?e(k,{children:t("No prompts to edit.")}):null,N?.map((c)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(c.label)}),c.differs?e(T,{tone:"warn",children:t("Differs from the file version")}):null,c.broken?e(T,{tone:"warn",children:t("File version cannot be read")}):null]}),c.description?e("p",{children:C(c.description)}):null,c.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:c.override.by,time:re(c.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>x(c.id),children:t("Edit")})})]},c.id)),b?e(q,{id:b,onClose:()=>{x(void 0),P()}}):null]})}function q({id:l,onClose:N}){let[i,h]=r(),[w,b]=r(""),[x,P]=r(),[c,E]=r(!1),[B,D]=r(!1),[V,H]=r(!1),[F,I]=r(!1),L=z();o(()=>{let a=!0;return _e.prompt(l).then((y)=>{if(!a)return;h(y),b(y.text)},(y)=>a&&P(d(y))),()=>{a=!1}},[l]);let U=async()=>{if(!i)return;D(!0);try{let a=await _e.savePrompt(l,{text:w,base:i.text});h(a),b(a.text),E(!1),f(t("Saved."))}catch(a){if(a instanceof de&&a.status===409){let{current:y}=a.body;h(y),f(a.message,"danger")}else f(d(a),"danger")}finally{D(!1)}},G=i!==void 0&&w!==i.text;return n(R,{open:!0,title:i?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[x?e(m,{message:x}):null,!i&&!x?e(v,{}):null,i?.broken?e(m,{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(T,{tone:"warn",children:t("Differs from the file version")})}):null,c?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(Ot,{label:t("Prompt"),before:i.text,after:w}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:B,onClick:()=>E(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:B,onClick:U,children:B?t("Saving…"):t("Save")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:L,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>H(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:L,className:"prompt-full",value:w,maxLength:i.maxChars,onChange:(a)=>b(a.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>I(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!G||!w.trim(),onClick:()=>E(!0),children:t("Review changes")})]})]}),V?e(Q,{fallback:null,children:e(O,{open:V,title:t("History of {name}",{name:C(i.label)}),load:async()=>(await _e.promptHistory(l)).versions.map((a)=>({id:a.id,text:a.text,previous:a.previous,by:a.by,at:a.at,revert:a.action==="revert"})),onUse:(a)=>{b(a),E(!1),H(!1)},onClose:()=>H(!1)})}):null,F?e(Q,{fallback:null,children:e(Z,{open:F,title:t("Revert {name} to the file version?",{name:C(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let a=await _e.revertPrompt(l,{base:i.text});h(a),b(a.text),E(!1),f(t("Back to the file version."))}catch(a){if(!(a instanceof de&&a.status===409))throw a;let{current:y}=a.body;h(y),f(a.message,"danger")}},onClose:()=>I(!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{pe as PromptsPage};
@@ -1 +0,0 @@
1
- import{gr}from"./chunk-index-v8mma5np.js";import"./chunk-index-sw9r4aa4.js";import"./chunk-index-qxynr1hf.js";import"./chunk-index-m81362sc.js";import"./chunk-index-n0ejy0wd.js";import"./chunk-index-6yra9kdq.js";import"./chunk-index-c7dbvkrq.js";import"./chunk-index-q5fyrtx4.js";import"./chunk-index-bef0fc2m.js";import"./chunk-index-20xgx0k2.js";export{gr as RoomConfirmHost};
@@ -1 +0,0 @@
1
- import{t,e,s,l}from"./chunk-index-cn49mawx.js";import"./chunk-index-q5fyrtx4.js";import"./chunk-index-gwkhs8s3.js";import"./chunk-index-6yra9kdq.js";import{si}from"./chunk-index-31m1b2f5.js";import"./chunk-index-vsfsv8hd.js";import"./chunk-index-s53bxwkk.js";function r(){if(!l((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)=>si(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
@@ -1,29 +0,0 @@
1
- import{p,Q,S,A,o,z,C,a,r,t,u,g,e,n,s,I,l,de,y,d,f,v,m,k,_,xe,yn,Dr,is,Le,Si,ss,fe,ji,J,Xe,In}from"./chunk-index-cn49mawx.js";import{Lo}from"./chunk-index-5vatmakn.js";import{lo,Xs,zs,co,Ds}from"./chunk-index-wxft0aqb.js";import{q}from"./chunk-index-qxynr1hf.js";import"./chunk-index-6yra9kdq.js";import"./chunk-index-n0ejy0wd.js";import"./chunk-index-q5fyrtx4.js";import{gr}from"./chunk-index-v8mma5np.js";import"./chunk-index-gwkhs8s3.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-sm7kfb07.js";import{Bn}from"./chunk-index-254701sm.js";import{wn}from"./chunk-index-fepsbhr6.js";import{cn,qi,Rr,Bi}from"./chunk-index-h2vhv4kh.js";import{qt}from"./chunk-index-n0cmnwd2.js";import{_e}from"./chunk-index-zvvwxkev.js";import{Ot}from"./chunk-index-rgf4rvns.js";import{Ft}from"./chunk-index-2hvn2kte.js";import{Te}from"./chunk-index-e35v554x.js";import"./chunk-index-sw9r4aa4.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-m81362sc.js";import"./chunk-index-9bdstf8t.js";import{tn}from"./chunk-index-aexy023z.js";import{ne,Ee}from"./chunk-index-c7dbvkrq.js";import"./chunk-index-vsfsv8hd.js";import"./chunk-index-s53bxwkk.js";import"./chunk-index-bef0fc2m.js";import"./chunk-index-20xgx0k2.js";var Be=S(()=>(p("wv0vdsjv"),import("./chunk-prompt-history-wv0vdsjv.js")).then((i)=>({default:i.HistorySheet}))),We=S(()=>(p("215psy17"),import("./chunk-character-creator-215psy17.js")).then((i)=>({default:i.CharacterCreator}))),Ke=["default","off","minimal","low","medium","high","xhigh"],Ne={default:u("Default"),off:u("Off"),minimal:u("Minimal"),low:u("Low"),medium:u("Medium"),high:u("High"),xhigh:u("Very high")},Z="default",ke=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),Ue=u("Automatic"),pe=(i)=>i==="auto"?t(Ue):t(Ne[i]??i),be=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??Z,thinking:i.thinking??Z});function ye(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??Z)?{model:h.model}:{},...h.thinking!==(i.thinking??Z)?{thinking:h.thinking}:{}}}function we(){let i=is(),h=a(i);if(i)h.current=i;let c=h.current,b=i!==void 0;if(o(()=>{if(!b)return;let N=window.location.href,w=()=>{if(window.location.href!==N)yn()};return window.addEventListener("popstate",w),window.addEventListener("hashchange",w),()=>{window.removeEventListener("popstate",w),window.removeEventListener("hashchange",w)}},[b]),!c)return null;return e(R,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:yn,children:e(qe,{name:c.name,opened:c.id},c.name)})}function qe({name:i,opened:h}){let[c,b]=r(),[N,w]=r([]),[T,V]=r(),[L,P]=r(),[D,U]=r(!1),[M,G]=r(!1),[O,B]=r(!1),[K,j]=r(!1),oe=In(c?.room??""),Y=a(null),ee=c!==void 0,X=l((x)=>c?x.rooms[c.room]?.view?.muted===!0:!1,c?.room??""),[re,W]=r(!1),ie=l((x)=>c?x.rooms[c.room]?.view?.coordinator===!0:!1,c?.room??""),te=z(),ae=z(),H=z();o(()=>{if(!ee||!Dr()?.look)return;Y.current?.scrollIntoView({block:"start"}),Y.current?.focus({preventScroll:!0})},[ee,h]);let E=a({});E.current={profile:c,draft:L},o(()=>{let x=!0;return Promise.all([y.agent(i),y.models()]).then(([me,Ve])=>{if(!x)return;let{profile:ve,draft:ce}=E.current,Ge=ve&&ce&&Object.keys(ye(ve,ce)).length>0;b(me),w(Ve.models),P(Ge?ce:be(me))},(me)=>x&&V(d(me))),()=>{x=!1}},[i,h]);let F=C(()=>c&&L?ye(c,L):{},[c,L]);if(T)return e(m,{message:T});if(!c||!L)return e(v,{});let he=Object.keys(F).length>0,Oe=Array.from(new Set([Z,...N,L.model])),ze=ke(c),ge=async()=>{U(!0);try{let x=await y.updateAgent(i,F);b(x),P(be(x)),G(!1),f(t("Saved."))}catch(x){f(d(x),"danger")}finally{U(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(fe,{spec:c.character,name:c.name,size:72,state:oe,label:c.displayName}),n("div",{children:[e("h3",{children:c.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:c.effective.model,thinking:pe(c.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:H,children:[e("span",{className:"menu-icon",children:e(s,{name:X?"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(Ft,{id:H,checked:!X,label:t("Notifications"),busy:re,onChange:async(x)=>{W(!0),await tn(c.room,!x),W(!1)}})]})})}),M?e(Ye,{profile:c,draft:L,saving:D,onBack:()=>G(!1),onSave:ge}):n("form",{className:"stack form",onSubmit:(x)=>{if(x.preventDefault(),!he)return;if(F.prompt!==void 0)G(!0);else ge()},children:[n("label",{htmlFor:ae,children:[t("Name"),e("input",{id:ae,value:L.displayName,onChange:(x)=>P({...L,displayName:x.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:te,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>j(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>B(!0),children:[e(je,{}),t("Full screen")]})]})]}),e("textarea",{id:te,rows:8,value:L.prompt,onChange:(x)=>P({...L,prompt:x.target.value})})]}),e(qt,{label:t("Model"),value:L.model,onChange:(x)=>P({...L,model:x}),options:Oe.map((x)=>({value:x,label:x===Z?ze:x}))}),e(qt,{label:t("Thinking level"),value:L.thinking,onChange:(x)=>P({...L,thinking:x}),options:Ke.map((x)=>({value:x,label:t(Ne[x])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!he||D,children:D?t("Saving…"):F.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Ze,{name:i,opened:h}),n("section",{className:"card stack",ref:Y,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(Q,{fallback:e(v,{}),children:e(We,{name:c.name,displayName:c.displayName,prompt:c.prompt,character:c.character,onSaved:(x)=>b(x)})})]}),ie?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived knight 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:()=>{yn(),Le({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive {name}",{name:c.displayName})})})]}),K?e(Q,{fallback:null,children:e(Be,{open:K,title:t("History of the prompt"),load:async()=>(await _e.agentPromptHistory(i)).versions.map((x)=>({id:x.id,text:x.text,previous:x.previous,by:x.by,at:x.at})),onUse:(x)=>{P({...L,prompt:x}),j(!1)},onClose:()=>j(!1)})}):null,e(R,{open:O,title:t("Prompt"),size:"full",onClose:()=>B(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:L.prompt,onChange:(x)=>P({...L,prompt:x.target.value})})})]})}function Ze({name:i,opened:h}){let[c,b]=r(),[N,w]=r(),[T,V]=r(),L=z(),P=a(null),D=c!==void 0;if(o(()=>{if(!D||!Dr()?.skills)return;P.current?.scrollIntoView({block:"start"}),P.current?.focus({preventScroll:!0})},[D,h]),o(()=>{let M=!0;return ne.skills(i).then((G)=>M&&b(G),(G)=>{if(M&&!(G instanceof de&&G.status===404))V(d(G))}),()=>{M=!1}},[i,h]),T)return e(m,{message:T});if(!c)return null;let U=async(M,G)=>{w(M);try{b(await ne.setSkills(i,G?{add:[M]}:{remove:[M]}))}catch(O){f(d(O),"danger")}finally{w(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),ref:P,tabIndex:-1,children:[e("h3",{children:t("Skills ({count})",{count:c.skills.filter((M)=>M.carried).length})}),e("p",{className:"meta",children:t("What the knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:c.skills.map((M,G)=>{let O=`${L}-${G}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:O,children:[n("span",{className:"menu-text",children:[e("strong",{children:M.name}),e("span",{className:"meta",children:M.missing?t("Its file cannot be read."):M.builtin?t("Built in: every knight carries it."):M.description??""})]}),e(Ft,{id:O,checked:M.carried,label:M.name,busy:N===M.name,disabled:M.builtin,onChange:(B)=>U(M.name,B)})]})},M.name)})})]})}var je=()=>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 Ye(i){let{profile:h,draft:c}=i,b=a(null);o(()=>b.current?.focus(),[]);let N=[];if(c.displayName!==h.displayName)N.push({label:t("Name"),before:h.displayName,after:c.displayName});let w=(T)=>T===Z?ke(h):T;if(c.model!==(h.model??Z))N.push({label:t("Model"),before:w(h.model??Z),after:w(c.model)});if(c.thinking!==(h.thinking??Z))N.push({label:t("Thinking level"),before:pe(h.thinking??Z),after:pe(c.thinking)});return n("section",{ref:b,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),N.length?e("ul",{className:"review-fields",children:N.map((T)=>n("li",{children:[e("strong",{children:T.label}),e("span",{className:"review-before",children:T.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:T.after})]},T.label))}):null,e(Ot,{label:t("Prompt"),before:h.prompt,after:c.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i.saving,onClick:i.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:i.saving,onClick:i.onSave,children:i.saving?t("Saving…"):t("Save")})]})]})}var Je=300000;function Se(){let i=zs(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return e(R,{open:i!==void 0,title:t("Archived conversation"),size:"wide",onClose:Xs,children:e(Qe,{room:h.room,until:h.until},`${h.room}:${h.until}`)})}function Qe(i){se("archived-log",".archived-log .messages { padding: 0; }");let{timeZone:h}=_(),c=Xe(),[b,N]=r(),[w,T]=r(!1),[V,L]=r(),[P,D]=r(!1),{room:U,until:M}=i;o(()=>{let O=!0;return lo.page(U,M).then((B)=>{if(!O)return;N(B.messages),T(B.more)},(B)=>{if(O)L(d(B))}),()=>{O=!1}},[U,M]);let G=async()=>{let O=b?.[0];if(!O||P)return;D(!0);try{let B=await lo.page(U,M,O.id);N((K)=>[...B.messages,...K??[]]),T(B.more)}catch(B){L(d(B))}D(!1)};if(V)return e(m,{message:V});if(!b)return e(v,{});if(b.length===0)return e(k,{children:t("The archived conversation has no messages.")});return n("div",{className:"archived-log",children:[w?e("button",{type:"button",className:"secondary older",disabled:P,onClick:G,children:P?t("Loading…"):t("Load earlier messages")}):null,e("ol",{className:"messages",children:b.map((O,B)=>{let K=b[B-1],j=!K||K.kind!==O.kind||K.author!==O.author||Date.parse(O.at)-Date.parse(K.at)>Je;return e(ji,{message:O,character:O.agent?c[O.agent]:void 0,header:j,enter:!1,unread:!1,timeZone:h,quotable:!1},O.id)})})]})}var et=`
2
- .sheet:has(.select-text) {
3
- -webkit-user-select: none;
4
- user-select: none;
5
- }
6
-
7
- .select-text {
8
- flex: 1;
9
- margin: 0;
10
- padding: var(--space-3);
11
- overflow-wrap: anywhere;
12
- white-space: pre-wrap;
13
- border: 1px solid var(--border);
14
- border-radius: var(--radius-md);
15
- background: var(--surface-2);
16
- font: inherit;
17
- line-height: 1.6;
18
- -webkit-touch-callout: default;
19
- -webkit-user-select: text;
20
- user-select: text;
21
- }
22
-
23
- .select-text-actions {
24
- display: flex;
25
- justify-content: flex-end;
26
- gap: var(--space-2);
27
- margin-top: var(--space-3);
28
- }
29
- `;function Ce(){let i=Ds(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return se("select-text",et),n(R,{open:i!==void 0,title:t("Select text"),size:"full",onClose:co,children:[e("p",{className:"hint",children:h.author}),e("pre",{className:"select-text",children:h.text}),n("div",{className:"select-text-actions",children:[e("button",{type:"button",className:"secondary",onClick:co,children:t("Close")}),e("button",{type:"button",onClick:()=>Bn(h.text),children:t("Copy all")})]})]})}function tt(i){let h=i.filter((N)=>N.parent!==void 0),c=i.filter((N)=>N.parent===void 0),b=new Set(c.map((N)=>N.name));return[...c.flatMap((N)=>[N,...h.filter((w)=>w.parent===N.name)]),...h.filter((N)=>!b.has(N.parent??""))]}function Ae(){let[i,h]=r(),[c,b]=r(),[N,w]=r(),[T,V]=r(),L=A(async()=>{try{h((await ne.archive()).entries),b(void 0)}catch(D){b(d(D))}},[]);o(()=>{L()},[L]);let P=async(D)=>{w(D.name);try{if(D.kind==="agent")await ne.restoreAgent(D.name);else await ne.restoreGroup(D.name);await Ee(),f(t("Restored {name}.",{name:D.displayName})),await L()}catch(U){f(d(U),"danger")}finally{w(void 0)}};if(c&&!i)return e(m,{message:c});if(!i)return e(v,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),i.length===0?e(k,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:tt(i).map((D)=>n("li",{className:"menu-item","data-helper":D.parent??void 0,style:D.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(s,{name:D.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:D.displayName}),n("span",{className:"meta",children:[D.parent?t("Temp knight of {name}",{name:D.parent}):D.kind==="agent"?t("Knight"):t("Group")," ","· ",D.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:N===D.name,onClick:()=>P(D),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:N===D.name,onClick:()=>V(D),children:t("Delete")})]},`${D.kind}:${D.name}`))}),e(q,{open:T!==void 0,title:t("Delete {name}?",{name:T?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!T)return;if(T.kind==="agent")await ne.deleteAgent(T.name);else await ne.deleteGroup(T.name);await Ee(),f(t("Deleted {name}.",{name:T.displayName})),await L()},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:T?.displayName??""})})})]})}var Me=/^[a-z0-9-]{1,32}$/,De=2,Ie=8,le="\x00";function at(){let i=l((h)=>h.order.flatMap((c)=>{let b=h.rooms[c]?.view;return b?.kind==="agent"&&!b.helper?[`${b.name}${le}${b.displayName}`]:[]}).join(`${le}${le}`));return C(()=>i===""?[]:i.split(`${le}${le}`).map((h)=>{let[c="",b=""]=h.split(le);return{name:c,displayName:b}}),[i])}function He(i){let h=at(),[c,b]=r(),[N,w]=r(),[T,V]=r(""),[L,P]=r(""),[D,U]=r(!1),[M,G]=r([]),[O,B]=r(""),[K,j]=r(!1),[oe,Y]=r(i.name===void 0),ee=z(),X=z();o(()=>{let H=i.name;if(H===void 0)return;let E=!0;return ne.group(H).then((F)=>{if(!E)return;b(F),V(F.displayName),G(F.members),B(F.host),Y(!0)},(F)=>E&&w(d(F))),()=>{E=!1}},[i.name]);let re=(H)=>h.find((E)=>E.name===H)?.displayName??H,W=M.includes(O)?O:M[0]??"",ie=c===void 0?!0:T.trim()!==c.displayName||M.join(",")!==c.members.join(",")||W!==c.host,te=T.trim()!==""&&M.length>=De&&M.length<=Ie&&(c!==void 0||Me.test(L));if(N&&!oe)return e(m,{message:N});if(!oe)return e(v,{});let ae=async()=>{j(!0),w(void 0);try{if(c){await ne.updateGroup(c.name,{...T.trim()!==c.displayName?{displayName:T.trim()}:{},...M.join(",")!==c.members.join(",")?{members:M}:{},...W!==c.host?{host:W}:{}}),await Ee(),f(t("Saved.")),i.onDone();return}let H=await ne.createGroup({name:L,displayName:T.trim(),members:M,host:W});await Ee(),f(t("Made {name}.",{name:H.displayName})),i.onDone(),I("room",H.room)}catch(H){w(d(H))}finally{j(!1)}};return n("form",{className:"stack form",onSubmit:(H)=>{if(H.preventDefault(),te&&ie&&!K)ae()},children:[n("label",{htmlFor:ee,children:[t("Name"),e("input",{id:ee,value:T,autoComplete:"off",onChange:(H)=>{if(V(H.target.value),!c&&!D)P(H.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),c?null:n("label",{htmlFor:X,children:[t("Permanent name"),e("input",{id:X,value:L,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":L!==""&&!Me.test(L),onChange:(H)=>{U(!0),P(H.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 8 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:h.map((H)=>{let E=M.includes(H.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:E,disabled:!E&&M.length>=Ie,onChange:()=>G(E?M.filter((F)=>F!==H.name):[...M,H.name])}),e("span",{className:"menu-text",children:e("strong",{children:H.displayName})})]})},H.name)})})]}),M.length>=De?e(qt,{label:t("Host"),value:W,onChange:B,options:M.map((H)=>({value:H,label:re(H)}))}):null,N?e(m,{message:N}):null,n("div",{className:"actions",children:[c?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),Le({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!te||!ie||K,children:K?t("Saving…"):c?t("Save"):t("Make group")})]})]})}var nt=S(()=>(p("215psy17"),import("./chunk-character-creator-215psy17.js")).then((i)=>({default:i.CharacterCreator}))),Pe=/^[a-z0-9-]{1,32}$/,ue="default";function ot(i){let h=[];for(let c of i){let b=c.indexOf("/"),N=b>0?c.slice(0,b):"",w=h.find((T)=>T.provider===N&&N!=="");if(w)w.models.push(c);else h.push({provider:N,models:[c]})}return h}var st=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Re({onDone:i}){let[h,c]=r(""),[b,N]=r(""),[w,T]=r(!1),[V,L]=r(""),[P,D]=r(ue),[U,M]=r(""),[G,O]=r(),[B,K]=r(!1),[j,oe]=r([]),[Y,ee]=r(),[X,re]=r(!1),W=[z(),z(),z(),z(),z()];o(()=>{let E=!0;return y.models().then((F)=>E&&oe(F.models),()=>{return}),()=>{E=!1}},[]);let ie=C(()=>wn({name:b,displayName:h,prompt:V}),[b,h,V]),te=G?.spec??ie,ae=Pe.test(b)&&h.trim()!==""&&V.trim()!=="";if(B)return e(Q,{fallback:e(v,{}),children:e(nt,{name:b||"new",displayName:h,prompt:V,character:te,onPick:(E,F)=>{O({input:E,spec:F}),K(!1)},onCancel:()=>K(!1)})});let H=async()=>{re(!0),ee(void 0);try{let E={name:b,displayName:h.trim(),prompt:V,...P!==ue?{model:P}:{},...U.trim()?{task:U.trim()}:{},...G?{character:G.input}:{}},F=await ne.createAgent(E);await Ee(),f(t("Made {name}.",{name:F.displayName})),i(),I("room",F.room)}catch(E){ee(E instanceof de&&E.field?`${E.field}: ${d(E)}`:d(E))}finally{re(!1)}};return n("form",{className:"stack form",onSubmit:(E)=>{if(E.preventDefault(),ae&&!X)H()},children:[n("label",{htmlFor:W[0],children:[t("Name"),e("input",{id:W[0],value:h,autoComplete:"off",onChange:(E)=>{if(c(E.target.value),!w)N(st(E.target.value))}})]}),n("label",{htmlFor:W[1],children:[t("Permanent name"),e("input",{id:W[1],value:b,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":b!==""&&!Pe.test(b),onChange:(E)=>{T(!0),N(E.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:W[2],children:[t("Prompt"),e("textarea",{id:W[2],rows:6,value:V,onChange:(E)=>L(E.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:W[4],children:[t("Model"),n(Te,{id:W[4],value:P,onChange:(E)=>D(E.target.value),children:[e("option",{value:ue,children:t("Default model")}),ot(j).map((E)=>E.provider===""?E.models.map((F)=>e("option",{value:F,children:F},F)):e("optgroup",{label:E.provider,children:E.models.map((F)=>e("option",{value:F,children:F},F))},E.provider))]})]}),n("label",{htmlFor:W[3],children:[t("Opening task"),e("textarea",{id:W[3],rows:3,value:U,onChange:(E)=>M(E.target.value)}),e("span",{className:"meta",children:t("Optional. The knight starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(fe,{spec:te,name:b||"new",size:72,label:h}),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:()=>K(!0),children:t("Choose a look")})]})]}),Y?e(m,{message:Y}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ae||X,children:X?t("Making…"):t("Make knight")})})]})}var rt=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Fe(){let i=ss(),h=a(i);if(i)h.current=i;let c=h.current,b=i!==void 0;if(o(()=>{if(!b)return;let N=window.location.href,w=()=>{if(window.location.href!==N)Si()};return window.addEventListener("popstate",w),window.addEventListener("hashchange",w),()=>{window.removeEventListener("popstate",w),window.removeEventListener("hashchange",w)}},[b]),!c)return null;return e(R,{open:i!==void 0,title:rt(c),size:"wide",onClose:Si,children:e("div",{className:"stack agent-sheet",children:c.kind==="new-agent"?e(Re,{onDone:Si}):c.kind==="archive"?e(Ae,{}):e(He,{...c.name===void 0?{}:{name:c.name},onDone:Si})},c.id)})}function $e(){let i=Rr(),h=a(!1);if(i)h.current=!0;return h.current?e(it,{open:i}):null}function it({open:i}){let h=_(),{now:c}=J(),b=l((w)=>cn(w).map(({id:T,card:V})=>{let L=w.rooms[V.room]?.view,P=L?.parent?w.rooms[L.parent]?.view:void 0;return{id:T,room:P?`${P.displayName} › ${L?.displayName??""}`:L?.displayName??V.room,title:V.frame.title,at:V.frame.at}})),N=b.length===0;return o(()=>{if(i&&N)qi()},[i,N]),e(R,{open:i&&!N,title:t("Cards waiting"),onClose:qi,children:e("ul",{className:"waiting-list",children:b.map((w)=>e("li",{children:n("button",{type:"button",onClick:()=>Bi(w.id),children:[e("strong",{children:w.title}),n("span",{className:"meta",children:[w.room,w.at?` · ${xe(w.at,c,h.timeZone)}`:""]})]})},w.id))})})}var lt=S(()=>(p("bh9ntk9s"),import("./chunk-shortcut-help-bh9ntk9s.js")));function mt(){let i=Lo(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(Q,{fallback:null,children:e(lt,{open:i})})}function ln(){return n(g,{children:[e(gr,{}),e(we,{}),e(Fe,{}),e(Se,{}),e(Ce,{}),e($e,{}),e(mt,{})]})}export{ln as SheetHosts};
@@ -1,26 +0,0 @@
1
- import{t,e,n}from"./chunk-index-cn49mawx.js";import{ii,zo}from"./chunk-index-5vatmakn.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-m81362sc.js";var l=`
2
- .shortcut-list {
3
- display: grid;
4
- grid-template-columns: max-content minmax(0, 1fr);
5
- align-items: center;
6
- gap: var(--space-3) var(--space-4);
7
- margin: 0;
8
- }
9
-
10
- .shortcut-list dt {
11
- display: flex;
12
- flex-wrap: wrap;
13
- gap: var(--space-1);
14
- }
15
-
16
- .shortcut-list dd {
17
- margin: 0;
18
- }
19
-
20
- .shortcut-list kbd {
21
- display: inline-block;
22
- min-width: 1.6rem;
23
- text-align: center;
24
- font-size: var(--text-sm);
25
- }
26
- `;function r(){let o=zo(),s=o?"⌥":"Alt",a=o?"⌘":"Ctrl";return[{keys:[s,"↑"],label:t("Previous room")},{keys:[s,"↓"],label:t("Next room")},{keys:[s,"Shift","↑"],label:t("Previous room with unread messages")},{keys:[s,"Shift","↓"],label:t("Next room with unread messages")},{keys:[a,"K"],label:t("Find a room")},{keys:["Esc"],label:t("Close the open menu or sheet, or leave the message box")},{keys:["?"],label:t("Show these shortcuts")}]}function i({open:o}){return se("shortcut-help",l),e(R,{open:o,title:t("Keyboard shortcuts"),onClose:ii,children:n("div",{className:"stack",children:[e("dl",{className:"shortcut-list",children:r().map((s)=>n("div",{style:{display:"contents"},children:[e("dt",{children:s.keys.map((a)=>e("kbd",{children:a},a))}),e("dd",{children:s.label})]},s.label))}),e("p",{className:"meta",children:t("In a message box the arrow shortcuts switch rooms only when it is empty or the caret is at its very start (up) or very end (down).")})]})})}export{i as default};
@@ -1 +0,0 @@
1
- import{gi,x,I,Re,O,ot,kt}from"./chunk-index-cn49mawx.js";import{br}from"./chunk-index-t5bmsqqd.js";import{po}from"./chunk-index-gwkhs8s3.js";import{No,ii,Xo}from"./chunk-index-5vatmakn.js";import{at}from"./chunk-index-20xgx0k2.js";function m(e,t){let{collapsed:o,expanded:r,current:s}=t,n=at(e,t.at),a=[],c=(i,d)=>{a.push({key:i,shown:d});let f=n.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:d});for(let l of f.closed)a.push({key:l,shown:d&&(r.has(l)||l===s)})};for(let i of n.home)c(i,!0);for(let i of n.pinned)c(i,!0);for(let i of n.folders){let d=!o.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)c(f,d)}let u=n.folders.length>0?n.rest:[...n.restAgents,...n.restGroups];for(let i of u)c(i,!0);let{orphans:p}=n;for(let i of p.open)a.push({key:i,shown:!0});for(let i of p.closed)a.push({key:i,shown:r.has(i)||i===s});return a}function y(e,t,o,r){let s=o===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((n)=>n.key===t),s<0)return}for(let n=s+o;n>=0&&n<e.length;n+=o){let a=e[n];if(a&&r(a))return a.key}return}var g=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function h(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return g.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function E(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:n,selectionEnd:a}=e;if(n===null||a===null||n!==a)return!1;return t?n===0:n===e.value.length}if((e.textContent??"")==="")return!0;let o=window.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;let r=o.getRangeAt(0),s=document.createRange();if(s.selectNodeContents(e),t)s.setEnd(r.startContainer,r.startOffset);else s.setStart(r.endContainer,r.endOffset);return s.toString()===""}function b(e){if(e.defaultPrevented||ot(e))return;let{key:t}=e;if(t==="Escape")return e.altKey||e.ctrlKey||e.metaKey?void 0:"escape";if(e.altKey&&!e.ctrlKey&&!e.metaKey){if(t!=="ArrowUp"&&t!=="ArrowDown")return;let o=t==="ArrowUp",r=h(e.target);if(r&&!E(r,o))return;if(e.shiftKey)return o?"previous-unread":"next-unread";return o?"previous":"next"}if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return h(e.target)?void 0:"help";return}function k(){let e=new Set;for(let t of document.querySelectorAll("details.thread-closed[open] [data-thread]"))if(t.dataset.thread)e.add(t.dataset.thread);return e}var S=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function w(e,t=12){let o=x("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===o);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>w(e,t-1))}function T(e,t){let o=O.getState(),r=gi(),s=r.pane==="room"?r.key:void 0,n=m(o,{at:(u)=>Re(o,u),collapsed:br(),expanded:k(),current:s});if(r.pane==="room"&&!n.some((u)=>u.key===s))return;let c=y(n,s,e,t?(u)=>po(u.key)>0:(u)=>u.shown);if(c===void 0)return;I("room",c),w(c)}function v(e){if(document.querySelector(".action-popover")){e.preventDefault(),kt();return}if(document.querySelector("dialog[open]"))return;let t=document.activeElement;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&g.has(t.type))e.preventDefault(),t.blur()}function H(e,t){switch(e){case"escape":v(t);break;case"help":if(t.preventDefault(),Xo())ii();else if(!S())No();break;default:if(S())break;t.preventDefault(),T(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function P(){let e=(t)=>{let o=b(t);if(o)H(o,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{P as startShortcuts};
@@ -1,8 +0,0 @@
1
- import{p,Q,S,o,z,r,t,g,e,n,s,de,d,f,v,m}from"./chunk-index-cn49mawx.js";import{_e}from"./chunk-index-zvvwxkev.js";import{Ot}from"./chunk-index-rgf4rvns.js";import{R}from"./chunk-index-m81362sc.js";var M=S(()=>(p("wv0vdsjv"),import("./chunk-prompt-history-wv0vdsjv.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:u}=c,[i,w]=r(),[h,b]=r(u?"":B),[y,F]=r(),[I,k]=r(!1),[C,x]=r(!1),[A,D]=r(!1),[H,N]=r(!1),T=z();o(()=>{if(!u)return;let a=!0;return _e.skillDocument(u).then((l)=>{if(!a)return;w(l),b(l.text)},(l)=>a&&F(d(l))),()=>{a=!1}},[u]);let L=i?.text??"",U=h!==L,E=u!==void 0&&!i&&!y,V=async()=>{x(!0);try{if(i){let a=await _e.saveSkillDocument(i.name,{text:h,baseHash:i.hash});w(a),b(a.text),k(!1),D(!1),f(t("Saved.")),c.onSaved()}else await _e.createSkillDocument({text:h}),f(t("Skill created.")),c.onSaved(),c.onClose()}catch(a){if(a instanceof de&&a.status===409){let{current:l}=a.body;w(l),D(!0)}else f(d(a),"danger")}finally{x(!1)}};return n(R,{open:!0,title:u??t("New skill"),size:"full",onClose:c.onClose,children:[y?e(m,{message:y}):null,E?e(v,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!E&&!y&&(!i||i.writable)?n("div",{className:"stack",children:[I?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),A?e(m,{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(Ot,{label:"SKILL.md",before:L,after:h}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>k(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:C,onClick:V,children:C?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:T,children:"SKILL.md"}),i?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:T,className:"prompt-full",spellCheck:!1,value:h,onChange:(a)=>b(a.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||!h.trim(),onClick:()=>k(!0),children:t("Review changes")})})]}),H&&i?e(Q,{fallback:null,children:e(M,{open:H,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await _e.skillHistory(i.name);return a.map((l,K)=>({id:l.id,text:l.text,previous:a[K+1]?.text??"",by:l.by,at:l.at}))},onUse:(a)=>{b(a),k(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
@@ -1 +0,0 @@
1
- import{p,Ar,Q,S,o,r,t,g,e,n,s,y,d,f,v,m,k,T,Wt,Et}from"./chunk-index-cn49mawx.js";import{q}from"./chunk-index-qxynr1hf.js";import{ve}from"./chunk-index-gcmmwh8t.js";import{_e}from"./chunk-index-zvvwxkev.js";import{ie}from"./chunk-index-sw9r4aa4.js";import"./chunk-index-m81362sc.js";function V({source:i}){return e("div",{className:"prose document",children:e(Wt,{remarkPlugins:[Et],components:{a:({href:a,children:l})=>a&&/^https?:\/\//.test(a)?e("a",{href:a,target:"_blank",rel:"noreferrer",children:l}):e("span",{children:l}),img:({alt:a})=>e("span",{children:a}),pre:({children:a})=>e("div",{className:"code-block",children:e("pre",{children:a})}),table:({children:a})=>e("div",{className:"table-wrap",children:e("table",{children:a})})},children:i})})}var F=S(()=>(p("e43mwz01"),import("./chunk-skill-editor-e43mwz01.js")).then((i)=>({default:i.SkillEditor})));function Y(){let[i,a]=r(0),{data:l,error:c}=ve(()=>y.skills(),`skills:${i}`),[E,N]=r(),[D,w]=r(),[h,C]=r();o(()=>{y.session().then(N,()=>{return})},[]);let b=E?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),b?n("button",{type:"button",className:"secondary",onClick:()=>w({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:b?t("Registered skills and their carriers. A skill a knight wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask a knight on Discord to edit their contents.")}),c?e(m,{message:c}):null,!l&&!c?e(v,{}):null,l?.length===0?e(k,{children:t("No skills.")}):null,l?.map((u)=>e(z,{skill:u,onEdit:b&&u.source.kind==="written"?()=>w({name:u.name}):void 0,onDelete:b&&u.source.kind==="written"?()=>C(u):void 0},`${u.name}:${i}`)),D?e(Q,{fallback:null,children:e(F,{name:D.name,onSaved:()=>a((u)=>u+1),onClose:()=>w(void 0)},D.name??"")}):null,e(q,{open:h!==void 0,title:t("Delete this skill?"),confirmLabel:t("Delete skill"),tone:"danger",onClose:()=>C(void 0),onConfirm:async()=>{if(!h)return;await _e.deleteSkillDocument(h.name),a((u)=>u+1),f(t("Deleted {name}.",{name:h.name}))},children:h?e(B,{skill:h}):null})]})}function B({skill:i}){return n(g,{children:[e("p",{children:i.carriers.length?t("{name} will be deleted and taken from the knights that carry it: {carriers}.",{name:i.name,carriers:i.carriers.join(", ")}):t("{name} will be deleted. No knight carries it.",{name:i.name})}),i.groups.length?e("p",{children:t("It also leaves the skill groups {groups}.",{groups:i.groups.join(", ")})}):null,e("p",{children:t("This cannot be undone.")})]})}function L(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 z({skill:i,onEdit:a,onDelete:l}){let[c,E]=r(!1),[N,D]=r(),[w,h]=r(),C=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Knight-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(T,{children:C}),i.missing?e(T,{tone:"warn",children:t("File missing")}):n(g,{children:[a?e("button",{type:"button",className:"secondary",onClick:a,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(E(!0),!N)h(void 0),y.skill(i.name).then(D).catch((b)=>h(d(b)))},children:"SKILL.md"})]}),l?e("button",{type:"button",className:"secondary",onClick:l,children:t("Delete")}):null]}),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:L(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All knights"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(ie,{open:c,title:i.name,size:"wide",onClose:()=>E(!1),children:w?e(m,{message:w}):!N?e(v,{}):e(M,{title:i.name,detail:N})})]})}function M({title:i,detail:a}){let l=a.metadata.filter((c)=>!(c.key==="name"&&c.value===i));return n("div",{className:"skill-document",children:[l.length?e("dl",{className:"skill-meta",children:l.map((c)=>n(Ar,{children:[e("dt",{children:c.key}),e("dd",{children:c.value})]},c.key))}):null,e(V,{source:a.body})]})}export{Y as SkillsPage};
@@ -1,16 +0,0 @@
1
- import{t,g,e,n,s,l}from"./chunk-index-cn49mawx.js";import{Ls}from"./chunk-index-wxft0aqb.js";import{se}from"./chunk-index-amxa2bn3.js";var p=`
2
- .line.start-over {
3
- flex-wrap: wrap;
4
- margin-top: var(--space-4);
5
- }
6
-
7
- .line.start-over .link-button {
8
- min-height: 1.75rem;
9
- font-size: inherit;
10
- }
11
-
12
- .start-over-empty {
13
- margin-top: var(--space-6);
14
- font-size: var(--text-sm);
15
- }
16
- `;function c(a){se("start-over",p);let{message:o}=a,i=l((m)=>{let r=m.rooms[o.room];return r?.messages.at(-1)?.id===o.id&&r.pending.length===0&&r.live.length===0});return n(g,{children:[n("li",{className:"line start-over","data-enter":a.enter||void 0,children:[e(s,{name:"reset",size:14}),e("span",{children:t("Conversation started over")}),e("button",{type:"button",className:"link-button",onClick:()=>Ls(o.room,o.id),children:t("View the archived conversation")})]}),i?e("li",{className:"line start-over-empty",children:e("span",{children:t("No messages yet. Say hello.")})}):null]})}export{c as default};
@@ -1 +0,0 @@
1
- import{p,Q,S,Se,o,r,t,e,n,s,I,l,rt,wt,me,as,nr,Ce,we}from"./chunk-index-cn49mawx.js";import{Io,Do,Li,Xi}from"./chunk-index-acj4xxgq.js";import{Cn,ri,Uo,zi,oi,Bt}from"./chunk-index-nkdg1dfz.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-gwkhs8s3.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-m81362sc.js";import{ys,Ti,bs}from"./chunk-index-9bdstf8t.js";Do();var O=S(()=>(p("k5fycefd"),import("./chunk-council-sheet-k5fycefd.js")).then((a)=>({default:a.CouncilSheet})));function F(a,c,u,d,f){as(a,c).then((b)=>{if(b)me({...b,at:u,via:d,source:f})},()=>{return})}function R(){let a=Ce("(max-width: 719px)"),c=Ce("(pointer: coarse)");return a||c}function G({roomKey:a,name:c}){let u=we(),d=R(),f=l((i)=>i.rooms[a]),b=l((i)=>i.limits);return o(()=>(u.focus(a),()=>u.focus(void 0)),[u,a]),e("div",{className:"table-chat",children:e(nr,{roomKey:a,name:c,composer:(i)=>f?.view?.readOnly?null:e(wt,{draftKey:a,name:c,limits:b,stoppable:Boolean(f?.stoppable),stopLabel:t("Stop the round"),blurAfterSend:d,onSend:(m,h)=>{u.say(a,m,h),i(!0)},onStop:()=>u.send({type:"stop",room:a})},a)})})}function z(a){let c=(u,d)=>n("label",{"data-checked":a.mode===u,children:[e("input",{type:"radio",name:"table-mode",value:u,checked:a.mode===u,onChange:()=>a.onMode(u)}),d]});return n("fieldset",{className:"segmented table-mode",children:[e("legend",{className:"visually-hidden",children:t("Show the council as")}),c("scene",t("Animation mode")),c("chat",t("Chat mode"))]})}function B(){return Uo((Se(rt)?.kinds??[]).map((a)=>a.kind)),null}function q({focus:a}){let[c,u]=r(),d=zi(void 0),f=Cn(),b=f.loaded&&d.length===0;return o(()=>{if(a&&f.loaded)I("table",void 0,{replace:!0})},[a,f.loaded]),n("div",{className:"table-page",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:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>c.focus(null),children:e(s,{name:"reset"})}):null,e("button",{type:"button",className:"secondary",onClick:()=>I("rooms"),children:t("All rooms")})]})]}),n("div",{className:"table-frame",children:[b?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("There are no rooms to seat yet.")})]}):e(Bt,{onHandle:u,onSeat:(i)=>{let m=d.find((h)=>h.name===i);if(m)I("room",m.key)},onFocus:(i)=>{let m=d.find((h)=>h.name===i);if(m)I("room",m.key)}}),e(B,{})]})]})}function D({named:a}){let[c,u]=r(),d=Ti(),f=ys(),b=l((g)=>g.listed),i=bs(d,f,a),m=i?.members??[],h=zi(m),k=oi(),{focus:H,look:v}=Li(i?.key??"",m),[P,C]=r(!1),[N,A]=Io(),x=R(),[E,V]=r(!1),T=()=>{V(!0),C(!0)},M=a===void 0||d.some(J(a));o(()=>{if(a!==void 0&&b&&!M)I("table",void 0,{replace:!0})},[a,b,M]);let y=h.length>0;return n("div",{className:"table-page","data-focused":y||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:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>v(null),children:e(s,{name:"reset"})}):null,i&&y?e(z,{mode:N,onMode:A}):null,k.length>0?e("button",{type:"button",className:"secondary council-chip","aria-haspopup":"dialog",onClick:T,children:i?t("Council: {name} ▾",{name:i.displayName}):t("Pick who sits")}):null]})]}),i&&y&&N==="chat"?e(G,{roomKey:i.key,name:i.displayName}):i&&y?e(Xi,{roomKey:i.key,members:m,focus:H,onLook:v,streams:!0,blurAfterSend:x,onHandle:u,onSeatMenu:(g)=>{let w=h.find((L)=>L.name===g.id);if(w)F(w.key,i.key,g.at,g.via,g.source)}}):e("div",{className:"table-frame",children:n("div",{className:"table-empty-state",children:[e("strong",{children:i?t("The council is empty"):t("No council yet")}),e("p",{className:"meta",children:i?t("Every member of this council is gone. Edit who sits."):t("A council is a group of up to {max} knights who answer in turn.",{max:8})}),k.length>0?e("button",{type:"button",onClick:T,children:i?t("Edit this council"):t("Pick who sits")}):null]})}),E?e(Q,{fallback:null,children:e(O,{open:P,onClose:()=>C(!1),council:i})}):null]})}var J=(a)=>(c)=>c.key===a||c.name===a;function re({focus:a}){return ri()?e(q,{focus:a}):e(D,{named:a})}export{re as TablePage};
@@ -1 +0,0 @@
1
- import{Yr,Hr,jr}from"./chunk-index-5t2jkecy.js";import"./chunk-index-s53bxwkk.js";export{Hr as clearAcross,jr as clearFinished,Yr as dismissThread};