@kubitnodes/stellaris 0.4.1 → 0.4.2
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 +603 -18
- package/dist/server/index.js +744 -60
- package/package.json +1 -1
- package/web/dist/assets/BackLink-DNHWkHmh.js +1 -0
- package/web/dist/assets/{Button-DxGzriWQ.js → Button-B6EN7Lh7.js} +1 -1
- package/web/dist/assets/ChannelForms-BrcWrkej.js +1 -0
- package/web/dist/assets/{ChannelView-DvtoxLi5.js → ChannelView-D7bT7d9q.js} +2 -2
- package/web/dist/assets/CitizenView-D6d1KnS6.js +2 -0
- package/web/dist/assets/{CitizensView-BOZHABbN.js → CitizensView-C55zOiYE.js} +1 -1
- package/web/dist/assets/{CliIcon-D3GddnP4.js → CliIcon-BRq1tnhu.js} +1 -1
- package/web/dist/assets/CronsView-BTGiqn10.js +1 -0
- package/web/dist/assets/{FileTree-DSFN4sd8.js → FileTree-BDhtTIzT.js} +1 -1
- package/web/dist/assets/{FileView-DyUYLXRC.js → FileView-BkZPGEbO.js} +2 -2
- package/web/dist/assets/{KnowledgeView-CMdXaTvS.js → KnowledgeView-BiTS-lyE.js} +1 -1
- package/web/dist/assets/{Markdown-BSeWHBBA.js → Markdown-DYk-gVwe.js} +5 -5
- package/web/dist/assets/{MessageItem-qIxS96uJ.js → MessageItem-WBBIzv48.js} +1 -1
- package/web/dist/assets/MetricsView-CYmnG6aQ.js +1 -0
- package/web/dist/assets/NeedsYouView-B-5olhZL.js +1 -0
- package/web/dist/assets/Overview-BO_lR1cu.js +1 -0
- package/web/dist/assets/{Pane-pZUzNQIW.js → Pane-DFJdAhv9.js} +1 -1
- package/web/dist/assets/{Picker-CDf6os_x.js → Picker-CAEREZF9.js} +1 -1
- package/web/dist/assets/ProjectView-LU59V2vh.js +1 -0
- package/web/dist/assets/ProposalView-DHemTlkc.js +1 -0
- package/web/dist/assets/{ProposalsView-DBGpcAPO.js → ProposalsView-DBIOJAul.js} +1 -1
- package/web/dist/assets/{Quota-Brd4ddB4.js → Quota-D6_yyawu.js} +1 -1
- package/web/dist/assets/{RunnersView-45OXtalD.js → RunnersView-BNKgYuNw.js} +1 -1
- package/web/dist/assets/{SkillFileList-BUImALv9.js → SkillFileList-Ntyv8noL.js} +1 -1
- package/web/dist/assets/SkillView-Dez1fvqU.js +1 -0
- package/web/dist/assets/SocietyView-CbmbQXHi.js +1 -0
- package/web/dist/assets/{StickyList-D_ED_-LW.js → StickyList-Q0KEWBUl.js} +1 -1
- package/web/dist/assets/{SubjectThread-B5zvoRSd.js → SubjectThread-1PnxxtZc.js} +1 -1
- package/web/dist/assets/{TaskView-B5_QTI3p.js → TaskView-CcIlNHBh.js} +2 -2
- package/web/dist/assets/TasksView-BkTU43PD.js +1 -0
- package/web/dist/assets/{ThreadForms-CbFClyd0.js → ThreadForms-BlOEvY5E.js} +1 -1
- package/web/dist/assets/ThreadItem-D5N_Fw1K.js +1 -0
- package/web/dist/assets/{ThreadView-CHFs0zaS.js → ThreadView-BaYV77mQ.js} +1 -1
- package/web/dist/assets/{citizen-B8p56JRh.js → citizen-BRg9UIgD.js} +1 -1
- package/web/dist/assets/{compose-CV4o6TMb.js → compose-BnOoMY1c.js} +1 -1
- package/web/dist/assets/format-hyYD8qd8.js +55 -0
- package/web/dist/assets/governance-D4hlG-xw.js +1 -0
- package/web/dist/assets/index-5CbC_NpF.js +24 -0
- package/web/dist/assets/{index-CA_njyMe.css → index-vxBI4BYp.css} +1 -1
- package/web/dist/assets/{mentions-BH0RZXfc.js → mentions-Ckktc7nR.js} +1 -1
- package/web/dist/assets/{tasks-D2Es55TQ.js → tasks-CFVtN9TK.js} +1 -1
- package/web/dist/assets/{useMatch-DeOpK57G.js → useMatch-BCaBBHc2.js} +1 -1
- package/web/dist/favicon.svg +89 -4
- package/web/dist/index.html +9 -9
- package/web/dist/assets/BackLink-fxPmFUg8.js +0 -1
- package/web/dist/assets/ChannelForms-C3m4IPnZ.js +0 -1
- package/web/dist/assets/CitizenView-Dq64VsZi.js +0 -2
- package/web/dist/assets/CronsView-CI947lZS.js +0 -1
- package/web/dist/assets/MetricsView-BhjdwkX1.js +0 -1
- package/web/dist/assets/NeedsYouView-7uZW9dY8.js +0 -1
- package/web/dist/assets/Overview-D6kiK8sE.js +0 -1
- package/web/dist/assets/ProjectView-B6OmxiT9.js +0 -1
- package/web/dist/assets/ProposalView-B1X8Jlo0.js +0 -1
- package/web/dist/assets/SkillView-B1knYZV8.js +0 -1
- package/web/dist/assets/SocietyView-F7bzrNv5.js +0 -1
- package/web/dist/assets/TasksView-DZLNqU2V.js +0 -1
- package/web/dist/assets/ThreadItem-kFn5M3Cx.js +0 -1
- package/web/dist/assets/format-BYF63sQU.js +0 -55
- package/web/dist/assets/governance-BjIg0eok.js +0 -1
- package/web/dist/assets/index-CyROMh25.js +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ft as e,It as t,Nt as n,Pt as r,Xn as i,Yn as a,Zn as o,er as s,j as c,t as l,tn as u}from"./format-hyYD8qd8.js";import{n as d,t as f}from"./Button-B6EN7Lh7.js";import{t as p}from"./CliIcon-BRq1tnhu.js";import{d as m}from"./citizen-BRg9UIgD.js";var h=s(o(),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 i=n.quotas?.[e],a=i===void 0?void 0:t.find(t=>t.cli===e&&t.quota!==void 0&&r(t.quota,i));a===void 0?t.push({cli:e,runners:[n.name],quota:i,connected:n.status===`connected`}):a.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(n,r){let i=t(n);if(!e(n,new Date(r)))return{name:i,percent:null,label:`reset`,reset:`reset since read`,high:!1};let a=n.usedPercent;return{name:i,percent:a===null?null:Math.min(100,a),label:a===null?`?`:`${Math.floor(a)}%`,reset:n.resetsAt===null?``:`resets in ${v(Date.parse(n.resetsAt)-r)}`,high:a!==null&&a>=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=i(),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 ${l(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:n}=c(),r=a(),[i,o]=(0,h.useState)(new Set),[s,l]=(0,h.useState)(new Map),u=(0,h.useRef)(new Set),{mutate:m}=d({mutationFn:({runner:e,cli:t})=>n.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:i})=>{o(e=>{let t=new Set(e);return t.delete(`${n}/${i}`),t}),r.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||i.size>0,onClick:()=>{for(let e of v)for(let t of e.clis)m({runner:e.name,cli:t})},children:i.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}`,a=E(e,t,i.has(r),s.get(r)),o=e.quota?.plan,c=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}`,c===null?``:` · ${c}`]}),(0,S.jsxs)(`span`,{className:`ml-auto text-right text-xs ${a.tone}`,title:a.detail,children:[a.words,(0,S.jsxs)(`span`,{className:`sr-only`,children:[`, `,a.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: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)(u,{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{v as i,D as n,k as r,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,
|
|
1
|
+
import{A as e,At as t,O as n,S as r,Xn as i,Yn as a,Zn as o,er as s,f as c,j as l,jt as u,t as d,x as f}from"./format-hyYD8qd8.js";import{n as p,t as m}from"./Button-B6EN7Lh7.js";import{t as h}from"./CliIcon-BRq1tnhu.js";import{k as g}from"./index-5CbC_NpF.js";import{n as _,r as v}from"./ThreadForms-BlOEvY5E.js";import{n as y,t as b}from"./Pane-DFJdAhv9.js";import{i as x,n as S}from"./Quota-D6_yyawu.js";var C=s(o(),1);function w(e){return e.toUpperCase().replaceAll(/[^A-Z0-9]/g,``)}function T(e,t){return t!==void 0&&e.version!==void 0&&e.version!==t}function E(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 D(e,t){return w(e)===w(t)}function O(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}}function k(e,n){return e.clis.flatMap(r=>{let i=t(e,r,new Date(n));return i===null?[]:[{cli:r,until:i.until,paused:u(e,r)!==void 0}]})}function A(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 ${d(r.at,t)}`]}):[`paused ${d(e.paused.at,t)}`],i=k(e,t),a=i.map(e=>`${e.cli} held by its limit for ${x(Date.parse(e.until)-t)}`),o=i.filter(e=>!e.paused).map(e=>e.cli),s=o.length===0?[]:[`${o.join(`, `)} held`];if(e.status!==`connected`){let n=`away${e.lastSeen===void 0?``:`, last seen ${d(e.lastSeen,t)}`}`;return{label:e.paused===void 0?`away`:`away · paused`,detail:[n,...r,...a].join(`; `),tone:`text-amber-300`}}return e.paused===void 0&&n.length===0&&i.length===0?{label:`connected`,detail:`connected`,tone:`text-fg-muted`}:{label:[...e.paused===void 0?n.length===0?[]:[`${n.join(`, `)} paused`]:[`paused`],...s].join(` · `),detail:[`connected`,...r,...a].join(`; `),tone:`text-amber-300`}}var j=i();function M(e,t){return Number(e.status!==`connected`)-Number(t.status!==`connected`)||e.name.localeCompare(t.name)}function N(e,t){return[e.length===0?`no CLI`:e.join(`, `),...t].join(` · `)}function P({enrollment:e,taken:t,followed:n,now:r}){let{api:i}=l(),o=a(),[s,c]=(0,C.useState)(null),u=s??O(e.hostname,t),f=()=>{o.invalidateQueries({queryKey:[`enrollments`]}),o.invalidateQueries({queryKey:[`runners`]})},h=p({mutationFn:()=>i.approveEnrollment(e.userCode,u.trim()),onSuccess:f}),g=p({mutationFn:()=>i.denyEnrollment(e.userCode),onSuccess:f}),y=h.isPending||g.isPending;return(0,j.jsxs)(`li`,{className:`rounded-xl border px-3 py-3 ${n?`border-amber-500/40 bg-amber-500/5`:`border-line`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-fg-primary`,children:e.hostname}),(0,j.jsx)(`code`,{className:`shrink-0 font-mono text-sm text-fg-primary`,children:e.userCode})]}),(0,j.jsxs)(`p`,{className:`mt-0.5 truncate text-meta`,children:[e.os,` · `,N(e.clis,e.capabilities),` · runner`,` `,e.version,` · asked `,d(e.requestedAt,r)]}),(0,j.jsxs)(`form`,{"aria-label":`Approve ${e.hostname}`,className:`mt-2.5 flex items-center gap-2`,onSubmit:e=>{e.preventDefault(),h.mutate()},children:[(0,j.jsx)(`input`,{value:u,maxLength:32,spellCheck:!1,"aria-label":`Runner name`,onChange:e=>c(e.target.value),className:`${_} min-w-0 flex-1 font-mono`}),(0,j.jsx)(m,{onClick:()=>g.mutate(),disabled:y,children:`Deny`}),(0,j.jsx)(m,{variant:`primary`,type:`submit`,disabled:y||u.trim()===``,children:h.isPending?`Approving…`:`Approve`})]}),(0,j.jsx)(`div`,{className:`mt-1.5`,children:(0,j.jsx)(v,{error:h.error??g.error})})]})}function F({paused:e}){return(0,j.jsx)(`svg`,{viewBox:`0 0 12 12`,width:12,height:12,"aria-hidden":`true`,className:`shrink-0`,children:(0,j.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 I(){let{code:t}=g({from:`/runners`}),{api:i}=l(),o=a(),s=(0,C.useRef)(!1),u=p({mutationFn:({runner:e,paused:t,cli:n})=>i.setRunnerPaused(e,t,n),onSettled:async()=>{try{await o.invalidateQueries({queryKey:[`runners`]})}finally{s.current=!1}}}),d=e=>{s.current||(s.current=!0,u.mutate(e))},m=c(),_=n(),x=r(),w=e().data,O=f(3e4),N=m.data??[],I=(_.data??[]).map(e=>e.name),L=(_.data??[]).toSorted(M),R=L.filter(e=>e.status===`connected`).length,z=L.length-R,B=L.filter(e=>T(e,w)).length,V=L.filter(e=>E(e)!==null).length,H=L.filter(e=>e.paused!==void 0||e.clis.some(t=>e.pausedClis?.[t]!==void 0)).length,U=L.filter(e=>k(e,O).some(e=>!e.paused)).length,W=t===void 0?void 0:N.find(e=>D(e.userCode,t)),G=W===void 0?N:[W,...N.filter(e=>e!==W)],K=e=>(x.data??[]).filter(t=>t.runner===e.name&&t.archived===void 0).map(e=>e.slug);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b,{title:`Runners`,subtitle:[`${R} connected`,...z===0?[]:[`${z} away`],...H===0?[]:[`${H} paused`],...U===0?[]:[`${U} held by a limit`],...N.length===0?[]:[`${N.length} waiting for approval`],...w===void 0?[]:[`server v${w}`],...B===0?[]:[`${B} on another version`],...V===0?[]:[`${V} without a git identity`]].join(` · `)}),(0,j.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[t!==void 0&&m.data!==void 0&&W===void 0?(0,j.jsxs)(`output`,{className:`block px-2 pb-2 text-meta`,children:[`No runner waits with the code `,t,`.`]}):null,G.length===0?null:(0,j.jsx)(`ul`,{"aria-label":`Waiting for approval`,className:`space-y-2 px-2 pb-3`,children:G.map(e=>(0,j.jsx)(P,{enrollment:e,taken:I,followed:e===W,now:O},e.userCode))}),_.data===void 0?(0,j.jsx)(y,{children:`Reading the runners…`}):L.length===0?(0,j.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No runners yet.`}):null,(0,j.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:L.map(e=>{let t=e.clis.length===0?`no CLI`:e.clis.join(`, `),n=K(e),r=n.length===0?`no projects`:n.join(`, `),i=E(e),a=A(e,O);return(0,j.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm`,children:[(0,j.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,j.jsx)(`button`,{type:`button`,"aria-label":r,title:r,"aria-disabled":u.isPending,onClick:()=>d({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,j.jsx)(h,{cli:t,size:13})},t)}),(0,j.jsx)(`span`,{className:`sr-only`,children:t})]}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`span`,{className:`block text-fg-primary`,children:e.name}),i===null?null:(0,j.jsx)(`span`,{className:`block text-xs text-amber-300`,title:i.detail,children:i.label})]}),(0,j.jsx)(`span`,{className:`text-fg-secondary`,children:e.os}),T(e,w)?(0,j.jsxs)(`span`,{className:`text-xs text-amber-300`,title:`the server runs v${w}`,children:[`v`,e.version,(0,j.jsxs)(`span`,{className:`sr-only`,children:[`, not the server's v`,w]})]}):(0,j.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.version===void 0?``:`v${e.version}`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:e.capabilities.join(`, `),children:e.capabilities.join(`, `)}),(0,j.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:r,children:r}),(0,j.jsx)(`span`,{className:`text-right text-xs ${a.tone}`,title:a.detail,children:a.label}),(0,j.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":u.isPending,onClick:()=>d({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,j.jsx)(F,{paused:e.paused!==void 0})})]},e.name)})}),(0,j.jsx)(`div`,{className:`px-2`,children:(0,j.jsx)(v,{error:u.error})}),(0,j.jsx)(S,{runners:L,now:O})]})]})}export{I as RunnersView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Xn as e,Zn as t,er as n}from"./format-hyYD8qd8.js";import{g as r}from"./Markdown-DYk-gVwe.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{N as e,P as t,Xn as n,Yn as r,Zn as i,er as a,j as o,tn as s}from"./format-hyYD8qd8.js";import{n as c,t as l}from"./Button-B6EN7Lh7.js";import{l as u}from"./compose-BnOoMY1c.js";import{l as d}from"./governance-D4hlG-xw.js";import{A as f}from"./index-5CbC_NpF.js";import{t as p}from"./BackLink-DNHWkHmh.js";import{t as m}from"./Markdown-DYk-gVwe.js";import{n as h,r as g}from"./ThreadForms-BlOEvY5E.js";import{n as _,t as v}from"./Pane-DFJdAhv9.js";import{n as y}from"./Overview-BO_lR1cu.js";import{t as b}from"./SkillFileList-Ntyv8noL.js";var x=a(i(),1),S=n(),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:n}=f({from:`/skills/$name`}),r=t(),i=e(n),[a,o]=(0,x.useState)(!1),c=r.data?.find(e=>e.name===n);if(c===void 0)return(0,S.jsx)(_,{children:r.data===void 0?`Reading…`:`The society has no skill ${n}.`});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)(s,{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:a?null:(0,S.jsx)(l,{onClick:()=>o(!0),children:`Remove…`})}),a?(0,S.jsx)(T,{name:c.name,onCancel:()=>o(!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:e,onCancel:t}){let{api:n}=o(),i=r(),a=u(),[s,d]=(0,x.useState)(``),f=(0,x.useRef)(null);(0,x.useEffect)(()=>f.current?.focus(),[]);let p=c({mutationFn:()=>n.removeSkill({name:e,reason:s.trim()}),onSuccess:async()=>{await a({to:`/society`}),await i.invalidateQueries({queryKey:[`skills`]})}});return(0,S.jsxs)(`form`,{"aria-label":`Remove ${e}`,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:t,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,Kt as n,P as r,S as i,Xn as a,Zn as o,er as s,g as c,l,tn as u,v as d,x as f,xt as p}from"./format-hyYD8qd8.js";import{t as m}from"./Button-B6EN7Lh7.js";import{n as h,r as g}from"./ChannelForms-BrcWrkej.js";import{n as _,t as v}from"./Pane-DFJdAhv9.js";import{n as y,r as b,t as x}from"./Overview-BO_lR1cu.js";var S=s(o(),1),C=a();function w(){let a=t(),o=d(),s=i(),u=e(),w=r(),E=c(p),D=l(),O=f(3e4),[k,A]=(0,S.useState)(!1);if(a.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:a.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)(u,{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{Xn as e,Zn as t,er as n}from"./format-hyYD8qd8.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,
|
|
1
|
+
import{B as e,Xn as t,Zn as n,er as r,t as i,v as a}from"./format-hyYD8qd8.js";import{C as o}from"./index-5CbC_NpF.js";import{t as s}from"./Markdown-DYk-gVwe.js";import{t as c}from"./MessageItem-WBBIzv48.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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{B as e,I as t,K as n,L as r,R as i,S as a,V as o,Xn as s,Yn as c,Zn as l,er as u,j as d,t as f,tn as p,v as m,x as h}from"./format-hyYD8qd8.js";import{n as g,t as _}from"./Button-B6EN7Lh7.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-CFVtN9TK.js";import{u as T}from"./governance-D4hlG-xw.js";import{A as E,_ as D,i as O,o as k,s as A}from"./index-5CbC_NpF.js";import{t as j}from"./BackLink-DNHWkHmh.js";import{f as M,l as N,m as P,n as F,o as I,t as L}from"./Markdown-DYk-gVwe.js";import{n as R,r as z}from"./ThreadForms-BlOEvY5E.js";import{n as B,t as V}from"./Pane-DFJdAhv9.js";import{t as ee}from"./StickyList-Q0KEWBUl.js";import{i as H,n as U,r as W,t as G}from"./FileTree-BDhtTIzT.js";import{t as K}from"./SubjectThread-1PnxxtZc.js";var q=u(l(),1),J=s(),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,` `,f(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)(p,{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 r=i(e,t.path),a;if(r.data!==void 0){let{patch:n,truncated:i}=r.data;a=n===null?(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown here.`}):n===``?(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:n}),i?(0,J.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}else a=r.error instanceof n&&r.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.`}):r.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:r.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`}),a]})}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 i=r(e.id),o=a(),s=`task/${e.id}`,c;if(i.data!==void 0){let{files:n,total:r,head:a}=i.data;c=n.length===0?(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,s,` yet.`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[r===1?`1 file`:`${r} files`,` changed · newest commit by `,a.author,` `,f(a.at,t)]}),(0,J.jsx)(te,{taskId:e.id,changes:n,now:t}),r>n.length?(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,r]}):null]})}else if(i.error instanceof n&&i.error.status===404)c=(0,J.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,s,` yet.`]});else if(i.error instanceof n&&i.error.status===503){let t=o.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=i.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:i.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} ${f(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${f(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,u===void 0?``:` · sent back by ${u.by} ${f(u.at,i)}`]})]})]})}function ie({task:e,stage:t}){let{api:n}=d(),r=c(),[i,a]=(0,q.useState)(``),o=e.stages.findIndex(e=>e.id===t.id),s=e.stages[o+1]===void 0&&e.onDone===`ghpr`&&e.pullRequest===void 0,l=g({mutationFn:()=>n.advanceTask({task_id:e.id,...i.trim()===``?{}:{note:i.trim()}}),onSuccess:async()=>{a(``),await r.invalidateQueries({queryKey:[`task`,e.id]}),await r.invalidateQueries({queryKey:[`tasks`]})}});return(0,J.jsxs)(`form`,{"aria-label":`Approve ${t.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:[t.name,` waits on you.`,s?` No pull request linked yet.`:``]}),(0,J.jsx)(`textarea`,{value:i,rows:2,"aria-label":`Note for the task's thread`,placeholder:`A note for the thread, if any`,onChange:e=>a(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,` `,
|
|
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,` `,f(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:[` · `,f(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:r}=E({from:`/task/$taskId`}),i=t(r),s=o(),c=a(),l=m(),u=h(3e4),d=A(),g=e(s.data?.some(e=>e.id===r)===!0?r:null);if(i.data===void 0)return(0,J.jsx)(B,{children:i.error instanceof n&&i.error.status===404?`There is no task ${r}.`:`Reading the task…`});let _=i.data,x=C(_),S=T(_),k=c.data?.find(e=>e.slug===_.project),M=s.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)(p,{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 ${d(_.createdBy)} ${f(_.createdAt,u)}`,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,` `,f(_.returned.at,u),`.`]}),(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:u},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:u}),(0,J.jsx)(ne,{task:_,now:u}),(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`}),s.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:u,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{S as e,Xn as t,Zn as n,er as r,t as i,tn as a,v as o,wt as s,x as c,z as l}from"./format-hyYD8qd8.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-CFVtN9TK.js";import{A as _,o as v}from"./index-5CbC_NpF.js";import{n as y,t as b}from"./Pane-DFJdAhv9.js";var x=r(n(),1),S=t();function C({task:e}){let t=h(e);return(0,S.jsx)(`ol`,{className:`flex gap-1`,"aria-hidden":`true`,children:e.stages.map((n,r)=>{let i=n.completedBy!==void 0,a=p(e,n),o=i?`bg-emerald-400/60`:a?e.status===`claimed`?`bg-fg-primary/90`:`bg-amber-300/80`:t===`abandoned`?`bg-surface-2/50`:`bg-surface-2`;return(0,S.jsx)(`li`,{title:`${r+1}. ${n.name} · ${m(n)}${n.gate?` · gate`:``}`,className:`h-1.5 min-w-3 flex-1 rounded-full ${o} ${n.gate?`ring-1 ring-sky-300/70 ring-offset-1 ring-offset-surface-1`:``}`},n.id)})})}var w=5;function T({task:e,members:t,now:n}){let r=h(e),o=s(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(a,{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,` `,i(e.returned.at,n)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&r!==`landing`&&o!==void 0?(0,S.jsxs)(S.Fragment,{children:[o.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&r!==`landing`&&o!==void 0?`${o.name} · waiting for ${m(o)} since ${i(e.stageSince,n)}`:r===`landing`?`landing task/${e.id} on the default branch`:`${r} ${i(e.updatedAt,n)}`})]})})}function E(){let{slug:t}=_({from:`/p/$slug/tasks`}),n=l(t),r=e(),i=o(),a=c(3e4),[s,u]=(0,x.useState)(new Set),f=r.data?.find(e=>e.slug===t),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??t} · ${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`||s.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[g.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:i.data,now:a},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...s,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,
|
|
1
|
+
import{D as e,K as t,Xn as n,Yn as r,Zn as i,er as a,j as o,v as s}from"./format-hyYD8qd8.js";import{n as c,t as l}from"./Button-B6EN7Lh7.js";import{i as u,l as d}from"./compose-BnOoMY1c.js";import{n as f}from"./mentions-Ckktc7nR.js";var p=a(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=n(),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 t?e.message:`The board did not take it.`})}function b({channel:t,onDone:n}){let{api:i}=o(),a=r(),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:t,title:b.trim()});return T!==``&&await i.sendMessage({thread_id:e.id,body:T}),e},onSuccess:e=>{a.invalidateQueries({queryKey:[`threads`]}),n(),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:n,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:t,onDone:n}){let{api:i}=o(),a=r(),[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 n of[[`thread`,e],[`threads`],[`channel`,t]])a.invalidateQueries({queryKey:n});n()}});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:n,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Xn as e,n as t,t as n,tn as r}from"./format-hyYD8qd8.js";import{_ as i,s as a}from"./index-5CbC_NpF.js";var o=e();function s(e){return e?.kind??`topic`}function c({state:e}){return(0,o.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${e===`open`?`bg-emerald-500/15 text-emerald-300`:`bg-surface-2 text-fg-tertiary`}`,children:e})}function l(){return(0,o.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5`,children:(0,o.jsx)(`path`,{d:`M4 2.5v6A2.5 2.5 0 0 0 6.5 11H13m-3-3 3 3-3 3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function u({thread:e,now:c}){let u=a(),d=e.state===`open`,f=d?``:t(e.body,180),p=d?void 0:e.closedAt,m=p??e.openedAt;return(0,o.jsxs)(r,{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:n(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{
|
|
1
|
+
import{I as e,K as t,Xn as n,Zn as r,er as i,j as a,kn as o,t as s,tn as c,v as l,x as u}from"./format-hyYD8qd8.js";import{t as d}from"./Button-B6EN7Lh7.js";import{A as f,C as p,i as m,k as h,s as g}from"./index-5CbC_NpF.js";import{t as _}from"./BackLink-DNHWkHmh.js";import{t as v}from"./Markdown-DYk-gVwe.js";import{t as y}from"./ThreadForms-BlOEvY5E.js";import{t as b}from"./MessageItem-WBBIzv48.js";import{n as x,t as S}from"./Pane-DFJdAhv9.js";import{t as C}from"./StickyList-Q0KEWBUl.js";import{r as w,t as T}from"./ThreadItem-D5N_Fw1K.js";var E=i(r(),1),D=n();function O(){let{threadId:e}=f({from:`/thread/$threadId`}),{message:t}=h({from:`/thread/$threadId`});return(0,D.jsx)(k,{id:e,target:t},e)}function k({id:n,target:r}){let{api:i}=a(),f=o({queryKey:[`thread`,n],queryFn:()=>i.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)(c,{to:`/c/$`,params:{_splat:I.channel},"aria-label":`Back to #${I.channel}`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:I.title,subtitle:`${w(I.subject)} thread in #${I.channel} · opened by ${k(I.openedBy)} ${s(I.openedAt,O)}`,trailing:(0,D.jsxs)(D.Fragment,{children:[I.subject?.kind===`task`?(0,D.jsx)(c,{to:`/task/$taskId`,params:{taskId:I.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Task →`}):I.subject?.kind===`proposal`?(0,D.jsx)(c,{to:`/proposal/$proposalId`,params:{proposalId:I.subject.id},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Proposal →`}):null,I.state===`open`&&!M&&I.subject?.kind!==`task`?(0,D.jsx)(d,{onClick:()=>N(!0),children:`Close`}):(0,D.jsx)(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:r===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===r},e.id)),I.state===`closed`?(0,D.jsxs)(`section`,{className:`mx-4 mt-3 mb-2 rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:[(0,D.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,k(I.closedBy??`board`),I.closedAt===void 0?``:` ${s(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{st as e,
|
|
1
|
+
import{st as e,xt as t}from"./format-hyYD8qd8.js";import{l as n}from"./index-5CbC_NpF.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Zn as e,er as t,ft as n,rn as r}from"./format-hyYD8qd8.js";var i=t(e(),1);function a(e){let t=r();return i.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}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};
|