@kubitnodes/stellaris 0.3.0 → 0.3.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/dist/cli/index.js +86 -4
- package/dist/server/index.js +403 -27
- package/package.json +1 -1
- package/web/dist/assets/ChannelView-UppsahaH.js +1 -0
- package/web/dist/assets/CitizenView-CvZ5sEqw.js +2 -0
- package/web/dist/assets/{CitizensView-DB2TlGxn.js → CitizensView-D7VztzDL.js} +1 -1
- package/web/dist/assets/{KnowledgeView-l0I_R5Zd.js → KnowledgeView-D2jzcn4S.js} +1 -1
- package/web/dist/assets/{Markdown-C6mhAmbQ.js → Markdown-Dc8gCFZz.js} +4 -4
- package/web/dist/assets/{MessageItem-BR30twQh.js → MessageItem-BcDf-lgD.js} +1 -1
- package/web/dist/assets/MetricsView-lRYbAJSl.js +1 -0
- package/web/dist/assets/NeedsYouView-C-2cU-C5.js +1 -0
- package/web/dist/assets/{Overview-D47FfDDO.js → Overview-lKNZgZg_.js} +1 -1
- package/web/dist/assets/{Pane-BXpuXst6.js → Pane-DKfOLaXj.js} +1 -1
- package/web/dist/assets/{ProjectView-CxUA5nFw.js → ProjectView-CSoD4RFx.js} +1 -1
- package/web/dist/assets/ProposalView-BkcPia8W.js +1 -0
- package/web/dist/assets/{ProposalsView-BscIGUTT.js → ProposalsView-BQucmpBt.js} +1 -1
- package/web/dist/assets/{RunnersView-BypVHvzI.js → RunnersView-FbbPyu3y.js} +1 -1
- package/web/dist/assets/{SocietyView-C403e1uR.js → SocietyView-rpbJ_PcL.js} +1 -1
- package/web/dist/assets/SubjectThread-DQHf-MWF.js +1 -0
- package/web/dist/assets/{TaskView-B-4WGLWK.js → TaskView-6_oFPNkL.js} +1 -1
- package/web/dist/assets/{TasksView-CA02-WIW.js → TasksView-CJkLuWGV.js} +1 -1
- package/web/dist/assets/{ThreadCard-C4rb-53v.js → ThreadCard-Cjwceioc.js} +1 -1
- package/web/dist/assets/ThreadForms-CE9t-rVz.js +1 -0
- package/web/dist/assets/{ThreadView-CAdCu-y_.js → ThreadView-D09wIsYl.js} +1 -1
- package/web/dist/assets/citizen-BPzyDHNO.js +1 -0
- package/web/dist/assets/format-CRfcN5Lw.js +55 -0
- package/web/dist/assets/index-Ch3gW4_Z.js +23 -0
- package/web/dist/assets/index-NUcot4yn.css +2 -0
- package/web/dist/assets/{tasks-DZgkXWwu.js → tasks-DcMvT5ru.js} +1 -1
- package/web/dist/assets/{useStickyScroll-CVTdIoKj.js → useStickyScroll-B3_nksqI.js} +1 -1
- package/web/dist/index.html +4 -4
- package/web/dist/assets/ChannelView-B4rv0TMD.js +0 -1
- package/web/dist/assets/CitizenView-DfBiP1Jw.js +0 -2
- package/web/dist/assets/MetricsView-BZ0WW2Do.js +0 -1
- package/web/dist/assets/NeedsYouView-C6CZNnJn.js +0 -1
- package/web/dist/assets/ProposalView-C0oLBLQD.js +0 -1
- package/web/dist/assets/SubjectThread-irSHRJpB.js +0 -1
- package/web/dist/assets/ThreadForms-Dh9ky_aU.js +0 -1
- package/web/dist/assets/citizen-BWGATcew.js +0 -1
- package/web/dist/assets/format-DZLzLk7S.js +0 -55
- package/web/dist/assets/index-D-wuKd9C.js +0 -21
- package/web/dist/assets/index-HwY3AK-1.css +0 -2
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,Ln as t,M as n,Nn as r,Pn as i,fn as a,m as o,v as s,y as c}from"./format-CRfcN5Lw.js";import{N as l,P as u,R as d,a as f,t as p}from"./index-Ch3gW4_Z.js";import{t as m}from"./MessageItem-BcDf-lgD.js";import{n as h,t as g}from"./Pane-DKfOLaXj.js";import{n as _}from"./ThreadCard-Cjwceioc.js";import{i as v}from"./ThreadForms-CE9t-rVz.js";import{t as y}from"./useStickyScroll-B3_nksqI.js";var b=t(i(),1),x=r();function S(){let{_splat:e=`general`}=d({from:`/c/$`});return(0,x.jsx)(C,{channel:e},e)}function C({channel:t}){let{api:r}=e(),i=a({queryKey:[`channel`,t],queryFn:()=>r.channel(t)}),d=n(),S=o(),C=c(),w=s(3e4),[T,E]=(0,b.useState)(!1),D=(0,b.useMemo)(()=>{let e=(i.data??[]).map(e=>({kind:`message`,at:e.ts,id:e.id,message:e})),n=(d.data??[]).filter(e=>e.channel===t).map(e=>({kind:`thread`,at:e.openedAt,id:e.id,thread:e}));return[...e,...n].toSorted((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))},[i.data,d.data,t]),O=i.data?.at(-1)?.id??null;(0,b.useEffect)(()=>l(t,O),[t,O]);let{ref:k,onScroll:A}=y(),[j,M]=t.split(`/`),N=M??j??t,P=M===void 0?void 0:C.data?.find(e=>e.slug===j),F=M===void 0?`society`:P?.name??j,I=P?.archived!==void 0,L=D.filter(e=>e.kind===`thread`&&e.thread.state===`open`);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(g,{title:`# ${N}`,subtitle:`${F} · ${i.data?.length??0} messages${L.length>0?` · ${L.length} open threads`:``}`,trailing:T||I?null:(0,x.jsx)(f,{onClick:()=>E(!0),children:`New thread`})}),T?(0,x.jsx)(v,{channel:t,onDone:()=>E(!1)}):null,(0,x.jsx)(`div`,{ref:k,onScroll:A,className:`flex-1 overflow-y-auto py-2`,children:i.error instanceof u&&i.error.status===404?(0,x.jsxs)(h,{children:[`There is no channel `,t,`.`]}):i.data===void 0?(0,x.jsx)(h,{children:`Reading the channel…`}):D.length===0?(0,x.jsx)(h,{children:`Nothing has been said here yet.`}):D.map(e=>e.kind===`message`?(0,x.jsx)(m,{message:e.message,members:S.data,now:w},e.id):(0,x.jsx)(_,{thread:e.thread,now:w},e.id))}),i.data===void 0?null:I?(0,x.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[F,` is archived, so its channels are read-only.`]}):(0,x.jsx)(p,{target:{channel:t},placeholder:`Message #${N}`})]})}export{S as ChannelView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{C as e,E as t,Ln as n,Mn as r,N as i,Nn as a,P as o,Pn as s,Rt as c,T as l,_ as u,a as d,d as f,f as p,h as m,j as h,m as g,t as _,u as v,v as y,vt as b,w as x}from"./format-CRfcN5Lw.js";import{F as S,L as C,P as w,R as T,S as E,a as D,d as O,f as k,g as A,h as j,l as M,m as ee,p as te,t as ne,u as N,v as P,y as F,z as I}from"./index-Ch3gW4_Z.js";import{t as L}from"./Markdown-Dc8gCFZz.js";import{n as R,t as re}from"./Pane-DKfOLaXj.js";import{n as ie,r as z}from"./ThreadForms-CE9t-rVz.js";import{t as ae}from"./useStickyScroll-B3_nksqI.js";import{a as B,c as V,n as oe,o as se,r as ce,s as le,t as ue}from"./citizen-BPzyDHNO.js";var H=n(s(),1),U=a(),de={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`was interrupted`,blocked:`was blocked`,stopped:`was stopped by you`};function W(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function G({label:e,tone:t,children:n}){return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`px-0.5 pb-0.5 text-[10px] tracking-wider text-fg-muted uppercase`,children:e}),(0,U.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 fe({step:e,open:t}){if(e.kind===`say`)return(0,U.jsx)(`li`,{className:`py-1.5 text-sm`,title:W(e.at),children:(0,U.jsx)(L,{text:e.text})});if(e.kind===`error`)return(0,U.jsx)(`li`,{className:`py-1 font-mono text-xs break-words text-red-400`,title:W(e.at),children:e.message});if(e.kind===`steer`)return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,U.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,U.jsx)(`span`,{"aria-hidden":`true`,className:`grid w-3 shrink-0 place-items-center text-sky-300`,children:`↳`}),(0,U.jsxs)(`span`,{className:`shrink-0 text-fg-tertiary`,children:[`Took `,k(e.posts.length)]}),(0,U.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,U.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:W(e.at)})]}),(0,U.jsx)(`ul`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:e.posts.map(e=>(0,U.jsxs)(`li`,{className:`rounded-md bg-surface-0/40 px-2.5 py-2`,children:[(0,U.jsxs)(`p`,{className:`flex gap-1.5 text-meta`,children:[(0,U.jsx)(`span`,{className:`text-fg-secondary`,children:e.author}),(0,U.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`in `,e.where]}),e.at===``?null:(0,U.jsx)(`span`,{className:`ml-auto shrink-0 font-mono`,children:W(e.at)})]}),(0,U.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,U.jsx)(L,{text:e.body})})]},`${e.at}-${e.author}`))})]})});let n=e.ok===null?(0,U.jsx)(`span`,{"aria-label":`running`,className:`size-1.5 animate-pulse rounded-full bg-amber-300`}):e.ok?(0,U.jsx)(`span`,{"aria-label":`succeeded`,className:`text-[11px] text-emerald-400`,children:`✓`}):(0,U.jsx)(`span`,{"aria-label":`failed`,className:`text-[11px] text-red-400`,children:`✕`});return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,U.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,U.jsx)(`span`,{className:`grid w-3 shrink-0 place-items-center`,children:n}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-fg-tertiary`,children:te(e.name)}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-fg-secondary`,children:e.summary}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:W(e.at)})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:[(0,U.jsx)(G,{label:`Input`,tone:`text-fg-secondary`,children:e.detail}),e.output===null?null:(0,U.jsx)(G,{label:e.ok===!1?`Returned an error`:`Returned`,tone:e.ok===!1?`text-red-300`:`text-fg-tertiary`,children:e.output})]})]})})}function K({steps:e}){let[t,n]=(0,H.useState)(!1),r=e.filter(e=>e.kind===`tool`).length;return e.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-meta`,children:`No steps yet.`}):(0,U.jsxs)(U.Fragment,{children:[r===0?null:(0,U.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-meta`,children:[r===1?`1 tool call`:`${r} tool calls`,(0,U.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,U.jsx)(`ol`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,U.jsx)(fe,{step:e,open:t},e.seq))})]})}function pe({turn:e,running:t,now:n}){if(e.end!==null){let t=e.end.costUsd>0?` · $${e.end.costUsd.toFixed(2)}`:``;return(0,U.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,U.jsxs)(`p`,{className:`text-caps`,children:[`The turn `,de[e.end.exitReason],` `,_(e.end.at,n),t,e.fromStart?` · ${N(e.startedAt,Date.parse(e.end.at))}`:``]}),e.end.summary===null?null:(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-secondary`,children:e.end.summary})]})}return t?(0,U.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-meta`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}),`Working · last step `,_(e.lastAt,n)]}):(0,U.jsx)(`p`,{className:`mt-3 text-meta`,children:`The turn ended without a report.`})}var q=30,me={turn:`turn`,board:`board`,merge:`both kept`},he={turn:`Changed by a turn`,board:`Written by the board`,merge:`Both versions kept`};function ge(e){return e.status===`added`?`new`:e.status===`deleted`?`deleted`:e.added===null||e.removed===null?`binary`:`+${e.added} −${e.removed}`}function _e(e){return e.files.map(e=>`${e.path} ${ge(e)}`).join(`, `)}function ve(e){return e.startsWith(`@@`)||e.startsWith(`\\`)?`text-fg-muted`:e.startsWith(`+`)?`text-emerald-300`:e.startsWith(`-`)?`text-red-300`:`text-fg-tertiary`}function ye({file:e}){return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[e.path,e.status===`modified`?``:(0,U.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,e.status]})]}),e.patch===null?(0,U.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown.`}):e.patch===``?(0,U.jsx)(`p`,{className:`mt-1 text-meta`,children:`Empty.`}):(0,U.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,U.jsx)(`span`,{className:`block whitespace-pre-wrap break-words ${ve(e)}`,children:e===``?` `:e},t))}),e.truncated?(0,U.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}function be({name:e,change:t}){let n=v(e,t.commit,!0);return(0,U.jsxs)(`div`,{className:`space-y-3 px-4 pt-1 pb-3`,children:[(0,U.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,U.jsx)(c,{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,U.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,W(t.at)]})]}),n.data===void 0?(0,U.jsx)(`p`,{className:`text-meta`,children:n.isError?`Could not read the change.`:`Reading the change…`}):n.data.map(e=>(0,U.jsx)(ye,{file:e},e.path))]})}function xe({name:e,change:t,now:n}){let[r,i]=(0,H.useState)(!1),a=t.files.length===0?t.subject:_e(t);return(0,U.jsx)(`li`,{className:`border-b border-line/60 last:border-b-0`,children:(0,U.jsxs)(`details`,{className:`group`,onToggle:e=>i(e.currentTarget.open),children:[(0,U.jsx)(`summary`,{"aria-label":`${he[t.kind]} ${_(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,U.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:me[t.kind]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:a}),(0,U.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:_(t.at,n)}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]})}),r?(0,U.jsx)(be,{name:e,change:t}):null]})})}function Se({name:e}){let[t,n]=(0,H.useState)(q),r=p(e,t),i=y(3e4);if(r.data===void 0)return(0,U.jsx)(R,{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,U.jsxs)(R,{children:[e,`'s home has no history yet; it starts with the citizen's first turn.`]}):(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,U.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,U.jsx)(`ol`,{children:a.map(t=>(0,U.jsx)(xe,{name:e,change:t,now:i},t.commit))}),o?(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(t+q),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:`Show earlier changes`}):null]})}function J({title:e,children:t}){return(0,U.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,U.jsx)(`h3`,{className:`text-section`,children:e}),(0,U.jsx)(`div`,{className:`mt-2`,children:t})]})}function Ce({member:e,charter:t}){let n=m(e.name),r=d(e.name),i=f(e.name),a=y(3e4);return(0,U.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,U.jsxs)(J,{title:`Edits to reconcile`,children:[(0,U.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,U.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:i.data.map(e=>(0,U.jsxs)(`li`,{className:`text-sm`,children:[(0,U.jsx)(`span`,{className:`text-fg-primary`,children:e.file}),(0,U.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.path.slice(e.path.lastIndexOf(`/`)+1),` · left`,` `,_(e.since,a)]})]},e.path))})]}),(0,U.jsx)(J,{title:`Profile`,children:e.profile.trim()===``?(0,U.jsx)(`p`,{className:`text-meta`,children:`No profile yet. The citizen writes its own profile.md.`}):(0,U.jsx)(L,{text:V(e.profile,`Profile`)})}),(0,U.jsx)(J,{title:`Core memory`,children:n.data===void 0?(0,U.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.data.body.trim()===``?(0,U.jsx)(`p`,{className:`text-meta`,children:`Empty. Every turn loads this file in full.`}):(0,U.jsx)(L,{text:V(n.data.body,`Core memory`)})}),(0,U.jsx)(J,{title:`Own skills`,children:r.data===void 0?(0,U.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):r.data.length===0?(0,U.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,U.jsx)(`ul`,{className:`space-y-1.5`,children:r.data.map(e=>(0,U.jsxs)(`li`,{className:`text-sm`,children:[(0,U.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,U.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})}),t===void 0?null:(0,U.jsxs)(J,{title:`Charter of ${t.name}`,children:[(0,U.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:t.purpose}),(0,U.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,U.jsx)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:t.verbs.map(e=>(0,U.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 Y(e,t){let n=i(e,t?.turnId??null);return{turn:(0,H.useMemo)(()=>t===void 0||n.data===void 0?void 0:ee(n.data,e,t.project,t.thread),[t,n.data,e]),loading:t?.turnId!==void 0&&n.isPending,missing:t!==void 0&&(t.turnId===void 0||n.isError)}}var X=50;function we({name:e,entry:t,cli:n,now:r,opened:i}){let[a,o]=(0,H.useState)(i),s=(0,H.useRef)(null);(0,H.useEffect)(()=>{i&&s.current?.scrollIntoView({block:`start`})},[i]);let c=F(),l=se(t),u=t.thread===void 0?null:c.get(t.thread)?.title??`a thread`,d=t.error??t.summary??``,f=t.error===null?`text-fg-secondary`:`text-red-300`;return(0,U.jsx)(`li`,{ref:s,className:`border-b border-line/60 last:border-b-0`,children:(0,U.jsxs)(`details`,{className:`group`,open:a,onToggle:e=>o(e.currentTarget.open),children:[(0,U.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,U.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,U.jsxs)(`span`,{className:`min-w-0 truncate text-fg-secondary`,children:[B(t.project),u===null?``:` · ${u}`]}),(0,U.jsx)(`span`,{className:`text-fg-muted`,children:t.trigger}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-fg-muted`,children:[oe(t),` `,_(t.ts,r)]}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-fg-tertiary`,children:[l,t.toolCalls===void 0?null:`${t.toolCalls} tools`,ue(t,n)].filter(e=>e!==null).join(` · `)}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]}),d.trim()===``?null:(0,U.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-xs leading-relaxed group-open:hidden ${f}`,children:(0,U.jsx)(P,{text:d,links:!1})})]}),a?(0,U.jsx)(Te,{name:e,entry:t,text:d,tone:f}):null]})})}function Te({name:e,entry:t,text:n,tone:r}){let i=Y(e,t);return(0,U.jsxs)(`div`,{className:`px-4 pt-1 pb-3`,children:[n.trim()===``?null:(0,U.jsx)(`p`,{className:`text-xs leading-relaxed whitespace-pre-wrap ${r}`,children:(0,U.jsx)(P,{text:n})}),(0,U.jsx)(`div`,{className:`mt-2`,children:t.turnId===void 0?(0,U.jsx)(`p`,{className:`text-meta`,children:`This turn ran before turns kept their steps.`}):i.loading?(0,U.jsx)(`p`,{className:`text-meta`,children:`Reading the steps…`}):i.turn===void 0?(0,U.jsx)(`p`,{className:`text-meta`,children:`No steps were kept for this turn.`}):(0,U.jsxs)(U.Fragment,{children:[t.startedAt===void 0?null:(0,U.jsxs)(`p`,{className:`text-caps`,children:[`Started `,W(t.startedAt)]}),(0,U.jsx)(K,{steps:i.turn.steps})]})})]})}function Ee({name:e,cli:t,opened:n}){let[r,i]=(0,H.useState)(X),a=o(e,r),s=y(3e4);if(a.data===void 0)return(0,U.jsx)(R,{children:`Reading the turns…`});let c=a.data.toReversed();if(c.length===0)return(0,U.jsxs)(R,{children:[e,` has not finished a turn yet.`]});let l=ce(c),u=t===`codex`?`unmetered`:`$${l.costUsd.toFixed(2)}`;return(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,U.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,children:[l.turns===1?`1 turn`:`${l.turns} turns`,l.failed===0?``:`, ${l.failed} not completed`,` · `,u]}),n!==null&&!c.some(e=>e.turnId===n)?(0,U.jsx)(`p`,{className:`px-4 pb-1 text-meta`,children:a.data.length===r?`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,U.jsx)(`ol`,{children:c.map(r=>(0,U.jsx)(we,{name:e,entry:r,cli:t,now:s,opened:n!==null&&r.turnId===n},r.id))}),a.data.length===r?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(r+X),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show `,X,` earlier turns`]}):null]})}function De(e){return e===void 0?``:`${e.name}${e.id===null?``:` · ${e.id}`}`}function Z({label:e,choices:t,value:n,onChange:r}){let[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)([]),l=t.findIndex(e=>e.value===n);(0,H.useEffect)(()=>{if(!i)return;c.current[Math.max(l,0)]?.focus();let e=e=>{e.target instanceof Node&&o.current?.contains(e.target)===!0||a(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[i,l]);let u=e=>{if(e.key===`Escape`){e.stopPropagation(),a(!1),s.current?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=(c.current.findIndex(e=>e===document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length;c.current[n]?.focus()},d=t[l];return(0,U.jsxs)(`div`,{ref:o,className:`relative min-w-0 flex-1`,children:[(0,U.jsxs)(`button`,{ref:s,type:`button`,"aria-label":`${e}: ${De(d)}`,"aria-expanded":i,onClick:()=>a(!i),onKeyDown:i?u: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,U.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:[d?.name,d?.id===null||d===void 0?null:(0,U.jsxs)(`span`,{className:`text-fg-tertiary`,children:[` · `,d.id]})]}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`text-[10px] text-fg-muted transition-transform ${i?`rotate-180`:``}`,children:`▾`})]}),i?(0,U.jsx)(`div`,{className:`absolute inset-x-0 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,U.jsxs)(`button`,{ref:e=>{c.current[t]=e},type:`button`,"aria-current":i?`true`:void 0,onKeyDown:u,onClick:()=>{r(e.value),a(!1),s.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,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`span`,{className:`block truncate text-xs text-fg-secondary`,children:[e.name,e.id===null?null:(0,U.jsxs)(`span`,{className:`text-fg-tertiary`,children:[` · `,e.id]})]}),e.description===``?null:(0,U.jsx)(`span`,{className:`block truncate text-[11px] text-fg-muted`,children:e.description})]}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`w-3 shrink-0 pt-px text-[11px] text-fg-primary`,children:i?`✓`:``})]},e.value)})}):null]})}var Q=``;function Oe(e,t){return[{value:Q,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 ke({member:e,onDone:n}){let{api:i}=t(),a=r(),o=u(e.cli),s=e.model??Q,[c,l]=(0,H.useState)(s),d=I({mutationFn:()=>i.setModel(e.name,c===Q?null:c),onSuccess:()=>{a.invalidateQueries({queryKey:[`members`]}),n()}}),f=o.data??[],p=e.model!==void 0&&!f.some(t=>t.id===e.model)?e.model:null;return(0,U.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(),d.mutate()},children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.isPending?(0,U.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Asking `,e.cli,` for its models…`]}):o.error===null?(0,U.jsx)(Z,{label:`Model`,choices:Oe(f,p),value:c,onChange:l}):(0,U.jsxs)(`p`,{role:`alert`,className:`min-w-0 flex-1 truncate text-xs text-red-400`,children:[e.cli,` did not list its models:`,` `,o.error instanceof w?o.error.message:`the board server did not answer`]}),(0,U.jsx)(D,{onClick:n,children:`Cancel`}),(0,U.jsx)(D,{variant:`primary`,type:`submit`,disabled:d.isPending||c===s||o.error!==null,children:d.isPending?`Saving…`:`Use this model`})]}),(0,U.jsx)(z,{error:d.error})]})}var $=``;function Ae(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 je(e,t){return[{value:$,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:Ae(e,t)}))]}function Me({member:e,onDone:n}){let{api:i}=t(),a=r(),o=x(),s=e.homeRunner??$,[c,l]=(0,H.useState)(s),u=I({mutationFn:()=>i.setRunner(e.name,c===$?null:c),onSuccess:()=>{a.invalidateQueries({queryKey:[`members`]}),n()}});return(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.data===void 0?(0,U.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`Reading the runners…`}):(0,U.jsx)(Z,{label:`Runner`,choices:je(o.data,e),value:c,onChange:l}),(0,U.jsx)(D,{onClick:n,children:`Cancel`}),(0,U.jsx)(D,{variant:`primary`,type:`submit`,disabled:u.isPending||c===s,children:u.isPending?`Saving…`:`Run here`})]}),(0,U.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,U.jsx)(z,{error:u.error})]})}function Ne(e){return e.thread===void 0?{channel:e.channel??(e.scope===`society`?`general`:`${e.scope}/general`)}:{threadId:e.thread}}function Pe({name:e,turn:n}){let{api:i}=t(),a=r(),[o,s]=(0,H.useState)(!1),c=I({mutationFn:()=>i.stopTurn(n.turnId),onSuccess:()=>{s(!1),a.invalidateQueries({queryKey:[`scheduler`]})}});return(0,U.jsxs)(`div`,{className:`border-t border-line`,children:[(0,U.jsx)(ne,{target:Ne(n),initialText:`@${e} `,placeholder:n.steerable?`Message ${e} while it works`:`Message ${e} for its next turn`,className:`px-3 pt-3 pb-2`},n.turnId),n.stoppable?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-3`,children:[(0,U.jsx)(`p`,{className:`min-w-0 flex-1 text-[11px] leading-snug text-fg-muted`,children:o?`Ends the turn now. What it was shown counts as read; its stages stay held.`:n.steerable?`Posts reach the turn at its next step.`:`This runner delivers posts after the turn ends.`}),o?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(D,{onClick:()=>{s(!1),c.reset()},children:`Keep it running`}),(0,U.jsx)(D,{variant:`primary`,disabled:c.isPending,onClick:()=>{c.mutate()},children:c.isPending?`Stopping…`:`Stop the turn`})]}):(0,U.jsx)(D,{onClick:()=>s(!0),children:`Stop…`})]}):null,c.error===null?null:(0,U.jsx)(`div`,{className:`px-3 pb-3`,children:(0,U.jsx)(z,{error:c.error})})]})}function Fe({member:e,scopes:n,preferred:i,running:a,paused:o,onDone:s}){let{api:c}=t(),l=r(),[u,d]=(0,H.useState)(`manual`),[f,p]=(0,H.useState)(i!==null&&n.includes(i)?i:n[0]??``),[m,h]=(0,H.useState)(``),g=(0,H.useRef)(null);(0,H.useEffect)(()=>g.current?.focus(),[]);let _=I({mutationFn:()=>c.wake({agent:e.name,project:f,kind:u,...m.trim()===``?{}:{reason:m.trim()}}),onSuccess:()=>{l.invalidateQueries({queryKey:[`scheduler`]}),s()}}),v=B(f),y=u===`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=o?` The society is paused, so it waits until you resume.`:a.includes(f)?` ${e.name} is in a turn there now; this one follows it.`:``;return(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,U.jsx)(`legend`,{className:`sr-only`,children:`Kind of turn`}),[`manual`,`reflection`].map(e=>(0,U.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 ${u===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,U.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:u===e,onChange:()=>d(e),className:`sr-only`}),e===`manual`?`A turn`:`A reflection`]},e))]}),(0,U.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-xs text-fg-tertiary`,children:[`at`,(0,U.jsx)(`select`,{value:f,onChange:e=>p(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:n.map(e=>(0,U.jsx)(`option`,{value:e,children:B(e)},e))})]})]}),(0,U.jsx)(`textarea`,{ref:g,value:m,rows:2,placeholder:u===`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:`${ie} resize-none`}),(0,U.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[y,b,` Each turn costs money.`]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,U.jsx)(D,{onClick:s,children:`Cancel`}),(0,U.jsx)(D,{variant:`primary`,type:`submit`,disabled:_.isPending||f===``,children:_.isPending?`Waking…`:u===`reflection`?`Ask for a reflection`:`Wake ${e.name}`})]}),(0,U.jsx)(z,{error:_.error})]})}var Ie={working:`bg-emerald-500/15 text-emerald-300`,queued:`bg-amber-500/15 text-amber-300`,idle:`bg-surface-2 text-fg-tertiary`};function Le({project:e,name:t}){let n=(h(e).data??[]).filter(e=>e.status===`claimed`&&e.claimedBy===t);return n.length===0?null:(0,U.jsx)(`ul`,{className:`mt-1.5 space-y-1`,children:n.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(c,{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,U.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`◇`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,U.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-mono text-[11px] text-fg-muted`,children:b(e)?.name??e.stage})]})},e.id))})}function Re(){let{name:e}=T({from:`/citizen/$name`}),{scope:t,tab:n,turn:r}=C({from:`/citizen/$name`});return(0,U.jsx)(Be,{name:e,chosen:t??null,tab:n??`now`,turn:r??null},e)}var ze=[{tab:`now`,label:`Now`},{tab:`turns`,label:`Turns`},{tab:`memory`,label:`Memory`},{tab:`history`,label:`History`}];function Be({name:t,chosen:n,tab:r,turn:i}){let a=g(),o=e(),s=l(),u=A(),[d,f]=(0,H.useState)(null),p=a.data?.find(e=>e.name===t);if(p===void 0)return(0,U.jsx)(R,{children:a.data===void 0?`Reading the roster…`:`There is no citizen ${t}.`});let m=S(s.data?.running??[]).filter(e=>e.agent===t),h=[...new Set(m.map(e=>e.scope))],_=m.map(e=>O(e.agent,e.scope,e.thread)),v=S(s.data?.pending??[]).find(e=>e.agent===t),y=h.length>0?`working`:v===void 0?`idle`:`queued`,b=j(u,t)[0],x=b?.model??p.lastModel,C=x??p.model??`CLI default`,w=p.model!==void 0&&p.model!==x?p.model:null,T=o.data?.find(e=>e.name===p.role),k=le(p),M=p.status===`active`&&p.cli!==null;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(re,{leading:p.cli===null?null:(0,U.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-2/70`,children:(0,U.jsx)(E,{cli:p.cli,size:20})}),title:t,subtitle:(0,U.jsxs)(U.Fragment,{children:[p.role,` · `,C,w===null?``:` · set to ${w}`,p.homeRunner===void 0?``:` · on ${p.homeRunner}`,p.status===`retired`?` · retired`:``]}),trailing:(0,U.jsxs)(U.Fragment,{children:[M&&d===null?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(D,{onClick:()=>f(`model`),children:`Model…`}),(0,U.jsx)(D,{onClick:()=>f(`runner`),children:`Runner…`}),(0,U.jsx)(D,{onClick:()=>f(`wake`),children:`Wake…`})]}):null,(0,U.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${Ie[y]}`,children:y})]})}),d===`wake`?(0,U.jsx)(Fe,{member:p,scopes:k,preferred:n?.split(`/`)[0]??b?.scope??null,running:h,paused:s.data?.paused??!1,onDone:()=>f(null)}):d===`model`?(0,U.jsx)(ke,{member:p,onDone:()=>f(null)}):d===`runner`?(0,U.jsx)(Me,{member:p,onDone:()=>f(null)}):null,(0,U.jsx)(`nav`,{"aria-label":`Citizen views`,className:`flex gap-1 border-b border-line px-3 py-2`,children:ze.map(e=>(0,U.jsx)(c,{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,U.jsx)(Ee,{name:t,cli:p.cli,opened:i},i):r===`memory`?(0,U.jsx)(Ce,{member:p,charter:T}):r===`history`?(0,U.jsx)(Se,{name:t}):(0,U.jsx)(He,{name:t,chosen:n,lastTurnAt:p.lastTurnAt,state:y,runningScopes:h,runningKeys:_,runningTurns:(s.data?.turns??[]).filter(e=>e.agent===t),queuedScope:v?.scope??null})]})}function Ve(e){return e.toSorted((e,t)=>e.startedAt.localeCompare(t.startedAt))[0]}function He({name:e,chosen:t,lastTurnAt:n,state:r,runningScopes:i,runningKeys:a,runningTurns:s,queuedScope:l}){let u=A(),d=y(5e3),{ref:f,onScroll:p}=ae(),m=j(u,e),h=o(e,1),g=Y(e,m.length===0?h.data?.at(-1):void 0),v=F(),b=e=>e.end===null&&a.includes(O(e.agent,e.scope,e.thread)),x=t?.split(`/`)[0]??null,S=(t?.includes(`/`)===!0?m.find(e=>M(e)===t):void 0)??Ve(m.filter(e=>e.scope===x&&b(e)))??m.find(e=>M(e)===t)??Ve(m.filter(b))??m[0]??g.turn,C=e=>e.thread===void 0?B(e.scope):`${B(e.scope)} · ${v.get(e.thread)?.title??`a thread`}`,w=S!==void 0&&b(S),T=S?.scope??i[0]??l,E=(S===void 0?void 0:s.find(e=>e.scope===S.scope&&e.thread===S.thread))??(w?void 0:s[0]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{className:`border-b border-line px-4 py-3 text-xs text-fg-tertiary`,children:[(0,U.jsx)(`p`,{children:w?`In a turn at ${B(S.scope)} for ${S.fromStart?``:`at least `}${N(S.startedAt,d)}`:i.length>0?`In a turn at ${i.map(B).join(` and `)}`:l===null?n===void 0?`No turns yet`:`Last turn ${_(n,d)}`:`Queued for a turn at ${B(l)}`}),T===null||T===`society`?null:(0,U.jsx)(Le,{project:T,name:e})]}),(0,U.jsx)(`div`,{ref:f,onScroll:p,className:`flex-1 overflow-y-auto px-4 py-3`,children:S===void 0?(0,U.jsx)(R,{children:r===`working`?`The turn has not reported a step yet.`:g.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,U.jsxs)(U.Fragment,{children:[m.length>1?(0,U.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,"aria-label":`Turns by conversation`,children:m.toSorted((e,t)=>M(e).localeCompare(M(t))).map(t=>(0,U.jsxs)(c,{to:`/citizen/$name`,params:{name:e},search:{scope:M(t)},replace:!0,"aria-current":t===S?`true`:void 0,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] transition-colors ${t===S?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[b(t)?(0,U.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}):null,C(t)]},M(t)))}):null,(0,U.jsxs)(`p`,{className:`text-caps`,children:[w?`This turn`:`Last turn`,` · `,C(S),` · started`,` `,S.fromStart?W(S.startedAt):`before the earliest step shown`]}),S.fromStart?null:(0,U.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`Earlier steps of this turn are no longer in the server's live buffer`,w?``:`; Turns has the whole turn`,`.`]}),(0,U.jsx)(K,{steps:S.steps}),(0,U.jsx)(pe,{turn:S,running:w,now:d})]})}),E===void 0?null:(0,U.jsx)(Pe,{name:e,turn:E})]})}export{Re as CitizenView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn as e,Rt as t,T as n,m as r,y as i}from"./format-CRfcN5Lw.js";import{F as a,S as o}from"./index-Ch3gW4_Z.js";import{n as s,t as c}from"./Pane-DKfOLaXj.js";import{a as l,i as u}from"./citizen-BPzyDHNO.js";var d=e();function f(e){let t=e.lastModel??e.model??`CLI default`;return e.model!==void 0&&e.model!==t?`${t} · set to ${e.model}`:t}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 e=r(),h=n(),g=i();if(e.data===void 0)return(0,d.jsx)(s,{children:`Reading the roster…`});let _=e.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=a(h.data?.running??[]),S=a(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 n=w(e),r=f(e),i=e.memberships.length===0?`no projects`:e.memberships.join(`, `),a=u(e,C);return(0,d.jsx)(`li`,{className:`col-span-full grid grid-cols-subgrid`,children:(0,d.jsxs)(t,{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:r,children:r}),(0,d.jsx)(`span`,{className:`text-xs text-fg-muted`,title:a.detail,children:a.label}),(0,d.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:i,children:i}),(0,d.jsx)(`span`,{className:`text-right text-xs ${n.tone}`,title:n.detail,children:n.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn as e,Rt as t,ft as n,p as r,t as i,v as a,y as o}from"./format-CRfcN5Lw.js";import{R as s}from"./index-Ch3gW4_Z.js";import{t as c}from"./Markdown-Dc8gCFZz.js";import{n as l,t as u}from"./Pane-DKfOLaXj.js";var d=e(),f=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function p(){let{scope:e,topic:p}=s({from:`/knowledge/$scope/$topic`}),m=r(e),h=o(),g=a(3e4),_=e===n,v=_?`the society`:h.data?.find(t=>t.slug===e)?.name??e,y=m.data?.find(e=>e.topic===p),b=_?(0,d.jsx)(t,{to:`/society`,"aria-label":`Back to the society`,className:f,children:`←`}):(0,d.jsx)(t,{to:`/p/$slug`,params:{slug:e},"aria-label":`Back to ${v}`,className:f,children:`←`});return y===void 0?(0,d.jsx)(l,{children:m.data===void 0?`Reading…`:`${v} has no topic ${p}.`}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{leading:b,title:y.topic,subtitle:`Knowledge of ${v} · written by ${y.updatedBy} ${i(y.updatedAt,g)}`}),(0,d.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:(0,d.jsx)(c,{text:y.body})})]})}export{p as KnowledgeView};
|