@kubitnodes/stellaris 0.3.16 → 0.3.17

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.
Files changed (47) hide show
  1. package/dist/cli/index.js +50 -2
  2. package/dist/server/index.js +50 -2
  3. package/package.json +1 -1
  4. package/web/dist/assets/BackLink-CssfJ-vJ.js +1 -0
  5. package/web/dist/assets/{ChannelForms-mdOuU6eZ.js → ChannelForms-B3XwkJj_.js} +1 -1
  6. package/web/dist/assets/ChannelView-B3qNylz5.js +2 -0
  7. package/web/dist/assets/{CitizenView-B_AL8Fnt.js → CitizenView-BUeC52q2.js} +2 -2
  8. package/web/dist/assets/{CitizensView--LjujB8k.js → CitizensView-BSWYcQ-Q.js} +1 -1
  9. package/web/dist/assets/{CliIcon-Cyv7ef-2.js → CliIcon-CFObB9XW.js} +1 -1
  10. package/web/dist/assets/CronsView-BBIx84f7.js +1 -0
  11. package/web/dist/assets/{KnowledgeView-CMYgeq6t.js → KnowledgeView-C8r5hAa_.js} +1 -1
  12. package/web/dist/assets/{Markdown-CI8CWgHq.js → Markdown-BO_bF8WD.js} +4 -4
  13. package/web/dist/assets/{MessageItem-Dtpufq_V.js → MessageItem-BkDlfhQC.js} +1 -1
  14. package/web/dist/assets/{MetricsView-CDtVttH_.js → MetricsView-DqAQ4th0.js} +1 -1
  15. package/web/dist/assets/{NeedsYouView-DuVBOLn4.js → NeedsYouView-D2Z-iLdT.js} +1 -1
  16. package/web/dist/assets/{Overview-BMatmD0p.js → Overview-DThLwb0l.js} +1 -1
  17. package/web/dist/assets/{Pane-L4GJKBiw.js → Pane-DHXhVwfI.js} +1 -1
  18. package/web/dist/assets/{Picker-h6akABv6.js → Picker-CQQ7hj8T.js} +1 -1
  19. package/web/dist/assets/{ProjectView-t3cOK3AT.js → ProjectView-DOtPYF6z.js} +1 -1
  20. package/web/dist/assets/{ProposalView-BRr85RPY.js → ProposalView-BpeiCg46.js} +1 -1
  21. package/web/dist/assets/{ProposalsView-ffQA37Wa.js → ProposalsView-BJg4ZsTy.js} +1 -1
  22. package/web/dist/assets/{RunnersView-BD0XRmGY.js → RunnersView-DOW8xq-J.js} +1 -1
  23. package/web/dist/assets/SocietyView-CbIpCGhP.js +1 -0
  24. package/web/dist/assets/{SubjectThread-DnQJDgcK.js → SubjectThread-Do5As1cO.js} +1 -1
  25. package/web/dist/assets/{TaskFileView-uJ9xM8Y0.js → TaskFileView-CPwEmR6p.js} +2 -2
  26. package/web/dist/assets/{TaskView-CkMhrkxY.js → TaskView-q6Kn30K7.js} +2 -2
  27. package/web/dist/assets/{TasksView-BuAqdPIa.js → TasksView-CT9Cui_C.js} +1 -1
  28. package/web/dist/assets/{ThreadCard-CkqMOMDh.js → ThreadCard-DsIkg4Br.js} +1 -1
  29. package/web/dist/assets/ThreadForms-BPowHd4M.js +1 -0
  30. package/web/dist/assets/{ThreadView-CpdtYhHa.js → ThreadView-BZ2nKfyD.js} +1 -1
  31. package/web/dist/assets/{citizen-Cyd1haJO.js → citizen-DFaT61S1.js} +1 -1
  32. package/web/dist/assets/{compose-BCqmtrsZ.js → compose-96HAETM2.js} +1 -1
  33. package/web/dist/assets/{format-qPQgH1PF.js → format-Cp_C4ygr.js} +1 -1
  34. package/web/dist/assets/{governance-D5tD2NOI.js → governance-BbogC_X-.js} +1 -1
  35. package/web/dist/assets/index-BXHV32GA.js +23 -0
  36. package/web/dist/assets/{link-DF__7B1f.js → link-DIpiSYJj.js} +1 -1
  37. package/web/dist/assets/{tasks-DcovWYAU.js → tasks-C1wf85BJ.js} +1 -1
  38. package/web/dist/assets/useMatch-DYOY33wl.js +1 -0
  39. package/web/dist/assets/{useStickyScroll-BFNyJYps.js → useStickyScroll-7ZZcyLI0.js} +1 -1
  40. package/web/dist/index.html +8 -8
  41. package/web/dist/assets/BackLink-B5n6YQVF.js +0 -1
  42. package/web/dist/assets/ChannelView-CeoMScnt.js +0 -2
  43. package/web/dist/assets/CronsView-DGGDT8e-.js +0 -1
  44. package/web/dist/assets/SocietyView-CsbeXgkb.js +0 -1
  45. package/web/dist/assets/ThreadForms-Bciw71n3.js +0 -1
  46. package/web/dist/assets/index-BfZnvrmA.js +0 -23
  47. package/web/dist/assets/useMatch-AToHy-wD.js +0 -1
