@venizia/vulcan 0.4.10-5 → 0.4.10-6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/base/hooks/guard-git.ts +9 -3
  3. package/base/hooks/guard-manifest.ts +4 -3
  4. package/base/hooks/guard-outside.ts +15 -3
  5. package/base/hooks/guard-writes.ts +6 -1
  6. package/base/templates/board.html +3 -3
  7. package/package.json +3 -3
  8. package/src/board/command.ts +37 -15
  9. package/src/board/common/constants.ts +7 -0
  10. package/src/board/logo.ts +49 -0
  11. package/src/board/open-file.ts +110 -0
  12. package/src/board/server.ts +74 -1
  13. package/src/board/settings.ts +6 -22
  14. package/src/commands/clean.command.ts +6 -1
  15. package/src/commands/table.ts +7 -5
  16. package/src/commit/hook.ts +44 -5
  17. package/src/config/common/constants.ts +28 -0
  18. package/src/config/schema.ts +103 -39
  19. package/src/doctor/private-values.ts +4 -1
  20. package/src/events/common/actor-names.ts +12 -0
  21. package/src/events/common/constants.ts +63 -26
  22. package/src/events/common/index.ts +1 -0
  23. package/src/events/text.ts +41 -6
  24. package/src/hooks/code-text.ts +304 -0
  25. package/src/hooks/command-view.ts +78 -17
  26. package/src/hooks/common/constants.ts +4 -0
  27. package/src/hooks/git-queries.ts +113 -0
  28. package/src/hooks/guard-git.ts +24 -20
  29. package/src/hooks/guard-manifest.ts +13 -27
  30. package/src/hooks/guard-outside.ts +108 -310
  31. package/src/hooks/guard-writes.ts +2065 -156
  32. package/src/hooks/index.ts +1 -0
  33. package/src/hooks/manifest-git.ts +671 -0
  34. package/src/hooks/manifest-path.ts +729 -0
  35. package/src/hooks/manifest-script.ts +700 -0
  36. package/src/hooks/manifest-shell.ts +1404 -0
  37. package/src/hooks/package-managers.ts +495 -0
  38. package/src/hooks/remote-hosts.ts +10 -1
  39. package/src/hooks/script-runners.ts +409 -0
  40. package/src/hooks/shell-folders.ts +213 -0
  41. package/src/hooks/shell-writes.ts +417 -0
  42. package/src/hooks/shell.ts +1307 -222
  43. package/src/hooks/trusted-scripts.ts +10 -30
  44. package/src/hooks/write-commands.ts +897 -0
  45. package/src/local/clean.ts +36 -6
  46. package/src/local/constants.ts +22 -0
  47. package/src/local/scan.ts +8 -1
  48. package/src/manifest/render.ts +3 -0
  49. package/src/signals/classify.ts +6 -2
package/README.md CHANGED
@@ -32,7 +32,7 @@ flag `bun x` fetches it when `@venizia/vulcan` is not installed yet.
32
32
  | `event add \| tail` | Write a line to the agent event log (`.agents/local/events/<day>.jsonl`) or read it |
33
33
  | `visualize <spec.json> [--out <name>] \| --schema` | Make one small static HTML page from a JSON spec, in `.agents/local/prototypes/` (`--out` names the page); `--schema` prints the spec's schema |
34
34
  | `profile [show\|edit\|reset]` | Tell VULCAN how you like to work (reply language, tone, habits) in `.agents/local/profile.json` |
35
- | `clean [--tmp\|--worktrees\|--clones\|--cache\|--all] [--yes]` | List what an agent left under `.agents/local/` (a dry run) and, with `--yes`, remove it |
35
+ | `clean [--tmp\|--worktrees\|--clones\|--cache\|--all] [--include-fresh] [--yes]` | List what an agent left under `.agents/local/` (a dry run) and, with `--yes`, remove it |
36
36
  | `upgrade [--stable \| --nightly] [<version\|tag>]` | Install the target `@venizia/vulcan`, then run `sync` from the newly installed CLI. `--stable` (default) is the `latest` dist-tag, never a prerelease; `--nightly` is the higher of `latest` and `next`; a named version or tag wins over both. `--nightly` that cannot read the dist-tags exits 1; a stable upgrade from an installed prerelease says that `--nightly` keeps the prerelease line |
37
37
  | `graph build [--full]` | Write the code graph of the project (the short name of `x atlas graph build`); `--full` reads everything again |
38
38
  | `graph status [--json]` | Say whether the graph still matches the files it was built from (fresh, behind, diverged or unknown) |
@@ -6,8 +6,8 @@
6
6
  * (ask: the pull request would land on the default branch).
7
7
  *
8
8
  * It guards against drift, it is not the last line of defence, and a guard that blocks every command when
9
- * its install is broken costs more than it protects. So input it cannot read passes, and so does a missing
10
- * package or `bun` (the settings wrapper says so on stderr). A guard that started and then failed - a crash
9
+ * its install is broken costs more than it protects. So a missing package or `bun` passes (the settings wrapper
10
+ * says so on stderr); input it cannot read ASKS, because nothing was checked. A guard that started and then failed - a crash
11
11
  * or a timeout, here an internal error or an unloadable module - ASKS about a command that names `git` or
12
12
  * `gh`, instead of passing it unchecked. `VULCAN_GUARDS=off` switches it off, read before anything is
13
13
  * imported. It imports only the modules it needs - no config, no zod. The branches the project lists in
@@ -37,7 +37,13 @@ try {
37
37
  cwd,
38
38
  askPush: ProjectGuards.readPolicy({ root: process.env.CLAUDE_PROJECT_DIR ?? cwd }).askPush,
39
39
  })
40
- : [];
40
+ : [
41
+ {
42
+ rule: 'V-W-01',
43
+ message: 'the hook input could not be read, so the command was not checked',
44
+ decision: GuardDecisions.ASK,
45
+ },
46
+ ];
41
47
 
