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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f,Q,w,z,o,A,N,a,r,t,c,g,e,n,s,K,u,le,O,d,p,S,m,k,fn,_s,Ts,we,oi,Ms,he,En}from"./chunk-index-84v7j6vh.js";import{j}from"./chunk-index-7bbqtdce.js";import"./chunk-index-51n20yhb.js";import"./chunk-index-dep2e3f3.js";import{xe,xt,Wi}from"./chunk-index-d85x96q0.js";import{On}from"./chunk-index-yrhbhmxz.js";import{$e,dt}from"./chunk-index-4gk88a0x.js";import{ft}from"./chunk-index-1f0j335v.js";import{De}from"./chunk-index-cmxs5y22.js";import"./chunk-index-grkczq2c.js";import{D}from"./chunk-index-9nents16.js";import{tt}from"./chunk-index-satam151.js";import"./chunk-index-0h4h76kw.js";function se(i){return n("fieldset",{className:"field",children:[e("legend",{children:i.label}),e("div",{className:"option-chips",children:i.options.map((h)=>e("button",{type:"button","aria-pressed":h.value===i.value,className:"option-chip",onClick:()=>i.onChange(h.value),children:h.label},h.value))})]})}var Fe=w(()=>(f("hgbtcn4b"),import("./chunk-prompt-history-hgbtcn4b.js")).then((i)=>({default:i.HistorySheet}))),He=w(()=>(f("k67f77w5"),import("./chunk-character-creator-k67f77w5.js")).then((i)=>({default:i.CharacterCreator}))),Oe=["default","off","minimal","low","medium","high","xhigh"],ve={default:c("Default"),off:c("Off"),minimal:c("Minimal"),low:c("Low"),medium:c("Medium"),high:c("High"),xhigh:c("Very high")},B="default",be=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),Ve=c("Automatic"),me=(i)=>i==="auto"?t(Ve):t(ve[i]??i),fe=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??B,thinking:i.thinking??B});function ge(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??B)?{model:h.model}:{},...h.thinking!==(i.thinking??B)?{thinking:h.thinking}:{}}}function ye(){let i=Ts(),h=a(i);if(i)h.current=i;let l=h.current,C=i!==void 0;if(o(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)fn()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(D,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:fn,children:e(ze,{name:l.name,opened:l.id},l.name)})}function ze({name:i,opened:h}){let[l,C]=r(),[P,I]=r([]),[E,V]=r(),[M,F]=r(),[v,x]=r(!1),[R,G]=r(!1),[ee,J]=r(!1),[U,q]=r(!1),te=En(l?.room??""),W=a(null),X=l!==void 0,_=u((y)=>l?y.rooms[l.room]?.view?.muted===!0:!1,l?.room??""),[ae,H]=r(!1),ne=u((y)=>l?y.rooms[l.room]?.view?.coordinator===!0:!1,l?.room??""),Y=A(),Z=A(),L=A();o(()=>{if(!X||!_s()?.look)return;W.current?.scrollIntoView({block:"start"}),W.current?.focus({preventScroll:!0})},[X,h]);let b=a({});b.current={profile:l,draft:M},o(()=>{let y=!0;return Promise.all([O.agent(i),O.models()]).then(([ie,Te])=>{if(!y)return;let{profile:ue,draft:re}=b.current,Re=ue&&re&&Object.keys(ge(ue,re)).length>0;C(ie),I(Te.models),F(Re?re:fe(ie))},(ie)=>y&&V(d(ie))),()=>{y=!1}},[i,h]);let T=N(()=>l&&M?ge(l,M):{},[l,M]);if(E)return e(m,{message:E});if(!l||!M)return e(S,{});let de=Object.keys(T).length>0,Ie=Array.from(new Set([B,...P,M.model])),Pe=be(l),pe=async()=>{x(!0);try{let y=await O.updateAgent(i,T);C(y),F(fe(y)),G(!1),p(t("Saved."))}catch(y){p(d(y),"danger")}finally{x(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(he,{spec:l.character,name:l.name,size:72,state:te,label:l.displayName}),n("div",{children:[e("h3",{children:l.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:l.effective.model,thinking:me(l.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:L,children:[e("span",{className:"menu-icon",children:e(s,{name:_?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(ft,{id:L,checked:!_,label:t("Notifications"),busy:ae,onChange:async(y)=>{H(!0),await tt(l.room,!y),H(!1)}})]})})}),R?e(Ke,{profile:l,draft:M,saving:v,onBack:()=>G(!1),onSave:pe}):n("form",{className:"stack form",onSubmit:(y)=>{if(y.preventDefault(),!de)return;if(T.prompt!==void 0)G(!0);else pe()},children:[n("label",{htmlFor:Z,children:[t("Name"),e("input",{id:Z,value:M.displayName,onChange:(y)=>F({...M,displayName:y.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:Y,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:()=>J(!0),children:[e(Be,{}),t("Full screen")]})]})]}),e("textarea",{id:Y,rows:8,value:M.prompt,onChange:(y)=>F({...M,prompt:y.target.value})})]}),e(se,{label:t("Model"),value:M.model,onChange:(y)=>F({...M,model:y}),options:Ie.map((y)=>({value:y,label:y===B?Pe:y}))}),e(se,{label:t("Thinking level"),value:M.thinking,onChange:(y)=>F({...M,thinking:y}),options:Oe.map((y)=>({value:y,label:t(ve[y])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!de||v,children:v?t("Saving…"):T.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Ge,{name:i,opened:h}),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(Q,{fallback:e(S,{}),children:e(He,{name:l.name,displayName:l.displayName,prompt:l.prompt,character:l.character,onSaved:(y)=>C(y)})})]}),ne?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived knight stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{fn(),we({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive {name}",{name:l.displayName})})})]}),U?e(Q,{fallback:null,children:e(Fe,{open:U,title:t("History of the prompt"),load:async()=>(await $e.agentPromptHistory(i)).versions.map((y)=>({id:y.id,text:y.text,previous:y.previous,by:y.by,at:y.at})),onUse:(y)=>{F({...M,prompt:y}),q(!1)},onClose:()=>q(!1)})}):null,e(D,{open:ee,title:t("Prompt"),size:"full",onClose:()=>J(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:M.prompt,onChange:(y)=>F({...M,prompt:y.target.value})})})]})}function Ge({name:i,opened:h}){let[l,C]=r(),[P,I]=r(),[E,V]=r(),M=A();if(o(()=>{let v=!0;return xe.skills(i).then((x)=>v&&C(x),(x)=>{if(v&&!(x instanceof le&&x.status===404))V(d(x))}),()=>{v=!1}},[i,h]),E)return e(m,{message:E});if(!l)return null;let F=async(v,x)=>{I(v);try{C(await xe.setSkills(i,x?{add:[v]}:{remove:[v]}))}catch(R){p(d(R),"danger")}finally{I(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 knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:l.skills.map((v,x)=>{let R=`${M}-${x}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:R,children:[n("span",{className:"menu-text",children:[e("strong",{children:v.name}),e("span",{className:"meta",children:v.missing?t("Its file cannot be read."):v.builtin?t("Built in: every knight carries it."):v.description??""})]}),e(ft,{id:R,checked:v.carried,label:v.name,busy:P===v.name,disabled:v.builtin,onChange:(G)=>F(v.name,G)})]})},v.name)})})]})}var Be=()=>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 Ke(i){let{profile:h,draft:l}=i,C=a(null);o(()=>C.current?.focus(),[]);let P=[];if(l.displayName!==h.displayName)P.push({label:t("Name"),before:h.displayName,after:l.displayName});let I=(E)=>E===B?be(h):E;if(l.model!==(h.model??B))P.push({label:t("Model"),before:I(h.model??B),after:I(l.model)});if(l.thinking!==(h.thinking??B))P.push({label:t("Thinking level"),before:me(h.thinking??B),after:me(l.thinking)});return n("section",{ref:C,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),P.length?e("ul",{className:"review-fields",children:P.map((E)=>n("li",{children:[e("strong",{children:E.label}),e("span",{className:"review-before",children:E.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:E.after})]},E.label))}):null,e(dt,{label:t("Prompt"),before:h.prompt,after:l.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i.saving,onClick:i.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:i.saving,onClick:i.onSave,children:i.saving?t("Saving…"):t("Save")})]})]})}function Ne(){let[i,h]=r(),[l,C]=r(),[P,I]=r(),[E,V]=r(),M=z(async()=>{try{h((await xe.archive()).entries),C(void 0)}catch(v){C(d(v))}},[]);o(()=>{M()},[M]);let F=async(v)=>{I(v.name);try{if(v.kind==="agent")await xe.restoreAgent(v.name);else await xe.restoreGroup(v.name);await xt(),p(t("Restored {name}.",{name:v.displayName})),await M()}catch(x){p(d(x),"danger")}finally{I(void 0)}};if(l&&!i)return e(m,{message:l});if(!i)return e(S,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),i.length===0?e(k,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:i.map((v)=>n("li",{className:"menu-item",children:[e("span",{className:"menu-icon",children:e(s,{name:v.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:v.displayName}),n("span",{className:"meta",children:[v.kind==="agent"?t("Knight"):t("Group")," ·"," ",v.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:P===v.name,onClick:()=>F(v),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:P===v.name,onClick:()=>V(v),children:t("Delete")})]},`${v.kind}:${v.name}`))}),e(j,{open:E!==void 0,title:t("Delete {name}?",{name:E?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!E)return;if(E.kind==="agent")await xe.deleteAgent(E.name);else await xe.deleteGroup(E.name);await xt(),p(t("Deleted {name}.",{name:E.displayName})),await M()},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:E?.displayName??""})})})]})}var ke=/^[a-z0-9-]{1,32}$/,Ce=2,Se=6,oe="\x00";function Ue(){let i=u((h)=>h.order.flatMap((l)=>{let C=h.rooms[l]?.view;return C?.kind==="agent"?[`${C.name}${oe}${C.displayName}`]:[]}).join(`${oe}${oe}`));return N(()=>i===""?[]:i.split(`${oe}${oe}`).map((h)=>{let[l="",C=""]=h.split(oe);return{name:l,displayName:C}}),[i])}function Ae(i){let h=Ue(),[l,C]=r(),[P,I]=r(),[E,V]=r(""),[M,F]=r(""),[v,x]=r(!1),[R,G]=r([]),[ee,J]=r(""),[U,q]=r(!1),[te,W]=r(i.name===void 0),X=A(),_=A();o(()=>{let L=i.name;if(L===void 0)return;let b=!0;return xe.group(L).then((T)=>{if(!b)return;C(T),V(T.displayName),G(T.members),J(T.host),W(!0)},(T)=>b&&I(d(T))),()=>{b=!1}},[i.name]);let ae=(L)=>h.find((b)=>b.name===L)?.displayName??L,H=R.includes(ee)?ee:R[0]??"",ne=l===void 0?!0:E.trim()!==l.displayName||R.join(",")!==l.members.join(",")||H!==l.host,Y=E.trim()!==""&&R.length>=Ce&&R.length<=Se&&(l!==void 0||ke.test(M));if(P&&!te)return e(m,{message:P});if(!te)return e(S,{});let Z=async()=>{q(!0),I(void 0);try{if(l){await xe.updateGroup(l.name,{...E.trim()!==l.displayName?{displayName:E.trim()}:{},...R.join(",")!==l.members.join(",")?{members:R}:{},...H!==l.host?{host:H}:{}}),await xt(),p(t("Saved.")),i.onDone();return}let L=await xe.createGroup({name:M,displayName:E.trim(),members:R,host:H});await xt(),p(t("Made {name}.",{name:L.displayName})),i.onDone(),K("room",L.room)}catch(L){I(d(L))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(L)=>{if(L.preventDefault(),Y&&ne&&!U)Z()},children:[n("label",{htmlFor:X,children:[t("Name"),e("input",{id:X,value:E,autoComplete:"off",onChange:(L)=>{if(V(L.target.value),!l&&!v)F(L.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),l?null:n("label",{htmlFor:_,children:[t("Permanent name"),e("input",{id:_,value:M,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":M!==""&&!ke.test(M),onChange:(L)=>{x(!0),F(L.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 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:h.map((L)=>{let b=R.includes(L.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:b,disabled:!b&&R.length>=Se,onChange:()=>G(b?R.filter((T)=>T!==L.name):[...R,L.name])}),e("span",{className:"menu-text",children:e("strong",{children:L.displayName})})]})},L.name)})})]}),R.length>=Ce?e(se,{label:t("Host"),value:H,onChange:J,options:R.map((L)=>({value:L,label:ae(L)}))}):null,P?e(m,{message:P}):null,n("div",{className:"actions",children:[l?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),we({kind:"archive",room:l.room,name:l.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!Y||!ne||U,children:U?t("Saving…"):l?t("Save"):t("Make group")})]})]})}var _e=w(()=>(f("k67f77w5"),import("./chunk-character-creator-k67f77w5.js")).then((i)=>({default:i.CharacterCreator}))),Ee=/^[a-z0-9-]{1,32}$/,ce="default";function je(i){let h=[];for(let l of i){let C=l.indexOf("/"),P=C>0?l.slice(0,C):"",I=h.find((E)=>E.provider===P&&P!=="");if(I)I.models.push(l);else h.push({provider:P,models:[l]})}return h}var qe=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Me({onDone:i}){let[h,l]=r(""),[C,P]=r(""),[I,E]=r(!1),[V,M]=r(""),[F,v]=r(ce),[x,R]=r(""),[G,ee]=r(),[J,U]=r(!1),[q,te]=r([]),[W,X]=r(),[_,ae]=r(!1),H=[A(),A(),A(),A(),A()];o(()=>{let b=!0;return O.models().then((T)=>b&&te(T.models),()=>{return}),()=>{b=!1}},[]);let ne=N(()=>On({name:C,displayName:h,prompt:V}),[C,h,V]),Y=G?.spec??ne,Z=Ee.test(C)&&h.trim()!==""&&V.trim()!=="";if(J)return e(Q,{fallback:e(S,{}),children:e(_e,{name:C||"new",displayName:h,prompt:V,character:Y,onPick:(b,T)=>{ee({input:b,spec:T}),U(!1)},onCancel:()=>U(!1)})});let L=async()=>{ae(!0),X(void 0);try{let b={name:C,displayName:h.trim(),prompt:V,...F!==ce?{model:F}:{},...x.trim()?{task:x.trim()}:{},...G?{character:G.input}:{}},T=await xe.createAgent(b);await xt(),p(t("Made {name}.",{name:T.displayName})),i(),K("room",T.room)}catch(b){X(b instanceof le&&b.field?`${b.field}: ${d(b)}`:d(b))}finally{ae(!1)}};return n("form",{className:"stack form",onSubmit:(b)=>{if(b.preventDefault(),Z&&!_)L()},children:[n("label",{htmlFor:H[0],children:[t("Name"),e("input",{id:H[0],value:h,autoComplete:"off",onChange:(b)=>{if(l(b.target.value),!I)P(qe(b.target.value))}})]}),n("label",{htmlFor:H[1],children:[t("Permanent name"),e("input",{id:H[1],value:C,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":C!==""&&!Ee.test(C),onChange:(b)=>{E(!0),P(b.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:H[2],children:[t("Prompt"),e("textarea",{id:H[2],rows:6,value:V,onChange:(b)=>M(b.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(De,{id:H[4],value:F,onChange:(b)=>v(b.target.value),children:[e("option",{value:ce,children:t("Default model")}),je(q).map((b)=>b.provider===""?b.models.map((T)=>e("option",{value:T,children:T},T)):e("optgroup",{label:b.provider,children:b.models.map((T)=>e("option",{value:T,children:T},T))},b.provider))]})]}),n("label",{htmlFor:H[3],children:[t("Opening task"),e("textarea",{id:H[3],rows:3,value:x,onChange:(b)=>R(b.target.value)}),e("span",{className:"meta",children:t("Optional. The knight starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(he,{spec:Y,name:C||"new",size:72,label:h}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:G?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>U(!0),children:t("Choose a look")})]})]}),W?e(m,{message:W}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!Z||_,children:_?t("Making…"):t("Make knight")})})]})}var We=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Le(){let i=Ms(),h=a(i);if(i)h.current=i;let l=h.current,C=i!==void 0;if(o(()=>{if(!C)return;let P=window.location.href,I=()=>{if(window.location.href!==P)oi()};return window.addEventListener("popstate",I),window.addEventListener("hashchange",I),()=>{window.removeEventListener("popstate",I),window.removeEventListener("hashchange",I)}},[C]),!l)return null;return e(D,{open:i!==void 0,title:We(l),size:"wide",onClose:oi,children:e("div",{className:"stack agent-sheet",children:l.kind==="new-agent"?e(Me,{onDone:oi}):l.kind==="archive"?e(Ne,{}):e(Ae,{...l.name===void 0?{}:{name:l.name},onDone:oi})},l.id)})}function ua(){return n(g,{children:[e(Wi,{}),e(ye,{}),e(Le,{})]})}export{ua as SheetHosts};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{f,Q,w,o,A,r,t,g,e,n,s,le,d,p,S,m}from"./chunk-index-84v7j6vh.js";import{$e,dt}from"./chunk-index-4gk88a0x.js";import{D}from"./chunk-index-9nents16.js";var M=w(()=>(f("hgbtcn4b"),import("./chunk-prompt-history-hgbtcn4b.js")).then((c)=>({default:c.HistorySheet}))),B=`---
|
|
2
|
+
name: my-skill
|
|
3
|
+
description: "Use when "
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# My skill
|
|
7
|
+
|
|
8
|
+
`;function _(c){let{name:u}=c,[i,k]=r(),[h,v]=r(u?"":B),[b,I]=r(),[R,y]=r(!1),[C,x]=r(!1),[z,H]=r(!1),[T,N]=r(!1),L=A();o(()=>{if(!u)return;let a=!0;return $e.skillDocument(u).then((l)=>{if(!a)return;k(l),v(l.text)},(l)=>a&&I(d(l))),()=>{a=!1}},[u]);let E=i?.text??"",U=h!==E,F=u!==void 0&&!i&&!b,V=async()=>{x(!0);try{if(i){let a=await $e.saveSkillDocument(i.name,{text:h,baseHash:i.hash});k(a),v(a.text),y(!1),H(!1),p(t("Saved.")),c.onSaved()}else await $e.createSkillDocument({text:h}),p(t("Skill created.")),c.onSaved(),c.onClose()}catch(a){if(a instanceof le&&a.status===409){let{current:l}=a.body;k(l),H(!0)}else p(d(a),"danger")}finally{x(!1)}};return n(D,{open:!0,title:u??t("New skill"),size:"full",onClose:c.onClose,children:[b?e(m,{message:b}):null,F?e(S,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!F&&!b&&(!i||i.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(m,{message:t("This skill changed while you were editing it. The changes below are against the version there now; save again to replace it, or go back to edit.")}):null,e(dt,{label:"SKILL.md",before:E,after:h}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>y(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:C,onClick:V,children:C?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:L,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>N(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:L,className:"prompt-full",spellCheck:!1,value:h,onChange:(a)=>v(a.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!U||!h.trim(),onClick:()=>y(!0),children:t("Review changes")})})]}),T&&i?e(Q,{fallback:null,children:e(M,{open:T,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await $e.skillHistory(i.name);return a.map((l,K)=>({id:l.id,text:l.text,previous:a[K+1]?.text??"",by:l.by,at:l.at}))},onUse:(a)=>{v(a),y(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f,dr,Q,w,o,r,t,g,e,n,s,O,d,S,m,k,P,Ft,Rt}from"./chunk-index-84v7j6vh.js";import{ye}from"./chunk-index-th43f690.js";import{de}from"./chunk-index-grkczq2c.js";import"./chunk-index-9nents16.js";function v({source:i}){return e("div",{className:"prose document",children:e(Ft,{remarkPlugins:[Rt],components:{a:({href:a,children:c})=>a&&/^https?:\/\//.test(a)?e("a",{href:a,target:"_blank",rel:"noreferrer",children:c}):e("span",{children:c}),img:({alt:a})=>e("span",{children:a}),pre:({children:a})=>e("div",{className:"code-block",children:e("pre",{children:a})}),table:({children:a})=>e("div",{className:"table-wrap",children:e("table",{children:a})})},children:i})})}var E=w(()=>(f("n0y9pd90"),import("./chunk-skill-editor-n0y9pd90.js")).then((i)=>({default:i.SkillEditor})));function j(){let[i,a]=r(0),{data:c,error:l}=ye(()=>O.skills(),`skills:${i}`),[b,N]=r(),[p,h]=r();o(()=>{O.session().then(N,()=>{return})},[]);let y=b?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),y?n("button",{type:"button",className:"secondary",onClick:()=>h({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:y?t("Registered skills and their carriers. A skill a knight wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask a knight on Discord to edit their contents.")}),l?e(m,{message:l}):null,!c&&!l?e(S,{}):null,c?.length===0?e(k,{children:t("No skills.")}):null,c?.map((u)=>e(V,{skill:u,onEdit:y&&u.source.kind==="written"?()=>h({name:u.name}):void 0},`${u.name}:${i}`)),p?e(Q,{fallback:null,children:e(E,{name:p.name,onSaved:()=>a((u)=>u+1),onClose:()=>h(void 0)},p.name??"")}):null]})}function D(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 V({skill:i,onEdit:a}){let[c,l]=r(!1),[b,N]=r(),[p,h]=r(),y=i.source.kind==="builtin"?t("Built-in"):i.source.kind==="written"?t("Knight-written"):i.source.kind==="package"?i.source.package:`${i.source.repo}:${i.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(P,{children:y}),i.missing?e(P,{tone:"warn",children:t("File missing")}):n(g,{children:[a?e("button",{type:"button",className:"secondary",onClick:a,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(l(!0),!b)h(void 0),O.skill(i.name).then(N).catch((u)=>h(d(u)))},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:D(i.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",i.source.kind==="builtin"?t("All knights"):i.carriers.join(", ")||t("None")]}),i.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",i.groups.join(", ")]}):null,e(de,{open:c,title:i.name,size:"wide",onClose:()=>l(!1),children:p?e(m,{message:p}):!b?e(S,{}):e(C,{title:i.name,detail:b})})]})}function C({title:i,detail:a}){let c=a.metadata.filter((l)=>!(l.key==="name"&&l.value===i));return n("div",{className:"skill-document",children:[c.length?e("dl",{className:"skill-meta",children:c.map((l)=>n(dr,{children:[e("dt",{children:l.key}),e("dd",{children:l.value})]},l.key))}):null,e(v,{source:a.body})]})}export{j as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N,a,r,t,ne,g,e,n,s,x,K,mt,Ve,u,an,Zt,hn,Ze,We,gn}from"./chunk-index-84v7j6vh.js";import{jn}from"./chunk-index-gzvkpe3e.js";import{Wn}from"./chunk-index-6tpr6r6d.js";import{Yn,Hn}from"./chunk-index-f3b5nch2.js";import{Dt}from"./chunk-index-a768zmp6.js";import{Ws}from"./chunk-index-43k1rjmx.js";Yn();function b(){let l=u((m)=>JSON.stringify(Ws(m,(o)=>Ve(m,o),(o)=>mt(m,o)>0,!0).map((o)=>({id:o.id,...o.title===void 0?{}:{title:o.title},entries:o.keys.map((f)=>({key:f,name:m.rooms[f]?.view?.displayName??f,waiting:mt(m,f)>0}))})))),d=jn(),p=a(l);if(!d)p.current=l;let c=p.current;return N(()=>JSON.parse(c),[c])}function k(l){let{key:d,name:p}=l.entry,c=u((i)=>i.rooms[d]),m=u((i)=>mt(i,d)),o=c?.view,f=Ze(o?.character),w=Dt(()=>Zt(d,l.onLeave),l.liftable&&!o?.home?Hn(d):void 0);if(!o)return null;return e("li",{...l.liftable&&!o.home?{"data-drop-item":"","data-key":d}:{},children:n("a",{className:"switcher-row",...w,href:x("room",d),"aria-current":d===l.current?"page":void 0,style:f,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(d)},children:[n("span",{className:"switcher-picture",children:[e(We,{view:o,size:40}),m?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),c?.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(gn,{room:d}),m?e("span",{className:"badge badge-warn",children:ne(m,"{count} card waiting","{count} cards waiting")}):null,o.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,c?.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,c?.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 U(l){let[d,p]=r(""),c=b(),m=c.map((i)=>({...i,entries:i.entries.filter((h)=>Wn(d,h.name)!==void 0)})).filter((i)=>i.entries.length>0||d===""),o=(i)=>l.close(i===l.current?void 0:()=>K("room",i)),f=c.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),w=m.filter((i)=>i.entries.length>0).length>1;return n(g,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:d,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>p(i.target.value),onKeyDown:(i)=>{let h=m.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&h&&!an(i.nativeEvent))o(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>hn(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:m.map((i)=>{let h=i.id==="waiting",y=i.id==="pinned"?"pinned":i.id==="rest"?"rest":h||i.id==="home"?void 0:"folder";return n("section",{"aria-label":h?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?f:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...y?{"data-drop-zone":y,"data-zone-id":i.id,...y==="folder"?{"data-folder":i.id}:{}}:{},children:[h?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):w||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?f:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((v)=>e(k,{entry:v,current:l.current,onPick:o,onLeave:l.close,liftable:!h&&i.id!=="home"},v.key))})]},i.id)})})]})}export{U as SwitcherList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,
|
|
1
|
+
import{b,As,zi}from"./chunk-index-84v7j6vh.js";import{Sr,wr}from"./chunk-index-dtste2ed.js";import{Oi,ts}from"./chunk-index-ewj52be9.js";import"./chunk-index-cwc1vvpw.js";var c=64;async function g(s){let a=new Image;a.src=s,await a.decode();let r=document.createElement("canvas");r.width=r.height=c;let t=r.getContext("2d");if(!t)throw Error("the page has no 2d canvas");t.drawImage(a,0,0,c,c);let i=c*0.175,o=c-i-2,e=i+2;return t.fillStyle="#ffffff",t.beginPath(),t.arc(o,e,i+2.5,0,Math.PI*2),t.fill(),t.fillStyle="#ef4444",t.beginPath(),t.arc(o,e,i,0,Math.PI*2),t.fill(),r.toDataURL("image/png")}var u=()=>[...document.head.querySelectorAll('link[rel~="icon"]')];function h(s){let a=new Map,r=!1,t=0,i=(e)=>{if(e.dataset.plainHref===void 0)return;if(e.setAttribute("href",e.dataset.plainHref),e.dataset.plainType)e.type=e.dataset.plainType;else e.removeAttribute("type");if(e.dataset.plainSizes)e.setAttribute("sizes",e.dataset.plainSizes);else e.removeAttribute("sizes");delete e.dataset.plainHref,delete e.dataset.plainType,delete e.dataset.plainSizes},o=async()=>{let e=++t,p=s.count()>0;if(p===r)return;if(!p){for(let n of u())i(n);r=!1;return}let l=u(),d=(l.find((n)=>n.dataset.plainHref===void 0&&n.type==="image/png")??l[0])?.href;if(!d)return;let f=a.get(d);if(!f)f=s.render(d),a.set(d,f);let m=await f.catch((n)=>{a.delete(d),console.warn("the tab icon's dot failed to draw",n);return});if(!m||e!==t)return;for(let n of u()){if(n.dataset.plainHref===void 0)n.dataset.plainHref=n.getAttribute("href")??"",n.dataset.plainType=n.type,n.dataset.plainSizes=n.getAttribute("sizes")??"";n.href=m,n.type="image/png",n.removeAttribute("sizes")}r=!0};s.subscribe(()=>void o()),o()}function H(){let s=()=>Oi().badge+wr(),a=()=>As(s());h({count:()=>zi(b.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};b.subscribe(t),ts(t),Sr(t)},render:g}),a()}export{H as startPageTabDot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f,Q,w,be,o,r,t,e,n,Se,K,u,Ge,fe,Rs}from"./chunk-index-84v7j6vh.js";import"./chunk-index-934zgd18.js";import"./chunk-index-8f9jer8r.js";import"./chunk-index-dtste2ed.js";import{_n,Tn,Si,bs,wi,Jn,Bt}from"./chunk-index-2f5nfekb.js";import{Kr,Gn}from"./chunk-index-y4sqmenv.js";import"./chunk-index-9nents16.js";var W=w(()=>(f("qeytqe0m"),import("./chunk-table-seats-qeytqe0m.js")).then((a)=>({default:a.TableSeatsSheet}))),z=300;function D(a){let[b,c]=r(!1);return o(()=>{if(!a){c(!1);return}if(Se()){c(!0);return}let l=setTimeout(()=>c(!0),z);return()=>clearTimeout(l)},[a]),b}function H(a,b,c,l){Rs(a).then((h)=>{if(h)fe({...h,at:b,via:c,source:l})},()=>{return})}function I(){return bs((be(Ge)?.kinds??[]).map((a)=>a.kind)),null}function te({focus:a}){let[b,c]=r(),l=wi(void 0),h=Jn(),[N,v]=r(!1),[x,A]=r(!1),m=Tn(),R=Si(),y=_n(),E=u((s)=>s.listed),T=m?y.loaded:E&&(!R||y.loaded),M=new Set(y.views.map((s)=>s.key)),k=m?l:l.filter((s)=>!M.has(s.key)),i=m?null:Kr(a,k),g=k.find((s)=>s.name===i);o(()=>{if(a&&T&&i===null)K("table",void 0,{replace:!0})},[a,T,i]);let B=D(i!==null),S=(s)=>{if(m){let p=l.find((L)=>L.name===s);if(p)K("room",p.key);return}let d=l.find((p)=>p.name===s);if(d&&M.has(d.key)){K("room",d.key);return}if(s===i)return;K("table",s??void 0,{replace:i!==null})},C=()=>{A(!0),v(!0)},V=!m&&l.length===0&&h.length>0,F=m&&y.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:[b?.kind==="webgl"?e("button",{type:"button",className:"secondary",onClick:()=>S(null),children:t("Reset view")}):null,!m&&h.length>0?e("button",{type:"button",className:"secondary","aria-haspopup":"dialog",onClick:C,children:t("Who's at the table")}):null]})]}),n("div",{className:"table-frame","data-focused":i!==null||void 0,children:[V?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("Every knight has left the table. Choose who sits down.")}),e("button",{type:"button",onClick:C,children:t("Who's at the table")})]}):F?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("There are no rooms to seat yet.")})]}):e(Bt,{onHandle:c,focus:i,onFocus:S,...m?{onMore:()=>K("rooms")}:{onSeat:S,onSeatMenu:(s)=>{let d=k.find((p)=>p.name===s.id);if(d)H(d.key,s.at,s.via,s.source)}}}),R?e(I,{}):null,g?e(Gn,{roomKey:g.key,open:B,onBack:()=>S(null),onMenu:(s)=>{let d=s.getBoundingClientRect();H(g.key,{x:d.left,y:d.bottom},"key",s)}},g.key):null]}),x?e(Q,{fallback:null,children:e(W,{open:N,onClose:()=>v(!1)})}):null]})}export{te as TablePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A,r,t,e,n,We}from"./chunk-index-84v7j6vh.js";import"./chunk-index-934zgd18.js";import"./chunk-index-8f9jer8r.js";import"./chunk-index-dtste2ed.js";import{Jn}from"./chunk-index-2f5nfekb.js";import{ft}from"./chunk-index-1f0j335v.js";import{D}from"./chunk-index-9nents16.js";import{tt}from"./chunk-index-satam151.js";function u({view:s}){let o=A(),[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(We,{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(ft,{id:o,checked:!l,label:s.displayName,busy:a,onChange:async(i)=>{m(!0),await tt(s.key,!i),m(!1)}})]})})}function g(s){let o=Jn();return e(D,{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("A knight 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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{wn,sr,or,Tt,en,tn,Kn}from"./chunk-index-datrrs6b.js";import{Mt,qt}from"./chunk-index-31ays46f.js";var le="http://www.w3.org/2000/svg",t=(d,i={},p)=>{let y=document.createElementNS(le,d);for(let[E,R]of Object.entries(i))y.setAttribute(E,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)"),E=i.reducedMotion==="auto"||i.reducedMotion===void 0?y.matches:i.reducedMotion,R=i.labels??qt,{theme:O,scheme:I}=i,M=[],_=new Map,A=new Map,T=i.focus??null,S=document.createElement("div");S.className="t2d";let m=t("svg",{role:"group","aria-label":R.table});if(S.appendChild(m),getComputedStyle(d).position==="static")d.style.position="relative";d.appendChild(S);function Q(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=wn(O,I);S.classList.toggle("reduced",E),S.classList.toggle("focus",T!==null),S.classList.toggle("dim",M.some((r)=>A.get(r.id)==="speaking"));let s=i.variant==="compact",c=Math.max(d.clientWidth,200),o=Math.max(d.clientHeight,s?60:200);m.setAttribute("viewBox",`0 0 ${c} ${o}`),m.replaceChildren();let g=Math.max(M.length,1),{rows:a,perRow:l}=fe(g,s);t("rect",{width:c,height:o,fill:e.css.bg},m);let w=t("defs",{},m),C=c/2,N=s?o*0.82:o*0.62;if(t("ellipse",{cx:C,cy:N,rx:c*0.47,ry:s?o*0.2:o*0.34,fill:e.css.floor,stroke:e.ink,"stroke-width":2},m),!s)t("ellipse",{cx:C,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},m);let F=c/l,q=s?o*0.95:o/(a+0.6),h=Math.max(46,Math.min(F*0.94,132,q*1.05)),u=h*0.72,n=h*1.05;Q(w,e,n),M.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(M.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=A.get(r.id)??"idle",f=t("g",{class:"seat","data-seat":r.id,"data-state":H,...T===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"}:{}},m);t("ellipse",{cx:0,cy:3,rx:h*0.55,ry:h*0.1,fill:"#000",opacity:0.35},f),t("ellipse",{class:"halo",cx:0,cy:-u-n*0.35,rx:n*0.8,ry:n*0.8,fill:`url(#${p}-h${b})`},f),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},f);let B=t("g",{class:"lift"},f),j=_.get(r.id);if(j)t("image",{href:ce(j),x:-n/2,y:-u-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:-u-n*0.3,r:n*0.3,fill:r.color,stroke:e.ink,"stroke-width":2},B);let v=t("text",{x:0,y:-u-n*0.3+n*0.1,"text-anchor":"middle","font-size":n*0.3,"font-weight":700,fill:"#fff","font-family":Tt},B);v.textContent=Array.from(r.name)[0]?.toUpperCase()??"?"}let X=u*0.22;t("path",{d:`M ${-h*0.5} ${-u} L ${h*0.5} ${-u} L ${h*0.42} 0 L ${-h*0.42} 0 Z`,fill:e.wood,stroke:e.ink,"stroke-width":2,"stroke-linejoin":"round"},f),t("rect",{x:-h*0.54,y:-u-X*0.2,width:h*1.08,height:X,rx:2,fill:e.woodLight,stroke:e.ink,"stroke-width":2},f);let L=Math.max(11,Math.min(15,h*0.14)),K=Math.min(Math.max(h*0.9,L*5.5+14),Math.max(h*0.9,r.name.length*L*0.62+18),F*0.98),se=L+8;t("rect",{class:"plate",x:-K/2,y:-u*0.78,width:K,height:se,rx:3,fill:e.gold,stroke:e.ink,"stroke-width":2},f);let ae=t("text",{x:0,y:-u*0.78+L+1.5,"text-anchor":"middle","font-size":L,"font-weight":700,"font-family":Tt,fill:e.plateInk},f);ae.textContent=or(r.name,(K-8)/L);let Z=t("g",{class:"badge"},t("g",{transform:`translate(${n*0.4} ${-u-n*0.78})`},f)),V=H==="done",D=H==="error",P=e.gold;if(V)P=sr.done;else if(D)P=sr.error;t("circle",{r:n*0.15,fill:P,stroke:e.ink,"stroke-width":2},Z);let U=t("text",{x:0,y:n*0.06,"text-anchor":"middle","font-size":n*0.2,"font-weight":800,"font-family":Tt,fill:V||D?"#fff":e.ink},Z);if(U.textContent="!",V)U.textContent="✓";else if(D)U.textContent="✕";let J=t("g",{class:"orbit"},f);t("circle",{cx:n*0.4,cy:-u-n*0.5,r:n*0.05,fill:r.color},J),t("circle",{cx:-n*0.4,cy:-u-n*0.5,r:n*0.035,fill:r.color,opacity:0.6},J),f.addEventListener("click",(v)=>i.onSeatClick({id:r.id,name:r.name,at:Mt(v,f)})),f.addEventListener("keydown",(v)=>{if(v.key==="Enter"||v.key===" ")v.preventDefault(),i.onSeatClick({id:r.id,name:r.name,at:Mt({clientX:0,clientY:0,detail:0},f)})})}),!s){let r=Math.min(c*0.34,190),b=o-6;t("rect",{x:C-r/2,y:b-22,width:r,height:22,rx:4,fill:e.wood,stroke:e.ink,"stroke-width":2},m);let k=t("text",{x:C,y:b-7,"text-anchor":"middle","font-size":12,"font-weight":700,"font-family":Tt,fill:e.gold},m);k.textContent=or(i.ownerName??"You",12)}}let G=new Set,ee=(e,s)=>{if(e.mode==="cut")return;let c=wn(O,I),o=(g,a)=>{let l=setTimeout(()=>{G.delete(l),g()},a);G.add(l)};for(let g of e.joining){let a=[...m.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()},tn)}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,[C,N,F]]of[[-26,-24,20],[24,-20,22],[0,-52,24],[-4,-4,26]].entries()){let q=t("circle",{class:"puff",cx:C,cy:N,r:F,fill:c.paper,stroke:c.ink,"stroke-width":3},l);q.style.animationDelay=`${w*40}ms`}m.appendChild(l),o(()=>l.remove(),en)}},W=new ResizeObserver(x);W.observe(d);let Y=()=>{if(i.reducedMotion==="auto"||i.reducedMotion===void 0)z.setReducedMotion(y.matches)};y.addEventListener("change",Y);let z={kind:"svg",setTheme(e,s){O=e,I=s,x()},setSeats(e){let s=M.map((o)=>o.id),c=new Map([...m.querySelectorAll("g.seat[data-seat]")].map((o)=>[o.getAttribute("data-seat")??"",o]));M=e;for(let o of e)if(A.set(o.id,o.state??"idle"),o.avatarSvg)_.set(o.id,o.avatarSvg);if(x(),s.length>0||c.size>0)ee(Kn(s,e.map((o)=>o.id),E),c)},setState(e,s){if(A.get(e)===s)return;A.set(e,s),x()},setAvatar(e,s){return _.set(e,s),x(),Promise.resolve()},setReducedMotion(e){E=e,x()},resetCamera(){T=null,x(),i.onFocus?.(null)},focus(e){if(e===T)return;T=e,x()},focused:()=>T,getStats(){return{kind:"svg",fps:0,frameMs:0,frameMsMax:0,drawCalls:0,triangles:0,textures:0,geometries:0,dpr:1,lowPower:!1,reduced:E,loop:"idle",seats:M.length,renders:0}},dispose(){for(let e of G)clearTimeout(e);G.clear(),W.disconnect(),y.removeEventListener("change",Y),S.remove()}};return z.setSeats(i.seats),z}export{ye as createTable2D};
|