@kubitnodes/stellaris 0.3.24 → 0.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/cli/index.js +99 -553
  2. package/dist/server/index.js +303 -579
  3. package/package.json +4 -4
  4. package/web/dist/assets/BackLink-UTiLF1J4.js +1 -0
  5. package/web/dist/assets/Button-Cp4cNRUX.js +1 -0
  6. package/web/dist/assets/ChannelForms-DD2B0tey.js +1 -0
  7. package/web/dist/assets/{ChannelView-BIXouQMX.js → ChannelView-CY3oG9hZ.js} +2 -2
  8. package/web/dist/assets/CitizenView-BNK5ro-6.js +2 -0
  9. package/web/dist/assets/{CitizensView-CYFS3f9U.js → CitizensView-WPQ6Jhl3.js} +1 -1
  10. package/web/dist/assets/{CliIcon-DVX5iLhG.js → CliIcon-C7bwChMP.js} +1 -1
  11. package/web/dist/assets/CronsView-_pdgwX1I.js +1 -0
  12. package/web/dist/assets/FileTree-jyDUSu7g.js +1 -0
  13. package/web/dist/assets/FileView-DcQvlc8V.js +4 -0
  14. package/web/dist/assets/KnowledgeView-DDl0HQPG.js +1 -0
  15. package/web/dist/assets/{Markdown--whKJBYV.js → Markdown-DT3V-EVe.js} +7 -7
  16. package/web/dist/assets/{MessageItem-BvDOeJci.js → MessageItem-agtEugfG.js} +1 -1
  17. package/web/dist/assets/MetricsView-DiXyYeWP.js +1 -0
  18. package/web/dist/assets/NeedsYouView-CKmuYan_.js +1 -0
  19. package/web/dist/assets/Overview-CKcTqsMM.js +1 -0
  20. package/web/dist/assets/{Pane-DTmByqgA.js → Pane-BaM0TdE6.js} +1 -1
  21. package/web/dist/assets/{Picker-DsHm4f7s.js → Picker-C2ig-0dT.js} +1 -1
  22. package/web/dist/assets/ProjectView-T2OHTh5j.js +1 -0
  23. package/web/dist/assets/ProposalView-B5yjTAcn.js +1 -0
  24. package/web/dist/assets/ProposalsView-p4KjwV9p.js +1 -0
  25. package/web/dist/assets/{Quota-D8WDWp5H.js → Quota-CfFGIql9.js} +1 -1
  26. package/web/dist/assets/RunnersView-DdvwoOur.js +1 -0
  27. package/web/dist/assets/{SkillFileList-DhdEcFQA.js → SkillFileList-CgrCnuaC.js} +1 -1
  28. package/web/dist/assets/SkillView-Di5Z9h2L.js +1 -0
  29. package/web/dist/assets/SocietyView-BDiVxUC5.js +1 -0
  30. package/web/dist/assets/StickyList-BaV_KZ8x.js +1 -0
  31. package/web/dist/assets/{SubjectThread-BEXt-tub.js → SubjectThread-DD_ZCCnr.js} +1 -1
  32. package/web/dist/assets/TaskView-CKcs-MOC.js +3 -0
  33. package/web/dist/assets/TasksView-oZMjncOU.js +1 -0
  34. package/web/dist/assets/{ThreadForms-DzoRDeBh.js → ThreadForms-CG5Y926b.js} +1 -1
  35. package/web/dist/assets/{ThreadItem-CDVppcOZ.js → ThreadItem-D-n2arFA.js} +1 -1
  36. package/web/dist/assets/{ThreadView-B4F10_j1.js → ThreadView-CT9vd0P4.js} +1 -1
  37. package/web/dist/assets/{citizen-BPIJzKdn.js → citizen-BiHfph2A.js} +1 -1
  38. package/web/dist/assets/{compose-BUhbVoI-.js → compose-DY1WL8zB.js} +1 -1
  39. package/web/dist/assets/format-CENiwkJC.js +55 -0
  40. package/web/dist/assets/governance-C6ez5MLh.js +1 -0
  41. package/web/dist/assets/index-CPXALUV6.js +23 -0
  42. package/web/dist/assets/{index-Bj8MlyAn.css → index-DIa8Dlav.css} +1 -1
  43. package/web/dist/assets/mentions-BEL5U6ra.js +3 -0
  44. package/web/dist/assets/{tasks-CTaxXtGL.js → tasks-CAI8Eci7.js} +1 -1
  45. package/web/dist/assets/useMatch-CINzyDWa.js +1 -0
  46. package/web/dist/index.html +9 -9
  47. package/web/dist/assets/BackLink-DKMw_rHu.js +0 -1
  48. package/web/dist/assets/Button-BYJGqZ3Q.js +0 -1
  49. package/web/dist/assets/ChannelForms-CkYupEL2.js +0 -1
  50. package/web/dist/assets/CitizenView-C3AMFixP.js +0 -2
  51. package/web/dist/assets/CronsView-BGCcO7bH.js +0 -1
  52. package/web/dist/assets/KnowledgeView-DLLYjd1G.js +0 -1
  53. package/web/dist/assets/MetricsView-B-KUNOZm.js +0 -1
  54. package/web/dist/assets/NeedsYouView-Dee_bOKj.js +0 -1
  55. package/web/dist/assets/Overview-DFiHDFnA.js +0 -1
  56. package/web/dist/assets/ProjectView-DsRXW-qk.js +0 -1
  57. package/web/dist/assets/ProposalView-B-4P1S-s.js +0 -1
  58. package/web/dist/assets/ProposalsView-uEuj-ooV.js +0 -1
  59. package/web/dist/assets/RunnersView-BB3q65rG.js +0 -1
  60. package/web/dist/assets/SkillView-vAv7zvtJ.js +0 -1
  61. package/web/dist/assets/SocietyView-Dv4phSkz.js +0 -1
  62. package/web/dist/assets/StickyList-C4fC_KJv.js +0 -1
  63. package/web/dist/assets/TaskFileView-B9sex0tS.js +0 -4
  64. package/web/dist/assets/TaskView-BCT388kb.js +0 -3
  65. package/web/dist/assets/TasksView-CuPay34-.js +0 -1
  66. package/web/dist/assets/format-CvfmDNoY.js +0 -55
  67. package/web/dist/assets/governance-Bba0OHvJ.js +0 -1
  68. package/web/dist/assets/index-DD3J11PT.js +0 -23
  69. package/web/dist/assets/mentions-D838wlfQ.js +0 -3
  70. package/web/dist/assets/useMatch-B8j0hm1q.js +0 -1
