pi-roundtable-web 0.29.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/chunk-account-66e6ezdq.js +1 -0
- package/dist/{chunk-action-menu-q5y7xpry.js → chunk-action-menu-ap5xn7bf.js} +1 -1
- package/dist/{chunk-agent-x74xezyt.js → chunk-agent-sapt5qhn.js} +1 -1
- package/dist/chunk-arranged-rooms-n6bk696f.js +1 -0
- package/dist/chunk-attachments-p5v9gqyt.js +102 -0
- package/dist/chunk-bulk-actions-aze4ewc4.js +1 -0
- package/dist/chunk-character-creator-m7tw20ef.js +225 -0
- package/dist/{chunk-codeeditor-239ss6a2.js → chunk-codeeditor-yy6pq8mv.js} +2 -2
- package/dist/chunk-confirm-0cajsfhk.js +1 -0
- package/dist/chunk-connectors-tw0tbm21.js +37 -0
- package/dist/chunk-conversations-wkm23m5r.js +1 -0
- package/dist/{chunk-council-sheet-a5e6tspr.js → chunk-council-sheet-mz7s23nq.js} +2 -2
- package/dist/chunk-council-view-zgvzxtgn.js +1 -0
- package/dist/{chunk-drag-7873fvzw.js → chunk-drag-d1bpy8w6.js} +1 -1
- package/dist/{chunk-entry-5zmjxadx.js → chunk-entry-7zr5b1fp.js} +1 -1
- package/dist/{chunk-folder-list-h9hmbm8e.js → chunk-folder-list-bs4eh3g9.js} +1 -1
- package/dist/chunk-folds-eez1q41c.js +1 -0
- package/dist/{chunk-gate-fa6za28z.js → chunk-gate-dt91egcd.js} +1 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +1 -0
- package/dist/chunk-host-picture-4rtswxwa.js +1 -0
- package/dist/chunk-host-state-1vxzmmq6.js +1 -0
- package/dist/chunk-host-ui-x38bf0et.js +1 -0
- package/dist/{chunk-index-4re5prfp.js → chunk-index-0h99xcs3.js} +2 -2
- package/dist/{chunk-index-5ssncptg.js → chunk-index-1kb8tv4v.js} +2 -2
- package/dist/chunk-index-24cggw6k.js +50 -0
- package/dist/chunk-index-2g8xtwqg.js +2 -0
- package/dist/chunk-index-3n38xe7m.js +2 -0
- package/dist/{chunk-index-en5dm1zv.js → chunk-index-3tksdmx7.js} +2 -2
- package/dist/{chunk-index-rr73h4kc.js → chunk-index-4a1tdadd.js} +3 -3
- package/dist/{chunk-index-f4gqzfkv.js → chunk-index-53fwc7sc.js} +2 -2
- package/dist/chunk-index-55ps4x5n.js +2 -0
- package/dist/{chunk-index-4krm48hm.js → chunk-index-5j1v2q7w.js} +1 -1
- package/dist/chunk-index-5w6tb7p0.js +2 -0
- package/dist/{chunk-index-y6p8j3zv.js → chunk-index-6btdp13p.js} +1 -1
- package/dist/chunk-index-6m7dwsmv.js +1 -0
- package/dist/{chunk-index-7c9fn21n.js → chunk-index-6rdywten.js} +2 -2
- package/dist/{chunk-index-gj3n4dh5.js → chunk-index-6s2pqwna.js} +2 -2
- package/dist/{chunk-index-r0hk9kyd.js → chunk-index-7mrkq793.js} +2 -2
- package/dist/chunk-index-7xcbpeqz.js +2 -0
- package/dist/chunk-index-88wh5eyj.js +2 -0
- package/dist/{chunk-index-ntt3em2k.js → chunk-index-8pbwr3rs.js} +1 -1
- package/dist/{chunk-index-bjeg3e2j.js → chunk-index-8wpvj7k5.js} +2 -2
- package/dist/chunk-index-97dcp1vh.js +1 -0
- package/dist/chunk-index-a7e6rhxy.js +2 -0
- package/dist/{chunk-index-4eag6s50.js → chunk-index-bxf8eq1s.js} +2 -2
- package/dist/chunk-index-c8gm1crh.js +120 -0
- package/dist/{chunk-index-4jnn2g09.js → chunk-index-ce7hsda9.js} +2 -2
- package/dist/chunk-index-cfesmk1f.js +2 -0
- package/dist/{chunk-index-zdzzf3fp.js → chunk-index-cmzvq3nf.js} +1 -1
- package/dist/{chunk-index-35zqk1zr.js → chunk-index-d4mx2vvf.js} +2 -2
- package/dist/chunk-index-d74tpnkd.js +2 -0
- package/dist/chunk-index-d941ae7c.js +2 -0
- package/dist/{chunk-index-rtz4936v.js → chunk-index-dr0jr7d3.js} +3 -3
- package/dist/{chunk-index-pcbkp62w.js → chunk-index-en728705.js} +2 -2
- package/dist/chunk-index-fb3kzyyp.js +2 -0
- package/dist/{chunk-index-a8c0ap8g.js → chunk-index-ffnd0jcj.js} +2 -2
- package/dist/chunk-index-fn6305vn.js +3 -0
- package/dist/{chunk-index-evhaaqzk.js → chunk-index-gdh7wsd5.js} +11 -11
- package/dist/{chunk-index-3tjmyd1h.js → chunk-index-m76gdwnk.js} +1 -1
- package/dist/chunk-index-mr391t49.js +2 -0
- package/dist/chunk-index-n3khm9fq.js +2 -0
- package/dist/{chunk-index-93f3e06v.js → chunk-index-nn4w6a04.js} +2 -2
- package/dist/{chunk-index-hef4gwtb.js → chunk-index-nr275sa7.js} +2 -2
- package/dist/{chunk-index-cttrqfm8.js → chunk-index-prq011b6.js} +1 -1
- package/dist/{chunk-index-h2a42p6s.js → chunk-index-q4k9vk04.js} +17 -1
- package/dist/chunk-index-rgdaec7y.js +2 -0
- package/dist/chunk-index-rjs1can6.js +2 -0
- package/dist/chunk-index-s4a8e4qm.js +2 -0
- package/dist/{chunk-index-q33ppq0j.js → chunk-index-sz381vda.js} +3 -3
- package/dist/{chunk-index-1652v386.css → chunk-index-t7csmbpy.css} +1 -1
- package/dist/{chunk-index-amspdq2j.js → chunk-index-v9jqyr1f.js} +1 -1
- package/dist/{chunk-index-e46652wf.js → chunk-index-vpq2cj14.js} +1 -1
- package/dist/chunk-index-vsaggfns.js +2 -0
- package/dist/{chunk-index-7k5895sn.js → chunk-index-w17wgjby.js} +3 -3
- package/dist/{chunk-index-teyx2hz7.js → chunk-index-wgrx2ybn.js} +2 -2
- package/dist/chunk-index-wsv46y9p.js +2 -0
- package/dist/{chunk-index-v6h43553.js → chunk-index-xbj816p0.js} +2 -2
- package/dist/{chunk-index-aycxt14t.js → chunk-index-yr758n6t.js} +2 -2
- package/dist/{chunk-index-pfs6rm6w.js → chunk-index-ysv36nbk.js} +2 -2
- package/dist/{chunk-index-haac6nbt.js → chunk-index-ze9p4npm.js} +2 -2
- package/dist/chunk-index-zfdvyrjt.js +2 -0
- package/dist/chunk-lang-css-3h22se37.js +1 -0
- package/dist/{chunk-lang-dockerfile-2p7e3ssz.js → chunk-lang-dockerfile-y24eejnh.js} +1 -1
- package/dist/{chunk-lang-go-zxp9k517.js → chunk-lang-go-qzgv1161.js} +2 -2
- package/dist/chunk-lang-html-9rvrmmpg.js +1 -0
- package/dist/chunk-lang-javascript-4kv8s3tk.js +1 -0
- package/dist/{chunk-lang-json-zmym50rg.js → chunk-lang-json-99v80v88.js} +1 -1
- package/dist/{chunk-lang-markdown-ww2kcs85.js → chunk-lang-markdown-gn8he877.js} +4 -4
- package/dist/{chunk-lang-python-ng1zdtd4.js → chunk-lang-python-prsw4p4k.js} +2 -2
- package/dist/{chunk-lang-rust-6ynhxjdd.js → chunk-lang-rust-g6xqta16.js} +1 -1
- package/dist/{chunk-lang-shell-39t9bz2s.js → chunk-lang-shell-dmpnzc6w.js} +1 -1
- package/dist/{chunk-lang-sql-w875ejpg.js → chunk-lang-sql-wz7ca27b.js} +2 -2
- package/dist/{chunk-lang-toml-b8ckgkg5.js → chunk-lang-toml-160prtq4.js} +1 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +1 -0
- package/dist/{chunk-lang-xml-bz91cjp1.js → chunk-lang-xml-9htkz2dd.js} +1 -1
- package/dist/{chunk-lang-yaml-g9zy0tdv.js → chunk-lang-yaml-08749wd5.js} +1 -1
- package/dist/chunk-layout-actions-tdx896xf.js +1 -0
- package/dist/chunk-menu-items-trhybv1g.js +1 -0
- package/dist/chunk-mode-toggle-4dtfphq4.js +1 -0
- package/dist/chunk-note-row-28e5x7n8.js +233 -0
- package/dist/chunk-notes-5nkayhw8.js +1 -0
- package/dist/chunk-notice-bell-xz8a04am.js +1 -0
- package/dist/{chunk-notices-mtn7pg1z.js → chunk-notices-d0cwvk27.js} +1 -1
- package/dist/{chunk-onboarding-f3hhxgg4.js → chunk-onboarding-zs4rtea9.js} +1 -1
- package/dist/{chunk-overview-qmepntrr.js → chunk-overview-9sb3ywa8.js} +1 -1
- package/dist/{chunk-palette-edkn1ypq.js → chunk-palette-5sfhrv4x.js} +1 -1
- package/dist/chunk-placement-items-e2neja55.js +1 -0
- package/dist/{chunk-profile-pwfq0wns.js → chunk-profile-jffhtpqf.js} +1 -1
- package/dist/{chunk-prompt-history-xp9hmeqt.js → chunk-prompt-history-1jz2gk3v.js} +1 -1
- package/dist/{chunk-prompts-a56qvytg.js → chunk-prompts-0t30ttd0.js} +1 -1
- package/dist/chunk-room-confirms-6595921h.js +1 -0
- package/dist/{chunk-room-menu-1m2c2ekt.js → chunk-room-menu-hwkjyxwe.js} +1 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +1 -0
- package/dist/{chunk-schedules-kwnw7p8v.js → chunk-schedules-e12y8fw2.js} +1 -1
- package/dist/{chunk-seat-menu-m2n9nvv0.js → chunk-seat-menu-n2bcw0mf.js} +1 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +29 -0
- package/dist/chunk-shortcut-help-434sqnxc.js +26 -0
- package/dist/chunk-shortcuts-mjxph0g7.js +1 -0
- package/dist/chunk-skill-editor-98492yrt.js +8 -0
- package/dist/chunk-skills-mfv8ppfh.js +1 -0
- package/dist/chunk-start-over-line-m526193z.js +16 -0
- package/dist/{chunk-switcher-list-ehsn2wsk.js → chunk-switcher-list-5ngjar24.js} +1 -1
- package/dist/{chunk-tab-dot-gkpe06q8.js → chunk-tab-dot-tzjkahj5.js} +1 -1
- package/dist/{chunk-table-av3kh3tt.js → chunk-table-xbtbex2z.js} +1 -1
- package/dist/{chunk-table2d-5x3jptp9.js → chunk-table2d-61bvrykm.js} +1 -1
- package/dist/{chunk-table3d-rsvajx7r.js → chunk-table3d-5a7vbgyj.js} +24 -24
- package/dist/chunk-thread-actions-bf6vf2mt.js +1 -0
- package/dist/{chunk-thread-cards-grzszfha.js → chunk-thread-cards-n0n603vf.js} +1 -1
- package/dist/chunk-thread-list-7bkdn51x.js +227 -0
- package/dist/{chunk-transcript-t5szb8r0.js → chunk-transcript-8ztrkt6g.js} +1 -1
- package/dist/chunk-waiting-chip-y83c90v3.js +32 -0
- package/dist/chunk-waiting-s273kcgz.js +1 -0
- package/dist/chunk-where-jr791gzj.js +1 -0
- package/dist/chunk-workspace-dw71mshw.js +586 -0
- package/dist/chunk-zh-tw-vm5d0w6j.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/src/api-types.ts +12 -0
- package/src/app/app.ts +7 -0
- package/src/app/card-log.ts +10 -2
- package/src/app/protocol.ts +18 -0
- package/src/app/queued-delivery.ts +107 -0
- package/src/app/queued-frames.ts +115 -0
- package/src/app/room-log.ts +39 -7
- package/src/app/routes.ts +97 -5
- package/src/app/socket.ts +12 -2
- package/src/app/surface.ts +37 -6
- package/src/app/zip.ts +124 -0
- package/src/auth/sessions.ts +9 -1
- package/src/host/cards.ts +10 -3
- package/src/host/stored-json.ts +23 -0
- package/src/i18n/zh-tw.ts +14 -0
- package/src/notices/mount.ts +1 -0
- package/src/notices/store.ts +9 -1
- package/src/web-plugin.ts +4 -1
- package/dist/chunk-account-9616x405.js +0 -1
- package/dist/chunk-arranged-rooms-9prq46vh.js +0 -1
- package/dist/chunk-bulk-actions-5dc4m9ad.js +0 -1
- package/dist/chunk-character-creator-wf02eg0h.js +0 -1
- package/dist/chunk-confirm-bhrx9195.js +0 -1
- package/dist/chunk-connectors-k77pd9by.js +0 -37
- package/dist/chunk-conversations-ftcpaqw1.js +0 -1
- package/dist/chunk-council-view-6593rqbr.js +0 -1
- package/dist/chunk-folds-vxq86t1s.js +0 -1
- package/dist/chunk-host-icons-y6frbzqt.js +0 -1
- package/dist/chunk-host-picture-fqg55rbr.js +0 -1
- package/dist/chunk-host-state-65tdhkyq.js +0 -1
- package/dist/chunk-host-ui-233kz7qp.js +0 -1
- package/dist/chunk-index-2c00zf3z.js +0 -2
- package/dist/chunk-index-2dhrqvba.js +0 -2
- package/dist/chunk-index-2s4bkrz3.js +0 -2
- package/dist/chunk-index-2ypaqwjy.js +0 -2
- package/dist/chunk-index-39qq37j5.js +0 -2
- package/dist/chunk-index-57teqgct.js +0 -2
- package/dist/chunk-index-9m9v1p7s.js +0 -2
- package/dist/chunk-index-a8nqn3y0.js +0 -3
- package/dist/chunk-index-am7ghh75.js +0 -120
- package/dist/chunk-index-amxa2bn3.js +0 -2
- package/dist/chunk-index-dajanzxc.js +0 -1
- package/dist/chunk-index-e2eeckhh.js +0 -2
- package/dist/chunk-index-ek98d2rn.js +0 -2
- package/dist/chunk-index-gp4chnp3.js +0 -2
- package/dist/chunk-index-mg96sqpk.js +0 -2
- package/dist/chunk-index-nsya88fn.js +0 -1
- package/dist/chunk-index-smz90j6p.js +0 -2
- package/dist/chunk-index-vzqwn3wp.js +0 -2
- package/dist/chunk-index-wt2asefx.js +0 -50
- package/dist/chunk-index-x4tq9btg.js +0 -2
- package/dist/chunk-index-yvcdg5hh.js +0 -2
- package/dist/chunk-index-zeqfnkty.js +0 -2
- package/dist/chunk-index-zpwb8mkk.js +0 -2
- package/dist/chunk-lang-css-avzhvm72.js +0 -1
- package/dist/chunk-lang-html-red02gep.js +0 -1
- package/dist/chunk-lang-javascript-n33kmjcx.js +0 -1
- package/dist/chunk-lang-typescript-qf8acbb2.js +0 -1
- package/dist/chunk-layout-actions-fyzzzeyp.js +0 -1
- package/dist/chunk-menu-items-yvnk3vds.js +0 -1
- package/dist/chunk-mode-toggle-ccv271hm.js +0 -1
- package/dist/chunk-note-row-314py1pp.js +0 -204
- package/dist/chunk-notes-4rnrddzw.js +0 -1
- package/dist/chunk-notice-bell-z9wgamnz.js +0 -1
- package/dist/chunk-placement-items-trsa5t23.js +0 -1
- package/dist/chunk-room-confirms-gqpkz4h0.js +0 -1
- package/dist/chunk-rooms-menu-button-tcvda1gq.js +0 -1
- package/dist/chunk-sheet-hosts-pr8xktyq.js +0 -29
- package/dist/chunk-shortcut-help-sbvrds1m.js +0 -26
- package/dist/chunk-shortcuts-8705p7q3.js +0 -1
- package/dist/chunk-skill-editor-7xy09sq1.js +0 -8
- package/dist/chunk-skills-cnc25x7q.js +0 -1
- package/dist/chunk-start-over-line-97zdd9pb.js +0 -16
- package/dist/chunk-thread-actions-7xtkegwm.js +0 -1
- package/dist/chunk-thread-list-9bjjac3j.js +0 -217
- package/dist/chunk-waiting-chip-d8b6a0p8.js +0 -28
- package/dist/chunk-waiting-ts3kxjvv.js +0 -1
- package/dist/chunk-where-3d3ncsa5.js +0 -1
- package/dist/chunk-workspace-ct6hvn0z.js +0 -578
- package/dist/chunk-zh-tw-v9v1eerm.js +0 -1
package/src/web-plugin.ts
CHANGED
|
@@ -66,7 +66,9 @@ export function webConsole(options: WebConsoleOptions): RoundtablePlugin {
|
|
|
66
66
|
const schedules = settings.panes.includes("schedules");
|
|
67
67
|
const migrations = [
|
|
68
68
|
...(rooms ? APP_MIGRATIONS : []),
|
|
69
|
-
...(auth.mode === "oidc"
|
|
69
|
+
...(auth.mode === "oidc"
|
|
70
|
+
? [WebSessions.migration, WebSessions.jsonValuesMigration]
|
|
71
|
+
: []),
|
|
70
72
|
];
|
|
71
73
|
return definePlugin({
|
|
72
74
|
name: "web-console",
|
|
@@ -368,6 +370,7 @@ async function build(settings: ResolvedOptions, context: Context) {
|
|
|
368
370
|
const app =
|
|
369
371
|
rooms && (vapid || external)
|
|
370
372
|
? new OwnerApp({
|
|
373
|
+
timeZone: env.timeZone,
|
|
371
374
|
...(settings.presentation
|
|
372
375
|
? { presentation: settings.presentation }
|
|
373
376
|
: {}),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,Q,S,e,v}from"./chunk-index-wt2asefx.js";var a={profile:S(()=>(p("pwfq0wns"),import("./chunk-profile-pwfq0wns.js")).then((o)=>({default:o.ProfilePage}))),notices:S(()=>(p("mtn7pg1z"),import("./chunk-notices-mtn7pg1z.js")).then((o)=>({default:o.NoticesPage}))),onboarding:S(()=>(p("f3hhxgg4"),import("./chunk-onboarding-f3hhxgg4.js")).then((o)=>({default:o.OnboardingPage})))};function n({pane:o}){let t=a[o];return t?e(Q,{fallback:e(v,{}),children:e(t,{})}):null}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,Q,S,j,C,a,t,g,e,n,s,Re,d,k,_,ge,Yt,vn,J,dr,Ti,Fr,Lt,Pi,Gr}from"./chunk-index-wt2asefx.js";import{Xe}from"./chunk-index-smz90j6p.js";import{pi}from"./chunk-index-2s4bkrz3.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-hef4gwtb.js";import{ui}from"./chunk-index-vzqwn3wp.js";import{di,fi}from"./chunk-index-q33ppq0j.js";import{Ft}from"./chunk-index-4eag6s50.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-aycxt14t.js";import{st}from"./chunk-index-7c9fn21n.js";di();var M=S(()=>(p("h9hmbm8e"),import("./chunk-folder-list-h9hmbm8e.js")).then((o)=>({default:o.FolderList}))),O=j(function(l){let{view:r}=l,f=Ft(()=>Yt(r.key),r.home?void 0:fi(r.key));return e(Fr,{...l,press:f,item:{...r.home?{}:{"data-drop-item":"","data-key":r.key},...l.arranging?{"data-arranging":""}:{}},after:l.arranging?e("button",{type:"button",className:"icon-button row-more","aria-haspopup":"menu","aria-label":t("Room menu"),onClick:(c)=>{let u=c.currentTarget;Yt(r.key).then((i)=>{if(!i)return;let y=u.getBoundingClientRect();ge({...i,at:{x:y.left,y:y.bottom},via:"key",source:u})},()=>{return})},children:e(s,{name:"more",size:18})}):null})});function P(o){let{now:l}=J(),{timeZone:r}=_(),f=Lt(o.rooms);return e("ul",{className:"room-list",children:f.map(({key:c,...u})=>{let i=o.threads[c];return e(O,{...u,active:c===o.active,now:l,timeZone:r,arranging:o.arranging,...i?{threads:e(Pi,{open:i.open,closed:i.closed,active:o.active,parent:c})}:{}},c)})})}function v(o){let r=Lt(o.rooms).length===0;if(r&&o.zone?.kind!=="pinned")return null;return n("section",{className:"stack",...r?{"data-empty":""}:{},...o.zone?{"data-drop-zone":o.zone.kind,"data-zone-id":o.zone.id}:{},children:[e("h2",{className:"section-title",children:o.title}),r?null:e(P,{rooms:o.rooms,threads:o.threads,active:o.active,arranging:o.arranging})]})}function re(o){let l=Boolean(_().kinds?.length),r=d((m)=>JSON.stringify({listed:m.listed,...st(m,(F)=>Re(m,F))})),f=pi(),c=a(r);if(!f)c.current=r;let u=c.current,{listed:i,...y}=C(()=>JSON.parse(u),[u]),{home:w,pinned:z,folders:N,restAgents:T,restGroups:D,rest:A,threads:L,orphans:h}=y,R=dr(),K=w.length+z.length+A.length===0&&N.every((m)=>m.rooms.length===0)&&h.open.length+h.closed.length===0,b={threads:L,active:o.active,arranging:R};return n("div",{className:"page","data-column":o.active?"":void 0,"data-drop-root":"",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Rooms")}),n("div",{className:"actions",children:[n("button",{type:"button",className:"header-button search-button",onClick:o.onSearch,children:[e(s,{name:"search",size:16}),e("span",{children:t("Find a room")}),e("kbd",{children:"⌘K"})]}),i?e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(m)=>ui(m.currentTarget),children:e(s,{name:"more",size:18})}):null,e("button",{type:"button",className:"header-button icon-button","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(m)=>vn(m.currentTarget),children:e(s,{name:"plus"})})]})]}),R?n("div",{className:"arrange-bar",children:[n("button",{type:"button",className:"secondary",onClick:()=>Xe({kind:"new"}),children:[e(s,{name:"plus",size:16}),e("span",{children:t("Add a folder")})]}),e("button",{type:"button",onClick:()=>Ti(!1),children:t("Done")})]}):null,i&&K&&!l?e(k,{children:t("No rooms yet. Rooms appear when the team has a knight.")}):null,!i?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,e(v,{title:t("Home"),rooms:w,...b}),e(v,{title:t("Pinned"),rooms:z,zone:{kind:"pinned",id:"pinned"},...b}),N.length>0?e("div",{className:"stack folder-list","data-folder-list":"",children:e(Q,{fallback:e("div",{className:"skeleton","aria-busy":"true"}),children:e(M,{folders:N,active:o.active,listed:i,rooms:(m)=>e(P,{rooms:m,threads:L,active:o.active,arranging:R})})})}):null,N.length>0?e(v,{title:t("Ungrouped"),rooms:A,zone:{kind:"rest",id:"rest"},...b}):n(g,{children:[e(v,{title:t("Knights"),rooms:T,zone:{kind:"rest",id:"rest-agents"},...b}),e(v,{title:t("Groups"),rooms:D,zone:{kind:"rest",id:"rest-groups"},...b})]}),h.open.length+h.closed.length>0?n("section",{className:"stack",children:[e("h2",{className:"section-title",children:t("Dispatch threads")}),e(Pi,{open:h.open,closed:h.closed,active:o.active})]}):null,e(Gr,{active:o.active})]})}export{re as ArrangedRoomsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,K,O,l,f}from"./chunk-index-wt2asefx.js";import{rn}from"./chunk-index-hef4gwtb.js";import"./chunk-index-4krm48hm.js";import{Tn,Kr}from"./chunk-index-pfs6rm6w.js";import{ie}from"./chunk-index-teyx2hz7.js";import{ho}from"./chunk-index-gp4chnp3.js";import"./chunk-index-aycxt14t.js";var s=500,c=(n)=>{let r=[];for(let e=0;e<n.length;e+=s)r.push(n.slice(e,e+s));return r},i=()=>O.dispatch({type:"changed"});async function w(n){let r=ho(n),e=Object.keys(r);if(e.length===0)return;let a=[];try{for(let o of c(e))a.push(...(await Tn.readAll(o)).moved)}catch(o){f(l(o),"danger"),i();return}rn(Object.fromEntries(e.map((o)=>[o,0]))),f(K(e.length,"Marked {count} room as read","Marked {count} rooms as read"),"info",a.length?{label:t("Undo"),run:()=>void m(a,r)}:void 0)}async function m(n,r){try{for(let e of c(n)){let{restored:a}=await Tn.unreadAll(e);rn(Object.fromEntries(a.map((o)=>[o,r[o]??0])))}}catch(e){f(l(e),"danger")}i()}var P=(n)=>Kr(n);async function d(n){try{await Tn.restoreHelpers(n)}catch(r){f(l(r),"danger")}i()}async function R(n){let r;try{r=(await Tn.archiveFinishedHelpers(n)).archived.flatMap((a)=>a.names)}catch(e){f(l(e),"danger"),i();return}if(i(),r.length===0)return;f(K(r.length,"Archived {count} temp knight","Archived {count} temp knights"),"info",{label:t("Undo"),run:()=>void d(r)})}async function T(n,r){try{await ie.archiveAgent(n)}catch(e){f(l(e),"danger"),i();return}i(),f(t("Archived {name}",{name:r}),"info",{label:t("Undo"),run:()=>void d([n])})}export{T as archiveHelper,P as clearAllFinished,R as clearFinishedHelpers,w as markAllRead,d as putBackHelpers};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{je,jt,Z,Qi,_n}from"./chunk-index-r0hk9kyd.js";import{j,zr,o,L,C,a,r,t,u,g,e,n,vi,fe,y,l,f,xn,he,Je,Ce}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{R}from"./chunk-index-zdzzf3fp.js";var de={"hat.none":"No hat","hat.goggcap":"Leather cap","hat.tallcap":"Burgundian felt cap","hat.softcap":"Soft cap","hat.hardhat":"Iron skullcap","hat.fcap":"Hunter's cap","hat.winghelm":"Winged helm","hat.helm":"Helm","hat.mortar":"Biretta","hat.beret":"Chaperon","hat.goggles":"Pointed cap","hat.tricorn":"Pilgrim hat","hat.sailor":"Straw hat","hat.kettle":"Kettle hat","hat.cavalier":"Feathered hat","hat.toque":"Linen cook's cap","hair.none":"No hair","beard.none":"No beard","accessory.none":"No accessory","prop.beads":"Prayer beads","prop.marotte":"Marotte","prop.map":"Chart","prop.flask":"Alchemist's phial","prop.telescope":"Astrolabe","prop.wrench":"Dividers","outfit.surplice":"Surplice","outfit.overalls":"Work jerkin","outfit.armor":"Mail hauberk","outfit.apron":"Smith's apron","outfit.chef":"Cook's tunic","outfit.coat":"Doublet","outfit.vest":"Pourpoint","outfit.sailor":"Mariner's tunic","hair.bob":"Bob","hair.bun":"Bun","hair.ponytail":"Ponytail"},X=(i)=>i.charAt(0).toUpperCase()+i.slice(1);function P(i,c){let h=`character.${i}.${c}`,b=t(h);if(b!==h)return b;if(i==="class")return Z.classes[c]?.label??X(c);return de[`${i}.${c}`]??X(c)}function Y(i){let c=`character.jobs.${i}`,h=t(c);return h!==c?h:Z.classes[i]?.jobs??""}var z=[{field:"hat",title:u("Hat"),ids:Z.hats},{field:"outfit",title:u("Outfit"),ids:Z.outfits},{field:"prop",title:u("Prop"),ids:Z.props},{field:"hair",title:u("Hair"),ids:Z.hair},{field:"beard",title:u("Beard"),ids:["none",...Z.beards]},{field:"accessory",title:u("Accessory"),ids:["none",...Z.accessories]}],ue=new Set(["class","colors","palette","build","skin","hairColor",...z.map((i)=>i.field)]),re=Object.keys(Z.palettes),ee={idle:u("Idle"),thinking:u("Thinking"),working:u("Working"),waiting:u("Waiting for you"),done:u("Done"),error:u("Error"),sleepy:u("Sleepy")},me={slim:u("Slim"),regular:u("Regular"),stout:u("Stout")};function W(i){return{class:i.class,outfit:i.outfit,hat:i.hat,prop:i.prop,hair:i.hair,beard:i.beard,accessory:i.accessory,build:i.build,skin:i.skin,hairColor:i.hairColor,colors:{...i.colors}}}var te=(i)=>JSON.stringify(W(i)),v=(i)=>i[Math.floor(Math.random()*i.length)];function be(){return{class:v(je),outfit:v(Z.outfits),hat:v(Z.hats),prop:v(Z.props),hair:v(Z.hair),beard:v(["none",...Z.beards]),accessory:v(["none",...Z.accessories]),build:v(["slim","regular","stout"]),skin:v([0,1,2,3,4,5]),hairColor:v(Z.hairColors),palette:v(re)}}var ie=j(function(c){return n("button",{type:"button",className:"creator-tile","aria-pressed":c.pressed,title:c.hint?`${c.label} — ${c.hint}`:c.label,onClick:c.onPick,...c.data,children:[e(he,{spec:c.spec,size:c.size,live:!1}),e("span",{children:c.label})]})});function ge(i,c,h){let b=JSON.stringify({...i,[c]:0});return C(()=>h.map((d)=>({...i,[c]:d})),[b,c,h])}function pe(){let i=a(null),[c,h]=r();return o(()=>{let b=i.current;if(!b)return;let d=()=>{let N=b.scrollLeft>1,A=b.scrollLeft+b.clientWidth<b.scrollWidth-1;h(N&&A?"both":A?"end":N?"start":void 0)};d(),b.addEventListener("scroll",d,{passive:!0});let p=typeof ResizeObserver>"u"?void 0:new ResizeObserver(d);return p?.observe(b),()=>{b.removeEventListener("scroll",d),p?.disconnect()}},[]),[i,c]}function ye(i){let{part:c}=i,h=ge(i.shown,c.field,c.ids),[b,d]=pe();return e("div",{className:"creator-strip",ref:b,"data-more":d,children:c.ids.map((p,N)=>e(ie,{data:{[`data-${c.field}`]:p},spec:h[N],size:44,label:P(c.field,p),pressed:i.draft[c.field]===p,onPick:()=>i.onPick(p)},p))})}function O(i){return e("button",{type:"button",className:"creator-swatch","aria-pressed":i.pressed,"aria-label":i.label,title:i.label,style:{background:i.background},onClick:i.onPick,...i.data})}function w(i){return n("div",{className:"creator-field","data-field":i.field,children:[i.title?e("h3",{children:i.title}):null,i.children,i.error?e("p",{className:"field-error",role:"alert",children:i.error}):null]})}function Me(i){let[c,h]=r(i.character),b=zr(c),[d,p]=r({}),[N,A]=r(!1),[F,ne]=r("idle"),[U,I]=r(),[B,_]=r(),G=Ce("(max-width: 719px)"),J=a(null),H=L(),oe=Je(c),se=xn(),E=te(c)!==te(i.character);o(()=>h(i.character),[i.character]),o(()=>{if(!E||i.onPick)return;let s=(k)=>k.preventDefault(),m=(k)=>{if(k.button!==0||k.metaKey||k.ctrlKey||k.shiftKey||k.altKey)return;let T=k.target instanceof Element?k.target.closest("a"):null;if(!T||T.target||T.hasAttribute("download"))return;if(J.current?.contains(T))return;k.preventDefault(),k.stopPropagation(),I({kind:"link",anchor:T})},M=vi((k)=>I({kind:"navigate",proceed:k}));return window.addEventListener("beforeunload",s),document.addEventListener("click",m,!0),()=>{M(),window.removeEventListener("beforeunload",s),document.removeEventListener("click",m,!0)}},[E,i.onPick]);let S=(s)=>{p({}),h((m)=>Qi(s,m))},le=async()=>{if(i.onPick){i.onPick(W(c),c);return}A(!0),p({});try{let s=await y.setCharacter(i.name,W(c));i.onSaved?.(s),f(t("Saved."))}catch(s){let m=s instanceof fe&&s.field?s.field.split(".")[0]:void 0,M=m&&ue.has(m)?m:"*";p({[M]:l(s)})}finally{A(!1)}},ce=async()=>{let s=U;if(h(i.character),p({}),s?.kind==="link")setTimeout(()=>s.anchor.click(),0);else if(s?.kind==="navigate")s.proceed()},V=e(w,{field:"class",title:t("Class"),error:d.class,children:e("div",{className:"creator-grid",children:je.map((s)=>e(ke,{id:s,base:b,pressed:c.class===s,onPick:()=>S({class:s,colors:c.colors})},s))})}),q=n(w,{field:"colors",title:t("Colors"),error:d.colors??d.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),re.map((s)=>{let m=Z.palettes[s];return e(O,{data:{"data-palette":s},label:P("palette",s),pressed:c.palette===s,background:`linear-gradient(135deg, ${m.primary} 52%, ${m.trim} 52%)`,onPick:()=>S({palette:s})},s)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((s)=>n("label",{children:[e("span",{children:s==="primary"?t("Primary (the accent)"):s==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:c.colors[s],onChange:(m)=>S({colors:{[s]:m.target.value}})})]},s))})]}),x=z.map((s)=>e(w,{field:s.field,title:t(s.title),error:d[s.field],children:e(ye,{part:s,draft:c,shown:b,onPick:(m)=>S({[s.field]:m})})},s.field)),Q=n(g,{children:[e(w,{field:"build",title:t("Build"),error:d.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((s)=>n("label",{"data-checked":c.build===s,children:[e("input",{type:"radio",name:`${H}-build`,checked:c.build===s,onChange:()=>S({build:s})}),ae(s)]},s))]})}),e(w,{field:"skin",title:t("Skin tone"),error:d.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),(se??Z.skins).map((s,m)=>e(O,{data:{"data-skin":String(m)},label:t("Skin tone {n}",{n:m+1}),pressed:c.skin===m,background:s,onPick:()=>S({skin:m})},m))]})}),e(w,{field:"hairColor",title:t("Hair color"),error:d.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),Z.hairColors.map((s,m)=>e(O,{data:{"data-hair-color":s},label:t("Hair color {n}",{n:m+1}),pressed:c.hairColor===s,background:s,onPick:()=>S({hairColor:s})},s)),e("input",{type:"color","aria-label":t("Hair color"),value:c.hairColor,onChange:(s)=>S({hairColor:s.target.value})})]})})]}),K=[{id:"class",title:t("Class"),summary:P("class",c.class),error:d.class,node:V},{id:"colors",title:t("Colors"),summary:c.palette?P("palette",c.palette):c.colors.primary,error:d.colors??d.palette,node:q},...z.map((s,m)=>({id:s.field,title:t(s.title),summary:P(s.field,c[s.field]),error:d[s.field],node:x[m]})),{id:"body",title:t("Body"),summary:ae(c.build),error:d.build??d.skin??d.hairColor,node:Q}];return n("form",{ref:J,className:"creator",style:oe,"aria-labelledby":H,onSubmit:(s)=>{if(s.preventDefault(),(E||i.onPick)&&!N)le()},children:[e("h2",{id:H,className:"visually-hidden",children:t("Character of {name}",{name:i.displayName})}),n("div",{className:"creator-preview",children:[e(he,{spec:c,name:i.name,state:F,size:176,label:t("{name}, {state}",{name:i.displayName,state:t(ee[F])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>ne((s)=>jt[(jt.indexOf(s)+1)%jt.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(ee[F])})]}),n("div",{className:"creator-body",children:[d["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:d["*"]}):null,G?e("ul",{className:"creator-sections",children:K.map((s)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>_(s.id),children:[e("strong",{children:s.title}),e("span",{className:"meta",children:s.summary}),s.error?e("span",{className:"field-error",role:"alert",children:s.error}):null]})},s.id))}):n(g,{children:[V,q,x,Q]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{p({}),h(_n({name:i.name,displayName:i.displayName,prompt:i.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>S(be()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(i.onCancel)i.onCancel();else if(E)I({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!E&&!i.onPick||N,children:N?t("Saving…"):i.onPick?t("Use this look"):t("Save")})]})]}),e(R,{open:G&&B!==void 0,title:K.find((s)=>s.id===B)?.title??"",onClose:()=>_(void 0),children:e("div",{className:"stack",children:K.find((s)=>s.id===B)?.node})}),e(D,{open:U!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>I(void 0),onConfirm:ce,children:e("p",{children:t("The new look for {name} has not been saved.",{name:i.displayName})})})]})}var ae=(i)=>t(me[i]);function ke(i){let c=i.base.colors,h=C(()=>Qi({class:i.id,colors:c}),[i.id,c]);return e(ie,{data:{"data-class":i.id},spec:h,size:56,label:P("class",i.id),hint:Y(i.id),pressed:i.pressed,onPick:i.onPick})}export{Me as CharacterCreator};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D}from"./chunk-index-y6p8j3zv.js";import"./chunk-index-zdzzf3fp.js";export{D as Confirm};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{o,r,t,g,e,n,h,y,l,f,v,m,k,T,_,re}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{on}from"./chunk-index-2dhrqvba.js";import{xe}from"./chunk-index-ek98d2rn.js";import{Te}from"./chunk-index-rtz4936v.js";import{ne}from"./chunk-index-57teqgct.js";import{se}from"./chunk-index-amxa2bn3.js";import"./chunk-index-zdzzf3fp.js";var P=(a,s)=>({method:a,body:JSON.stringify(s)}),U=encodeURIComponent,A={list:()=>h("connectors/managed"),add:(a)=>h("connectors/managed",P("POST",a)),describe:(a,s)=>h(`connectors/managed/${U(a)}`,P("PATCH",{description:s})),remove:(a)=>h(`connectors/managed/${U(a)}`,{method:"DELETE"}),grants:()=>h("connectors/grants"),channels:()=>h("connectors/grants/channels"),authorize:(a)=>h("connectors/grants",P("POST",a)),describeGrant:(a,s,i)=>h(`connectors/grants/${U(a)}/${U(s)}`,P("PATCH",i)),revoke:(a,s)=>h(`connectors/grants/${U(a)}/${U(s)}`,{method:"DELETE"}),rotate:(a)=>h(`connectors/grants/${U(a)}/rotate`,{method:"POST"})};var F={name:"",url:"",description:"",header:"",token:""};function Y(a){let[s,i]=r(F),[d,b]=r(),[C,w]=r(!1),p=(c)=>(M)=>i((x)=>({...x,[c]:M}));return n("form",{className:"stack",onSubmit:async(c)=>{c.preventDefault(),w(!0),b(void 0);try{let{connector:M,skipped:x}=await A.add({name:s.name,url:s.url,description:s.description,...s.header.trim()?{header:s.header}:{},...s.token?{token:s.token}:{}});i(F),f(x.length?t("Added {name}. Left out tools whose names are too long: {tools}",{name:M.name,tools:x.join(", ")}):t("Added {name}.",{name:M.name})),a.onDone()}catch(M){b(l(M))}finally{w(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:s.name,maxLength:12,placeholder:"notion",required:!0,onChange:(c)=>p("name")(c.target.value)}),e("span",{className:"meta",children:t("Lowercase letters, digits and -, up to 12; it becomes the prefix of its tool names.")})]}),n("label",{children:[t("MCP URL"),e("input",{type:"url",value:s.url,maxLength:500,placeholder:"https://mcp.example.com/mcp",required:!0,onChange:(c)=>p("url")(c.target.value)}),e("span",{className:"meta",children:t("A Streamable HTTP endpoint; one ending in /sse uses SSE. A credential may be part of the URL.")})]}),n("label",{children:[t("Purpose"),e("textarea",{value:s.description,maxLength:1000,rows:3,required:!0,onChange:(c)=>p("description")(c.target.value)}),e("span",{className:"meta",children:t("The knights decide from this text when to use the connector.")})]}),n("div",{className:"form-row",children:[n("label",{children:[t("Header name (optional)"),e("input",{value:s.header,maxLength:100,placeholder:"X-API-Key",onChange:(c)=>p("header")(c.target.value)}),e("span",{className:"meta",children:t("Leave empty to send Authorization: Bearer <token>.")})]}),n("label",{children:[t("Token (optional)"),e("input",{type:"password",value:s.token,maxLength:4000,autoComplete:"new-password",onChange:(c)=>p("token")(c.target.value)}),e("span",{className:"meta",children:t("Stored encrypted by the gateway and never shown again; leave empty if the credential is in the URL.")})]})]}),d?e(m,{message:d}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:C,children:t("Add connector")})]})]})}function j(a){let[s,i]=r(a.connector.description),[d,b]=r(),[C,w]=r(!1);return n("form",{className:"stack",onSubmit:async(N)=>{N.preventDefault(),w(!0),b(void 0);try{await A.describe(a.connector.name,s),f(t("Purpose updated.")),a.onDone()}catch(c){b(l(c))}finally{w(!1)}},children:[n("label",{children:[t("Purpose"),e("textarea",{value:s,maxLength:1000,rows:4,required:!0,onChange:(N)=>i(N.target.value)}),e("span",{className:"meta",children:t("From the next message on, the knights follow the new purpose.")})]}),d?e(m,{message:d}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:C,children:t("Save")})]})]})}function G(){let{data:a,error:s,reload:i}=on(()=>A.list()),[d,b]=r(!1),[C,w]=r(),[p,N]=r();return n("section",{className:"stack","aria-labelledby":"connectors-mine",children:[n("div",{className:"card-head",children:[e("h3",{id:"connectors-mine",children:t("MCP connectors")}),e("button",{type:"button",onClick:()=>b(!0),children:t("Add connector")})]}),s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?.length===0?e(k,{children:t("No connectors yet.")}):null,a?.map((c)=>n("article",{className:"card connector-card",children:[n("div",{className:"card-head",children:[e("strong",{children:c.name}),c.tools===void 0?e(T,{tone:"warn",children:t("Tools unreadable")}):e(T,{children:t("{count} tools",{count:c.tools})})]}),e("p",{className:"meta connector-url",children:c.displayUrl??t("(the URL cannot be parsed)")}),e("p",{children:c.description}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>w(c),children:t("Edit purpose")}),e("button",{type:"button",className:"danger",onClick:()=>N(c),children:t("Remove")})]})]},c.name)),e(ne,{open:d,title:t("Add an MCP connector"),onClose:()=>b(!1),children:d?e(Y,{onCancel:()=>b(!1),onDone:()=>{b(!1),i()}}):null}),e(ne,{open:C!==void 0,title:t("Edit purpose of {name}",{name:C?.name??""}),onClose:()=>w(void 0),children:C?e(j,{connector:C,onCancel:()=>w(void 0),onDone:()=>{w(void 0),i()}},C.name):null}),e(D,{open:p!==void 0,title:t("Remove connector"),confirmLabel:t("Remove"),tone:"danger",onClose:()=>N(void 0),onConfirm:async()=>{if(!p)return;await A.remove(p.name),f(t("Removed {name}.",{name:p.name})),i()},children:e("p",{children:t("Remove {name} and its token? From the next message on, the knights no longer use it.",{name:p?.name??""})})})]})}var V=" new",J=(a,s)=>a.map((i)=>s.find((d)=>d.id===i)?.label??i).join(", ");function K(a){return e(ne,{open:a.shown!==void 0,title:t("MCP URL of {bundle}",{bundle:a.shown?.bundle??""}),onClose:a.onClose,children:n("div",{className:"stack",children:[e("p",{children:t("This URL is the access credential and is shown only this once. Add a remote MCP server in the AI client and paste it; no separate token is needed.")}),e("input",{readOnly:!0,"aria-label":t("MCP URL"),className:"mcp-url",value:a.shown?.url??"",onFocus:(s)=>s.target.select()}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(a.shown?.url??"").then(()=>f(t("Copied")))},children:t("Copy")}),e("button",{type:"button",onClick:a.onClose,children:t("Done")})]})]})})}function X(a){return n("fieldset",{className:"field",children:[e("legend",{children:t("Allowed operations")}),e("ul",{className:"menu",children:a.operations.map((s)=>{let i=a.chosen.includes(s.id);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:i,onChange:()=>a.onChange(i?a.chosen.filter((d)=>d!==s.id):[...a.chosen,s.id])}),e("span",{className:"menu-text",children:e("strong",{children:s.label})})]})},s.id)})})]})}function Z(a){let{view:s}=a,[i,d]=r(),[b,C]=r(s.bundles[0]?.name??V),[w,p]=r(""),[N,c]=r(""),[M,x]=r([]),[L,R]=r(""),[E,W]=r(""),[I,B]=r(),[O,z]=r(!1);return o(()=>{A.channels().then((u)=>{d(u),c((S)=>S||u[0]?.id||"")},(u)=>B(l(u)))},[]),n("form",{className:"stack",onSubmit:async(u)=>{u.preventDefault(),z(!0),B(void 0);try{let S=await A.authorize({bundle:b===V?w:b,channelId:N,operations:M,...L.trim()?{displayName:L}:{},...E.trim()?{description:E}:{}});f(t("Authorized the channel in {bundle}.",{bundle:S.bundle})),a.onDone(S.url?{bundle:S.bundle,url:S.url}:void 0)}catch(S){B(l(S))}finally{z(!1)}},children:[n("label",{htmlFor:"mcp-bundle",children:[t("Bundle"),n(Te,{id:"mcp-bundle",value:b,onChange:(u)=>C(u.target.value),children:[s.bundles.map((u)=>e("option",{value:u.name,children:u.name},u.name)),e("option",{value:V,children:t("New bundle…")})]})]}),b===V?n("label",{children:[t("New bundle name"),e("input",{value:w,maxLength:80,required:!0,onChange:(u)=>p(u.target.value)}),e("span",{className:"meta",children:t("Channels in one bundle share one MCP URL.")})]}):null,n("label",{htmlFor:"mcp-channel",children:[t("Channel"),i===void 0&&!I?e(v,{}):e(Te,{id:"mcp-channel",value:N,required:!0,onChange:(u)=>c(u.target.value),children:(i??[]).map((u)=>e("option",{value:u.id,children:`${u.guild} › #${u.name}`},u.id))})]}),e(X,{operations:s.operations,chosen:M,onChange:x}),n("label",{children:[t("Name outside AI clients see (optional)"),e("input",{value:L,maxLength:100,onChange:(u)=>R(u.target.value)})]}),n("label",{children:[t("Purpose (optional)"),e("textarea",{value:E,maxLength:1000,rows:2,onChange:(u)=>W(u.target.value)})]}),I?e(m,{message:I}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:O,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:O||!N||M.length===0,children:t("Authorize")})]})]})}function Q(a){let{bundle:s,grant:i}=a.target,[d,b]=r(i.displayName),[C,w]=r(i.description),[p,N]=r(),[c,M]=r(!1);return n("form",{className:"stack",onSubmit:async(L)=>{L.preventDefault(),M(!0),N(void 0);try{await A.describeGrant(s,i.channelId,{displayName:d,description:C}),f(t("Updated what outside AI clients see.")),a.onDone()}catch(R){N(l(R))}finally{M(!1)}},children:[n("label",{children:[t("Name outside AI clients see"),e("input",{value:d,maxLength:100,required:!0,onChange:(L)=>b(L.target.value)})]}),n("label",{children:[t("Purpose"),e("textarea",{value:C,maxLength:1000,rows:3,onChange:(L)=>w(L.target.value)}),e("span",{className:"meta",children:t("The channel's name and topic on Discord stay as they are.")})]}),p?e(m,{message:p}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:c,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:c,children:t("Save")})]})]})}function ee(a){let{grant:s}=a,{timeZone:i}=_();return n("li",{className:"grant",children:[n("div",{className:"card-head",children:[e("strong",{children:s.displayName}),s.visible?null:e(T,{tone:"warn",children:t("Not visible now")})]}),e("p",{className:"meta",children:`${s.guildName} › #${s.channelName}`}),e("p",{children:s.description||t("No purpose set.")}),e("p",{className:"meta",children:t("Allowed: {operations}",{operations:J(s.operations,a.operations)})}),s.audit.length?n("details",{children:[e("summary",{children:t("Recent activity")}),e("ul",{className:"audit",children:s.audit.map((d)=>n("li",{children:[e("time",{dateTime:d.at,children:re(d.at,i)})," ",e("code",{children:d.tool})," ",d.status]},`${d.at}-${d.tool}`))})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:a.onDescribe,children:t("Rename / purpose")}),e("button",{type:"button",className:"danger",onClick:a.onRevoke,children:t("Revoke")})]})]})}function q(){let{data:a,error:s,reload:i}=on(()=>A.grants()),[d,b]=r(!1),[C,w]=r(),[p,N]=r(),[c,M]=r(),[x,L]=r();return n("section",{className:"stack","aria-labelledby":"mcp-grants",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h3",{id:"mcp-grants",children:t("MCP authorizations")}),e("p",{className:"hint",children:t("Which channels outside AI clients may use through each bundle's MCP URL, and with which operations.")})]}),e("button",{type:"button",disabled:!a,onClick:()=>b(!0),children:t("Authorize a channel")})]}),s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?.bundles.length===0?e(k,{children:t("There are no authorizations yet.")}):null,a?.bundles.map((R)=>n("article",{className:"card bundle-card",children:[n("div",{className:"card-head",children:[e("strong",{children:R.name}),e("button",{type:"button",className:"secondary",onClick:()=>M(R.name),children:t("New URL")})]}),R.grants.length===0?e(k,{children:t("No channels")}):null,e("ul",{className:"grants",children:R.grants.map((E)=>e(ee,{bundle:R.name,grant:E,operations:a.operations,onDescribe:()=>w({bundle:R.name,grant:E}),onRevoke:()=>N({bundle:R.name,grant:E})},E.channelId))})]},R.name)),e(ne,{open:d,title:t("Authorize a channel"),onClose:()=>b(!1),children:d&&a?e(Z,{view:a,onCancel:()=>b(!1),onDone:(R)=>{if(b(!1),R)L(R);i()}}):null}),e(ne,{open:C!==void 0,title:t("What outside AI clients see"),onClose:()=>w(void 0),children:C?e(Q,{target:C,onCancel:()=>w(void 0),onDone:()=>{w(void 0),i()}},`${C.bundle}/${C.grant.channelId}`):null}),e(D,{open:p!==void 0,title:t("Revoke the channel"),confirmLabel:t("Revoke"),tone:"danger",onClose:()=>N(void 0),onConfirm:async()=>{if(!p)return;await A.revoke(p.bundle,p.grant.channelId),f(t("Revoked.")),i()},children:e("p",{children:t("Remove {channel} from bundle {bundle}? Its other channels and its URL keep working; operations already sent are not undone.",{channel:p?.grant.displayName??"",bundle:p?.bundle??""})})}),e(D,{open:c!==void 0,title:t("Replace the MCP URL"),confirmLabel:t("Replace URL"),tone:"danger",onClose:()=>M(void 0),onConfirm:async()=>{if(!c)return;let{bundle:R,url:E}=await A.rotate(c);if(E)L({bundle:R,url:E});i()},children:e("p",{children:t("Replace the URL of bundle {bundle}? The old URL stops working at once; every channel setting stays.",{bundle:c??""})})}),e(K,{...x?{shown:x}:{},onClose:()=>L(void 0)})]})}var te=`
|
|
2
|
-
/* The Connectors page's management: an address never breaks the layout, a bundle's channels sit as rows. */
|
|
3
|
-
.connector-url,
|
|
4
|
-
.connectors-page .grant .meta {
|
|
5
|
-
overflow-wrap: anywhere;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.connectors-page .grants,
|
|
9
|
-
.connectors-page .audit {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: 0;
|
|
14
|
-
list-style: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.connectors-page .grant {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
gap: var(--space-1);
|
|
21
|
-
padding: var(--space-3) 0;
|
|
22
|
-
border-top: 1px solid var(--border);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.connectors-page .grant p {
|
|
26
|
-
margin: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.connectors-page .audit {
|
|
30
|
-
gap: var(--space-1);
|
|
31
|
-
font-size: var(--text-sm);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.mcp-url {
|
|
35
|
-
font-family: var(--font-mono);
|
|
36
|
-
}
|
|
37
|
-
`,H=()=>se("connectors",te);function _e(){H();let{connectorAdminUrl:a,connectorParts:s}=_(),i=s??{gateways:!0};return n("section",{className:"stack connectors-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Connectors")}),a?e("a",{href:a,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the knights.")}),i.manage?e(G,{}):null,i.grants?e(q,{}):null,i.gateways?e(ae,{}):null]})}function ae(){let{data:a,error:s}=xe(()=>y.connectors(),"connectors");return n("section",{className:"stack",children:[s?e(m,{message:s}):null,!a&&!s?e(v,{}):null,a?n(g,{children:[e("h3",{children:t("Upstream gateways")}),a.gateways.length===0?e(k,{children:t("No gateways.")}):null,a.gateways.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(T,{children:i.enabled?t("Enabled"):t("Disabled")}),e(T,{tone:i.reachable?"plain":"warn",children:i.reachable?t("Reachable"):t("Unreachable")}),e(T,{children:t("{count} tools",{count:i.tools})})]})},i.name)),e("h3",{children:t("Virtual servers")}),a.servers.length===0?e(k,{children:t("No virtual servers.")}):null,a.servers.map((i)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.name}),e(T,{children:t("{count} tools",{count:i.tools.length})})]}),n("p",{children:[t("Used by"),": ",i.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:i.tools.map((d)=>e("li",{children:d},d))})]})]},i.name))]}):null]})}export{_e as ConnectorsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,u,g,e,n,x,y,v,m,k,T,_,Se,re,Le,mn,wi,J}from"./chunk-index-wt2asefx.js";import{xe}from"./chunk-index-ek98d2rn.js";var h=[{kind:"owner",title:u("Owner channels"),note:u("Direct messages and channels where the owner talks to a knight.")},{kind:"agent",title:u("Bot server channels"),note:u("The bot server's one-to-one channels.")},{kind:"group",title:u("Group channels"),note:u("The bot server's group channels.")},{kind:"outside",title:u("Outside AI clients"),note:u("Conversations an outside AI client holds over MCP.")},{kind:"plugin",title:u("Plugin conversations"),note:u("Conversations a plugin runs, such as a web chat, as the host recorded them.")}];function P(){let{timeZone:o}=_(),{now:i}=J(),{data:a,error:s}=xe(()=>y.conversations(),"conversations"),c=a?.conversations;if(!c)return s?e(m,{message:s}):e(v,{});return n(g,{children:[s?e(m,{message:s}):null,h.map((r)=>{let d=c.filter((l)=>l.kind===r.kind);return n("section",{className:"stack",children:[e("h2",{children:t(r.title)}),e("p",{className:"hint",children:t(r.note)}),d.length===0?e(k,{children:t("None stored.")}):null,d.map((l)=>e(p,{item:l,now:i,timeZone:o},l.key))]},r.kind)})]})}function p(o){let{item:i}=o,a=mn(i.channel,i.id),s=wi(i);return n("a",{className:"card card-link",href:x("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:s}),i.busy>0?e(T,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(T,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${re(i.startedAt,o.timeZone)} · `:a.detail?`${a.detail} · `:"",i.principal?`${i.visibility==="private"?t("Private to {name}",{name:i.principal.name}):t("Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",Se(i.lastActive,o.now,o.timeZone)," ·"," ",Le(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{P as ConversationsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Di,Ui,xr}from"./chunk-index-am7ghh75.js";import"./chunk-index-4jnn2g09.js";import"./chunk-index-haac6nbt.js";import"./chunk-index-zdzzf3fp.js";import"./chunk-index-zeqfnkty.js";import"./chunk-index-hef4gwtb.js";export{Di as CouncilChip,xr as CouncilView,Ui as useCouncilSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Sr,wr,kr,_r,Tr}from"./chunk-index-nsya88fn.js";export{wr as collapsedNow,_r as expandFolder,Tr as pruneCollapsed,kr as toggleCollapsed,Sr as useCollapsed};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-ntt3em2k.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt}from"./chunk-index-h2a42p6s.js";export{lt as HostPicture};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mo,ze,go,Oo,yo,bo,vo,rn,pr,xo,ma}from"./chunk-index-hef4gwtb.js";export{xo as keepCards,pr as keepReads,vo as noCards,bo as noReads,ma as onFrame,rn as seedUnread,mo as subscribeHost,Oo as totalUnread,yo as unreadCounts,go as unreadOf,ze as useHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j,E,o,L,Ne,C,a,r,t,K,g,e,n,s,x,fn,O,d,fe,l,f,v,m,k,T,Zt,Dn,Et,_,Dr,Se,Wt,gn,At,On,Nt,J,Sn,Ce,rr,Ee}from"./chunk-index-wt2asefx.js";import{Ln}from"./chunk-index-haac6nbt.js";import{Bi,Wo,Ze,Fi}from"./chunk-index-4jnn2g09.js";import{D}from"./chunk-index-y6p8j3zv.js";import{ze,bo,vo,rn,pr,xo}from"./chunk-index-hef4gwtb.js";import{at,lt}from"./chunk-index-h2a42p6s.js";import{Er}from"./chunk-index-rr73h4kc.js";import"./chunk-index-ntt3em2k.js";import{Te}from"./chunk-index-rtz4936v.js";import{ne}from"./chunk-index-57teqgct.js";import"./chunk-index-zdzzf3fp.js";function Je(c){let i={};for(let u of c)if(u.type==="multiselect")i[u.name]=[...Ve(u.initial)];else i[u.name]=Ve(u.initial)[0]??"";return i}var Ve=(c)=>c===void 0?[]:typeof c==="string"?[c]:[...c];function je(c,i){let u={};for(let p of c){let y=i[p.name];if(y===void 0||y===""||y.length===0)continue;u[p.name]=y}return u}function Ke(c){let{field:i,value:u}=c,[p,y]=r(""),N=i.search?i.options.filter((h)=>h.label.toLowerCase().includes(p.trim().toLowerCase())):i.options,H=i.search?e("input",{type:"search",value:p,placeholder:t("Search…"),"aria-label":t("Search {name}",{name:i.label}),onChange:(h)=>y(h.target.value)}):null;if(i.type==="select")return n(g,{children:[H,n(Te,{id:c.id,value:String(u),required:i.required===!0,"aria-describedby":c.described,...i.search?{size:6}:{},onChange:(h)=>c.onChange(h.target.value),children:[i.required?null:e("option",{value:"",children:t("None")}),N.map((h)=>e("option",{value:h.value,children:h.label},h.value))]})]});let b=new Set(Array.isArray(u)?u:[]);return n(g,{children:[H,e("fieldset",{"aria-describedby":c.described,children:N.map((h)=>n("label",{children:[e("input",{type:"checkbox",checked:b.has(h.value),onChange:(S)=>{let w=new Set(b);if(S.target.checked)w.add(h.value);else w.delete(h.value);c.onChange(i.options.filter((V)=>w.has(V.value)).map((V)=>V.value))}}),h.label]},h.value))})]})}function et(c){let{field:i,value:u}=c,p=L(),y="hint"in i?i.hint:void 0,N=c.error||y?`${p}-note`:void 0,H;if("options"in i)H=e(Ke,{field:i,id:p,value:u,described:N,onChange:c.onChange});else if(i.type==="textarea")H=e("textarea",{id:p,rows:5,value:String(u),maxLength:i.max??8000,required:i.required===!0,"aria-describedby":N,onChange:(b)=>c.onChange(b.target.value)});else H=e("input",{id:p,type:i.type==="url"?"url":"text",value:String(u),maxLength:i.max??500,required:i.required===!0,"aria-describedby":N,onChange:(b)=>c.onChange(b.target.value)});return n("div",{className:"host-field",children:[i.type==="multiselect"?e("span",{className:"field-label",children:i.label}):e("label",{htmlFor:p,children:i.label}),H,c.error||y?e("span",{id:`${p}-note`,className:c.error?"field-error":"hint",role:c.error?"alert":void 0,children:c.error??y}):null]})}function ue(c){let{spec:i}=c,[u,p]=r(()=>Je(i.fields)),[y,N]=r(!1),[H,b]=r();return n("form",{className:"host-form",onSubmit:async(S)=>{if(S.preventDefault(),y)return;N(!0),b(void 0);try{b(await c.onSubmit(je(i.fields,u)))}catch(w){b({error:l(w)})}finally{N(!1)}},children:[i.fields.map((S)=>e(et,{field:S,value:u[S.name]??"",error:H?.field===S.name?H.error:void 0,onChange:(w)=>p((V)=>({...V,[S.name]:w}))},S.name)),H&&!i.fields.some((S)=>S.name===H.field)?e(m,{message:H.error}):null,n("div",{className:"actions",children:[c.onCancel?e("button",{type:"button",className:"secondary",disabled:y,onClick:c.onCancel,children:t("Cancel")}):null,e("button",{type:"submit",disabled:y,children:i.submit})]})]})}function tt(c){if(!c.ok)return{error:Bi(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)Fi(c.open);return}function oe(c){let[i,u]=r(),[p,y]=r(!1),N=async(b,h)=>tt(await c.run(b,h)),H=async(b)=>{if(b.form||b.confirm){u(b);return}y(!0);try{let h=await N(b,{});if(h)f(h.error,"danger")}catch(h){f(l(h),"danger")}finally{y(!1)}};if(c.actions.length===0)return null;return n("div",{className:c.className??"host-actions",children:[c.actions.map((b)=>e("button",{type:"button",className:b.style==="danger"?"danger":b.style==="secondary"?"secondary":"",disabled:p,onClick:()=>H(b),children:b.label},b.id)),i?.form?e(ne,{open:!0,title:i.form.title,onClose:()=>u(void 0),children:e(ue,{spec:i.form,onCancel:()=>u(void 0),onSubmit:async(b)=>{let h=await N(i,b);if(!h)u(void 0);return h}})}):i?e(D,{open:!0,title:i.label,confirmLabel:i.label,tone:i.style==="danger"?"danger":"primary",onConfirm:async()=>{let b=await N(i,{});if(b)throw Error(b.error)},onClose:()=>u(void 0),children:e("p",{children:i.confirm})}):null]})}var Oe=/^file:([A-Za-z0-9_-]{1,64})$/;function Pe(c){let i=URL.parse(c,document.baseURI);return i!==null&&i.origin===window.location.origin}function nt({id:c,alt:i}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(c)}`,alt:i,loading:"lazy",decoding:"async",onError:(u)=>{let p=document.createElement("span");p.textContent=i||t("Image"),u.currentTarget.replaceWith(p)}})}var re=j(function({source:i}){return e("div",{className:"prose",children:e(Zt,{remarkPlugins:[Et],urlTransform:(u)=>Oe.test(u)?u:Dn(u),components:{a:({href:u,children:p})=>u&&/^https?:\/\//.test(u)&&!Pe(u)?e("a",{href:u,target:"_blank",rel:"noreferrer noopener",children:p}):u&&Pe(u)?e("a",{href:u,children:p}):e("span",{children:p}),img:({src:u,alt:p})=>{let y=typeof u==="string"?Oe.exec(u):null;return y?.[1]?e(nt,{id:y[1],alt:p??""}):e("span",{children:p})},pre:Dr,table:({children:u})=>e("div",{className:"table-wrap",children:e("table",{children:u})})},children:i})})});function rt(c){switch(c??"open"){case"working":return t("Working…");case"done":return t("Done");case"superseded":return t("Replaced");case"expired":return t("Expired");default:return""}}var we=(c)=>(c.state??"open")==="open";function ae(c){let{card:i}=c,u=rt(i.state);return n("article",{className:"host-card","data-tone":i.tone??"note","data-state":i.state??"open",children:[n("header",{children:[e("h3",{children:i.title}),u?e(T,{tone:i.state==="working"?"busy":"plain",children:u}):null]}),i.body?e(re,{source:i.body}):null,i.links?.length?e("div",{className:"host-card-links",children:i.links.map((p)=>e("a",{href:p.url,...p.url.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.label},`${p.url}`))}):null,we(i)&&i.buttons?.length?e(oe,{actions:i.buttons,run:c.run}):null]})}at();function ot(){let[c,i]=r(()=>Ln().toString());return o(()=>{let u=()=>i(Ln().toString());return window.addEventListener("popstate",u),window.addEventListener("hashchange",u),()=>{window.removeEventListener("popstate",u),window.removeEventListener("hashchange",u)}},[]),c}function st(c){if(!c.ok)return{error:Bi(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)Fi(c.open);return}function it(c){let{section:i}=c;switch(i.kind){case"markdown":return e(re,{source:i.text});case"card":return e(ae,{card:i.card,run:c.run});case"form":return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:i.form.title}),e(ue,{spec:i.form,onSubmit:(u)=>c.submit(i.action,u)})]});case"list":return n("section",{className:"stack",children:[i.title?e("h2",{className:"section-title",children:i.title}):null,i.rows.length===0?e(k,{children:t("Nothing here.")}):null,e("ul",{className:"host-list",children:dt(i.rows).map(([u,p])=>n("li",{children:[p.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null,n("div",{className:"host-list-main",children:[p.open?e("a",{href:p.open,...p.open.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.title}):e("strong",{children:p.title}),p.subtitle?e("span",{children:p.subtitle}):null]}),p.actions?.length?e(oe,{actions:p.actions,run:c.run}):null]},u))})]})}}function ct({routeKey:c}){let i=c??"",u=ot(),p=ze((w)=>w.pages[i]??0),[y,N]=r(0),[H,b]=r({});o(()=>{let w=!0;return Ze.page(i,Object.fromEntries(new URLSearchParams(u))).then((V)=>w&&b({page:V}),(V)=>{if(!w)return;let P=V instanceof fe&&V.status===404;b((q)=>({...P||!q.page?{}:{page:q.page},error:l(V),gone:P}))}),()=>{w=!1}},[i,u,p,y]);let h=async(w,V)=>{let P=await Ze.pageAct(i,{action:w,input:V}),q=st(P);if(!q)N((I)=>I+1);return q},S=async(w,V)=>{let P=await Ze.pageAct(i,{action:w.id,input:V});if(P.ok)N((q)=>q+1);return P};if(H.gone)return e("div",{className:"page",children:e(k,{children:t("This page is not available.")})});if(!H.page)return e("div",{className:"page",children:H.error?e(m,{message:H.error}):e(v,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:H.page.title})}),H.error?e(m,{message:H.error}):null,H.page.sections.map((w,V)=>e(it,{section:w,run:S,submit:h},V))]})}function dt(c){let i=new Map;return c.map((u)=>{let p=i.get(u.title)??0;return i.set(u.title,p+1),[`${u.title}:${p}`,u]})}var ut=/https?:\/\/[^\s<>"']+/g,mt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function ft(c){let i=c.replace(mt,""),u=URL.parse(i);return u&&(u.protocol==="https:"||u.protocol==="http:")?i:""}function _e({text:c}){let i=[],u=0;for(let p of c.matchAll(ut)){let y=ft(p[0]);if(y==="")continue;let N=p.index;if(N>u)i.push(c.slice(u,N));i.push(e("a",{href:y,target:"_blank",rel:"noreferrer noopener",children:y},`${N}`)),u=N+y.length}if(u<c.length)i.push(c.slice(u));return e("span",{className:"plain",children:i})}var qe=j(function(i){let{message:u}=i,p=u.authorKind??"external";if(p==="notice")return n("li",{className:"host-notice","data-mid":u.id,"data-highlight":i.highlighted||void 0,"data-enter":i.enter||void 0,children:[e(s,{name:"bell",size:14}),e(re,{source:u.text}),e("time",{dateTime:u.at,children:Wt(u.at,i.timeZone)})]});let y=p==="member"&&u.principalId!==void 0&&u.principalId===i.me;return n("li",{className:"message","data-mid":u.id,"data-author":p,"data-mine":y||void 0,"data-header":i.header||void 0,"data-enter":i.enter||void 0,"data-unread":i.unread||void 0,"data-highlight":i.highlighted||void 0,children:[y?null:e("span",{className:"message-avatar",children:i.header?e(lt,{picture:u.picture,name:u.author}):null}),n("div",{className:"message-main",children:[i.header?n("div",{className:"message-meta",children:[e("strong",{children:u.author}),u.authorLabel?e("span",{className:"label-chip",children:u.authorLabel}):null,e("time",{dateTime:u.at,children:Wt(u.at,i.timeZone)})]}):null,n("div",{className:"bubble",children:[u.text?p==="assistant"?e(re,{source:u.text}):e(_e,{text:u.text}):null,e(Nt,{files:u.files}),u.expiredFiles?e("p",{className:"message-expired",children:K(u.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),u.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});var pt=1500,gt=96,me=new Set,ke=new Map;function ht(c){if(document.visibilityState!=="visible")return!1;return!c||c.scrollHeight-c.scrollTop-c.clientHeight<gt}function De(c){if(!(c instanceof Element))return;let i=c.closest("[data-unread][data-mid]");return i?Number(i.dataset.mid):void 0}function Ue(c){let{room:i,scroller:u,messages:p,began:y,enterAfter:N,me:H,shared:b}=c,h=a({seen:void 0,watched:new Set}),[,S]=r(0),w=ke.get(i)??me;if(N!==void 0&&p){let M=h.current;M.seen??=N;let F=ht(u.current),G=M.seen;for(let A of p){if(A.id<=M.seen)continue;if(F)M.watched.add(A.id);G=Math.max(G,A.id)}M.seen=G}let V=C(()=>{if(y===void 0||N===void 0||!p)return me;let M=new Set;for(let F of p){if(F.id===0||F.id<=y)continue;if(F.kind==="system"||F.note)continue;if(F.authorKind==="notice")continue;if(F.principalId===void 0?F.kind==="owner"&&!b:F.principalId===H)continue;if(h.current.watched.has(F.id)||w.has(F.id))continue;M.add(F.id)}return M.size===0?me:M},[p,y,N,H,b,w]),P=E((M)=>{let F=ke.get(i)??me;if(F.has(M))return;ke.set(i,new Set(F).add(M)),S((G)=>G+1)},[i]),q=V.size>0;o(()=>{let M=u.current;if(!M||!q)return;let F=(A)=>{if(A.pointerType==="touch")return;let B=De(A.target);if(B!==void 0)P(B)},G=(A)=>{let B=De(A.target);if(B!==void 0)P(B)};return M.addEventListener("pointerover",F,{passive:!0}),M.addEventListener("focusin",G,{passive:!0}),M.addEventListener("click",G,{passive:!0}),()=>{M.removeEventListener("pointerover",F),M.removeEventListener("focusin",G),M.removeEventListener("click",G)}},[u,P,q]);let I=a(new Map),U=[...V].join(",");return o(()=>{let M=u.current,F=I.current;for(let[W,Z]of F)if(!V.has(W))clearTimeout(Z),F.delete(W);if(!M||!q||typeof IntersectionObserver!=="function"||!matchMedia("(pointer: coarse)").matches)return;let G=(W)=>{let Z=F.get(W);if(Z===void 0)return;clearTimeout(Z),F.delete(W)},A=new IntersectionObserver((W)=>{for(let Z of W){let te=Number(Z.target.dataset.mid),le=Z.rootBounds;if(!(Z.isIntersecting&&(Z.intersectionRatio>=0.5||le!==null&&Z.intersectionRect.height>=le.height*0.5))){G(te);continue}if(F.has(te))continue;F.set(te,setTimeout(()=>{if(F.delete(te),document.visibilityState==="visible")P(te)},pt))}},{root:M,threshold:[0,0.25,0.5,0.75,1]}),B=[...M.querySelectorAll("[data-unread][data-mid]")];for(let W of B)A.observe(W);let X=()=>{if(document.visibilityState!=="visible")return;for(let W of B)A.unobserve(W),A.observe(W)};return document.addEventListener("visibilitychange",X),()=>{document.removeEventListener("visibilitychange",X),A.disconnect()}},[u,P,q,U]),o(()=>{let M=I.current;return()=>{for(let F of M.values())clearTimeout(F);M.clear()}},[]),V}at();var bt=3;function yt({marks:c}){let[i,u]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":i,onClick:()=>u((p)=>!p),children:[c.slice(0,bt).map((p)=>e(lt,{picture:{principal:p.principal},name:p.name,size:16},p.principal)),e("span",{children:t("Seen by {count}",{count:c.length})})]}),i?e("span",{className:"seen-names",children:c.map((p)=>p.name).join(t(", "))}):null]})}function vt(c,i){let u=Ee(),p=d((y)=>y.connects);o(()=>{let y=i.current;if(!y)return;let N=0,H=0,b,h,S=()=>{if(h=void 0,document.visibilityState!=="visible")return;let P=y.getBoundingClientRect(),q=0;for(let U of y.querySelectorAll("[data-mid]")){let M=U.getBoundingClientRect();if(M.bottom>P.top&&M.top<P.bottom-4)q=Math.max(q,Number(U.dataset.mid))}if(q<=N)return;let I=H+1000-Date.now();if(I>0){clearTimeout(b),b=setTimeout(w,I);return}if(u.send({type:"read",room:c,upTo:q}))N=q,H=Date.now()},w=()=>{if(h===void 0)h=requestAnimationFrame(S)};y.addEventListener("scroll",w,{passive:!0}),document.addEventListener("visibilitychange",w),window.addEventListener("resize",w);let V=new MutationObserver(w);return V.observe(y,{childList:!0,subtree:!0}),w(),()=>{if(y.removeEventListener("scroll",w),document.removeEventListener("visibilitychange",w),window.removeEventListener("resize",w),V.disconnect(),clearTimeout(b),h!==void 0)cancelAnimationFrame(h)}},[u,c,i,p])}function pe(c){let{roomKey:i}=c;vt(i,c.scroller);let u=d((w)=>w.principal?.id),p=d((w)=>w.rooms[i]?.messages),y=ze((w)=>w.reads[i]??bo),N=ze((w)=>w.cursor[i]),H=a(void 0);if(H.current===void 0&&N!==void 0)H.current=N;let b=d((w)=>w.rooms[i]?.view?.notes===!0),h=Ue({room:i,scroller:c.scroller,messages:p,began:H.current,enterAfter:c.enterAfter,me:u,shared:c.host===!0||b}),S=C(()=>{let V=(p??[]).filter((I)=>I.kind!=="system"),P=H.current===void 0?void 0:V.find((I)=>I.id>(H.current??0)&&(I.principalId===void 0||I.principalId!==u))?.id,q=new Map;for(let I of y){if(I.principal===u)continue;let U=V.findLast((M)=>M.id<=I.upTo);if(U)q.set(U.id,[...q.get(U.id)??[],I])}return{before:(I)=>I.id===P?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(I)=>{let U=q.get(I.id);return U?e(yt,{marks:U}):null},unread:(I)=>h.has(I.id),...c.host?{message:(I,U)=>I.kind==="system"&&I.authorKind===void 0?void 0:e(qe,{message:I,header:U.header,enter:U.enter,unread:U.unread,timeZone:U.timeZone,me:u,highlighted:c.highlight===I.id})}:{}}},[p,y,u,c.host,c.highlight,h]);return e(Sn,{roomKey:i,enterAfter:c.enterAfter,quotable:c.quotable,decor:S})}at();var wt=20,kt=2600,$e;function Ht(c,i,u){let p=d((b)=>b.connects),y=ze((b)=>b.rooms[c]??0),[N,H]=r({view:void 0,error:void 0,gone:!1});return o(()=>{let b=!0;return Ze.open(i,u).then((h)=>{if(!b)return;O.dispatch({type:"history_loaded",room:c,messages:h.messages,more:h.more,older:!1}),pr(c,h.reads,h.cursor),xo(c,h.cards),H({view:h,error:void 0,gone:!1})},(h)=>{if(!b)return;let S=h instanceof fe&&h.status===404;H((w)=>({view:S?void 0:w.view,error:l(h),gone:S}))}),()=>{b=!1}},[c,i,u,p,y]),N}function Rt(c){let{header:i}=c;return n(g,{children:[i.banner?e("p",{className:"host-banner","data-tone":i.banner.tone,role:"status",children:i.banner.text}):null,i.fields.length?e("dl",{className:"host-head-fields",children:i.fields.map((u)=>n("div",{children:[e("dt",{children:u.label}),e("dd",{children:u.link?e("a",{href:u.link,...u.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:u.value}):u.value})]},`${u.label}:${u.value}`))}):null,e(oe,{className:"host-actions bar",actions:i.actions,run:c.run})]})}function St(c){let i=ze((S)=>S.cards[c.room]??vo),u=Ce("(min-width: 720px) and (min-height: 760px)"),[p,y]=r();if(i.length===0)return null;let N=i.filter((S)=>we(S)||S.state==="working"),H=i.filter((S)=>!N.includes(S)),b=p??(u&&N.length>0),h=N[0];return n("div",{className:"host-cards","data-open":b||void 0,children:[n("button",{type:"button",className:"host-cards-toggle","aria-expanded":b,onClick:()=>y(!b),children:[e(s,{name:"chevron",size:14}),h?n("span",{children:[e("strong",{children:K(N.length,"{count} card waiting","{count} cards waiting")}),`: ${h.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:H.length})})]}),b?n("div",{className:"host-cards-body",children:[N.map((S)=>e(ae,{card:S,run:c.run(S.id)},S.id)),H.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:H.length})}),H.map((S)=>e(ae,{card:S,run:c.run(S.id)},S.id))]}):null]}):null]})}function Lt({roomKey:c}){let i=Ee(),u=Wo(c),p=u?.kind??"",y=u?.id??"",{view:N,error:H,gone:b}=Ht(c,p,y),h=d((R)=>R.rooms[c]),S=d((R)=>R.limits),w=d((R)=>R.connects),V=d((R)=>R.connection==="open"),P=a(null),q=a(null),{away:I,onScroll:U,onGrow:M,toEnd:F}=rr(P),[G,A]=r(!1),[B,X]=r(),[W,Z]=r($e),[te,le]=r(!1),[Re,Ae]=r(),he=a(void 0),se=a(void 0),Q=N!==void 0;if(o(()=>{if(!u||b||!Q)return;return i.send({type:"subscribe",room:c}),i.focus(c),()=>{i.focus(void 0),i.send({type:"unsubscribe",room:c})}},[i,c,w,b,Q]),Q&&he.current===void 0)he.current=h?.messages.at(-1)?.id??0;Ne(()=>{if(Q)F(!1)},[Q]),Ne(()=>{let R=P.current;if(R&&se.current!==void 0)R.scrollTop+=R.scrollHeight-se.current,se.current=void 0},[h?.messages[0]?.id]),o(()=>{let R=q.current;if(!R||typeof ResizeObserver>"u")return;let z=new ResizeObserver(M);return z.observe(R),()=>z.disconnect()},[M]);let be=E(async()=>{let R=O.getState().rooms[c]?.messages[0];if(!R)return!1;let z=await Ze.older(p,y,R.id,fn);return O.dispatch({type:"history_loaded",room:c,messages:z.messages,more:z.more,older:!0}),pr(c,z.reads,void 0),z.more},[c,p,y]),ce=a(void 0);o(()=>{let R=()=>{let z=Number(Ln().get("message"));ce.current=Number.isSafeInteger(z)&&z>0?z:void 0};return R(),window.addEventListener("popstate",R),()=>window.removeEventListener("popstate",R)},[]);let ye=h?.messages[0]?.id,Le=h?.more===!0;o(()=>{let R=ce.current,z=P.current;if(!Q||R===void 0||!z)return;let Y=z.querySelector(`[data-mid="${R}"]`);if(Y){ce.current=void 0,Y.scrollIntoView({block:"center"}),Ae(R),requestAnimationFrame(()=>z.dispatchEvent(new Event("scroll"))),setTimeout(()=>Ae(void 0),kt);return}if(ye!==void 0&&R<ye&&Le){let ie=0;(async()=>{if(ie+=1,!await be().catch(()=>!1)||ie>=wt)ce.current=void 0})()}},[Q,ye,Le,h?.messages.length,be]);let Me=(R,z={},Y)=>Ze.act(p,y,{action:R.id,...Y===void 0?{}:{card:Y},input:z}),We=(R,z)=>Me(R,z),Qe=(R)=>(z,Y)=>Me(z,Y,R);if(b||!Q&&!H&&!u)return e("section",{className:"room",children:n("div",{className:"page",children:[e(k,{children:t("This room is not available.")}),e("a",{className:"back",href:x("rooms"),children:t("Back to rooms")})]})});let ee=N?.access.send??[],ve=ee.length>1,Fe=ve&&te,xe=W&&ee.includes(W)?W:ee.includes("turn")?"turn":ee[0],Ie=Fe||xe==="turn",Ye=Ie?N?.wording?.turn?.placeholder??t("Ask AI…"):N?.wording?.note?.placeholder??t("Write an internal note…"),de=N?.header.title??c,Xe=h?.messages??[];return n("section",{className:"room",onDragOver:(R)=>{if(ee.length&&R.dataTransfer.types.includes("Files"))R.preventDefault()},onDrop:(R)=>{if(!ee.length||!R.dataTransfer.files.length)return;R.preventDefault(),X([...R.dataTransfer.files])},children:[n("header",{className:"room-head",children:[e("a",{className:"icon-button room-back",href:x("rooms"),"aria-label":t("Back to rooms"),children:e(s,{name:"back"})}),e(lt,{name:de,size:40}),n("div",{className:"room-title",children:[e("h1",{children:de}),e("span",{className:"room-status","data-working":h?.typing||void 0,children:h?.typing?t("Working…"):t("Host room")})]})]}),!V?n("div",{className:"offline-banner",role:"status",children:[e("span",{className:"spinner","aria-hidden":"true"}),t("Reconnecting… messages wait here until it is back.")]}):null,N?e(Rt,{header:N.header,run:We}):null,e("div",{className:"room-scroll",ref:P,onScroll:U,children:n("div",{className:"room-content",ref:q,children:[H?e(m,{message:H}):null,!Q&&!H?e(v,{}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:G,onClick:async()=>{A(!0),se.current=P.current?.scrollHeight;try{await be()}catch(R){se.current=void 0,f(l(R),"danger")}finally{A(!1)}},children:G?t("Loading…"):t("Load earlier messages")}):null,Q&&Xe.length===0?e(k,{children:t("No messages yet.")}):null,e(pe,{roomKey:c,enterAfter:he.current,quotable:!1,scroller:P,host:!0,highlight:Re}),h?.typing?e(On,{name:de,progress:h.progress}):null]})}),I?n("button",{type:"button",className:"to-end",onClick:()=>F(!0),children:[e(s,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,N?e(St,{room:c,run:Qe}):null,N&&ee.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,N&&ee.length>0?e(g,{children:e(At,{draftKey:c,name:de,placeholder:Ye,onAddressed:le,...ve?{above:e(Er,{on:Ie,label:N?.wording?.turn?.label??t("@AI"),...Fe?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(R)=>{let z=R?"turn":"note";$e=z,Z(z)}})}:{},limits:S,stoppable:Boolean(h?.stoppable),onSend:(R,z,Y)=>{if(ve&&Y){let ie=gn(R);i.say(c,ie===""&&z.length===0?R:ie,z,"turn")}else i.say(c,R,z,xe);F(!0)},onStop:()=>i.send({type:"stop",room:c}),...B?{incoming:B,onIncomingTaken:()=>X(void 0)}:{}},c)}):null]})}at();function ge({room:c}){let i=ze((u)=>u.unread[c]??0);if(i<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":K(i,"{count} unread message","{count} unread messages"),children:i>99?"99+":i})}at();var Ct=6,Tt=250;function He(c){let{kind:i}=c,{timeZone:u}=_(),{now:p}=J(),y=d((A)=>A.connects),N=ze((A)=>A.lists[i]??0),[H,b]=r(""),[h,S]=r(""),[w,V]=r(),[P,q]=r(),[I,U]=r(),[M,F]=r(!1);o(()=>{let A=setTimeout(()=>S(H.trim()),Tt);return()=>clearTimeout(A)},[H]),o(()=>{let A=!0;return Ze.list(i,h||void 0).then((B)=>{if(!A)return;rn(Object.fromEntries(B.rooms.map((X)=>[X.key,X.unread??0]))),V(B.rooms),q(B.cursor),U(void 0)},(B)=>A&&U(l(B))),()=>{A=!1}},[i,h,y,N]);let G=async()=>{if(!P||M)return;F(!0);try{let A=await Ze.list(i,h||void 0,P);rn(Object.fromEntries(A.rooms.map((B)=>[B.key,B.unread??0]))),V((B)=>[...B??[],...A.rooms]),q(A.cursor)}catch(A){U(l(A))}finally{F(!1)}};return n("section",{className:"stack",children:[n("h2",{className:"section-title",children:[c.icon?e(s,{name:c.icon,size:14,className:"section-icon"}):null,c.label]}),w&&(w.length>=Ct||h||H)?e("input",{type:"search",className:"kind-filter",value:H,placeholder:t("Search {name}",{name:c.label}),"aria-label":t("Search {name}",{name:c.label}),onChange:(A)=>b(A.target.value)}):null,I?e(m,{message:I}):null,!w&&!I?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,w&&w.length===0?e(k,{children:h?t("Nothing matches."):t("No rooms yet.")}):null,w&&w.length>0?e("ul",{className:"room-list",children:w.map((A)=>e("li",{children:n("a",{className:"room-row",href:x("room",A.key),"aria-current":A.key===c.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(lt,{picture:A.picture,name:A.title,size:44}),A.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null]}),n("span",{className:"room-row-main",children:[n("span",{className:"room-row-top",children:[e("strong",{children:A.title}),e(ge,{room:A.key}),e("span",{className:"room-row-time",children:A.lastAt?Se(A.lastAt,p,u):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:A.subtitle??""})})]}),e(s,{name:"chevron",size:16,className:"room-row-chevron"})]})},A.key))}):null,P?e("button",{type:"button",className:"secondary",disabled:M,onClick:G,children:M?t("Loading…"):t("Show more")}):null]})}function Be(c){return c.kinds.map((i)=>e(He,{kind:i.kind,label:i.label,...i.icon?{icon:i.icon}:{},active:c.active},i.kind))}function Ge(){let c=(_().pages??[]).filter((i)=>i.place==="settings");if(c.length===0)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("More settings")}),c.map((i)=>n("a",{className:"menu-item menu-link",href:x("p",i.id),children:[e("span",{className:"menu-text",children:e("strong",{children:i.label})}),e(s,{name:"chevron",size:16})]},i.id))]})}export{Be as HostKinds,ct as HostPage,Lt as HostRoomPage,Ge as HostSettingsPages,pe as ReadLog,ge as UnreadMark};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jn}from"./chunk-index-9m9v1p7s.js";var f=12;function m(r,e){let t=r.find((u)=>e>=u.top&&e<=u.bottom);if(t)return t;let n,o=f+1;for(let u of r){let i=e<u.top?u.top-e:e-u.bottom;if(i<o)n=u,o=i}return n}function d(r,e,t){for(let n of r)if(n.key!==e&&n.top+n.height/2>t)return n.key;return null}function ds(r,e,t){let n=m(r,t);return n?{zone:n,before:d(n.items,e,t)}:void 0}function fs(r,e,t){let{zone:n,before:o}=t;if(n.kind==="rest")return r.kind==="rest"?void 0:{kind:"unplace"};if(n.kind==="pinned"&&r.kind==="pinned"||n.kind==="folder"&&r.kind==="folder"&&r.folder===n.folder){let i=r.siblings;if(jn(i,e,o).every((s,l)=>s===i[l]))return}return n.kind==="pinned"?{kind:"pin",before:o}:{kind:"folder",folder:n.folder,before:o}}function hs(r,e,t,n){if(n<e.top-f*3||n>e.bottom+f*3)return;return{before:d(r,t,n)}}function io(r,e,t,n=0){let o=(r[e]?.height??0)+n;return r.map((u,i)=>{if(i===e)return 0;if(e<t&&i>e&&i<=t)return-o;if(e>t&&i>=t&&i<e)return o;return 0})}function ro(r,e,t){return jn(r,e,t).indexOf(e)}function ps(r,e,t,n=64,o=18){if(r<e+n)return-Math.min(1,(e+n-r)/n)*o;if(r>t-n)return Math.min(1,(r-(t-n))/n)*o;return 0}var ms=600;
|
|
2
|
-
export{ds,fs,hs,io,ro,ps,ms};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E,o,r,l,J}from"./chunk-index-wt2asefx.js";function on(s){let{version:i}=J(),[a,u]=r(0),[f,d]=r(),[c,n]=r();o(()=>{let e=!0;return s().then((t)=>{if(!e)return;d(t),n(void 0)},(t)=>{if(e)n(l(t))}),()=>{e=!1}},[a,i]);let m=E(()=>u((e)=>e+1),[]);return{data:f,error:c,reload:m}}
|
|
2
|
-
export{on};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o,a,r,t,g,e,n,s,bi,X,Re,d,y,f,bn,ns,is}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{Xe,Ri,ws}from"./chunk-index-smz90j6p.js";import{Kt,fr,eo,to,no}from"./chunk-index-yvcdg5hh.js";import{ne}from"./chunk-index-57teqgct.js";import{ie,Ae}from"./chunk-index-teyx2hz7.js";import{Vs,et,wo}from"./chunk-index-9m9v1p7s.js";import{st,zt}from"./chunk-index-7c9fn21n.js";function x(i){let{room:l}=i,m=d((c)=>{let k=st(c,(h)=>Re(c,h)),v=zt(k,l),b=v.kind==="rest"?[]:v.siblings;return{name:c.rooms[l]?.view?.displayName??l,folder:v.kind==="folder"?v.folder:"",pinned:v.kind==="pinned",canUp:et(b,l,"up")!==void 0,canDown:et(b,l,"down")!==void 0}},l),u=d((c)=>c.folders),p=(c)=>{i.onClose(),Kt(l,c)},C=m.folder===""&&!m.pinned;return n("div",{className:"stack",children:[e("p",{className:"meta",children:m.name}),n("fieldset",{children:[e("legend",{className:"visually-hidden",children:t("Move to folder…")}),n("ul",{className:"menu",children:[e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:C,onChange:()=>p(null)}),e("span",{className:"menu-icon",children:e(s,{name:"rooms",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Ungrouped")})})]})}),u.map((c)=>e("li",{children:n("label",{className:"menu-item menu-link",children:[e("input",{type:"radio",name:"move-folder",checked:m.folder===c.id,onChange:()=>p(c.id)}),e("span",{className:"menu-icon",children:e(s,{name:"folder",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:c.name})})]})},c.id)),e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>Xe({kind:"new",room:l}),children:[e("span",{className:"menu-icon",children:e(s,{name:"plus",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("New folder…")})})]})})]})]}),m.canUp||m.canDown?n("ul",{className:"menu",children:[m.canUp?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),fr(l,"up")},children:[e("span",{className:"menu-icon",children:e(s,{name:"up",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move up")})})]})}):null,m.canDown?e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{i.onClose(),fr(l,"down")},children:[e("span",{className:"menu-icon",children:e(s,{name:"down",size:18})}),e("span",{className:"menu-text",children:e("strong",{children:t("Move down")})})]})}):null]}):null]})}function R(i){return e(ne,{open:i.open,title:t("Move to folder…"),onClose:i.onClose,children:e(x,{room:i.room,onClose:i.onClose})})}function E(i){let{ask:l}=i,[m,u]=r(l.kind==="rename"?l.name:""),[p,C]=r(),[c,k]=r(!1),v=a(null);return o(()=>v.current?.focus(),[]),n("form",{className:"stack",onSubmit:async(h)=>{h.preventDefault();let w;try{w=wo(m)}catch{C(t("Give the folder a name of 1 to 40 characters."));return}k(!0),C(void 0);let N;if(l.kind==="rename")N=await to(l.id,w,C)!==void 0;else{let F=await eo(w,C);if(N=F!==void 0,F&&l.room)await Kt(l.room,F)}if(k(!1),N)i.onClose()},children:[n("div",{className:"field",children:[e("label",{className:"field-label",htmlFor:"folder-name",children:t("Folder name")}),e("input",{id:"folder-name",type:"text",ref:v,value:m,autoComplete:"off",enterKeyHint:"done",maxLength:Vs*2,"aria-invalid":p?!0:void 0,onChange:(h)=>u(h.target.value)}),p?e("p",{className:"field-error",role:"alert",children:p}):null]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:c,onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:c,children:l.kind==="rename"?t("Rename"):t("Create")})]})]})}function A(){let i=ws(),l=a(void 0);if(i)l.current=i;let m=l.current;if(!m)return null;let u=m.kind==="new"||m.kind==="rename";return n(g,{children:[u?e(ne,{open:i?.kind==="new"||i?.kind==="rename",title:m.kind==="rename"?t("Rename folder"):t("Add a folder"),onClose:Ri,children:e(E,{ask:m,onClose:Ri})}):null,m.kind==="delete"?e(D,{open:i?.kind==="delete",title:t("Delete folder"),confirmLabel:t("Delete folder"),tone:"danger",onClose:Ri,onConfirm:async()=>{let p="";if(!await no(m.id,(c)=>{p=c}))throw Error(p)},children:e("p",{children:t("Delete the folder {name}? Its rooms move to Ungrouped; no room is deleted.",{name:m.name})})}):null,m.kind==="move"?e(R,{open:i?.kind==="move",room:m.room,onClose:Ri}):null]})}function M(i){return n(D,{open:i.open,title:t("Turn on yolo mode?"),confirmLabel:t("Turn on yolo mode"),tone:"yolo",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await y.setMode(i.room,{yolo:!0})},children:[e("p",{children:t("In this room, the knight's held actions are approved for you, without a card, as soon as they come up.")}),e("p",{children:t("Risky classes still ask: running as another user, deleting files, force pushes, disk, service and firewall changes, and anything that names its own approvers. The host can add more.")}),e("p",{children:t("Every approval it makes is written into the conversation, and a banner stays up while yolo mode is on.")})]})}function S(i){return e(D,{open:i.open,title:t("Start over {name}?",{name:i.name}),confirmLabel:t("Start over"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{await y.startRoomOver(i.room)},children:e("p",{children:t("The current conversation is archived and the next message begins a new one. Long-term memory is kept. A turn that is running finishes first.")})})}function L(i){return e(D,{open:i.open,title:t("Archive {name}?",{name:i.name}),confirmLabel:t("Archive"),tone:"danger",...i.restoreFocus?{restoreFocus:i.restoreFocus}:{},onClose:i.onClose,onConfirm:async()=>{let l=i.room.indexOf("."),m=i.room.slice(l+1);if(i.room.slice(0,l).endsWith(":group"))await ie.archiveGroup(m);else await ie.archiveAgent(m);if(bn(),await Ae(),f(t("Archived {name}.",{name:i.name})),bi().key===i.room)X("rooms")},children:e("p",{children:t("{name} stops answering and its schedules are cancelled. A group loses it as a member. The history is kept, and Archived in the room list restores it.",{name:i.name})})})}function vr(){return n(g,{children:[e(T,{}),e(A,{})]})}function T(){let i=is(),l=a(void 0);if(i)l.current=i;let m=l.current;if(!m)return null;let u={room:m.room,name:m.name,restoreFocus:m.restoreFocus,onClose:ns};return n(g,{children:[e(M,{open:i?.kind==="yolo",...u}),e(S,{open:i?.kind==="start-over",...u}),e(L,{open:i?.kind==="archive",...u})]})}
|
|
2
|
-
export{vr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var Vs=40;class l extends Error{code;constructor(e){super(e);this.code=e;this.name="LayoutError"}}function jn(e,n,r){if(r===n&&e.includes(n))return[...e];let t=e.filter((o)=>o!==n),i=r===null||r===void 0?-1:t.indexOf(r);if(i<0)return[...t,n];return[...t.slice(0,i),n,...t.slice(i)]}function et(e,n,r){let t=e.indexOf(n);if(t<0)return;if(r==="up")return t===0?void 0:{before:e[t-1]??null};return t===e.length-1?void 0:{before:e[t+2]??null}}function wo(e){let n=e.trim(),r=Array.from(n).length;if(r<1||r>40||/\p{Cc}/u.test(n))throw new l("bad-name");return n}var c=(e,n)=>e.toLocaleLowerCase()===n.toLocaleLowerCase();function u(e,n){let r=e.folders.findIndex((t)=>t.id===n);if(r<0)throw new l("no-folder");return r}var f=(e,n)=>({pins:e.pins,folders:n});function qs(e,n,r){let t=u(e,n),i=wo(r);if(e.folders.some((o)=>o.id!==n&&c(o.name,i)))throw new l("duplicate");return f(e,e.folders.map((o,s)=>s===t?{...o,name:i}:o))}function Bs(e,n,r){let t=u(e,n),i=e.folders[t],o=jn(e.folders.map((s)=>s.id),n,r);return f(e,o.map((s)=>s===n?i:e.folders.find((a)=>a.id===s)))}function Fs(e,n){return u(e,n),f(e,e.folders.filter((r)=>r.id!==n))}var d=(e,n)=>({pins:e.pins.filter((r)=>r!==n),folders:e.folders.map((r)=>r.rooms.includes(n)?{...r,rooms:r.rooms.filter((t)=>t!==n)}:r)});function Gs(e,n,r,t){if(r!==null)u(e,r);let i=d(e,n);if(r===null)return i;return f(i,i.folders.map((o)=>o.id===r?{...o,rooms:jn(o.rooms,n,t)}:o))}function Zs(e,n,r,t){let i=d(e,n);if(!r)return i;return{pins:jn(e.pins.filter((o)=>o!==n),n,t),folders:i.folders}}
|
|
2
|
-
export{Vs,jn,et,wo,qs,Bs,Fs,Gs,Zs};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{p,t,X,hn,O,l,f,Ko,ge,Ye,$t,we,kt}from"./chunk-index-wt2asefx.js";import{zs}from"./chunk-index-e2eeckhh.js";import{oo}from"./chunk-index-93f3e06v.js";import{Wn}from"./chunk-index-x4tq9btg.js";import{en}from"./chunk-index-pcbkp62w.js";import{ie,Ae}from"./chunk-index-teyx2hz7.js";import{po}from"./chunk-index-gp4chnp3.js";var d=(e)=>e();async function Zn(e){try{await navigator.clipboard.writeText(e),f(t("Copied"))}catch{f(t("Could not copy."),"danger")}}async function c(e){try{await navigator.share(e)}catch(o){if(o instanceof DOMException&&o.name==="AbortError")return;f(t("Could not share."),"danger")}}var b=()=>(p("5dc4m9ad"),import("./chunk-bulk-actions-5dc4m9ad.js")),h=()=>typeof navigator.share==="function";function aa(e,o=d){let i=O.getState().rooms[e],n=i?.view;if(!n||n.kind==="thread")return;let s=i.mode,a=n.home||n.helper?[]:oo(e,o);if(n.kind==="agent"){let r=n.name;a.push({id:"edit",label:t("Edit knight"),icon:"profile",run:()=>o(()=>Ye(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>o(()=>Ye(r,{look:!0}))},{id:"skills",label:t("Skills"),icon:"skills",run:()=>o(()=>Ye(r,{skills:!0}))})}if(n.kind==="group"){let r=n.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>o(()=>kt({kind:"group",name:r}))})}if(n.kind==="agent")a.push(...po([e]));if(!n.helper)a.push({id:"notifications",label:t("Notifications"),icon:n.muted?"bell-off":"bell",checked:!n.muted,run:async()=>{let r=n.muted!==!0;if(!await en(e,r))return;f(r?t("Notifications are off for {name}",{name:n.displayName}):t("Notifications are on for {name}",{name:n.displayName}))}});if(!n.readOnly)a.push({id:"yolo",label:t("Yolo mode"),icon:"bolt",tone:"yolo",checked:s.yolo,run:()=>{if(s.yolo)return $t(e,{yolo:!1});we({kind:"yolo",room:e,name:n.displayName})}},{id:"long",label:t("Long-running mode"),icon:"timer",tone:"long",checked:s.longRunning,run:()=>$t(e,{longRunning:!s.longRunning})},{id:"start-over",label:t("Start over"),icon:"reset",tone:"danger",run:()=>we({kind:"start-over",room:e,name:n.displayName})});if(n.helper){let{name:r,displayName:g}=n;a.push({id:"archive-helper",label:t("Archive this temp knight"),icon:"archive",tone:"danger",run:()=>b().then((v)=>v.archiveHelper(r,g))})}else if(!n.readOnly&&!n.coordinator)a.push({id:"archive",label:n.kind==="group"?t("Archive group"):t("Archive knight"),icon:"archive",tone:"danger",run:()=>we({kind:"archive",room:e,name:n.displayName})});return{title:n.displayName,items:a}}function ta(e=d){return{title:t("Add"),items:[{id:"new-agent",label:t("New knight"),icon:"profile",run:()=>e(()=>kt({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>kt({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>kt({kind:"archive"}))}]}}function la(e,o){let i=e.getBoundingClientRect();ge({...ta(o),at:{x:i.left,y:i.bottom},via:"key",source:e})}function ca(e,o){let{rooms:i}=O.getState(),n=i[e]?.view,s=i[o]?.view;if(n?.kind!=="agent"||s?.kind!=="group")return;return{title:n.displayName,items:[{id:"chat",label:t("Private chat"),icon:"conversations",run:()=>X("room",e)},{id:"leave",label:t("Remove from the council"),icon:"close",run:()=>y(s,n)}]}}async function y(e,o){let i=(e.members??[]).filter((n)=>n!==o.name);if(i.length<Wn){we({kind:"archive",room:e.key,name:e.displayName});return}try{let n=await ie.group(e.name);await ie.updateGroup(e.name,{members:i,...n.host===o.name?{host:i[0]??""}:{}}),await Ae(),f(t("{name} left the council",{name:o.displayName}))}catch(n){f(l(n),"danger")}}function u(e,o){let i=e.querySelector(".bubble > .prose");if(!i)return o;return(i.innerText||i.textContent||o).trim()}function w(e){let o=window.getSelection();if(!o||o.isCollapsed)return"";return(o.anchorNode&&e.contains(o.anchorNode)?o.toString():"").trim()}function ua(e,o,i){let n=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>Zn(w(o)||u(o,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>Zn(e.text)}];if(i)n.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>Ko(e.room,e.text)});if(n.push({id:"select",label:t("Select text"),icon:"list",run:()=>zs(e.author,e.text)}),h())n.push({id:"share",label:t("Share"),icon:"send",run:()=>c({text:u(o,e.text)})});return{title:e.author,items:n}}function da(e,o){return{title:o,items:[{id:"profile",label:t("Knight profile"),icon:"profile",run:()=>Ye(e)}]}}var m=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((o)=>o.description?`- ${o.label}: ${o.description}`:`- ${o.label}`)];function na(e){let o=[e.title];switch(e.kind){case"approval":{o.push("",e.message);let{approval:i}=e;if(i){if(o.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)o.push(JSON.stringify(i.input,null,2));for(let n of i.files??[])o.push(n.path)}break}case"ask":o.push("",...m({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)o.push("",...m(i));break}return o.join(`
|
|
2
|
-
`)}function fa(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>Zn(na(e))}]}}function k(e){let o=document.createElement("a");o.href=hn(e),o.download=e.name,o.hidden=!0,document.body.append(o),o.click(),o.remove()}async function M(e){let o=new URL(hn(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(o);if(i.ok){let n=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[n]})){await c({files:[n],title:e.name});return}}}catch{}await c({title:e.name,url:o})}function ha(e){let o=[{id:"download",label:t("Download"),icon:"download",run:()=>k(e)}];if(h())o.push({id:"share",label:t("Share"),icon:"send",run:()=>M(e)});return{title:e.name,items:o}}
|
|
3
|
-
export{Zn,aa,ta,la,ca,ua,da,na,fa,ha};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import{p,Q,S,ke,o,Ne,C,zn,a,r,t,u,g,e,n,s,Me,X,d,M,pn,In,rt,_,We,gn,At,Ot,Un,On,ge,we,os,xn,he,Nt,Je,De,ss,tr,nr,ir,Sn,Ce,He,Ee,wn,lr,cr}from"./chunk-index-wt2asefx.js";import{Ze}from"./chunk-index-4jnn2g09.js";import{ze}from"./chunk-index-hef4gwtb.js";import{Pn}from"./chunk-index-zeqfnkty.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-zdzzf3fp.js";var Ae=(i)=>`roundtable-console:council-mode:${i}`,Ge=(i)=>`rt-table-mode:${i}`,qe="roundtable-console:table-mode",Re=new Map,{emit:Ln,use:Nn}=M(),Te=(i)=>i==="scene"||i==="chat"?i:void 0;function ye(i){try{return globalThis.localStorage?.getItem(i)??void 0}catch{return}}function Le(i,c){try{if(c===void 0)globalThis.localStorage?.removeItem(i);else globalThis.localStorage?.setItem(i,c)}catch{}}function Hn(i){let c=ye(Ge(i)),m=c==="1"?"scene":c==="0"?"chat":void 0,f=m??Te(ye(qe))??"scene";if(m!==void 0||Te(ye(qe)))Le(Ae(i),f),Le(Ge(i),void 0);return f}function Dn(i){let c=Re.get(i);if(c!==void 0)return c;let m=Te(ye(Ae(i)))??Hn(i);return Re.set(i,m),m}function Vn(i,c){Re.set(i,c),Le(Ae(i),c),Ln()}function je(i){return[Nn(()=>Dn(i)),(c)=>Vn(i,c)]}var Fn=`
|
|
2
|
-
/* The box's fold button says what it does, in words beside its chevron. */
|
|
3
|
-
.scene-collapse {
|
|
4
|
-
width: auto;
|
|
5
|
-
flex: none;
|
|
6
|
-
gap: var(--space-1);
|
|
7
|
-
padding-inline: var(--space-2);
|
|
8
|
-
font-size: var(--text-xs);
|
|
9
|
-
}
|
|
10
|
-
.scene-collapse span {
|
|
11
|
-
white-space: nowrap;
|
|
12
|
-
}
|
|
13
|
-
/* Folded, the box is one bar: who speaks, the start of their newest line, and the button that opens it. */
|
|
14
|
-
.scene-bar {
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: var(--space-2);
|
|
18
|
-
min-height: var(--touch);
|
|
19
|
-
padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
}
|
|
22
|
-
.scene-bar .scene-chip {
|
|
23
|
-
width: 2rem;
|
|
24
|
-
height: 2rem;
|
|
25
|
-
margin: 0;
|
|
26
|
-
border-width: 2px;
|
|
27
|
-
flex: none;
|
|
28
|
-
}
|
|
29
|
-
.scene-bar-name {
|
|
30
|
-
flex: 0 1 auto;
|
|
31
|
-
min-width: 3ch;
|
|
32
|
-
max-width: 35%;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
text-overflow: ellipsis;
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
}
|
|
37
|
-
.scene-bar-preview {
|
|
38
|
-
flex: 1 1 0;
|
|
39
|
-
min-width: 0;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
white-space: nowrap;
|
|
43
|
-
color: var(--muted);
|
|
44
|
-
font-size: var(--text-sm);
|
|
45
|
-
}
|
|
46
|
-
.scene-bar-asking {
|
|
47
|
-
flex: none;
|
|
48
|
-
padding: 0 var(--space-2);
|
|
49
|
-
border-radius: var(--radius-full);
|
|
50
|
-
background: color-mix(in srgb, var(--accent) 16%, transparent);
|
|
51
|
-
font-size: var(--text-xs);
|
|
52
|
-
white-space: nowrap;
|
|
53
|
-
}
|
|
54
|
-
.scene-composer[hidden] {
|
|
55
|
-
display: none;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* On a phone the tab's tools are narrow, but the fold button keeps its words. */
|
|
59
|
-
@media (max-width: 719px) {
|
|
60
|
-
.scene-tools .scene-collapse,
|
|
61
|
-
.scene-bar .scene-collapse {
|
|
62
|
-
width: auto;
|
|
63
|
-
min-width: 0;
|
|
64
|
-
padding-inline: var(--space-1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/* Phones held upright: folded, the box is only its bar and the scene takes the rest. */
|
|
68
|
-
@media (max-width: 719px) and (orientation: portrait) {
|
|
69
|
-
.table-frame[data-focused][data-folded] {
|
|
70
|
-
grid-template-rows: minmax(0, 1fr) auto;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`,Kn=`
|
|
74
|
-
/* The header's tools wrap under the title on a narrow screen rather than overflow it. */
|
|
75
|
-
.table-tools {
|
|
76
|
-
flex-wrap: wrap;
|
|
77
|
-
justify-content: flex-end;
|
|
78
|
-
}
|
|
79
|
-
/* The switch between the scene and the chat: two short choices that sit beside the council chip. */
|
|
80
|
-
.table-mode {
|
|
81
|
-
flex: none;
|
|
82
|
-
margin: 0;
|
|
83
|
-
}
|
|
84
|
-
.table-mode label {
|
|
85
|
-
min-height: 2rem;
|
|
86
|
-
padding: 0 var(--space-2);
|
|
87
|
-
font-size: var(--text-sm);
|
|
88
|
-
white-space: nowrap;
|
|
89
|
-
}
|
|
90
|
-
/* A council's header: on a phone its tools take a row of their own under the title. */
|
|
91
|
-
@media (max-width: 719px) {
|
|
92
|
-
.council-head {
|
|
93
|
-
flex-wrap: wrap;
|
|
94
|
-
}
|
|
95
|
-
.council-head .table-tools {
|
|
96
|
-
order: 3;
|
|
97
|
-
flex-basis: 100%;
|
|
98
|
-
min-width: 0;
|
|
99
|
-
}
|
|
100
|
-
.council-head .council-chip {
|
|
101
|
-
flex: 1 1 0;
|
|
102
|
-
min-width: 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/* The council's messages as a chat fill the view under its header, like a room's own list. */
|
|
106
|
-
.table-chat {
|
|
107
|
-
position: relative;
|
|
108
|
-
flex: 1;
|
|
109
|
-
min-height: 0;
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: column;
|
|
112
|
-
}
|
|
113
|
-
`,Ye=()=>se("dialogue-fold",Fn),Ii=()=>se("table-page",Kn);function Ue(i,c,m,f){if(!i)return;let l=i.pending.at(-1);if(l&&!l.failed)return{id:`p${l.id}`,who:"owner",author:c,text:l.text,files:[],live:!1,pending:!0};if(i.typing&&i.progress.text!==""){let h=i.agent??f;return{id:`s${i.messages.at(-1)?.id??0}`,who:"agent",agent:h,author:m(h),text:i.progress.text,files:[],live:!0,pending:!1}}let b=i.live.at(-1);if(b)return{id:`l${b.live??b.id}`,who:"agent",agent:b.agent,author:b.author,text:b.text,files:b.files,live:!0,pending:!1};for(let h=i.messages.length-1;h>=0;h-=1){let y=i.messages[h];if(!y||y.kind==="system")continue;return Xe(y)}return}function Xe(i){return{id:`m${i.id}`,who:i.kind==="owner"?"owner":"agent",agent:i.agent,author:i.author,text:i.text,files:i.files,live:!1,pending:!1}}var _n=(i,c)=>i.id===c.id||i.who===c.who&&i.agent===c.agent&&i.text!==""&&c.text!==""&&(c.text.startsWith(i.text)||i.text.startsWith(c.text));function Qe(){let i=[],c,m=(f)=>{let l=i.length-1,b=i[l];if(b&&_n(b,f))i[l]=f;else i.push(f)};return{get line(){return i[0]},get waiting(){return Math.max(0,i.length-1)},feed(f,l){let b=f.at(-1)?.id??0;if(!c){c=b,i=l?[l]:[];return}if(!l){c=Math.max(c,b),i=[];return}for(let h of f)if(h.id>c&&h.kind!=="system")m(Xe(h));if(c=Math.max(c,b),l&&!l.id.startsWith("m"))m(l)},advance(){if(i.length<2)return!1;return i=i.slice(1),!0}}}function en(i,c,m,f){if(i!==void 0&&f.includes(i))return i;if(c!==void 0&&f.includes(c))return c;return qn(m,f)}function nn(i,c,m){return i.cardOrder.map((l)=>({id:l,card:i.cards[l]})).filter((l)=>l.card?.room===c).filter((l)=>l.card.outcome===void 0||m===void 0||l.card.after>=m)}var Bn=90;function Gn(i,c,m,f={}){if(f.instant)return c;let l=i+m/1000*(f.cps??Bn);return Math.min(c,Math.max(i,l))}function tn(){let i,c="",m=0,f=0;return{get shown(){return Math.floor(f)},get done(){return Math.floor(f)>=m},feed(l,b){if(l!==i){let h=c!==""&&(b.startsWith(c)||c.startsWith(b));if(i=l,!h)f=0}if(c=b,m=Array.from(b).length,f>m)f=m},step(l,b){f=Gn(f,m,l,{instant:b})},finish(){f=m}}}function on(i,c,m){if(i?.who!=="agent")return;if(i.live&&m!==void 0)return m;return c?i.agent:void 0}function rn(i,c=80){let m=i.split(`
|
|
114
|
-
`).map((l)=>l.replace(/^\s*(?:#{1,6}\s|>\s?|[-*+]\s|\d+\.\s)+/,"").replace(/[*_`~]/g,"").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\s+/g," ").trim()).find((l)=>l!=="")??"",f=Array.from(m);return f.length>c?`${f.slice(0,c-1).join("")}…`:m}var sn=(i,c)=>Array.from(i).slice(0,c).join("");function qn(i,c){if(!i||i.who!=="agent"||i.agent===void 0)return null;return c.includes(i.agent)?i.agent:null}function an(i,c,m){return m&&m.lineId===c?m.member:i}var Wn=["①","②","③","④","⑤","⑥","⑦","⑧"];function cn(i){if(!i)return[];return[...i.spoken.map((c)=>({name:c,place:"spoken"})),...i.current===void 0?[]:[{name:i.current,place:"current"}],...i.next.map((c,m)=>({name:c,place:"next",order:m+1}))]}function dn(i){let c={};if(i?.state!=="running")return c;for(let f of i.spoken)c[f]="✓";let m=new Set;if(i.next.forEach((f,l)=>{let b=Wn[l];if(b===void 0||m.has(f))return;m.add(f),c[f]=b}),i.current!==void 0)delete c[i.current];return c}var le=(i)=>i?.state==="running"?i.current:void 0;function ln(i){let c=i.current===void 0?i.replies:i.replies+1;return Math.min(Math.max(c,0),i.limit)}var un="roundtable-console:dialogue-folded",Oe=new Map,{emit:jn,use:Yn}=M();function Xn(i){let c=Oe.get(i);if(c!==void 0)return c;try{let m=globalThis.localStorage?.getItem(i)??void 0;if(m!==void 0)Oe.set(i,m);return m}catch{return}}function Zn(i,c){Oe.set(i,c);try{globalThis.localStorage?.setItem(i,c)}catch{}jn()}var Jn=()=>Xn(un)==="1";function Qn(i){Zn(un,i?"1":"0")}function ve(){return[Yn(Jn),Qn]}var Se={},{emit:et,use:nt}=M();function Ve(i,c){if(Se[i]===c)return;let m={...Se};if(c===void 0)delete m[i];else m[i]=c;Se=m,et()}var tt=()=>Se;function xe(){return nt(tt)}var ot=24;function mn(i,c,m){let f=a(!0);o(()=>{let l=i.current;if(!l)return;let b=()=>{f.current=l.scrollHeight-l.scrollTop-l.clientHeight<=ot};return l.addEventListener("scroll",b,{passive:!0}),()=>l.removeEventListener("scroll",b)},[i]),Ne(()=>{let l=i.current;if(!c){f.current=!0;return}if(l&&f.current)l.scrollTop=l.scrollHeight},[i,c,m])}function st(i){if(i.ended==="limit")return t("Limit reached");if(i.ended==="stopped")return t("Round stopped");if(i.ended==="done")return t("{count} of {limit} replies",{count:i.replies,limit:i.limit});return t("Reply {n} of {limit}",{n:i.n,limit:i.limit})}var Pe=(i)=>st({...i,n:ln(i)});function fn(i){let c=d((h)=>h.rooms[i.roomKey]?.round),m=d((h)=>{let y={};for(let v of Object.values(h.rooms))if(v.view?.kind==="agent")y[v.view.name]=v.view.displayName;return y}),f=De();if(!c)return null;let l=cn(c),b=(h)=>m[h]??h;return n("div",{className:"order-strip","data-state":c.state,children:[e("ol",{className:"order-faces","aria-label":t("Speaking order"),children:l.map((h,y)=>n("li",{className:"order-face","data-place":h.place,title:b(h.name),children:[e(he,{spec:f[h.name],name:h.name,size:h.place==="current"?36:26,live:!1}),e("span",{className:"order-badge","aria-hidden":"true",children:h.place==="spoken"?"✓":h.place==="next"?h.order:null}),e("span",{className:"visually-hidden",children:`${b(h.name)}, ${h.place==="spoken"?t("has spoken"):h.place==="current"?t("speaking"):t("next")}`})]},`${h.name}:${y}`))}),e("span",{className:"order-chip","aria-live":"polite",children:Pe(c)}),c.state==="running"&&(c.queued??0)>0?e("span",{className:"order-queued",children:t("Your message waits for the next round")}):null]})}Ye();function it(i){let c=a(tn()),[,m]=zn((h)=>h+1,0),f=Me();c.current.feed(i?.id??"",i?.text??"");let l=i?.text??"",b=i?.id;return o(()=>{let h=c.current;if(f||l===""||b===void 0){h.finish(),m();return}let y=performance.now(),v=0,x=()=>{let T=performance.now();if(h.step(T-y,!1),y=T,m(),!h.done)v=requestAnimationFrame(x)};if(!h.done)v=requestAnimationFrame(x);return()=>cancelAnimationFrame(v)},[f,b,l]),{shown:c.current.shown,done:c.current.done,finish(){c.current.finish(),m()}}}function Fe(i){let c=d((y)=>y.rooms[i]),m=d((y)=>y.principal?.name)??t("You"),f=d((y)=>{let v={};for(let x of Object.values(y.rooms))if(x.view?.kind==="agent")v[x.view.name]=x.view.displayName;return v}),l=c?.view,b=(y)=>(y===void 0?void 0:f[y])??y??l?.displayName??i,h=Ue(c,m,b,l?.kind==="agent"?l.name:void 0);return{room:c,view:l,line:h,displayOf:b}}function at(i){let{loaded:c,error:m}=i,f=d((y)=>y.rooms[i.roomKey]),[l,b]=r(!1),h=a(null);return o(()=>{if(i.open&&c)h.current?.scrollTo({top:h.current.scrollHeight})},[i.open,c]),e(R,{open:i.open,title:`${i.name} · ${t("Log")}`,onClose:i.onClose,children:n("div",{className:"scene-log",ref:h,children:[m?e("p",{className:"failure-text",children:m}):null,f?.more?e("button",{type:"button",className:"secondary older",disabled:l,onClick:async()=>{b(!0),await ir(i.roomKey),b(!1)},children:l?t("Loading…"):t("Load earlier messages")}):null,e(Sn,{roomKey:i.roomKey,enterAfter:void 0,quotable:!0})]})})}function hn(i){let{roomKey:c}=i,m=Ee(),f=_(),l=nr(c),b=i.streams!==!1;o(()=>{if(!b)return;return m.focus(c),()=>m.focus(void 0)},[m,c,b]);let h=d((L)=>L.limits),y=d((L)=>nn(L,c,L.rooms[c]?.messages.at(-1)?.id)),v=De(),{room:x,view:T,line:O,displayOf:Z}=Fe(c),q=a(void 0);if(q.current?.room!==c)q.current={room:c,stage:Qe()};let{stage:H}=q.current;H.feed(x?.messages??[],O);let{line:k,waiting:V}=H,P=T?.kind==="agent"?T:void 0,F=P?P.name:k?.who==="agent"?k.agent:void 0,ne=Je(F?v[F]:void 0),B=P?P.displayName:k?k.author:T?.displayName??c,{shown:te,done:G,finish:K}=it(k),[,J]=zn((L)=>L+1,0);o(()=>{if(G&&V>0&&H.advance())J()},[G,V,H]);let oe=le(x?.round),re=Boolean(x?.typing&&x.progress.text!==""&&V===0),ae=on(k,!G,re?oe??k?.agent:void 0);o(()=>{Ve(c,ae)},[c,ae]),o(()=>()=>Ve(c,void 0),[c]);let z=a(null);mn(z,!G,te);let[j,Y]=r(!1),[D,I]=ve(),ce=k?.who==="owner"&&!P?{["--agent-accent"]:"var(--accent)"}:ne,ee=Boolean(x?.typing),w=G&&V===0&&k?.who==="agent"&&oe!==void 0&&oe!==k.agent,E=ee&&(!k||k.who==="owner"||w),N=k?sn(k.text,te):"",ie=P||k?.who==="agent"?e("span",{className:"scene-chip",children:e(he,{spec:F?v[F]:void 0,name:F??B,size:34,live:!1})}):null,W=y.some(({card:L})=>L.outcome===void 0),de=n("button",{type:"button",className:"icon-button scene-collapse","aria-expanded":!D,onClick:(L)=>{L.stopPropagation(),I(!D)},children:[e(s,{name:"chevron",style:{rotate:D?"-90deg":"90deg"}}),e("span",{children:D?t("Expand dialogue"):t("Collapse dialogue")})]});return n("section",{className:"scene-box","data-open":i.open||void 0,"data-collapsed":D||void 0,"data-who":k?.who,style:ce,"aria-label":t("Log"),children:[D?n("div",{className:"scene-bar",onClick:()=>I(!1),children:[ie,e("strong",{className:"scene-bar-name",children:B}),e("span",{className:"scene-bar-preview",children:k?rn(k.text):x?.round?Pe(x.round):""}),W?e("span",{className:"scene-bar-asking",children:t("Waiting for your answer")}):null,de]}):n("header",{className:"scene-tab",children:[ie,e("strong",{className:"scene-name",children:B}),n("span",{className:"scene-tools",children:[i.onBack?e("button",{type:"button",className:"icon-button","aria-label":t("Back to the whole table"),onClick:i.onBack,children:e(s,{name:"back"})}):null,i.onMenu?e("button",{type:"button",className:"icon-button scene-more","aria-label":t("More"),"aria-haspopup":"menu",onClick:(L)=>i.onMenu?.(L.currentTarget),children:e(s,{name:"more"})}):null,n("button",{type:"button",className:"icon-button scene-log-button","aria-label":t("Log"),"aria-haspopup":"dialog",onClick:()=>Y(!0),children:[e(s,{name:"conversations"}),e("span",{children:t("Log")})]}),de]})]}),D?null:i.strip,D?null:n("div",{className:"scene-body",ref:z,children:[e("div",{className:"scene-line","data-live":k?.live||void 0,"aria-live":"polite",...G?{}:{role:"button",tabIndex:0,title:t("Tap to show the whole message"),onClick:K,onKeyDown:(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),K()}},children:k?n(g,{children:[P&&k.who==="owner"?e("span",{className:"scene-from",children:k.author}):null,e(We,{source:N}),G?e(Nt,{files:k.files}):null]}):null}),E&&x?e(On,{name:w?Z(oe):B,progress:x.progress}):null,y.map(({id:L,card:A})=>e("div",{className:"scene-card",children:e(tr,{card:A,timeZone:f.timeZone})},L))]}),T?.readOnly?null:e("div",{className:"scene-composer",hidden:D,children:e(At,{draftKey:c,name:T?.displayName??c,limits:h,stoppable:Boolean(x?.stoppable),blurAfterSend:i.blurAfterSend===!0,...T?.kind==="group"?{stopLabel:t("Stop the round")}:{},onSend:(L,A)=>m.say(c,L,A),onStop:()=>m.send({type:"stop",room:c})},c)}),e(at,{roomKey:c,open:j,loaded:l.loaded,error:l.error,name:T?.displayName??c,onClose:()=>Y(!1)})]})}var ct=8,dt={views:[],attention:{},loaded:!1},bn=dt,{emit:lt,use:ut}=M(),An=()=>ut(()=>bn);function ai(){let i=ke(rt)?.tier;return i!==void 0&&i!=="owner"}function mt(i,c){return{key:i.key,kind:"agent",name:`${c}.${i.id}`,displayName:i.title,home:!1,readOnly:!1,mode:{yolo:!1,longRunning:!1},typing:!1,stoppable:!1}}var ft=(i)=>i.attention===!0,pt=(i,c)=>(c.lastAt??"").localeCompare(i.lastAt??"");async function gt(i){let c=await Promise.allSettled(i.map((l)=>Ze.list(l))),m=[];c.forEach((l,b)=>{let h=i[b];if(l.status!=="fulfilled"||h===void 0)return;for(let y of l.value.rooms)m.push({room:y,kind:h})}),m.sort((l,b)=>pt(l.room,b.room));let f={};for(let{room:l}of m)if(ft(l))f[l.key]=!0;return{views:m.map(({room:l,kind:b})=>mt(l,b)),attention:f,loaded:!0}}function Uo(i){let c=Ee(),m=d((x)=>x.connects),f=ze((x)=>x.lists),l=a(0),b=a(0),h=i.join(`
|
|
115
|
-
`),{views:y}=An();o(()=>{l.current+=1;let x=l.current,T=!0;return gt(h===""?[]:h.split(`
|
|
116
|
-
`)).then((O)=>{if(!T||x<b.current)return;b.current=x,bn=O,lt()}),()=>{T=!1}},[h,m,f]);let v=y.slice(0,ct).map((x)=>x.key).join(`
|
|
117
|
-
`);o(()=>{let x=v===""?[]:v.split(`
|
|
118
|
-
`);for(let T of x)c.send({type:"subscribe",room:T});return()=>{for(let T of x)c.send({type:"unsubscribe",room:T})}},[c,v,m])}var ht=380,bt="cubic-bezier(0.7, 0, 0.84, 0)",yt=2.4,yn=0.35,vt=260,wt="cubic-bezier(0.2, 0.8, 0.2, 1)",St=1.06,xt=700,U;function vn(i){if(U?.host===i&&U.phase==="diving")U.abort()}var kt=(i)=>{if(!i||typeof i.animate!=="function")return;i.animate([{transform:`scale(${St})`,opacity:yn},{transform:"scale(1)",opacity:1}],{duration:vt,easing:wt})};function kn(i,c,m,f){if(U)return;let l=i.closest("main.route")??i;if(Me()||typeof l.animate!=="function"){m();return}f?.();let b=l.getBoundingClientRect(),h=`${c.x-b.left}px ${c.y-b.top}px`,y={overflow:l.style.overflow,events:l.style.pointerEvents};l.style.overflow="hidden",l.style.pointerEvents="none";let v=l.animate([{transformOrigin:h,transform:"scale(1)",opacity:1},{transformOrigin:h,transform:`scale(${yt})`,opacity:yn}],{duration:ht,easing:bt,fill:"forwards"}),x=document.documentElement,T,O,Z=()=>{l.style.overflow=y.overflow,l.style.pointerEvents=y.events,v.cancel()},q=()=>{window.removeEventListener("popstate",k),window.removeEventListener("hashchange",k)},H={host:i,phase:"diving",abort:k};function k(){if(U!==H||H.phase!=="diving")return;q(),Z(),U=void 0}let V=(P)=>{if(U!==H)return;if(O?.disconnect(),clearTimeout(T),x.removeAttribute("data-dive"),Z(),U=void 0,P)kt(document.querySelector("main.route"))};U=H,window.addEventListener("popstate",k),window.addEventListener("hashchange",k),v.finished.then(()=>{if(U!==H||H.phase!=="diving")return;if(H.phase="committing",q(),x.setAttribute("data-dive",""),m(),!i.isConnected){V(!0);return}O=new MutationObserver(()=>{if(!i.isConnected)V(!0)}),O.observe(l.parentElement??document.body,{childList:!0,subtree:!0}),T=setTimeout(()=>V(!i.isConnected),xt)},()=>{return})}var Rt=(i)=>i==="sleepy"?"idle":i;function Rn(i,c){let m={};for(let[l,b]of Object.entries(i))m[l]=Rt(b);let f=(l)=>l!==void 0&&(l in m)&&m[l]!=="waiting"&&m[l]!=="error";for(let l of c){let b=l.agent;if(l.typing&&f(b)){let h=m[b];if(h!=="thinking"&&h!=="working")m[b]="thinking"}}for(let l of c)if(f(l.voice))m[l.voice]="speaking";return m}function Ke(i,c){if(i==="speaking")return"happy";return(c?.STATE_EXPRESSION??Ct)[i]}var Ct={idle:"neutral",thinking:"thinking",working:"determined",waiting:"curious",done:"proud",error:"apologetic",sleepy:"sleepy"};function _e(i,c){return`s${i}${c.toLowerCase().replace(/[^a-z0-9]/g,"")}`.slice(0,16)}var Et={x:-7,y:-3,w:114,h:100},me=256;function Ie(i,c,m,f,l,b,h){let y=i.composeSvg(c,{bare:!0,look:m,expr:Ke(f,i),...h?{mouth:h}:{},state:"idle",still:!0,size:me,uid:l,skins:b}),{x:v,y:x,w:T,h:O}=Et;return y.replace('viewBox="0 0 100 100"',`viewBox="${v} ${x} ${T} ${O}"`).replace(`width="${me}" height="${me}"`,`width="${me}" height="${Math.round(me*O/T)}"`)}function $e(i,c,m,f,l,b){if(f!=="speaking")return{avatarSvg:Ie(i,c,m,f,l,b)};return{avatarSvg:Ie(i,c,m,f,l,b,"closed"),talkSvg:Ie(i,c,m,f,l,b,"open")}}function Cn(i){let c=i.delayMs??300,m=i.timers??{set:(h,y)=>setTimeout(h,y),clear:(h)=>clearTimeout(h)},f=new Map,l=new Map,b=(h)=>{let y=l.get(h);if(y===void 0)return;m.clear(y),l.delete(h)};return{seed(h,y){b(h),f.set(h,Ke(y))},update(h,y){let v=Ke(y);if(!f.has(h)){f.set(h,v);return}if(b(h),f.get(h)===v)return;l.set(h,m.set(()=>{l.delete(h),f.set(h,v),i.setAvatar(h,y)},c))},forget(h){b(h),f.delete(h)},dispose(){for(let h of[...l.keys()])b(h);f.clear()}}}var Mt={idle:u("idle"),thinking:u("thinking"),working:u("working"),waiting:u("waiting"),speaking:u("speaking"),done:u("done"),error:u("error")},Tt=()=>({table:t("Round table"),seat:(i,c)=>t("{name} ({state})",{name:i,state:t(Mt[c])})}),Lt=()=>{He().catch(()=>{return})};function li(i){let c=ai(),{views:m}=An(),f=d((l)=>{let b=l.order.map((y)=>l.rooms[y]?.view).filter((y)=>y!==void 0&&y.kind==="agent"&&!y.helper);return[...i?i.slice(0,Pn).map((y)=>b.find((v)=>v.name===y)).filter((y)=>y!==void 0):b].sort((y,v)=>Number(v.home)-Number(y.home)).slice(0,Pn)},i?.join(`
|
|
119
|
-
`)??"");return c?m.slice(0,Pn):f}function ci(){return d((i)=>i.order.map((c)=>i.rooms[c]?.view).filter((c)=>c!==void 0&&c.kind==="agent"&&!c.helper),"agents")}function Ht(i){let c=xe(),m=d((f)=>Object.values(f.rooms).filter((l)=>i?l.key===i:l.view?.kind==="group").map((l)=>{let b=le(l.round),h=b??l.agent,y=l.typing&&l.progress.text!=="";return{key:l.key,typing:l.typing||b!==void 0,...h===void 0?{}:{agent:h},...y&&h!==void 0?{streamer:h}:{}}}),i??"");return C(()=>m.map(({key:f,streamer:l,...b})=>{let h=c[f]??l;return h===void 0?b:{...b,voice:h}}),[m,c])}function Dt(i){return d((c)=>dn(i?c.rooms[i]?.round:void 0),i??"")}function $n(i){let{variant:c="full",onHandle:m}=i,f=In(),l=Ot(),b=Un(),h=xn(),y=De(),v=li(i.members),x=ss(v.map((w)=>w.key)),T=Ht(i.groupRoom),O=Dt(i.groupRoom),Z=An().attention,q=ai(),H=a(q);H.current=q;let k=c==="full"&&i.list===!0,V=C(()=>Rn(Object.fromEntries(v.map((w)=>{let E=x[w.key]??"idle";return[w.name,Z[w.key]&&(E==="idle"||E==="sleepy")?"waiting":E]})),T),[v,x,T,Z]),P=a(V);P.current=V;let F=C(()=>{if(!f)return[];return v.map((w,E)=>{let N=y[w.name]??w.character??pn(f,w);return{id:w.name,name:w.displayName,color:f.accentOf(N,b.look),...$e(f,N,b.look,P.current[w.name]??"idle",_e(E,w.name),h)}})},[f,v,y,b.look,h]),ne=a(F);ne.current=F;let B=a(v);B.current=v;let te=a({look:l,scheme:b.scheme});te.current={look:l,scheme:b.scheme};let G=a(null),K=a(void 0),[J,oe]=r(0),re=a(void 0),ae=a(()=>{return});ae.current=(w)=>{let E=v.find((N)=>N.name===w);if(!f||!E)return;return y[w]??E.character??pn(f,E)};let z=a(b);z.current=b;let j=a(h);j.current=h;let Y=a(f);Y.current=f;let D=a(m);D.current=m;let I=a(i);I.current=i;let ce=f!==void 0&&F.length>0;o(()=>{let w=G.current;if(!ce||!w)return;let E=!0,N,ie=Cn({setAvatar:(W,de)=>{let L=ae.current(W),A=Y.current,ue=B.current.findIndex((be)=>be.name===W);if(!L||!A||ue<0)return;let{avatarSvg:fe,talkSvg:pe}=$e(A,L,z.current.look,de,_e(ue,W),j.current);N?.setAvatar(W,fe,pe)}});return re.current=ie,(async()=>{let{mountRoundTable:W}=await (p("5zmjxadx"),import("./chunk-entry-5zmjxadx.js")),de=ne.current.map((A)=>({...A,state:P.current[A.id]??"idle"})),L=await W(w,{theme:te.current.look,scheme:te.current.scheme,seats:de,onSeatClick:({id:A,at:ue})=>{let fe=I.current.onSeat;if(fe){fe(A);return}let pe=B.current.find((Tn)=>Tn.name===A);if(!pe)return;let be=()=>X("room",pe.key),Be=G.current;if(ue&&Be)kn(Be,ue,be,H.current?Lt:void 0);else be()},...I.current.onSeatMenu?{onSeatMenu:(A)=>I.current.onSeatMenu?.(A)}:{},ownerName:I.current.ownerName??t("You"),focus:I.current.focus??null,onFocus:(A)=>I.current.onFocus?.(A),reducedMotion:"auto",lowPower:"auto",variant:c,listBelow:k,labels:Tt()});if(!E){L.dispose();return}N=L,K.current=L;for(let A of de)ie.seed(A.id,A.state??"idle");D.current?.(L),oe((A)=>A+1)})(),()=>{E=!1,vn(w),ie.dispose(),re.current=void 0,K.current=void 0,D.current?.(void 0),N?.dispose()}},[ce,c,k]);let ee=i.focus??null;if(o(()=>{let w=K.current;if(w&&w.focused()!==ee)w.focus(ee)},[ee,J]),o(()=>{let w=K.current;if(!w||F.length===0)return;let E=P.current;w.setSeats(F.map((N)=>({...N,state:E[N.id]??"idle"})));for(let N of F)re.current?.seed(N.id,E[N.id]??"idle")},[F,J]),o(()=>{let w=K.current;if(!w)return;for(let E of ne.current)w.setMark(E.id,O[E.id]??null)},[O,F,J]),o(()=>{let w=K.current;if(w)w.setTheme(l,b.scheme)},[l,b.scheme,J]),o(()=>{let w=K.current;if(!w)return;for(let E of ne.current){let N=V[E.id]??"idle";w.setState(E.id,N),re.current?.update(E.id,N)}},[V,J]),v.length===0)return e("p",{className:"table-empty",children:t("No knights are seated yet.")});return e("section",{className:"table-host",ref:G,"aria-label":t("Round table")})}function En(i,c){let{line:m}=Fe(i),f=d((O)=>le(O.rooms[i]?.round)),l=xe()[i],[b,h]=r(),y=en(l,f,m,c),v=`${m?.id??""}|${y??""}`;return{focus:an(y,v,b),look:(O)=>h({lineId:v,member:O})}}function Mn(i){let{roomKey:c,members:m}=i,[f]=ve();return n("div",{className:"table-frame room-scene","data-focused":"","data-folded":f||void 0,children:[e($n,{members:m,groupRoom:c,variant:"full",focus:i.focus,onFocus:i.onLook,onSeat:i.onLook,...i.onHandle?{onHandle:i.onHandle}:{},...i.onSeatMenu?{onSeatMenu:i.onSeatMenu}:{}}),e(hn,{roomKey:c,open:!0,streams:i.streams??!1,blurAfterSend:i.blurAfterSend===!0,strip:e(fn,{roomKey:c})})]})}Ii();var Vt=S(()=>(p("a5e6tspr"),import("./chunk-council-sheet-a5e6tspr.js")).then((i)=>({default:i.CouncilSheet}))),Pt=S(()=>(p("ccv271hm"),import("./chunk-mode-toggle-ccv271hm.js")).then((i)=>({default:i.ModeToggle}))),Ft=S(()=>(p("1m2c2ekt"),import("./chunk-room-menu-1m2c2ekt.js")).then((i)=>({default:i.RoomMenu})));function It(i,c,m,f,l){os(i,c).then((b)=>{if(b)ge({...b,at:m,via:f,source:l})},()=>{return})}function Kt(){let i=Ce("(max-width: 719px)"),c=Ce("(pointer: coarse)");return i||c}function Di(i){return e("button",{type:"button",className:"secondary council-chip","aria-haspopup":"dialog",onClick:i.onOpen,children:i.council?t("Council: {name} ▾",{name:i.council.displayName}):t("Pick who sits")})}function Ui(i,c){let[m,f]=r(!1),[l,b]=r(!1),h=()=>{f(!0),b(!0)},y=m?e(Q,{fallback:null,children:e(Vt,{open:l,onClose:()=>b(!1),council:i,...c?{go:c}:{}})}):null;return{ask:h,sheet:y}}function _t(i){let c=(m,f)=>n("label",{"data-checked":i.mode===m,children:[e("input",{type:"radio",name:"table-mode",value:m,checked:i.mode===m,onChange:()=>i.onMode(m)}),f]});return n("fieldset",{className:"segmented table-mode",children:[e("legend",{className:"visually-hidden",children:t("Show the council as")}),c("scene",t("Animation mode")),c("chat",t("Chat mode"))]})}function xr(i){let{roomKey:c}=i,m=Ee(),f=d((w)=>w.rooms[c]),l=d((w)=>w.connection==="open"),b=d((w)=>w.limits),h=Ot(),y=Kt(),v=f?.view,x=v?.members??[],T=li(x),[O,Z]=je(c),[q,H]=r(),{focus:k,look:V}=En(c,x),{ask:P,sheet:F}=Ui(v,i.go),[ne,B]=r(!1),[te,G]=r(!1),K=a(null),[J,oe]=r(),[re,ae]=r(!1);o(()=>(m.focus(c),()=>m.focus(void 0)),[m,c]);let z=v?.displayName??c,j=f?.mode,Y=T.length>0||i.empty===void 0,D=Y&&O==="scene",I=v?.notes===!0,ce=I&&re,ee=I&&J===c&&!ce;return n(g,{children:[n("header",{className:"room-head council-head",children:[i.lead,n("div",{className:"table-tools",children:[D&&q?.kind==="webgl"?e("button",{type:"button",className:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>V(null),children:e(s,{name:"reset"})}):null,Y?e(_t,{mode:O,onMode:Z}):null,e(Di,{council:v,onOpen:P})]}),e(wn,{}),e("button",{ref:K,type:"button",className:"icon-button","aria-label":t("Room menu"),"aria-haspopup":"dialog",onClick:()=>{G(!0),B(!0)},children:e(s,{name:"menu"})})]}),h==="camelot"&&Y&&!D?e("div",{className:"group-strip",children:e($n,{members:x,groupRoom:c,variant:"compact"})}):null,!l?n("div",{className:"offline-banner",role:"status",children:[e("span",{className:"spinner","aria-hidden":"true"}),t("Reconnecting… messages wait here until it is back.")]}):null,e(lr,{room:c,mode:j&&(j.yolo||j.longRunning)?j:void 0,approved:f?.autoApproved??0}),!Y?e("div",{className:"table-frame",children:i.empty}):D?e(Mn,{roomKey:c,members:x,focus:k,onLook:V,blurAfterSend:y,onHandle:H,onSeatMenu:(w)=>{let E=T.find((N)=>N.name===w.id);if(E)It(E.key,c,w.at,w.via,w.source)}}):e("div",{className:"table-chat",children:e(cr,{roomKey:c,name:z,...i.surface?{surface:i.surface}:{},composer:(w)=>v?.readOnly?null:e(At,{draftKey:c,name:z,onAddressed:ae,...I?{placeholder:ee?t("Write an internal note…"):t("Ask AI…"),above:e(Q,{fallback:null,children:e(Pt,{on:!ee,label:t("@AI"),...ce?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(E)=>oe(E?void 0:c)})})}:{},limits:b,stoppable:Boolean(f?.stoppable),stopLabel:t("Stop the round"),blurAfterSend:y,onSend:(E,N,ie)=>{if(I&&ie){let W=gn(E);m.say(c,W===""&&N.length===0?E:W,N,"turn")}else m.say(c,E,N,ee?"note":void 0);w(!0)},onStop:()=>m.send({type:"stop",room:c}),...i.incoming&&i.onIncomingTaken?{incoming:i.incoming,onIncomingTaken:i.onIncomingTaken}:{}},c)})}),F,te?e(Q,{fallback:null,children:e(Ft,{open:ne,room:c,mode:j,muted:v?.muted===!0,agent:void 0,group:v?.name,coordinator:v?.coordinator===!0,displayName:z,readOnly:v?.readOnly??!1,parent:void 0,onClose:()=>B(!1),onAskYolo:()=>{B(!1),we({kind:"yolo",room:c,name:z,restoreFocus:()=>K.current})},onAskStartOver:()=>{B(!1),we({kind:"start-over",room:c,name:z,restoreFocus:()=>K.current})}})}):null]})}
|
|
120
|
-
export{Ii,An,ai,Uo,li,ci,$n,Di,Ui,xr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var c=new WeakMap;function se(e,t){if(typeof document>"u")return;let n=c.get(document)??new Set;if(n.has(e))return;if(c.set(document,n.add(e)),typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let d=new CSSStyleSheet;d.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,d];return}catch{}let o=document.createElement("style");o.textContent=t,document.head.append(o)}
|
|
2
|
-
export{se};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{je,Zr,jt,Wr,Z,ae,Qi,Yr,Ys,Hs,Hr,js,Ks,Js,_n}from"./chunk-index-r0hk9kyd.js";export{jt as AVATAR_STATES,Z as CATALOG,je as CLASS_IDS,ae as CharacterError,Hs as EAST_ASIAN_SKINS,Zr as EXPRESSIONS,Wr as STATE_EXPRESSION,Ks as accentOf,Js as characterCss,Hr as checkSkins,js as composeSvg,Yr as parseCharacter,Ys as readCharacter,Qi as resolveCharacter,_n as suggestCharacter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{M,h}from"./chunk-index-wt2asefx.js";var uo={page:(e,t,o,c=50)=>h(`rooms/${encodeURIComponent(e)}/messages?archive=${t}&limit=${c}${o===void 0?"":`&before=${o}`}`)},n,{emit:r,use:s}=M();function Ns(e,t){n={room:e,until:t},r()}function Ls(){if(!n)return;n=void 0,r()}var Xs=()=>s(()=>n),i;function zs(e,t){i={author:e,text:t},r()}function fo(){if(!i)return;i=void 0,r()}var Is=()=>s(()=>i);
|
|
2
|
-
export{uo,Ns,Ls,Xs,zs,fo,Is};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o,r,l,J}from"./chunk-index-wt2asefx.js";function xe(f,e){let{version:u}=J(),[t,a]=r({data:void 0,error:void 0,subject:e});return o(()=>{let n=!0;return f().then((d)=>{if(n)a({data:d,error:void 0,subject:e})},(d)=>{if(n)a((i)=>({data:i.subject===e?i.data:void 0,error:l(d),subject:e}))}),()=>{n=!1}},[e,u]),t.subject===e?{data:t.data,error:t.error}:{data:void 0,error:void 0}}
|
|
2
|
-
export{xe};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p,t}from"./chunk-index-wt2asefx.js";import{yo}from"./chunk-index-hef4gwtb.js";import{Ai,Ds,Us}from"./chunk-index-aycxt14t.js";function ho(e){let n=yo();if(!e)return n;let r=new Set([...e,...Ds(e)]);return Object.fromEntries(Object.entries(n).filter(([s])=>r.has(s)))}var i=()=>(p("5dc4m9ad"),import("./chunk-bulk-actions-5dc4m9ad.js"));function Ei(e){let n=[];if(Object.keys(ho(e)).length>0)n.push({id:"read-all",label:t("Mark all as read"),icon:"check",run:()=>{i().then((r)=>r.markAllRead(e))}});if(Ai(e).size>0)n.push({id:"clear-finished",label:t("Clear all finished threads"),icon:"trash",tone:"danger",run:()=>{i().then((r)=>r.clearAllFinished(e))}});return n.push(...po(e)),n}function po(e){if(Us(e).size===0)return[];return[{id:"clear-helpers",label:t("Clear finished temp knights"),icon:"trash",tone:"danger",run:()=>{i().then((n)=>n.clearFinishedHelpers(e))}}]}
|
|
2
|
-
export{ho,Ei,po};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M}from"./chunk-index-wt2asefx.js";var a="roundtable-console:folders-collapsed";function i(){try{let e=localStorage.getItem(a),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=M(),n=()=>(l??=i(),l);function s(e){l=e;try{localStorage.setItem(a,JSON.stringify([...e]))}catch{}d()}var Sr=()=>c(n),wr=()=>n();function kr(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function _r(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function Tr(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{Sr,wr,kr,_r,Tr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,ge,cs,Ti}from"./chunk-index-wt2asefx.js";import{Xe}from"./chunk-index-smz90j6p.js";import{Ei}from"./chunk-index-gp4chnp3.js";function ui(e){let r=e.getBoundingClientRect(),o=cs();ge({title:t("Rooms"),items:[...Ei(),{id:"new-folder",label:t("Add a folder"),icon:"plus",run:()=>Xe({kind:"new"})},{id:"arrange",label:o?t("Done"):t("Arrange"),icon:o?"check":"list",run:()=>Ti(!o)}],at:{x:r.left,y:r.bottom},via:"key",source:e})}
|
|
2
|
-
export{ui};
|