@kubitnodes/stellaris 0.3.10 → 0.3.12
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/dist/cli/index.js +763 -140
- package/dist/server/index.js +1263 -244
- package/package.json +1 -1
- package/web/dist/assets/BackLink-BlJvN2RA.js +1 -0
- package/web/dist/assets/ChannelForms-CmFxBXNK.js +1 -0
- package/web/dist/assets/ChannelView-4s--IwKC.js +1 -0
- package/web/dist/assets/CitizenView-B5-LVVCG.js +2 -0
- package/web/dist/assets/CitizensView-B8lVGSBD.js +1 -0
- package/web/dist/assets/CliIcon-CT5ljQDC.js +1 -0
- package/web/dist/assets/KnowledgeView-DbI8DIZb.js +1 -0
- package/web/dist/assets/{Markdown-4W4xjIq7.js → Markdown-B5zEdYuO.js} +4 -4
- package/web/dist/assets/MessageItem-DuxSZwn0.js +1 -0
- package/web/dist/assets/MetricsView-D8D-y-sz.js +1 -0
- package/web/dist/assets/NeedsYouView-Buwq8-_l.js +1 -0
- package/web/dist/assets/Overview-CrQ8ybpq.js +1 -0
- package/web/dist/assets/{Pane-xzIpwnBD.js → Pane-CFoSKOo5.js} +1 -1
- package/web/dist/assets/ProjectView-BBQg-ZxC.js +1 -0
- package/web/dist/assets/ProposalView-BjPHVxj4.js +1 -0
- package/web/dist/assets/ProposalsView-DjyZpZe0.js +1 -0
- package/web/dist/assets/RunnersView-2h5NWUuD.js +1 -0
- package/web/dist/assets/SocietyView-BuaSb_3d.js +1 -0
- package/web/dist/assets/SubjectThread-C1mHvHMI.js +1 -0
- package/web/dist/assets/TaskFileView-CeEzbSCL.js +4 -0
- package/web/dist/assets/TaskView-yL9hCM7G.js +3 -0
- package/web/dist/assets/TasksView-DCVU5oZn.js +1 -0
- package/web/dist/assets/ThreadCard-CXXf9qfA.js +1 -0
- package/web/dist/assets/ThreadForms-CTBaAJ57.js +1 -0
- package/web/dist/assets/ThreadView-zg8KqF3t.js +1 -0
- package/web/dist/assets/citizen-CImM6WB6.js +1 -0
- package/web/dist/assets/compose-BG_-Tp87.js +1 -0
- package/web/dist/assets/{format-lz-5NQWT.js → format-BWr3zKWg.js} +1 -1
- package/web/dist/assets/governance-cDTg2_iq.js +1 -0
- package/web/dist/assets/index-Cxqhrg2v.js +23 -0
- package/web/dist/assets/index-VVnGdAXc.css +2 -0
- package/web/dist/assets/link-CFdt17Sp.js +1 -0
- package/web/dist/assets/mentions-BCdV0bMK.js +1 -0
- package/web/dist/assets/{tasks-DK1cnXqs.js → tasks-C10zwkED.js} +1 -1
- package/web/dist/assets/useMatch-BpnmzT6s.js +1 -0
- package/web/dist/assets/{useStickyScroll-CfP3Yl_4.js → useStickyScroll-BjqdEt_f.js} +1 -1
- package/web/dist/index.html +10 -4
- package/web/dist/assets/BackLink-B3tz8OFm.js +0 -1
- package/web/dist/assets/ChannelView-Dkzr1zkF.js +0 -1
- package/web/dist/assets/CitizenView-BLgyEvYz.js +0 -2
- package/web/dist/assets/CitizensView-DttP5FqR.js +0 -1
- package/web/dist/assets/KnowledgeView-DFAC95aF.js +0 -1
- package/web/dist/assets/MessageItem-Bfpve1_Y.js +0 -1
- package/web/dist/assets/MetricsView-Bp486U0v.js +0 -1
- package/web/dist/assets/NeedsYouView-CJ4COcNn.js +0 -1
- package/web/dist/assets/Overview-BnO1K52h.js +0 -1
- package/web/dist/assets/ProjectView-w0mcF0KW.js +0 -1
- package/web/dist/assets/ProposalView-CyJCwUYK.js +0 -1
- package/web/dist/assets/ProposalsView-XrraDhwt.js +0 -1
- package/web/dist/assets/RunnersView-H3kCdSQB.js +0 -1
- package/web/dist/assets/SocietyView-Cf8ENDAw.js +0 -1
- package/web/dist/assets/SubjectThread-ClMmgVVd.js +0 -1
- package/web/dist/assets/TaskFileView-CRwwL5K8.js +0 -4
- package/web/dist/assets/TaskView-A9IgTxQ0.js +0 -1
- package/web/dist/assets/TasksView-CnhTIldG.js +0 -1
- package/web/dist/assets/ThreadCard-fvf8cY_l.js +0 -1
- package/web/dist/assets/ThreadForms-D09Ykgj9.js +0 -1
- package/web/dist/assets/ThreadView-BqNSssCf.js +0 -1
- package/web/dist/assets/citizen-C27Wvimj.js +0 -1
- package/web/dist/assets/index-CoKyPk79.js +0 -23
- package/web/dist/assets/index-t2fXHB5Y.css +0 -2
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ot as e,b as t,pn as n}from"./format-BWr3zKWg.js";import{C as r,n as i,r as a,t as o,v as s}from"./index-Cxqhrg2v.js";var c=n(),l=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function u({fallback:n}){let u=e(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=t(),h=i(f,d);if(h===null)return n;let g=o(h,{entity:e=>p.get(e)?.title,project:e=>m.data?.find(t=>t.slug===e)?.name});return(0,c.jsx)(`button`,{type:`button`,onClick:()=>u.history.back(),"aria-label":`Back to ${g}`,title:`Back to ${g}`,className:l,children:`←`})}export{u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,_n as t,fn as n,mn as r,pn as i,t as a}from"./format-BWr3zKWg.js";import{c as o,l as s,s as c}from"./compose-BG_-Tp87.js";import{t as l}from"./link-CFdt17Sp.js";import{n as u,r as d}from"./ThreadForms-CTBaAJ57.js";var f=t(r(),1),p=i();function m({project:t,onDone:r}){let{api:i}=e(),a=n(),l=o(),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),v=(0,f.useRef)(null);(0,f.useEffect)(()=>v.current?.focus(),[]);let y=s({mutationFn:()=>i.createChannel({project:t,name:m.trim(),purpose:g.trim()}),onSuccess:async e=>{await a.invalidateQueries({queryKey:[`channels`]}),r(),await l({to:`/c/$`,params:{_splat:e}})}});return(0,p.jsxs)(`form`,{"aria-label":`New channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),y.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`div`,{className:`w-40 shrink-0`,children:(0,p.jsx)(`input`,{ref:v,value:m,maxLength:64,spellCheck:!1,"aria-label":`Channel name`,placeholder:`release-0-4`,onChange:e=>h(e.target.value),className:`${u} font-mono`})}),(0,p.jsx)(`input`,{value:g,"aria-label":`Purpose`,placeholder:`What the channel is for`,onChange:e=>_(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:r,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:y.isPending||m.trim()===``||g.trim()===``,children:y.isPending?`Opening…`:`Open`})]}),(0,p.jsx)(`p`,{className:`text-meta`,children:t===null?`Announced in the society's general, and followed by whoever subscribes to it; you read every channel without following one.`:`Announced in ${t}'s general, where its members choose to follow it; you read every channel without following one. Tasks filed in it hang their threads here, and it is archived once its tasks are done.`}),(0,p.jsx)(d,{error:y.error})]})}function h({channel:t,onDone:r}){let{api:i}=e(),a=n(),[o,l]=(0,f.useState)(``),m=s({mutationFn:()=>i.archiveChannel({channel:t,reason:o.trim()}),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`channels`]}),r()}});return(0,p.jsxs)(`form`,{"aria-label":`Archive the channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),m.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`input`,{value:o,"aria-label":`Reason`,placeholder:`Why its work is done`,onChange:e=>l(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:r,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:m.isPending||o.trim()===``,children:m.isPending?`Archiving…`:`Archive channel`})]}),(0,p.jsx)(`p`,{className:`text-meta`,children:`Its open threads close, nobody follows it, and nothing more is posted or filed here; its posts, threads, and tasks stay readable. The board refuses while a task filed here is in play.`}),(0,p.jsx)(d,{error:m.error})]})}function g({channels:e,now:t}){return e.length===0?(0,p.jsx)(`p`,{className:`text-meta`,children:`No channels.`}):(0,p.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(l,{to:`/c/$`,params:{_splat:e.ref},className:`text-sm hover:text-fg-primary ${e.archived===void 0?`text-fg-secondary`:`text-fg-tertiary`}`,children:[`# `,e.name]}),(0,p.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.messages,` messages`,e.archived===void 0?``:` · archived ${a(e.archived.at,t)}`]})]},e.ref))})}export{g as n,m as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e,Kt as t,O as n,_n as r,b as i,c as a,g as o,mn as s,pn as c,pt as l,t as u,y as d,z as f}from"./format-BWr3zKWg.js";import{s as p}from"./compose-BG_-Tp87.js";import{S as m,T as h,i as g}from"./index-Cxqhrg2v.js";import{i as _}from"./ThreadForms-CTBaAJ57.js";import{t as v}from"./ChannelForms-CmFxBXNK.js";import{t as y}from"./MessageItem-DuxSZwn0.js";import{n as b,t as x}from"./Pane-CFoSKOo5.js";import{n as S}from"./ThreadCard-CXXf9qfA.js";import{t as C}from"./useStickyScroll-BjqdEt_f.js";var w=r(s(),1),T=c();function E(){let{_splat:e=`general`}=h({from:`/c/$`});return(0,T.jsx)(D,{channel:e},e)}function D({channel:r}){let{api:s}=n(),c=t({queryKey:[`channel`,r],queryFn:()=>s.channel(r)}),h=e(),E=o(),D=i(),O=a(),k=d(3e4),[A,j]=(0,w.useState)(!1),[M,N]=(0,w.useState)(!1),P=(0,w.useMemo)(()=>{let e=(c.data??[]).map(e=>({kind:`message`,at:e.ts,id:e.id,message:e})),t=(h.data??[]).filter(e=>e.channel===r).map(e=>({kind:`thread`,at:e.openedAt,id:e.id,thread:e}));return[...e,...t].toSorted((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))},[c.data,h.data,r]),F=c.data?.at(-1)?.id??null;(0,w.useEffect)(()=>m(r,F),[r,F]);let{ref:I,onScroll:L}=C(),[R,z]=r.split(`/`),B=z??R??r,V=z===void 0?void 0:D.data?.find(e=>e.slug===R),H=z===void 0?`society`:V?.name??R,U=O.data?.find(e=>e.ref===r)?.archived,W=V?.archived!==void 0||U!==void 0,G=!W&&!l(z===void 0?null:R??null,B),K=P.filter(e=>e.kind===`thread`&&e.thread.state===`open`);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(x,{title:`# ${B}`,subtitle:`${H} · ${c.data?.length??0} messages${K.length>0?` · ${K.length} open threads`:``}`,trailing:A||M||W?null:(0,T.jsxs)(T.Fragment,{children:[G?(0,T.jsx)(p,{onClick:()=>N(!0),children:`Archive…`}):null,(0,T.jsx)(p,{onClick:()=>j(!0),children:`New thread`})]})}),A?(0,T.jsx)(_,{channel:r,onDone:()=>j(!1)}):null,M?(0,T.jsx)(v,{channel:r,onDone:()=>N(!1)}):null,(0,T.jsx)(`div`,{ref:I,onScroll:L,className:`flex-1 overflow-y-auto py-2`,children:c.error instanceof f&&c.error.status===404?(0,T.jsxs)(b,{children:[`There is no channel `,r,`.`]}):c.data===void 0?(0,T.jsx)(b,{children:`Reading the channel…`}):P.length===0?(0,T.jsx)(b,{children:`Nothing has been said here yet.`}):P.map(e=>e.kind===`message`?(0,T.jsx)(y,{message:e.message,members:E.data,now:k},e.id):(0,T.jsx)(S,{thread:e.thread,now:k},e.id))}),c.data===void 0?null:U===void 0?W?(0,T.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[H,` is archived, so its channels are read-only.`]}):(0,T.jsx)(g,{target:{channel:r},placeholder:`Message #${B}`}):(0,T.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[`Archived `,u(U.at,k),` by `,U.by,`: `,U.reason,`. Its posts, threads, and tasks stay readable; nothing more is posted or filed here.`]})]})}export{E as ChannelView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{E as e,F as t,L as n,O as r,R as i,T as a,U as o,_ as s,_n as c,a as l,bt as u,d,dt as f,f as p,fn as m,g as h,mn as g,o as _,p as v,pn as y,t as b,w as x,y as S,z as C}from"./format-BWr3zKWg.js";import{l as w,s as T}from"./compose-BG_-Tp87.js";import{t as E}from"./link-CFdt17Sp.js";import{t as ee}from"./CliIcon-CT5ljQDC.js";import{T as te,_ as D,c as O,d as ne,f as re,h as k,i as ie,l as A,m as j,p as ae,u as M,v as oe,w as se}from"./index-Cxqhrg2v.js";import{n as ce,r as N}from"./ThreadForms-CTBaAJ57.js";import{t as P}from"./Markdown-B5zEdYuO.js";import{n as F,t as le}from"./Pane-CFoSKOo5.js";import{t as ue}from"./useStickyScroll-BjqdEt_f.js";import{a as I,c as de,i as L,l as R,n as fe,o as z,s as pe,t as me}from"./citizen-CImM6WB6.js";var B=c(g(),1),V=y(),he={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`was interrupted`,blocked:`was blocked`,stopped:`was stopped by you`};function H(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function U({label:e,tone:t,children:n}){return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`px-0.5 pb-0.5 text-[10px] tracking-wider text-fg-muted uppercase`,children:e}),(0,V.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words ${t}`,children:n})]})}function ge({step:e,open:t}){if(e.kind===`say`)return(0,V.jsx)(`li`,{className:`py-1.5 text-sm`,title:H(e.at),children:(0,V.jsx)(P,{text:e.text})});if(e.kind===`error`)return(0,V.jsx)(`li`,{className:`py-1 font-mono text-xs break-words text-red-400`,title:H(e.at),children:e.message});if(e.kind===`steer`)return(0,V.jsx)(`li`,{children:(0,V.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`grid w-3 shrink-0 place-items-center text-sky-300`,children:`↳`}),(0,V.jsxs)(`span`,{className:`shrink-0 text-fg-tertiary`,children:[`Took `,ne(e.posts.length)]}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:e.from.length===0?``:`from ${e.from.join(`, `)}, delivered mid-turn`}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:H(e.at)})]}),(0,V.jsx)(`ul`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:e.posts.map(e=>(0,V.jsxs)(`li`,{className:`rounded-md bg-surface-0/40 px-2.5 py-2`,children:[(0,V.jsxs)(`p`,{className:`flex gap-1.5 text-meta`,children:[(0,V.jsx)(`span`,{className:`text-fg-secondary`,children:e.author}),(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`in `,e.where]}),e.at===``?null:(0,V.jsx)(`span`,{className:`ml-auto shrink-0 font-mono`,children:H(e.at)})]}),(0,V.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,V.jsx)(P,{text:e.body})})]},`${e.at}-${e.author}`))})]})});let n=e.ok===null?(0,V.jsx)(`span`,{"aria-label":`running`,className:`size-1.5 animate-pulse rounded-full bg-amber-300`}):e.ok?(0,V.jsx)(`span`,{"aria-label":`succeeded`,className:`text-[11px] text-emerald-400`,children:`✓`}):(0,V.jsx)(`span`,{"aria-label":`failed`,className:`text-[11px] text-red-400`,children:`✕`});return(0,V.jsx)(`li`,{children:(0,V.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,V.jsx)(`span`,{className:`grid w-3 shrink-0 place-items-center`,children:n}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-fg-tertiary`,children:re(e.name)}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-fg-secondary`,children:e.summary}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:H(e.at)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:[(0,V.jsx)(U,{label:`Input`,tone:`text-fg-secondary`,children:e.detail}),e.output===null?null:(0,V.jsx)(U,{label:e.ok===!1?`Returned an error`:`Returned`,tone:e.ok===!1?`text-red-300`:`text-fg-tertiary`,children:e.output})]})]})})}function W({steps:e}){let[t,n]=(0,B.useState)(!1),r=e.filter(e=>e.kind===`tool`).length;return e.length===0?(0,V.jsx)(`p`,{className:`mt-2 text-meta`,children:`No steps yet.`}):(0,V.jsxs)(V.Fragment,{children:[r===0?null:(0,V.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-meta`,children:[r===1?`1 tool call`:`${r} tool calls`,(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:`rounded-md px-1.5 py-0.5 text-fg-tertiary transition-colors hover:bg-surface-2/60 hover:text-fg-primary`,children:t?`Collapse all`:`Expand all`})]}),(0,V.jsx)(`ol`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,V.jsx)(ge,{step:e,open:t},e.seq))})]})}function _e({turn:e,running:t,now:n}){return e.end===null?t?(0,V.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-meta`,"aria-live":`polite`,children:[(0,V.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}),`Working · last step `,b(e.lastAt,n)]}):(0,V.jsx)(`p`,{className:`mt-3 text-meta`,children:`The turn ended without a report.`}):(0,V.jsxs)(`section`,{className:`mt-3 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,V.jsxs)(`p`,{className:`text-caps`,children:[`The turn `,he[e.end.exitReason],` `,b(e.end.at,n),e.fromStart?` · ${A(e.startedAt,Date.parse(e.end.at))}`:``]}),e.end.summary===null?null:(0,V.jsx)(`p`,{className:`mt-1 text-sm text-fg-secondary`,children:e.end.summary})]})}var G=30,ve={turn:`turn`,board:`board`,merge:`both kept`},ye={turn:`Changed by a turn`,board:`Written by the board`,merge:`Both versions kept`};function be(e){return e.status===`added`?`new`:e.status===`deleted`?`deleted`:e.added===null||e.removed===null?`binary`:`+${e.added} −${e.removed}`}function xe(e){return e.files.map(e=>`${e.path} ${be(e)}`).join(`, `)}function Se(e){return e.startsWith(`@@`)||e.startsWith(`\\`)?`text-fg-muted`:e.startsWith(`+`)?`text-emerald-300`:e.startsWith(`-`)?`text-red-300`:`text-fg-tertiary`}function Ce({file:e}){return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[e.path,e.status===`modified`?``:(0,V.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,e.status]})]}),e.patch===null?(0,V.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown.`}):e.patch===``?(0,V.jsx)(`p`,{className:`mt-1 text-meta`,children:`Empty.`}):(0,V.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed`,children:e.patch.split(`
|
|
2
|
+
`).map((e,t)=>(0,V.jsx)(`span`,{className:`block whitespace-pre-wrap break-words ${Se(e)}`,children:e===``?` `:e},t))}),e.truncated?(0,V.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}function we({name:e,change:t}){let n=d(e,t.commit,!0);return(0,V.jsxs)(`div`,{className:`space-y-3 px-4 pt-1 pb-3`,children:[(0,V.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[t.kind===`merge`?`Two turns on different runners changed the same lines at once. The file kept one turn's version, and this copy holds the other's until the citizen reconciles them.`:t.kind===`board`?`Written by the board: ${t.subject.replace(/^home: /,``)}.`:t.turnId===void 0?t.subject:(0,V.jsx)(E,{to:`/citizen/$name`,params:{name:e},search:{tab:`turns`,turn:t.turnId},className:`text-fg-secondary underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Open the turn that made it`}),(0,V.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,H(t.at)]})]}),n.data===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:n.isError?`Could not read the change.`:`Reading the change…`}):n.data.map(e=>(0,V.jsx)(Ce,{file:e},e.path))]})}function Te({name:e,change:t,now:n}){let[r,i]=(0,B.useState)(!1),a=t.files.length===0?t.subject:xe(t);return(0,V.jsx)(`li`,{className:`border-b border-line/60 last:border-b-0`,children:(0,V.jsxs)(`details`,{className:`group`,onToggle:e=>i(e.currentTarget.open),children:[(0,V.jsx)(`summary`,{"aria-label":`${ye[t.kind]} ${b(t.at,n)}: ${a}`,className:`block cursor-pointer list-none px-4 py-2.5 transition-colors hover:bg-surface-2/30 group-open:bg-surface-2/20`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:ve[t.kind]}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:a}),(0,V.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:b(t.at,n)}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]})}),r?(0,V.jsx)(we,{name:e,change:t}):null]})})}function Ee({name:e}){let[t,n]=(0,B.useState)(G),r=v(e,t),i=S(3e4);if(r.data===void 0)return(0,V.jsx)(F,{children:r.isError?`Could not read the home's history.`:`Reading the history…`});let{changes:a,more:o}=r.data;return a.length===0?(0,V.jsxs)(F,{children:[e,`'s home has no history yet; it starts with the citizen's first turn.`]}):(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,children:[`What `,e,`'s turns changed in its memory, skills, and profile, newest first.`]}),(0,V.jsx)(`ol`,{children:a.map(t=>(0,V.jsx)(Te,{name:e,change:t,now:i},t.commit))}),o?(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(t+G),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:`Show earlier changes`}):null]})}function K({title:e,children:t}){return(0,V.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,V.jsx)(`h3`,{className:`text-section`,children:e}),(0,V.jsx)(`div`,{className:`mt-2`,children:t})]})}function De({member:e,charter:t}){let n=s(e.name),r=_(e.name),i=p(e.name),a=S(3e4);return(0,V.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[i.data===void 0||i.data.length===0?null:(0,V.jsxs)(K,{title:`Edits to reconcile`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`Two turns on different runners changed these files at once. Each file kept one version; the other waits beside it until `,e.name,` merges it in and deletes the copy.`]}),(0,V.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:i.data.map(e=>(0,V.jsxs)(`li`,{className:`text-sm`,children:[(0,V.jsx)(`span`,{className:`text-fg-primary`,children:e.file}),(0,V.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.path.slice(e.path.lastIndexOf(`/`)+1),` · left`,` `,b(e.since,a)]})]},e.path))})]}),(0,V.jsx)(K,{title:`Profile`,children:e.profile.trim()===``?(0,V.jsx)(`p`,{className:`text-meta`,children:`No profile yet. The citizen writes its own profile.md.`}):(0,V.jsx)(P,{text:R(e.profile,`Profile`)})}),(0,V.jsx)(K,{title:`Core memory`,children:n.data===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.data.body.trim()===``?(0,V.jsx)(`p`,{className:`text-meta`,children:`Empty. Every turn loads this file in full.`}):(0,V.jsx)(P,{text:R(n.data.body,`Core memory`)})}),(0,V.jsx)(K,{title:`Own skills`,children:r.data===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):r.data.length===0?(0,V.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:r.data.map(e=>(0,V.jsxs)(`li`,{className:`text-sm`,children:[(0,V.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,V.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})}),t===void 0?null:(0,V.jsxs)(K,{title:`Charter of ${t.name}`,children:[(0,V.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:t.purpose}),(0,V.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Wakes on mentions, stages, and `,t.wakeTriggers.join(`, `)||`nothing else`,t.resident?` · keeps a warm session`:``,t.reflects?` · reflects`:``]}),(0,V.jsx)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:t.verbs.map(e=>(0,V.jsx)(`span`,{className:`rounded-md bg-surface-2/70 px-1.5 py-px font-mono text-[11px] text-fg-tertiary`,children:e},e))})]})]})}function q(e,t){let r=n(e,t?.turnId??null);return{turn:(0,B.useMemo)(()=>t===void 0||r.data===void 0?void 0:ae(r.data,e,t.project,t),[t,r.data,e]),loading:t?.turnId!==void 0&&r.isPending,missing:t!==void 0&&(t.turnId===void 0||r.isError)}}var J=50;function Oe({name:e,entry:t,now:n,opened:r}){let[i,a]=(0,B.useState)(r),o=(0,B.useRef)(null);(0,B.useEffect)(()=>{r&&o.current?.scrollIntoView({block:`start`})},[r]);let s=oe(),c=pe(t),l=t.thread===void 0?t.channel===void 0?null:`#${t.channel}`:s.get(t.thread)?.title??`a thread`,u=t.error??t.summary??``,d=t.error===null?`text-fg-secondary`:`text-red-300`;return(0,V.jsx)(`li`,{ref:o,className:`border-b border-line/60 last:border-b-0`,children:(0,V.jsxs)(`details`,{className:`group`,open:i,onToggle:e=>a(e.currentTarget.open),children:[(0,V.jsxs)(`summary`,{className:`block cursor-pointer list-none px-4 py-2.5 transition-colors hover:bg-surface-2/30 group-open:bg-surface-2/20`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 truncate text-fg-secondary`,children:[L(t.project),l===null?``:` · ${l}`]}),(0,V.jsx)(`span`,{className:`text-fg-muted`,children:t.trigger}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-fg-muted`,children:[me(t),` `,b(t.ts,n)]}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-fg-tertiary`,title:t.usage===void 0?void 0:I(t.usage),children:[c,t.toolCalls===void 0?null:`${t.toolCalls} tools`,t.usage===void 0?null:z(t.usage)].filter(e=>e!==null).join(` · `)}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]}),u.trim()===``?null:(0,V.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-xs leading-relaxed group-open:hidden ${d}`,children:(0,V.jsx)(D,{text:u,links:!1})})]}),i?(0,V.jsx)(ke,{name:e,entry:t,text:u,tone:d}):null]})})}function ke({name:e,entry:t,text:n,tone:r}){let i=q(e,t);return(0,V.jsxs)(`div`,{className:`px-4 pt-1 pb-3`,children:[n.trim()===``?null:(0,V.jsx)(`p`,{className:`text-xs leading-relaxed whitespace-pre-wrap ${r}`,children:(0,V.jsx)(D,{text:n})}),(0,V.jsx)(`div`,{className:`mt-2`,children:t.turnId===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`This turn ran before turns kept their steps.`}):i.loading?(0,V.jsx)(`p`,{className:`text-meta`,children:`Reading the steps…`}):i.turn===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`No steps were kept for this turn.`}):(0,V.jsxs)(V.Fragment,{children:[t.startedAt===void 0?null:(0,V.jsxs)(`p`,{className:`text-caps`,children:[`Started `,H(t.startedAt)]}),(0,V.jsx)(W,{steps:i.turn.steps})]})})]})}function Ae({name:e,opened:t}){let[n,r]=(0,B.useState)(J),a=i(e,n),o=S(3e4);if(a.data===void 0)return(0,V.jsx)(F,{children:`Reading the turns…`});let s=a.data.toReversed();if(s.length===0)return(0,V.jsxs)(F,{children:[e,` has not finished a turn yet.`]});let c=fe(s),l=c.usage===null?``:` · ${z(c.usage)}${c.withUsage<c.turns?` over ${c.withUsage} of them`:``}`;return(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,title:c.usage===null?void 0:I(c.usage),children:[c.turns===1?`1 turn`:`${c.turns} turns`,c.failed===0?``:`, ${c.failed} not completed`,l]}),t!==null&&!s.some(e=>e.turnId===t)?(0,V.jsx)(`p`,{className:`px-4 pb-1 text-meta`,children:a.data.length===n?`The turn this address opens is further back; show earlier turns to reach it.`:`The turn this address opens is not in this citizen's history.`}):null,(0,V.jsx)(`ol`,{children:s.map(n=>(0,V.jsx)(Oe,{name:e,entry:n,now:o,opened:t!==null&&n.turnId===t},n.id))}),a.data.length===n?(0,V.jsxs)(`button`,{type:`button`,onClick:()=>r(n+J),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show `,J,` earlier turns`]}):null]})}function je(e){return e===void 0?``:`${e.name}${e.id===null?``:` · ${e.id}`}`}function Y({label:e,choices:t,value:n,onChange:r,listClassName:i=`inset-x-0`}){let[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)([]),u=t.findIndex(e=>e.value===n);(0,B.useEffect)(()=>{if(!a)return;l.current[Math.max(u,0)]?.focus();let e=e=>{e.target instanceof Node&&s.current?.contains(e.target)===!0||o(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[a,u]);let d=e=>{if(e.key===`Escape`){e.stopPropagation(),o(!1),c.current?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=(l.current.findIndex(e=>e===document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length;l.current[n]?.focus()},f=t[u];return(0,V.jsxs)(`div`,{ref:s,className:`relative min-w-0 flex-1`,children:[(0,V.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`${e}: ${je(f)}`,"aria-expanded":a,onClick:()=>o(!a),onKeyDown:a?d:void 0,className:`flex h-7 w-full items-center gap-1.5 rounded-md bg-surface-2/60 px-2.5 text-xs text-fg-secondary transition-colors hover:bg-surface-2 focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:[f?.name,f?.id===null||f===void 0?null:(0,V.jsxs)(`span`,{className:`text-fg-tertiary`,children:[` · `,f.id]})]}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`text-[10px] text-fg-muted transition-transform ${a?`rotate-180`:``}`,children:`▾`})]}),a?(0,V.jsx)(`div`,{className:`absolute ${i} top-full z-20 mt-1 max-h-80 overflow-y-auto rounded-xl bg-surface-1/95 p-1 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.08),0_16px_32px_-12px_rgba(0,0,0,0.8)] backdrop-blur-xl`,children:t.map((e,t)=>{let i=e.value===n;return(0,V.jsxs)(`button`,{ref:e=>{l.current[t]=e},type:`button`,"aria-current":i?`true`:void 0,onKeyDown:d,onClick:()=>{r(e.value),o(!1),c.current?.focus()},className:`flex w-full items-start gap-2 rounded-lg px-2.5 py-1.5 text-left transition-colors focus-visible:outline-none ${i?`bg-surface-2/80`:`hover:bg-surface-2/50 focus-visible:bg-surface-2/50`}`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`span`,{className:`block truncate text-xs text-fg-secondary`,children:[e.name,e.id===null?null:(0,V.jsxs)(`span`,{className:`text-fg-tertiary`,children:[` · `,e.id]})]}),e.description===``?null:(0,V.jsx)(`span`,{className:`block truncate text-[11px] text-fg-muted`,children:e.description})]}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`w-3 shrink-0 pt-px text-[11px] text-fg-primary`,children:i?`✓`:``})]},e.value)})}):null]})}var X=``,Z=``;function Me(e,t){return[{value:X,name:`CLI default`,id:e.find(e=>e.isDefault)?.name??null,description:`Whatever the CLI runs when no model is set.`},...e.map(e=>({value:e.id,name:e.name,id:e.name===e.id?null:e.id,description:e.description})),...t===null?[]:[{value:t,name:t,id:null,description:`Not in the CLI's list.`}]]}function Ne(e,t){return[{value:Z,name:`Default`,id:e?.defaultEffort??null,description:`Whatever the model runs unset.`},...(e?.efforts??[]).map(e=>({value:e.id,name:e.id,id:null,description:e.description})),...t===null?[]:[{value:t,name:t,id:null,description:`Not in the model's list.`}]]}function Pe({member:e,onDone:t}){let{api:n}=r(),i=m(),a=l(e.name),o=e.model??X,s=e.effort??Z,[c,u]=(0,B.useState)(o),[d,f]=(0,B.useState)(s),p=w({mutationFn:async()=>{c!==o&&await n.setModel(e.name,c===X?null:c),d!==s&&await n.setEffort(e.name,d===Z?null:d)},onSettled:()=>void i.invalidateQueries({queryKey:[`members`]}),onSuccess:t}),h=a.data?.models??[],g=e.model!==void 0&&!h.some(t=>t.id===e.model)?e.model:null,_=e=>h.find(t=>e===X?t.isDefault:t.id===e),v=_(c)?.efforts??[],y=d!==Z&&!v.some(e=>e.id===d)?d:null,b=e=>{u(e);let t=_(e)?.efforts??[];d!==Z&&!t.some(e=>e.id===d)&&f(Z)},x=c!==o||d!==s;return(0,V.jsxs)(`form`,{"aria-label":`Model of ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),p.mutate()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a.isPending?(0,V.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Asking `,e.cli,` for its models…`]}):a.error===null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Y,{label:`Model`,choices:Me(h,g),value:c,onChange:b}),v.length===0&&y===null?null:(0,V.jsx)(`div`,{className:`flex w-32 shrink-0`,children:(0,V.jsx)(Y,{label:`Effort`,choices:Ne(_(c),y),value:d,onChange:f,listClassName:`right-0 w-64`})})]}):(0,V.jsxs)(`p`,{role:`alert`,className:`min-w-0 flex-1 truncate text-xs text-red-400`,children:[e.cli,` did not list its models:`,` `,a.error instanceof C?a.error.message:`the board server did not answer`]}),(0,V.jsx)(T,{onClick:t,children:`Cancel`}),(0,V.jsx)(T,{variant:`primary`,type:`submit`,disabled:p.isPending||!x||a.error!==null,children:p.isPending?`Saving…`:`Save`})]}),a.data===void 0?null:(0,V.jsxs)(`p`,{className:`text-meta`,children:[`As `,a.data.cli,` on `,a.data.runner,` lists them, where this citizen's turns run.`]}),(0,V.jsx)(N,{error:p.error})]})}var Q=``;function Fe(e,t){let n=t.cli;return[e.status,e.clis.length===0?`offers no CLI yet`:e.clis.join(`, `),n!==null&&e.clis.length>0&&!e.clis.includes(n)?`has no ${n}`:``,e.capabilities.length===0?``:e.capabilities.join(`, `)].filter(e=>e!==``).join(` · `)}function Ie(e,t){return[{value:Q,name:`Any runner`,id:null,description:`Pinned to the least busy runner on its next turn outside a project.`},...e.map(e=>({value:e.name,name:e.name,id:e.os,description:Fe(e,t)}))]}function Le({member:e,onDone:t}){let{api:n}=r(),i=m(),o=a(),s=e.homeRunner??Q,[c,l]=(0,B.useState)(s),u=w({mutationFn:()=>n.setRunner(e.name,c===Q?null:c),onSuccess:()=>{i.invalidateQueries({queryKey:[`members`]}),t()}});return(0,V.jsxs)(`form`,{"aria-label":`Runner of ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),u.mutate()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.data===void 0?(0,V.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`Reading the runners…`}):(0,V.jsx)(Y,{label:`Runner`,choices:Ie(o.data,e),value:c,onChange:l}),(0,V.jsx)(T,{onClick:t,children:`Cancel`}),(0,V.jsx)(T,{variant:`primary`,type:`submit`,disabled:u.isPending||c===s,children:u.isPending?`Saving…`:`Run here`})]}),(0,V.jsx)(`p`,{className:`text-meta`,children:`Its conversations outside projects start afresh there from its next turn; its memory and skills follow it. Project work runs where each project lives.`}),(0,V.jsx)(N,{error:u.error})]})}function Re(e){if(e.thread!==void 0)return{threadId:e.thread};let t=e.scope===`society`?null:e.scope;return e.channel===void 0?{channel:e.askedIn??u(t,`general`)}:{channel:u(t,e.channel)}}function ze({name:e,turn:t}){let{api:n}=r(),i=m(),[a,o]=(0,B.useState)(!1),s=w({mutationFn:()=>n.stopTurn(t.turnId),onSuccess:()=>{o(!1),i.invalidateQueries({queryKey:[`scheduler`]})}});return(0,V.jsxs)(`div`,{className:`border-t border-line`,children:[(0,V.jsx)(ie,{target:Re(t),initialText:`@${e} `,placeholder:t.steerable?`Message ${e} while it works`:`Message ${e} for its next turn`,className:`px-3 pt-3 pb-2`},t.turnId),t.stoppable?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-3`,children:[(0,V.jsx)(`p`,{className:`min-w-0 flex-1 text-[11px] leading-snug text-fg-muted`,children:a?`Ends the turn now. What it was shown counts as read; its stages stay held.`:t.steerable?`Posts reach the turn at its next step.`:`This runner delivers posts after the turn ends.`}),a?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(T,{onClick:()=>{o(!1),s.reset()},children:`Keep it running`}),(0,V.jsx)(T,{variant:`primary`,disabled:s.isPending,onClick:()=>{s.mutate()},children:s.isPending?`Stopping…`:`Stop the turn`})]}):(0,V.jsx)(T,{onClick:()=>o(!0),children:`Stop…`})]}):null,s.error===null?null:(0,V.jsx)(`div`,{className:`px-3 pb-3`,children:(0,V.jsx)(N,{error:s.error})})]})}function Be({member:e,scopes:t,preferred:n,running:i,paused:a,onDone:o}){let{api:s}=r(),c=m(),[l,u]=(0,B.useState)(`manual`),[d,f]=(0,B.useState)(n!==null&&t.includes(n)?n:t[0]??``),[p,h]=(0,B.useState)(``),g=(0,B.useRef)(null);(0,B.useEffect)(()=>g.current?.focus(),[]);let _=w({mutationFn:()=>s.wake({agent:e.name,project:d,kind:l,...p.trim()===``?{}:{reason:p.trim()}}),onSuccess:()=>{c.invalidateQueries({queryKey:[`scheduler`]}),o()}}),v=L(d),y=l===`reflection`?`Asks ${e.name} to reflect at ${v}: consolidate its memory, skills, and profile, and take no new work. It restarts the reflection clock.`:`Starts a turn for ${e.name} at ${v} as soon as the scheduler takes it.`,b=a?` The society is paused, so it waits until you resume.`:i.includes(d)?` ${e.name} is in a turn there now; this one follows it.`:``;return(0,V.jsxs)(`form`,{"aria-label":`Wake ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),_.mutate()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,V.jsx)(`legend`,{className:`sr-only`,children:`Kind of turn`}),[`manual`,`reflection`].map(e=>(0,V.jsxs)(`label`,{className:`cursor-pointer rounded-md px-2.5 py-1 text-xs transition-colors has-focus-visible:ring-2 has-focus-visible:ring-fg-primary/30 ${l===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,V.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:l===e,onChange:()=>u(e),className:`sr-only`}),e===`manual`?`A turn`:`A reflection`]},e))]}),(0,V.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-xs text-fg-tertiary`,children:[`at`,(0,V.jsx)(`select`,{value:d,onChange:e=>f(e.target.value),"aria-label":`Where`,className:`rounded-md bg-surface-2/60 px-2 py-1 text-xs text-fg-primary outline-none`,children:t.map(e=>(0,V.jsx)(`option`,{value:e,children:L(e)},e))})]})]}),(0,V.jsx)(`textarea`,{ref:g,value:p,rows:2,placeholder:l===`reflection`?`Anything to reflect on in particular? Optional.`:`What should it look at? It reads this as the reason it was woken.`,"aria-label":`Reason`,onChange:e=>h(e.target.value),className:`${ce} resize-none`}),(0,V.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[y,b,` Each turn costs money.`]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,V.jsx)(T,{onClick:o,children:`Cancel`}),(0,V.jsx)(T,{variant:`primary`,type:`submit`,disabled:_.isPending||d===``,children:_.isPending?`Waking…`:l===`reflection`?`Ask for a reflection`:`Wake ${e.name}`})]}),(0,V.jsx)(N,{error:_.error})]})}var Ve={working:`bg-emerald-500/15 text-emerald-300`,queued:`bg-amber-500/15 text-amber-300`,idle:`bg-surface-2 text-fg-tertiary`};function He({project:e,name:n}){let r=(t(e).data??[]).filter(e=>e.status===`claimed`&&e.claimedBy===n);return r.length===0?null:(0,V.jsx)(`ul`,{className:`mt-1.5 space-y-1`,children:r.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(E,{to:`/task/$taskId`,params:{taskId:e.id},className:`flex items-center gap-2 rounded-md text-xs text-fg-secondary hover:text-fg-primary`,children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`◇`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,V.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-mono text-[11px] text-fg-muted`,children:f(e)?.name??e.stage})]})},e.id))})}function Ue(){let{name:e}=te({from:`/citizen/$name`}),{scope:t,tab:n,turn:r}=se({from:`/citizen/$name`});return(0,V.jsx)(Ge,{name:e,chosen:t??null,tab:n??`now`,turn:r??null},e)}var We=[{tab:`now`,label:`Now`},{tab:`turns`,label:`Turns`},{tab:`memory`,label:`Memory`},{tab:`history`,label:`History`}];function Ge({name:t,chosen:n,tab:r,turn:i}){let a=h(),s=x(),c=e(),l=k(),[u,d]=(0,B.useState)(null),f=a.data?.find(e=>e.name===t);if(f===void 0)return(0,V.jsx)(F,{children:a.data===void 0?`Reading the roster…`:`There is no citizen ${t}.`});let p=o(c.data?.running??[]).filter(e=>e.agent===t),m=[...new Set(p.map(e=>e.scope))],g=p.map(e=>M(e.agent,e.scope,e)),_=o(c.data?.pending??[]).find(e=>e.agent===t),v=m.length>0?`working`:_===void 0?`idle`:`queued`,y=j(l,t)[0],b=y?.model??f.lastModel,S=b??f.model??`CLI default`,C=f.model!==void 0&&f.model!==b?f.model:null,w=s.data?.find(e=>e.name===f.role),te=de(f),D=f.status===`active`&&f.cli!==null;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(le,{leading:f.cli===null?null:(0,V.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-2/70`,children:(0,V.jsx)(ee,{cli:f.cli,size:20})}),title:t,subtitle:(0,V.jsxs)(V.Fragment,{children:[f.role,` · `,S,C===null?``:` · set to ${C}`,f.effort===void 0?``:` · ${f.effort} effort`,f.homeRunner===void 0?``:` · on ${f.homeRunner}`,f.status===`retired`?` · retired`:``]}),trailing:(0,V.jsxs)(V.Fragment,{children:[D&&u===null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(T,{onClick:()=>d(`model`),children:`Model…`}),(0,V.jsx)(T,{onClick:()=>d(`runner`),children:`Runner…`}),(0,V.jsx)(T,{onClick:()=>d(`wake`),children:`Wake…`})]}):null,(0,V.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${Ve[v]}`,children:v})]})}),u===`wake`?(0,V.jsx)(Be,{member:f,scopes:te,preferred:n?.split(`/`)[0]??y?.scope??null,running:m,paused:c.data?.paused??!1,onDone:()=>d(null)}):u===`model`?(0,V.jsx)(Pe,{member:f,onDone:()=>d(null)}):u===`runner`?(0,V.jsx)(Le,{member:f,onDone:()=>d(null)}):null,(0,V.jsx)(`nav`,{"aria-label":`Citizen views`,className:`flex gap-1 border-b border-line px-3 py-2`,children:We.map(e=>(0,V.jsx)(E,{to:`/citizen/$name`,params:{name:t},search:{...n===null?{}:{scope:n},...e.tab===`now`?{}:{tab:e.tab}},replace:!0,"aria-current":e.tab===r?`page`:void 0,className:`rounded-md px-2.5 py-1 text-xs transition-colors ${e.tab===r?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:e.label},e.tab))}),r===`turns`?(0,V.jsx)(Ae,{name:t,opened:i},i):r===`memory`?(0,V.jsx)(De,{member:f,charter:w}):r===`history`?(0,V.jsx)(Ee,{name:t}):(0,V.jsx)(Ke,{name:t,chosen:n,lastTurnAt:f.lastTurnAt,state:v,runningScopes:m,runningKeys:g,runningTurns:(c.data?.turns??[]).filter(e=>e.agent===t),queuedScope:_?.scope??null})]})}function $(e){return e.toSorted((e,t)=>e.startedAt.localeCompare(t.startedAt))[0]}function Ke({name:e,chosen:t,lastTurnAt:n,state:r,runningScopes:a,runningKeys:o,runningTurns:s,queuedScope:c}){let l=k(),u=S(5e3),{ref:d,onScroll:f}=ue(),p=j(l,e),m=i(e,1),h=q(e,p.length===0?m.data?.at(-1):void 0),g=oe(),_=e=>e.end===null&&o.includes(M(e.agent,e.scope,e)),v=t?.split(`/`)[0]??null,y=(t?.includes(`/`)===!0?p.find(e=>O(e)===t):void 0)??$(p.filter(e=>e.scope===v&&_(e)))??p.find(e=>O(e)===t)??$(p.filter(_))??p[0]??h.turn,x=e=>e.thread===void 0?e.channel===void 0?L(e.scope):`${L(e.scope)} · #${e.channel}`:`${L(e.scope)} · ${g.get(e.thread)?.title??`a thread`}`,C=y!==void 0&&_(y),w=y?.scope??a[0]??c,T=(y===void 0?void 0:s.find(e=>e.scope===y.scope&&e.thread===y.thread&&e.channel===y.channel))??(C?void 0:s[0]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{className:`border-b border-line px-4 py-3 text-xs text-fg-tertiary`,children:[(0,V.jsx)(`p`,{children:C?`In a turn at ${L(y.scope)} for ${y.fromStart?``:`at least `}${A(y.startedAt,u)}`:a.length>0?`In a turn at ${a.map(L).join(` and `)}`:c===null?n===void 0?`No turns yet`:`Last turn ${b(n,u)}`:`Queued for a turn at ${L(c)}`}),w===null||w===`society`?null:(0,V.jsx)(He,{project:w,name:e})]}),(0,V.jsx)(`div`,{ref:d,onScroll:f,className:`flex-1 overflow-y-auto px-4 py-3`,children:y===void 0?(0,V.jsx)(F,{children:r===`working`?`The turn has not reported a step yet.`:h.loading?`Reading the last turn…`:n===void 0?`${e} has not taken a turn yet.`:`${e}'s last turn kept no steps; Turns lists every finished one.`}):(0,V.jsxs)(V.Fragment,{children:[p.length>1?(0,V.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,"aria-label":`Turns by conversation`,children:p.toSorted((e,t)=>O(e).localeCompare(O(t))).map(t=>(0,V.jsxs)(E,{to:`/citizen/$name`,params:{name:e},search:{scope:O(t)},replace:!0,"aria-current":t===y?`true`:void 0,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] transition-colors ${t===y?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[_(t)?(0,V.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}):null,x(t)]},O(t)))}):null,(0,V.jsxs)(`p`,{className:`text-caps`,children:[C?`This turn`:`Last turn`,` · `,x(y),` · started`,` `,y.fromStart?H(y.startedAt):`before the earliest step shown`]}),y.fromStart?null:(0,V.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`Earlier steps of this turn are no longer in the server's live buffer`,C?``:`; Turns has the whole turn`,`.`]}),(0,V.jsx)(W,{steps:y.steps}),(0,V.jsx)(_e,{turn:y,running:C,now:u})]})}),T===void 0?null:(0,V.jsx)(ze,{name:e,turn:T})]})}export{Ue as CitizenView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,U as t,b as n,g as r,pn as i}from"./format-BWr3zKWg.js";import{t as a}from"./link-CFdt17Sp.js";import{t as o}from"./CliIcon-CT5ljQDC.js";import{n as s,t as c}from"./Pane-CFoSKOo5.js";import{i as l,r as u}from"./citizen-CImM6WB6.js";var d=i();function f(e){let t=e.lastModel??e.model??`CLI default`,n=e.model!==void 0&&e.model!==t?`${t} · set to ${e.model}`:t;return e.effort===void 0?n:`${n} · ${e.effort}`}function p(e,t){return e.name.localeCompare(t.name)}function m(e,t){return e.role.localeCompare(t.role)||p(e,t)}function h(){let i=r(),h=e(),g=n();if(i.data===void 0)return(0,d.jsx)(s,{children:`Reading the roster…`});let _=i.data.filter(e=>e.cli!==null),v=_.filter(e=>e.status===`active`).toSorted(m),y=_.filter(e=>e.status!==`active`).toSorted(p),b=new Set(v.map(e=>e.role)).size,x=t(h.data?.running??[]),S=t(h.data?.pending??[]),C=new Map((g.data??[]).flatMap(e=>e.runner===void 0?[]:[[e.slug,e.runner]])),w=e=>{let t=[...new Set(x.filter(t=>t.agent===e.name).map(e=>e.scope))];return t.length>0?{label:`working`,detail:`in a turn at ${t.map(l).join(` and `)}`,tone:`text-emerald-300`}:S.some(t=>t.agent===e.name)?{label:`queued`,detail:`queued for a turn`,tone:`text-amber-300`}:{label:`resting`,detail:`resting`,tone:`text-fg-muted`}};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(c,{title:`Citizens`,subtitle:`${v.length} active in ${b===1?`1 role`:`${b} roles`}${y.length===0?``:` · ${y.length} retired`}`}),(0,d.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[v.length===0?(0,d.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No citizens yet. Ask the concierge for one.`}):null,(0,d.jsx)(`ul`,{className:`grid grid-cols-[auto_auto_auto_minmax(0,max-content)_auto_minmax(3rem,1fr)_auto] gap-x-3`,children:v.map(e=>{let t=w(e),n=f(e),r=e.memberships.length===0?`no projects`:e.memberships.join(`, `),i=u(e,C);return(0,d.jsx)(`li`,{className:`col-span-full grid grid-cols-subgrid`,children:(0,d.jsxs)(a,{to:`/citizen/$name`,params:{name:e.name},className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,d.jsx)(`span`,{className:`grid size-4 place-items-center`,children:e.cli===null?null:(0,d.jsx)(o,{cli:e.cli,size:13})}),(0,d.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,d.jsx)(`span`,{className:`text-fg-secondary`,children:e.role}),(0,d.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:n,children:n}),(0,d.jsx)(`span`,{className:`text-xs text-fg-muted`,title:i.detail,children:i.label}),(0,d.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:r,children:r}),(0,d.jsx)(`span`,{className:`text-right text-xs ${t.tone}`,title:t.detail,children:t.label})]})},e.name)})}),y.length===0?null:(0,d.jsxs)(`p`,{className:`mt-2 border-t border-line px-2 pt-2 text-meta`,children:[`Retired: `,y.map(e=>`${e.name} (${e.role})`).join(`, `)]})]})]})}export{h as CitizensView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pn as e}from"./format-BWr3zKWg.js";var t=`M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656`,n={claude:{label:`Claude Code`,path:`M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z`,fill:`#D97757`,accent:`#fb923c`},codex:{label:`Codex`,path:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`,fill:`#f5f5f5`,accent:`#10b981`}},r=e();function i({cli:e,size:t=16}){let i=n[e];return(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,width:t,height:t,"aria-hidden":`true`,className:`shrink-0`,children:(0,r.jsx)(`path`,{d:i.path,fill:i.fill,fillRule:`evenodd`,clipRule:`evenodd`})})}export{n,t as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,_n as t,b as n,fn as r,lt as i,m as a,mn as o,pn as s,t as c,y as l}from"./format-BWr3zKWg.js";import{c as u,l as d,s as f}from"./compose-BG_-Tp87.js";import{t as p}from"./link-CFdt17Sp.js";import{T as m}from"./index-Cxqhrg2v.js";import{r as h}from"./ThreadForms-CTBaAJ57.js";import{t as g}from"./Markdown-B5zEdYuO.js";import{n as _,t as v}from"./Pane-CFoSKOo5.js";import{t as y}from"./BackLink-BlJvN2RA.js";var b=t(o(),1),x=s(),S=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function C(){let{scope:t,topic:o}=m({from:`/knowledge/$scope/$topic`}),{api:s}=e(),C=r(),w=u(),T=a(t),E=n(),D=l(3e4),[O,k]=(0,b.useState)(!1),A=t===i,j=A?`the society`:E.data?.find(e=>e.slug===t)?.name??t,M=T.data?.find(e=>e.topic===o),N=d({mutationFn:()=>s.removeKnowledge({project:A?null:t,topic:o}),onSuccess:async()=>{await C.invalidateQueries({queryKey:[`knowledge`,t]}),await w(A?{to:`/society`}:{to:`/p/$slug`,params:{slug:t}})}}),P=A?(0,x.jsx)(p,{to:`/society`,"aria-label":`Back to the society`,className:S,children:`←`}):(0,x.jsx)(p,{to:`/p/$slug`,params:{slug:t},"aria-label":`Back to ${j}`,className:S,children:`←`});return M===void 0?(0,x.jsx)(_,{children:T.data===void 0?`Reading…`:`${j} has no topic ${o}.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(v,{leading:(0,x.jsx)(y,{fallback:P}),title:M.topic,subtitle:`Knowledge of ${j} · written by ${M.updatedBy} ${c(M.updatedAt,D)}`,trailing:O?null:(0,x.jsx)(f,{onClick:()=>k(!0),children:`Remove…`})}),O?(0,x.jsxs)(`form`,{"aria-label":`Remove the topic`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),N.mutate()},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`p`,{className:`min-w-0 flex-1 text-meta`,children:[`No turn or search finds `,M.topic,` again, and a note in`,` `,A?`#general`:`#${t}/general`,` says so without waking anyone. The server keeps its text aside.`]}),(0,x.jsx)(f,{onClick:()=>k(!1),children:`Cancel`}),(0,x.jsx)(f,{variant:`primary`,type:`submit`,disabled:N.isPending,children:N.isPending?`Removing…`:`Remove topic`})]}),(0,x.jsx)(h,{error:N.error})]}):null,(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:(0,x.jsx)(g,{text:M.body})})]})}export{C as KnowledgeView};
|