@@ -1 +1 @@
1
- import{Cn as e,Dn as t,Kt as n,Lt as r,Qt as i,Rt as a,Wt as o,Xt as s,qt as c,wn as l}from"./format-qPQgH1PF.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 a=t===`.`,o;if(r){o=a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else{for(e.includes(`//`)&&(e=u(e)),s=e.split(`/`);s.length>1&&i(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(i(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=s.join(`/`),l=(a?u(c):c)||`/`;return o&&r&&r.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=t(l(),1),S=e(),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),n=t.current;return e.forEach((e,t)=>{o(n[t],e,!1,!0)||(n[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,t){let n=typeof e==`string`&&c(e);if(n)return t.has(n)?e:null}function te(e,t,n,r,i){let a=m(e.pathname,r),s=m(t.pathname,r);return(n?.exact?a!==s:!a.startsWith(s)||a.length!==s.length&&a[s.length]!==`/`)||(n?.includeSearch??!0)&&!o(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function j(e,t,n){let i=a(),o=x.useRef(null),s=x.useCallback(e=>{if(o.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{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}=e,M=E(!!l?.includeHash),[N,P,V]=O(e.search,e.params,l),[H,U]=x.useMemo(()=>[e,{...e}],[i,e.from,e._fromLocation,e.hash,e.to,N,P,e.state,e.mask,e.unsafeRelative]),ne=x.useCallback(e=>{let t=ee(u,i.protocolAllowlist);if(t!==void 0)return[t??void 0];H._fromLocation||(U._fromLocation=e);let n=i.buildLocation(U),r=B(n,i,y);return[r,!y&&(!r||c(r))?void 0:te(e,n,V,i.basepath,M)]},[V,y,M,H,U,i,u]),[W,G]=r(i.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??i.options.defaultPreload,X=f??i.options.defaultPreloadDelay??0,Z=x.useCallback(e=>{let t=e?.isIntersecting;if(!(t??Y===`intent`)){t===!1&&R(o);return}if(!X){k(i,H);return}L.has(o)||L.set(o,setTimeout(()=>{L.delete(o),k(i,H)},X))},[i,H,o,Y,X]);x.useEffect(()=>{if(!Y)return;Y===`render`&&!J.current&&(J.current=!0,k(i,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)}},[i,H,Y,Z,o]);let Q=F(e,n);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(),i.navigate({...H,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:v}))},ie=()=>{Y===`intent`&&k(i,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,n)}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,r,i,a,o){let{activeProps:s,inactiveProps:c,className:l,style:u,target:d}=t,f=n(r?s:c,{})??(r?N:M);Object.assign(e,f),e.href=i,o!==`a`&&(e.disabled=a),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),a&&(e.role=`link`,e[`aria-disabled`]=!0),r&&(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||!s(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,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!P.has(r)||!o(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===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
+ import{Cn as e,En as t,Gt as n,It as r,Kt as i,Lt as a,Sn as o,Ut as s,Yt as c,Zt as l}from"./format-Cp_C4ygr.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&&l(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&&(l(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?u(s):s)||`/`;return a&&r&&r.set(a,c),c}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=t(e(),1),S=o(),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),n=t.current;return e.forEach((e,t)=>{s(n[t],e,!1,!0)||(n[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,t){let n=typeof e==`string`&&i(e);if(n)return t.has(n)?e:null}function te(e,t,n,r,i){let a=m(e.pathname,r),o=m(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!s(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function j(e,t,n){let o=a(),s=x.useRef(null),c=x.useCallback(e=>{if(s.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{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}=e,M=E(!!l?.includeHash),[N,P,V]=O(e.search,e.params,l),[H,U]=x.useMemo(()=>[e,{...e}],[o,e.from,e._fromLocation,e.hash,e.to,N,P,e.state,e.mask,e.unsafeRelative]),ne=x.useCallback(e=>{let t=ee(u,o.protocolAllowlist);if(t!==void 0)return[t??void 0];H._fromLocation||(U._fromLocation=e);let n=o.buildLocation(U),r=B(n,o,y);return[r,!y&&(!r||i(r))?void 0:te(e,n,V,o.basepath,M)]},[V,y,M,H,U,o,u]),[W,G]=r(o.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??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(e,n);if(Q.ref=t?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,e,G,W,q,n)}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,r,i,a,o){let{activeProps:s,inactiveProps:c,className:l,style:u,target:d}=t,f=n(r?s:c,{})??(r?N:M);Object.assign(e,f),e.href=i,o!==`a`&&(e.disabled=a),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),a&&(e.role=`link`,e[`aria-disabled`]=!0),r&&(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||!c(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,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!P.has(r)||!s(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===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,vt as t}from"./format-qPQgH1PF.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};
1
+ import{_t as e,gt as t}from"./format-Cp_C4ygr.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{Cn as e,En as t,It as n,Lt as r,en as i}from"./format-Cp_C4ygr.js";function a(){throw Error(`Invariant failed`)}var o=t(e(),1),s=o.createContext(void 0),c=o.createContext(void 0),l={};function u(e,t){let n=o.useRef();return r=>{let a=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=i(n.current,a):a}}function d(e){let t=r(),i=o.useContext(e.from?c:s),d=e.from??i,f=t.stores.getMatchStore(d),p=u(e,t),m=n(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{Dn as e,wn as t}from"./format-qPQgH1PF.js";var n=e(t(),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};
1
+ import{Cn as e,En as t}from"./format-Cp_C4ygr.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};
@@ -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-BfZnvrmA.js"></script>
10
- <link rel="modulepreload" crossorigin href="/assets/format-qPQgH1PF.js">
9
+ <script type="module" crossorigin src="/assets/index-BXHV32GA.js"></script>
10
+ <link rel="modulepreload" crossorigin href="/assets/format-Cp_C4ygr.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/mentions-BCdV0bMK.js">
12
- <link rel="modulepreload" crossorigin href="/assets/compose-BCqmtrsZ.js">
13
- <link rel="modulepreload" crossorigin href="/assets/useMatch-AToHy-wD.js">
14
- <link rel="modulepreload" crossorigin href="/assets/link-DF__7B1f.js">
15
- <link rel="modulepreload" crossorigin href="/assets/CliIcon-Cyv7ef-2.js">
16
- <link rel="modulepreload" crossorigin href="/assets/tasks-DcovWYAU.js">
17
- <link rel="modulepreload" crossorigin href="/assets/governance-D5tD2NOI.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/compose-96HAETM2.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/useMatch-DYOY33wl.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/link-DIpiSYJj.js">
15
+ <link rel="modulepreload" crossorigin href="/assets/CliIcon-CFObB9XW.js">
16
+ <link rel="modulepreload" crossorigin href="/assets/tasks-C1wf85BJ.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/governance-BbogC_X-.js">
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-BoTts74M.css">
19
19
  </head>
