@kubitnodes/stellaris 0.4.1 → 0.4.2
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 +603 -18
- package/dist/server/index.js +744 -60
- package/package.json +1 -1
- package/web/dist/assets/BackLink-DNHWkHmh.js +1 -0
- package/web/dist/assets/{Button-DxGzriWQ.js → Button-B6EN7Lh7.js} +1 -1
- package/web/dist/assets/ChannelForms-BrcWrkej.js +1 -0
- package/web/dist/assets/{ChannelView-DvtoxLi5.js → ChannelView-D7bT7d9q.js} +2 -2
- package/web/dist/assets/CitizenView-D6d1KnS6.js +2 -0
- package/web/dist/assets/{CitizensView-BOZHABbN.js → CitizensView-C55zOiYE.js} +1 -1
- package/web/dist/assets/{CliIcon-D3GddnP4.js → CliIcon-BRq1tnhu.js} +1 -1
- package/web/dist/assets/CronsView-BTGiqn10.js +1 -0
- package/web/dist/assets/{FileTree-DSFN4sd8.js → FileTree-BDhtTIzT.js} +1 -1
- package/web/dist/assets/{FileView-DyUYLXRC.js → FileView-BkZPGEbO.js} +2 -2
- package/web/dist/assets/{KnowledgeView-CMdXaTvS.js → KnowledgeView-BiTS-lyE.js} +1 -1
- package/web/dist/assets/{Markdown-BSeWHBBA.js → Markdown-DYk-gVwe.js} +5 -5
- package/web/dist/assets/{MessageItem-qIxS96uJ.js → MessageItem-WBBIzv48.js} +1 -1
- package/web/dist/assets/MetricsView-CYmnG6aQ.js +1 -0
- package/web/dist/assets/NeedsYouView-B-5olhZL.js +1 -0
- package/web/dist/assets/Overview-BO_lR1cu.js +1 -0
- package/web/dist/assets/{Pane-pZUzNQIW.js → Pane-DFJdAhv9.js} +1 -1
- package/web/dist/assets/{Picker-CDf6os_x.js → Picker-CAEREZF9.js} +1 -1
- package/web/dist/assets/ProjectView-LU59V2vh.js +1 -0
- package/web/dist/assets/ProposalView-DHemTlkc.js +1 -0
- package/web/dist/assets/{ProposalsView-DBGpcAPO.js → ProposalsView-DBIOJAul.js} +1 -1
- package/web/dist/assets/{Quota-Brd4ddB4.js → Quota-D6_yyawu.js} +1 -1
- package/web/dist/assets/{RunnersView-45OXtalD.js → RunnersView-BNKgYuNw.js} +1 -1
- package/web/dist/assets/{SkillFileList-BUImALv9.js → SkillFileList-Ntyv8noL.js} +1 -1
- package/web/dist/assets/SkillView-Dez1fvqU.js +1 -0
- package/web/dist/assets/SocietyView-CbmbQXHi.js +1 -0
- package/web/dist/assets/{StickyList-D_ED_-LW.js → StickyList-Q0KEWBUl.js} +1 -1
- package/web/dist/assets/{SubjectThread-B5zvoRSd.js → SubjectThread-1PnxxtZc.js} +1 -1
- package/web/dist/assets/{TaskView-B5_QTI3p.js → TaskView-CcIlNHBh.js} +2 -2
- package/web/dist/assets/TasksView-BkTU43PD.js +1 -0
- package/web/dist/assets/{ThreadForms-CbFClyd0.js → ThreadForms-BlOEvY5E.js} +1 -1
- package/web/dist/assets/ThreadItem-D5N_Fw1K.js +1 -0
- package/web/dist/assets/{ThreadView-CHFs0zaS.js → ThreadView-BaYV77mQ.js} +1 -1
- package/web/dist/assets/{citizen-B8p56JRh.js → citizen-BRg9UIgD.js} +1 -1
- package/web/dist/assets/{compose-CV4o6TMb.js → compose-BnOoMY1c.js} +1 -1
- package/web/dist/assets/format-hyYD8qd8.js +55 -0
- package/web/dist/assets/governance-D4hlG-xw.js +1 -0
- package/web/dist/assets/index-5CbC_NpF.js +24 -0
- package/web/dist/assets/{index-CA_njyMe.css → index-vxBI4BYp.css} +1 -1
- package/web/dist/assets/{mentions-BH0RZXfc.js → mentions-Ckktc7nR.js} +1 -1
- package/web/dist/assets/{tasks-D2Es55TQ.js → tasks-CFVtN9TK.js} +1 -1
- package/web/dist/assets/{useMatch-DeOpK57G.js → useMatch-BCaBBHc2.js} +1 -1
- package/web/dist/favicon.svg +89 -4
- package/web/dist/index.html +9 -9
- package/web/dist/assets/BackLink-fxPmFUg8.js +0 -1
- package/web/dist/assets/ChannelForms-C3m4IPnZ.js +0 -1
- package/web/dist/assets/CitizenView-Dq64VsZi.js +0 -2
- package/web/dist/assets/CronsView-CI947lZS.js +0 -1
- package/web/dist/assets/MetricsView-BhjdwkX1.js +0 -1
- package/web/dist/assets/NeedsYouView-7uZW9dY8.js +0 -1
- package/web/dist/assets/Overview-D6kiK8sE.js +0 -1
- package/web/dist/assets/ProjectView-B6OmxiT9.js +0 -1
- package/web/dist/assets/ProposalView-B1X8Jlo0.js +0 -1
- package/web/dist/assets/SkillView-B1knYZV8.js +0 -1
- package/web/dist/assets/SocietyView-F7bzrNv5.js +0 -1
- package/web/dist/assets/TasksView-DZLNqU2V.js +0 -1
- package/web/dist/assets/ThreadItem-kFn5M3Cx.js +0 -1
- package/web/dist/assets/format-BYF63sQU.js +0 -55
- package/web/dist/assets/governance-BjIg0eok.js +0 -1
- package/web/dist/assets/index-CyROMh25.js +0 -24
package/web/dist/favicon.svg
CHANGED
|
@@ -1,5 +1,90 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="ground" x1="50%" y1="0%" x2="50%" y2="100%">
|
|
4
|
+
<stop offset="0" stop-color="#242830"/>
|
|
5
|
+
<stop offset="1" stop-color="#11141a"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="1024" height="1024" rx="224" fill="url(#ground)"/>
|
|
9
|
+
<g id="03-meteor-right" opacity="0.65">
|
|
10
|
+
<defs>
|
|
11
|
+
<linearGradient id="color-03-meteor-right" gradientUnits="userSpaceOnUse" x1="890" y1="442" x2="640" y2="590">
|
|
12
|
+
<stop offset="0" stop-color="#bcb1f4" stop-opacity="0"/>
|
|
13
|
+
<stop offset="0.35" stop-color="#bcb1f4" stop-opacity="0.14"/>
|
|
14
|
+
<stop offset="0.7" stop-color="#b8d5f3" stop-opacity="0.55"/>
|
|
15
|
+
<stop offset="1" stop-color="#dffff8" stop-opacity="0.95"/>
|
|
16
|
+
</linearGradient>
|
|
17
|
+
</defs>
|
|
18
|
+
<path d="M890 442 L634.498211 580.706437 Q634.836909 593.05655 645.501789 599.293563 Z" fill="url(#color-03-meteor-right)" opacity="0.2"/>
|
|
19
|
+
<path d="M890 442 L638.013243 586.643991 Q634.836909 593.05655 641.986757 593.356009 Z" fill="url(#color-03-meteor-right)"/>
|
|
20
|
+
<circle cx="640" cy="590" r="6" fill="#c9eee9" opacity="0.5"/>
|
|
21
|
+
<circle cx="640" cy="590" r="2.7" fill="#f4fffc"/>
|
|
22
|
+
</g>
|
|
23
|
+
<g id="02-meteor-lower" opacity="0.75">
|
|
24
|
+
<defs>
|
|
25
|
+
<linearGradient id="color-02-meteor-lower" gradientUnits="userSpaceOnUse" x1="425" y1="650" x2="130" y2="865">
|
|
26
|
+
<stop offset="0" stop-color="#bcb1f4" stop-opacity="0"/>
|
|
27
|
+
<stop offset="0.35" stop-color="#bcb1f4" stop-opacity="0.14"/>
|
|
28
|
+
<stop offset="0.7" stop-color="#b8d5f3" stop-opacity="0.55"/>
|
|
29
|
+
<stop offset="1" stop-color="#dffff8" stop-opacity="0.95"/>
|
|
30
|
+
</linearGradient>
|
|
31
|
+
</defs>
|
|
32
|
+
<path d="M425 650 L122.578778 854.817394 Q124.342997 869.122901 137.421222 875.182606 Z" fill="url(#color-02-meteor-lower)" opacity="0.2"/>
|
|
33
|
+
<path d="M425 650 L127.320114 861.322948 Q124.342997 869.122901 132.679886 868.677052 Z" fill="url(#color-02-meteor-lower)"/>
|
|
34
|
+
<circle cx="130" cy="865" r="7" fill="#c9eee9" opacity="0.5"/>
|
|
35
|
+
<circle cx="130" cy="865" r="3.15" fill="#f4fffc"/>
|
|
36
|
+
</g>
|
|
37
|
+
<g id="01-meteor-upper" opacity="1">
|
|
38
|
+
<defs>
|
|
39
|
+
<linearGradient id="color-01-meteor-upper" gradientUnits="userSpaceOnUse" x1="580" y1="10" x2="200" y2="235">
|
|
40
|
+
<stop offset="0" stop-color="#bcb1f4" stop-opacity="0"/>
|
|
41
|
+
<stop offset="0.35" stop-color="#bcb1f4" stop-opacity="0.14"/>
|
|
42
|
+
<stop offset="0.7" stop-color="#b8d5f3" stop-opacity="0.55"/>
|
|
43
|
+
<stop offset="1" stop-color="#dffff8" stop-opacity="0.95"/>
|
|
44
|
+
</linearGradient>
|
|
45
|
+
</defs>
|
|
46
|
+
<path d="M580 10 L191.746229 221.060299 Q192.255721 239.585428 208.253771 248.939701 Z" fill="url(#color-01-meteor-upper)" opacity="0.2"/>
|
|
47
|
+
<path d="M580 10 L197.019472 229.966219 Q192.255721 239.585428 202.980528 240.033781 Z" fill="url(#color-01-meteor-upper)"/>
|
|
48
|
+
<circle cx="200" cy="235" r="9" fill="#c9eee9" opacity="0.5"/>
|
|
49
|
+
<circle cx="200" cy="235" r="4.05" fill="#f4fffc"/>
|
|
50
|
+
</g>
|
|
51
|
+
<g id="06-star-lower" opacity="1">
|
|
52
|
+
<defs>
|
|
53
|
+
<linearGradient id="color-06-star-lower" x1="10%" y1="0%" x2="90%" y2="100%">
|
|
54
|
+
<stop offset="0" stop-color="#e4fcff"/>
|
|
55
|
+
<stop offset="0.24" stop-color="#d0c5ff"/>
|
|
56
|
+
<stop offset="0.42" stop-color="#fff9ff"/>
|
|
57
|
+
<stop offset="0.58" stop-color="#f7c8e9"/>
|
|
58
|
+
<stop offset="0.8" stop-color="#c0efeb"/>
|
|
59
|
+
<stop offset="1" stop-color="#fff1c3"/>
|
|
60
|
+
</linearGradient>
|
|
61
|
+
</defs>
|
|
62
|
+
<path d="M0 -1 C.12 -.33 .2 -.17 1 0 C.2 .17 .12 .33 0 1 C-.12 .33 -.2 .17 -1 0 C-.2 -.17 -.12 -.33 0 -1Z" transform="translate(720 760) rotate(-20) scale(130 150)" fill="url(#color-06-star-lower)"/>
|
|
63
|
+
</g>
|
|
64
|
+
<g id="05-star-upper" opacity="1">
|
|
65
|
+
<defs>
|
|
66
|
+
<linearGradient id="color-05-star-upper" x1="10%" y1="0%" x2="90%" y2="100%">
|
|
67
|
+
<stop offset="0" stop-color="#e4fcff"/>
|
|
68
|
+
<stop offset="0.24" stop-color="#d0c5ff"/>
|
|
69
|
+
<stop offset="0.42" stop-color="#fff9ff"/>
|
|
70
|
+
<stop offset="0.58" stop-color="#f7c8e9"/>
|
|
71
|
+
<stop offset="0.8" stop-color="#c0efeb"/>
|
|
72
|
+
<stop offset="1" stop-color="#fff1c3"/>
|
|
73
|
+
</linearGradient>
|
|
74
|
+
</defs>
|
|
75
|
+
<path d="M0 -1 C.12 -.33 .2 -.17 1 0 C.2 .17 .12 .33 0 1 C-.12 .33 -.2 .17 -1 0 C-.2 -.17 -.12 -.33 0 -1Z" transform="translate(725 265) rotate(19) scale(153 177)" fill="url(#color-05-star-upper)"/>
|
|
76
|
+
</g>
|
|
77
|
+
<g id="04-star-large" opacity="1">
|
|
78
|
+
<defs>
|
|
79
|
+
<linearGradient id="color-04-star-large" x1="10%" y1="0%" x2="90%" y2="100%">
|
|
80
|
+
<stop offset="0" stop-color="#e4fcff"/>
|
|
81
|
+
<stop offset="0.24" stop-color="#d0c5ff"/>
|
|
82
|
+
<stop offset="0.42" stop-color="#fff9ff"/>
|
|
83
|
+
<stop offset="0.58" stop-color="#f7c8e9"/>
|
|
84
|
+
<stop offset="0.8" stop-color="#c0efeb"/>
|
|
85
|
+
<stop offset="1" stop-color="#fff1c3"/>
|
|
86
|
+
</linearGradient>
|
|
87
|
+
</defs>
|
|
88
|
+
<path d="M0 -1 C.12 -.33 .2 -.17 1 0 C.2 .17 .12 .33 0 1 C-.12 .33 -.2 .17 -1 0 C-.2 -.17 -.12 -.33 0 -1Z" transform="translate(355 500) rotate(-14) scale(240 275)" fill="url(#color-04-star-large)"/>
|
|
89
|
+
</g>
|
|
5
90
|
</svg>
|
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-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/Button-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/useMatch-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/compose-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/CliIcon-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/tasks-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/governance-
|
|
17
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-5CbC_NpF.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/format-hyYD8qd8.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/Button-B6EN7Lh7.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/useMatch-BCaBBHc2.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/compose-BnOoMY1c.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/CliIcon-BRq1tnhu.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/tasks-CFVtN9TK.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/governance-D4hlG-xw.js">
|
|
17
|
+
<link rel="stylesheet" crossorigin href="/assets/index-vxBI4BYp.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body class="antialiased">
|
|
20
20
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Jn as e,S as t,tn as n}from"./format-BYF63sQU.js";import{O as r,n as i,r as a,t as o,v as s}from"./index-CyROMh25.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=n(),d=r({select:e=>e.location.state.__TSR_index}),f=a(),p=s(),m=t(),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 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,Qn as n,Yn as r,j as i,qn as a,t as o}from"./format-BYF63sQU.js";import{n as s,t as c}from"./Button-DxGzriWQ.js";import{l}from"./compose-CV4o6TMb.js";import{n as u,r as d}from"./ThreadForms-CbFClyd0.js";var f=n(r(),1),p=t();function m({project:e,onDone:t}){let{api:n}=i(),r=a(),o=l(),[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),v=(0,f.useRef)(null);(0,f.useEffect)(()=>v.current?.focus(),[]);let y=s({mutationFn:()=>n.createChannel({project:e,name:m.trim(),purpose:g.trim()}),onSuccess:async e=>{await r.invalidateQueries({queryKey:[`channels`]}),t(),await o({to:`/c/$`,params:{_splat:e}})}});return(0,p.jsxs)(`form`,{"aria-label":`New channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),y.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`div`,{className:`w-40 shrink-0`,children:(0,p.jsx)(`input`,{ref:v,value:m,maxLength:64,spellCheck:!1,"aria-label":`Channel name`,placeholder:`release-0-4`,onChange:e=>h(e.target.value),className:`${u} font-mono`})}),(0,p.jsx)(`input`,{value:g,"aria-label":`Purpose`,placeholder:`What the channel is for`,onChange:e=>_(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:t,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:y.isPending||m.trim()===``||g.trim()===``,children:y.isPending?`Opening…`:`Open`})]}),(0,p.jsx)(d,{error:y.error})]})}function h({channel:e,onDone:t}){let{api:n}=i(),r=a(),[o,l]=(0,f.useState)(``),m=s({mutationFn:()=>n.archiveChannel({channel:e,reason:o.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`channels`]}),t()}});return(0,p.jsxs)(`form`,{"aria-label":`Archive the channel`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),m.mutate()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`input`,{value:o,"aria-label":`Reason`,placeholder:`Why its work is done`,onChange:e=>l(e.target.value),className:`${u} min-w-0 flex-1`}),(0,p.jsx)(c,{onClick:t,children:`Cancel`}),(0,p.jsx)(c,{variant:`primary`,type:`submit`,disabled:m.isPending||o.trim()===``,children:m.isPending?`Archiving…`:`Archive channel`})]}),(0,p.jsx)(d,{error:m.error})]})}function g({channels:t,now:n}){return t.length===0?(0,p.jsx)(`p`,{className:`text-meta`,children:`No channels.`}):(0,p.jsx)(`ul`,{className:`space-y-1`,children:t.map(t=>(0,p.jsxs)(`li`,{children:[(0,p.jsxs)(e,{to:`/c/$`,params:{_splat:t.ref},className:`text-sm hover:text-fg-primary ${t.archived===void 0?`text-fg-secondary`:`text-fg-tertiary`}`,children:[`# `,t.name]}),(0,p.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,t.messages,` messages`,t.archived===void 0?``:` · archived ${o(t.archived.at,n)}`]})]},t.ref))})}export{g as n,m as r,h as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$t as e,D as t,Jn as n,K as r,Kt as i,O as a,Qn as o,S as s,St as c,U as l,W as u,X as d,Yn as f,a as p,h as m,j as h,k as g,m as _,o as v,p as y,qn as b,qt as x,t as S,u as C,v as ee,x as w,y as T,z as E}from"./format-BYF63sQU.js";import{n as D,t as O}from"./Button-DxGzriWQ.js";import{t as te}from"./CliIcon-D3GddnP4.js";import{A as k,_ as A,c as j,d as M,f as N,h as P,i as F,k as I,l as L,m as ne,p as re,u as ie,v as ae}from"./index-CyROMh25.js";import{t as R}from"./Markdown-BSeWHBBA.js";import{n as oe,r as z}from"./ThreadForms-CbFClyd0.js";import{n as B,t as se}from"./Pane-pZUzNQIW.js";import{t as ce}from"./StickyList-D_ED_-LW.js";import{a as le,c as V,f as ue,l as H,m as de,n as fe,o as U,p as W,r as pe,u as me}from"./citizen-B8p56JRh.js";import{n as G}from"./Picker-CDf6os_x.js";import{t as he}from"./Quota-Brd4ddB4.js";var K=o(f(),1),q=n(),ge={completed:`completed`,timeout:`timed out`,error:`failed`,interrupted:`was interrupted`,blocked:`was blocked`,stopped:`was stopped by you`};function J(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}function _e({label:e,tone:t,children:n}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`px-0.5 pb-0.5 text-[10px] tracking-wider text-fg-muted uppercase`,children:e}),(0,q.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 ve({step:e,open:t}){if(e.kind===`say`)return(0,q.jsx)(`li`,{className:`py-1.5 text-sm`,title:J(e.at),children:(0,q.jsx)(R,{text:e.text})});if(e.kind===`error`)return(0,q.jsx)(`li`,{className:`py-1 font-mono text-xs break-words text-red-400`,title:J(e.at),children:e.message});if(e.kind===`steer`)return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,q.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,q.jsx)(`span`,{"aria-hidden":`true`,className:`grid w-3 shrink-0 place-items-center text-sky-300`,children:`↳`}),(0,q.jsxs)(`span`,{className:`shrink-0 text-fg-tertiary`,children:[`Took `,M(e.posts.length)]}),(0,q.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,q.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:J(e.at)})]}),(0,q.jsx)(`ul`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:e.posts.map(e=>(0,q.jsxs)(`li`,{className:`rounded-md bg-surface-0/40 px-2.5 py-2`,children:[(0,q.jsxs)(`p`,{className:`flex gap-1.5 text-meta`,children:[(0,q.jsx)(`span`,{className:`text-fg-secondary`,children:e.author}),(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`in `,e.where]}),e.at===``?null:(0,q.jsx)(`span`,{className:`ml-auto shrink-0 font-mono`,children:J(e.at)})]}),(0,q.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,q.jsx)(R,{text:e.body})})]},`${e.at}-${e.author}`))})]})});let n=e.ok===null?(0,q.jsx)(`span`,{"aria-label":`running`,className:`size-1.5 animate-pulse rounded-full bg-amber-300`}):e.ok?(0,q.jsx)(`span`,{"aria-label":`succeeded`,className:`text-[11px] text-emerald-400`,children:`✓`}):(0,q.jsx)(`span`,{"aria-label":`failed`,className:`text-[11px] text-red-400`,children:`✕`});return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`details`,{open:t,className:`group rounded-md open:bg-surface-2/30`,children:[(0,q.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,q.jsx)(`span`,{className:`grid w-3 shrink-0 place-items-center`,children:n}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-fg-tertiary`,children:N(e.name)}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-fg-secondary`,children:e.summary}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-fg-muted`,children:J(e.at)})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5 px-1.5 pb-1.5`,children:[(0,q.jsx)(_e,{label:`Input`,tone:`text-fg-secondary`,children:e.detail}),e.output===null?null:(0,q.jsx)(_e,{label:e.ok===!1?`Returned an error`:`Returned`,tone:e.ok===!1?`text-red-300`:`text-fg-tertiary`,children:e.output})]})]})})}function ye({steps:e}){let[t,n]=(0,K.useState)(!1),r=e.filter(e=>e.kind===`tool`).length;return e.length===0?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`No steps yet.`}):(0,q.jsxs)(q.Fragment,{children:[r===0?null:(0,q.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-meta`,children:[r===1?`1 tool call`:`${r} tool calls`,(0,q.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,q.jsx)(`ol`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,q.jsx)(ve,{step:e,open:t},e.seq))})]})}function be({turn:e,running:t,now:n}){return e.end===null?t?(0,q.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-meta`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}),`Working · last step `,S(e.lastAt,n)]}):(0,q.jsx)(`p`,{className:`mt-3 text-meta`,children:`The turn ended without a report.`}):(0,q.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,q.jsxs)(`p`,{className:`text-caps`,children:[`The turn `,ge[e.end.exitReason],` `,S(e.end.at,n),e.fromStart?` · ${L(e.startedAt,Date.parse(e.end.at))}`:``]}),e.end.summary===null?null:(0,q.jsx)(`p`,{className:`mt-1 text-sm text-fg-secondary`,children:e.end.summary})]})}var xe=30,Se={turn:`turn`,board:`board`,merge:`both kept`},Ce={turn:`Changed by a turn`,board:`Written by the board`,merge:`Both versions kept`};function we(e){return e.status===`added`?`new`:e.status===`deleted`?`deleted`:e.added===null||e.removed===null?`binary`:`+${e.added} −${e.removed}`}function Te(e){return e.files.map(e=>`${e.path} ${we(e)}`).join(`, `)}function Ee(e){return e.startsWith(`@@`)||e.startsWith(`\\`)?`text-fg-muted`:e.startsWith(`+`)?`text-emerald-300`:e.startsWith(`-`)?`text-red-300`:`text-fg-tertiary`}function De({file:e}){return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[e.path,e.status===`modified`?``:(0,q.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,e.status]})]}),e.patch===null?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`A binary file; its contents are not shown.`}):e.patch===``?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`Empty.`}):(0,q.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,q.jsx)(`span`,{className:`block whitespace-pre-wrap break-words ${Ee(e)}`,children:e===``?` `:e},t))}),e.truncated?(0,q.jsx)(`p`,{className:`mt-1 text-meta`,children:`The rest of this file's change is cut.`}):null]})}function Oe({name:t,change:n}){let r=y(t,n.commit,!0);return(0,q.jsxs)(`div`,{className:`space-y-3 px-4 pt-1 pb-3`,children:[(0,q.jsxs)(`p`,{className:`text-xs text-fg-secondary`,children:[n.kind===`merge`?Ce.merge:n.kind===`board`?`Written by the board: ${n.subject.replace(/^home: /,``)}.`:n.turnId===void 0?n.subject:(0,q.jsx)(e,{to:`/citizen/$name`,params:{name:t},search:{tab:`turns`,turn:n.turnId},className:`text-fg-secondary underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Open the turn that made it`}),(0,q.jsxs)(`span`,{className:`text-fg-muted`,children:[` · `,J(n.at)]})]}),r.data===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:r.isError?`Could not read the change.`:`Reading the change…`}):r.data.map(e=>(0,q.jsx)(De,{file:e},e.path))]})}function ke({name:e,change:t,now:n}){let[r,i]=(0,K.useState)(!1),a=t.files.length===0?t.subject:Te(t);return(0,q.jsx)(`li`,{className:`border-b border-line/60 last:border-b-0`,children:(0,q.jsxs)(`details`,{className:`group`,onToggle:e=>i(e.currentTarget.open),children:[(0,q.jsx)(`summary`,{"aria-label":`${Ce[t.kind]} ${S(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,q.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:Se[t.kind]}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-secondary`,children:a}),(0,q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:S(t.at,n)}),(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]})}),r?(0,q.jsx)(Oe,{name:e,change:t}):null]})})}function Ae({name:e}){let[t,n]=(0,K.useState)(xe),r=m(e,t),i=w(3e4);if(r.data===void 0)return(0,q.jsx)(B,{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,q.jsx)(B,{children:`No history yet.`}):(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,q.jsx)(`ol`,{children:a.map(t=>(0,q.jsx)(ke,{name:e,change:t,now:i},t.commit))}),o?(0,q.jsx)(`button`,{type:`button`,onClick:()=>n(t+xe),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:`Show earlier changes`}):null]})}function Y({title:e,children:t}){return(0,q.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:e}),(0,q.jsx)(`div`,{className:`mt-2`,children:t})]})}function je({member:e,charter:t}){let n=T(e.name),r=v(e.name),i=_(e.name),a=w(3e4);return(0,q.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,q.jsx)(Y,{title:`Edits to reconcile`,children:(0,q.jsx)(`ul`,{className:`space-y-1.5`,children:i.data.map(e=>(0,q.jsxs)(`li`,{className:`text-sm`,children:[(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.file}),(0,q.jsxs)(`span`,{className:`text-meta`,children:[` `,`· `,e.path.slice(e.path.lastIndexOf(`/`)+1),` · left`,` `,S(e.since,a)]})]},e.path))})}),(0,q.jsx)(Y,{title:`Profile`,children:e.profile.trim()===``?(0,q.jsx)(`p`,{className:`text-meta`,children:`No profile yet.`}):(0,q.jsx)(R,{text:W(e.profile,`Profile`)})}),(0,q.jsx)(Y,{title:`Core memory`,children:n.data===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.data.body.trim()===``?(0,q.jsx)(`p`,{className:`text-meta`,children:`Empty.`}):(0,q.jsx)(R,{text:W(n.data.body,`Core memory`)})}),(0,q.jsx)(Y,{title:`Own skills`,children:r.data===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):r.data.length===0?(0,q.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,q.jsx)(`ul`,{className:`space-y-1.5`,children:r.data.map(e=>(0,q.jsxs)(`li`,{className:`text-sm`,children:[(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),e.summary===``?null:(0,q.jsxs)(`span`,{className:`text-fg-secondary`,children:[` · `,e.summary]})]},e.name))})}),t===void 0?null:(0,q.jsxs)(Y,{title:`Charter of ${t.name}`,children:[(0,q.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:t.purpose}),(0,q.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,q.jsx)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:t.verbs.map(e=>(0,q.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 Me(e,t){let n=l(e,t?.turnId??null);return{turn:(0,K.useMemo)(()=>t===void 0||n.data===void 0?void 0:re(n.data,e,t.project,t),[t,n.data,e]),loading:t?.turnId!==void 0&&n.isPending,missing:t!==void 0&&(t.turnId===void 0||n.isError)}}var X=50;function Ne({name:e,entry:t,now:n,opened:r}){let[i,a]=(0,K.useState)(r),o=(0,K.useRef)(null);(0,K.useEffect)(()=>{r&&o.current?.scrollIntoView({block:`start`})},[r]);let s=ae(),c=me(t),l=t.thread===void 0?t.channel===void 0?t.place===void 0?null:`${t.place}'s channels`:`#${t.channel}`:s.get(t.thread)?.title??`a thread`,u=t.heartbeat===void 0?void 0:de(t),d=t.error??t.summary??``,f=t.error===null?`text-fg-secondary`:`text-red-300`;return(0,q.jsx)(`li`,{ref:o,className:`border-b border-line/60 last:border-b-0`,children:(0,q.jsxs)(`details`,{className:`group`,open:i,onToggle:e=>a(e.currentTarget.open),children:[(0,q.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,q.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsxs)(`span`,{className:`min-w-0 truncate text-fg-secondary`,children:[U(t.project),l===null?``:` · ${l}`]}),(0,q.jsx)(`span`,{className:`text-fg-muted`,children:t.trigger}),u===void 0?null:(0,q.jsxs)(`span`,{className:`-ml-1 shrink-0 text-fg-muted`,title:u,children:[`· `,t.heartbeat]}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-fg-muted`,children:[fe(t),` `,S(t.ts,n)]}),(0,q.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-fg-tertiary`,title:t.usage===void 0?void 0:V(t.usage),children:[c,t.toolCalls===void 0?null:`${t.toolCalls} tools`,t.usage===void 0?null:H(t.usage)].filter(e=>e!==null).join(` · `)}),(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-[10px] text-fg-muted transition-transform group-open:rotate-90`,children:`▸`})]}),d.trim()===``?null:(0,q.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-xs leading-relaxed group-open:hidden ${f}`,children:(0,q.jsx)(A,{text:d,links:!1})})]}),i?(0,q.jsx)(Pe,{name:e,entry:t,text:d,tone:f}):null]})})}function Pe({name:e,entry:t,text:n,tone:r}){let i=Me(e,t);return(0,q.jsxs)(`div`,{className:`px-4 pt-1 pb-3`,children:[n.trim()===``?null:(0,q.jsx)(`p`,{className:`text-xs leading-relaxed whitespace-pre-wrap ${r}`,children:(0,q.jsx)(A,{text:n})}),(0,q.jsx)(`div`,{className:`mt-2`,children:t.turnId===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`This turn ran before turns kept their steps.`}):i.loading?(0,q.jsx)(`p`,{className:`text-meta`,children:`Reading the steps…`}):i.turn===void 0?(0,q.jsx)(`p`,{className:`text-meta`,children:`No steps were kept for this turn.`}):(0,q.jsxs)(q.Fragment,{children:[t.startedAt===void 0?null:(0,q.jsxs)(`p`,{className:`text-caps`,children:[`Started `,J(t.startedAt)]}),(0,q.jsx)(ye,{steps:i.turn.steps})]})})]})}function Fe({name:e,opened:t}){let[n,r]=(0,K.useState)(X),i=u(e,n),a=w(3e4);if(i.data===void 0)return(0,q.jsx)(B,{children:`Reading the turns…`});let o=i.data.toReversed();if(o.length===0)return(0,q.jsxs)(B,{children:[e,` has not finished a turn yet.`]});let s=pe(o),c=s.usage===null?``:` · ${H(s.usage)}${s.withUsage<s.turns?` over ${s.withUsage} of them`:``}`;return(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`p`,{className:`px-4 pt-3 pb-1 text-meta`,title:s.usage===null?void 0:V(s.usage),children:[s.turns===1?`1 turn`:`${s.turns} turns`,s.failed===0?``:`, ${s.failed} not completed`,c]}),t!==null&&!o.some(e=>e.turnId===t)?(0,q.jsx)(`p`,{className:`px-4 pb-1 text-meta`,children:i.data.length===n?`The turn this address opens is further back.`:`The turn this address opens is not in this citizen's history.`}):null,(0,q.jsx)(`ol`,{children:o.map(n=>(0,q.jsx)(Ne,{name:e,entry:n,now:a,opened:t!==null&&n.turnId===t},n.id))}),i.data.length===n?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(n+X),className:`px-4 py-3 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show `,X,` earlier turns`]}):null]})}var Z=``,Q=``;function Ie(e,t){return[{value:Z,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 Le(e,t){return[{value:Q,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 Re({member:e,onDone:t}){let{api:n}=h(),i=b(),a=p(e.name),o=e.model??Z,s=e.effort??Q,[c,l]=(0,K.useState)(o),[u,d]=(0,K.useState)(s),f=D({mutationFn:async()=>{c!==o&&await n.setModel(e.name,c===Z?null:c),u!==s&&await n.setEffort(e.name,u===Q?null:u)},onSettled:()=>void i.invalidateQueries({queryKey:[`members`]}),onSuccess:t}),m=a.data?.models??[],g=e.model!==void 0&&!m.some(t=>t.id===e.model)?e.model:null,_=e=>m.find(t=>e===Z?t.isDefault:t.id===e),v=_(c)?.efforts??[],y=u!==Q&&!v.some(e=>e.id===u)?u:null,x=e=>{l(e);let t=_(e)?.efforts??[];u!==Q&&!t.some(e=>e.id===u)&&d(Q)},S=c!==o||u!==s;return(0,q.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(),f.mutate()},children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a.isPending?(0,q.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:[`Asking `,e.cli,` for its models…`]}):a.error===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Model`,choices:Ie(m,g),value:c,onChange:x}),v.length===0&&y===null?null:(0,q.jsx)(`div`,{className:`flex w-32 shrink-0`,children:(0,q.jsx)(G,{label:`Effort`,choices:Le(_(c),y),value:u,onChange:d,listClassName:`right-0 w-64`})})]}):(0,q.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 r?a.error.message:`the board server did not answer`]}),(0,q.jsx)(O,{onClick:t,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:f.isPending||!S||a.error!==null,children:f.isPending?`Saving…`:`Save`})]}),a.data===void 0?null:(0,q.jsxs)(`p`,{className:`text-meta`,children:[`Listed by `,a.data.cli,` on `,a.data.runner]}),(0,q.jsx)(z,{error:f.error})]})}var $=``;function ze(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 Be(e,t){return[{value:$,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:ze(e,t)}))]}function Ve({member:e,onDone:t}){let{api:n}=h(),r=b(),i=a(),o=e.homeRunner??$,[s,c]=(0,K.useState)(o),l=D({mutationFn:()=>n.setRunner(e.name,s===$?null:s),onSuccess:()=>{r.invalidateQueries({queryKey:[`members`]}),t()}});return(0,q.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(),l.mutate()},children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i.data===void 0?(0,q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`Reading the runners…`}):(0,q.jsx)(G,{label:`Runner`,choices:Be(i.data,e),value:s,onChange:c}),(0,q.jsx)(O,{onClick:t,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:l.isPending||s===o,children:l.isPending?`Saving…`:`Run here`})]}),(0,q.jsx)(z,{error:l.error})]})}function He(e){if(e.thread!==void 0)return{threadId:e.thread};let t=e.scope===`society`?null:e.scope;return e.channel===void 0?e.place===void 0?{channel:e.askedIn??i(t,`general`)}:{channel:e.askedIn!==void 0&&x(e.askedIn).project===e.place?e.askedIn:i(e.place,`general`)}:{channel:i(t,e.channel)}}function Ue({name:e,turn:t}){let{api:n}=h(),r=b(),[i,a]=(0,K.useState)(!1),o=D({mutationFn:()=>n.stopTurn(t.turnId),onSuccess:()=>{a(!1),r.invalidateQueries({queryKey:[`scheduler`]})}});return(0,q.jsxs)(`div`,{className:`border-t border-line`,children:[(0,q.jsx)(F,{target:He(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,q.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-3`,children:[(0,q.jsx)(`p`,{className:`min-w-0 flex-1 text-[11px] leading-snug text-fg-muted`,children:i?`Stop ${e}'s turn?`:t.steerable?`Posts reach the turn at its next step.`:`This runner delivers posts after the turn ends.`}),i?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O,{onClick:()=>{a(!1),o.reset()},children:`Keep it running`}),(0,q.jsx)(O,{variant:`primary`,disabled:o.isPending,onClick:()=>{o.mutate()},children:o.isPending?`Stopping…`:`Stop the turn`})]}):(0,q.jsx)(O,{onClick:()=>a(!0),children:`Stop…`})]}):null,o.error===null?null:(0,q.jsx)(`div`,{className:`px-3 pb-3`,children:(0,q.jsx)(z,{error:o.error})})]})}function We({member:e,scopes:t,preferred:n,running:r,paused:i,onDone:a}){let{api:o}=h(),s=b(),[c,l]=(0,K.useState)(`manual`),[u,d]=(0,K.useState)(n!==null&&t.includes(n)?n:t[0]??``),[f,p]=(0,K.useState)(``),m=(0,K.useRef)(null);(0,K.useEffect)(()=>m.current?.focus(),[]);let g=D({mutationFn:()=>o.wake({agent:e.name,project:u,kind:c,...f.trim()===``?{}:{reason:f.trim()}}),onSuccess:()=>{s.invalidateQueries({queryKey:[`scheduler`]}),a()}}),_=i?`The society is paused.`:r.includes(u)?`${e.name} is in a turn there now.`:null;return(0,q.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(),g.mutate()},children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:`Kind of turn`}),[`manual`,`reflection`].map(e=>(0,q.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 ${c===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:c===e,onChange:()=>l(e),className:`sr-only`}),e===`manual`?`A turn`:`A reflection`]},e))]}),(0,q.jsxs)(`div`,{className:`ml-auto flex w-52 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-tertiary`,children:`at`}),(0,q.jsx)(G,{label:`Where`,choices:le(t),value:u,onChange:d})]})]}),(0,q.jsx)(`textarea`,{ref:m,value:f,rows:2,placeholder:c===`reflection`?`What to reflect on, optional`:`What it should look at`,"aria-label":`Reason`,onChange:e=>p(e.target.value),className:`${oe} resize-none`}),_===null?null:(0,q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-fg-muted`,children:_}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(O,{onClick:a,children:`Cancel`}),(0,q.jsx)(O,{variant:`primary`,type:`submit`,disabled:g.isPending||u===``,children:g.isPending?`Waking…`:c===`reflection`?`Ask for a reflection`:`Wake ${e.name}`})]}),(0,q.jsx)(z,{error:g.error})]})}var Ge={working:`bg-emerald-500/15 text-emerald-300`,queued:`bg-amber-500/15 text-amber-300`,idle:`bg-surface-2 text-fg-tertiary`};function Ke({project:t,name:n}){let r=(E(t).data??[]).filter(e=>e.status===`claimed`&&e.claimedBy===n);return r.length===0?null:(0,q.jsx)(`ul`,{className:`mt-1.5 space-y-1`,children:r.map(t=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(e,{to:`/task/$taskId`,params:{taskId:t.id},className:`flex items-center gap-2 rounded-md text-xs text-fg-secondary hover:text-fg-primary`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`text-fg-muted`,children:`◇`}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.title}),(0,q.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate font-mono text-[11px] text-fg-muted`,children:c(t)?.name??t.stage})]})},t.id))})}function qe(){let{name:e}=k({from:`/citizen/$name`}),{scope:t,tab:n,turn:r}=I({from:`/citizen/$name`});return(0,q.jsx)(Ye,{name:e,chosen:t??null,tab:n??`now`,turn:r??null},e)}var Je=[{tab:`now`,label:`Now`},{tab:`turns`,label:`Turns`},{tab:`memory`,label:`Memory`},{tab:`history`,label:`History`}];function Ye({name:n,chosen:r,tab:i,turn:o}){let c=ee(),l=t(),u=g(),f=P(),p=C(),m=a(),h=s(),_=w(3e4),[v,y]=(0,K.useState)(null),b=c.data?.find(e=>e.name===n);if(b===void 0)return(0,q.jsx)(B,{children:c.data===void 0?`Reading the roster…`:`There is no citizen ${n}.`});let x=d(u.data?.running??[]).filter(e=>e.agent===n),S=[...new Set(x.map(e=>e.scope))],T=x.map(e=>ie(e.agent,e.scope,e)),E=d(u.data?.pending??[]).find(e=>e.agent===n),D=S.length>0?`working`:E===void 0?`idle`:`queued`,k=ne(f,n)[0],A=k?.model??b.lastModel,j=A??b.model??`CLI default`,M=b.model!==void 0&&b.model!==A?b.model:null,N=l.data?.find(e=>e.name===b.role),F=ue(b),I=b.status===`active`&&b.cli!==null,L=(p.data??[]).filter(e=>e.agent===n&&e.ended===void 0).length;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(se,{leading:b.cli===null?null:(0,q.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-2/70`,children:(0,q.jsx)(te,{cli:b.cli,size:20})}),title:n,subtitle:(0,q.jsxs)(q.Fragment,{children:[b.role,` · `,j,M===null?``:` · set to ${M}`,b.effort===void 0?``:` · ${b.effort} effort`,b.homeRunner===void 0?``:` · on ${b.homeRunner}`,b.status===`retired`?` · retired`:``]}),trailing:(0,q.jsxs)(q.Fragment,{children:[L===0?null:(0,q.jsx)(e,{to:`/crons`,search:{agent:n},className:`inline-flex h-7 shrink-0 items-center rounded-md px-3 text-xs text-fg-tertiary transition-colors hover:bg-surface-2/70 hover:text-fg-primary focus-visible:ring-2 focus-visible:ring-fg-primary/30 focus-visible:outline-none`,children:L===1?`1 cron`:`${L} crons`}),I&&v===null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O,{onClick:()=>y(`model`),children:`Model…`}),(0,q.jsx)(O,{onClick:()=>y(`runner`),children:`Runner…`}),(0,q.jsx)(O,{onClick:()=>y(`wake`),children:`Wake…`})]}):null,(0,q.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${Ge[D]}`,children:D})]})}),(0,q.jsx)(he,{member:b,runners:m.data??[],placed:new Map((h.data??[]).flatMap(e=>e.runner===void 0?[]:[[e.slug,e.runner]])),now:_}),v===`wake`?(0,q.jsx)(We,{member:b,scopes:F,preferred:r?.split(`/`)[0]??k?.scope??null,running:S,paused:u.data?.paused??!1,onDone:()=>y(null)}):v===`model`?(0,q.jsx)(Re,{member:b,onDone:()=>y(null)}):v===`runner`?(0,q.jsx)(Ve,{member:b,onDone:()=>y(null)}):null,(0,q.jsx)(`nav`,{"aria-label":`Citizen views`,className:`flex gap-1 border-b border-line px-3 py-2`,children:Je.map(t=>(0,q.jsx)(e,{to:`/citizen/$name`,params:{name:n},search:{...r===null?{}:{scope:r},...t.tab===`now`?{}:{tab:t.tab}},replace:!0,"aria-current":t.tab===i?`page`:void 0,className:`rounded-md px-2.5 py-1 text-xs transition-colors ${t.tab===i?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:t.label},t.tab))}),i===`turns`?(0,q.jsx)(Fe,{name:n,opened:o},o):i===`memory`?(0,q.jsx)(je,{member:b,charter:N}):i===`history`?(0,q.jsx)(Ae,{name:n}):(0,q.jsx)(Ze,{name:n,chosen:r,lastTurnAt:b.lastTurnAt,state:D,runningScopes:S,runningKeys:T,runningTurns:(u.data?.turns??[]).filter(e=>e.agent===n),queuedScope:E?.scope??null})]})}function Xe(e){return e.toSorted((e,t)=>e.startedAt.localeCompare(t.startedAt))[0]}function Ze({name:t,chosen:n,lastTurnAt:r,state:i,runningScopes:a,runningKeys:o,runningTurns:s,queuedScope:c}){let l=P(),d=w(5e3),f=ne(l,t),p=u(t,1),m=Me(t,f.length===0?p.data?.at(-1):void 0),h=ae(),g=e=>e.end===null&&o.includes(ie(e.agent,e.scope,e)),_=n?.split(`/`)[0]??null,v=(n?.includes(`/`)===!0?f.find(e=>j(e)===n):void 0)??Xe(f.filter(e=>e.scope===_&&g(e)))??f.find(e=>j(e)===n)??Xe(f.filter(g))??f[0]??m.turn,y=e=>e.thread===void 0?e.channel===void 0?e.place===void 0?U(e.scope):`${U(e.scope)} · ${e.place}'s channels`:`${U(e.scope)} · #${e.channel}`:`${U(e.scope)} · ${h.get(e.thread)?.title??`a thread`}`,b=v!==void 0&&g(v),x=v?.scope??a[0]??c,C=(v===void 0?void 0:s.find(e=>e.scope===v.scope&&e.thread===v.thread&&e.channel===v.channel&&e.place===v.place))??(b?void 0:s[0]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{className:`border-b border-line px-4 py-3 text-xs text-fg-tertiary`,children:[(0,q.jsx)(`p`,{children:b?`In a turn at ${U(v.scope)} for ${v.fromStart?``:`at least `}${L(v.startedAt,d)}`:a.length>0?`In a turn at ${a.map(U).join(` and `)}`:c===null?r===void 0?`No turns yet`:`Last turn ${S(r,d)}`:`Queued for a turn at ${U(c)}`}),x===null||x===`society`?null:(0,q.jsx)(Ke,{project:x,name:t})]}),(0,q.jsx)(ce,{className:`px-4 py-3`,children:v===void 0?(0,q.jsx)(B,{children:i===`working`?`The turn has not reported a step yet.`:m.loading?`Reading the last turn…`:r===void 0?`${t} has not taken a turn yet.`:`${t}'s last turn kept no steps.`}):(0,q.jsxs)(q.Fragment,{children:[f.length>1?(0,q.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,"aria-label":`Turns by conversation`,children:f.toSorted((e,t)=>j(e).localeCompare(j(t))).map(n=>(0,q.jsxs)(e,{to:`/citizen/$name`,params:{name:t},search:{scope:j(n)},replace:!0,"aria-current":n===v?`true`:void 0,className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] transition-colors ${n===v?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[g(n)?(0,q.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-emerald-400`}):null,y(n)]},j(n)))}):null,(0,q.jsxs)(`p`,{className:`text-caps`,children:[b?`This turn`:`Last turn`,` · `,y(v),` · started`,` `,v.fromStart?J(v.startedAt):`before the earliest step shown`]}),(0,q.jsx)(ye,{steps:v.steps}),(0,q.jsx)(be,{turn:v,running:b,now:d})]})}),C===void 0?null:(0,q.jsx)(Ue,{name:t,turn:C})]})}export{qe as CitizenView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,F as t,Jn as n,Qn as r,S as i,V as a,Yn as o,j as s,qn as c,t as l,u,v as d,x as f,yt as p,zt as m}from"./format-BYF63sQU.js";import{n as h,t as g}from"./Button-DxGzriWQ.js";import{t as _}from"./CliIcon-D3GddnP4.js";import{D as v,E as y,T as b,k as x,w as S}from"./index-CyROMh25.js";import{t as C}from"./Markdown-BSeWHBBA.js";import{a as w,o as T,r as E}from"./ThreadForms-CbFClyd0.js";import{n as D,t as O}from"./Pane-pZUzNQIW.js";import{a as k,f as A,o as j}from"./citizen-B8p56JRh.js";import{n as M,r as N,t as P}from"./Picker-CDf6os_x.js";var F=r(o(),1),I=n(),L=[`UTC`,...Intl.supportedValuesOf(`timeZone`).filter(e=>e!==`UTC`)],R=50;function z(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 B({value:e,onChange:t,label:n,placeholder:r}){let[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(0),c=(0,F.useRef)(null),l=(0,F.useRef)([]),u=e.trim().toLowerCase(),d=(0,F.useMemo)(()=>(u===``?L:L.filter(e=>e.toLowerCase().includes(u))).slice(0,R),[u]),f=(0,F.useMemo)(()=>new Date,[]);(0,F.useEffect)(()=>{i&&l.current[o]?.scrollIntoView({block:`nearest`})},[i,o]),(0,F.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,I.jsxs)(`div`,{ref:c,className:`relative min-w-0 flex-1`,children:[(0,I.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))}else e.key===`Enter`&&i&&d[o]!==void 0?(e.preventDefault(),p(d[o])):e.key===`Tab`?a(!1):e.key===`Escape`&&i&&(e.preventDefault(),e.stopPropagation(),a(!1))},className:T}),i&&d.length>0&&(d.length!==1||d[0]!==e)?(0,I.jsx)(`div`,{className:`max-h-48 ${P}`,children:d.map((e,t)=>(0,I.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:N(t===o),children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-secondary`,children:e}),(0,I.jsx)(`span`,{className:`shrink-0 text-[11px] text-fg-muted`,children:z(e,f)})]},e))}):null]})}function V({word:e,children:t}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-fg-tertiary`,children:e}),t]})}function H(e,t){return m(typeof e==`string`?new Date(e):e,t)}function U({cron:t}){let n=a(),r=b(t);if(r.kind===`thread`){let t=n.data?.find(e=>e.id===r.id)?.title??r.id;return(0,I.jsxs)(e,{to:`/thread/$threadId`,params:{threadId:r.id},className:`truncate hover:text-fg-primary`,children:[`thread “`,t,`”`]})}return r.kind===`channel`?(0,I.jsxs)(e,{to:`/c/$`,params:{_splat:r.ref},className:`hover:text-fg-primary`,children:[`#`,r.ref]}):r.kind===`place`?(0,I.jsxs)(e,{to:`/p/$slug`,params:{slug:r.project},className:`hover:text-fg-primary`,children:[r.project,`'s channels`]}):(0,I.jsxs)(`span`,{children:[`home at `,j(r.scope)]})}function W({cron:t,next:n,member:r,zone:i,now:a,focused:o}){let u=(0,F.useRef)(null);(0,F.useEffect)(()=>{o&&u.current!==null&&(u.current.open=!0,u.current.scrollIntoView({block:`nearest`}))},[o]);let{api:d}=s(),f=c(),[p,m]=(0,F.useState)(!1),[v,b]=(0,F.useState)(``),x=()=>void f.invalidateQueries({queryKey:[`crons`]}),S=h({mutationFn:e=>d.pauseCron(t.id,e),onSuccess:x}),w=h({mutationFn:()=>d.removeCron(t.id,v.trim()),onSuccess:x}),D=`at`in t.schedule?`once, ${H(t.schedule.at,i)}`:`${t.schedule.cron} · ${t.schedule.timezone??i}`,O=t.ended===void 0?t.paused===void 0?n===null?`no time to come`:n.getTime()<=a?`due, waiting for its turn`:l(n.toISOString(),a):`paused`:`ended ${l(t.ended.at,a)}`,k=y(t);return(0,I.jsx)(`li`,{className:`rounded-lg ${o?`bg-surface-2/30`:``}`,children:(0,I.jsxs)(`details`,{ref:u,className:`group`,children:[(0,I.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,I.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[r?.cli===void 0||r.cli===null?null:(0,I.jsx)(_,{cli:r.cli,size:13}),(0,I.jsx)(`span`,{className:`shrink-0 text-fg-secondary`,children:t.agent}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg-primary`,children:t.title}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs ${t.paused===void 0?`text-fg-muted`:`text-amber-300`}`,title:n===null?void 0:`${H(n,i)}, ${i}`,children:O})]}),(0,I.jsxs)(`p`,{className:`mt-0.5 flex items-baseline gap-1.5 truncate text-meta`,children:[(0,I.jsx)(`span`,{children:D}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(U,{cron:t}),t.lastRun===void 0?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsxs)(`span`,{children:[`last turn `,t.lastRun.outcome,` `,l(t.lastRun.at,a)]})]}),k?(0,I.jsxs)(`span`,{className:`text-amber-300`,children:[`· `,t.failures,` failed in a row`]}):null]})]}),(0,I.jsxs)(`div`,{className:`space-y-3 px-2 pt-1 pb-3`,children:[(0,I.jsx)(`div`,{className:`rounded-lg bg-surface-2/30 px-3 py-2`,children:(0,I.jsx)(C,{text:t.note})}),(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Set by `,t.createdBy,` `,l(t.createdAt,a),t.lastFiredAt===void 0?``:` · fired last ${H(t.lastFiredAt,i)}`,t.ended===void 0?``:` · ended by ${t.ended.by}: ${t.ended.reason}`]}),n===null?null:(0,I.jsxs)(`p`,{className:`text-meta`,children:[`Next `,H(n,i),` (`,i,`)`]}),t.lastRun===void 0?null:(0,I.jsx)(e,{to:`/citizen/$name`,params:{name:t.agent},search:{tab:`turns`,turn:t.lastRun.turnId},className:`text-meta underline-offset-2 hover:text-fg-primary hover:underline`,children:`Open its last turn`}),t.ended===void 0?p?(0,I.jsxs)(`form`,{"aria-label":`Remove ${t.title}`,className:`space-y-2`,onSubmit:e=>{e.preventDefault(),w.mutate()},children:[(0,I.jsx)(`input`,{value:v,"aria-label":`Why it ends`,placeholder:`Why it ends`,onChange:e=>b(e.target.value),className:T}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:()=>m(!1),children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:w.isPending||v.trim()===``,children:w.isPending?`Removing…`:`Remove cron`})]}),(0,I.jsx)(E,{error:w.error})]}):(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:()=>S.mutate(t.paused===void 0),disabled:S.isPending,children:t.paused===void 0?`Pause`:`Resume`}),(0,I.jsx)(g,{onClick:()=>m(!0),children:`Remove…`}),(0,I.jsx)(E,{error:S.error})]}):null]})]})})}function G({zone:e,onDone:t}){let{api:n}=s(),r=c(),[i,a]=(0,F.useState)(e),o=new Intl.DateTimeFormat().resolvedOptions().timeZone,l=h({mutationFn:()=>n.setTimezone(i.trim()),onSuccess:()=>{r.invalidateQueries({queryKey:[`society`]}),r.invalidateQueries({queryKey:[`crons`]}),t()}});return(0,I.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,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(B,{value:i,onChange:a,label:`Society time zone`}),o===i?null:(0,I.jsxs)(g,{onClick:()=>a(o),children:[`Use `,o]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:t,children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:l.isPending||i.trim()===``||i.trim()===e,children:l.isPending?`Saving…`:`Save`})]}),(0,I.jsx)(E,{error:l.error})]})}function K({members:e,preferred:n,zone:r,onDone:a}){let{api:o}=s(),l=c(),u=i(),d=t(),[m,_]=(0,F.useState)(e.find(e=>e.name===n)?.name??e[0]?.name??``),y=e.find(e=>e.name===m),b=y===void 0?[]:A(y),[x,S]=(0,F.useState)(b[0]??`society`),[C,D]=(0,F.useState)(``),[O,j]=(0,F.useState)(`repeats`),[N,P]=(0,F.useState)(`0 9 * * 1-5`),[L,R]=(0,F.useState)(``),[z,U]=(0,F.useState)(``),[W,G]=(0,F.useState)(``),[K,q]=(0,F.useState)(``),J=(0,F.useRef)(null);(0,F.useEffect)(()=>J.current?.focus(),[]);let Y=f(3e4),ee=(x===`society`?d.data?.channels??[]:u.data?.find(e=>e.slug===x)?.channels??[]).filter(e=>e!==`general`),X=O===`repeats`?{cron:N,...L.trim()===``?{}:{timezone:L.trim()}}:{at:z===``?``:new Date(z).toISOString()},Z=v(O===`once`&&z===``?{at:`invalid`}:X,r,new Date(Y)),Q=O===`repeats`?L.trim()===``?r:L.trim():r,$=h({mutationFn:()=>o.createCron({agent:m,title:W.trim(),note:K.trim(),project:x,...C===``?{}:{channel:C},...X}),onSuccess:()=>{l.invalidateQueries({queryKey:[`crons`]}),a()}});return(0,I.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,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(V,{word:`wakes`,children:(0,I.jsx)(M,{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:m,onChange:t=>{let n=e.find(e=>e.name===t);_(t),S(n===void 0?p:A(n)[0]??`society`),D(``)}})}),(0,I.jsx)(V,{word:`at`,children:(0,I.jsx)(M,{label:`Where`,choices:k(b),value:x,onChange:e=>{S(e),D(``)}})}),(0,I.jsx)(V,{word:`in`,children:(0,I.jsx)(M,{label:`Conversation`,choices:[{value:``,name:`its home`,id:null,description:`general, and work tied to no other channel`},...ee.map(e=>({value:e,name:`#${e}`,id:null,description:`a workstream's own conversation`}))],value:C,onChange:D})})]}),(0,I.jsx)(`input`,{ref:J,value:W,maxLength:120,"aria-label":`Title`,placeholder:`Title, such as Morning report`,onChange:e=>G(e.target.value),className:T}),(0,I.jsx)(`textarea`,{value:K,rows:3,"aria-label":`Note`,placeholder:`What to do when it fires`,onChange:e=>q(e.target.value),className:w}),(0,I.jsxs)(`fieldset`,{className:`flex gap-1`,children:[(0,I.jsx)(`legend`,{className:`sr-only`,children:`How often`}),[`repeats`,`once`].map(e=>(0,I.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 ${O===e?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/60 hover:text-fg-primary`}`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`kind`,value:e,checked:O===e,onChange:()=>j(e),className:`sr-only`}),e===`repeats`?`Repeats`:`Once`]},e))]}),O===`repeats`?(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`div`,{className:`w-44 shrink-0`,children:(0,I.jsx)(`input`,{value:N,spellCheck:!1,"aria-label":`Cron expression`,placeholder:`minute hour day month weekday`,onChange:e=>P(e.target.value),className:T})}),(0,I.jsx)(B,{value:L,onChange:R,label:`Its time zone`,placeholder:`${r}, the society's`})]}):(0,I.jsx)(`input`,{type:`datetime-local`,value:z,"aria-label":`When, in this browser's time`,onChange:e=>U(e.target.value),className:T}),(0,I.jsx)(`p`,{"aria-live":`polite`,className:`text-xs leading-relaxed text-fg-muted`,children:`error`in Z?(0,I.jsx)(`span`,{className:`text-amber-300`,children:Z.error}):(0,I.jsxs)(I.Fragment,{children:[Z.times.length===1?`Fires `:`Fires next `,Z.times.map(e=>H(e,Q)).join(`, `),` (`,Q,`).`]})}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(g,{onClick:a,children:`Cancel`}),(0,I.jsx)(g,{variant:`primary`,type:`submit`,disabled:$.isPending||m===``||W.trim()===``||K.trim()===``||`error`in Z,children:$.isPending?`Setting…`:`Set cron`})]}),(0,I.jsx)(E,{error:$.error})]})}function q(){let{agent:n,cron:r}=x({from:`/crons`}),i=u(),a=d(),o=t(),s=f(3e4),[c,l]=(0,F.useState)(null),p=o.data?.timezone??`UTC`,m=(i.data??[]).filter(e=>n===void 0||e.agent===n),h=S(m,p),_=m.filter(y).length,v=(a.data??[]).filter(e=>e.status===`active`&&e.cli!==null),b=e=>a.data?.find(t=>t.name===e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(O,{title:n===void 0?`Crons`:`Crons of ${n}`,subtitle:[`${h.active.length} running`,...h.paused.length===0?[]:[`${h.paused.length} paused`],..._===0?[]:[`${_} failing`],`times in ${p}`].join(` · `),trailing:c===null?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{onClick:()=>l(`zone`),children:`Time zone…`}),(0,I.jsx)(g,{onClick:()=>l(`new`),disabled:v.length===0,children:`New cron…`})]}):null}),c===`new`?(0,I.jsx)(K,{members:v,preferred:n,zone:p,onDone:()=>l(null)}):c===`zone`?(0,I.jsx)(G,{zone:p,onDone:()=>l(null)}):null,(0,I.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[n===void 0?null:(0,I.jsx)(e,{to:`/crons`,className:`block px-2 pb-2 text-meta hover:text-fg-primary`,children:`Show every citizen's crons`}),i.error!==null&&i.data===void 0?(0,I.jsxs)(D,{children:[`Could not read the crons: `,i.error.message]}):i.data===void 0?(0,I.jsx)(D,{children:`Reading the crons…`}):h.active.length+h.paused.length+h.ended.length===0?(0,I.jsx)(`p`,{className:`px-2 py-2 text-meta`,children:`No crons yet.`}):null,h.active.length===0?null:(0,I.jsx)(`ul`,{"aria-label":`Running`,className:`space-y-0.5`,children:h.active.map(({cron:e,next:t})=>(0,I.jsx)(W,{cron:e,next:t,member:b(e.agent),zone:p,now:s,focused:e.id===r},e.id))}),h.paused.length===0?null:(0,I.jsxs)(`section`,{"aria-label":`Paused`,className:`mt-3`,children:[(0,I.jsx)(`h3`,{className:`px-2 pb-1 text-section`,children:`Paused`}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:h.paused.map(e=>(0,I.jsx)(W,{cron:e,next:null,member:b(e.agent),zone:p,now:s,focused:e.id===r},e.id))})]}),h.ended.length===0?null:(0,I.jsxs)(`details`,{className:`mt-3`,open:h.ended.some(e=>e.id===r),children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer px-2 pb-1 text-section`,children:[`Ended (`,h.ended.length,`)`]}),(0,I.jsx)(`ul`,{"aria-label":`Ended`,className:`space-y-0.5`,children:h.ended.map(e=>(0,I.jsx)(W,{cron:e,next:null,member:b(e.agent),zone:p,now:s,focused:e.id===r},e.id))})]})]})]})}export{q as CronsView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,K as n,b as r,r as i,t as a,x as o}from"./format-BYF63sQU.js";import{g as s,k as c,s as l}from"./index-CyROMh25.js";import{n as u,t as d}from"./Pane-pZUzNQIW.js";import{t as f}from"./citizen-B8p56JRh.js";import{n as p}from"./Overview-D6kiK8sE.js";var m=t(),h=[{window:`24h`,label:`24 hours`},{window:`7d`,label:`7 days`},{window:`all`,label:`All time`}],g={stage:`a stage to take`,mention:`a mention`,user_post:`your post`,heartbeat:`a heartbeat`,task_done:`a finished task`,proposal_decided:`a decided proposal`,ops_event:`a signal`,onboarding:`joining`,manual:`your wake`},_=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`});function v(e,t){return t===0?``:`${Math.round(e/t*100)}%`}function y(e){return e.toFixed(1).replace(/\.0$/,``)}function b({part:e,whole:t}){return(0,m.jsxs)(m.Fragment,{children:[e,(0,m.jsx)(`span`,{className:`ml-1.5 inline-block w-9 text-right text-fg-muted`,children:e===0?``:v(e,t)})]})}function x({children:e}){return(0,m.jsx)(`p`,{className:`text-sm text-fg-primary`,children:e})}function S({children:e}){return(0,m.jsx)(`p`,{className:`mt-1 text-meta`,children:e})}function C({label:e,columns:t,rows:n}){return n.length===0?null:(0,m.jsxs)(`table`,{"aria-label":e,className:`mt-3 w-full table-fixed text-sm`,children:[(0,m.jsxs)(`colgroup`,{children:[(0,m.jsx)(`col`,{}),t.slice(1).map(e=>(0,m.jsx)(`col`,{className:`w-24`},e))]}),(0,m.jsx)(`thead`,{children:(0,m.jsx)(`tr`,{children:t.map((e,t)=>(0,m.jsx)(`th`,{scope:`col`,className:`text-caps pb-1 font-normal ${t===0?`text-left`:`text-right`}`,children:e},e))})}),(0,m.jsx)(`tbody`,{children:n.map((e,t)=>(0,m.jsx)(`tr`,{className:`border-t border-line/50`,children:e.map((e,t)=>(0,m.jsx)(`td`,{className:`py-1.5 ${t===0?`pr-3 text-fg-primary`:`text-right text-fg-secondary tabular-nums`}`,children:e},t))},t))})]})}function w({name:t}){let n=l();return t===`user`?(0,m.jsx)(`span`,{children:n(t)}):(0,m.jsx)(e,{to:`/citizen/$name`,params:{name:t},className:`hover:underline`,children:t})}function T(e){return e.window===`24h`?1:e.window===`7d`?7:Math.max(1,e.decisions.byDay.length)}function E(){let{window:t=`7d`}=c({from:`/metrics`}),l=r(t),E=o(6e4),D=(0,m.jsx)(`nav`,{"aria-label":`Window`,className:`flex shrink-0 gap-1`,children:h.map(n=>(0,m.jsx)(e,{to:`/metrics`,search:{window:n.window},"aria-current":n.window===t?`page`:void 0,className:`rounded-md px-2 py-1 text-xs transition-colors ${n.window===t?`bg-surface-2 text-fg-primary`:`text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`}`,children:n.label},n.window))}),O=(0,m.jsx)(d,{title:`Metrics`,trailing:D});if(l.data===void 0)return(0,m.jsxs)(m.Fragment,{children:[O,(0,m.jsx)(u,{children:l.error instanceof n?l.error.message:`Counting the event log…`})]});let{idle:k,sentBack:A,messages:j,latency:M,decisions:N,blocked:P}=l.data,F=T(l.data);return(0,m.jsxs)(m.Fragment,{children:[O,(0,m.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,m.jsxs)(p,{title:`Turns that did nothing`,children:[k.turns===0?(0,m.jsx)(S,{children:`No finished turns in this window.`}):(0,m.jsxs)(x,{children:[k.idle,` of `,k.turns,` working turns changed nothing on the board`,` `,(0,m.jsx)(`span`,{className:`text-fg-muted`,children:v(k.idle,k.turns)})]}),k.unknown>0?(0,m.jsxs)(S,{children:[k.unknown,` `,k.unknown===1?`turn`:`turns`,` kept no transcript and could not be counted.`]}):null,(0,m.jsx)(C,{label:`By what woke them`,columns:[`Woken by`,`Turns`,`Did nothing`],rows:k.byTrigger.map(e=>[`${g[e.trigger]??e.trigger}${e.heartbeat===void 0?``:`, ${f[e.heartbeat]}`}`,e.turns,(0,m.jsx)(b,{part:e.idle,whole:e.turns},`idle`)])}),(0,m.jsx)(C,{label:`By citizen`,columns:[`Citizen`,`Turns`,`Did nothing`],rows:k.byAgent.map(e=>[(0,m.jsxs)(`span`,{children:[(0,m.jsx)(w,{name:e.agent}),e.role===null?null:(0,m.jsxs)(`span`,{className:`text-meta`,children:[` · `,e.role]})]},`who`),e.turns,(0,m.jsx)(b,{part:e.idle,whole:e.turns},`idle`)])})]}),(0,m.jsxs)(p,{title:`Work sent back`,children:[A.finished===0?(0,m.jsx)(S,{children:`No task finished in this window.`}):(0,m.jsxs)(x,{children:[A.tasksSentBack,` of `,A.finished,` finished tasks were sent back,`,` `,A.sendBacks,` `,A.sendBacks===1?`time`:`times`,` in all`]}),(0,m.jsx)(C,{label:`Where work came back from`,columns:[`Came back from`,`Times`],rows:A.byStage.map(e=>[`${e.project} · ${e.stage}`,e.count])}),(0,m.jsx)(C,{label:`Who sent work back`,columns:[`Sent back by`,`Times`],rows:A.bySender.map(e=>[(0,m.jsx)(w,{name:e.agent},`who`),e.count])})]}),(0,m.jsxs)(p,{title:`Messages per finished task`,children:[j.finished===0?(0,m.jsx)(S,{children:`No task finished in this window.`}):(0,m.jsxs)(x,{children:[y(j.messages/j.finished),` posts a task, across`,` `,j.finished,` finished `,j.finished===1?`task`:`tasks`]}),(0,m.jsx)(C,{label:`By project`,columns:[`Project`,`Tasks`,`Posts a task`],rows:j.byProject.map(e=>[e.project,e.finished,y(e.messages/e.finished)])}),(0,m.jsx)(C,{label:`Most talked-over tasks`,columns:[`Task`,`Posts`],rows:j.busiest.map(e=>[(0,m.jsx)(s,{kind:`task`,id:e.taskId,children:e.title},`task`),e.messages])})]}),(0,m.jsxs)(p,{title:`Wake latency`,children:[M.medianMs===null||M.slowestMs===null?(0,m.jsx)(S,{children:`No mention led to a turn in this window.`}):(0,m.jsxs)(x,{children:[i(M.medianMs),` from a mention to its turn, at the median; the slowest took`,` `,i(M.slowestMs)]}),M.unanswered>0?(0,m.jsxs)(S,{children:[M.unanswered,` `,M.unanswered===1?`mention has`:`mentions have`,` no turn yet.`]}):null,(0,m.jsx)(C,{label:`By citizen`,columns:[`Citizen`,`Mentions`,`Median`,`Slowest`],rows:M.byAgent.map(e=>[(0,m.jsx)(w,{name:e.agent},`who`),e.mentions,i(e.medianMs),i(e.slowestMs)])})]}),(0,m.jsxs)(p,{title:`Your decisions`,children:[N.total===0?(0,m.jsx)(S,{children:`You decided nothing in this window.`}):(0,m.jsxs)(x,{children:[N.total,` `,N.total===1?`decision`:`decisions`,`, about`,` `,y(N.total/F),` a day`]}),(0,m.jsx)(C,{label:`By day`,columns:[`Day`,`Proposals`,`Answers`,`Stages`],rows:N.byDay.map(e=>[_.format(new Date(`${e.day}T00:00:00Z`)),e.proposals,e.answers,e.stages])})]}),(0,m.jsx)(p,{title:`Blocked on a capability`,children:P.length===0?(0,m.jsx)(S,{children:`No task waited for a capability no runner offers.`}):(0,m.jsx)(`ul`,{className:`space-y-2`,children:P.map(e=>(0,m.jsxs)(`li`,{children:[(0,m.jsxs)(`p`,{className:`text-sm text-fg-primary`,children:[(0,m.jsx)(s,{kind:`task`,id:e.taskId,children:e.title??e.taskId}),(0,m.jsx)(`span`,{className:e.holds?`text-amber-300`:`text-fg-muted`,children:e.holds?` · blocked now`:` · cleared`})]}),(0,m.jsxs)(`p`,{className:`text-meta`,children:[e.summary,` · since `,a(e.firstAt,E)]})]},e.taskId))})})]})]})}export{E as MetricsView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,S as n,n as r,t as i,x as a}from"./format-BYF63sQU.js";import{o}from"./governance-BjIg0eok.js";import{S as s,_ as c,s as l}from"./index-CyROMh25.js";import{n as u,t as d}from"./Pane-pZUzNQIW.js";var f=t(),p=[{kind:`proposal`,label:`Proposals to decide`},{kind:`stage`,label:`Stages that name you`},{kind:`request`,label:`Asked of you`}],m=`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`;function h({title:e,meta:t}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{className:`text-title block truncate`,children:e}),(0,f.jsx)(`span`,{className:`mt-1 block truncate text-meta`,children:t})]})}function g(){let t=s(),g=n(),_=a(3e4),v=l(),y=e=>g.data?.find(t=>t.slug===e)?.name??e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d,{title:`Needs you`,subtitle:t.length===0?`Nothing waits on you`:`${t.length} waiting on you, oldest first`}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.length===0?(0,f.jsx)(u,{children:`Nothing waits on you.`}):p.map(({kind:n,label:a})=>{let s=t.filter(e=>e.kind===n);return s.length===0?null:(0,f.jsxs)(`section`,{className:`mb-3`,children:[(0,f.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[a,` · `,s.length]}),(0,f.jsx)(`ul`,{children:s.map(t=>{if(t.kind===`proposal`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:t.proposal.id},className:m,children:(0,f.jsx)(h,{title:o(t.proposal),meta:`proposed by ${v(t.proposal.proposedBy)} ${i(t.since,_)}`})})},t.proposal.id);if(t.kind===`stage`)return(0,f.jsx)(`li`,{children:(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:t.task.id},className:m,children:(0,f.jsx)(h,{title:t.task.title,meta:`${t.stage.name}${t.stage.gate?` (gate)`:``} in ${y(t.task.project)} · waiting since ${i(t.since,_)}`})})},t.task.id);let n=`${v(t.message.author)} in ${t.thread===null?`#${t.message.channel}`:t.thread.title} ${i(t.since,_)}`,a=(0,f.jsx)(h,{title:(0,f.jsx)(c,{text:r(t.message.body,160),links:!1}),meta:n}),s=t.thread?.subject;return(0,f.jsx)(`li`,{children:s?.kind===`task`?(0,f.jsx)(e,{to:`/task/$taskId`,params:{taskId:s.id},className:m,children:a}):s?.kind===`proposal`?(0,f.jsx)(e,{to:`/proposal/$proposalId`,params:{proposalId:s.id},className:m,children:a}):t.thread===null?(0,f.jsx)(e,{to:`/c/$`,params:{_splat:t.message.channel},className:m,children:a}):(0,f.jsx)(e,{to:`/thread/$threadId`,params:{threadId:t.thread.id},className:m,children:a})},t.message.id)})})]},n)})})]})}export{g as NeedsYouView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,X as n,k as r,n as i,t as a}from"./format-BYF63sQU.js";import{t as o}from"./CliIcon-D3GddnP4.js";import{_ as s}from"./index-CyROMh25.js";import{o as c}from"./citizen-B8p56JRh.js";var l=t();function u({title:e,aside:t,children:n}){return(0,l.jsxs)(`section`,{className:`border-t border-line pt-4 first:border-t-0 first:pt-0`,children:[(0,l.jsxs)(`h3`,{className:`flex items-baseline justify-between gap-2`,children:[(0,l.jsx)(`span`,{className:`text-section`,children:e}),t]}),(0,l.jsx)(`div`,{className:`mt-2`,children:n})]})}function d({members:t,scope:i}){let a=r(),s=n(a.data?.running??[]),u=n(a.data?.pending??[]);return t.length===0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Nobody yet.`}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:t.map(t=>{let n=s.filter(e=>e.agent===t.name).map(e=>e.scope),r=n.includes(i),a=u.some(e=>e.agent===t.name),d=r?`in a turn here`:n.length>0?`in a turn at ${n.map(c).join(` and `)}`:a?`queued`:`resting`;return(0,l.jsx)(`li`,{children:(0,l.jsxs)(e,{to:`/citizen/$name`,params:{name:t.name},search:r&&i!==`society`?{scope:i}:{},className:`flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-surface-2/50`,children:[(0,l.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center`,children:t.cli===null?null:(0,l.jsx)(o,{cli:t.cli,size:13})}),(0,l.jsx)(`span`,{className:`text-fg-primary`,children:t.name}),(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-fg-muted`,children:t.role}),(0,l.jsx)(`span`,{className:`shrink-0 text-xs ${n.length>0?`text-emerald-300`:a?`text-amber-300`:`text-fg-muted`}`,children:d})]})},t.name)})})}function f({scope:t,topics:n,now:r}){return n===void 0?(0,l.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):n.length===0?(0,l.jsx)(`p`,{className:`text-meta`,children:`No knowledge yet.`}):(0,l.jsx)(`ul`,{className:`-mx-2`,children:n.toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).map(n=>(0,l.jsx)(`li`,{children:(0,l.jsxs)(e,{to:`/knowledge/$scope/$topic`,params:{scope:t,topic:n.topic},className:`block rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-2/50`,children:[(0,l.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,l.jsx)(`span`,{className:`text-sm text-fg-primary`,children:n.topic}),(0,l.jsxs)(`span`,{className:`text-meta`,children:[`by `,n.updatedBy,` `,a(n.updatedAt,r)]})]}),(0,l.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:(0,l.jsx)(s,{text:i(n.body,240),links:!1})})]})},n.topic))})}export{u as n,f as r,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,K as n,O as r,Qn as i,S as a,Yn as o,c as s,d as c,g as l,j as u,l as d,qn as f,t as p,v as m,x as h,z as g}from"./format-BYF63sQU.js";import{n as _,t as v}from"./Button-DxGzriWQ.js";import{i as y,t as b}from"./tasks-D2Es55TQ.js";import{A as x}from"./index-CyROMh25.js";import{c as S,g as C,h as w,n as T,t as E}from"./Markdown-BSeWHBBA.js";import{n as D,r as O}from"./ThreadForms-CbFClyd0.js";import{n as k,r as A}from"./ChannelForms-C3m4IPnZ.js";import{n as j,t as M}from"./Pane-pZUzNQIW.js";import{n as N}from"./Picker-CDf6os_x.js";import{n as P,r as F,t as I}from"./Overview-D6kiK8sE.js";import{i as L,n as R,r as z,t as B}from"./FileTree-DSFN4sd8.js";var V=i(o(),1),H=t();function U({project:e,source:t,folder:n,nested:r,openings:i}){return(0,H.jsx)(L,{nested:r,children:S(n.entries).map(r=>{let a=n.path===``?r.name:`${n.path}/${r.name}`;if(r.kind===`dir`){let n=i.open.has(a);return(0,H.jsxs)(`li`,{children:[(0,H.jsx)(R,{name:r.name,open:n,onToggle:()=>i.toggle(a)}),n?(0,H.jsx)(W,{project:e,source:t,path:a,openings:i}):null]},`dir:${r.name}`)}return(0,H.jsx)(`li`,{children:(0,H.jsxs)(T,{source:t,path:a,className:`group ${z}`,children:[(0,H.jsx)(B,{}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-fg-secondary group-hover:text-fg-primary`,children:r.name}),r.size===null?null:(0,H.jsx)(`span`,{className:`shrink-0 text-meta whitespace-nowrap`,children:C(r.size)})]})},r.name)})})}function W({project:e,source:t,path:r,openings:i}){let a=s(t,r);if(a.data?.kind===`dir`)return(0,H.jsx)(U,{project:e,source:t,folder:a.data,nested:!0,openings:i});let o;return o=a.data?.kind===`file`||a.error instanceof n&&a.error.status===404?`Not on ${e.defaultBranch} now.`:a.error instanceof n&&a.error.status===503?`${w(e)}, is not connected.`:a.error===null?`Reading…`:a.error.message,(0,H.jsx)(L,{nested:!0,children:(0,H.jsx)(`li`,{className:`py-0.5 pl-[18px] text-meta`,children:o})})}function G({project:e,now:t}){let r={kind:`project`,slug:e.slug},i=s(r,``),a=e.defaultBranch,[o,c]=(0,V.useState)(new Set),l=e=>{c(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},u;if(i.data?.kind===`dir`){let{commit:n}=i.data;u=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`text-meta`,children:[a,` · committed by `,n.author,` `,p(n.at,t),` · `,n.id.slice(0,7)]}),i.data.entries.length===0?(0,H.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Nothing on `,a,` yet.`]}):(0,H.jsx)(U,{project:e,source:r,folder:i.data,nested:!1,openings:{open:o,toggle:l}})]})}else u=i.error instanceof n&&i.error.status===404?(0,H.jsxs)(`p`,{className:`text-meta`,children:[`Nothing on `,a,` yet.`]}):i.error instanceof n&&i.error.status===503?(0,H.jsxs)(`p`,{className:`text-meta`,children:[w(e),`, is not connected, so the project's files cannot be listed now.`]}):i.error===null?(0,H.jsxs)(`p`,{className:`text-meta`,children:[`Reading `,a,`…`]}):(0,H.jsx)(`p`,{className:`text-meta`,children:i.error.message});return(0,H.jsx)(P,{title:`Files`,aside:(0,H.jsx)(T,{source:r,path:``,className:`text-meta underline decoration-line underline-offset-2 hover:text-fg-primary`,children:`Browse the branch`}),children:u})}function K(e,t,n){let r=n.filter(n=>n.status===`active`&&t.members.includes(n.name)&&n.cli!==null&&!e.clis.includes(n.cli)).map(e=>`has no ${e.cli} for ${e.name}`);for(let n of t.requiredCapabilities)e.capabilities.includes(n)||r.push(`lacks ${n}`);return r}function q(e,t,n){return e.map(e=>({value:e.name,name:e.name,id:e.os,description:[e.name===t.runner?`here now`:``,e.status,e.clis.length===0?`offers no CLI yet`:e.clis.join(`, `),e.capabilities.join(`, `),...K(e,t,n)].filter(e=>e!==``).join(` · `)}))}function J({project:e,onDone:t}){let{api:i}=u(),a=f(),o=r(),s=m(),c=e.runner??``,[l,d]=(0,V.useState)(c),[p,h]=(0,V.useState)(null),g=_({mutationFn:t=>i.moveProject(e.slug,l,t),onSuccess:async e=>{await a.invalidateQueries({queryKey:[`projects`]}),e.released?.ok===!1?h({runner:e.project.runner??l,detail:e.released.detail}):t()}}),y=g.error instanceof n&&g.error.code===`SOURCE_AWAY`;return p===null?(0,H.jsxs)(`form`,{"aria-label":`Runner of ${e.slug}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),g.mutate(!1)},children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.data===void 0?(0,H.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`Reading the runners…`}):(0,H.jsx)(N,{label:`Runner`,choices:q(o.data,e,s.data??[]),value:l,onChange:e=>{d(e),g.reset()}}),(0,H.jsx)(v,{onClick:t,children:`Cancel`}),(0,H.jsx)(v,{variant:`primary`,type:`submit`,disabled:g.isPending||l===c||l===``,children:g.isPending?`Moving…`:`Move here`})]}),(0,H.jsx)(O,{error:g.error}),y&&!g.isPending?(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsx)(v,{onClick:()=>g.mutate(!0),children:`Move without them`})}):null]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line bg-surface-2/20 p-3`,children:[(0,H.jsxs)(`output`,{className:`block min-w-0 flex-1 text-sm text-fg-secondary`,children:[`On `,p.runner,`. `,p.detail,`.`]}),(0,H.jsx)(v,{onClick:t,children:`Done`})]})}function Y({project:e,onDone:t}){let{api:n}=u(),r=f(),[i,a]=(0,V.useState)(e.name),[o,s]=(0,V.useState)(e.defaultBranch),c={...i.trim()===e.name?{}:{name:i.trim()},...o.trim()===e.defaultBranch?{}:{default_branch:o.trim()}},l=_({mutationFn:()=>n.configureProject(e.slug,c),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`projects`]}),t()}}),d=Object.keys(c).length===0||i.trim()===``||o.trim()===``;return(0,H.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(),l.mutate()},children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{value:i,maxLength:120,"aria-label":`Project name`,onChange:e=>a(e.target.value),className:`${D} min-w-0 flex-1`}),(0,H.jsx)(`div`,{className:`w-36 shrink-0`,children:(0,H.jsx)(`input`,{value:o,maxLength:100,spellCheck:!1,"aria-label":`Default branch`,onChange:e=>s(e.target.value),className:`${D} font-mono`})}),(0,H.jsx)(v,{onClick:t,children:`Cancel`}),(0,H.jsx)(v,{variant:`primary`,type:`submit`,disabled:l.isPending||d,children:l.isPending?`Saving…`:`Save`})]}),(0,H.jsx)(O,{error:l.error})]})}function X(){let{slug:t}=x({from:`/p/$slug`}),n=a(),r=d(),i=m(),o=g(t),s=c(t),u=l(t),f=h(3e4),[_,S]=(0,V.useState)(!1),[C,w]=(0,V.useState)(!1),[T,D]=(0,V.useState)(!1),O=n.data?.find(e=>e.slug===t);if(O===void 0)return(0,H.jsx)(j,{children:n.data===void 0?`Reading the project…`:`There is no project ${t}.`});let N=(i.data??[]).filter(e=>e.status===`active`&&O.members.includes(e.name)),L=y(o.data??[]),R=s.data?.body.trim()??``;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(M,{title:O.name,subtitle:`${t} · ${O.repo??`a local repository`} · ${O.defaultBranch}${O.runner===void 0?``:` · on ${O.runner}`}`,trailing:(0,H.jsxs)(H.Fragment,{children:[_||O.archived!==void 0?null:(0,H.jsx)(v,{onClick:()=>S(!0),children:`Edit…`}),C||O.archived!==void 0||O.runner===void 0?null:(0,H.jsx)(v,{onClick:()=>w(!0),children:`Runner…`}),(0,H.jsx)(e,{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 →`})]})}),_?(0,H.jsx)(Y,{project:O,onDone:()=>S(!1)}):null,C?(0,H.jsx)(J,{project:O,onDone:()=>w(!1)}):null,T?(0,H.jsx)(A,{project:t,onDone:()=>D(!1)}):null,(0,H.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[O.archived===void 0?null:(0,H.jsxs)(`p`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-sm text-fg-secondary`,children:[`Archived `,p(O.archived.at,f),` by `,O.archived.by,`:`,` `,O.archived.reason,`.`]}),(0,H.jsx)(P,{title:`Channels`,aside:O.archived===void 0&&!T?(0,H.jsx)(v,{onClick:()=>D(!0),children:`New channel…`}):null,children:(0,H.jsx)(k,{channels:(r.data??[]).filter(e=>e.project===t),now:f})}),(0,H.jsx)(P,{title:`Members`,children:(0,H.jsx)(I,{members:N,scope:t})}),(0,H.jsx)(P,{title:`Tasks`,children:o.data===void 0?(0,H.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):L.length===0?(0,H.jsx)(`p`,{className:`text-meta`,children:`No tasks yet.`}):(0,H.jsx)(e,{to:`/p/$slug/tasks`,params:{slug:t},className:`flex flex-wrap gap-1.5`,children:L.map(e=>(0,H.jsxs)(`span`,{className:`rounded-md bg-surface-2/60 px-2 py-0.5 text-xs text-fg-secondary`,children:[e.tasks.length,` `,b.find(t=>t.phase===e.phase)?.label.toLowerCase()]},e.phase))})}),(0,H.jsx)(P,{title:`How a task ends`,children:(0,H.jsx)(`p`,{className:`text-sm text-fg-secondary`,children:O.onDone===`merge`?`When its last stage is done, the board merges task/<id> onto ${O.defaultBranch}.`:O.onDone===`ghpr`?`When its last stage is done, the board merges the pull request linked to it into ${O.defaultBranch} on GitHub.`:`When its last stage is done, it is done; nothing is merged.`})}),(0,H.jsx)(P,{title:`Dashboard`,aside:s.data?.updatedBy===void 0?void 0:(0,H.jsxs)(`span`,{className:`text-meta`,children:[`by `,s.data.updatedBy,s.data.updatedAt===void 0?``:` ${p(s.data.updatedAt,f)}`]}),children:s.data===void 0?(0,H.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):R===``?(0,H.jsx)(`p`,{className:`text-meta`,children:`Empty.`}):(0,H.jsx)(E,{text:R})}),(0,H.jsx)(P,{title:`Knowledge`,children:(0,H.jsx)(F,{scope:t,topics:u.data,now:f})}),(0,H.jsx)(G,{project:O,now:f},t)]})]})}export{X as ProjectView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,B as t,C as n,D as r,Jn as i,Jt as a,K as o,Kt as s,P as c,Qn as l,Qt as u,S as d,V as ee,Xt as f,Yn as p,Yt as m,_t as h,bt as g,gt as _,ht as v,j as y,mt as b,qn as te,t as x,v as ne,vt as re,w as ie,x as S,xt as C,z as ae}from"./format-BYF63sQU.js";import{n as w,t as T}from"./Button-DxGzriWQ.js";import{t as oe}from"./CliIcon-D3GddnP4.js";import{a as se}from"./tasks-D2Es55TQ.js";import{c as E,d as D,l as O,n as k,o as A,r as j,s as M}from"./governance-BjIg0eok.js";import{A as N,i as P,o as F,s as I}from"./index-CyROMh25.js";import{t as L}from"./BackLink-fxPmFUg8.js";import{t as R}from"./Markdown-BSeWHBBA.js";import{n as z,r as B}from"./ThreadForms-CbFClyd0.js";import{n as ce,t as V}from"./Pane-pZUzNQIW.js";import{t as H}from"./StickyList-D_ED_-LW.js";import{t as U}from"./SkillFileList-BUImALv9.js";import{StatusChip as W}from"./ProposalsView-DBGpcAPO.js";import{t as G}from"./SubjectThread-B5zvoRSd.js";var K=l(p(),1),q=i();function le({proposal:e}){let{api:t}=y(),n=te(),[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)(``),s=(0,K.useRef)(null);(0,K.useEffect)(()=>{r!==null&&s.current?.focus()},[r]);let c=w({mutationFn:()=>{let n=a.trim();return r===`reject`?t.reject({proposal_id:e.id,reason:n}):t.approve({proposal_id:e.id,...n===``?{}:{reason:n}})},onSuccess:()=>{let t=[[`proposals`],[`proposal`,e.id],[`threads`],[`thread`,e.id]];for(let e of t)n.invalidateQueries({queryKey:e});i(null),o(``)}});if(r===null)return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-4 py-3`,children:[(0,q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-meta`,children:`This proposal waits on you.`}),(0,q.jsx)(T,{onClick:()=>i(`reject`),children:`Reject`}),(0,q.jsx)(T,{variant:`primary`,onClick:()=>i(`approve`),children:`Approve`})]});let l=r===`approve`;return(0,q.jsxs)(`form`,{"aria-label":l?`Approve the proposal`:`Reject the proposal`,className:`space-y-2 border-t border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),c.mutate()},children:[(0,q.jsx)(`textarea`,{ref:s,value:a,rows:2,placeholder:l?`Why approve? Optional.`:`Why not?`,"aria-label":l?`Reason for approving`:`Reason for rejecting`,onChange:e=>o(e.target.value),className:`${z} resize-none`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(T,{onClick:()=>{i(null),c.reset()},children:`Cancel`}),(0,q.jsx)(T,{variant:`primary`,type:`submit`,disabled:c.isPending||!l&&a.trim()===``,children:c.isPending?`Deciding…`:l?`Confirm approval`:`Confirm rejection`})]}),(0,q.jsx)(B,{error:c.error})]})}function J({children:e}){return(0,q.jsx)(`dl`,{className:`mt-2 space-y-1.5`,children:e})}function Y({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`grid grid-cols-[9rem_1fr] gap-3 text-sm`,children:[(0,q.jsx)(`dt`,{className:`text-meta`,children:e}),(0,q.jsx)(`dd`,{className:`min-w-0 break-words text-fg-secondary`,children:t})]})}function X(e){return e.length===0?`none`:e.join(`, `)}function Z({name:e,change:t}){return(0,q.jsxs)(`span`,{className:`inline-block rounded-md px-1.5 py-px font-mono text-[11px] ${t===`added`?`bg-emerald-500/15 text-emerald-300`:t===`removed`?`bg-red-500/15 text-red-300 line-through`:`bg-surface-2/70 text-fg-tertiary`}`,children:[t===`added`?`+ `:t===`removed`?`− `:``,e]})}function Q({children:e}){return(0,q.jsx)(`div`,{className:`mt-2 rounded-xl bg-surface-2/30 px-3.5 py-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]`,children:e})}function $({next:e,current:t,compare:n}){let r=t===void 0?null:E(t,e),i=r!==null&&r.verbsAdded.length===0&&r.verbsRemoved.length===0&&r.changes.length===0&&!r.purposeChanged;return(0,q.jsxs)(q.Fragment,{children:[n?r===null?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`A new role: no charter by this name exists yet.`}):i?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:`The same as the charter the role has now.`}):(0,q.jsxs)(Q,{children:[(0,q.jsx)(`p`,{className:`text-caps`,children:`Against the charter it has now`}),r.verbsAdded.length+r.verbsRemoved.length===0?null:(0,q.jsxs)(`p`,{className:`mt-2 flex flex-wrap gap-1`,children:[r.verbsAdded.map(e=>(0,q.jsx)(Z,{name:e,change:`added`},e)),r.verbsRemoved.map(e=>(0,q.jsx)(Z,{name:e,change:`removed`},e))]}),r.changes.length===0?null:(0,q.jsx)(J,{children:r.changes.map(e=>(0,q.jsxs)(Y,{label:e.field,children:[e.from,` → `,(0,q.jsx)(`span`,{className:`text-fg-primary`,children:e.to})]},e.field))}),r.purposeChanged?(0,q.jsx)(`p`,{className:`mt-2 text-xs text-fg-secondary`,children:`The purpose is rewritten.`}):null]}):null,(0,q.jsxs)(J,{children:[(0,q.jsx)(Y,{label:`Role`,children:e.name}),(0,q.jsx)(Y,{label:`Purpose`,children:e.purpose}),(0,q.jsx)(Y,{label:`Verbs`,children:(0,q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.verbs.map(e=>(0,q.jsx)(Z,{name:e},e))})}),(0,q.jsx)(Y,{label:`Wake triggers`,children:X(e.wakeTriggers)}),(0,q.jsx)(Y,{label:`Replicas per project`,children:e.maxReplicas}),(0,q.jsx)(Y,{label:`Warm session`,children:e.resident?`yes`:`no`}),(0,q.jsx)(Y,{label:`Society role`,children:e.societyScope?`yes, in no project`:`no`}),(0,q.jsx)(Y,{label:`Reflects`,children:e.reflects?`yes`:`no`})]})]})}function ue({proposal:e,reallocation:t,current:n,compare:r}){let{role:i,changes:a,description:o}=t,s=e.provision?.changed,c=Array.isArray(s)?s.filter(e=>typeof e==`string`):null;return r&&n!=null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)($,{next:C(n,a),current:n,compare:!0}),(0,q.jsx)(J,{children:(0,q.jsx)(Y,{label:`Why`,children:o})})]}):(0,q.jsxs)(J,{children:[(0,q.jsx)(Y,{label:`Role`,children:i}),r&&n===null?(0,q.jsx)(Y,{label:`Role now`,children:`none by this name; approving it will fail`}):null,c===null?(0,q.jsxs)(q.Fragment,{children:[a.maxReplicas===void 0?null:(0,q.jsx)(Y,{label:`Replicas per project`,children:a.maxReplicas}),a.backlogThreshold===void 0?null:(0,q.jsx)(Y,{label:`Backlog per member`,children:a.backlogThreshold}),a.wakeTriggers===void 0?null:(0,q.jsx)(Y,{label:`Wake triggers`,children:X(a.wakeTriggers)}),a.verbs===void 0?null:(0,q.jsx)(Y,{label:`Verbs`,children:(0,q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:a.verbs.map(e=>(0,q.jsx)(Z,{name:e},e))})})]}):(0,q.jsx)(Y,{label:`Changed`,children:c.map(e=>(0,q.jsx)(`span`,{className:`block`,children:e},e))}),(0,q.jsx)(Y,{label:`Why`,children:o})]})}function de({proposal:t,slug:n,reason:r,members:i}){let a=d(),o=ae(n),s=a.data?.find(e=>e.slug===n),c=t.status===`proposed`,l=c?(i??[]).filter(e=>e.status===`active`&&e.memberships.includes(n)).map(e=>e.name):t.provision?.members??[],u=(o.data??[]).filter(se).length;return(0,q.jsxs)(J,{children:[(0,q.jsxs)(Y,{label:`Project`,children:[(0,q.jsx)(e,{to:`/p/$slug`,params:{slug:n},className:`hover:text-fg-primary`,children:s?.name??n}),s?.name===void 0||s.name===n?null:` · ${n}`]}),(0,q.jsx)(Y,{label:c?`Members who leave`:`Members who left`,children:Array.isArray(l)?X(l.filter(e=>typeof e==`string`)):`none`}),c?(0,q.jsx)(Y,{label:`Tasks in play`,children:o.data===void 0?`reading…`:u===0?`none`:`${u}: approval is refused`}):null,(0,q.jsx)(Y,{label:`Reason`,children:r})]})}function fe({proposal:e}){let t=e.skillFiles,n=ie(e.id,t!==void 0);if(t===void 0)return(0,q.jsx)(`p`,{className:`mt-2 text-sm text-fg-secondary`,children:e.status===`proposed`?`Files not taken yet.`:`The board took no files for it.`});if(n.data===void 0)return(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:n.isError?`Could not read its files.`:`Loading…`});let r=n.data.find(e=>e.path===`SKILL.md`),i=n.data.filter(e=>e.path!==`SKILL.md`);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(J,{children:(0,q.jsxs)(Y,{label:`Taken from`,children:[e.proposedBy,`'s home at`,` `,(0,q.jsx)(`span`,{className:`font-mono`,children:t.commit.slice(0,7)})]})}),r===void 0||r.text===null?null:(0,q.jsx)(Q,{children:(0,q.jsx)(R,{text:O(r.text)})}),i.length===0?null:(0,q.jsx)(`div`,{className:`mt-2`,children:(0,q.jsx)(U,{files:i})})]})}function pe({proposal:e,roles:t,members:n}){let r=e.status===`proposed`,{charter:i}=e;switch(e.kind){case`member`:{let e=_.safeParse(i);if(!e.success)break;let t=e.data;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(J,{children:[(0,q.jsx)(Y,{label:`Citizen`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,q.jsx)(oe,{cli:t.cli,size:13}),t.name]})}),(0,q.jsx)(Y,{label:`Role`,children:t.role}),(0,q.jsxs)(Y,{label:`CLI and model`,children:[t.cli,` · `,t.model??`cli default`]}),(0,q.jsx)(Y,{label:`Projects`,children:X(t.memberships)}),(0,q.jsx)(Y,{label:`Also follows`,children:X(t.subscriptions)}),t.homeRunner===void 0?null:(0,q.jsx)(Y,{label:`Runs on`,children:t.homeRunner})]}),t.seedInstructions===void 0?null:(0,q.jsxs)(Q,{children:[(0,q.jsx)(`p`,{className:`text-caps`,children:`Seed instructions`}),(0,q.jsx)(`div`,{className:`mt-1.5`,children:(0,q.jsx)(R,{text:t.seedInstructions})})]})]})}case`role`:{let n=M(e);if(n===null)break;return(0,q.jsx)($,{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,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(J,{children:[(0,q.jsx)(Y,{label:`Skill`,children:t.data.name}),(0,q.jsx)(Y,{label:`Summary`,children:t.data.summary})]}),(0,q.jsx)(fe,{proposal:e})]})}case`channel`:{let e=v.safeParse(i);if(!e.success)break;return(0,q.jsxs)(J,{children:[(0,q.jsxs)(Y,{label:`Channel`,children:[`#`,s(e.data.project,e.data.name)]}),(0,q.jsx)(Y,{label:`Purpose`,children:e.data.purpose})]})}case`retirement`:{let e=re.safeParse(i);if(!e.success)break;let t=n?.find(t=>t.name===e.data.agent);return(0,q.jsxs)(J,{children:[(0,q.jsxs)(Y,{label:`Citizen`,children:[(0,q.jsx)(F,{name:e.data.agent,members:n}),t===void 0?null:` · ${t.role}`]}),(0,q.jsx)(Y,{label:`Holds now`,children:t===void 0?`unknown`:t.claimsHeld===1?`1 stage`:`${t.claimsHeld} stages`}),(0,q.jsx)(Y,{label:`Reason`,children:e.data.reason})]})}case`archive`:{let t=b.safeParse(i);if(!t.success)break;return(0,q.jsx)(de,{proposal:e,slug:t.data.project,reason:t.data.reason,members:n})}case`reallocation`:{let n=h.safeParse(i);if(!n.success)break;return(0,q.jsx)(ue,{proposal:e,reallocation:n.data,current:t===void 0?void 0:t.find(e=>e.name===n.data.role)??null,compare:r})}}return(0,q.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-lg bg-surface-2/40 p-3 font-mono text-[11px] text-fg-tertiary`,children:JSON.stringify(i,null,2)})}var me=f({agent:u().optional(),channel:u().optional(),role:u().optional(),skill:u().optional(),replaced:m().optional(),releasedTasks:a(u()).optional(),project:u().optional()});function he({proposal:t}){let n=me.safeParse(t.provision??{});if(t.provision===void 0||!n.success)return null;let r=n.data,i=`text-fg-primary underline decoration-fg-muted underline-offset-2`;if(t.kind===`member`&&r.agent!==void 0)return(0,q.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,q.jsx)(e,{to:`/citizen/$name`,params:{name:r.agent},className:i,children:r.agent}),`.`]});if(t.kind===`channel`&&r.channel!==void 0)return(0,q.jsxs)(`p`,{className:`mt-1`,children:[`Created`,` `,(0,q.jsxs)(e,{to:`/c/$`,params:{_splat:r.channel},className:i,children:[`#`,r.channel]}),`.`]});if(t.kind===`retirement`&&r.agent!==void 0){let e=r.releasedTasks?.length??0;return(0,q.jsxs)(`p`,{className:`mt-1`,children:[`Retired `,r.agent,`; `,e===1?`1 stage went`:`${e} stages went`,` back to open.`]})}return t.kind===`archive`&&r.project!==void 0?(0,q.jsxs)(`p`,{className:`mt-1`,children:[`Archived`,` `,(0,q.jsx)(e,{to:`/p/$slug`,params:{slug:r.project},className:i,children:r.project}),`; its members left and its threads closed.`]}):r.role===void 0?r.skill===void 0?null:(0,q.jsxs)(`p`,{className:`mt-1`,children:[r.replaced===!0?`Replaced`:`Published`,` the society's skill `,r.skill,`.`]}):(0,q.jsxs)(`p`,{className:`mt-1`,children:[r.replaced===!0?`Rewrote`:`Added`,` the role `,r.role,`.`]})}function ge(){let{proposalId:i}=N({from:`/proposal/$proposalId`}),a=n(i),s=ne(),l=r(),u=c(),d=ee(),f=S(3e4),p=I(),m=t(d.data?.some(e=>e.id===i)===!0?i:null);if(a.data===void 0)return(0,q.jsx)(ce,{children:a.error instanceof o&&a.error.status===404?`There is no proposal ${i}.`:`Reading the proposal…`});let h=a.data,g=h.status===`proposed`,_=s.data?.find(e=>e.name===h.proposedBy)?.role,v=d.data?.find(e=>e.id===h.id),y=h.status===`rejected`?`Rejected`:`Approved`,b=k(h,{members:s.data??[],roles:l.data??[],skills:u.data??[]});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(V,{leading:(0,q.jsx)(L,{fallback:(0,q.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(h),subtitle:`${h.kind} proposal by ${p(h.proposedBy)} ${x(h.createdAt,f)}${g?` · for ${j(h,_)} to decide`:``}`,trailing:(0,q.jsx)(W,{status:h.status})}),(0,q.jsxs)(H,{stick:!1,follow:!1,ids:m.data?.messages.map(e=>e.id),className:`px-4 py-4`,children:[g?(0,q.jsxs)(`p`,{className:`rounded-lg bg-sky-400/10 px-3 py-2 text-xs leading-relaxed text-sky-200`,children:[`If approved: `,b]}):(0,q.jsxs)(`div`,{className:`rounded-lg bg-surface-2/40 px-3 py-2 text-xs leading-relaxed text-fg-secondary`,children:[(0,q.jsxs)(`p`,{children:[y,` by `,p(h.decidedBy??`someone`),h.decidedAt===void 0?``:` ${x(h.decidedAt,f)}`,h.reason===void 0?`.`:`: ${h.reason}`]}),(0,q.jsx)(he,{proposal:h})]}),h.body.trim()===``||v!==void 0?null:(0,q.jsxs)(`section`,{className:`mt-5`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:`Why`}),(0,q.jsx)(`div`,{className:`mt-2`,children:(0,q.jsx)(R,{text:h.body})})]}),(0,q.jsxs)(`section`,{className:`mt-5 border-t border-line pt-4`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:g?`What it would make`:h.status===`provisioned`?`What it made`:`What it proposed`}),(0,q.jsx)(pe,{proposal:h,roles:l.data,members:s.data})]}),(0,q.jsxs)(`section`,{"aria-label":`Thread`,className:`mt-5 border-t border-line pt-4`,children:[(0,q.jsx)(`h3`,{className:`text-section`,children:`Thread`}),v===void 0?(0,q.jsx)(`p`,{className:`mt-2 text-meta`,children:d.data===void 0?`Reading the thread…`:`No thread on this proposal.`}):(0,q.jsx)(G,{thread:v,now:f,empty:`Nothing said yet.`})]})]},h.id),v?.state===`open`?(0,q.jsx)(P,{target:{threadId:h.id},placeholder:`Write in the proposal's thread`}):null,D(h)?(0,q.jsx)(le,{proposal:h}):null]})}export{ge as ProposalView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,N as n,P as r,Qn as i,Yn as a,j as o,qn as s}from"./format-BYF63sQU.js";import{n as c,t as l}from"./Button-DxGzriWQ.js";import{l as u}from"./compose-CV4o6TMb.js";import{l as d}from"./governance-BjIg0eok.js";import{A as f}from"./index-CyROMh25.js";import{t as p}from"./BackLink-fxPmFUg8.js";import{t as m}from"./Markdown-BSeWHBBA.js";import{n as h,r as g}from"./ThreadForms-CbFClyd0.js";import{n as _,t as v}from"./Pane-pZUzNQIW.js";import{n as y}from"./Overview-D6kiK8sE.js";import{t as b}from"./SkillFileList-BUImALv9.js";var x=i(a(),1),S=t(),C=`grid size-7 shrink-0 place-items-center rounded-lg text-fg-tertiary hover:bg-surface-2/70 hover:text-fg-primary`;function w(){let{name:t}=f({from:`/skills/$name`}),i=r(),a=n(t),[o,s]=(0,x.useState)(!1),c=i.data?.find(e=>e.name===t);if(c===void 0)return(0,S.jsx)(_,{children:i.data===void 0?`Reading…`:`The society has no skill ${t}.`});let u=a.data?.find(e=>e.path===`SKILL.md`),h=a.data?.filter(e=>e.path!==`SKILL.md`)??[];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(v,{leading:(0,S.jsx)(p,{fallback:(0,S.jsx)(e,{to:`/society`,"aria-label":`Back to the society`,className:C,children:`←`})}),title:(0,S.jsx)(`span`,{title:c.name,children:c.name}),subtitle:c.summary===``?void 0:(0,S.jsx)(`span`,{title:c.summary,children:c.summary}),trailing:o?null:(0,S.jsx)(l,{onClick:()=>s(!0),children:`Remove…`})}),o?(0,S.jsx)(T,{name:c.name,onCancel:()=>s(!1)}):null,(0,S.jsx)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:a.data===void 0?(0,S.jsx)(`p`,{className:`text-meta`,children:a.isError?`Could not read its files.`:`Reading…`}):(0,S.jsxs)(S.Fragment,{children:[u===void 0||u.text===null?null:(0,S.jsx)(m,{text:d(u.text)}),h.length===0?null:(0,S.jsx)(y,{title:`Files`,children:(0,S.jsx)(b,{files:h})})]})})]})}function T({name:e,onCancel:t}){let{api:n}=o(),r=s(),i=u(),[a,d]=(0,x.useState)(``),f=(0,x.useRef)(null);(0,x.useEffect)(()=>f.current?.focus(),[]);let p=c({mutationFn:()=>n.removeSkill({name:e,reason:a.trim()}),onSuccess:async()=>{await i({to:`/society`}),await r.invalidateQueries({queryKey:[`skills`]})}});return(0,S.jsxs)(`form`,{"aria-label":`Remove ${e}`,className:`space-y-2 border-b border-line bg-surface-2/20 p-3`,onSubmit:e=>{e.preventDefault(),p.mutate()},children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`input`,{ref:f,value:a,"aria-label":`Reason`,placeholder:`Why it is wrong, superseded, or unused`,onChange:e=>d(e.target.value),className:`${h} min-w-0 flex-1`}),(0,S.jsx)(l,{onClick:t,children:`Cancel`}),(0,S.jsx)(l,{variant:`primary`,type:`submit`,disabled:p.isPending||a.trim()===``,children:p.isPending?`Removing…`:`Remove skill`})]}),(0,S.jsx)(g,{error:p.error})]})}export{w as SkillView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,D as t,F as n,Jn as r,P as i,Qn as a,S as o,Wt as s,Yn as c,g as l,l as u,v as d,x as f,yt as p}from"./format-BYF63sQU.js";import{t as m}from"./Button-DxGzriWQ.js";import{n as h,r as g}from"./ChannelForms-C3m4IPnZ.js";import{n as _,t as v}from"./Pane-pZUzNQIW.js";import{n as y,r as b,t as x}from"./Overview-D6kiK8sE.js";var S=a(c(),1),C=r();function w(){let e=n(),r=d(),a=o(),c=t(),w=i(),E=l(p),D=u(),O=f(3e4),[k,A]=(0,S.useState)(!1);if(e.data===void 0||r.data===void 0)return(0,C.jsx)(_,{children:`Reading the society…`});let j=r.data.filter(e=>e.cli!==null),M=j.filter(e=>e.status===`active`),N=j.filter(e=>e.status===`retired`),P=(c.data??[]).filter(e=>e.name!==s);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(v,{title:e.data.name,subtitle:`${M.length} citizens · ${a.data?.length??0} projects · ${P.length} roles`}),k?(0,C.jsx)(g,{project:null,onDone:()=>A(!1)}):null,(0,C.jsxs)(`div`,{className:`flex-1 space-y-5 overflow-y-auto px-4 py-4`,children:[(0,C.jsxs)(y,{title:`Citizens`,children:[(0,C.jsx)(x,{members:M,scope:p}),N.length===0?null:(0,C.jsxs)(`p`,{className:`mt-2 text-meta`,children:[`Retired: `,N.map(e=>e.name).join(`, `)]})]}),(0,C.jsx)(y,{title:`Channels`,aside:k?null:(0,C.jsx)(m,{onClick:()=>A(!0),children:`New channel…`}),children:(0,C.jsx)(h,{channels:(D.data??[]).filter(e=>e.project===null),now:O})}),(0,C.jsx)(y,{title:`Roles`,children:(0,C.jsx)(`ul`,{className:`space-y-2.5`,children:P.map(e=>{let t=M.filter(t=>t.role===e.name).length;return(0,C.jsxs)(`li`,{children:[(0,C.jsxs)(`p`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,C.jsx)(`span`,{className:`text-fg-primary`,children:e.name}),(0,C.jsxs)(`span`,{className:`text-meta`,children:[t===1?`1 member`:`${t} members`,e.resident?` · warm session`:``,e.societyScope?` · society role`:``]})]}),(0,C.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:e.purpose})]},e.name)})})}),(0,C.jsx)(y,{title:`Knowledge`,children:(0,C.jsx)(b,{scope:p,topics:E.data,now:O})}),(0,C.jsx)(y,{title:`Skills`,children:w.data===void 0?(0,C.jsx)(`p`,{className:`text-meta`,children:`Reading…`}):w.data.length===0?(0,C.jsx)(`p`,{className:`text-meta`,children:`None yet.`}):(0,C.jsx)(T,{skills:w.data})})]})]})}function T({skills:t}){return(0,C.jsx)(`ul`,{className:`-mx-2`,children:t.map(t=>(0,C.jsx)(`li`,{children:(0,C.jsxs)(e,{to:`/skills/$name`,params:{name:t.name},className:`block rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-2/50`,children:[(0,C.jsx)(`span`,{className:`block text-sm text-fg-primary`,children:t.name}),t.summary===``?null:(0,C.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:t.summary})]})},t.name))})}export{w as SocietyView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,Qn as n,S as r,St as i,Yn as a,t as o,v as s,x as c,z as l}from"./format-BYF63sQU.js";import{c as u,i as d,l as f,o as p,r as m,s as h,t as g}from"./tasks-D2Es55TQ.js";import{A as _,o as v}from"./index-CyROMh25.js";import{n as y,t as b}from"./Pane-pZUzNQIW.js";var x=n(a(),1),S=t();function C({task:e}){let t=h(e);return(0,S.jsx)(`ol`,{className:`flex gap-1`,"aria-hidden":`true`,children:e.stages.map((n,r)=>{let i=n.completedBy!==void 0,a=p(e,n),o=i?`bg-emerald-400/60`:a?e.status===`claimed`?`bg-fg-primary/90`:`bg-amber-300/80`:t===`abandoned`?`bg-surface-2/50`:`bg-surface-2`;return(0,S.jsx)(`li`,{title:`${r+1}. ${n.name} · ${m(n)}${n.gate?` · gate`:``}`,className:`h-1.5 min-w-3 flex-1 rounded-full ${o} ${n.gate?`ring-1 ring-sky-300/70 ring-offset-1 ring-offset-surface-1`:``}`},n.id)})})}var w=5;function T({task:t,members:n,now:r}){let a=h(t),s=i(t);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(e,{to:`/task/$taskId`,params:{taskId:t.id},className:`block rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/50`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{className:`text-title min-w-0 flex-1 truncate`,children:t.title}),(0,S.jsx)(`span`,{className:`shrink-0 text-meta`,children:u(t)})]}),(0,S.jsx)(`div`,{className:`mt-2`,children:(0,S.jsx)(C,{task:t})}),t.returned===void 0?null:(0,S.jsxs)(`p`,{className:`mt-1.5 truncate text-xs text-orange-300/90`,children:[`Sent back from `,f(t,t.returned.from),` by `,t.returned.by,` `,o(t.returned.at,r)]}),(0,S.jsx)(`p`,{className:`mt-1.5 truncate text-meta`,children:t.status===`claimed`&&a!==`landing`&&s!==void 0?(0,S.jsxs)(S.Fragment,{children:[s.name,` · held by `,(0,S.jsx)(v,{name:t.claimedBy??``,members:n})]}):t.status===`open`&&a!==`landing`&&s!==void 0?`${s.name} · waiting for ${m(s)} since ${o(t.stageSince,r)}`:a===`landing`?`landing task/${t.id} on the default branch`:`${a} ${o(t.updatedAt,r)}`})]})})}function E(){let{slug:e}=_({from:`/p/$slug/tasks`}),t=l(e),n=r(),i=s(),a=c(3e4),[o,u]=(0,x.useState)(new Set),f=n.data?.find(t=>t.slug===e),p=d(t.data??[]),m=p.filter(e=>e.phase!==`done`&&e.phase!==`abandoned`).reduce((e,t)=>e+t.tasks.length,0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(b,{title:`Tasks`,subtitle:`${f?.name??e} · ${m} in play · ${t.data?.length??0} in all`}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:t.data===void 0?(0,S.jsx)(y,{children:`Reading the tasks…`}):p.length===0?(0,S.jsx)(y,{children:`No tasks in this project yet.`}):p.map(e=>{let t=e.phase!==`done`&&e.phase!==`abandoned`||o.has(e.phase)?e.tasks:e.tasks.slice(0,w);return(0,S.jsxs)(`section`,{className:`mb-3`,children:[(0,S.jsxs)(`h3`,{className:`px-3 pt-2 pb-1 text-[11px] font-semibold tracking-wider text-fg-muted uppercase`,children:[g.find(t=>t.phase===e.phase)?.label,` · `,e.tasks.length]}),(0,S.jsx)(`ul`,{children:t.map(e=>(0,S.jsx)(T,{task:e,members:i.data,now:a},e.id))}),t.length<e.tasks.length?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(new Set([...o,e.phase])),className:`px-3 pt-1 text-xs text-fg-tertiary hover:text-fg-primary`,children:[`Show all `,e.tasks.length]}):null]},e.phase)})})]})}export{E as TasksView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Jn as t,n,t as r}from"./format-BYF63sQU.js";import{_ as i,s as a}from"./index-CyROMh25.js";var o=t();function s(e){return e?.kind??`topic`}function c({state:e}){return(0,o.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 l(){return(0,o.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5`,children:(0,o.jsx)(`path`,{d:`M4 2.5v6A2.5 2.5 0 0 0 6.5 11H13m-3-3 3 3-3 3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function u({thread:t,now:c}){let u=a(),d=t.state===`open`,f=d?``:n(t.body,180),p=d?void 0:t.closedAt,m=p??t.openedAt;return(0,o.jsxs)(e,{to:`/thread/$threadId`,params:{threadId:t.id},className:`group flex gap-3 px-4 py-1`,children:[(0,o.jsx)(`span`,{title:t.state,className:`grid h-5 w-7 shrink-0 place-items-center ${d?`text-emerald-400 group-hover:text-emerald-300`:`text-fg-muted group-hover:text-fg-tertiary`}`,children:(0,o.jsx)(l,{})}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,o.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm text-fg-tertiary`,children:[u(t.openedBy),` opened `,s(t.subject),` thread`,` `,(0,o.jsx)(`span`,{className:`text-fg-secondary group-hover:text-fg-primary`,children:t.title}),(0,o.jsxs)(`span`,{className:`sr-only`,children:[`, `,t.state]})]}),(0,o.jsx)(`time`,{dateTime:m,title:`${p===void 0?`opened`:`closed`} ${m}`,className:`shrink-0 text-meta`,children:r(m,c)})]}),f===``?null:(0,o.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-sm leading-relaxed text-fg-secondary`,children:(0,o.jsx)(i,{text:f,links:!1})})]})]})}export{u as n,s as r,c as t};
|