42
48
  if (hits.length > 0) {
43
49
  const denied = hits.some((hit) => hit.decision === GuardDecisions.DENY);
@@ -3,9 +3,10 @@
3
3
  * .agents/vulcan.manifest.json. The file is rendered from the config by `vulcan sync`, so a hand
4
4
  * edit is either lost on the next sync or hides a config change from the doctor.
5
5
  *
6
- * Unlike guard-writes it denies rather than asks, and it fails closed for the same reason: Claude
7
- * Code blocks a PreToolUse call only on exit 2, so a hook that throws would let every write through.
8
- * The modules load inside the try for that reason.
6
+ * Unlike guard-writes it denies rather than asks. Claude Code blocks a PreToolUse call only on exit
7
+ * 2, so the modules load inside the try: a throw (a missing module, a crash) exits 2 and blocks the
8
+ * call. Input that is not a tool call - invalid JSON, empty, null - is not an error: the parser
9
+ * notes it on stderr and the hook exits 0, so the call passes.
9
10
  */
10
11
 
11
12
  // A module, so the awaits below are top-level; it has no static import, by design.
@@ -7,8 +7,8 @@
7
7
  * approved unseen. A write into the agent tool scratchpad is always denied.
8
8
  *
9
9
  * It guards against drift, not against an attacker, and a guard that blocks every call when its install
10
- * is broken costs more than it protects. So input it cannot read passes, and so does a missing package or
11
- * `bun` (the settings wrapper says so on stderr). A guard that started and then failed - a crash or a
10
+ * is broken costs more than it protects. So a missing package or `bun` passes (the settings wrapper says so on
11
+ * stderr); input it cannot read ASKS, because nothing was checked. A guard that started and then failed - a crash or a
12
12
  * timeout, here an internal error or an unloadable module - ASKS instead of passing the call unchecked; a
13
13
  * manifest that cannot be read leaves the default allowlist. `VULCAN_GUARDS=off` switches it off,
14
14
  * read before anything is imported. It reads what the project set (`guard.outside`, `guard.toolOwnedPaths`)
@@ -34,7 +34,19 @@ try {
34
34
  const { relative } = await import('node:path');
35
35
  const input = ManifestGuard.parseHookInput({ text });
36
36
 
37
- if (input) {
37
+ if (!input) {
38
+ console.log(
39
+ JSON.stringify(
40
+ HookDecision.buildTool({
41
+ decision: GuardDecisions.ASK,
42
+ reason: [
43
+ 'The hook input could not be read, so this call was not checked for files outside the project (V-B-08).',
44
+ 'Confirm only if the call stays inside the project.',
45
+ ],
46
+ }),
47
+ ),
48
+ );
49
+ } else {
38
50
  const projectRoot = process.env.CLAUDE_PROJECT_DIR ?? input.cwd ?? process.cwd();
39
51
  const { ProjectGuards } = await import('../../src/hooks/project-guards.ts');
40
52
  const { toolOwnedPaths, outside } = ProjectGuards.readPolicy({ root: projectRoot });
@@ -32,7 +32,12 @@ try {
32
32
  trust: { root, scripts: policy.trustedScripts, readOnlyScripts: policy.readOnlyScripts },
33
33
  extra: policy.commands,
34
34
  })
35
- : [];
35
+ : [
36
+ {
37
+ rule: 'V-W-02',
38
+ message: 'the hook input could not be read, so the command was not checked',
39
+ },
40
+ ];
36
41
 
37
42
  if (hits.length > 0) {
38
43
  console.log(JSON.stringify(WriteGuard.buildDecision({ hits })));
@@ -1263,9 +1263,9 @@
1263
1263
  <body>
1264
1264
  <div id="root"></div>
1265
1265
  <!--BOARD_DATA-->
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}))}})();
1266
+ <script>(()=>{var y,ut,cn,Z,Fe,Ne,mt,we,_t,We,Ue,ft,me=Symbol.for("pv"),Ee={},Se=[],dn=/^m(i|n|o|s|text|space)$/,Te=Array.isArray,pt=Se.slice,ne=Object.assign;function te(e){e&&e.parentNode&&e.remove()}function be(e,t,n,o,s){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:me,__v:s||++ut,__i:-1,__u:0};return!s&&y.vnode&&y.vnode(i),i}function E(e){return e.children}function Q(e,t){this.props=e,this.context=t,this.__g=0}function J(e,t){if(t==null)return e.__&&J(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:J(e)}function gt(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),gt(e)}function Ve(e){(8&e.__g||(e.__g|=8,Z.push(e),Ne++))&&Fe==y.debounceRendering||((Fe=y.debounceRendering)||queueMicrotask)(ht)}function ht(){var e,t,n,o,s,i,r,l,u;try{for(t=1;Z.length;)Z.length>t&&Z.sort(mt),e=Z.shift(),t=Z.length,8&e.__g&&(o=void 0,s=void 0,i=(s=(n=e).__v).__e,r=[],l=[],(u=n.__P)&&((o=ne({constructor:me},s)).__v=s.__v+1,y.vnode&&y.vnode(o),Ge(u,o,s,n.__n,u.namespaceURI,32&s.__u?[i]:null,r,i||J(s),32&s.__u,l),o.__v=s.__v,o.__.__k[o.__i]=o,wt(r,o,l),s.__=s.__e=null,o.__e!=i&&gt(o)))}finally{(Ne=Z.length)&&(Fe||queueMicrotask)(ht)}}function yt(e,t,n,o,s,i,r,l,u,m,c){var f,_,d,p,w,h,b=o.__k||Se,v=t.length;for(u=un(n,t,b,u,v),f=0;f<v;f++)(d=n.__k[f])!=null&&(_=~d.__i&&b[d.__i]||Ee,d.__i=f,h=Ge(e,d,_,s,i,r,l,u,m,c),p=d.__e,(_.ref!=d.ref||8&_.__u)&&(_.ref&&ze(_.ref,null,d,_),d.ref&&c.push(d.ref,d.__c||p,d)),w=w||p,4&d.__u?(u=vt(d,u,e,!_.__v),_.__e&&(_.__e=null)):typeof d.type=="function"&&h!==void 0?u=h:p&&(u=p.nextSibling),d.__u&=-21);return n.__e=w,u}function un(e,t,n,o,s){var i,r,l,u,m,c,f,_,d,p=n.length,w=p,h=0,b=0,v=e.__k=Array(s);for(i=0;i<s;i++)(r=t[i])!=null&&typeof r!="boolean"&&typeof r!="function"?(typeof r!="object"||r.constructor===String?r=v[i]=be(null,r):Te(r)?r=v[i]=be(E,{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,~(m=r.__i=mn(r,n,u,w))&&(w--,(l=n[m])&&(l.__u|=2)),l&&l.__v?(r.__u|=16,m==u-1?h--:m==u+1?h++:m!=u&&(m>u?h--:h++,b=1)):(~m||(s>p?h--:s<p&&h++),typeof r.type!="function"&&(r.__u|=4))):v[i]=null;if(b){for(c=[],f=[],i=0;i<s;i++)if((r=v[i])&&16&r.__u){for(h=0,_=c.length;h<_;)c[d=h+_>>1]<r.__i?h=d+1:_=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==o&&(o=J(l)),Ke(l,l));return o}function vt(e,t,n,o){var s,i,r,l;if(typeof e.type=="function"){if(e.props.__P)return t;if(s=e.__k)for(i=0;i<s.length;i++)s[i]&&(s[i].__=e,t=vt(s[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=J(e))&&!t.parentNode&&(t=null),r=e.__e,l=t;l&&l.nodeType==8;)l=l.nextSibling;for(r!=l&&(!o&&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"&&(Te(e)?e.some(function(n){Ie(n,t)}):t.push(e)),t}function mn(e,t,n,o){var s,{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(o>(u?1:0)){for(s=n-1;s>=0;s--)if((l=t[s])&&!(2&l.__u)&&i==l.key&&r==l.type)return s;for(s=n+1;s<t.length;s++)if((l=t[s])&&!(2&l.__u)&&i==l.key&&r==l.type)return s}return-1}function dt(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function ke(e,t,n,o,s){var i,r;if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||dt(e.style,t);if(n)for(t in n)o&&n[t]==o[t]||dt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")(e.__e||(e.__e={}))[t]=n,n&&o||(r=Ue[t]||(Ue[t]=_n(t)),(e.__a||(e.__a={}))[t]=We,i=t!=(t=t.replace(_t,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,r,i):e.removeEventListener(t,r,i));else{if(s=="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 _n(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[we]==null)t[we]=We++;else if(t[we]<this.__a[e])return;return n(y.event?y.event(t):t)}}}function Ge(e,t,n,o,s,i,r,l,u,m){var c,f,_,d,p,w,h,b,v,S,g,N,X,se,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=He(c,i):i.push(c),l=i[0]||l),(c=y.__b)&&c(t);e:if(typeof W=="function"){_=r.length;try{if(b=t.props,v=(c=W.prototype)&&c.render,S=(c=W.contextType)&&o[c.__c],g=c?S?S.props.value:c.__:o,(d=n.__c)?(t.__c=d,2&d.__g&&(d.__g|=1)):(v?t.__c=d=new W(b,g):(t.__c=d=new Q(b,g),d.constructor=W,d.render=pn),S&&S.sub(d),d.state||(d.state={}),d.__n=o,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(R){R&&(R.__=t)}),Se.push.apply(d.__h,d.__k),d.__k=[],d.__h.length&&r.push(d),l=J(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,N=y.__r,X=0,v)d.state=d.__s,d.__g&=-9,N&&N(t),c=d.render(d.props,d.state,d.context),Se.push.apply(d.__h,d.__k),d.__k=[];else do d.__g&=-9,N&&N(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(8&d.__g&&++X<25);d.state=d.__s,d.getChildContext&&(o=ne({},o,d.getChildContext())),v&&n.__c&&d.getSnapshotBeforeUpdate&&(h=d.getSnapshotBeforeUpdate(p,w)),se=c&&c.type===E&&c.key==null?c.props.children:c,b.__P&&(c=l,s=(e=b.__P).namespaceURI,u=i=null,n.props&&n.props.__P!=e&&(n.__k.some(function(R){R&&Ke(R,R)}),n.__k=null),l=n.__k?J(n,0):null),l=yt(e,Te(se)?se:[se],t,n,o,s,i,r,l,u,m),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(R){if(r.length=_,t.__v=null,u||i)if(R.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=He(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||[]),R.then||kt(t),y.__e(R,t,n)}}else l=t.__e=fn(n.__e,t,n,o,s,i,r,u,m,e);return(c=y.diffed)&&c(t),l}function He(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 kt(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(kt))}function wt(e,t,n){for(var o=0;o<n.length;)ze(n[o++],n[o++],n[o++]);y.__c&&y.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){y.__e(i,s.__v)}})}function fn(e,t,n,o,s,i,r,l,u,m){var c,f,_,d,p,w,h,b,v,S=n.props||Ee,{props:g,type:N}=t;if(N=="svg"?s="http://www.w3.org/2000/svg":N=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i){for(c=0;c<i.length;c++)if((p=i[c])&&(N?p.localName==N:p.nodeType==3)){e=p,i[c]=null;break}}if(!e){if(b=m.ownerDocument||document,!N)return b.createTextNode(g);e=b.createElementNS(s,N,g.is&&g),l&&(y.__m&&y.__m(t,i),l=!1),i=null}if(N){if(m=N=="template"&&e.content||e,i=N=="textarea"&&g.defaultValue!=null?null:i&&pt.call(m.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"?_=p:c=="children"||(c in g)||c=="value"&&("defaultValue"in g)||c=="checked"&&("defaultChecked"in g)||ke(e,c,null,p,s);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)||ke(e,c,p,S[c],s);f?(l||_&&(f.__html==_.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(_&&(e.textContent=""),(N=="foreignObject"||s=="http://www.w3.org/1998/Math/MathML"&&dn.test(N))&&(s="http://www.w3.org/1999/xhtml"),yt(m,Te(d)?d:[d],t,n,o,s,i,r,i?i[0]:n.__k&&J(n,0),l,u),i&&i.some(te)),l&&N!="textarea"||(c="value",N=="progress"&&w==null?e.removeAttribute(c):w==null||w===e[c]&&(N!="progress"||w)||ke(e,c,w,S[c],s),c="checked",h!=null&&h!=e[c]&&ke(e,c,h,S[c],s))}else S===g||l&&e.data==g||(e.data=g);return e}function ze(e,t,n,o){try{typeof e=="function"?t?t.__x=e(t)||1:o&&(o=o.__c||o.__e)&&(t=o.__x)&&(o.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(s){y.__e(s,n)}}function Ke(e,t,n){var o,s,i,r;if(y.unmount&&y.unmount(e),!(o=e.ref)||o.current&&o.current!=e.__e||ze(o,null,t,e),o=e.__c){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(l){y.__e(l,t)}o.__P=o.__n=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&Ke(o[r],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(o=e.__c)&&(o=o.__z)&&(s=He(o,i=[]))&&(o==e.__e&&i.some(te),te(s),te(o)),(o=e.__e)&&(n||te(o),o.__e&&(o.__e=null)),e.__e=e.__c=e.__=null}function pn(e,t,n){return this.constructor(e,n)}function je(e,t){var n,o,s,i;y.__&&y.__(e,t),t.nodeType==9&&(t=t.documentElement),o=(n=e&&32&e.__u)?null:t.__k,t.__k=be(E,{children:[e]}),s=[],i=[],Ge(t,t.__k,o||Ee,Ee,t.namespaceURI,o?null:t.firstChild?pt.call(t.childNodes):null,s,o?o.__e:t.firstChild,n,i),wt(s,t.__k,i),t.__k.props.children=null}function xe(e){function t(n){var o,s;return this.getChildContext||(o=new Set,(s={})[t.__c]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&o.forEach(function(r){r.__g|=4,Ve(r)})},this.sub=function(i){o.add(i);var r=i.componentWillUnmount;i.componentWillUnmount=function(){o.delete(i),r&&r.call(i)}}),n.children}return t.__c="__cC"+ft++,t.__=e,t.Provider=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}y={__e:function(e,t,n,o){for(var s,i,r;t=t.__;)if((s=t.__c)&&!(1&s.__g)){s.__g|=4;try{if((r=(i=s.constructor)&&i.getDerivedStateFromError)&&s.setState(i.getDerivedStateFromError(e)),s.componentDidCatch&&(s.componentDidCatch(e,o||{}),r=1),r&&8&s.__g)return void(s.__g|=2)}catch(l){e=l}}throw Ne=0,e}},ut=0,cn=function(e){return e!=null&&e.constructor===me},Q.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),Ve(this)))},Q.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Ve(this))},Q.prototype.render=E,Z=[],Ne=0,mt=function(e,t){return e.__v.__b-t.__v.__b},we=Symbol(),_t=/(PointerCapture)$|Capture$/i,We=0,Ue={},ft=0;var ie,T,qe,bt,Xe=Object.is,fe=0,Ot=[],Ye=[],I=y,{__b:Nt,__r:Et,diffed:St,__c:Tt,unmount:It,__:xt}=I;function Ae(e,t){I.__h&&I.__h(T,e,fe||t),fe=0;var n=T.__H||(T.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function D(e){return fe=1,Rt(Dt,e)}function Rt(e,t,n){var o=Ae(ie++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Dt(void 0,t),function(i){var r=o.__N?o.__N[0]:o.__[0],l=o.t(r,i);Xe(r,l)||(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=T,!T.__f)){T.__f=!0;var s=T.shouldComponentUpdate;T.shouldComponentUpdate=function(i,r,l){var u=this.__H;if(!u)return!0;var m=!1,c=this.props!=i;if(u.__.some(function(_){_.__N&&(m=!0,Xe(_.__[0],_.__N[0])||(c=!0))}),s){var f=s.call(this,i,r,l);return m?f||c:f}return!m||c}}return o.__}function G(e,t){var n=Ae(ie++,3);!I.__s&&Bt(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,T.__H.__h.push(n))}function Ce(e){return fe=5,K(function(){return{current:e}},[])}function K(e,t){var n=Ae(ie++,7);return Bt(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Qe(e,t){return fe=8,K(function(){return e},t)}function Oe(e){var t=T.context[e.__c],n=Ae(ie++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(T)),t.props.value):e.__}function gn(){var e;do{for(;e=Ye.shift();)try{_e(e)}catch(n){I.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=Ot.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(_e),t.__h.some(Ze),t.__h=[]}catch(n){t.__h=[],I.__e(n,e.__v)}}}while(Ye.length)}I.__b=function(e){T=null,Nt&&Nt(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xt&&xt(e,t)},I.__r=function(e){Et&&Et(e),ie=0;var t=(T=e.__c).__H;t&&(qe==T?T.__h=[]:(t.__h.some(_e),t.__h.some(Ze),ie=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),qe=T},I.diffed=function(e){St&&St(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Ct(Ot.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),qe=T=null},I.__c=function(e,t){t.some(function(n){try{n.__h.some(_e),n.__h=n.__h.filter(function(o){return!o.__||Ze(o)})}catch(o){n.__h=[function(){throw o}]}}),Tt&&Tt(e,t)},I.unmount=function(e){It&&It(e);var t,n,o=e.__c;o&&o.__H&&(o.__H.__.some(function(s){try{if(s.__P&&s.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}s.__P=n,Ct(Ye.push(s))}else _e(s)}catch(i){t=i}}),o.__H=void 0,t&&I.__e(t,o.__v))};var At=typeof requestAnimationFrame=="function";function hn(e){var t,n=function(){clearTimeout(o),At&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);At&&(t=requestAnimationFrame(n))}function Ct(e){e!=1&&bt==I.requestAnimationFrame||((bt=I.requestAnimationFrame)||hn)(gn)}function _e(e){var t=T,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),T=t}function Ze(e){var t=T;e.__c=e.__(),T=t}function Bt(e,t){return!e||e.length!=t.length||t.some(function(n,o){return!Xe(n,e[o])})}function Dt(e,t){return typeof t=="function"?t(e):t}var Pt=Object.assign;var kn=/^(-|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 wn=Symbol.for("react.element"),bn=/^(?: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]/,Nn=/[A-Z0-9]/g,En=typeof document<"u";var Sn=function(e){return/fil|che|rad/.test(e)};function Lt(e,t,n){return t.__k==null&&(t.textContent=""),je(e,t),typeof n=="function"&&n(),e?e.__c:null}Q.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Q.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 Tn={configurable:!0,get:function(){return this.class}},Mt=y.vnode;y.vnode=function(e){if(typeof e.type=="string")(function(o){var{props:s,type:i}=o,r={},l=i.indexOf("-")==-1;for(var u in s){var m=s[u];if(!(u=="value"&&("defaultValue"in s)&&m==null||En&&u=="children"&&i=="noscript"||u=="class"||u=="className")){if(u=="style"&&m&&m.constructor==Object){var c=void 0;for(var f in m)typeof m[f]!="number"||kn.test(f)||(c||(c=m=Pt({},m)),m[f]+="px")}else if(u=="defaultValue"&&"value"in s&&s.value==null)u="value";else if(u=="download"&&m===!0)m="";else if(u=="translate"&&m==="no")m=!1;else if(u[0]=="o"&&u[1]=="n"){var _=u.toLowerCase();_=="ondoubleclick"?u="ondblclick":_!="onchange"||i!="input"&&i!="textarea"||Sn(s.type)?_=="onfocus"?u="onfocusin":_=="onblur"&&(u="onfocusout"):_=u="oninput",_=="oninput"&&r[u=_]&&(u="oninputCapture")}else l&&bn.test(u)?u=u.replace(Nn,"-$&").toLowerCase():m===null&&(m=void 0);r[u]=m}}i=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=Ie(s.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),r.defaultValue!=null&&(r.value=Ie(s.children).forEach(function(d){d.props.selected=r.multiple?r.defaultValue.indexOf(d.props.value)!=-1:r.defaultValue==d.props.value}))),s.class&&!s.className?(r.class=s.class,Object.defineProperty(r,"className",Tn)):s.className&&(r.class=r.className=s.className),o.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=Pt({},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=wn,Mt&&Mt(e)};function Ft(e){return!!e.__k&&(je(null,e),!0)}function Ut(e){return{render:function(t){Lt(t,e)},unmount:function(){Ft(e)}}}class In{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 xn{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 P{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 pe{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 Re=xe({t:(e)=>e,now:0}),B=()=>Oe(Re),Be=()=>Oe(Re).t;class Je{static textOf(e){let{event:t,translate:n}=e,o;if(t.kind==="decision"&&t.choice)o=n(`lt.${t.choice}`);else if(t.kind==="note")o=n(t.needsOwner?"lt.ask":"lt.note");else if(t.kind==="msg"&&t.incoming)o=t.from?`${n("lt.gotFrom")} ${t.from}`:n("lt.got");else if(t.kind==="msg"&&t.to)o=`${n("lt.msgTo")} ${t.to}`;else o=n(`lt.${t.kind}`);return`${t.actor} ${o}${t.summary?`: ${t.summary}`:""}`}}var An=60000;class x{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())/An));if(n<1)return t("vừa xong");if(n<60)return`${n}${t(" phút")}`;let o=Math.floor(n/60);if(o<24)return`${o}${t(" giờ")}${n%60?` ${n%60}${t(" phút")}`:""}`;return`${Math.floor(o/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 Cn=Symbol.for("pv"),On=0;function a(e,t,n,o,s,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 m={type:e,props:u,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:Cn,__v:--On,__i:-1,__u:0};return(s||i)&&(m.__source=s,m.__self=i),y.vnode&&y.vnode(m),m}var Ht={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]]}},Vt=["#F5B83D","#EF5B3A","#8FD16F","#5BB6E8","#B28DE0","#F28DB2"];var Rn=(e)=>{let{state:t}=e;return a("g",{className:t==="working"?"m-squint":void 0,children:e.shape.eyes.map(([n,o],s)=>{let i=s===0?1:-1;if(t==="idle")return a("path",{d:`M${n-2.4} ${o}q2.4 1.8 4.8 0`,className:"m-o m-line"},n);return a("g",{children:[a("circle",{cx:n,cy:o,r:2.3,className:"m-ink"}),a("circle",{cx:n+0.8,cy:o-0.8,r:0.8,fill:"#fff"}),t==="you"?a("path",{d:`M${n-2.6*i} ${o-4.2}l${4*i} -1`,className:"m-o m-line"}):null,t==="blocked"?a("path",{d:`M${n-2.2*i} ${o-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"})},De=(e)=>a(E,{children:[a("path",{d:e.shape.d,fill:e.fill,className:"m-o",strokeWidth:2.2}),a(Rn,{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})]}),Dn=(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 Ht?t:"bun"}static colorOf(e){let t=0;for(let n of e.name)t=t*31+n.charCodeAt(0)>>>0;return Vt[t%Vt.length]}}var Pe=(e)=>{let t=Ht[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(E,{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(De,{shape:t,state:"working",fill:n})}),a(Dn,{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(E,{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(De,{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(E,{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(De,{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(E,{children:[a(De,{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 et={you:"ask",blocked:"ask",working:"work",idle:"idle"},$e=(e)=>a(E,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),Pn=(e)=>{let{t,now:n}=B(),{row:o,card:s}=e,i=(f)=>x.clock({iso:f}),r=[s.role,s.lane?`${t("ag.under")} ${s.lane}`:void 0,s.harness,s.model].filter(Boolean).join(" · "),l=s.since?` · ${x.ago({iso:s.since,now:n,translate:t})}`:"",u=a("span",{className:"c-face",children:a(Pe,{state:o.st,name:o.n,shape:e.shape})}),m=a("span",{className:`c-badge b-${et[o.st]}`,children:`${t(pe.PILL[o.st])}${l}`}),c={"data-agent":o.n,tabIndex:0,"aria-pressed":e.picked,onClick:()=>e.onPick(o.n),onKeyDown:(f)=>{if(f.key==="Enter"||f.key===" ")f.preventDefault(),e.onPick(o.n)}};if(e.compact)return a("div",{className:`c-card c-compact cell ${o.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:o.n}),m]}),s.workingOn?a("div",{className:"c-id",children:s.workingOn.flow.id}):null]}),o.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 ${o.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:o.n}),m]}),r?a("div",{className:"c-role",children:r}):null]})]}),a("div",{className:"c-body",children:[s.workingOn?a($e,{label:t("ag.working"),children:[s.workingOn.flow.title," ",a("small",{children:s.workingOn.flow.id})]}):null,o.ask?a($e,{label:t("ag.asking"),children:`"${o.ask}"`}):null,s.action?a($e,{label:t(s.workingOn?"ag.action":"ag.lastTime"),children:[s.action.summary," ",a("small",{children:i(s.action.ts)})]}):null,s.message?a($e,{label:t("ag.message"),children:[Je.textOf({event:s.message,translate:t})," ",a("small",{children:i(s.message.ts)})]}):null]}),a("div",{className:"c-foot",children:[a("span",{children:[t("ag.prs")," ",a("b",{children:s.prs})]}),a("span",{children:[t("ag.pending")," ",a("b",{children:s.pending})]}),a("span",{children:[a("b",{children:s.today})," ",t("ag.today")]}),s.last?a("span",{className:"c-r",children:i(s.last)}):null]})]})},Wt=(e)=>{let{t,now:n}=B(),[o,s]=D(!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)),m=(c)=>a(Pn,{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(m),u.length>0?a("button",{className:"btn c-loose",type:"button","aria-expanded":o,onClick:()=>s(!o),children:`${t("ag.earlier")} (${u.length})`}):null,o?u.map(m):null]})]})};class j{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 tt{static UNKNOWN="unknown";static UNNAMED_PREFIX="claude:";static isNamed(e){return e.actor!==this.UNKNOWN&&!e.actor.startsWith(this.UNNAMED_PREFIX)}}class O{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)=>O.linesOf({flow:t,showAll:e.showAll}))}static flowsOf(e){let t=[];for(let n of e.data.flows){let o=O.linesOf({flow:n,showAll:e.showAll}).sort(O.byTime),s=o.find((i)=>i.id===n.lastId)??o.at(-1);if(s===void 0)continue;t.push({flow:n,holder:n.holder,evs:o,last:s,lastAsk:o.find((i)=>i.id===n.askId),noWork:!o.some((i)=>!i.plumbing&&i.kind!=="flow"),newCount:o.filter((i)=>i.ts>e.lastSeen).length})}return t}static rowsOf(e){let{data:t,flows:n,events:o,translate:s}=e,i=t.agents,r=(c)=>c!==""&&c!==t.owner&&!H.NOT_AGENTS.has(c)&&tt.isNamed({actor:c}),l=t.roster??[],u=(c)=>l.includes(c)?l.indexOf(c):l.length;return[...new Set([...Object.keys(i).filter(r),...o.filter((c)=>c.source!=="github"&&r(c.actor)).map((c)=>c.actor)])].map((c)=>{let f=i[c],_=o.filter((g)=>g.actor===c&&!g.incoming).sort(O.byTime).at(-1),d=n.find((g)=>g.flow.state==="you"&&g.evs.findLast((N)=>N.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,_?.ts].filter((g)=>g!==void 0).sort().at(-1)??null,b=h===null||e.now-Date.parse(h)>C.ACTIVE_GAP_MS,v=O.stateOf({doc:f,blockedFlow:p,youFlow:d,runFlow:w,quiet:b}),S=O.saidOf({st:v,doc:f,lastLine:_,youFlow:d,translate:s});return{n:c,lastAt:h,st:v,...v==="you"&&d?.lastAsk?{ask:d.lastAsk.summary}:{},flow:(p??d)?.flow.id??w?.flow.id??_?.flowId??null,...S,key:`${_?.id??_?.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:o,youFlow:s,translate:i}=e,r=(m)=>m?Date.parse(m)||0:0,l=(m,c)=>({text:c,ts:m.ts,approx:x.isApproximate({source:m.source})}),u;if(t==="you"&&s?.lastAsk)u=l(s.lastAsk,`${i("chờ anh: ")}${s.lastAsk.summary}`);else if(n?.current&&(!o||r(n.checkedAt)>r(o.ts)))u={text:n.current,ts:n.since,approx:!1};else if(o)u=l(o,o.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(j.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 o of t){if(!o.ref?.pr)continue;let s=n[`${o.ref.repo??""}#${o.ref.pr}`]??={repo:o.ref.repo,n:o.ref.pr,flow:o.flowId,ci:null,link:null,merged:!1,closed:!1};s.by??=o.kind==="pr"?o.actor:void 0,s.merged||=o.kind==="merge",s.closed||=o.status==="closed",s.ci=o.kind==="ci"?o.status??null:s.ci,s.link=o.link&&/^https:\/\/.+\/pull\//.test(o.link)?o.link:s.link}return Object.values(n)}static of(e){let{data:t,events:n,name:o}=e,s=n.filter((i)=>i.kind==="msg").filter((i)=>{let{sender:r,receiver:l}=U.endsOf({data:t,message:i});return r===o||l===o}).sort(O.byTime);return{mine:n.filter((i)=>i.actor===o).sort(O.byTime),open:U.prsOf({events:n}).filter((i)=>i.by===o&&!i.merged&&!i.closed),pending:U.pendingOf({data:t,messages:s,name:o})}}static pendingOf(e){let{data:t,messages:n,name:o}=e,s=(l)=>U.endsOf({data:t,message:l}),i=n.filter((l)=>s(l).sender===o).at(-1)?.ts??"",r=new Set;return n.filter((l)=>{let{sender:u,receiver:m}=s(l),c=`${u}|${m}|${l.summary}|${l.ts.slice(0,16)}`;if(m!==o||l.ts<=i||r.has(c))return!1;return r.add(c),!0})}}var $n=/[.!?](\s|$)/,Gt=140,Mn=3;class q{static sentenceOf(e){let t=(e.text??"").trim(),n=$n.exec(t),o=n===null?t:t.slice(0,n.index+1);return o.length>Gt?`${o.slice(0,Gt-1).trimEnd()}…`:o}static itemOf(e){let{view:t}=e,{flow:n}=t,o=(i)=>({done:(i??[]).filter((r)=>r.done).length,total:(i??[]).length}),s=t.evs.filter((i)=>!i.plumbing&&!H.NOT_AGENTS.has(i.actor)).map((i)=>i.actor);return{now:q.sentenceOf({text:n.next??n.why}),waiting:n.state==="you"||n.state==="blocked"?n.next??t.lastAsk?.summary:void 0,steps:o(n.steps),checks:o(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,...s])],updates:t.evs.filter((i)=>i.kind==="flow").length,deploys:[...new Set(t.evs.filter((i)=>i.kind==="release").map((i)=>i.summary))].slice(-Mn)}}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:o,row:s,doc:i,now:r}=e,l=n.filter((c)=>c.actor===s.n&&!c.plumbing),u=U.of({data:t,events:n,name:s.n}),m=(c)=>c.reduce((f,_)=>f===void 0||_.ts>=f.ts?_:f,void 0);return{workingOn:s.st==="idle"||s.flow===C.UNSORTED?void 0:o.find((c)=>c.flow.id===s.flow),action:m(l.filter((c)=>c.kind!=="msg"&&c.kind!=="flow")),message:m(n.filter((c)=>{let{sender:f,receiver:_}=U.endsOf({data:t,message:c});return c.kind==="msg"&&(f===s.n||_===s.n)})),prs:u.open.length,pending:u.pending.length,today:l.filter((c)=>x.isSameDay({iso:c.ts,now:r})).length,last:i?.checkedAt,since:s.st==="idle"&&i?.state==="working"?s.lastAt??i.since:i?.since,role:t.roles?.[s.n],lane:t.lanes?.[s.n],model:i?.model,harness:i?.harness}}}var Ln=(e)=>e.status==="fail"||e.status==="blocked",zt=(e)=>{let{t}=B();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"})})},Me=(e)=>a("span",{className:"c-bar",children:a("span",{style:{width:`${Math.round(e.done/e.total*100)}%`}})}),nt=(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,o)=>a("li",{className:n.done?"on":void 0,children:n.text},`${o}:${n.text}`))})})},Fn=(e)=>{let{event:t}=e;if(t.incoming)return t.from?a(E,{children:[" ← ",a("b",{children:t.from})]}):null;return t.to?a(E,{children:[" → ",a("b",{children:t.to})]}):null},at=(e)=>{let{t}=B(),{event:n}=e,o=x.isApproximate({source:n.source}),s=j.safe({value:n.link}),i=P.KIND_TEXT[n.kind],r="";if(o)r=t("giờ ước lượng");else if(n.source==="github")r="GitHub";return a("li",{className:`ev${Ln(n)?" fail":""}`,children:[a("span",{className:"tm",children:[o?"≈":"",x.clock({iso:n.ts})]}),a("div",{children:[e.chip,a("div",{className:"who",children:[a("b",{children:n.actor}),a(Fn,{event:n}),` · ${i?t(i):n.kind}${n.attempt&&n.attempt>1?`${t(" lần ")}${n.attempt}`:""}`]}),a("div",{className:"sm",children:n.summary}),s||r?a("div",{children:[s?a("a",{className:"lk",href:j.safe({value:n.link}),target:"_blank",rel:"noopener",children:s.replace(/^https:\/\/github\.com\//,"")}):null,s&&r?" · ":null,r?a("span",{className:"src",children:r}):null]}):null]})]})};var Kt={decision:"ms.decision",merge:"ms.merge",release:"ms.deploy"},jt=5,Un=200,Vn=(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]}),Hn=(e)=>{let{t}=B(),n=e.view.evs.filter((o,s)=>s===0||(o.kind in Kt)).map((o,s)=>({event:o,tag:s===0?"ms.open":Kt[o.kind]})).reverse();return a("div",{className:"d-up",children:n.map(({event:o,tag:s},i)=>a("div",{className:`d-u${i===0?" last":""}`,children:[a("time",{children:x.clock({iso:o.ts})}),a("span",{className:"d-tag",children:t(s)}),o.summary]},o.id))})},Wn=(e)=>{let{t}=B();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,Un).map((n)=>a(at,{event:n},n.id))})]})},Gn=(e)=>{let{t}=B(),{view:n}=e,{flow:o}=n,s=q.itemOf({view:n});return a("div",{id:"dBody",className:"d-body",children:[a("h2",{children:o.title}),a("div",{className:"d-meta",children:[a("span",{className:"c-id",children:o.id}),o.tracker?a("span",{className:"c-ref",children:o.tracker}):null,o.due?a("span",{children:`${t("fl.due")} ${o.due}`}):null,a("span",{children:[t("it.holder"),": ",a("span",{className:"d-who",children:n.holder})]})]}),n.noWork?null:a(E,{children:[a("div",{className:"d-stages",children:P.STAGES.map((i,r)=>a("span",{title:t(i),className:Vn({stage:r,cur:o.cur})},i))}),a("div",{className:"d-stl",children:[a("span",{children:t(P.STAGES[0])}),a("b",{children:t(P.STAGES[o.cur])}),a("span",{children:t(P.STAGES[P.STAGES.length-1])})]})]}),o.context||o.apps?a(ae,{title:t("dt.whatItIs"),children:[o.context?a("p",{children:o.context}):null,o.apps?a("div",{className:"c-chips",children:o.apps.map((i)=>a("span",{children:i},i))}):null]}):null,o.steps&&o.steps.length>0?a(ae,{title:`${t("fl.steps")} · ${s.steps.done}/${s.steps.total}`,children:[a(Me,{...s.steps}),a(nt,{items:o.steps})]}):null,o.checks&&o.checks.length>0?a(ae,{title:`${t("fl.checks")}${o.tracker?` · ${o.tracker}`:""}`,children:a(nt,{items:o.checks})}):null,s.waiting?a("div",{className:"d-sec d-waiting",children:[a("span",{className:"d-k",children:t("it.waiting")}),a("span",{children:s.waiting})]}):null,n.noWork?a("p",{className:"d-empty",children:t("nw.empty")}):null,a(ae,{title:t("dt.milestones"),children:a(Hn,{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(at,{event:i},i.id))}):null]})},zn=(e)=>{let{t,now:n}=B(),{row:o,card:s,data:i}=e,r=U.of({data:i,events:e.events,name:o.n}),l=(u)=>x.clock({iso:u});return a("div",{id:"dBody",className:"d-body d-agent",children:[a("div",{className:"d-agenthead",children:[a(Pe,{state:o.st,name:o.n,shape:e.shape}),a("div",{children:[a("h2",{id:"popName",children:o.n}),a("div",{className:"d-meta",children:[a("span",{className:`c-badge b-${et[o.st]}`,children:t(pe.PILL[o.st])}),s.since?a("span",{children:`${t("từ ")}${l(s.since)} · ${x.ago({iso:s.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(-jt).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:j.safe({value:U.prHref({pr:u})}),target:"_blank",rel:"noopener",children:`${u.repo??""}#${u.n}`}),u.ci?a(zt,{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(-jt).reverse().map((u)=>{let{sender:m,receiver:c}=U.endsOf({data:i,message:u});return a("li",{children:[a("time",{children:l(u.ts)}),`${m===o.n?`→ ${c??"?"}`:`← ${m??"?"}`}: ${u.summary}`]},u.id)})})})]})},qt=(e)=>{let{t}=B(),{detail:n}=e,o=n?.kind==="flow"?e.views.find((i)=>i.flow.id===n.id):void 0,s=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:o===void 0&&s===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:[o&&o.flow.id===C.UNSORTED?a(Wn,{view:o}):null,o&&o.flow.id!==C.UNSORTED?a(Gn,{view:o,everything:e.everything,onEverything:e.onEverything}):null,s?a(zn,{row:s,card:e.cards[s.n],data:e.data,events:e.events,shape:re.shapeOf({name:s.n,shapes:e.data.shapes}),onFlow:e.onFlow}):null]})]})};var le={fill:"none",stroke:"currentColor",strokeWidth:1.5},Xt={light:a("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a("circle",{cx:"10",cy:"10",r:"3.6",...le}),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",...le,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",...le,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",...le}),a("path",{d:"M7 17h6M10 13.5V17",...le,strokeLinecap:"round"})]})},Yt=()=>a("svg",{className:"chev",viewBox:"0 0 12 12","aria-hidden":"true",children:a("path",{d:"M3 4.5l3 3 3-3",...le})});var ge=["light","dark","system"],Kn={light:"sáng",dark:"tối",system:"theo máy"},Zt=(e)=>{let t=Be(),n=`${t("Giao diện: ")}${t(Kn[e.theme])}`,o=`${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:j.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:x.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":o,title:o,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:Xt[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,ce=(e)=>a(E,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),Qt=(e)=>a("span",{className:"c-v c-mini",children:[a(Me,{done:e.done,total:e.total}),`${e.done}/${e.total} ${e.label}`]}),Xn=(e)=>{let{t,now:n}=B();if(e.due===void 0)return a("span",{className:"c-badge b-idle",children:t("it.noDue")});let o=q.daysLeft({due:e.due,now:n}),s=o<0?t("it.overdue"):`${o} ${t("it.daysLeft")}`;return a("span",{className:`c-badge ${o<=qn?"b-ask":"b-idle"}`,children:`${t("fl.due")} ${e.due} · ${s}`})},Yn=(e)=>{let{t}=B(),{view:n,card:o}=e,{flow:s}=n,i=Ce(null),r=(l)=>x.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":s.id,role:"button",tabIndex:0,"aria-selected":e.selected,onClick:()=>e.onSelect(s.id),onKeyDown:(l)=>{if(l.key==="Enter"&&l.target===l.currentTarget)l.preventDefault(),e.onSelect(s.id)},children:[a("div",{className:"c-head",children:[a("span",{className:`c-badge b-${jn[s.state]}`,children:n.noWork?t("nw.chip"):t(P.STAGES[s.cur])}),a("span",{className:"c-id",children:s.id}),s.tracker?a("span",{className:"c-ref",children:s.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(Xn,{due:s.due})]}),a("div",{className:"c-title",children:s.title}),o.now?a("div",{className:"c-now",children:`${t("it.now")}: ${o.now}`}):null,a("div",{className:"c-wb",children:[o.steps.total>0?a(ce,{label:t("fl.steps"),children:a(Qt,{...o.steps,label:t("it.done")})}):null,o.checks.total>0?a(ce,{label:t("it.checks"),children:a(Qt,{...o.checks,label:t("it.criteria")})}):null,s.apps?a(ce,{label:t("it.apps"),children:a("span",{className:"c-chips",children:s.apps.map((l)=>a("span",{children:l},l))})}):null,o.prs.length>0?a(ce,{label:t("it.prs"),children:o.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(ce,{label:t("it.people"),children:a("span",{className:"c-chips",children:o.people.map((l,u)=>a("span",{className:u===0?"h":void 0,children:u===0?`${l} ${t("it.holds")}`:l},l))})}),o.waiting?a(ce,{label:t("it.waiting"),children:o.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:o.updates})]}),o.deploys.length>0?a("span",{children:[t("it.deploys")," ",a("b",{children:o.deploys.join(", ")})]}):null,a("span",{className:"c-r",children:`${t("it.latest")} ${r(n.last.ts)}`})]})]})},Jt=(e)=>{let{t,now:n}=B(),o=e.views.filter((r)=>e.agent===null||O.involves({view:r,name:e.agent})),s=o.filter((r)=>r.flow.id!==C.UNSORTED&&(r.flow.state!=="done"||x.isWithin({iso:r.last.ts,now:n,days:H.DONE_DAYS}))),i=o.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:s.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:[s.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,P.GROUPS.map((r)=>{let l=s.filter((m)=>m.flow.state===r.key).sort((m,c)=>r.key==="you"||r.key==="blocked"?O.byTime(m.last,c.last):O.byTime(c.last,m.last)),u=e.open[r.key]??r.open;if(s.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(Yt,{}),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((m)=>a(Yn,{view:m,card:q.itemOf({view:m}),selected:e.selected===m.flow.id,onSelect:e.onSelect},m.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 Zn=[["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"]],en=(e)=>{let t=Be();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:Zn.flatMap(([n,o])=>[a("dt",{children:n},n),a("dd",{children:a("span",{children:t(o)})},o)])})]})};class oe{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 he=(e)=>{let[t,n]=D(()=>{let s=oe.get({key:e.key});return e.allowed.find((i)=>i===s)??e.initial}),o=Qe((s)=>{oe.set({key:e.key,value:s}),n(s)},[e.key]);return[t,o]},tn=()=>{let[e,t]=D(Date.now());return G(()=>{let n=setInterval(()=>t(Date.now()),60000);return()=>clearInterval(n)},[]),e},nn=(e)=>{let t=e.data.live?.stream,[n,o]=D("wait");return G(()=>{if(t===void 0)return;let s,i,r=!1,l=0,u=()=>{s=new EventSource(t),s.onmessage=(m)=>{l=0;let c=JSON.parse(m.data);if(c.tooLarge){o("big");return}e.onData(c),o("on")},s.onerror=()=>{if(s?.close(),o("off"),!r)i=setTimeout(u,Math.min(30000,1000*2**l)),l+=1}};return u(),()=>{r=!0,s?.close(),clearTimeout(i)}},[t]),n};var an={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 ot{static translate(e){return an[e.language][e.key]??e.key}}var Qn=["flows","decisions","agents","shapes","roster","lanes","roles","sources","generatedAt","since"],Jn='input,textarea,select,[contenteditable="true"]',on=(e)=>{let[t,n]=D(e.data),o=`board:${t.key}:`,[s,i]=he({key:`${o}lang`,initial:ee.EN,allowed:[ee.EN,ee.VI]}),[r,l]=he({key:`${o}theme`,initial:"light",allowed:ge}),[u,m]=he({key:`${o}plumbing`,initial:"0",allowed:["0","1"]}),[c,f]=he({key:`${o}agentDetails`,initial:"1",allowed:["0","1"]}),[_,d]=D(!1),[p,w]=D(null),[h,b]=D(!1),[v,S]=D(null),[g,N]=D({}),[X,se]=D(()=>oe.get({key:`${o}lastSeen`})??new Date().toISOString()),M=tn(),L=u==="1",z=nn({data:t,onData:(k)=>n((A)=>({...A,...Object.fromEntries(Qn.map((ue)=>[ue,k[ue]]))}))}),V=K(()=>(k)=>ot.translate({language:s,key:k}),[s]),W=K(()=>({t:V,now:M}),[V,M]),R=K(()=>O.eventsOf({data:t,showAll:L}),[t,L]),Y=K(()=>O.flowsOf({data:t,showAll:L,lastSeen:X}),[t,L,X,M]),de=K(()=>O.rowsOf({data:t,flows:Y,events:R,translate:V,now:M}),[t,Y,R,V,M]),st=K(()=>Object.fromEntries(de.map((k)=>[k.n,q.agentOf({data:t,events:R,views:Y,row:k,doc:t.agents[k.n],now:M})])),[t,R,Y,de,M]),it=p!==null&&(p.kind==="flow"?Y.some((k)=>k.flow.id===p.id):de.some((k)=>k.n===p.name)),Le=(k)=>w({kind:"flow",id:k}),ln=(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=s},[t.title,s]),G(()=>{if(r==="system")document.documentElement.removeAttribute("data-board-theme");else document.documentElement.setAttribute("data-board-theme",r)},[r]),G(()=>{oe.set({key:`${o}lastSeen`,value:X})},[o,X]),G(()=>{let k=(A)=>{if((A.target instanceof Element?A.target:null)?.closest?.(Jn)||A.metaKey||A.ctrlKey||A.altKey)return;let ye=[...document.querySelectorAll(".row")],rt=p?.kind==="flow"?p.id:null,lt=ye.findIndex((ve)=>ve.dataset.id===rt);if(A.key==="j"||A.key==="k"){A.preventDefault();let ve=A.key==="j"?Math.min(ye.length-1,lt+1):Math.max(0,lt-1),ct=ye[ve]?.dataset.id;if(ct!==void 0)Le(ct),ye[ve].focus()}else if(A.key==="e"&&rt)b(!h);else if(A.key==="Escape")if(_)d(!1);else w(null);else if(A.key==="?")d(!_)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)}),a(Re.Provider,{value:W,children:[a("div",{className:"app",children:[a(Zt,{title:t.title,logo:t.logo,sources:t.sources,lastSeen:X,newCount:Y.reduce((k,A)=>k+A.newCount,0),onSeen:()=>se(new Date().toISOString()),showPlumbing:L,onPlumbing:()=>m(L?"0":"1"),language:s,onLanguage:()=>i(s===ee.EN?ee.VI:ee.EN),theme:r,onTheme:()=>l(ge[(ge.indexOf(r)+1)%ge.length]),keysOpen:_,onKeys:()=>d(!_),live:t.live===void 0?void 0:z}),a("main",{className:`c-main${it?"":" closed"}`,id:"vFlows",children:[a(Wt,{rows:de,cards:st,shapes:t.shapes,picked:v,details:c==="1",onDetails:(k)=>f(k?"1":"0"),onPick:ln}),a(Jt,{views:Y,agent:v,onAgent:(k)=>{if(S(k),k===null&&p?.kind==="agent")w(null)},selected:p?.kind==="flow"?p.id:null,onSelect:Le,open:g,onToggle:(k)=>N((A)=>({...A,[k]:!(A[k]??P.GROUPS.find((ue)=>ue.key===k)?.open)}))}),a(qt,{detail:it?p:null,views:Y,rows:de,cards:st,data:t,events:R,everything:h,onEverything:b,onFlow:Le,onClose:()=>w(null)})]})]}),a(en,{open:_})]})};var sn=document.getElementById("board-data"),rn=document.getElementById("root");if(sn?.textContent&&rn){let e=JSON.parse(sn.textContent);Ut(rn).render(a(on,{data:e}))}})();
1268
1268
  </script>
1269
- <!-- built from f6a0c394c561e9adfe73c78cc6718ac851c7108c2ef6c29867e70f169361f062; run make board-ui after a change to packages/cli/src/board/ui -->
1269
+ <!-- built from 550e7773705ed418ec7152858ff78a657056a09481ce3f0e7f90e215ca0a176a; run make board-ui after a change to packages/cli/src/board/ui -->
1270
1270
  </body>
1271
1271
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/vulcan",
3
- "version": "0.4.10-5",
3
+ "version": "0.4.10-6",
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-5",
49
- "@venizia/vulcan-okf": "0.4.10-5",
48
+ "@venizia/vulcan-atlas": "0.4.10-6",
49
+ "@venizia/vulcan-okf": "0.4.10-6",
50
50
  "zod": "^4.6.7"
51
51
  },
52
52
  "devDependencies": {