@venizia/vulcan 0.4.10-7 → 0.4.10-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/base/claude/events.json +1 -11
- package/base/claude/settings.json +3 -3
- package/base/extensions/vulcan-guards.ts +9 -2
- package/base/hooks/guard-outside.ts +34 -10
- package/base/hooks/session-start.ts +1 -1
- package/base/packs/venizia.md +16 -0
- package/base/rules.md +23 -18
- package/base/templates/AGENTS.md +2 -2
- package/base/templates/board.html +3 -3
- package/package.json +3 -3
- package/src/agents/atlas-block.ts +8 -31
- package/src/agents/generated-block.ts +52 -0
- package/src/agents/index.ts +2 -0
- package/src/agents/rules-block.ts +92 -0
- package/src/board/command.ts +39 -14
- package/src/board/common/constants.ts +17 -0
- package/src/board/common/types.ts +8 -1
- package/src/board/fold.ts +1 -1
- package/src/board/github.ts +1 -2
- package/src/board/gitlab.ts +436 -0
- package/src/board/index.ts +1 -0
- package/src/board/settings.ts +14 -1
- package/src/commands/index.ts +0 -2
- package/src/commands/sync.command.ts +3 -3
- package/src/commands/table.ts +2 -14
- package/src/common/constants.ts +0 -1
- package/src/common/record.ts +5 -0
- package/src/config/schema.ts +33 -26
- package/src/doctor/checks.ts +110 -49
- package/src/doctor/common/constants.ts +0 -2
- package/src/events/common/constants.ts +2 -12
- package/src/events/hook.ts +5 -56
- package/src/hooks/command-view.ts +1 -1
- package/src/hooks/common/types.ts +2 -0
- package/src/hooks/guard-git.ts +40 -0
- package/src/hooks/guard-outside.ts +52 -2
- package/src/hooks/session-digest.ts +24 -123
- package/src/hooks/shell-folders.ts +127 -2
- package/src/hooks/shell-writes.ts +4 -0
- package/src/hooks/shell.ts +111 -2
- package/src/manifest/render.ts +17 -15
- package/src/rules/base.ts +11 -7
- package/src/rules/index.ts +1 -0
- package/src/rules/packs.ts +44 -0
- package/src/sync/agents-block.ts +94 -0
- package/src/sync/base-rules.ts +3 -3
- package/src/sync/index.ts +1 -1
- package/src/visualize/architecture.ts +504 -0
- package/src/visualize/assets.ts +15 -14
- package/src/visualize/compare-render.ts +22 -24
- package/src/visualize/constants.ts +15 -0
- package/src/visualize/diagrams.ts +13 -121
- package/src/visualize/kinds-render.ts +2 -2
- package/src/visualize/labels-vi.ts +14 -0
- package/src/visualize/labels.ts +2 -0
- package/src/visualize/layout.ts +409 -66
- package/src/visualize/page.ts +34 -10
- package/src/visualize/schema.ts +18 -0
- package/src/visualize/sections.ts +22 -9
- package/base/hooks/guard-manifest.ts +0 -2
- package/base/hooks/guard-package.ts +0 -2
- package/base/hooks/guard-remote-hosts.ts +0 -2
- package/src/commands/graph.command.ts +0 -6
- package/src/sync/atlas-block.ts +0 -56
|
@@ -1263,9 +1263,9 @@
|
|
|
1263
1263
|
<body>
|
|
1264
1264
|
<div id="root"></div>
|
|
1265
1265
|
<!--BOARD_DATA-->
|
|
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&>(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}))}})();
|
|
1266
|
+
<script>(()=>{var y,mt,dn,J,Ue,Ee,_t,be,ft,Ge,Ve,pt,_e=Symbol.for("pv"),Te={},Se=[],un=/^m(i|n|o|s|text|space)$/,Ie=Array.isArray,gt=Se.slice,ae=Object.assign;function ne(e){e&&e.parentNode&&e.remove()}function Ne(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:_e,__v:s||++mt,__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 ee(e,t){if(t==null)return e.__&&ee(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:ee(e)}function ht(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),ht(e)}function He(e){(8&e.__g||(e.__g|=8,J.push(e),Ee++))&&Ue==y.debounceRendering||((Ue=y.debounceRendering)||queueMicrotask)(yt)}function yt(){var e,t,n,o,s,i,r,l,u;try{for(t=1;J.length;)J.length>t&&J.sort(_t),e=J.shift(),t=J.length,8&e.__g&&(o=void 0,s=void 0,i=(s=(n=e).__v).__e,r=[],l=[],(u=n.__P)&&((o=ae({constructor:_e},s)).__v=s.__v+1,y.vnode&&y.vnode(o),ze(u,o,s,n.__n,u.namespaceURI,32&s.__u?[i]:null,r,i||ee(s),32&s.__u,l),o.__v=s.__v,o.__.__k[o.__i]=o,bt(r,o,l),s.__=s.__e=null,o.__e!=i&&ht(o)))}finally{(Ee=J.length)&&(Ue||queueMicrotask)(yt)}}function vt(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=mn(n,t,b,u,v),f=0;f<v;f++)(d=n.__k[f])!=null&&(_=~d.__i&&b[d.__i]||Te,d.__i=f,h=ze(e,d,_,s,i,r,l,u,m,c),p=d.__e,(_.ref!=d.ref||8&_.__u)&&(_.ref&&Ke(_.ref,null,d,_),d.ref&&c.push(d.ref,d.__c||p,d)),w=w||p,4&d.__u?(u=kt(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 mn(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]=Ne(null,r):Ie(r)?r=v[i]=Ne(E,{children:r}):r.constructor===_e&&r.__b?r=v[i]=Ne(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=_n(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=ee(l)),je(l,l));return o}function kt(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=kt(s[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=ee(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 Ae(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(Ie(e)?e.some(function(n){Ae(n,t)}):t.push(e)),t}function _n(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 ut(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function we(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||ut(e.style,t);if(n)for(t in n)o&&n[t]==o[t]||ut(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")(e.__e||(e.__e={}))[t]=n,n&&o||(r=Ve[t]||(Ve[t]=fn(t)),(e.__a||(e.__a={}))[t]=Ge,i=t!=(t=t.replace(ft,"$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 fn(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[be]==null)t[be]=Ge++;else if(t[be]<this.__a[e])return;return n(y.event?y.event(t):t)}}}function ze(e,t,n,o,s,i,r,l,u,m){var c,f,_,d,p,w,h,b,v,T,g,N,Y,ie,L,F,z,V,W=t.type;if(t.constructor!==_e)return null;128&n.__u&&(u=32&n.__u,c=n.__c.__z)&&(t.__u|=u,f=i=[],c.nodeType==8?l=We(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,T=(c=W.contextType)&&o[c.__c],g=c?T?T.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=gn),T&&T.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=ae({},d.__s)),ae(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(B){B&&(B.__=t)}),Se.push.apply(d.__h,d.__k),d.__k=[],d.__h.length&&r.push(d),l=ee(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,Y=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&&++Y<25);d.state=d.__s,d.getChildContext&&(o=ae({},o,d.getChildContext())),v&&n.__c&&d.getSnapshotBeforeUpdate&&(h=d.getSnapshotBeforeUpdate(p,w)),ie=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(B){B&&je(B,B)}),n.__k=null),l=n.__k?ee(n,0):null),l=vt(e,Ie(ie)?ie:[ie],t,n,o,s,i,r,l,u,m),b.__P&&(t.__e=null,l=c),t.__u&=-161,f&&f.some(ne),d.__h.length&&r.push(d),1&d.__g&&(d.__g&=-4)}catch(B){if(r.length=_,t.__v=null,u||i)if(B.then){if(L=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"))L++||(F=V);else if(L&&V.data.startsWith("/$s")&&!--L)break}else if(!L)break}}if(!F){for(;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;F=l}(c=We(F=t.__c.__z||(t.__c.__z=F)))?(t.__e=F,l=c):t.__e=l,l=l&&l.nextSibling}else i&&i.some(ne);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),B.then||wt(t),y.__e(B,t,n)}}else l=t.__e=pn(n.__e,t,n,o,s,i,r,u,m,e);return(c=y.diffed)&&c(t),l}function We(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 wt(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(wt))}function bt(e,t,n){for(var o=0;o<n.length;)Ke(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 pn(e,t,n,o,s,i,r,l,u,m){var c,f,_,d,p,w,h,b,v,T=n.props||Te,{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&>.call(m.childNodes),!l&&i)for(T={},c=0;c<e.attributes.length;c++)T[(p=e.attributes[c]).name]=p.value;for(c in T)p=T[c],c=="dangerouslySetInnerHTML"?_=p:c=="children"||(c in g)||c=="value"&&("defaultValue"in g)||c=="checked"&&("defaultChecked"in g)||we(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"||!(T[c]!==p||v&&p!=null)||we(e,c,p,T[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"&&un.test(N))&&(s="http://www.w3.org/1999/xhtml"),vt(m,Ie(d)?d:[d],t,n,o,s,i,r,i?i[0]:n.__k&&ee(n,0),l,u),i&&i.some(ne)),l&&N!="textarea"||(c="value",N=="progress"&&w==null?e.removeAttribute(c):w==null||w===e[c]&&(N!="progress"||w)||we(e,c,w,T[c],s),c="checked",h!=null&&h!=e[c]&&we(e,c,h,T[c],s))}else T===g||l&&e.data==g||(e.data=g);return e}function Ke(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 je(e,t,n){var o,s,i,r;if(y.unmount&&y.unmount(e),!(o=e.ref)||o.current&&o.current!=e.__e||Ke(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]&&je(o[r],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(o=e.__c)&&(o=o.__z)&&(s=We(o,i=[]))&&(o==e.__e&&i.some(ne),ne(s),ne(o)),(o=e.__e)&&(n||ne(o),o.__e&&(o.__e=null)),e.__e=e.__c=e.__=null}function gn(e,t,n){return this.constructor(e,n)}function qe(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=Ne(E,{children:[e]}),s=[],i=[],ze(t,t.__k,o||Te,Te,t.namespaceURI,o?null:t.firstChild?gt.call(t.childNodes):null,s,o?o.__e:t.firstChild,n,i),bt(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,He(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"+pt++,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 Ee=0,e}},mt=0,dn=function(e){return e!=null&&e.constructor===_e},Q.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=ae({},this.state)),typeof e=="function"&&(e=e(ae({},n),this.props)),e&&(ae(n,e),this.__v&&(t&&this.__k.push(t),He(this)))},Q.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),He(this))},Q.prototype.render=E,J=[],Ee=0,_t=function(e,t){return e.__v.__b-t.__v.__b},be=Symbol(),ft=/(PointerCapture)$|Capture$/i,Ge=0,Ve={},pt=0;var re,S,Xe,Nt,Ye=Object.is,pe=0,Bt=[],Ze=[],I=y,{__b:Et,__r:Tt,diffed:St,__c:It,unmount:At,__:xt}=I;function Ce(e,t){I.__h&&I.__h(S,e,pe||t),pe=0;var n=S.__H||(S.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return pe=1,Rt(Dt,e)}function Rt(e,t,n){var o=Ce(re++,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);Ye(r,l)||(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=S,!S.__f)){S.__f=!0;var s=S.shouldComponentUpdate;S.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,Ye(_.__[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=Ce(re++,3);!I.__s&&Pt(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,S.__H.__h.push(n))}function Oe(e){return pe=5,K(function(){return{current:e}},[])}function K(e,t){var n=Ce(re++,7);return Pt(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Qe(e,t){return pe=8,K(function(){return e},t)}function Be(e){var t=S.context[e.__c],n=Ce(re++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(S)),t.props.value):e.__}function hn(){var e;do{for(;e=Ze.shift();)try{fe(e)}catch(n){I.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=Bt.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(fe),t.__h.some(Je),t.__h=[]}catch(n){t.__h=[],I.__e(n,e.__v)}}}while(Ze.length)}I.__b=function(e){S=null,Et&&Et(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),xt&&xt(e,t)},I.__r=function(e){Tt&&Tt(e),re=0;var t=(S=e.__c).__H;t&&(Xe==S?S.__h=[]:(t.__h.some(fe),t.__h.some(Je),re=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),Xe=S},I.diffed=function(e){St&&St(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Ot(Bt.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),Xe=S=null},I.__c=function(e,t){t.some(function(n){try{n.__h.some(fe),n.__h=n.__h.filter(function(o){return!o.__||Je(o)})}catch(o){n.__h=[function(){throw o}]}}),It&&It(e,t)},I.unmount=function(e){At&&At(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,Ot(Ze.push(s))}else fe(s)}catch(i){t=i}}),o.__H=void 0,t&&I.__e(t,o.__v))};var Ct=typeof requestAnimationFrame=="function";function yn(e){var t,n=function(){clearTimeout(o),Ct&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Ct&&(t=requestAnimationFrame(n))}function Ot(e){e!=1&&Nt==I.requestAnimationFrame||((Nt=I.requestAnimationFrame)||yn)(hn)}function fe(e){var t=S,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),S=t}function Je(e){var t=S;e.__c=e.__(),S=t}function Pt(e,t){return!e||e.length!=t.length||t.some(function(n,o){return!Ye(n,e[o])})}function Dt(e,t){return typeof t=="function"?t(e):t}var $t=Object.assign;var wn=/^(-|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]/,En=/[A-Z0-9]/g,Tn=typeof document<"u";var Sn=function(e){return/fil|che|rad/.test(e)};function Ft(e,t,n){return t.__k==null&&(t.textContent=""),qe(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 Mt=y.event;y.event=function(e){return Mt&&(e=Mt(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}},Lt=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||Tn&&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"||wn.test(f)||(c||(c=m=$t({},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&&Nn.test(u)?u=u.replace(En,"-$&").toLowerCase():m===null&&(m=void 0);r[u]=m}}i=="select"&&(r.multiple&&Array.isArray(r.value)&&(r.value=Ae(s.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),r.defaultValue!=null&&(r.value=Ae(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",In)):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=$t({},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,Lt&&Lt(e)};function Ut(e){return!!e.__k&&(qe(null,e),!0)}function Vt(e){return{render:function(t){Ft(t,e)},unmount:function(){Ut(e)}}}class An{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 U{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 q{static GITHUB="github";static GITLAB="gitlab";static HOSTS=new Set([this.GITHUB,this.GITLAB])}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 PROJECT_PATH=/^[\w.-]+(?:\/[\w.-]+)+$/;static GITLAB_DEFAULT_HOST="gitlab.com";static GITLAB_HOST=/^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)*(?::\d{1,5})?$/;static GITLAB_JOB_PIPELINES=10;static HARNESS_ASKS=new Set(["idle_prompt","permission_prompt","elicitation_dialog"]);static WORK_KINDS=[U.ASSIGN,U.DESIGN,U.COMMIT,U.PR,U.FIX,U.NOTE];static PROGRESS_KINDS=[U.COMMIT,U.PR,U.FIX,U.MERGE,U.RELEASE,U.HANDOFF]}class te{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 M{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 Re=xe({t:(e)=>e,now:0}),R=()=>Be(Re),Pe=()=>Be(Re).t;class et{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 Cn=60000;class A{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())/Cn));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 On=Symbol.for("pv"),Bn=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:On,__v:--Bn,__i:-1,__u:0};return(s||i)&&(m.__source=s,m.__self=i),y.vnode&&y.vnode(m),m}var Wt={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]]}},Ht=["#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)})})},Pn=(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(Pn,{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 le{static shapeOf(e){let t=e.shapes[e.name];return t in Wt?t:"bun"}static colorOf(e){let t=0;for(let n of e.name)t=t*31+n.charCodeAt(0)>>>0;return Ht[t%Ht.length]}}var $e=(e)=>{let t=Wt[e.shape],n=le.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 tt={you:"ask",blocked:"ask",working:"work",idle:"idle"},Me=(e)=>a(E,{children:[a("span",{className:"c-k",children:e.label}),a("span",{className:"c-v",children:e.children})]}),$n=(e)=>{let{t,now:n}=R(),{row:o,card:s}=e,i=(f)=>A.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?` · ${A.ago({iso:s.since,now:n,translate:t})}`:"",u=a("span",{className:"c-face",children:a($e,{state:o.st,name:o.n,shape:e.shape})}),m=a("span",{className:`c-badge b-${tt[o.st]}`,children:`${t(ge.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(Me,{label:t("ag.working"),children:[s.workingOn.flow.title," ",a("small",{children:s.workingOn.flow.id})]}):null,o.ask?a(Me,{label:t("ag.asking"),children:`"${o.ask}"`}):null,s.action?a(Me,{label:t(s.workingOn?"ag.action":"ag.lastTime"),children:[s.action.summary," ",a("small",{children:i(s.action.ts)})]}):null,s.message?a(Me,{label:t("ag.message"),children:[et.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]})]})},Gt=(e)=>{let{t,now:n}=R(),[o,s]=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)),m=(c)=>a($n,{row:c,card:e.cards[c.n],shape:le.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;if(e.image===!0)return/^(?:https:\/\/|data:image\/)/.test(t)?t:void 0;return/^https?:\/\//.test(t)?t:void 0}}class nt{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)&&nt.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)=>!q.HOSTS.has(c.source)&&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}),T=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,...T,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:A.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 D{static endsOf(e){let{message:t}=e;return t.incoming?{sender:t.from,receiver:t.actor}:{sender:t.actor,receiver:t.to}}static labelOf(e){let{pr:t}=e;return`${t.repo??""}${t.source===q.GITLAB?"!":"#"}${t.n}`}static prHref(e){let{pr:t}=e;if(j.safe({value:t.link??void 0}))return t.link??void 0;return t.source!==q.GITLAB&&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,source:o.source,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|-\/merge_requests)\//.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}=D.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:D.prsOf({events:n}).filter((i)=>i.by===o&&!i.merged&&!i.closed),pending:D.pendingOf({data:t,messages:s,name:o})}}static pendingOf(e){let{data:t,messages:n,name:o}=e,s=(l)=>D.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 Mn=/[.!?](\s|$)/,zt=140,Ln=3;class X{static sentenceOf(e){let t=(e.text??"").trim(),n=Mn.exec(t),o=n===null?t:t.slice(0,n.index+1);return o.length>zt?`${o.slice(0,zt-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:X.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:D.prsOf({events:t.evs}).filter((i)=>!i.merged&&!i.closed).map((i)=>({label:D.labelOf({pr:i}),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(-Ln)}}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=D.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:_}=D.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)=>A.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 Fn=(e)=>e.status==="fail"||e.status==="blocked",Kt=(e)=>{let{t}=R();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"})})},Le=(e)=>a("span",{className:"c-bar",children:a("span",{style:{width:`${Math.round(e.done/e.total*100)}%`}})}),at=(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}`))})})},Un=(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},ot=(e)=>{let{t}=R(),{event:n}=e,o=A.isApproximate({source:n.source}),s=j.safe({value:n.link}),i=M.KIND_TEXT[n.kind],r="";if(o)r=t("giờ ước lượng");else if(n.source===q.GITHUB)r="GitHub";else if(n.source===q.GITLAB)r="GitLab";return a("li",{className:`ev${Fn(n)?" fail":""}`,children:[a("span",{className:"tm",children:[o?"≈":"",A.clock({iso:n.ts})]}),a("div",{children:[e.chip,a("div",{className:"who",children:[a("b",{children:n.actor}),a(Un,{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 jt={decision:"ms.decision",merge:"ms.merge",release:"ms.deploy"},qt=5,Vn=200,Hn=(e)=>{if(e.stage===e.cur)return"st cur";return e.stage<e.cur?"st done":"st"},oe=(e)=>a("div",{className:"d-sec",children:[a("h4",{children:e.title}),e.children]}),Wn=(e)=>{let{t}=R(),n=e.view.evs.filter((o,s)=>s===0||(o.kind in jt)).map((o,s)=>({event:o,tag:s===0?"ms.open":jt[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:A.clock({iso:o.ts})}),a("span",{className:"d-tag",children:t(s)}),o.summary]},o.id))})},Gn=(e)=>{let{t}=R();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,Vn).map((n)=>a(ot,{event:n},n.id))})]})},zn=(e)=>{let{t}=R(),{view:n}=e,{flow:o}=n,s=X.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:M.STAGES.map((i,r)=>a("span",{title:t(i),className:Hn({stage:r,cur:o.cur})},i))}),a("div",{className:"d-stl",children:[a("span",{children:t(M.STAGES[0])}),a("b",{children:t(M.STAGES[o.cur])}),a("span",{children:t(M.STAGES[M.STAGES.length-1])})]})]}),o.context||o.apps?a(oe,{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(oe,{title:`${t("fl.steps")} · ${s.steps.done}/${s.steps.total}`,children:[a(Le,{...s.steps}),a(at,{items:o.steps})]}):null,o.checks&&o.checks.length>0?a(oe,{title:`${t("fl.checks")}${o.tracker?` · ${o.tracker}`:""}`,children:a(at,{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(oe,{title:t("dt.milestones"),children:a(Wn,{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]})},Kn=(e)=>{let{t,now:n}=R(),{row:o,card:s,data:i}=e,r=D.of({data:i,events:e.events,name:o.n}),l=(u)=>A.clock({iso:u});return a("div",{id:"dBody",className:"d-body d-agent",children:[a("div",{className:"d-agenthead",children:[a($e,{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-${tt[o.st]}`,children:t(ge.PILL[o.st])}),s.since?a("span",{children:`${t("từ ")}${l(s.since)} · ${A.ago({iso:s.since,now:n,translate:t})}`}):null]})]})]}),a(oe,{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(-qt).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(oe,{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:D.prHref({pr:u})}),target:"_blank",rel:"noopener",children:D.labelOf({pr:u})}),u.ci?a(Kt,{bad:u.ci==="fail"}):null,u.flow]},`${u.repo}#${u.n}`))})}),a(oe,{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(-qt).reverse().map((u)=>{let{sender:m,receiver:c}=D.endsOf({data:i,message:u});return a("li",{children:[a("time",{children:l(u.ts)}),`${m===o.n?`→ ${c??"?"}`:`← ${m??"?"}`}: ${u.summary}`]},u.id)})})})]})},Xt=(e)=>{let{t}=R(),{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(Gn,{view:o}):null,o&&o.flow.id!==C.UNSORTED?a(zn,{view:o,everything:e.everything,onEverything:e.onEverything}):null,s?a(Kn,{row:s,card:e.cards[s.n],data:e.data,events:e.events,shape:le.shapeOf({name:s.n,shapes:e.data.shapes}),onFlow:e.onFlow}):null]})]})};var ce={fill:"none",stroke:"currentColor",strokeWidth:1.5},Yt={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"})]})},Zt=()=>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"],jn={light:"sáng",dark:"tối",system:"theo máy"},Jt=(e)=>{let t=Pe(),n=`${t("Giao diện: ")}${t(jn[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:A.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:Yt[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 qn={you:"wait",blocked:"ask",running:"work",parked:"idle",done:"ok"},Xn=2,de=(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(Le,{done:e.done,total:e.total}),`${e.done}/${e.total} ${e.label}`]}),Yn=(e)=>{let{t,now:n}=R();if(e.due===void 0)return a("span",{className:"c-badge b-idle",children:t("it.noDue")});let o=X.daysLeft({due:e.due,now:n}),s=o<0?t("it.overdue"):`${o} ${t("it.daysLeft")}`;return a("span",{className:`c-badge ${o<=Xn?"b-ask":"b-idle"}`,children:`${t("fl.due")} ${e.due} · ${s}`})},Zn=(e)=>{let{t}=R(),{view:n,card:o}=e,{flow:s}=n,i=Oe(null),r=(l)=>A.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-${qn[s.state]}`,children:n.noWork?t("nw.chip"):t(M.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(Yn,{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(de,{label:t("fl.steps"),children:a(Qt,{...o.steps,label:t("it.done")})}):null,o.checks.total>0?a(de,{label:t("it.checks"),children:a(Qt,{...o.checks,label:t("it.criteria")})}):null,s.apps?a(de,{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(de,{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(de,{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(de,{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)}`})]})]})},en=(e)=>{let{t,now:n}=R(),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"||A.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,M.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(Zt,{}),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(Zn,{view:m,card:X.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 Jn=[["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"]],tn=(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:Jn.flatMap(([n,o])=>[a("dt",{children:n},n),a("dd",{children:a("span",{children:t(o)})},o)])})]})};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 s=se.get({key:e.key});return e.allowed.find((i)=>i===s)??e.initial}),o=Qe((s)=>{se.set({key:e.key,value:s}),n(s)},[e.key]);return[t,o]},nn=()=>{let[e,t]=P(Date.now());return G(()=>{let n=setInterval(()=>t(Date.now()),60000);return()=>clearInterval(n)},[]),e},an=(e)=>{let t=e.data.live?.stream,[n,o]=P("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 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 st{static translate(e){return on[e.language][e.key]??e.key}}var Qn=["flows","decisions","agents","shapes","roster","lanes","roles","sources","generatedAt","since"],ea='input,textarea,select,[contenteditable="true"]',sn=(e)=>{let[t,n]=P(e.data),o=`board:${t.key}:`,[s,i]=ye({key:`${o}lang`,initial:te.EN,allowed:[te.EN,te.VI]}),[r,l]=ye({key:`${o}theme`,initial:"light",allowed:he}),[u,m]=ye({key:`${o}plumbing`,initial:"0",allowed:["0","1"]}),[c,f]=ye({key:`${o}agentDetails`,initial:"1",allowed:["0","1"]}),[_,d]=P(!1),[p,w]=P(null),[h,b]=P(!1),[v,T]=P(null),[g,N]=P({}),[Y,ie]=P(()=>se.get({key:`${o}lastSeen`})??new Date().toISOString()),L=nn(),F=u==="1",z=an({data:t,onData:(k)=>n((x)=>({...x,...Object.fromEntries(Qn.map((me)=>[me,k[me]]))}))}),V=K(()=>(k)=>st.translate({language:s,key:k}),[s]),W=K(()=>({t:V,now:L}),[V,L]),B=K(()=>O.eventsOf({data:t,showAll:F}),[t,F]),Z=K(()=>O.flowsOf({data:t,showAll:F,lastSeen:Y}),[t,F,Y,L]),ue=K(()=>O.rowsOf({data:t,flows:Z,events:B,translate:V,now:L}),[t,Z,B,V,L]),it=K(()=>Object.fromEntries(ue.map((k)=>[k.n,X.agentOf({data:t,events:B,views:Z,row:k,doc:t.agents[k.n],now:L})])),[t,B,Z,ue,L]),rt=p!==null&&(p.kind==="flow"?Z.some((k)=>k.flow.id===p.id):ue.some((k)=>k.n===p.name)),Fe=(k)=>w({kind:"flow",id:k}),cn=(k)=>{if(v===k){T(null),w(null);return}T(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(()=>{se.set({key:`${o}lastSeen`,value:Y})},[o,Y]),G(()=>{let k=(x)=>{if((x.target instanceof Element?x.target:null)?.closest?.(ea)||x.metaKey||x.ctrlKey||x.altKey)return;let ve=[...document.querySelectorAll(".row")],lt=p?.kind==="flow"?p.id:null,ct=ve.findIndex((ke)=>ke.dataset.id===lt);if(x.key==="j"||x.key==="k"){x.preventDefault();let ke=x.key==="j"?Math.min(ve.length-1,ct+1):Math.max(0,ct-1),dt=ve[ke]?.dataset.id;if(dt!==void 0)Fe(dt),ve[ke].focus()}else if(x.key==="e"&<)b(!h);else if(x.key==="Escape")if(_)d(!1);else w(null);else if(x.key==="?")d(!_)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)}),a(Re.Provider,{value:W,children:[a("div",{className:"app",children:[a(Jt,{title:t.title,logo:t.logo,sources:t.sources,lastSeen:Y,newCount:Z.reduce((k,x)=>k+x.newCount,0),onSeen:()=>ie(new Date().toISOString()),showPlumbing:F,onPlumbing:()=>m(F?"0":"1"),language:s,onLanguage:()=>i(s===te.EN?te.VI:te.EN),theme:r,onTheme:()=>l(he[(he.indexOf(r)+1)%he.length]),keysOpen:_,onKeys:()=>d(!_),live:t.live===void 0?void 0:z}),a("main",{className:`c-main${rt?"":" closed"}`,id:"vFlows",children:[a(Gt,{rows:ue,cards:it,shapes:t.shapes,picked:v,details:c==="1",onDetails:(k)=>f(k?"1":"0"),onPick:cn}),a(en,{views:Z,agent:v,onAgent:(k)=>{if(T(k),k===null&&p?.kind==="agent")w(null)},selected:p?.kind==="flow"?p.id:null,onSelect:Fe,open:g,onToggle:(k)=>N((x)=>({...x,[k]:!(x[k]??M.GROUPS.find((me)=>me.key===k)?.open)}))}),a(Xt,{detail:rt?p:null,views:Z,rows:ue,cards:it,data:t,events:B,everything:h,onEverything:b,onFlow:Fe,onClose:()=>w(null)})]})]}),a(tn,{open:_})]})};var rn=document.getElementById("board-data"),ln=document.getElementById("root");if(rn?.textContent&&ln){let e=JSON.parse(rn.textContent);Vt(ln).render(a(sn,{data:e}))}})();
|
|
1268
1268
|
</script>
|
|
1269
|
-
<!-- built from
|
|
1269
|
+
<!-- built from 0560f268012d557595bf074cfd9fd7219b9bd46804ed6dcc66967d9ddc517a54; 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-
|
|
3
|
+
"version": "0.4.10-9",
|
|
4
4
|
"description": "VULCAN - one setup, one workflow for every project: init, sync, doctor, upgrade, and `vulcan x` for the shipped tools. Bun-only.",
|
|
5
5
|
"homepage": "https://github.com/VENIZIA-AI/vulcan/tree/main/packages/cli",
|
|
6
6
|
"bugs": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@clack/prompts": "1.8.1",
|
|
48
|
-
"@venizia/vulcan-atlas": "0.4.10-
|
|
49
|
-
"@venizia/vulcan-okf": "0.4.10-
|
|
48
|
+
"@venizia/vulcan-atlas": "0.4.10-9",
|
|
49
|
+
"@venizia/vulcan-okf": "0.4.10-9",
|
|
50
50
|
"zod": "^4.6.7"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { GeneratedBlock } from './generated-block.ts';
|
|
2
|
+
|
|
3
|
+
const { start: ATLAS_BLOCK_START, end: ATLAS_BLOCK_END } = GeneratedBlock.markersOf({
|
|
4
|
+
name: 'atlas',
|
|
5
|
+
origin: '.configs/vulcan.config.*',
|
|
6
|
+
});
|
|
6
7
|
|
|
7
8
|
export class AtlasBlock {
|
|
8
9
|
/**
|
|
@@ -24,32 +25,8 @@ export class AtlasBlock {
|
|
|
24
25
|
].join('\n');
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
* Puts the block into AGENTS.md: rewritten between its markers when it is there, else inserted
|
|
29
|
-
* before the section that follows "Must read first", else appended. Text outside is never touched.
|
|
30
|
-
*/
|
|
28
|
+
/** Puts the block into AGENTS.md; see `GeneratedBlock.merge`. */
|
|
31
29
|
static merge(opts: { text: string; block: string }): { changed: boolean; text: string } {
|
|
32
|
-
|
|
33
|
-
const end = opts.text.indexOf(ATLAS_BLOCK_END);
|
|
34
|
-
let text: string;
|
|
35
|
-
|
|
36
|
-
if (opts.text === '') {
|
|
37
|
-
text = opts.block;
|
|
38
|
-
} else if (start !== -1 && end > start) {
|
|
39
|
-
text = `${opts.text.slice(0, start)}${opts.block.trimEnd()}${opts.text.slice(end + ATLAS_BLOCK_END.length)}`;
|
|
40
|
-
} else {
|
|
41
|
-
const heading = opts.text.indexOf(MUST_READ);
|
|
42
|
-
const next = heading === -1 ? -1 : opts.text.indexOf('\n## ', heading + MUST_READ.length);
|
|
43
|
-
|
|
44
|
-
if (next === -1) {
|
|
45
|
-
text = `${opts.text}${opts.text.endsWith('\n') ? '' : '\n'}\n${opts.block}`;
|
|
46
|
-
} else {
|
|
47
|
-
const at = next + 1;
|
|
48
|
-
|
|
49
|
-
text = `${opts.text.slice(0, at)}${opts.block}\n${opts.text.slice(at)}`;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return { changed: text !== opts.text, text };
|
|
30
|
+
return GeneratedBlock.merge({ ...opts, name: 'atlas' });
|
|
54
31
|
}
|
|
55
32
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const MUST_READ = '## Must read first';
|
|
2
|
+
|
|
3
|
+
/** A block `vulcan sync` writes into AGENTS.md between its own markers, `<!-- vulcan:<name>:start ... -->` to `<!-- vulcan:<name>:end -->`. */
|
|
4
|
+
export class GeneratedBlock {
|
|
5
|
+
static markersOf(opts: { name: string; origin: string }): { start: string; end: string } {
|
|
6
|
+
return {
|
|
7
|
+
start: `<!-- vulcan:${opts.name}:start - generated by vulcan sync from ${opts.origin}; do not edit -->`,
|
|
8
|
+
end: `<!-- vulcan:${opts.name}:end -->`,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Puts the block into AGENTS.md: rewritten between its markers when it is there, else inserted
|
|
14
|
+
* before the section that follows "Must read first", else appended. Text outside is never touched.
|
|
15
|
+
*/
|
|
16
|
+
static merge(opts: { text: string; block: string; name: string }): {
|
|
17
|
+
changed: boolean;
|
|
18
|
+
text: string;
|
|
19
|
+
} {
|
|
20
|
+
const startPrefix = `<!-- vulcan:${opts.name}:start`;
|
|
21
|
+
const endMarker = `<!-- vulcan:${opts.name}:end -->`;
|
|
22
|
+
const start = opts.text.indexOf(startPrefix);
|
|
23
|
+
const end = opts.text.indexOf(endMarker);
|
|
24
|
+
let text: string;
|
|
25
|
+
|
|
26
|
+
if (opts.text === '') {
|
|
27
|
+
text = opts.block;
|
|
28
|
+
} else if (start !== -1 && end > start) {
|
|
29
|
+
text = `${opts.text.slice(0, start)}${opts.block.trimEnd()}${opts.text.slice(end + endMarker.length)}`;
|
|
30
|
+
} else {
|
|
31
|
+
const heading = opts.text.indexOf(MUST_READ);
|
|
32
|
+
// The section that follows, or another generated block, whichever comes first.
|
|
33
|
+
const nexts =
|
|
34
|
+
heading === -1
|
|
35
|
+
? []
|
|
36
|
+
: ['\n## ', '\n<!-- vulcan:']
|
|
37
|
+
.map((marker) => opts.text.indexOf(marker, heading + MUST_READ.length))
|
|
38
|
+
.filter((at) => at !== -1);
|
|
39
|
+
const next = nexts.length === 0 ? -1 : Math.min(...nexts);
|
|
40
|
+
|
|
41
|
+
if (next === -1) {
|
|
42
|
+
text = `${opts.text}${opts.text.endsWith('\n') ? '' : '\n'}\n${opts.block}`;
|
|
43
|
+
} else {
|
|
44
|
+
const at = next + 1;
|
|
45
|
+
|
|
46
|
+
text = `${opts.text.slice(0, at)}${opts.block}\n${opts.text.slice(at)}`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return { changed: text !== opts.text, text };
|
|
51
|
+
}
|
|
52
|
+
}
|
package/src/agents/index.ts
CHANGED
|
@@ -5,7 +5,9 @@ export * from './prompt.ts';
|
|
|
5
5
|
export * from './resolve.ts';
|
|
6
6
|
export * from './table.ts';
|
|
7
7
|
export * from './render.ts';
|
|
8
|
+
export * from './generated-block.ts';
|
|
8
9
|
export * from './atlas-block.ts';
|
|
10
|
+
export * from './rules-block.ts';
|
|
9
11
|
export * from './exclude.ts';
|
|
10
12
|
export * from './hooks-json.ts';
|
|
11
13
|
export * from './codex-hooks.ts';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { RuleParser } from '../rules/index.ts';
|
|
2
|
+
import type { ISlot } from '../rules/index.ts';
|
|
3
|
+
import { GeneratedBlock } from './generated-block.ts';
|
|
4
|
+
|
|
5
|
+
const { start: RULES_BLOCK_START, end: RULES_BLOCK_END } = GeneratedBlock.markersOf({
|
|
6
|
+
name: 'rules',
|
|
7
|
+
origin: 'the base rules and .configs/vulcan.config.*',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
/** A summary of a rule shorter than this takes the next sentence too (`Approval has a card.`). */
|
|
11
|
+
const SHORT_SUMMARY_CHARACTERS = 40;
|
|
12
|
+
|
|
13
|
+
export class RulesBlock {
|
|
14
|
+
/** What the block may weigh with its markers: Claude Code gives a hook's output whole up to about 10,000 bytes (measured), so 6 KB leaves room for the rest of the session's context, and each rule line carries its whole first sentence. */
|
|
15
|
+
static readonly MAX_BYTES = 6144;
|
|
16
|
+
|
|
17
|
+
/** A rule row as one line: its whole first sentence, plain, with the next one when the first is only a title. */
|
|
18
|
+
static summaryOf(opts: { row: string }): string {
|
|
19
|
+
const cell = (opts.row.split('|')[2] ?? '').replaceAll('**', '').replace(/\s+/g, ' ').trim();
|
|
20
|
+
const [first = '', second = ''] = cell.split(/(?<=[.!?])\s+/);
|
|
21
|
+
return first.length < SHORT_SUMMARY_CHARACTERS ? `${first} ${second}`.trim() : first;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** One line for each slot of the base rules: the option this project chose, or that it has not chosen. */
|
|
25
|
+
static slotLinesOf(opts: {
|
|
26
|
+
slots: Record<string, ISlot>;
|
|
27
|
+
choices: Record<string, string | undefined>;
|
|
28
|
+
command: string;
|
|
29
|
+
}): string[] {
|
|
30
|
+
return Object.entries(opts.slots).map(([id, slot]) => {
|
|
31
|
+
const choice = opts.choices[id];
|
|
32
|
+
|
|
33
|
+
return choice === undefined
|
|
34
|
+
? `- ${id}: this project has **not chosen** - run \`${opts.command} doctor\``
|
|
35
|
+
: `- ${id}: this project: \`${choice}\` - ${slot.options[choice]?.text ?? `unknown option - run \`${opts.command} doctor\``}`;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The rules an agent must not skip, from the rules themselves: this project's slot choices, the write
|
|
41
|
+
* boundaries, where scratch files go, and the rules sessions drop most (from the last, as many as fit
|
|
42
|
+
* `MAX_BYTES`). `rows` are the base and project rule rows.
|
|
43
|
+
*/
|
|
44
|
+
static render(opts: {
|
|
45
|
+
rows: string[];
|
|
46
|
+
slotLines: string[];
|
|
47
|
+
/** The rule packs the project follows: each one's name, the path of its file and the IDs of its rules. */
|
|
48
|
+
packs?: { name: string; path: string; ids: string[] }[];
|
|
49
|
+
/** The project's temp folder, relative to its root: the block is committed, so it holds no path of one machine. */
|
|
50
|
+
tmp: string;
|
|
51
|
+
oftenDropped: string[];
|
|
52
|
+
}): string {
|
|
53
|
+
const bullet = (id: string): string | undefined => {
|
|
54
|
+
const row = opts.rows.find((item) => RuleParser.parseIds({ markdown: item })[0] === id);
|
|
55
|
+
|
|
56
|
+
return row === undefined ? undefined : `- ${id}: ${RulesBlock.summaryOf({ row })}`;
|
|
57
|
+
};
|
|
58
|
+
const dropped = opts.oftenDropped.map((id) => bullet(id)).filter((line) => line !== undefined);
|
|
59
|
+
const build = (count: number): string =>
|
|
60
|
+
[
|
|
61
|
+
RULES_BLOCK_START,
|
|
62
|
+
'## Rules that must not be skipped',
|
|
63
|
+
'',
|
|
64
|
+
'Full text, cited by ID: `node_modules/@venizia/vulcan/base/rules.md` (V-*) and `.agents/rules.md`.',
|
|
65
|
+
'',
|
|
66
|
+
...opts.slotLines,
|
|
67
|
+
...(opts.packs ?? []).map(
|
|
68
|
+
(pack) =>
|
|
69
|
+
`- Pack \`${pack.name}\` (\`${pack.path}\`): this project follows it - ${pack.ids.join(', ')}.`,
|
|
70
|
+
),
|
|
71
|
+
...['V-W-02', 'V-W-03', 'V-W-06']
|
|
72
|
+
.map((id) => bullet(id))
|
|
73
|
+
.filter((line) => line !== undefined),
|
|
74
|
+
`- V-B-08: Scratch and temporary files go in \`${opts.tmp}\`, never /tmp or the scratchpad folder a tool offers. Claude Code sets \`TMPDIR\` to it; elsewhere \`export TMPDIR="$PWD/${opts.tmp}"\` from the project root.`,
|
|
75
|
+
...dropped.slice(0, count),
|
|
76
|
+
RULES_BLOCK_END,
|
|
77
|
+
'',
|
|
78
|
+
].join('\n');
|
|
79
|
+
let count = dropped.length;
|
|
80
|
+
|
|
81
|
+
while (count > 0 && Buffer.byteLength(build(count)) > RulesBlock.MAX_BYTES) {
|
|
82
|
+
count -= 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return build(count);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Puts the block into AGENTS.md; see `GeneratedBlock.merge`. */
|
|
89
|
+
static merge(opts: { text: string; block: string }): { changed: boolean; text: string } {
|
|
90
|
+
return GeneratedBlock.merge({ ...opts, name: 'rules' });
|
|
91
|
+
}
|
|
92
|
+
}
|