@kubitnodes/stellaris 0.3.26 → 0.4.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 +752 -184
- package/dist/server/index.js +1528 -276
- package/package.json +2 -2
- package/web/dist/assets/{BackLink-UTiLF1J4.js → BackLink-BLiSCuKv.js} +1 -1
- package/web/dist/assets/{Button-Cp4cNRUX.js → Button-D4-iu6aX.js} +1 -1
- package/web/dist/assets/ChannelForms-DjviQfVm.js +1 -0
- package/web/dist/assets/{ChannelView-CY3oG9hZ.js → ChannelView-B-0H7Ps8.js} +2 -2
- package/web/dist/assets/CitizenView-gE5GgCBa.js +2 -0
- package/web/dist/assets/{CitizensView-WPQ6Jhl3.js → CitizensView-DXD3qkq1.js} +1 -1
- package/web/dist/assets/{CliIcon-C7bwChMP.js → CliIcon-DL4ZwgZv.js} +1 -1
- package/web/dist/assets/{CronsView-_pdgwX1I.js → CronsView-CX_G5D3h.js} +1 -1
- package/web/dist/assets/{FileTree-jyDUSu7g.js → FileTree-BFa_KVI8.js} +1 -1
- package/web/dist/assets/{FileView-DcQvlc8V.js → FileView-Cd9Ijarf.js} +2 -2
- package/web/dist/assets/KnowledgeView-D_a4pjGV.js +1 -0
- package/web/dist/assets/{Markdown-DT3V-EVe.js → Markdown-DPqvK--4.js} +4 -4
- package/web/dist/assets/{MessageItem-agtEugfG.js → MessageItem-WBTzWwyj.js} +1 -1
- package/web/dist/assets/MetricsView-YUkYixqT.js +1 -0
- package/web/dist/assets/NeedsYouView-CE_B9bZQ.js +1 -0
- package/web/dist/assets/Overview-BGUnf6K1.js +1 -0
- package/web/dist/assets/{Pane-BaM0TdE6.js → Pane-C9TbEME4.js} +1 -1
- package/web/dist/assets/{Picker-C2ig-0dT.js → Picker-BK48MjLY.js} +1 -1
- package/web/dist/assets/ProjectView-sL3aGAC6.js +1 -0
- package/web/dist/assets/ProposalView-BhZR4MIR.js +1 -0
- package/web/dist/assets/{ProposalsView-p4KjwV9p.js → ProposalsView-DTGx8NDn.js} +1 -1
- package/web/dist/assets/{Quota-CfFGIql9.js → Quota-BkF7pa0u.js} +1 -1
- package/web/dist/assets/RunnersView-Bl62pXNw.js +1 -0
- package/web/dist/assets/{SkillFileList-CgrCnuaC.js → SkillFileList-BUpKUkaG.js} +1 -1
- package/web/dist/assets/{SkillView-Di5Z9h2L.js → SkillView-BQJApSh7.js} +1 -1
- package/web/dist/assets/{SocietyView-BDiVxUC5.js → SocietyView-JSdVE50m.js} +1 -1
- package/web/dist/assets/{StickyList-BaV_KZ8x.js → StickyList-DafbJutb.js} +1 -1
- package/web/dist/assets/{SubjectThread-DD_ZCCnr.js → SubjectThread-Jyl5YCFL.js} +1 -1
- package/web/dist/assets/{TaskView-CKcs-MOC.js → TaskView-Jke2pVGT.js} +2 -2
- package/web/dist/assets/{TasksView-oZMjncOU.js → TasksView-zJTIaqEA.js} +1 -1
- package/web/dist/assets/{ThreadForms-CG5Y926b.js → ThreadForms-DwUOktyP.js} +1 -1
- package/web/dist/assets/{ThreadItem-D-n2arFA.js → ThreadItem-Blx8gSvO.js} +1 -1
- package/web/dist/assets/{ThreadView-CT9vd0P4.js → ThreadView-CdQpBb7M.js} +1 -1
- package/web/dist/assets/citizen-BOn5BBRL.js +1 -0
- package/web/dist/assets/compose-D-X3BQgY.js +1 -0
- package/web/dist/assets/format-Dhd2NUB3.js +55 -0
- package/web/dist/assets/{governance-C6ez5MLh.js → governance-CWzi7hzX.js} +1 -1
- package/web/dist/assets/index-CA_njyMe.css +2 -0
- package/web/dist/assets/index-iplooQqq.js +24 -0
- package/web/dist/assets/{mentions-BEL5U6ra.js → mentions-S-r32HKM.js} +1 -1
- package/web/dist/assets/{tasks-CAI8Eci7.js → tasks-D_Fy7dtN.js} +1 -1
- package/web/dist/assets/useMatch-DZXCHHaG.js +1 -0
- package/web/dist/index.html +9 -9
- package/web/dist/assets/ChannelForms-DD2B0tey.js +0 -1
- package/web/dist/assets/CitizenView-BNK5ro-6.js +0 -2
- package/web/dist/assets/KnowledgeView-DDl0HQPG.js +0 -1
- package/web/dist/assets/MetricsView-DiXyYeWP.js +0 -1
- package/web/dist/assets/NeedsYouView-CKmuYan_.js +0 -1
- package/web/dist/assets/Overview-CKcTqsMM.js +0 -1
- package/web/dist/assets/ProjectView-T2OHTh5j.js +0 -1
- package/web/dist/assets/ProposalView-B5yjTAcn.js +0 -1
- package/web/dist/assets/RunnersView-DdvwoOur.js +0 -1
- package/web/dist/assets/citizen-BiHfph2A.js +0 -1
- package/web/dist/assets/compose-DY1WL8zB.js +0 -1
- package/web/dist/assets/format-CENiwkJC.js +0 -55
- package/web/dist/assets/index-CPXALUV6.js +0 -23
- package/web/dist/assets/index-DIa8Dlav.css +0 -2
- package/web/dist/assets/useMatch-CINzyDWa.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,Gn as t,Kn as n,O as r,S as i,Xn as a,f as o,j as s,qn as c,t as l,x as u}from"./format-Dhd2NUB3.js";import{n as d,t as f}from"./Button-D4-iu6aX.js";import{t as p}from"./CliIcon-DL4ZwgZv.js";import{k as m}from"./index-iplooQqq.js";import{n as h,r as g}from"./ThreadForms-DwUOktyP.js";import{n as _,t as v}from"./Pane-C9TbEME4.js";import{n as y}from"./Quota-BkF7pa0u.js";var b=a(c(),1);function x(e){return e.toUpperCase().replaceAll(/[^A-Z0-9]/g,``)}function S(e,t){return t!==void 0&&e.version!==void 0&&e.version!==t}function C(e){let t=e.gitIdentityMissing??[];if(t.length===0)return null;let n=t.map(e=>`user.${e}`),r=t.includes(`name`)?`git refuses the commits citizens make themselves on it`:`the commits citizens make themselves on it carry an empty address or one git made up`;return{label:t.length===1?`no git ${n.join(``)}`:`no git identity`,detail:`Its account has no git ${n.join(` or `)}, so ${r}.`}}function w(e,t){return x(e)===x(t)}function T(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 E=n();function D(e,t){return Number(e.status!==`connected`)-Number(t.status!==`connected`)||e.name.localeCompare(t.name)}function O(e,t){return[e.length===0?`no CLI`:e.join(`, `),...t].join(` · `)}function k({enrollment:e,taken:n,followed:r,now:i}){let{api:a}=s(),o=t(),[c,u]=(0,b.useState)(null),p=c??T(e.hostname,n),m=()=>{o.invalidateQueries({queryKey:[`enrollments`]}),o.invalidateQueries({queryKey:[`runners`]})},_=d({mutationFn:()=>a.approveEnrollment(e.userCode,p.trim()),onSuccess:m}),v=d({mutationFn:()=>a.denyEnrollment(e.userCode),onSuccess:m}),y=_.isPending||v.isPending;return(0,E.jsxs)(`li`,{className:`rounded-xl border px-3 py-3 ${r?`border-amber-500/40 bg-amber-500/5`:`border-line`}`,children:[(0,E.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-fg-primary`,children:e.hostname}),(0,E.jsx)(`code`,{className:`shrink-0 font-mono text-sm text-fg-primary`,children:e.userCode})]}),(0,E.jsxs)(`p`,{className:`mt-0.5 truncate text-meta`,children:[e.os,` · `,O(e.clis,e.capabilities),` · runner`,` `,e.version,` · asked `,l(e.requestedAt,i)]}),(0,E.jsxs)(`form`,{"aria-label":`Approve ${e.hostname}`,className:`mt-2.5 flex items-center gap-2`,onSubmit:e=>{e.preventDefault(),_.mutate()},children:[(0,E.jsx)(`input`,{value:p,maxLength:32,spellCheck:!1,"aria-label":`Runner name`,onChange:e=>u(e.target.value),className:`${h} min-w-0 flex-1 font-mono`}),(0,E.jsx)(f,{onClick:()=>v.mutate(),disabled:y,children:`Deny`}),(0,E.jsx)(f,{variant:`primary`,type:`submit`,disabled:y||p.trim()===``,children:_.isPending?`Approving…`:`Approve`})]}),(0,E.jsx)(`div`,{className:`mt-1.5`,children:(0,E.jsx)(g,{error:_.error??v.error})})]})}function A({paused:e}){return(0,E.jsx)(`svg`,{viewBox:`0 0 12 12`,width:12,height:12,"aria-hidden":`true`,className:`shrink-0`,children:(0,E.jsx)(`path`,{d:e?`M3 1.5v9l7.5-4.5z`:`M2.5 1.5h2.5v9h-2.5zM7 1.5h2.5v9h-2.5z`,fill:`currentColor`})})}function j(e,t){let n=e.clis.filter(t=>e.pausedClis?.[t]!==void 0),r=e.paused===void 0?e.clis.flatMap(n=>{let r=e.pausedClis?.[n];return r===void 0?[]:[`${n} paused ${l(r.at,t)}`]}):[`paused ${l(e.paused.at,t)}`];if(e.status!==`connected`){let n=`away${e.lastSeen===void 0?``:`, last seen ${l(e.lastSeen,t)}`}`;return{label:e.paused===void 0?`away`:`away · paused`,detail:[n,...r].join(`; `),tone:`text-amber-300`}}return e.paused===void 0&&n.length===0?{label:`connected`,detail:`connected`,tone:`text-fg-muted`}:{label:e.paused===void 0?`${n.join(`, `)} paused`:`paused`,detail:[`connected`,...r].join(`; `),tone:`text-amber-300`}}function M(){let{code:n}=m({from:`/runners`}),{api:a}=s(),c=t(),l=(0,b.useRef)(!1),f=d({mutationFn:({runner:e,paused:t,cli:n})=>a.setRunnerPaused(e,t,n),onSettled:async()=>{try{await c.invalidateQueries({queryKey:[`runners`]})}finally{l.current=!1}}}),h=e=>{l.current||(l.current=!0,f.mutate(e))},x=o(),T=r(),O=i(),M=e().data,N=u(3e4),P=x.data??[],F=(T.data??[]).map(e=>e.name),I=(T.data??[]).toSorted(D),L=I.filter(e=>e.status===`connected`).length,R=I.length-L,z=I.filter(e=>S(e,M)).length,B=I.filter(e=>C(e)!==null).length,V=I.filter(e=>e.paused!==void 0||e.clis.some(t=>e.pausedClis?.[t]!==void 0)).length,H=n===void 0?void 0:P.find(e=>w(e.userCode,n)),U=H===void 0?P:[H,...P.filter(e=>e!==H)],W=e=>(O.data??[]).filter(t=>t.runner===e.name&&t.archived===void 0).map(e=>e.slug);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v,{title:`Runners`,subtitle:[`${L} connected`,...R===0?[]:[`${R} away`],...V===0?[]:[`${V} paused`],...P.length===0?[]:[`${P.length} waiting for approval`],...M===void 0?[]:[`server v${M}`],...z===0?[]:[`${z} on another version`],...B===0?[]:[`${B} without a git identity`]].join(` · `)}),(0,E.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[n!==void 0&&x.data!==void 0&&H===void 0?(0,E.jsxs)(`output`,{className:`block px-2 pb-2 text-meta`,children:[`No runner waits with the code `,n,`.`]}):null,U.length===0?null:(0,E.jsx)(`ul`,{"aria-label":`Waiting for approval`,className:`space-y-2 px-2 pb-3`,children:U.map(e=>(0,E.jsx)(k,{enrollment:e,taken:F,followed:e===H,now:N},e.userCode))}),T.data===void 0?(0,E.jsx)(_,{children:`Reading the runners…`}):I.length===0?(0,E.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No runners yet.`}):null,(0,E.jsx)(`ul`,{"aria-label":`Registered`,className:`grid grid-cols-[auto_auto_auto_auto_minmax(0,max-content)_minmax(3rem,1fr)_auto_auto] gap-x-3`,children:I.map(e=>{let t=e.clis.length===0?`no CLI`:e.clis.join(`, `),n=W(e),r=n.length===0?`no projects`:n.join(`, `),i=C(e),a=j(e,N);return(0,E.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm`,children:[(0,E.jsxs)(`span`,{className:`flex items-center`,children:[e.clis.map(t=>{let n=e.pausedClis?.[t]!==void 0,r=`${n?`Resume`:`Pause`} ${t} on ${e.name}`;return(0,E.jsx)(`button`,{type:`button`,"aria-label":r,title:r,"aria-disabled":f.isPending,onClick:()=>h({runner:e.name,paused:!n,cli:t}),className:`rounded p-0.5 transition-opacity hover:bg-surface-2/70 focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none ${n?`opacity-30 hover:opacity-60`:``}`,children:(0,E.jsx)(p,{cli:t,size:13})},t)}),(0,E.jsx)(`span`,{className:`sr-only`,children:t})]}),(0,E.jsxs)(`span`,{children:[(0,E.jsx)(`span`,{className:`block text-fg-primary`,children:e.name}),i===null?null:(0,E.jsx)(`span`,{className:`block text-xs text-amber-300`,title:i.detail,children:i.label})]}),(0,E.jsx)(`span`,{className:`text-fg-secondary`,children:e.os}),S(e,M)?(0,E.jsxs)(`span`,{className:`text-xs text-amber-300`,title:`the server runs v${M}`,children:[`v`,e.version,(0,E.jsxs)(`span`,{className:`sr-only`,children:[`, not the server's v`,M]})]}):(0,E.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.version===void 0?``:`v${e.version}`}),(0,E.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:e.capabilities.join(`, `),children:e.capabilities.join(`, `)}),(0,E.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:r,children:r}),(0,E.jsx)(`span`,{className:`text-right text-xs ${a.tone}`,title:a.detail,children:a.label}),(0,E.jsx)(`button`,{type:`button`,"aria-label":`${e.paused===void 0?`Pause`:`Resume`} ${e.name}`,title:`${e.paused===void 0?`Pause`:`Resume`} ${e.name}`,"aria-disabled":f.isPending,onClick:()=>h({runner:e.name,paused:e.paused===void 0}),className:`-mr-1 rounded p-1 text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:(0,E.jsx)(A,{paused:e.paused!==void 0})})]},e.name)})}),(0,E.jsx)(`div`,{className:`px-2`,children:(0,E.jsx)(g,{error:f.error})}),(0,E.jsx)(y,{runners:I,now:N})]})]})}export{M as RunnersView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kn as e,Xn as t,qn as n}from"./format-Dhd2NUB3.js";import{g as r}from"./Markdown-DPqvK--4.js";var i=t(n(),1),a=e();function o({files:e}){let[t,n]=(0,i.useState)(new Set),o=e=>{n(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})};return(0,a.jsx)(`ul`,{children:e.map(e=>{let n=t.has(e.path);return(0,a.jsxs)(`li`,{children:[(0,a.jsxs)(`button`,{type:`button`,"aria-expanded":n,title:e.path,onClick:()=>o(e.path),className:`group flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40 ${n?`bg-surface-2/30`:``}`,children:[(0,a.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,a.jsx)(`span`,{className:`min-w-0 truncate ${n?`text-fg-primary`:`text-fg-secondary group-hover:text-fg-primary`}`,children:e.path}),(0,a.jsxs)(`span`,{className:`shrink-0 text-meta`,children:[r(e.size),e.executable?` · executable`:``]})]}),n?e.text===null?(0,a.jsx)(`p`,{className:`mt-1 mb-2 ml-[18px] text-meta`,children:`A binary file.`}):(0,a.jsxs)(`pre`,{className:`mt-1 mb-2 ml-[18px] max-h-96 overflow-auto rounded-lg bg-surface-2/40 p-3 font-mono text-[11px] leading-relaxed text-fg-secondary`,children:[e.text,e.truncated?`
|
|
2
2
|
…`:``]}):null]},e.path)})})}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gn as e,Kn as t,N as n,P as r,Xn as i,Zt as a,j as o,qn as s}from"./format-Dhd2NUB3.js";import{n as c,t as l}from"./Button-D4-iu6aX.js";import{l as u}from"./compose-D-X3BQgY.js";import{l as d}from"./governance-CWzi7hzX.js";import{A as f}from"./index-iplooQqq.js";import{t as p}from"./BackLink-BLiSCuKv.js";import{t as m}from"./Markdown-DPqvK--4.js";import{n as h,r as g}from"./ThreadForms-DwUOktyP.js";import{n as _,t as v}from"./Pane-C9TbEME4.js";import{n as y}from"./Overview-BGUnf6K1.js";import{t as b}from"./SkillFileList-BUpKUkaG.js";var x=i(s(),1),S=t(),C=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function w(){let{name:e}=f({from:`/skills/$name`}),t=r(),i=n(e),[o,s]=(0,x.useState)(!1),c=t.data?.find(t=>t.name===e);if(c===void 0)return(0,S.jsx)(_,{children:t.data===void 0?`Reading…`:`The society has no skill ${e}.`});let u=i.data?.find(e=>e.path===`SKILL.md`),h=i.data?.filter(e=>e.path!==`SKILL.md`)??[];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(v,{leading:(0,S.jsx)(p,{fallback:(0,S.jsx)(a,{to:`/society`,"aria-label":`Back to the society`,className:C,children:`←`})}),title:(0,S.jsx)(`span`,{title:c.name,children:c.name}),subtitle:c.summary===``?void 0:(0,S.jsx)(`span`,{title:c.summary,children:c.summary}),trailing:o?null:(0,S.jsx)(l,{onClick:()=>s(!0),children:`Remove…`})}),o?(0,S.jsx)(T,{name:c.name,onCancel:()=>s(!1)}):null,(0,S.jsx)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:i.data===void 0?(0,S.jsx)(`p`,{className:`text-meta`,children:i.isError?`Could not read its files.`:`Reading…`}):(0,S.jsxs)(S.Fragment,{children:[u===void 0||u.text===null?null:(0,S.jsx)(m,{text:d(u.text)}),h.length===0?null:(0,S.jsx)(y,{title:`Files`,children:(0,S.jsx)(b,{files:h})})]})})]})}function T({name:t,onCancel:n}){let{api:r}=o(),i=e(),a=u(),[s,d]=(0,x.useState)(``),f=(0,x.useRef)(null);(0,x.useEffect)(()=>f.current?.focus(),[]);let p=c({mutationFn:()=>r.removeSkill({name:t,reason:s.trim()}),onSuccess:async()=>{await a({to:`/society`}),await i.invalidateQueries({queryKey:[`skills`]})}});return(0,S.jsxs)(`form`,{"aria-label":`Remove ${t}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),p.mutate()},children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`input`,{ref:f,value:s,"aria-label":`Reason`,placeholder:`Why it is wrong, superseded, or unused`,onChange:e=>d(e.target.value),className:`${h} min-w-0 flex-1`}),(0,S.jsx)(l,{onClick:n,children:`Cancel`}),(0,S.jsx)(l,{variant:`primary`,type:`submit`,disabled:p.isPending||s.trim()===``,children:p.isPending?`Removing…`:`Remove skill`})]}),(0,S.jsx)(g,{error:p.error})]})}export{w as SkillView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,F as t,
|
|
1
|
+
import{D as e,F as t,Ht as n,Kn as r,P as i,S as a,Xn as o,Zt as s,g as c,l,qn as u,v as d,x as f,yt as p}from"./format-Dhd2NUB3.js";import{t as m}from"./Button-D4-iu6aX.js";import{n as h,r as g}from"./ChannelForms-DjviQfVm.js";import{n as _,t as v}from"./Pane-C9TbEME4.js";import{n as y,r as b,t as x}from"./Overview-BGUnf6K1.js";var S=o(u(),1),C=r();function w(){let r=t(),o=d(),s=a(),u=e(),w=i(),E=c(p),D=l(),O=f(3e4),[k,A]=(0,S.useState)(!1);if(r.data===void 0||o.data===void 0)return(0,C.jsx)(_,{children:`Reading the society…`});let j=o.data.filter(e=>e.cli!==null),M=j.filter(e=>e.status===`active`),N=j.filter(e=>e.status===`retired`),P=(u.data??[]).filter(e=>e.name!==n);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(v,{title:r.data.name,subtitle:`${M.length} citizens · ${s.data?.length??0} projects · ${P.length} roles`}),k?(0,C.jsx)(g,{project:null,onDone:()=>A(!1)}):null,(0,C.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,C.jsxs)(y,{title:`Citizens`,children:[(0,C.jsx)(x,{members:M,scope:p}),N.length===0?null:(0,C.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,N.map(e=>e.name).join(`, `)]})]}),(0,C.jsx)(y,{title:`Channels`,aside:k?null:(0,C.jsx)(m,{onClick:()=>A(!0),children:`New channel…`}),children:(0,C.jsx)(h,{channels:(D.data??[]).filter(e=>e.project===null),now:O})}),(0,C.jsx)(y,{title:`Roles`,children:(0,C.jsx)(`ul`,{className:`space-y-2.5`,children:P.map(e=>{let t=M.filter(t=>t.role===e.name).length;return(0,C.jsxs)(`li`,{children:[(0,C.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,C.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,C.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,C.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,C.jsx)(y,{title:`Knowledge`,children:(0,C.jsx)(b,{scope:p,topics:E.data,now:O})}),(0,C.jsx)(y,{title:`Skills`,children:w.data===void 0?(0,C.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):w.data.length===0?(0,C.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,C.jsx)(T,{skills:w.data})})]})]})}function T({skills:e}){return(0,C.jsx)(`ul`,{className:`-mx-2`,children:e.map(e=>(0,C.jsx)(`li`,{children:(0,C.jsxs)(s,{to:`/skills/$name`,params:{name:e.name},className:`block rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-2/50`,children:[(0,C.jsx)(`span`,{className:`block text-sm text-fg-primary`,children:e.name}),e.summary===``?null:(0,C.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.summary})]})},e.name))})}export{w as SocietyView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kn as e,Xn as t,qn as n}from"./format-Dhd2NUB3.js";var r=t(n(),1),i=80;function a(e){return e.scrollHeight-e.scrollTop-e.clientHeight}function o({stick:e=!0,follow:t=!0,ids:n=[]}={}){let o=(0,r.useRef)(null),c=(0,r.useRef)(e&&t),l=(0,r.useRef)(null),u=(0,r.useRef)(0),[d,f]=(0,r.useState)(!1),p=n.at(-1)??null,[m,h]=(0,r.useState)(null);(0,r.useLayoutEffect)(()=>{e&&t||(c.current=!1)},[e,t]),(0,r.useLayoutEffect)(()=>{let e=o.current;e!==null&&c.current&&(l.current===null?t&&(e.scrollTop=e.scrollHeight):l.current!==e.scrollHeight&&(l.current=e.scrollHeight,e.scrollTo({top:e.scrollHeight,behavior:s()})))}),(0,r.useLayoutEffect)(()=>{let e=o.current;if(e===null)return;let t=l.current===null&&a(e)>=i;f(t),h(e=>t&&e!==null?e:p)},[p]);let g=()=>{let e=o.current;if(e===null)return;let t=a(e)<i;(t||e.scrollTop<u.current)&&(l.current=null),u.current=e.scrollTop,c.current=t||l.current!==null,f(!c.current),c.current&&h(p)},_=({focus:e=!1}={})=>{let t=o.current;if(t===null)return;c.current=!0,l.current=t.scrollHeight,f(!1),h(p);let n=s(),r=t.scrollHeight-2*t.clientHeight;n===`smooth`&&t.scrollTop<r&&(t.scrollTop=r),u.current=t.scrollTop,t.scrollTo({top:t.scrollHeight,behavior:n});let i=[...t.querySelectorAll(`article`)].at(-1)??t.lastElementChild;e&&i instanceof HTMLElement&&(i.hasAttribute(`tabindex`)||i.setAttribute(`tabindex`,`-1`),i.focus({preventScroll:!0}))},v=m===null?0:n.filter(e=>e>m).length;return{ref:o,onScroll:g,away:d,unseen:d?v:0,jump:_}}function s(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}var c=e();function l({stick:e,follow:t,ids:n,className:i,children:a}){let{ref:s,onScroll:l,away:u,unseen:d,jump:f}=o({stick:e,follow:t,ids:n}),p=(0,r.useRef)(null);return(0,c.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,c.jsx)(`div`,{ref:s,onScroll:l,className:`flex-1 overflow-y-auto ${i}`,children:a}),u?(0,c.jsxs)(`button`,{ref:p,type:`button`,onClick:()=>f({focus:document.activeElement===p.current}),"aria-label":d>0?`Jump to latest, ${d} new`:`Jump to latest`,title:`Jump to latest`,className:`absolute bottom-3 left-1/2 grid size-8 -translate-x-1/2 place-items-center rounded-full bg-surface-2 text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.08),0_8px_20px_-6px_rgba(0,0,0,0.9)] transition-colors hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:[(0,c.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,c.jsx)(`path`,{d:`M8 3v10M3.5 8.5 8 13l4.5-4.5`})}),d>0?(0,c.jsx)(`span`,{"aria-hidden":`true`,className:`absolute -top-1.5 -right-1.5 min-w-4 rounded-full bg-fg-primary px-1 text-center text-[10px] leading-4 font-medium text-surface-0 tabular-nums`,children:d>99?`99+`:d}):null]}):null]})}export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,
|
|
1
|
+
import{B as e,Kn as t,Xn as n,qn as r,t as i,v as a}from"./format-Dhd2NUB3.js";import{C as o}from"./index-iplooQqq.js";import{t as s}from"./Markdown-DPqvK--4.js";import{t as c}from"./MessageItem-WBTzWwyj.js";var l=n(r(),1),u=t();function d({thread:t,now:n,task:r,empty:d}){let f=a(),p=e(t.id),m=p.data?.messages??[],h=m.at(-1)?.id??null;if((0,l.useEffect)(()=>o(t.id,h),[t.id,h]),p.data===void 0)return(0,u.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the thread…`});let g=p.data.thread;return(0,u.jsxs)(`div`,{className:`-mx-4 mt-1`,children:[m.length===0?(0,u.jsx)(`p`,{className:`mx-4 mt-1 text-meta`,children:d}):m.map(e=>(0,u.jsx)(c,{message:e,members:f.data,now:n,task:r},e.id)),t.state===`closed`?(0,u.jsxs)(`div`,{className:`mx-4 mt-2`,children:[(0,u.jsxs)(`p`,{className:`text-meta`,children:[`Closed`,g.closedAt===void 0?``:` ${i(g.closedAt,n)}`,g.body.trim()===``?`.`:`:`]}),g.body.trim()===``?null:(0,u.jsx)(s,{text:g.body})]}):null]})}export{d as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{B as e,
|
|
1
|
+
import{B as e,Gn as t,I as n,K as r,Kn as i,L as a,R as o,S as s,V as c,Xn as l,Zt as u,j as d,qn as f,t as p,v as m,x as h}from"./format-Dhd2NUB3.js";import{n as g,t as _}from"./Button-D4-iu6aX.js";import{c as v,l as y,n as b,o as x,r as S,s as C,t as w}from"./tasks-D_Fy7dtN.js";import{u as T}from"./governance-CWzi7hzX.js";import{A as E,_ as D,i as O,o as k,s as A}from"./index-iplooQqq.js";import{t as j}from"./BackLink-BLiSCuKv.js";import{f as M,l as N,m as P,n as F,o as I,t as L}from"./Markdown-DPqvK--4.js";import{n as R,r as z}from"./ThreadForms-DwUOktyP.js";import{n as B,t as V}from"./Pane-C9TbEME4.js";import{t as ee}from"./StickyList-DafbJutb.js";import{i as H,n as U,r as W,t as G}from"./FileTree-BFa_KVI8.js";import{t as K}from"./SubjectThread-Jyl5YCFL.js";var q=l(f(),1),J=i(),Y={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 X({last:e,now:t}){return e===void 0?null:(0,J.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,p(e.at,t)]})}function Z({taskId:e,path:t,patch:n}){let r=(0,q.useMemo)(()=>P(n),[n]);return(0,J.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,J.jsxs)(`div`,{className:`flex ${Y[n.kind]}`,children:[(0,J.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,J.jsx)(u,{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,J.jsx)(`span`,{className:`min-w-0 flex-1 pr-2 break-words whitespace-pre-wrap`,children:n.text===``?` `:n.text})]},r))})}function Q({taskId:e,change:t}){let n=o(e,t.path),i;if(n.data!==void 0){let{patch:r,truncated:a}=n.data;i=r===null?(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown here.`}):r===``?(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`No lines changed.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{taskId:e,path:t.path,patch:r}),a?(0,J.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,J.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,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`Reading the change…`}):(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:n.error.message});return(0,J.jsxs)(`div`,{className:`mb-2 ml-[18px]`,children:[t.status===`deleted`?null:(0,J.jsx)(F,{source:{kind:`task`,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 $({taskId:e,nodes:t,nested:n,openings:r,now:i}){let{isOpen:a,toggle:o,shown:s,toggleFile:c}=r;return(0,J.jsx)(H,{nested:n,children:t.map(t=>{if(t.kind===`dir`){let n=a(t);return(0,J.jsxs)(`li`,{children:[(0,J.jsxs)(U,{name:t.name,open:n,onToggle:()=>o(t),children:[(0,J.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,J.jsx)(X,{last:t.lastChange,now:i})]}),n?(0,J.jsx)($,{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,J.jsxs)(`li`,{children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":l,title:n.path,onClick:()=>c(n.path),className:`group ${W} ${l?`bg-surface-2/30`:``}`,children:[(0,J.jsx)(G,{}),(0,J.jsx)(`span`,{className:`min-w-0 truncate ${u}`,children:t.name}),(0,J.jsx)(`span`,{className:`shrink-0 text-meta`,children:I(n)}),(0,J.jsx)(X,{last:n.lastChange,now:i})]}),l?(0,J.jsx)(Q,{taskId:e,change:n}):null]},n.path)})})}function te({taskId:e,changes:t,now:n}){let r=(0,q.useMemo)(()=>N(t),[t]),i=(0,q.useMemo)(()=>M(r),[r]),[a,o]=(0,q.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,q.useState)(new Set);return(0,J.jsx)($,{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 ne({task:e,now:t}){let n=a(e.id),i=s(),o=`task/${e.id}`,c;if(n.data!==void 0){let{files:r,total:i,head:a}=n.data;c=r.length===0?(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,o,` yet.`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[i===1?`1 file`:`${i} files`,` changed · newest commit by `,a.author,` `,p(a.at,t)]}),(0,J.jsx)(te,{taskId:e.id,changes:r,now:t}),i>r.length?(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,r.length,` of `,i]}):null]})}else if(n.error instanceof r&&n.error.status===404)c=(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,o,` yet.`]});else if(n.error instanceof r&&n.error.status===503){let t=i.data?.find(t=>t.slug===e.project);c=(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[t?.runner===void 0?`The runner`:`${t.runner}, the runner`,` `,t?.name??e.project,` lives on, is not connected, so the task's files cannot be listed now.`]})}else c=n.error===null?(0,J.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,J.jsx)(`p`,{className:`mt-2 text-meta`,children:n.error.message});return(0,J.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,J.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,J.jsx)(F,{source:{kind:`task`,taskId:e.id},path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),c]})}function re({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=x(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,J.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,J.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,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,J.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,J.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,S(e),c===void 0?null:(0,J.jsxs)(J.Fragment,{children:[` · held by `,(0,J.jsx)(k,{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 ie({task:e,stage:n}){let{api:r}=d(),i=t(),[a,o]=(0,q.useState)(``),s=e.stages.findIndex(e=>e.id===n.id),c=e.stages[s+1]===void 0&&e.onDone===`ghpr`&&e.pullRequest===void 0,l=g({mutationFn:()=>r.advanceTask({task_id:e.id,...a.trim()===``?{}:{note:a.trim()}}),onSuccess:async()=>{o(``),await i.invalidateQueries({queryKey:[`task`,e.id]}),await i.invalidateQueries({queryKey:[`tasks`]})}});return(0,J.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(),l.mutate()},children:[(0,J.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[n.name,` waits on you.`,c?` No pull request linked yet.`:``]}),(0,J.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,J.jsx)(`div`,{className:`flex justify-end`,children:(0,J.jsx)(_,{variant:`primary`,type:`submit`,disabled:l.isPending,children:l.isPending?`Approving…`:`Approve`})}),(0,J.jsx)(z,{error:l.error})]})}function ae({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,J.jsxs)(`section`,{"aria-label":`Pull request`,className:`mt-5 border-t border-line pt-4`,children:[(0,J.jsx)(`h3`,{className:`text-section`,children:`Pull request`}),(0,J.jsxs)(`p`,{className:`mt-2 text-sm`,children:[(0,J.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,J.jsxs)(`span`,{className:`text-meta`,children:[` `,`· linked by `,n.linkedBy,` `,p(n.linkedAt,t)]})]}),e.status===`abandoned`&&e.onDone===`ghpr`?(0,J.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,J.jsxs)(`span`,{className:`text-meta`,children:[` · `,p(n.closed.at,t)]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`mt-3 text-caps text-fg-muted`,children:`Merges as`}),(0,J.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 oe(){let{taskId:t}=E({from:`/task/$taskId`}),
|
|
3
|
+
`);return(0,J.jsxs)(`section`,{"aria-label":`Pull request`,className:`mt-5 border-t border-line pt-4`,children:[(0,J.jsx)(`h3`,{className:`text-section`,children:`Pull request`}),(0,J.jsxs)(`p`,{className:`mt-2 text-sm`,children:[(0,J.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,J.jsxs)(`span`,{className:`text-meta`,children:[` `,`· linked by `,n.linkedBy,` `,p(n.linkedAt,t)]})]}),e.status===`abandoned`&&e.onDone===`ghpr`?(0,J.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,J.jsxs)(`span`,{className:`text-meta`,children:[` · `,p(n.closed.at,t)]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`mt-3 text-caps text-fg-muted`,children:`Merges as`}),(0,J.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 oe(){let{taskId:t}=E({from:`/task/$taskId`}),i=n(t),a=c(),o=s(),l=m(),d=h(3e4),f=A(),g=e(a.data?.some(e=>e.id===t)===!0?t:null);if(i.data===void 0)return(0,J.jsx)(B,{children:i.error instanceof r&&i.error.status===404?`There is no task ${t}.`:`Reading the task…`});let _=i.data,x=C(_),S=T(_),k=o.data?.find(e=>e.slug===_.project),M=a.data?.find(e=>e.id===_.id);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(V,{leading:(0,J.jsx)(j,{fallback:(0,J.jsx)(u,{to:`/p/$slug/tasks`,params:{slug:_.project},"aria-label":`Back to the tasks of ${k?.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:`${k?.name??_.project}${_.channel===`general`?``:` #${_.channel}`} · ${v(_)} · created by ${f(_.createdBy)} ${p(_.createdAt,d)}`,trailing:(0,J.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${b[x]}`,children:w.find(e=>e.phase===x)?.label.toLowerCase()})}),(0,J.jsxs)(ee,{stick:!1,follow:!1,ids:g.data?.messages.map(e=>e.id),className:`px-4 py-4`,children:[(0,J.jsx)(`h3`,{className:`text-section`,children:`Plan`}),_.returned===void 0?null:(0,J.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 `,y(_,_.returned.from),` by `,_.returned.by,` `,p(_.returned.at,d),`.`]}),(0,J.jsx)(`ol`,{className:`mt-3`,children:_.stages.map((e,t)=>(0,J.jsx)(re,{stage:e,index:t,task:_,members:l.data,now:d},e.id))}),S===null?null:(0,J.jsx)(ie,{task:_,stage:S}),(0,J.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,J.jsxs)(J.Fragment,{children:[` · blocked by `,(0,J.jsx)(D,{text:_.blockedBy.join(`, `)})]}):null]}),_.body.trim()===``?null:(0,J.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,J.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,J.jsx)(`div`,{className:`mt-2`,children:(0,J.jsx)(L,{text:_.body})})]}),(0,J.jsx)(ae,{task:_,now:d}),(0,J.jsx)(ne,{task:_,now:d}),(0,J.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,J.jsx)(`h3`,{className:`text-section`,children:`Thread`}),a.data===void 0?null:M===void 0?(0,J.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,J.jsx)(K,{thread:M,now:d,task:_,empty:`Nothing said yet.`})]})]},_.id),M?.state===`open`?(0,J.jsx)(O,{target:{threadId:_.id},placeholder:`Write in the task's thread`}):null]})}export{oe as TaskView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kn as e,S as t,St as n,Xn as r,Zt as i,qn as a,t as o,v as s,x as c,z as l}from"./format-Dhd2NUB3.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-D_Fy7dtN.js";import{A as _,o as v}from"./index-iplooQqq.js";import{n as y,t as b}from"./Pane-C9TbEME4.js";var x=r(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:t,now:r}){let a=h(e),s=n(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(i,{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,r)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&a!==`landing`&&s!==void 0?(0,S.jsxs)(S.Fragment,{children:[s.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&a!==`landing`&&s!==void 0?`${s.name} · waiting for ${m(s)} since ${o(e.stageSince,r)}`:a===`landing`?`landing task/${e.id} on the default branch`:`${a} ${o(e.updatedAt,r)}`})]})})}function E(){let{slug:e}=_({from:`/p/$slug/tasks`}),n=l(e),r=t(),i=s(),a=c(3e4),[o,u]=(0,x.useState)(new Set),f=r.data?.find(t=>t.slug===e),p=d(n.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 · ${n.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:n.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`||o.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:i.data,now:a},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...o,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{D as e,
|
|
1
|
+
import{D as e,Gn as t,K as n,Kn as r,Xn as i,j as a,qn as o,v as s}from"./format-Dhd2NUB3.js";import{n as c,t as l}from"./Button-D4-iu6aX.js";import{i as u,l as d}from"./compose-D-X3BQgY.js";import{n as f}from"./mentions-S-r32HKM.js";var p=i(o(),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}=a(),o=t(),f=d(),g=s(),_=e(),[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=>{o.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 ${u(D)}.`:null}),(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:e,channel:n,onDone:r}){let{api:i}=a(),o=t(),[s,u]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>i.closeThread({thread_id:e,summary:s.trim()}),onSuccess:()=>{for(let t of[[`thread`,e],[`threads`],[`channel`,n]])o.invalidateQueries({queryKey:t});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?`,"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{Kn as e,Zt as t,n,t as r}from"./format-Dhd2NUB3.js";import{_ as i,s as a}from"./index-iplooQqq.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?``:n(e.body,180),p=d?void 0:e.closedAt,m=p??e.openedAt;return(0,o.jsxs)(t,{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{I as e,
|
|
1
|
+
import{I as e,K as t,Kn as n,Tn as r,Xn as i,Zt as a,j as o,qn as s,t as c,v as l,x as u}from"./format-Dhd2NUB3.js";import{t as d}from"./Button-D4-iu6aX.js";import{A as f,C as p,i as m,k as h,s as g}from"./index-iplooQqq.js";import{t as _}from"./BackLink-BLiSCuKv.js";import{t as v}from"./Markdown-DPqvK--4.js";import{t as y}from"./ThreadForms-DwUOktyP.js";import{t as b}from"./MessageItem-WBTzWwyj.js";import{n as x,t as S}from"./Pane-C9TbEME4.js";import{t as C}from"./StickyList-DafbJutb.js";import{r as w,t as T}from"./ThreadItem-Blx8gSvO.js";var E=i(s(),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:i}){let{api:s}=o(),f=r({queryKey:[`thread`,n],queryFn:()=>s.thread(n)}),h=l(),O=u(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=e(P?.kind===`task`?P.id:null);if(f.data===void 0)return(0,D.jsx)(x,{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)(S,{leading:(0,D.jsx)(_,{fallback:(0,D.jsx)(a,{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:`${w(I.subject)} thread in #${I.channel} · opened by ${k(I.openedBy)} ${c(I.openedAt,O)}`,trailing:(0,D.jsxs)(D.Fragment,{children:[I.subject?.kind===`task`?(0,D.jsx)(a,{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)(a,{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)(T,{state:I.state})]})}),M&&I.state===`open`?(0,D.jsx)(y,{threadId:I.id,channel:I.channel,onDone:()=>N(!1)}):null,(0,D.jsxs)(C,{stick:i===void 0,ids:A.map(e=>e.id),className:`py-2`,children:[A.length===0?(0,D.jsx)(x,{children:`No messages in this thread yet.`}):null,A.map(e=>(0,D.jsx)(b,{message:e,members:h.data,now:O,task:F.data,target:e.id===i},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?``:` ${c(I.closedAt,O)}`]}),I.body.trim()===``?(0,D.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,w(I.subject),`.`]}):(0,D.jsx)(v,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{st as e,yt as t}from"./format-Dhd2NUB3.js";import{l as n}from"./index-iplooQqq.js";function r(e){return e===`society`?`the society`:e}function i(e){return[...e.memberships,t]}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={unread:`for unread posts`,held:`for a held stage`,waiting:`for a stage to take`};function c(e){return e.heartbeat===void 0?e.trigger:`${e.trigger} ${s[e.heartbeat]}`}var l={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function u(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:l[e.exitReason]??e.exitReason}function d(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}var f=new Intl.NumberFormat(`en`,{notation:`compact`}),p=new Intl.NumberFormat(`en`);function m(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function h(e){return{input:`${f.format(m(e))} in`,output:`${f.format(e.outputTokens)} out`}}function g(e){let{input:t,output:n}=h(e);return`${t} · ${n}`}function _(e){return[`${p.format(m(e))} input tokens: ${p.format(e.cacheReadTokens)} read from the cache,`,`${p.format(e.cacheWriteTokens)} written to it, ${p.format(e.inputTokens)} neither;`,`${p.format(e.outputTokens)} output tokens`].join(` `)}function v(t){let n=t.flatMap(e=>e.usage===void 0?[]:[e.usage]);return{turns:t.length,failed:t.filter(d).length,usage:n.length===0?null:n.reduce(e),withUsage:n.length}}var y={"24h":`in the last 24 hours`,"7d":`in the last 7 days`,all:`in all`};function b(e){return e===1?`1 finished turn`:`${e} finished turns`}function x(e,t){let n=y[t];if(e===void 0||e.turns===0)return{label:`no turns`,counts:null,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`,counts:null,detail:`${b(e.turns)} ${n}, none with a token count: ${i}`,spoken:`${b(e.turns)} ${n}, none counted`};let a={label:g(e.usage),counts:h(e.usage)};if(r===0)return{...a,detail:`${_(e.usage)}; over ${b(e.turns)} ${n}`,spoken:null};let o=`over ${e.withUsage} of ${b(e.turns)} ${n}`;return{...a,detail:[`${_(e.usage)}; ${o}.`,`The other ${r===1?`one has`:`${r} have`} no count: ${i}.`].join(` `),spoken:o}}function S(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 C(e,t){return[...new Set([e.homeRunner,...e.memberships.map(e=>t.get(e))].filter(e=>e!==void 0))]}function w(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=C(e,t),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{a,_ as c,C as d,i as f,w as i,g as l,c as m,u as n,r as o,S as p,v as r,x as s,s as t,o as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as e,Xn as t,dt as n,qn as r}from"./format-Dhd2NUB3.js";var i=t(r(),1);function a(t){let n=e();return i.useCallback(e=>n.navigate({...e,from:e.from??t?.from}),[t?.from,n])}function o(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 s(e,t,n,r){let i=`@${r} `;return{text:e.slice(0,n)+i+e.slice(t),caret:n+i.length}}function c(e,t=1){let r=n(e);return t===1?`![Uploading ${r}…]()`:`![Uploading ${r} (${t})…]()`}function l(e,t,n){for(let r=1;;r+=1){let i=c(e,r);if(!t.includes(i)&&!n.includes(i))return i}}function u(e,t,n,r){let i=Math.min(Math.max(t,0),e.length),a=Math.min(Math.max(n,i),e.length);return{text:e.slice(0,i)+r+e.slice(a),caret:i+r.length}}function d(e,t,n,r){let i=e.indexOf(n);if(i===-1)return null;let a=i+n.length;return{text:e.slice(0,i)+r+e.slice(a),caret:t<=i?t:t>=a?t-n.length+r.length:i+r.length}}var f=/!\[([^\]\n]*)\]\(image:([0-9A-HJKMNP-TV-Z]{26})\)/g;function p(e,t){let n=[];for(let t of e.matchAll(f))n.push({kind:`kept`,start:t.index,text:t[0],id:t[2]??null,alt:t[1]??``});for(let r of t){let t=e.indexOf(r);if(t!==-1){let e=r.slice(12,-4);n.push({kind:`uploading`,start:t,text:r,id:null,alt:e})}}return n.toSorted((e,t)=>e.start-t.start)}function m(e,t,n){let r=n.start+n.text.length;return e.slice(n.start,r)===n.text?{text:e.slice(0,n.start)+e.slice(r),caret:t<=n.start?t:t>=r?t-n.text.length:n.start}:{text:e,caret:t}}var h=new Intl.ListFormat(`en`,{type:`conjunction`});function g(e){return h.format(e)}export{o as a,l as c,g as i,a as l,p as n,m as o,u as r,d as s,s as t};
|