@kubitnodes/stellaris 0.3.5 → 0.3.7

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.
Files changed (56) hide show
  1. package/dist/cli/index.js +139 -15
  2. package/dist/server/index.js +210 -31
  3. package/package.json +1 -1
  4. package/web/dist/assets/BackLink-BW0sb-M0.js +1 -0
  5. package/web/dist/assets/ChannelView-DmTE9aUA.js +1 -0
  6. package/web/dist/assets/CitizenView-lrA6vZDK.js +2 -0
  7. package/web/dist/assets/CitizensView-MRVffBnU.js +1 -0
  8. package/web/dist/assets/KnowledgeView-C2N-x5yS.js +1 -0
  9. package/web/dist/assets/{Markdown-MZnGPfvk.js → Markdown-CS3NCze-.js} +4 -4
  10. package/web/dist/assets/MessageItem-CL3XDi7l.js +1 -0
  11. package/web/dist/assets/MetricsView-CR5u5k5n.js +1 -0
  12. package/web/dist/assets/NeedsYouView-BwUvwyVt.js +1 -0
  13. package/web/dist/assets/Overview-DxFOFviB.js +1 -0
  14. package/web/dist/assets/{Pane-B-pz52UC.js → Pane-voa6GU0F.js} +1 -1
  15. package/web/dist/assets/ProjectView-BkNG_qdh.js +1 -0
  16. package/web/dist/assets/ProposalView-G89UmLF5.js +1 -0
  17. package/web/dist/assets/ProposalsView-CzpL-POB.js +1 -0
  18. package/web/dist/assets/RunnersView-SKNIDsjR.js +1 -0
  19. package/web/dist/assets/{SocietyView-DA_65uyo.js → SocietyView-CCFXEYZW.js} +1 -1
  20. package/web/dist/assets/SubjectThread-JQG2FxkA.js +1 -0
  21. package/web/dist/assets/TaskFileView-BKoGmHGz.js +4 -0
  22. package/web/dist/assets/TaskView-BIYqIFU4.js +1 -0
  23. package/web/dist/assets/TasksView-n2ssgQOL.js +1 -0
  24. package/web/dist/assets/ThreadCard-CzQXJXSd.js +1 -0
  25. package/web/dist/assets/{ThreadForms-BipMby65.js → ThreadForms-0LpUc2jJ.js} +1 -1
  26. package/web/dist/assets/ThreadView-_LgGISSH.js +1 -0
  27. package/web/dist/assets/citizen-DvJr6Ibu.js +1 -0
  28. package/web/dist/assets/format-C7bqWt6N.js +55 -0
  29. package/web/dist/assets/index-D4oCtkuZ.css +2 -0
  30. package/web/dist/assets/index-DM00hlle.js +23 -0
  31. package/web/dist/assets/{tasks-DnJj3psB.js → tasks-B4bx7Gg3.js} +1 -1
  32. package/web/dist/assets/{useStickyScroll-D_7q2RKi.js → useStickyScroll-DCsF4GYJ.js} +1 -1
  33. package/web/dist/index.html +4 -4
  34. package/web/dist/assets/BackLink-DivaHiZ7.js +0 -1
  35. package/web/dist/assets/ChannelView-DgkkiZuY.js +0 -1
  36. package/web/dist/assets/CitizenView-BzhH1ycF.js +0 -2
  37. package/web/dist/assets/CitizensView-BzGNyC2f.js +0 -1
  38. package/web/dist/assets/KnowledgeView-DedLlEZd.js +0 -1
  39. package/web/dist/assets/MessageItem-Deq-ntT8.js +0 -1
  40. package/web/dist/assets/MetricsView-C-2j71rI.js +0 -1
  41. package/web/dist/assets/NeedsYouView-D4xqHNDU.js +0 -1
  42. package/web/dist/assets/Overview-DxCYcW_A.js +0 -1
  43. package/web/dist/assets/ProjectView-BhZYFv7f.js +0 -1
  44. package/web/dist/assets/ProposalView-DAc9lEHB.js +0 -1
  45. package/web/dist/assets/ProposalsView-CmwwJuop.js +0 -1
  46. package/web/dist/assets/RunnersView-Dqo_BEoK.js +0 -1
  47. package/web/dist/assets/SubjectThread-M4F1paqV.js +0 -1
  48. package/web/dist/assets/TaskFileView-CCNVrooP.js +0 -4
  49. package/web/dist/assets/TaskView-BTSDk1yL.js +0 -1
  50. package/web/dist/assets/TasksView-0IQm6u-_.js +0 -1
  51. package/web/dist/assets/ThreadCard-BTGP4fOT.js +0 -1
  52. package/web/dist/assets/ThreadView-D96DZAOM.js +0 -1
  53. package/web/dist/assets/citizen-CYBzbWt-.js +0 -1
  54. package/web/dist/assets/format-11lojpK1.js +0 -55
  55. package/web/dist/assets/index-BXq4t0NA.js +0 -23
  56. package/web/dist/assets/index-CKjqsZME.css +0 -2
