pi-roundtable-web 0.26.1 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +10 -6
- package/dist/chunk-account-nhpd9j90.js +1 -0
- package/dist/chunk-action-menu-ec9jqtxq.js +1 -0
- package/dist/chunk-agent-d1xfrawq.js +1 -0
- package/dist/chunk-arranged-rooms-bga8yk2v.js +1 -0
- package/dist/{chunk-character-creator-bd426yjw.js → chunk-character-creator-k67f77w5.js} +1 -1
- package/dist/{chunk-codeeditor-ajhgd33t.js → chunk-codeeditor-jm2sm333.js} +2 -2
- package/dist/chunk-confirm-wc5xraev.js +1 -0
- package/dist/chunk-connectors-mhnw6d79.js +1 -0
- package/dist/chunk-conversations-yjyq4g1y.js +1 -0
- package/dist/{chunk-drag-peyb8t0k.js → chunk-drag-nyq52ck7.js} +1 -1
- package/dist/chunk-entry-red1597w.js +1 -0
- package/dist/chunk-folder-list-x56y26yq.js +1 -0
- package/dist/chunk-folds-3p7s2nvx.js +1 -0
- package/dist/{chunk-gate-hc7dd0fx.js → chunk-gate-h41bv4y9.js} +1 -1
- package/dist/chunk-group-scene-7eb6jyev.js +1 -0
- package/dist/chunk-group-table-rca48kt0.js +1 -0
- package/dist/chunk-host-icons-x318gjqp.js +1 -0
- package/dist/chunk-host-picture-xswcakgy.js +1 -0
- package/dist/chunk-host-state-bpahvk54.js +1 -0
- package/dist/chunk-host-ui-tsbwwk38.js +1 -0
- package/dist/{chunk-index-m7fvw92f.js → chunk-index-029209sy.js} +2 -2
- package/dist/chunk-index-066vzexw.js +2 -0
- package/dist/chunk-index-0h4h76kw.js +2 -0
- package/dist/{chunk-index-eg55mqqe.js → chunk-index-0n6ja7my.js} +1 -1
- package/dist/{chunk-index-gyary7np.js → chunk-index-0xj30mzw.js} +11 -11
- package/dist/{chunk-index-pk1yxkv4.js → chunk-index-1f0j335v.js} +2 -2
- package/dist/chunk-index-2f5nfekb.js +8 -0
- package/dist/chunk-index-31ays46f.js +2 -0
- package/dist/{chunk-index-zrvg23jd.js → chunk-index-43k1rjmx.js} +2 -2
- package/dist/chunk-index-4gk88a0x.js +4 -0
- package/dist/chunk-index-4jf4jvfd.css +1 -0
- package/dist/chunk-index-4mf29sbx.js +2 -0
- package/dist/chunk-index-51n20yhb.js +2 -0
- package/dist/{chunk-index-cvbdf2ca.js → chunk-index-6tpr6r6d.js} +2 -2
- package/dist/{chunk-index-w31c4yjv.js → chunk-index-7bbqtdce.js} +1 -1
- package/dist/chunk-index-84v7j6vh.js +50 -0
- package/dist/chunk-index-8f9jer8r.js +2 -0
- package/dist/chunk-index-91z3g774.js +1 -0
- package/dist/{chunk-index-yzsgsvnp.js → chunk-index-934zgd18.js} +2 -2
- package/dist/{chunk-index-vcyzwtk2.js → chunk-index-9nents16.js} +2 -2
- package/dist/chunk-index-9w0sar6s.js +2 -0
- package/dist/chunk-index-a768zmp6.js +2 -0
- package/dist/{chunk-index-w2j3njb6.js → chunk-index-b7jjca66.js} +2 -2
- package/dist/chunk-index-c5x70d9g.js +2 -0
- package/dist/chunk-index-cmxs5y22.js +42 -0
- package/dist/chunk-index-cwc1vvpw.js +2 -0
- package/dist/chunk-index-d85x96q0.js +2 -0
- package/dist/chunk-index-datrrs6b.js +2 -0
- package/dist/chunk-index-dep2e3f3.js +2 -0
- package/dist/{chunk-index-rnxj3z8k.js → chunk-index-dtste2ed.js} +2 -2
- package/dist/{chunk-index-czdketze.js → chunk-index-ewj52be9.js} +2 -2
- package/dist/{chunk-index-2yebd9tb.js → chunk-index-f3b5nch2.js} +4 -4
- package/dist/{chunk-index-rmxbdmn2.js → chunk-index-frwa2fmc.js} +2 -2
- package/dist/chunk-index-grkczq2c.js +2 -0
- package/dist/chunk-index-gzvkpe3e.js +2 -0
- package/dist/{chunk-index-73gh7kgr.js → chunk-index-kfv996qe.js} +3 -3
- package/dist/{chunk-index-5yzfrf7b.js → chunk-index-kw85ajap.js} +3 -3
- package/dist/chunk-index-satam151.js +2 -0
- package/dist/{chunk-index-dt9775ka.js → chunk-index-smw1n2pt.js} +5 -5
- package/dist/chunk-index-th43f690.js +2 -0
- package/dist/chunk-index-ths2hxpe.js +1 -0
- package/dist/{chunk-index-k7t14rwa.js → chunk-index-tmx30r1w.js} +2 -2
- package/dist/{chunk-index-snzzfhk3.js → chunk-index-y00wke93.js} +2 -2
- package/dist/chunk-index-y4sqmenv.js +2 -0
- package/dist/{chunk-index-z9x4cnzf.js → chunk-index-yrhbhmxz.js} +2 -2
- package/dist/chunk-index-zd76pr2k.js +2 -0
- package/dist/chunk-lang-css-fa7c0zfj.js +1 -0
- package/dist/{chunk-lang-dockerfile-k728ewsf.js → chunk-lang-dockerfile-46rk929v.js} +1 -1
- package/dist/{chunk-lang-go-wjwgay4v.js → chunk-lang-go-qb0qdpg7.js} +3 -3
- package/dist/chunk-lang-html-47mf2y0v.js +1 -0
- package/dist/chunk-lang-javascript-d32qrvxz.js +1 -0
- package/dist/{chunk-lang-json-7gd89mvs.js → chunk-lang-json-1q4fp694.js} +1 -1
- package/dist/{chunk-lang-markdown-b6qbe8bt.js → chunk-lang-markdown-5w7t28wa.js} +5 -5
- package/dist/{chunk-lang-python-3v56y31b.js → chunk-lang-python-3dq0p4rf.js} +2 -2
- package/dist/{chunk-lang-rust-kh0z74d1.js → chunk-lang-rust-70pa0agr.js} +1 -1
- package/dist/{chunk-lang-shell-9zv0zvbx.js → chunk-lang-shell-4pxt7hf4.js} +1 -1
- package/dist/{chunk-lang-sql-yw6bf3t7.js → chunk-lang-sql-kgcbh2a9.js} +2 -2
- package/dist/{chunk-lang-toml-tg1r96nq.js → chunk-lang-toml-99t95pab.js} +1 -1
- package/dist/chunk-lang-typescript-4k1d8z7s.js +1 -0
- package/dist/{chunk-lang-xml-ev1mndd4.js → chunk-lang-xml-mnbv9yfa.js} +1 -1
- package/dist/{chunk-lang-yaml-fz5qpb3r.js → chunk-lang-yaml-2by9g1dy.js} +1 -1
- package/dist/chunk-layout-actions-cgghzj1w.js +1 -0
- package/dist/chunk-menu-items-24cfwawa.js +2 -0
- package/dist/chunk-mode-toggle-v4baz3r1.js +1 -0
- package/dist/{chunk-note-row-kd0fy7ee.js → chunk-note-row-72n6cqyk.js} +2 -2
- package/dist/chunk-notes-83s3tsey.js +1 -0
- package/dist/chunk-notice-bell-a4ty5h1p.js +1 -0
- package/dist/chunk-notices-evny44be.js +1 -0
- package/dist/chunk-onboarding-q1avjbrx.js +1 -0
- package/dist/chunk-overview-42h45ehd.js +1 -0
- package/dist/chunk-palette-e44qepmh.js +1 -0
- package/dist/chunk-placement-items-v466t0sv.js +1 -0
- package/dist/chunk-profile-bqcgkgk4.js +1 -0
- package/dist/chunk-prompt-history-hgbtcn4b.js +1 -0
- package/dist/chunk-prompts-czs8y6r1.js +1 -0
- package/dist/chunk-room-confirms-h8cdj3ng.js +1 -0
- package/dist/chunk-room-menu-7s0feajw.js +1 -0
- package/dist/chunk-rooms-menu-button-gawqvpsr.js +1 -0
- package/dist/{chunk-schedules-rw57nr0m.js → chunk-schedules-zba7krac.js} +1 -1
- package/dist/{chunk-seat-menu-ys5v9abz.js → chunk-seat-menu-ca5p4e9q.js} +1 -1
- package/dist/chunk-sheet-hosts-ssbz6hf2.js +1 -0
- package/dist/chunk-skill-editor-n0y9pd90.js +8 -0
- package/dist/chunk-skills-ea4vb2s4.js +1 -0
- package/dist/chunk-switcher-list-pj5csqr9.js +1 -0
- package/dist/{chunk-tab-dot-r6brdbmw.js → chunk-tab-dot-4tkpxqeh.js} +1 -1
- package/dist/chunk-table-j8nmtdnn.js +1 -0
- package/dist/chunk-table-seats-qeytqe0m.js +1 -0
- package/dist/chunk-table2d-18y029k9.js +1 -0
- package/dist/chunk-table3d-q2s31ae0.js +4220 -0
- package/dist/chunk-thread-actions-w3eadnh7.js +1 -0
- package/dist/chunk-thread-cards-fbpky3c9.js +1 -0
- package/dist/chunk-thread-list-pghe84be.js +1 -0
- package/dist/chunk-transcript-eqzxgqys.js +1 -0
- package/dist/chunk-where-ygyr4jdj.js +1 -0
- package/dist/chunk-workspace-h0p32ygy.js +578 -0
- package/dist/chunk-zh-tw-k6xx1hp2.js +1 -0
- package/dist/index.html +1 -2
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/src/api-types.ts +5 -0
- package/src/app/api-http.ts +1 -1
- package/src/app/routes.ts +53 -1
- package/src/app/surface-threads.ts +1 -1
- package/src/app/surface.ts +2 -1
- package/src/app/threads.ts +20 -0
- package/src/auth/authenticator.ts +8 -1
- package/src/auth/sessions.ts +10 -3
- package/src/i18n/zh-tw.ts +96 -79
- package/src/options.ts +1 -1
- package/src/web-plugin.ts +12 -1
- package/dist/chunk-account-ghq105t4.js +0 -1
- package/dist/chunk-action-menu-me0g9qsc.js +0 -1
- package/dist/chunk-agent-rdv7ekrt.js +0 -1
- package/dist/chunk-arranged-rooms-81rqhx9x.js +0 -1
- package/dist/chunk-confirm-p3mts8mx.js +0 -1
- package/dist/chunk-connectors-bkv3xn83.js +0 -1
- package/dist/chunk-conversations-0e0vbxwr.js +0 -1
- package/dist/chunk-entry-mv7q8br0.js +0 -1
- package/dist/chunk-folder-list-era3tksh.js +0 -1
- package/dist/chunk-folds-hvws0bd5.js +0 -1
- package/dist/chunk-group-scene-dkbpmbh5.js +0 -1
- package/dist/chunk-group-table-fqmxgdfw.js +0 -1
- package/dist/chunk-host-icons-4xde9ntk.js +0 -1
- package/dist/chunk-host-picture-014yzk20.js +0 -1
- package/dist/chunk-host-state-t56e5sdy.js +0 -1
- package/dist/chunk-host-ui-p1zy9nmp.js +0 -1
- package/dist/chunk-index-0fmmvgee.js +0 -2
- package/dist/chunk-index-0xh24y25.js +0 -2
- package/dist/chunk-index-4t0r3t3b.js +0 -2
- package/dist/chunk-index-6twb7ccd.js +0 -2
- package/dist/chunk-index-7xffskfa.js +0 -8
- package/dist/chunk-index-aqw7cy5j.js +0 -1
- package/dist/chunk-index-b6ca02e8.js +0 -2
- package/dist/chunk-index-b8nvhcx5.js +0 -2
- package/dist/chunk-index-gr6e0hse.js +0 -2
- package/dist/chunk-index-j214tczc.js +0 -1
- package/dist/chunk-index-jd6632ef.js +0 -2
- package/dist/chunk-index-jw7dtshr.js +0 -2
- package/dist/chunk-index-kwcx62wb.js +0 -4
- package/dist/chunk-index-mmg788a1.js +0 -2
- package/dist/chunk-index-mq0dacwr.js +0 -2
- package/dist/chunk-index-p53ak25v.js +0 -2
- package/dist/chunk-index-rbcz9jd4.css +0 -1
- package/dist/chunk-index-v3bmr0nw.js +0 -2
- package/dist/chunk-index-wrm8w165.js +0 -2
- package/dist/chunk-index-xh0mg9cw.js +0 -2
- package/dist/chunk-index-ybtvvx85.js +0 -2
- package/dist/chunk-index-zynq0b0w.js +0 -50
- package/dist/chunk-lang-css-88v3hp3d.js +0 -1
- package/dist/chunk-lang-html-07d47es4.js +0 -1
- package/dist/chunk-lang-javascript-fmhhgzwd.js +0 -1
- package/dist/chunk-lang-typescript-etjjvr2g.js +0 -1
- package/dist/chunk-layout-actions-48ecgtkg.js +0 -1
- package/dist/chunk-menu-items-1epy3h0t.js +0 -2
- package/dist/chunk-mode-toggle-fxmfxsa4.js +0 -1
- package/dist/chunk-notes-yb8f057c.js +0 -1
- package/dist/chunk-notice-bell-wr4f1rph.js +0 -1
- package/dist/chunk-notices-x07da5bb.js +0 -1
- package/dist/chunk-onboarding-csrkbh9z.js +0 -1
- package/dist/chunk-overview-avc2d30t.js +0 -1
- package/dist/chunk-palette-9nhp95bz.js +0 -1
- package/dist/chunk-placement-items-q694dpgk.js +0 -1
- package/dist/chunk-profile-6qemf3m7.js +0 -1
- package/dist/chunk-prompt-history-7enzp2p3.js +0 -1
- package/dist/chunk-prompts-nv6mrn0q.js +0 -1
- package/dist/chunk-room-confirms-zz7n61y7.js +0 -1
- package/dist/chunk-room-menu-rr6nzap1.js +0 -1
- package/dist/chunk-rooms-menu-button-zbtwj47d.js +0 -1
- package/dist/chunk-sheet-hosts-jhvaacst.js +0 -1
- package/dist/chunk-skill-editor-sz8an8qr.js +0 -8
- package/dist/chunk-skills-tnr1h16h.js +0 -1
- package/dist/chunk-switcher-list-17enhrse.js +0 -1
- package/dist/chunk-table-r12cja6p.js +0 -1
- package/dist/chunk-table-seats-g3t392zz.js +0 -1
- package/dist/chunk-table2d-p3ezsdcj.js +0 -1
- package/dist/chunk-table3d-4x2n2b00.js +0 -4220
- package/dist/chunk-thread-actions-qc6ezkha.js +0 -1
- package/dist/chunk-transcript-n2s6dher.js +0 -1
- package/dist/chunk-where-f3scdydc.js +0 -1
- package/dist/chunk-workspace-xs023bxm.js +0 -1
- package/dist/chunk-zh-tw-efvmk3fd.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gyary7np.js";import"./chunk-index-w2j3njb6.js";import{Rn}from"./chunk-index-rmxbdmn2.js";var r=()=>Rn();export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gyary7np.js";import"./chunk-index-w2j3njb6.js";import{Qn}from"./chunk-index-k7t14rwa.js";import"./chunk-index-rmxbdmn2.js";import"./chunk-index-dt9775ka.js";import"./chunk-index-m7fvw92f.js";var t=()=>Qn();export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gyary7np.js";import"./chunk-index-w2j3njb6.js";import{Ct}from"./chunk-index-dt9775ka.js";import"./chunk-index-m7fvw92f.js";var t=()=>Ct({jsx:!0});export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gyary7np.js";import"./chunk-index-w2j3njb6.js";import{Ct}from"./chunk-index-dt9775ka.js";import"./chunk-index-m7fvw92f.js";var r=()=>Ct({typescript:!0,jsx:!0});export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ws,Gt,$i,xr,Sr,Vs,Bs,wr,Fs,Gs}from"./chunk-index-p53ak25v.js";import"./chunk-index-b8nvhcx5.js";export{xr as createFolder,wr as deleteFolder,Gs as dropRoom,Gt as moveRoom,Fs as muteFolder,Bs as nudgeFolder,$i as nudgeRoom,ws as pinRoom,Vs as placeFolderBefore,Sr as renameFolderTo};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,Jt,b,O,ds,ye,Ye,Qt,Ce,bt}from"./chunk-index-zynq0b0w.js";import"./chunk-index-wrm8w165.js";import{Tr}from"./chunk-index-xh0mg9cw.js";import{He}from"./chunk-index-mq0dacwr.js";import"./chunk-index-b8nvhcx5.js";var p=(e)=>e();async function s(e){try{await navigator.clipboard.writeText(e),O(t("Copied"))}catch{O(t("Could not copy."),"danger")}}async function c(e){try{await navigator.share(e)}catch(n){if(n instanceof DOMException&&n.name==="AbortError")return;O(t("Could not share."),"danger")}}var m=()=>typeof navigator.share==="function";function q(e,n=p){let i=b.getState().rooms[e],o=i?.view;if(!o||o.kind==="thread")return;let l=i.mode,a=o.home?[]:Tr(e,n);if(o.kind==="agent"){let r=o.name;a.push({id:"edit",label:t("Edit agent"),icon:"profile",run:()=>n(()=>Ye(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>n(()=>Ye(r,{look:!0}))})}if(o.kind==="group"){let r=o.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>n(()=>bt({kind:"group",name:r}))})}if(a.push({id:"notifications",label:t("Notifications"),icon:o.muted?"bell-off":"bell",checked:!o.muted,run:async()=>{let r=o.muted!==!0;if(!await He(e,r))return;O(r?t("Notifications are off for {name}",{name:o.displayName}):t("Notifications are on for {name}",{name:o.displayName}))}}),!o.readOnly)a.push({id:"yolo",label:t("Yolo mode"),icon:"bolt",tone:"yolo",checked:l.yolo,run:()=>{if(l.yolo)return Qt(e,{yolo:!1});Ce({kind:"yolo",room:e,name:o.displayName})}},{id:"long",label:t("Long-running mode"),icon:"timer",tone:"long",checked:l.longRunning,run:()=>Qt(e,{longRunning:!l.longRunning})},{id:"start-over",label:t("Start over"),icon:"reset",tone:"danger",run:()=>Ce({kind:"start-over",room:e,name:o.displayName})});if(!o.readOnly&&!o.coordinator)a.push({id:"archive",label:o.kind==="group"?t("Archive group"):t("Archive agent"),icon:"archive",tone:"danger",run:()=>Ce({kind:"archive",room:e,name:o.displayName})});return{title:o.displayName,items:a}}function f(e=p){return{title:t("Add"),items:[{id:"new-agent",label:t("New agent"),icon:"profile",run:()=>e(()=>bt({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>bt({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>bt({kind:"archive"}))}]}}function I(e,n){let i=e.getBoundingClientRect();ye({...f(n),at:{x:i.left,y:i.bottom},via:"key",source:e})}function P(e){let n=b.getState().rooms[e]?.view;if(n?.kind!=="agent")return;return{title:n.displayName,items:[{id:"leave",label:t("Leave the table"),icon:"bell-off",run:async()=>{if(!await He(e,!0))return;O(t("{name} left the table",{name:n.displayName}))}}]}}function u(e,n){let i=e.querySelector(".bubble > .prose");if(!i)return n;return(i.innerText||i.textContent||n).trim()}function h(e){if(!e)return;let n=window.getSelection();if(!n)return;let i=document.createRange();i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i)}function g(e){let n=window.getSelection();if(!n||n.isCollapsed)return"";return(n.anchorNode&&e.contains(n.anchorNode)?n.toString():"").trim()}function H(e,n,i){let o=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>s(g(n)||u(n,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>s(e.text)}];if(i)o.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>ds(e.room,e.text)});if(o.push({id:"select",label:t("Select text"),icon:"list",run:()=>h(n.querySelector(".bubble"))}),m())o.push({id:"share",label:t("Share"),icon:"send",run:()=>c({text:u(n,e.text)})});return{title:e.author,items:o}}function D(e,n){return{title:n,items:[{id:"profile",label:t("Agent profile"),icon:"profile",run:()=>Ye(e)}]}}var d=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((n)=>n.description?`- ${n.label}: ${n.description}`:`- ${n.label}`)];function y(e){let n=[e.title];switch(e.kind){case"approval":{n.push("",e.message);let{approval:i}=e;if(i){if(n.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)n.push(JSON.stringify(i.input,null,2));for(let o of i.files??[])n.push(o.path)}break}case"ask":n.push("",...d({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)n.push("",...d(i));break}return n.join(`
|
|
2
|
-
`)}function Q(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>s(y(e))}]}}function v(e){let n=document.createElement("a");n.href=Jt(e),n.download=e.name,n.hidden=!0,document.body.append(n),n.click(),n.remove()}async function w(e){let n=new URL(Jt(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(n);if(i.ok){let o=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[o]})){await c({files:[o],title:e.name});return}}}catch{}await c({title:e.name,url:n})}function j(e){let n=[{id:"download",label:t("Download"),icon:"download",run:()=>v(e)}];if(m())n.push({id:"share",label:t("Share"),icon:"send",run:()=>w(e)});return{title:e.name,items:n}}export{f as addMenu,D as avatarMenu,y as cardDetails,Q as cardMenu,s as copyText,j as fileMenu,H as messageMenu,I as openAddMenu,q as roomMenu,P as seatMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Vi}from"./chunk-index-5yzfrf7b.js";export{Vi as ModeToggle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X,a,o,r,t,c,e,n,y,u,x,p,_,P,k,fs,ne}from"./chunk-index-zynq0b0w.js";import{Oe}from"./chunk-index-gr6e0hse.js";import{ue}from"./chunk-index-ybtvvx85.js";import"./chunk-index-vcyzwtk2.js";var L=[{kind:"core",label:c("Core"),hint:c("Carried into every turn.")},{kind:"note",label:c("Note"),hint:c("Searched when the assistant needs them.")},{kind:"event",label:c("Events"),hint:c("Carried into every turn until their date.")}],B=300;function ee(){let{timeZone:m}=k(),{version:l}=ne(),[s,g]=r("core"),[f,N]=r(""),[b,E]=r(),[d,R]=r(),[h,C]=r(),[w,S]=r(),[D,W]=r(),V=Oe(()=>y.principals(),"principals").data,A=o(0),K=X(async(i)=>{let v=++A.current;try{let I=await y.notes(i.trim(),D);if(v!==A.current)return;E(I),R(void 0)}catch(I){if(v===A.current)R(u(I))}},[D]);a(()=>{let i=setTimeout(()=>void K(f),B);return()=>clearTimeout(i)},[f,K,l]);let T=(b??[]).filter((i)=>i.kind===s).sort((i,v)=>s==="event"?(i.eventDate??"").localeCompare(v.eventDate??""):i.id-v.id),q=fs(m);return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Notes")}),e("p",{className:"hint",children:t("What the assistant remembers. A change applies from the next turn.")})]}),e("button",{type:"button",onClick:()=>C({draft:{kind:s,fact:"",eventDate:""}}),children:t("Add")})]}),V&&V.principals.length>1?e(F,{people:V,shown:D,choose:(i)=>{E(void 0),W(i)}}):null,n("div",{className:"toolbar",children:[e("div",{className:"tabs",role:"tablist",children:L.map((i)=>n("button",{type:"button",role:"tab","aria-selected":s===i.kind,onClick:()=>g(i.kind),children:[t(i.label),b?` ${b.filter((v)=>v.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:f,onChange:(i)=>N(i.target.value)})]}),e("p",{className:"hint",children:t(L.find((i)=>i.kind===s)?.hint??"")}),d?e(p,{message:d}):null,!b?e(x,{}):T.length===0?e(_,{children:f?t("No matching notes."):t("Nothing of this kind yet.")}):T.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[n("div",{children:[i.eventDate?n("p",{className:"meta",children:[i.eventDate," ",i.eventDate<q?e(P,{children:t("past")}):null]}):null,e("p",{className:"text",children:i.fact})]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>C({note:i,draft:{kind:i.kind,fact:i.fact,eventDate:i.eventDate??""}}),children:t("Edit")}),e("button",{type:"button",className:"danger",onClick:()=>S(i),children:t("Delete")})]})]})},i.id)),e(ue,{open:h!==void 0,title:h?.note?t("Edit note"):t("Add note"),onClose:()=>C(void 0),children:h?e(H,{initial:h.draft,save:async(i)=>{if(h.note)await y.updateNote(h.note.id,i,D);else await y.addNote(i,D);C((v)=>v===h?void 0:v),await K(f)},cancel:()=>C(void 0)}):null}),e(ue,{open:w!==void 0,title:t("Delete this note?"),onClose:()=>S(void 0),children:w?e(M,{text:w.fact,run:async()=>{await y.deleteNote(w.id,D),S((i)=>i===w?void 0:i),await K(f)},cancel:()=>S(void 0)}):null})]})}function F(m){let{people:l}=m;return n("label",{className:"inline",children:[t("Whose notes")," ",e("select",{value:m.shown??l.self,onChange:(s)=>m.choose(s.target.value===l.self?void 0:s.target.value),children:l.principals.map((s)=>e("option",{value:s.id,children:s.id===l.self?t("{name} (you)",{name:s.name}):s.disabled?t("{name} (disabled)",{name:s.name}):s.name},s.id))})]})}function H(m){let[l,s]=r(m.initial),[g,f]=r(!1),[N,b]=r(),E=async()=>{f(!0),b(void 0);try{await m.save({kind:l.kind,fact:l.fact,...l.kind==="event"&&l.eventDate?{eventDate:l.eventDate}:{}})}catch(d){b(u(d)),f(!1)}};return n("form",{className:"stack",onSubmit:(d)=>{d.preventDefault(),E()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:L.map((d)=>e("button",{type:"button","aria-pressed":l.kind===d.kind,onClick:()=>s({...l,kind:d.kind}),children:t(d.label)},d.kind))})]}),l.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:l.eventDate,onChange:(d)=>s({...l,eventDate:d.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:l.fact,onChange:(d)=>s({...l,fact:d.target.value})})]}),N?e(p,{message:N}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:m.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:g,children:g?t("Saving…"):t("Save")})]})]})}function M(m){let[l,s]=r(!1),[g,f]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:m.text}),g?e(p,{message:g}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:m.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:l,onClick:()=>{s(!0),m.run().catch((N)=>{f(u(N)),s(!1)})},children:l?t("Deleting…"):t("Delete")})]})]})}export{ee as NotesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-0q15ysrb.js";import{t,e,n,s,S}from"./chunk-index-zynq0b0w.js";import{zn}from"./chunk-index-czdketze.js";import"./chunk-index-0xh24y25.js";function r({current:a}){let{badge:o}=zn();return n("a",{className:"icon-button bell",href:S("notices"),"aria-current":a?"page":void 0,"aria-label":o>0?t("Notices, {count} waiting",{count:o}):t("Notices"),children:[e(s,{name:"bell"}),o>0?e("span",{className:"bell-count","aria-hidden":"true",children:o>99?"99+":o}):null]})}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,r,t,e,n,s,u,p,_,P}from"./chunk-index-zynq0b0w.js";import"./chunk-index-0q15ysrb.js";import{zn,Gr,Zr}from"./chunk-index-czdketze.js";import"./chunk-index-0xh24y25.js";function g(o,l){let i=Math.max(0,Math.round((l-Date.parse(o))/60000));if(i<1)return t("just now");if(i<60)return t("{count} min ago",{count:i});let c=Math.round(i/60);if(c<24)return t("{count} h ago",{count:c});return t("{count} d ago",{count:Math.round(c/24)})}function f({notice:o}){let[l,i]=r(!1),[c,m]=r();return n("li",{className:"card stack notice","data-urgent":o.urgency==="high"||void 0,children:[n("div",{className:"card-head",children:[e("strong",{children:o.title}),o.urgency==="high"?e(P,{tone:"warn",children:t("Urgent")}):null]}),o.body?e("p",{children:o.body}):null,e("p",{className:"meta",children:g(o.raisedAt,Date.now())}),c?e(p,{message:c}):null,n("div",{className:"actions",children:[o.open?e("a",{className:"button",href:Zr(o.open),children:t("Open")}):null,o.ackable?o.acked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Handled")]}):e("button",{type:"button",className:"secondary",disabled:l,onClick:async()=>{i(!0),m(void 0);try{await Gr(o.tag)}catch(d){m(u(d))}finally{i(!1)}},children:t("Handled")}):null]})]})}function E(){let{notices:o,known:l}=zn(),[,i]=r(0);return a(()=>{let c=setInterval(()=>i((m)=>m+1),60000);return()=>clearInterval(c)},[]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Notices")})}),o.length===0?e(_,{children:l?t("Nothing needs you."):t("Loading…")}):e("ul",{className:"stack notices",children:o.map((c)=>e(f,{notice:c},c.tag))})]})}export{E as NoticesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X,a,o,r,t,m,e,n,s,S,u,x,p,kn,Ti}from"./chunk-index-zynq0b0w.js";import{j}from"./chunk-index-w31c4yjv.js";import"./chunk-index-0q15ysrb.js";import{On,Wt}from"./chunk-index-snzzfhk3.js";import"./chunk-index-vcyzwtk2.js";import{le}from"./chunk-index-0xh24y25.js";var M=90000,A=2000,C=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),_=()=>/iPhone|iPad/.test(navigator.userAgent);function F({step:i,view:w,refresh:f}){let[l,c]=r(),[d,g]=r(i.done?"arrived":"idle"),[N,b]=r(),[k,v]=r(!1),[V,T]=r(!1),y=o(void 0);a(()=>(kn().then(c,()=>c("unsupported")),()=>clearTimeout(y.current)),[]),a(()=>{if(i.done)g("arrived")},[i.done]);let I=X((h)=>{let P=async()=>{if((await f())?.steps.find((E)=>E.id===i.id)?.done){g("arrived");return}if(Date.now()-h>M){g("late");return}y.current=setTimeout(P,A)};y.current=setTimeout(P,A)},[f,i.id]),L=async()=>{v(!0),b(void 0),g("sending");try{await le.pushTest(),g("waiting"),I(Date.now())}catch(h){g("idle"),b(u(h))}finally{v(!1)}},D=async()=>{v(!0),b(void 0);try{await Ti(),c(await kn()),await f()}catch(h){b(h instanceof Error&&h.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):u(h)),c(await kn().catch(()=>"unsupported"))}finally{v(!1)}},O=l==="unsupported"&&_()&&!C();return n("section",{className:"card stack","aria-labelledby":`step-${i.id}`,children:[n("div",{className:"card-head",children:[e("h2",{id:`step-${i.id}`,children:On(i)}),i.done?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:Wt(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":l==="on"||O===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:O?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):C()?t("This page is installed on this device."):t("On a phone, add it to the home screen from the browser's menu so notifications reach you when it is closed.")})]}),n("li",{"data-done":l==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),l==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):l==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):l==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:k||l===void 0,onClick:D,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),d==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(m,{children:[e("button",{type:"button",className:"secondary",disabled:k||l!=="on"||d==="waiting",onClick:L,children:d==="waiting"?t("Waiting for it…"):t("Send a test notification")}),d==="late"?e("span",{className:"meta",children:t("It has not arrived. Check that notifications are allowed for this app, then send another.")}):null]})]})]}),N?e(p,{message:N}):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(j,{open:V,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>T(!1),onConfirm:async()=>{await le.waive(i.id),await f()},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 Z(){let[i,w]=r(),[f,l]=r(),c=X(async()=>{try{let d=await le.onboarding();return w(d),d}catch(d){l(u(d));return}},[]);if(a(()=>{c()},[c]),f&&!i)return e(p,{message:f});if(!i)return e(x,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),i.steps.map((d)=>d.builtin==="push"?e(F,{step:d,view:i,refresh:c},d.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:On(d)}),d.done||d.waived?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",d.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:S(d.open.page),children:t("Open")})]}),e("p",{className:"meta",children:Wt(d)})]},d.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{Z as OnboardingPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,t,c,m,e,n,S,y,u,x,p,_,P,k,De,te,ke,gi,tn,Yn,ne}from"./chunk-index-zynq0b0w.js";import{Oe}from"./chunk-index-gr6e0hse.js";import{ue}from"./chunk-index-ybtvvx85.js";import"./chunk-index-vcyzwtk2.js";function v(a){let{cleanup:s}=k(),[d,g]=r(),[l,o]=r(!1),[h,i]=r();if(!s)return null;let w=()=>{if(!l)g(void 0),i(void 0)};return n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>g("start-over"),children:t("Start over")}),a.deletable?e("button",{type:"button",className:"danger",onClick:()=>g("delete"),children:t("Delete")}):null,n(ue,{open:d!==void 0,title:d==="delete"?t("Permanently delete {name}?",{name:a.title}):t("Start over {name}?",{name:a.title}),onClose:w,children:[e("p",{children:d==="delete"?t("The live conversation and all archives will be permanently deleted. Memory and schedules are preserved."):t("The current conversation will be archived; the next message starts a new one. Long-term memory is preserved. Active turns finish first.")}),h?e(p,{message:h}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l,onClick:w,children:t("Cancel")}),e("button",{type:"button",className:d==="delete"?"danger":"",disabled:l,onClick:async()=>{if(!d)return;o(!0),i(void 0);try{if(d==="delete")await y.deleteConversation(a.channel);else await y.startOver(a.channel);g(void 0),a.refresh()}catch(N){i(u(N))}finally{o(!1)}},children:l?d==="delete"?t("Deleting…"):a.busy?t("Waiting for this turn…"):t("Starting over…"):d==="delete"?t("Delete permanently"):t("Start over")})]})]})]})}function K(){let a=k(),{now:s}=ne(),[d,g]=r(0),l=()=>g((i)=>i+1),{data:o,error:h}=Oe(()=>y.overview(),`overview:${d}`);if(!o)return h?e(p,{message:h}):e(x,{});return n(m,{children:[h?e(p,{message:h}):null,n("section",{className:"stack",children:[e("h2",{children:t("Agent server")}),e("p",{className:"hint",children:t("Agent and group status; starting over archives the conversation and preserves memory.")}),o.agents.length+o.groups.length===0?e(_,{children:t("No agents.")}):null,o.agents.map((i)=>e(C,{agent:i,groups:o.groups,agents:o.agents,guildId:o.guildId,now:s,refresh:l},i.name)),o.groups.map((i)=>e(I,{group:i,guildId:o.guildId,now:s,timeZone:a.timeZone,refresh:l},i.name))]}),n("section",{className:"stack",children:[e("h2",{children:t("My workspaces")}),e("p",{className:"hint",children:t("Direct messages and channels where you mention the assistant. Start over archives; delete removes every archive permanently.")}),o.workspaces?.length?o.workspaces.map((i)=>e(b,{conversation:i,schedules:i.schedules,now:s,refresh:l},i.key)):e(_,{children:t("No workspaces.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Outside-agent conversations")}),e("p",{className:"hint",children:t("Conversations opened through remote MCP; after deletion the session ID cannot be resumed.")}),o.outside?.length?o.outside.map((i)=>e(b,{conversation:i,now:s,refresh:l},i.key)):e(_,{children:t("No outside-agent conversations.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Party channels")}),e("p",{className:"hint",children:t("Starting over stops the container and archives role conversations; each speaker's memory is preserved.")}),o.party?.length?o.party.map((i)=>e(A,{party:i,now:s,refresh:l},i.key)):e(_,{children:t("No party channels.")})]})]})}function f({busy:a}){return e(P,{tone:a?"busy":"plain",children:a===0?t("idle"):a===1?t("Working"):t("Working, {count} waiting",{count:a-1})})}function I(a){let{group:s,now:d,timeZone:g}=a;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[s.channelId?e("a",{href:Yn(s.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:s.displayName}):e("strong",{children:s.displayName}),e(P,{children:t("Group")}),e(f,{busy:s.busy})]}),e("p",{children:t("Members: {members} | Host: {host}",{members:s.members.join(", "),host:s.host})}),n("p",{className:"hint",children:[t("Last active")," ",De(s.lastActive,d,g)]}),s.channelId?e(v,{channel:`discord:${s.channelId}`,title:s.displayName,busy:s.busy>0,refresh:a.refresh}):null]})}function C(a){let{agent:s}=a,{timeZone:d,panes:g}=k(),l=a.groups.find((i)=>i.channelId===s.workingIn),o=a.agents.find((i)=>i.channelId===s.workingIn),h=!s.workingIn?void 0:s.workingIn===s.channelId?t("Working in own channel"):l?t("Working in group {name}",{name:l.displayName}):o?t("Replying in {name}'s channel",{name:o.displayName}):t("Replying in another channel");return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:s.channelId?e("a",{href:Yn(s.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:s.displayName}):s.displayName}),e(P,{children:"agent"}),s.workingIn?e(f,{busy:1+s.waiting}):s.waiting>0?e(P,{tone:"busy",children:t("{count} waiting",{count:s.waiting})}):e(P,{children:t("idle")})]}),h?e("p",{children:h}):null,n("dl",{className:"facts",children:[n("div",{children:[e("dt",{children:t("Model")}),n("dd",{children:[s.model," · thinking ",s.thinking]})]}),n("div",{children:[e("dt",{children:t("Context")}),e("dd",{children:s.context?s.context.tokens===null?t("Just compacted (limit {limit})",{limit:gi(s.context.contextWindow)}):`${gi(s.context.tokens)} / ${gi(s.context.contextWindow)} (${Math.round(s.context.tokens/s.context.contextWindow*100)}%)`:"—"})]}),n("div",{children:[e("dt",{children:t("Schedules")}),e("dd",{children:s.schedules})]}),n("div",{children:[e("dt",{children:t("Last active")}),e("dd",{children:De(s.lastActive,a.now,d)})]})]}),s.channelId?n(m,{children:[e(v,{channel:`discord:${s.channelId}`,title:s.displayName,busy:!!s.workingIn||s.waiting>0,refresh:a.refresh}),g.includes("conversations")?e("a",{href:S("conversations",`discord:${s.channelId}`),children:t("transcript")}):null]}):null]})}function b({conversation:a,schedules:s,now:d,refresh:g}){let{timeZone:l,panes:o}=k(),{title:h,detail:i}=a.kind==="outside"?{title:a.firstMessage||t("(No messages)"),detail:a.id}:tn(a.channel,a.id);return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel&&a.channel.kind!=="gone"?e("a",{href:Yn(a.id,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:h}):h}),e(f,{busy:a.busy})]}),i?e("p",{className:"hint",children:i}):null,e("p",{children:a.liveBytes>0?t("Conversation {size} · Archives {count}",{size:ke(a.liveBytes),count:a.archives}):t("No live conversation · Archives {count}",{count:a.archives})}),a.startedAt?n("p",{children:[t("Started")," ",te(a.startedAt,l)]}):null,n("p",{className:"hint",children:[s!==void 0?`${t("Schedules")} ${s} · `:"",t("Last active")," ",De(a.lastActive,d,l)]}),e(v,{channel:a.key,title:h,busy:a.busy>0,deletable:!0,refresh:g}),o.includes("conversations")?e("a",{href:S("conversations",a.key),children:t("transcript")}):null]})}function A({party:a,now:s,refresh:d}){let{timeZone:g}=k(),{title:l,detail:o}=tn(a.channel,a.channelId),h={running:c("Container running"),stopped:c("Container stopped"),missing:c("No container yet"),unknown:c("Container status unknown")};return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel.kind!=="gone"?e("a",{href:Yn(a.channelId,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:l}):l}),e(P,{children:a.profile}),e(P,{children:t(h[a.container])}),e(f,{busy:a.busy})]}),o?e("p",{className:"hint",children:o}):null,e("p",{children:t("Enabled by {name} at {time}",{name:a.enabledBy,time:te(a.enabledAt,g)})}),n("p",{className:"hint",children:[t("Last active")," ",De(a.lastActive,s,g)]}),e(v,{channel:a.key,title:l,busy:a.busy>0,refresh:d})]})}export{K as OverviewPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,A,o,r,t,e,n,s,S,K,d,nn,de}from"./chunk-index-zynq0b0w.js";import{I}from"./chunk-index-vcyzwtk2.js";import{Vn}from"./chunk-index-cvbdf2ca.js";function T(m){let[f,v]=r(""),[p,h]=r(0),g=o(null),b=d((l)=>l.order.flatMap((i)=>{let c=l.rooms[i]?.view;return c?[{key:i,name:c.displayName,agent:c.name,character:c.character,kind:c.kind}]:[]})),u=A(()=>[...b.map((i)=>({id:i.key,label:i.name,hint:i.kind==="agent"?t("Agent"):i.kind==="group"?t("Group"):t("Thread"),room:!0,...i.kind==="agent"?{avatar:{name:i.agent,character:i.character}}:{icon:"conversations"},go:()=>K("room",i.key)})),...m.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>K(i.pane)}))].flatMap((i)=>{let c=Vn(f,i.label);return c===void 0?[]:[{target:i,score:c}]}).sort((i,c)=>c.score-i.score).map((i)=>i.target).slice(0,12),[b,m.pages,f]);a(()=>h(0),[f]),a(()=>{if(m.open)v(""),requestAnimationFrame(()=>g.current?.focus())},[m.open]);let y=(l)=>{if(!l)return;m.onClose(),l.go()};return e(I,{open:m.open,title:t("Find a room"),onClose:m.onClose,variant:"palette",children:n("div",{className:"palette-box",children:[n("div",{className:"palette-input",children:[e(s,{name:"search",size:18}),e("input",{ref:g,value:f,placeholder:t("Find a room or page"),"aria-label":t("Find a room or page"),role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":u[p]?`palette-${p}`:void 0,onChange:(l)=>v(l.target.value),onKeyDown:(l)=>{if(nn(l.nativeEvent))return;if(l.key==="ArrowDown")l.preventDefault(),h((i)=>Math.min(u.length-1,i+1));else if(l.key==="ArrowUp")l.preventDefault(),h((i)=>Math.max(0,i-1));else if(l.key==="Enter")l.preventDefault(),y(u[p])}}),e("kbd",{children:"Esc"})]}),n("ul",{className:"palette-list",children:[u.length===0?e("li",{className:"palette-empty",children:t("Nothing matches.")}):null,u.map((l,i)=>e("li",{"data-active":i===p||void 0,children:n("a",{href:l.room?S("room",l.id):S(l.id),onClick:(c)=>{c.preventDefault(),y(l)},onMouseMove:()=>h(i),"aria-current":i===p?"true":void 0,children:[l.avatar?e(de,{spec:l.avatar.character,name:l.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(s,{name:l.icon??"list",size:16})}),e("span",{className:"palette-label",children:l.label}),e("span",{className:"meta",children:l.hint})]})},l.id))]})]})})}export{T as Palette};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Tr,Zs}from"./chunk-index-xh0mg9cw.js";import"./chunk-index-wrm8w165.js";import"./chunk-index-b8nvhcx5.js";export{Zs as folderMenu,Tr as placementItems};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X,a,o,r,t,c,m,e,n,s,y,u,x,p,P,Pi}from"./chunk-index-zynq0b0w.js";import{j}from"./chunk-index-w31c4yjv.js";import"./chunk-index-0q15ysrb.js";import"./chunk-index-vcyzwtk2.js";import{le}from"./chunk-index-0xh24y25.js";var T=3000;function B({profile:i}){return n("div",{className:"who",children:[i.picture?e("img",{className:"who-picture",src:`api/people/${encodeURIComponent(i.principal)}/picture`,alt:""}):e("span",{className:"who-initial","aria-hidden":"true",children:Array.from(i.name)[0]??"?"}),n("div",{className:"stack",children:[e("strong",{children:i.name}),i.tier?n("span",{className:"meta",children:[e(s,{name:"shield",size:14})," ",t(z[i.tier])]}):null]})]})}function R({link:i,labels:C,changed:d}){let[l,f]=r(),[h,k]=r(!1),[L,V]=r(),[b,w]=r(!1),N=i.pending!==void 0||l!==void 0,q=o(void 0);a(()=>{if(!N||i.linked)return;return q.current=setInterval(()=>{le.links().then((v)=>{let I=v.links.find((A)=>A.provider===i.provider);if(I)d(I)},()=>{return})},T),()=>clearInterval(q.current)},[N,i.linked,i.provider,d]);let S=async(v)=>{k(!0),V(void 0);try{await v()}catch(I){V(u(I))}finally{k(!1)}},g=i.blockedBy.length>0;return n("li",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:i.label}),i.linked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Linked"),i.linked.displayName?` · ${i.linked.displayName}`:""]}):i.step==="required"?e(P,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(P,{children:t("Recommended")}):null]}),L?e(p,{message:L}):null,i.linked?i.linked.locked?e("p",{className:"meta",children:t("The server's configuration links this account.")}):n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:h,onClick:()=>w(!0),children:t("Unlink")}),e(j,{open:b,title:t("Unlink {name}?",{name:i.label}),confirmLabel:t("Unlink"),tone:"danger",onClose:()=>w(!1),onConfirm:async()=>{d(await le.unlink(i.provider)),f(void 0)},children:e("p",{children:t("The app will no longer know this account is yours. You can link it again later.")})})]}):N?n("div",{className:"stack",children:[l?n(m,{children:[e("p",{children:l.instructions}),e("p",{className:"meta",children:t("Your code")}),e("code",{className:"link-code",children:l.code}),e("p",{className:"meta",children:t("The code works until {time}.",{time:new Date(l.expiresAt).toLocaleTimeString()})})]}):e("p",{className:"meta",children:t("A code is waiting to be used.")}),i.pending?.redeemedBy?n("p",{children:[e(s,{name:"check",size:14})," ",t("{name} used the code. Confirm that this is you.",{name:i.pending.redeemedBy.displayName})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:h,onClick:()=>S(async()=>{d(await le.cancelLink(i.provider)),f(void 0)}),children:t("Cancel")}),e("button",{type:"button",disabled:h,onClick:()=>S(async()=>{let v=l?.request??i.pending?.request;if(!v)return;d(await le.confirmLink(i.provider,v)),f(void 0)}),children:t("I did it")})]})]}):n("div",{className:"stack",children:[g?e("p",{className:"meta",children:t("Link {name} first.",{name:i.blockedBy.map((v)=>C[v]??v).join(", ")})}):null,e("div",{className:"actions",children:e("button",{type:"button",disabled:h||g,onClick:()=>S(async()=>{f(await le.issueLink(i.provider)),d((await le.links()).links.find((v)=>v.provider===i.provider)??i)}),children:t("Link")})})]})]})}function E(){let i=Intl.DateTimeFormat().resolvedOptions().timeZone,[C,d]=r(),[l,f]=r({start:"22:00",end:"07:00"}),[h,k]=r(!1),[L,V]=r(!1),[b,w]=r(),[N,q]=r();a(()=>{le.pushPrefs().then((g)=>{if(d(g.quiet),g.quiet)f(g.quiet);k(!0)},()=>k(!0))},[]);let S=async(g)=>{V(!0),q(void 0),w(void 0);try{await g()}catch(v){q(u(v))}finally{V(!1)}};if(!h)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:t("In your quiet hours a normal notice waits in the bell instead of ringing your phone. An urgent one still rings.")}),n("div",{className:"quiet-row",children:[n("label",{children:[t("From")," ",e("input",{type:"time",value:l.start,onChange:(g)=>f({...l,start:g.target.value})})]}),n("label",{children:[t("To")," ",e("input",{type:"time",value:l.end,onChange:(g)=>f({...l,end:g.target.value})})]}),e("span",{className:"meta",children:i})]}),N?e(p,{message:N}):null,b?e("p",{className:"meta",children:b}):null,n("div",{className:"actions",children:[C?e("button",{type:"button",className:"secondary",disabled:L,onClick:()=>S(async()=>{await le.setPushPrefs(null),d(void 0)}),children:t("Turn off quiet hours")}):null,e("button",{type:"button",className:"secondary",disabled:L,onClick:()=>S(async()=>{await le.pushTest(),w(t("A test notification is on its way."))}),children:t("Send a test notification")}),e("button",{type:"button",disabled:L||l.start===l.end,onClick:()=>S(async()=>{let g=await le.setPushPrefs({...l,timeZone:i});d(g.quiet)}),children:t("Save")})]})]})}function O({profile:i,changed:C}){let[d,l]=r();if(i.sources.length===0)return null;let f=async(h)=>{l(void 0);try{C(await le.chooseSource(h))}catch(k){l(u(k))}};return n("section",{className:"card stack",children:[e("h2",{children:t("Shown as")}),e("p",{className:"meta",children:t("The name and picture of this account are what others see in the app.")}),n("fieldset",{className:"choice",children:[e("legend",{className:"visually-hidden",children:t("Shown as")}),n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===void 0,onChange:()=>f(null)}),t("Automatic")]}),i.sources.map((h)=>n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===h.provider,onChange:()=>f(h.provider)}),t(h.label)]},h.provider))]}),d?e(p,{message:d}):null]})}function G(){let[i,C]=r(),[d,l]=r(),[f,h]=r(),[k,L]=r();a(()=>{y.session().then(C,(b)=>L(u(b))),le.profile().then(l,()=>{return}),le.links().then(h,()=>{return})},[]);let V=X((b)=>{h((w)=>w?{links:w.links.map((N)=>N.provider===b.provider?b:N)}:w),le.profile().then(l,()=>{return})},[]);if(k)return e(p,{message:k});if(!i)return e(x,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Profile")})}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),d?e(B,{profile:d}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(Pi,{auth:i.auth})]}),f&&f.links.length>0?n("section",{className:"stack",children:[e("h2",{children:t("Your accounts")}),e("ul",{className:"stack notices",children:f.links.map((b)=>e(R,{link:b,labels:Object.fromEntries(f.links.map((w)=>[w.provider,w.label])),changed:V},b.provider))})]}):null,d?e(O,{profile:d,changed:l}):null,i.push?e(E,{}):null]})}var z={owner:c("Owner"),admin:c("Admin"),member:c("Member")};export{G as ProfilePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,r,t,e,n,u,x,p,_,P,k,te}from"./chunk-index-zynq0b0w.js";import{at}from"./chunk-index-kwcx62wb.js";import{I}from"./chunk-index-vcyzwtk2.js";function U(i){let{open:m,load:v}=i,{timeZone:y}=k(),[s,f]=r(),[c,g]=r(),[h,b]=r();a(()=>{if(!m)return;let o=!0;return f(void 0),g(void 0),b(void 0),v().then((d)=>o&&f(d),(d)=>o&&g(u(d))),()=>{o=!1}},[m]);let l=s?.find((o)=>o.id===h);return e(I,{open:m,title:i.title,size:"wide",onClose:i.onClose,children:n("div",{className:"stack history",children:[c?e(p,{message:c}):null,!s&&!c?e(x,{}):null,s?.length===0?e(_,{children:t("No changes have been kept yet.")}):null,s&&s.length>0?e("ul",{className:"menu",children:s.map((o)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":o.id===h,onClick:()=>b(o.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:o.by}),e("span",{className:"meta",children:te(o.at,y)})]}),o.revert?e(P,{children:t("Back to the file version")}):null]})},o.id))}):null,l?n("section",{className:"stack","aria-label":t("This change"),children:[e(at,{label:t("This change"),before:l.previous,after:l.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>i.onUse(l.text),children:t("Use this text")})})]}):null]})})}export{U as HistorySheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,M,w,X,a,D,r,t,c,m,e,n,s,oe,u,O,x,p,_,P,k,te}from"./chunk-index-zynq0b0w.js";import{Ee,at}from"./chunk-index-kwcx62wb.js";import{I}from"./chunk-index-vcyzwtk2.js";var U={"Shared prompt":c("Shared prompt"),"Guest prompt":c("Guest prompt"),"The base every agent's prompt starts with, the main assistant's included.":c("The base every agent's prompt starts with, the main assistant's included."),"Used instead of the shared prompt when the person speaking is not the owner.":c("Used instead of the shared prompt when the person speaking is not the owner.")},C=(l)=>t(U[l]??l);var G=w(()=>(h("7enzp2p3"),import("./chunk-prompt-history-7enzp2p3.js")).then((l)=>({default:l.HistorySheet}))),Z=w(()=>(h("p3mts8mx"),import("./chunk-confirm-p3mts8mx.js")).then((l)=>({default:l.Confirm})));function me(){let{timeZone:l}=k(),[N,i]=r(),[f,b]=r(),[v,y]=r(),S=X(()=>{Ee.prompts().then((d)=>i(d.documents),(d)=>b(u(d)))},[]);return a(S,[S]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the assistant and the agents start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),f?e(p,{message:f}):null,!N&&!f?e(x,{}):null,N?.length===0?e(_,{children:t("No prompts to edit.")}):null,N?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(d.label)}),d.differs?e(P,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(P,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:C(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:te(d.override.at,l)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>y(d.id),children:t("Edit")})})]},d.id)),v?e(q,{id:v,onClose:()=>{y(void 0),S()}}):null]})}function q({id:l,onClose:N}){let[i,f]=r(),[b,v]=r(""),[y,S]=r(),[d,R]=r(!1),[E,B]=r(!1),[H,T]=r(!1),[V,F]=r(!1),z=D();a(()=>{let o=!0;return Ee.prompt(l).then((g)=>{if(!o)return;f(g),v(g.text)},(g)=>o&&S(u(g))),()=>{o=!1}},[l]);let A=async()=>{if(!i)return;B(!0);try{let o=await Ee.savePrompt(l,{text:b,base:i.text});f(o),v(o.text),R(!1),O(t("Saved."))}catch(o){if(o instanceof oe&&o.status===409){let{current:g}=o.body;f(g),O(o.message,"danger")}else O(u(o),"danger")}finally{B(!1)}},L=i!==void 0&&b!==i.text;return n(I,{open:!0,title:i?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[y?e(p,{message:y}):null,!i&&!y?e(x,{}):null,i?.broken?e(p,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(P,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(at,{label:t("Prompt"),before:i.text,after:b}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:E,onClick:()=>R(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:E,onClick:A,children:E?t("Saving…"):t("Save")})]})]}):n(m,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:z,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>T(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:z,className:"prompt-full",value:b,maxLength:i.maxChars,onChange:(o)=>v(o.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>F(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!L||!b.trim(),onClick:()=>R(!0),children:t("Review changes")})]})]}),H?e(M,{fallback:null,children:e(G,{open:H,title:t("History of {name}",{name:C(i.label)}),load:async()=>(await Ee.promptHistory(l)).versions.map((o)=>({id:o.id,text:o.text,previous:o.previous,by:o.by,at:o.at,revert:o.action==="revert"})),onUse:(o)=>{v(o),R(!1),T(!1)},onClose:()=>T(!1)})}):null,V?e(M,{fallback:null,children:e(Z,{open:V,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 o=await Ee.revertPrompt(l,{base:i.text});f(o),v(o.text),R(!1),O(t("Back to the file version."))}catch(o){if(!(o instanceof oe&&o.status===409))throw o;let{current:g}=o.body;f(g),O(o.message,"danger")}},onClose:()=>F(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{me as PromptsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Di}from"./chunk-index-v3bmr0nw.js";import"./chunk-index-ybtvvx85.js";import"./chunk-index-w31c4yjv.js";import"./chunk-index-vcyzwtk2.js";import"./chunk-index-p53ak25v.js";import"./chunk-index-wrm8w165.js";import"./chunk-index-b8nvhcx5.js";export{Di as RoomConfirmHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,r,t,m,e,n,s,S,d,k,Ye,Qt,Ce,bt}from"./chunk-index-zynq0b0w.js";import{Me}from"./chunk-index-wrm8w165.js";import{ot}from"./chunk-index-pk1yxkv4.js";import{I}from"./chunk-index-vcyzwtk2.js";import{He}from"./chunk-index-mq0dacwr.js";var p="room-menu-yolo",N="room-menu-long",f="room-menu-mute";function T(a){let[i,l]=r(!1),u=k().app?.modes!==!1,b=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),c=d((o)=>o.pins.includes(a.room),a.room),g=a.mode??{yolo:!1,longRunning:!1},y=async(o)=>{l(!0),await Qt(a.room,{longRunning:o}),l(!1)};return e(I,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:S("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the agent that started this thread.")})]}),e(s,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:f,children:[e("span",{className:"menu-icon",children:e(s,{name:a.muted?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(ot,{id:f,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{l(!0),await He(a.room,!o),l(!1)},busy:i})]})}),a.readOnly||!u?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:p,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(s,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(ot,{id:p,checked:g.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else l(!0),Qt(a.room,{yolo:!1}).then(()=>l(!1))},busy:i})]})}),a.readOnly||!u?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(s,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(ot,{id:N,checked:g.longRunning,label:t("Long-running mode"),onChange:y,busy:i})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ye(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit agent")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(s,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),bt({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(s,{name:"chevron",size:16})]})}):null,a.readOnly||!b?null:n(m,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(h("48ecgtkg"),import("./chunk-layout-actions-48ecgtkg.js")).then((o)=>o.pinRoom(a.room,!c))},children:[e("span",{className:"menu-icon",children:e(s,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:c?t("Unpin"):t("Pin")}),e("span",{className:"meta",children:t("Keep this room at the top of the list.")})]})]})}),e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Me({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(s,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(s,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),Ce({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive agent")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{T as RoomMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,e,s,d}from"./chunk-index-zynq0b0w.js";import"./chunk-index-wrm8w165.js";import{Ln}from"./chunk-index-4t0r3t3b.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>Ln(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,M,w,X,a,D,A,o,r,t,c,m,e,n,s,K,d,oe,y,u,O,x,p,_,on,ps,ms,Ce,jn,ys,de,_n}from"./chunk-index-zynq0b0w.js";import{j}from"./chunk-index-w31c4yjv.js";import"./chunk-index-wrm8w165.js";import"./chunk-index-p53ak25v.js";import{ve,gt,Di}from"./chunk-index-v3bmr0nw.js";import{dn}from"./chunk-index-z9x4cnzf.js";import{Ee,at}from"./chunk-index-kwcx62wb.js";import{ot}from"./chunk-index-pk1yxkv4.js";import"./chunk-index-ybtvvx85.js";import{I}from"./chunk-index-vcyzwtk2.js";import{He}from"./chunk-index-mq0dacwr.js";import"./chunk-index-b8nvhcx5.js";function ie(l){return n("fieldset",{className:"field",children:[e("legend",{children:l.label}),e("div",{className:"option-chips",children:l.options.map((f)=>e("button",{type:"button","aria-pressed":f.value===l.value,className:"option-chip",onClick:()=>l.onChange(f.value),children:f.label},f.value))})]})}var Re=w(()=>(h("7enzp2p3"),import("./chunk-prompt-history-7enzp2p3.js")).then((l)=>({default:l.HistorySheet}))),Te=w(()=>(h("bd426yjw"),import("./chunk-character-creator-bd426yjw.js")).then((l)=>({default:l.CharacterCreator}))),xe=["default","off","minimal","low","medium","high","xhigh"],be={default:c("Follow the assistant (automatic)"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},G="default",me=(l)=>t(be[l]??l),he=(l)=>({displayName:l.displayName,prompt:l.prompt,model:l.model??G,thinking:l.thinking??G});function ge(l,f){return{...f.displayName!==l.displayName?{displayName:f.displayName}:{},...f.prompt!==l.prompt?{prompt:f.prompt}:{},...f.model!==(l.model??G)?{model:f.model}:{},...f.thinking!==(l.thinking??G)?{thinking:f.thinking}:{}}}function ye(){let l=ms(),f=o(l);if(l)f.current=l;let i=f.current,N=l!==void 0;if(a(()=>{if(!N)return;let L=window.location.href,E=()=>{if(window.location.href!==L)on()};return window.addEventListener("popstate",E),window.addEventListener("hashchange",E),()=>{window.removeEventListener("popstate",E),window.removeEventListener("hashchange",E)}},[N]),!i)return null;return e(I,{open:l!==void 0,title:t("Edit agent"),size:"wide",onClose:on,children:e(Oe,{name:i.name,opened:i.id},i.name)})}function Oe({name:l,opened:f}){let[i,N]=r(),[L,E]=r([]),[k,V]=r(),[C,T]=r(),[g,R]=r(!1),[F,z]=r(!1),[ee,Q]=r(!1),[B,q]=r(!1),te=_n(i?.room??""),W=o(null),Y=i!==void 0,U=d((b)=>i?b.rooms[i.room]?.view?.muted===!0:!1,i?.room??""),[ae,H]=r(!1),ne=d((b)=>i?b.rooms[i.room]?.view?.coordinator===!0:!1,i?.room??""),J=D(),Z=D(),S=D();a(()=>{if(!Y||!ps()?.look)return;W.current?.scrollIntoView({block:"start"}),W.current?.focus({preventScroll:!0})},[Y,f]);let v=o({});v.current={profile:i,draft:C},a(()=>{let b=!0;return Promise.all([y.agent(l),y.models()]).then(([re,Pe])=>{if(!b)return;let{profile:fe,draft:le}=v.current,Fe=fe&&le&&Object.keys(ge(fe,le)).length>0;N(re),E(Pe.models),T(Fe?le:he(re))},(re)=>b&&V(u(re))),()=>{b=!1}},[l,f]);let P=A(()=>i&&C?ge(i,C):{},[i,C]);if(k)return e(p,{message:k});if(!i||!C)return e(x,{});let pe=Object.keys(P).length>0,De=Array.from(new Set([G,...L,C.model])),ue=async()=>{R(!0);try{let b=await y.updateAgent(l,P);N(b),T(he(b)),z(!1),O(t("Saved."))}catch(b){O(u(b),"danger")}finally{R(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(de,{spec:i.character,name:i.name,size:72,state:te,label:i.displayName}),n("div",{children:[e("h3",{children:i.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:i.effective.model,thinking:me(i.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:S,children:[e("span",{className:"menu-icon",children:e(s,{name:U?"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(ot,{id:S,checked:!U,label:t("Notifications"),busy:ae,onChange:async(b)=>{H(!0),await He(i.room,!b),H(!1)}})]})})}),F?e(ze,{profile:i,draft:C,saving:g,onBack:()=>z(!1),onSave:ue}):n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),!pe)return;if(P.prompt!==void 0)z(!0);else ue()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:C.displayName,onChange:(b)=>T({...C,displayName:b.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:J,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>q(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>Q(!0),children:[e(Ve,{}),t("Full screen")]})]})]}),e("textarea",{id:J,rows:8,value:C.prompt,onChange:(b)=>T({...C,prompt:b.target.value})})]}),e(ie,{label:t("Model"),value:C.model,onChange:(b)=>T({...C,model:b}),options:De.map((b)=>({value:b,label:b===G?t("Follow the assistant"):b}))}),e(ie,{label:t("Thinking level"),value:C.thinking,onChange:(b)=>T({...C,thinking:b}),options:xe.map((b)=>({value:b,label:t(be[b])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!pe||g,children:g?t("Saving…"):P.prompt!==void 0?t("Review changes"):t("Save")})})]}),e($e,{name:l,opened:f}),n("section",{className:"card stack",ref:W,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(M,{fallback:e(x,{}),children:e(Te,{name:i.name,displayName:i.displayName,prompt:i.prompt,character:i.character,onSaved:(b)=>N(b)})})]}),ne?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived agent stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{on(),Ce({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive {name}",{name:i.displayName})})})]}),B?e(M,{fallback:null,children:e(Re,{open:B,title:t("History of the prompt"),load:async()=>(await Ee.agentPromptHistory(l)).versions.map((b)=>({id:b.id,text:b.text,previous:b.previous,by:b.by,at:b.at})),onUse:(b)=>{T({...C,prompt:b}),q(!1)},onClose:()=>q(!1)})}):null,e(I,{open:ee,title:t("Prompt"),size:"full",onClose:()=>Q(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:C.prompt,onChange:(b)=>T({...C,prompt:b.target.value})})})]})}function $e({name:l,opened:f}){let[i,N]=r(),[L,E]=r(),[k,V]=r(),C=D();if(a(()=>{let g=!0;return ve.skills(l).then((R)=>g&&N(R),(R)=>{if(g&&!(R instanceof oe&&R.status===404))V(u(R))}),()=>{g=!1}},[l,f]),k)return e(p,{message:k});if(!i)return null;let T=async(g,R)=>{E(g);try{N(await ve.setSkills(l,R?{add:[g]}:{remove:[g]}))}catch(F){O(u(F),"danger")}finally{E(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),children:[e("h3",{children:t("Skills")}),e("p",{className:"meta",children:t("What the agent can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:i.skills.map((g,R)=>{let F=`${C}-${R}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:F,children:[n("span",{className:"menu-text",children:[e("strong",{children:g.name}),e("span",{className:"meta",children:g.missing?t("Its file cannot be read."):g.builtin?t("Built in: every agent carries it."):g.description??""})]}),e(ot,{id:F,checked:g.carried,label:g.name,busy:L===g.name,disabled:g.builtin,onChange:(z)=>T(g.name,z)})]})},g.name)})})]})}var Ve=()=>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 ze(l){let{profile:f,draft:i}=l,N=o(null);a(()=>N.current?.focus(),[]);let L=[];if(i.displayName!==f.displayName)L.push({label:t("Name"),before:f.displayName,after:i.displayName});let E=(k)=>k===G?t("Follow the assistant"):k;if(i.model!==(f.model??G))L.push({label:t("Model"),before:E(f.model??G),after:E(i.model)});if(i.thinking!==(f.thinking??G))L.push({label:t("Thinking level"),before:me(f.thinking??G),after:me(i.thinking)});return n("section",{ref:N,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),L.length?e("ul",{className:"review-fields",children:L.map((k)=>n("li",{children:[e("strong",{children:k.label}),e("span",{className:"review-before",children:k.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:k.after})]},k.label))}):null,e(at,{label:t("Prompt"),before:f.prompt,after:i.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:l.saving,onClick:l.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:l.saving,onClick:l.onSave,children:l.saving?t("Saving…"):t("Save")})]})]})}function Ne(){let[l,f]=r(),[i,N]=r(),[L,E]=r(),[k,V]=r(),C=X(async()=>{try{f((await ve.archive()).entries),N(void 0)}catch(g){N(u(g))}},[]);a(()=>{C()},[C]);let T=async(g)=>{E(g.name);try{if(g.kind==="agent")await ve.restoreAgent(g.name);else await ve.restoreGroup(g.name);await gt(),O(t("Restored {name}.",{name:g.displayName})),await C()}catch(R){O(u(R),"danger")}finally{E(void 0)}};if(i&&!l)return e(p,{message:i});if(!l)return e(x,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived agents and groups no longer answer. Their history is kept until you delete them.")}),l.length===0?e(_,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:l.map((g)=>n("li",{className:"menu-item",children:[e("span",{className:"menu-icon",children:e(s,{name:g.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:g.displayName}),n("span",{className:"meta",children:[g.kind==="agent"?t("Agent"):t("Group")," ·"," ",g.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:L===g.name,onClick:()=>T(g),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:L===g.name,onClick:()=>V(g),children:t("Delete")})]},`${g.kind}:${g.name}`))}),e(j,{open:k!==void 0,title:t("Delete {name}?",{name:k?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!k)return;if(k.kind==="agent")await ve.deleteAgent(k.name);else await ve.deleteGroup(k.name);await gt(),O(t("Deleted {name}.",{name:k.displayName})),await C()},children:e("p",{children:t("{name} and its messages in this app are deleted for good, and the name can be used again. This cannot be undone.",{name:k?.displayName??""})})})]})}var we=/^[a-z0-9-]{1,32}$/,ke=2,Se=6,se="\x00";function Ge(){let l=d((f)=>f.order.flatMap((i)=>{let N=f.rooms[i]?.view;return N?.kind==="agent"?[`${N.name}${se}${N.displayName}`]:[]}).join(`${se}${se}`));return A(()=>l===""?[]:l.split(`${se}${se}`).map((f)=>{let[i="",N=""]=f.split(se);return{name:i,displayName:N}}),[l])}function Ae(l){let f=Ge(),[i,N]=r(),[L,E]=r(),[k,V]=r(""),[C,T]=r(""),[g,R]=r(!1),[F,z]=r([]),[ee,Q]=r(""),[B,q]=r(!1),[te,W]=r(l.name===void 0),Y=D(),U=D();a(()=>{let S=l.name;if(S===void 0)return;let v=!0;return ve.group(S).then((P)=>{if(!v)return;N(P),V(P.displayName),z(P.members),Q(P.host),W(!0)},(P)=>v&&E(u(P))),()=>{v=!1}},[l.name]);let ae=(S)=>f.find((v)=>v.name===S)?.displayName??S,H=F.includes(ee)?ee:F[0]??"",ne=i===void 0?!0:k.trim()!==i.displayName||F.join(",")!==i.members.join(",")||H!==i.host,J=k.trim()!==""&&F.length>=ke&&F.length<=Se&&(i!==void 0||we.test(C));if(L&&!te)return e(p,{message:L});if(!te)return e(x,{});let Z=async()=>{q(!0),E(void 0);try{if(i){await ve.updateGroup(i.name,{...k.trim()!==i.displayName?{displayName:k.trim()}:{},...F.join(",")!==i.members.join(",")?{members:F}:{},...H!==i.host?{host:H}:{}}),await gt(),O(t("Saved.")),l.onDone();return}let S=await ve.createGroup({name:C,displayName:k.trim(),members:F,host:H});await gt(),O(t("Made {name}.",{name:S.displayName})),l.onDone(),K("room",S.room)}catch(S){E(u(S))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(S)=>{if(S.preventDefault(),J&&ne&&!B)Z()},children:[n("label",{htmlFor:Y,children:[t("Name"),e("input",{id:Y,value:k,autoComplete:"off",onChange:(S)=>{if(V(S.target.value),!i&&!g)T(S.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),i?null:n("label",{htmlFor:U,children:[t("Permanent name"),e("input",{id:U,value:C,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":C!==""&&!we.test(C),onChange:(S)=>{R(!0),T(S.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 6 agents. They take turns in the order picked.")}),e("ul",{className:"menu",children:f.map((S)=>{let v=F.includes(S.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:v,disabled:!v&&F.length>=Se,onChange:()=>z(v?F.filter((P)=>P!==S.name):[...F,S.name])}),e("span",{className:"menu-text",children:e("strong",{children:S.displayName})})]})},S.name)})})]}),F.length>=ke?e(ie,{label:t("Host"),value:H,onChange:Q,options:F.map((S)=>({value:S,label:ae(S)}))}):null,L?e(p,{message:L}):null,n("div",{className:"actions",children:[i?e("button",{type:"button",className:"danger",onClick:()=>{l.onDone(),Ce({kind:"archive",room:i.room,name:i.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!J||!ne||B,children:B?t("Saving…"):i?t("Save"):t("Make group")})]})]})}var Be=w(()=>(h("bd426yjw"),import("./chunk-character-creator-bd426yjw.js")).then((l)=>({default:l.CharacterCreator}))),Me=/^[a-z0-9-]{1,32}$/,ce="default";function Ke(l){let f=[];for(let i of l){let N=i.indexOf("/"),L=N>0?i.slice(0,N):"",E=f.find((k)=>k.provider===L&&L!=="");if(E)E.models.push(i);else f.push({provider:L,models:[i]})}return f}var Ue=(l)=>l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Le({onDone:l}){let[f,i]=r(""),[N,L]=r(""),[E,k]=r(!1),[V,C]=r(""),[T,g]=r(ce),[R,F]=r(""),[z,ee]=r(),[Q,B]=r(!1),[q,te]=r([]),[W,Y]=r(),[U,ae]=r(!1),H=[D(),D(),D(),D(),D()];a(()=>{let v=!0;return y.models().then((P)=>v&&te(P.models),()=>{return}),()=>{v=!1}},[]);let ne=A(()=>dn({name:N,displayName:f,prompt:V}),[N,f,V]),J=z?.spec??ne,Z=Me.test(N)&&f.trim()!==""&&V.trim()!=="";if(Q)return e(M,{fallback:e(x,{}),children:e(Be,{name:N||"new",displayName:f,prompt:V,character:J,onPick:(v,P)=>{ee({input:v,spec:P}),B(!1)},onCancel:()=>B(!1)})});let S=async()=>{ae(!0),Y(void 0);try{let v={name:N,displayName:f.trim(),prompt:V,...T!==ce?{model:T}:{},...R.trim()?{task:R.trim()}:{},...z?{character:z.input}:{}},P=await ve.createAgent(v);await gt(),O(t("Made {name}.",{name:P.displayName})),l(),K("room",P.room)}catch(v){Y(v instanceof oe&&v.field?`${v.field}: ${u(v)}`:u(v))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(v)=>{if(v.preventDefault(),Z&&!U)S()},children:[n("label",{htmlFor:H[0],children:[t("Name"),e("input",{id:H[0],value:f,autoComplete:"off",onChange:(v)=>{if(i(v.target.value),!E)L(Ue(v.target.value))}})]}),n("label",{htmlFor:H[1],children:[t("Permanent name"),e("input",{id:H[1],value:N,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":N!==""&&!Me.test(N),onChange:(v)=>{k(!0),L(v.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:H[2],children:[t("Prompt"),e("textarea",{id:H[2],rows:6,value:V,onChange:(v)=>C(v.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:H[4],children:[t("Model"),n("select",{id:H[4],value:T,onChange:(v)=>g(v.target.value),children:[e("option",{value:ce,children:t("Follow the assistant")}),Ke(q).map((v)=>v.provider===""?v.models.map((P)=>e("option",{value:P,children:P},P)):e("optgroup",{label:v.provider,children:v.models.map((P)=>e("option",{value:P,children:P},P))},v.provider))]})]}),n("label",{htmlFor:H[3],children:[t("Opening task"),e("textarea",{id:H[3],rows:3,value:R,onChange:(v)=>F(v.target.value)}),e("span",{className:"meta",children:t("Optional. The agent starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(de,{spec:J,name:N||"new",size:72,label:f}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:z?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>B(!0),children:t("Choose a look")})]})]}),W?e(p,{message:W}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||U,children:U?t("Making…"):t("Make agent")})})]})}var _e=(l)=>l.kind==="new-agent"?t("New agent"):l.kind==="archive"?t("Archived"):l.name===void 0?t("New group"):t("Edit group");function Ie(){let l=ys(),f=o(l);if(l)f.current=l;let i=f.current,N=l!==void 0;if(a(()=>{if(!N)return;let L=window.location.href,E=()=>{if(window.location.href!==L)jn()};return window.addEventListener("popstate",E),window.addEventListener("hashchange",E),()=>{window.removeEventListener("popstate",E),window.removeEventListener("hashchange",E)}},[N]),!i)return null;return e(I,{open:l!==void 0,title:_e(i),size:"wide",onClose:jn,children:e("div",{className:"stack agent-sheet",children:i.kind==="new-agent"?e(Le,{onDone:jn}):i.kind==="archive"?e(Ne,{}):e(Ae,{...i.name===void 0?{}:{name:i.name},onDone:jn})},i.id)})}function la(){return n(m,{children:[e(Di,{}),e(ye,{}),e(Ie,{})]})}export{la as SheetHosts};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{h,M,w,a,D,r,t,m,e,n,s,oe,u,O,x,p}from"./chunk-index-zynq0b0w.js";import{Ee,at}from"./chunk-index-kwcx62wb.js";import{I}from"./chunk-index-vcyzwtk2.js";var K=w(()=>(h("7enzp2p3"),import("./chunk-prompt-history-7enzp2p3.js")).then((c)=>({default:c.HistorySheet}))),B=`---
|
|
2
|
-
name: my-skill
|
|
3
|
-
description: "Use when "
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# My skill
|
|
7
|
-
|
|
8
|
-
`;function _(c){let{name:d}=c,[l,y]=r(),[f,v]=r(d?"":B),[b,F]=r(),[R,g]=r(!1),[k,C]=r(!1),[z,N]=r(!1),[H,S]=r(!1),T=D();a(()=>{if(!d)return;let i=!0;return Ee.skillDocument(d).then((o)=>{if(!i)return;y(o),v(o.text)},(o)=>i&&F(u(o))),()=>{i=!1}},[d]);let L=l?.text??"",A=f!==L,E=d!==void 0&&!l&&!b,U=async()=>{C(!0);try{if(l){let i=await Ee.saveSkillDocument(l.name,{text:f,baseHash:l.hash});y(i),v(i.text),g(!1),N(!1),O(t("Saved.")),c.onSaved()}else await Ee.createSkillDocument({text:f}),O(t("Skill created.")),c.onSaved(),c.onClose()}catch(i){if(i instanceof oe&&i.status===409){let{current:o}=i.body;y(o),N(!0)}else O(u(i),"danger")}finally{C(!1)}};return n(I,{open:!0,title:d??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(p,{message:b}):null,E?e(x,{}):null,l&&!l.writable?e(p,{message:t("This skill cannot be edited here.")}):null,!E&&!b&&(!l||l.writable)?n("div",{className:"stack",children:[R?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),z?e(p,{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(at,{label:"SKILL.md",before:L,after:f}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:k,onClick:()=>g(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:k,onClick:U,children:k?t("Saving…"):l?t("Save"):t("Create skill")})]})]}):n(m,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:T,children:"SKILL.md"}),l?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>S(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:T,className:"prompt-full",spellCheck:!1,value:f,onChange:(i)=>v(i.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!A||!f.trim(),onClick:()=>g(!0),children:t("Review changes")})})]}),H&&l?e(M,{fallback:null,children:e(K,{open:H,title:t("History of {name}",{name:l.name}),load:async()=>{let{versions:i}=await Ee.skillHistory(l.name);return i.map((o,V)=>({id:o.id,text:o.text,previous:i[V+1]?.text??"",by:o.by,at:o.at}))},onUse:(i)=>{v(i),g(!1),S(!1)},onClose:()=>S(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,er,M,w,a,r,t,m,e,n,s,y,u,x,p,_,P,Vt,Pt}from"./chunk-index-zynq0b0w.js";import{Oe}from"./chunk-index-gr6e0hse.js";import{ue}from"./chunk-index-ybtvvx85.js";import"./chunk-index-vcyzwtk2.js";function N({source:i}){return e("div",{className:"prose document",children:e(Vt,{remarkPlugins:[Pt],components:{a:({href:o,children:d})=>o&&/^https?:\/\//.test(o)?e("a",{href:o,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:o})=>e("span",{children:o}),pre:({children:o})=>e("div",{className:"code-block",children:e("pre",{children:o})}),table:({children:o})=>e("div",{className:"table-wrap",children:e("table",{children:o})})},children:i})})}var v=w(()=>(h("sz8an8qr"),import("./chunk-skill-editor-sz8an8qr.js")).then((i)=>({default:i.SkillEditor})));function q(){let[i,o]=r(0),{data:d,error:l}=Oe(()=>y.skills(),`skills:${i}`),[f,S]=r(),[g,k]=r();a(()=>{y.session().then(S,()=>{return})},[]);let b=f?.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:()=>k({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 an agent wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask an agent on Discord to edit their contents.")}),l?e(p,{message:l}):null,!d&&!l?e(x,{}):null,d?.length===0?e(_,{children:t("No skills.")}):null,d?.map((c)=>e(D,{skill:c,onEdit:b&&c.source.kind==="written"?()=>k({name:c.name}):void 0},`${c.name}:${i}`)),g?e(M,{fallback:null,children:e(v,{name:g.name,onSaved:()=>o((c)=>c+1),onClose:()=>k(void 0)},g.name??"")}):null]})}function E(i){switch(i.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:i.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${i.repo}:${i.path}`});default:return}}function D({skill:i,onEdit:o}){let[d,l]=r(!1),[f,S]=r(),[g,k]=r(),b=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Assistant-written"):i.source.kind==="package"?i.source.package:`${i.source.repo}:${i.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(P,{children:b}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(m,{children:[o?e("button",{type:"button",className:"secondary",onClick:o,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!f)k(void 0),y.skill(i.name).then(S).catch((c)=>k(u(c)))},children:"SKILL.md"})]})]}),e("p",{children:i.missing??i.description}),i.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(s,{name:"lock",size:14}),e("span",{children:E(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All agents"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(ue,{open:d,title:i.name,size:"wide",onClose:()=>l(!1),children:g?e(p,{message:g}):!f?e(x,{}):e(V,{title:i.name,detail:f})})]})}function V({title:i,detail:o}){let d=o.metadata.filter((l)=>!(l.key==="name"&&l.value===i));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((l)=>n(er,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(N,{source:o.body})]})}export{q as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A,o,r,t,xe,m,e,n,s,S,K,dt,Ie,d,nn,Bt,ln,Ve,vt,_i}from"./chunk-index-zynq0b0w.js";import{In,Dn,Un,Xt}from"./chunk-index-2yebd9tb.js";import{Vn}from"./chunk-index-cvbdf2ca.js";import{Ls}from"./chunk-index-zrvg23jd.js";In();function v(){let l=d((f)=>JSON.stringify(Ls(f,(a)=>Ie(f,a),(a)=>dt(f,a)>0,!0).map((a)=>({id:a.id,...a.title===void 0?{}:{title:a.title},entries:a.keys.map((h)=>({key:h,name:f.rooms[h]?.view?.displayName??h,waiting:dt(f,h)>0}))})))),c=Un(),y=o(l);if(!c)y.current=l;let u=y.current;return A(()=>JSON.parse(u),[u])}function b(l){let{key:c,name:y}=l.entry,u=d((i)=>i.rooms[c]),f=d((i)=>dt(i,c)),a=u?.view,h=Ve(a?.character),g=Xt(()=>Bt(c,l.onLeave),l.liftable&&!a?.home?Dn(c):void 0);if(!a)return null;return e("li",{...l.liftable&&!a.home?{"data-drop-item":"","data-key":c}:{},children:n("a",{className:"switcher-row",...g,href:S("room",c),"aria-current":c===l.current?"page":void 0,style:h,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(c)},children:[n("span",{className:"switcher-picture",children:[e(vt,{view:a,size:40}),f?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:y}),u?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(_i,{room:c}),f?e("span",{className:"badge badge-warn",children:xe(f,"{count} card waiting","{count} cards waiting")}):null,a.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,u?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,u?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[c,y]=r(""),u=v(),f=u.map((i)=>({...i,entries:i.entries.filter((p)=>Vn(c,p.name)!==void 0)})).filter((i)=>i.entries.length>0||c===""),a=(i)=>l.close(i===l.current?void 0:()=>K("room",i)),h=u.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),g=f.filter((i)=>i.entries.length>0).length>1;return n(m,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:c,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>y(i.target.value),onKeyDown:(i)=>{let p=f.flatMap((w)=>w.entries)[0];if(i.key==="Enter"&&p&&!nn(i.nativeEvent))a(p.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>ln(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:f.map((i)=>{let p=i.id==="waiting",w=i.id==="pinned"?"pinned":i.id==="rest"?"rest":p||i.id==="home"?void 0:"folder";return n("section",{"aria-label":p?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?h:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...w?{"data-drop-zone":w,"data-zone-id":i.id,...w==="folder"?{"data-folder":i.id}:{}}:{},children:[p?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):g||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?h:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(b,{entry:N,current:l.current,onPick:a,onLeave:l.close,liftable:!p&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,M,w,ge,a,r,t,e,n,ut,K,d,Ge,ye,bs}from"./chunk-index-zynq0b0w.js";import"./chunk-index-yzsgsvnp.js";import"./chunk-index-0fmmvgee.js";import"./chunk-index-rnxj3z8k.js";import{bn,fi,ls,hi,Bn,Ut}from"./chunk-index-7xffskfa.js";import{Vr,Xn}from"./chunk-index-b6ca02e8.js";import"./chunk-index-vcyzwtk2.js";var V=w(()=>(h("g3t392zz"),import("./chunk-table-seats-g3t392zz.js")).then((s)=>({default:s.TableSeatsSheet}))),F=300;function L(s){let[f,c]=r(!1);return a(()=>{if(!s){c(!1);return}if(ut()){c(!0);return}let l=setTimeout(()=>c(!0),F);return()=>clearTimeout(l)},[s]),f}function R(s,f,c,l){bs(s).then((p)=>{if(p)ye({...p,at:f,via:c,source:l})},()=>{return})}function W(){return ls((ge(Ge)?.kinds??[]).map((s)=>s.kind)),null}function Y({focus:s}){let[f,c]=r(),l=hi(void 0),p=Bn(),[C,v]=r(!1),[N,H]=r(!1),u=fi(),S=bn(),x=d((o)=>o.listed),k=u?S.loaded:x,i=u?null:Vr(s,l),b=l.find((o)=>o.name===i);a(()=>{if(s&&k&&i===null)K("table",void 0,{replace:!0})},[s,k,i]);let A=L(i!==null),g=(o)=>{if(u){let m=l.find((y)=>y.name===o);if(m)K("room",m.key);return}if(o===i)return;K("table",o??void 0,{replace:i!==null})},T=()=>{H(!0),v(!0)},E=!u&&l.length===0&&p.length>0,B=u&&S.loaded&&l.length===0;return n("div",{className:"table-page","data-focused":i!==null||void 0,children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[f?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>g(null),children:t("Reset view")}):null,!u&&p.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:T,children:t("Who's at the table")}):null]})]}),n("div",{className:"table-frame","data-focused":i!==null||void 0,children:[E?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("Every agent has left the table. Choose who sits down.")}),e("button",{type:"button",onClick:T,children:t("Who's at the table")})]}):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(Ut,{onHandle:c,focus:i,onFocus:g,onSeat:g,...u?{onMore:()=>K("rooms")}:{onSeatMenu:(o)=>{let m=l.find((y)=>y.name===o.id);if(m)R(m.key,o.at,o.via,o.source)}}}),u?e(W,{}):null,b?e(Xn,{roomKey:b.key,open:A,onBack:()=>g(null),onMenu:(o)=>{let m=o.getBoundingClientRect();R(b.key,{x:m.left,y:m.bottom},"key",o)}},b.key):null]}),N?e(M,{fallback:null,children:e(V,{open:C,onClose:()=>v(!1)})}):null]})}export{Y as TablePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D,r,t,e,n,vt}from"./chunk-index-zynq0b0w.js";import"./chunk-index-yzsgsvnp.js";import"./chunk-index-0fmmvgee.js";import"./chunk-index-rnxj3z8k.js";import{Bn}from"./chunk-index-7xffskfa.js";import{ot}from"./chunk-index-pk1yxkv4.js";import{I}from"./chunk-index-vcyzwtk2.js";import{He}from"./chunk-index-mq0dacwr.js";function u({view:s}){let o=D(),[a,m]=r(!1),l=s.muted===!0;return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",htmlFor:o,children:[e(vt,{view:s,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:s.displayName}),l?e("span",{className:"meta",children:t("Off the table")}):null]}),e(ot,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await He(s.key,!i),m(!1)}})]})})}function g(s){let o=Bn();return e(I,{open:s.open,title:t("Who's at the table"),onClose:s.onClose,children:n("div",{className:"stack table-seats",children:[e("p",{className:"meta",children:t("An agent who leaves the table is muted: its room stops pushing to you. A card that waits for you is always pushed.")}),e("ul",{className:"menu",children:o.map((a)=>e(u,{view:a},a.key))})]})})}export{g as TableSeatsSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gn,Wi,Yi,_t,Ht,jt,qn}from"./chunk-index-6twb7ccd.js";import{Dt}from"./chunk-index-jw7dtshr.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[v,R]of Object.entries(i))y.setAttribute(v,String(R));return p?.appendChild(y),y},ce=(d)=>{let i=/<svg[^>]*\swidth=/.test(d)?d:d.replace("<svg",'<svg width="256" height="256"');return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`},de=0;function fe(d,i){let p=i||d<=6?1:2;return{rows:p,perRow:Math.max(1,Math.ceil(d/p))}}function ye(d,i){let p=`t2d${++de}`,y=window.matchMedia("(prefers-reduced-motion: reduce)"),v=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??Dt,{theme:O,scheme:I}=i,S=[],_=new Map,L=new Map,E=i.focus??null,M=document.createElement("div");M.className="t2d";let f=t("svg",{role:"group","aria-label":R.table});if(M.appendChild(f),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(M);function X(e,s,c){let o=Math.max(1.6,c*0.022),g=o+Math.max(1.2,c*0.014),a=t("filter",{id:`${p}-rim`,x:"-15%",y:"-15%",width:"130%",height:"130%"},e);t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:g,result:"far"},a),t("feFlood",{"flood-color":s.ink,result:"ink"},a),t("feComposite",{in:"ink",in2:"far",operator:"in",result:"line"},a),t("feMorphology",{in:"SourceAlpha",operator:"dilate",radius:o,result:"near"},a),t("feFlood",{"flood-color":s.paper,result:"paper"},a),t("feComposite",{in:"paper",in2:"near",operator:"in",result:"rim"},a);let l=t("feMerge",{},a);for(let w of["line","rim","SourceGraphic"])t("feMergeNode",{in:w},l)}function x(){let e=gn(O,I);M.classList.toggle("reduced",v),M.classList.toggle("focus",E!==null),M.classList.toggle("dim",S.some((r)=>L.get(r.id)==="speaking"));let s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);f.setAttribute("viewBox",`0 0 ${c} ${o}`),f.replaceChildren();let g=Math.max(S.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},f);let w=t("defs",{},f),T=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:T,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},f),!s)t("ellipse",{cx:T,cy:N,rx:c*0.3,ry:o*0.2,fill:"none",stroke:e.css.ring,"stroke-width":3,opacity:e.night?0.9:0.7},f);let F=c/l,q=s?o*0.95:o/(a+0.6),m=Math.max(46,Math.min(F*0.94,132,q*1.05)),h=m*0.72,n=m*1.05;X(w,e,n),S.forEach((r,b)=>{let k=t("radialGradient",{id:`${p}-h${b}`},w);t("stop",{offset:0,"stop-color":r.color,"stop-opacity":0.95},k),t("stop",{offset:1,"stop-color":r.color,"stop-opacity":0},k)});let te=(r)=>{if(s)return o*0.92;return a===1?o*0.62:o*(0.46+r*0.3)};if(S.forEach((r,b)=>{let k=Math.floor(b/l),oe=Math.min(l,g-k*l),ne=b-k*l,re=c/oe*(ne+0.5),ie=te(k),H=L.get(r.id)??"idle",u=t("g",{class:"seat","data-seat":r.id,"data-state":H,...E===r.id?{"data-focus":""}:{},transform:`translate(${re.toFixed(1)} ${ie.toFixed(1)})`,tabindex:i.listBelow?-1:0,role:"button","aria-label":R.seat(r.name,H),color:e.css.text,...i.listBelow?{"aria-hidden":"true"}:{}},f);t("ellipse",{cx:0,cy:3,rx:m*0.55,ry:m*0.1,fill:"#000",opacity:0.35},u),t("ellipse",{class:"halo",cx:0,cy:-h-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},u),t("polygon",{class:"beam",points:`${-n*0.12},${-n*2.1} ${n*0.12},${-n*2.1} ${n*0.5},0 ${-n*0.5},0`,fill:r.color,opacity:0.2},u);let B=t("g",{class:"lift"},u),Y=_.get(r.id);if(Y)t("image",{href:ce(Y),x:-n/2,y:-h-n*0.78,width:n,height:n*0.88,filter:`url(#${p}-rim)`,...r.dim?{opacity:0.55}:{}},B);else{t("circle",{cx:0,cy:-h-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);let A=t("text",{x:0,y:-h-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":_t},B);A.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let Z=h*0.22;t("path",{d:`M ${-m*0.5} ${-h} L ${m*0.5} ${-h} L ${m*0.42} 0 L ${-m*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},u),t("rect",{x:-m*0.54,y:-h-Z*0.2,width:m*1.08,height:Z,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},u);let C=Math.max(11,Math.min(15,m*0.14)),K=Math.min(Math.max(m*0.9,C*5.5+14),Math.max(m*0.9,r.name.length*C*0.62+18),F*0.98),se=C+8;t("rect",{class:"plate",x:-K/2,y:-h*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},u);let ae=t("text",{x:0,y:-h*0.78+C+1.5,"text-anchor":"middle","font-size":C,"font-weight":700,"font-family":_t,fill:e.plateInk},u);ae.textContent=Yi(r.name,(K-8)/C);let J=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-h-n*0.78})`},u)),V=H==="done",D=H==="error",P=e.gold;if(V)P=Wi.done;else if(D)P=Wi.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},J);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":_t,fill:V||D?"#fff":e.ink},J);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let Q=t("g",{class:"orbit"},u);t("circle",{cx:n*0.4,cy:-h-n*0.5,r:n*0.05,fill:r.color},Q),t("circle",{cx:-n*0.4,cy:-h-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},Q),u.addEventListener("click",()=>i.onSeatClick({id:r.id,name:r.name})),u.addEventListener("keydown",(A)=>{if(A.key==="Enter"||A.key===" ")A.preventDefault(),i.onSeatClick({id:r.id,name:r.name})})}),!s){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:T-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},f);let k=t("text",{x:T,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":_t,fill:e.gold},f);k.textContent=Yi(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=gn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.add(l)};for(let g of e.joining){let a=[...f.querySelectorAll("g.seat[data-seat]")].find((l)=>l.getAttribute("data-seat")===g);if(!a)continue;a.classList.add("seat-in"),a.prepend(t("ellipse",{class:"seat-ring",rx:44,ry:12,cy:4,stroke:c.css.ring})),o(()=>{a.classList.remove("seat-in"),a.querySelector(".seat-ring")?.remove()},jt)}for(let g of e.leaving){let a=s.get(g);if(!a)continue;let l=a.cloneNode(!0);l.classList.add("seat-out");for(let w of["data-seat","tabindex","role","aria-label"])l.removeAttribute(w);l.setAttribute("aria-hidden","true");for(let[w,[T,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:T,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}f.appendChild(l),o(()=>l.remove(),Ht)}},W=new ResizeObserver(x);W.observe(d);let j=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",j);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=S.map((o)=>o.id),c=new Map([...f.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));S=e;for(let o of e)if(L.set(o.id,o.state??"idle"),o.avatarSvg)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(qn(s,e.map((o)=>o.id),v),c)},setState(e,s){if(L.get(e)===s)return;L.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){v=e,x()},resetCamera(){E=null,x(),i.onFocus?.(null)},focus(e){if(e===E)return;E=e,x()},focused:()=>E,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:v,loop:"idle",seats:S.length,renders:0}},dispose(){for(let e of G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",j),M.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};
|