@kubitnodes/stellaris 0.3.9 → 0.3.11
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 +557 -125
- package/dist/server/index.js +977 -243
- package/package.json +1 -1
- package/web/dist/assets/BackLink-C-vad6K2.js +1 -0
- package/web/dist/assets/ChannelForms-jNbbNnIC.js +1 -0
- package/web/dist/assets/ChannelView-kLoegYUQ.js +1 -0
- package/web/dist/assets/CitizenView-Cb8f2mB7.js +2 -0
- package/web/dist/assets/{CitizensView-DdIHzcx3.js → CitizensView-Ds2rojfa.js} +1 -1
- package/web/dist/assets/KnowledgeView-k10TU0jc.js +1 -0
- package/web/dist/assets/{Markdown-B2tp7ki-.js → Markdown-J2pAPfCa.js} +3 -3
- package/web/dist/assets/{MessageItem-CWZ0X2Vr.js → MessageItem-BjM8BdpK.js} +1 -1
- package/web/dist/assets/{MetricsView-7X3Cmybh.js → MetricsView-D9N54rV7.js} +1 -1
- package/web/dist/assets/{NeedsYouView-Pi1jBF8V.js → NeedsYouView-ML8i7Pl7.js} +1 -1
- package/web/dist/assets/{Overview-C1leALP3.js → Overview-BBXvRhfR.js} +1 -1
- package/web/dist/assets/{Pane-DxXjKLAj.js → Pane-caYWCiyo.js} +1 -1
- package/web/dist/assets/ProjectView-sDpFNjcW.js +1 -0
- package/web/dist/assets/ProposalView-Bc91NjKC.js +1 -0
- package/web/dist/assets/{ProposalsView-Uc6fp4bD.js → ProposalsView-Dg_bEryX.js} +1 -1
- package/web/dist/assets/{RunnersView-D4pd3ArT.js → RunnersView-Dv5nbwYv.js} +1 -1
- package/web/dist/assets/SocietyView-ClaEWgOq.js +1 -0
- package/web/dist/assets/SubjectThread-D_L3vB-A.js +1 -0
- package/web/dist/assets/{TaskFileView-dvFssKHp.js → TaskFileView-B19YtrtW.js} +2 -2
- package/web/dist/assets/{TaskView-C-VIKoFp.js → TaskView-FYSoCb3T.js} +1 -1
- package/web/dist/assets/{TasksView-BXqfwU5R.js → TasksView-CniXTU3R.js} +1 -1
- package/web/dist/assets/{ThreadCard-Bn7HfgDI.js → ThreadCard-DCpvhSlc.js} +1 -1
- package/web/dist/assets/{ThreadForms-CzYPjU1-.js → ThreadForms-DUGkAwTp.js} +1 -1
- package/web/dist/assets/ThreadView-D8eXlVbC.js +1 -0
- package/web/dist/assets/citizen-BtOZq62_.js +1 -0
- package/web/dist/assets/{format-Cc6KjiYZ.js → format-EfoceZkm.js} +1 -1
- package/web/dist/assets/index-BeOGtAz0.css +2 -0
- package/web/dist/assets/index-D75IxLme.js +23 -0
- package/web/dist/assets/{tasks-CbQrkZ1C.js → tasks-Duke4U7N.js} +1 -1
- package/web/dist/assets/{useStickyScroll-NvlGfk6Z.js → useStickyScroll-n5d7sdPZ.js} +1 -1
- package/web/dist/index.html +4 -4
- package/web/dist/assets/BackLink-1EUHNOu3.js +0 -1
- package/web/dist/assets/ChannelView-A47Rvstg.js +0 -1
- package/web/dist/assets/CitizenView-B_jG9N5w.js +0 -2
- package/web/dist/assets/KnowledgeView-CXRQ4igk.js +0 -1
- package/web/dist/assets/ProjectView-DFReelVz.js +0 -1
- package/web/dist/assets/ProposalView-3L5osVUL.js +0 -1
- package/web/dist/assets/SocietyView--buUCciX.js +0 -1
- package/web/dist/assets/SubjectThread-C811fit3.js +0 -1
- package/web/dist/assets/ThreadView-BioBQeqV.js +0 -1
- package/web/dist/assets/citizen-BqHxQY9q.js +0 -1
- package/web/dist/assets/index-WB0PqHlY.js +0 -23
- package/web/dist/assets/index-t2fXHB5Y.css +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,P as t,b as n,c as r,dn as i,fn as a,g as o,gn as s,l as c,m as l,pn as u,t as d,y as f}from"./format-EfoceZkm.js";import{i as p,t as m}from"./tasks-Duke4U7N.js";import{H as h,R as g,V as _,c as v}from"./index-D75IxLme.js";import{n as y,r as b}from"./ThreadForms-DUGkAwTp.js";import{n as x,r as S}from"./ChannelForms-jNbbNnIC.js";import{t as C}from"./Markdown-J2pAPfCa.js";import{n as w,t as T}from"./Pane-caYWCiyo.js";import{n as E,r as D,t as O}from"./Overview-BBXvRhfR.js";var k=s(u(),1),A=a();function j({project:t,onDone:n}){let{api:r}=e(),a=i(),[o,s]=(0,k.useState)(t.name),[c,l]=(0,k.useState)(t.defaultBranch),u={...o.trim()===t.name?{}:{name:o.trim()},...c.trim()===t.defaultBranch?{}:{default_branch:c.trim()}},d=h({mutationFn:()=>r.configureProject(t.slug,u),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`projects`]}),n()}}),f=Object.keys(u).length===0||o.trim()===``||c.trim()===``;return(0,A.jsxs)(`form`,{"aria-label":`Edit ${t.slug}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),d.mutate()},children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`input`,{value:o,maxLength:120,"aria-label":`Project name`,onChange:e=>s(e.target.value),className:`${y} min-w-0 flex-1`}),(0,A.jsx)(`div`,{className:`w-36 shrink-0`,children:(0,A.jsx)(`input`,{value:c,maxLength:100,spellCheck:!1,"aria-label":`Default branch`,onChange:e=>l(e.target.value),className:`${y} font-mono`})}),(0,A.jsx)(v,{onClick:n,children:`Cancel`}),(0,A.jsx)(v,{variant:`primary`,type:`submit`,disabled:d.isPending||f,children:d.isPending?`Saving…`:`Save`})]}),(0,A.jsxs)(`p`,{className:`text-meta`,children:[t.slug,` stays in its addresses, channels, and branches. A new default branch is where tasks start and land from now; its runner makes it from the project's remote, or from where the repository stands, before the next turn.`]}),(0,A.jsx)(b,{error:d.error})]})}function M(){let{slug:e}=_({from:`/p/$slug`}),i=n(),a=r(),s=o(),u=t(e),h=c(e),y=l(e),b=f(3e4),[M,N]=(0,k.useState)(!1),[P,F]=(0,k.useState)(!1),I=i.data?.find(t=>t.slug===e);if(I===void 0)return(0,A.jsx)(w,{children:i.data===void 0?`Reading the project…`:`There is no project ${e}.`});let L=(s.data??[]).filter(e=>e.status===`active`&&I.members.includes(e.name)),R=p(u.data??[]),z=h.data?.body.trim()??``;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(T,{title:I.name,subtitle:`${e} · ${I.repo??`a local repository`} · ${I.defaultBranch}`,trailing:(0,A.jsxs)(A.Fragment,{children:[M||I.archived!==void 0?null:(0,A.jsx)(v,{onClick:()=>N(!0),children:`Edit…`}),(0,A.jsx)(g,{to:`/p/$slug/tasks`,params:{slug:e},className:`shrink-0 rounded-md px-2 py-1 text-xs text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`Tasks →`})]})}),M?(0,A.jsx)(j,{project:I,onDone:()=>N(!1)}):null,P?(0,A.jsx)(S,{project:e,onDone:()=>F(!1)}):null,(0,A.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[I.archived===void 0?null:(0,A.jsxs)(`p`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-sm text-fg-secondary`,children:[`Archived `,d(I.archived.at,b),` by `,I.archived.by,`:`,` `,I.archived.reason,`. Its channels, tasks, and history stay readable here; nothing more is posted, filed, or joined.`]}),(0,A.jsx)(E,{title:`Channels`,aside:I.archived===void 0&&!P?(0,A.jsx)(v,{onClick:()=>F(!0),children:`New channel…`}):null,children:(0,A.jsx)(x,{channels:(a.data??[]).filter(t=>t.project===e),now:b})}),(0,A.jsx)(E,{title:`Members`,children:(0,A.jsx)(O,{members:L,scope:e})}),(0,A.jsx)(E,{title:`Tasks`,children:u.data===void 0?(0,A.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):R.length===0?(0,A.jsx)(`p`,{className:`text-meta`,children:`No tasks yet.`}):(0,A.jsx)(g,{to:`/p/$slug/tasks`,params:{slug:e},className:`flex flex-wrap gap-1.5`,children:R.map(e=>(0,A.jsxs)(`span`,{className:`rounded-md bg-surface-2/60 px-2 py-0.5 text-xs text-fg-secondary`,children:[e.tasks.length,` `,m.find(t=>t.phase===e.phase)?.label.toLowerCase()]},e.phase))})}),(0,A.jsx)(E,{title:`How a task ends`,children:(0,A.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:I.onDone===`merge`?`When its last stage is done, the board merges task/<id> onto ${I.defaultBranch}.`:`When its last stage is done, it is done; nothing is merged.`})}),(0,A.jsx)(E,{title:`Dashboard`,children:h.data===void 0?(0,A.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):z===``?(0,A.jsx)(`p`,{className:`text-meta`,children:`Empty. Agents on the server's machine may edit it.`}):(0,A.jsx)(C,{text:z})}),(0,A.jsx)(E,{title:`Knowledge`,children:(0,A.jsx)(D,{scope:e,topics:y.data,now:b})})]})]})}export{M as ProjectView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ct as e,D as t,F as n,P as r,R as i,St as a,Tt as o,b as s,dn as c,fn as l,g as u,gn as d,it as f,k as p,lt as m,nt as h,ot as g,pn as _,rt as v,st as y,t as b,w as x,x as S,xt as C,y as w,yt as T}from"./format-EfoceZkm.js";import{a as ee}from"./tasks-Duke4U7N.js";import{F as te,H as ne,M as re,N as E,O as D,P as O,R as k,T as A,V as j,c as M,d as N,i as P,j as F,k as I,u as L}from"./index-D75IxLme.js";import{n as R,r as z}from"./ThreadForms-DUGkAwTp.js";import{t as B}from"./Markdown-J2pAPfCa.js";import{n as V,t as ie}from"./Pane-caYWCiyo.js";import{t as H}from"./BackLink-C-vad6K2.js";import{StatusChip as U}from"./ProposalsView-Dg_bEryX.js";import{t as W}from"./SubjectThread-D_L3vB-A.js";var G=d(_(),1),K=l();function q({proposal:e,consequence:n}){let{api:r}=t(),i=c(),a=u(),[o,s]=(0,G.useState)(null),[l,d]=(0,G.useState)(``),f=(0,G.useRef)(null);(0,G.useEffect)(()=>{o!==null&&f.current?.focus()},[o]);let p=ne({mutationFn:()=>{let t=l.trim();return o===`reject`?r.reject({proposal_id:e.id,reason:t}):r.approve({proposal_id:e.id,...t===``?{}:{reason:t}})},onSuccess:()=>{let t=[[`proposals`],[`proposal`,e.id],[`threads`],[`thread`,e.id]];for(let e of t)i.invalidateQueries({queryKey:e});s(null),d(``)}}),m=(a.data??[]).find(t=>t.name===e.proposedBy&&t.status===`active`&&t.cli!==null),h=m===void 0?`Your decision is posted in the proposal's thread, which closes.`:`Your decision is posted in the proposal's thread, which closes, and wakes ${m.name}, who proposed it.`;if(o===null)return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-4 py-3`,children:[(0,K.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`This proposal waits on you.`}),(0,K.jsx)(M,{onClick:()=>s(`reject`),children:`Reject`}),(0,K.jsx)(M,{variant:`primary`,onClick:()=>s(`approve`),children:`Approve`})]});let g=o===`approve`;return(0,K.jsxs)(`form`,{"aria-label":g?`Approve the proposal`:`Reject the proposal`,className:`space-y-2 border-t border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),p.mutate()},children:[(0,K.jsx)(`textarea`,{ref:f,value:l,rows:2,placeholder:g?`Why approve? Optional.`:`Why not? It is posted with the decision.`,"aria-label":g?`Reason for approving`:`Reason for rejecting`,onChange:e=>d(e.target.value),className:`${R} resize-none`}),(0,K.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[g?n:`Nothing is created, and the proposal's thread closes.`,` `,h]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,K.jsx)(M,{onClick:()=>{s(null),p.reset()},children:`Cancel`}),(0,K.jsx)(M,{variant:`primary`,type:`submit`,disabled:p.isPending||!g&&l.trim()===``,children:p.isPending?`Deciding…`:g?`Confirm approval`:`Confirm rejection`})]}),(0,K.jsx)(z,{error:p.error})]})}function J({children:e}){return(0,K.jsx)(`dl`,{className:`mt-2 space-y-1.5`,children:e})}function Y({label:e,children:t}){return(0,K.jsxs)(`div`,{className:`grid grid-cols-[9rem_1fr] gap-3 text-sm`,children:[(0,K.jsx)(`dt`,{className:`text-meta`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0 break-words text-fg-secondary`,children:t})]})}function X(e){return e.length===0?`none`:e.join(`, `)}function Z({name:e,change:t}){return(0,K.jsxs)(`span`,{className:`inline-block rounded-md px-1.5 py-px font-mono text-[11px] ${t===`added`?`bg-emerald-500/15 text-emerald-300`:t===`removed`?`bg-red-500/15 text-red-300 line-through`:`bg-surface-2/70 text-fg-tertiary`}`,children:[t===`added`?`+ `:t===`removed`?`− `:``,e]})}function Q({children:e}){return(0,K.jsx)(`div`,{className:`mt-2 rounded-xl bg-surface-2/30 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:e})}function ae({next:e,current:t,compare:n}){let r=t===void 0?null:E(t,e),i=r!==null&&r.verbsAdded.length===0&&r.verbsRemoved.length===0&&r.changes.length===0&&!r.purposeChanged;return(0,K.jsxs)(K.Fragment,{children:[n?r===null?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:`A new role: no charter by this name exists yet.`}):i?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:`The same as the charter the role has now.`}):(0,K.jsxs)(Q,{children:[(0,K.jsx)(`p`,{className:`text-caps`,children:`Against the charter it has now`}),r.verbsAdded.length+r.verbsRemoved.length===0?null:(0,K.jsxs)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:[r.verbsAdded.map(e=>(0,K.jsx)(Z,{name:e,change:`added`},e)),r.verbsRemoved.map(e=>(0,K.jsx)(Z,{name:e,change:`removed`},e))]}),r.changes.length===0?null:(0,K.jsx)(J,{children:r.changes.map(e=>(0,K.jsxs)(Y,{label:e.field,children:[e.from,` → `,(0,K.jsx)(`span`,{className:`text-fg-primary`,children:e.to})]},e.field))}),r.purposeChanged?(0,K.jsx)(`p`,{className:`mt-2 text-xs text-fg-secondary`,children:`The purpose is rewritten.`}):null]}):null,(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Role`,children:e.name}),(0,K.jsx)(Y,{label:`Purpose`,children:e.purpose}),(0,K.jsx)(Y,{label:`Verbs`,children:(0,K.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.verbs.map(e=>(0,K.jsx)(Z,{name:e},e))})}),(0,K.jsx)(Y,{label:`Wake triggers`,children:X(e.wakeTriggers)}),(0,K.jsx)(Y,{label:`Replicas per project`,children:e.maxReplicas}),(0,K.jsx)(Y,{label:`Warm session`,children:e.resident?`yes`:`no`}),(0,K.jsx)(Y,{label:`Society role`,children:e.societyScope?`yes, in no project`:`no`}),(0,K.jsx)(Y,{label:`Reflects`,children:e.reflects?`yes`:`no`})]})]})}function oe({proposal:e,slug:t,reason:n,members:i}){let a=s(),o=r(t),c=a.data?.find(e=>e.slug===t),l=e.status===`proposed`,u=l?(i??[]).filter(e=>e.status===`active`&&e.memberships.includes(t)).map(e=>e.name):e.provision?.members??[],d=(o.data??[]).filter(ee).length;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Project`,children:[(0,K.jsx)(k,{to:`/p/$slug`,params:{slug:t},className:`hover:text-fg-primary`,children:c?.name??t}),c?.name===void 0||c.name===t?null:` · ${t}`]}),(0,K.jsx)(Y,{label:l?`Members who leave`:`Members who left`,children:Array.isArray(u)?X(u.filter(e=>typeof e==`string`)):`none`}),l?(0,K.jsx)(Y,{label:`Tasks in play`,children:o.data===void 0?`reading…`:d===0?`none`:`${d}: approval is refused until they are done, abandoned, or filed elsewhere`}):null,(0,K.jsx)(Y,{label:`Reason`,children:n}),(0,K.jsx)(Y,{label:`After`,children:`Its open threads close and nothing more is posted, filed, or joined there; its channels, tasks, repository, and history stay readable.`})]})}function se({proposal:e,roles:t,members:n}){let r=e.status===`proposed`,{charter:i}=e;switch(e.kind){case`member`:{let e=f.safeParse(i);if(!e.success)break;let t=e.data;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Citizen`,children:(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(A,{cli:t.cli,size:13}),t.name]})}),(0,K.jsx)(Y,{label:`Role`,children:t.role}),(0,K.jsxs)(Y,{label:`CLI and model`,children:[t.cli,` · `,t.model??`cli default`]}),(0,K.jsx)(Y,{label:`Projects`,children:X(t.memberships)}),(0,K.jsx)(Y,{label:`Also follows`,children:X(t.subscriptions)}),t.homeRunner===void 0?null:(0,K.jsx)(Y,{label:`Runs on`,children:t.homeRunner})]}),t.seedInstructions===void 0?null:(0,K.jsxs)(Q,{children:[(0,K.jsx)(`p`,{className:`text-caps`,children:`Seed instructions`}),(0,K.jsx)(`div`,{className:`mt-1.5`,children:(0,K.jsx)(B,{text:t.seedInstructions})})]})]})}case`role`:{let n=re(e);if(n===null)break;return(0,K.jsx)(ae,{next:n,current:t?.find(e=>e.name===n.name),compare:r})}case`skill`:{let e=m.safeParse(i);if(!e.success)break;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Skill`,children:e.data.name}),(0,K.jsx)(Y,{label:`Summary`,children:e.data.summary})]}),(0,K.jsx)(Q,{children:(0,K.jsx)(B,{text:O(e.data.body)})})]})}case`channel`:{let e=v.safeParse(i);if(!e.success)break;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Channel`,children:[`#`,T(e.data.project,e.data.name)]}),(0,K.jsx)(Y,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=y.safeParse(i);if(!e.success)break;let t=n?.find(t=>t.name===e.data.agent);return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Citizen`,children:[(0,K.jsx)(L,{name:e.data.agent,members:n}),t===void 0?null:` · ${t.role}`]}),(0,K.jsx)(Y,{label:`Holds now`,children:t===void 0?`unknown`:t.claimsHeld===1?`1 stage`:`${t.claimsHeld} stages`}),(0,K.jsx)(Y,{label:`Reason`,children:e.data.reason})]})}case`archive`:{let t=h.safeParse(i);if(!t.success)break;return(0,K.jsx)(oe,{proposal:e,slug:t.data.project,reason:t.data.reason,members:n})}case`reallocation`:{let e=g.safeParse(i);if(!e.success)break;return(0,K.jsx)(J,{children:(0,K.jsx)(Y,{label:`Reallocation`,children:e.data.description})})}}return(0,K.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-lg bg-surface-2/40 p-3 font-mono text-[11px] text-fg-tertiary`,children:JSON.stringify(i,null,2)})}var ce=e({agent:o().optional(),channel:o().optional(),role:o().optional(),skill:o().optional(),replaced:a().optional(),releasedTasks:C(o()).optional(),project:o().optional()});function le({proposal:e}){let t=ce.safeParse(e.provision??{});if(e.provision===void 0||!t.success)return null;let n=t.data,r=`text-fg-primary underline decoration-fg-muted underline-offset-2`;if(e.kind===`member`&&n.agent!==void 0)return(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,K.jsx)(k,{to:`/citizen/$name`,params:{name:n.agent},className:r,children:n.agent}),`.`]});if(e.kind===`channel`&&n.channel!==void 0)return(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,K.jsxs)(k,{to:`/c/$`,params:{_splat:n.channel},className:r,children:[`#`,n.channel]}),`.`]});if(e.kind===`retirement`&&n.agent!==void 0){let e=n.releasedTasks?.length??0;return(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Retired `,n.agent,`; `,e===1?`1 stage went`:`${e} stages went`,` back to open.`]})}return e.kind===`archive`&&n.project!==void 0?(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Archived`,` `,(0,K.jsx)(k,{to:`/p/$slug`,params:{slug:n.project},className:r,children:n.project}),`; its members left and its threads closed.`]}):n.role===void 0?n.skill===void 0?null:(0,K.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Replaced`:`Published`,` the society's skill `,n.skill,`.`]}):(0,K.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Rewrote`:`Added`,` the role `,n.role,`.`]})}function $(){let{proposalId:e}=j({from:`/proposal/$proposalId`}),t=S(e),r=u(),a=x(),o=p(),s=n(),c=w(3e4),l=N();if(t.data===void 0)return(0,K.jsx)(V,{children:t.error instanceof i&&t.error.status===404?`There is no proposal ${e}.`:`Reading the proposal…`});let d=t.data,f=d.status===`proposed`,m=r.data?.find(e=>e.name===d.proposedBy)?.role,h=s.data?.find(e=>e.id===d.id),g=d.status===`rejected`?`Rejected`:`Approved`,_=D(d,{members:r.data??[],roles:a.data??[],skills:o.data??[]});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ie,{leading:(0,K.jsx)(H,{fallback:(0,K.jsx)(k,{to:`/proposals`,"aria-label":`Back to the proposals`,className:`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,children:`←`})}),title:F(d),subtitle:`${d.kind} proposal by ${l(d.proposedBy)} ${b(d.createdAt,c)}${f?` · for ${I(d,m)} to decide`:``}`,trailing:(0,K.jsx)(U,{status:d.status})}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[f?(0,K.jsxs)(`p`,{className:`rounded-lg bg-sky-400/10 px-3 py-2 text-xs leading-relaxed text-sky-200`,children:[`If approved: `,_]}):(0,K.jsxs)(`div`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-xs leading-relaxed text-fg-secondary`,children:[(0,K.jsxs)(`p`,{children:[g,` by `,l(d.decidedBy??`someone`),d.decidedAt===void 0?``:` ${b(d.decidedAt,c)}`,d.reason===void 0?`.`:`: ${d.reason}`]}),(0,K.jsx)(le,{proposal:d})]}),d.body.trim()===``||h!==void 0?null:(0,K.jsxs)(`section`,{className:`mt-5`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:`Why`}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(B,{text:d.body})})]}),(0,K.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:f?`What it would make`:d.status===`provisioned`?`What it made`:`What it proposed`}),(0,K.jsx)(se,{proposal:d,roles:a.data,members:r.data})]}),(0,K.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:`Thread`}),h===void 0?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:s.data===void 0?`Reading the thread…`:`This proposal is older than proposal threads; its thread opens when it is decided.`}):(0,K.jsx)(W,{thread:h,now:c,empty:`Nothing said yet. The pitch and the decision are posted here.`})]})]}),h?.state===`open`?(0,K.jsx)(P,{target:{threadId:d.id},placeholder:`Write in the proposal's thread`}):null,te(d)?(0,K.jsx)(q,{proposal:d,consequence:_}):null]})}export{$ as ProposalView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,
|
|
1
|
+
import{S as e,fn as t,gn as n,pn as r,t as i,y as a}from"./format-EfoceZkm.js";import{A as o,D as s,R as c,d as l,j as u}from"./index-D75IxLme.js";import{n as d,t as f}from"./Pane-caYWCiyo.js";var p=n(r(),1),m=t(),h=8,g={proposed:`bg-amber-500/15 text-amber-300`,approved:`bg-emerald-500/15 text-emerald-300`,provisioned:`bg-emerald-500/15 text-emerald-300`,rejected:`bg-red-500/15 text-red-300`,retired:`bg-surface-2 text-fg-muted`};function _({status:e}){return(0,m.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${g[e]}`,children:e===`provisioned`?`approved`:e})}function v({proposal:e,now:t}){let n=l(),r=e.decidedBy===void 0||e.decidedAt===void 0?``:` · ${e.status===`rejected`?`rejected`:`approved`} by ${n(e.decidedBy)} ${i(e.decidedAt,t)}`;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(c,{to:`/proposal/$proposalId`,params:{proposalId:e.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:u(e)}),(0,m.jsx)(_,{status:e.status})]}),(0,m.jsxs)(`p`,{className:`mt-1 truncate text-meta`,children:[`proposed by `,n(e.proposedBy),` `,i(e.createdAt,t),r]})]})})}function y(){let t=e(),n=a(3e4),[r,i]=(0,p.useState)(!1),c=o(t.data??[]),l=c.find(e=>e.group===`yours`)?.proposals.length??0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(f,{title:`Proposals`,subtitle:`${l===0?`nothing`:l} waiting on you · ${t.data?.length??0} in all`}),(0,m.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.data===void 0?(0,m.jsx)(d,{children:`Reading the proposals…`}):c.length===0?(0,m.jsx)(d,{children:`No proposals yet. Citizens propose roles, members, channels, and skills.`}):c.map(e=>{let t=e.group===`decided`&&!r?e.proposals.slice(0,h):e.proposals;return(0,m.jsxs)(`section`,{className:`mb-3`,children:[(0,m.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[s.find(t=>t.group===e.group)?.label,` ·`,` `,e.proposals.length]}),(0,m.jsx)(`ul`,{children:t.map(e=>(0,m.jsx)(v,{proposal:e,now:n},e.id))}),t.length<e.proposals.length?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.proposals.length]}):null]},e.group)})})]})}export{y as ProposalsView,_ as StatusChip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,T as t,b as n,
|
|
1
|
+
import{D as e,T as t,b as n,dn as r,fn as i,gn as a,pn as o,t as s,u as c,y as l}from"./format-EfoceZkm.js";import{B as u,H as d,T as f,c as p}from"./index-D75IxLme.js";import{n as m,r as h}from"./ThreadForms-DUGkAwTp.js";import{n as g,t as _}from"./Pane-caYWCiyo.js";var v=a(o(),1);function y(e){return e.toUpperCase().replaceAll(/[^A-Z0-9]/g,``)}function b(e,t){return y(e)===y(t)}function x(e,t){let n=(e.split(`.`)[0]??``).toLowerCase().replaceAll(/[^a-z0-9-]+/g,`-`).replaceAll(/-+/g,`-`).replace(/^-+/,``).slice(0,32).replace(/-+$/,``)||`runner`;if(!t.includes(n))return n;for(let e=2;;e+=1){let r=`-${e}`,i=`${n.slice(0,32-r.length)}${r}`;if(!t.includes(i))return i}}var S=i();function C(e,t){return Number(e.status!==`connected`)-Number(t.status!==`connected`)||e.name.localeCompare(t.name)}function w(e,t){return[e.length===0?`no CLI`:e.join(`, `),...t].join(` · `)}function T({enrollment:t,taken:n,followed:i,now:a}){let{api:o}=e(),c=r(),[l,u]=(0,v.useState)(()=>x(t.hostname,n)),f=()=>{c.invalidateQueries({queryKey:[`enrollments`]}),c.invalidateQueries({queryKey:[`runners`]})},g=d({mutationFn:()=>o.approveEnrollment(t.userCode,l.trim()),onSuccess:f}),_=d({mutationFn:()=>o.denyEnrollment(t.userCode),onSuccess:f}),y=g.isPending||_.isPending;return(0,S.jsxs)(`li`,{className:`rounded-xl border px-3 py-3 ${i?`border-amber-500/40 bg-amber-500/5`:`border-line`}`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-fg-primary`,children:t.hostname}),(0,S.jsx)(`code`,{className:`shrink-0 font-mono text-sm text-fg-primary`,children:t.userCode})]}),(0,S.jsxs)(`p`,{className:`mt-0.5 truncate text-meta`,children:[t.os,` · `,w(t.clis,t.capabilities),` · runner`,` `,t.version,` · asked `,s(t.requestedAt,a)]}),(0,S.jsxs)(`form`,{"aria-label":`Approve ${t.hostname}`,className:`mt-2.5 flex items-center gap-2`,onSubmit:e=>{e.preventDefault(),g.mutate()},children:[(0,S.jsx)(`input`,{value:l,maxLength:32,spellCheck:!1,"aria-label":`Runner name`,onChange:e=>u(e.target.value),className:`${m} min-w-0 flex-1 font-mono`}),(0,S.jsx)(p,{onClick:()=>_.mutate(),disabled:y,children:`Deny`}),(0,S.jsx)(p,{variant:`primary`,type:`submit`,disabled:y||l.trim()===``,children:g.isPending?`Approving…`:`Approve`})]}),(0,S.jsx)(`div`,{className:`mt-1.5`,children:(0,S.jsx)(h,{error:g.error??_.error})})]})}function E(){let{code:e}=u({from:`/runners`}),r=c(),i=t(),a=n(),o=l(3e4),d=r.data??[],p=(i.data??[]).map(e=>e.name),m=(i.data??[]).toSorted(C),h=m.filter(e=>e.status===`connected`).length,v=m.length-h,y=e===void 0?void 0:d.find(t=>b(t.userCode,e)),x=y===void 0?d:[y,...d.filter(e=>e!==y)],w=e=>(a.data??[]).filter(t=>t.runner===e.name&&t.archived===void 0).map(e=>e.slug);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_,{title:`Runners`,subtitle:[`${h} connected`,...v===0?[]:[`${v} away`],...d.length===0?[]:[`${d.length} waiting for approval`]].join(` · `)}),(0,S.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[e!==void 0&&r.data!==void 0&&y===void 0?(0,S.jsxs)(`output`,{className:`block px-2 pb-2 text-meta`,children:[`No runner waits with the code `,e,`. It may have been approved, denied, or expired; a runner whose code expired asks again with a new one.`]}):null,x.length===0?null:(0,S.jsx)(`ul`,{"aria-label":`Waiting for approval`,className:`space-y-2 px-2 pb-3`,children:x.map(e=>(0,S.jsx)(T,{enrollment:e,taken:p,followed:e===y,now:o},e.userCode))}),i.data===void 0?(0,S.jsx)(g,{children:`Reading the runners…`}):m.length===0?(0,S.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No runners yet.`}):null,(0,S.jsx)(`ul`,{"aria-label":`Registered`,className:`grid grid-cols-[auto_auto_auto_minmax(0,max-content)_minmax(3rem,1fr)_auto] gap-x-3`,children:m.map(e=>{let t=e.clis.length===0?`no CLI`:e.clis.join(`, `),n=w(e),r=n.length===0?`no projects`:n.join(`, `),i=e.status===`connected`?{label:`connected`,detail:`connected`,tone:`text-fg-muted`}:{label:`away`,detail:`away${e.lastSeen===void 0?``:`, last seen ${s(e.lastSeen,o)}`}`,tone:`text-amber-300`};return(0,S.jsxs)(`li`,{className:`col-span-full grid grid-cols-subgrid items-center rounded-lg px-2 py-1.5 text-sm`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,title:t,children:[e.clis.map(e=>(0,S.jsx)(f,{cli:e,size:13},e)),(0,S.jsx)(`span`,{className:`sr-only`,children:t})]}),(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,S.jsx)(`span`,{className:`text-fg-secondary`,children:e.os}),(0,S.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:e.capabilities.join(`, `),children:e.capabilities.join(`, `)}),(0,S.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,title:r,children:r}),(0,S.jsx)(`span`,{className:`text-right text-xs ${i.tone}`,title:i.detail,children:i.label})]},e.name)})}),r.data===void 0||d.length>0?null:(0,S.jsx)(`p`,{className:`mt-2 border-t border-line px-2 pt-2 text-meta`,children:`A runner started with STELLARIS_SERVER_URL set to this board and no token asks to join here, with a code to approve.`})]})]})}export{E as RunnersView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,b as t,c as n,ct as r,fn as i,g as a,gn as o,k as s,m as c,pn as l,vt as u,w as d,y as f}from"./format-EfoceZkm.js";import{c as p}from"./index-D75IxLme.js";import{n as m,r as h}from"./ChannelForms-jNbbNnIC.js";import{n as g,t as _}from"./Pane-caYWCiyo.js";import{n as v,r as y,t as b}from"./Overview-BBXvRhfR.js";var x=o(l(),1),S=i();function C(){let i=e(),o=a(),l=t(),C=d(),w=s(),T=c(r),E=n(),D=f(3e4),[O,k]=(0,x.useState)(!1);if(i.data===void 0||o.data===void 0)return(0,S.jsx)(g,{children:`Reading the society…`});let A=o.data.filter(e=>e.cli!==null),j=A.filter(e=>e.status===`active`),M=A.filter(e=>e.status===`retired`),N=(C.data??[]).filter(e=>e.name!==u);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_,{title:i.data.name,subtitle:`${j.length} citizens · ${l.data?.length??0} projects · ${N.length} roles`}),O?(0,S.jsx)(h,{project:null,onDone:()=>k(!1)}):null,(0,S.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,S.jsxs)(v,{title:`Citizens`,children:[(0,S.jsx)(b,{members:j,scope:r}),M.length===0?null:(0,S.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,M.map(e=>e.name).join(`, `)]})]}),(0,S.jsx)(v,{title:`Channels`,aside:O?null:(0,S.jsx)(p,{onClick:()=>k(!0),children:`New channel…`}),children:(0,S.jsx)(m,{channels:(E.data??[]).filter(e=>e.project===null),now:D})}),(0,S.jsx)(v,{title:`Roles`,children:(0,S.jsx)(`ul`,{className:`space-y-2.5`,children:N.map(e=>{let t=j.filter(t=>t.role===e.name).length;return(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,S.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,S.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,S.jsx)(v,{title:`Knowledge`,children:(0,S.jsx)(y,{scope:r,topics:T.data,now:D})}),(0,S.jsx)(v,{title:`Skills`,children:w.data===void 0?(0,S.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):w.data.length===0?(0,S.jsx)(`p`,{className:`text-meta`,children:`None yet. A citizen's skill joins the society by proposal.`}):(0,S.jsx)(`ul`,{className:`space-y-1.5`,children:w.data.map(e=>(0,S.jsxs)(`li`,{className:`text-sm`,children:[(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,S.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})})]})]})}export{C as SocietyView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,Gt as t,fn as n,g as r,gn as i,pn as a,t as o}from"./format-EfoceZkm.js";import{I as s}from"./index-D75IxLme.js";import{t as c}from"./Markdown-J2pAPfCa.js";import{t as l}from"./MessageItem-BjM8BdpK.js";var u=i(a(),1),d=n();function f({thread:n,now:i,task:a,empty:f}){let{api:p}=e(),m=r(),h=t({queryKey:[`thread`,n.id],queryFn:()=>p.thread(n.id)}),g=h.data?.messages??[],_=g.at(-1)?.id??null;if((0,u.useEffect)(()=>s(n.id,_),[n.id,_]),h.data===void 0)return(0,d.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the thread…`});let v=h.data.thread;return(0,d.jsxs)(`div`,{className:`-mx-4 mt-1`,children:[g.length===0?(0,d.jsx)(`p`,{className:`mx-4 mt-1 text-meta`,children:f}):g.map(e=>(0,d.jsx)(l,{message:e,members:m.data,now:i,task:a},e.id)),n.state===`closed`?(0,d.jsxs)(`div`,{className:`mx-4 mt-2`,children:[(0,d.jsxs)(`p`,{className:`text-meta`,children:[`Closed`,v.closedAt===void 0?``:` ${o(v.closedAt,i)}`,v.body.trim()===``?`.`:`:`]}),v.body.trim()===``?null:(0,d.jsx)(c,{text:v.body})]}):null]})}export{f as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as e,R as t,
|
|
1
|
+
import{N as e,R as t,Z as n,b as r,fn as i,gn as a,j as o,pn as s,t as c,y as l}from"./format-EfoceZkm.js";import{B as u,R as d,V as f}from"./index-D75IxLme.js";import{c as p,d as m,f as h,i as g,l as _,n as v,o as y,p as b,r as x,t as S}from"./Markdown-J2pAPfCa.js";import{n as C,t as w}from"./Pane-caYWCiyo.js";import{t as T}from"./BackLink-C-vad6K2.js";var E=a(s(),1),D=i(),O=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,k=`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary`,A=1e3,j=2e4;function M({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,D.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,D.jsx)(`span`,{children:`Files`}):(0,D.jsx)(v,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,D.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,D.jsx)(v,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function N({taskId:e,file:t}){let n=t.entries.toSorted((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1);return(0,D.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,D.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,D.jsx)(v,{taskId:e,path:t.path===``?n.name:`${t.path}/${n.name}`,className:`text-sm text-fg-secondary hover:text-fg-primary`,children:n.kind===`dir`?`${n.name}/`:n.name}),n.size===null?null:(0,D.jsx)(`span`,{className:`text-meta`,children:h(n.size)})]},n.name))})}function P({rows:e}){let[t,...n]=e;if(t===void 0)return(0,D.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,A),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,D.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,D.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsx)(`tr`,{children:t.map((e,t)=>(0,D.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,D.jsx)(`tbody`,{children:r.map((e,t)=>(0,D.jsx)(`tr`,{children:e.map((e,t)=>(0,D.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,D.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,A,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function F({text:e,line:t}){let n=e.endsWith(`
|
|
2
2
|
`)?e.slice(0,-1).split(`
|
|
3
3
|
`):e.split(`
|
|
4
|
-
`),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>j?(0,D.jsx)(`pre`,{className:r,children:e}):(0,D.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,D.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,D.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function I({taskId:e,file:t,url:r,line:i}){let a=(0,E.useMemo)(()=>t.content===null?null:b(t.path,g(t.content)),[t.path,t.content]),o=t.path.split(`/`).at(-1)??t.path;return a===null?(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is `,h(t.size),`, more than the `,h(n),` the board shows. Its runner still has it on the task's branch.`]}):a.kind===`markdown`?(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(S,{text:a.text,base:{taskId:e,dir:m(t.path)},line:i})}):a.kind===`image`?r===null?null:(0,D.jsx)(`img`,{src:r,alt:o,className:`mt-3 max-w-full rounded-lg`}):a.kind===`table`?(0,D.jsx)(P,{rows:a.rows}):a.kind===`text`?(0,D.jsx)(F,{text:a.text,line:i}):(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is not text (`,h(t.size),`). Download it to open it.`]})}function L(){let{taskId:n,_splat:
|
|
4
|
+
`),r=`mt-3 overflow-x-auto rounded-lg bg-surface-0/80 p-3 font-mono text-[12px] leading-relaxed text-fg-secondary shadow-[inset_0_0_0_1px_rgba(255,255,255,0.05)]`;return n.length>j?(0,D.jsx)(`pre`,{className:r,children:e}):(0,D.jsx)(`pre`,{className:r,children:n.map((e,n)=>(0,D.jsxs)(`span`,{className:`flex ${n+1===t?`line-target`:``}`,children:[(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`w-10 shrink-0 pr-3 text-right text-fg-muted select-none`,children:n+1}),(0,D.jsx)(`span`,{className:`whitespace-pre`,children:e===``?` `:e})]},n))})}function I({taskId:e,file:t,url:r,line:i}){let a=(0,E.useMemo)(()=>t.content===null?null:b(t.path,g(t.content)),[t.path,t.content]),o=t.path.split(`/`).at(-1)??t.path;return a===null?(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is `,h(t.size),`, more than the `,h(n),` the board shows. Its runner still has it on the task's branch.`]}):a.kind===`markdown`?(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(S,{text:a.text,base:{taskId:e,dir:m(t.path)},line:i})}):a.kind===`image`?r===null?null:(0,D.jsx)(`img`,{src:r,alt:o,className:`mt-3 max-w-full rounded-lg`}):a.kind===`table`?(0,D.jsx)(P,{rows:a.rows}):a.kind===`text`?(0,D.jsx)(F,{text:a.text,line:i}):(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o,` is not text (`,h(t.size),`). Download it to open it.`]})}function L(){let{taskId:n,_splat:i}=f({from:`/task/$taskId/files/$`}),a=u({from:`/task/$taskId/files/$`}),s=y(_(i??``)??``),m=s.path,h=a.line??s.line,g=o(n),v=r(),b=e(n,m),S=l(3e4),A=b.data,j=A?.kind===`file`?A.content:null,P=x(j,p(m)??`application/octet-stream`),F=m===``?`Files`:m.split(`/`).at(-1)??m,L=g.data?.title??n,R=(0,E.useRef)(null);(0,E.useEffect)(()=>{h!==void 0&&A!==void 0&&R.current?.querySelector(`.line-target`)?.scrollIntoView({block:`center`})},[h,A]);let z;if(A!==void 0)z=A.kind===`dir`?(0,D.jsx)(N,{taskId:n,file:A}):(0,D.jsx)(I,{taskId:n,file:A,url:P,line:h});else if(b.error instanceof t&&b.error.status===404)z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[m===``?`Nothing`:m,` is not on task/`,n,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(b.error instanceof t&&b.error.status===503){let e=v.data?.find(e=>e.slug===g.data?.project);z=(0,D.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[e?.runner===void 0?`The runner`:`${e.runner}, the runner`,` `,e?.name??`the project`,` lives on, is not connected, so the task's files cannot be read now.`]})}else z=b.error===null?(0,D.jsxs)(C,{children:[`Reading `,F,` from the task's runner…`]}):(0,D.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:b.error.message});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{leading:(0,D.jsx)(T,{fallback:(0,D.jsx)(d,{to:`/task/$taskId`,params:{taskId:n},"aria-label":`Back to the task ${L}`,className:O,children:`←`})}),title:F,subtitle:A===void 0?L:`${L}${h===void 0?``:` · line ${h}`} · committed by ${A.commit.author} ${c(A.commit.at,S)} · ${A.commit.id.slice(0,7)}`,trailing:P===null?null:(0,D.jsx)(`a`,{href:P,download:F,className:k,children:`Download`})}),(0,D.jsxs)(`div`,{ref:R,className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,D.jsx)(M,{taskId:n,path:m}),z]})]})}export{L as TaskFileView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,F as t,M as n,R as r,b as i,
|
|
1
|
+
import{D as e,F as t,M as n,R as r,b as i,dn as a,fn as o,g as s,gn as c,j as l,pn as u,t as d,y as f}from"./format-EfoceZkm.js";import{a as p,c as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./tasks-Duke4U7N.js";import{H as x,R as S,V as C,c as w,d as T,i as E,u as D,x as O}from"./index-D75IxLme.js";import{a as k,n as A,s as j,t as M,u as N}from"./Markdown-J2pAPfCa.js";import{n as P,t as F}from"./Pane-caYWCiyo.js";import{t as I}from"./BackLink-C-vad6K2.js";import{t as L}from"./SubjectThread-D_L3vB-A.js";var R=c(u(),1),z=o();function B({last:e,now:t}){return e===void 0?null:(0,z.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,d(e.at,t)]})}function V({taskId:e,nodes:t,nested:n,isOpen:r,toggle:i,now:a}){return(0,z.jsx)(`ul`,{className:n?`ml-[5px] border-l border-line-strong pl-2`:`mt-2`,children:t.map(t=>{if(t.kind===`dir`){let n=r(t);return(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>i(t),className:`flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40`,children:[(0,z.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,z.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[t.name,`/`]}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,z.jsx)(B,{last:t.lastChange,now:a})]}),n?(0,z.jsx)(V,{taskId:e,nodes:t.children,nested:!0,isOpen:r,toggle:i,now:a}):null]},`dir:${t.path}`)}let{change:n}=t;return(0,z.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5 text-sm`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`}),n.status===`deleted`?(0,z.jsx)(`span`,{className:`min-w-0 truncate text-fg-tertiary line-through`,title:n.path,children:t.name}):(0,z.jsx)(A,{taskId:e,path:n.path,className:`min-w-0 truncate text-fg-secondary hover:text-fg-primary`,children:t.name}),(0,z.jsx)(`span`,{className:`shrink-0 text-meta`,children:k(n)}),(0,z.jsx)(B,{last:n.lastChange,now:a})]},n.path)})})}function H({taskId:e,changes:t,now:n}){let r=(0,R.useMemo)(()=>j(t),[t]),i=(0,R.useMemo)(()=>N(r),[r]),[a,o]=(0,R.useState)(new Map);return(0,z.jsx)(V,{taskId:e,nodes:r.children,nested:!1,isOpen:e=>a.get(e.path)??i.has(e.path),toggle:e=>{o(t=>new Map(t).set(e.path,!(t.get(e.path)??i.has(e.path))))},now:n})}function U({task:e,now:t}){let a=n(e.id),o=i(),s=`task/${e.id}`,c;if(a.data!==void 0){let{files:n,total:r,head:i}=a.data;c=n.length===0?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[r===1?`1 file`:`${r} files`,` changed · newest commit by `,i.author,` `,d(i.at,t)]}),(0,z.jsx)(H,{taskId:e.id,changes:n,now:t}),r>n.length?(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,r,`; browse the branch for the rest.`]}):null]})}else if(a.error instanceof r&&a.error.status===404)c=(0,z.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,s,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(a.error instanceof r&&a.error.status===503){let t=o.data?.find(t=>t.slug===e.project);c=(0,z.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=a.error===null?(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:a.error.message});return(0,z.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,z.jsx)(A,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),c]})}function W({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=_(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,z.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,z.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,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,z.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,z.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,v(e),c===void 0?null:(0,z.jsxs)(z.Fragment,{children:[` · held by `,(0,z.jsx)(D,{name:c,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${d(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${d(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,u===void 0?``:` · sent back by ${u.by} ${d(u.at,i)}`]})]})]})}function G({taskId:t}){let{api:n}=e(),r=a(),i=x({mutationFn:()=>n.openThread({task_id:t}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,z.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,z.jsx)(w,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,z.jsx)(`p`,{className:`text-meta`,children:i.error===null?`This task is older than task threads. It closes when the task ends.`:i.error.message})]})}function K(){let{taskId:e}=C({from:`/task/$taskId`}),n=l(e),a=t(),o=i(),c=s(),u=f(3e4),_=T();if(n.data===void 0)return(0,z.jsx)(P,{children:n.error instanceof r&&n.error.status===404?`There is no task ${e}.`:`Reading the task…`});let v=n.data,x=y(v),w=o.data?.find(e=>e.slug===v.project),D=a.data?.find(e=>e.id===v.id);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(F,{leading:(0,z.jsx)(I,{fallback:(0,z.jsx)(S,{to:`/p/$slug/tasks`,params:{slug:v.project},"aria-label":`Back to the tasks of ${w?.name??v.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:v.title,subtitle:`${w?.name??v.project}${v.channel===`general`?``:` #${v.channel}`} · ${m(v)} · created by ${_(v.createdBy)} ${d(v.createdAt,u)}`,trailing:(0,z.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${g[x]}`,children:b.find(e=>e.phase===x)?.label.toLowerCase()})}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Plan`}),v.returned===void 0?null:(0,z.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 `,h(v,v.returned.from),` by `,v.returned.by,` `,d(v.returned.at,u),`. The work is redone from`,` `,h(v,v.stage),` until it reaches that stage again.`]}),(0,z.jsx)(`ol`,{className:`mt-3`,children:v.stages.map((e,t)=>(0,z.jsx)(W,{stage:e,index:t,task:v,members:c.data,now:u},e.id))}),(0,z.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,v.onDone===`merge`?`task/${v.id} merges onto the default branch`:`nothing more`,v.blockedBy.length>0?(0,z.jsxs)(z.Fragment,{children:[` · blocked by `,(0,z.jsx)(O,{text:v.blockedBy.join(`, `)})]}):null]}),v.body.trim()===``?null:(0,z.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(M,{text:v.body})})]}),(0,z.jsx)(U,{task:v,now:u}),(0,z.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,z.jsx)(`h3`,{className:`text-section`,children:`Thread`}),a.data===void 0?null:D===void 0?p(v)?(0,z.jsx)(G,{taskId:v.id}):(0,z.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,z.jsx)(L,{thread:D,now:u,task:v,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),D?.state===`open`?(0,z.jsx)(E,{target:{threadId:v.id},placeholder:`Write in the task's thread`}):null]})}export{K as TaskView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,b as t,
|
|
1
|
+
import{P as e,b as t,fn as n,g as r,gn as i,pn as a,t as o,ut as s,y as c}from"./format-EfoceZkm.js";import{c as l,i as u,l as d,o as f,r as p,s as m,t as h}from"./tasks-Duke4U7N.js";import{R as g,V as _,u as v}from"./index-D75IxLme.js";import{n as y,t as b}from"./Pane-caYWCiyo.js";var x=i(a(),1),S=n();function C({task:e}){let t=m(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=f(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} · ${p(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=m(e),i=s(e);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(g,{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:l(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 `,d(e,e.returned.from),` by `,e.returned.by,` `,o(e.returned.at,n)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:e.status===`claimed`&&r!==`landing`&&i!==void 0?(0,S.jsxs)(S.Fragment,{children:[i.name,` · held by `,(0,S.jsx)(v,{name:e.claimedBy??``,members:t})]}):e.status===`open`&&r!==`landing`&&i!==void 0?`${i.name} · waiting for ${p(i)} since ${o(e.stageSince,n)}`:r===`landing`?`landing task/${e.id} on the default branch`:`${r} ${o(e.updatedAt,n)}`})]})})}function E(){let{slug:n}=_({from:`/p/$slug/tasks`}),i=e(n),a=t(),o=r(),s=c(3e4),[l,d]=(0,x.useState)(new Set),f=a.data?.find(e=>e.slug===n),p=u(i.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??n} · ${m} in play · ${i.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:i.data===void 0?(0,S.jsx)(y,{children:`Reading the tasks…`}):p.length===0?(0,S.jsx)(y,{children:`No tasks in this project yet.`}):p.map(e=>{let t=e.phase!==`done`&&e.phase!==`abandoned`||l.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[h.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:o.data,now:s},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>d(new Set([...l,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fn as e,n as t,t as n}from"./format-EfoceZkm.js";import{R as r,x as i}from"./index-D75IxLme.js";var a=e();function o(e){return e?.kind??`topic`}function s({state:e}){return(0,a.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${e===`open`?`bg-emerald-500/15 text-emerald-300`:`bg-surface-2 text-fg-tertiary`}`,children:e})}function c({thread:e,now:c}){let l=e.state===`closed`?t(e.body,180):``,u=e.messages===1?`1 message`:`${e.messages} messages`;return(0,a.jsxs)(r,{to:`/thread/$threadId`,params:{threadId:e.id},className:`mx-4 my-2 block rounded-xl bg-surface-2/40 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:bg-surface-2/70`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`↳`}),(0,a.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:e.title}),(0,a.jsx)(s,{state:e.state})]}),(0,a.jsxs)(`p`,{className:`mt-1 text-meta`,children:[o(e.subject),` thread by `,e.openedBy,` · `,u,` · opened`,` `,n(e.openedAt,c)]}),l===``?null:(0,a.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-secondary`,children:(0,a.jsx)(i,{text:l,links:!1})})]})}export{c as n,o as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,R as t,
|
|
1
|
+
import{D as e,R as t,dn as n,fn as r,g as i,gn as a,pn as o,w as s}from"./format-EfoceZkm.js";import{H as c,a as l,c as u,o as d,z as f}from"./index-D75IxLme.js";var p=a(o(),1),m=r(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof t?e.message:`The board did not take it.`})}function _({channel:t,onDone:r}){let{api:a}=e(),o=n(),_=f(),v=i(),y=s(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=c({mutationFn:async()=>{let e=await a.openThread({channel:t,title:b.trim()});return S.trim()!==``&&await a.sendMessage({thread_id:e.id,body:S.trim()}),e},onSuccess:e=>{o.invalidateQueries({queryKey:[`threads`]}),r(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:d(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${l(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(u,{onClick:r,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:t,channel:r,onDone:i}){let{api:a}=e(),o=n(),[s,l]=(0,p.useState)(``),d=(0,p.useRef)(null);(0,p.useEffect)(()=>d.current?.focus(),[]);let f=c({mutationFn:()=>a.closeThread({thread_id:t,summary:s.trim()}),onSuccess:()=>{for(let e of[[`thread`,t],[`threads`],[`channel`,r]])o.invalidateQueries({queryKey:e});i()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,m.jsx)(`textarea`,{ref:d,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${r}.`,"aria-label":`Closing summary`,onChange:e=>l(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{onClick:i,children:`Cancel`}),(0,m.jsx)(u,{variant:`primary`,type:`submit`,disabled:s.trim()===``||f.isPending,children:f.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:f.error})]})}export{_ as i,h as n,g as r,v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,Gt as t,R as n,fn as r,g as i,gn as a,j as o,pn as s,t as c,y as l}from"./format-EfoceZkm.js";import{I as u,R as d,V as f,c as p,d as m,i as h}from"./index-D75IxLme.js";import{t as g}from"./ThreadForms-DUGkAwTp.js";import{t as _}from"./Markdown-J2pAPfCa.js";import{t as v}from"./MessageItem-BjM8BdpK.js";import{n as y,t as b}from"./Pane-caYWCiyo.js";import{r as x,t as S}from"./ThreadCard-DCpvhSlc.js";import{t as C}from"./useStickyScroll-n5d7sdPZ.js";import{t as w}from"./BackLink-C-vad6K2.js";var T=a(s(),1),E=r();function D(){let{threadId:e}=f({from:`/thread/$threadId`});return(0,E.jsx)(O,{id:e},e)}function O({id:r}){let{api:a}=e(),s=t({queryKey:[`thread`,r],queryFn:()=>a.thread(r)}),f=i(),D=l(3e4),O=m(),k=s.data?.messages??[],A=k.at(-1)?.id??null;(0,T.useEffect)(()=>u(r,A),[r,A]);let{ref:j,onScroll:M}=C(),[N,P]=(0,T.useState)(!1),F=s.data?.thread.subject,I=o(F?.kind===`task`?F.id:null);if(s.data===void 0)return(0,E.jsx)(y,{children:s.error instanceof n&&s.error.status===404?`There is no thread ${r}.`:`Reading the thread…`});let{thread:L}=s.data;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(b,{leading:(0,E.jsx)(w,{fallback:(0,E.jsx)(d,{to:`/c/$`,params:{_splat:L.channel},"aria-label":`Back to #${L.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:L.title,subtitle:`${x(L.subject)} thread in #${L.channel} · opened by ${O(L.openedBy)} ${c(L.openedAt,D)}`,trailing:(0,E.jsxs)(E.Fragment,{children:[L.subject?.kind===`task`?(0,E.jsx)(d,{to:`/task/$taskId`,params:{taskId:L.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 →`}):L.subject?.kind===`proposal`?(0,E.jsx)(d,{to:`/proposal/$proposalId`,params:{proposalId:L.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,L.state===`open`&&!N&&L.subject?.kind!==`task`?(0,E.jsx)(p,{onClick:()=>P(!0),children:`Close`}):(0,E.jsx)(S,{state:L.state})]})}),N&&L.state===`open`?(0,E.jsx)(g,{threadId:L.id,channel:L.channel,onDone:()=>P(!1)}):null,(0,E.jsxs)(`div`,{ref:j,onScroll:M,className:`flex-1 overflow-y-auto py-2`,children:[k.length===0?(0,E.jsx)(y,{children:`No messages in this thread yet.`}):null,k.map(e=>(0,E.jsx)(v,{message:e,members:f.data,now:D,task:I.data},e.id)),L.state===`closed`?(0,E.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,E.jsxs)(`p`,{className:`text-caps`,children:[`Closed by `,O(L.closedBy??`board`),L.closedAt===void 0?``:` ${c(L.closedAt,D)}`]}),L.body.trim()===``?(0,E.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`It ended with its `,x(L.subject),`.`]}):(0,E.jsx)(_,{text:L.body})]}):null]}),L.state===`open`?(0,E.jsx)(h,{target:{threadId:L.id},placeholder:`Reply in the thread`}):null]})}export{D as ThreadView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ct as e,et as t}from"./format-EfoceZkm.js";import{p as n}from"./index-D75IxLme.js";function r(e){return e===`society`?`the society`:e}function i(t){return[...t.memberships,e]}function a(e){return e.startedAt===void 0?null:n(e.startedAt,Date.parse(e.ts))}var o={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`interrupted`,blocked:`blocked`,stopped:`stopped by you`};function s(e){return e.exitReason===null?e.outcome===`failed`?`failed`:`completed`:o[e.exitReason]??e.exitReason}function c(e){return e.outcome===`failed`||e.exitReason!==null&&e.exitReason!==`completed`&&e.exitReason!==`stopped`}var l=new Intl.NumberFormat(`en`,{notation:`compact`}),u=new Intl.NumberFormat(`en`);function d(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function f(e){return`${l.format(d(e))} in · ${l.format(e.outputTokens)} out`}function p(e){return[`${u.format(d(e))} input tokens: ${u.format(e.cacheReadTokens)} read from the cache,`,`${u.format(e.cacheWriteTokens)} written to it, ${u.format(e.inputTokens)} neither;`,`${u.format(e.outputTokens)} output tokens`].join(` `)}function m(e){let n=e.flatMap(e=>e.usage===void 0?[]:[e.usage]);return{turns:e.length,failed:e.filter(c).length,usage:n.length===0?null:n.reduce(t),withUsage:n.length}}function h(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 g(e,t){let n=[...e.homeRunner===void 0?[]:[{what:`outside projects`,runner:e.homeRunner}],...e.memberships.map(e=>({what:e,runner:t.get(e)}))],r=[...new Set(n.flatMap(e=>e.runner===void 0?[]:[e.runner]))],i=n.map(e=>`${e.what}: ${e.runner??`placed on its first turn`}`).join(`; `);return{label:r.length===0?`no runner yet`:`on ${r.join(`, `)}`,detail:i===``?`pinned to a runner on its first turn`:i}}export{p as a,i as c,r as i,h as l,m as n,f as o,g as r,a as s,s as t};
|