20
20
  <body class="antialiased">
@@ -1 +0,0 @@
1
- import{Cn as e,Rt as t,x as n}from"./format-qPQgH1PF.js";import{D as r,n as i,r as a,t as o,v as s}from"./index-BfZnvrmA.js";var c=e(),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:e}){let u=t(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=n(),h=i(f,d);if(h===null)return e;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{Cn as e,Dn as t,R as n,V as r,_ as i,b as a,c as o,gt as s,jt as c,k as l,nn as u,st as d,t as f,wn as p,x as m}from"./format-qPQgH1PF.js";import{s as h}from"./compose-BCqmtrsZ.js";import{t as g}from"./link-DF__7B1f.js";import{S as _,i as v,k as y,s as b}from"./index-BfZnvrmA.js";import{i as x}from"./ThreadForms-Bciw71n3.js";import{t as S}from"./ChannelForms-mdOuU6eZ.js";import{t as C}from"./MessageItem-Dtpufq_V.js";import{n as w,t as T}from"./Pane-L4GJKBiw.js";import{n as E}from"./ThreadCard-CkqMOMDh.js";import{t as D}from"./useStickyScroll-BFNyJYps.js";var O=t(p(),1),k=/^Knowledge (written|updated|removed): ([a-z0-9][a-z0-9-]{0,31})\. It is (?:no longer )?under knowledge\/\2\.md( of the society)?\.$/;function A(e){if(e.notice!==void 0)return e.notice;let t=e.thread===void 0?k.exec(e.body.trim()):null;if(t===null)return null;let{project:n,channel:r}=c(e.channel);if(r!==`general`||t[3]!==void 0!=(n===null))return null;let i=d.safeParse({kind:`knowledge`,action:t[1],topic:t[2],project:n});return i.success?i.data:null}function j(e,t){let n=e.notices.at(-1);return n!==void 0&&n.kind===`knowledge`&&t.kind===`knowledge`&&n.action!==`removed`&&t.action===`updated`&&n.topic===t.topic&&n.project===t.project}function M(e,t){let n=[],r=null;for(let i of e){let e=t(i),a=e===void 0?null:A(e);e===void 0||a===null?(n.push({kind:`item`,item:i}),r=null):r!==null&&j(r,a)?(r.messages.push(e),r.notices.push(a)):(r={messages:[e],notices:[a]},n.push({kind:`notices`,run:r}))}return n}function N(e){let[t]=e,n=e.length-1;return t===void 0||t.action===`removed`?{did:`removed`,times:null}:t.action===`written`?{did:`wrote`,times:n===0?null:`then updated it ${n===1?`once`:`${n} times`}`}:{did:`updated`,times:n===0?null:`${e.length} times`}}function P(e){let t=[...new Set(e)];return t.length<=2?t.join(` and `):`${t.slice(0,-1).join(`, `)}, and ${t.at(-1)??``}`}var F=e();function I(){return(0,F.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5`,children:(0,F.jsx)(`path`,{d:`M8 4.2C6.4 3 4.4 2.8 2.2 3.4v9.2c2.2-.6 4.2-.4 5.8.8m0-9.2c1.6-1.2 3.6-1.4 5.8-.8v9.2c-2.2-.6-4.2-.4-5.8.8m0-9.2v9.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinejoin:`round`})})}function L({notices:e}){let[t]=e;if(t===void 0)return null;let{did:n,times:r}=N(e);return(0,F.jsxs)(F.Fragment,{children:[n,` knowledge`,` `,t.action===`removed`?(0,F.jsx)(`span`,{className:`text-fg-secondary`,children:t.topic}):(0,F.jsx)(g,{to:`/knowledge/$scope/$topic`,params:{scope:t.project??`society`,topic:t.topic},className:`text-fg-secondary hover:text-fg-primary`,children:t.topic}),r===null?null:` · ${r}`]})}function R(e){let t=e.notices.filter(e=>e.kind===`knowledge`);return{mark:(0,F.jsx)(I,{}),text:(0,F.jsx)(L,{notices:t})}}function z({run:e,now:t}){let n=b(),r=e.messages.at(-1);if(r===void 0)return null;let{mark:i,text:a}=R(e);return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-1 text-meta`,children:[(0,F.jsx)(`span`,{className:`grid w-7 shrink-0 place-items-center text-fg-muted`,children:i}),(0,F.jsxs)(`p`,{className:`min-w-0 flex-1 truncate`,children:[P(e.messages.map(e=>n(e.author))),` `,a]}),(0,F.jsx)(`time`,{dateTime:r.ts,title:e.messages.map(e=>`${n(e.author)} ${e.ts}`).join(`
2
- `),className:`shrink-0`,children:f(r.ts,t)})]})}function B(){let{_splat:e=`general`}=y({from:`/c/$`});return(0,F.jsx)(V,{channel:e},e)}function V({channel:e}){let{api:t}=l(),c=u({queryKey:[`channel`,e],queryFn:()=>t.channel(e)}),d=n(),p=i(),g=m(),y=o(),b=a(3e4),[k,A]=(0,O.useState)(!1),[j,N]=(0,O.useState)(!1),P=(0,O.useMemo)(()=>{let t=(c.data??[]).map(e=>({kind:`message`,at:e.ts,id:e.id,message:e})),n=(d.data??[]).filter(t=>t.channel===e).map(e=>({kind:`thread`,at:e.openedAt,id:e.id,thread:e}));return[...t,...n].toSorted((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id))},[c.data,d.data,e]),I=(0,O.useMemo)(()=>M(P,e=>e.kind===`message`?e.message:void 0),[P]),L=c.data?.at(-1)?.id??null;(0,O.useEffect)(()=>_(e,L),[e,L]);let{ref:R,onScroll:B}=D(),[V,H]=e.split(`/`),U=H??V??e,W=H===void 0?void 0:g.data?.find(e=>e.slug===V),G=H===void 0?`society`:W?.name??V,K=y.data?.find(t=>t.ref===e)?.archived,q=W?.archived!==void 0||K!==void 0,J=!q&&!s(H===void 0?null:V??null,U),Y=P.filter(e=>e.kind===`thread`&&e.thread.state===`open`);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(T,{title:`# ${U}`,subtitle:`${G} · ${c.data?.length??0} messages${Y.length>0?` · ${Y.length} open threads`:``}`,trailing:k||j||q?null:(0,F.jsxs)(F.Fragment,{children:[J?(0,F.jsx)(h,{onClick:()=>N(!0),children:`Archive…`}):null,(0,F.jsx)(h,{onClick:()=>A(!0),children:`New thread`})]})}),k?(0,F.jsx)(x,{channel:e,onDone:()=>A(!1)}):null,j?(0,F.jsx)(S,{channel:e,onDone:()=>N(!1)}):null,(0,F.jsx)(`div`,{ref:R,onScroll:B,className:`flex-1 overflow-y-auto py-2`,children:c.error instanceof r&&c.error.status===404?(0,F.jsxs)(w,{children:[`There is no channel `,e,`.`]}):c.data===void 0?(0,F.jsx)(w,{children:`Reading the channel…`}):P.length===0?(0,F.jsx)(w,{children:`Nothing has been said here yet.`}):I.map(e=>{if(e.kind===`notices`){let t=e.run.messages[0]?.id??``;return(0,F.jsx)(z,{run:e.run,now:b},t)}let{item:t}=e;return t.kind===`message`?(0,F.jsx)(C,{message:t.message,members:p.data,now:b},t.id):(0,F.jsx)(E,{thread:t.thread,now:b},t.id)})}),c.data===void 0?null:K===void 0?q?(0,F.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[G,` is archived, so its channels are read-only.`]}):(0,F.jsx)(v,{target:{channel:e},placeholder:`Message #${U}`}):(0,F.jsxs)(`p`,{className:`border-t border-line px-4 py-3 text-meta`,children:[`Archived `,f(K.at,b),` by `,K.by,`: `,K.reason,`. Its posts, threads, and tasks stay readable; nothing more is posted or filed here.`]})]})}export{B as ChannelView};
@@ -1 +0,0 @@
1
- import{Cn as e,Dn as t,M as n,R as r,Sn as i,_ as a,b as o,ft as s,k as c,l,t as u,wn as d,wt as f,x as p}from"./format-qPQgH1PF.js";import{l as m,s as h}from"./compose-BCqmtrsZ.js";import{t as g}from"./link-DF__7B1f.js";import{t as _}from"./CliIcon-Cyv7ef-2.js";import{C as v,E as y,O as b,T as x,w as S}from"./index-BfZnvrmA.js";import{n as C,r as w}from"./ThreadForms-Bciw71n3.js";import{t as T}from"./Markdown-CI8CWgHq.js";import{n as E,t as D}from"./Pane-L4GJKBiw.js";import{a as O,i as k,l as A}from"./citizen-Cyd1haJO.js";import{n as j,r as M,t as N}from"./Picker-h6akABv6.js";var P=t(d(),1),F=e(),I=[`UTC`,...Intl.supportedValuesOf(`timeZone`).filter(e=>e!==`UTC`)],L=50;function R(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``;return n===`GMT`?`UTC`:n.replace(`GMT`,`UTC`)}function z({value:e,onChange:t,label:n,placeholder:r}){let[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(0),c=(0,P.useRef)(null),l=(0,P.useRef)([]),u=e.trim().toLowerCase(),d=(0,P.useMemo)(()=>(u===``?I:I.filter(e=>e.toLowerCase().includes(u))).slice(0,L),[u]),f=(0,P.useMemo)(()=>new Date,[]);(0,P.useEffect)(()=>{i&&l.current[o]?.scrollIntoView({block:`nearest`})},[i,o]),(0,P.useEffect)(()=>{if(!i)return;let e=e=>{e.target instanceof Node&&c.current?.contains(e.target)===!0||a(!1)};return window.addEventListener(`click`,e),()=>window.removeEventListener(`click`,e)},[i]);let p=e=>{t(e),a(!1)};return(0,F.jsxs)(`div`,{ref:c,className:`relative min-w-0 flex-1`,children:[(0,F.jsx)(`input`,{"aria-label":n,value:e,spellCheck:!1,autoComplete:`off`,placeholder:r,onChange:e=>{t(e.target.value),s(0),a(!0)},onClick:()=>a(!0),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!i){a(!0);return}let t=e.key===`ArrowDown`?1:-1;s(e=>(e+t+d.length)%Math.max(d.length,1));return}if(e.key===`Enter`&&i&&d[o]!==void 0){e.preventDefault(),p(d[o]);return}if(e.key===`Tab`){a(!1);return}e.key===`Escape`&&i&&(e.preventDefault(),e.stopPropagation(),a(!1))},className:C}),i&&d.length>0&&(d.length!==1||d[0]!==e)?(0,F.jsx)(`div`,{className:`max-h-48 ${N}`,children:d.map((e,t)=>(0,F.jsxs)(`button`,{ref:e=>{l.current[t]=e},type:`button`,tabIndex:-1,"aria-current":t===o?`true`:void 0,onPointerDown:e=>e.preventDefault(),onPointerEnter:()=>s(t),onClick:()=>p(e),className:M(t===o),children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-secondary`,children:e}),(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-fg-muted`,children:R(e,f)})]},e))}):null]})}function B({word:e,children:t}){return(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`shrink-0 text-xs text-fg-tertiary`,children:e}),t]})}function V(e,t){return f(typeof e==`string`?new Date(e):e,t)}function H({cron:e}){let t=r(),n=S(e);if(n.kind===`thread`){let e=t.data?.find(e=>e.id===n.id)?.title??n.id;return(0,F.jsxs)(g,{to:`/thread/$threadId`,params:{threadId:n.id},className:`truncate hover:text-fg-primary`,children:[`thread “`,e,`”`]})}return n.kind===`channel`?(0,F.jsxs)(g,{to:`/c/$`,params:{_splat:n.ref},className:`hover:text-fg-primary`,children:[`#`,n.ref]}):(0,F.jsxs)(`span`,{children:[`home at `,O(n.scope)]})}function U({cron:e,next:t,member:n,zone:r,now:a,focused:o}){let s=(0,P.useRef)(null);(0,P.useEffect)(()=>{o&&s.current!==null&&(s.current.open=!0,s.current.scrollIntoView({block:`nearest`}))},[o]);let{api:l}=c(),d=i(),[f,p]=(0,P.useState)(!1),[v,y]=(0,P.useState)(``),b=()=>void d.invalidateQueries({queryKey:[`crons`]}),S=m({mutationFn:t=>l.pauseCron(e.id,t),onSuccess:b}),E=m({mutationFn:()=>l.removeCron(e.id,v.trim()),onSuccess:b}),D=`at`in e.schedule?`once, ${V(e.schedule.at,r)}`:`${e.schedule.cron} · ${e.schedule.timezone??r}`,O=e.ended===void 0?e.paused===void 0?t===null?`no time to come`:t.getTime()<=a?`due, waiting for its turn`:u(t.toISOString(),a):`paused`:`ended ${u(e.ended.at,a)}`,k=x(e);return(0,F.jsx)(`li`,{className:`rounded-lg ${o?`bg-surface-2/30`:``}`,children:(0,F.jsxs)(`details`,{ref:s,className:`group`,children:[(0,F.jsxs)(`summary`,{className:`cursor-pointer list-none rounded-lg px-2 py-2 hover:bg-surface-2/40 focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[n?.cli===void 0||n.cli===null?null:(0,F.jsx)(_,{cli:n.cli,size:13}),(0,F.jsx)(`span`,{className:`shrink-0 text-fg-secondary`,children:e.agent}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-primary`,children:e.title}),(0,F.jsx)(`span`,{className:`shrink-0 text-xs ${e.paused===void 0?`text-fg-muted`:`text-amber-300`}`,title:t===null?void 0:`${V(t,r)}, ${r}`,children:O})]}),(0,F.jsxs)(`p`,{className:`mt-0.5 flex items-baseline gap-1.5 truncate text-meta`,children:[(0,F.jsx)(`span`,{children:D}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsx)(H,{cron:e}),e.lastRun===void 0?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsxs)(`span`,{children:[`last turn `,e.lastRun.outcome,` `,u(e.lastRun.at,a)]})]}),k?(0,F.jsxs)(`span`,{className:`text-amber-300`,children:[`· `,e.failures,` failed in a row`]}):null]})]}),(0,F.jsxs)(`div`,{className:`space-y-3 px-2 pt-1 pb-3`,children:[(0,F.jsx)(`div`,{className:`rounded-lg bg-surface-2/30 px-3 py-2`,children:(0,F.jsx)(T,{text:e.note})}),(0,F.jsxs)(`p`,{className:`text-meta`,children:[`Set by `,e.createdBy,` `,u(e.createdAt,a),e.lastFiredAt===void 0?``:` · fired last ${V(e.lastFiredAt,r)}`,e.ended===void 0?``:` · ended by ${e.ended.by}: ${e.ended.reason}`]}),t===null?null:(0,F.jsxs)(`p`,{className:`text-meta`,children:[`Next `,V(t,r),` (`,r,`)`]}),e.lastRun===void 0?null:(0,F.jsx)(g,{to:`/citizen/$name`,params:{name:e.agent},search:{tab:`turns`,turn:e.lastRun.turnId},className:`text-meta underline-offset-2 hover:text-fg-primary hover:underline`,children:`Open its last turn`}),e.ended===void 0?f?(0,F.jsxs)(`form`,{"aria-label":`Remove ${e.title}`,className:`space-y-2`,onSubmit:e=>{e.preventDefault(),E.mutate()},children:[(0,F.jsx)(`input`,{value:v,"aria-label":`Why it ends`,placeholder:`Why it ends, which the cron keeps`,onChange:e=>y(e.target.value),className:C}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(h,{onClick:()=>p(!1),children:`Cancel`}),(0,F.jsx)(h,{variant:`primary`,type:`submit`,disabled:E.isPending||v.trim()===``,children:E.isPending?`Removing…`:`Remove cron`})]}),(0,F.jsx)(w,{error:E.error})]}):(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(h,{onClick:()=>S.mutate(e.paused===void 0),disabled:S.isPending,children:e.paused===void 0?`Pause`:`Resume`}),(0,F.jsx)(h,{onClick:()=>p(!0),children:`Remove…`}),(0,F.jsx)(w,{error:S.error})]}):null]})]})})}function W({zone:e,onDone:t}){let{api:n}=c(),r=i(),[a,o]=(0,P.useState)(e),s=new Intl.DateTimeFormat().resolvedOptions().timeZone,l=m({mutationFn:()=>n.setTimezone(a.trim()),onSuccess:()=>{r.invalidateQueries({queryKey:[`society`]}),r.invalidateQueries({queryKey:[`crons`]}),t()}});return(0,F.jsxs)(`form`,{"aria-label":`Time zone`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),l.mutate()},children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,F.jsx)(z,{value:a,onChange:o,label:`Society time zone`}),s===a?null:(0,F.jsxs)(h,{onClick:()=>o(s),children:[`Use `,s]})]}),(0,F.jsx)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:`Crons that name no zone are read in it, so their times move with it, and every turn's prompt tells the time in it.`}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(h,{onClick:t,children:`Cancel`}),(0,F.jsx)(h,{variant:`primary`,type:`submit`,disabled:l.isPending||a.trim()===``||a.trim()===e,children:l.isPending?`Saving…`:`Save`})]}),(0,F.jsx)(w,{error:l.error})]})}function G({members:e,preferred:t,zone:r,onDone:a}){let{api:l}=c(),u=i(),d=p(),f=n(),[g,_]=(0,P.useState)(e.find(e=>e.name===t)?.name??e[0]?.name??``),v=e.find(e=>e.name===g),b=v===void 0?[]:A(v),[x,S]=(0,P.useState)(b[0]??`society`),[T,E]=(0,P.useState)(``),[D,O]=(0,P.useState)(`repeats`),[M,N]=(0,P.useState)(`0 9 * * 1-5`),[I,L]=(0,P.useState)(``),[R,H]=(0,P.useState)(``),[U,W]=(0,P.useState)(``),[G,K]=(0,P.useState)(``),q=(0,P.useRef)(null);(0,P.useEffect)(()=>q.current?.focus(),[]);let J=o(3e4),Y=(x===`society`?f.data?.channels??[]:d.data?.find(e=>e.slug===x)?.channels??[]).filter(e=>e!==`general`),X=D===`repeats`?{cron:M,...I.trim()===``?{}:{timezone:I.trim()}}:{at:R===``?``:new Date(R).toISOString()},Z=y(D===`once`&&R===``?{at:`invalid`}:X,r,new Date(J)),Q=D===`repeats`?I.trim()===``?r:I.trim():r,$=m({mutationFn:()=>l.createCron({agent:g,title:U.trim(),note:G.trim(),project:x,...T===``?{}:{channel:T},...X}),onSuccess:()=>{u.invalidateQueries({queryKey:[`crons`]}),a()}});return(0,F.jsxs)(`form`,{"aria-label":`New cron`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),$.mutate()},children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(B,{word:`wakes`,children:(0,F.jsx)(j,{label:`Citizen`,choices:e.map(e=>({value:e.name,name:e.name,id:e.role,description:e.memberships.length===0?`in no project`:`in ${e.memberships.join(`, `)}`})),value:g,onChange:t=>{let n=e.find(e=>e.name===t);_(t),S(n===void 0?s:A(n)[0]??`society`),E(``)}})}),(0,F.jsx)(B,{word:`at`,children:(0,F.jsx)(j,{label:`Where`,choices:k(b),value:x,onChange:e=>{S(e),E(``)}})}),(0,F.jsx)(B,{word:`in`,children:(0,F.jsx)(j,{label:`Conversation`,choices:[{value:``,name:`its home`,id:null,description:`general, and work tied to no other channel`},...Y.map(e=>({value:e,name:`#${e}`,id:null,description:`a workstream's own conversation`}))],value:T,onChange:E})})]}),(0,F.jsx)(`input`,{ref:q,value:U,maxLength:120,"aria-label":`Title`,placeholder:`Title, such as Morning report`,onChange:e=>W(e.target.value),className:C}),(0,F.jsx)(`textarea`,{value:G,rows:3,"aria-label":`Note`,placeholder:`What to do when it fires; the citizen reads this in every turn it starts.`,onChange:e=>K(e.target.value),className:`${C} resize-none`}),(0,F.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,F.jsx)(`legend`,{className:`sr-only`,children:`How often`}),[`repeats`,`once`].map(e=>(0,F.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 ${D===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,F.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:D===e,onChange:()=>O(e),className:`sr-only`}),e===`repeats`?`Repeats`:`Once`]},e))]}),D===`repeats`?(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,F.jsx)(`div`,{className:`w-44 shrink-0`,children:(0,F.jsx)(`input`,{value:M,spellCheck:!1,"aria-label":`Cron expression`,placeholder:`minute hour day month weekday`,onChange:e=>N(e.target.value),className:C})}),(0,F.jsx)(z,{value:I,onChange:L,label:`Its time zone`,placeholder:`${r}, the society's`})]}):(0,F.jsx)(`input`,{type:`datetime-local`,value:R,"aria-label":`When, in this browser's time`,onChange:e=>H(e.target.value),className:C}),(0,F.jsxs)(`p`,{"aria-live":`polite`,className:`text-[11px] leading-relaxed text-fg-muted`,children:[`error`in Z?(0,F.jsx)(`span`,{className:`text-amber-300`,children:Z.error}):(0,F.jsxs)(F.Fragment,{children:[Z.times.length===1?`Fires `:`Fires next `,Z.times.map(e=>V(e,Q)).join(`, `),` (`,Q,`).`]}),` `,`Each fire is a turn for `,g===``?`the citizen`:g,`, which costs money.`]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(h,{onClick:a,children:`Cancel`}),(0,F.jsx)(h,{variant:`primary`,type:`submit`,disabled:$.isPending||g===``||U.trim()===``||G.trim()===``||`error`in Z,children:$.isPending?`Setting…`:`Set cron`})]}),(0,F.jsx)(w,{error:$.error})]})}function K(){let{agent:e,cron:t}=b({from:`/crons`}),r=l(),i=a(),s=n(),c=o(3e4),[u,d]=(0,P.useState)(null),f=s.data?.timezone??`UTC`,p=(r.data??[]).filter(t=>e===void 0||t.agent===e),m=v(p,f),_=p.filter(x).length,y=(i.data??[]).filter(e=>e.status===`active`&&e.cli!==null),S=e=>i.data?.find(t=>t.name===e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(D,{title:e===void 0?`Crons`:`Crons of ${e}`,subtitle:[`${m.active.length} running`,...m.paused.length===0?[]:[`${m.paused.length} paused`],..._===0?[]:[`${_} failing`],`times in ${f}`].join(` · `),trailing:u===null?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(h,{onClick:()=>d(`zone`),children:`Time zone…`}),(0,F.jsx)(h,{onClick:()=>d(`new`),disabled:y.length===0,children:`New cron…`})]}):null}),u===`new`?(0,F.jsx)(G,{members:y,preferred:e,zone:f,onDone:()=>d(null)}):u===`zone`?(0,F.jsx)(W,{zone:f,onDone:()=>d(null)}):null,(0,F.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[e===void 0?null:(0,F.jsx)(g,{to:`/crons`,className:`block px-2 pb-2 text-meta hover:text-fg-primary`,children:`Show every citizen's crons`}),r.error!==null&&r.data===void 0?(0,F.jsxs)(E,{children:[`The board server did not list its crons (`,r.error.message,`); one older than this interface has none.`]}):r.data===void 0?(0,F.jsx)(E,{children:`Reading the crons…`}):m.active.length+m.paused.length+m.ended.length===0?(0,F.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No crons yet. A citizen sets one with create_cron when it needs to come back to something later; you can set one for any citizen here.`}):null,m.active.length===0?null:(0,F.jsx)(`ul`,{"aria-label":`Running`,className:`space-y-0.5`,children:m.active.map(({cron:e,next:n})=>(0,F.jsx)(U,{cron:e,next:n,member:S(e.agent),zone:f,now:c,focused:e.id===t},e.id))}),m.paused.length===0?null:(0,F.jsxs)(`section`,{"aria-label":`Paused`,className:`mt-3`,children:[(0,F.jsx)(`h3`,{className:`px-2 pb-1 text-section`,children:`Paused`}),(0,F.jsx)(`ul`,{className:`space-y-0.5`,children:m.paused.map(e=>(0,F.jsx)(U,{cron:e,next:null,member:S(e.agent),zone:f,now:c,focused:e.id===t},e.id))})]}),m.ended.length===0?null:(0,F.jsxs)(`details`,{className:`mt-3`,open:m.ended.some(e=>e.id===t),children:[(0,F.jsxs)(`summary`,{className:`cursor-pointer px-2 pb-1 text-section`,children:[`Ended (`,m.ended.length,`)`]}),(0,F.jsx)(`ul`,{"aria-label":`Ended`,className:`space-y-0.5`,children:m.ended.map(e=>(0,F.jsx)(U,{cron:e,next:null,member:S(e.agent),zone:f,now:c,focused:e.id===t},e.id))})]})]})]})}export{K as CronsView};
@@ -1 +0,0 @@
1
- import{Cn as e,Dn as t,M as n,T as r,_ as i,b as a,c as o,ft as s,h as c,j as l,kt as u,wn as d,x as f}from"./format-qPQgH1PF.js";import{s as p}from"./compose-BCqmtrsZ.js";import{n as m,r as h}from"./ChannelForms-mdOuU6eZ.js";import{n as g,t as _}from"./Pane-L4GJKBiw.js";import{n as v,r as y,t as b}from"./Overview-BMatmD0p.js";var x=t(d(),1),S=e();function C(){let e=n(),t=i(),d=f(),C=r(),w=l(),T=c(s),E=o(),D=a(3e4),[O,k]=(0,x.useState)(!1);if(e.data===void 0||t.data===void 0)return(0,S.jsx)(g,{children:`Reading the society…`});let A=t.data.filter(e=>e.cli!==null),j=A.filter(e=>e.status===`active`),M=A.filter(e=>e.status===`retired`),N=(C.data??[]).filter(e=>e.name!==u);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_,{title:e.data.name,subtitle:`${j.length} citizens · ${d.data?.length??0} projects · ${N.length} roles`}),O?(0,S.jsx)(h,{project:null,onDone:()=>k(!1)}):null,(0,S.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,S.jsxs)(v,{title:`Citizens`,children:[(0,S.jsx)(b,{members:j,scope:s}),M.length===0?null:(0,S.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,M.map(e=>e.name).join(`, `)]})]}),(0,S.jsx)(v,{title:`Channels`,aside:O?null:(0,S.jsx)(p,{onClick:()=>k(!0),children:`New channel…`}),children:(0,S.jsx)(m,{channels:(E.data??[]).filter(e=>e.project===null),now:D})}),(0,S.jsx)(v,{title:`Roles`,children:(0,S.jsx)(`ul`,{className:`space-y-2.5`,children:N.map(e=>{let t=j.filter(t=>t.role===e.name).length;return(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,S.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,S.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,S.jsx)(v,{title:`Knowledge`,children:(0,S.jsx)(y,{scope:s,topics:T.data,now:D})}),(0,S.jsx)(v,{title:`Skills`,children:w.data===void 0?(0,S.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):w.data.length===0?(0,S.jsx)(`p`,{className:`text-meta`,children:`None yet. A citizen's skill joins the society by proposal.`}):(0,S.jsx)(`ul`,{className:`space-y-1.5`,children:w.data.map(e=>(0,S.jsxs)(`li`,{className:`text-sm`,children:[(0,S.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,S.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})})]})]})}export{C as SocietyView};
@@ -1 +0,0 @@
1
- import{Cn as e,Dn as t,Sn as n,T as r,V as i,_ as a,k as o,wn as s}from"./format-qPQgH1PF.js";import{c,l,n as u,o as d,s as f}from"./compose-BCqmtrsZ.js";var p=t(s(),1),m=e(),h=`block w-full rounded-lg bg-surface-2/50 px-3 py-2 text-sm text-fg-primary outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] placeholder:text-fg-muted focus:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.16)]`;function g({error:e}){return e===null?null:(0,m.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:e instanceof i?e.message:`The board did not take it.`})}function _({channel:e,onDone:t}){let{api:i}=o(),s=n(),_=c(),v=a(),y=r(),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(``),w=(0,p.useRef)(null);(0,p.useEffect)(()=>w.current?.focus(),[]);let T=l({mutationFn:async()=>{let t=await i.openThread({channel:e,title:b.trim()});return S.trim()!==``&&await i.sendMessage({thread_id:t.id,body:S.trim()}),t},onSuccess:e=>{s.invalidateQueries({queryKey:[`threads`]}),t(),_({to:`/thread/$threadId`,params:{threadId:e.id}})}}),E=S.trim()===``?[]:d(S,v.data??[],y.data??[]);return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),T.mutate()},children:[(0,m.jsx)(`input`,{ref:w,value:b,maxLength:200,placeholder:`What is the thread about?`,"aria-label":`Thread title`,onChange:e=>x(e.target.value),className:h}),(0,m.jsx)(`textarea`,{value:S,rows:3,placeholder:`First message, optional`,"aria-label":`First message`,onChange:e=>C(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-fg-muted`,children:E.length>0?`The first message wakes ${u(E)}.`:`Only its participants and anyone mentioned will read it.`}),(0,m.jsx)(f,{onClick:t,children:`Cancel`}),(0,m.jsx)(f,{variant:`primary`,type:`submit`,disabled:b.trim()===``||T.isPending,children:T.isPending?`Opening…`:`Open thread`})]}),(0,m.jsx)(g,{error:T.error})]})}function v({threadId:e,channel:t,onDone:r}){let{api:i}=o(),a=n(),[s,c]=(0,p.useState)(``),u=(0,p.useRef)(null);(0,p.useEffect)(()=>u.current?.focus(),[]);let d=l({mutationFn:()=>i.closeThread({thread_id:e,summary:s.trim()}),onSuccess:()=>{for(let n of[[`thread`,e],[`threads`],[`channel`,t]])a.invalidateQueries({queryKey:n});r()}});return(0,m.jsxs)(`form`,{className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),d.mutate()},children:[(0,m.jsx)(`textarea`,{ref:u,value:s,rows:3,placeholder:`What did it settle? The summary is posted to #${t}.`,"aria-label":`Closing summary`,onChange:e=>c(e.target.value),className:`${h} resize-none`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(f,{onClick:r,children:`Cancel`}),(0,m.jsx)(f,{variant:`primary`,type:`submit`,disabled:s.trim()===``||d.isPending,children:d.isPending?`Closing…`:`Close thread`})]}),(0,m.jsx)(g,{error:d.error})]})}export{_ as i,h as n,g as r,v as t};