@@ -1 +1 @@
1
- import{A as e,At as t,Dt as n,Gn as r,Jn as i,Ot as a,Un as o,Wn as s,Yt as c,kt as l,t as u}from"./format-CvfmDNoY.js";import{n as d,t as f}from"./Button-BYJGqZ3Q.js";import{t as p}from"./CliIcon-DVX5iLhG.js";import{u as m}from"./citizen-BPIJzKdn.js";var h=i(r(),1);function g(e,t){return e===void 0||t-Date.parse(e.observedAt)>=9e5}function _(e){let t=[];for(let n of e)for(let e of n.clis){let r=n.quotas?.[e],i=r===void 0?void 0:t.find(t=>t.cli===e&&t.quota!==void 0&&a(t.quota,r));i===void 0?t.push({cli:e,runners:[n.name],quota:r,connected:n.status===`connected`}):i.runners.push(n.name)}return t}function v(e){let t=Math.max(1,Math.round(e/6e4));if(t<60)return`${t}m`;let n=Math.floor(t/60);return n<24?`${n}h ${t%60}m`:`${Math.floor(n/24)}d ${n%24}h`}function y(e,n){let r=t(e);if(!l(e,new Date(n)))return{name:r,percent:null,label:`reset`,reset:`reset since read`,high:!1};let i=e.usedPercent;return{name:r,percent:i===null?null:Math.min(100,i),label:i===null?`?`:`${Math.floor(i)}%`,reset:e.resetsAt===null?``:`resets in ${v(Date.parse(e.resetsAt)-n)}`,high:i!==null&&i>=80}}function b(e,t){let r=n(e,new Date(t));return r===`limited`?{level:r,words:e.limitedUntil===null?`limited`:`limited for ${v(Date.parse(e.limitedUntil)-t)}`,tone:`text-red-300`}:r===`warning`?{level:r,words:`near a limit`,tone:`text-amber-300`}:{level:r,words:r===`none`?`no plan limits reported`:``,tone:`text-fg-muted`}}function x(e,t){if(e===void 0)return`unknown`;let{level:n,words:r}=b(e,t);return n===`limited`||n===`none`?r:[...e.windows.map(e=>y(e,t)).map(e=>`${e.name} ${e.label}`),...r===``?[]:[r]].join(` · `)||`no windows reported`}var S=s(),C={claude:`bg-claude`,codex:`bg-codex`};function w(e){if(e.credits!==null){if(e.credits.unlimited)return`unlimited credits`;let t=Number(e.credits.balance);return e.credits.balance===null||Number.isNaN(t)?null:`credits ${t.toLocaleString(`en`)}`}let t=e.extraUsage;if(t===null||!t.enabled||t.usedCredits===null)return null;let n=e=>`${(e/100).toFixed(2)}${t.currency===null?``:` ${t.currency}`}`;return`extra usage ${n(t.usedCredits)}${t.monthlyLimit===null?``:` of ${n(t.monthlyLimit)}`}`}function T({cli:e,quota:t,now:n}){let r=b(t,n).level===`limited`?t.limitedBy:null;return(0,S.jsx)(`ul`,{className:`col-span-full mt-1 grid grid-cols-subgrid gap-y-0.5 pl-6`,children:t.windows.map(t=>{let i=y(t,n),a=t.key===r||(i.percent??0)>=100?`bg-red-400`:i.high?`bg-amber-400`:C[e];return(0,S.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-center text-xs`,children:[(0,S.jsx)(`span`,{className:`text-fg-secondary`,children:i.name}),(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,S.jsx)(`span`,{className:`block h-full rounded-full ${a}`,style:{width:`${i.percent??0}%`}})}),(0,S.jsx)(`span`,{className:`text-right text-fg-secondary tabular-nums`,children:i.label}),(0,S.jsx)(`span`,{className:`truncate text-fg-muted`,title:t.resetsAt===null?void 0:t.resetsAt,children:i.reset})]},t.key)})})}function E(e,t,n,r){if(n)return{words:`reading…`,detail:`asking the CLI on the runner`,tone:`text-fg-muted`};let i=e.quota;if(r!==void 0&&i===void 0)return{words:r.includes(`upgrade it`)?`runner too old to read`:`read failed`,detail:r,tone:`text-amber-300`};if(i===void 0)return e.connected?{words:`unknown`,detail:`nothing reported yet`,tone:`text-fg-muted`}:{words:`unknown`,detail:`nothing reported yet, and the runner is away`,tone:`text-fg-muted`};let{words:a,tone:o}=b(i,t),s=`as of ${u(i.observedAt,t)}`,c=i.source===`read`?`read on request`:`reported by a turn`;return{words:a===``?s:`${a} · ${s}`,detail:`${c} at ${i.observedAt}${r===void 0?``:`; the last read failed: ${r}`}`,tone:g(i,t)&&a===``?`text-fg-muted`:o}}function D({runners:t,now:n}){let{api:r}=e(),i=o(),[a,s]=(0,h.useState)(new Set),[c,l]=(0,h.useState)(new Map),u=(0,h.useRef)(new Set),{mutate:m}=d({mutationFn:({runner:e,cli:t})=>r.readQuota(e,t),onMutate:({runner:e,cli:t})=>{s(n=>new Set(n).add(`${e}/${t}`))},onSuccess:(e,{runner:t,cli:n})=>{l(e=>{let r=new Map(e);return r.delete(`${t}/${n}`),r})},onError:(e,{runner:t,cli:n})=>{l(r=>new Map(r).set(`${t}/${n}`,e.message))},onSettled:(e,t,{runner:n,cli:r})=>{s(e=>{let t=new Set(e);return t.delete(`${n}/${r}`),t}),i.invalidateQueries({queryKey:[`runners`]})}});(0,h.useEffect)(()=>{for(let e of t)if(e.status===`connected`)for(let t of e.clis){let n=`${e.name}/${t}`;!u.current.has(n)&&g(e.quotas?.[t],Date.now())&&(u.current.add(n),m({runner:e.name,cli:t}))}},[t,m]);let v=t.filter(e=>e.status===`connected`),y=_(t);return y.length===0?null:(0,S.jsxs)(`section`,{"aria-label":`Plan quota`,className:`mt-3 border-t border-line pt-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 px-2`,children:[(0,S.jsx)(`h2`,{className:`flex-1 text-section text-fg-primary`,children:`Plan quota`}),(0,S.jsx)(f,{className:`-mr-3`,disabled:v.length===0||a.size>0,onClick:()=>{for(let e of v)for(let t of e.clis)m({runner:e.name,cli:t})},children:a.size>0?`Reading…`:`Read again`})]}),(0,S.jsx)(`ul`,{"aria-label":`Quota by runner`,className:`mt-1.5 grid grid-cols-[auto_minmax(3rem,7rem)_auto_minmax(0,1fr)] gap-x-2 gap-y-1`,children:y.map(e=>{let t=e.runners[0]??``,r=`${t}/${e.cli}`,i=E(e,n,a.has(r),c.get(r)),o=e.quota?.plan,s=e.quota===void 0?null:w(e.quota);return(0,S.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid rounded-lg px-2 py-1.5`,children:[(0,S.jsxs)(`div`,{className:`col-span-full flex items-center gap-2 text-sm`,children:[(0,S.jsx)(p,{cli:e.cli,size:13}),(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.runners.join(` · `)}),(0,S.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[e.cli,o==null?``:` · ${o}`,s===null?``:` · ${s}`]}),(0,S.jsxs)(`span`,{className:`ml-auto text-right text-xs ${i.tone}`,title:i.detail,children:[i.words,(0,S.jsxs)(`span`,{className:`sr-only`,children:[`, `,i.detail]})]})]}),e.quota===void 0||e.quota.windows.length===0?null:(0,S.jsx)(T,{cli:e.cli,quota:e.quota,now:n}),e.runners.length>1?(0,S.jsxs)(`p`,{className:`col-span-full pt-0.5 pl-6 text-meta`,children:[`Same numbers on `,e.runners.join(` and `),`, so most likely one login.`]}):null]},`${e.cli}/${t}`)})})]})}function O({member:e,runners:t,placed:n,now:r}){let i=e.cli,a=m(e,n);return i===null||a.length===0?null:(0,S.jsxs)(`p`,{className:`border-b border-line px-4 py-1.5 text-meta`,children:[(0,S.jsxs)(c,{to:`/runners`,className:`hover:text-fg-primary`,children:[i,` quota`]}),a.map(e=>{let n=t.find(t=>t.name===e)?.quotas?.[i],a=n===void 0?``:b(n,r).tone;return(0,S.jsxs)(`span`,{children:[` · `,e,` `,(0,S.jsx)(`span`,{className:a,title:n===void 0?`nothing reported yet`:`as of ${n.observedAt}`,children:x(n,r)})]},e)})]})}function k({member:e,runners:t,placed:n,now:r}){let i=e.cli;if(i===null)return null;let a=m(e,n).flatMap(e=>{let n=t.find(t=>t.name===e)?.quotas?.[i];if(n===void 0)return[];let{level:a,words:o}=b(n,r);return a===`limited`||a===`warning`?[{name:e,level:a,words:o}]:[]});if(a.length===0)return null;let o=a.some(e=>e.level===`limited`),s=a.map(e=>`${i} ${e.words} on ${e.name}`).join(`; `);return(0,S.jsx)(`span`,{title:s,className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full ${o?`bg-red-400`:`bg-amber-400`}`,children:(0,S.jsxs)(`span`,{className:`sr-only`,children:[`, `,s]})})}export{D as n,k as r,O as t};
1
+ import{Dt as e,Et as t,Hn as n,Jt as r,Ot as i,Un as a,Wn as o,j as s,kt as c,qn as l,t as u}from"./format-CENiwkJC.js";import{n as d,t as f}from"./Button-Cp4cNRUX.js";import{t as p}from"./CliIcon-C7bwChMP.js";import{u as m}from"./citizen-BiHfph2A.js";var h=l(o(),1);function g(e,t){return e===void 0||t-Date.parse(e.observedAt)>=9e5}function _(t){let n=[];for(let r of t)for(let t of r.clis){let i=r.quotas?.[t],a=i===void 0?void 0:n.find(n=>n.cli===t&&n.quota!==void 0&&e(n.quota,i));a===void 0?n.push({cli:t,runners:[r.name],quota:i,connected:r.status===`connected`}):a.runners.push(r.name)}return n}function v(e){let t=Math.max(1,Math.round(e/6e4));if(t<60)return`${t}m`;let n=Math.floor(t/60);return n<24?`${n}h ${t%60}m`:`${Math.floor(n/24)}d ${n%24}h`}function y(e,t){let n=c(e);if(!i(e,new Date(t)))return{name:n,percent:null,label:`reset`,reset:`reset since read`,high:!1};let r=e.usedPercent;return{name:n,percent:r===null?null:Math.min(100,r),label:r===null?`?`:`${Math.floor(r)}%`,reset:e.resetsAt===null?``:`resets in ${v(Date.parse(e.resetsAt)-t)}`,high:r!==null&&r>=80}}function b(e,n){let r=t(e,new Date(n));return r===`limited`?{level:r,words:e.limitedUntil===null?`limited`:`limited for ${v(Date.parse(e.limitedUntil)-n)}`,tone:`text-red-300`}:r===`warning`?{level:r,words:`near a limit`,tone:`text-amber-300`}:{level:r,words:r===`none`?`no plan limits reported`:``,tone:`text-fg-muted`}}function x(e,t){if(e===void 0)return`unknown`;let{level:n,words:r}=b(e,t);return n===`limited`||n===`none`?r:[...e.windows.map(e=>y(e,t)).map(e=>`${e.name} ${e.label}`),...r===``?[]:[r]].join(` · `)||`no windows reported`}var S=a(),C={claude:`bg-claude`,codex:`bg-codex`};function w(e){if(e.credits!==null){if(e.credits.unlimited)return`unlimited credits`;let t=Number(e.credits.balance);return e.credits.balance===null||Number.isNaN(t)?null:`credits ${t.toLocaleString(`en`)}`}let t=e.extraUsage;if(t===null||!t.enabled||t.usedCredits===null)return null;let n=e=>`${(e/100).toFixed(2)}${t.currency===null?``:` ${t.currency}`}`;return`extra usage ${n(t.usedCredits)}${t.monthlyLimit===null?``:` of ${n(t.monthlyLimit)}`}`}function T({cli:e,quota:t,now:n}){let r=b(t,n).level===`limited`?t.limitedBy:null;return(0,S.jsx)(`ul`,{className:`col-span-full mt-1 grid grid-cols-subgrid gap-y-0.5 pl-6`,children:t.windows.map(t=>{let i=y(t,n),a=t.key===r||(i.percent??0)>=100?`bg-red-400`:i.high?`bg-amber-400`:C[e];return(0,S.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-center text-xs`,children:[(0,S.jsx)(`span`,{className:`text-fg-secondary`,children:i.name}),(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,S.jsx)(`span`,{className:`block h-full rounded-full ${a}`,style:{width:`${i.percent??0}%`}})}),(0,S.jsx)(`span`,{className:`text-right text-fg-secondary tabular-nums`,children:i.label}),(0,S.jsx)(`span`,{className:`truncate text-fg-muted`,title:t.resetsAt===null?void 0:t.resetsAt,children:i.reset})]},t.key)})})}function E(e,t,n,r){if(n)return{words:`reading…`,detail:`asking the CLI on the runner`,tone:`text-fg-muted`};let i=e.quota;if(r!==void 0&&i===void 0)return{words:r.includes(`upgrade it`)?`runner too old to read`:`read failed`,detail:r,tone:`text-amber-300`};if(i===void 0)return e.connected?{words:`unknown`,detail:`nothing reported yet`,tone:`text-fg-muted`}:{words:`unknown`,detail:`nothing reported yet, and the runner is away`,tone:`text-fg-muted`};let{words:a,tone:o}=b(i,t),s=`as of ${u(i.observedAt,t)}`,c=i.source===`read`?`read on request`:`reported by a turn`;return{words:a===``?s:`${a} · ${s}`,detail:`${c} at ${i.observedAt}${r===void 0?``:`; the last read failed: ${r}`}`,tone:g(i,t)&&a===``?`text-fg-muted`:o}}function D({runners:e,now:t}){let{api:r}=s(),i=n(),[a,o]=(0,h.useState)(new Set),[c,l]=(0,h.useState)(new Map),u=(0,h.useRef)(new Set),{mutate:m}=d({mutationFn:({runner:e,cli:t})=>r.readQuota(e,t),onMutate:({runner:e,cli:t})=>{o(n=>new Set(n).add(`${e}/${t}`))},onSuccess:(e,{runner:t,cli:n})=>{l(e=>{let r=new Map(e);return r.delete(`${t}/${n}`),r})},onError:(e,{runner:t,cli:n})=>{l(r=>new Map(r).set(`${t}/${n}`,e.message))},onSettled:(e,t,{runner:n,cli:r})=>{o(e=>{let t=new Set(e);return t.delete(`${n}/${r}`),t}),i.invalidateQueries({queryKey:[`runners`]})}});(0,h.useEffect)(()=>{for(let t of e)if(t.status===`connected`)for(let e of t.clis){let n=`${t.name}/${e}`;!u.current.has(n)&&g(t.quotas?.[e],Date.now())&&(u.current.add(n),m({runner:t.name,cli:e}))}},[e,m]);let v=e.filter(e=>e.status===`connected`),y=_(e);return y.length===0?null:(0,S.jsxs)(`section`,{"aria-label":`Plan quota`,className:`mt-3 border-t border-line pt-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 px-2`,children:[(0,S.jsx)(`h2`,{className:`flex-1 text-section text-fg-primary`,children:`Plan quota`}),(0,S.jsx)(f,{className:`-mr-3`,disabled:v.length===0||a.size>0,onClick:()=>{for(let e of v)for(let t of e.clis)m({runner:e.name,cli:t})},children:a.size>0?`Reading…`:`Read again`})]}),(0,S.jsx)(`ul`,{"aria-label":`Quota by runner`,className:`mt-1.5 grid grid-cols-[auto_minmax(3rem,7rem)_auto_minmax(0,1fr)] gap-x-2 gap-y-1`,children:y.map(e=>{let n=e.runners[0]??``,r=`${n}/${e.cli}`,i=E(e,t,a.has(r),c.get(r)),o=e.quota?.plan,s=e.quota===void 0?null:w(e.quota);return(0,S.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid rounded-lg px-2 py-1.5`,children:[(0,S.jsxs)(`div`,{className:`col-span-full flex items-center gap-2 text-sm`,children:[(0,S.jsx)(p,{cli:e.cli,size:13}),(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.runners.join(` · `)}),(0,S.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[e.cli,o==null?``:` · ${o}`,s===null?``:` · ${s}`]}),(0,S.jsxs)(`span`,{className:`ml-auto text-right text-xs ${i.tone}`,title:i.detail,children:[i.words,(0,S.jsxs)(`span`,{className:`sr-only`,children:[`, `,i.detail]})]})]}),e.quota===void 0||e.quota.windows.length===0?null:(0,S.jsx)(T,{cli:e.cli,quota:e.quota,now:t}),e.runners.length>1?(0,S.jsxs)(`p`,{className:`col-span-full pt-0.5 pl-6 text-meta`,children:[`Same numbers on `,e.runners.join(` and `)]}):null]},`${e.cli}/${n}`)})})]})}function O({member:e,runners:t,placed:n,now:i}){let a=e.cli,o=m(e,n);return a===null||o.length===0?null:(0,S.jsxs)(`p`,{className:`border-b border-line px-4 py-1.5 text-meta`,children:[(0,S.jsxs)(r,{to:`/runners`,className:`hover:text-fg-primary`,children:[a,` quota`]}),o.map(e=>{let n=t.find(t=>t.name===e)?.quotas?.[a],r=n===void 0?``:b(n,i).tone;return(0,S.jsxs)(`span`,{children:[` · `,e,` `,(0,S.jsx)(`span`,{className:r,title:n===void 0?`nothing reported yet`:`as of ${n.observedAt}`,children:x(n,i)})]},e)})]})}function k({member:e,runners:t,placed:n,now:r}){let i=e.cli;if(i===null)return null;let a=m(e,n).flatMap(e=>{let n=t.find(t=>t.name===e)?.quotas?.[i];if(n===void 0)return[];let{level:a,words:o}=b(n,r);return a===`limited`||a===`warning`?[{name:e,level:a,words:o}]:[]});if(a.length===0)return null;let o=a.some(e=>e.level===`limited`),s=a.map(e=>`${i} ${e.words} on ${e.name}`).join(`; `);return(0,S.jsx)(`span`,{title:s,className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full ${o?`bg-red-400`:`bg-amber-400`}`,children:(0,S.jsxs)(`span`,{className:`sr-only`,children:[`, `,s]})})}export{D as n,k as r,O as t};
@@ -0,0 +1 @@
1
+ import{A as e,Hn as t,O as n,S as r,Un as i,Wn as a,f as o,j as s,qn as c,t as l,x as u}from"./format-CENiwkJC.js";import{n as d,t as f}from"./Button-Cp4cNRUX.js";import{t as p}from"./CliIcon-C7bwChMP.js";import{k as m}from"./index-CPXALUV6.js";import{n as h,r as g}from"./ThreadForms-CG5Y926b.js";import{n as _,t as v}from"./Pane-BaM0TdE6.js";import{n as y}from"./Quota-CfFGIql9.js";var b=c(a(),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=i();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(){let{code:t}=m({from:`/runners`}),i=o(),a=n(),s=r(),c=e().data,d=u(3e4),f=i.data??[],h=(a.data??[]).map(e=>e.name),g=(a.data??[]).toSorted(D),b=g.filter(e=>e.status===`connected`).length,x=g.length-b,T=g.filter(e=>S(e,c)).length,O=g.filter(e=>C(e)!==null).length,A=t===void 0?void 0:f.find(e=>w(e.userCode,t)),j=A===void 0?f:[A,...f.filter(e=>e!==A)],M=e=>(s.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:[`${b} connected`,...x===0?[]:[`${x} away`],...f.length===0?[]:[`${f.length} waiting for approval`],...c===void 0?[]:[`server v${c}`],...T===0?[]:[`${T} on another version`],...O===0?[]:[`${O} without a git identity`]].join(` · `)}),(0,E.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[t!==void 0&&i.data!==void 0&&A===void 0?(0,E.jsxs)(`output`,{className:`block px-2 pb-2 text-meta`,children:[`No runner waits with the code `,t,`.`]}):null,j.length===0?null:(0,E.jsx)(`ul`,{"aria-label":`Waiting for approval`,className:`space-y-2 px-2 pb-3`,children:j.map(e=>(0,E.jsx)(k,{enrollment:e,taken:h,followed:e===A,now:d},e.userCode))}),a.data===void 0?(0,E.jsx)(_,{children:`Reading the runners…`}):g.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] gap-x-3`,children:g.map(e=>{let t=e.clis.length===0?`no CLI`:e.clis.join(`, `),n=M(e),r=n.length===0?`no projects`:n.join(`, `),i=C(e),a=e.status===`connected`?{label:`connected`,detail:`connected`,tone:`text-fg-muted`}:{label:`away`,detail:`away${e.lastSeen===void 0?``:`, last seen ${l(e.lastSeen,d)}`}`,tone:`text-amber-300`};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 gap-1`,title:t,children:[e.clis.map(e=>(0,E.jsx)(p,{cli:e,size:13},e)),(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,c)?(0,E.jsxs)(`span`,{className:`text-xs text-amber-300`,title:`the server runs v${c}`,children:[`v`,e.version,(0,E.jsxs)(`span`,{className:`sr-only`,children:[`, not the server's v`,c]})]}):(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})]},e.name)})}),(0,E.jsx)(y,{runners:g,now:d})]})]})}export{A as RunnersView};
@@ -1,2 +1,2 @@
1
- import{Gn as e,Jn as t,Wn as n}from"./format-CvfmDNoY.js";import{p as r}from"./Markdown--whKJBYV.js";var i=t(e(),1),a=n();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; it is published as it is.`}):(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?`
1
+ import{Un as e,Wn as t,qn as n}from"./format-CENiwkJC.js";import{g as r}from"./Markdown-DT3V-EVe.js";var i=n(t(),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};
@@ -0,0 +1 @@
1
+ import{Hn as e,Jt as t,N as n,P as r,Un as i,Wn as a,j as o,qn as s}from"./format-CENiwkJC.js";import{n as c,t as l}from"./Button-Cp4cNRUX.js";import{i as u}from"./compose-DY1WL8zB.js";import{l as d}from"./governance-C6ez5MLh.js";import{A as f}from"./index-CPXALUV6.js";import{t as p}from"./BackLink-UTiLF1J4.js";import{t as m}from"./Markdown-DT3V-EVe.js";import{n as h,r as g}from"./ThreadForms-CG5Y926b.js";import{n as _,t as v}from"./Pane-BaM0TdE6.js";import{n as y}from"./Overview-CKcTqsMM.js";import{t as b}from"./SkillFileList-CgrCnuaC.js";var x=s(a(),1),S=i(),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`}),i=r(),a=n(e),[o,s]=(0,x.useState)(!1),c=i.data?.find(t=>t.name===e);if(c===void 0)return(0,S.jsx)(_,{children:i.data===void 0?`Reading…`:`The society has no skill ${e}.`});let u=a.data?.find(e=>e.path===`SKILL.md`),h=a.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)(t,{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:a.data===void 0?(0,S.jsx)(`p`,{className:`text-meta`,children:a.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};
@@ -0,0 +1 @@
1
+ import{D as e,F as t,Jt as n,P as r,S as i,Un as a,Wn as o,g as s,gt as c,l,qn as u,v as d,x as f,zt as p}from"./format-CENiwkJC.js";import{t as m}from"./Button-Cp4cNRUX.js";import{n as h,r as g}from"./ChannelForms-DD2B0tey.js";import{n as _,t as v}from"./Pane-BaM0TdE6.js";import{n as y,r as b,t as x}from"./Overview-CKcTqsMM.js";var S=u(o(),1),C=a();function w(){let n=t(),a=d(),o=i(),u=e(),w=r(),E=s(c),D=l(),O=f(3e4),[k,A]=(0,S.useState)(!1);if(n.data===void 0||a.data===void 0)return(0,C.jsx)(_,{children:`Reading the society…`});let j=a.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!==p);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(v,{title:n.data.name,subtitle:`${M.length} citizens · ${o.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:c}),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:c,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)(n,{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};
@@ -0,0 +1 @@
1
+ import{Un as e,Wn as t,qn as n}from"./format-CENiwkJC.js";var r=n(t(),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,Gn as t,Jn as n,Wn as r,_ as i,t as a}from"./format-CvfmDNoY.js";import{C as o}from"./index-DD3J11PT.js";import{t as s}from"./Markdown--whKJBYV.js";import{t as c}from"./MessageItem-BvDOeJci.js";var l=n(t(),1),u=r();function d({thread:t,now:n,task:r,empty:d}){let f=i(),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?``:` ${a(g.closedAt,n)}`,g.body.trim()===``?`.`:`:`]}),g.body.trim()===``?null:(0,u.jsx)(s,{text:g.body})]}):null]})}export{d as t};
1
+ import{B as e,Un as t,Wn as n,qn as r,t as i,v as a}from"./format-CENiwkJC.js";import{C as o}from"./index-CPXALUV6.js";import{t as s}from"./Markdown-DT3V-EVe.js";import{t as c}from"./MessageItem-agtEugfG.js";var l=r(n(),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};
@@ -0,0 +1,3 @@
1
+ import{B as e,Hn as t,I as n,Jt as r,K as i,L as a,R as o,S as s,Un as c,V as l,Wn as u,j as d,qn as f,t as p,v as m,x as h}from"./format-CENiwkJC.js";import{n as g,t as _}from"./Button-Cp4cNRUX.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-CAI8Eci7.js";import{u as T}from"./governance-C6ez5MLh.js";import{A as E,_ as D,i as O,o as k,s as A}from"./index-CPXALUV6.js";import{t as j}from"./BackLink-UTiLF1J4.js";import{f as M,l as N,m as P,n as F,o as I,t as L}from"./Markdown-DT3V-EVe.js";import{n as R,r as z}from"./ThreadForms-CG5Y926b.js";import{n as B,t as V}from"./Pane-BaM0TdE6.js";import{t as ee}from"./StickyList-BaV_KZ8x.js";import{i as H,n as U,r as W,t as G}from"./FileTree-jyDUSu7g.js";import{t as K}from"./SubjectThread-DD_ZCCnr.js";var q=f(u(),1),J=c(),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 i=(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:i.map((n,i)=>(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)(r,{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})]},i))})}function Q({taskId:e,change:t}){let n=o(e,t.path),r;if(n.data!==void 0){let{patch:i,truncated:a}=n.data;r=i===null?(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown here.`}):i===``?(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:i}),a?(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}else r=n.error instanceof i&&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`}),r]})}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),r=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 i&&n.error.status===404)c=(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,o,` yet.`]});else if(n.error instanceof i&&n.error.status===503){let t=r.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
+
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`}),a=n(t),o=l(),c=s(),u=m(),d=h(3e4),f=A(),g=e(o.data?.some(e=>e.id===t)===!0?t:null);if(a.data===void 0)return(0,J.jsx)(B,{children:a.error instanceof i&&a.error.status===404?`There is no task ${t}.`:`Reading the task…`});let _=a.data,x=C(_),S=T(_),k=c.data?.find(e=>e.slug===_.project),M=o.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)(r,{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:u.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`}),o.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};
@@ -0,0 +1 @@
1
+ import{Jt as e,S as t,Un as n,Wn as r,qn as i,t as a,v as o,x as s,yt as c,z as l}from"./format-CENiwkJC.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-CAI8Eci7.js";import{A as _,o as v}from"./index-CPXALUV6.js";import{n as y,t as b}from"./Pane-BaM0TdE6.js";var x=i(r(),1),S=n();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:t,members:n,now:r}){let i=h(t),o=c(t);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(e,{to:`/task/$taskId`,params:{taskId:t.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:t.title}),(0,S.jsx)(`span`,{className:`shrink-0 text-meta`,children:u(t)})]}),(0,S.jsx)(`div`,{className:`mt-2`,children:(0,S.jsx)(C,{task:t})}),t.returned===void 0?null:(0,S.jsxs)(`p`,{className:`mt-1.5 truncate text-xs text-orange-300/90`,children:[`Sent back from `,f(t,t.returned.from),` by `,t.returned.by,` `,a(t.returned.at,r)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:t.status===`claimed`&&i!==`landing`&&o!==void 0?(0,S.jsxs)(S.Fragment,{children:[o.name,` · held by `,(0,S.jsx)(v,{name:t.claimedBy??``,members:n})]}):t.status===`open`&&i!==`landing`&&o!==void 0?`${o.name} · waiting for ${m(o)} since ${a(t.stageSince,r)}`:i===`landing`?`landing task/${t.id} on the default branch`:`${i} ${a(t.updatedAt,r)}`})]})})}function E(){let{slug:e}=_({from:`/p/$slug/tasks`}),n=l(e),r=t(),i=o(),a=s(3e4),[c,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`||c.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[g.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:i.data,now:a},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...c,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
@@ -1 +1 @@
1
- import{A as e,E as t,Gn as n,Jn as r,K as i,Un as a,Wn as o,_ as s}from"./format-CvfmDNoY.js";import{n as c,t as l}from"./Button-BYJGqZ3Q.js";import{i as u,n as d}from"./compose-BUhbVoI-.js";import{n as f}from"./mentions-D838wlfQ.js";var p=r(n(),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=o(),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 i?e.message:`The board did not take it.`})}function b({channel:n,onDone:r}){let{api:i}=e(),o=a(),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=>{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 ${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(),o=a(),[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]])o.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
+ import{D as e,Hn as t,K as n,Un as r,Wn as i,j as a,qn as o,v as s}from"./format-CENiwkJC.js";import{n as c,t as l}from"./Button-Cp4cNRUX.js";import{i as u,n as d}from"./compose-DY1WL8zB.js";import{n as f}from"./mentions-BEL5U6ra.js";var p=o(i(),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=u(),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 ${d(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{Wn as e,Yt as t,n,t as r}from"./format-CvfmDNoY.js";import{_ as i,s as a}from"./index-DD3J11PT.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
+ import{Jt as e,Un as t,n,t as r}from"./format-CENiwkJC.js";import{_ as i,s as a}from"./index-CPXALUV6.js";var o=t();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:t,now:c}){let u=a(),d=t.state===`open`,f=d?``:n(t.body,180),p=d?void 0:t.closedAt,m=p??t.openedAt;return(0,o.jsxs)(e,{to:`/thread/$threadId`,params:{threadId:t.id},className:`group flex gap-3 px-4 py-1`,children:[(0,o.jsx)(`span`,{title:t.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(t.openedBy),` opened `,s(t.subject),` thread`,` `,(0,o.jsx)(`span`,{className:`text-fg-secondary group-hover:text-fg-primary`,children:t.title}),(0,o.jsxs)(`span`,{className:`sr-only`,children:[`, `,t.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,Cn as t,F as n,Gn as r,Jn as i,K as a,Wn as o,Yt as s,_ as c,b as l,t as u}from"./format-CvfmDNoY.js";import{t as d}from"./Button-BYJGqZ3Q.js";import{A as f,C as p,i as m,k as h,s as g}from"./index-DD3J11PT.js";import{t as _}from"./BackLink-DKMw_rHu.js";import{t as v}from"./Markdown--whKJBYV.js";import{t as y}from"./ThreadForms-DzoRDeBh.js";import{t as b}from"./MessageItem-BvDOeJci.js";import{n as x,t as S}from"./Pane-DTmByqgA.js";import{t as C}from"./StickyList-C4fC_KJv.js";import{r as w,t as T}from"./ThreadItem-CDVppcOZ.js";var E=i(r(),1),D=o();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:r,target:i}){let{api:o}=e(),f=t({queryKey:[`thread`,r],queryFn:()=>o.thread(r)}),h=c(),O=l(3e4),k=g(),A=f.data?.messages??[],j=A.at(-1)?.id??null;(0,E.useEffect)(()=>p(r,j),[r,j]);let[M,N]=(0,E.useState)(!1),P=f.data?.thread.subject,F=n(P?.kind===`task`?P.id:null);if(f.data===void 0)return(0,D.jsx)(x,{children:f.error instanceof a&&f.error.status===404?`There is no thread ${r}.`:`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)(s,{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)} ${u(I.openedAt,O)}`,trailing:(0,D.jsxs)(D.Fragment,{children:[I.subject?.kind===`task`?(0,D.jsx)(s,{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)(s,{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?``:` ${u(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};
1
+ import{I as e,Jt as t,K as n,Sn as r,Un as i,Wn as a,j as o,qn as s,t as c,v as l,x as u}from"./format-CENiwkJC.js";import{t as d}from"./Button-Cp4cNRUX.js";import{A as f,C as p,i as m,k as h,s as g}from"./index-CPXALUV6.js";import{t as _}from"./BackLink-UTiLF1J4.js";import{t as v}from"./Markdown-DT3V-EVe.js";import{t as y}from"./ThreadForms-CG5Y926b.js";import{t as b}from"./MessageItem-agtEugfG.js";import{n as x,t as S}from"./Pane-BaM0TdE6.js";import{t as C}from"./StickyList-BaV_KZ8x.js";import{r as w,t as T}from"./ThreadItem-D-n2arFA.js";var E=s(a(),1),D=i();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:i,target:a}){let{api:s}=o(),f=r({queryKey:[`thread`,i],queryFn:()=>s.thread(i)}),h=l(),O=u(3e4),k=g(),A=f.data?.messages??[],j=A.at(-1)?.id??null;(0,E.useEffect)(()=>p(i,j),[i,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 n&&f.error.status===404?`There is no thread ${i}.`:`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)(t,{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)(t,{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)(t,{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:a===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===a},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};
@@ -1 +1 @@
1
- import{_t as e,st as t}from"./format-CvfmDNoY.js";import{l as n}from"./index-DD3J11PT.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{input:`${u.format(f(e))} in`,output:`${u.format(e.outputTokens)} out`}}function m(e){let{input:t,output:n}=p(e);return`${t} · ${n}`}function h(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 g(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 _={"24h":`in the last 24 hours`,"7d":`in the last 7 days`,all:`in all`};function v(e){return e===1?`1 finished turn`:`${e} finished turns`}function y(e,t){let n=_[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:`${v(e.turns)} ${n}, none with a token count: ${i}`,spoken:`${v(e.turns)} ${n}, none counted`};let a={label:m(e.usage),counts:p(e.usage)};if(r===0)return{...a,detail:`${h(e.usage)}; over ${v(e.turns)} ${n}`,spoken:null};let o=`over ${e.withUsage} of ${v(e.turns)} ${n}`;return{...a,detail:[`${h(e.usage)}; ${o}.`,`The other ${r===1?`one has`:`${r} have`} no count: ${i}.`].join(` `),spoken:o}}function b(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 x(e,t){return[...new Set([e.homeRunner,...e.memberships.map(e=>t.get(e))].filter(e=>e!==void 0))]}function S(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=x(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{r as a,m as c,i as d,b as f,a as i,o as l,g as n,y as o,S as r,h as s,c as t,x as u};
1
+ import{gt as e,st as t}from"./format-CENiwkJC.js";import{l as n}from"./index-CPXALUV6.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{input:`${u.format(f(e))} in`,output:`${u.format(e.outputTokens)} out`}}function m(e){let{input:t,output:n}=p(e);return`${t} · ${n}`}function h(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 g(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 _={"24h":`in the last 24 hours`,"7d":`in the last 7 days`,all:`in all`};function v(e){return e===1?`1 finished turn`:`${e} finished turns`}function y(e,t){let n=_[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:`${v(e.turns)} ${n}, none with a token count: ${i}`,spoken:`${v(e.turns)} ${n}, none counted`};let a={label:m(e.usage),counts:p(e.usage)};if(r===0)return{...a,detail:`${h(e.usage)}; over ${v(e.turns)} ${n}`,spoken:null};let o=`over ${e.withUsage} of ${v(e.turns)} ${n}`;return{...a,detail:[`${h(e.usage)}; ${o}.`,`The other ${r===1?`one has`:`${r} have`} no count: ${i}.`].join(` `),spoken:o}}function b(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 x(e,t){return[...new Set([e.homeRunner,...e.memberships.map(e=>t.get(e))].filter(e=>e!==void 0))]}function S(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=x(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{r as a,m as c,i as d,b as f,a as i,o as l,g as n,y as o,S as r,h as s,c as t,x as u};
@@ -1 +1 @@
1
- import{Gn as e,Jn as t,Zt as n}from"./format-CvfmDNoY.js";var r=t(e(),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};
1
+ import{Wn as e,Xt as t,qn as n}from"./format-CENiwkJC.js";var r=n(e(),1);function i(e){let n=t();return r.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}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};