@venizia/vulcan 0.4.10-2 → 0.4.10-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -18
- package/base/hooks/guard-outside.ts +10 -19
- package/base/hooks/guard-writes.ts +3 -24
- package/base/make/vulcan.mk +1 -4
- package/base/rules.md +4 -4
- package/base/skills/visualize-work/SKILL.md +1 -1
- package/base/skills/visualize-work/references/spec.md +1 -1
- package/base/templates/board.html +10 -110
- package/package.json +3 -3
- package/src/agents/resolve.ts +1 -0
- package/src/board/command.ts +16 -1
- package/src/board/common/constants.ts +2 -0
- package/src/board/common/types.ts +2 -2
- package/src/board/page.ts +57 -5
- package/src/board/schema.ts +4 -1
- package/src/board/server.ts +13 -2
- package/src/board/settings.ts +1 -1
- package/src/commands/graph.command.ts +6 -0
- package/src/commands/help.command.ts +2 -63
- package/src/commands/index.ts +2 -0
- package/src/commands/sync.command.ts +5 -1
- package/src/commands/table.ts +327 -0
- package/src/commit/check.ts +1 -0
- package/src/commit/common/constants.ts +2 -0
- package/src/commit/hook.ts +44 -4
- package/src/common/constants.ts +7 -3
- package/src/common/env-variables.ts +37 -0
- package/src/common/index.ts +1 -0
- package/src/config/loader.ts +22 -0
- package/src/config/schema.ts +162 -20
- package/src/create/add-app.ts +5 -0
- package/src/create/common/constants.ts +5 -3
- package/src/create/preset.ts +1 -0
- package/src/create/scratch.ts +2 -1
- package/src/doctor/checks.ts +106 -4
- package/src/doctor/common/constants.ts +26 -0
- package/src/doctor/runner.ts +3 -0
- package/src/doctor/schema.ts +4 -0
- package/src/hooks/owner-reply.ts +5 -0
- package/src/hooks/project-guards.ts +28 -4
- package/src/hooks/project-tmp.ts +39 -4
- package/src/hooks/session-digest.ts +9 -0
- package/src/init/scaffold.ts +1 -0
- package/src/local/auto-clean.ts +2 -1
- package/src/local/browser-socket.ts +33 -0
- package/src/local/clean.ts +1 -0
- package/src/local/index.ts +1 -0
- package/src/local/scan.ts +33 -9
- package/src/manifest/render.ts +70 -9
- package/src/owner/constants.ts +3 -1
- package/src/owner/profile.ts +1 -0
- package/src/owner/schema.ts +37 -6
- package/src/router.ts +4 -130
- package/src/rules/base.ts +1 -0
- package/src/signals/loop.ts +1 -0
- package/src/skills/frontmatter.ts +1 -0
- package/src/sync/claude-launch.ts +12 -12
- package/src/sync/local-choice.ts +32 -3
- package/src/sync/planner.ts +1 -0
- package/src/theme/index.ts +1 -0
- package/src/theme/tokens.ts +410 -0
- package/src/ui/prompt.ts +1 -0
- package/src/visualize/page.ts +4 -4
- package/src/visualize/render.ts +2 -1
- package/src/visualize/theme.ts +43 -12
- package/src/wiki/anchors.ts +1 -0
|
@@ -4,143 +4,43 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Board</title>
|
|
7
|
+
<!--BOARD_TOKENS-->
|
|
7
8
|
<style>
|
|
8
|
-
/* One screen: a top bar, the flow list (left) and the flow detail (right), and the dock of agents below.
|
|
9
|
+
/* One screen: a top bar, the flow list (left) and the flow detail (right), and the dock of agents below. Colours come from the design tokens (the style above); only the panes and the mascot keep their own. */
|
|
9
10
|
:root {
|
|
10
11
|
--font: 'Inter Display','Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
|
|
11
12
|
--mono: 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
|
|
12
|
-
--r: 4px;
|
|
13
13
|
--gap: 8px;
|
|
14
14
|
--bar: 56px;
|
|
15
15
|
--ease-out: cubic-bezier(.22,1,.36,1);
|
|
16
|
-
--ground: #f5f5f5;
|
|
17
|
-
--bg: #ffffff;
|
|
18
|
-
--head: #fafafa;
|
|
19
|
-
--soft: #f2f2f2;
|
|
20
|
-
--sunk: #f7f7f7;
|
|
21
|
-
--line: #0000001a;
|
|
22
16
|
--line-2: #00000033;
|
|
23
|
-
--ink: #000000;
|
|
24
|
-
--body: #4b4b4b;
|
|
25
|
-
--muted: #6b6b6b;
|
|
26
|
-
--accent: #8a5a20;
|
|
27
|
-
--accent-soft: #f5ecdf;
|
|
28
|
-
--accent-ink: #ffffff;
|
|
29
|
-
--fail: #b42318;
|
|
30
|
-
--fail-soft: #fdecea;
|
|
31
|
-
--ok: #067647;
|
|
32
|
-
--ok-soft: #e7f5ee;
|
|
33
|
-
--wait: #8a4b00;
|
|
34
|
-
--wait-soft: #fdf1dc;
|
|
35
|
-
--focus: #8a5a20;
|
|
36
17
|
color-scheme: light;
|
|
37
|
-
--stroke-strong: #101010;
|
|
38
18
|
--face-ink: #18181b;
|
|
39
19
|
--cheek: #e8a8a0;
|
|
40
20
|
}
|
|
41
21
|
@media (prefers-color-scheme: dark) {
|
|
42
22
|
:root:not([data-theme='light']):not([data-board-theme='light']) {
|
|
43
|
-
--ground: #121214;
|
|
44
|
-
--bg: #1b1b1b;
|
|
45
|
-
--head: #202024;
|
|
46
|
-
--soft: #26262b;
|
|
47
|
-
--sunk: #232327;
|
|
48
|
-
--line: #ffffff1a;
|
|
49
23
|
--line-2: #ffffff33;
|
|
50
|
-
--ink: #ffffff;
|
|
51
|
-
--body: #ffffffb3;
|
|
52
|
-
--muted: #ffffff8c;
|
|
53
|
-
--accent: #dead6a;
|
|
54
|
-
--accent-soft: #33281a;
|
|
55
|
-
--accent-ink: #1a1200;
|
|
56
|
-
--fail: #f97066;
|
|
57
|
-
--fail-soft: #3a1d1a;
|
|
58
|
-
--ok: #47cd89;
|
|
59
|
-
--ok-soft: #14291f;
|
|
60
|
-
--wait: #fdb022;
|
|
61
|
-
--wait-soft: #33270f;
|
|
62
|
-
--focus: #dead6a;
|
|
63
24
|
color-scheme: dark;
|
|
64
|
-
--stroke-strong: #ffffff4d;
|
|
65
25
|
--face-ink: #f4f4f5;
|
|
66
26
|
--cheek: #b8706a;
|
|
67
27
|
}
|
|
68
28
|
}
|
|
69
29
|
:root[data-theme='dark'] {
|
|
70
|
-
--ground: #121214;
|
|
71
|
-
--bg: #1b1b1b;
|
|
72
|
-
--head: #202024;
|
|
73
|
-
--soft: #26262b;
|
|
74
|
-
--sunk: #232327;
|
|
75
|
-
--line: #ffffff1a;
|
|
76
30
|
--line-2: #ffffff33;
|
|
77
|
-
--ink: #ffffff;
|
|
78
|
-
--body: #ffffffb3;
|
|
79
|
-
--muted: #ffffff8c;
|
|
80
|
-
--accent: #dead6a;
|
|
81
|
-
--accent-soft: #33281a;
|
|
82
|
-
--accent-ink: #1a1200;
|
|
83
|
-
--fail: #f97066;
|
|
84
|
-
--fail-soft: #3a1d1a;
|
|
85
|
-
--ok: #47cd89;
|
|
86
|
-
--ok-soft: #14291f;
|
|
87
|
-
--wait: #fdb022;
|
|
88
|
-
--wait-soft: #33270f;
|
|
89
|
-
--focus: #dead6a;
|
|
90
31
|
color-scheme: dark;
|
|
91
|
-
--stroke-strong: #ffffff4d;
|
|
92
32
|
--face-ink: #f4f4f5;
|
|
93
33
|
--cheek: #b8706a;
|
|
94
34
|
}
|
|
95
35
|
:root[data-board-theme='dark'] {
|
|
96
|
-
--ground: #121214;
|
|
97
|
-
--bg: #1b1b1b;
|
|
98
|
-
--head: #202024;
|
|
99
|
-
--soft: #26262b;
|
|
100
|
-
--sunk: #232327;
|
|
101
|
-
--line: #ffffff1a;
|
|
102
36
|
--line-2: #ffffff33;
|
|
103
|
-
--ink: #ffffff;
|
|
104
|
-
--body: #ffffffb3;
|
|
105
|
-
--muted: #ffffff8c;
|
|
106
|
-
--accent: #dead6a;
|
|
107
|
-
--accent-soft: #33281a;
|
|
108
|
-
--accent-ink: #1a1200;
|
|
109
|
-
--fail: #f97066;
|
|
110
|
-
--fail-soft: #3a1d1a;
|
|
111
|
-
--ok: #47cd89;
|
|
112
|
-
--ok-soft: #14291f;
|
|
113
|
-
--wait: #fdb022;
|
|
114
|
-
--wait-soft: #33270f;
|
|
115
|
-
--focus: #dead6a;
|
|
116
37
|
color-scheme: dark;
|
|
117
|
-
--stroke-strong: #ffffff4d;
|
|
118
38
|
--face-ink: #f4f4f5;
|
|
119
39
|
--cheek: #b8706a;
|
|
120
40
|
}
|
|
121
41
|
:root[data-board-theme='light'] {
|
|
122
|
-
--ground: #f5f5f5;
|
|
123
|
-
--bg: #ffffff;
|
|
124
|
-
--head: #fafafa;
|
|
125
|
-
--soft: #f2f2f2;
|
|
126
|
-
--sunk: #f7f7f7;
|
|
127
|
-
--line: #0000001a;
|
|
128
42
|
--line-2: #00000033;
|
|
129
|
-
--ink: #000000;
|
|
130
|
-
--body: #4b4b4b;
|
|
131
|
-
--muted: #6b6b6b;
|
|
132
|
-
--accent: #8a5a20;
|
|
133
|
-
--accent-soft: #f5ecdf;
|
|
134
|
-
--accent-ink: #ffffff;
|
|
135
|
-
--fail: #b42318;
|
|
136
|
-
--fail-soft: #fdecea;
|
|
137
|
-
--ok: #067647;
|
|
138
|
-
--ok-soft: #e7f5ee;
|
|
139
|
-
--wait: #8a4b00;
|
|
140
|
-
--wait-soft: #fdf1dc;
|
|
141
|
-
--focus: #8a5a20;
|
|
142
43
|
color-scheme: light;
|
|
143
|
-
--stroke-strong: #101010;
|
|
144
44
|
--face-ink: #18181b;
|
|
145
45
|
--cheek: #e8a8a0;
|
|
146
46
|
}
|
|
@@ -426,7 +326,7 @@
|
|
|
426
326
|
}
|
|
427
327
|
.ev .lk {
|
|
428
328
|
font-size: 12px;
|
|
429
|
-
color: var(--accent);
|
|
329
|
+
color: var(--accent-text);
|
|
430
330
|
text-decoration: none;
|
|
431
331
|
word-break: break-all;
|
|
432
332
|
}
|
|
@@ -992,7 +892,7 @@
|
|
|
992
892
|
}
|
|
993
893
|
.b-work {
|
|
994
894
|
background: var(--accent-soft);
|
|
995
|
-
color: var(--accent);
|
|
895
|
+
color: var(--accent-text);
|
|
996
896
|
}
|
|
997
897
|
.b-idle {
|
|
998
898
|
background: var(--soft);
|
|
@@ -1045,7 +945,7 @@
|
|
|
1045
945
|
color: var(--muted);
|
|
1046
946
|
}
|
|
1047
947
|
.c-ref {
|
|
1048
|
-
color: var(--accent);
|
|
948
|
+
color: var(--accent-text);
|
|
1049
949
|
font-weight: 600;
|
|
1050
950
|
font-size: 12px;
|
|
1051
951
|
}
|
|
@@ -1115,7 +1015,7 @@
|
|
|
1115
1015
|
}
|
|
1116
1016
|
.c-chips span.h {
|
|
1117
1017
|
background: var(--accent-soft);
|
|
1118
|
-
color: var(--accent);
|
|
1018
|
+
color: var(--accent-text);
|
|
1119
1019
|
font-weight: 700;
|
|
1120
1020
|
}
|
|
1121
1021
|
.c-gh {
|
|
@@ -1304,7 +1204,7 @@
|
|
|
1304
1204
|
.d-tag {
|
|
1305
1205
|
font-size: 11px;
|
|
1306
1206
|
font-weight: 700;
|
|
1307
|
-
color: var(--accent);
|
|
1207
|
+
color: var(--accent-text);
|
|
1308
1208
|
background: var(--accent-soft);
|
|
1309
1209
|
border-radius: var(--r);
|
|
1310
1210
|
padding: 0 6px;
|
|
@@ -1363,9 +1263,9 @@
|
|
|
1363
1263
|
<body>
|
|
1364
1264
|
<div id="root"></div>
|
|
1365
1265
|
<!--BOARD_DATA-->
|
|
1366
|
-
<script>(()=>{var y,mt,un,Z,Ve,Ne,ft,be,pt,ze,He,gt,me=Symbol.for("pv"),Se={},Te=[],_n=/^m(i|n|o|s|text|space)$/,Ae=Array.isArray,ht=Te.slice,ne=Object.assign;function te(e){e&&e.parentNode&&e.remove()}function Ee(e,t,n,s,o){var i={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:me,__v:o||++mt,__i:-1,__u:0};return!o&&y.vnode&&y.vnode(i),i}function N(e){return e.children}function J(e,t){this.props=e,this.context=t,this.__g=0}function Q(e,t){if(t==null)return e.__&&Q(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!="function"||e.props.__P?null:Q(e)}function yt(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),yt(e)}function We(e){(8&e.__g||(e.__g|=8,Z.push(e),Ne++))&&Ve==y.debounceRendering||((Ve=y.debounceRendering)||queueMicrotask)(vt)}function vt(){var e,t,n,s,o,i,r,l,u;try{for(t=1;Z.length;)Z.length>t&&Z.sort(ft),e=Z.shift(),t=Z.length,8&e.__g&&(s=void 0,o=void 0,i=(o=(n=e).__v).__e,r=[],l=[],(u=n.__P)&&((s=ne({constructor:me},o)).__v=o.__v+1,y.vnode&&y.vnode(s),Ke(u,s,o,n.__n,u.namespaceURI,32&o.__u?[i]:null,r,i||Q(o),32&o.__u,l),s.__v=o.__v,s.__.__k[s.__i]=s,Et(r,s,l),o.__=o.__e=null,s.__e!=i&&yt(s)))}finally{(Ne=Z.length)&&(Ve||queueMicrotask)(vt)}}function kt(e,t,n,s,o,i,r,l,u,_,c){var f,m,d,p,w,h,b=s.__k||Te,v=t.length;for(u=mn(n,t,b,u,v),f=0;f<v;f++)(d=n.__k[f])!=null&&(m=~d.__i&&b[d.__i]||Se,d.__i=f,h=Ke(e,d,m,o,i,r,l,u,_,c),p=d.__e,(m.ref!=d.ref||8&m.__u)&&(m.ref&&Xe(m.ref,null,d,m),d.ref&&c.push(d.ref,d.__c||p,d)),w=w||p,4&d.__u?(u=wt(d,u,e,!m.__v),m.__e&&(m.__e=null)):typeof d.type=="function"&&h!==void 0?u=h:p&&(u=p.nextSibling),d.__u&=-21);return n.__e=w,u}function mn(e,t,n,s,o){var i,r,l,u,_,c,f,m,d,p=n.length,w=p,h=0,b=0,v=e.__k=Array(o);for(i=0;i<o;i++)(r=t[i])!=null&&typeof r!="boolean"&&typeof r!="function"?(typeof r!="object"||r.constructor===String?r=v[i]=Ee(null,r):Ae(r)?r=v[i]=Ee(N,{children:r}):r.constructor===me&&r.__b?r=v[i]=Ee(r.type,r.props,r.key,r.ref,r.__v):v[i]=r,u=i+h,r.__=e,r.__b=e.__b+1,l=null,~(_=r.__i=fn(r,n,u,w))&&(w--,(l=n[_])&&(l.__u|=2)),l&&l.__v?(r.__u|=16,_==u-1?h--:_==u+1?h++:_!=u&&(_>u?h--:h++,b=1)):(~_||(o>p?h--:o<p&&h++),typeof r.type!="function"&&(r.__u|=4))):v[i]=null;if(b){for(c=[],f=[],i=0;i<o;i++)if((r=v[i])&&16&r.__u){for(h=0,m=c.length;h<m;)c[d=h+m>>1]<r.__i?h=d+1:m=d;c[h]=r.__i,f[i]=h+1}for(h=c.length;i--;)f[i]&&(f[i]==h?h--:v[i].__u|=4)}if(w)for(i=0;i<p;i++)!(l=n[i])||2&l.__u||(l.__e==s&&(s=Q(l)),je(l,l));return s}function wt(e,t,n,s){var o,i,r,l;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&(o[i].__=e,t=wt(o[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=Q(e))&&!t.parentNode&&(t=null),r=e.__e,l=t;l&&l.nodeType==8;)l=l.nextSibling;for(r!=l&&(!s&&n.moveBefore&&r.parentNode?n.moveBefore(r,t):n.insertBefore(r,t||null)),t=r;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function Ie(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(Ae(e)?e.some(function(n){Ie(n,t)}):t.push(e)),t}function fn(e,t,n,s){var o,{key:i,type:r}=e,l=t[n],u=l&&!(2&l.__u);if(l===null&&i==null||u&&i==l.key&&r==l.type)return n;if(s>(u?1:0)){for(o=n-1;o>=0;o--)if((l=t[o])&&!(2&l.__u)&&i==l.key&&r==l.type)return o;for(o=n+1;o<t.length;o++)if((l=t[o])&&!(2&l.__u)&&i==l.key&&r==l.type)return o}return-1}function _t(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function we(e,t,n,s,o){var i,r;if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||_t(e.style,t);if(n)for(t in n)s&&n[t]==s[t]||_t(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")(e.__e||(e.__e={}))[t]=n,n&&s||(r=He[t]||(He[t]=pn(t)),(e.__a||(e.__a={}))[t]=ze,i=t!=(t=t.replace(pt,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,r,i):e.removeEventListener(t,r,i));else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{return void(e[t]=n==null?"":n)}catch(l){}if(typeof n=="function")return;n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n)}}function pn(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[be]==null)t[be]=ze++;else if(t[be]<this.__a[e])return;return n(y.event?y.event(t):t)}}}function Ke(e,t,n,s,o,i,r,l,u,_){var c,f,m,d,p,w,h,b,v,S,g,E,Y,oe,M,L,z,V,W=t.type;if(t.constructor!==me)return null;128&n.__u&&(u=32&n.__u,c=n.__c.__z)&&(t.__u|=u,f=i=[],c.nodeType==8?l=Ge(c,i):i.push(c),l=i[0]||l),(c=y.__b)&&c(t);e:if(typeof W=="function"){m=r.length;try{if(b=t.props,v=(c=W.prototype)&&c.render,S=(c=W.contextType)&&s[c.__c],g=c?S?S.props.value:c.__:s,(d=n.__c)?(t.__c=d,2&d.__g&&(d.__g|=1)):(v?t.__c=d=new W(b,g):(t.__c=d=new J(b,g),d.constructor=W,d.render=hn),S&&S.sub(d),d.state||(d.state={}),d.__n=s,d.__g|=8,d.__h=[],d.__k=[]),v&&(d.__s||(d.__s=d.state),W.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ne({},d.__s)),ne(d.__s,W.getDerivedStateFromProps(b,d.__s)))),p=d.props,w=d.state,d.__v=t,n.__c){if(b!==p&&v&&!W.getDerivedStateFromProps&&d.componentWillReceiveProps&&d.componentWillReceiveProps(b,g),t.__v==n.__v&&!(8&d.__g)||!(4&d.__g)&&d.shouldComponentUpdate&&d.shouldComponentUpdate(b,d.__s,g)===!1){t.__v!=n.__v&&(d.props=b,d.state=d.__s,d.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(x){x&&(x.__=t)}),Te.push.apply(d.__h,d.__k),d.__k=[],d.__h.length&&r.push(d),l=Q(n);break e}d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,g),v&&d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,w,h)})}else v&&!W.getDerivedStateFromProps&&d.componentWillMount&&d.componentWillMount(),v&&d.componentDidMount&&d.__h.push(d.componentDidMount);if(d.context=g,d.props=b,d.__P=e,d.__g&=-5,E=y.__r,Y=0,v)d.state=d.__s,d.__g&=-9,E&&E(t),c=d.render(d.props,d.state,d.context),Te.push.apply(d.__h,d.__k),d.__k=[];else do d.__g&=-9,E&&E(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(8&d.__g&&++Y<25);d.state=d.__s,d.getChildContext&&(s=ne({},s,d.getChildContext())),v&&n.__c&&d.getSnapshotBeforeUpdate&&(h=d.getSnapshotBeforeUpdate(p,w)),oe=c&&c.type===N&&c.key==null?c.props.children:c,b.__P&&(c=l,o=(e=b.__P).namespaceURI,u=i=null,n.props&&n.props.__P!=e&&(n.__k.some(function(x){x&&je(x,x)}),n.__k=null),l=n.__k?Q(n,0):null),l=kt(e,Ae(oe)?oe:[oe],t,n,s,o,i,r,l,u,_),b.__P&&(t.__e=null,l=c),t.__u&=-161,f&&f.some(te),d.__h.length&&r.push(d),1&d.__g&&(d.__g&=-4)}catch(x){if(r.length=m,t.__v=null,u||i)if(x.then){if(M=0,t.__u|=128|u,i){for(~(z=i.indexOf(l||void 0))||(z=i.length);(V=i[z-1])&&V.nodeType==8;)z--;for(;z<i.length;z++)if(V=i[z]){if(i[z]=null,V.nodeType==8){if(V.data.startsWith("$s"))M++||(L=V);else if(M&&V.data.startsWith("/$s")&&!--M)break}else if(!M)break}}if(!L){for(;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;L=l}(c=Ge(L=t.__c.__z||(t.__c.__z=L)))?(t.__e=L,l=c):t.__e=l,l=l&&l.nextSibling}else i&&i.some(te);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),x.then||bt(t),y.__e(x,t,n)}}else l=t.__e=gn(n.__e,t,n,s,o,i,r,u,_,e);return(c=y.diffed)&&c(t),l}function Ge(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))n++;else if(e.data.startsWith("/$s")&&!--n)return e}t&&t.push(e)}}function bt(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(bt))}function Et(e,t,n){for(var s=0;s<n.length;)Xe(n[s++],n[s++],n[s++]);y.__c&&y.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){y.__e(i,o.__v)}})}function gn(e,t,n,s,o,i,r,l,u,_){var c,f,m,d,p,w,h,b,v,S=n.props||Se,{props:g,type:E}=t;if(E=="svg"?o="http://www.w3.org/2000/svg":E=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i){for(c=0;c<i.length;c++)if((p=i[c])&&(E?p.localName==E:p.nodeType==3)){e=p,i[c]=null;break}}if(!e){if(b=_.ownerDocument||document,!E)return b.createTextNode(g);e=b.createElementNS(o,E,g.is&&g),l&&(y.__m&&y.__m(t,i),l=!1),i=null}if(E){if(_=E=="template"&&e.content||e,i=E=="textarea"&&g.defaultValue!=null?null:i&&ht.call(_.childNodes),!l&&i)for(S={},c=0;c<e.attributes.length;c++)S[(p=e.attributes[c]).name]=p.value;for(c in S)p=S[c],c=="dangerouslySetInnerHTML"?m=p:c=="children"||(c in g)||c=="value"&&("defaultValue"in g)||c=="checked"&&("defaultChecked"in g)||we(e,c,null,p,o);for(c in v=1&n.__u,g)p=g[c],c=="children"?d=p:c=="dangerouslySetInnerHTML"?f=p:c=="value"?w=p:c=="checked"?h=p:l&&typeof p!="function"||!(S[c]!==p||v&&p!=null)||we(e,c,p,S[c],o);f?(l||m&&(f.__html==m.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(m&&(e.textContent=""),(E=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&_n.test(E))&&(o="http://www.w3.org/1999/xhtml"),kt(_,Ae(d)?d:[d],t,n,s,o,i,r,i?i[0]:n.__k&&Q(n,0),l,u),i&&i.some(te)),l&&E!="textarea"||(c="value",E=="progress"&&w==null?e.removeAttribute(c):w==null||w===e[c]&&(E!="progress"||w)||we(e,c,w,S[c],o),c="checked",h!=null&&h!=e[c]&&we(e,c,h,S[c],o))}else S===g||l&&e.data==g||(e.data=g);return e}function Xe(e,t,n,s){try{typeof e=="function"?t?t.__x=e(t)||1:s&&(s=s.__c||s.__e)&&(t=s.__x)&&(s.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){y.__e(o,n)}}function je(e,t,n){var s,o,i,r;if(y.unmount&&y.unmount(e),!(s=e.ref)||s.current&&s.current!=e.__e||Xe(s,null,t,e),s=e.__c){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(l){y.__e(l,t)}s.__P=s.__n=null}if(s=e.__k)for(r=0;r<s.length;r++)s[r]&&je(s[r],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(s=e.__c)&&(s=s.__z)&&(o=Ge(s,i=[]))&&(s==e.__e&&i.some(te),te(o),te(s)),(s=e.__e)&&(n||te(s),s.__e&&(s.__e=null)),e.__e=e.__c=e.__=null}function hn(e,t,n){return this.constructor(e,n)}function Ye(e,t){var n,s,o,i;y.__&&y.__(e,t),t.nodeType==9&&(t=t.documentElement),s=(n=e&&32&e.__u)?null:t.__k,t.__k=Ee(N,{children:[e]}),o=[],i=[],Ke(t,t.__k,s||Se,Se,t.namespaceURI,s?null:t.firstChild?ht.call(t.childNodes):null,o,s?s.__e:t.firstChild,n,i),Et(o,t.__k,i),t.__k.props.children=null}function Oe(e){function t(n){var s,o;return this.getChildContext||(s=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&s.forEach(function(r){r.__g|=4,We(r)})},this.sub=function(i){s.add(i);var r=i.componentWillUnmount;i.componentWillUnmount=function(){s.delete(i),r&&r.call(i)}}),n.children}return t.__c="__cC"+gt++,t.__=e,t.Provider=(t.Consumer=function(n,s){return n.children(s)}).contextType=t,t}y={__e:function(e,t,n,s){for(var o,i,r;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((r=(i=o.constructor)&&i.getDerivedStateFromError)&&o.setState(i.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,s||{}),r=1),r&&8&o.__g)return void(o.__g|=2)}catch(l){e=l}}throw Ne=0,e}},mt=0,un=function(e){return e!=null&&e.constructor===me},J.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=ne({},this.state)),typeof e=="function"&&(e=e(ne({},n),this.props)),e&&(ne(n,e),this.__v&&(t&&this.__k.push(t),We(this)))},J.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),We(this))},J.prototype.render=N,Z=[],Ne=0,ft=function(e,t){return e.__v.__b-t.__v.__b},be=Symbol(),pt=/(PointerCapture)$|Capture$/i,ze=0,He={},gt=0;var ie,T,qe,Nt,Ze=Object.is,pe=0,Dt=[],Je=[],A=y,{__b:St,__r:Tt,diffed:At,__c:It,unmount:Ot,__:Ct}=A;function Ce(e,t){A.__h&&A.__h(T,e,pe||t),pe=0;var n=T.__H||(T.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return pe=1,Pt(Mt,e)}function Pt(e,t,n){var s=Ce(ie++,2);if(s.t=e,!s.__c&&(s.__=[n?n(t):Mt(void 0,t),function(i){var r=s.__N?s.__N[0]:s.__[0],l=s.t(r,i);Ze(r,l)||(s.__N=[l,s.__[1]],s.__c.setState({}))}],s.__c=T,!T.__f)){T.__f=!0;var o=T.shouldComponentUpdate;T.shouldComponentUpdate=function(i,r,l){var u=this.__H;if(!u)return!0;var _=!1,c=this.props!=i;if(u.__.some(function(m){m.__N&&(_=!0,Ze(m.__[0],m.__N[0])||(c=!0))}),o){var f=o.call(this,i,r,l);return _?f||c:f}return!_||c}}return s.__}function G(e,t){var n=Ce(ie++,3);!A.__s&&Bt(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,T.__H.__h.push(n))}function Re(e){return pe=5,K(function(){return{current:e}},[])}function K(e,t){var n=Ce(ie++,7);return Bt(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function et(e,t){return pe=8,K(function(){return e},t)}function xe(e){var t=T.context[e.__c],n=Ce(ie++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(T)),t.props.value):e.__}function yn(){var e;do{for(;e=Je.shift();)try{fe(e)}catch(n){A.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=Dt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(fe),t.__h.some(Qe),t.__h=[]}catch(n){t.__h=[],A.__e(n,e.__v)}}}while(Je.length)}A.__b=function(e){T=null,St&&St(e)},A.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ct&&Ct(e,t)},A.__r=function(e){Tt&&Tt(e),ie=0;var t=(T=e.__c).__H;t&&(qe==T?T.__h=[]:(t.__h.some(fe),t.__h.some(Qe),ie=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),qe=T},A.diffed=function(e){At&&At(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&xt(Dt.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),qe=T=null},A.__c=function(e,t){t.some(function(n){try{n.__h.some(fe),n.__h=n.__h.filter(function(s){return!s.__||Qe(s)})}catch(s){n.__h=[function(){throw s}]}}),It&&It(e,t)},A.unmount=function(e){Ot&&Ot(e);var t,n,s=e.__c;s&&s.__H&&(s.__H.__.some(function(o){try{if(o.__P&&o.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}o.__P=n,xt(Je.push(o))}else fe(o)}catch(i){t=i}}),s.__H=void 0,t&&A.__e(t,s.__v))};var Rt=typeof requestAnimationFrame=="function";function vn(e){var t,n=function(){clearTimeout(s),Rt&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(n,35);Rt&&(t=requestAnimationFrame(n))}function xt(e){e!=1&&Nt==A.requestAnimationFrame||((Nt=A.requestAnimationFrame)||vn)(yn)}function fe(e){var t=T,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),T=t}function Qe(e){var t=T;e.__c=e.__(),T=t}function Bt(e,t){return!e||e.length!=t.length||t.some(function(n,s){return!Ze(n,e[s])})}function Mt(e,t){return typeof t=="function"?t(e):t}var Lt=Object.assign;var bn=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;var En=Symbol.for("react.element"),Nn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Sn=/[A-Z0-9]/g,Tn=typeof document<"u";var An=function(e){return/fil|che|rad/.test(e)};function Ut(e,t,n){return t.__k==null&&(t.textContent=""),Ye(e,t),typeof n=="function"&&n(),e?e.__c:null}J.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(J.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var $t=y.event;y.event=function(e){return $t&&(e=$t(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var In={configurable:!0,get:function(){return this.class}},Ft=y.vnode;y.vnode=function(e){if(typeof e.type=="string")(function(s){var{props:o,type:i}=s,r={},l=i.indexOf("-")==-1;for(var u in o){var _=o[u];if(!(u=="value"&&("defaultValue"in o)&&_==null||Tn&&u=="children"&&i=="noscript"||u=="class"||u=="className")){if(u=="style"&&_&&_.constructor==Object){var c=void 0;for(var f in _)typeof _[f]!="number"||bn.test(f)||(c||(c=_=Lt({},_)),_[f]+="px")}else if(u=="defaultValue"&&"value"in o&&o.value==null)u="value";else if(u=="download"&&_===!0)_="";else if(u=="translate"&&_==="no")_=!1;else if(u[0]=="o"&&u[1]=="n"){var m=u.toLowerCase();m=="ondoubleclick"?u="ondblclick":m!="onchange"||i!="input"&&i!="textarea"||An(o.type)?m=="onfocus"?u="onfocusin":m=="onblur"&&(u="onfocusout"):m=u="oninput",m=="oninput"&&r[u=m]&&(u="oninputCapture")}else l&&Nn.test(u)?u=u.replace(Sn,"-$&").toLowerCase():_===null&&(_=void 0);r[u]=_}}i=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=Ie(o.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),r.defaultValue!=null&&(r.value=Ie(o.children).forEach(function(d){d.props.selected=r.multiple?r.defaultValue.indexOf(d.props.value)!=-1:r.defaultValue==d.props.value}))),o.class&&!o.className?(r.class=o.class,Object.defineProperty(r,"className",In)):o.className&&(r.class=r.className=o.className),s.props=r})(e);else if(typeof e.type=="function"&&(("ref"in e.props)&&("prototype"in e.type)&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=Lt({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=En,Ft&&Ft(e)};function Vt(e){return!!e.__k&&(Ye(null,e),!0)}function Ht(e){return{render:function(t){Ut(t,e)},unmount:function(){Vt(e)}}}class On{static YOU="you";static BLOCKED="blocked";static RUNNING="running";static PARKED="parked";static DONE="done";static ORDER=[this.YOU,this.BLOCKED,this.RUNNING,this.PARKED,this.DONE]}class F{static REQUEST="request";static DECISION="decision";static ASSIGN="assign";static NOTE="note";static DESIGN="design";static COMMIT="commit";static PR="pr";static CI="ci";static REVIEW="review";static FIX="fix";static MERGE="merge";static RELEASE="release";static HANDOFF="handoff";static MSG="msg";static FLOW="flow";static AGENT="agent"}class Cn{static BUN="bun";static FLAME="flame";static EMBER="ember";static ROCK="rock";static BANANA="banana";static SCHEME_SET=new Set([this.BUN,this.FLAME,this.EMBER,this.ROCK,this.BANANA]);static isValid(e){return this.SCHEME_SET.has(e)}}class C{static ROLE_MAX=60;static HARNESS_CLAUDE="Claude Code";static DEFAULT_OWNER="Owner";static LOGO_MAX_BYTES=102400;static MANIFEST_FILE=".agents/vulcan.manifest.json";static CI_ACTOR="CI";static ACTIVE_GAP_MS=1800000;static UNSORTED="Unsorted";static DEFAULT_OUT=".agents/local/reports/board.html";static DEFAULT_DAYS=7;static HOUR_MS=3600000;static DAY_MS=24*C.HOUR_MS;static TEMPLATE="templates/board.html";static DATA_MARKER="<\!--BOARD_DATA-->";static GH_TIMEOUT_MS=15000;static GH_LIMIT=30;static HARNESS_ASKS=new Set(["idle_prompt","permission_prompt","elicitation_dialog"]);static WORK_KINDS=[F.ASSIGN,F.DESIGN,F.COMMIT,F.PR,F.FIX,F.NOTE];static PROGRESS_KINDS=[F.COMMIT,F.PR,F.FIX,F.MERGE,F.RELEASE,F.HANDOFF]}class ee{static EN="en";static VI="vi"}class H{static NOT_AGENTS=new Set([C.CI_ACTOR,"reviewer"]);static APPROXIMATE_SOURCE=/ước lượng/;static EARLIER_HOURS=24;static DONE_DAYS=7;static IDLE_TEXT=/^rảnh/}class B{static STAGES=["Đề xuất","Anh duyệt","Thiết kế","Code","PR + CI","Review","Merge","Phát hành","Bàn giao"];static STATE_TEXT={you:"Cần anh",blocked:"Bị chặn",running:"Đang chạy",parked:"st.parked",done:"Xong"};static KIND_TEXT={request:"đề xuất",decision:"quyết định",assign:"giao việc",note:"ghi chú",design:"thiết kế",commit:"code",pr:"PR",ci:"CI",review:"review",fix:"sửa",merge:"merge",release:"phát hành",handoff:"bàn giao",msg:"tin nhắn",flow:"k.flow",agent:"k.agent"};static GROUPS=[{key:"you",label:"g.you",swatch:"var(--ink)",open:!0},{key:"blocked",label:"g.blocked",swatch:"var(--fail)",open:!0},{key:"running",label:"g.running",swatch:"var(--accent)",open:!0},{key:"parked",label:"g.parked",swatch:"var(--line-2)",open:!1},{key:"done",label:"g.done",swatch:"var(--ok)",open:!1}];static STATE_ORDER=["you","blocked","running","parked","done"]}class ge{static PILL={working:"Đang làm",you:"Chờ anh",idle:"Rảnh",blocked:"Bị chặn"};static WORD={working:"đang làm",you:"chờ anh",idle:"rảnh",blocked:"bị chặn"}}var De=Oe({t:(e)=>e,now:0}),D=()=>xe(De),Pe=()=>xe(De).t;class tt{static textOf(e){let{event:t,translate:n}=e,s;if(t.kind==="decision"&&t.choice)s=n(`lt.${t.choice}`);else if(t.kind==="note")s=n(t.needsOwner?"lt.ask":"lt.note");else if(t.kind==="msg"&&t.incoming)s=t.from?`${n("lt.gotFrom")} ${t.from}`:n("lt.got");else if(t.kind==="msg"&&t.to)s=`${n("lt.msgTo")} ${t.to}`;else s=n(`lt.${t.kind}`);return`${t.actor} ${s}${t.summary?`: ${t.summary}`:""}`}}var Rn=60000;class I{static clock(e){let t=new Date(e.iso);return Number.isNaN(t.getTime())?"--:--":t.toLocaleTimeString("vi-VN",{hour:"2-digit",minute:"2-digit",hour12:!1})}static ago(e){let{translate:t}=e,n=Math.max(0,Math.round((e.now-new Date(e.iso).getTime())/Rn));if(n<1)return t("vừa xong");if(n<60)return`${n}${t(" phút")}`;let s=Math.floor(n/60);if(s<24)return`${s}${t(" giờ")}${n%60?` ${n%60}${t(" phút")}`:""}`;return`${Math.floor(s/24)}${t(" ngày")}`}static isSameDay(e){return new Date(e.iso).toDateString()===new Date(e.now).toDateString()}static isWithin(e){return e.now-Date.parse(e.iso)<e.days*C.DAY_MS}static isApproximate(e){return H.APPROXIMATE_SOURCE.test(e.source??"")}}var xn=Symbol.for("pv"),Dn=0;function a(e,t,n,s,o,i){t||(t={});var r,l,u=t;if("ref"in u&&typeof e!="function")for(l in u={},t)l=="ref"?r=t[l]:u[l]=t[l];var _={type:e,props:u,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:xn,__v:--Dn,__i:-1,__u:0};return(o||i)&&(_.__source=o,_.__self=i),y.vnode&&y.vnode(_),_}var Gt={bun:{d:"M6 30C6 18.5 12.4 12 20 12s14 6.5 14 18c0 3.3-2.2 5-5 5H11c-2.8 0-5-1.7-5-5z",eyes:[[15,23.4],[25,23.4]],mouth:[20,28.4],cheeks:[[11.4,27.2],[28.6,27.2]]},flame:{d:"M20 4.5c2.2 5.2 6.4 7.6 9.6 12.2 2.6 3.7 3.9 7 3.9 10.3 0 5.6-5.6 9-13.5 9S6.5 32.6 6.5 27c0-4.2 2-7.6 4.6-10.4.6 2.4 1.8 3.8 3.4 4.4-.6-6.4 1.8-11.6 5.5-16.5z",eyes:[[15.2,25.4],[24.8,25.4]],mouth:[20,30],cheeks:[[11.4,28.8],[28.6,28.8]]},ember:{d:"M7.5 27.5c0-8 5.8-13.5 12.8-13.5S33 19.6 33 26.8c0 5.6-5 8.7-12.6 8.7S7.5 33 7.5 27.5z",eyes:[[15.4,25.2],[25,25.2]],mouth:[20.2,29.8],cheeks:[[11.6,28.6],[28.8,28.6]]},rock:{d:"M8.5 31.5 6.8 23.6l4.4-8.2 8-4.2 9.2 2.2 5 7.2v8.6l-4.8 6.3H13.2z",eyes:[[15,24.6],[24.6,24.6]],mouth:[19.8,29.4],cheeks:[[11,28.2],[28.4,28.2]]},banana:{d:"M5.6 18.6c-.9-2 1.6-3.6 3.2-2.2 3.4 3.2 7.2 4.6 11.2 4.6s7.8-1.4 11.2-4.6c1.6-1.4 4.1.2 3.2 2.2-3 8.4-8.6 14.4-14.4 14.4S8.6 27 5.6 18.6z",eyes:[[15.4,25.6],[24.6,25.6]],mouth:[20,29.4],cheeks:[[11.8,27.6],[28.2,27.6]]}},Wt=["#F5B83D","#EF5B3A","#8FD16F","#5BB6E8","#B28DE0","#F28DB2"];var Pn=(e)=>{let{state:t}=e;return a("g",{className:t==="working"?"m-squint":void 0,children:e.shape.eyes.map(([n,s],o)=>{let i=o===0?1:-1;if(t==="idle")return a("path",{d:`M${n-2.4} ${s}q2.4 1.8 4.8 0`,className:"m-o m-line"},n);return a("g",{children:[a("circle",{cx:n,cy:s,r:2.3,className:"m-ink"}),a("circle",{cx:n+0.8,cy:s-0.8,r:0.8,fill:"#fff"}),t==="you"?a("path",{d:`M${n-2.6*i} ${s-4.2}l${4*i} -1`,className:"m-o m-line"}):null,t==="blocked"?a("path",{d:`M${n-2.2*i} ${s-3.2}l${4*i} -1.4`,className:"m-o m-line"}):null]},n)})})},Bn=(e)=>{let[t,n]=e.at;if(e.state==="working")return a("path",{d:`M${t-2.2} ${n-0.4}q2.2 1.4 4.4 0`,className:"m-o m-line"});if(e.state==="you")return a("ellipse",{cx:t,cy:n+0.2,rx:1.8,ry:1.4,className:"m-ink"});if(e.state==="blocked")return a("path",{d:`M${t-2.8} ${n+0.8}q1.4-1.5 2.8 0t2.8 0`,className:"m-o m-line m-bad"});return a("ellipse",{cx:t,cy:n+0.2,rx:1.4,ry:1,className:"m-ink"})},Be=(e)=>a(N,{children:[a("path",{d:e.shape.d,fill:e.fill,className:"m-o",strokeWidth:2.2}),a(Pn,{shape:e.shape,state:e.state}),e.shape.cheeks.map(([t,n])=>a("ellipse",{cx:t,cy:n,rx:2.4,ry:1.5,fill:"#FF8A80"},t)),a(Bn,{at:e.shape.mouth,state:e.state})]}),Mn=(e)=>a("g",{transform:"translate(8,3)",children:a("g",{className:"m-hoe",children:[a("path",{d:"M22.5 18.5 41 37",strokeWidth:4.2,className:"m-o m-line"}),a("path",{d:"M22.5 18.5 41 37",stroke:"#B9783F",strokeWidth:2.2,strokeLinecap:"round"}),a("path",{d:"M38.6 34.6 44.4 33.2 45.6 40.2 41.2 41.6z",fill:"#A9B4BF",className:"m-o",strokeWidth:1.6}),a("circle",{cx:25,cy:21,r:2.6,fill:e.fill,className:"m-o",strokeWidth:1.6}),a("circle",{cx:29.4,cy:25.4,r:2.6,fill:e.fill,className:"m-o",strokeWidth:1.6})]})});class re{static shapeOf(e){let t=e.shapes[e.name];return t in Gt?t:"bun"}static colorOf(e){let t=0;for(let n of e.name)t=t*31+n.charCodeAt(0)>>>0;return Wt[t%Wt.length]}}var Me=(e)=>{let t=Gt[e.shape],n=re.colorOf({name:e.name});return a("svg",{viewBox:"-6 -16 68 60",className:"bot","aria-hidden":"true",children:[e.state==="working"?a(N,{children:[a("ellipse",{cx:47,cy:40.5,rx:10,ry:3,fill:"#8B5A2B",className:"m-o",strokeWidth:1.6}),a("path",{d:"M39 40.5c3-4 13-4 16 0",fill:"#A0703F",className:"m-o",strokeWidth:1.6}),a("g",{className:"m-dig",children:a(Be,{shape:t,state:"working",fill:n})}),a(Mn,{fill:n}),a("circle",{cx:50,cy:39,r:1.6,fill:"#8B5A2B",className:"m-o m-clod",strokeWidth:0.8}),a("circle",{cx:51,cy:39.5,r:1.2,fill:"#8B5A2B",className:"m-o m-clod m-c2",strokeWidth:0.8}),a("circle",{cx:48.5,cy:39,r:1.1,fill:"#8B5A2B",className:"m-o m-clod m-c3",strokeWidth:0.8})]}):null,e.state==="idle"?a(N,{children:[a("ellipse",{cx:20,cy:36.8,rx:14,ry:1.8,className:"m-ink m-shadow"}),a("g",{className:"m-sleep",children:[a(Be,{shape:t,state:"idle",fill:"#8E8FA3"}),a("circle",{cx:24.5,cy:29,r:2.6,fill:"#BFE6FF",className:"m-o m-snot",strokeWidth:0.9})]}),a("text",{x:31,y:10,className:"m-zz",children:"z"}),a("text",{x:31,y:10,className:"m-zz m-z2",children:"z"}),a("text",{x:31,y:10,className:"m-zz m-z3",children:"Z"})]}):null,e.state==="you"?a(N,{children:[a("g",{className:"m-bubble",children:[a("path",{d:"M26 -10h18a4 4 0 0 1 4 4v10a4 4 0 0 1-4 4h-9l-5 4 1-4h-5a4 4 0 0 1-4-4v-10a4 4 0 0 1 4-4z",fill:"#F6D33C",className:"m-o",strokeWidth:1.8}),a("text",{x:35,y:5,textAnchor:"middle",className:"m-q",children:"?"})]}),a("g",{className:"m-lean",children:[a(Be,{shape:t,state:"you",fill:n}),a("g",{className:"m-wave",children:a("circle",{cx:35.4,cy:22,r:2.7,fill:n,className:"m-o",strokeWidth:1.6})})]})]}):null,e.state==="blocked"?a(N,{children:[a(Be,{shape:t,state:"blocked",fill:n}),a("path",{d:"M7.6 13.4c1.3 1.8 2 2.8 2 3.8a2 2 0 0 1-4 0c0-1 .7-2 2-3.8z",fill:"#BFE6FF",className:"m-o",strokeWidth:0.9}),a("circle",{cx:34,cy:7.4,r:3.4,fill:"var(--fail)",className:"m-o",strokeWidth:1.2}),a("path",{d:"M34 5.6v2.2",stroke:"#fff",strokeWidth:1.2,strokeLinecap:"round"}),a("circle",{cx:34,cy:9.3,r:0.5,fill:"#fff"})]}):null]})};var nt={you:"ask",blocked:"ask",working:"work",idle:"idle"},Le=(e)=>a(N,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),Ln=(e)=>{let{t,now:n}=D(),{row:s,card:o}=e,i=(f)=>I.clock({iso:f}),r=[o.role,o.lane?`${t("ag.under")} ${o.lane}`:void 0,o.harness,o.model].filter(Boolean).join(" · "),l=o.since?` · ${I.ago({iso:o.since,now:n,translate:t})}`:"",u=a("span",{className:"c-face",children:a(Me,{state:s.st,name:s.n,shape:e.shape})}),_=a("span",{className:`c-badge b-${nt[s.st]}`,children:`${t(ge.PILL[s.st])}${l}`}),c={"data-agent":s.n,tabIndex:0,"aria-pressed":e.picked,onClick:()=>e.onPick(s.n),onKeyDown:(f)=>{if(f.key==="Enter"||f.key===" ")f.preventDefault(),e.onPick(s.n)}};if(e.compact)return a("div",{className:`c-card c-compact cell ${s.st}${e.picked?" sel":""}`,role:"button",...c,children:[u,a("div",{className:"c-grow",children:[a("div",{className:"c-top",children:[a("span",{className:"c-nm",children:s.n}),_]}),o.workingOn?a("div",{className:"c-id",children:o.workingOn.flow.id}):null]}),s.st==="you"?a("span",{className:"c-ask",role:"img","aria-label":t("ag.asking"),title:t("ag.asking")}):null]});return a("div",{className:`c-card cell ${s.st}${e.picked?" sel":""}`,role:"button",...c,children:[a("div",{className:"c-head",children:[u,a("div",{className:"c-grow",children:[a("div",{className:"c-top",children:[a("span",{className:"c-nm",children:s.n}),_]}),r?a("div",{className:"c-role",children:r}):null]})]}),a("div",{className:"c-body",children:[o.workingOn?a(Le,{label:t("ag.working"),children:[o.workingOn.flow.title," ",a("small",{children:o.workingOn.flow.id})]}):null,s.ask?a(Le,{label:t("ag.asking"),children:`"${s.ask}"`}):null,o.action?a(Le,{label:t(o.workingOn?"ag.action":"ag.lastTime"),children:[o.action.summary," ",a("small",{children:i(o.action.ts)})]}):null,o.message?a(Le,{label:t("ag.message"),children:[tt.textOf({event:o.message,translate:t})," ",a("small",{children:i(o.message.ts)})]}):null]}),a("div",{className:"c-foot",children:[a("span",{children:[t("ag.prs")," ",a("b",{children:o.prs})]}),a("span",{children:[t("ag.pending")," ",a("b",{children:o.pending})]}),a("span",{children:[a("b",{children:o.today})," ",t("ag.today")]}),o.last?a("span",{className:"c-r",children:i(o.last)}):null]})]})},zt=(e)=>{let{t,now:n}=D(),[s,o]=P(!1),i=n-H.EARLIER_HOURS*C.HOUR_MS,r=(c)=>c.lastAt!==null&&Date.parse(c.lastAt)>=i,l=e.rows.filter(r),u=e.rows.filter((c)=>!r(c)),_=(c)=>a(Ln,{row:c,card:e.cards[c.n],shape:re.shapeOf({name:c.n,shapes:e.shapes}),picked:e.picked===c.n,compact:!e.details,onPick:e.onPick},c.n);return a("section",{className:"c-pane",id:"dock","aria-label":t("Các agent đang chạy"),children:[a("div",{className:"c-ph",children:[t("pn.agents")," ",a("span",{className:"c-n",children:l.length}),a("button",{className:"btn c-tg",type:"button","aria-pressed":e.details,onClick:()=>e.onDetails(!e.details),children:t("ag.details")})]}),a("div",{className:"c-scroll",children:[e.rows.length===0?a("p",{className:"c-empty",children:t("chưa có agent")}):null,l.map(_),u.length>0?a("button",{className:"btn c-loose",type:"button","aria-expanded":s,onClick:()=>o(!s),children:`${t("ag.earlier")} (${u.length})`}):null,s?u.map(_):null]})]})};class X{static safe(e){let{value:t}=e;if(t===void 0)return;return/^https:\/\//.test(t)||e.image===!0&&/^data:image\//.test(t)?t:void 0}}class $n{static SESSION_START="session-start";static SESSION_STOP="session-stop";static MSG_SENT="msg-sent";static MSG_RECEIVED="msg-received";static NEEDS_OWNER="needs-owner";static SUBAGENT_STOP="subagent-stop";static COMMIT="commit";static PR="pr";static DECISION="decision";static FLOW="flow";static DEPLOY="deploy";static TOOL_TICK="tool-tick";static SCHEME_SET=new Set([this.SESSION_START,this.SESSION_STOP,this.MSG_SENT,this.MSG_RECEIVED,this.NEEDS_OWNER,this.SUBAGENT_STOP,this.COMMIT,this.PR,this.DECISION,this.FLOW,this.DEPLOY,this.TOOL_TICK]);static isValid(e){return this.SCHEME_SET.has(e)}}class Fn{static APPROVE="approve";static PARK="park";static REJECT="reject";static SCHEME_SET=new Set([this.APPROVE,this.PARK,this.REJECT]);static isValid(e){return this.SCHEME_SET.has(e)}}class Un{static STEP="--step";static STEP_DONE="--step-done";static CHECK="--check";static CHECK_DONE="--check-done";static APP="--app";static DUE="--due";static KIND="--kind";static SUMMARY="--summary";static FLOW="--flow";static REF="--ref";static STATUS="--status";static TITLE="--title";static WHY="--why";static CONTEXT="--context";static NEXT="--next";static ACTOR="--actor";static DIR="--dir";static SINCE="--since";static JSON="--json";static KNOWN=new Set([this.STEP,this.STEP_DONE,this.CHECK,this.CHECK_DONE,this.APP,this.DUE,this.KIND,this.SUMMARY,this.FLOW,this.REF,this.STATUS,this.TITLE,this.WHY,this.CONTEXT,this.NEXT,this.ACTOR,this.DIR,this.SINCE,this.JSON])}class le{static DEFAULT_MAX_SIZE="50MB";static DEFAULT_MAX_FILES=30;static DEFAULT_MAX_AGE_DAYS=30;static DEFAULT_DIRECTORY=".agents/local/events";static MANIFEST_FILE=".agents/vulcan.manifest.json";static DAY_FILE=/^(\d{4}-\d{2}-\d{2})\.jsonl$/;static FILE_SUFFIX=".jsonl";static SUMMARY_MAX=200;static CONTEXT_MAX=600;static MESSAGE_SENT_LABEL="message sent";static TOOL_TICK_LABEL="using a tool";static TICK_SECONDS=30;static TICK_FOLDER=".agents/local/tmp/event-ticks";static REF_MAX=120;static ITEM_COUNT_MAX=30;static ITEM_TEXT_MAX=200;static APP_COUNT_MAX=12;static APP_TEXT_MAX=40;static DUE_PATTERN=/^\d{4}-\d{2}-\d{2}$/;static MODEL_MAX=80;static ACTOR_MAX=80;static REDACTED="[redacted]";static FLOW_PREFIX="VULZ";static FLOW_ID="VULZ-[A-Z0-9]{2,8}-\\d+|F-\\d+";static FLOW_PATTERN=new RegExp(`\\b(?:${le.FLOW_ID})\\b`);static FLOW_EXACT=new RegExp(`^(?:${le.FLOW_ID})$`);static FLOW_LINE=new RegExp(`\\bFlow:\\s*(${le.FLOW_ID})\\b`);static FLOW_LEGACY=/^F-\d+$/;static FLOW_CLAIM_DIR=".flow-ids";static FLOW_RECENT_COUNT=5;static UNKNOWN_ACTOR="unknown";static UNNAMED_PREFIX="claude:";static MADE_UP_NAME_SOURCES=new Set(["derived","auto","collision"]);static ACTOR_ENV="VULCAN_ACTOR";static SESSION_ENV="CLAUDE_CODE_SESSION_ID";static CONFIG_DIR_ENV="CLAUDE_CONFIG_DIR";static DAY_MS=86400000}class at{static isNamed(e){return e.actor!==le.UNKNOWN_ACTOR&&!e.actor.startsWith(le.UNNAMED_PREFIX)}}class $e{static PRIVATE_KEY=/-----BEGIN [A-Z ]*PRIVATE KEY-----.*/g;static TOKENS=[/\b(?:ghp|gho|ghs|ghu|ghr)_[A-Za-z0-9]{16,}/g,/\bgithub_pat_[A-Za-z0-9_]{16,}/g,/\bnpm_[A-Za-z0-9]{16,}/g,/\bsk-[A-Za-z0-9_-]{16,}/g,/\bAKIA[0-9A-Z]{16}\b/g,/\bAIza[0-9A-Za-z_-]{35}/g,/\bglpat-[A-Za-z0-9_-]{16,}/g,/\b[sr]k_(?:live|test)_[A-Za-z0-9]{8,}/g,/\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]*/g,/\bBasic\s+(?:(?=[A-Za-z0-9+/]*(?:[0-9+/]|[a-z][A-Z]))[A-Za-z0-9+/]{8,}={0,2}|[A-Za-z0-9+/]{8,}={1,2})/g,/\bxox[abprs]-[A-Za-z0-9-]{10,}/g,/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi];static HIGH_ENTROPY=[/\b[0-9a-fA-F]{64,}\b/g,/\b(?=[A-Za-z0-9+]*\d)(?=[A-Za-z0-9+]*[a-z])(?=[A-Za-z0-9+]*[A-Z])[A-Za-z0-9+]{40,}={0,2}/g];static PATTERNS=[$e.PRIVATE_KEY,...$e.TOKENS,...$e.HIGH_ENTROPY];static URL_USERINFO=/(\/\/)[^\s/@:]+:[^\s/@]+@/g;static ASSIGNMENT=/["']?\b([A-Za-z0-9_.-]*(?:key|token|secret|password|passwd|pwd|credential)[A-Za-z0-9_.-]*)["']?\s*[:=]\s*("[^"]*"|'[^']*'|\S+)/gi;static SPOKEN=/\b((?:password|passwd|passphrase|secret|token|api[ _-]?key)s?)\s+(?:is|are|was|were)\s+("[^"]*"|'[^']*'|\S+)/gi}class R{static byTime(e,t){if(e.ts!==t.ts)return e.ts<t.ts?-1:1;return e.stage-t.stage}static involves(e){return e.view.holder===e.name||e.view.evs.some((t)=>t.actor===e.name||t.to===e.name)}static linesOf(e){return e.flow.events.filter((t)=>e.showAll||!t.plumbing)}static eventsOf(e){return e.data.flows.flatMap((t)=>R.linesOf({flow:t,showAll:e.showAll}))}static flowsOf(e){let t=[];for(let n of e.data.flows){let s=R.linesOf({flow:n,showAll:e.showAll}).sort(R.byTime),o=s.find((i)=>i.id===n.lastId)??s.at(-1);if(o===void 0)continue;t.push({flow:n,holder:n.holder,evs:s,last:o,lastAsk:s.find((i)=>i.id===n.askId),noWork:!s.some((i)=>!i.plumbing&&i.kind!=="flow"),newCount:s.filter((i)=>i.ts>e.lastSeen).length})}return t}static rowsOf(e){let{data:t,flows:n,events:s,translate:o}=e,i=t.agents,r=(c)=>c!==""&&c!==t.owner&&!H.NOT_AGENTS.has(c)&&at.isNamed({actor:c}),l=t.roster??[],u=(c)=>l.includes(c)?l.indexOf(c):l.length;return[...new Set([...Object.keys(i).filter(r),...s.filter((c)=>c.source!=="github"&&r(c.actor)).map((c)=>c.actor)])].map((c)=>{let f=i[c],m=s.filter((g)=>g.actor===c&&!g.incoming).sort(R.byTime).at(-1),d=n.find((g)=>g.flow.state==="you"&&g.evs.findLast((E)=>E.actor!==t.owner)?.actor===c),p=n.find((g)=>g.flow.state==="blocked"&&g.holder===c),w=n.find((g)=>g.flow.state==="running"&&g.holder===c),h=[f?.checkedAt,m?.ts].filter((g)=>g!==void 0).sort().at(-1)??null,b=h===null||e.now-Date.parse(h)>C.ACTIVE_GAP_MS,v=R.stateOf({doc:f,blockedFlow:p,youFlow:d,runFlow:w,quiet:b}),S=R.saidOf({st:v,doc:f,lastLine:m,youFlow:d,translate:o});return{n:c,lastAt:h,st:v,...v==="you"&&d?.lastAsk?{ask:d.lastAsk.summary}:{},flow:(p??d)?.flow.id??w?.flow.id??m?.flowId??null,...S,key:`${m?.id??m?.ts??""}|${f?.checkedAt??""}|${f?.current??""}`}}).sort((c,f)=>u(c.n)-u(f.n)||c.n.localeCompare(f.n))}static stateOf(e){if(e.blockedFlow)return"blocked";if(e.youFlow)return"you";return!e.quiet&&(e.doc?.state==="working"||e.runFlow)?"working":"idle"}static saidOf(e){let{st:t,doc:n,lastLine:s,youFlow:o,translate:i}=e,r=(_)=>_?Date.parse(_)||0:0,l=(_,c)=>({text:c,ts:_.ts,approx:I.isApproximate({source:_.source})}),u;if(t==="you"&&o?.lastAsk)u=l(o.lastAsk,`${i("chờ anh: ")}${o.lastAsk.summary}`);else if(n?.current&&(!s||r(n.checkedAt)>r(s.ts)))u={text:n.current,ts:n.since,approx:!1};else if(s)u=l(s,s.summary);else u={text:n?.current===""||n===void 0?i("chưa có việc"):n.current,ts:n?.since??null,approx:!1};return t==="idle"&&!H.IDLE_TEXT.test(u.text)?{...u,text:`${i("rảnh · ")}${u.text}`}:u}}class U{static endsOf(e){let{message:t}=e;return t.incoming?{sender:t.from,receiver:t.actor}:{sender:t.actor,receiver:t.to}}static prHref(e){let{pr:t}=e;if(X.safe({value:t.link??void 0}))return t.link??void 0;return t.repo&&/^[\w.-]+\/[\w.-]+$/.test(t.repo)?`https://github.com/${t.repo}/pull/${t.n}`:void 0}static prsOf(e){let{events:t}=e,n={};for(let s of t){if(!s.ref?.pr)continue;let o=n[`${s.ref.repo??""}#${s.ref.pr}`]??={repo:s.ref.repo,n:s.ref.pr,flow:s.flowId,ci:null,link:null,merged:!1,closed:!1};o.by??=s.kind==="pr"?s.actor:void 0,o.merged||=s.kind==="merge",o.closed||=s.status==="closed",o.ci=s.kind==="ci"?s.status??null:o.ci,o.link=s.link&&/^https:\/\/.+\/pull\//.test(s.link)?s.link:o.link}return Object.values(n)}static of(e){let{data:t,events:n,name:s}=e,o=n.filter((i)=>i.kind==="msg").filter((i)=>{let{sender:r,receiver:l}=U.endsOf({data:t,message:i});return r===s||l===s}).sort(R.byTime);return{mine:n.filter((i)=>i.actor===s).sort(R.byTime),open:U.prsOf({events:n}).filter((i)=>i.by===s&&!i.merged&&!i.closed),pending:U.pendingOf({data:t,messages:o,name:s})}}static pendingOf(e){let{data:t,messages:n,name:s}=e,o=(l)=>U.endsOf({data:t,message:l}),i=n.filter((l)=>o(l).sender===s).at(-1)?.ts??"",r=new Set;return n.filter((l)=>{let{sender:u,receiver:_}=o(l),c=`${u}|${_}|${l.summary}|${l.ts.slice(0,16)}`;if(_!==s||l.ts<=i||r.has(c))return!1;return r.add(c),!0})}}var Vn=/[.!?](\s|$)/,Kt=140,Hn=3;class j{static sentenceOf(e){let t=(e.text??"").trim(),n=Vn.exec(t),s=n===null?t:t.slice(0,n.index+1);return s.length>Kt?`${s.slice(0,Kt-1).trimEnd()}…`:s}static itemOf(e){let{view:t}=e,{flow:n}=t,s=(i)=>({done:(i??[]).filter((r)=>r.done).length,total:(i??[]).length}),o=t.evs.filter((i)=>!i.plumbing&&!H.NOT_AGENTS.has(i.actor)).map((i)=>i.actor);return{now:j.sentenceOf({text:n.next??n.why}),waiting:n.state==="you"||n.state==="blocked"?n.next??t.lastAsk?.summary:void 0,steps:s(n.steps),checks:s(n.checks),prs:U.prsOf({events:t.evs}).filter((i)=>!i.merged&&!i.closed).map((i)=>({label:`${i.repo??""}#${i.n}`,ci:i.ci})),people:[...new Set([t.holder,...o])],updates:t.evs.filter((i)=>i.kind==="flow").length,deploys:[...new Set(t.evs.filter((i)=>i.kind==="release").map((i)=>i.summary))].slice(-Hn)}}static daysLeft(e){let t=new Date(e.now);return t.setHours(0,0,0,0),Math.round((new Date(`${e.due}T00:00:00`).getTime()-t.getTime())/C.DAY_MS)}static agentOf(e){let{data:t,events:n,views:s,row:o,doc:i,now:r}=e,l=n.filter((c)=>c.actor===o.n&&!c.plumbing),u=U.of({data:t,events:n,name:o.n}),_=(c)=>c.reduce((f,m)=>f===void 0||m.ts>=f.ts?m:f,void 0);return{workingOn:o.st==="idle"||o.flow===C.UNSORTED?void 0:s.find((c)=>c.flow.id===o.flow),action:_(l.filter((c)=>c.kind!=="msg"&&c.kind!=="flow")),message:_(n.filter((c)=>{let{sender:f,receiver:m}=U.endsOf({data:t,message:c});return c.kind==="msg"&&(f===o.n||m===o.n)})),prs:u.open.length,pending:u.pending.length,today:l.filter((c)=>I.isSameDay({iso:c.ts,now:r})).length,last:i?.checkedAt,since:o.st==="idle"&&i?.state==="working"?o.lastAt??i.since:i?.since,role:t.roles?.[o.n],lane:t.lanes?.[o.n],model:i?.model,harness:i?.harness}}}var Wn=(e)=>e.status==="fail"||e.status==="blocked",Xt=(e)=>{let{t}=D();return a("svg",{className:`mk ${e.bad?"x":"v"}`,viewBox:"0 0 10 10",role:"img","aria-label":e.bad?t("lỗi"):t("đạt"),children:a("path",{d:e.bad?"M2.5 2.5l5 5M7.5 2.5l-5 5":"M2 5.4l2 2 4-4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})},Fe=(e)=>a("span",{className:"c-bar",children:a("span",{style:{width:`${Math.round(e.done/e.total*100)}%`}})}),st=(e)=>{let{items:t}=e;if(t===void 0||t.length===0)return null;return a("div",{className:"ckl",children:a("ul",{children:t.map((n,s)=>a("li",{className:n.done?"on":void 0,children:n.text},`${s}:${n.text}`))})})},Gn=(e)=>{let{event:t}=e;if(t.incoming)return t.from?a(N,{children:[" ← ",a("b",{children:t.from})]}):null;return t.to?a(N,{children:[" → ",a("b",{children:t.to})]}):null},ot=(e)=>{let{t}=D(),{event:n}=e,s=I.isApproximate({source:n.source}),o=X.safe({value:n.link}),i=B.KIND_TEXT[n.kind],r="";if(s)r=t("giờ ước lượng");else if(n.source==="github")r="GitHub";return a("li",{className:`ev${Wn(n)?" fail":""}`,children:[a("span",{className:"tm",children:[s?"≈":"",I.clock({iso:n.ts})]}),a("div",{children:[e.chip,a("div",{className:"who",children:[a("b",{children:n.actor}),a(Gn,{event:n}),` · ${i?t(i):n.kind}${n.attempt&&n.attempt>1?`${t(" lần ")}${n.attempt}`:""}`]}),a("div",{className:"sm",children:n.summary}),o||r?a("div",{children:[o?a("a",{className:"lk",href:X.safe({value:n.link}),target:"_blank",rel:"noopener",children:o.replace(/^https:\/\/github\.com\//,"")}):null,o&&r?" · ":null,r?a("span",{className:"src",children:r}):null]}):null]})]})};var jt={decision:"ms.decision",merge:"ms.merge",release:"ms.deploy"},Yt=5,zn=200,Kn=(e)=>{if(e.stage===e.cur)return"st cur";return e.stage<e.cur?"st done":"st"},ae=(e)=>a("div",{className:"d-sec",children:[a("h4",{children:e.title}),e.children]}),Xn=(e)=>{let{t}=D(),n=e.view.evs.filter((s,o)=>o===0||(s.kind in jt)).map((s,o)=>({event:s,tag:o===0?"ms.open":jt[s.kind]})).reverse();return a("div",{className:"d-up",children:n.map(({event:s,tag:o},i)=>a("div",{className:`d-u${i===0?" last":""}`,children:[a("time",{children:I.clock({iso:s.ts})}),a("span",{className:"d-tag",children:t(o)}),s.summary]},s.id))})},jn=(e)=>{let{t}=D();return a("div",{id:"dBody",className:"d-body",children:[a("h2",{children:t("it.unsorted")}),a("p",{className:"d-empty",children:t("it.unsortedNote")}),a("ul",{className:"evs",children:[...e.view.evs].reverse().slice(0,zn).map((n)=>a(ot,{event:n},n.id))})]})},Yn=(e)=>{let{t}=D(),{view:n}=e,{flow:s}=n,o=j.itemOf({view:n});return a("div",{id:"dBody",className:"d-body",children:[a("h2",{children:s.title}),a("div",{className:"d-meta",children:[a("span",{className:"c-id",children:s.id}),s.tracker?a("span",{className:"c-ref",children:s.tracker}):null,s.due?a("span",{children:`${t("fl.due")} ${s.due}`}):null,a("span",{children:[t("it.holder"),": ",a("span",{className:"d-who",children:n.holder})]})]}),n.noWork?null:a(N,{children:[a("div",{className:"d-stages",children:B.STAGES.map((i,r)=>a("span",{title:t(i),className:Kn({stage:r,cur:s.cur})},i))}),a("div",{className:"d-stl",children:[a("span",{children:t(B.STAGES[0])}),a("b",{children:t(B.STAGES[s.cur])}),a("span",{children:t(B.STAGES[B.STAGES.length-1])})]})]}),s.context||s.apps?a(ae,{title:t("dt.whatItIs"),children:[s.context?a("p",{children:s.context}):null,s.apps?a("div",{className:"c-chips",children:s.apps.map((i)=>a("span",{children:i},i))}):null]}):null,s.steps&&s.steps.length>0?a(ae,{title:`${t("fl.steps")} · ${o.steps.done}/${o.steps.total}`,children:[a(Fe,{...o.steps}),a(st,{items:s.steps})]}):null,s.checks&&s.checks.length>0?a(ae,{title:`${t("fl.checks")}${s.tracker?` · ${s.tracker}`:""}`,children:a(st,{items:s.checks})}):null,o.waiting?a("div",{className:"d-sec d-waiting",children:[a("span",{className:"d-k",children:t("it.waiting")}),a("span",{children:o.waiting})]}):null,n.noWork?a("p",{className:"d-empty",children:t("nw.empty")}):null,a(ae,{title:t("dt.milestones"),children:a(Xn,{view:n})}),a("button",{className:"btn d-all",type:"button","aria-pressed":e.everything,onClick:()=>e.onEverything(!e.everything),children:`${t("dt.all")} (${n.evs.length})`}),e.everything?a("ul",{className:"evs",children:n.evs.map((i)=>a(ot,{event:i},i.id))}):null]})},qn=(e)=>{let{t,now:n}=D(),{row:s,card:o,data:i}=e,r=U.of({data:i,events:e.events,name:s.n}),l=(u)=>I.clock({iso:u});return a("div",{id:"dBody",className:"d-body d-agent",children:[a("div",{className:"d-agenthead",children:[a(Me,{state:s.st,name:s.n,shape:e.shape}),a("div",{children:[a("h2",{id:"popName",children:s.n}),a("div",{className:"d-meta",children:[a("span",{className:`c-badge b-${nt[s.st]}`,children:t(ge.PILL[s.st])}),o.since?a("span",{children:`${t("từ ")}${l(o.since)} · ${I.ago({iso:o.since,now:n,translate:t})}`}):null]})]})]}),a(ae,{title:t("5 sự kiện gần nhất"),children:r.mine.length===0?a("p",{className:"d-empty",children:t("Chưa có sự kiện nào của agent này.")}):a("ul",{className:"d-list",children:r.mine.slice(-Yt).reverse().map((u)=>a("li",{children:[a("time",{children:l(u.ts)}),u.flowId?a("button",{className:"btn chip",type:"button",onClick:()=>e.onFlow(u.flowId),children:u.flowId}):null,u.summary]},u.id))})}),a(ae,{title:`${t("PR đang mở (")}${r.open.length})`,children:r.open.length===0?a("p",{className:"d-empty",children:t("Không có PR nào đang mở.")}):a("ul",{className:"d-list",children:r.open.map((u)=>a("li",{children:[a("a",{href:X.safe({value:U.prHref({pr:u})}),target:"_blank",rel:"noopener",children:`${u.repo??""}#${u.n}`}),u.ci?a(Xt,{bad:u.ci==="fail"}):null,u.flow]},`${u.repo}#${u.n}`))})}),a(ae,{title:`${t("Tin nhắn chưa có trả lời (")}${r.pending.length})`,children:r.pending.length===0?a("p",{className:"d-empty",children:t("Không có tin nào đang chờ.")}):a("ul",{className:"d-list",children:r.pending.slice(-Yt).reverse().map((u)=>{let{sender:_,receiver:c}=U.endsOf({data:i,message:u});return a("li",{children:[a("time",{children:l(u.ts)}),`${_===s.n?`→ ${c??"?"}`:`← ${_??"?"}`}: ${u.summary}`]},u.id)})})})]})},qt=(e)=>{let{t}=D(),{detail:n}=e,s=n?.kind==="flow"?e.views.find((i)=>i.flow.id===n.id):void 0,o=n?.kind==="agent"?e.rows.find((i)=>i.n===n.name):void 0;return a("section",{className:"c-pane c-p3",id:"detail","aria-label":t("Chi tiết luồng"),hidden:s===void 0&&o===void 0,children:[a("div",{className:"c-ph",children:[t("pn.detail"),a("button",{className:"c-x",type:"button",title:t("Đóng"),"aria-label":t("Đóng"),onClick:e.onClose,children:"✕"})]}),a("div",{className:"c-scroll",children:[s&&s.flow.id===C.UNSORTED?a(jn,{view:s}):null,s&&s.flow.id!==C.UNSORTED?a(Yn,{view:s,everything:e.everything,onEverything:e.onEverything}):null,o?a(qn,{row:o,card:e.cards[o.n],data:e.data,events:e.events,shape:re.shapeOf({name:o.n,shapes:e.data.shapes}),onFlow:e.onFlow}):null]})]})};var ce={fill:"none",stroke:"currentColor",strokeWidth:1.5},Zt={light:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a("circle",{cx:"10",cy:"10",r:"3.6",...ce}),a("path",{d:"M10 1.8v2M10 16.2v2M1.8 10h2M16.2 10h2M4.2 4.2l1.4 1.4M14.4 14.4l1.4 1.4M4.2 15.8l1.4-1.4M14.4 5.6l1.4-1.4",...ce,strokeLinecap:"round"})]}),dark:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a("path",{d:"M16.5 12.4A7 7 0 0 1 7.6 3.5a7 7 0 1 0 8.9 8.9Z",...ce,strokeLinejoin:"round"})}),system:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a("rect",{x:"2.5",y:"3.5",width:"15",height:"10",rx:"1.5",...ce}),a("path",{d:"M7 17h6M10 13.5V17",...ce,strokeLinecap:"round"})]})},Jt=()=>a("svg",{className:"chev",viewBox:"0 0 12 12","aria-hidden":"true",children:a("path",{d:"M3 4.5l3 3 3-3",...ce})});var he=["light","dark","system"],Zn={light:"sáng",dark:"tối",system:"theo máy"},Qt=(e)=>{let t=Pe(),n=`${t("Giao diện: ")}${t(Zn[e.theme])}`,s=`${t("lang.label")}: ${t(`lang.${e.language}`)}`;return a("header",{className:"bar",children:[a("span",{className:"mark",id:"mark",children:e.logo?a("img",{src:X.safe({value:e.logo,image:!0}),alt:""}):null}),a("span",{className:"brule","aria-hidden":"true"}),a("h1",{id:"boardTitle",children:e.title}),a("span",{className:"spacer"}),a("span",{className:"since",id:"since",title:e.sources.join(`
|
|
1367
|
-
`),children:a("span",{id:"sinceTxt",children:[t("Từ lần xem trước lúc "),a("b",{children:I.clock({iso:e.lastSeen})}),": ",a("b",{children:e.newCount}),t(" sự kiện mới")]})}),a("button",{className:"btn",type:"button",id:"bSeen",onClick:e.onSeen,children:a("span",{children:t("Đánh dấu đã xem")})}),a("span",{className:"fresh",id:"fresh",children:e.live===void 0?null:a("span",{className:e.live==="on"?void 0:"st",children:t(`live.${e.live}`)})}),a("button",{className:"btn",type:"button",id:"bPlumb","aria-pressed":e.showPlumbing,title:t("pl.tip"),onClick:e.onPlumbing,children:a("span",{children:t("pl.all")})}),a("button",{className:"btn lang",type:"button",id:"bLang","aria-label":s,title:s,onClick:e.onLanguage,children:e.language==="en"?"VI":"EN"}),a("button",{className:"btn sq theme",type:"button",id:"bTheme","aria-label":`${n}${t(". Bấm để đổi")}`,title:n,onClick:e.onTheme,children:Zt[e.theme]}),a("button",{className:"btn sq",type:"button",id:"bKeys","aria-label":t("Phím tắt"),"aria-expanded":e.keysOpen,onClick:e.onKeys,children:"?"})]})};var Jn={you:"wait",blocked:"ask",running:"work",parked:"idle",done:"ok"},Qn=2,de=(e)=>a(N,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),en=(e)=>a("span",{className:"c-v c-mini",children:[a(Fe,{done:e.done,total:e.total}),`${e.done}/${e.total} ${e.label}`]}),ea=(e)=>{let{t,now:n}=D();if(e.due===void 0)return a("span",{className:"c-badge b-idle",children:t("it.noDue")});let s=j.daysLeft({due:e.due,now:n}),o=s<0?t("it.overdue"):`${s} ${t("it.daysLeft")}`;return a("span",{className:`c-badge ${s<=Qn?"b-ask":"b-idle"}`,children:`${t("fl.due")} ${e.due} · ${o}`})},ta=(e)=>{let{t}=D(),{view:n,card:s}=e,{flow:o}=n,i=Re(null),r=(l)=>I.clock({iso:l});return G(()=>{if(e.selected)i.current?.scrollIntoView({block:"nearest"})},[e.selected]),a("div",{ref:i,className:`c-card row${e.selected?" sel":""}`,"data-id":o.id,role:"button",tabIndex:0,"aria-selected":e.selected,onClick:()=>e.onSelect(o.id),onKeyDown:(l)=>{if(l.key==="Enter"&&l.target===l.currentTarget)l.preventDefault(),e.onSelect(o.id)},children:[a("div",{className:"c-head",children:[a("span",{className:`c-badge b-${Jn[o.state]}`,children:n.noWork?t("nw.chip"):t(B.STAGES[o.cur])}),a("span",{className:"c-id",children:o.id}),o.tracker?a("span",{className:"c-ref",children:o.tracker}):null,n.newCount>0?a("span",{className:"unread",title:`${n.newCount}${t(" sự kiện mới")}`}):null,a("span",{className:"c-grow"}),a(ea,{due:o.due})]}),a("div",{className:"c-title",children:o.title}),s.now?a("div",{className:"c-now",children:`${t("it.now")}: ${s.now}`}):null,a("div",{className:"c-wb",children:[s.steps.total>0?a(de,{label:t("fl.steps"),children:a(en,{...s.steps,label:t("it.done")})}):null,s.checks.total>0?a(de,{label:t("it.checks"),children:a(en,{...s.checks,label:t("it.criteria")})}):null,o.apps?a(de,{label:t("it.apps"),children:a("span",{className:"c-chips",children:o.apps.map((l)=>a("span",{children:l},l))})}):null,s.prs.length>0?a(de,{label:t("it.prs"),children:s.prs.map((l)=>a("span",{className:"c-pr",children:[l.label,l.ci===null?null:a("b",{className:l.ci==="fail"?"bad":"good",children:` ● CI ${t(l.ci==="fail"?"lỗi":"đạt")}`})]},l.label))}):null,a(de,{label:t("it.people"),children:a("span",{className:"c-chips",children:s.people.map((l,u)=>a("span",{className:u===0?"h":void 0,children:u===0?`${l} ${t("it.holds")}`:l},l))})}),s.waiting?a(de,{label:t("it.waiting"),children:s.waiting}):null]}),a("div",{className:"c-foot",children:[a("span",{children:[t("it.started")," ",a("b",{children:r(n.evs[0].ts)})]}),a("span",{children:[t("it.updates")," ",a("b",{children:s.updates})]}),s.deploys.length>0?a("span",{children:[t("it.deploys")," ",a("b",{children:s.deploys.join(", ")})]}):null,a("span",{className:"c-r",children:`${t("it.latest")} ${r(n.last.ts)}`})]})]})},tn=(e)=>{let{t,now:n}=D(),s=e.views.filter((r)=>e.agent===null||R.involves({view:r,name:e.agent})),o=s.filter((r)=>r.flow.id!==C.UNSORTED&&(r.flow.state!=="done"||I.isWithin({iso:r.last.ts,now:n,days:H.DONE_DAYS}))),i=s.find((r)=>r.flow.id===C.UNSORTED);return a("section",{className:"c-pane","aria-label":t("Danh sách luồng"),children:[a("div",{className:"c-ph",children:[t("pn.items")," ",a("span",{className:"c-n",id:"flowN",children:o.length}),e.agent===null?null:a("button",{className:"btn filter-chip",type:"button","aria-label":`${t("Bỏ lọc theo ")}${e.agent}`,onClick:()=>e.onAgent(null),children:[t("Của "),a("b",{children:e.agent})," ×"]})]}),a("div",{className:"c-scroll",id:"groups",children:[o.length===0?a("p",{className:"c-empty",children:t("Chưa có luồng nào. Bật events.log, hoặc ghi một dòng bằng vulcan event add.")}):null,B.GROUPS.map((r)=>{let l=o.filter((_)=>_.flow.state===r.key).sort((_,c)=>r.key==="you"||r.key==="blocked"?R.byTime(_.last,c.last):R.byTime(c.last,_.last)),u=e.open[r.key]??r.open;if(o.length===0)return null;return a("section",{className:"c-group",children:[a("button",{className:"c-gh",type:"button","aria-expanded":u,onClick:()=>e.onToggle(r.key),children:[a(Jt,{}),a("span",{className:"c-dot",style:{background:r.swatch}}),a("span",{children:`${t(r.label)} · ${l.length}`})]}),u&&l.length===0?a("p",{className:"c-empty",children:r.key==="you"?t("Không có gì chờ anh."):t("Trống.")}):null,u?l.map((_)=>a(ta,{view:_,card:j.itemOf({view:_}),selected:e.selected===_.flow.id,onSelect:e.onSelect},_.flow.id)):null]},r.key)}),i?a("button",{className:"btn c-loose",type:"button","aria-pressed":e.selected===i.flow.id,onClick:()=>e.onSelect(i.flow.id),children:`${t("it.unsorted")} · ${i.evs.length}`}):null]})]})};var na=[["j / k","Luồng sau / trước"],["Enter","Mở chi tiết"],["e","Các bước hoặc mọi sự kiện"],["Esc","Đóng"],["?","Bảng này"]],nn=(e)=>{let t=Pe();return a("div",{className:"keys",id:"keys",hidden:!e.open,role:"dialog","aria-label":t("Phím tắt"),children:[a("h2",{children:a("span",{children:t("Phím tắt")})}),a("dl",{children:na.flatMap(([n,s])=>[a("dt",{children:n},n),a("dd",{children:a("span",{children:t(s)})},s)])})]})};class se{static get(e){try{return localStorage.getItem(e.key)}catch{return null}}static set(e){try{localStorage.setItem(e.key,e.value)}catch{}}static remove(e){try{localStorage.removeItem(e.key)}catch{}}}var ye=(e)=>{let[t,n]=P(()=>{let o=se.get({key:e.key});return e.allowed.find((i)=>i===o)??e.initial}),s=et((o)=>{se.set({key:e.key,value:o}),n(o)},[e.key]);return[t,s]},an=()=>{let[e,t]=P(Date.now());return G(()=>{let n=setInterval(()=>t(Date.now()),60000);return()=>clearInterval(n)},[]),e},sn=(e)=>{let t=e.data.live?.stream,[n,s]=P("wait");return G(()=>{if(t===void 0)return;let o,i,r=!1,l=0,u=()=>{o=new EventSource(t),o.onmessage=(_)=>{l=0;let c=JSON.parse(_.data);if(c.tooLarge){s("big");return}e.onData(c),s("on")},o.onerror=()=>{if(o?.close(),s("off"),!r)i=setTimeout(u,Math.min(30000,1000*2**l)),l+=1}};return u(),()=>{r=!0,o?.close(),clearTimeout(i)}},[t]),n};var on={en:{"ag.under":"under","ag.earlier":"Earlier","ag.details":"Details","it.unsorted":"Unsorted","it.unsortedNote":"Events that name no flow, newest first."," giờ":" h"," lần ":" try "," ngày":" d"," phút":" min"," sự kiện mới":" new events",". Bấm để đổi":". Click to change","5 sự kiện gần nhất":"Last 5 events","Anh duyệt":"Approval","Bàn giao":"Handoff","Bảng này":"This panel","Bị chặn":"Blocked","Bỏ lọc theo ":"Clear filter for ","Chi tiết luồng":"Flow detail","Chưa có luồng nào. Bật events.log, hoặc ghi một dòng bằng vulcan event add.":"No flows yet. Turn on events.log, or write a line with vulcan event add.","Chưa có sự kiện nào của agent này.":"No events from this agent yet.","Chờ anh":"Waiting on you",Code:"Code","Các agent đang chạy":"Running agents","Các bước hoặc mọi sự kiện":"Stages or all events","Cần anh":"Needs you","Của ":"By ","Danh sách luồng":"Flow list","Giao diện: ":"Theme: ","Không có PR nào đang mở.":"No open pull requests.","Không có gì chờ anh.":"Nothing waits on you.","Không có tin nào đang chờ.":"No message is waiting.","Luồng sau / trước":"Next / previous flow",Merge:"Merge","Mở chi tiết":"Open detail","PR + CI":"PR + CI","PR đang mở (":"Open pull requests (","Phát hành":"Release","Phím tắt":"Shortcuts",Review:"Review",Rảnh:"Idle","Thiết kế":"Design","Tin nhắn chưa có trả lời (":"Unanswered messages (","Trống.":"Empty.","Từ lần xem trước lúc ":"Since your last visit at ",Xong:"Done","ag.action":"Latest action","ag.asking":"Asking you","ag.lastTime":"Last time","ag.message":"Latest message","ag.pending":"Unanswered","ag.prs":"PRs","ag.today":"events today","ag.working":"Working on","bàn giao":"handoff","bị chặn":"blocked","chưa có agent":"no agents yet","chưa có việc":"no work yet","chờ anh":"waiting on you","chờ anh: ":"waiting on you: ","dt.all":"All events","dt.milestones":"Milestones","dt.whatItIs":"What it is","fl.checks":"Acceptance checks","fl.due":"Due","fl.steps":"Steps","g.blocked":"Blocked","g.done":"Done this week","g.parked":"Parked","g.running":"Running","g.you":"Needs you","ghi chú":"note","giao việc":"assign","giờ ước lượng":"estimated time","it.apps":"Apps","it.checks":"Acceptance","it.criteria":"criteria","it.daysLeft":"days left","it.deploys":"Deploy","it.done":"done","it.holder":"Holder","it.holds":"holds","it.latest":"latest","it.noDue":"No due date","it.now":"Now","it.overdue":"overdue","it.people":"People","it.prs":"PR","it.started":"Started","it.updates":"Updates","it.waiting":"Waiting on","k.agent":"agent activity","k.flow":"flow title","lang.en":"English","lang.label":"Language","lang.vi":"Tiếng Việt","live.big":"too large to stream: reload","live.off":"disconnected, retrying","live.on":"live","live.wait":"connecting","lt.approve":"approved","lt.ask":"asked the owner","lt.assign":"assigned work","lt.ci":"ran a check","lt.commit":"committed","lt.decision":"decided","lt.design":"designed","lt.fix":"fixed","lt.got":"got a message","lt.gotFrom":"got a message from","lt.handoff":"handed over","lt.merge":"merged","lt.msg":"sent a message","lt.msgTo":"wrote to","lt.note":"noted","lt.park":"parked","lt.pr":"updated a pull request","lt.reject":"rejected","lt.release":"released","lt.request":"requested","lt.review":"reviewed",lỗi:"error","ms.decision":"Decision","ms.deploy":"Deploy","ms.merge":"Merge","ms.open":"Opened","nw.chip":"No work yet","nw.empty":"No work logged yet","phát hành":"release","pl.all":"Show all events","pl.tip":"Sessions starting and stopping, subagents and prompts that only wait are hidden, and so are agents the project did not list; this shows them","pn.agents":"Agents","pn.detail":"Details","pn.items":"Work items","quyết định":"decision",rảnh:"idle","rảnh · ":"idle · ","st.parked":"Parked",sáng:"light",sửa:"fix","theo máy":"system","thiết kế":"design","tin nhắn":"message",to:"to",tối:"dark","từ ":"since ","vừa xong":"just now","Đang chạy":"Running","Đang làm":"Working","Đánh dấu đã xem":"Mark as seen",Đóng:"Close","Đề xuất":"Proposal","đang làm":"working",đạt:"pass","đề xuất":"proposal",đỏ:"red"},vi:{"ag.under":"thuộc","ag.earlier":"Trước đó","ag.details":"Chi tiết","it.unsorted":"Chưa xếp luồng","it.unsortedNote":"Các sự kiện không thuộc luồng nào, mới nhất trước.","ag.action":"Việc gần nhất","ag.asking":"Hỏi anh","ag.lastTime":"Lần cuối","ag.message":"Tin nhắn","ag.pending":"Tin chờ","ag.prs":"PR","ag.today":"sự kiện hôm nay","ag.working":"Đang làm","dt.all":"Mọi sự kiện","dt.milestones":"Diễn biến","dt.whatItIs":"Đây là gì","fl.checks":"Tiêu chí nghiệm thu","fl.due":"Hạn","fl.steps":"Các bước","g.blocked":"Bị chặn / Lỗi","g.done":"Xong trong tuần","g.parked":"Để sau","g.running":"Đang chạy","g.you":"Cần anh","it.apps":"App","it.checks":"Nghiệm thu","it.criteria":"tiêu chí","it.daysLeft":"ngày nữa","it.deploys":"Deploy","it.done":"xong","it.holder":"Giữ việc","it.holds":"giữ","it.latest":"mới nhất","it.noDue":"Chưa có hạn","it.now":"Đang","it.overdue":"quá hạn","it.people":"Người","it.prs":"PR","it.started":"Bắt đầu","it.updates":"Cập nhật","it.waiting":"Đang chờ","k.agent":"hoạt động agent","k.flow":"tên luồng","lang.en":"English","lang.label":"Ngôn ngữ","lang.vi":"Tiếng Việt","live.big":"quá lớn để truyền: tải lại","live.off":"mất kết nối, đang thử lại","live.on":"trực tiếp","live.wait":"đang kết nối","lt.approve":"duyệt","lt.ask":"hỏi chủ","lt.assign":"giao việc","lt.ci":"chạy kiểm tra","lt.commit":"commit","lt.decision":"quyết định","lt.design":"thiết kế","lt.fix":"sửa","lt.got":"nhận tin nhắn","lt.gotFrom":"nhận tin nhắn từ","lt.handoff":"bàn giao","lt.merge":"merge","lt.msg":"gửi tin nhắn","lt.msgTo":"nhắn cho","lt.note":"ghi chú","lt.park":"để sau","lt.pr":"cập nhật pull request","lt.reject":"từ chối","lt.release":"phát hành","lt.request":"đề xuất","lt.review":"review","ms.decision":"Quyết định","ms.deploy":"Deploy","ms.merge":"Merge","ms.open":"Mở việc","nw.chip":"Chưa có việc","nw.empty":"Chưa có việc nào được ghi","pl.all":"Hiện mọi sự kiện","pl.tip":"Phiên bắt đầu và kết thúc, subagent và lời nhắc chỉ để chờ, cùng các agent dự án không liệt kê, đang được ẩn; nút này hiện chúng","pn.agents":"Agent","pn.detail":"Chi tiết","pn.items":"Việc","st.parked":"Để sau",to:"cho"}};class it{static translate(e){return on[e.language][e.key]??e.key}}var aa=["flows","decisions","agents","shapes","roster","lanes","roles","sources","generatedAt","since"],sa='input,textarea,select,[contenteditable="true"]',rn=(e)=>{let[t,n]=P(e.data),s=`board:${t.key}:`,[o,i]=ye({key:`${s}lang`,initial:ee.EN,allowed:[ee.EN,ee.VI]}),[r,l]=ye({key:`${s}theme`,initial:"light",allowed:he}),[u,_]=ye({key:`${s}plumbing`,initial:"0",allowed:["0","1"]}),[c,f]=ye({key:`${s}agentDetails`,initial:"1",allowed:["0","1"]}),[m,d]=P(!1),[p,w]=P(null),[h,b]=P(!1),[v,S]=P(null),[g,E]=P({}),[Y,oe]=P(()=>se.get({key:`${s}lastSeen`})??new Date().toISOString()),M=an(),L=u==="1",z=sn({data:t,onData:(k)=>n((O)=>({...O,...Object.fromEntries(aa.map((_e)=>[_e,k[_e]]))}))}),V=K(()=>(k)=>it.translate({language:o,key:k}),[o]),W=K(()=>({t:V,now:M}),[V,M]),x=K(()=>R.eventsOf({data:t,showAll:L}),[t,L]),q=K(()=>R.flowsOf({data:t,showAll:L,lastSeen:Y}),[t,L,Y,M]),ue=K(()=>R.rowsOf({data:t,flows:q,events:x,translate:V,now:M}),[t,q,x,V,M]),rt=K(()=>Object.fromEntries(ue.map((k)=>[k.n,j.agentOf({data:t,events:x,views:q,row:k,doc:t.agents[k.n],now:M})])),[t,x,q,ue,M]),lt=p!==null&&(p.kind==="flow"?q.some((k)=>k.flow.id===p.id):ue.some((k)=>k.n===p.name)),Ue=(k)=>w({kind:"flow",id:k}),dn=(k)=>{if(v===k){S(null),w(null);return}S(k),w({kind:"agent",name:k})};return G(()=>{document.title=t.title,document.documentElement.lang=o},[t.title,o]),G(()=>{if(r==="system")document.documentElement.removeAttribute("data-board-theme");else document.documentElement.setAttribute("data-board-theme",r)},[r]),G(()=>{se.set({key:`${s}lastSeen`,value:Y})},[s,Y]),G(()=>{let k=(O)=>{if((O.target instanceof Element?O.target:null)?.closest?.(sa)||O.metaKey||O.ctrlKey||O.altKey)return;let ve=[...document.querySelectorAll(".row")],ct=p?.kind==="flow"?p.id:null,dt=ve.findIndex((ke)=>ke.dataset.id===ct);if(O.key==="j"||O.key==="k"){O.preventDefault();let ke=O.key==="j"?Math.min(ve.length-1,dt+1):Math.max(0,dt-1),ut=ve[ke]?.dataset.id;if(ut!==void 0)Ue(ut),ve[ke].focus()}else if(O.key==="e"&&ct)b(!h);else if(O.key==="Escape")if(m)d(!1);else w(null);else if(O.key==="?")d(!m)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)}),a(De.Provider,{value:W,children:[a("div",{className:"app",children:[a(Qt,{title:t.title,logo:t.logo,sources:t.sources,lastSeen:Y,newCount:q.reduce((k,O)=>k+O.newCount,0),onSeen:()=>oe(new Date().toISOString()),showPlumbing:L,onPlumbing:()=>_(L?"0":"1"),language:o,onLanguage:()=>i(o===ee.EN?ee.VI:ee.EN),theme:r,onTheme:()=>l(he[(he.indexOf(r)+1)%he.length]),keysOpen:m,onKeys:()=>d(!m),live:t.live===void 0?void 0:z}),a("main",{className:`c-main${lt?"":" closed"}`,id:"vFlows",children:[a(zt,{rows:ue,cards:rt,shapes:t.shapes,picked:v,details:c==="1",onDetails:(k)=>f(k?"1":"0"),onPick:dn}),a(tn,{views:q,agent:v,onAgent:(k)=>{if(S(k),k===null&&p?.kind==="agent")w(null)},selected:p?.kind==="flow"?p.id:null,onSelect:Ue,open:g,onToggle:(k)=>E((O)=>({...O,[k]:!(O[k]??B.GROUPS.find((_e)=>_e.key===k)?.open)}))}),a(qt,{detail:lt?p:null,views:q,rows:ue,cards:rt,data:t,events:x,everything:h,onEverything:b,onFlow:Ue,onClose:()=>w(null)})]})]}),a(nn,{open:m})]})};var ln=document.getElementById("board-data"),cn=document.getElementById("root");if(ln?.textContent&&cn){let e=JSON.parse(ln.textContent);Ht(cn).render(a(rn,{data:e}))}})();
|
|
1266
|
+
<script>(()=>{var y,mt,un,Z,Ve,Ne,ft,Ee,pt,ze,He,gt,me=Symbol.for("pv"),Se={},Te=[],_n=/^m(i|n|o|s|text|space)$/,Ae=Array.isArray,ht=Te.slice,ne=Object.assign;function te(e){e&&e.parentNode&&e.remove()}function be(e,t,n,s,o){var i={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:me,__v:o||++mt,__i:-1,__u:0};return!o&&y.vnode&&y.vnode(i),i}function N(e){return e.children}function J(e,t){this.props=e,this.context=t,this.__g=0}function Q(e,t){if(t==null)return e.__&&Q(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!="function"||e.props.__P?null:Q(e)}function yt(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),yt(e)}function We(e){(8&e.__g||(e.__g|=8,Z.push(e),Ne++))&&Ve==y.debounceRendering||((Ve=y.debounceRendering)||queueMicrotask)(vt)}function vt(){var e,t,n,s,o,i,r,l,u;try{for(t=1;Z.length;)Z.length>t&&Z.sort(ft),e=Z.shift(),t=Z.length,8&e.__g&&(s=void 0,o=void 0,i=(o=(n=e).__v).__e,r=[],l=[],(u=n.__P)&&((s=ne({constructor:me},o)).__v=o.__v+1,y.vnode&&y.vnode(s),Ke(u,s,o,n.__n,u.namespaceURI,32&o.__u?[i]:null,r,i||Q(o),32&o.__u,l),s.__v=o.__v,s.__.__k[s.__i]=s,bt(r,s,l),o.__=o.__e=null,s.__e!=i&&yt(s)))}finally{(Ne=Z.length)&&(Ve||queueMicrotask)(vt)}}function kt(e,t,n,s,o,i,r,l,u,_,c){var f,m,d,p,w,h,E=s.__k||Te,v=t.length;for(u=mn(n,t,E,u,v),f=0;f<v;f++)(d=n.__k[f])!=null&&(m=~d.__i&&E[d.__i]||Se,d.__i=f,h=Ke(e,d,m,o,i,r,l,u,_,c),p=d.__e,(m.ref!=d.ref||8&m.__u)&&(m.ref&&Xe(m.ref,null,d,m),d.ref&&c.push(d.ref,d.__c||p,d)),w=w||p,4&d.__u?(u=wt(d,u,e,!m.__v),m.__e&&(m.__e=null)):typeof d.type=="function"&&h!==void 0?u=h:p&&(u=p.nextSibling),d.__u&=-21);return n.__e=w,u}function mn(e,t,n,s,o){var i,r,l,u,_,c,f,m,d,p=n.length,w=p,h=0,E=0,v=e.__k=Array(o);for(i=0;i<o;i++)(r=t[i])!=null&&typeof r!="boolean"&&typeof r!="function"?(typeof r!="object"||r.constructor===String?r=v[i]=be(null,r):Ae(r)?r=v[i]=be(N,{children:r}):r.constructor===me&&r.__b?r=v[i]=be(r.type,r.props,r.key,r.ref,r.__v):v[i]=r,u=i+h,r.__=e,r.__b=e.__b+1,l=null,~(_=r.__i=fn(r,n,u,w))&&(w--,(l=n[_])&&(l.__u|=2)),l&&l.__v?(r.__u|=16,_==u-1?h--:_==u+1?h++:_!=u&&(_>u?h--:h++,E=1)):(~_||(o>p?h--:o<p&&h++),typeof r.type!="function"&&(r.__u|=4))):v[i]=null;if(E){for(c=[],f=[],i=0;i<o;i++)if((r=v[i])&&16&r.__u){for(h=0,m=c.length;h<m;)c[d=h+m>>1]<r.__i?h=d+1:m=d;c[h]=r.__i,f[i]=h+1}for(h=c.length;i--;)f[i]&&(f[i]==h?h--:v[i].__u|=4)}if(w)for(i=0;i<p;i++)!(l=n[i])||2&l.__u||(l.__e==s&&(s=Q(l)),je(l,l));return s}function wt(e,t,n,s){var o,i,r,l;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&(o[i].__=e,t=wt(o[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=Q(e))&&!t.parentNode&&(t=null),r=e.__e,l=t;l&&l.nodeType==8;)l=l.nextSibling;for(r!=l&&(!s&&n.moveBefore&&r.parentNode?n.moveBefore(r,t):n.insertBefore(r,t||null)),t=r;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function Ie(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(Ae(e)?e.some(function(n){Ie(n,t)}):t.push(e)),t}function fn(e,t,n,s){var o,{key:i,type:r}=e,l=t[n],u=l&&!(2&l.__u);if(l===null&&i==null||u&&i==l.key&&r==l.type)return n;if(s>(u?1:0)){for(o=n-1;o>=0;o--)if((l=t[o])&&!(2&l.__u)&&i==l.key&&r==l.type)return o;for(o=n+1;o<t.length;o++)if((l=t[o])&&!(2&l.__u)&&i==l.key&&r==l.type)return o}return-1}function _t(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function we(e,t,n,s,o){var i,r;if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||_t(e.style,t);if(n)for(t in n)s&&n[t]==s[t]||_t(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")(e.__e||(e.__e={}))[t]=n,n&&s||(r=He[t]||(He[t]=pn(t)),(e.__a||(e.__a={}))[t]=ze,i=t!=(t=t.replace(pt,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,r,i):e.removeEventListener(t,r,i));else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{return void(e[t]=n==null?"":n)}catch(l){}if(typeof n=="function")return;n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n)}}function pn(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[Ee]==null)t[Ee]=ze++;else if(t[Ee]<this.__a[e])return;return n(y.event?y.event(t):t)}}}function Ke(e,t,n,s,o,i,r,l,u,_){var c,f,m,d,p,w,h,E,v,S,g,b,Y,oe,M,L,z,V,W=t.type;if(t.constructor!==me)return null;128&n.__u&&(u=32&n.__u,c=n.__c.__z)&&(t.__u|=u,f=i=[],c.nodeType==8?l=Ge(c,i):i.push(c),l=i[0]||l),(c=y.__b)&&c(t);e:if(typeof W=="function"){m=r.length;try{if(E=t.props,v=(c=W.prototype)&&c.render,S=(c=W.contextType)&&s[c.__c],g=c?S?S.props.value:c.__:s,(d=n.__c)?(t.__c=d,2&d.__g&&(d.__g|=1)):(v?t.__c=d=new W(E,g):(t.__c=d=new J(E,g),d.constructor=W,d.render=hn),S&&S.sub(d),d.state||(d.state={}),d.__n=s,d.__g|=8,d.__h=[],d.__k=[]),v&&(d.__s||(d.__s=d.state),W.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ne({},d.__s)),ne(d.__s,W.getDerivedStateFromProps(E,d.__s)))),p=d.props,w=d.state,d.__v=t,n.__c){if(E!==p&&v&&!W.getDerivedStateFromProps&&d.componentWillReceiveProps&&d.componentWillReceiveProps(E,g),t.__v==n.__v&&!(8&d.__g)||!(4&d.__g)&&d.shouldComponentUpdate&&d.shouldComponentUpdate(E,d.__s,g)===!1){t.__v!=n.__v&&(d.props=E,d.state=d.__s,d.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(x){x&&(x.__=t)}),Te.push.apply(d.__h,d.__k),d.__k=[],d.__h.length&&r.push(d),l=Q(n);break e}d.componentWillUpdate&&d.componentWillUpdate(E,d.__s,g),v&&d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,w,h)})}else v&&!W.getDerivedStateFromProps&&d.componentWillMount&&d.componentWillMount(),v&&d.componentDidMount&&d.__h.push(d.componentDidMount);if(d.context=g,d.props=E,d.__P=e,d.__g&=-5,b=y.__r,Y=0,v)d.state=d.__s,d.__g&=-9,b&&b(t),c=d.render(d.props,d.state,d.context),Te.push.apply(d.__h,d.__k),d.__k=[];else do d.__g&=-9,b&&b(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(8&d.__g&&++Y<25);d.state=d.__s,d.getChildContext&&(s=ne({},s,d.getChildContext())),v&&n.__c&&d.getSnapshotBeforeUpdate&&(h=d.getSnapshotBeforeUpdate(p,w)),oe=c&&c.type===N&&c.key==null?c.props.children:c,E.__P&&(c=l,o=(e=E.__P).namespaceURI,u=i=null,n.props&&n.props.__P!=e&&(n.__k.some(function(x){x&&je(x,x)}),n.__k=null),l=n.__k?Q(n,0):null),l=kt(e,Ae(oe)?oe:[oe],t,n,s,o,i,r,l,u,_),E.__P&&(t.__e=null,l=c),t.__u&=-161,f&&f.some(te),d.__h.length&&r.push(d),1&d.__g&&(d.__g&=-4)}catch(x){if(r.length=m,t.__v=null,u||i)if(x.then){if(M=0,t.__u|=128|u,i){for(~(z=i.indexOf(l||void 0))||(z=i.length);(V=i[z-1])&&V.nodeType==8;)z--;for(;z<i.length;z++)if(V=i[z]){if(i[z]=null,V.nodeType==8){if(V.data.startsWith("$s"))M++||(L=V);else if(M&&V.data.startsWith("/$s")&&!--M)break}else if(!M)break}}if(!L){for(;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;L=l}(c=Ge(L=t.__c.__z||(t.__c.__z=L)))?(t.__e=L,l=c):t.__e=l,l=l&&l.nextSibling}else i&&i.some(te);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),x.then||Et(t),y.__e(x,t,n)}}else l=t.__e=gn(n.__e,t,n,s,o,i,r,u,_,e);return(c=y.diffed)&&c(t),l}function Ge(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))n++;else if(e.data.startsWith("/$s")&&!--n)return e}t&&t.push(e)}}function Et(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(Et))}function bt(e,t,n){for(var s=0;s<n.length;)Xe(n[s++],n[s++],n[s++]);y.__c&&y.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){y.__e(i,o.__v)}})}function gn(e,t,n,s,o,i,r,l,u,_){var c,f,m,d,p,w,h,E,v,S=n.props||Se,{props:g,type:b}=t;if(b=="svg"?o="http://www.w3.org/2000/svg":b=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i){for(c=0;c<i.length;c++)if((p=i[c])&&(b?p.localName==b:p.nodeType==3)){e=p,i[c]=null;break}}if(!e){if(E=_.ownerDocument||document,!b)return E.createTextNode(g);e=E.createElementNS(o,b,g.is&&g),l&&(y.__m&&y.__m(t,i),l=!1),i=null}if(b){if(_=b=="template"&&e.content||e,i=b=="textarea"&&g.defaultValue!=null?null:i&&ht.call(_.childNodes),!l&&i)for(S={},c=0;c<e.attributes.length;c++)S[(p=e.attributes[c]).name]=p.value;for(c in S)p=S[c],c=="dangerouslySetInnerHTML"?m=p:c=="children"||(c in g)||c=="value"&&("defaultValue"in g)||c=="checked"&&("defaultChecked"in g)||we(e,c,null,p,o);for(c in v=1&n.__u,g)p=g[c],c=="children"?d=p:c=="dangerouslySetInnerHTML"?f=p:c=="value"?w=p:c=="checked"?h=p:l&&typeof p!="function"||!(S[c]!==p||v&&p!=null)||we(e,c,p,S[c],o);f?(l||m&&(f.__html==m.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(m&&(e.textContent=""),(b=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&_n.test(b))&&(o="http://www.w3.org/1999/xhtml"),kt(_,Ae(d)?d:[d],t,n,s,o,i,r,i?i[0]:n.__k&&Q(n,0),l,u),i&&i.some(te)),l&&b!="textarea"||(c="value",b=="progress"&&w==null?e.removeAttribute(c):w==null||w===e[c]&&(b!="progress"||w)||we(e,c,w,S[c],o),c="checked",h!=null&&h!=e[c]&&we(e,c,h,S[c],o))}else S===g||l&&e.data==g||(e.data=g);return e}function Xe(e,t,n,s){try{typeof e=="function"?t?t.__x=e(t)||1:s&&(s=s.__c||s.__e)&&(t=s.__x)&&(s.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){y.__e(o,n)}}function je(e,t,n){var s,o,i,r;if(y.unmount&&y.unmount(e),!(s=e.ref)||s.current&&s.current!=e.__e||Xe(s,null,t,e),s=e.__c){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(l){y.__e(l,t)}s.__P=s.__n=null}if(s=e.__k)for(r=0;r<s.length;r++)s[r]&&je(s[r],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(s=e.__c)&&(s=s.__z)&&(o=Ge(s,i=[]))&&(s==e.__e&&i.some(te),te(o),te(s)),(s=e.__e)&&(n||te(s),s.__e&&(s.__e=null)),e.__e=e.__c=e.__=null}function hn(e,t,n){return this.constructor(e,n)}function Ye(e,t){var n,s,o,i;y.__&&y.__(e,t),t.nodeType==9&&(t=t.documentElement),s=(n=e&&32&e.__u)?null:t.__k,t.__k=be(N,{children:[e]}),o=[],i=[],Ke(t,t.__k,s||Se,Se,t.namespaceURI,s?null:t.firstChild?ht.call(t.childNodes):null,o,s?s.__e:t.firstChild,n,i),bt(o,t.__k,i),t.__k.props.children=null}function Oe(e){function t(n){var s,o;return this.getChildContext||(s=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&s.forEach(function(r){r.__g|=4,We(r)})},this.sub=function(i){s.add(i);var r=i.componentWillUnmount;i.componentWillUnmount=function(){s.delete(i),r&&r.call(i)}}),n.children}return t.__c="__cC"+gt++,t.__=e,t.Provider=(t.Consumer=function(n,s){return n.children(s)}).contextType=t,t}y={__e:function(e,t,n,s){for(var o,i,r;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((r=(i=o.constructor)&&i.getDerivedStateFromError)&&o.setState(i.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,s||{}),r=1),r&&8&o.__g)return void(o.__g|=2)}catch(l){e=l}}throw Ne=0,e}},mt=0,un=function(e){return e!=null&&e.constructor===me},J.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=ne({},this.state)),typeof e=="function"&&(e=e(ne({},n),this.props)),e&&(ne(n,e),this.__v&&(t&&this.__k.push(t),We(this)))},J.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),We(this))},J.prototype.render=N,Z=[],Ne=0,ft=function(e,t){return e.__v.__b-t.__v.__b},Ee=Symbol(),pt=/(PointerCapture)$|Capture$/i,ze=0,He={},gt=0;var ie,T,qe,Nt,Ze=Object.is,pe=0,Dt=[],Je=[],A=y,{__b:St,__r:Tt,diffed:At,__c:It,unmount:Ot,__:Ct}=A;function Ce(e,t){A.__h&&A.__h(T,e,pe||t),pe=0;var n=T.__H||(T.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return pe=1,Pt(Mt,e)}function Pt(e,t,n){var s=Ce(ie++,2);if(s.t=e,!s.__c&&(s.__=[n?n(t):Mt(void 0,t),function(i){var r=s.__N?s.__N[0]:s.__[0],l=s.t(r,i);Ze(r,l)||(s.__N=[l,s.__[1]],s.__c.setState({}))}],s.__c=T,!T.__f)){T.__f=!0;var o=T.shouldComponentUpdate;T.shouldComponentUpdate=function(i,r,l){var u=this.__H;if(!u)return!0;var _=!1,c=this.props!=i;if(u.__.some(function(m){m.__N&&(_=!0,Ze(m.__[0],m.__N[0])||(c=!0))}),o){var f=o.call(this,i,r,l);return _?f||c:f}return!_||c}}return s.__}function G(e,t){var n=Ce(ie++,3);!A.__s&&Bt(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,T.__H.__h.push(n))}function Re(e){return pe=5,K(function(){return{current:e}},[])}function K(e,t){var n=Ce(ie++,7);return Bt(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function et(e,t){return pe=8,K(function(){return e},t)}function xe(e){var t=T.context[e.__c],n=Ce(ie++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(T)),t.props.value):e.__}function yn(){var e;do{for(;e=Je.shift();)try{fe(e)}catch(n){A.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=Dt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(fe),t.__h.some(Qe),t.__h=[]}catch(n){t.__h=[],A.__e(n,e.__v)}}}while(Je.length)}A.__b=function(e){T=null,St&&St(e)},A.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ct&&Ct(e,t)},A.__r=function(e){Tt&&Tt(e),ie=0;var t=(T=e.__c).__H;t&&(qe==T?T.__h=[]:(t.__h.some(fe),t.__h.some(Qe),ie=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),qe=T},A.diffed=function(e){At&&At(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&xt(Dt.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),qe=T=null},A.__c=function(e,t){t.some(function(n){try{n.__h.some(fe),n.__h=n.__h.filter(function(s){return!s.__||Qe(s)})}catch(s){n.__h=[function(){throw s}]}}),It&&It(e,t)},A.unmount=function(e){Ot&&Ot(e);var t,n,s=e.__c;s&&s.__H&&(s.__H.__.some(function(o){try{if(o.__P&&o.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}o.__P=n,xt(Je.push(o))}else fe(o)}catch(i){t=i}}),s.__H=void 0,t&&A.__e(t,s.__v))};var Rt=typeof requestAnimationFrame=="function";function vn(e){var t,n=function(){clearTimeout(s),Rt&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(n,35);Rt&&(t=requestAnimationFrame(n))}function xt(e){e!=1&&Nt==A.requestAnimationFrame||((Nt=A.requestAnimationFrame)||vn)(yn)}function fe(e){var t=T,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),T=t}function Qe(e){var t=T;e.__c=e.__(),T=t}function Bt(e,t){return!e||e.length!=t.length||t.some(function(n,s){return!Ze(n,e[s])})}function Mt(e,t){return typeof t=="function"?t(e):t}var Lt=Object.assign;var En=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;var bn=Symbol.for("react.element"),Nn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Sn=/[A-Z0-9]/g,Tn=typeof document<"u";var An=function(e){return/fil|che|rad/.test(e)};function Ut(e,t,n){return t.__k==null&&(t.textContent=""),Ye(e,t),typeof n=="function"&&n(),e?e.__c:null}J.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(J.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var $t=y.event;y.event=function(e){return $t&&(e=$t(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var In={configurable:!0,get:function(){return this.class}},Ft=y.vnode;y.vnode=function(e){if(typeof e.type=="string")(function(s){var{props:o,type:i}=s,r={},l=i.indexOf("-")==-1;for(var u in o){var _=o[u];if(!(u=="value"&&("defaultValue"in o)&&_==null||Tn&&u=="children"&&i=="noscript"||u=="class"||u=="className")){if(u=="style"&&_&&_.constructor==Object){var c=void 0;for(var f in _)typeof _[f]!="number"||En.test(f)||(c||(c=_=Lt({},_)),_[f]+="px")}else if(u=="defaultValue"&&"value"in o&&o.value==null)u="value";else if(u=="download"&&_===!0)_="";else if(u=="translate"&&_==="no")_=!1;else if(u[0]=="o"&&u[1]=="n"){var m=u.toLowerCase();m=="ondoubleclick"?u="ondblclick":m!="onchange"||i!="input"&&i!="textarea"||An(o.type)?m=="onfocus"?u="onfocusin":m=="onblur"&&(u="onfocusout"):m=u="oninput",m=="oninput"&&r[u=m]&&(u="oninputCapture")}else l&&Nn.test(u)?u=u.replace(Sn,"-$&").toLowerCase():_===null&&(_=void 0);r[u]=_}}i=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=Ie(o.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),r.defaultValue!=null&&(r.value=Ie(o.children).forEach(function(d){d.props.selected=r.multiple?r.defaultValue.indexOf(d.props.value)!=-1:r.defaultValue==d.props.value}))),o.class&&!o.className?(r.class=o.class,Object.defineProperty(r,"className",In)):o.className&&(r.class=r.className=o.className),s.props=r})(e);else if(typeof e.type=="function"&&(("ref"in e.props)&&("prototype"in e.type)&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=Lt({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=bn,Ft&&Ft(e)};function Vt(e){return!!e.__k&&(Ye(null,e),!0)}function Ht(e){return{render:function(t){Ut(t,e)},unmount:function(){Vt(e)}}}class On{static YOU="you";static BLOCKED="blocked";static RUNNING="running";static PARKED="parked";static DONE="done";static ORDER=[this.YOU,this.BLOCKED,this.RUNNING,this.PARKED,this.DONE]}class F{static REQUEST="request";static DECISION="decision";static ASSIGN="assign";static NOTE="note";static DESIGN="design";static COMMIT="commit";static PR="pr";static CI="ci";static REVIEW="review";static FIX="fix";static MERGE="merge";static RELEASE="release";static HANDOFF="handoff";static MSG="msg";static FLOW="flow";static AGENT="agent"}class Cn{static BUN="bun";static FLAME="flame";static EMBER="ember";static ROCK="rock";static BANANA="banana";static SCHEME_SET=new Set([this.BUN,this.FLAME,this.EMBER,this.ROCK,this.BANANA]);static isValid(e){return this.SCHEME_SET.has(e)}}class C{static ROLE_MAX=60;static HARNESS_CLAUDE="Claude Code";static DEFAULT_OWNER="Owner";static LOGO_MAX_BYTES=102400;static MANIFEST_FILE=".agents/vulcan.manifest.json";static CI_ACTOR="CI";static ACTIVE_GAP_MS=1800000;static UNSORTED="Unsorted";static DEFAULT_OUT=".agents/local/reports/board.html";static DEFAULT_DAYS=7;static HOUR_MS=3600000;static DAY_MS=24*C.HOUR_MS;static TEMPLATE="templates/board.html";static DATA_MARKER="<\!--BOARD_DATA-->";static TOKENS_MARKER="<\!--BOARD_TOKENS-->";static GH_TIMEOUT_MS=15000;static GH_LIMIT=30;static HARNESS_ASKS=new Set(["idle_prompt","permission_prompt","elicitation_dialog"]);static WORK_KINDS=[F.ASSIGN,F.DESIGN,F.COMMIT,F.PR,F.FIX,F.NOTE];static PROGRESS_KINDS=[F.COMMIT,F.PR,F.FIX,F.MERGE,F.RELEASE,F.HANDOFF]}class ee{static EN="en";static VI="vi"}class H{static NOT_AGENTS=new Set([C.CI_ACTOR,"reviewer"]);static APPROXIMATE_SOURCE=/ước lượng/;static EARLIER_HOURS=24;static DONE_DAYS=7;static IDLE_TEXT=/^rảnh/}class B{static STAGES=["Đề xuất","Anh duyệt","Thiết kế","Code","PR + CI","Review","Merge","Phát hành","Bàn giao"];static STATE_TEXT={you:"Cần anh",blocked:"Bị chặn",running:"Đang chạy",parked:"st.parked",done:"Xong"};static KIND_TEXT={request:"đề xuất",decision:"quyết định",assign:"giao việc",note:"ghi chú",design:"thiết kế",commit:"code",pr:"PR",ci:"CI",review:"review",fix:"sửa",merge:"merge",release:"phát hành",handoff:"bàn giao",msg:"tin nhắn",flow:"k.flow",agent:"k.agent"};static GROUPS=[{key:"you",label:"g.you",swatch:"var(--ink)",open:!0},{key:"blocked",label:"g.blocked",swatch:"var(--fail)",open:!0},{key:"running",label:"g.running",swatch:"var(--accent)",open:!0},{key:"parked",label:"g.parked",swatch:"var(--line-2)",open:!1},{key:"done",label:"g.done",swatch:"var(--ok)",open:!1}];static STATE_ORDER=["you","blocked","running","parked","done"]}class ge{static PILL={working:"Đang làm",you:"Chờ anh",idle:"Rảnh",blocked:"Bị chặn"};static WORD={working:"đang làm",you:"chờ anh",idle:"rảnh",blocked:"bị chặn"}}var De=Oe({t:(e)=>e,now:0}),D=()=>xe(De),Pe=()=>xe(De).t;class tt{static textOf(e){let{event:t,translate:n}=e,s;if(t.kind==="decision"&&t.choice)s=n(`lt.${t.choice}`);else if(t.kind==="note")s=n(t.needsOwner?"lt.ask":"lt.note");else if(t.kind==="msg"&&t.incoming)s=t.from?`${n("lt.gotFrom")} ${t.from}`:n("lt.got");else if(t.kind==="msg"&&t.to)s=`${n("lt.msgTo")} ${t.to}`;else s=n(`lt.${t.kind}`);return`${t.actor} ${s}${t.summary?`: ${t.summary}`:""}`}}var Rn=60000;class I{static clock(e){let t=new Date(e.iso);return Number.isNaN(t.getTime())?"--:--":t.toLocaleTimeString("vi-VN",{hour:"2-digit",minute:"2-digit",hour12:!1})}static ago(e){let{translate:t}=e,n=Math.max(0,Math.round((e.now-new Date(e.iso).getTime())/Rn));if(n<1)return t("vừa xong");if(n<60)return`${n}${t(" phút")}`;let s=Math.floor(n/60);if(s<24)return`${s}${t(" giờ")}${n%60?` ${n%60}${t(" phút")}`:""}`;return`${Math.floor(s/24)}${t(" ngày")}`}static isSameDay(e){return new Date(e.iso).toDateString()===new Date(e.now).toDateString()}static isWithin(e){return e.now-Date.parse(e.iso)<e.days*C.DAY_MS}static isApproximate(e){return H.APPROXIMATE_SOURCE.test(e.source??"")}}var xn=Symbol.for("pv"),Dn=0;function a(e,t,n,s,o,i){t||(t={});var r,l,u=t;if("ref"in u&&typeof e!="function")for(l in u={},t)l=="ref"?r=t[l]:u[l]=t[l];var _={type:e,props:u,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:xn,__v:--Dn,__i:-1,__u:0};return(o||i)&&(_.__source=o,_.__self=i),y.vnode&&y.vnode(_),_}var Gt={bun:{d:"M6 30C6 18.5 12.4 12 20 12s14 6.5 14 18c0 3.3-2.2 5-5 5H11c-2.8 0-5-1.7-5-5z",eyes:[[15,23.4],[25,23.4]],mouth:[20,28.4],cheeks:[[11.4,27.2],[28.6,27.2]]},flame:{d:"M20 4.5c2.2 5.2 6.4 7.6 9.6 12.2 2.6 3.7 3.9 7 3.9 10.3 0 5.6-5.6 9-13.5 9S6.5 32.6 6.5 27c0-4.2 2-7.6 4.6-10.4.6 2.4 1.8 3.8 3.4 4.4-.6-6.4 1.8-11.6 5.5-16.5z",eyes:[[15.2,25.4],[24.8,25.4]],mouth:[20,30],cheeks:[[11.4,28.8],[28.6,28.8]]},ember:{d:"M7.5 27.5c0-8 5.8-13.5 12.8-13.5S33 19.6 33 26.8c0 5.6-5 8.7-12.6 8.7S7.5 33 7.5 27.5z",eyes:[[15.4,25.2],[25,25.2]],mouth:[20.2,29.8],cheeks:[[11.6,28.6],[28.8,28.6]]},rock:{d:"M8.5 31.5 6.8 23.6l4.4-8.2 8-4.2 9.2 2.2 5 7.2v8.6l-4.8 6.3H13.2z",eyes:[[15,24.6],[24.6,24.6]],mouth:[19.8,29.4],cheeks:[[11,28.2],[28.4,28.2]]},banana:{d:"M5.6 18.6c-.9-2 1.6-3.6 3.2-2.2 3.4 3.2 7.2 4.6 11.2 4.6s7.8-1.4 11.2-4.6c1.6-1.4 4.1.2 3.2 2.2-3 8.4-8.6 14.4-14.4 14.4S8.6 27 5.6 18.6z",eyes:[[15.4,25.6],[24.6,25.6]],mouth:[20,29.4],cheeks:[[11.8,27.6],[28.2,27.6]]}},Wt=["#F5B83D","#EF5B3A","#8FD16F","#5BB6E8","#B28DE0","#F28DB2"];var Pn=(e)=>{let{state:t}=e;return a("g",{className:t==="working"?"m-squint":void 0,children:e.shape.eyes.map(([n,s],o)=>{let i=o===0?1:-1;if(t==="idle")return a("path",{d:`M${n-2.4} ${s}q2.4 1.8 4.8 0`,className:"m-o m-line"},n);return a("g",{children:[a("circle",{cx:n,cy:s,r:2.3,className:"m-ink"}),a("circle",{cx:n+0.8,cy:s-0.8,r:0.8,fill:"#fff"}),t==="you"?a("path",{d:`M${n-2.6*i} ${s-4.2}l${4*i} -1`,className:"m-o m-line"}):null,t==="blocked"?a("path",{d:`M${n-2.2*i} ${s-3.2}l${4*i} -1.4`,className:"m-o m-line"}):null]},n)})})},Bn=(e)=>{let[t,n]=e.at;if(e.state==="working")return a("path",{d:`M${t-2.2} ${n-0.4}q2.2 1.4 4.4 0`,className:"m-o m-line"});if(e.state==="you")return a("ellipse",{cx:t,cy:n+0.2,rx:1.8,ry:1.4,className:"m-ink"});if(e.state==="blocked")return a("path",{d:`M${t-2.8} ${n+0.8}q1.4-1.5 2.8 0t2.8 0`,className:"m-o m-line m-bad"});return a("ellipse",{cx:t,cy:n+0.2,rx:1.4,ry:1,className:"m-ink"})},Be=(e)=>a(N,{children:[a("path",{d:e.shape.d,fill:e.fill,className:"m-o",strokeWidth:2.2}),a(Pn,{shape:e.shape,state:e.state}),e.shape.cheeks.map(([t,n])=>a("ellipse",{cx:t,cy:n,rx:2.4,ry:1.5,fill:"#FF8A80"},t)),a(Bn,{at:e.shape.mouth,state:e.state})]}),Mn=(e)=>a("g",{transform:"translate(8,3)",children:a("g",{className:"m-hoe",children:[a("path",{d:"M22.5 18.5 41 37",strokeWidth:4.2,className:"m-o m-line"}),a("path",{d:"M22.5 18.5 41 37",stroke:"#B9783F",strokeWidth:2.2,strokeLinecap:"round"}),a("path",{d:"M38.6 34.6 44.4 33.2 45.6 40.2 41.2 41.6z",fill:"#A9B4BF",className:"m-o",strokeWidth:1.6}),a("circle",{cx:25,cy:21,r:2.6,fill:e.fill,className:"m-o",strokeWidth:1.6}),a("circle",{cx:29.4,cy:25.4,r:2.6,fill:e.fill,className:"m-o",strokeWidth:1.6})]})});class re{static shapeOf(e){let t=e.shapes[e.name];return t in Gt?t:"bun"}static colorOf(e){let t=0;for(let n of e.name)t=t*31+n.charCodeAt(0)>>>0;return Wt[t%Wt.length]}}var Me=(e)=>{let t=Gt[e.shape],n=re.colorOf({name:e.name});return a("svg",{viewBox:"-6 -16 68 60",className:"bot","aria-hidden":"true",children:[e.state==="working"?a(N,{children:[a("ellipse",{cx:47,cy:40.5,rx:10,ry:3,fill:"#8B5A2B",className:"m-o",strokeWidth:1.6}),a("path",{d:"M39 40.5c3-4 13-4 16 0",fill:"#A0703F",className:"m-o",strokeWidth:1.6}),a("g",{className:"m-dig",children:a(Be,{shape:t,state:"working",fill:n})}),a(Mn,{fill:n}),a("circle",{cx:50,cy:39,r:1.6,fill:"#8B5A2B",className:"m-o m-clod",strokeWidth:0.8}),a("circle",{cx:51,cy:39.5,r:1.2,fill:"#8B5A2B",className:"m-o m-clod m-c2",strokeWidth:0.8}),a("circle",{cx:48.5,cy:39,r:1.1,fill:"#8B5A2B",className:"m-o m-clod m-c3",strokeWidth:0.8})]}):null,e.state==="idle"?a(N,{children:[a("ellipse",{cx:20,cy:36.8,rx:14,ry:1.8,className:"m-ink m-shadow"}),a("g",{className:"m-sleep",children:[a(Be,{shape:t,state:"idle",fill:"#8E8FA3"}),a("circle",{cx:24.5,cy:29,r:2.6,fill:"#BFE6FF",className:"m-o m-snot",strokeWidth:0.9})]}),a("text",{x:31,y:10,className:"m-zz",children:"z"}),a("text",{x:31,y:10,className:"m-zz m-z2",children:"z"}),a("text",{x:31,y:10,className:"m-zz m-z3",children:"Z"})]}):null,e.state==="you"?a(N,{children:[a("g",{className:"m-bubble",children:[a("path",{d:"M26 -10h18a4 4 0 0 1 4 4v10a4 4 0 0 1-4 4h-9l-5 4 1-4h-5a4 4 0 0 1-4-4v-10a4 4 0 0 1 4-4z",fill:"#F6D33C",className:"m-o",strokeWidth:1.8}),a("text",{x:35,y:5,textAnchor:"middle",className:"m-q",children:"?"})]}),a("g",{className:"m-lean",children:[a(Be,{shape:t,state:"you",fill:n}),a("g",{className:"m-wave",children:a("circle",{cx:35.4,cy:22,r:2.7,fill:n,className:"m-o",strokeWidth:1.6})})]})]}):null,e.state==="blocked"?a(N,{children:[a(Be,{shape:t,state:"blocked",fill:n}),a("path",{d:"M7.6 13.4c1.3 1.8 2 2.8 2 3.8a2 2 0 0 1-4 0c0-1 .7-2 2-3.8z",fill:"#BFE6FF",className:"m-o",strokeWidth:0.9}),a("circle",{cx:34,cy:7.4,r:3.4,fill:"var(--fail)",className:"m-o",strokeWidth:1.2}),a("path",{d:"M34 5.6v2.2",stroke:"#fff",strokeWidth:1.2,strokeLinecap:"round"}),a("circle",{cx:34,cy:9.3,r:0.5,fill:"#fff"})]}):null]})};var nt={you:"ask",blocked:"ask",working:"work",idle:"idle"},Le=(e)=>a(N,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),Ln=(e)=>{let{t,now:n}=D(),{row:s,card:o}=e,i=(f)=>I.clock({iso:f}),r=[o.role,o.lane?`${t("ag.under")} ${o.lane}`:void 0,o.harness,o.model].filter(Boolean).join(" · "),l=o.since?` · ${I.ago({iso:o.since,now:n,translate:t})}`:"",u=a("span",{className:"c-face",children:a(Me,{state:s.st,name:s.n,shape:e.shape})}),_=a("span",{className:`c-badge b-${nt[s.st]}`,children:`${t(ge.PILL[s.st])}${l}`}),c={"data-agent":s.n,tabIndex:0,"aria-pressed":e.picked,onClick:()=>e.onPick(s.n),onKeyDown:(f)=>{if(f.key==="Enter"||f.key===" ")f.preventDefault(),e.onPick(s.n)}};if(e.compact)return a("div",{className:`c-card c-compact cell ${s.st}${e.picked?" sel":""}`,role:"button",...c,children:[u,a("div",{className:"c-grow",children:[a("div",{className:"c-top",children:[a("span",{className:"c-nm",children:s.n}),_]}),o.workingOn?a("div",{className:"c-id",children:o.workingOn.flow.id}):null]}),s.st==="you"?a("span",{className:"c-ask",role:"img","aria-label":t("ag.asking"),title:t("ag.asking")}):null]});return a("div",{className:`c-card cell ${s.st}${e.picked?" sel":""}`,role:"button",...c,children:[a("div",{className:"c-head",children:[u,a("div",{className:"c-grow",children:[a("div",{className:"c-top",children:[a("span",{className:"c-nm",children:s.n}),_]}),r?a("div",{className:"c-role",children:r}):null]})]}),a("div",{className:"c-body",children:[o.workingOn?a(Le,{label:t("ag.working"),children:[o.workingOn.flow.title," ",a("small",{children:o.workingOn.flow.id})]}):null,s.ask?a(Le,{label:t("ag.asking"),children:`"${s.ask}"`}):null,o.action?a(Le,{label:t(o.workingOn?"ag.action":"ag.lastTime"),children:[o.action.summary," ",a("small",{children:i(o.action.ts)})]}):null,o.message?a(Le,{label:t("ag.message"),children:[tt.textOf({event:o.message,translate:t})," ",a("small",{children:i(o.message.ts)})]}):null]}),a("div",{className:"c-foot",children:[a("span",{children:[t("ag.prs")," ",a("b",{children:o.prs})]}),a("span",{children:[t("ag.pending")," ",a("b",{children:o.pending})]}),a("span",{children:[a("b",{children:o.today})," ",t("ag.today")]}),o.last?a("span",{className:"c-r",children:i(o.last)}):null]})]})},zt=(e)=>{let{t,now:n}=D(),[s,o]=P(!1),i=n-H.EARLIER_HOURS*C.HOUR_MS,r=(c)=>c.lastAt!==null&&Date.parse(c.lastAt)>=i,l=e.rows.filter(r),u=e.rows.filter((c)=>!r(c)),_=(c)=>a(Ln,{row:c,card:e.cards[c.n],shape:re.shapeOf({name:c.n,shapes:e.shapes}),picked:e.picked===c.n,compact:!e.details,onPick:e.onPick},c.n);return a("section",{className:"c-pane",id:"dock","aria-label":t("Các agent đang chạy"),children:[a("div",{className:"c-ph",children:[t("pn.agents")," ",a("span",{className:"c-n",children:l.length}),a("button",{className:"btn c-tg",type:"button","aria-pressed":e.details,onClick:()=>e.onDetails(!e.details),children:t("ag.details")})]}),a("div",{className:"c-scroll",children:[e.rows.length===0?a("p",{className:"c-empty",children:t("chưa có agent")}):null,l.map(_),u.length>0?a("button",{className:"btn c-loose",type:"button","aria-expanded":s,onClick:()=>o(!s),children:`${t("ag.earlier")} (${u.length})`}):null,s?u.map(_):null]})]})};class X{static safe(e){let{value:t}=e;if(t===void 0)return;return/^https:\/\//.test(t)||e.image===!0&&/^data:image\//.test(t)?t:void 0}}class $n{static SESSION_START="session-start";static SESSION_STOP="session-stop";static MSG_SENT="msg-sent";static MSG_RECEIVED="msg-received";static NEEDS_OWNER="needs-owner";static SUBAGENT_STOP="subagent-stop";static COMMIT="commit";static PR="pr";static DECISION="decision";static FLOW="flow";static DEPLOY="deploy";static TOOL_TICK="tool-tick";static SCHEME_SET=new Set([this.SESSION_START,this.SESSION_STOP,this.MSG_SENT,this.MSG_RECEIVED,this.NEEDS_OWNER,this.SUBAGENT_STOP,this.COMMIT,this.PR,this.DECISION,this.FLOW,this.DEPLOY,this.TOOL_TICK]);static isValid(e){return this.SCHEME_SET.has(e)}}class Fn{static APPROVE="approve";static PARK="park";static REJECT="reject";static SCHEME_SET=new Set([this.APPROVE,this.PARK,this.REJECT]);static isValid(e){return this.SCHEME_SET.has(e)}}class Un{static STEP="--step";static STEP_DONE="--step-done";static CHECK="--check";static CHECK_DONE="--check-done";static APP="--app";static DUE="--due";static KIND="--kind";static SUMMARY="--summary";static FLOW="--flow";static REF="--ref";static STATUS="--status";static TITLE="--title";static WHY="--why";static CONTEXT="--context";static NEXT="--next";static ACTOR="--actor";static DIR="--dir";static SINCE="--since";static JSON="--json";static KNOWN=new Set([this.STEP,this.STEP_DONE,this.CHECK,this.CHECK_DONE,this.APP,this.DUE,this.KIND,this.SUMMARY,this.FLOW,this.REF,this.STATUS,this.TITLE,this.WHY,this.CONTEXT,this.NEXT,this.ACTOR,this.DIR,this.SINCE,this.JSON])}class le{static DEFAULT_MAX_SIZE="50MB";static DEFAULT_MAX_FILES=30;static DEFAULT_MAX_AGE_DAYS=30;static DEFAULT_DIRECTORY=".agents/local/events";static MANIFEST_FILE=".agents/vulcan.manifest.json";static DAY_FILE=/^(\d{4}-\d{2}-\d{2})\.jsonl$/;static FILE_SUFFIX=".jsonl";static SUMMARY_MAX=200;static CONTEXT_MAX=600;static MESSAGE_SENT_LABEL="message sent";static TOOL_TICK_LABEL="using a tool";static TICK_SECONDS=30;static TICK_FOLDER=".agents/local/tmp/event-ticks";static REF_MAX=120;static ITEM_COUNT_MAX=30;static ITEM_TEXT_MAX=200;static APP_COUNT_MAX=12;static APP_TEXT_MAX=40;static DUE_PATTERN=/^\d{4}-\d{2}-\d{2}$/;static MODEL_MAX=80;static ACTOR_MAX=80;static REDACTED="[redacted]";static FLOW_PREFIX="VULZ";static FLOW_ID="VULZ-[A-Z0-9]{2,8}-\\d+|F-\\d+";static FLOW_PATTERN=new RegExp(`\\b(?:${le.FLOW_ID})\\b`);static FLOW_EXACT=new RegExp(`^(?:${le.FLOW_ID})$`);static FLOW_LINE=new RegExp(`\\bFlow:\\s*(${le.FLOW_ID})\\b`);static FLOW_LEGACY=/^F-\d+$/;static FLOW_CLAIM_DIR=".flow-ids";static FLOW_RECENT_COUNT=5;static UNKNOWN_ACTOR="unknown";static UNNAMED_PREFIX="claude:";static MADE_UP_NAME_SOURCES=new Set(["derived","auto","collision"]);static ACTOR_ENV="VULCAN_ACTOR";static SESSION_ENV="CLAUDE_CODE_SESSION_ID";static CONFIG_DIR_ENV="CLAUDE_CONFIG_DIR";static DAY_MS=86400000}class at{static isNamed(e){return e.actor!==le.UNKNOWN_ACTOR&&!e.actor.startsWith(le.UNNAMED_PREFIX)}}class $e{static PRIVATE_KEY=/-----BEGIN [A-Z ]*PRIVATE KEY-----.*/g;static TOKENS=[/\b(?:ghp|gho|ghs|ghu|ghr)_[A-Za-z0-9]{16,}/g,/\bgithub_pat_[A-Za-z0-9_]{16,}/g,/\bnpm_[A-Za-z0-9]{16,}/g,/\bsk-[A-Za-z0-9_-]{16,}/g,/\bAKIA[0-9A-Z]{16}\b/g,/\bAIza[0-9A-Za-z_-]{35}/g,/\bglpat-[A-Za-z0-9_-]{16,}/g,/\b[sr]k_(?:live|test)_[A-Za-z0-9]{8,}/g,/\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]*/g,/\bBasic\s+(?:(?=[A-Za-z0-9+/]*(?:[0-9+/]|[a-z][A-Z]))[A-Za-z0-9+/]{8,}={0,2}|[A-Za-z0-9+/]{8,}={1,2})/g,/\bxox[abprs]-[A-Za-z0-9-]{10,}/g,/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi];static HIGH_ENTROPY=[/\b[0-9a-fA-F]{64,}\b/g,/\b(?=[A-Za-z0-9+]*\d)(?=[A-Za-z0-9+]*[a-z])(?=[A-Za-z0-9+]*[A-Z])[A-Za-z0-9+]{40,}={0,2}/g];static PATTERNS=[$e.PRIVATE_KEY,...$e.TOKENS,...$e.HIGH_ENTROPY];static URL_USERINFO=/(\/\/)[^\s/@:]+:[^\s/@]+@/g;static ASSIGNMENT=/["']?\b([A-Za-z0-9_.-]*(?:key|token|secret|password|passwd|pwd|credential)[A-Za-z0-9_.-]*)["']?\s*[:=]\s*("[^"]*"|'[^']*'|\S+)/gi;static SPOKEN=/\b((?:password|passwd|passphrase|secret|token|api[ _-]?key)s?)\s+(?:is|are|was|were)\s+("[^"]*"|'[^']*'|\S+)/gi}class R{static byTime(e,t){if(e.ts!==t.ts)return e.ts<t.ts?-1:1;return e.stage-t.stage}static involves(e){return e.view.holder===e.name||e.view.evs.some((t)=>t.actor===e.name||t.to===e.name)}static linesOf(e){return e.flow.events.filter((t)=>e.showAll||!t.plumbing)}static eventsOf(e){return e.data.flows.flatMap((t)=>R.linesOf({flow:t,showAll:e.showAll}))}static flowsOf(e){let t=[];for(let n of e.data.flows){let s=R.linesOf({flow:n,showAll:e.showAll}).sort(R.byTime),o=s.find((i)=>i.id===n.lastId)??s.at(-1);if(o===void 0)continue;t.push({flow:n,holder:n.holder,evs:s,last:o,lastAsk:s.find((i)=>i.id===n.askId),noWork:!s.some((i)=>!i.plumbing&&i.kind!=="flow"),newCount:s.filter((i)=>i.ts>e.lastSeen).length})}return t}static rowsOf(e){let{data:t,flows:n,events:s,translate:o}=e,i=t.agents,r=(c)=>c!==""&&c!==t.owner&&!H.NOT_AGENTS.has(c)&&at.isNamed({actor:c}),l=t.roster??[],u=(c)=>l.includes(c)?l.indexOf(c):l.length;return[...new Set([...Object.keys(i).filter(r),...s.filter((c)=>c.source!=="github"&&r(c.actor)).map((c)=>c.actor)])].map((c)=>{let f=i[c],m=s.filter((g)=>g.actor===c&&!g.incoming).sort(R.byTime).at(-1),d=n.find((g)=>g.flow.state==="you"&&g.evs.findLast((b)=>b.actor!==t.owner)?.actor===c),p=n.find((g)=>g.flow.state==="blocked"&&g.holder===c),w=n.find((g)=>g.flow.state==="running"&&g.holder===c),h=[f?.checkedAt,m?.ts].filter((g)=>g!==void 0).sort().at(-1)??null,E=h===null||e.now-Date.parse(h)>C.ACTIVE_GAP_MS,v=R.stateOf({doc:f,blockedFlow:p,youFlow:d,runFlow:w,quiet:E}),S=R.saidOf({st:v,doc:f,lastLine:m,youFlow:d,translate:o});return{n:c,lastAt:h,st:v,...v==="you"&&d?.lastAsk?{ask:d.lastAsk.summary}:{},flow:(p??d)?.flow.id??w?.flow.id??m?.flowId??null,...S,key:`${m?.id??m?.ts??""}|${f?.checkedAt??""}|${f?.current??""}`}}).sort((c,f)=>u(c.n)-u(f.n)||c.n.localeCompare(f.n))}static stateOf(e){if(e.blockedFlow)return"blocked";if(e.youFlow)return"you";return!e.quiet&&(e.doc?.state==="working"||e.runFlow)?"working":"idle"}static saidOf(e){let{st:t,doc:n,lastLine:s,youFlow:o,translate:i}=e,r=(_)=>_?Date.parse(_)||0:0,l=(_,c)=>({text:c,ts:_.ts,approx:I.isApproximate({source:_.source})}),u;if(t==="you"&&o?.lastAsk)u=l(o.lastAsk,`${i("chờ anh: ")}${o.lastAsk.summary}`);else if(n?.current&&(!s||r(n.checkedAt)>r(s.ts)))u={text:n.current,ts:n.since,approx:!1};else if(s)u=l(s,s.summary);else u={text:n?.current===""||n===void 0?i("chưa có việc"):n.current,ts:n?.since??null,approx:!1};return t==="idle"&&!H.IDLE_TEXT.test(u.text)?{...u,text:`${i("rảnh · ")}${u.text}`}:u}}class U{static endsOf(e){let{message:t}=e;return t.incoming?{sender:t.from,receiver:t.actor}:{sender:t.actor,receiver:t.to}}static prHref(e){let{pr:t}=e;if(X.safe({value:t.link??void 0}))return t.link??void 0;return t.repo&&/^[\w.-]+\/[\w.-]+$/.test(t.repo)?`https://github.com/${t.repo}/pull/${t.n}`:void 0}static prsOf(e){let{events:t}=e,n={};for(let s of t){if(!s.ref?.pr)continue;let o=n[`${s.ref.repo??""}#${s.ref.pr}`]??={repo:s.ref.repo,n:s.ref.pr,flow:s.flowId,ci:null,link:null,merged:!1,closed:!1};o.by??=s.kind==="pr"?s.actor:void 0,o.merged||=s.kind==="merge",o.closed||=s.status==="closed",o.ci=s.kind==="ci"?s.status??null:o.ci,o.link=s.link&&/^https:\/\/.+\/pull\//.test(s.link)?s.link:o.link}return Object.values(n)}static of(e){let{data:t,events:n,name:s}=e,o=n.filter((i)=>i.kind==="msg").filter((i)=>{let{sender:r,receiver:l}=U.endsOf({data:t,message:i});return r===s||l===s}).sort(R.byTime);return{mine:n.filter((i)=>i.actor===s).sort(R.byTime),open:U.prsOf({events:n}).filter((i)=>i.by===s&&!i.merged&&!i.closed),pending:U.pendingOf({data:t,messages:o,name:s})}}static pendingOf(e){let{data:t,messages:n,name:s}=e,o=(l)=>U.endsOf({data:t,message:l}),i=n.filter((l)=>o(l).sender===s).at(-1)?.ts??"",r=new Set;return n.filter((l)=>{let{sender:u,receiver:_}=o(l),c=`${u}|${_}|${l.summary}|${l.ts.slice(0,16)}`;if(_!==s||l.ts<=i||r.has(c))return!1;return r.add(c),!0})}}var Vn=/[.!?](\s|$)/,Kt=140,Hn=3;class j{static sentenceOf(e){let t=(e.text??"").trim(),n=Vn.exec(t),s=n===null?t:t.slice(0,n.index+1);return s.length>Kt?`${s.slice(0,Kt-1).trimEnd()}…`:s}static itemOf(e){let{view:t}=e,{flow:n}=t,s=(i)=>({done:(i??[]).filter((r)=>r.done).length,total:(i??[]).length}),o=t.evs.filter((i)=>!i.plumbing&&!H.NOT_AGENTS.has(i.actor)).map((i)=>i.actor);return{now:j.sentenceOf({text:n.next??n.why}),waiting:n.state==="you"||n.state==="blocked"?n.next??t.lastAsk?.summary:void 0,steps:s(n.steps),checks:s(n.checks),prs:U.prsOf({events:t.evs}).filter((i)=>!i.merged&&!i.closed).map((i)=>({label:`${i.repo??""}#${i.n}`,ci:i.ci})),people:[...new Set([t.holder,...o])],updates:t.evs.filter((i)=>i.kind==="flow").length,deploys:[...new Set(t.evs.filter((i)=>i.kind==="release").map((i)=>i.summary))].slice(-Hn)}}static daysLeft(e){let t=new Date(e.now);return t.setHours(0,0,0,0),Math.round((new Date(`${e.due}T00:00:00`).getTime()-t.getTime())/C.DAY_MS)}static agentOf(e){let{data:t,events:n,views:s,row:o,doc:i,now:r}=e,l=n.filter((c)=>c.actor===o.n&&!c.plumbing),u=U.of({data:t,events:n,name:o.n}),_=(c)=>c.reduce((f,m)=>f===void 0||m.ts>=f.ts?m:f,void 0);return{workingOn:o.st==="idle"||o.flow===C.UNSORTED?void 0:s.find((c)=>c.flow.id===o.flow),action:_(l.filter((c)=>c.kind!=="msg"&&c.kind!=="flow")),message:_(n.filter((c)=>{let{sender:f,receiver:m}=U.endsOf({data:t,message:c});return c.kind==="msg"&&(f===o.n||m===o.n)})),prs:u.open.length,pending:u.pending.length,today:l.filter((c)=>I.isSameDay({iso:c.ts,now:r})).length,last:i?.checkedAt,since:o.st==="idle"&&i?.state==="working"?o.lastAt??i.since:i?.since,role:t.roles?.[o.n],lane:t.lanes?.[o.n],model:i?.model,harness:i?.harness}}}var Wn=(e)=>e.status==="fail"||e.status==="blocked",Xt=(e)=>{let{t}=D();return a("svg",{className:`mk ${e.bad?"x":"v"}`,viewBox:"0 0 10 10",role:"img","aria-label":e.bad?t("lỗi"):t("đạt"),children:a("path",{d:e.bad?"M2.5 2.5l5 5M7.5 2.5l-5 5":"M2 5.4l2 2 4-4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})},Fe=(e)=>a("span",{className:"c-bar",children:a("span",{style:{width:`${Math.round(e.done/e.total*100)}%`}})}),st=(e)=>{let{items:t}=e;if(t===void 0||t.length===0)return null;return a("div",{className:"ckl",children:a("ul",{children:t.map((n,s)=>a("li",{className:n.done?"on":void 0,children:n.text},`${s}:${n.text}`))})})},Gn=(e)=>{let{event:t}=e;if(t.incoming)return t.from?a(N,{children:[" ← ",a("b",{children:t.from})]}):null;return t.to?a(N,{children:[" → ",a("b",{children:t.to})]}):null},ot=(e)=>{let{t}=D(),{event:n}=e,s=I.isApproximate({source:n.source}),o=X.safe({value:n.link}),i=B.KIND_TEXT[n.kind],r="";if(s)r=t("giờ ước lượng");else if(n.source==="github")r="GitHub";return a("li",{className:`ev${Wn(n)?" fail":""}`,children:[a("span",{className:"tm",children:[s?"≈":"",I.clock({iso:n.ts})]}),a("div",{children:[e.chip,a("div",{className:"who",children:[a("b",{children:n.actor}),a(Gn,{event:n}),` · ${i?t(i):n.kind}${n.attempt&&n.attempt>1?`${t(" lần ")}${n.attempt}`:""}`]}),a("div",{className:"sm",children:n.summary}),o||r?a("div",{children:[o?a("a",{className:"lk",href:X.safe({value:n.link}),target:"_blank",rel:"noopener",children:o.replace(/^https:\/\/github\.com\//,"")}):null,o&&r?" · ":null,r?a("span",{className:"src",children:r}):null]}):null]})]})};var jt={decision:"ms.decision",merge:"ms.merge",release:"ms.deploy"},Yt=5,zn=200,Kn=(e)=>{if(e.stage===e.cur)return"st cur";return e.stage<e.cur?"st done":"st"},ae=(e)=>a("div",{className:"d-sec",children:[a("h4",{children:e.title}),e.children]}),Xn=(e)=>{let{t}=D(),n=e.view.evs.filter((s,o)=>o===0||(s.kind in jt)).map((s,o)=>({event:s,tag:o===0?"ms.open":jt[s.kind]})).reverse();return a("div",{className:"d-up",children:n.map(({event:s,tag:o},i)=>a("div",{className:`d-u${i===0?" last":""}`,children:[a("time",{children:I.clock({iso:s.ts})}),a("span",{className:"d-tag",children:t(o)}),s.summary]},s.id))})},jn=(e)=>{let{t}=D();return a("div",{id:"dBody",className:"d-body",children:[a("h2",{children:t("it.unsorted")}),a("p",{className:"d-empty",children:t("it.unsortedNote")}),a("ul",{className:"evs",children:[...e.view.evs].reverse().slice(0,zn).map((n)=>a(ot,{event:n},n.id))})]})},Yn=(e)=>{let{t}=D(),{view:n}=e,{flow:s}=n,o=j.itemOf({view:n});return a("div",{id:"dBody",className:"d-body",children:[a("h2",{children:s.title}),a("div",{className:"d-meta",children:[a("span",{className:"c-id",children:s.id}),s.tracker?a("span",{className:"c-ref",children:s.tracker}):null,s.due?a("span",{children:`${t("fl.due")} ${s.due}`}):null,a("span",{children:[t("it.holder"),": ",a("span",{className:"d-who",children:n.holder})]})]}),n.noWork?null:a(N,{children:[a("div",{className:"d-stages",children:B.STAGES.map((i,r)=>a("span",{title:t(i),className:Kn({stage:r,cur:s.cur})},i))}),a("div",{className:"d-stl",children:[a("span",{children:t(B.STAGES[0])}),a("b",{children:t(B.STAGES[s.cur])}),a("span",{children:t(B.STAGES[B.STAGES.length-1])})]})]}),s.context||s.apps?a(ae,{title:t("dt.whatItIs"),children:[s.context?a("p",{children:s.context}):null,s.apps?a("div",{className:"c-chips",children:s.apps.map((i)=>a("span",{children:i},i))}):null]}):null,s.steps&&s.steps.length>0?a(ae,{title:`${t("fl.steps")} · ${o.steps.done}/${o.steps.total}`,children:[a(Fe,{...o.steps}),a(st,{items:s.steps})]}):null,s.checks&&s.checks.length>0?a(ae,{title:`${t("fl.checks")}${s.tracker?` · ${s.tracker}`:""}`,children:a(st,{items:s.checks})}):null,o.waiting?a("div",{className:"d-sec d-waiting",children:[a("span",{className:"d-k",children:t("it.waiting")}),a("span",{children:o.waiting})]}):null,n.noWork?a("p",{className:"d-empty",children:t("nw.empty")}):null,a(ae,{title:t("dt.milestones"),children:a(Xn,{view:n})}),a("button",{className:"btn d-all",type:"button","aria-pressed":e.everything,onClick:()=>e.onEverything(!e.everything),children:`${t("dt.all")} (${n.evs.length})`}),e.everything?a("ul",{className:"evs",children:n.evs.map((i)=>a(ot,{event:i},i.id))}):null]})},qn=(e)=>{let{t,now:n}=D(),{row:s,card:o,data:i}=e,r=U.of({data:i,events:e.events,name:s.n}),l=(u)=>I.clock({iso:u});return a("div",{id:"dBody",className:"d-body d-agent",children:[a("div",{className:"d-agenthead",children:[a(Me,{state:s.st,name:s.n,shape:e.shape}),a("div",{children:[a("h2",{id:"popName",children:s.n}),a("div",{className:"d-meta",children:[a("span",{className:`c-badge b-${nt[s.st]}`,children:t(ge.PILL[s.st])}),o.since?a("span",{children:`${t("từ ")}${l(o.since)} · ${I.ago({iso:o.since,now:n,translate:t})}`}):null]})]})]}),a(ae,{title:t("5 sự kiện gần nhất"),children:r.mine.length===0?a("p",{className:"d-empty",children:t("Chưa có sự kiện nào của agent này.")}):a("ul",{className:"d-list",children:r.mine.slice(-Yt).reverse().map((u)=>a("li",{children:[a("time",{children:l(u.ts)}),u.flowId?a("button",{className:"btn chip",type:"button",onClick:()=>e.onFlow(u.flowId),children:u.flowId}):null,u.summary]},u.id))})}),a(ae,{title:`${t("PR đang mở (")}${r.open.length})`,children:r.open.length===0?a("p",{className:"d-empty",children:t("Không có PR nào đang mở.")}):a("ul",{className:"d-list",children:r.open.map((u)=>a("li",{children:[a("a",{href:X.safe({value:U.prHref({pr:u})}),target:"_blank",rel:"noopener",children:`${u.repo??""}#${u.n}`}),u.ci?a(Xt,{bad:u.ci==="fail"}):null,u.flow]},`${u.repo}#${u.n}`))})}),a(ae,{title:`${t("Tin nhắn chưa có trả lời (")}${r.pending.length})`,children:r.pending.length===0?a("p",{className:"d-empty",children:t("Không có tin nào đang chờ.")}):a("ul",{className:"d-list",children:r.pending.slice(-Yt).reverse().map((u)=>{let{sender:_,receiver:c}=U.endsOf({data:i,message:u});return a("li",{children:[a("time",{children:l(u.ts)}),`${_===s.n?`→ ${c??"?"}`:`← ${_??"?"}`}: ${u.summary}`]},u.id)})})})]})},qt=(e)=>{let{t}=D(),{detail:n}=e,s=n?.kind==="flow"?e.views.find((i)=>i.flow.id===n.id):void 0,o=n?.kind==="agent"?e.rows.find((i)=>i.n===n.name):void 0;return a("section",{className:"c-pane c-p3",id:"detail","aria-label":t("Chi tiết luồng"),hidden:s===void 0&&o===void 0,children:[a("div",{className:"c-ph",children:[t("pn.detail"),a("button",{className:"c-x",type:"button",title:t("Đóng"),"aria-label":t("Đóng"),onClick:e.onClose,children:"✕"})]}),a("div",{className:"c-scroll",children:[s&&s.flow.id===C.UNSORTED?a(jn,{view:s}):null,s&&s.flow.id!==C.UNSORTED?a(Yn,{view:s,everything:e.everything,onEverything:e.onEverything}):null,o?a(qn,{row:o,card:e.cards[o.n],data:e.data,events:e.events,shape:re.shapeOf({name:o.n,shapes:e.data.shapes}),onFlow:e.onFlow}):null]})]})};var ce={fill:"none",stroke:"currentColor",strokeWidth:1.5},Zt={light:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a("circle",{cx:"10",cy:"10",r:"3.6",...ce}),a("path",{d:"M10 1.8v2M10 16.2v2M1.8 10h2M16.2 10h2M4.2 4.2l1.4 1.4M14.4 14.4l1.4 1.4M4.2 15.8l1.4-1.4M14.4 5.6l1.4-1.4",...ce,strokeLinecap:"round"})]}),dark:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a("path",{d:"M16.5 12.4A7 7 0 0 1 7.6 3.5a7 7 0 1 0 8.9 8.9Z",...ce,strokeLinejoin:"round"})}),system:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a("rect",{x:"2.5",y:"3.5",width:"15",height:"10",rx:"1.5",...ce}),a("path",{d:"M7 17h6M10 13.5V17",...ce,strokeLinecap:"round"})]})},Jt=()=>a("svg",{className:"chev",viewBox:"0 0 12 12","aria-hidden":"true",children:a("path",{d:"M3 4.5l3 3 3-3",...ce})});var he=["light","dark","system"],Zn={light:"sáng",dark:"tối",system:"theo máy"},Qt=(e)=>{let t=Pe(),n=`${t("Giao diện: ")}${t(Zn[e.theme])}`,s=`${t("lang.label")}: ${t(`lang.${e.language}`)}`;return a("header",{className:"bar",children:[a("span",{className:"mark",id:"mark",children:e.logo?a("img",{src:X.safe({value:e.logo,image:!0}),alt:""}):null}),a("span",{className:"brule","aria-hidden":"true"}),a("h1",{id:"boardTitle",children:e.title}),a("span",{className:"spacer"}),a("span",{className:"since",id:"since",title:e.sources.join(`
|
|
1267
|
+
`),children:a("span",{id:"sinceTxt",children:[t("Từ lần xem trước lúc "),a("b",{children:I.clock({iso:e.lastSeen})}),": ",a("b",{children:e.newCount}),t(" sự kiện mới")]})}),a("button",{className:"btn",type:"button",id:"bSeen",onClick:e.onSeen,children:a("span",{children:t("Đánh dấu đã xem")})}),a("span",{className:"fresh",id:"fresh",children:e.live===void 0?null:a("span",{className:e.live==="on"?void 0:"st",children:t(`live.${e.live}`)})}),a("button",{className:"btn",type:"button",id:"bPlumb","aria-pressed":e.showPlumbing,title:t("pl.tip"),onClick:e.onPlumbing,children:a("span",{children:t("pl.all")})}),a("button",{className:"btn lang",type:"button",id:"bLang","aria-label":s,title:s,onClick:e.onLanguage,children:e.language==="en"?"VI":"EN"}),a("button",{className:"btn sq theme",type:"button",id:"bTheme","aria-label":`${n}${t(". Bấm để đổi")}`,title:n,onClick:e.onTheme,children:Zt[e.theme]}),a("button",{className:"btn sq",type:"button",id:"bKeys","aria-label":t("Phím tắt"),"aria-expanded":e.keysOpen,onClick:e.onKeys,children:"?"})]})};var Jn={you:"wait",blocked:"ask",running:"work",parked:"idle",done:"ok"},Qn=2,de=(e)=>a(N,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),en=(e)=>a("span",{className:"c-v c-mini",children:[a(Fe,{done:e.done,total:e.total}),`${e.done}/${e.total} ${e.label}`]}),ea=(e)=>{let{t,now:n}=D();if(e.due===void 0)return a("span",{className:"c-badge b-idle",children:t("it.noDue")});let s=j.daysLeft({due:e.due,now:n}),o=s<0?t("it.overdue"):`${s} ${t("it.daysLeft")}`;return a("span",{className:`c-badge ${s<=Qn?"b-ask":"b-idle"}`,children:`${t("fl.due")} ${e.due} · ${o}`})},ta=(e)=>{let{t}=D(),{view:n,card:s}=e,{flow:o}=n,i=Re(null),r=(l)=>I.clock({iso:l});return G(()=>{if(e.selected)i.current?.scrollIntoView({block:"nearest"})},[e.selected]),a("div",{ref:i,className:`c-card row${e.selected?" sel":""}`,"data-id":o.id,role:"button",tabIndex:0,"aria-selected":e.selected,onClick:()=>e.onSelect(o.id),onKeyDown:(l)=>{if(l.key==="Enter"&&l.target===l.currentTarget)l.preventDefault(),e.onSelect(o.id)},children:[a("div",{className:"c-head",children:[a("span",{className:`c-badge b-${Jn[o.state]}`,children:n.noWork?t("nw.chip"):t(B.STAGES[o.cur])}),a("span",{className:"c-id",children:o.id}),o.tracker?a("span",{className:"c-ref",children:o.tracker}):null,n.newCount>0?a("span",{className:"unread",title:`${n.newCount}${t(" sự kiện mới")}`}):null,a("span",{className:"c-grow"}),a(ea,{due:o.due})]}),a("div",{className:"c-title",children:o.title}),s.now?a("div",{className:"c-now",children:`${t("it.now")}: ${s.now}`}):null,a("div",{className:"c-wb",children:[s.steps.total>0?a(de,{label:t("fl.steps"),children:a(en,{...s.steps,label:t("it.done")})}):null,s.checks.total>0?a(de,{label:t("it.checks"),children:a(en,{...s.checks,label:t("it.criteria")})}):null,o.apps?a(de,{label:t("it.apps"),children:a("span",{className:"c-chips",children:o.apps.map((l)=>a("span",{children:l},l))})}):null,s.prs.length>0?a(de,{label:t("it.prs"),children:s.prs.map((l)=>a("span",{className:"c-pr",children:[l.label,l.ci===null?null:a("b",{className:l.ci==="fail"?"bad":"good",children:` ● CI ${t(l.ci==="fail"?"lỗi":"đạt")}`})]},l.label))}):null,a(de,{label:t("it.people"),children:a("span",{className:"c-chips",children:s.people.map((l,u)=>a("span",{className:u===0?"h":void 0,children:u===0?`${l} ${t("it.holds")}`:l},l))})}),s.waiting?a(de,{label:t("it.waiting"),children:s.waiting}):null]}),a("div",{className:"c-foot",children:[a("span",{children:[t("it.started")," ",a("b",{children:r(n.evs[0].ts)})]}),a("span",{children:[t("it.updates")," ",a("b",{children:s.updates})]}),s.deploys.length>0?a("span",{children:[t("it.deploys")," ",a("b",{children:s.deploys.join(", ")})]}):null,a("span",{className:"c-r",children:`${t("it.latest")} ${r(n.last.ts)}`})]})]})},tn=(e)=>{let{t,now:n}=D(),s=e.views.filter((r)=>e.agent===null||R.involves({view:r,name:e.agent})),o=s.filter((r)=>r.flow.id!==C.UNSORTED&&(r.flow.state!=="done"||I.isWithin({iso:r.last.ts,now:n,days:H.DONE_DAYS}))),i=s.find((r)=>r.flow.id===C.UNSORTED);return a("section",{className:"c-pane","aria-label":t("Danh sách luồng"),children:[a("div",{className:"c-ph",children:[t("pn.items")," ",a("span",{className:"c-n",id:"flowN",children:o.length}),e.agent===null?null:a("button",{className:"btn filter-chip",type:"button","aria-label":`${t("Bỏ lọc theo ")}${e.agent}`,onClick:()=>e.onAgent(null),children:[t("Của "),a("b",{children:e.agent})," ×"]})]}),a("div",{className:"c-scroll",id:"groups",children:[o.length===0?a("p",{className:"c-empty",children:t("Chưa có luồng nào. Bật events.log, hoặc ghi một dòng bằng vulcan event add.")}):null,B.GROUPS.map((r)=>{let l=o.filter((_)=>_.flow.state===r.key).sort((_,c)=>r.key==="you"||r.key==="blocked"?R.byTime(_.last,c.last):R.byTime(c.last,_.last)),u=e.open[r.key]??r.open;if(o.length===0)return null;return a("section",{className:"c-group",children:[a("button",{className:"c-gh",type:"button","aria-expanded":u,onClick:()=>e.onToggle(r.key),children:[a(Jt,{}),a("span",{className:"c-dot",style:{background:r.swatch}}),a("span",{children:`${t(r.label)} · ${l.length}`})]}),u&&l.length===0?a("p",{className:"c-empty",children:r.key==="you"?t("Không có gì chờ anh."):t("Trống.")}):null,u?l.map((_)=>a(ta,{view:_,card:j.itemOf({view:_}),selected:e.selected===_.flow.id,onSelect:e.onSelect},_.flow.id)):null]},r.key)}),i?a("button",{className:"btn c-loose",type:"button","aria-pressed":e.selected===i.flow.id,onClick:()=>e.onSelect(i.flow.id),children:`${t("it.unsorted")} · ${i.evs.length}`}):null]})]})};var na=[["j / k","Luồng sau / trước"],["Enter","Mở chi tiết"],["e","Các bước hoặc mọi sự kiện"],["Esc","Đóng"],["?","Bảng này"]],nn=(e)=>{let t=Pe();return a("div",{className:"keys",id:"keys",hidden:!e.open,role:"dialog","aria-label":t("Phím tắt"),children:[a("h2",{children:a("span",{children:t("Phím tắt")})}),a("dl",{children:na.flatMap(([n,s])=>[a("dt",{children:n},n),a("dd",{children:a("span",{children:t(s)})},s)])})]})};class se{static get(e){try{return localStorage.getItem(e.key)}catch{return null}}static set(e){try{localStorage.setItem(e.key,e.value)}catch{}}static remove(e){try{localStorage.removeItem(e.key)}catch{}}}var ye=(e)=>{let[t,n]=P(()=>{let o=se.get({key:e.key});return e.allowed.find((i)=>i===o)??e.initial}),s=et((o)=>{se.set({key:e.key,value:o}),n(o)},[e.key]);return[t,s]},an=()=>{let[e,t]=P(Date.now());return G(()=>{let n=setInterval(()=>t(Date.now()),60000);return()=>clearInterval(n)},[]),e},sn=(e)=>{let t=e.data.live?.stream,[n,s]=P("wait");return G(()=>{if(t===void 0)return;let o,i,r=!1,l=0,u=()=>{o=new EventSource(t),o.onmessage=(_)=>{l=0;let c=JSON.parse(_.data);if(c.tooLarge){s("big");return}e.onData(c),s("on")},o.onerror=()=>{if(o?.close(),s("off"),!r)i=setTimeout(u,Math.min(30000,1000*2**l)),l+=1}};return u(),()=>{r=!0,o?.close(),clearTimeout(i)}},[t]),n};var on={en:{"ag.under":"under","ag.earlier":"Earlier","ag.details":"Details","it.unsorted":"Unsorted","it.unsortedNote":"Events that name no flow, newest first."," giờ":" h"," lần ":" try "," ngày":" d"," phút":" min"," sự kiện mới":" new events",". Bấm để đổi":". Click to change","5 sự kiện gần nhất":"Last 5 events","Anh duyệt":"Approval","Bàn giao":"Handoff","Bảng này":"This panel","Bị chặn":"Blocked","Bỏ lọc theo ":"Clear filter for ","Chi tiết luồng":"Flow detail","Chưa có luồng nào. Bật events.log, hoặc ghi một dòng bằng vulcan event add.":"No flows yet. Turn on events.log, or write a line with vulcan event add.","Chưa có sự kiện nào của agent này.":"No events from this agent yet.","Chờ anh":"Waiting on you",Code:"Code","Các agent đang chạy":"Running agents","Các bước hoặc mọi sự kiện":"Stages or all events","Cần anh":"Needs you","Của ":"By ","Danh sách luồng":"Flow list","Giao diện: ":"Theme: ","Không có PR nào đang mở.":"No open pull requests.","Không có gì chờ anh.":"Nothing waits on you.","Không có tin nào đang chờ.":"No message is waiting.","Luồng sau / trước":"Next / previous flow",Merge:"Merge","Mở chi tiết":"Open detail","PR + CI":"PR + CI","PR đang mở (":"Open pull requests (","Phát hành":"Release","Phím tắt":"Shortcuts",Review:"Review",Rảnh:"Idle","Thiết kế":"Design","Tin nhắn chưa có trả lời (":"Unanswered messages (","Trống.":"Empty.","Từ lần xem trước lúc ":"Since your last visit at ",Xong:"Done","ag.action":"Latest action","ag.asking":"Asking you","ag.lastTime":"Last time","ag.message":"Latest message","ag.pending":"Unanswered","ag.prs":"PRs","ag.today":"events today","ag.working":"Working on","bàn giao":"handoff","bị chặn":"blocked","chưa có agent":"no agents yet","chưa có việc":"no work yet","chờ anh":"waiting on you","chờ anh: ":"waiting on you: ","dt.all":"All events","dt.milestones":"Milestones","dt.whatItIs":"What it is","fl.checks":"Acceptance checks","fl.due":"Due","fl.steps":"Steps","g.blocked":"Blocked","g.done":"Done this week","g.parked":"Parked","g.running":"Running","g.you":"Needs you","ghi chú":"note","giao việc":"assign","giờ ước lượng":"estimated time","it.apps":"Apps","it.checks":"Acceptance","it.criteria":"criteria","it.daysLeft":"days left","it.deploys":"Deploy","it.done":"done","it.holder":"Holder","it.holds":"holds","it.latest":"latest","it.noDue":"No due date","it.now":"Now","it.overdue":"overdue","it.people":"People","it.prs":"PR","it.started":"Started","it.updates":"Updates","it.waiting":"Waiting on","k.agent":"agent activity","k.flow":"flow title","lang.en":"English","lang.label":"Language","lang.vi":"Tiếng Việt","live.big":"too large to stream: reload","live.off":"disconnected, retrying","live.on":"live","live.wait":"connecting","lt.approve":"approved","lt.ask":"asked the owner","lt.assign":"assigned work","lt.ci":"ran a check","lt.commit":"committed","lt.decision":"decided","lt.design":"designed","lt.fix":"fixed","lt.got":"got a message","lt.gotFrom":"got a message from","lt.handoff":"handed over","lt.merge":"merged","lt.msg":"sent a message","lt.msgTo":"wrote to","lt.note":"noted","lt.park":"parked","lt.pr":"updated a pull request","lt.reject":"rejected","lt.release":"released","lt.request":"requested","lt.review":"reviewed",lỗi:"error","ms.decision":"Decision","ms.deploy":"Deploy","ms.merge":"Merge","ms.open":"Opened","nw.chip":"No work yet","nw.empty":"No work logged yet","phát hành":"release","pl.all":"Show all events","pl.tip":"Sessions starting and stopping, subagents and prompts that only wait are hidden, and so are agents the project did not list; this shows them","pn.agents":"Agents","pn.detail":"Details","pn.items":"Work items","quyết định":"decision",rảnh:"idle","rảnh · ":"idle · ","st.parked":"Parked",sáng:"light",sửa:"fix","theo máy":"system","thiết kế":"design","tin nhắn":"message",to:"to",tối:"dark","từ ":"since ","vừa xong":"just now","Đang chạy":"Running","Đang làm":"Working","Đánh dấu đã xem":"Mark as seen",Đóng:"Close","Đề xuất":"Proposal","đang làm":"working",đạt:"pass","đề xuất":"proposal",đỏ:"red"},vi:{"ag.under":"thuộc","ag.earlier":"Trước đó","ag.details":"Chi tiết","it.unsorted":"Chưa xếp luồng","it.unsortedNote":"Các sự kiện không thuộc luồng nào, mới nhất trước.","ag.action":"Việc gần nhất","ag.asking":"Hỏi anh","ag.lastTime":"Lần cuối","ag.message":"Tin nhắn","ag.pending":"Tin chờ","ag.prs":"PR","ag.today":"sự kiện hôm nay","ag.working":"Đang làm","dt.all":"Mọi sự kiện","dt.milestones":"Diễn biến","dt.whatItIs":"Đây là gì","fl.checks":"Tiêu chí nghiệm thu","fl.due":"Hạn","fl.steps":"Các bước","g.blocked":"Bị chặn / Lỗi","g.done":"Xong trong tuần","g.parked":"Để sau","g.running":"Đang chạy","g.you":"Cần anh","it.apps":"App","it.checks":"Nghiệm thu","it.criteria":"tiêu chí","it.daysLeft":"ngày nữa","it.deploys":"Deploy","it.done":"xong","it.holder":"Giữ việc","it.holds":"giữ","it.latest":"mới nhất","it.noDue":"Chưa có hạn","it.now":"Đang","it.overdue":"quá hạn","it.people":"Người","it.prs":"PR","it.started":"Bắt đầu","it.updates":"Cập nhật","it.waiting":"Đang chờ","k.agent":"hoạt động agent","k.flow":"tên luồng","lang.en":"English","lang.label":"Ngôn ngữ","lang.vi":"Tiếng Việt","live.big":"quá lớn để truyền: tải lại","live.off":"mất kết nối, đang thử lại","live.on":"trực tiếp","live.wait":"đang kết nối","lt.approve":"duyệt","lt.ask":"hỏi chủ","lt.assign":"giao việc","lt.ci":"chạy kiểm tra","lt.commit":"commit","lt.decision":"quyết định","lt.design":"thiết kế","lt.fix":"sửa","lt.got":"nhận tin nhắn","lt.gotFrom":"nhận tin nhắn từ","lt.handoff":"bàn giao","lt.merge":"merge","lt.msg":"gửi tin nhắn","lt.msgTo":"nhắn cho","lt.note":"ghi chú","lt.park":"để sau","lt.pr":"cập nhật pull request","lt.reject":"từ chối","lt.release":"phát hành","lt.request":"đề xuất","lt.review":"review","ms.decision":"Quyết định","ms.deploy":"Deploy","ms.merge":"Merge","ms.open":"Mở việc","nw.chip":"Chưa có việc","nw.empty":"Chưa có việc nào được ghi","pl.all":"Hiện mọi sự kiện","pl.tip":"Phiên bắt đầu và kết thúc, subagent và lời nhắc chỉ để chờ, cùng các agent dự án không liệt kê, đang được ẩn; nút này hiện chúng","pn.agents":"Agent","pn.detail":"Chi tiết","pn.items":"Việc","st.parked":"Để sau",to:"cho"}};class it{static translate(e){return on[e.language][e.key]??e.key}}var aa=["flows","decisions","agents","shapes","roster","lanes","roles","sources","generatedAt","since"],sa='input,textarea,select,[contenteditable="true"]',rn=(e)=>{let[t,n]=P(e.data),s=`board:${t.key}:`,[o,i]=ye({key:`${s}lang`,initial:ee.EN,allowed:[ee.EN,ee.VI]}),[r,l]=ye({key:`${s}theme`,initial:"light",allowed:he}),[u,_]=ye({key:`${s}plumbing`,initial:"0",allowed:["0","1"]}),[c,f]=ye({key:`${s}agentDetails`,initial:"1",allowed:["0","1"]}),[m,d]=P(!1),[p,w]=P(null),[h,E]=P(!1),[v,S]=P(null),[g,b]=P({}),[Y,oe]=P(()=>se.get({key:`${s}lastSeen`})??new Date().toISOString()),M=an(),L=u==="1",z=sn({data:t,onData:(k)=>n((O)=>({...O,...Object.fromEntries(aa.map((_e)=>[_e,k[_e]]))}))}),V=K(()=>(k)=>it.translate({language:o,key:k}),[o]),W=K(()=>({t:V,now:M}),[V,M]),x=K(()=>R.eventsOf({data:t,showAll:L}),[t,L]),q=K(()=>R.flowsOf({data:t,showAll:L,lastSeen:Y}),[t,L,Y,M]),ue=K(()=>R.rowsOf({data:t,flows:q,events:x,translate:V,now:M}),[t,q,x,V,M]),rt=K(()=>Object.fromEntries(ue.map((k)=>[k.n,j.agentOf({data:t,events:x,views:q,row:k,doc:t.agents[k.n],now:M})])),[t,x,q,ue,M]),lt=p!==null&&(p.kind==="flow"?q.some((k)=>k.flow.id===p.id):ue.some((k)=>k.n===p.name)),Ue=(k)=>w({kind:"flow",id:k}),dn=(k)=>{if(v===k){S(null),w(null);return}S(k),w({kind:"agent",name:k})};return G(()=>{document.title=t.title,document.documentElement.lang=o},[t.title,o]),G(()=>{if(r==="system")document.documentElement.removeAttribute("data-board-theme");else document.documentElement.setAttribute("data-board-theme",r)},[r]),G(()=>{se.set({key:`${s}lastSeen`,value:Y})},[s,Y]),G(()=>{let k=(O)=>{if((O.target instanceof Element?O.target:null)?.closest?.(sa)||O.metaKey||O.ctrlKey||O.altKey)return;let ve=[...document.querySelectorAll(".row")],ct=p?.kind==="flow"?p.id:null,dt=ve.findIndex((ke)=>ke.dataset.id===ct);if(O.key==="j"||O.key==="k"){O.preventDefault();let ke=O.key==="j"?Math.min(ve.length-1,dt+1):Math.max(0,dt-1),ut=ve[ke]?.dataset.id;if(ut!==void 0)Ue(ut),ve[ke].focus()}else if(O.key==="e"&&ct)E(!h);else if(O.key==="Escape")if(m)d(!1);else w(null);else if(O.key==="?")d(!m)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)}),a(De.Provider,{value:W,children:[a("div",{className:"app",children:[a(Qt,{title:t.title,logo:t.logo,sources:t.sources,lastSeen:Y,newCount:q.reduce((k,O)=>k+O.newCount,0),onSeen:()=>oe(new Date().toISOString()),showPlumbing:L,onPlumbing:()=>_(L?"0":"1"),language:o,onLanguage:()=>i(o===ee.EN?ee.VI:ee.EN),theme:r,onTheme:()=>l(he[(he.indexOf(r)+1)%he.length]),keysOpen:m,onKeys:()=>d(!m),live:t.live===void 0?void 0:z}),a("main",{className:`c-main${lt?"":" closed"}`,id:"vFlows",children:[a(zt,{rows:ue,cards:rt,shapes:t.shapes,picked:v,details:c==="1",onDetails:(k)=>f(k?"1":"0"),onPick:dn}),a(tn,{views:q,agent:v,onAgent:(k)=>{if(S(k),k===null&&p?.kind==="agent")w(null)},selected:p?.kind==="flow"?p.id:null,onSelect:Ue,open:g,onToggle:(k)=>b((O)=>({...O,[k]:!(O[k]??B.GROUPS.find((_e)=>_e.key===k)?.open)}))}),a(qt,{detail:lt?p:null,views:q,rows:ue,cards:rt,data:t,events:x,everything:h,onEverything:E,onFlow:Ue,onClose:()=>w(null)})]})]}),a(nn,{open:m})]})};var ln=document.getElementById("board-data"),cn=document.getElementById("root");if(ln?.textContent&&cn){let e=JSON.parse(ln.textContent);Ht(cn).render(a(rn,{data:e}))}})();
|
|
1368
1268
|
</script>
|
|
1369
|
-
<!-- built from
|
|
1269
|
+
<!-- built from f6a0c394c561e9adfe73c78cc6718ac851c7108c2ef6c29867e70f169361f062; run make board-ui after a change to packages/cli/src/board/ui -->
|
|
1370
1270
|
</body>
|
|
1371
1271
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/vulcan",
|
|
3
|
-
"version": "0.4.10-
|
|
3
|
+
"version": "0.4.10-4",
|
|
4
4
|
"description": "VULCAN - one setup, one workflow for every project: init, sync, doctor, upgrade, and `vulcan x` for the shipped tools. Bun-only.",
|
|
5
5
|
"homepage": "https://github.com/VENIZIA-AI/vulcan/tree/main/packages/cli",
|
|
6
6
|
"bugs": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@clack/prompts": "1.8.1",
|
|
48
|
-
"@venizia/vulcan-atlas": "0.4.10-
|
|
49
|
-
"@venizia/vulcan-okf": "0.4.10-
|
|
48
|
+
"@venizia/vulcan-atlas": "0.4.10-4",
|
|
49
|
+
"@venizia/vulcan-okf": "0.4.10-4",
|
|
50
50
|
"zod": "^4.6.7"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
package/src/agents/resolve.ts
CHANGED
|
@@ -7,6 +7,7 @@ export const NO_TTY_HINT = `vulcan sync: no agents chosen on this machine - wrot
|
|
|
7
7
|
|
|
8
8
|
type TParsed = { ok: true; agents: string[] } | { ok: false; error: string };
|
|
9
9
|
|
|
10
|
+
/** Parses and resolves the list of agent tools a project targets, from the flag, the config or a prompt; used by `vulcan agents`, `vulcan sync` and `vulcan doctor`. */
|
|
10
11
|
export class AgentSelection {
|
|
11
12
|
private static fromList(opts: {
|
|
12
13
|
value: string;
|