@kubitnodes/stellaris 0.3.20 → 0.3.21
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 +182 -56
- package/dist/server/index.js +281 -85
- package/package.json +1 -1
- package/web/dist/assets/BackLink-23Q1JvmZ.js +1 -0
- package/web/dist/assets/{ChannelForms-BYrcUldk.js → ChannelForms-0Cwh59E7.js} +1 -1
- package/web/dist/assets/{ChannelView-GJ_DusLQ.js → ChannelView-CqWV1zza.js} +2 -2
- package/web/dist/assets/{CitizenView-Cx7IYSRr.js → CitizenView-s5OdjXmB.js} +2 -2
- package/web/dist/assets/{CitizensView-IKH7_yNQ.js → CitizensView-r6SZLnVl.js} +1 -1
- package/web/dist/assets/{CliIcon-vSuwLv2K.js → CliIcon-BOSygXeI.js} +1 -1
- package/web/dist/assets/{CronsView-DJbi8Qhx.js → CronsView-Y-bAE0l2.js} +1 -1
- package/web/dist/assets/{KnowledgeView-CoYOG9tI.js → KnowledgeView-CI4PJWwm.js} +1 -1
- package/web/dist/assets/{Markdown-YC-fbHiE.js → Markdown-DyckB74r.js} +4 -4
- package/web/dist/assets/{MessageItem-D7MUCA_T.js → MessageItem-DI05jbrI.js} +1 -1
- package/web/dist/assets/{MetricsView-CE94VW0I.js → MetricsView-DKh-lEW5.js} +1 -1
- package/web/dist/assets/{NeedsYouView-Otnm3lcG.js → NeedsYouView-C6FfiTsg.js} +1 -1
- package/web/dist/assets/{Overview-B8f6rLb2.js → Overview-D5RvWBg5.js} +1 -1
- package/web/dist/assets/{Pane-_D7n5uKH.js → Pane-BendOaje.js} +1 -1
- package/web/dist/assets/{Picker-DUiiQMFN.js → Picker-BuVnakvi.js} +1 -1
- package/web/dist/assets/{ProjectView-D_ACOmEd.js → ProjectView-blBEh70W.js} +1 -1
- package/web/dist/assets/ProposalView-CMntpKTc.js +2 -0
- package/web/dist/assets/{ProposalsView-BovF6CMD.js → ProposalsView-CVUAV2Mm.js} +1 -1
- package/web/dist/assets/{RunnersView-B2_uCVHC.js → RunnersView-B-wuWVgB.js} +1 -1
- package/web/dist/assets/{SocietyView-Bf0iX8AY.js → SocietyView-CaVbfJWz.js} +1 -1
- package/web/dist/assets/{SubjectThread-B_Vmgs3d.js → SubjectThread-Bd_-sDhJ.js} +1 -1
- package/web/dist/assets/{TaskFileView-BzO0gjE6.js → TaskFileView-CO4Y97OT.js} +2 -2
- package/web/dist/assets/{TaskView-DB_Nji99.js → TaskView-DRZoHALo.js} +2 -2
- package/web/dist/assets/{TasksView-Bz36YYWq.js → TasksView-CQVQo3zF.js} +1 -1
- package/web/dist/assets/{ThreadForms-1mbMZsbv.js → ThreadForms-CUSeWu0c.js} +1 -1
- package/web/dist/assets/{ThreadItem-QJSA92C4.js → ThreadItem-BPYYXh3V.js} +1 -1
- package/web/dist/assets/{ThreadView-BECLqt5B.js → ThreadView-BcI2i6FI.js} +1 -1
- package/web/dist/assets/{citizen-DVFr5T6R.js → citizen-Eff1h9rA.js} +1 -1
- package/web/dist/assets/{compose-_6feqP1t.js → compose-D73Agshx.js} +1 -1
- package/web/dist/assets/{format-DxXtbdNM.js → format-fw0G_Vff.js} +1 -1
- package/web/dist/assets/governance-sRsfOw52.js +1 -0
- package/web/dist/assets/index-CYiok0pT.js +23 -0
- package/web/dist/assets/link-Cl7vKbOz.js +1 -0
- package/web/dist/assets/{tasks-B6I9DJ8O.js → tasks-CyXIxoAy.js} +1 -1
- package/web/dist/assets/useMatch-D-tEHQEw.js +1 -0
- package/web/dist/assets/{useStickyScroll-Ca7sWbGH.js → useStickyScroll-Bn4YyEXL.js} +1 -1
- package/web/dist/index.html +8 -8
- package/web/dist/assets/BackLink-BjfX2KZl.js +0 -1
- package/web/dist/assets/ProposalView-4d0U3nEb.js +0 -2
- package/web/dist/assets/governance-C9xH4QTm.js +0 -1
- package/web/dist/assets/index-BEVCPm4C.js +0 -23
- package/web/dist/assets/link-CTjFMNoY.js +0 -1
- package/web/dist/assets/useMatch-B3RzAe8y.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as e,Gt as t,Jt as n,On as r,Rt as i,Tn as a,Zt as o,qt as s,wn as c,zt as l}from"./format-fw0G_Vff.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(t,n,r=`never`,i){if(n.includes(`//`)&&(n=u(n)),n.startsWith(`/`))return n.length===1||r===`preserve`?n:r===`always`?n.endsWith(`/`)?n:`${n}/`:n.endsWith(`/`)?n.slice(0,-1):n;let a=n===`.`,o;if(i){o=a?t:t+`\0`+n;let e=i.get(o);if(e)return e}let s;if(a)s=t.split(`/`);else{for(t.includes(`//`)&&(t=u(t)),s=t.split(`/`);s.length>1&&e(s)===``;)s.pop();let r=n.split(`/`);for(let e=0,t=r.length;e<t;e++){let n=r[e];n===``?e?e===t-1&&s.push(n):s=[n]:n===`..`?s.length>1?s.pop():s=[``]:n===`.`||s.push(n)}}s.length>1&&(e(s)===``?r===`never`&&s.pop():r===`always`&&s.push(``));let c=s.join(`/`),l=(a?u(c):c)||`/`;return o&&i&&i.set(o,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=r(a(),1),S=c(),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 n=x.useRef(e),r=n.current;return e.forEach((e,n)=>{t(r[n],e,!1,!0)||(r[n]=e)}),n.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,t){let r=typeof e==`string`&&n(e);if(r)return t.has(r)?e:null}function te(e,n,r,i,a){let o=m(e.pathname,i),s=m(n.pathname,i);return(r?.exact?o!==s:!o.startsWith(s)||o.length!==s.length&&o[s.length]!==`/`)||(r?.includeSearch??!0)&&!t(e.search,n.search,!r?.exact,r?.explicitUndefined)?!1:!r?.includeHash||a&&e.hash===n.hash}function j(e,t,r){let a=l(),o=x.useRef(null),s=x.useCallback(e=>{if(o.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:c,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}=e,M=E(!!c?.includeHash),[N,P,V]=O(e.search,e.params,c),[H,U]=x.useMemo(()=>[e,{...e}],[a,e.from,e._fromLocation,e.hash,e.to,N,P,e.state,e.mask,e.unsafeRelative]),ne=x.useCallback(e=>{let t=ee(u,a.protocolAllowlist);if(t!==void 0)return[t??void 0];H._fromLocation||(U._fromLocation=e);let r=a.buildLocation(U),i=B(r,a,y);return[i,!y&&(!i||n(i))?void 0:te(e,r,V,a.basepath,M)]},[V,y,M,H,U,a,u]),[W,G]=i(a.stores.location,ne,A),K=G===void 0?W:void 0,q=y||W===void 0,J=x.useRef(!1),Y=e.reloadDocument||K||q?!1:d??a.options.defaultPreload,X=f??a.options.defaultPreloadDelay??0,Z=x.useCallback(e=>{let t=e?.isIntersecting;if(!(t??Y===`intent`)){t===!1&&R(o);return}if(!X){k(a,H);return}L.has(o)||L.set(o,setTimeout(()=>{L.delete(o),k(a,H)},X))},[a,H,o,Y,X]);x.useEffect(()=>{if(!Y)return;Y===`render`&&!J.current&&(J.current=!0,k(a,H));let e=!0,t;return Y===`viewport`&&o.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&Z(t.pop())},{rootMargin:`100px`}),t.observe(o.current)),()=>{e=!1,t?.disconnect(),R(o)}},[a,H,Y,Z,o]);let Q=F(e,r);if(Q.ref=t?s:o,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(),a.navigate({...H,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:v}))},ie=()=>{Y===`intent`&&k(a,H)},$=()=>{Y===`intent`&&R(o)};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,e,G,W,q,r)}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,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!o(i,t.protocolAllowlist))return i}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,n){let r=0;for(let i in n)if(r++,e[i]!==n[i]&&(!P.has(i)||!t(e[i],n[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{_t as e,
|
|
1
|
+
import{_t as e,bt as t}from"./format-fw0G_Vff.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(t,n){if(!e(t))return t.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(t.action===`advanced`)return{text:t.to===null?`finished ${i(t.stage)}`:`finished ${i(t.stage)} → ${i(t.to)}`,tone:r.working};if(t.action===`returned`){let e=t.to===null?`an earlier stage`:i(t.to);return{text:`sent back from ${i(t.stage)} to ${e}`,tone:r.returned}}return t.action===`abandoned`?{text:`abandoned`,tone:r.abandoned}:t.action===`landed`?{text:`landed`,tone:r.landing}:{text:`landing failed · back at ${i(t.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(e){let n=i(e);return n===`done`?`All ${e.stages.length} stages done`:n===`abandoned`?`Abandoned`:`Stage ${t(e,e.stage)+1} of ${e.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{On as e,Rt as t,Tn as n,nn as r,zt as i}from"./format-fw0G_Vff.js";function a(){throw Error(`Invariant failed`)}var o=e(n(),1),s=o.createContext(void 0),c=o.createContext(void 0),l={};function u(e,t){let n=o.useRef();return i=>{let a=e?.select?e.select(i):i;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=r(n.current,a):a}}function d(e){let n=i(),r=o.useContext(e.from?c:s),d=e.from??r,f=n.stores.getMatchStore(d),p=u(e,n),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{On as e,Tn as t}from"./format-fw0G_Vff.js";var n=e(t(),1);function r(e=!0){let t=(0,n.useRef)(null),r=(0,n.useRef)(e);return(0,n.useLayoutEffect)(()=>{e||(r.current=!1)},[e]),(0,n.useLayoutEffect)(()=>{let e=t.current;e!==null&&r.current&&(e.scrollTop=e.scrollHeight)}),{ref:t,onScroll:()=>{let e=t.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<80)}}}export{r as t};
|
package/web/dist/index.html
CHANGED
|
@@ -6,15 +6,15 @@
|
|
|
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-CYiok0pT.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/format-fw0G_Vff.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-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/compose-D73Agshx.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/useMatch-D-tEHQEw.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/link-Cl7vKbOz.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/CliIcon-BOSygXeI.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/tasks-CyXIxoAy.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/governance-sRsfOw52.js">
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-BkOq4PSU.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body class="antialiased">
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{It as e,x as t,xn as n}from"./format-DxXtbdNM.js";import{O as r,n as i,r as a,t as o,v as s}from"./index-BEVCPm4C.js";var c=n(),l=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function u({fallback:n}){let u=e(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=t(),h=i(f,d);if(h===null)return n;let g=o(h,{entity:e=>p.get(e)?.title,project:e=>m.data?.find(t=>t.slug===e)?.name});return(0,c.jsx)(`button`,{type:`button`,onClick:()=>u.history.back(),"aria-label":`Back to ${g}`,title:`Back to ${g}`,className:l,children:`←`})}export{u as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A as e,At as t,C as n,E as r,H as i,M as a,Mt as o,Pt as s,R as c,S as l,Sn as u,Tn as d,_ as f,at as p,b as m,bn as h,ft as g,jt as _,kt as v,lt as y,ot as ee,st as te,t as b,ut as x,x as S,xn as C,z as w}from"./format-DxXtbdNM.js";import{a as T,s as ne}from"./compose-_6feqP1t.js";import{t as E}from"./link-CTjFMNoY.js";import{t as re}from"./CliIcon-vSuwLv2K.js";import{a as ie}from"./tasks-B6I9DJ8O.js";import{c as ae,d as D,l as O,n as k,o as A,r as j,s as M}from"./governance-C9xH4QTm.js";import{A as N,i as P,o as F,s as I}from"./index-BEVCPm4C.js";import{n as L,r as R}from"./ThreadForms-1mbMZsbv.js";import{p as z,t as B}from"./Markdown-YC-fbHiE.js";import{n as V,t as H}from"./Pane-_D7n5uKH.js";import{t as oe}from"./BackLink-BjfX2KZl.js";import{StatusChip as U}from"./ProposalsView-BovF6CMD.js";import{t as W}from"./SubjectThread-B_Vmgs3d.js";var G=d(u(),1),K=C();function q({proposal:t,consequence:n}){let{api:r}=e(),i=h(),a=f(),[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=ne({mutationFn:()=>{let e=c.trim();return o===`reject`?r.reject({proposal_id:t.id,reason:e}):r.approve({proposal_id:t.id,...e===``?{}:{reason:e}})},onSuccess:()=>{let e=[[`proposals`],[`proposal`,t.id],[`threads`],[`thread`,t.id]];for(let t of e)i.invalidateQueries({queryKey:t});s(null),l(``)}}),p=(a.data??[]).find(e=>e.name===t.proposedBy&&e.status===`active`&&e.cli!==null),m=p===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 ${p.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)(T,{onClick:()=>s(`reject`),children:`Reject`}),(0,K.jsx)(T,{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:`${L} resize-none`}),(0,K.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:[g?n:`Nothing is created, and the proposal's thread closes.`,` `,m]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,K.jsx)(T,{onClick:()=>{s(null),d.reset()},children:`Cancel`}),(0,K.jsx)(T,{variant:`primary`,type:`submit`,disabled:d.isPending||!g&&c.trim()===``,children:d.isPending?`Deciding…`:g?`Confirm approval`:`Confirm rejection`})]}),(0,K.jsx)(R,{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 se({next:e,current:t,compare:n}){let r=t===void 0?null:ae(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 ce({proposal:e,slug:t,reason:n,members:r}){let i=S(),a=c(t),o=i.data?.find(e=>e.slug===t),s=e.status===`proposed`,l=s?(r??[]).filter(e=>e.status===`active`&&e.memberships.includes(t)).map(e=>e.name):e.provision?.members??[],u=(a.data??[]).filter(ie).length;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Project`,children:[(0,K.jsx)(E,{to:`/p/$slug`,params:{slug:t},className:`hover:text-fg-primary`,children:o?.name??t}),o?.name===void 0||o.name===t?null:` · ${t}`]}),(0,K.jsx)(Y,{label:s?`Members who leave`:`Members who left`,children:Array.isArray(l)?X(l.filter(e=>typeof e==`string`)):`none`}),s?(0,K.jsx)(Y,{label:`Tasks in play`,children:a.data===void 0?`reading…`:u===0?`none`:`${u}: 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 le({proposal:e,name:t}){let r=e.skillFiles,i=n(e.id,r!==void 0),[a,o]=(0,G.useState)(new Set);if(r===void 0)return(0,K.jsx)(`p`,{className:`mt-2 text-sm text-fg-secondary`,children:e.status===`proposed`?`The board takes skills/${t}/ from ${e.proposedBy}'s home when the turn that proposed it ends.`:`The board took no files for it.`});if(i.data===void 0)return(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:i.isError?`Could not read its files.`:`Loading…`});let s=i.data.find(e=>e.path===`SKILL.md`),c=i.data.filter(e=>e.path!==`SKILL.md`),l=e=>{o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J,{children:(0,K.jsxs)(Y,{label:`Taken from`,children:[e.proposedBy,`'s home at`,` `,(0,K.jsx)(`span`,{className:`font-mono`,children:r.commit.slice(0,7)})]})}),s===void 0||s.text===null?null:(0,K.jsx)(Q,{children:(0,K.jsx)(B,{text:O(s.text)})}),c.length===0?null:(0,K.jsx)(`ul`,{className:`mt-2`,children:c.map(e=>{let t=a.has(e.path);return(0,K.jsxs)(`li`,{children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":t,title:e.path,onClick:()=>l(e.path),className:`group flex w-full items-baseline gap-2 rounded-md py-0.5 text-left text-sm hover:bg-surface-2/40 ${t?`bg-surface-2/30`:``}`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-2.5 shrink-0 text-[10px] text-fg-muted transition-transform ${t?`rotate-90`:``}`,children:`▸`}),(0,K.jsx)(`span`,{className:`min-w-0 truncate ${t?`text-fg-primary`:`text-fg-secondary group-hover:text-fg-primary`}`,children:e.path}),(0,K.jsxs)(`span`,{className:`shrink-0 text-meta`,children:[z(e.size),e.executable?` · executable`:``]})]}),t?e.text===null?(0,K.jsx)(`p`,{className:`mt-1 mb-2 ml-[18px] text-meta`,children:`A binary file; it is published as it is.`}):(0,K.jsxs)(`pre`,{className:`mt-1 mb-2 ml-[18px] max-h-96 overflow-auto rounded-lg bg-surface-2/40 p-3 font-mono text-[11px] leading-relaxed text-fg-secondary`,children:[e.text,e.truncated?`
|
|
2
|
-
…`:``]}):null]},e.path)})})]})}function $({proposal:e,roles:t,members:n}){let r=e.status===`proposed`,{charter:i}=e;switch(e.kind){case`member`:{let e=te.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)(re,{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=M(e);if(n===null)break;return(0,K.jsx)(se,{next:n,current:t?.find(e=>e.name===n.name),compare:r})}case`skill`:{let t=g.safeParse(i);if(!t.success)break;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{children:[(0,K.jsx)(Y,{label:`Skill`,children:t.data.name}),(0,K.jsx)(Y,{label:`Summary`,children:t.data.summary})]}),t.data.body===void 0?(0,K.jsx)(le,{proposal:e,name:t.data.name}):(0,K.jsx)(Q,{children:(0,K.jsx)(B,{text:O(t.data.body)})})]})}case`channel`:{let e=ee.safeParse(i);if(!e.success)break;return(0,K.jsxs)(J,{children:[(0,K.jsxs)(Y,{label:`Channel`,children:[`#`,v(e.data.project,e.data.name)]}),(0,K.jsx)(Y,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=x.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)(F,{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=p.safeParse(i);if(!t.success)break;return(0,K.jsx)(ce,{proposal:e,slug:t.data.project,reason:t.data.reason,members:n})}case`reallocation`:{let e=y.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 ue=o({agent:s().optional(),channel:s().optional(),role:s().optional(),skill:s().optional(),replaced:_().optional(),releasedTasks:t(s()).optional(),project:s().optional()});function de({proposal:e}){let t=ue.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)(E,{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)(E,{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)(E,{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 fe(){let{proposalId:e}=N({from:`/proposal/$proposalId`}),t=l(e),n=f(),o=r(),s=a(),c=w(),u=m(3e4),d=I();if(t.data===void 0)return(0,K.jsx)(V,{children:t.error instanceof i&&t.error.status===404?`There is no proposal ${e}.`:`Reading the proposal…`});let p=t.data,h=p.status===`proposed`,g=n.data?.find(e=>e.name===p.proposedBy)?.role,_=c.data?.find(e=>e.id===p.id),v=p.status===`rejected`?`Rejected`:`Approved`,y=k(p,{members:n.data??[],roles:o.data??[],skills:s.data??[]});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(H,{leading:(0,K.jsx)(oe,{fallback:(0,K.jsx)(E,{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:A(p),subtitle:`${p.kind} proposal by ${d(p.proposedBy)} ${b(p.createdAt,u)}${h?` · for ${j(p,g)} to decide`:``}`,trailing:(0,K.jsx)(U,{status:p.status})}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4`,children:[h?(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: `,y]}):(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:[v,` by `,d(p.decidedBy??`someone`),p.decidedAt===void 0?``:` ${b(p.decidedAt,u)}`,p.reason===void 0?`.`:`: ${p.reason}`]}),(0,K.jsx)(de,{proposal:p})]}),p.body.trim()===``||_!==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:p.body})})]}),(0,K.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-section`,children:h?`What it would make`:p.status===`provisioned`?`What it made`:`What it proposed`}),(0,K.jsx)($,{proposal:p,roles:o.data,members:n.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`}),_===void 0?(0,K.jsx)(`p`,{className:`mt-2 text-meta`,children:c.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:_,now:u,empty:`Nothing said yet. The pitch and the decision are posted here.`})]})]}),_?.state===`open`?(0,K.jsx)(P,{target:{threadId:p.id},placeholder:`Write in the proposal's thread`}):null,D(p)?(0,K.jsx)(q,{proposal:p,consequence:y}):null]})}export{fe as ProposalView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Tt as e,at as t,ct as n,ft as r,kt as i,mt as a,ot as o,st as s,ut as c}from"./format-DxXtbdNM.js";import{s as l}from"./tasks-B6I9DJ8O.js";var u=[{group:`yours`,label:`Waiting on you`},{group:`others`,label:`Waiting on others`},{group:`decided`,label:`Decided`}];function d(e){let t=a(e.kind,e.charter);return t.charAt(0).toUpperCase()+t.slice(1)}function f(e){return e.status===`proposed`&&e.proposedBy!==`user`&&n[e.kind].includes(`user`)}function p(e){return e.status===`proposed`?f(e)?`yours`:`others`:`decided`}function m(e){return u.map(({group:t})=>{let n=e.filter(e=>p(e)===t);return{group:t,proposals:t===`decided`?n.toSorted((e,t)=>(t.decidedAt??t.createdAt).localeCompare(e.decidedAt??e.createdAt)):n.toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt))}}).filter(e=>e.proposals.length>0)}var h=new Intl.ListFormat(`en`,{type:`disjunction`});function g(e,t){let r=n[e.kind].flatMap(n=>n===`user`?e.proposedBy===`user`?[]:[`you`]:[n===t?`another ${n}`:`the ${n}`]);return r.length===0?`nobody`:h.format(r)}function _(t){let n=e.safeParse(t.charter);return t.kind===`role`&&n.success?n.data:null}function v(e){return e===void 0?`unset`:typeof e==`boolean`?e?`yes`:`no`:Array.isArray(e)?e.length===0?`none`:e.join(`, `):typeof e==`string`||typeof e==`number`?String(e):JSON.stringify(e)}var y=[[`wakeTriggers`,`wake triggers`],[`maxReplicas`,`replicas per project`],[`backlogThreshold`,`backlog per member before scaling`],[`resident`,`warm session`],[`societyScope`,`society role`],[`reflects`,`reflects`],[`reviewDate`,`review date`]];function b(e,t){return{verbsAdded:t.verbs.filter(t=>!e.verbs.includes(t)),verbsRemoved:e.verbs.filter(e=>!t.verbs.includes(e)),purposeChanged:e.purpose.trim()!==t.purpose.trim(),changes:y.flatMap(([n,r])=>{let i=v(e[n]),a=v(t[n]);return i===a?[]:[{field:r,from:i,to:a}]})}}function x(e){return e.replace(/^\s*---\n[\s\S]*?\n---[ \t]*\n?/,``).trim()}function S(e,n){switch(e.kind){case`member`:{let t=s.safeParse(e.charter);if(!t.success)break;let{name:n,role:r,cli:i,memberships:a}=t.data;return`Creates the citizen ${n} (${r}, ${i})${a.length===0?``:` in ${a.join(`, `)}`} and starts its first turn.`}case`role`:{let t=_(e);if(t===null)break;if(!n.roles.some(e=>e.name===t.name))return`Adds the role ${t.name}; nobody holds it until a member proposal is approved.`;let r=n.members.filter(e=>e.role===t.name&&e.status===`active`).length;return r===0?`Rewrites the ${t.name} charter; no active member holds the role.`:`Rewrites the ${t.name} charter for ${r===1?`its member`:`its ${r} members`}, from their next turn.`}case`channel`:{let t=o.safeParse(e.charter);if(!t.success)break;return`Creates #${i(t.data.project,t.data.name)}.`}case`retirement`:{let t=c.safeParse(e.charter);if(!t.success)break;return`Retires ${t.data.agent}: its stages go back to open and its home is archived, not deleted.`}case`skill`:{let t=r.safeParse(e.charter);if(!t.success)break;return n.skills.some(e=>e.name===t.data.name)?`Replaces the society's ${t.data.name} skill with ${t.data.body===void 0?`these files`:`this text`}.`:`Publishes ${t.data.name} to the society's skills, which every citizen's instructions list.`}case`archive`:{let n=t.safeParse(e.charter);if(!n.success)break;return`Archives ${n.data.project}: its members leave, its open threads close, and it takes no more work; its channels, tasks, and history stay readable.`}case`reallocation`:return`Records the decision; the board carries out nothing for a reallocation.`}return`The charter does not parse as its kind; approving it will fail.`}function C(e){let t=l(e);if(t===`landing`||t===`done`||t===`abandoned`)return null;let n=e.stages.find(t=>t.id===e.stage);return n===void 0||n.agent!==`user`&&n.role!==`user`?null:e.status===`open`||e.claimedBy===`user`?n:null}function w(e){let t=(e,t)=>e.since.localeCompare(t.since),n=e.proposals.filter(f).map(e=>({kind:`proposal`,since:e.createdAt,proposal:e})),r=e.tasks.flatMap(e=>{let t=C(e);return t===null?[]:[{kind:`stage`,since:e.stageSince,task:e,stage:t}]}),i=e.requests.map(({message:e,thread:t})=>({kind:`request`,since:e.ts,message:e,thread:t}));return[...n.toSorted(t),...r.toSorted(t),...i.toSorted(t)]}export{w as a,b as c,f as d,m as i,x as l,S as n,d as o,g as r,_ as s,u as t,C as u};
|