@kubitnodes/stellaris 0.3.13 → 0.3.15
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 +1101 -539
- package/dist/server/index.js +1262 -592
- package/package.json +2 -1
- package/web/dist/assets/{BackLink-d0xz7ZLb.js → BackLink-hLg9AYSp.js} +1 -1
- package/web/dist/assets/{ChannelForms-BIRwT9CY.js → ChannelForms-b6eKogvP.js} +1 -1
- package/web/dist/assets/ChannelView-CHvr0c9I.js +1 -0
- package/web/dist/assets/CitizenView-DlqilbFH.js +2 -0
- package/web/dist/assets/{CitizensView-Bv04iH-y.js → CitizensView-Dq3V4mpg.js} +1 -1
- package/web/dist/assets/{CliIcon-tYTwI_RQ.js → CliIcon-DxDvRRcX.js} +1 -1
- package/web/dist/assets/CronsView-CBiPaq-C.js +1 -0
- package/web/dist/assets/KnowledgeView-ndWDlRoP.js +1 -0
- package/web/dist/assets/{Markdown-BLiIulgZ.js → Markdown-BMm7unnl.js} +4 -4
- package/web/dist/assets/{MessageItem-CHrmjF7P.js → MessageItem-Dk1m5NaR.js} +1 -1
- package/web/dist/assets/{MetricsView-DG1alTgs.js → MetricsView-B31t_Q2z.js} +1 -1
- package/web/dist/assets/{NeedsYouView-Doc0fKPi.js → NeedsYouView-d8_ydJI9.js} +1 -1
- package/web/dist/assets/{Overview-ChsOgIEW.js → Overview-D-6YP-tf.js} +1 -1
- package/web/dist/assets/{Pane-MJgGXQBb.js → Pane-CODhA5zE.js} +1 -1
- package/web/dist/assets/Picker-DB-wxloY.js +1 -0
- package/web/dist/assets/ProjectView-CH-nqrAo.js +1 -0
- package/web/dist/assets/ProposalView-D-E0Hzdr.js +1 -0
- package/web/dist/assets/{ProposalsView-CSA8neXR.js → ProposalsView-Bmuq8Qnh.js} +1 -1
- package/web/dist/assets/{RunnersView-Dx21LDFu.js → RunnersView-N4iUU4FM.js} +1 -1
- package/web/dist/assets/{SocietyView-CdVW2DgG.js → SocietyView-fSkmFC3z.js} +1 -1
- package/web/dist/assets/SubjectThread-akZdGCfo.js +1 -0
- package/web/dist/assets/{TaskFileView-BqqzxJKb.js → TaskFileView-DM_JjQQx.js} +2 -2
- package/web/dist/assets/TaskView-JLLJKQ0_.js +3 -0
- package/web/dist/assets/{TasksView-Ba5fPAvy.js → TasksView-CncU8UNJ.js} +1 -1
- package/web/dist/assets/ThreadCard-8OB70j9B.js +1 -0
- package/web/dist/assets/{ThreadForms-ChTFRu-P.js → ThreadForms-RnrV7V5X.js} +1 -1
- package/web/dist/assets/{ThreadView-CnJPNS_8.js → ThreadView-DrwqggME.js} +1 -1
- package/web/dist/assets/citizen-BRSvyK2X.js +1 -0
- package/web/dist/assets/{compose-BgpUWGYE.js → compose-D7DOz6kC.js} +1 -1
- package/web/dist/assets/format-BORdp4w-.js +55 -0
- package/web/dist/assets/{governance-Di4MijNG.js → governance-WrDQawLN.js} +1 -1
- package/web/dist/assets/index-Dw96wkep.css +2 -0
- package/web/dist/assets/index-ww_EHgVF.js +23 -0
- package/web/dist/assets/{link-DAMxBItI.js → link-1v5lugnf.js} +1 -1
- package/web/dist/assets/{tasks-bwj_EdwF.js → tasks-C-9dAYQV.js} +1 -1
- package/web/dist/assets/useMatch-CyeFfbcR.js +1 -0
- package/web/dist/assets/{useStickyScroll-BILPUgGj.js → useStickyScroll-CE7dyz0Q.js} +1 -1
- package/web/dist/index.html +9 -9
- package/web/dist/assets/ChannelView-BvMlzMiN.js +0 -1
- package/web/dist/assets/CitizenView-DNQwjpIp.js +0 -2
- package/web/dist/assets/KnowledgeView-L0pdaM_2.js +0 -1
- package/web/dist/assets/ProjectView-CQTn7yDo.js +0 -1
- package/web/dist/assets/ProposalView-C92OJ_w1.js +0 -1
- package/web/dist/assets/SubjectThread-egXeFhT1.js +0 -1
- package/web/dist/assets/TaskView-rks26vuF.js +0 -3
- package/web/dist/assets/ThreadCard-D6i69_15.js +0 -1
- package/web/dist/assets/citizen-D-dxX00V.js +0 -1
- package/web/dist/assets/format-C3aawMM6.js +0 -55
- package/web/dist/assets/index-VVnGdAXc.css +0 -2
- package/web/dist/assets/index-krHkeIbX.js +0 -23
- package/web/dist/assets/useMatch-B-8IcuU6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ft as e,Gt as t,Ht as n,It as r,Jt as i,Sn as a,Tn as o,Wt as s,Xt as c,xn as l}from"./format-BORdp4w-.js";function u(e){return e.replace(/\/{2,}/g,`/`)}function d(e){return e===`/`?e:e.replace(/^\/+/,``)}function f(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function p(e){return f(d(e))}function m(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function h(e,t,n=`never`,r){if(t.includes(`//`)&&(t=u(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=u(e)),o=e.split(`/`);o.length>1&&c(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(c(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),l=(i?u(s):s)||`/`;return a&&r&&r.set(a,l),l}function g(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function _(e){return e==null||e===``}function v(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function y(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&_(f)){if(c===`/`&&!d)continue;f=``}o+=c+v(s,f,r)+(d||``)}}return o+a||`/`}var b=`Error preloading route! ☝️`,x=o(a(),1),S=l(),C=()=>!0,w=()=>!1;function T({children:e,fallback:t=null}){return(0,S.jsx)(x.Fragment,{children:E()?e:t})}function E(e=!0){return x.useSyncExternalStore(D,C,e?w:C)}function D(){return()=>{}}function O(...e){let t=x.useRef(e),r=t.current;return e.forEach((e,t)=>{n(r[t],e,!1,!0)||(r[t]=e)}),t.current}function k(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(b)})}var A={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function ee(e,n){let r=typeof e==`string`&&t(e);if(r)return n.has(r)?e:null}function te(e,t,r,i,a){let o=m(e.pathname,i),s=m(t.pathname,i);return(r?.exact?o!==s:!o.startsWith(s)||o.length!==s.length&&o[s.length]!==`/`)||(r?.includeSearch??!0)&&!n(e.search,t.search,!r?.exact,r?.explicitUndefined)?!1:!r?.includeHash||a&&e.hash===t.hash}function j(n,i,a){let o=r(),s=x.useRef(null),c=x.useCallback(e=>{if(s.current=e,typeof i==`function`)return i(e);i&&(i.current=e)},[i]),{activeOptions:l,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,ignoreBlocker:v,disabled:y,target:b,onClick:S,onBlur:C,onFocus:w,onMouseEnter:T,onMouseLeave:D,onTouchStart:j}=n,M=E(!!l?.includeHash),[N,P,V]=O(n.search,n.params,l),[H,U]=x.useMemo(()=>[n,{...n}],[o,n.from,n._fromLocation,n.hash,n.to,N,P,n.state,n.mask,n.unsafeRelative]),ne=x.useCallback(e=>{let n=ee(u,o.protocolAllowlist);if(n!==void 0)return[n??void 0];H._fromLocation||(U._fromLocation=e);let r=o.buildLocation(U),i=B(r,o,y);return[i,!y&&(!i||t(i))?void 0:te(e,r,V,o.basepath,M)]},[V,y,M,H,U,o,u]),[W,G]=e(o.stores.location,ne,A),K=G===void 0?W:void 0,q=y||W===void 0,J=x.useRef(!1),Y=n.reloadDocument||K||q?!1:d??o.options.defaultPreload,X=f??o.options.defaultPreloadDelay??0,Z=x.useCallback(e=>{let t=e?.isIntersecting;if(!(t??Y===`intent`)){t===!1&&R(s);return}if(!X){k(o,H);return}L.has(s)||L.set(s,setTimeout(()=>{L.delete(s),k(o,H)},X))},[o,H,s,Y,X]);x.useEffect(()=>{if(!Y)return;Y===`render`&&!J.current&&(J.current=!0,k(o,H));let e=!0,t;return Y===`viewport`&&s.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&Z(t.pop())},{rootMargin:`100px`}),t.observe(s.current)),()=>{e=!1,t?.disconnect(),R(s)}},[o,H,Y,Z,s]);let Q=F(n,a);if(Q.ref=i?c:s,K)return Q.href=K,Q;let re=e=>{let t=b??e.currentTarget.getAttribute(`target`);!q&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!t||t===`_self`)&&e.button===0&&(e.preventDefault(),o.navigate({...H,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:v}))},ie=()=>{Y===`intent`&&k(o,H)},$=()=>{Y===`intent`&&R(s)};return Q.onClick=z(S,re),Q.onBlur=z(C,$),Q.onFocus=z(w,Z),Q.onMouseEnter=z(T,Z),Q.onMouseLeave=z(D,$),Q.onTouchStart=z(j,ie),I(Q,n,G,W,q,a)}var M={},N={className:`active`},P=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`_fromLocation`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function F(e,t){let n={};for(let r in e)P.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function I(e,t,n,r,i,a){let{activeProps:o,inactiveProps:c,className:l,style:u,target:d}=t,f=s(n?o:c,{})??(n?N:M);Object.assign(e,f),e.href=r,a!==`a`&&(e.disabled=i),e.target=d;let p=f.style;(u||p)&&(e.style=u&&p?{...u,...p}:u||p);let m=f.className;return(l||m)&&(e.className=l?m?`${l} ${m}`:l:m),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var L=new WeakMap,R=e=>{clearTimeout(L.get(e)),L.delete(e)},z=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function B(e,t,n){if(n)return;let r=e.maskedLocation??e,a=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&a===r.publicHref||!i(a,t.protocolAllowlist))return a}var V=x.memo(x.forwardRef((e,t)=>{let n=e._asChild||`a`,r=j(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return x.createElement(n,r,i)}),H);function H(e,t){let r=0;for(let i in t)if(r++,e[i]!==t[i]&&(!P.has(i)||!n(e[i],t[i],!1,!0)))return!1;for(let t in e)r--;return r===0}export{y as a,d as c,g as i,f as l,T as n,h as o,u as r,p as s,V as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{gt as e,ht as t}from"./format-BORdp4w-.js";var n=[{phase:`returned`,label:`Sent back`},{phase:`waiting`,label:`Waiting for a holder`},{phase:`working`,label:`Being worked`},{phase:`landing`,label:`Landing`},{phase:`done`,label:`Done`},{phase:`abandoned`,label:`Abandoned`}],r={returned:`bg-orange-500/15 text-orange-300`,waiting:`bg-amber-500/15 text-amber-300`,working:`bg-emerald-500/15 text-emerald-300`,landing:`bg-sky-500/15 text-sky-300`,done:`bg-surface-2 text-fg-secondary`,abandoned:`bg-surface-2 text-fg-muted`};function i(e){return e.status===`done`||e.status===`abandoned`?e.status:e.completing?`landing`:e.returned===void 0?e.status===`claimed`?`working`:`waiting`:`returned`}function a(e,t){let n=i(e);return t.id===e.stage&&n!==`landing`&&n!==`done`&&n!==`abandoned`}function o(e){let t=i(e);return t!==`done`&&t!==`abandoned`}function s(e,t){return e.stages.find(e=>e.id===t)?.name??t}function c(e,n){if(!t(e))return e.action===`approved`?{text:`approved`,tone:r.working}:{text:`rejected`,tone:`bg-red-500/15 text-red-300`};let i=e=>n===void 0?e:s(n,e);if(e.action===`advanced`)return{text:e.to===null?`finished ${i(e.stage)}`:`finished ${i(e.stage)} → ${i(e.to)}`,tone:r.working};if(e.action===`returned`){let t=e.to===null?`an earlier stage`:i(e.to);return{text:`sent back from ${i(e.stage)} to ${t}`,tone:r.returned}}return e.action===`abandoned`?{text:`abandoned`,tone:r.abandoned}:e.action===`landed`?{text:`landed`,tone:r.landing}:{text:`landing failed · back at ${i(e.stage)}`,tone:`bg-red-500/15 text-red-300`}}function l(e){return e.agent===void 0?e.role===void 0?`anyone in the project`:`any ${e.role}`:e.agent}function u(e){return n.map(({phase:t})=>({phase:t,tasks:e.filter(e=>i(e)===t).toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt))})).filter(e=>e.tasks.length>0)}function d(t){let n=i(t);return n===`done`?`All ${t.stages.length} stages done`:n===`abandoned`?`Abandoned`:`Stage ${e(t,t.stage)+1} of ${t.stages.length}`}export{o as a,d as c,u as i,s as l,r as n,a as o,l as r,i as s,n as t,c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as e,Ft as t,It as n,Sn as r,Tn as i}from"./format-BORdp4w-.js";function a(){throw Error(`Invariant failed`)}var o=i(r(),1),s=o.createContext(void 0),c=o.createContext(void 0),l={};function u(t,n){let r=o.useRef();return i=>{let a=t?.select?t.select(i):i;return t?.structuralSharing??n.options.defaultStructuralSharing?r.current=e(r.current,a):a}}function d(e){let r=n(),i=o.useContext(e.from?c:s),d=e.from??i,f=r.stores.getMatchStore(d),p=u(e,r),m=t(f,e=>e?p(e):l);if(m!==l)return m;(e.shouldThrow??!0)&&a()}export{a as i,u as n,s as r,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Sn as e,Tn as t}from"./format-BORdp4w-.js";var n=t(e(),1);function r(){let e=(0,n.useRef)(null),t=(0,n.useRef)(!0);return(0,n.useLayoutEffect)(()=>{let n=e.current;n!==null&&t.current&&(n.scrollTop=n.scrollHeight)}),{ref:e,onScroll:()=>{let n=e.current;n!==null&&(t.current=n.scrollHeight-n.scrollTop-n.clientHeight<80)}}}export{r as t};
|
package/web/dist/index.html
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
<meta name="color-scheme" content="dark" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
8
|
<title>Stellaris</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/format-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-ww_EHgVF.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/format-BORdp4w-.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/mentions-BCdV0bMK.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/compose-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/useMatch-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/link-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/CliIcon-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/tasks-
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/governance-
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/compose-D7DOz6kC.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/useMatch-CyeFfbcR.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/link-1v5lugnf.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/CliIcon-DxDvRRcX.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/tasks-C-9dAYQV.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/governance-WrDQawLN.js">
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Dw96wkep.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body class="antialiased">
|
|
21
21
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as e,Kt as t,O as n,_n as r,b as i,c as a,g as o,mn as s,pn as c,pt as l,t as u,y as d,z as f}from"./format-C3aawMM6.js";import{s as p}from"./compose-BgpUWGYE.js";import{S as m,T as h,i as g}from"./index-krHkeIbX.js";import{i as _}from"./ThreadForms-ChTFRu-P.js";import{t as v}from"./ChannelForms-BIRwT9CY.js";import{t as y}from"./MessageItem-CHrmjF7P.js";import{n as b,t as x}from"./Pane-MJgGXQBb.js";import{n as S}from"./ThreadCard-D6i69_15.js";import{t as C}from"./useStickyScroll-BILPUgGj.js";var w=r(s(),1),T=c();function E(){let{_splat:e=`general`}=h({from:`/c/$`});return(0,T.jsx)(D,{channel:e},e)}function D({channel:r}){let{api:s}=n(),c=t({queryKey:[`channel`,r],queryFn:()=>s.channel(r)}),h=e(),E=o(),D=i(),O=a(),k=d(3e4),[A,j]=(0,w.useState)(!1),[M,N]=(0,w.useState)(!1),P=(0,w.useMemo)(()=>{let e=(c.data??[]).map(e=>({kind:`message`,at:e.ts,id:e.id,message:e})),t=(h.data??[]).filter(e=>e.channel===r).map(e=>({kind:`thread`,at:e.openedAt,id:e.id,thread:e}));return[...e,...t].toSorted((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))},[c.data,h.data,r]),F=c.data?.at(-1)?.id??null;(0,w.useEffect)(()=>m(r,F),[r,F]);let{ref:I,onScroll:L}=C(),[R,z]=r.split(`/`),B=z??R??r,V=z===void 0?void 0:D.data?.find(e=>e.slug===R),H=z===void 0?`society`:V?.name??R,U=O.data?.find(e=>e.ref===r)?.archived,W=V?.archived!==void 0||U!==void 0,G=!W&&!l(z===void 0?null:R??null,B),K=P.filter(e=>e.kind===`thread`&&e.thread.state===`open`);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(x,{title:`# ${B}`,subtitle:`${H} · ${c.data?.length??0} messages${K.length>0?` · ${K.length} open threads`:``}`,trailing:A||M||W?null:(0,T.jsxs)(T.Fragment,{children:[G?(0,T.jsx)(p,{onClick:()=>N(!0),children:`Archive…`}):null,(0,T.jsx)(p,{onClick:()=>j(!0),children:`New thread`})]})}),A?(0,T.jsx)(_,{channel:r,onDone:()=>j(!1)}):null,M?(0,T.jsx)(v,{channel:r,onDone:()=>N(!1)}):null,(0,T.jsx)(`div`,{ref:I,onScroll:L,className:`flex-1 overflow-y-auto py-2`,children:c.error instanceof f&&c.error.status===404?(0,T.jsxs)(b,{children:[`There is no channel `,r,`.`]}):c.data===void 0?(0,T.jsx)(b,{children:`Reading the channel…`}):P.length===0?(0,T.jsx)(b,{children:`Nothing has been said here yet.`}):P.map(e=>e.kind===`message`?(0,T.jsx)(y,{message:e.message,members:E.data,now:k},e.id):(0,T.jsx)(S,{thread:e.thread,now:k},e.id))}),c.data===void 0?null:U===void 0?W?(0,T.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[H,` is archived, so its channels are read-only.`]}):(0,T.jsx)(g,{target:{channel:r},placeholder:`Message #${B}`}):(0,T.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[`Archived `,u(U.at,k),` by `,U.by,`: `,U.reason,`. Its posts, threads, and tasks stay readable; nothing more is posted or filed here.`]})]})}export{E as ChannelView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as e,F as t,L as n,O as r,R as i,T as a,U as o,_ as s,_n as c,a as l,bt as u,d,dt as f,f as p,fn as m,g as h,mn as g,o as _,p as v,pn as y,t as b,w as x,y as S,z as C}from"./format-C3aawMM6.js";import{l as w,s as T}from"./compose-BgpUWGYE.js";import{t as E}from"./link-DAMxBItI.js";import{t as ee}from"./CliIcon-tYTwI_RQ.js";import{T as te,_ as D,c as O,d as ne,f as re,h as k,i as ie,l as A,m as j,p as ae,u as M,v as oe,w as se}from"./index-krHkeIbX.js";import{n as ce,r as N}from"./ThreadForms-ChTFRu-P.js";import{t as P}from"./Markdown-BLiIulgZ.js";import{n as F,t as le}from"./Pane-MJgGXQBb.js";import{t as ue}from"./useStickyScroll-BILPUgGj.js";import{a as I,c as de,i as L,l as R,n as fe,o as z,s as pe,t as me}from"./citizen-D-dxX00V.js";var B=c(g(),1),V=y(),he={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`was interrupted`,blocked:`was blocked`,stopped:`was stopped by you`};function H(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function U({label:e,tone:t,children:n}){return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`px-0.5 pb-0.5 text-[10px] tracking-wider text-fg-muted uppercase`,children:e}),(0,V.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words ${t}`,children:n})]})}function ge({step:e,open:t}){if(e.kind===`say`)return(0,V.jsx)(`li`,{className:`py-1.5 text-sm`,title:H(e.at),children:(0,V.jsx)(P,{text:e.text})});if(e.kind===`error`)return(0,V.jsx)(`li`,{className:`py-1 font-mono text-xs break-words text-red-400`,title:H(e.at),children:e.message});if(e.kind===`steer`)return(0,V.jsx)(`li`,{children:(0,V.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`grid w-3 shrink-0 place-items-center text-sky-300`,children:`↳`}),(0,V.jsxs)(`span`,{className:`shrink-0 text-fg-tertiary`,children:[`Took `,ne(e.posts.length)]}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:e.from.length===0?``:`from ${e.from.join(`, `)}, delivered mid-turn`}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:H(e.at)})]}),(0,V.jsx)(`ul`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:e.posts.map(e=>(0,V.jsxs)(`li`,{className:`rounded-md bg-surface-0/40 px-2.5 py-2`,children:[(0,V.jsxs)(`p`,{className:`flex gap-1.5 text-meta`,children:[(0,V.jsx)(`span`,{className:`text-fg-secondary`,children:e.author}),(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`in `,e.where]}),e.at===``?null:(0,V.jsx)(`span`,{className:`ml-auto shrink-0 font-mono`,children:H(e.at)})]}),(0,V.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,V.jsx)(P,{text:e.body})})]},`${e.at}-${e.author}`))})]})});let n=e.ok===null?(0,V.jsx)(`span`,{"aria-label":`running`,className:`size-1.5 animate-pulse rounded-full bg-amber-300`}):e.ok?(0,V.jsx)(`span`,{"aria-label":`succeeded`,className:`text-[11px] text-emerald-400`,children:`✓`}):(0,V.jsx)(`span`,{"aria-label":`failed`,className:`text-[11px] text-red-400`,children:`✕`});return(0,V.jsx)(`li`,{children:(0,V.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md px-1.5 py-1 text-xs hover:bg-surface-2/40`,children:[(0,V.jsx)(`span`,{className:`grid w-3 shrink-0 place-items-center`,children:n}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-fg-tertiary`,children:re(e.name)}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-fg-secondary`,children:e.summary}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:H(e.at)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:[(0,V.jsx)(U,{label:`Input`,tone:`text-fg-secondary`,children:e.detail}),e.output===null?null:(0,V.jsx)(U,{label:e.ok===!1?`Returned an error`:`Returned`,tone:e.ok===!1?`text-red-300`:`text-fg-tertiary`,children:e.output})]})]})})}function W({steps:e}){let[t,n]=(0,B.useState)(!1),r=e.filter(e=>e.kind===`tool`).length;return e.length===0?(0,V.jsx)(`p`,{className:`mt-2 text-meta`,children:`No steps yet.`}):(0,V.jsxs)(V.Fragment,{children:[r===0?null:(0,V.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-meta`,children:[r===1?`1 tool call`:`${r} tool calls`,(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:`rounded-md px-1.5 py-0.5 text-fg-tertiary transition-colors hover:bg-surface-2/60 hover:text-fg-primary`,children:t?`Collapse all`:`Expand all`})]}),(0,V.jsx)(`ol`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,V.jsx)(ge,{step:e,open:t},e.seq))})]})}function _e({turn:e,running:t,now:n}){return e.end===null?t?(0,V.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-meta`,"aria-live":`polite`,children:[(0,V.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}),`Working · last step `,b(e.lastAt,n)]}):(0,V.jsx)(`p`,{className:`mt-3 text-meta`,children:`The turn ended without a report.`}):(0,V.jsxs)(`section`,{className:`mt-3 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,V.jsxs)(`p`,{className:`text-caps`,children:[`The turn `,he[e.end.exitReason],` `,b(e.end.at,n),e.fromStart?` · ${A(e.startedAt,Date.parse(e.end.at))}`:``]}),e.end.summary===null?null:(0,V.jsx)(`p`,{className:`mt-1 text-sm text-fg-secondary`,children:e.end.summary})]})}var G=30,ve={turn:`turn`,board:`board`,merge:`both kept`},ye={turn:`Changed by a turn`,board:`Written by the board`,merge:`Both versions kept`};function be(e){return e.status===`added`?`new`:e.status===`deleted`?`deleted`:e.added===null||e.removed===null?`binary`:`+${e.added} −${e.removed}`}function xe(e){return e.files.map(e=>`${e.path} ${be(e)}`).join(`, `)}function Se(e){return e.startsWith(`@@`)||e.startsWith(`\\`)?`text-fg-muted`:e.startsWith(`+`)?`text-emerald-300`:e.startsWith(`-`)?`text-red-300`:`text-fg-tertiary`}function Ce({file:e}){return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[e.path,e.status===`modified`?``:(0,V.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,e.status]})]}),e.patch===null?(0,V.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown.`}):e.patch===``?(0,V.jsx)(`p`,{className:`mt-1 text-meta`,children:`Empty.`}):(0,V.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto rounded-md bg-surface-0/60 p-2 font-mono text-[11px] leading-relaxed`,children:e.patch.split(`
|
|
2
|
-
`).map((e,t)=>(0,V.jsx)(`span`,{className:`block whitespace-pre-wrap break-words ${Se(e)}`,children:e===``?` `:e},t))}),e.truncated?(0,V.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}function we({name:e,change:t}){let n=d(e,t.commit,!0);return(0,V.jsxs)(`div`,{className:`space-y-3 px-4 pt-1 pb-3`,children:[(0,V.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[t.kind===`merge`?`Two turns on different runners changed the same lines at once. The file kept one turn's version, and this copy holds the other's until the citizen reconciles them.`:t.kind===`board`?`Written by the board: ${t.subject.replace(/^home: /,``)}.`:t.turnId===void 0?t.subject:(0,V.jsx)(E,{to:`/citizen/$name`,params:{name:e},search:{tab:`turns`,turn:t.turnId},className:`text-fg-secondary underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Open the turn that made it`}),(0,V.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,H(t.at)]})]}),n.data===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:n.isError?`Could not read the change.`:`Reading the change…`}):n.data.map(e=>(0,V.jsx)(Ce,{file:e},e.path))]})}function Te({name:e,change:t,now:n}){let[r,i]=(0,B.useState)(!1),a=t.files.length===0?t.subject:xe(t);return(0,V.jsx)(`li`,{className:`border-b border-line/60 last:border-b-0`,children:(0,V.jsxs)(`details`,{className:`group`,onToggle:e=>i(e.currentTarget.open),children:[(0,V.jsx)(`summary`,{"aria-label":`${ye[t.kind]} ${b(t.at,n)}: ${a}`,className:`block cursor-pointer list-none px-4 py-2.5 transition-colors hover:bg-surface-2/30 group-open:bg-surface-2/20`,children:(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:ve[t.kind]}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:a}),(0,V.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:b(t.at,n)}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]})}),r?(0,V.jsx)(we,{name:e,change:t}):null]})})}function Ee({name:e}){let[t,n]=(0,B.useState)(G),r=v(e,t),i=S(3e4);if(r.data===void 0)return(0,V.jsx)(F,{children:r.isError?`Could not read the home's history.`:`Reading the history…`});let{changes:a,more:o}=r.data;return a.length===0?(0,V.jsxs)(F,{children:[e,`'s home has no history yet; it starts with the citizen's first turn.`]}):(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,children:[`What `,e,`'s turns changed in its memory, skills, and profile, newest first.`]}),(0,V.jsx)(`ol`,{children:a.map(t=>(0,V.jsx)(Te,{name:e,change:t,now:i},t.commit))}),o?(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(t+G),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:`Show earlier changes`}):null]})}function K({title:e,children:t}){return(0,V.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,V.jsx)(`h3`,{className:`text-section`,children:e}),(0,V.jsx)(`div`,{className:`mt-2`,children:t})]})}function De({member:e,charter:t}){let n=s(e.name),r=_(e.name),i=p(e.name),a=S(3e4);return(0,V.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[i.data===void 0||i.data.length===0?null:(0,V.jsxs)(K,{title:`Edits to reconcile`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`Two turns on different runners changed these files at once. Each file kept one version; the other waits beside it until `,e.name,` merges it in and deletes the copy.`]}),(0,V.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:i.data.map(e=>(0,V.jsxs)(`li`,{className:`text-sm`,children:[(0,V.jsx)(`span`,{className:`text-fg-primary`,children:e.file}),(0,V.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.path.slice(e.path.lastIndexOf(`/`)+1),` · left`,` `,b(e.since,a)]})]},e.path))})]}),(0,V.jsx)(K,{title:`Profile`,children:e.profile.trim()===``?(0,V.jsx)(`p`,{className:`text-meta`,children:`No profile yet. The citizen writes its own profile.md.`}):(0,V.jsx)(P,{text:R(e.profile,`Profile`)})}),(0,V.jsx)(K,{title:`Core memory`,children:n.data===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.data.body.trim()===``?(0,V.jsx)(`p`,{className:`text-meta`,children:`Empty. Every turn loads this file in full.`}):(0,V.jsx)(P,{text:R(n.data.body,`Core memory`)})}),(0,V.jsx)(K,{title:`Own skills`,children:r.data===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):r.data.length===0?(0,V.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:r.data.map(e=>(0,V.jsxs)(`li`,{className:`text-sm`,children:[(0,V.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,V.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})}),t===void 0?null:(0,V.jsxs)(K,{title:`Charter of ${t.name}`,children:[(0,V.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:t.purpose}),(0,V.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Wakes on mentions, stages, and `,t.wakeTriggers.join(`, `)||`nothing else`,t.resident?` · keeps a warm session`:``,t.reflects?` · reflects`:``]}),(0,V.jsx)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:t.verbs.map(e=>(0,V.jsx)(`span`,{className:`rounded-md bg-surface-2/70 px-1.5 py-px font-mono text-[11px] text-fg-tertiary`,children:e},e))})]})]})}function q(e,t){let r=n(e,t?.turnId??null);return{turn:(0,B.useMemo)(()=>t===void 0||r.data===void 0?void 0:ae(r.data,e,t.project,t),[t,r.data,e]),loading:t?.turnId!==void 0&&r.isPending,missing:t!==void 0&&(t.turnId===void 0||r.isError)}}var J=50;function Oe({name:e,entry:t,now:n,opened:r}){let[i,a]=(0,B.useState)(r),o=(0,B.useRef)(null);(0,B.useEffect)(()=>{r&&o.current?.scrollIntoView({block:`start`})},[r]);let s=oe(),c=pe(t),l=t.thread===void 0?t.channel===void 0?null:`#${t.channel}`:s.get(t.thread)?.title??`a thread`,u=t.error??t.summary??``,d=t.error===null?`text-fg-secondary`:`text-red-300`;return(0,V.jsx)(`li`,{ref:o,className:`border-b border-line/60 last:border-b-0`,children:(0,V.jsxs)(`details`,{className:`group`,open:i,onToggle:e=>a(e.currentTarget.open),children:[(0,V.jsxs)(`summary`,{className:`block cursor-pointer list-none px-4 py-2.5 transition-colors hover:bg-surface-2/30 group-open:bg-surface-2/20`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 truncate text-fg-secondary`,children:[L(t.project),l===null?``:` · ${l}`]}),(0,V.jsx)(`span`,{className:`text-fg-muted`,children:t.trigger}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-fg-muted`,children:[me(t),` `,b(t.ts,n)]}),(0,V.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-fg-tertiary`,title:t.usage===void 0?void 0:I(t.usage),children:[c,t.toolCalls===void 0?null:`${t.toolCalls} tools`,t.usage===void 0?null:z(t.usage)].filter(e=>e!==null).join(` · `)}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]}),u.trim()===``?null:(0,V.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-xs leading-relaxed group-open:hidden ${d}`,children:(0,V.jsx)(D,{text:u,links:!1})})]}),i?(0,V.jsx)(ke,{name:e,entry:t,text:u,tone:d}):null]})})}function ke({name:e,entry:t,text:n,tone:r}){let i=q(e,t);return(0,V.jsxs)(`div`,{className:`px-4 pt-1 pb-3`,children:[n.trim()===``?null:(0,V.jsx)(`p`,{className:`text-xs leading-relaxed whitespace-pre-wrap ${r}`,children:(0,V.jsx)(D,{text:n})}),(0,V.jsx)(`div`,{className:`mt-2`,children:t.turnId===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`This turn ran before turns kept their steps.`}):i.loading?(0,V.jsx)(`p`,{className:`text-meta`,children:`Reading the steps…`}):i.turn===void 0?(0,V.jsx)(`p`,{className:`text-meta`,children:`No steps were kept for this turn.`}):(0,V.jsxs)(V.Fragment,{children:[t.startedAt===void 0?null:(0,V.jsxs)(`p`,{className:`text-caps`,children:[`Started `,H(t.startedAt)]}),(0,V.jsx)(W,{steps:i.turn.steps})]})})]})}function Ae({name:e,opened:t}){let[n,r]=(0,B.useState)(J),a=i(e,n),o=S(3e4);if(a.data===void 0)return(0,V.jsx)(F,{children:`Reading the turns…`});let s=a.data.toReversed();if(s.length===0)return(0,V.jsxs)(F,{children:[e,` has not finished a turn yet.`]});let c=fe(s),l=c.usage===null?``:` · ${z(c.usage)}${c.withUsage<c.turns?` over ${c.withUsage} of them`:``}`;return(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,V.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,title:c.usage===null?void 0:I(c.usage),children:[c.turns===1?`1 turn`:`${c.turns} turns`,c.failed===0?``:`, ${c.failed} not completed`,l]}),t!==null&&!s.some(e=>e.turnId===t)?(0,V.jsx)(`p`,{className:`px-4 pb-1 text-meta`,children:a.data.length===n?`The turn this address opens is further back; show earlier turns to reach it.`:`The turn this address opens is not in this citizen's history.`}):null,(0,V.jsx)(`ol`,{children:s.map(n=>(0,V.jsx)(Oe,{name:e,entry:n,now:o,opened:t!==null&&n.turnId===t},n.id))}),a.data.length===n?(0,V.jsxs)(`button`,{type:`button`,onClick:()=>r(n+J),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show `,J,` earlier turns`]}):null]})}function je(e){return e===void 0?``:`${e.name}${e.id===null?``:` · ${e.id}`}`}function Y({label:e,choices:t,value:n,onChange:r,listClassName:i=`inset-x-0`}){let[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)([]),u=t.findIndex(e=>e.value===n);(0,B.useEffect)(()=>{if(!a)return;l.current[Math.max(u,0)]?.focus();let e=e=>{e.target instanceof Node&&s.current?.contains(e.target)===!0||o(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[a,u]);let d=e=>{if(e.key===`Escape`){e.stopPropagation(),o(!1),c.current?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=(l.current.findIndex(e=>e===document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length;l.current[n]?.focus()},f=t[u];return(0,V.jsxs)(`div`,{ref:s,className:`relative min-w-0 flex-1`,children:[(0,V.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`${e}: ${je(f)}`,"aria-expanded":a,onClick:()=>o(!a),onKeyDown:a?d:void 0,className:`flex h-7 w-full items-center gap-1.5 rounded-md bg-surface-2/60 px-2.5 text-xs text-fg-secondary transition-colors hover:bg-surface-2 focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:[f?.name,f?.id===null||f===void 0?null:(0,V.jsxs)(`span`,{className:`text-fg-tertiary`,children:[` · `,f.id]})]}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`text-[10px] text-fg-muted transition-transform ${a?`rotate-180`:``}`,children:`▾`})]}),a?(0,V.jsx)(`div`,{className:`absolute ${i} top-full z-20 mt-1 max-h-80 overflow-y-auto rounded-xl bg-surface-1/95 p-1 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.08),0_16px_32px_-12px_rgba(0,0,0,0.8)] backdrop-blur-xl`,children:t.map((e,t)=>{let i=e.value===n;return(0,V.jsxs)(`button`,{ref:e=>{l.current[t]=e},type:`button`,"aria-current":i?`true`:void 0,onKeyDown:d,onClick:()=>{r(e.value),o(!1),c.current?.focus()},className:`flex w-full items-start gap-2 rounded-lg px-2.5 py-1.5 text-left transition-colors focus-visible:outline-none ${i?`bg-surface-2/80`:`hover:bg-surface-2/50 focus-visible:bg-surface-2/50`}`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`span`,{className:`block truncate text-xs text-fg-secondary`,children:[e.name,e.id===null?null:(0,V.jsxs)(`span`,{className:`text-fg-tertiary`,children:[` · `,e.id]})]}),e.description===``?null:(0,V.jsx)(`span`,{className:`block truncate text-[11px] text-fg-muted`,children:e.description})]}),(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`w-3 shrink-0 pt-px text-[11px] text-fg-primary`,children:i?`✓`:``})]},e.value)})}):null]})}var X=``,Z=``;function Me(e,t){return[{value:X,name:`CLI default`,id:e.find(e=>e.isDefault)?.name??null,description:`Whatever the CLI runs when no model is set.`},...e.map(e=>({value:e.id,name:e.name,id:e.name===e.id?null:e.id,description:e.description})),...t===null?[]:[{value:t,name:t,id:null,description:`Not in the CLI's list.`}]]}function Ne(e,t){return[{value:Z,name:`Default`,id:e?.defaultEffort??null,description:`Whatever the model runs unset.`},...(e?.efforts??[]).map(e=>({value:e.id,name:e.id,id:null,description:e.description})),...t===null?[]:[{value:t,name:t,id:null,description:`Not in the model's list.`}]]}function Pe({member:e,onDone:t}){let{api:n}=r(),i=m(),a=l(e.name),o=e.model??X,s=e.effort??Z,[c,u]=(0,B.useState)(o),[d,f]=(0,B.useState)(s),p=w({mutationFn:async()=>{c!==o&&await n.setModel(e.name,c===X?null:c),d!==s&&await n.setEffort(e.name,d===Z?null:d)},onSettled:()=>void i.invalidateQueries({queryKey:[`members`]}),onSuccess:t}),h=a.data?.models??[],g=e.model!==void 0&&!h.some(t=>t.id===e.model)?e.model:null,_=e=>h.find(t=>e===X?t.isDefault:t.id===e),v=_(c)?.efforts??[],y=d!==Z&&!v.some(e=>e.id===d)?d:null,b=e=>{u(e);let t=_(e)?.efforts??[];d!==Z&&!t.some(e=>e.id===d)&&f(Z)},x=c!==o||d!==s;return(0,V.jsxs)(`form`,{"aria-label":`Model of ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),p.mutate()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a.isPending?(0,V.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Asking `,e.cli,` for its models…`]}):a.error===null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Y,{label:`Model`,choices:Me(h,g),value:c,onChange:b}),v.length===0&&y===null?null:(0,V.jsx)(`div`,{className:`flex w-32 shrink-0`,children:(0,V.jsx)(Y,{label:`Effort`,choices:Ne(_(c),y),value:d,onChange:f,listClassName:`right-0 w-64`})})]}):(0,V.jsxs)(`p`,{role:`alert`,className:`min-w-0 flex-1 truncate text-xs text-red-400`,children:[e.cli,` did not list its models:`,` `,a.error instanceof C?a.error.message:`the board server did not answer`]}),(0,V.jsx)(T,{onClick:t,children:`Cancel`}),(0,V.jsx)(T,{variant:`primary`,type:`submit`,disabled:p.isPending||!x||a.error!==null,children:p.isPending?`Saving…`:`Save`})]}),a.data===void 0?null:(0,V.jsxs)(`p`,{className:`text-meta`,children:[`As `,a.data.cli,` on `,a.data.runner,` lists them, where this citizen's turns run.`]}),(0,V.jsx)(N,{error:p.error})]})}var Q=``;function Fe(e,t){let n=t.cli;return[e.status,e.clis.length===0?`offers no CLI yet`:e.clis.join(`, `),n!==null&&e.clis.length>0&&!e.clis.includes(n)?`has no ${n}`:``,e.capabilities.length===0?``:e.capabilities.join(`, `)].filter(e=>e!==``).join(` · `)}function Ie(e,t){return[{value:Q,name:`Any runner`,id:null,description:`Pinned to the least busy runner on its next turn outside a project.`},...e.map(e=>({value:e.name,name:e.name,id:e.os,description:Fe(e,t)}))]}function Le({member:e,onDone:t}){let{api:n}=r(),i=m(),o=a(),s=e.homeRunner??Q,[c,l]=(0,B.useState)(s),u=w({mutationFn:()=>n.setRunner(e.name,c===Q?null:c),onSuccess:()=>{i.invalidateQueries({queryKey:[`members`]}),t()}});return(0,V.jsxs)(`form`,{"aria-label":`Runner of ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),u.mutate()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.data===void 0?(0,V.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`Reading the runners…`}):(0,V.jsx)(Y,{label:`Runner`,choices:Ie(o.data,e),value:c,onChange:l}),(0,V.jsx)(T,{onClick:t,children:`Cancel`}),(0,V.jsx)(T,{variant:`primary`,type:`submit`,disabled:u.isPending||c===s,children:u.isPending?`Saving…`:`Run here`})]}),(0,V.jsx)(`p`,{className:`text-meta`,children:`Its conversations outside projects start afresh there from its next turn; its memory and skills follow it. Project work runs where each project lives.`}),(0,V.jsx)(N,{error:u.error})]})}function Re(e){if(e.thread!==void 0)return{threadId:e.thread};let t=e.scope===`society`?null:e.scope;return e.channel===void 0?{channel:e.askedIn??u(t,`general`)}:{channel:u(t,e.channel)}}function ze({name:e,turn:t}){let{api:n}=r(),i=m(),[a,o]=(0,B.useState)(!1),s=w({mutationFn:()=>n.stopTurn(t.turnId),onSuccess:()=>{o(!1),i.invalidateQueries({queryKey:[`scheduler`]})}});return(0,V.jsxs)(`div`,{className:`border-t border-line`,children:[(0,V.jsx)(ie,{target:Re(t),initialText:`@${e} `,placeholder:t.steerable?`Message ${e} while it works`:`Message ${e} for its next turn`,className:`px-3 pt-3 pb-2`},t.turnId),t.stoppable?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-3`,children:[(0,V.jsx)(`p`,{className:`min-w-0 flex-1 text-[11px] leading-snug text-fg-muted`,children:a?`Ends the turn now. What it was shown counts as read; its stages stay held.`:t.steerable?`Posts reach the turn at its next step.`:`This runner delivers posts after the turn ends.`}),a?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(T,{onClick:()=>{o(!1),s.reset()},children:`Keep it running`}),(0,V.jsx)(T,{variant:`primary`,disabled:s.isPending,onClick:()=>{s.mutate()},children:s.isPending?`Stopping…`:`Stop the turn`})]}):(0,V.jsx)(T,{onClick:()=>o(!0),children:`Stop…`})]}):null,s.error===null?null:(0,V.jsx)(`div`,{className:`px-3 pb-3`,children:(0,V.jsx)(N,{error:s.error})})]})}function Be({member:e,scopes:t,preferred:n,running:i,paused:a,onDone:o}){let{api:s}=r(),c=m(),[l,u]=(0,B.useState)(`manual`),[d,f]=(0,B.useState)(n!==null&&t.includes(n)?n:t[0]??``),[p,h]=(0,B.useState)(``),g=(0,B.useRef)(null);(0,B.useEffect)(()=>g.current?.focus(),[]);let _=w({mutationFn:()=>s.wake({agent:e.name,project:d,kind:l,...p.trim()===``?{}:{reason:p.trim()}}),onSuccess:()=>{c.invalidateQueries({queryKey:[`scheduler`]}),o()}}),v=L(d),y=l===`reflection`?`Asks ${e.name} to reflect at ${v}: consolidate its memory, skills, and profile, and take no new work. It restarts the reflection clock.`:`Starts a turn for ${e.name} at ${v} as soon as the scheduler takes it.`,b=a?` The society is paused, so it waits until you resume.`:i.includes(d)?` ${e.name} is in a turn there now; this one follows it.`:``;return(0,V.jsxs)(`form`,{"aria-label":`Wake ${e.name}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),_.mutate()},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,V.jsx)(`legend`,{className:`sr-only`,children:`Kind of turn`}),[`manual`,`reflection`].map(e=>(0,V.jsxs)(`label`,{className:`cursor-pointer rounded-md px-2.5 py-1 text-xs transition-colors has-focus-visible:ring-2 has-focus-visible:ring-fg-primary/30 ${l===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,V.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:l===e,onChange:()=>u(e),className:`sr-only`}),e===`manual`?`A turn`:`A reflection`]},e))]}),(0,V.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-xs text-fg-tertiary`,children:[`at`,(0,V.jsx)(`select`,{value:d,onChange:e=>f(e.target.value),"aria-label":`Where`,className:`rounded-md bg-surface-2/60 px-2 py-1 text-xs text-fg-primary outline-none`,children:t.map(e=>(0,V.jsx)(`option`,{value:e,children:L(e)},e))})]})]}),(0,V.jsx)(`textarea`,{ref:g,value:p,rows:2,placeholder:l===`reflection`?`Anything to reflect on in particular? Optional.`:`What should it look at? It reads this as the reason it was woken.`,"aria-label":`Reason`,onChange:e=>h(e.target.value),className:`${ce} resize-none`}),(0,V.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[y,b,` Each turn costs money.`]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,V.jsx)(T,{onClick:o,children:`Cancel`}),(0,V.jsx)(T,{variant:`primary`,type:`submit`,disabled:_.isPending||d===``,children:_.isPending?`Waking…`:l===`reflection`?`Ask for a reflection`:`Wake ${e.name}`})]}),(0,V.jsx)(N,{error:_.error})]})}var Ve={working:`bg-emerald-500/15 text-emerald-300`,queued:`bg-amber-500/15 text-amber-300`,idle:`bg-surface-2 text-fg-tertiary`};function He({project:e,name:n}){let r=(t(e).data??[]).filter(e=>e.status===`claimed`&&e.claimedBy===n);return r.length===0?null:(0,V.jsx)(`ul`,{className:`mt-1.5 space-y-1`,children:r.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(E,{to:`/task/$taskId`,params:{taskId:e.id},className:`flex items-center gap-2 rounded-md text-xs text-fg-secondary hover:text-fg-primary`,children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`◇`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,V.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-mono text-[11px] text-fg-muted`,children:f(e)?.name??e.stage})]})},e.id))})}function Ue(){let{name:e}=te({from:`/citizen/$name`}),{scope:t,tab:n,turn:r}=se({from:`/citizen/$name`});return(0,V.jsx)(Ge,{name:e,chosen:t??null,tab:n??`now`,turn:r??null},e)}var We=[{tab:`now`,label:`Now`},{tab:`turns`,label:`Turns`},{tab:`memory`,label:`Memory`},{tab:`history`,label:`History`}];function Ge({name:t,chosen:n,tab:r,turn:i}){let a=h(),s=x(),c=e(),l=k(),[u,d]=(0,B.useState)(null),f=a.data?.find(e=>e.name===t);if(f===void 0)return(0,V.jsx)(F,{children:a.data===void 0?`Reading the roster…`:`There is no citizen ${t}.`});let p=o(c.data?.running??[]).filter(e=>e.agent===t),m=[...new Set(p.map(e=>e.scope))],g=p.map(e=>M(e.agent,e.scope,e)),_=o(c.data?.pending??[]).find(e=>e.agent===t),v=m.length>0?`working`:_===void 0?`idle`:`queued`,y=j(l,t)[0],b=y?.model??f.lastModel,S=b??f.model??`CLI default`,C=f.model!==void 0&&f.model!==b?f.model:null,w=s.data?.find(e=>e.name===f.role),te=de(f),D=f.status===`active`&&f.cli!==null;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(le,{leading:f.cli===null?null:(0,V.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-2/70`,children:(0,V.jsx)(ee,{cli:f.cli,size:20})}),title:t,subtitle:(0,V.jsxs)(V.Fragment,{children:[f.role,` · `,S,C===null?``:` · set to ${C}`,f.effort===void 0?``:` · ${f.effort} effort`,f.homeRunner===void 0?``:` · on ${f.homeRunner}`,f.status===`retired`?` · retired`:``]}),trailing:(0,V.jsxs)(V.Fragment,{children:[D&&u===null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(T,{onClick:()=>d(`model`),children:`Model…`}),(0,V.jsx)(T,{onClick:()=>d(`runner`),children:`Runner…`}),(0,V.jsx)(T,{onClick:()=>d(`wake`),children:`Wake…`})]}):null,(0,V.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${Ve[v]}`,children:v})]})}),u===`wake`?(0,V.jsx)(Be,{member:f,scopes:te,preferred:n?.split(`/`)[0]??y?.scope??null,running:m,paused:c.data?.paused??!1,onDone:()=>d(null)}):u===`model`?(0,V.jsx)(Pe,{member:f,onDone:()=>d(null)}):u===`runner`?(0,V.jsx)(Le,{member:f,onDone:()=>d(null)}):null,(0,V.jsx)(`nav`,{"aria-label":`Citizen views`,className:`flex gap-1 border-b border-line px-3 py-2`,children:We.map(e=>(0,V.jsx)(E,{to:`/citizen/$name`,params:{name:t},search:{...n===null?{}:{scope:n},...e.tab===`now`?{}:{tab:e.tab}},replace:!0,"aria-current":e.tab===r?`page`:void 0,className:`rounded-md px-2.5 py-1 text-xs transition-colors ${e.tab===r?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:e.label},e.tab))}),r===`turns`?(0,V.jsx)(Ae,{name:t,opened:i},i):r===`memory`?(0,V.jsx)(De,{member:f,charter:w}):r===`history`?(0,V.jsx)(Ee,{name:t}):(0,V.jsx)(Ke,{name:t,chosen:n,lastTurnAt:f.lastTurnAt,state:v,runningScopes:m,runningKeys:g,runningTurns:(c.data?.turns??[]).filter(e=>e.agent===t),queuedScope:_?.scope??null})]})}function $(e){return e.toSorted((e,t)=>e.startedAt.localeCompare(t.startedAt))[0]}function Ke({name:e,chosen:t,lastTurnAt:n,state:r,runningScopes:a,runningKeys:o,runningTurns:s,queuedScope:c}){let l=k(),u=S(5e3),{ref:d,onScroll:f}=ue(),p=j(l,e),m=i(e,1),h=q(e,p.length===0?m.data?.at(-1):void 0),g=oe(),_=e=>e.end===null&&o.includes(M(e.agent,e.scope,e)),v=t?.split(`/`)[0]??null,y=(t?.includes(`/`)===!0?p.find(e=>O(e)===t):void 0)??$(p.filter(e=>e.scope===v&&_(e)))??p.find(e=>O(e)===t)??$(p.filter(_))??p[0]??h.turn,x=e=>e.thread===void 0?e.channel===void 0?L(e.scope):`${L(e.scope)} · #${e.channel}`:`${L(e.scope)} · ${g.get(e.thread)?.title??`a thread`}`,C=y!==void 0&&_(y),w=y?.scope??a[0]??c,T=(y===void 0?void 0:s.find(e=>e.scope===y.scope&&e.thread===y.thread&&e.channel===y.channel))??(C?void 0:s[0]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{className:`border-b border-line px-4 py-3 text-xs text-fg-tertiary`,children:[(0,V.jsx)(`p`,{children:C?`In a turn at ${L(y.scope)} for ${y.fromStart?``:`at least `}${A(y.startedAt,u)}`:a.length>0?`In a turn at ${a.map(L).join(` and `)}`:c===null?n===void 0?`No turns yet`:`Last turn ${b(n,u)}`:`Queued for a turn at ${L(c)}`}),w===null||w===`society`?null:(0,V.jsx)(He,{project:w,name:e})]}),(0,V.jsx)(`div`,{ref:d,onScroll:f,className:`flex-1 overflow-y-auto px-4 py-3`,children:y===void 0?(0,V.jsx)(F,{children:r===`working`?`The turn has not reported a step yet.`:h.loading?`Reading the last turn…`:n===void 0?`${e} has not taken a turn yet.`:`${e}'s last turn kept no steps; Turns lists every finished one.`}):(0,V.jsxs)(V.Fragment,{children:[p.length>1?(0,V.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,"aria-label":`Turns by conversation`,children:p.toSorted((e,t)=>O(e).localeCompare(O(t))).map(t=>(0,V.jsxs)(E,{to:`/citizen/$name`,params:{name:e},search:{scope:O(t)},replace:!0,"aria-current":t===y?`true`:void 0,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] transition-colors ${t===y?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[_(t)?(0,V.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}):null,x(t)]},O(t)))}):null,(0,V.jsxs)(`p`,{className:`text-caps`,children:[C?`This turn`:`Last turn`,` · `,x(y),` · started`,` `,y.fromStart?H(y.startedAt):`before the earliest step shown`]}),y.fromStart?null:(0,V.jsxs)(`p`,{className:`mt-1 text-meta`,children:[`Earlier steps of this turn are no longer in the server's live buffer`,C?``:`; Turns has the whole turn`,`.`]}),(0,V.jsx)(W,{steps:y.steps}),(0,V.jsx)(_e,{turn:y,running:C,now:u})]})}),T===void 0?null:(0,V.jsx)(ze,{name:e,turn:T})]})}export{Ue as CitizenView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as e,_n as t,b as n,fn as r,lt as i,m as a,mn as o,pn as s,t as c,y as l}from"./format-C3aawMM6.js";import{c as u,l as d,s as f}from"./compose-BgpUWGYE.js";import{t as p}from"./link-DAMxBItI.js";import{T as m}from"./index-krHkeIbX.js";import{r as h}from"./ThreadForms-ChTFRu-P.js";import{t as g}from"./Markdown-BLiIulgZ.js";import{n as _,t as v}from"./Pane-MJgGXQBb.js";import{t as y}from"./BackLink-d0xz7ZLb.js";var b=t(o(),1),x=s(),S=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function C(){let{scope:t,topic:o}=m({from:`/knowledge/$scope/$topic`}),{api:s}=e(),C=r(),w=u(),T=a(t),E=n(),D=l(3e4),[O,k]=(0,b.useState)(!1),A=t===i,j=A?`the society`:E.data?.find(e=>e.slug===t)?.name??t,M=T.data?.find(e=>e.topic===o),N=d({mutationFn:()=>s.removeKnowledge({project:A?null:t,topic:o}),onSuccess:async()=>{await C.invalidateQueries({queryKey:[`knowledge`,t]}),await w(A?{to:`/society`}:{to:`/p/$slug`,params:{slug:t}})}}),P=A?(0,x.jsx)(p,{to:`/society`,"aria-label":`Back to the society`,className:S,children:`←`}):(0,x.jsx)(p,{to:`/p/$slug`,params:{slug:t},"aria-label":`Back to ${j}`,className:S,children:`←`});return M===void 0?(0,x.jsx)(_,{children:T.data===void 0?`Reading…`:`${j} has no topic ${o}.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(v,{leading:(0,x.jsx)(y,{fallback:P}),title:M.topic,subtitle:`Knowledge of ${j} · written by ${M.updatedBy} ${c(M.updatedAt,D)}`,trailing:O?null:(0,x.jsx)(f,{onClick:()=>k(!0),children:`Remove…`})}),O?(0,x.jsxs)(`form`,{"aria-label":`Remove the topic`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),N.mutate()},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`p`,{className:`min-w-0 flex-1 text-meta`,children:[`No turn or search finds `,M.topic,` again, and a note in`,` `,A?`#general`:`#${t}/general`,` says so without waking anyone. The server keeps its text aside.`]}),(0,x.jsx)(f,{onClick:()=>k(!1),children:`Cancel`}),(0,x.jsx)(f,{variant:`primary`,type:`submit`,disabled:N.isPending,children:N.isPending?`Removing…`:`Remove topic`})]}),(0,x.jsx)(h,{error:N.error})]}):null,(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:(0,x.jsx)(g,{text:M.body})})]})}export{C as KnowledgeView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as e,O as t,_n as n,b as r,c as i,fn as a,g as o,l as s,m as c,mn as l,pn as u,t as d,y as f}from"./format-C3aawMM6.js";import{l as p,s as m}from"./compose-BgpUWGYE.js";import{t as h}from"./link-DAMxBItI.js";import{i as g,t as _}from"./tasks-bwj_EdwF.js";import{T as v}from"./index-krHkeIbX.js";import{n as y,r as b}from"./ThreadForms-ChTFRu-P.js";import{n as x,r as S}from"./ChannelForms-BIRwT9CY.js";import{t as C}from"./Markdown-BLiIulgZ.js";import{n as w,t as T}from"./Pane-MJgGXQBb.js";import{n as E,r as D,t as O}from"./Overview-ChsOgIEW.js";var k=n(l(),1),A=u();function j({project:e,onDone:n}){let{api:r}=t(),i=a(),[o,s]=(0,k.useState)(e.name),[c,l]=(0,k.useState)(e.defaultBranch),u={...o.trim()===e.name?{}:{name:o.trim()},...c.trim()===e.defaultBranch?{}:{default_branch:c.trim()}},d=p({mutationFn:()=>r.configureProject(e.slug,u),onSuccess:async()=>{await i.invalidateQueries({queryKey:[`projects`]}),n()}}),f=Object.keys(u).length===0||o.trim()===``||c.trim()===``;return(0,A.jsxs)(`form`,{"aria-label":`Edit ${e.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)(m,{onClick:n,children:`Cancel`}),(0,A.jsx)(m,{variant:`primary`,type:`submit`,disabled:d.isPending||f,children:d.isPending?`Saving…`:`Save`})]}),(0,A.jsxs)(`p`,{className:`text-meta`,children:[e.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:t}=v({from:`/p/$slug`}),n=r(),a=i(),l=o(),u=e(t),p=s(t),y=c(t),b=f(3e4),[M,N]=(0,k.useState)(!1),[P,F]=(0,k.useState)(!1),I=n.data?.find(e=>e.slug===t);if(I===void 0)return(0,A.jsx)(w,{children:n.data===void 0?`Reading the project…`:`There is no project ${t}.`});let L=(l.data??[]).filter(e=>e.status===`active`&&I.members.includes(e.name)),R=g(u.data??[]),z=p.data?.body.trim()??``;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(T,{title:I.name,subtitle:`${t} · ${I.repo??`a local repository`} · ${I.defaultBranch}`,trailing:(0,A.jsxs)(A.Fragment,{children:[M||I.archived!==void 0?null:(0,A.jsx)(m,{onClick:()=>N(!0),children:`Edit…`}),(0,A.jsx)(h,{to:`/p/$slug/tasks`,params:{slug:t},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:t,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)(m,{onClick:()=>F(!0),children:`New channel…`}):null,children:(0,A.jsx)(x,{channels:(a.data??[]).filter(e=>e.project===t),now:b})}),(0,A.jsx)(E,{title:`Members`,children:(0,A.jsx)(O,{members:L,scope:t})}),(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)(h,{to:`/p/$slug/tasks`,params:{slug:t},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,` `,_.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}.`:I.onDone===`ghpr`?`When its last stage is done, the board merges the pull request linked to it into ${I.defaultBranch} on GitHub.`:`When its last stage is done, it is done; nothing is merged.`})}),(0,A.jsx)(E,{title:`Dashboard`,aside:p.data?.updatedBy===void 0?void 0:(0,A.jsxs)(`span`,{className:`text-meta`,children:[`by `,p.data.updatedBy,p.data.updatedAt===void 0?``:` ${d(p.data.updatedAt,b)}`]}),children:p.data===void 0?(0,A.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):z===``?(0,A.jsx)(`p`,{className:`text-meta`,children:`Empty. The project's members fill it in with update_dashboard.`}):(0,A.jsx)(C,{text:z})}),(0,A.jsx)(E,{title:`Knowledge`,children:(0,A.jsx)(D,{scope:t,topics:y.data,now:b})})]})]})}export{M as ProjectView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,Ct as t,Et as n,F as r,I as i,O as a,St as o,_n as s,at as c,b as l,bt as u,ct as d,fn as f,g as p,it as m,mn as h,pn as g,rt as ee,st as te,t as _,ut as v,w as y,wt as b,x,y as S,z as ne}from"./format-C3aawMM6.js";import{l as re,s as C}from"./compose-BgpUWGYE.js";import{t as w}from"./link-DAMxBItI.js";import{t as T}from"./CliIcon-tYTwI_RQ.js";import{a as E}from"./tasks-bwj_EdwF.js";import{c as D,d as O,l as k,n as A,o as j,r as M,s as N}from"./governance-Di4MijNG.js";import{T as P,i as F,o as I,s as L}from"./index-krHkeIbX.js";import{n as R,r as z}from"./ThreadForms-ChTFRu-P.js";import{t as B}from"./Markdown-BLiIulgZ.js";import{n as ie,t as V}from"./Pane-MJgGXQBb.js";import{t as H}from"./BackLink-d0xz7ZLb.js";import{StatusChip as U}from"./ProposalsView-CSA8neXR.js";import{t as W}from"./SubjectThread-egXeFhT1.js";var G=s(h(),1),K=g();function q({proposal:e,consequence:t}){let{api:n}=a(),r=f(),i=p(),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(``),u=(0,G.useRef)(null);(0,G.useEffect)(()=>{o!==null&&u.current?.focus()},[o]);let d=re({mutationFn:()=>{let t=c.trim();return o===`reject`?n.reject({proposal_id:e.id,reason:t}):n.approve({proposal_id:e.id,...t===``?{}:{reason:t}})},onSuccess:()=>{let t=[[`proposals`],[`proposal`,e.id],[`threads`],[`thread`,e.id]];for(let e of t)r.invalidateQueries({queryKey:e});s(null),l(``)}}),m=(i.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)(C,{onClick:()=>s(`reject`),children:`Reject`}),(0,K.jsx)(C,{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(),d.mutate()},children:[(0,K.jsx)(`textarea`,{ref:u,value:c,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=>l(e.target.value),className:`${R} resize-none`}),(0,K.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[g?t:`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)(C,{onClick:()=>{s(null),d.reset()},children:`Cancel`}),(0,K.jsx)(C,{variant:`primary`,type:`submit`,disabled:d.isPending||!g&&c.trim()===``,children:d.isPending?`Deciding…`:g?`Confirm approval`:`Confirm rejection`})]}),(0,K.jsx)(z,{error:d.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:D(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=l(),o=r(t),s=a.data?.find(e=>e.slug===t),c=e.status===`proposed`,u=c?(i??[]).filter(e=>e.status===`active`&&e.memberships.includes(t)).map(e=>e.name):e.provision?.members??[],d=(o.data??[]).filter(E).length;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Project`,children:[(0,K.jsx)(w,{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,K.jsx)(Y,{label:c?`Members who leave`:`Members who left`,children:Array.isArray(u)?X(u.filter(e=>typeof e==`string`)):`none`}),c?(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=c.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)(T,{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=N(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=v.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:k(e.data.body)})})]})}case`channel`:{let e=m.safeParse(i);if(!e.success)break;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Channel`,children:[`#`,u(e.data.project,e.data.name)]}),(0,K.jsx)(Y,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=d.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)(I,{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=ee.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=te.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=b({agent:n().optional(),channel:n().optional(),role:n().optional(),skill:n().optional(),replaced:t().optional(),releasedTasks:o(n()).optional(),project:n().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)(w,{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)(w,{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)(w,{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:t}=P({from:`/proposal/$proposalId`}),n=x(t),r=p(),a=y(),o=e(),s=i(),c=S(3e4),l=L();if(n.data===void 0)return(0,K.jsx)(ie,{children:n.error instanceof ne&&n.error.status===404?`There is no proposal ${t}.`:`Reading the proposal…`});let u=n.data,d=u.status===`proposed`,f=r.data?.find(e=>e.name===u.proposedBy)?.role,m=s.data?.find(e=>e.id===u.id),h=u.status===`rejected`?`Rejected`:`Approved`,g=A(u,{members:r.data??[],roles:a.data??[],skills:o.data??[]});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(V,{leading:(0,K.jsx)(H,{fallback:(0,K.jsx)(w,{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:j(u),subtitle:`${u.kind} proposal by ${l(u.proposedBy)} ${_(u.createdAt,c)}${d?` · for ${M(u,f)} to decide`:``}`,trailing:(0,K.jsx)(U,{status:u.status})}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[d?(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: `,g]}):(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:[h,` by `,l(u.decidedBy??`someone`),u.decidedAt===void 0?``:` ${_(u.decidedAt,c)}`,u.reason===void 0?`.`:`: ${u.reason}`]}),(0,K.jsx)(le,{proposal:u})]}),u.body.trim()===``||m!==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:u.body})})]}),(0,K.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:d?`What it would make`:u.status===`provisioned`?`What it made`:`What it proposed`}),(0,K.jsx)(se,{proposal:u,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`}),m===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:m,now:c,empty:`Nothing said yet. The pitch and the decision are posted here.`})]})]}),m?.state===`open`?(0,K.jsx)(F,{target:{threadId:u.id},placeholder:`Write in the proposal's thread`}):null,O(u)?(0,K.jsx)(q,{proposal:u,consequence:g}):null]})}export{$ as ProposalView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Kt as e,O as t,_n as n,g as r,mn as i,pn as a,t as o}from"./format-C3aawMM6.js";import{S as s}from"./index-krHkeIbX.js";import{t as c}from"./Markdown-BLiIulgZ.js";import{t as l}from"./MessageItem-CHrmjF7P.js";var u=n(i(),1),d=a();function f({thread:n,now:i,task:a,empty:f}){let{api:p}=t(),m=r(),h=e({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,3 +0,0 @@
|
|
|
1
|
-
import{I as e,M as t,N as n,O as r,_n as i,b as a,fn as o,g as s,mn as c,pn as l,t as u,y as d,z as f}from"./format-C3aawMM6.js";import{l as p,s as m}from"./compose-BgpUWGYE.js";import{t as h}from"./link-DAMxBItI.js";import{a as g,c as _,l as v,n as y,o as b,r as x,s as S,t as C}from"./tasks-bwj_EdwF.js";import{u as w}from"./governance-Di4MijNG.js";import{T,_ as E,i as D,o as O,s as k}from"./index-krHkeIbX.js";import{n as A,r as j}from"./ThreadForms-ChTFRu-P.js";import{a as M,n as N,s as P,t as F,u as I}from"./Markdown-BLiIulgZ.js";import{n as L,t as R}from"./Pane-MJgGXQBb.js";import{t as z}from"./BackLink-d0xz7ZLb.js";import{t as B}from"./SubjectThread-egXeFhT1.js";var V=i(c(),1),H=l();function U({last:e,now:t}){return e===void 0?null:(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-meta`,children:[e.author,` `,u(e.at,t)]})}function W({taskId:e,nodes:t,nested:n,isOpen:r,toggle:i,now:a}){return(0,H.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,H.jsxs)(`li`,{children:[(0,H.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,H.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,H.jsxs)(`span`,{className:`min-w-0 truncate text-fg-primary`,children:[t.name,`/`]}),(0,H.jsx)(`span`,{className:`shrink-0 text-meta`,children:t.files===1?`1 file`:`${t.files} files`}),(0,H.jsx)(U,{last:t.lastChange,now:a})]}),n?(0,H.jsx)(W,{taskId:e,nodes:t.children,nested:!0,isOpen:r,toggle:i,now:a}):null]},`dir:${t.path}`)}let{change:n}=t;return(0,H.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5 text-sm`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`w-2.5 shrink-0`}),n.status===`deleted`?(0,H.jsx)(`span`,{className:`min-w-0 truncate text-fg-tertiary line-through`,title:n.path,children:t.name}):(0,H.jsx)(N,{taskId:e,path:n.path,className:`min-w-0 truncate text-fg-secondary hover:text-fg-primary`,children:t.name}),(0,H.jsx)(`span`,{className:`shrink-0 text-meta`,children:M(n)}),(0,H.jsx)(U,{last:n.lastChange,now:a})]},n.path)})})}function G({taskId:e,changes:t,now:n}){let r=(0,V.useMemo)(()=>P(t),[t]),i=(0,V.useMemo)(()=>I(r),[r]),[a,o]=(0,V.useState)(new Map);return(0,H.jsx)(W,{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 K({task:e,now:t}){let r=n(e.id),i=a(),o=`task/${e.id}`,s;if(r.data!==void 0){let{files:n,total:i,head:a}=r.data;s=n.length===0?(0,H.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing changed on `,o,` yet. What a turn writes reaches the branch when the turn ends.`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`mt-2 text-meta`,children:[i===1?`1 file`:`${i} files`,` changed · newest commit by `,a.author,` `,u(a.at,t)]}),(0,H.jsx)(G,{taskId:e.id,changes:n,now:t}),i>n.length?(0,H.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`The first `,n.length,` of `,i,`; browse the branch for the rest.`]}):null]})}else if(r.error instanceof f&&r.error.status===404)s=(0,H.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,o,` yet. What a turn writes reaches the branch when the turn ends.`]});else if(r.error instanceof f&&r.error.status===503){let t=i.data?.find(t=>t.slug===e.project);s=(0,H.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 s=r.error===null?(0,H.jsx)(`p`,{className:`mt-2 text-meta`,children:`Reading the task's branch…`}):(0,H.jsx)(`p`,{className:`mt-2 text-meta`,children:r.error.message});return(0,H.jsxs)(`section`,{"aria-label":`Files`,className:`mt-5 border-t border-line pt-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,H.jsx)(`h3`,{className:`text-section`,children:`Files`}),(0,H.jsx)(N,{taskId:e.id,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`})]}),s]})}function q({stage:e,index:t,task:n,members:r,now:i}){let a=e.completedBy!==void 0,o=b(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),d=n.returned?.from===e.id?n.returned:void 0;return(0,H.jsxs)(`li`,{className:`relative flex gap-3 pb-4`,children:[s?null:(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-6 bottom-0 left-2.5 w-px bg-line`}),(0,H.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,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`p`,{className:`text-sm ${o?`font-medium text-fg-primary`:`text-fg-secondary`}`,children:[e.name,e.gate?(0,H.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,H.jsxs)(`p`,{className:`mt-0.5 text-meta`,children:[`for `,x(e),c===void 0?null:(0,H.jsxs)(H.Fragment,{children:[` · held by `,(0,H.jsx)(O,{name:c,members:r})]}),e.completedBy!==void 0&&e.completedAt!==void 0?` · done by ${e.completedBy} ${u(e.completedAt,i)}`:o&&n.status===`open`?` · waiting since ${u(n.stageSince,i)}`:``,l.length>0?` · held before by ${l.join(`, `)}`:``,d===void 0?``:` · sent back by ${d.by} ${u(d.at,i)}`]})]})]})}function J(e){return e.onDone===`ghpr`?e.pullRequest===void 0?`It lands through a pull request, and none is linked yet, so the board refuses to finish it.`:`Approving lands it: the board merges pull request #${e.pullRequest.number} on GitHub.`:e.onDone===`merge`?`Approving lands it: the board merges task/${e.id}.`:`Approving finishes the task.`}function Y({task:e,stage:t}){let{api:n}=r(),i=o(),[a,s]=(0,V.useState)(``),c=e.stages.findIndex(e=>e.id===t.id),l=e.stages[c+1],u=p({mutationFn:()=>n.advanceTask({task_id:e.id,...a.trim()===``?{}:{note:a.trim()}}),onSuccess:async()=>{s(``),await i.invalidateQueries({queryKey:[`task`,e.id]}),await i.invalidateQueries({queryKey:[`tasks`]})}});return(0,H.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(),u.mutate()},children:[(0,H.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[t.name,` waits on you.`,` `,l===void 0?J(e):`Approving moves the task on to ${l.name}.`]}),(0,H.jsx)(`textarea`,{value:a,rows:2,"aria-label":`Note for the task's thread`,placeholder:`A note for the thread, if any`,onChange:e=>s(e.target.value),className:A}),(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsx)(m,{variant:`primary`,type:`submit`,disabled:u.isPending,children:u.isPending?`Approving…`:`Approve`})}),(0,H.jsx)(j,{error:u.error})]})}function X({task:e,now:t}){let n=e.pullRequest;if(n===void 0)return null;let r=[n.subject??`The pull request's title`,n.body??``].filter(e=>e!==``).join(`
|
|
2
|
-
|
|
3
|
-
`);return(0,H.jsxs)(`section`,{"aria-label":`Pull request`,className:`mt-5 border-t border-line pt-4`,children:[(0,H.jsx)(`h3`,{className:`text-section`,children:`Pull request`}),(0,H.jsxs)(`p`,{className:`mt-2 text-sm`,children:[(0,H.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,H.jsxs)(`span`,{className:`text-meta`,children:[` `,`· linked by `,n.linkedBy,` `,u(n.linkedAt,t)]})]}),e.status===`abandoned`&&e.onDone===`ghpr`?(0,H.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,H.jsxs)(`span`,{className:`text-meta`,children:[` · `,u(n.closed.at,t)]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`mt-3 text-caps text-fg-muted`,children:`Merges as`}),(0,H.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 Z({taskId:e}){let{api:t}=r(),n=o(),i=p({mutationFn:()=>t.openThread({task_id:e}),onSuccess:()=>{n.invalidateQueries({queryKey:[`threads`]})}});return(0,H.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,H.jsx)(m,{variant:`primary`,disabled:i.isPending,onClick:()=>i.mutate(),children:i.isPending?`Opening…`:`Open its thread`}),(0,H.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 Q(){let{taskId:n}=T({from:`/task/$taskId`}),r=t(n),i=e(),o=a(),c=s(),l=d(3e4),p=k();if(r.data===void 0)return(0,H.jsx)(L,{children:r.error instanceof f&&r.error.status===404?`There is no task ${n}.`:`Reading the task…`});let m=r.data,b=S(m),x=w(m),O=o.data?.find(e=>e.slug===m.project),A=i.data?.find(e=>e.id===m.id);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(R,{leading:(0,H.jsx)(z,{fallback:(0,H.jsx)(h,{to:`/p/$slug/tasks`,params:{slug:m.project},"aria-label":`Back to the tasks of ${O?.name??m.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:m.title,subtitle:`${O?.name??m.project}${m.channel===`general`?``:` #${m.channel}`} · ${_(m)} · created by ${p(m.createdBy)} ${u(m.createdAt,l)}`,trailing:(0,H.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${y[b]}`,children:C.find(e=>e.phase===b)?.label.toLowerCase()})}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[(0,H.jsx)(`h3`,{className:`text-section`,children:`Plan`}),m.returned===void 0?null:(0,H.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 `,v(m,m.returned.from),` by `,m.returned.by,` `,u(m.returned.at,l),`. The work is redone from`,` `,v(m,m.stage),` until it reaches that stage again.`]}),(0,H.jsx)(`ol`,{className:`mt-3`,children:m.stages.map((e,t)=>(0,H.jsx)(q,{stage:e,index:t,task:m,members:c.data,now:l},e.id))}),x===null?null:(0,H.jsx)(Y,{task:m,stage:x}),(0,H.jsxs)(`p`,{className:`text-meta`,children:[`When the last stage is done:`,` `,m.onDone===`merge`?`task/${m.id} merges onto the default branch`:m.onDone===`ghpr`?m.pullRequest===void 0?`its pull request merges on GitHub, once one is linked`:`pull request #${m.pullRequest.number} merges on GitHub`:`nothing more`,m.blockedBy.length>0?(0,H.jsxs)(H.Fragment,{children:[` · blocked by `,(0,H.jsx)(E,{text:m.blockedBy.join(`, `)})]}):null]}),m.body.trim()===``?null:(0,H.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,H.jsx)(`h3`,{className:`text-section`,children:`Brief`}),(0,H.jsx)(`div`,{className:`mt-2`,children:(0,H.jsx)(F,{text:m.body})})]}),(0,H.jsx)(X,{task:m,now:l}),(0,H.jsx)(K,{task:m,now:l}),(0,H.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,H.jsx)(`h3`,{className:`text-section`,children:`Thread`}),i.data===void 0?null:A===void 0?g(m)?(0,H.jsx)(Z,{taskId:m.id}):(0,H.jsx)(`p`,{className:`mt-2 text-meta`,children:`No thread on this task.`}):(0,H.jsx)(B,{thread:A,now:l,task:m,empty:`Nothing said yet. Each stage's handover lands here, and so does anything written below.`})]})]}),A?.state===`open`?(0,H.jsx)(D,{target:{threadId:m.id},placeholder:`Write in the task's thread`}):null]})}export{Q as TaskView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,pn as t,t as n}from"./format-C3aawMM6.js";import{t as r}from"./link-DAMxBItI.js";import{_ as i}from"./index-krHkeIbX.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`?e(t.body,180):``,u=t.messages===1?`1 message`:`${t.messages} messages`;return(0,a.jsxs)(r,{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`,` `,n(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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt as e,tt as t}from"./format-C3aawMM6.js";import{l as n}from"./index-krHkeIbX.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};
|