@kubitnodes/stellaris 0.3.2 → 0.3.4
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 +27 -1
- package/dist/server/index.js +69 -21
- package/package.json +1 -1
- package/web/dist/assets/{ChannelView-CX4cPMWM.js → ChannelView-CZyYu_Zi.js} +1 -1
- package/web/dist/assets/{CitizenView-8ZU2hK4D.js → CitizenView-JsI89Tn3.js} +2 -2
- package/web/dist/assets/{CitizensView-BDenU7WD.js → CitizensView-7vHTRRIs.js} +1 -1
- package/web/dist/assets/KnowledgeView-eBae2Dix.js +1 -0
- package/web/dist/assets/Markdown-BrvfGmz7.js +31 -0
- package/web/dist/assets/{MessageItem-BWuFJqdk.js → MessageItem-DXU3Ovq1.js} +1 -1
- package/web/dist/assets/MetricsView-CxXGHRtN.js +1 -0
- package/web/dist/assets/NeedsYouView-R-oQddyC.js +1 -0
- package/web/dist/assets/{Overview-BYcIErNt.js → Overview-D76LQcxp.js} +1 -1
- package/web/dist/assets/{Pane-KNrdAxkc.js → Pane-JzhKR0rO.js} +1 -1
- package/web/dist/assets/{ProjectView-CmoGtfJ4.js → ProjectView-vYKWw1Ck.js} +1 -1
- package/web/dist/assets/ProposalView-dskJSjhm.js +1 -0
- package/web/dist/assets/{ProposalsView-DSiFdLGD.js → ProposalsView-DQW7OmOU.js} +1 -1
- package/web/dist/assets/{RunnersView-DfduymeY.js → RunnersView-BLwSywI7.js} +1 -1
- package/web/dist/assets/{SocietyView-BwfrqQiF.js → SocietyView-OCdDJqhz.js} +1 -1
- package/web/dist/assets/{SubjectThread-B-1_FwBN.js → SubjectThread-DQNXXY4q.js} +1 -1
- package/web/dist/assets/TaskFileView-Bl1vm7Op.js +4 -0
- package/web/dist/assets/TaskView-Bq-vXuc5.js +1 -0
- package/web/dist/assets/{TasksView-QpcbsOzR.js → TasksView-C1cdPYRc.js} +1 -1
- package/web/dist/assets/ThreadCard-CliRbP_c.js +1 -0
- package/web/dist/assets/{ThreadForms-B6Lv_t5p.js → ThreadForms-C4ytMMBB.js} +1 -1
- package/web/dist/assets/{ThreadView-5PMRCHd4.js → ThreadView-CvXd68Ml.js} +1 -1
- package/web/dist/assets/{citizen-B9DadtKn.js → citizen-TjyiyFqE.js} +1 -1
- package/web/dist/assets/{format-DbfHOiKW.js → format-8m6fdeP8.js} +1 -1
- package/web/dist/assets/index-CADeLxUP.js +23 -0
- package/web/dist/assets/index-iNICYkef.css +2 -0
- package/web/dist/assets/{tasks-Bw07dkQC.js → tasks-Di8iatzY.js} +1 -1
- package/web/dist/assets/{useStickyScroll-CRgyaBkv.js → useStickyScroll-BPuANcOs.js} +1 -1
- package/web/dist/index.html +4 -4
- package/web/dist/assets/KnowledgeView-IUzeK83J.js +0 -1
- package/web/dist/assets/Markdown-DH59NuID.js +0 -31
- package/web/dist/assets/MetricsView-RzP1J0EG.js +0 -1
- package/web/dist/assets/NeedsYouView-DvnPW0tZ.js +0 -1
- package/web/dist/assets/ProposalView-FjvrD4Fz.js +0 -1
- package/web/dist/assets/TaskFileView-BNR8mQRk.js +0 -1
- package/web/dist/assets/TaskView-qdFvjqvJ.js +0 -1
- package/web/dist/assets/ThreadCard-ClSg5-Lj.js +0 -1
- package/web/dist/assets/index-2BnqwsfR.js +0 -23
- package/web/dist/assets/index-C3ujZpqY.css +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bt as e,hn as t,n,t as r,v as i,y as a}from"./format-DbfHOiKW.js";import{C as o,O as s,c,v as l}from"./index-2BnqwsfR.js";import{n as u,t as d}from"./Pane-KNrdAxkc.js";var f=t(),p=[{kind:`proposal`,label:`Proposals to decide`},{kind:`stage`,label:`Stages that name you`},{kind:`request`,label:`Asked of you`}],m=`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`;function h({title:e,meta:t}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-title block truncate`,children:e}),(0,f.jsx)(`span`,{className:`mt-1 block truncate text-meta`,children:t})]})}function g(){let t=o(),g=a(),_=i(3e4),v=e=>g.data?.find(t=>t.slug===e)?.name??e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d,{title:`Needs you`,subtitle:t.length===0?`Nothing waits on you`:`${t.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.length===0?(0,f.jsx)(u,{children:`Nothing waits on you. Proposals you may decide, stages that name you, and questions citizens ask you with @user appear here until you answer where they asked.`}):p.map(({kind:i,label:a})=>{let o=t.filter(e=>e.kind===i);return o.length===0?null:(0,f.jsxs)(`section`,{className:`mb-3`,children:[(0,f.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[a,` · `,o.length]}),(0,f.jsx)(`ul`,{children:o.map(t=>{if(t.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:t.proposal.id},className:m,children:(0,f.jsx)(h,{title:s(t.proposal),meta:`proposed by ${c(t.proposal.proposedBy)} ${r(t.since,_)}`})})},t.proposal.id);if(t.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:t.task.id},className:m,children:(0,f.jsx)(h,{title:t.task.title,meta:`${t.stage.name}${t.stage.gate?` (gate)`:``} in ${v(t.task.project)} · waiting since ${r(t.since,_)}`})})},t.task.id);let i=`${c(t.message.author)} in ${t.thread===null?`#${t.message.channel}`:t.thread.title} ${r(t.since,_)}`,a=(0,f.jsx)(h,{title:(0,f.jsx)(l,{text:n(t.message.body,160),links:!1}),meta:i}),o=t.thread?.subject;return(0,f.jsx)(`li`,{children:o?.kind===`task`?(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:o.id},className:m,children:a}):o?.kind===`proposal`?(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:o.id},className:m,children:a}):t.thread===null?(0,f.jsx)(e,{to:`/c/$`,params:{_splat:t.message.channel},className:m,children:a}):(0,f.jsx)(e,{to:`/thread/$threadId`,params:{threadId:t.thread.id},className:m,children:a})},t.message.id)})})]},i)})})]})}export{g as NeedsYouView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,C as t,E as n,I as r,M as i,N as a,O as o,Q as s,Z as c,_t as l,b as u,bt as d,gn as f,gt as p,hn as m,ht as h,it as g,m as _,mn as v,nt as y,pt as b,t as x,tt as S,v as C,y as w,yn as T,yt as E}from"./format-DbfHOiKW.js";import{a as ee}from"./tasks-Bw07dkQC.js";import{A as te,E as D,I as O,L as k,M as A,O as ne,S as j,T as M,a as N,c as P,j as F,k as I,s as L,t as R}from"./index-2BnqwsfR.js";import{t as z}from"./Markdown-DH59NuID.js";import{n as B,t as V}from"./Pane-KNrdAxkc.js";import{n as H,r as U}from"./ThreadForms-B6Lv_t5p.js";import{StatusChip as W}from"./ProposalsView-DSiFdLGD.js";import{t as G}from"./SubjectThread-B-1_FwBN.js";var K=T(f(),1),q=m();function J({proposal:e,consequence:t}){let{api:r}=n(),i=v(),a=_(),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(``),u=(0,K.useRef)(null);(0,K.useEffect)(()=>{o!==null&&u.current?.focus()},[o]);let d=k({mutationFn:()=>{let t=c.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),l(``)}}),f=(a.data??[]).find(t=>t.name===e.proposedBy&&t.status===`active`&&t.cli!==null),p=f===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 ${f.name}, who proposed it.`;if(o===null)return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-4 py-3`,children:[(0,q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`This proposal waits on you.`}),(0,q.jsx)(N,{onClick:()=>s(`reject`),children:`Reject`}),(0,q.jsx)(N,{variant:`primary`,onClick:()=>s(`approve`),children:`Approve`})]});let m=o===`approve`;return(0,q.jsxs)(`form`,{"aria-label":m?`Approve the proposal`:`Reject the proposal`,className:`space-y-2 border-t border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),d.mutate()},children:[(0,q.jsx)(`textarea`,{ref:u,value:c,rows:2,placeholder:m?`Why approve? Optional.`:`Why not? It is posted with the decision.`,"aria-label":m?`Reason for approving`:`Reason for rejecting`,onChange:e=>l(e.target.value),className:`${H} resize-none`}),(0,q.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[m?t:`Nothing is created, and the proposal's thread closes.`,` `,p]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(N,{onClick:()=>{s(null),d.reset()},children:`Cancel`}),(0,q.jsx)(N,{variant:`primary`,type:`submit`,disabled:d.isPending||!m&&c.trim()===``,children:d.isPending?`Deciding…`:m?`Confirm approval`:`Confirm rejection`})]}),(0,q.jsx)(U,{error:d.error})]})}function Y({children:e}){return(0,q.jsx)(`dl`,{className:`mt-2 space-y-1.5`,children:e})}function X({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[9rem_1fr] gap-3 text-sm`,children:[(0,q.jsx)(`dt`,{className:`text-meta`,children:e}),(0,q.jsx)(`dd`,{className:`min-w-0 break-words text-fg-secondary`,children:t})]})}function Z(e){return e.length===0?`none`:e.join(`, `)}function Q({name:e,change:t}){return(0,q.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 $({children:e}){return(0,q.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 re({next:e,current:t,compare:n}){let r=t===void 0?null:te(t,e),i=r!==null&&r.verbsAdded.length===0&&r.verbsRemoved.length===0&&r.changes.length===0&&!r.purposeChanged;return(0,q.jsxs)(q.Fragment,{children:[n?r===null?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`A new role: no charter by this name exists yet.`}):i?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`The same as the charter the role has now.`}):(0,q.jsxs)($,{children:[(0,q.jsx)(`p`,{className:`text-caps`,children:`Against the charter it has now`}),r.verbsAdded.length+r.verbsRemoved.length===0?null:(0,q.jsxs)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:[r.verbsAdded.map(e=>(0,q.jsx)(Q,{name:e,change:`added`},e)),r.verbsRemoved.map(e=>(0,q.jsx)(Q,{name:e,change:`removed`},e))]}),r.changes.length===0?null:(0,q.jsx)(Y,{children:r.changes.map(e=>(0,q.jsxs)(X,{label:e.field,children:[e.from,` → `,(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.to})]},e.field))}),r.purposeChanged?(0,q.jsx)(`p`,{className:`mt-2 text-xs text-fg-secondary`,children:`The purpose is rewritten.`}):null]}):null,(0,q.jsxs)(Y,{children:[(0,q.jsx)(X,{label:`Role`,children:e.name}),(0,q.jsx)(X,{label:`Purpose`,children:e.purpose}),(0,q.jsx)(X,{label:`Verbs`,children:(0,q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.verbs.map(e=>(0,q.jsx)(Q,{name:e},e))})}),(0,q.jsx)(X,{label:`Wake triggers`,children:Z(e.wakeTriggers)}),(0,q.jsx)(X,{label:`Replicas per project`,children:e.maxReplicas}),(0,q.jsx)(X,{label:`Warm session`,children:e.resident?`yes`:`no`}),(0,q.jsx)(X,{label:`Society role`,children:e.societyScope?`yes, in no project`:`no`}),(0,q.jsx)(X,{label:`Reflects`,children:e.reflects?`yes`:`no`})]})]})}function ie({proposal:e,slug:t,reason:n,members:r}){let a=w(),o=i(t),s=a.data?.find(e=>e.slug===t),c=e.status===`proposed`,l=c?(r??[]).filter(e=>e.status===`active`&&e.memberships.includes(t)).map(e=>e.name):e.provision?.members??[],u=(o.data??[]).filter(ee).length;return(0,q.jsxs)(Y,{children:[(0,q.jsxs)(X,{label:`Project`,children:[(0,q.jsx)(d,{to:`/p/$slug`,params:{slug:t},className:`hover:text-fg-primary`,children:s?.name??t}),s?.name===void 0||s.name===t?null:` · ${t}`]}),(0,q.jsx)(X,{label:c?`Members who leave`:`Members who left`,children:Array.isArray(l)?Z(l.filter(e=>typeof e==`string`)):`none`}),c?(0,q.jsx)(X,{label:`Tasks in play`,children:o.data===void 0?`reading…`:u===0?`none`:`${u}: approval is refused until they are done, abandoned, or filed elsewhere`}):null,(0,q.jsx)(X,{label:`Reason`,children:n}),(0,q.jsx)(X,{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 ae({proposal:t,roles:n,members:r}){let i=t.status===`proposed`,{charter:a}=t;switch(t.kind){case`member`:{let t=e.safeParse(a);if(!t.success)break;let n=t.data;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Y,{children:[(0,q.jsx)(X,{label:`Citizen`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,q.jsx)(j,{cli:n.cli,size:13}),n.name]})}),(0,q.jsx)(X,{label:`Role`,children:n.role}),(0,q.jsxs)(X,{label:`CLI and model`,children:[n.cli,` · `,n.model??`cli default`]}),(0,q.jsx)(X,{label:`Projects`,children:Z(n.memberships)}),(0,q.jsx)(X,{label:`Also follows`,children:Z(n.subscriptions)}),n.homeRunner===void 0?null:(0,q.jsx)(X,{label:`Runs on`,children:n.homeRunner})]}),n.seedInstructions===void 0?null:(0,q.jsxs)($,{children:[(0,q.jsx)(`p`,{className:`text-caps`,children:`Seed instructions`}),(0,q.jsx)(`div`,{className:`mt-1.5`,children:(0,q.jsx)(z,{text:n.seedInstructions})})]})]})}case`role`:{let e=I(t);if(e===null)break;return(0,q.jsx)(re,{next:e,current:n?.find(t=>t.name===e.name),compare:i})}case`skill`:{let e=g.safeParse(a);if(!e.success)break;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Y,{children:[(0,q.jsx)(X,{label:`Skill`,children:e.data.name}),(0,q.jsx)(X,{label:`Summary`,children:e.data.summary})]}),(0,q.jsx)($,{children:(0,q.jsx)(z,{text:F(e.data.body)})})]})}case`channel`:{let e=s.safeParse(a);if(!e.success)break;return(0,q.jsxs)(Y,{children:[(0,q.jsxs)(X,{label:`Channel`,children:[`#`,b(e.data.project,e.data.name)]}),(0,q.jsx)(X,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=y.safeParse(a);if(!e.success)break;let t=r?.find(t=>t.name===e.data.agent);return(0,q.jsxs)(Y,{children:[(0,q.jsxs)(X,{label:`Citizen`,children:[(0,q.jsx)(L,{name:e.data.agent,members:r}),t===void 0?null:` · ${t.role}`]}),(0,q.jsx)(X,{label:`Holds now`,children:t===void 0?`unknown`:t.claimsHeld===1?`1 stage`:`${t.claimsHeld} stages`}),(0,q.jsx)(X,{label:`Reason`,children:e.data.reason})]})}case`archive`:{let e=c.safeParse(a);if(!e.success)break;return(0,q.jsx)(ie,{proposal:t,slug:e.data.project,reason:e.data.reason,members:r})}case`reallocation`:{let e=S.safeParse(a);if(!e.success)break;return(0,q.jsx)(Y,{children:(0,q.jsx)(X,{label:`Reallocation`,children:e.data.description})})}}return(0,q.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(a,null,2)})}var oe=l({agent:E().optional(),channel:E().optional(),role:E().optional(),skill:E().optional(),replaced:p().optional(),releasedTasks:h(E()).optional(),project:E().optional()});function se({proposal:e}){let t=oe.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,q.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,q.jsx)(d,{to:`/citizen/$name`,params:{name:n.agent},className:r,children:n.agent}),`.`]});if(e.kind===`channel`&&n.channel!==void 0)return(0,q.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,q.jsxs)(d,{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,q.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,q.jsxs)(`p`,{className:`mt-1`,children:[`Archived`,` `,(0,q.jsx)(d,{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,q.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Replaced`:`Published`,` the society's skill `,n.skill,`.`]}):(0,q.jsxs)(`p`,{className:`mt-1`,children:[n.replaced===!0?`Rewrote`:`Added`,` the role `,n.role,`.`]})}function ce(){let{proposalId:e}=O({from:`/proposal/$proposalId`}),n=u(e),i=_(),s=t(),c=o(),l=a(),f=C(3e4);if(n.data===void 0)return(0,q.jsx)(B,{children:n.error instanceof r&&n.error.status===404?`There is no proposal ${e}.`:`Reading the proposal…`});let p=n.data,m=p.status===`proposed`,h=i.data?.find(e=>e.name===p.proposedBy)?.role,g=l.data?.find(e=>e.id===p.id),v=p.status===`rejected`?`Rejected`:`Approved`,y=M(p,{members:i.data??[],roles:s.data??[],skills:c.data??[]});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{leading:(0,q.jsx)(d,{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:ne(p),subtitle:`${p.kind} proposal by ${P(p.proposedBy)} ${x(p.createdAt,f)}${m?` · for ${D(p,h)} to decide`:``}`,trailing:(0,q.jsx)(W,{status:p.status})}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[m?(0,q.jsxs)(`p`,{className:`rounded-lg bg-sky-400/10 px-3 py-2 text-xs leading-relaxed text-sky-200`,children:[`If approved: `,y]}):(0,q.jsxs)(`div`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-xs leading-relaxed text-fg-secondary`,children:[(0,q.jsxs)(`p`,{children:[v,` by `,P(p.decidedBy??`someone`),p.decidedAt===void 0?``:` ${x(p.decidedAt,f)}`,p.reason===void 0?`.`:`: ${p.reason}`]}),(0,q.jsx)(se,{proposal:p})]}),p.body.trim()===``||g!==void 0?null:(0,q.jsxs)(`section`,{className:`mt-5`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:`Why`}),(0,q.jsx)(`div`,{className:`mt-2`,children:(0,q.jsx)(z,{text:p.body})})]}),(0,q.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:m?`What it would make`:p.status===`provisioned`?`What it made`:`What it proposed`}),(0,q.jsx)(ae,{proposal:p,roles:s.data,members:i.data})]}),(0,q.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:`Thread`}),g===void 0?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:l.data===void 0?`Reading the thread…`:`This proposal is older than proposal threads; its thread opens when it is decided.`}):(0,q.jsx)(G,{thread:g,now:f,empty:`Nothing said yet. The pitch and the decision are posted here.`})]})]}),g?.state===`open`?(0,q.jsx)(R,{target:{threadId:p.id},placeholder:`Write in the proposal's thread`}):null,A(p)?(0,q.jsx)(J,{proposal:p,consequence:y}):null]})}export{ce as ProposalView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,I as t,bt as n,gn as r,hn as i,j as a,q as o,t as s,v as c,y as l,yn as u}from"./format-DbfHOiKW.js";import{I as d}from"./index-2BnqwsfR.js";import{a as f,c as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./Markdown-DH59NuID.js";import{n as x,t as S}from"./Pane-KNrdAxkc.js";var C=u(r(),1),w=i(),T=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`,E=`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`,D=1e3;function O({taskId:e,path:t}){let n=t===``?[]:t.split(`/`),r=`text-fg-tertiary hover:text-fg-primary`;return(0,w.jsxs)(`nav`,{"aria-label":`Path`,className:`flex flex-wrap items-center gap-x-1 text-meta`,children:[n.length===0?(0,w.jsx)(`span`,{children:`Files`}):(0,w.jsx)(g,{taskId:e,path:``,className:r,children:`Files`}),n.map((t,i)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i===n.length-1?(0,w.jsx)(`span`,{className:`text-fg-secondary`,children:t}):(0,w.jsx)(g,{taskId:e,path:n.slice(0,i+1).join(`/`),className:r,children:t})]},n.slice(0,i+1).join(`/`)))]})}function k({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,w.jsx)(`ul`,{className:`mt-3 space-y-1`,children:n.map(n=>(0,w.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,w.jsx)(g,{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,w.jsx)(`span`,{className:`text-meta`,children:p(n.size)})]},n.name))})}function A({rows:e}){let[t,...n]=e;if(t===void 0)return(0,w.jsx)(`p`,{className:`mt-3 text-meta`,children:`The table is empty.`});let r=n.slice(0,D),i=`border border-line px-2 py-1 text-left align-top whitespace-pre-wrap`;return(0,w.jsxs)(`div`,{className:`mt-3 overflow-x-auto`,children:[(0,w.jsxs)(`table`,{className:`text-xs text-fg-secondary`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsx)(`tr`,{children:t.map((e,t)=>(0,w.jsx)(`th`,{scope:`col`,className:`${i} font-medium text-fg-primary`,children:e},t))})}),(0,w.jsx)(`tbody`,{children:r.map((e,t)=>(0,w.jsx)(`tr`,{children:e.map((e,t)=>(0,w.jsx)(`td`,{className:i,children:e},t))},t))})]}),n.length>r.length?(0,w.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,D,` of `,n.length,` rows; download the file for the rest.`]}):null]})}function j({taskId:e,file:t,url:n}){let r=(0,C.useMemo)(()=>t.content===null?null:h(t.path,m(t.content)),[t.path,t.content]),i=t.path.split(`/`).at(-1)??t.path;return r===null?(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[i,` is `,p(t.size),`, more than the `,p(o),` the board shows. Its runner still has it on the task's branch.`]}):r.kind===`markdown`?(0,w.jsx)(`div`,{className:`mt-3`,children:(0,w.jsx)(b,{text:r.text,base:{taskId:e,dir:y(t.path)}})}):r.kind===`image`?n===null?null:(0,w.jsx)(`img`,{src:n,alt:i,className:`mt-3 max-w-full rounded-lg`}):r.kind===`table`?(0,w.jsx)(A,{rows:r.rows}):r.kind===`text`?(0,w.jsx)(`pre`,{className:`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)]`,children:r.text}):(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[i,` is not text (`,p(t.size),`). Download it to open it.`]})}function M(){let{taskId:r,_splat:i}=d({from:`/task/$taskId/files/$`}),o=_(i??``)??``,u=e(r),p=l(),m=a(r,o),h=c(3e4),g=m.data,y=g?.kind===`file`?g.content:null,b=v(y,f(o)??`application/octet-stream`),C=o===``?`Files`:o.split(`/`).at(-1)??o,D=u.data?.title??r,A;if(g!==void 0)A=g.kind===`dir`?(0,w.jsx)(k,{taskId:r,file:g}):(0,w.jsx)(j,{taskId:r,file:g,url:b});else if(m.error instanceof t&&m.error.status===404)A=(0,w.jsxs)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:[o===``?`Nothing`:o,` is not on task/`,r,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(m.error instanceof t&&m.error.status===503){let e=p.data?.find(e=>e.slug===u.data?.project);A=(0,w.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 A=m.error===null?(0,w.jsxs)(x,{children:[`Reading `,C,` from the task's runner…`]}):(0,w.jsx)(`p`,{className:`mt-3 text-sm text-fg-secondary`,children:m.error.message});return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(S,{leading:(0,w.jsx)(n,{to:`/task/$taskId`,params:{taskId:r},"aria-label":`Back to the task ${D}`,className:T,children:`←`}),title:C,subtitle:g===void 0?D:`${D} · committed by ${g.commit.author} ${s(g.commit.at,h)} · ${g.commit.id.slice(0,7)}`,trailing:b===null?null:(0,w.jsx)(`a`,{href:b,download:C,className:E,children:`Download`})}),(0,w.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,w.jsx)(O,{taskId:r,path:o}),A]})]})}export{M as TaskFileView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,E as t,I as n,N as r,bt as i,hn as a,m as o,mn as s,t as c,v as l,y as u}from"./format-DbfHOiKW.js";import{a as d,c as f,l as p,n as m,o as h,r as g,s as _,t as v}from"./tasks-Bw07dkQC.js";import{I as y,L as b,a as x,c as S,s as C,t as w,v as T}from"./index-2BnqwsfR.js";import{t as E}from"./Markdown-DH59NuID.js";import{n as D,t as O}from"./Pane-KNrdAxkc.js";import{t as k}from"./SubjectThread-B-1_FwBN.js";var A=a();function j({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=h(n,e),s=t===n.stages.length-1,l=o&&n.status===`claimed`?n.claimedBy:void 0,u=e.holders.filter(t=>t!==l&&t!==e.completedBy),d=n.returned?.from===e.id?n.returned:void 0;return(0,A.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,A.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,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,A.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,A.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,g(e),l===void 0?null:(0,A.jsxs)(A.Fragment,{children:[` · held by `,(0,A.jsx)(C,{name:l,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${c(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${c(n.stageSince,i)}`:``,u.length>0?` · held before by ${u.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${c(d.at,i)}`]})]})]})}function M({taskId:e}){let{api:n}=t(),r=s(),i=b({mutationFn:()=>n.openThread({task_id:e}),onSuccess:()=>{r.invalidateQueries({queryKey:[`threads`]})}});return(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,A.jsx)(x,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,A.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 N(){let{taskId:t}=y({from:`/task/$taskId`}),a=e(t),s=r(),h=u(),g=o(),b=l(3e4);if(a.data===void 0)return(0,A.jsx)(D,{children:a.error instanceof n&&a.error.status===404?`There is no task ${t}.`:`Reading the task…`});let x=a.data,C=_(x),N=h.data?.find(e=>e.slug===x.project),P=s.data?.find(e=>e.id===x.id);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(O,{leading:(0,A.jsx)(i,{to:`/p/$slug/tasks`,params:{slug:x.project},"aria-label":`Back to the tasks of ${N?.name??x.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:x.title,subtitle:`${N?.name??x.project} · ${f(x)} · created by ${S(x.createdBy)} ${c(x.createdAt,b)}`,trailing:(0,A.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${m[C]}`,children:v.find(e=>e.phase===C)?.label.toLowerCase()})}),(0,A.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,A.jsx)(`h3`,{className:`text-section`,children:`Plan`}),x.returned===void 0?null:(0,A.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 `,p(x,x.returned.from),` by `,x.returned.by,` `,c(x.returned.at,b),`. The work is redone from`,` `,p(x,x.stage),` until it reaches that stage again.`]}),(0,A.jsx)(`ol`,{className:`mt-3`,children:x.stages.map((e,t)=>(0,A.jsx)(j,{stage:e,index:t,task:x,members:g.data,now:b},e.id))}),(0,A.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,x.onDone===`merge`?`task/${x.id} merges onto the default branch`:`nothing more`,x.blockedBy.length>0?(0,A.jsxs)(A.Fragment,{children:[` · blocked by `,(0,A.jsx)(T,{text:x.blockedBy.join(`, `)})]}):null]}),x.body.trim()===``?null:(0,A.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,A.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,A.jsx)(`div`,{className:`mt-2`,children:(0,A.jsx)(E,{text:x.body})})]}),(0,A.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,A.jsx)(`h3`,{className:`text-section`,children:`Thread`}),s.data===void 0?null:P===void 0?d(x)?(0,A.jsx)(M,{taskId:x.id}):(0,A.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,A.jsx)(k,{thread:P,now:b,task:x,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),P?.state===`open`?(0,A.jsx)(w,{target:{threadId:x.id},placeholder:`Write in the task's thread`}):null]})}export{N as TaskView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bt as e,hn as t,n,t as r}from"./format-DbfHOiKW.js";import{v as i}from"./index-2BnqwsfR.js";var a=t();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:t,now:c}){let l=t.state===`closed`?n(t.body,180):``,u=t.messages===1?`1 message`:`${t.messages} messages`;return(0,a.jsxs)(e,{to:`/thread/$threadId`,params:{threadId:t.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:t.title}),(0,a.jsx)(s,{state:t.state})]}),(0,a.jsxs)(`p`,{className:`mt-1 text-meta`,children:[o(t.subject),` thread by `,t.openedBy,` · `,u,` · opened`,` `,r(t.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};
|