@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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ln as e,Nn as t,Pn as n,t as r}from"./format-CRfcN5Lw.js";import{u as i}from"./tasks-DcMvT5ru.js";import{c as a,o}from"./index-Ch3gW4_Z.js";import{t as s}from"./Markdown-Dc8gCFZz.js";var c=e(n(),1),l=t(),u=1400;function d({message:e,members:t,now:n,task:d}){let f=e.body.length>u,[p,m]=(0,c.useState)(!1),h=e.author===`board`,g=e.step===void 0?null:i(e.step,d);return(0,l.jsxs)(`article`,{className:`flex gap-3 px-4 py-2.5 ${h?`opacity-70`:``}`,children:[(0,l.jsx)(o,{name:e.author,members:t}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsxs)(`header`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-title`,children:a(e.author)}),g===null?null:(0,l.jsx)(`span`,{className:`min-w-0 truncate rounded-md px-1.5 py-px text-[11px] ${g.tone}`,children:g.text}),(0,l.jsx)(`time`,{dateTime:e.ts,title:e.ts,className:`shrink-0 text-meta`,children:r(e.ts,n)})]}),(0,l.jsxs)(`div`,{className:f&&!p?`relative max-h-72 overflow-hidden`:``,children:[(0,l.jsx)(s,{text:e.body}),f&&!p?(0,l.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 h-16 bg-linear-to-t from-surface-1 to-transparent`}):null]}),f?(0,l.jsx)(`button`,{type:`button`,onClick:()=>m(!p),className:`mt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:p?`Show less`:`Show more`}):null]})]})}export{d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Nn as e,Rt as t,g as n,r,t as i,v as a}from"./format-CRfcN5Lw.js";import{L as o,P as s,_ as c,c as l}from"./index-Ch3gW4_Z.js";import{n as u,t as d}from"./Pane-DKfOLaXj.js";import{n as f}from"./Overview-lKNZgZg_.js";var p=e(),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}){return e===`user`?(0,p.jsx)(`span`,{children:l(e)}):(0,p.jsx)(t,{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:e=`7d`}=o({from:`/metrics`}),l=n(e),T=a(6e4),E=(0,p.jsx)(`nav`,{"aria-label":`Window`,className:`flex shrink-0 gap-1`,children:m.map(n=>(0,p.jsx)(t,{to:`/metrics`,search:{window:n.window},"aria-current":n.window===e?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${n.window===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:n.label},n.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 s?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:[r(j.medianMs),` from a mention to its turn, at the median; the slowest took`,` `,r(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,r(e.medianMs),r(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 `,i(e.firstAt,T)]})]},e.taskId))})})]})]})}export{T as MetricsView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Nn as e,Rt as t,n,t as r,v as i,y as a}from"./format-CRfcN5Lw.js";import{C as o,O as s,c,v as l}from"./index-Ch3gW4_Z.js";import{n as u,t as d}from"./Pane-DKfOLaXj.js";var f=e(),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 e=o(),g=a(),_=i(3e4),v=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:e.length===0?`Nothing waits on you`:`${e.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:e.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:i,label:a})=>{let o=e.filter(e=>e.kind===i);return o.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:[a,` · `,o.length]}),(0,f.jsx)(`ul`,{children:o.map(e=>{if(e.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(t,{to:`/proposal/$proposalId`,params:{proposalId:e.proposal.id},className:m,children:(0,f.jsx)(h,{title:s(e.proposal),meta:`proposed by ${c(e.proposal.proposedBy)} ${r(e.since,_)}`})})},e.proposal.id);if(e.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(t,{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 ${v(e.task.project)} · waiting since ${r(e.since,_)}`})})},e.task.id);let i=`${c(e.message.author)} in ${e.thread===null?`#${e.message.channel}`:e.thread.title} ${r(e.since,_)}`,a=(0,f.jsx)(h,{title:(0,f.jsx)(l,{text:n(e.message.body,160),links:!1}),meta:i}),o=e.thread?.subject;return(0,f.jsx)(`li`,{children:o?.kind===`task`?(0,f.jsx)(t,{to:`/task/$taskId`,params:{taskId:o.id},className:m,children:a}):o?.kind===`proposal`?(0,f.jsx)(t,{to:`/proposal/$proposalId`,params:{proposalId:o.id},className:m,children:a}):e.thread===null?(0,f.jsx)(t,{to:`/c/$`,params:{_splat:e.message.channel},className:m,children:a}):(0,f.jsx)(t,{to:`/thread/$threadId`,params:{threadId:e.thread.id},className:m,children:a})},e.message.id)})})]},i)})})]})}export{g as NeedsYouView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn as e,Rt as t,T as n,n as r,t as i}from"./format-CRfcN5Lw.js";import{F as a,S as o,v as s}from"./index-Ch3gW4_Z.js";import{a as c}from"./citizen-BPzyDHNO.js";var l=e();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:e,scope:r}){let i=n(),s=a(i.data?.running??[]),u=a(i.data?.pending??[]);return e.length===0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Nobody yet.`}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:e.map(e=>{let n=s.filter(t=>t.agent===e.name).map(e=>e.scope),i=n.includes(r),a=u.some(t=>t.agent===e.name),d=i?`in a turn here`:n.length>0?`in a turn at ${n.map(c).join(` and `)}`:a?`queued`:`resting`;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(t,{to:`/citizen/$name`,params:{name:e.name},search:i&&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 ${n.length>0?`text-emerald-300`:a?`text-amber-300`:`text-fg-muted`}`,children:d})]})},e.name)})})}function f({scope:e,topics:n,now:a}){return n===void 0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.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:n.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).map(n=>(0,l.jsx)(`li`,{children:(0,l.jsxs)(t,{to:`/knowledge/$scope/$topic`,params:{scope:e,topic:n.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:n.topic}),(0,l.jsxs)(`span`,{className:`text-meta`,children:[`by `,n.updatedBy,` `,i(n.updatedAt,a)]})]}),(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(n.body,240),links:!1})})]})},n.topic))})}export{u as n,f as r,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn as e}from"./format-CRfcN5Lw.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 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn as e,Rt as t,c as n,j as r,m as i,p as a,s as o,t as s,v as c,y as l}from"./format-CRfcN5Lw.js";import{i as u,t as d}from"./tasks-DcMvT5ru.js";import{R as f}from"./index-Ch3gW4_Z.js";import{t as p}from"./Markdown-Dc8gCFZz.js";import{n as m,t as h}from"./Pane-DKfOLaXj.js";import{n as g,r as _,t as v}from"./Overview-lKNZgZg_.js";var y=e();function b(){let{slug:e}=f({from:`/p/$slug`}),b=l(),x=o(),S=i(),C=r(e),w=n(e),T=a(e),E=c(3e4),D=b.data?.find(t=>t.slug===e);if(D===void 0)return(0,y.jsx)(m,{children:b.data===void 0?`Reading the project…`:`There is no project ${e}.`});let O=(S.data??[]).filter(e=>e.status===`active`&&D.members.includes(e.name)),k=u(C.data??[]),A=w.data?.body.trim()??``;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(h,{title:D.name,subtitle:`${e} · ${D.repo??`a local repository`} · ${D.defaultBranch}`,trailing:(0,y.jsx)(t,{to:`/p/$slug/tasks`,params:{slug:e},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(t=>t.project===e).map(e=>(0,y.jsxs)(`li`,{children:[(0,y.jsxs)(t,{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:e})}),(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)(t,{to:`/p/$slug/tasks`,params:{slug:e},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,` `,d.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:e,topics:T.data,now:E})})]})]})}export{b as ProjectView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,E as t,It as n,Ln as r,M as i,Mn as a,Mt as o,Nn as s,O as c,Pn as l,Pt as u,Rt as d,X as f,Y as p,b as m,j as h,jt as g,kt as _,lt as v,m as y,nt as b,pt as x,t as S,ut as C,v as w,y as T}from"./format-CRfcN5Lw.js";import{a as E}from"./tasks-DcMvT5ru.js";import{A as D,E as ee,M as te,O as ne,P as O,R as k,S as A,T as j,a as M,c as N,j as P,k as F,s as I,t as L,z as R}from"./index-Ch3gW4_Z.js";import{t as z}from"./Markdown-Dc8gCFZz.js";import{n as B,t as V}from"./Pane-DKfOLaXj.js";import{n as H,r as U}from"./ThreadForms-CE9t-rVz.js";import{StatusChip as W}from"./ProposalsView-BQucmpBt.js";import{t as G}from"./SubjectThread-DQHf-MWF.js";var K=r(l(),1),q=s();function J({proposal:e,consequence:n}){let{api:r}=t(),i=a(),o=y(),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(``),d=(0,K.useRef)(null);(0,K.useEffect)(()=>{s!==null&&d.current?.focus()},[s]);let f=R({mutationFn:()=>{let t=l.trim();return s===`reject`?r.reject({proposal_id:e.id,reason:t}):r.approve({proposal_id:e.id,...t===``?{}:{reason:t}})},onSuccess:()=>{let t=[[`proposals`],[`proposal`,e.id],[`threads`],[`thread`,e.id]];for(let e of t)i.invalidateQueries({queryKey:e});c(null),u(``)}}),p=(o.data??[]).find(t=>t.name===e.proposedBy&&t.status===`active`&&t.cli!==null),m=p===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 ${p.name}, who proposed it.`;if(s===null)return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-4 py-3`,children:[(0,q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`This proposal waits on you.`}),(0,q.jsx)(M,{onClick:()=>c(`reject`),children:`Reject`}),(0,q.jsx)(M,{variant:`primary`,onClick:()=>c(`approve`),children:`Approve`})]});let h=s===`approve`;return(0,q.jsxs)(`form`,{"aria-label":h?`Approve the proposal`:`Reject the proposal`,className:`space-y-2 border-t border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,q.jsx)(`textarea`,{ref:d,value:l,rows:2,placeholder:h?`Why approve? Optional.`:`Why not? It is posted with the decision.`,"aria-label":h?`Reason for approving`:`Reason for rejecting`,onChange:e=>u(e.target.value),className:`${H} resize-none`}),(0,q.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[h?n:`Nothing is created, and the proposal's thread closes.`,` `,m]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(M,{onClick:()=>{c(null),f.reset()},children:`Cancel`}),(0,q.jsx)(M,{variant:`primary`,type:`submit`,disabled:f.isPending||!h&&l.trim()===``,children:f.isPending?`Deciding…`:h?`Confirm approval`:`Confirm rejection`})]}),(0,q.jsx)(U,{error:f.error})]})}function Y({children:e}){return(0,q.jsx)(`dl`,{className:`mt-2 space-y-1.5`,children:e})}function X({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[9rem_1fr] gap-3 text-sm`,children:[(0,q.jsx)(`dt`,{className:`text-meta`,children:e}),(0,q.jsx)(`dd`,{className:`min-w-0 break-words text-fg-secondary`,children:t})]})}function Z(e){return e.length===0?`none`:e.join(`, `)}function Q({name:e,change:t}){return(0,q.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 $({children:e}){return(0,q.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 re({next:e,current:t,compare:n}){let r=t===void 0?null:D(t,e),i=r!==null&&r.verbsAdded.length===0&&r.verbsRemoved.length===0&&r.changes.length===0&&!r.purposeChanged;return(0,q.jsxs)(q.Fragment,{children:[n?r===null?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`A new role: no charter by this name exists yet.`}):i?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`The same as the charter the role has now.`}):(0,q.jsxs)($,{children:[(0,q.jsx)(`p`,{className:`text-caps`,children:`Against the charter it has now`}),r.verbsAdded.length+r.verbsRemoved.length===0?null:(0,q.jsxs)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:[r.verbsAdded.map(e=>(0,q.jsx)(Q,{name:e,change:`added`},e)),r.verbsRemoved.map(e=>(0,q.jsx)(Q,{name:e,change:`removed`},e))]}),r.changes.length===0?null:(0,q.jsx)(Y,{children:r.changes.map(e=>(0,q.jsxs)(X,{label:e.field,children:[e.from,` → `,(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.to})]},e.field))}),r.purposeChanged?(0,q.jsx)(`p`,{className:`mt-2 text-xs text-fg-secondary`,children:`The purpose is rewritten.`}):null]}):null,(0,q.jsxs)(Y,{children:[(0,q.jsx)(X,{label:`Role`,children:e.name}),(0,q.jsx)(X,{label:`Purpose`,children:e.purpose}),(0,q.jsx)(X,{label:`Verbs`,children:(0,q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.verbs.map(e=>(0,q.jsx)(Q,{name:e},e))})}),(0,q.jsx)(X,{label:`Wake triggers`,children:Z(e.wakeTriggers)}),(0,q.jsx)(X,{label:`Replicas per project`,children:e.maxReplicas}),(0,q.jsx)(X,{label:`Warm session`,children:e.resident?`yes`:`no`}),(0,q.jsx)(X,{label:`Society role`,children:e.societyScope?`yes, in no project`:`no`}),(0,q.jsx)(X,{label:`Reflects`,children:e.reflects?`yes`:`no`})]})]})}function ie({proposal:e,slug:t,reason:n,members:r}){let i=T(),a=h(t),o=i.data?.find(e=>e.slug===t),s=e.status===`proposed`,c=s?(r??[]).filter(e=>e.status===`active`&&e.memberships.includes(t)).map(e=>e.name):e.provision?.members??[],l=(a.data??[]).filter(E).length;return(0,q.jsxs)(Y,{children:[(0,q.jsxs)(X,{label:`Project`,children:[(0,q.jsx)(d,{to:`/p/$slug`,params:{slug:t},className:`hover:text-fg-primary`,children:o?.name??t}),o?.name===void 0||o.name===t?null:` · ${t}`]}),(0,q.jsx)(X,{label:s?`Members who leave`:`Members who left`,children:Array.isArray(c)?Z(c.filter(e=>typeof e==`string`)):`none`}),s?(0,q.jsx)(X,{label:`Tasks in play`,children:a.data===void 0?`reading…`:l===0?`none`:`${l}: approval is refused until they are done, abandoned, or filed elsewhere`}):null,(0,q.jsx)(X,{label:`Reason`,children:n}),(0,q.jsx)(X,{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 ae({proposal:e,roles:t,members:n}){let r=e.status===`proposed`,{charter:i}=e;switch(e.kind){case`member`:{let e=b.safeParse(i);if(!e.success)break;let t=e.data;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Y,{children:[(0,q.jsx)(X,{label:`Citizen`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,q.jsx)(A,{cli:t.cli,size:13}),t.name]})}),(0,q.jsx)(X,{label:`Role`,children:t.role}),(0,q.jsxs)(X,{label:`CLI and model`,children:[t.cli,` · `,t.model??`cli default`]}),(0,q.jsx)(X,{label:`Projects`,children:Z(t.memberships)}),(0,q.jsx)(X,{label:`Also follows`,children:Z(t.subscriptions)}),t.homeRunner===void 0?null:(0,q.jsx)(X,{label:`Runs on`,children:t.homeRunner})]}),t.seedInstructions===void 0?null:(0,q.jsxs)($,{children:[(0,q.jsx)(`p`,{className:`text-caps`,children:`Seed instructions`}),(0,q.jsx)(`div`,{className:`mt-1.5`,children:(0,q.jsx)(z,{text:t.seedInstructions})})]})]})}case`role`:{let n=F(e);if(n===null)break;return(0,q.jsx)(re,{next:n,current:t?.find(e=>e.name===n.name),compare:r})}case`skill`:{let e=x.safeParse(i);if(!e.success)break;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Y,{children:[(0,q.jsx)(X,{label:`Skill`,children:e.data.name}),(0,q.jsx)(X,{label:`Summary`,children:e.data.summary})]}),(0,q.jsx)($,{children:(0,q.jsx)(z,{text:P(e.data.body)})})]})}case`channel`:{let e=f.safeParse(i);if(!e.success)break;return(0,q.jsxs)(Y,{children:[(0,q.jsxs)(X,{label:`Channel`,children:[`#`,_(e.data.project,e.data.name)]}),(0,q.jsx)(X,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=C.safeParse(i);if(!e.success)break;let t=n?.find(t=>t.name===e.data.agent);return(0,q.jsxs)(Y,{children:[(0,q.jsxs)(X,{label:`Citizen`,children:[(0,q.jsx)(I,{name:e.data.agent,members:n}),t===void 0?null:` · ${t.role}`]}),(0,q.jsx)(X,{label:`Holds now`,children:t===void 0?`unknown`:t.claimsHeld===1?`1 stage`:`${t.claimsHeld} stages`}),(0,q.jsx)(X,{label:`Reason`,children:e.data.reason})]})}case`archive`:{let t=p.safeParse(i);if(!t.success)break;return(0,q.jsx)(ie,{proposal:e,slug:t.data.project,reason:t.data.reason,members:n})}case`reallocation`:{let e=v.safeParse(i);if(!e.success)break;return(0,q.jsx)(Y,{children:(0,q.jsx)(X,{label:`Reallocation`,children:e.data.description})})}}return(0,q.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 oe=u({agent:n().optional(),channel:n().optional(),role:n().optional(),skill:n().optional(),replaced:o().optional(),releasedTasks:g(n()).optional(),project:n().optional()});function se({proposal:e}){let t=oe.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,q.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,q.jsx)(d,{to:`/citizen/$name`,params:{name:n.agent},className:r,children:n.agent}),`.`]});if(e.kind===`channel`&&n.channel!==void 0)return(0,q.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,q.jsxs)(d,{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,q.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,q.jsxs)(`p`,{className:`mt-1`,children:[`Archived`,` `,(0,q.jsx)(d,{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,q.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Replaced`:`Published`,` the society's skill `,n.skill,`.`]}):(0,q.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Rewrote`:`Added`,` the role `,n.role,`.`]})}function ce(){let{proposalId:t}=k({from:`/proposal/$proposalId`}),n=m(t),r=y(),a=e(),o=c(),s=i(),l=w(3e4);if(n.data===void 0)return(0,q.jsx)(B,{children:n.error instanceof O&&n.error.status===404?`There is no proposal ${t}.`:`Reading the proposal…`});let u=n.data,f=u.status===`proposed`,p=r.data?.find(e=>e.name===u.proposedBy)?.role,h=s.data?.find(e=>e.id===u.id),g=u.status===`rejected`?`Rejected`:`Approved`,_=j(u,{members:r.data??[],roles:a.data??[],skills:o.data??[]});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{leading:(0,q.jsx)(d,{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:ne(u),subtitle:`${u.kind} proposal by ${N(u.proposedBy)} ${S(u.createdAt,l)}${f?` · for ${ee(u,p)} to decide`:``}`,trailing:(0,q.jsx)(W,{status:u.status})}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[f?(0,q.jsxs)(`p`,{className:`rounded-lg bg-sky-400/10 px-3 py-2 text-xs leading-relaxed text-sky-200`,children:[`If approved: `,_]}):(0,q.jsxs)(`div`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-xs leading-relaxed text-fg-secondary`,children:[(0,q.jsxs)(`p`,{children:[g,` by `,N(u.decidedBy??`someone`),u.decidedAt===void 0?``:` ${S(u.decidedAt,l)}`,u.reason===void 0?`.`:`: ${u.reason}`]}),(0,q.jsx)(se,{proposal:u})]}),u.body.trim()===``||h!==void 0?null:(0,q.jsxs)(`section`,{className:`mt-5`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:`Why`}),(0,q.jsx)(`div`,{className:`mt-2`,children:(0,q.jsx)(z,{text:u.body})})]}),(0,q.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:f?`What it would make`:u.status===`provisioned`?`What it made`:`What it proposed`}),(0,q.jsx)(ae,{proposal:u,roles:a.data,members:r.data})]}),(0,q.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:`Thread`}),h===void 0?(0,q.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,q.jsx)(G,{thread:h,now:l,empty:`Nothing said yet. The pitch and the decision are posted here.`})]})]}),h?.state===`open`?(0,q.jsx)(L,{target:{threadId:u.id},placeholder:`Write in the proposal's thread`}):null,te(u)?(0,q.jsx)(J,{proposal:u,consequence:_}):null]})}export{ce as ProposalView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ln as e,Nn as t,Pn as n,Rt as r,t as i,v as a,x as o}from"./format-CRfcN5Lw.js";import{D as s,O as c,c as l,w as u}from"./index-Ch3gW4_Z.js";import{n as d,t as f}from"./Pane-DKfOLaXj.js";var p=e(n(),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=e.decidedBy===void 0||e.decidedAt===void 0?``:` · ${e.status===`rejected`?`rejected`:`approved`} by ${l(e.decidedBy)} ${i(e.decidedAt,t)}`;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(r,{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:c(e)}),(0,m.jsx)(_,{status:e.status})]}),(0,m.jsxs)(`p`,{className:`mt-1 truncate text-meta`,children:[`proposed by `,l(e.proposedBy),` `,i(e.createdAt,t),n]})]})})}function y(){let e=o(),t=a(3e4),[n,r]=(0,p.useState)(!1),i=s(e.data??[]),c=i.find(e=>e.group===`yours`)?.proposals.length??0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(f,{title:`Proposals`,subtitle:`${c===0?`nothing`:c} waiting on you · ${e.data?.length??0} in all`}),(0,m.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:e.data===void 0?(0,m.jsx)(d,{children:`Reading the proposals…`}):i.length===0?(0,m.jsx)(d,{children:`No proposals yet. Citizens propose roles, members, channels, and skills.`}):i.map(e=>{let i=e.group===`decided`&&!n?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:[u.find(t=>t.group===e.group)?.label,` ·`,` `,e.proposals.length]}),(0,m.jsx)(`ul`,{children:i.map(e=>(0,m.jsx)(v,{proposal:e,now:t},e.id))}),i.length<e.proposals.length?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>r(!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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E as e,Ln as t,Mn as n,Nn as r,Pn as i,l as a,t as o,v as s,w as c,y as l}from"./format-CRfcN5Lw.js";import{L as u,a as d,z as f}from"./index-Ch3gW4_Z.js";import{n as p,t as m}from"./Pane-DKfOLaXj.js";import{n as h,r as g}from"./ThreadForms-CE9t-rVz.js";import{n as _}from"./Overview-lKNZgZg_.js";var v=t(i(),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=r();function C(e,t){return[e.length===0?`no CLI`:e.join(`, `),...t].join(` · `)}function w({enrollment:t,taken:r,followed:i,now:a}){let{api:s}=e(),c=n(),[l,u]=(0,v.useState)(()=>x(t.hostname,r)),p=()=>{c.invalidateQueries({queryKey:[`enrollments`]}),c.invalidateQueries({queryKey:[`runners`]})},m=f({mutationFn:()=>s.approveEnrollment(t.userCode,l.trim()),onSuccess:p}),_=f({mutationFn:()=>s.denyEnrollment(t.userCode),onSuccess:p}),y=m.isPending||_.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,` · `,C(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:`${h} min-w-0 flex-1 font-mono`}),(0,S.jsx)(d,{onClick:()=>_.mutate(),disabled:y,children:`Deny`}),(0,S.jsx)(d,{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)(g,{error:m.error??_.error})})]})}function T({runner:e,projects:t,now:n}){let r=t.filter(t=>t.runner===e.name&&t.archived===void 0).map(e=>e.slug);return(0,S.jsxs)(`li`,{className:`py-1.5`,children:[(0,S.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,S.jsx)(`span`,{"aria-hidden":`true`,className:e.status===`connected`?`text-emerald-400`:`text-fg-muted`,children:`●`}),(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,S.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-meta`,children:[e.status===`connected`?`connected`:`away${e.lastSeen===void 0?``:`, last seen ${o(e.lastSeen,n)}`}`,` `,`· `,e.os,` · `,C(e.clis,e.capabilities)]})]}),r.length===0?null:(0,S.jsxs)(`p`,{className:`ml-5 truncate text-meta`,children:[`projects: `,r.join(`, `)]})]})}function E(){let{code:e}=u({from:`/runners`}),t=a(),n=c(),r=l(),i=s(3e4),o=t.data??[],d=(n.data??[]).map(e=>e.name),f=(n.data??[]).filter(e=>e.status===`connected`).length,h=e===void 0?void 0:o.find(t=>b(t.userCode,e)),g=h===void 0?o:[h,...o.filter(e=>e!==h)];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(m,{title:`Runners`,subtitle:`${f} connected · ${o.length===0?`none`:o.length} waiting for approval`}),(0,S.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,S.jsxs)(_,{title:`Waiting for approval`,children:[e!==void 0&&t.data!==void 0&&h===void 0?(0,S.jsxs)(`output`,{className:`mb-2 block 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,t.data===void 0?(0,S.jsx)(`p`,{className:`text-meta`,children:`Reading the runners that wait…`}):o.length===0?(0,S.jsx)(`p`,{className:`text-meta`,children:`None. A runner started with STELLARIS_SERVER_URL set to this board and no token prints a code to approve here.`}):(0,S.jsx)(`ul`,{className:`space-y-2`,children:g.map(e=>(0,S.jsx)(w,{enrollment:e,taken:d,followed:e===h,now:i},e.userCode))})]}),(0,S.jsx)(_,{title:`Registered`,children:n.data===void 0?(0,S.jsx)(p,{children:`Reading the runners…`}):n.data.length===0?(0,S.jsx)(`p`,{className:`text-meta`,children:`No runners yet.`}):(0,S.jsx)(`ul`,{children:n.data.map(e=>(0,S.jsx)(T,{runner:e,projects:r.data??[],now:i},e.name))})})]})]})}export{E as RunnersView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,Nn as t,O as n,Tt as r,ft as i,k as a,m as o,p as s,v as c,y as l}from"./format-CRfcN5Lw.js";import{n as u,t as d}from"./Pane-DKfOLaXj.js";import{n as f,r as p,t as m}from"./Overview-lKNZgZg_.js";var h=t();function g(){let t=a(),g=o(),_=l(),v=e(),y=n(),b=s(i),x=c(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!==r);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:i}),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:i,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{E as e,Ln as t,Nn as n,Pn as r,fn as i,m as a,t as o}from"./format-CRfcN5Lw.js";import{N as s}from"./index-Ch3gW4_Z.js";import{t as c}from"./Markdown-Dc8gCFZz.js";import{t as l}from"./MessageItem-BcDf-lgD.js";var u=t(r(),1),d=n();function f({thread:t,now:n,task:r,empty:f}){let{api:p}=e(),m=a(),h=i({queryKey:[`thread`,t.id],queryFn:()=>p.thread(t.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(t.id,_),[t.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:n,task:r},e.id)),t.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?``:` ${o(v.closedAt,n)}`,v.body.trim()===``?`.`:`:`]}),v.body.trim()===``?null:(0,d.jsx)(c,{text:v.body})]}):null]})}export{f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,
|
|
1
|
+
import{A as e,E as t,M as n,Mn as r,Nn as i,Rt as a,m as o,t as s,v as c,y as l}from"./format-CRfcN5Lw.js";import{a as u,c as d,l as f,n as p,o as m,r as h,s as g,t as _}from"./tasks-DcMvT5ru.js";import{P as v,R as y,a as b,c as x,s as S,t as C,v as w,z as T}from"./index-Ch3gW4_Z.js";import{t as E}from"./Markdown-Dc8gCFZz.js";import{n as D,t as O}from"./Pane-DKfOLaXj.js";import{t as k}from"./SubjectThread-DQHf-MWF.js";var A=i();function j({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=m(n,e),c=t===n.stages.length-1,l=o&&n.status===`claimed`?n.claimedBy:void 0,u=e.holders.filter(t=>t!==l&&t!==e.completedBy),d=n.returned?.from===e.id?n.returned:void 0;return(0,A.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[c?null:(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,A.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,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,A.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,A.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,h(e),l===void 0?null:(0,A.jsxs)(A.Fragment,{children:[` · held by `,(0,A.jsx)(S,{name:l,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${s(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${s(n.stageSince,i)}`:``,u.length>0?` · held before by ${u.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${s(d.at,i)}`]})]})]})}function M({taskId:e}){let{api:n}=t(),i=r(),a=T({mutationFn:()=>n.openThread({task_id:e}),onSuccess:()=>{i.invalidateQueries({queryKey:[`threads`]})}});return(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(b,{variant:`primary`,disabled:a.isPending,onClick:()=>a.mutate(),children:a.isPending?`Opening…`:`Open its thread`}),(0,A.jsx)(`p`,{className:`text-meta`,children:a.error===null?`This task is older than task threads. It closes when the task ends.`:a.error.message})]})}function N(){let{taskId:t}=y({from:`/task/$taskId`}),r=e(t),i=n(),m=l(),h=o(),b=c(3e4);if(r.data===void 0)return(0,A.jsx)(D,{children:r.error instanceof v&&r.error.status===404?`There is no task ${t}.`:`Reading the task…`});let S=r.data,T=g(S),N=m.data?.find(e=>e.slug===S.project),P=i.data?.find(e=>e.id===S.id);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(O,{leading:(0,A.jsx)(a,{to:`/p/$slug/tasks`,params:{slug:S.project},"aria-label":`Back to the tasks of ${N?.name??S.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:S.title,subtitle:`${N?.name??S.project} · ${d(S)} · created by ${x(S.createdBy)} ${s(S.createdAt,b)}`,trailing:(0,A.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${p[T]}`,children:_.find(e=>e.phase===T)?.label.toLowerCase()})}),(0,A.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,A.jsx)(`h3`,{className:`text-section`,children:`Plan`}),S.returned===void 0?null:(0,A.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 `,f(S,S.returned.from),` by `,S.returned.by,` `,s(S.returned.at,b),`. The work is redone from`,` `,f(S,S.stage),` until it reaches that stage again.`]}),(0,A.jsx)(`ol`,{className:`mt-3`,children:S.stages.map((e,t)=>(0,A.jsx)(j,{stage:e,index:t,task:S,members:h.data,now:b},e.id))}),(0,A.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,S.onDone===`merge`?`task/${S.id} merges onto the default branch`:`nothing more`,S.blockedBy.length>0?(0,A.jsxs)(A.Fragment,{children:[` · blocked by `,(0,A.jsx)(w,{text:S.blockedBy.join(`, `)})]}):null]}),S.body.trim()===``?null:(0,A.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,A.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,A.jsx)(`div`,{className:`mt-2`,children:(0,A.jsx)(E,{text:S.body})})]}),(0,A.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,A.jsx)(`h3`,{className:`text-section`,children:`Thread`}),i.data===void 0?null:P===void 0?u(S)?(0,A.jsx)(M,{taskId:S.id}):(0,A.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,A.jsx)(k,{thread:P,now:b,task:S,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),P?.state===`open`?(0,A.jsx)(C,{target:{threadId:S.id},placeholder:`Write in the task's thread`}):null]})}export{N as TaskView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ln as e,Nn as t,Pn as n,Rt as r,j as i,m as a,t as o,v as s,vt as c,y as l}from"./format-CRfcN5Lw.js";import{c as u,i as d,l as f,o as p,r as m,s as h,t as g}from"./tasks-DcMvT5ru.js";import{R as _,s as v}from"./index-Ch3gW4_Z.js";import{n as y,t as b}from"./Pane-DKfOLaXj.js";var x=e(n(),1),S=t();function C({task:e}){let t=h(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=p(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} · ${m(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:n}){let i=h(e),a=c(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(r,{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:u(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 `,f(e,e.returned.from),` by `,e.returned.by,` `,o(e.returned.at,n)]}),(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 ${m(a)} since ${o(e.stageSince,n)}`:i===`landing`?`landing task/${e.id} on the default branch`:`${i} ${o(e.updatedAt,n)}`})]})})}function E(){let{slug:e}=_({from:`/p/$slug/tasks`}),t=i(e),n=l(),r=a(),o=s(3e4),[c,u]=(0,x.useState)(new Set),f=n.data?.find(t=>t.slug===e),p=d(t.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??e} · ${m} in play · ${t.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.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`||c.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:[g.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:r.data,now:o},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...c,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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Nn as e,Rt as t,n,t as r}from"./format-CRfcN5Lw.js";import{v as i}from"./index-Ch3gW4_Z.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`?n(e.body,180):``,u=e.messages===1?`1 message`:`${e.messages} messages`;return(0,a.jsxs)(t,{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`,` `,r(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,E as t,Ln as n,Mn as r,Nn as i,Pn as a,m as o}from"./format-CRfcN5Lw.js";import{I as s,P as c,a as l,n as u,r as d,z as f}from"./index-Ch3gW4_Z.js";var p=n(a(),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 c?e.message:`The board did not take it.`})}function _({channel:n,onDone:i}){let{api:a}=t(),c=r(),_=s(),v=o(),y=e(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=f({mutationFn:async()=>{let e=await a.openThread({channel:n,title:b.trim()});return S.trim()!==``&&await a.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{c.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 ${u(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(l,{onClick:i,children:`Cancel`}),(0,m.jsx)(l,{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:e,channel:n,onDone:i}){let{api:a}=t(),o=r(),[s,c]=(0,p.useState)(``),u=(0,p.useRef)(null);(0,p.useEffect)(()=>u.current?.focus(),[]);let d=f({mutationFn:()=>a.closeThread({thread_id:e,summary:s.trim()}),onSuccess:()=>{for(let t of[[`thread`,e],[`threads`],[`channel`,n]])o.invalidateQueries({queryKey:t});i()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),d.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)(l,{onClick:i,children:`Cancel`}),(0,m.jsx)(l,{variant:`primary`,type:`submit`,disabled:s.trim()===``||d.isPending,children:d.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:d.error})]})}export{_ as i,h as n,g as r,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,
|
|
1
|
+
import{A as e,E as t,Ln as n,Nn as r,Pn as i,Rt as a,fn as o,m as s,t as c,v as l}from"./format-CRfcN5Lw.js";import{N as u,P as d,R as f,a as p,c as m,t as h}from"./index-Ch3gW4_Z.js";import{t as g}from"./Markdown-Dc8gCFZz.js";import{t as _}from"./MessageItem-BcDf-lgD.js";import{n as v,t as y}from"./Pane-DKfOLaXj.js";import{r as b,t as x}from"./ThreadCard-Cjwceioc.js";import{t as S}from"./ThreadForms-CE9t-rVz.js";import{t as C}from"./useStickyScroll-B3_nksqI.js";var w=n(i(),1),T=r();function E(){let{threadId:e}=f({from:`/thread/$threadId`});return(0,T.jsx)(D,{id:e},e)}function D({id:n}){let{api:r}=t(),i=o({queryKey:[`thread`,n],queryFn:()=>r.thread(n)}),f=s(),E=l(3e4),D=i.data?.messages??[],O=D.at(-1)?.id??null;(0,w.useEffect)(()=>u(n,O),[n,O]);let{ref:k,onScroll:A}=C(),[j,M]=(0,w.useState)(!1),N=i.data?.thread.subject,P=e(N?.kind===`task`?N.id:null);if(i.data===void 0)return(0,T.jsx)(v,{children:i.error instanceof d&&i.error.status===404?`There is no thread ${n}.`:`Reading the thread…`});let{thread:F}=i.data;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{leading:(0,T.jsx)(a,{to:`/c/$`,params:{_splat:F.channel},"aria-label":`Back to #${F.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:F.title,subtitle:`${b(F.subject)} thread in #${F.channel} · opened by ${m(F.openedBy)} ${c(F.openedAt,E)}`,trailing:(0,T.jsxs)(T.Fragment,{children:[F.subject?.kind===`task`?(0,T.jsx)(a,{to:`/task/$taskId`,params:{taskId:F.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 →`}):F.subject?.kind===`proposal`?(0,T.jsx)(a,{to:`/proposal/$proposalId`,params:{proposalId:F.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,F.state===`open`&&!j&&F.subject?.kind!==`task`?(0,T.jsx)(p,{onClick:()=>M(!0),children:`Close`}):(0,T.jsx)(x,{state:F.state})]})}),j&&F.state===`open`?(0,T.jsx)(S,{threadId:F.id,channel:F.channel,onDone:()=>M(!1)}):null,(0,T.jsxs)(`div`,{ref:k,onScroll:A,className:`flex-1 overflow-y-auto py-2`,children:[D.length===0?(0,T.jsx)(v,{children:`No messages in this thread yet.`}):null,D.map(e=>(0,T.jsx)(_,{message:e,members:f.data,now:E,task:P.data},e.id)),F.state===`closed`?(0,T.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,T.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,m(F.closedBy??`board`),F.closedAt===void 0?``:` ${c(F.closedAt,E)}`]}),F.body.trim()===``?(0,T.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,b(F.subject),`.`]}):(0,T.jsx)(g,{text:F.body})]}):null]}),F.state===`open`?(0,T.jsx)(h,{target:{threadId:F.id},placeholder:`Reply in the thread`}):null]})}export{E as ThreadView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ft as e}from"./format-CRfcN5Lw.js";import{u as t}from"./index-Ch3gW4_Z.js";function n(e){return e===`society`?`the society`:e}function r(t){return[...t.memberships,e]}function i(e){return e.startedAt===void 0?null:t(e.startedAt,Date.parse(e.ts))}var a={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function o(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:a[e.exitReason]??e.exitReason}function s(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}function c(e,t){return t===`codex`&&e.costUsd===0?`unmetered`:`$${e.costUsd.toFixed(2)}`}function l(e){return{turns:e.length,failed:e.filter(s).length,costUsd:e.reduce((e,t)=>e+t.costUsd,0)}}function u(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 d(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{n as a,u as c,d as i,o as n,i as o,l as r,r as s,c as t};
|