@kubitnodes/stellaris 0.2.0 → 0.3.0
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 +1 -1
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/web/dist/assets/{ChannelView-O1FQ_Cbf.js → ChannelView-B4rv0TMD.js} +1 -1
- package/web/dist/assets/{CitizenView-D0rSRBnj.js → CitizenView-DfBiP1Jw.js} +1 -1
- package/web/dist/assets/{CitizensView-BPx5ChvL.js → CitizensView-DB2TlGxn.js} +1 -1
- package/web/dist/assets/{KnowledgeView-Cjf5Axu5.js → KnowledgeView-l0I_R5Zd.js} +1 -1
- package/web/dist/assets/{Markdown-Dkiv3bKi.js → Markdown-C6mhAmbQ.js} +1 -1
- package/web/dist/assets/{MessageItem-sep2BGUh.js → MessageItem-BR30twQh.js} +1 -1
- package/web/dist/assets/{MetricsView-BIH8FLob.js → MetricsView-BZ0WW2Do.js} +1 -1
- package/web/dist/assets/{NeedsYouView-CuB7daZ0.js → NeedsYouView-C6CZNnJn.js} +1 -1
- package/web/dist/assets/{Overview-C6Ae0n9b.js → Overview-D47FfDDO.js} +1 -1
- package/web/dist/assets/{ProjectView-CpTcrvFa.js → ProjectView-CxUA5nFw.js} +1 -1
- package/web/dist/assets/{ProposalView-BXisoFis.js → ProposalView-C0oLBLQD.js} +1 -1
- package/web/dist/assets/{ProposalsView-BjPeXIxG.js → ProposalsView-BscIGUTT.js} +1 -1
- package/web/dist/assets/{RunnersView-0ou0ekMc.js → RunnersView-BypVHvzI.js} +1 -1
- package/web/dist/assets/{SocietyView-C8lU_XY4.js → SocietyView-C403e1uR.js} +1 -1
- package/web/dist/assets/{SubjectThread-BWbOV_wk.js → SubjectThread-irSHRJpB.js} +1 -1
- package/web/dist/assets/{TaskView-CDLRRfS6.js → TaskView-B-4WGLWK.js} +1 -1
- package/web/dist/assets/{TasksView-p6PdvdWY.js → TasksView-CA02-WIW.js} +1 -1
- package/web/dist/assets/{ThreadCard-BisvLnYg.js → ThreadCard-C4rb-53v.js} +1 -1
- package/web/dist/assets/{ThreadForms-DZ1yLsjU.js → ThreadForms-Dh9ky_aU.js} +1 -1
- package/web/dist/assets/{ThreadView-CQUPQ5oR.js → ThreadView-CAdCu-y_.js} +1 -1
- package/web/dist/assets/{citizen-BwK8Ciw3.js → citizen-BWGATcew.js} +1 -1
- package/web/dist/assets/{index-CbJnPhSw.js → index-D-wuKd9C.js} +8 -8
- package/web/dist/assets/index-HwY3AK-1.css +2 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-DJ30ENcc.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{An as e,Ft as t,Pn as n,jn as r,t as i,v as a,x as o}from"./format-DZLzLk7S.js";import{C as s,D as c,E as l,c as u}from"./index-
|
|
1
|
+
import{An as e,Ft as t,Pn as n,jn as r,t as i,v as a,x as o}from"./format-DZLzLk7S.js";import{C as s,D as c,E as l,c as u}from"./index-D-wuKd9C.js";import{n as d,t as f}from"./Pane-BXpuXst6.js";var p=n(r(),1),m=e(),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:n}){let r=e.decidedBy===void 0||e.decidedAt===void 0?``:` · ${e.status===`rejected`?`rejected`:`approved`} by ${u(e.decidedBy)} ${i(e.decidedAt,n)}`;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(t,{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 `,u(e.proposedBy),` `,i(e.createdAt,n),r]})]})})}function y(){let e=o(),t=a(3e4),[n,r]=(0,p.useState)(!1),i=l(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:[s.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{An as e,E as t,Pn as n,jn as r,kn as i,l as a,t as o,v as s,w as c,y as l}from"./format-DZLzLk7S.js";import{I as u,R as d,a as f}from"./index-
|
|
1
|
+
import{An as e,E as t,Pn as n,jn as r,kn as i,l as a,t as o,v as s,w as c,y as l}from"./format-DZLzLk7S.js";import{I as u,R as d,a as f}from"./index-D-wuKd9C.js";import{n as p,t as m}from"./Pane-BXpuXst6.js";import{n as h,r as g}from"./ThreadForms-Dh9ky_aU.js";import{n as _}from"./Overview-D47FfDDO.js";var v=n(r(),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=e();function C(e,t){return[e.length===0?`no CLI`:e.join(`, `),...t].join(` · `)}function w({enrollment:e,taken:n,followed:r,now:a}){let{api:s}=t(),c=i(),[l,u]=(0,v.useState)(()=>x(e.hostname,n)),p=()=>{c.invalidateQueries({queryKey:[`enrollments`]}),c.invalidateQueries({queryKey:[`runners`]})},m=d({mutationFn:()=>s.approveEnrollment(e.userCode,l.trim()),onSuccess:p}),_=d({mutationFn:()=>s.denyEnrollment(e.userCode),onSuccess:p}),y=m.isPending||_.isPending;return(0,S.jsxs)(`li`,{className:`rounded-xl border px-3 py-3 ${r?`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:e.hostname}),(0,S.jsx)(`code`,{className:`shrink-0 font-mono text-sm text-fg-primary`,children:e.userCode})]}),(0,S.jsxs)(`p`,{className:`mt-0.5 truncate text-meta`,children:[e.os,` · `,C(e.clis,e.capabilities),` · runner`,` `,e.version,` · asked `,o(e.requestedAt,a)]}),(0,S.jsxs)(`form`,{"aria-label":`Approve ${e.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)(f,{onClick:()=>_.mutate(),disabled:y,children:`Deny`}),(0,S.jsx)(f,{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{An as e,C as t,Ct as n,O as r,dt as i,k as a,m as o,p as s,v as c,y as l}from"./format-DZLzLk7S.js";import{n as u,t as d}from"./Pane-BXpuXst6.js";import{n as f,r as p,t as m}from"./Overview-
|
|
1
|
+
import{An as e,C as t,Ct as n,O as r,dt as i,k as a,m as o,p as s,v as c,y as l}from"./format-DZLzLk7S.js";import{n as u,t as d}from"./Pane-BXpuXst6.js";import{n as f,r as p,t as m}from"./Overview-D47FfDDO.js";var h=e();function g(){let e=a(),g=o(),_=l(),v=t(),y=r(),b=s(i),x=c(3e4);if(e.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!==n);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{title:e.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{An as e,E as t,Pn as n,jn as r,ln as i,m as a,t as o}from"./format-DZLzLk7S.js";import{M as s}from"./index-
|
|
1
|
+
import{An as e,E as t,Pn as n,jn as r,ln as i,m as a,t as o}from"./format-DZLzLk7S.js";import{M as s}from"./index-D-wuKd9C.js";import{t as c}from"./Markdown-C6mhAmbQ.js";import{t as l}from"./MessageItem-BR30twQh.js";var u=n(r(),1),d=e();function f({thread:e,now:n,task:r,empty:f}){let{api:p}=t(),m=a(),h=i({queryKey:[`thread`,e.id],queryFn:()=>p.thread(e.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(e.id,_),[e.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)),e.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,An as t,E as n,Ft as r,M as i,kn as a,m as o,t as s,v as c,y as l}from"./format-DZLzLk7S.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-DZgkXWwu.js";import{L as v,N as y,R as b,_ as x,a as S,c as C,s as w,t as T}from"./index-
|
|
1
|
+
import{A as e,An as t,E as n,Ft as r,M as i,kn as a,m as o,t as s,v as c,y as l}from"./format-DZLzLk7S.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-DZgkXWwu.js";import{L as v,N as y,R as b,_ as x,a as S,c as C,s as w,t as T}from"./index-D-wuKd9C.js";import{t as E}from"./Markdown-C6mhAmbQ.js";import{n as D,t as O}from"./Pane-BXpuXst6.js";import{t as k}from"./SubjectThread-irSHRJpB.js";var A=t();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)(w,{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:t}=n(),r=a(),i=b({mutationFn:()=>t.openThread({task_id:e}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(S,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,A.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 N(){let{taskId:t}=v({from:`/task/$taskId`}),n=e(t),a=i(),m=l(),h=o(),b=c(3e4);if(n.data===void 0)return(0,A.jsx)(D,{children:n.error instanceof y&&n.error.status===404?`There is no task ${t}.`:`Reading the task…`});let S=n.data,w=g(S),N=m.data?.find(e=>e.slug===S.project),P=a.data?.find(e=>e.id===S.id);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(O,{leading:(0,A.jsx)(r,{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 ${C(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[w]}`,children:_.find(e=>e.phase===w)?.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)(x,{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`}),a.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)(T,{target:{threadId:S.id},placeholder:`Write in the task's thread`}):null]})}export{N as TaskView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{An as e,Ft as t,Pn as n,_t as r,j as i,jn as a,m as o,t as s,v as c,y as l}from"./format-DZLzLk7S.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-DZgkXWwu.js";import{L as _,s as v}from"./index-
|
|
1
|
+
import{An as e,Ft as t,Pn as n,_t as r,j as i,jn as a,m as o,t as s,v as c,y as l}from"./format-DZLzLk7S.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-DZgkXWwu.js";import{L as _,s as v}from"./index-D-wuKd9C.js";import{n as y,t as b}from"./Pane-BXpuXst6.js";var x=n(a(),1),S=e();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:n,now:i}){let a=h(e),o=r(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(t,{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,` `,s(e.returned.at,i)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&a!==`landing`&&o!==void 0?(0,S.jsxs)(S.Fragment,{children:[o.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:n})]}):e.status===`open`&&a!==`landing`&&o!==void 0?`${o.name} · waiting for ${m(o)} since ${s(e.stageSince,i)}`:a===`landing`?`landing task/${e.id} on the default branch`:`${a} ${s(e.updatedAt,i)}`})]})})}function E(){let{slug:e}=_({from:`/p/$slug/tasks`}),t=i(e),n=l(),r=o(),a=c(3e4),[s,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`||s.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:a},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...s,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{An as e,Ft as t,n,t as r}from"./format-DZLzLk7S.js";import{_ as i}from"./index-
|
|
1
|
+
import{An as e,Ft as t,n,t as r}from"./format-DZLzLk7S.js";import{_ as i}from"./index-D-wuKd9C.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{An as e,C as t,E as n,Pn as r,jn as i,kn as a,m as o}from"./format-DZLzLk7S.js";import{F as s,N as c,R as l,a as u,n as d,r as f}from"./index-
|
|
1
|
+
import{An as e,C as t,E as n,Pn as r,jn as i,kn as a,m as o}from"./format-DZLzLk7S.js";import{F as s,N as c,R as l,a as u,n as d,r as f}from"./index-D-wuKd9C.js";var p=r(i(),1),m=e(),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:e,onDone:r}){let{api:i}=n(),c=a(),_=s(),v=o(),y=t(),[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 t=await i.openThread({channel:e,title:b.trim()});return S.trim()!==``&&await i.sendMessage({thread_id:t.id,body:S.trim()}),t},onSuccess:e=>{c.invalidateQueries({queryKey:[`threads`]}),r(),_({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 ${d(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(u,{onClick:r,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:e,channel:t,onDone:r}){let{api:i}=n(),o=a(),[s,c]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=l({mutationFn:()=>i.closeThread({thread_id:e,summary:s.trim()}),onSuccess:()=>{for(let n of[[`thread`,e],[`threads`],[`channel`,t]])o.invalidateQueries({queryKey:n});r()}});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 #${t}.`,"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)(u,{onClick:r,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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,An as t,E as n,Ft as r,Pn as i,jn as a,ln as o,m as s,t as c,v as l}from"./format-DZLzLk7S.js";import{L as u,M as d,N as f,a as p,c as m,t as h}from"./index-
|
|
1
|
+
import{A as e,An as t,E as n,Ft as r,Pn as i,jn as a,ln as o,m as s,t as c,v as l}from"./format-DZLzLk7S.js";import{L as u,M as d,N as f,a as p,c as m,t as h}from"./index-D-wuKd9C.js";import{t as g}from"./Markdown-C6mhAmbQ.js";import{t as _}from"./MessageItem-BR30twQh.js";import{n as v,t as y}from"./Pane-BXpuXst6.js";import{r as b,t as x}from"./ThreadCard-C4rb-53v.js";import{t as S}from"./ThreadForms-Dh9ky_aU.js";import{t as C}from"./useStickyScroll-CVTdIoKj.js";var w=i(a(),1),T=t();function E(){let{threadId:e}=u({from:`/thread/$threadId`});return(0,T.jsx)(D,{id:e},e)}function D({id:t}){let{api:i}=n(),a=o({queryKey:[`thread`,t],queryFn:()=>i.thread(t)}),u=s(),E=l(3e4),D=a.data?.messages??[],O=D.at(-1)?.id??null;(0,w.useEffect)(()=>d(t,O),[t,O]);let{ref:k,onScroll:A}=C(),[j,M]=(0,w.useState)(!1),N=a.data?.thread.subject,P=e(N?.kind===`task`?N.id:null);if(a.data===void 0)return(0,T.jsx)(v,{children:a.error instanceof f&&a.error.status===404?`There is no thread ${t}.`:`Reading the thread…`});let{thread:F}=a.data;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{leading:(0,T.jsx)(r,{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)(r,{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)(r,{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:u.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dt as e}from"./format-DZLzLk7S.js";import{u as t}from"./index-
|
|
1
|
+
import{dt as e}from"./format-DZLzLk7S.js";import{u as t}from"./index-D-wuKd9C.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`};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`}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};
|