@@ -0,0 +1 @@
1
+ import{R as e,ln as t,r as n,t as r,v as i,y as a}from"./format-C7bqWt6N.js";import{B as o,R as s,b as c,d as l}from"./index-DM00hlle.js";import{n as u,t as d}from"./Pane-voa6GU0F.js";import{n as f}from"./Overview-DxFOFviB.js";var p=t(),m=[{window:`24h`,label:`24 hours`},{window:`7d`,label:`7 days`},{window:`all`,label:`All time`}],h={stage:`a stage to take`,mention:`a mention`,user_post:`your post`,heartbeat:`a heartbeat`,task_done:`a finished task`,proposal_decided:`a decided proposal`,ops_event:`a signal`,onboarding:`joining`,manual:`your wake`},g=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`});function _(e,t){return t===0?``:`${Math.round(e/t*100)}%`}function v(e){return e.toFixed(1).replace(/\.0$/,``)}function y({part:e,whole:t}){return(0,p.jsxs)(p.Fragment,{children:[e,(0,p.jsx)(`span`,{className:`ml-1.5 inline-block w-9 text-right text-fg-muted`,children:e===0?``:_(e,t)})]})}function b({children:e}){return(0,p.jsx)(`p`,{className:`text-sm text-fg-primary`,children:e})}function x({children:e}){return(0,p.jsx)(`p`,{className:`mt-1 text-meta`,children:e})}function S({label:e,columns:t,rows:n}){return n.length===0?null:(0,p.jsxs)(`table`,{"aria-label":e,className:`mt-3 w-full table-fixed text-sm`,children:[(0,p.jsxs)(`colgroup`,{children:[(0,p.jsx)(`col`,{}),t.slice(1).map(e=>(0,p.jsx)(`col`,{className:`w-24`},e))]}),(0,p.jsx)(`thead`,{children:(0,p.jsx)(`tr`,{children:t.map((e,t)=>(0,p.jsx)(`th`,{scope:`col`,className:`text-caps pb-1 font-normal ${t===0?`text-left`:`text-right`}`,children:e},e))})}),(0,p.jsx)(`tbody`,{children:n.map((e,t)=>(0,p.jsx)(`tr`,{className:`border-t border-line/50`,children:e.map((e,t)=>(0,p.jsx)(`td`,{className:`py-1.5 ${t===0?`pr-3 text-fg-primary`:`text-right text-fg-secondary tabular-nums`}`,children:e},t))},t))})]})}function C({name:e}){let t=l();return e===`user`?(0,p.jsx)(`span`,{children:t(e)}):(0,p.jsx)(s,{to:`/citizen/$name`,params:{name:e},className:`hover:underline`,children:e})}function w(e){return e.window===`24h`?1:e.window===`7d`?7:Math.max(1,e.decisions.byDay.length)}function T(){let{window:t=`7d`}=o({from:`/metrics`}),l=i(t),T=a(6e4),E=(0,p.jsx)(`nav`,{"aria-label":`Window`,className:`flex shrink-0 gap-1`,children:m.map(e=>(0,p.jsx)(s,{to:`/metrics`,search:{window:e.window},"aria-current":e.window===t?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${e.window===t?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:e.label},e.window))}),D=(0,p.jsx)(d,{title:`Metrics`,subtitle:`How the society works, counted from its event log`,trailing:E});if(l.data===void 0)return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsx)(u,{children:l.error instanceof e?l.error.message:`Counting the event log…`})]});let{idle:O,sentBack:k,messages:A,latency:j,decisions:M,blocked:N}=l.data,P=w(l.data);return(0,p.jsxs)(p.Fragment,{children:[D,(0,p.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,p.jsxs)(f,{title:`Turns that did nothing`,children:[O.turns===0?(0,p.jsx)(x,{children:`No finished turns in this window.`}):(0,p.jsxs)(b,{children:[O.idle,` of `,O.turns,` turns changed nothing on the board`,` `,(0,p.jsx)(`span`,{className:`text-fg-muted`,children:_(O.idle,O.turns)})]}),(0,p.jsxs)(x,{children:[`A turn that took no board action: no post, claim, handover, plan, proposal, decision, or knowledge. Reflections are left out, since they write memory.`,O.unknown>0?` ${O.unknown} ${O.unknown===1?`turn`:`turns`} kept no transcript and could not be counted.`:``]}),(0,p.jsx)(S,{label:`By what woke them`,columns:[`Woken by`,`Turns`,`Did nothing`],rows:O.byTrigger.map(e=>[h[e.trigger]??e.trigger,e.turns,(0,p.jsx)(y,{part:e.idle,whole:e.turns},`idle`)])}),(0,p.jsx)(S,{label:`By citizen`,columns:[`Citizen`,`Turns`,`Did nothing`],rows:O.byAgent.map(e=>[(0,p.jsxs)(`span`,{children:[(0,p.jsx)(C,{name:e.agent}),e.role===null?null:(0,p.jsxs)(`span`,{className:`text-meta`,children:[` · `,e.role]})]},`who`),e.turns,(0,p.jsx)(y,{part:e.idle,whole:e.turns},`idle`)])})]}),(0,p.jsxs)(f,{title:`Work sent back`,children:[k.finished===0?(0,p.jsx)(x,{children:`No task finished in this window.`}):(0,p.jsxs)(b,{children:[k.tasksSentBack,` of `,k.finished,` finished tasks were sent back,`,` `,k.sendBacks,` `,k.sendBacks===1?`time`:`times`,` in all`]}),(0,p.jsx)(S,{label:`Where work came back from`,columns:[`Came back from`,`Times`],rows:k.byStage.map(e=>[`${e.project} · ${e.stage}`,e.count])}),(0,p.jsx)(S,{label:`Who sent work back`,columns:[`Sent back by`,`Times`],rows:k.bySender.map(e=>[(0,p.jsx)(C,{name:e.agent},`who`),e.count])})]}),(0,p.jsxs)(f,{title:`Messages per finished task`,children:[A.finished===0?(0,p.jsx)(x,{children:`No task finished in this window.`}):(0,p.jsxs)(b,{children:[v(A.messages/A.finished),` posts a task, across`,` `,A.finished,` finished `,A.finished===1?`task`:`tasks`]}),(0,p.jsx)(x,{children:`Posts in each finished task's thread, handovers included, the board's own left out.`}),(0,p.jsx)(S,{label:`By project`,columns:[`Project`,`Tasks`,`Posts a task`],rows:A.byProject.map(e=>[e.project,e.finished,v(e.messages/e.finished)])}),(0,p.jsx)(S,{label:`Most talked-over tasks`,columns:[`Task`,`Posts`],rows:A.busiest.map(e=>[(0,p.jsx)(c,{kind:`task`,id:e.taskId,children:e.title},`task`),e.messages])})]}),(0,p.jsxs)(f,{title:`Wake latency`,children:[j.medianMs===null||j.slowestMs===null?(0,p.jsx)(x,{children:`No mention led to a turn in this window.`}):(0,p.jsxs)(b,{children:[n(j.medianMs),` from a mention to its turn, at the median; the slowest took`,` `,n(j.slowestMs)]}),(0,p.jsxs)(x,{children:[`From a post that mentions a citizen to the start of its turn in the same conversation, debounce included.`,j.unanswered>0?` ${j.unanswered} ${j.unanswered===1?`mention has`:`mentions have`} no turn yet.`:``]}),(0,p.jsx)(S,{label:`By citizen`,columns:[`Citizen`,`Mentions`,`Median`,`Slowest`],rows:j.byAgent.map(e=>[(0,p.jsx)(C,{name:e.agent},`who`),e.mentions,n(e.medianMs),n(e.slowestMs)])})]}),(0,p.jsxs)(f,{title:`Your decisions`,children:[M.total===0?(0,p.jsx)(x,{children:`You decided nothing in this window.`}):(0,p.jsxs)(b,{children:[M.total,` `,M.total===1?`decision`:`decisions`,`, about`,` `,v(M.total/P),` a day`]}),(0,p.jsx)(x,{children:`Proposals you decided, questions to you that you answered, and stages you passed or sent back.`}),(0,p.jsx)(S,{label:`By day`,columns:[`Day`,`Proposals`,`Answers`,`Stages`],rows:M.byDay.map(e=>[g.format(new Date(`${e.day}T00:00:00Z`)),e.proposals,e.answers,e.stages])})]}),(0,p.jsx)(f,{title:`Blocked on a capability`,children:N.length===0?(0,p.jsx)(x,{children:`No task waited for a capability no runner offers.`}):(0,p.jsx)(`ul`,{className:`space-y-2`,children:N.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(`p`,{className:`text-sm text-fg-primary`,children:[(0,p.jsx)(c,{kind:`task`,id:e.taskId,children:e.title??e.taskId}),(0,p.jsx)(`span`,{className:e.holds?`text-amber-300`:`text-fg-muted`,children:e.holds?` · blocked now`:` · cleared`})]}),(0,p.jsxs)(`p`,{className:`text-meta`,children:[e.summary,` · since `,r(e.firstAt,T)]})]},e.taskId))})})]})]})}export{T as MetricsView};
@@ -0,0 +1 @@
1
+ import{b as e,ln as t,n,t as r,y as i}from"./format-C7bqWt6N.js";import{E as a,R as o,d as s,j as c,x as l}from"./index-DM00hlle.js";import{n as u,t as d}from"./Pane-voa6GU0F.js";var f=t(),p=[{kind:`proposal`,label:`Proposals to decide`},{kind:`stage`,label:`Stages that name you`},{kind:`request`,label:`Asked of you`}],m=`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`;function h({title:e,meta:t}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-title block truncate`,children:e}),(0,f.jsx)(`span`,{className:`mt-1 block truncate text-meta`,children:t})]})}function g(){let t=a(),g=e(),_=i(3e4),v=s(),y=e=>g.data?.find(t=>t.slug===e)?.name??e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d,{title:`Needs you`,subtitle:t.length===0?`Nothing waits on you`:`${t.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.length===0?(0,f.jsx)(u,{children:`Nothing waits on you. Proposals you may decide, stages that name you, and questions citizens ask you with @user appear here until you answer where they asked.`}):p.map(({kind:e,label:i})=>{let a=t.filter(t=>t.kind===e);return a.length===0?null:(0,f.jsxs)(`section`,{className:`mb-3`,children:[(0,f.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[i,` · `,a.length]}),(0,f.jsx)(`ul`,{children:a.map(e=>{if(e.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(o,{to:`/proposal/$proposalId`,params:{proposalId:e.proposal.id},className:m,children:(0,f.jsx)(h,{title:c(e.proposal),meta:`proposed by ${v(e.proposal.proposedBy)} ${r(e.since,_)}`})})},e.proposal.id);if(e.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(o,{to:`/task/$taskId`,params:{taskId:e.task.id},className:m,children:(0,f.jsx)(h,{title:e.task.title,meta:`${e.stage.name}${e.stage.gate?` (gate)`:``} in ${y(e.task.project)} · waiting since ${r(e.since,_)}`})})},e.task.id);let t=`${v(e.message.author)} in ${e.thread===null?`#${e.message.channel}`:e.thread.title} ${r(e.since,_)}`,i=(0,f.jsx)(h,{title:(0,f.jsx)(l,{text:n(e.message.body,160),links:!1}),meta:t}),a=e.thread?.subject;return(0,f.jsx)(`li`,{children:a?.kind===`task`?(0,f.jsx)(o,{to:`/task/$taskId`,params:{taskId:a.id},className:m,children:i}):a?.kind===`proposal`?(0,f.jsx)(o,{to:`/proposal/$proposalId`,params:{proposalId:a.id},className:m,children:i}):e.thread===null?(0,f.jsx)(o,{to:`/c/$`,params:{_splat:e.message.channel},className:m,children:i}):(0,f.jsx)(o,{to:`/thread/$threadId`,params:{threadId:e.thread.id},className:m,children:i})},e.message.id)})})]},e)})})]})}export{g as NeedsYouView};
@@ -0,0 +1 @@
1
+ import{E as e,H as t,ln as n,n as r,t as i}from"./format-C7bqWt6N.js";import{R as a,T as o,x as s}from"./index-DM00hlle.js";import{i as c}from"./citizen-DvJr6Ibu.js";var l=n();function u({title:e,aside:t,children:n}){return(0,l.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,l.jsxs)(`h3`,{className:`flex items-baseline justify-between gap-2`,children:[(0,l.jsx)(`span`,{className:`text-section`,children:e}),t]}),(0,l.jsx)(`div`,{className:`mt-2`,children:n})]})}function d({members:n,scope:r}){let i=e(),s=t(i.data?.running??[]),u=t(i.data?.pending??[]);return n.length===0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Nobody yet.`}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:n.map(e=>{let t=s.filter(t=>t.agent===e.name).map(e=>e.scope),n=t.includes(r),i=u.some(t=>t.agent===e.name),d=n?`in a turn here`:t.length>0?`in a turn at ${t.map(c).join(` and `)}`:i?`queued`:`resting`;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(a,{to:`/citizen/$name`,params:{name:e.name},search:n&&r!==`society`?{scope:r}:{},className:`flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,l.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center`,children:e.cli===null?null:(0,l.jsx)(o,{cli:e.cli,size:13})}),(0,l.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:e.role}),(0,l.jsx)(`span`,{className:`shrink-0 text-xs ${t.length>0?`text-emerald-300`:i?`text-amber-300`:`text-fg-muted`}`,children:d})]})},e.name)})})}function f({scope:e,topics:t,now:n}){return t===void 0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):t.length===0?(0,l.jsxs)(`p`,{className:`text-meta`,children:[`No knowledge yet. `,e===`society`?`The steward and you`:`Members`,` write it with write_knowledge.`]}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:t.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).map(t=>(0,l.jsx)(`li`,{children:(0,l.jsxs)(a,{to:`/knowledge/$scope/$topic`,params:{scope:e,topic:t.topic},className:`block rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-2/50`,children:[(0,l.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-sm text-fg-primary`,children:t.topic}),(0,l.jsxs)(`span`,{className:`text-meta`,children:[`by `,t.updatedBy,` `,i(t.updatedAt,n)]})]}),(0,l.jsx)(`span`,{className:`mt-0.5 line-clamp-2 block text-sm leading-relaxed text-fg-secondary`,children:(0,l.jsx)(s,{text:r(t.body,240),links:!1})})]})},t.topic))})}export{u as n,f as r,d as t};
@@ -1 +1 @@
1
- import{_n as e}from"./format-11lojpK1.js";var t=e();function n({title:e,subtitle:n,leading:r,trailing:i}){return(0,t.jsxs)(`header`,{className:`flex items-center gap-3 border-b border-line px-4 py-3`,children:[r,(0,t.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,t.jsx)(`h2`,{className:`text-heading truncate`,children:e}),n===void 0?null:(0,t.jsx)(`p`,{className:`truncate text-meta`,children:n})]}),i]})}function r({children:e}){return(0,t.jsx)(`p`,{className:`px-4 py-10 text-center text-meta`,"aria-live":`polite`,children:e})}export{r as n,n as t};
1
+ import{ln as e}from"./format-C7bqWt6N.js";var t=e();function n({title:e,subtitle:n,leading:r,trailing:i}){return(0,t.jsxs)(`header`,{className:`flex items-center gap-3 border-b border-line px-4 py-3`,children:[r,(0,t.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,t.jsx)(`h2`,{className:`text-heading truncate`,children:e}),n===void 0?null:(0,t.jsx)(`p`,{className:`truncate text-meta`,children:n})]}),i]})}function r({children:e}){return(0,t.jsx)(`p`,{className:`px-4 py-10 text-center text-meta`,"aria-live":`polite`,children:e})}export{r as n,n as t};
@@ -0,0 +1 @@
1
+ import{P as e,b as t,c as n,g as r,l as i,ln as a,m as o,t as s,y as c}from"./format-C7bqWt6N.js";import{i as l,t as u}from"./tasks-B4bx7Gg3.js";import{R as d,V as f}from"./index-DM00hlle.js";import{t as p}from"./Markdown-CS3NCze-.js";import{n as m,t as h}from"./Pane-voa6GU0F.js";import{n as g,r as _,t as v}from"./Overview-DxFOFviB.js";var y=a();function b(){let{slug:a}=f({from:`/p/$slug`}),b=t(),x=n(),S=r(),C=e(a),w=i(a),T=o(a),E=c(3e4),D=b.data?.find(e=>e.slug===a);if(D===void 0)return(0,y.jsx)(m,{children:b.data===void 0?`Reading the project…`:`There is no project ${a}.`});let O=(S.data??[]).filter(e=>e.status===`active`&&D.members.includes(e.name)),k=l(C.data??[]),A=w.data?.body.trim()??``;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(h,{title:D.name,subtitle:`${a} · ${D.repo??`a local repository`} · ${D.defaultBranch}`,trailing:(0,y.jsx)(d,{to:`/p/$slug/tasks`,params:{slug:a},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Tasks →`})}),(0,y.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[D.archived===void 0?null:(0,y.jsxs)(`p`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-sm text-fg-secondary`,children:[`Archived `,s(D.archived.at,E),` by `,D.archived.by,`:`,` `,D.archived.reason,`. Its channels, tasks, and history stay readable here; nothing more is posted, filed, or joined.`]}),D.archived===void 0?null:(0,y.jsx)(g,{title:`Channels`,children:(0,y.jsx)(`ul`,{className:`space-y-1`,children:(x.data??[]).filter(e=>e.project===a).map(e=>(0,y.jsxs)(`li`,{children:[(0,y.jsxs)(d,{to:`/c/$`,params:{_splat:e.ref},className:`text-sm text-fg-secondary hover:text-fg-primary`,children:[`# `,e.name]}),(0,y.jsxs)(`span`,{className:`text-meta`,children:[` · `,e.messages,` messages`]})]},e.ref))})}),(0,y.jsx)(g,{title:`Members`,children:(0,y.jsx)(v,{members:O,scope:a})}),(0,y.jsx)(g,{title:`Tasks`,children:C.data===void 0?(0,y.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):k.length===0?(0,y.jsx)(`p`,{className:`text-meta`,children:`No tasks yet.`}):(0,y.jsx)(d,{to:`/p/$slug/tasks`,params:{slug:a},className:`flex flex-wrap gap-1.5`,children:k.map(e=>(0,y.jsxs)(`span`,{className:`rounded-md bg-surface-2/60 px-2 py-0.5 text-xs text-fg-secondary`,children:[e.tasks.length,` `,u.find(t=>t.phase===e.phase)?.label.toLowerCase()]},e.phase))})}),(0,y.jsx)(g,{title:`How a task ends`,children:(0,y.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:D.onDone===`merge`?`When its last stage is done, the board merges task/<id> onto ${D.defaultBranch}.`:`When its last stage is done, it is done; nothing is merged.`})}),(0,y.jsx)(g,{title:`Dashboard`,children:w.data===void 0?(0,y.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):A===``?(0,y.jsx)(`p`,{className:`text-meta`,children:`Empty. Agents on the server's machine may edit it.`}):(0,y.jsx)(p,{text:A})}),(0,y.jsx)(g,{title:`Knowledge`,children:(0,y.jsx)(_,{scope:a,topics:T.data,now:E})})]})]})}export{b as ProjectView};
@@ -0,0 +1 @@
1
+ import{D as e,F as t,P as n,R as r,St as i,at as a,b as o,bt as s,cn as c,et as l,g as u,gt as d,it as f,k as p,ln as m,nt as h,pn as g,st as _,t as v,tt as y,un as b,vt as x,w as S,x as C,y as w,yt as T}from"./format-C7bqWt6N.js";import{a as ee}from"./tasks-B4bx7Gg3.js";import{F as te,H as ne,M as re,N as E,O as D,P as O,R as k,T as A,V as j,c as M,d as N,i as P,j as F,k as I,u as L}from"./index-DM00hlle.js";import{t as R}from"./Markdown-CS3NCze-.js";import{n as z,t as B}from"./Pane-voa6GU0F.js";import{n as V,r as ie}from"./ThreadForms-0LpUc2jJ.js";import{t as H}from"./BackLink-BW0sb-M0.js";import{StatusChip as U}from"./ProposalsView-CzpL-POB.js";import{t as W}from"./SubjectThread-JQG2FxkA.js";var G=g(b(),1),K=m();function q({proposal:t,consequence:n}){let{api:r}=e(),i=c(),a=u(),[o,s]=(0,G.useState)(null),[l,d]=(0,G.useState)(``),f=(0,G.useRef)(null);(0,G.useEffect)(()=>{o!==null&&f.current?.focus()},[o]);let p=ne({mutationFn:()=>{let e=l.trim();return o===`reject`?r.reject({proposal_id:t.id,reason:e}):r.approve({proposal_id:t.id,...e===``?{}:{reason:e}})},onSuccess:()=>{let e=[[`proposals`],[`proposal`,t.id],[`threads`],[`thread`,t.id]];for(let t of e)i.invalidateQueries({queryKey:t});s(null),d(``)}}),m=(a.data??[]).find(e=>e.name===t.proposedBy&&e.status===`active`&&e.cli!==null),h=m===void 0?`Your decision is posted in the proposal's thread, which closes.`:`Your decision is posted in the proposal's thread, which closes, and wakes ${m.name}, who proposed it.`;if(o===null)return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-4 py-3`,children:[(0,K.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`This proposal waits on you.`}),(0,K.jsx)(M,{onClick:()=>s(`reject`),children:`Reject`}),(0,K.jsx)(M,{variant:`primary`,onClick:()=>s(`approve`),children:`Approve`})]});let g=o===`approve`;return(0,K.jsxs)(`form`,{"aria-label":g?`Approve the proposal`:`Reject the proposal`,className:`space-y-2 border-t border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),p.mutate()},children:[(0,K.jsx)(`textarea`,{ref:f,value:l,rows:2,placeholder:g?`Why approve? Optional.`:`Why not? It is posted with the decision.`,"aria-label":g?`Reason for approving`:`Reason for rejecting`,onChange:e=>d(e.target.value),className:`${V} resize-none`}),(0,K.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[g?n:`Nothing is created, and the proposal's thread closes.`,` `,h]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,K.jsx)(M,{onClick:()=>{s(null),p.reset()},children:`Cancel`}),(0,K.jsx)(M,{variant:`primary`,type:`submit`,disabled:p.isPending||!g&&l.trim()===``,children:p.isPending?`Deciding…`:g?`Confirm approval`:`Confirm rejection`})]}),(0,K.jsx)(ie,{error:p.error})]})}function J({children:e}){return(0,K.jsx)(`dl`,{className:`mt-2 space-y-1.5`,children:e})}function Y({label:e,children:t}){return(0,K.jsxs)(`div`,{className:`grid grid-cols-[9rem_1fr] gap-3 text-sm`,children:[(0,K.jsx)(`dt`,{className:`text-meta`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0 break-words text-fg-secondary`,children:t})]})}function X(e){return e.length===0?`none`:e.join(`, `)}function Z({name:e,change:t}){return(0,K.jsxs)(`span`,{className:`inline-block rounded-md px-1.5 py-px font-mono text-[11px] ${t===`added`?`bg-emerald-500/15 text-emerald-300`:t===`removed`?`bg-red-500/15 text-red-300 line-through`:`bg-surface-2/70 text-fg-tertiary`}`,children:[t===`added`?`+ `:t===`removed`?`− `:``,e]})}function Q({children:e}){return(0,K.jsx)(`div`,{className:`mt-2 rounded-xl bg-surface-2/30 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:e})}function ae({next:e,current:t,compare:n}){let r=t===void 0?null:E(t,e),i=r!==null&&r.verbsAdded.length===0&&r.verbsRemoved.length===0&&r.changes.length===0&&!r.purposeChanged;return(0,K.jsxs)(K.Fragment,{children:[n?r===null?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:`A new role: no charter by this name exists yet.`}):i?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:`The same as the charter the role has now.`}):(0,K.jsxs)(Q,{children:[(0,K.jsx)(`p`,{className:`text-caps`,children:`Against the charter it has now`}),r.verbsAdded.length+r.verbsRemoved.length===0?null:(0,K.jsxs)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:[r.verbsAdded.map(e=>(0,K.jsx)(Z,{name:e,change:`added`},e)),r.verbsRemoved.map(e=>(0,K.jsx)(Z,{name:e,change:`removed`},e))]}),r.changes.length===0?null:(0,K.jsx)(J,{children:r.changes.map(e=>(0,K.jsxs)(Y,{label:e.field,children:[e.from,` → `,(0,K.jsx)(`span`,{className:`text-fg-primary`,children:e.to})]},e.field))}),r.purposeChanged?(0,K.jsx)(`p`,{className:`mt-2 text-xs text-fg-secondary`,children:`The purpose is rewritten.`}):null]}):null,(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Role`,children:e.name}),(0,K.jsx)(Y,{label:`Purpose`,children:e.purpose}),(0,K.jsx)(Y,{label:`Verbs`,children:(0,K.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.verbs.map(e=>(0,K.jsx)(Z,{name:e},e))})}),(0,K.jsx)(Y,{label:`Wake triggers`,children:X(e.wakeTriggers)}),(0,K.jsx)(Y,{label:`Replicas per project`,children:e.maxReplicas}),(0,K.jsx)(Y,{label:`Warm session`,children:e.resident?`yes`:`no`}),(0,K.jsx)(Y,{label:`Society role`,children:e.societyScope?`yes, in no project`:`no`}),(0,K.jsx)(Y,{label:`Reflects`,children:e.reflects?`yes`:`no`})]})]})}function oe({proposal:e,slug:t,reason:r,members:i}){let a=o(),s=n(t),c=a.data?.find(e=>e.slug===t),l=e.status===`proposed`,u=l?(i??[]).filter(e=>e.status===`active`&&e.memberships.includes(t)).map(e=>e.name):e.provision?.members??[],d=(s.data??[]).filter(ee).length;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Project`,children:[(0,K.jsx)(k,{to:`/p/$slug`,params:{slug:t},className:`hover:text-fg-primary`,children:c?.name??t}),c?.name===void 0||c.name===t?null:` · ${t}`]}),(0,K.jsx)(Y,{label:l?`Members who leave`:`Members who left`,children:Array.isArray(u)?X(u.filter(e=>typeof e==`string`)):`none`}),l?(0,K.jsx)(Y,{label:`Tasks in play`,children:s.data===void 0?`reading…`:d===0?`none`:`${d}: approval is refused until they are done, abandoned, or filed elsewhere`}):null,(0,K.jsx)(Y,{label:`Reason`,children:r}),(0,K.jsx)(Y,{label:`After`,children:`Its open threads close and nothing more is posted, filed, or joined there; its channels, tasks, repository, and history stay readable.`})]})}function se({proposal:e,roles:t,members:n}){let r=e.status===`proposed`,{charter:i}=e;switch(e.kind){case`member`:{let e=h.safeParse(i);if(!e.success)break;let t=e.data;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Citizen`,children:(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(A,{cli:t.cli,size:13}),t.name]})}),(0,K.jsx)(Y,{label:`Role`,children:t.role}),(0,K.jsxs)(Y,{label:`CLI and model`,children:[t.cli,` · `,t.model??`cli default`]}),(0,K.jsx)(Y,{label:`Projects`,children:X(t.memberships)}),(0,K.jsx)(Y,{label:`Also follows`,children:X(t.subscriptions)}),t.homeRunner===void 0?null:(0,K.jsx)(Y,{label:`Runs on`,children:t.homeRunner})]}),t.seedInstructions===void 0?null:(0,K.jsxs)(Q,{children:[(0,K.jsx)(`p`,{className:`text-caps`,children:`Seed instructions`}),(0,K.jsx)(`div`,{className:`mt-1.5`,children:(0,K.jsx)(R,{text:t.seedInstructions})})]})]})}case`role`:{let n=re(e);if(n===null)break;return(0,K.jsx)(ae,{next:n,current:t?.find(e=>e.name===n.name),compare:r})}case`skill`:{let e=_.safeParse(i);if(!e.success)break;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Skill`,children:e.data.name}),(0,K.jsx)(Y,{label:`Summary`,children:e.data.summary})]}),(0,K.jsx)(Q,{children:(0,K.jsx)(R,{text:O(e.data.body)})})]})}case`channel`:{let e=y.safeParse(i);if(!e.success)break;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Channel`,children:[`#`,d(e.data.project,e.data.name)]}),(0,K.jsx)(Y,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=a.safeParse(i);if(!e.success)break;let t=n?.find(t=>t.name===e.data.agent);return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Citizen`,children:[(0,K.jsx)(L,{name:e.data.agent,members:n}),t===void 0?null:` · ${t.role}`]}),(0,K.jsx)(Y,{label:`Holds now`,children:t===void 0?`unknown`:t.claimsHeld===1?`1 stage`:`${t.claimsHeld} stages`}),(0,K.jsx)(Y,{label:`Reason`,children:e.data.reason})]})}case`archive`:{let t=l.safeParse(i);if(!t.success)break;return(0,K.jsx)(oe,{proposal:e,slug:t.data.project,reason:t.data.reason,members:n})}case`reallocation`:{let e=f.safeParse(i);if(!e.success)break;return(0,K.jsx)(J,{children:(0,K.jsx)(Y,{label:`Reallocation`,children:e.data.description})})}}return(0,K.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-lg bg-surface-2/40 p-3 font-mono text-[11px] text-fg-tertiary`,children:JSON.stringify(i,null,2)})}var ce=s({agent:i().optional(),channel:i().optional(),role:i().optional(),skill:i().optional(),replaced:T().optional(),releasedTasks:x(i()).optional(),project:i().optional()});function le({proposal:e}){let t=ce.safeParse(e.provision??{});if(e.provision===void 0||!t.success)return null;let n=t.data,r=`text-fg-primary underline decoration-fg-muted underline-offset-2`;if(e.kind===`member`&&n.agent!==void 0)return(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,K.jsx)(k,{to:`/citizen/$name`,params:{name:n.agent},className:r,children:n.agent}),`.`]});if(e.kind===`channel`&&n.channel!==void 0)return(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,K.jsxs)(k,{to:`/c/$`,params:{_splat:n.channel},className:r,children:[`#`,n.channel]}),`.`]});if(e.kind===`retirement`&&n.agent!==void 0){let e=n.releasedTasks?.length??0;return(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Retired `,n.agent,`; `,e===1?`1 stage went`:`${e} stages went`,` back to open.`]})}return e.kind===`archive`&&n.project!==void 0?(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Archived`,` `,(0,K.jsx)(k,{to:`/p/$slug`,params:{slug:n.project},className:r,children:n.project}),`; its members left and its threads closed.`]}):n.role===void 0?n.skill===void 0?null:(0,K.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Replaced`:`Published`,` the society's skill `,n.skill,`.`]}):(0,K.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Rewrote`:`Added`,` the role `,n.role,`.`]})}function $(){let{proposalId:e}=j({from:`/proposal/$proposalId`}),n=C(e),i=u(),a=S(),o=p(),s=t(),c=w(3e4),l=N();if(n.data===void 0)return(0,K.jsx)(z,{children:n.error instanceof r&&n.error.status===404?`There is no proposal ${e}.`:`Reading the proposal…`});let d=n.data,f=d.status===`proposed`,m=i.data?.find(e=>e.name===d.proposedBy)?.role,h=s.data?.find(e=>e.id===d.id),g=d.status===`rejected`?`Rejected`:`Approved`,_=D(d,{members:i.data??[],roles:a.data??[],skills:o.data??[]});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(B,{leading:(0,K.jsx)(H,{fallback:(0,K.jsx)(k,{to:`/proposals`,"aria-label":`Back to the proposals`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:F(d),subtitle:`${d.kind} proposal by ${l(d.proposedBy)} ${v(d.createdAt,c)}${f?` · for ${I(d,m)} to decide`:``}`,trailing:(0,K.jsx)(U,{status:d.status})}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[f?(0,K.jsxs)(`p`,{className:`rounded-lg bg-sky-400/10 px-3 py-2 text-xs leading-relaxed text-sky-200`,children:[`If approved: `,_]}):(0,K.jsxs)(`div`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-xs leading-relaxed text-fg-secondary`,children:[(0,K.jsxs)(`p`,{children:[g,` by `,l(d.decidedBy??`someone`),d.decidedAt===void 0?``:` ${v(d.decidedAt,c)}`,d.reason===void 0?`.`:`: ${d.reason}`]}),(0,K.jsx)(le,{proposal:d})]}),d.body.trim()===``||h!==void 0?null:(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:`Why`}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(R,{text:d.body})})]}),(0,K.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:f?`What it would make`:d.status===`provisioned`?`What it made`:`What it proposed`}),(0,K.jsx)(se,{proposal:d,roles:a.data,members:i.data})]}),(0,K.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:`Thread`}),h===void 0?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:s.data===void 0?`Reading the thread…`:`This proposal is older than proposal threads; its thread opens when it is decided.`}):(0,K.jsx)(W,{thread:h,now:c,empty:`Nothing said yet. The pitch and the decision are posted here.`})]})]}),h?.state===`open`?(0,K.jsx)(P,{target:{threadId:d.id},placeholder:`Write in the proposal's thread`}):null,te(d)?(0,K.jsx)(q,{proposal:d,consequence:_}):null]})}export{$ as ProposalView};
@@ -0,0 +1 @@
1
+ import{S as e,ln as t,pn as n,t as r,un as i,y as a}from"./format-C7bqWt6N.js";import{A as o,D as s,R as c,d as l,j as u}from"./index-DM00hlle.js";import{n as d,t as f}from"./Pane-voa6GU0F.js";var p=n(i(),1),m=t(),h=8,g={proposed:`bg-amber-500/15 text-amber-300`,approved:`bg-emerald-500/15 text-emerald-300`,provisioned:`bg-emerald-500/15 text-emerald-300`,rejected:`bg-red-500/15 text-red-300`,retired:`bg-surface-2 text-fg-muted`};function _({status:e}){return(0,m.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${g[e]}`,children:e===`provisioned`?`approved`:e})}function v({proposal:e,now:t}){let n=l(),i=e.decidedBy===void 0||e.decidedAt===void 0?``:` · ${e.status===`rejected`?`rejected`:`approved`} by ${n(e.decidedBy)} ${r(e.decidedAt,t)}`;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(c,{to:`/proposal/$proposalId`,params:{proposalId:e.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:u(e)}),(0,m.jsx)(_,{status:e.status})]}),(0,m.jsxs)(`p`,{className:`mt-1 truncate text-meta`,children:[`proposed by `,n(e.proposedBy),` `,r(e.createdAt,t),i]})]})})}function y(){let t=e(),n=a(3e4),[r,i]=(0,p.useState)(!1),c=o(t.data??[]),l=c.find(e=>e.group===`yours`)?.proposals.length??0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(f,{title:`Proposals`,subtitle:`${l===0?`nothing`:l} waiting on you · ${t.data?.length??0} in all`}),(0,m.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.data===void 0?(0,m.jsx)(d,{children:`Reading the proposals…`}):c.length===0?(0,m.jsx)(d,{children:`No proposals yet. Citizens propose roles, members, channels, and skills.`}):c.map(e=>{let t=e.group===`decided`&&!r?e.proposals.slice(0,h):e.proposals;return(0,m.jsxs)(`section`,{className:`mb-3`,children:[(0,m.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[s.find(t=>t.group===e.group)?.label,` ·`,` `,e.proposals.length]}),(0,m.jsx)(`ul`,{children:t.map(e=>(0,m.jsx)(v,{proposal:e,now:n},e.id))}),t.length<e.proposals.length?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.proposals.length]}):null]},e.group)})})]})}export{y as ProposalsView,_ as StatusChip};
@@ -0,0 +1 @@
1
+ import{D as e,T as t,b as n,cn as r,ln as i,pn as a,t as o,u as s,un as c,y as l}from"./format-C7bqWt6N.js";import{B as u,H as d,T as f,c as p}from"./index-DM00hlle.js";import{n as m,t as h}from"./Pane-voa6GU0F.js";import{n as g,r as _}from"./ThreadForms-0LpUc2jJ.js";var v=a(c(),1);function y(e){return e.toUpperCase().replaceAll(/[^A-Z0-9]/g,``)}function b(e,t){return y(e)===y(t)}function x(e,t){let n=(e.split(`.`)[0]??``).toLowerCase().replaceAll(/[^a-z0-9-]+/g,`-`).replaceAll(/-+/g,`-`).replace(/^-+/,``).slice(0,32).replace(/-+$/,``)||`runner`;if(!t.includes(n))return n;for(let e=2;;e+=1){let r=`-${e}`,i=`${n.slice(0,32-r.length)}${r}`;if(!t.includes(i))return i}}var S=i();function C(e,t){return Number(e.status!==`connected`)-Number(t.status!==`connected`)||e.name.localeCompare(t.name)}function w(e,t){return[e.length===0?`no CLI`:e.join(`, `),...t].join(` · `)}function T({enrollment:t,taken:n,followed:i,now:a}){let{api:s}=e(),c=r(),[l,u]=(0,v.useState)(()=>x(t.hostname,n)),f=()=>{c.invalidateQueries({queryKey:[`enrollments`]}),c.invalidateQueries({queryKey:[`runners`]})},m=d({mutationFn:()=>s.approveEnrollment(t.userCode,l.trim()),onSuccess:f}),h=d({mutationFn:()=>s.denyEnrollment(t.userCode),onSuccess:f}),y=m.isPending||h.isPending;return(0,S.jsxs)(`li`,{className:`rounded-xl border px-3 py-3 ${i?`border-amber-500/40 bg-amber-500/5`:`border-line`}`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-fg-primary`,children:t.hostname}),(0,S.jsx)(`code`,{className:`shrink-0 font-mono text-sm text-fg-primary`,children:t.userCode})]}),(0,S.jsxs)(`p`,{className:`mt-0.5 truncate text-meta`,children:[t.os,` · `,w(t.clis,t.capabilities),` · runner`,` `,t.version,` · asked `,o(t.requestedAt,a)]}),(0,S.jsxs)(`form`,{"aria-label":`Approve ${t.hostname}`,className:`mt-2.5 flex items-center gap-2`,onSubmit:e=>{e.preventDefault(),m.mutate()},children:[(0,S.jsx)(`input`,{value:l,maxLength:32,spellCheck:!1,"aria-label":`Runner name`,onChange:e=>u(e.target.value),className:`${g} min-w-0 flex-1 font-mono`}),(0,S.jsx)(p,{onClick:()=>h.mutate(),disabled:y,children:`Deny`}),(0,S.jsx)(p,{variant:`primary`,type:`submit`,disabled:y||l.trim()===``,children:m.isPending?`Approving…`:`Approve`})]}),(0,S.jsx)(`div`,{className:`mt-1.5`,children:(0,S.jsx)(_,{error:m.error??h.error})})]})}function E(){let{code:e}=u({from:`/runners`}),r=s(),i=t(),a=n(),c=l(3e4),d=r.data??[],p=(i.data??[]).map(e=>e.name),g=(i.data??[]).toSorted(C),_=g.filter(e=>e.status===`connected`).length,v=g.length-_,y=e===void 0?void 0:d.find(t=>b(t.userCode,e)),x=y===void 0?d:[y,...d.filter(e=>e!==y)],w=e=>(a.data??[]).filter(t=>t.runner===e.name&&t.archived===void 0).map(e=>e.slug);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(h,{title:`Runners`,subtitle:[`${_} connected`,...v===0?[]:[`${v} away`],...d.length===0?[]:[`${d.length} waiting for approval`]].join(` · `)}),(0,S.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[e!==void 0&&r.data!==void 0&&y===void 0?(0,S.jsxs)(`output`,{className:`block px-2 pb-2 text-meta`,children:[`No runner waits with the code `,e,`. It may have been approved, denied, or expired; a runner whose code expired asks again with a new one.`]}):null,x.length===0?null:(0,S.jsx)(`ul`,{"aria-label":`Waiting for approval`,className:`space-y-2 px-2 pb-3`,children:x.map(e=>(0,S.jsx)(T,{enrollment:e,taken:p,followed:e===y,now:c},e.userCode))}),i.data===void 0?(0,S.jsx)(m,{children:`Reading the runners…`}):g.length===0?(0,S.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No runners yet.`}):null,(0,S.jsx)(`ul`,{"aria-label":`Registered`,className:`grid grid-cols-[auto_auto_auto_minmax(0,max-content)_minmax(3rem,1fr)_auto] gap-x-3`,children:g.map(e=>{let t=e.clis.length===0?`no CLI`:e.clis.join(`, `),n=w(e),r=n.length===0?`no projects`:n.join(`, `),i=e.status===`connected`?{label:`connected`,detail:`connected`,tone:`text-fg-muted`}:{label:`away`,detail:`away${e.lastSeen===void 0?``:`, last seen ${o(e.lastSeen,c)}`}`,tone:`text-amber-300`};return(0,S.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,title:t,children:[e.clis.map(e=>(0,S.jsx)(f,{cli:e,size:13},e)),(0,S.jsx)(`span`,{className:`sr-only`,children:t})]}),(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,S.jsx)(`span`,{className:`text-fg-secondary`,children:e.os}),(0,S.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:e.capabilities.join(`, `),children:e.capabilities.join(`, `)}),(0,S.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:r,children:r}),(0,S.jsx)(`span`,{className:`text-right text-xs ${i.tone}`,title:i.detail,children:i.label})]},e.name)})}),r.data===void 0||d.length>0?null:(0,S.jsx)(`p`,{className:`mt-2 border-t border-line px-2 pt-2 text-meta`,children:`A runner started with STELLARIS_SERVER_URL set to this board and no token asks to join here, with a code to approve.`})]})]})}export{E as RunnersView};
@@ -1 +1 @@
1
- import{A as e,_n as t,at as n,b as r,h as i,k as a,mt as o,p as s,w as c,y as l}from"./format-11lojpK1.js";import{n as u,t as d}from"./Pane-B-pz52UC.js";import{n as f,r as p,t as m}from"./Overview-DxCYcW_A.js";var h=t();function g(){let t=e(),g=i(),_=r(),v=c(),y=a(),b=s(n),x=l(3e4);if(t.data===void 0||g.data===void 0)return(0,h.jsx)(u,{children:`Reading the society…`});let S=g.data.filter(e=>e.cli!==null),C=S.filter(e=>e.status===`active`),w=S.filter(e=>e.status===`retired`),T=(v.data??[]).filter(e=>e.name!==o);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{title:t.data.name,subtitle:`${C.length} citizens · ${_.data?.length??0} projects · ${T.length} roles`}),(0,h.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,h.jsxs)(f,{title:`Citizens`,children:[(0,h.jsx)(m,{members:C,scope:n}),w.length===0?null:(0,h.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,w.map(e=>e.name).join(`, `)]})]}),(0,h.jsx)(f,{title:`Roles`,children:(0,h.jsx)(`ul`,{className:`space-y-2.5`,children:T.map(e=>{let t=C.filter(t=>t.role===e.name).length;return(0,h.jsxs)(`li`,{children:[(0,h.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,h.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,h.jsx)(f,{title:`Knowledge`,children:(0,h.jsx)(p,{scope:n,topics:b.data,now:x})}),(0,h.jsx)(f,{title:`Skills`,children:y.data===void 0?(0,h.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):y.data.length===0?(0,h.jsx)(`p`,{className:`text-meta`,children:`None yet. A citizen's skill joins the society by proposal.`}):(0,h.jsx)(`ul`,{className:`space-y-1.5`,children:y.data.map(e=>(0,h.jsxs)(`li`,{className:`text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,h.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})})]})]})}export{g as SocietyView};
1
+ import{A as e,b as t,g as n,ht as r,k as i,ln as a,m as o,ot as s,w as c,y as l}from"./format-C7bqWt6N.js";import{n as u,t as d}from"./Pane-voa6GU0F.js";import{n as f,r as p,t as m}from"./Overview-DxFOFviB.js";var h=a();function g(){let a=e(),g=n(),_=t(),v=c(),y=i(),b=o(s),x=l(3e4);if(a.data===void 0||g.data===void 0)return(0,h.jsx)(u,{children:`Reading the society…`});let S=g.data.filter(e=>e.cli!==null),C=S.filter(e=>e.status===`active`),w=S.filter(e=>e.status===`retired`),T=(v.data??[]).filter(e=>e.name!==r);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{title:a.data.name,subtitle:`${C.length} citizens · ${_.data?.length??0} projects · ${T.length} roles`}),(0,h.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,h.jsxs)(f,{title:`Citizens`,children:[(0,h.jsx)(m,{members:C,scope:s}),w.length===0?null:(0,h.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,w.map(e=>e.name).join(`, `)]})]}),(0,h.jsx)(f,{title:`Roles`,children:(0,h.jsx)(`ul`,{className:`space-y-2.5`,children:T.map(e=>{let t=C.filter(t=>t.role===e.name).length;return(0,h.jsxs)(`li`,{children:[(0,h.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,h.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,h.jsx)(f,{title:`Knowledge`,children:(0,h.jsx)(p,{scope:s,topics:b.data,now:x})}),(0,h.jsx)(f,{title:`Skills`,children:y.data===void 0?(0,h.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):y.data.length===0?(0,h.jsx)(`p`,{className:`text-meta`,children:`None yet. A citizen's skill joins the society by proposal.`}):(0,h.jsx)(`ul`,{className:`space-y-1.5`,children:y.data.map(e=>(0,h.jsxs)(`li`,{className:`text-sm`,children:[(0,h.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,h.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})})]})]})}export{g as SocietyView};
@@ -0,0 +1 @@
1
+ import{D as e,Ht as t,g as n,ln as r,pn as i,t as a,un as o}from"./format-C7bqWt6N.js";import{I as s}from"./index-DM00hlle.js";import{t as c}from"./Markdown-CS3NCze-.js";import{t as l}from"./MessageItem-CL3XDi7l.js";var u=i(o(),1),d=r();function f({thread:r,now:i,task:o,empty:f}){let{api:p}=e(),m=n(),h=t({queryKey:[`thread`,r.id],queryFn:()=>p.thread(r.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(r.id,_),[r.id,_]),h.data===void 0)return(0,d.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the thread…`});let v=h.data.thread;return(0,d.jsxs)(`div`,{className:`-mx-4 mt-1`,children:[g.length===0?(0,d.jsx)(`p`,{className:`mx-4 mt-1 text-meta`,children:f}):g.map(e=>(0,d.jsx)(l,{message:e,members:m.data,now:i,task:o},e.id)),r.state===`closed`?(0,d.jsxs)(`div`,{className:`mx-4 mt-2`,children:[(0,d.jsxs)(`p`,{className:`text-meta`,children:[`Closed`,v.closedAt===void 0?``:` ${a(v.closedAt,i)}`,v.body.trim()===``?`.`:`:`]}),v.body.trim()===``?null:(0,d.jsx)(c,{text:v.body})]}):null]})}export{f as t};
@@ -0,0 +1,4 @@
1
+ import{N as e,R as t,Y as n,b as r,j as i,ln as a,pn as o,t as s,un as c,y as l}from"./format-C7bqWt6N.js";import{B as u,R as d,V as f}from"./index-DM00hlle.js";import{c as p,d as m,f as h,i as g,l as _,n as v,o as y,p as b,r as x,t as S}from"./Markdown-CS3NCze-.js";import{n as C,t as w}from"./Pane-voa6GU0F.js";import{t as T}from"./BackLink-BW0sb-M0.js";var E=o(c(),1),D=a(),O=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,k=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,A=1e3,j=2e4;function M({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,D.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,D.jsx)(`span`,{children:`Files`}):(0,D.jsx)(v,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,D.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,D.jsx)(v,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function N({taskId:e,file:t}){let n=t.entries.toSorted((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1);return(0,D.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,D.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,D.jsx)(v,{taskId:e,path:t.path===``?n.name:`${t.path}/${n.name}`,className:`text-sm text-fg-secondary hover:text-fg-primary`,children:n.kind===`dir`?`${n.name}/`:n.name}),n.size===null?null:(0,D.jsx)(`span`,{className:`text-meta`,children:h(n.size)})]},n.name))})}function P({rows:e}){let[t,...n]=e;if(t===void 0)return(0,D.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,A),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,D.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,D.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsx)(`tr`,{children:t.map((e,t)=>(0,D.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,D.jsx)(`tbody`,{children:r.map((e,t)=>(0,D.jsx)(`tr`,{children:e.map((e,t)=>(0,D.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,D.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,A,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function F({text:e,line:t}){let n=e.endsWith(`
2
+ `)?e.slice(0,-1).split(`
3
+ `):e.split(`
4
+ `),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>j?(0,D.jsx)(`pre`,{className:r,children:e}):(0,D.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,D.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,D.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function I({taskId:e,file:t,url:r,line:i}){let a=(0,E.useMemo)(()=>t.content===null?null:b(t.path,g(t.content)),[t.path,t.content]),o=t.path.split(`/`).at(-1)??t.path;return a===null?(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is `,h(t.size),`, more than the `,h(n),` the board shows. Its runner still has it on the task's branch.`]}):a.kind===`markdown`?(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(S,{text:a.text,base:{taskId:e,dir:m(t.path)},line:i})}):a.kind===`image`?r===null?null:(0,D.jsx)(`img`,{src:r,alt:o,className:`mt-3 max-w-full rounded-lg`}):a.kind===`table`?(0,D.jsx)(P,{rows:a.rows}):a.kind===`text`?(0,D.jsx)(F,{text:a.text,line:i}):(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is not text (`,h(t.size),`). Download it to open it.`]})}function L(){let{taskId:n,_splat:a}=f({from:`/task/$taskId/files/$`}),o=u({from:`/task/$taskId/files/$`}),c=y(_(a??``)??``),m=c.path,h=o.line??c.line,g=i(n),v=r(),b=e(n,m),S=l(3e4),A=b.data,j=A?.kind===`file`?A.content:null,P=x(j,p(m)??`application/octet-stream`),F=m===``?`Files`:m.split(`/`).at(-1)??m,L=g.data?.title??n,R=(0,E.useRef)(null);(0,E.useEffect)(()=>{h!==void 0&&A!==void 0&&R.current?.querySelector(`.line-target`)?.scrollIntoView({block:`center`})},[h,A]);let z;if(A!==void 0)z=A.kind===`dir`?(0,D.jsx)(N,{taskId:n,file:A}):(0,D.jsx)(I,{taskId:n,file:A,url:P,line:h});else if(b.error instanceof t&&b.error.status===404)z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[m===``?`Nothing`:m,` is not on task/`,n,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(b.error instanceof t&&b.error.status===503){let e=v.data?.find(e=>e.slug===g.data?.project);z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[e?.runner===void 0?`The runner`:`${e.runner}, the runner`,` `,e?.name??`the project`,` lives on, is not connected, so the task's files cannot be read now.`]})}else z=b.error===null?(0,D.jsxs)(C,{children:[`Reading `,F,` from the task's runner…`]}):(0,D.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:b.error.message});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{leading:(0,D.jsx)(T,{fallback:(0,D.jsx)(d,{to:`/task/$taskId`,params:{taskId:n},"aria-label":`Back to the task ${L}`,className:O,children:`←`})}),title:F,subtitle:A===void 0?L:`${L}${h===void 0?``:` · line ${h}`} · committed by ${A.commit.author} ${s(A.commit.at,S)} · ${A.commit.id.slice(0,7)}`,trailing:P===null?null:(0,D.jsx)(`a`,{href:P,download:F,className:k,children:`Download`})}),(0,D.jsxs)(`div`,{ref:R,className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,D.jsx)(M,{taskId:n,path:m}),z]})]})}export{L as TaskFileView};
@@ -0,0 +1 @@
1
+ import{D as e,F as t,M as n,R as r,b as i,cn as a,g as o,j as s,ln as c,pn as l,t as u,un as d,y as f}from"./format-C7bqWt6N.js";import{a as p,c as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./tasks-B4bx7Gg3.js";import{H as x,R as S,V as C,c as w,d as T,i as E,u as D,x as O}from"./index-DM00hlle.js";import{a as k,n as A,s as j,t as M,u as N}from"./Markdown-CS3NCze-.js";import{n as P,t as F}from"./Pane-voa6GU0F.js";import{t as I}from"./BackLink-BW0sb-M0.js";import{t as L}from"./SubjectThread-JQG2FxkA.js";var R=l(d(),1),z=c();function B({last:e,now:t}){return e===void 0?null:(0,z.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,u(e.at,t)]})}function V({taskId:e,nodes:t,nested:n,isOpen:r,toggle:i,now:a}){return(0,z.jsx)(`ul`,{className:n?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:t.map(t=>{if(t.kind===`dir`){let n=r(t);return(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>i(t),className:`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${n?`rotate-90`:``}`,children:`▸`}),(0,z.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[t.name,`/`]}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,z.jsx)(B,{last:t.lastChange,now:a})]}),n?(0,z.jsx)(V,{taskId:e,nodes:t.children,nested:!0,isOpen:r,toggle:i,now:a}):null]},`dir:${t.path}`)}let{change:n}=t;return(0,z.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5 text-sm`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`}),n.status===`deleted`?(0,z.jsx)(`span`,{className:`min-w-0 truncate text-fg-tertiary line-through`,title:n.path,children:t.name}):(0,z.jsx)(A,{taskId:e,path:n.path,className:`min-w-0 truncate text-fg-secondary hover:text-fg-primary`,children:t.name}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:k(n)}),(0,z.jsx)(B,{last:n.lastChange,now:a})]},n.path)})})}function H({taskId:e,changes:t,now:n}){let r=(0,R.useMemo)(()=>j(t),[t]),i=(0,R.useMemo)(()=>N(r),[r]),[a,o]=(0,R.useState)(new Map);return(0,z.jsx)(V,{taskId:e,nodes:r.children,nested:!1,isOpen:e=>a.get(e.path)??i.has(e.path),toggle:e=>{o(t=>new Map(t).set(e.path,!(t.get(e.path)??i.has(e.path))))},now:n})}function U({task:e,now:t}){let a=n(e.id),o=i(),s=`task/${e.id}`,c;if(a.data!==void 0){let{files:n,total:r,head:i}=a.data;c=n.length===0?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[r===1?`1 file`:`${r} files`,` changed · newest commit by `,i.author,` `,u(i.at,t)]}),(0,z.jsx)(H,{taskId:e.id,changes:n,now:t}),r>n.length?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,r,`; browse the branch for the rest.`]}):null]})}else if(a.error instanceof r&&a.error.status===404)c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(a.error instanceof r&&a.error.status===503){let t=o.data?.find(t=>t.slug===e.project);c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[t?.runner===void 0?`The runner`:`${t.runner}, the runner`,` `,t?.name??e.project,` lives on, is not connected, so the task's files cannot be listed now.`]})}else c=a.error===null?(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:a.error.message});return(0,z.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,z.jsx)(A,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),c]})}function W({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=_(n,e),s=t===n.stages.length-1,c=o&&n.status===`claimed`?n.claimedBy:void 0,l=e.holders.filter(t=>t!==c&&t!==e.completedBy),d=n.returned?.from===e.id?n.returned:void 0;return(0,z.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`relative z-10 grid size-5 shrink-0 place-items-center rounded-full text-[10px] ${a?`bg-emerald-400/20 text-emerald-300`:o?`bg-fg-primary text-surface-0`:`bg-surface-2 text-fg-muted`}`,children:a?`✓`:t+1}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,z.jsx)(`span`,{className:`ml-2 rounded-md bg-sky-400/10 px-1.5 py-px text-[11px] text-sky-300`,children:`gate`}):null]}),(0,z.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,v(e),c===void 0?null:(0,z.jsxs)(z.Fragment,{children:[` · held by `,(0,z.jsx)(D,{name:c,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${u(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${u(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${u(d.at,i)}`]})]})]})}function G({taskId:t}){let{api:n}=e(),r=a(),i=x({mutationFn:()=>n.openThread({task_id:t}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,z.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,z.jsx)(w,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,z.jsx)(`p`,{className:`text-meta`,children:i.error===null?`This task is older than task threads. It closes when the task ends.`:i.error.message})]})}function K(){let{taskId:e}=C({from:`/task/$taskId`}),n=s(e),a=t(),c=i(),l=o(),d=f(3e4),_=T();if(n.data===void 0)return(0,z.jsx)(P,{children:n.error instanceof r&&n.error.status===404?`There is no task ${e}.`:`Reading the task…`});let v=n.data,x=y(v),w=c.data?.find(e=>e.slug===v.project),D=a.data?.find(e=>e.id===v.id);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(F,{leading:(0,z.jsx)(I,{fallback:(0,z.jsx)(S,{to:`/p/$slug/tasks`,params:{slug:v.project},"aria-label":`Back to the tasks of ${w?.name??v.project}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:v.title,subtitle:`${w?.name??v.project} · ${m(v)} · created by ${_(v.createdBy)} ${u(v.createdAt,d)}`,trailing:(0,z.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${g[x]}`,children:b.find(e=>e.phase===x)?.label.toLowerCase()})}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Plan`}),v.returned===void 0?null:(0,z.jsxs)(`p`,{className:`mt-2 rounded-lg bg-orange-500/10 px-3 py-2 text-xs leading-relaxed text-orange-200`,children:[`Sent back from `,h(v,v.returned.from),` by `,v.returned.by,` `,u(v.returned.at,d),`. The work is redone from`,` `,h(v,v.stage),` until it reaches that stage again.`]}),(0,z.jsx)(`ol`,{className:`mt-3`,children:v.stages.map((e,t)=>(0,z.jsx)(W,{stage:e,index:t,task:v,members:l.data,now:d},e.id))}),(0,z.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,v.onDone===`merge`?`task/${v.id} merges onto the default branch`:`nothing more`,v.blockedBy.length>0?(0,z.jsxs)(z.Fragment,{children:[` · blocked by `,(0,z.jsx)(O,{text:v.blockedBy.join(`, `)})]}):null]}),v.body.trim()===``?null:(0,z.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(M,{text:v.body})})]}),(0,z.jsx)(U,{task:v,now:d}),(0,z.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Thread`}),a.data===void 0?null:D===void 0?p(v)?(0,z.jsx)(G,{taskId:v.id}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,z.jsx)(L,{thread:D,now:d,task:v,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),D?.state===`open`?(0,z.jsx)(E,{target:{threadId:v.id},placeholder:`Write in the task's thread`}):null]})}export{K as TaskView};
@@ -0,0 +1 @@
1
+ import{P as e,b as t,ct as n,g as r,ln as i,pn as a,t as o,un as s,y as c}from"./format-C7bqWt6N.js";import{c as l,i as u,l as d,o as f,r as p,s as m,t as h}from"./tasks-B4bx7Gg3.js";import{R as g,V as _,u as v}from"./index-DM00hlle.js";import{n as y,t as b}from"./Pane-voa6GU0F.js";var x=a(s(),1),S=i();function C({task:e}){let t=m(e);return(0,S.jsx)(`ol`,{className:`flex gap-1`,"aria-hidden":`true`,children:e.stages.map((n,r)=>{let i=n.completedBy!==void 0,a=f(e,n),o=i?`bg-emerald-400/60`:a?e.status===`claimed`?`bg-fg-primary/90`:`bg-amber-300/80`:t===`abandoned`?`bg-surface-2/50`:`bg-surface-2`;return(0,S.jsx)(`li`,{title:`${r+1}. ${n.name} · ${p(n)}${n.gate?` · gate`:``}`,className:`h-1.5 min-w-3 flex-1 rounded-full ${o} ${n.gate?`ring-1 ring-sky-300/70 ring-offset-1 ring-offset-surface-1`:``}`},n.id)})})}var w=5;function T({task:e,members:t,now:r}){let i=m(e),a=n(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(g,{to:`/task/$taskId`,params:{taskId:e.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,S.jsx)(`span`,{className:`shrink-0 text-meta`,children:l(e)})]}),(0,S.jsx)(`div`,{className:`mt-2`,children:(0,S.jsx)(C,{task:e})}),e.returned===void 0?null:(0,S.jsxs)(`p`,{className:`mt-1.5 truncate text-xs text-orange-300/90`,children:[`Sent back from `,d(e,e.returned.from),` by `,e.returned.by,` `,o(e.returned.at,r)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&i!==`landing`&&a!==void 0?(0,S.jsxs)(S.Fragment,{children:[a.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&i!==`landing`&&a!==void 0?`${a.name} · waiting for ${p(a)} since ${o(e.stageSince,r)}`:i===`landing`?`landing task/${e.id} on the default branch`:`${i} ${o(e.updatedAt,r)}`})]})})}function E(){let{slug:n}=_({from:`/p/$slug/tasks`}),i=e(n),a=t(),o=r(),s=c(3e4),[l,d]=(0,x.useState)(new Set),f=a.data?.find(e=>e.slug===n),p=u(i.data??[]),m=p.filter(e=>e.phase!==`done`&&e.phase!==`abandoned`).reduce((e,t)=>e+t.tasks.length,0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(b,{title:`Tasks`,subtitle:`${f?.name??n} · ${m} in play · ${i.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:i.data===void 0?(0,S.jsx)(y,{children:`Reading the tasks…`}):p.length===0?(0,S.jsx)(y,{children:`No tasks in this project yet.`}):p.map(e=>{let t=e.phase!==`done`&&e.phase!==`abandoned`||l.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[h.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:o.data,now:s},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>d(new Set([...l,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
@@ -0,0 +1 @@
1
+ import{ln as e,n as t,t as n}from"./format-C7bqWt6N.js";import{R as r,x as i}from"./index-DM00hlle.js";var a=e();function o(e){return e?.kind??`topic`}function s({state:e}){return(0,a.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${e===`open`?`bg-emerald-500/15 text-emerald-300`:`bg-surface-2 text-fg-tertiary`}`,children:e})}function c({thread:e,now:c}){let l=e.state===`closed`?t(e.body,180):``,u=e.messages===1?`1 message`:`${e.messages} messages`;return(0,a.jsxs)(r,{to:`/thread/$threadId`,params:{threadId:e.id},className:`mx-4 my-2 block rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:bg-surface-2/70`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`↳`}),(0,a.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,a.jsx)(s,{state:e.state})]}),(0,a.jsxs)(`p`,{className:`mt-1 text-meta`,children:[o(e.subject),` thread by `,e.openedBy,` · `,u,` · opened`,` `,n(e.openedAt,c)]}),l===``?null:(0,a.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-secondary`,children:(0,a.jsx)(i,{text:l,links:!1})})]})}export{c as n,o as r,s as t};
@@ -1 +1 @@
1
- import{D as e,R as t,_n as n,gn as r,h as i,vn as a,w as o,xn as s}from"./format-11lojpK1.js";import{R as c,V as l,a as u,c as d,o as f}from"./index-BXq4t0NA.js";var p=s(a(),1),m=n(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof t?e.message:`The board did not take it.`})}function _({channel:t,onDone:n}){let{api:a}=e(),s=r(),_=c(),v=i(),y=o(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=l({mutationFn:async()=>{let e=await a.openThread({channel:t,title:b.trim()});return S.trim()!==``&&await a.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{s.invalidateQueries({queryKey:[`threads`]}),n(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:f(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${u(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(d,{onClick:n,children:`Cancel`}),(0,m.jsx)(d,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:t,channel:n,onDone:i}){let{api:a}=e(),o=r(),[s,c]=(0,p.useState)(``),u=(0,p.useRef)(null);(0,p.useEffect)(()=>u.current?.focus(),[]);let f=l({mutationFn:()=>a.closeThread({thread_id:t,summary:s.trim()}),onSuccess:()=>{for(let e of[[`thread`,t],[`threads`],[`channel`,n]])o.invalidateQueries({queryKey:e});i()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,m.jsx)(`textarea`,{ref:u,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${n}.`,"aria-label":`Closing summary`,onChange:e=>c(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(d,{onClick:i,children:`Cancel`}),(0,m.jsx)(d,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:f.error})]})}export{_ as i,h as n,g as r,v as t};
1
+ import{D as e,R as t,cn as n,g as r,ln as i,pn as a,un as o,w as s}from"./format-C7bqWt6N.js";import{H as c,a as l,c as u,o as d,z as f}from"./index-DM00hlle.js";var p=a(o(),1),m=i(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof t?e.message:`The board did not take it.`})}function _({channel:t,onDone:i}){let{api:a}=e(),o=n(),_=f(),v=r(),y=s(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=c({mutationFn:async()=>{let e=await a.openThread({channel:t,title:b.trim()});return S.trim()!==``&&await a.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{o.invalidateQueries({queryKey:[`threads`]}),i(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:d(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${l(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:t,channel:r,onDone:i}){let{api:a}=e(),o=n(),[s,l]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>a.closeThread({thread_id:t,summary:s.trim()}),onSuccess:()=>{for(let e of[[`thread`,t],[`threads`],[`channel`,r]])o.invalidateQueries({queryKey:e});i()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,m.jsx)(`textarea`,{ref:d,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${r}.`,"aria-label":`Closing summary`,onChange:e=>l(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:f.error})]})}export{_ as i,h as n,g as r,v as t};
@@ -0,0 +1 @@
1
+ import{D as e,Ht as t,R as n,g as r,j as i,ln as a,pn as o,t as s,un as c,y as l}from"./format-C7bqWt6N.js";import{I as u,R as d,V as f,c as p,d as m,i as h}from"./index-DM00hlle.js";import{t as g}from"./Markdown-CS3NCze-.js";import{t as _}from"./MessageItem-CL3XDi7l.js";import{n as v,t as y}from"./Pane-voa6GU0F.js";import{r as b,t as x}from"./ThreadCard-CzQXJXSd.js";import{t as S}from"./ThreadForms-0LpUc2jJ.js";import{t as C}from"./useStickyScroll-DCsF4GYJ.js";import{t as w}from"./BackLink-BW0sb-M0.js";var T=o(c(),1),E=a();function D(){let{threadId:e}=f({from:`/thread/$threadId`});return(0,E.jsx)(O,{id:e},e)}function O({id:a}){let{api:o}=e(),c=t({queryKey:[`thread`,a],queryFn:()=>o.thread(a)}),f=r(),D=l(3e4),O=m(),k=c.data?.messages??[],A=k.at(-1)?.id??null;(0,T.useEffect)(()=>u(a,A),[a,A]);let{ref:j,onScroll:M}=C(),[N,P]=(0,T.useState)(!1),F=c.data?.thread.subject,I=i(F?.kind===`task`?F.id:null);if(c.data===void 0)return(0,E.jsx)(v,{children:c.error instanceof n&&c.error.status===404?`There is no thread ${a}.`:`Reading the thread…`});let{thread:L}=c.data;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(y,{leading:(0,E.jsx)(w,{fallback:(0,E.jsx)(d,{to:`/c/$`,params:{_splat:L.channel},"aria-label":`Back to #${L.channel}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:L.title,subtitle:`${b(L.subject)} thread in #${L.channel} · opened by ${O(L.openedBy)} ${s(L.openedAt,D)}`,trailing:(0,E.jsxs)(E.Fragment,{children:[L.subject?.kind===`task`?(0,E.jsx)(d,{to:`/task/$taskId`,params:{taskId:L.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Task →`}):L.subject?.kind===`proposal`?(0,E.jsx)(d,{to:`/proposal/$proposalId`,params:{proposalId:L.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Proposal →`}):null,L.state===`open`&&!N&&L.subject?.kind!==`task`?(0,E.jsx)(p,{onClick:()=>P(!0),children:`Close`}):(0,E.jsx)(x,{state:L.state})]})}),N&&L.state===`open`?(0,E.jsx)(S,{threadId:L.id,channel:L.channel,onDone:()=>P(!1)}):null,(0,E.jsxs)(`div`,{ref:j,onScroll:M,className:`flex-1 overflow-y-auto py-2`,children:[k.length===0?(0,E.jsx)(v,{children:`No messages in this thread yet.`}):null,k.map(e=>(0,E.jsx)(_,{message:e,members:f.data,now:D,task:I.data},e.id)),L.state===`closed`?(0,E.jsxs)(`section`,{className:`mx-4 mt-3 mb-2 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,E.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,O(L.closedBy??`board`),L.closedAt===void 0?``:` ${s(L.closedAt,D)}`]}),L.body.trim()===``?(0,E.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,b(L.subject),`.`]}):(0,E.jsx)(g,{text:L.body})]}):null]}),L.state===`open`?(0,E.jsx)(h,{target:{threadId:L.id},placeholder:`Reply in the thread`}):null]})}export{D as ThreadView};
@@ -0,0 +1 @@
1
+ import{Q as e,ot as t}from"./format-C7bqWt6N.js";import{p as n}from"./index-DM00hlle.js";function r(e){return e===`society`?`the society`:e}function i(e){return[...e.memberships,t]}function a(e){return e.startedAt===void 0?null:n(e.startedAt,Date.parse(e.ts))}var o={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function s(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:o[e.exitReason]??e.exitReason}function c(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}var l=new Intl.NumberFormat(`en`,{notation:`compact`}),u=new Intl.NumberFormat(`en`);function d(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function f(e){return`${l.format(d(e))} in · ${l.format(e.outputTokens)} out`}function p(e){return[`${u.format(d(e))} input tokens: ${u.format(e.cacheReadTokens)} read from the cache,`,`${u.format(e.cacheWriteTokens)} written to it, ${u.format(e.inputTokens)} neither;`,`${u.format(e.outputTokens)} output tokens`].join(` `)}function m(t){let n=t.flatMap(e=>e.usage===void 0?[]:[e.usage]);return{turns:t.length,failed:t.filter(c).length,usage:n.length===0?null:n.reduce(e),withUsage:n.length}}function h(e,t){let n=/^\s*#{1,6}\s+(.+?)\s*(?:\n|$)/.exec(e);return n?.[1]?.toLowerCase()===t.toLowerCase()?e.slice(n[0].length).trim():e}function g(e,t){let n=[...e.homeRunner===void 0?[]:[{what:`outside projects`,runner:e.homeRunner}],...e.memberships.map(e=>({what:e,runner:t.get(e)}))],r=[...new Set(n.flatMap(e=>e.runner===void 0?[]:[e.runner]))],i=n.map(e=>`${e.what}: ${e.runner??`placed on its first turn`}`).join(`; `);return{label:r.length===0?`no runner yet`:`on ${r.join(`, `)}`,detail:i===``?`pinned to a runner on its first turn`:i}}export{p as a,i as c,r as i,h as l,m as n,f as o,g as r,a as s,s as t};