@kubitnodes/stellaris 0.3.22 → 0.3.23
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/README.md +4 -4
- package/dist/cli/index.js +556 -413
- package/dist/server/index.js +666 -473
- package/package.json +1 -1
- package/web/dist/assets/BackLink-DGYs80bb.js +1 -0
- package/web/dist/assets/{Button-Yoe21NQ2.js → Button-f4jgBZY1.js} +1 -1
- package/web/dist/assets/{ChannelForms-55otlg-m.js → ChannelForms-q9zdj4p2.js} +1 -1
- package/web/dist/assets/{ChannelView-DJvLzg0N.js → ChannelView-CGs_aWL3.js} +2 -2
- package/web/dist/assets/{CitizenView-m1K2aTvK.js → CitizenView-gcIo_sKt.js} +2 -2
- package/web/dist/assets/CitizensView-DZ7S8vnJ.js +1 -0
- package/web/dist/assets/{CliIcon-DbMYJdlU.js → CliIcon-CLHaA65A.js} +1 -1
- package/web/dist/assets/{CronsView-B4kXk5Ld.js → CronsView-1wns6Uwv.js} +1 -1
- package/web/dist/assets/{KnowledgeView-aSGxDDKy.js → KnowledgeView-Cxfi2-Pt.js} +1 -1
- package/web/dist/assets/Markdown-BhtIFcWc.js +30 -0
- package/web/dist/assets/MessageItem-Bk9eBp1U.js +1 -0
- package/web/dist/assets/MetricsView-CTEH6rJn.js +1 -0
- package/web/dist/assets/NeedsYouView-2VNqH2Sb.js +1 -0
- package/web/dist/assets/{Overview-BveU1yJj.js → Overview-CS9HCSmm.js} +1 -1
- package/web/dist/assets/{Pane-CLjdfBMM.js → Pane-CJYRVkwh.js} +1 -1
- package/web/dist/assets/{Picker-CXOe5Xdu.js → Picker-DoxCN6C7.js} +1 -1
- package/web/dist/assets/{ProjectView-oa4Z46ED.js → ProjectView-CJ3r4UdN.js} +1 -1
- package/web/dist/assets/ProposalView-DLn9dNPp.js +2 -0
- package/web/dist/assets/{ProposalsView-BZHivSEm.js → ProposalsView-B-cOxTsQ.js} +1 -1
- package/web/dist/assets/{Quota-BC7dpnwd.js → Quota-Bo7UdWTV.js} +1 -1
- package/web/dist/assets/{RunnersView-BrJF-aLU.js → RunnersView-DlQruhwp.js} +1 -1
- package/web/dist/assets/{SocietyView-C1yosPuf.js → SocietyView-Bl4ErnV8.js} +1 -1
- package/web/dist/assets/{StickyList-7tAlUDCN.js → StickyList-MVP34ytV.js} +1 -1
- package/web/dist/assets/{SubjectThread-CCq6ZAnR.js → SubjectThread-BFFnHxIF.js} +1 -1
- package/web/dist/assets/{TaskFileView-BEXQJQQ6.js → TaskFileView-GZ0eQFUb.js} +2 -2
- package/web/dist/assets/{TaskView-Cfhb7NuO.js → TaskView-DppFelLW.js} +2 -2
- package/web/dist/assets/{TasksView-3XljXcoi.js → TasksView-DDNXzeG4.js} +1 -1
- package/web/dist/assets/{ThreadForms-D2y5dXSC.js → ThreadForms-C846TvtS.js} +1 -1
- package/web/dist/assets/{ThreadItem-DeIhhmyu.js → ThreadItem-C8cou6wD.js} +1 -1
- package/web/dist/assets/{ThreadView-CbUnt9WL.js → ThreadView-DvSGDYoD.js} +1 -1
- package/web/dist/assets/{citizen--bqux6i_.js → citizen-B2Dlbcpe.js} +1 -1
- package/web/dist/assets/{compose-DNc3_c5x.js → compose-BmqQmcZH.js} +1 -1
- package/web/dist/assets/{format-B6fjC0_a.js → format-DT52SbbR.js} +1 -1
- package/web/dist/assets/{governance-RBQ4Lam0.js → governance-Cr5OlQnw.js} +1 -1
- package/web/dist/assets/index-BTVy_xFF.js +23 -0
- package/web/dist/assets/index-DzV6CCnG.css +2 -0
- package/web/dist/assets/{mentions-B2Qchd_6.js → mentions-D5hNgtg6.js} +1 -1
- package/web/dist/assets/{tasks-DCUj5w_d.js → tasks-R3YgpYTe.js} +1 -1
- package/web/dist/assets/useMatch-pEF6RJ6Q.js +1 -0
- package/web/dist/index.html +9 -9
- package/web/dist/assets/BackLink-CD-iuy-h.js +0 -1
- package/web/dist/assets/CitizensView-BeTgmrKE.js +0 -1
- package/web/dist/assets/Markdown-c9bCCLHg.js +0 -30
- package/web/dist/assets/MessageItem-DKJKMqs-.js +0 -1
- package/web/dist/assets/MetricsView-D2TTry5O.js +0 -1
- package/web/dist/assets/NeedsYouView-C3celRei.js +0 -1
- package/web/dist/assets/ProposalView-B4T-EoX9.js +0 -2
- package/web/dist/assets/index-CyCty7a2.js +0 -23
- package/web/dist/assets/index-GRqxKN35.css +0 -2
- package/web/dist/assets/useMatch-CfbBQirn.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{G as e,Hn as t,Kn as n,L as r,P as i,Un as a,b as o,qt as s,rt as c,t as l,x as u}from"./format-DT52SbbR.js";import{A as d,k as f}from"./index-BTVy_xFF.js";import{c as p,d as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,t as S}from"./Markdown-BhtIFcWc.js";import{n as C,t as w}from"./Pane-CJYRVkwh.js";import{t as T}from"./BackLink-DGYs80bb.js";var E=n(a(),1),D=t(),O=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,k=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,A=1e3,j=2e4;function M({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,D.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,D.jsx)(`span`,{children:`Files`}):(0,D.jsx)(v,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,D.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,D.jsx)(v,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function N({taskId:e,file:t}){let n=t.entries.toSorted((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1);return(0,D.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,D.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,D.jsx)(v,{taskId:e,path:t.path===``?n.name:`${t.path}/${n.name}`,className:`text-sm text-fg-secondary hover:text-fg-primary`,children:n.kind===`dir`?`${n.name}/`:n.name}),n.size===null?null:(0,D.jsx)(`span`,{className:`text-meta`,children:b(n.size)})]},n.name))})}function P({rows:e}){let[t,...n]=e;if(t===void 0)return(0,D.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,A),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,D.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,D.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsx)(`tr`,{children:t.map((e,t)=>(0,D.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,D.jsx)(`tbody`,{children:r.map((e,t)=>(0,D.jsx)(`tr`,{children:e.map((e,t)=>(0,D.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,D.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,A,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function F({text:e,line:t}){let n=e.endsWith(`
|
|
2
2
|
`)?e.slice(0,-1).split(`
|
|
3
3
|
`):e.split(`
|
|
4
|
-
`),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>j?(0,D.jsx)(`pre`,{className:r,children:e}):(0,D.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,D.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,D.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function I({taskId:e,file:t,url:n,line:r}){let i=(0,E.useMemo)(()=>t.content===null?null:_(t.path,h(t.content)),[t.path,t.content]),a=t.path.split(`/`).at(-1)??t.path;return i===null?(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is `,b(t.size),`, more than the `,b(
|
|
4
|
+
`),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>j?(0,D.jsx)(`pre`,{className:r,children:e}):(0,D.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,D.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,D.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function I({taskId:e,file:t,url:n,line:r}){let i=(0,E.useMemo)(()=>t.content===null?null:_(t.path,h(t.content)),[t.path,t.content]),a=t.path.split(`/`).at(-1)??t.path;return i===null?(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is `,b(t.size),`, more than the `,b(c),` the board shows. Its runner still has it on the task's branch.`]}):i.kind===`markdown`?(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(S,{text:i.text,base:{taskId:e,dir:m(t.path)},line:r})}):i.kind===`image`?n===null?null:(0,D.jsx)(`img`,{src:n,alt:a,className:`mt-3 max-w-full rounded-lg`}):i.kind===`table`?(0,D.jsx)(P,{rows:i.rows}):i.kind===`text`?(0,D.jsx)(F,{text:i.text,line:r}):(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[a,` is not text (`,b(t.size),`). Download it to open it.`]})}function L(){let{taskId:t,_splat:n}=d({from:`/task/$taskId/files/$`}),a=f({from:`/task/$taskId/files/$`}),c=y(g(n??``)??``),m=c.path,h=a.line??c.line,_=i(t),v=u(),b=r(t,m),S=o(3e4),A=b.data,j=A?.kind===`file`?A.content:null,P=x(j,p(m)??`application/octet-stream`),F=m===``?`Files`:m.split(`/`).at(-1)??m,L=_.data?.title??t,R=(0,E.useRef)(null);(0,E.useEffect)(()=>{h!==void 0&&A!==void 0&&R.current?.querySelector(`.line-target`)?.scrollIntoView({block:`center`})},[h,A]);let z;if(A!==void 0)z=A.kind===`dir`?(0,D.jsx)(N,{taskId:t,file:A}):(0,D.jsx)(I,{taskId:t,file:A,url:P,line:h});else if(b.error instanceof e&&b.error.status===404)z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[m===``?`Nothing`:m,` is not on task/`,t,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(b.error instanceof e&&b.error.status===503){let e=v.data?.find(e=>e.slug===_.data?.project);z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[e?.runner===void 0?`The runner`:`${e.runner}, the runner`,` `,e?.name??`the project`,` lives on, is not connected, so the task's files cannot be read now.`]})}else z=b.error===null?(0,D.jsxs)(C,{children:[`Reading `,F,` from the task's runner…`]}):(0,D.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:b.error.message});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{leading:(0,D.jsx)(T,{fallback:(0,D.jsx)(s,{to:`/task/$taskId`,params:{taskId:t},"aria-label":`Back to the task ${L}`,className:O,children:`←`})}),title:F,subtitle:A===void 0?L:`${L}${h===void 0?``:` · line ${h}`} · committed by ${A.commit.author} ${l(A.commit.at,S)} · ${A.commit.id.slice(0,7)}`,trailing:P===null?null:(0,D.jsx)(`a`,{href:P,download:F,className:k,children:`Download`})}),(0,D.jsxs)(`div`,{ref:R,className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,D.jsx)(M,{taskId:t,path:m}),z]})]})}export{L as TaskFileView};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{A as e,B as t,
|
|
1
|
+
import{A as e,B as t,F as n,G as r,Hn as i,I as a,Kn as o,P as s,Un as c,Vn as l,_ as u,b as d,qt as f,t as p,x as m,z as h}from"./format-DT52SbbR.js";import{n as g,t as _}from"./Button-f4jgBZY1.js";import{a as v,c as y,l as b,n as x,o as S,r as C,s as w,t as T}from"./tasks-R3YgpYTe.js";import{u as E}from"./governance-Cr5OlQnw.js";import{A as D,_ as O,i as k,o as A,s as j}from"./index-BTVy_xFF.js";import{a as M,f as N,n as P,s as F,t as I,u as L}from"./Markdown-BhtIFcWc.js";import{n as R,r as z}from"./ThreadForms-C846TvtS.js";import{n as B,t as V}from"./Pane-CJYRVkwh.js";import{t as H}from"./StickyList-MVP34ytV.js";import{t as ee}from"./BackLink-DGYs80bb.js";import{t as U}from"./SubjectThread-BFFnHxIF.js";var W=o(c(),1),G=i(),K={hunk:`text-fg-muted`,note:`text-fg-muted`,added:`bg-emerald-400/10 text-emerald-300`,removed:`bg-red-400/10 text-red-300`,context:`text-fg-tertiary`};function q({last:e,now:t}){return e===void 0?null:(0,G.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,p(e.at,t)]})}function J({taskId:e,path:t,patch:n}){let r=(0,W.useMemo)(()=>N(n),[n]);return(0,G.jsx)(`div`,{className:`mt-1 max-h-96 overflow-auto rounded-md bg-surface-0/60 py-1.5 font-mono text-[11px] leading-relaxed`,children:r.map((n,r)=>(0,G.jsxs)(`div`,{className:`flex ${K[n.kind]}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-2 text-right text-fg-muted select-none`,children:n.line===void 0?null:(0,G.jsx)(f,{to:`/task/$taskId/files/$`,params:{taskId:e,_splat:t},search:{line:n.line},tabIndex:-1,title:`Open ${t} at line ${n.line}`,className:`hover:text-fg-primary`,children:n.line})}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 pr-2 break-words whitespace-pre-wrap`,children:n.text===``?` `:n.text})]},r))})}function Y({taskId:e,change:t}){let n=a(e,t.path),i;if(n.data!==void 0){let{patch:r,truncated:a}=n.data;i=r===null?(0,G.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown here.`}):r===``?(0,G.jsx)(`p`,{className:`mt-1 text-meta`,children:`No lines changed.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J,{taskId:e,path:t.path,patch:r}),a?(0,G.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}else i=n.error instanceof r&&n.error.status===503?(0,G.jsx)(`p`,{className:`mt-1 text-meta`,children:`The task's runner is not connected, so the change cannot be read now.`}):n.error===null?(0,G.jsx)(`p`,{className:`mt-1 text-meta`,children:`Reading the change…`}):(0,G.jsx)(`p`,{className:`mt-1 text-meta`,children:n.error.message});return(0,G.jsxs)(`div`,{className:`mb-2 ml-[18px]`,children:[t.status===`deleted`?null:(0,G.jsx)(P,{taskId:e,path:t.path,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Open the whole file`}),i]})}function X({taskId:e,nodes:t,nested:n,openings:r,now:i}){let{isOpen:a,toggle:o,shown:s,toggleFile:c}=r;return(0,G.jsx)(`ul`,{className:n?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:t.map(t=>{if(t.kind===`dir`){let n=a(t);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>o(t),className:`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${n?`rotate-90`:``}`,children:`▸`}),(0,G.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[t.name,`/`]}),(0,G.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,G.jsx)(q,{last:t.lastChange,now:i})]}),n?(0,G.jsx)(X,{taskId:e,nodes:t.children,nested:!0,openings:r,now:i}):null]},`dir:${t.path}`)}let{change:n}=t,l=s.has(n.path),u=n.status===`deleted`?`text-fg-tertiary line-through`:l?`text-fg-primary`:`text-fg-secondary group-hover:text-fg-primary`;return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":l,title:n.path,onClick:()=>c(n.path),className:`group flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40 ${l?`bg-surface-2/30`:``}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate ${u}`,children:t.name}),(0,G.jsx)(`span`,{className:`shrink-0 text-meta`,children:M(n)}),(0,G.jsx)(q,{last:n.lastChange,now:i})]}),l?(0,G.jsx)(Y,{taskId:e,change:n}):null]},n.path)})})}function Z({taskId:e,changes:t,now:n}){let r=(0,W.useMemo)(()=>F(t),[t]),i=(0,W.useMemo)(()=>L(r),[r]),[a,o]=(0,W.useState)(new Map),s=e=>a.get(e.path)??i.has(e.path),c=e=>{o(t=>new Map(t).set(e.path,!(t.get(e.path)??i.has(e.path))))},[l,u]=(0,W.useState)(new Set);return(0,G.jsx)(X,{taskId:e,nodes:r.children,nested:!1,openings:{isOpen:s,toggle:c,shown:l,toggleFile:e=>{u(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})}},now:n})}function Q({task:e,now:t}){let i=n(e.id),a=m(),o=`task/${e.id}`,s;if(i.data!==void 0){let{files:n,total:r,head:a}=i.data;s=n.length===0?(0,G.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,o,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:`mt-2 text-meta`,children:[r===1?`1 file`:`${r} files`,` changed · newest commit by `,a.author,` `,p(a.at,t)]}),(0,G.jsx)(Z,{taskId:e.id,changes:n,now:t}),r>n.length?(0,G.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,r,`; browse the branch for the rest.`]}):null]})}else if(i.error instanceof r&&i.error.status===404)s=(0,G.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,o,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(i.error instanceof r&&i.error.status===503){let t=a.data?.find(t=>t.slug===e.project);s=(0,G.jsxs)(`p`,{className:`mt-2 text-meta`,children:[t?.runner===void 0?`The runner`:`${t.runner}, the runner`,` `,t?.name??e.project,` lives on, is not connected, so the task's files cannot be listed now.`]})}else s=i.error===null?(0,G.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,G.jsx)(`p`,{className:`mt-2 text-meta`,children:i.error.message});return(0,G.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,G.jsx)(P,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),s]})}function $({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=S(n,e),s=t===n.stages.length-1,c=o&&n.status===`claimed`?n.claimedBy:void 0,l=e.holders.filter(t=>t!==c&&t!==e.completedBy),u=n.returned?.from===e.id?n.returned:void 0;return(0,G.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,G.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,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,G.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,G.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,C(e),c===void 0?null:(0,G.jsxs)(G.Fragment,{children:[` · held by `,(0,G.jsx)(A,{name:c,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${p(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${p(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,u===void 0?``:` · sent back by ${u.by} ${p(u.at,i)}`]})]})]})}function te(e){return e.onDone===`ghpr`?e.pullRequest===void 0?`It lands through a pull request, and none is linked yet, so the board refuses to finish it.`:`Approving lands it: the board merges pull request #${e.pullRequest.number} on GitHub.`:e.onDone===`merge`?`Approving lands it: the board merges task/${e.id}.`:`Approving finishes the task.`}function ne({task:t,stage:n}){let{api:r}=e(),i=l(),[a,o]=(0,W.useState)(``),s=t.stages.findIndex(e=>e.id===n.id),c=t.stages[s+1],u=g({mutationFn:()=>r.advanceTask({task_id:t.id,...a.trim()===``?{}:{note:a.trim()}}),onSuccess:async()=>{o(``),await i.invalidateQueries({queryKey:[`task`,t.id]}),await i.invalidateQueries({queryKey:[`tasks`]})}});return(0,G.jsxs)(`form`,{"aria-label":`Approve ${n.name}`,className:`mt-1 mb-4 space-y-2 rounded-lg bg-surface-2/40 p-3`,onSubmit:e=>{e.preventDefault(),u.mutate()},children:[(0,G.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[n.name,` waits on you.`,` `,c===void 0?te(t):`Approving moves the task on to ${c.name}.`]}),(0,G.jsx)(`textarea`,{value:a,rows:2,"aria-label":`Note for the task's thread`,placeholder:`A note for the thread, if any`,onChange:e=>o(e.target.value),className:R}),(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(_,{variant:`primary`,type:`submit`,disabled:u.isPending,children:u.isPending?`Approving…`:`Approve`})}),(0,G.jsx)(z,{error:u.error})]})}function re({task:e,now:t}){let n=e.pullRequest;if(n===void 0)return null;let r=[n.subject??`The pull request's title`,n.body??``].filter(e=>e!==``).join(`
|
|
2
2
|
|
|
3
|
-
`);return(0,G.jsxs)(`section`,{"aria-label":`Pull request`,className:`mt-5 border-t border-line pt-4`,children:[(0,G.jsx)(`h3`,{className:`text-section`,children:`Pull request`}),(0,G.jsxs)(`p`,{className:`mt-2 text-sm`,children:[(0,G.jsxs)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`,className:`text-fg-primary underline decoration-line underline-offset-2 hover:decoration-fg-tertiary`,children:[`#`,n.number,` on GitHub`]}),(0,G.jsxs)(`span`,{className:`text-meta`,children:[` `,`· linked by `,n.linkedBy,` `,
|
|
3
|
+
`);return(0,G.jsxs)(`section`,{"aria-label":`Pull request`,className:`mt-5 border-t border-line pt-4`,children:[(0,G.jsx)(`h3`,{className:`text-section`,children:`Pull request`}),(0,G.jsxs)(`p`,{className:`mt-2 text-sm`,children:[(0,G.jsxs)(`a`,{href:n.url,target:`_blank`,rel:`noreferrer`,className:`text-fg-primary underline decoration-line underline-offset-2 hover:decoration-fg-tertiary`,children:[`#`,n.number,` on GitHub`]}),(0,G.jsxs)(`span`,{className:`text-meta`,children:[` `,`· linked by `,n.linkedBy,` `,p(n.linkedAt,t)]})]}),e.status===`abandoned`&&e.onDone===`ghpr`?(0,G.jsxs)(`p`,{className:`mt-2 text-sm text-fg-secondary`,children:[n.closed===void 0?`The task was abandoned, so the board closes the pull request on GitHub.`:n.closed.ok?`The task was abandoned: ${n.closed.detail}.`:`The task was abandoned, and the board could not close the pull request: ${n.closed.detail}.`,n.closed===void 0?null:(0,G.jsxs)(`span`,{className:`text-meta`,children:[` · `,p(n.closed.at,t)]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`mt-3 text-caps text-fg-muted`,children:`Merges as`}),(0,G.jsx)(`pre`,{className:`mt-1 rounded-lg bg-surface-2/40 p-3 font-mono text-xs whitespace-pre-wrap text-fg-secondary`,children:r})]})]})}function ie({taskId:t}){let{api:n}=e(),r=l(),i=g({mutationFn:()=>n.openThread({task_id:t}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,G.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,G.jsx)(_,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,G.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 ae(){let{taskId:e}=D({from:`/task/$taskId`}),n=s(e),i=t(),a=m(),o=u(),c=d(3e4),l=j(),g=h(i.data?.some(t=>t.id===e)===!0?e:null);if(n.data===void 0)return(0,G.jsx)(B,{children:n.error instanceof r&&n.error.status===404?`There is no task ${e}.`:`Reading the task…`});let _=n.data,S=w(_),C=E(_),A=a.data?.find(e=>e.slug===_.project),M=i.data?.find(e=>e.id===_.id);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{leading:(0,G.jsx)(ee,{fallback:(0,G.jsx)(f,{to:`/p/$slug/tasks`,params:{slug:_.project},"aria-label":`Back to the tasks of ${A?.name??_.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:_.title,subtitle:`${A?.name??_.project}${_.channel===`general`?``:` #${_.channel}`} · ${y(_)} · created by ${l(_.createdBy)} ${p(_.createdAt,c)}`,trailing:(0,G.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${x[S]}`,children:T.find(e=>e.phase===S)?.label.toLowerCase()})}),(0,G.jsxs)(H,{stick:!1,follow:!1,ids:g.data?.messages.map(e=>e.id),className:`px-4 py-4`,children:[(0,G.jsx)(`h3`,{className:`text-section`,children:`Plan`}),_.returned===void 0?null:(0,G.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 `,b(_,_.returned.from),` by `,_.returned.by,` `,p(_.returned.at,c),`. The work is redone from`,` `,b(_,_.stage),` until it reaches that stage again.`]}),(0,G.jsx)(`ol`,{className:`mt-3`,children:_.stages.map((e,t)=>(0,G.jsx)($,{stage:e,index:t,task:_,members:o.data,now:c},e.id))}),C===null?null:(0,G.jsx)(ne,{task:_,stage:C}),(0,G.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,_.onDone===`merge`?`task/${_.id} merges onto the default branch`:_.onDone===`ghpr`?_.pullRequest===void 0?`its pull request merges on GitHub, once one is linked`:`pull request #${_.pullRequest.number} merges on GitHub`:`nothing more`,_.blockedBy.length>0?(0,G.jsxs)(G.Fragment,{children:[` · blocked by `,(0,G.jsx)(O,{text:_.blockedBy.join(`, `)})]}):null]}),_.body.trim()===``?null:(0,G.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,G.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,G.jsx)(`div`,{className:`mt-2`,children:(0,G.jsx)(I,{text:_.body})})]}),(0,G.jsx)(re,{task:_,now:c}),(0,G.jsx)(Q,{task:_,now:c}),(0,G.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,G.jsx)(`h3`,{className:`text-section`,children:`Thread`}),i.data===void 0?null:M===void 0?v(_)?(0,G.jsx)(ie,{taskId:_.id}):(0,G.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,G.jsx)(U,{thread:M,now:c,task:_,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]},_.id),M?.state===`open`?(0,G.jsx)(k,{target:{threadId:_.id},placeholder:`Write in the task's thread`}):null]})}export{ae as TaskView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Hn as e,Kn as t,R as n,Un as r,_ as i,b as a,qt as o,t as s,x as c,yt as l}from"./format-DT52SbbR.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-R3YgpYTe.js";import{A as _,o as v}from"./index-BTVy_xFF.js";import{n as y,t as b}from"./Pane-CJYRVkwh.js";var x=t(r(),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:t,now:n}){let r=h(e),i=l(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(o,{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,n)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&r!==`landing`&&i!==void 0?(0,S.jsxs)(S.Fragment,{children:[i.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&r!==`landing`&&i!==void 0?`${i.name} · waiting for ${m(i)} since ${s(e.stageSince,n)}`:r===`landing`?`landing task/${e.id} on the default branch`:`${r} ${s(e.updatedAt,n)}`})]})})}function E(){let{slug:e}=_({from:`/p/$slug/tasks`}),t=n(e),r=c(),o=i(),s=a(3e4),[l,u]=(0,x.useState)(new Set),f=r.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`||l.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[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:o.data,now:s},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...l,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,
|
|
1
|
+
import{A as e,E as t,G as n,Hn as r,Kn as i,Un as a,Vn as o,_ as s}from"./format-DT52SbbR.js";import{n as c,t as l}from"./Button-f4jgBZY1.js";import{i as u,n as d}from"./compose-BmqQmcZH.js";import{n as f}from"./mentions-D5hNgtg6.js";var p=i(a(),1);function m(e,t,n){let r=t.filter(e=>e.status===`active`&&e.cli!==null),i=r.filter(e=>n.find(t=>t.name===e.role)?.wakeTriggers.includes(`user_post`)).map(e=>e.name),a=f(e).filter(e=>r.some(t=>t.name===e));return[...new Set([...i,...a])]}var h=r(),g=`block h-7 w-full rounded-md bg-surface-2/60 px-2.5 text-xs text-fg-primary outline-none placeholder:text-fg-muted focus-visible:ring-2 focus-visible:ring-fg-primary/30`,_=`block w-full resize-none rounded-md bg-surface-2/60 px-2.5 py-1.5 text-xs leading-relaxed text-fg-primary outline-none placeholder:text-fg-muted focus-visible:ring-2 focus-visible:ring-fg-primary/30`,v=`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 y({error:e}){return e===null?null:(0,h.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof n?e.message:`The board did not take it.`})}function b({channel:n,onDone:r}){let{api:i}=e(),a=o(),f=u(),g=s(),_=t(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=S.trim(),E=c({mutationFn:async()=>{let e=await i.openThread({channel:n,title:b.trim()});return T!==``&&await i.sendMessage({thread_id:e.id,body:T}),e},onSuccess:e=>{a.invalidateQueries({queryKey:[`threads`]}),r(),f({to:`/thread/$threadId`,params:{threadId:e.id}})}}),D=T===``?[]:m(T,g.data??[],_.data??[]);return(0,h.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),E.mutate()},children:[(0,h.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:v}),(0,h.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${v} resize-none`}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:D.length>0?`The first message wakes ${d(D)}.`:`Only its participants and anyone mentioned will read it.`}),(0,h.jsx)(l,{onClick:r,children:`Cancel`}),(0,h.jsx)(l,{variant:`primary`,type:`submit`,disabled:b.trim()===``||E.isPending,children:E.isPending?`Opening…`:`Open thread`})]}),(0,h.jsx)(y,{error:E.error})]})}function x({threadId:t,channel:n,onDone:r}){let{api:i}=e(),a=o(),[s,u]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>i.closeThread({thread_id:t,summary:s.trim()}),onSuccess:()=>{for(let e of[[`thread`,t],[`threads`],[`channel`,n]])a.invalidateQueries({queryKey:e});r()}});return(0,h.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,h.jsx)(`textarea`,{ref:d,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${n}.`,"aria-label":`Closing summary`,onChange:e=>u(e.target.value),className:`${v} resize-none`}),(0,h.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,h.jsx)(l,{onClick:r,children:`Cancel`}),(0,h.jsx)(l,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,h.jsx)(y,{error:f.error})]})}export{_ as a,b as i,v as n,g as o,y as r,x as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Hn as e,n as t,qt as n,t as r}from"./format-DT52SbbR.js";import{_ as i,s as a}from"./index-BTVy_xFF.js";var o=e();function s(e){return e?.kind??`topic`}function c({state:e}){return(0,o.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 l(){return(0,o.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5`,children:(0,o.jsx)(`path`,{d:`M4 2.5v6A2.5 2.5 0 0 0 6.5 11H13m-3-3 3 3-3 3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function u({thread:e,now:c}){let u=a(),d=e.state===`open`,f=d?``:t(e.body,180),p=d?void 0:e.closedAt,m=p??e.openedAt;return(0,o.jsxs)(n,{to:`/thread/$threadId`,params:{threadId:e.id},className:`group flex gap-3 px-4 py-1`,children:[(0,o.jsx)(`span`,{title:e.state,className:`grid h-5 w-7 shrink-0 place-items-center ${d?`text-emerald-400 group-hover:text-emerald-300`:`text-fg-muted group-hover:text-fg-tertiary`}`,children:(0,o.jsx)(l,{})}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,o.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm text-fg-tertiary`,children:[u(e.openedBy),` opened `,s(e.subject),` thread`,` `,(0,o.jsx)(`span`,{className:`text-fg-secondary group-hover:text-fg-primary`,children:e.title}),(0,o.jsxs)(`span`,{className:`sr-only`,children:[`, `,e.state]})]}),(0,o.jsx)(`time`,{dateTime:m,title:`${p===void 0?`opened`:`closed`} ${m}`,className:`shrink-0 text-meta`,children:r(m,c)})]}),f===``?null:(0,o.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:(0,o.jsx)(i,{text:f,links:!1})})]})]})}export{u as n,s as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,
|
|
1
|
+
import{A as e,G as t,Hn as n,Kn as r,P as i,Un as a,_ as o,b as s,qt as c,t as l,xn as u}from"./format-DT52SbbR.js";import{t as d}from"./Button-f4jgBZY1.js";import{A as f,C as p,i as m,k as h,s as g}from"./index-BTVy_xFF.js";import{t as _}from"./Markdown-BhtIFcWc.js";import{t as v}from"./ThreadForms-C846TvtS.js";import{t as y}from"./MessageItem-Bk9eBp1U.js";import{n as b,t as x}from"./Pane-CJYRVkwh.js";import{t as S}from"./StickyList-MVP34ytV.js";import{r as C,t as w}from"./ThreadItem-C8cou6wD.js";import{t as T}from"./BackLink-DGYs80bb.js";var E=r(a(),1),D=n();function O(){let{threadId:e}=f({from:`/thread/$threadId`}),{message:t}=h({from:`/thread/$threadId`});return(0,D.jsx)(k,{id:e,target:t},e)}function k({id:n,target:r}){let{api:a}=e(),f=u({queryKey:[`thread`,n],queryFn:()=>a.thread(n)}),h=o(),O=s(3e4),k=g(),A=f.data?.messages??[],j=A.at(-1)?.id??null;(0,E.useEffect)(()=>p(n,j),[n,j]);let[M,N]=(0,E.useState)(!1),P=f.data?.thread.subject,F=i(P?.kind===`task`?P.id:null);if(f.data===void 0)return(0,D.jsx)(b,{children:f.error instanceof t&&f.error.status===404?`There is no thread ${n}.`:`Reading the thread…`});let{thread:I}=f.data;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(x,{leading:(0,D.jsx)(T,{fallback:(0,D.jsx)(c,{to:`/c/$`,params:{_splat:I.channel},"aria-label":`Back to #${I.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:I.title,subtitle:`${C(I.subject)} thread in #${I.channel} · opened by ${k(I.openedBy)} ${l(I.openedAt,O)}`,trailing:(0,D.jsxs)(D.Fragment,{children:[I.subject?.kind===`task`?(0,D.jsx)(c,{to:`/task/$taskId`,params:{taskId:I.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 →`}):I.subject?.kind===`proposal`?(0,D.jsx)(c,{to:`/proposal/$proposalId`,params:{proposalId:I.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,I.state===`open`&&!M&&I.subject?.kind!==`task`?(0,D.jsx)(d,{onClick:()=>N(!0),children:`Close`}):(0,D.jsx)(w,{state:I.state})]})}),M&&I.state===`open`?(0,D.jsx)(v,{threadId:I.id,channel:I.channel,onDone:()=>N(!1)}):null,(0,D.jsxs)(S,{stick:r===void 0,ids:A.map(e=>e.id),className:`py-2`,children:[A.length===0?(0,D.jsx)(b,{children:`No messages in this thread yet.`}):null,A.map(e=>(0,D.jsx)(y,{message:e,members:h.data,now:O,task:F.data,target:e.id===r},e.id)),I.state===`closed`?(0,D.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,D.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,k(I.closedBy??`board`),I.closedAt===void 0?``:` ${l(I.closedAt,O)}`]}),I.body.trim()===``?(0,D.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,C(I.subject),`.`]}):(0,D.jsx)(_,{text:I.body})]}):null]}),I.state===`open`?(0,D.jsx)(m,{target:{threadId:I.id},placeholder:`Reply in the thread`}):null]})}export{O as ThreadView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{gt as e,ot as t}from"./format-DT52SbbR.js";import{l as n}from"./index-BTVy_xFF.js";function r(e){return e===`society`?`the society`:e}function i(t){return[...t.memberships,e]}function a(e){return e.map(e=>({value:e,name:r(e),id:null,description:e===`society`?`outside any project`:`a project`}))}function o(e){return e.startedAt===void 0?null:n(e.startedAt,Date.parse(e.ts))}var s={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function c(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:s[e.exitReason]??e.exitReason}function l(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}var u=new Intl.NumberFormat(`en`,{notation:`compact`}),d=new Intl.NumberFormat(`en`);function f(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function p(e){return`${u.format(f(e))} in · ${u.format(e.outputTokens)} out`}function m(e){return[`${d.format(f(e))} input tokens: ${d.format(e.cacheReadTokens)} read from the cache,`,`${d.format(e.cacheWriteTokens)} written to it, ${d.format(e.inputTokens)} neither;`,`${d.format(e.outputTokens)} output tokens`].join(` `)}function h(e){let n=e.flatMap(e=>e.usage===void 0?[]:[e.usage]);return{turns:e.length,failed:e.filter(l).length,usage:n.length===0?null:n.reduce(t),withUsage:n.length}}var g={"24h":`in the last 24 hours`,"7d":`in the last 7 days`,all:`in all`};function _(e){return e===1?`1 finished turn`:`${e} finished turns`}function v(e,t){let n=g[t];if(e===void 0||e.turns===0)return{label:`no turns`,detail:`no finished turn ${n}`,spoken:null};let r=e.turns-e.withUsage,i=`logged before turns counted tokens, or ended without their runner's report`;if(e.usage===null)return{label:`tokens unknown`,detail:`${_(e.turns)} ${n}, none with a token count: ${i}`,spoken:`${_(e.turns)} ${n}, none counted`};if(r===0)return{label:p(e.usage),detail:`${m(e.usage)}; over ${_(e.turns)} ${n}`,spoken:null};let a=`over ${e.withUsage} of ${_(e.turns)} ${n}`;return{label:`≥${u.format(f(e.usage))} in · ≥${u.format(e.usage.outputTokens)} out`,detail:[`${m(e.usage)}; ${a}.`,`The other ${r===1?`one has`:`${r} have`} no count: ${i}.`].join(` `),spoken:a}}function y(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 b(e,t){return[...new Set([e.homeRunner,...e.memberships.map(e=>t.get(e))].filter(e=>e!==void 0))]}function x(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=b(e,t),i=n.map(e=>`${e.what}: ${e.runner??`placed on its first turn`}`).join(`; `),a=r.length===0?[`no runner yet`]:r.map((e,t)=>`${t===0?`on `:``}${e}${t<r.length-1?`,`:``}`);return{label:a.join(` `),parts:a,detail:i===``?`pinned to a runner on its first turn`:i}}export{r as a,p as c,i as d,y as f,a as i,o as l,h as n,v as o,x as r,m as s,c as t,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kn as e,Un as t,Yt as n}from"./format-DT52SbbR.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function a(e,t){let n=/(^|[^\w@])@([a-z0-9-]*)$/.exec(e.slice(0,t))?.[2];return n===void 0?null:{start:t-n.length-1,prefix:n}}function o(e,t,n,r){let i=`@${r} `;return{text:e.slice(0,n)+i+e.slice(t),caret:n+i.length}}var s=new Intl.ListFormat(`en`,{type:`conjunction`});function c(e){return s.format(e)}export{i,c as n,a as r,o as t};
|