@event4u/agent-config 4.6.0 → 4.7.1
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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +1 -1
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +1 -1
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +1 -1
- package/dist/mcp/registry-manifest.json +1 -1
- package/dist/server/routes/wizard.js +6 -6
- package/dist/server/routes/wizard.js.map +1 -1
- package/dist/shared/userMd/formAdapter.js +6 -4
- package/dist/shared/userMd/formAdapter.js.map +1 -1
- package/dist/shared/userMd/schema.js +9 -3
- package/dist/shared/userMd/schema.js.map +1 -1
- package/dist/ui/assets/index-4V5HhhIV.js +40 -0
- package/dist/ui/assets/index-4V5HhhIV.js.map +1 -0
- package/dist/ui/index.html +1 -1
- package/docs/contracts/agent-user-schema.md +4 -4
- package/package.json +1 -1
- package/scripts/__pycache__/validate_frontmatter.cpython-312.pyc +0 -0
- package/scripts/_lib/__pycache__/__init__.cpython-312.pyc +0 -0
- package/scripts/_lib/__pycache__/agent_src.cpython-312.pyc +0 -0
- package/dist/ui/assets/index-BAJQeVdX.js +0 -40
- package/dist/ui/assets/index-BAJQeVdX.js.map +0 -1
package/dist/ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<meta name="robots" content="noindex" />
|
|
7
7
|
<title>agent-config</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-4V5HhhIV.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BbWWuFrF.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -25,12 +25,12 @@ version: 1
|
|
|
25
25
|
identity:
|
|
26
26
|
name: "Matze" # required — how the user wants to be addressed (full name or shorthand)
|
|
27
27
|
language: "de" # required — BCP-47-ish primary language ("de", "en", "fr", ...)
|
|
28
|
-
role: #
|
|
28
|
+
role: # optional — unordered list of role labels (may be empty)
|
|
29
29
|
- founder
|
|
30
30
|
- engineer
|
|
31
31
|
style:
|
|
32
32
|
pace: "pragmatic" # pragmatic | thorough | rapid
|
|
33
|
-
voice_sample: | #
|
|
33
|
+
voice_sample: | # optional — one paste of the user's typical writing
|
|
34
34
|
Mach das einfach. Wenn unklar, frag im Council.
|
|
35
35
|
last_updated: "2026-05-15" # YYYY-MM-DD — bumped on every accepted change
|
|
36
36
|
---
|
|
@@ -55,9 +55,9 @@ enforced by `/agents user accept` and `/agents user update`.
|
|
|
55
55
|
| `version` | yes | Schema version. v1 is the only valid value today. |
|
|
56
56
|
| `identity.name` | yes | How the agent addresses the user (full name or shorthand — user's choice). |
|
|
57
57
|
| `language` | yes | Primary language; the agent mirrors per [`language-and-tone`](../../.agent-src/rules/language-and-tone.md). |
|
|
58
|
-
| `role` |
|
|
58
|
+
| `role` | no | Unordered list of role labels (may be empty). Drives reviewer-voice selection and persona pairing when populated. Seeded enum mirrors `SEED_PROFILE_IDS`; additional free-form entries accepted; each present entry must be non-empty. The setup wizard never blocks a save on it. |
|
|
59
59
|
| `style.pace` | yes | `pragmatic` (default), `thorough` (more verification), or `rapid` (shorter replies). |
|
|
60
|
-
| `voice_sample` |
|
|
60
|
+
| `voice_sample` | no | Optional representative paste — sharpens mirror-back and tone calibration when present; may be empty. The setup wizard never blocks a save on it. |
|
|
61
61
|
| `last_updated` | yes | ISO date, bumped on every accept. |
|
|
62
62
|
|
|
63
63
|
## Explicit exclusions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event4u/agent-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.1",
|
|
4
4
|
"description": "Universal AI Agent OS \u2014 audited skills, governance rules, commands, and templates for AI coding tools (Claude Code, Cursor, Windsurf, Copilot).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))r(t);new MutationObserver(t=>{for(const l of t)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function i(t){const l={};return t.integrity&&(l.integrity=t.integrity),t.referrerPolicy&&(l.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?l.credentials="include":t.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(t){if(t.ep)return;t.ep=!0;const l=i(t);fetch(t.href,l)}})();var Cn,w,yr,br,q,Li,kr,wr,Rn,qe,Ae,xr,di,Yn,Kn,Ze={},Xe=[],dl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Tn=Array.isArray;function W(e,n){for(var i in n)e[i]=n[i];return e}function fi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function fl(e,n,i){var r,t,l,o={};for(l in n)l=="key"?r=n[l]:l=="ref"?t=n[l]:o[l]=n[l];if(arguments.length>2&&(o.children=arguments.length>3?Cn.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(l in e.defaultProps)o[l]===void 0&&(o[l]=e.defaultProps[l]);return Ge(e,o,r,t,null)}function Ge(e,n,i,r,t){var l={type:e,props:n,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:t??++yr,__i:-1,__u:0};return t==null&&w.vnode!=null&&w.vnode(l),l}function U(e){return e.children}function Se(e,n){this.props=e,this.context=n}function me(e,n){if(n==null)return e.__?me(e.__,e.__i+1):null;for(var i;n<e.__k.length;n++)if((i=e.__k[n])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?me(e):null}function pl(e){if(e.__P&&e.__d){var n=e.__v,i=n.__e,r=[],t=[],l=W({},n);l.__v=n.__v+1,w.vnode&&w.vnode(l),pi(e.__P,l,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,r,i??me(n),!!(32&n.__u),t),l.__v=n.__v,l.__.__k[l.__i]=l,Tr(r,l,t),n.__e=n.__=null,l.__e!=i&&Ar(l)}}function Ar(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Ar(e)}function Fi(e){(!e.__d&&(e.__d=!0)&&q.push(e)&&!en.__r++||Li!=w.debounceRendering)&&((Li=w.debounceRendering)||kr)(en)}function en(){try{for(var e,n=1;q.length;)q.length>n&&q.sort(wr),e=q.shift(),n=q.length,pl(e)}finally{q.length=en.__r=0}}function Sr(e,n,i,r,t,l,o,c,d,u,f){var s,h,p,v,g,b,k,m=r&&r.__k||Xe,D=n.length;for(d=hl(i,n,m,d,D),s=0;s<D;s++)(p=i.__k[s])!=null&&(h=p.__i!=-1&&m[p.__i]||Ze,p.__i=s,b=pi(e,p,h,t,l,o,c,d,u,f),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&hi(h.ref,null,p),f.push(p.ref,p.__c||v,p)),g==null&&v!=null&&(g=v),(k=!!(4&p.__u))||h.__k===p.__k?(d=Cr(p,d,e,k),k&&h.__e&&(h.__e=null)):typeof p.type=="function"&&b!==void 0?d=b:v&&(d=v.nextSibling),p.__u&=-7);return i.__e=g,d}function hl(e,n,i,r,t){var l,o,c,d,u,f=i.length,s=f,h=0;for(e.__k=new Array(t),l=0;l<t;l++)(o=n[l])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[l]=Ge(null,o,null,null,null):Tn(o)?o=e.__k[l]=Ge(U,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[l]=Ge(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[l]=o,d=l+h,o.__=e,o.__b=e.__b+1,c=null,(u=o.__i=vl(o,i,d,s))!=-1&&(s--,(c=i[u])&&(c.__u|=2)),c==null||c.__v==null?(u==-1&&(t>f?h--:t<f&&h++),typeof o.type!="function"&&(o.__u|=4)):u!=d&&(u==d-1?h--:u==d+1?h++:(u>d?h--:h++,o.__u|=4))):e.__k[l]=null;if(s)for(l=0;l<f;l++)(c=i[l])!=null&&!(2&c.__u)&&(c.__e==r&&(r=me(c)),Ir(c,c));return r}function Cr(e,n,i,r){var t,l;if(typeof e.type=="function"){for(t=e.__k,l=0;t&&l<t.length;l++)t[l]&&(t[l].__=e,n=Cr(t[l],n,i,r));return n}e.__e!=n&&(r&&(n&&e.type&&!n.parentNode&&(n=me(e)),i.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function vl(e,n,i,r){var t,l,o,c=e.key,d=e.type,u=n[i],f=u!=null&&(2&u.__u)==0;if(u===null&&c==null||f&&c==u.key&&d==u.type)return i;if(r>(f?1:0)){for(t=i-1,l=i+1;t>=0||l<n.length;)if((u=n[o=t>=0?t--:l++])!=null&&!(2&u.__u)&&c==u.key&&d==u.type)return o}return-1}function Pi(e,n,i){n[0]=="-"?e.setProperty(n,i??""):e[n]=i==null?"":typeof i!="number"||dl.test(n)?i:i+"px"}function He(e,n,i,r,t){var l,o;e:if(n=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(n in r)i&&n in i||Pi(e.style,n,"");if(i)for(n in i)r&&i[n]==r[n]||Pi(e.style,n,i[n])}else if(n[0]=="o"&&n[1]=="n")l=n!=(n=n.replace(xr,"$1")),o=n.toLowerCase(),n=o in e||n=="onFocusOut"||n=="onFocusIn"?o.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=i,i?r?i[Ae]=r[Ae]:(i[Ae]=di,e.addEventListener(n,l?Kn:Yn,l)):e.removeEventListener(n,l?Kn:Yn,l);else{if(t=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&i==1?"":i))}}function Ri(e){return function(n){if(this.l){var i=this.l[n.type+e];if(n[qe]==null)n[qe]=di++;else if(n[qe]<i[Ae])return;return i(w.event?w.event(n):n)}}}function pi(e,n,i,r,t,l,o,c,d,u){var f,s,h,p,v,g,b,k,m,D,Q,ke,Ni,Ue,Pn,j=n.type;if(n.constructor!==void 0)return null;128&i.__u&&(d=!!(32&i.__u),l=[c=n.__e=i.__e]),(f=w.__b)&&f(n);e:if(typeof j=="function")try{if(k=n.props,m=j.prototype&&j.prototype.render,D=(f=j.contextType)&&r[f.__c],Q=f?D?D.props.value:f.__:r,i.__c?b=(s=n.__c=i.__c).__=s.__E:(m?n.__c=s=new j(k,Q):(n.__c=s=new Se(k,Q),s.constructor=j,s.render=ml),D&&D.sub(s),s.state||(s.state={}),s.__n=r,h=s.__d=!0,s.__h=[],s._sb=[]),m&&s.__s==null&&(s.__s=s.state),m&&j.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=W({},s.__s)),W(s.__s,j.getDerivedStateFromProps(k,s.__s))),p=s.props,v=s.state,s.__v=n,h)m&&j.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),m&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(m&&j.getDerivedStateFromProps==null&&k!==p&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(k,Q),n.__v==i.__v||!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(k,s.__s,Q)===!1){n.__v!=i.__v&&(s.props=k,s.state=s.__s,s.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.some(function(ce){ce&&(ce.__=n)}),Xe.push.apply(s.__h,s._sb),s._sb=[],s.__h.length&&o.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(k,s.__s,Q),m&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(p,v,g)})}if(s.context=Q,s.props=k,s.__P=e,s.__e=!1,ke=w.__r,Ni=0,m)s.state=s.__s,s.__d=!1,ke&&ke(n),f=s.render(s.props,s.state,s.context),Xe.push.apply(s.__h,s._sb),s._sb=[];else do s.__d=!1,ke&&ke(n),f=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++Ni<25);s.state=s.__s,s.getChildContext!=null&&(r=W(W({},r),s.getChildContext())),m&&!h&&s.getSnapshotBeforeUpdate!=null&&(g=s.getSnapshotBeforeUpdate(p,v)),Ue=f!=null&&f.type===U&&f.key==null?Er(f.props.children):f,c=Sr(e,Tn(Ue)?Ue:[Ue],n,i,r,t,l,o,c,d,u),s.base=n.__e,n.__u&=-161,s.__h.length&&o.push(s),b&&(s.__E=s.__=null)}catch(ce){if(n.__v=null,d||l!=null)if(ce.then){for(n.__u|=d?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;l[l.indexOf(c)]=null,n.__e=c}else{for(Pn=l.length;Pn--;)fi(l[Pn]);qn(n)}else n.__e=i.__e,n.__k=i.__k,ce.then||qn(n);w.__e(ce,n,i)}else l==null&&n.__v==i.__v?(n.__k=i.__k,n.__e=i.__e):c=n.__e=_l(i.__e,n,i,r,t,l,o,d,u);return(f=w.diffed)&&f(n),128&n.__u?void 0:c}function qn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(qn))}function Tr(e,n,i){for(var r=0;r<i.length;r++)hi(i[r],i[++r],i[++r]);w.__c&&w.__c(n,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(l){l.call(t)})}catch(l){w.__e(l,t.__v)}})}function Er(e){return typeof e!="object"||e==null||e.__b>0?e:Tn(e)?e.map(Er):e.constructor!==void 0?null:W({},e)}function _l(e,n,i,r,t,l,o,c,d){var u,f,s,h,p,v,g,b=i.props||Ze,k=n.props,m=n.type;if(m=="svg"?t="http://www.w3.org/2000/svg":m=="math"?t="http://www.w3.org/1998/Math/MathML":t||(t="http://www.w3.org/1999/xhtml"),l!=null){for(u=0;u<l.length;u++)if((p=l[u])&&"setAttribute"in p==!!m&&(m?p.localName==m:p.nodeType==3)){e=p,l[u]=null;break}}if(e==null){if(m==null)return document.createTextNode(k);e=document.createElementNS(t,m,k.is&&k),c&&(w.__m&&w.__m(n,l),c=!1),l=null}if(m==null)b===k||c&&e.data==k||(e.data=k);else{if(l=m=="textarea"&&k.defaultValue!=null?null:l&&Cn.call(e.childNodes),!c&&l!=null)for(b={},u=0;u<e.attributes.length;u++)b[(p=e.attributes[u]).name]=p.value;for(u in b)p=b[u],u=="dangerouslySetInnerHTML"?s=p:u=="children"||u in k||u=="value"&&"defaultValue"in k||u=="checked"&&"defaultChecked"in k||He(e,u,null,p,t);for(u in k)p=k[u],u=="children"?h=p:u=="dangerouslySetInnerHTML"?f=p:u=="value"?v=p:u=="checked"?g=p:c&&typeof p!="function"||b[u]===p||He(e,u,p,b[u],t);if(f)c||s&&(f.__html==s.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),n.__k=[];else if(s&&(e.innerHTML=""),Sr(n.type=="template"?e.content:e,Tn(h)?h:[h],n,i,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":t,l,o,l?l[0]:i.__k&&me(i,0),c,d),l!=null)for(u=l.length;u--;)fi(l[u]);c&&m!="textarea"||(u="value",m=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[u]||m=="progress"&&!v||m=="option"&&v!=b[u])&&He(e,u,v,b[u],t),u="checked",g!=null&&g!=e[u]&&He(e,u,g,b[u],t))}return e}function hi(e,n,i){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&n==null||(e.__u=e(n))}else e.current=n}catch(t){w.__e(t,i)}}function Ir(e,n,i){var r,t;if(w.unmount&&w.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||hi(r,null,n)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(l){w.__e(l,n)}r.base=r.__P=null}if(r=e.__k)for(t=0;t<r.length;t++)r[t]&&Ir(r[t],n,i||typeof e.type!="function");i||fi(e.__e),e.__c=e.__=e.__e=void 0}function ml(e,n,i){return this.constructor(e,i)}function gl(e,n,i){var r,t,l,o;n==document&&(n=document.documentElement),w.__&&w.__(e,n),t=(r=!1)?null:n.__k,l=[],o=[],pi(n,e=n.__k=fl(U,null,[e]),t||Ze,Ze,n.namespaceURI,t?null:n.firstChild?Cn.call(n.childNodes):null,l,t?t.__e:n.firstChild,r,o),Tr(l,e,o)}Cn=Xe.slice,w={__e:function(e,n,i,r){for(var t,l,o;n=n.__;)if((t=n.__c)&&!t.__)try{if((l=t.constructor)&&l.getDerivedStateFromError!=null&&(t.setState(l.getDerivedStateFromError(e)),o=t.__d),t.componentDidCatch!=null&&(t.componentDidCatch(e,r||{}),o=t.__d),o)return t.__E=t}catch(c){e=c}throw e}},yr=0,br=function(e){return e!=null&&e.constructor===void 0},Se.prototype.setState=function(e,n){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=W({},this.state),typeof e=="function"&&(e=e(W({},i),this.props)),e&&W(i,e),e!=null&&this.__v&&(n&&this._sb.push(n),Fi(this))},Se.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Fi(this))},Se.prototype.render=U,q=[],kr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wr=function(e,n){return e.__v.__b-n.__v.__b},en.__r=0,Rn=Math.random().toString(8),qe="__d"+Rn,Ae="__a"+Rn,xr=/(PointerCapture)$|Capture$/i,di=0,Yn=Ri(!1),Kn=Ri(!0);var yl=0;function a(e,n,i,r,t,l){n||(n={});var o,c,d=n;if("ref"in d)for(c in d={},n)c=="ref"?o=n[c]:d[c]=n[c];var u={type:e,props:d,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--yl,__i:-1,__u:0,__source:t,__self:l};if(typeof e=="function"&&(o=e.defaultProps))for(c in o)d[c]===void 0&&(d[c]=o[c]);return w.vnode&&w.vnode(u),u}var Le,S,$n,$i,Gn=0,Or=[],C=w,Mi=C.__b,Di=C.__r,ji=C.diffed,Bi=C.__c,Ui=C.unmount,Hi=C.__;function vi(e,n){C.__h&&C.__h(S,e,Gn||n),Gn=0;var i=S.__H||(S.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Nr(e){return Gn=1,bl(Pr,e)}function bl(e,n,i){var r=vi(Le++,2);if(r.t=e,!r.__c&&(r.__=[Pr(void 0,n),function(c){var d=r.__N?r.__N[0]:r.__[0],u=r.t(d,c);d!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=S,!S.__f)){var t=function(c,d,u){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(h){return h.__c});if(f.every(function(h){return!h.__N}))return!l||l.call(this,c,d,u);var s=r.__c.props!==c;return f.some(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(s=!0)}}),l&&l.call(this,c,d,u)||s};S.__f=!0;var l=S.shouldComponentUpdate,o=S.componentWillUpdate;S.componentWillUpdate=function(c,d,u){if(this.__e){var f=l;l=void 0,t(c,d,u),l=f}o&&o.call(this,c,d,u)},S.shouldComponentUpdate=t}return r.__N||r.__}function je(e,n){var i=vi(Le++,3);!C.__s&&Fr(i.__H,n)&&(i.__=e,i.u=n,S.__H.__h.push(i))}function Lr(e,n){var i=vi(Le++,7);return Fr(i.__H,n)&&(i.__=e(),i.__H=n,i.__h=e),i.__}function kl(){for(var e;e=Or.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(Ve),n.__h.some(Vn),n.__h=[]}catch(i){n.__h=[],C.__e(i,e.__v)}}}C.__b=function(e){S=null,Mi&&Mi(e)},C.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Hi&&Hi(e,n)},C.__r=function(e){Di&&Di(e),Le=0;var n=(S=e.__c).__H;n&&($n===S?(n.__h=[],S.__h=[],n.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(n.__h.some(Ve),n.__h.some(Vn),n.__h=[],Le=0)),$n=S},C.diffed=function(e){ji&&ji(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Or.push(n)!==1&&$i===C.requestAnimationFrame||(($i=C.requestAnimationFrame)||wl)(kl)),n.__H.__.some(function(i){i.u&&(i.__H=i.u),i.u=void 0})),$n=S=null},C.__c=function(e,n){n.some(function(i){try{i.__h.some(Ve),i.__h=i.__h.filter(function(r){return!r.__||Vn(r)})}catch(r){n.some(function(t){t.__h&&(t.__h=[])}),n=[],C.__e(r,i.__v)}}),Bi&&Bi(e,n)},C.unmount=function(e){Ui&&Ui(e);var n,i=e.__c;i&&i.__H&&(i.__H.__.some(function(r){try{Ve(r)}catch(t){n=t}}),i.__H=void 0,n&&C.__e(n,i.__v))};var Wi=typeof requestAnimationFrame=="function";function wl(e){var n,i=function(){clearTimeout(r),Wi&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(i,35);Wi&&(n=requestAnimationFrame(i))}function Ve(e){var n=S,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),S=n}function Vn(e){var n=S;e.__c=e.__(),S=n}function Fr(e,n){return!e||e.length!==n.length||n.some(function(i,r){return i!==e[r]})}function Pr(e,n){return typeof n=="function"?n(e):n}var xl=Symbol.for("preact-signals");function En(){if(z>1)z--;else{var e,n=!1;for(function(){var t=rn;for(rn=void 0;t!==void 0;)t.S.v===t.v&&(t.S.i=t.i),t=t.o}();Ce!==void 0;){var i=Ce;for(Ce=void 0,nn++;i!==void 0;){var r=i.u;if(i.u=void 0,i.f&=-3,!(8&i.f)&&$r(i))try{i.c()}catch(t){n||(e=t,n=!0)}i=r}}if(nn=0,z--,n)throw e}}function Al(e){if(z>0)return e();Jn=++Sl,z++;try{return e()}finally{En()}}var A=void 0;function _i(e){var n=A;A=void 0;try{return e()}finally{A=n}}var Ce=void 0,z=0,nn=0,Sl=0,Jn=0,rn=void 0,tn=0;function Rr(e){if(A!==void 0){var n=e.n;if(n===void 0||n.t!==A)return n={i:0,S:e,p:A.s,n:void 0,t:A,e:void 0,x:void 0,r:n},A.s!==void 0&&(A.s.n=n),A.s=n,e.n=n,32&A.f&&e.S(n),n;if(n.i===-1)return n.i=0,n.n!==void 0&&(n.n.p=n.p,n.p!==void 0&&(n.p.n=n.n),n.p=A.s,n.n=void 0,A.s.n=n,A.s=n),n}}function N(e,n){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=n?.watched,this.Z=n?.unwatched,this.name=n?.name}N.prototype.brand=xl;N.prototype.h=function(){return!0};N.prototype.S=function(e){var n=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:_i(function(){var r;(r=n.W)==null||r.call(n)}))};N.prototype.U=function(e){var n=this;if(this.t!==void 0){var i=e.e,r=e.x;i!==void 0&&(i.x=r,e.e=void 0),r!==void 0&&(r.e=i,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&_i(function(){var t;(t=n.Z)==null||t.call(n)}))}};N.prototype.subscribe=function(e){var n=this;return Be(function(){var i=n.value,r=A;A=void 0;try{e(i)}finally{A=r}},{name:"sub"})};N.prototype.valueOf=function(){return this.value};N.prototype.toString=function(){return this.value+""};N.prototype.toJSON=function(){return this.value};N.prototype.peek=function(){var e=this;return _i(function(){return e.value})};Object.defineProperty(N.prototype,"value",{get:function(){var e=Rr(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(nn>100)throw new Error("Cycle detected");(function(i){z!==0&&nn===0&&i.l!==Jn&&(i.l=Jn,rn={S:i,v:i.v,i:i.i,o:rn})})(this),this.v=e,this.i++,tn++,z++;try{for(var n=this.t;n!==void 0;n=n.x)n.t.N()}finally{En()}}}});function _(e,n){return new N(e,n)}function $r(e){for(var n=e.s;n!==void 0;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function Mr(e){for(var n=e.s;n!==void 0;n=n.n){var i=n.S.n;if(i!==void 0&&(n.r=i),n.S.n=n,n.i=-1,n.n===void 0){e.s=n;break}}}function Dr(e){for(var n=e.s,i=void 0;n!==void 0;){var r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):i=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=i}function ae(e,n){N.call(this,void 0),this.x=e,this.s=void 0,this.g=tn-1,this.f=4,this.W=n?.watched,this.Z=n?.unwatched,this.name=n?.name}ae.prototype=new N;ae.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===tn))return!0;if(this.g=tn,this.f|=1,this.i>0&&!$r(this))return this.f&=-2,!0;var e=A;try{Mr(this),A=this;var n=this.x();(16&this.f||this.v!==n||this.i===0)&&(this.v=n,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return A=e,Dr(this),this.f&=-2,!0};ae.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var n=this.s;n!==void 0;n=n.n)n.S.S(n)}N.prototype.S.call(this,e)};ae.prototype.U=function(e){if(this.t!==void 0&&(N.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var n=this.s;n!==void 0;n=n.n)n.S.U(n)}};ae.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(ae.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Rr(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function zi(e,n){return new ae(e,n)}function jr(e){var n=e.m;if(e.m=void 0,typeof n=="function"){z++;var i=A;A=void 0;try{n()}catch(r){throw e.f&=-2,e.f|=8,mi(e),r}finally{A=i,En()}}}function mi(e){for(var n=e.s;n!==void 0;n=n.n)n.S.U(n);e.x=void 0,e.s=void 0,jr(e)}function Cl(e){if(A!==this)throw new Error("Out-of-order effect");Dr(this),A=e,this.f&=-2,8&this.f&&mi(this),En()}function ye(e,n){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=n?.name}ye.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var n=this.x();typeof n=="function"&&(this.m=n)}finally{e()}};ye.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,jr(this),Mr(this),z++;var e=A;return A=this,Cl.bind(this,e)};ye.prototype.N=function(){2&this.f||(this.f|=2,this.u=Ce,Ce=this)};ye.prototype.d=function(){this.f|=8,1&this.f||mi(this)};ye.prototype.dispose=function(){this.d()};function Be(e,n){var i=new ye(e,n);try{i.c()}catch(t){throw i.d(),t}var r=i.d.bind(i);return r[Symbol.dispose]=r,r}var Br,We,Tl=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,Ur=[];Be(function(){Br=this.N})();function be(e,n){w[e]=n.bind(null,w[e]||function(){})}function ln(e){if(We){var n=We;We=void 0,n()}We=e&&e.S()}function Hr(e){var n=this,i=e.data,r=Il(i);r.value=i;var t=Lr(function(){for(var c=n,d=n.__v;d=d.__;)if(d.__c){d.__c.__$f|=4;break}var u=zi(function(){var p=r.value.value;return p===0?0:p===!0?"":p||""}),f=zi(function(){return!Array.isArray(u.value)&&!br(u.value)}),s=Be(function(){if(this.N=Wr,f.value){var p=u.value;c.__v&&c.__v.__e&&c.__v.__e.nodeType===3&&(c.__v.__e.data=p)}}),h=n.__$u.d;return n.__$u.d=function(){s(),h.call(this)},[f,u]},[]),l=t[0],o=t[1];return l.value?o.peek():o.value}Hr.displayName="ReactiveTextNode";Object.defineProperties(N.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Hr},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});be("__b",function(e,n){if(typeof n.type=="string"){var i,r=n.props;for(var t in r)if(t!=="children"){var l=r[t];l instanceof N&&(i||(n.__np=i={}),i[t]=l,r[t]=l.peek())}}e(n)});be("__r",function(e,n){if(e(n),n.type!==U){ln();var i,r=n.__c;r&&(r.__$f&=-2,(i=r.__$u)===void 0&&(r.__$u=i=function(t,l){var o;return Be(function(){o=this},{name:l}),o.c=t,o}(function(){var t;Tl&&((t=i.y)==null||t.call(i)),r.__$f|=1,r.setState({})},typeof n.type=="function"?n.type.displayName||n.type.name:""))),ln(i)}});be("__e",function(e,n,i,r){ln(),e(n,i,r)});be("diffed",function(e,n){ln();var i;if(typeof n.type=="string"&&(i=n.__e)){var r=n.__np,t=n.props;if(r){var l=i.U;if(l)for(var o in l){var c=l[o];c!==void 0&&!(o in r)&&(c.d(),l[o]=void 0)}else l={},i.U=l;for(var d in r){var u=l[d],f=r[d];u===void 0?(u=El(i,d,f),l[d]=u):u.o(f,t)}for(var s in r)t[s]=r[s]}}e(n)});function El(e,n,i,r){var t=n in e&&e.ownerSVGElement===void 0,l=_(i),o=i.peek();return{o:function(c,d){l.value=c,o=c.peek()},d:Be(function(){this.N=Wr;var c=l.value.value;o!==c?(o=void 0,t?e[n]=c:c!=null&&(c!==!1||n[4]==="-")?e.setAttribute(n,c):e.removeAttribute(n)):o=void 0})}}be("unmount",function(e,n){if(typeof n.type=="string"){var i=n.__e;if(i){var r=i.U;if(r){i.U=void 0;for(var t in r){var l=r[t];l&&l.d()}}}n.__np=void 0}else{var o=n.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}e(n)});be("__h",function(e,n,i,r){(r<3||r===9)&&(n.__$f|=2),e(n,i,r)});Se.prototype.shouldComponentUpdate=function(e,n){if(this.__R)return!0;var i=this.__$u,r=i&&i.s!==void 0;for(var t in n)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var l=2&this.__$f;if(!(r||l||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var c in this.props)if(!(c in e))return!0;return!1};function Il(e,n){return Lr(function(){return _(e,n)},[])}var Ol=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Nl(){Al(function(){for(var e;e=Ur.shift();)Br.call(e)})}function Wr(){Ur.push(this)===1&&(w.requestAnimationFrame||Ol)(Nl)}function zr(){const e=window.location.hash;return e===""||e==="#"?"/":e.startsWith("#")?e.slice(1):e}const fe=_(zr());function Qn(e){const n=e.startsWith("/")?e:`/${e}`;`#${n}`!==window.location.hash&&(window.location.hash=n)}let Yi=!1;function Ll(){Yi||(Yi=!0,window.addEventListener("hashchange",()=>{fe.value=zr()}))}let Fe=null;function Fl(e){Fe=e}class $ extends Error{status;body;constructor(n,i,r){super(r),this.status=n,this.body=i}}async function x(e,n={}){const i={Accept:"application/json",...n.headers??{}};Fe!==null&&(i.Authorization=`Bearer ${Fe}`);const{body:r,...t}=n,l={...t,headers:i};r!==void 0&&(l.body=JSON.stringify(r),i["Content-Type"]="application/json");const o=await fetch(e,l),c=await o.text(),d=c===""?{}:JSON.parse(c);if(!o.ok){const u=d.error?.message??`request failed (${o.status})`;throw new $(o.status,d,u)}return d}async function Pl(e,n,i,r={}){const t={Accept:"text/event-stream","Content-Type":"application/json",...r.headers??{}};Fe!==null&&(t.Authorization=`Bearer ${Fe}`);const l=await fetch(e,{...r,method:"POST",headers:t,body:JSON.stringify(n)});if(!l.ok||l.body===null){const f=await l.text().catch(()=>"");let s={};try{s=f===""?{}:JSON.parse(f)}catch{}throw new $(l.status,s,s.error?.message??`stream failed (${l.status})`)}const o=l.body.getReader(),c=new TextDecoder;let d="";const u=f=>{for(const s of f.split(`
|
|
2
|
-
`)){if(!s.startsWith("data:"))continue;const h=s.slice(5).trim();if(h!=="")try{i(JSON.parse(h))}catch{}}};for(;;){const{done:f,value:s}=await o.read();if(f)break;d+=c.decode(s,{stream:!0});let h=d.indexOf(`
|
|
3
|
-
|
|
4
|
-
`);for(;h!==-1;)u(d.slice(0,h)),d=d.slice(h+2),h=d.indexOf(`
|
|
5
|
-
|
|
6
|
-
`)}d.trim()!==""&&u(d)}const an=_(null);async function Rl(){try{const e=await x("/api/v1/ping");an.value={...e,projectScopeAvailable:e.projectScopeAvailable===!0}}catch{an.value=null}}function Y(e){switch(e.code){case"VALIDATION":return"Some fields need attention before saving.";case"CONFLICT":return"This file changed on disk while you were editing. Review the latest version and re-save.";case"PRECONDITION_REQUIRED":return"Reload the page once — the optimistic-lock token is missing.";case"NOT_FOUND":return"The file does not exist yet. Use the wizard to create it.";case"ATOMIC_WRITE":return"Write failed mid-flight. The file was not partially modified.";case"YAML_PARSE":return"YAML parse error — fix the file by hand, then reload.";default:return e.message}}function $l(e){return/expected (boolean|string|number)/i.test(e)?e.replace(/^expected/i,"Expected"):e}function Yr(e){const n={};for(const i of e.fields??[])n[i.path]=$l(i.message);return n}function Ml({id:e,children:n}){return a("p",{class:"ac-field__description",id:e,children:n})}function Dl({id:e,children:n}){return a("p",{class:"ac-field__error",id:e,role:"alert","aria-live":"polite",children:n})}function oe({id:e,label:n,description:i,error:r,children:t}){const l=i!==void 0?`${e}-desc`:void 0,o=r!==void 0?`${e}-err`:void 0;return a("div",{class:"ac-field","data-invalid":r!==void 0?"true":void 0,children:[a("label",{class:"ac-field__label",for:e,children:n}),i!==void 0?a(Ml,{id:l,children:i}):null,a("div",{class:"ac-field__control","aria-describedby":l,"aria-errormessage":o,children:t}),r!==void 0?a(Dl,{id:o,children:r}):null]})}function Kr(e){return a(oe,{id:e.id,label:e.label,description:e.description,error:e.error,children:a("input",{class:"ac-input",type:"text",id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,"aria-invalid":e.error!==void 0?"true":void 0,onInput:n=>e.onChange(n.currentTarget.value)})})}function jl(e){const n=e.step??(e.integer===!0?1:"any");return a(oe,{id:e.id,label:e.label,description:e.description,error:e.error,children:a("input",{class:"ac-input",type:"number",id:e.id,name:e.name,value:Number.isFinite(e.value)?String(e.value):"0",min:e.min,max:e.max,step:n,"aria-invalid":e.error!==void 0?"true":void 0,onInput:i=>{const r=i.currentTarget.value,t=r===""?0:Number(r);e.onChange(Number.isFinite(t)?t:0)}})})}function Bl(e){return a(oe,{id:e.id,label:e.label,description:e.description,error:e.error,children:a("label",{class:"ac-toggle",children:[a("input",{type:"checkbox",id:e.id,name:e.name,checked:e.value,"aria-invalid":e.error!==void 0?"true":void 0,onChange:n=>e.onChange(n.currentTarget.checked)}),a("span",{class:"ac-toggle__track","aria-hidden":"true"}),a("span",{class:"ac-toggle__state",children:e.value?"On":"Off"})]})})}function qr(e){const n=e.options.length>3;return a(oe,{id:e.id,label:e.label,description:e.description,error:e.error,children:n?a("select",{class:"ac-input",id:e.id,name:e.name,value:e.value,"aria-invalid":e.error!==void 0?"true":void 0,onChange:i=>e.onChange(i.currentTarget.value),children:e.options.map(i=>a("option",{value:i.value,children:i.label??(i.value===""?"(none)":i.value)},i.value))}):a("div",{class:"ac-radio-group",role:"radiogroup","aria-labelledby":`${e.id}-label`,children:e.options.map(i=>{const r=`${e.id}-${i.value||"none"}`;return a("label",{class:"ac-radio",for:r,children:[a("input",{type:"radio",id:r,name:e.name,value:i.value,checked:i.value===e.value,onChange:()=>e.onChange(i.value)}),a("span",{children:i.label??(i.value===""?"(none)":i.value)})]},i.value)})})})}function on(e){return a(oe,{id:e.id,label:e.label,description:e.description,error:e.error,children:a("textarea",{class:"ac-textarea",id:e.id,name:e.name,rows:e.rows??6,placeholder:e.placeholder,"aria-invalid":e.error!==void 0?"true":void 0,onInput:n=>e.onChange(n.currentTarget.value),children:e.value})})}function Gr(e){return e.replace(/_/g," ").replace(/\./g," › ").replace(/\b\w/g,n=>n.toUpperCase())}function Ul(e){return e.enum!==void 0&&e.enum.length>0?"enum":e.type==="integer"?"integer":e.type==="number"?"number":e.type==="boolean"?"boolean":e.type==="string"?"string":e.type==="array"&&e.items?.type==="string"?"array-of-strings":"unsupported"}function Mn(e,n){const i=Ul(n);return{path:e,kind:i,label:Gr(e[e.length-1]??""),description:n.description,options:n.enum,min:n.minimum,max:n.maximum}}function Hl(e){const n=[],i=e.properties??{};for(const[r,t]of Object.entries(i))if(t.type==="object"&&t.properties!==void 0){const l=[];for(const[o,c]of Object.entries(t.properties))if(c.type==="object"&&c.properties!==void 0)for(const[d,u]of Object.entries(c.properties))l.push(Mn([r,o,d],u));else l.push(Mn([r,o],c));n.push({path:[r],label:Gr(r),description:t.description,fields:l})}else{const l=n.find(c=>c.path[0]==="__general"),o=Mn([r],t);l===void 0?n.unshift({path:["__general"],label:"General",fields:[o]}):l.fields.push(o)}return n}function Wl(e,n){let i=e;for(const r of n){if(i===null||typeof i!="object"||Array.isArray(i))return;i=i[r]}return i}function Vr(e,n,i){if(n.length===0)return e;const[r,...t]=n;if(r===void 0)return e;const l={...e};if(t.length===0)return l[r]=i,l;const o=l[r],c=o!==null&&typeof o=="object"&&!Array.isArray(o)?o:{};return l[r]=Vr(c,t,i),l}function Te(e){return e.join(".")}function zl(e,n,i,r){const t=Te(e.path),l=t,o=Wl(n,e.path),c=i[t],d=u=>{r(Vr(n,e.path,u))};switch(e.kind){case"string":{const u=typeof o=="string"?o:"";return u.length>80?a(on,{id:t,name:l,label:e.label,description:e.description,error:c,value:u,onChange:d}):a(Kr,{id:t,name:l,label:e.label,description:e.description,error:c,value:u,onChange:d})}case"enum":{const u=typeof o=="string"||typeof o=="number"?String(o):"",f=(e.options??[]).map(s=>({value:String(s)}));return a(qr,{id:t,name:l,label:e.label,description:e.description,error:c,value:u,options:f,onChange:d})}case"number":case"integer":{const u=typeof o=="number"?o:0;return a(jl,{id:t,name:l,label:e.label,description:e.description,error:c,value:u,integer:e.kind==="integer",min:e.min,max:e.max,onChange:d})}case"boolean":{const u=typeof o=="boolean"?o:!1;return a(Bl,{id:t,name:l,label:e.label,description:e.description,error:c,value:u,onChange:d})}case"array-of-strings":{const f=(Array.isArray(o)?o.filter(s=>typeof s=="string"):[]).join(`
|
|
7
|
-
`);return a(on,{id:t,name:l,label:e.label,description:`${e.description??""} (one entry per line)`.trim(),error:c,value:f,onChange:s=>{const h=s.split(`
|
|
8
|
-
`).map(p=>p.trim()).filter(p=>p!=="");d(h)}})}default:return null}}function Yl({section:e,values:n,errors:i,onChange:r}){return a("section",{class:"ac-section","aria-labelledby":`section-${Te(e.path)}`,children:[a("h2",{class:"ac-section__title",id:`section-${Te(e.path)}`,children:e.label}),e.description!==void 0?a("p",{class:"ac-section__description",children:e.description}):null,a("div",{class:"ac-section__fields",children:e.fields.map(t=>a("div",{children:zl(t,n,i,r)},Te(t.path)))})]})}function Kl(e){const n=Hl(e.schema),i=e.errors??{};return a("form",{class:"ac-form",onSubmit:r=>r.preventDefault(),children:[n.map(r=>a(Yl,{section:r,values:e.values,errors:i,onChange:e.onChange},Te(r.path))),e.actions!==void 0?a("div",{class:"ac-form__actions",children:e.actions}):null]})}function ql(e){const[n]=Nr(()=>`${e.id}-list`);return a(oe,{id:e.id,label:e.label,description:e.description,error:e.error,children:[a("input",{class:"ac-input",type:"text",id:e.id,name:e.name,value:e.value,placeholder:e.placeholder,list:n,"aria-invalid":e.error!==void 0?"true":void 0,onInput:i=>e.onChange(i.currentTarget.value)}),a("datalist",{id:n,children:e.suggestions.map(i=>a("option",{value:i},i))})]})}const Gl=["developer","reviewer","designer","product-manager","ops","qa","maintainer"],Vl=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function Ki(){return new Date().toISOString().slice(0,10)}function se(e,n){return e?.[n]}function Jl({value:e,onChange:n,errors:i,hideRole:r,hideIdentityBasics:t}){const[l,o]=Nr(""),c="umd-role-suggestions";function d(v){n({...e,...v,last_updated:Ki()})}const u=e.role.filter(v=>v.trim()!=="");function f(v){const g=v.trim();if(g===""||u.includes(g)){o("");return}d({role:[...u,g]}),o("")}function s(v){u.length<=1||d({role:u.filter(g=>g!==v)})}function h(v){const g={...e,last_updated:Ki()};v===""?delete g.notes:g.notes=v,n(g)}const p=Gl.filter(v=>!u.includes(v));return a("div",{class:"ac-user-md-form",children:[t?null:a(Kr,{id:"umd-name",name:"identity.name",label:"Name",description:'How the agent addresses you in chat (e.g. "Matze", "Sarah"). Required.',value:e.identity.name,error:se(i,"identity.name"),onChange:v=>d({identity:{...e.identity,name:v}})}),t?null:a(ql,{id:"umd-language",name:"language",label:"Language",description:"BCP-47 tag the agent mirrors in replies (e.g. 'de', 'en', 'en-US').",value:e.language,suggestions:Vl,error:se(i,"language"),onChange:v=>d({language:v})}),r?null:a(oe,{id:"umd-role-input",label:"Roles",description:"One or more roles. Seeded suggestions are non-binding — type anything and press Enter.",error:se(i,"role"),children:[a("ul",{class:"ac-chip-list","data-testid":"umd-role-list",children:u.map(v=>a("li",{class:"ac-chip",children:[a("span",{children:v}),a("button",{type:"button",class:"ac-chip__remove","aria-label":`Remove ${v}`,disabled:u.length<=1,onClick:()=>s(v),children:"×"})]},v))}),a("div",{class:"ac-role-add",children:[a("input",{class:"ac-input",type:"text",id:"umd-role-input",name:"role-add",list:c,placeholder:"Add a role and press Enter",value:l,onInput:v=>o(v.currentTarget.value),onKeyDown:v=>{(v.key==="Enter"||v.key===",")&&(v.preventDefault(),f(l))}}),a("datalist",{id:c,children:p.map(v=>a("option",{value:v},v))}),a("button",{type:"button",class:"ac-button",onClick:()=>f(l),children:"Add role"})]})]}),a(qr,{id:"umd-pace",name:"style.pace",label:"Pace",value:e.style.pace,error:se(i,"style.pace"),options:[{value:"pragmatic",label:"Pragmatic"},{value:"thorough",label:"Thorough"},{value:"rapid",label:"Rapid"}],onChange:v=>d({style:{...e.style,pace:v}})}),a(on,{id:"umd-voice",name:"voice_sample",label:"Voice sample",description:"One to three sentences in your own style. The agent uses it as a tone anchor.",rows:4,value:e.voice_sample,error:se(i,"voice_sample"),onChange:v=>d({voice_sample:v})}),a(on,{id:"umd-notes",name:"notes",label:"Notes",description:"Optional free-form prose the agent remembers across sessions.",rows:6,value:e.notes??"",error:se(i,"notes"),onChange:h})]})}function Jr(){return{version:1,identity:{name:""},language:"en",role:[""],style:{pace:"pragmatic"},voice_sample:"",last_updated:"1970-01-01"}}function qi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ze(e,n){return typeof e=="string"?e:n}function Ql(e){return e==="thorough"||e==="rapid"?e:"pragmatic"}function Zl(e){if(!Array.isArray(e))return[""];const n=e.filter(i=>typeof i=="string");return n.length===0?[""]:n}function Xl(e){if(typeof e=="string")return e===""?void 0:e}function Gi(e){const n=Jr(),i=qi(e.identity)?e.identity:{},r=qi(e.style)?e.style:{},t=Xl(e.notes),l={version:1,identity:{name:ze(i.name,n.identity.name)},language:ze(e.language,n.language),role:Zl(e.role),style:{pace:Ql(r.pace)},voice_sample:ze(e.voice_sample,n.voice_sample),last_updated:ze(e.last_updated,n.last_updated)};return t!==void 0&&(l.notes=t),l}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function Qr(e){return typeof e>"u"||e===null}function ea(e){return typeof e=="object"&&e!==null}function na(e){return Array.isArray(e)?e:Qr(e)?[]:[e]}function ia(e,n){var i,r,t,l;if(n)for(l=Object.keys(n),i=0,r=l.length;i<r;i+=1)t=l[i],e[t]=n[t];return e}function ra(e,n){var i="",r;for(r=0;r<n;r+=1)i+=e;return i}function ta(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var la=Qr,aa=ea,oa=na,ca=ra,sa=ta,ua=ia,I={isNothing:la,isObject:aa,toArray:oa,repeat:ca,isNegativeZero:sa,extend:ua};function Zr(e,n){var i="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`
|
|
9
|
-
|
|
10
|
-
`+e.mark.snippet),r+" "+i):r}function Pe(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Zr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Pe.prototype=Object.create(Error.prototype);Pe.prototype.constructor=Pe;Pe.prototype.toString=function(n){return this.name+": "+Zr(this,n)};var F=Pe;function Dn(e,n,i,r,t){var l="",o="",c=Math.floor(t/2)-1;return r-n>c&&(l=" ... ",n=r-c+l.length),i-r>c&&(o=" ...",i=r+c-o.length),{str:l+e.slice(n,i).replace(/\t/g,"→")+o,pos:r-n+l.length}}function jn(e,n){return I.repeat(" ",n-e.length)+e}function da(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\r?\n|\r|\0/g,r=[0],t=[],l,o=-1;l=i.exec(e.buffer);)t.push(l.index),r.push(l.index+l[0].length),e.position<=l.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var c="",d,u,f=Math.min(e.line+n.linesAfter,t.length).toString().length,s=n.maxLength-(n.indent+f+3);for(d=1;d<=n.linesBefore&&!(o-d<0);d++)u=Dn(e.buffer,r[o-d],t[o-d],e.position-(r[o]-r[o-d]),s),c=I.repeat(" ",n.indent)+jn((e.line-d+1).toString(),f)+" | "+u.str+`
|
|
11
|
-
`+c;for(u=Dn(e.buffer,r[o],t[o],e.position,s),c+=I.repeat(" ",n.indent)+jn((e.line+1).toString(),f)+" | "+u.str+`
|
|
12
|
-
`,c+=I.repeat("-",n.indent+f+3+u.pos)+`^
|
|
13
|
-
`,d=1;d<=n.linesAfter&&!(o+d>=t.length);d++)u=Dn(e.buffer,r[o+d],t[o+d],e.position-(r[o]-r[o+d]),s),c+=I.repeat(" ",n.indent)+jn((e.line+d+1).toString(),f)+" | "+u.str+`
|
|
14
|
-
`;return c.replace(/\n$/,"")}var fa=da,pa=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ha=["scalar","sequence","mapping"];function va(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(r){n[String(r)]=i})}),n}function _a(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(pa.indexOf(i)===-1)throw new F('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=va(n.styleAliases||null),ha.indexOf(this.kind)===-1)throw new F('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var O=_a;function Vi(e,n){var i=[];return e[n].forEach(function(r){var t=i.length;i.forEach(function(l,o){l.tag===r.tag&&l.kind===r.kind&&l.multi===r.multi&&(t=o)}),i[t]=r}),i}function ma(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(r);return e}function Zn(e){return this.extend(e)}Zn.prototype.extend=function(n){var i=[],r=[];if(n instanceof O)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new F("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(l){if(!(l instanceof O))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new F("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new F("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(l){if(!(l instanceof O))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var t=Object.create(Zn.prototype);return t.implicit=(this.implicit||[]).concat(i),t.explicit=(this.explicit||[]).concat(r),t.compiledImplicit=Vi(t,"implicit"),t.compiledExplicit=Vi(t,"explicit"),t.compiledTypeMap=ma(t.compiledImplicit,t.compiledExplicit),t};var Xr=Zn,et=new O("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),nt=new O("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),it=new O("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),rt=new Xr({explicit:[et,nt,it]});function ga(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function ya(){return null}function ba(e){return e===null}var tt=new O("tag:yaml.org,2002:null",{kind:"scalar",resolve:ga,construct:ya,predicate:ba,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function ka(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function wa(e){return e==="true"||e==="True"||e==="TRUE"}function xa(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var lt=new O("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ka,construct:wa,predicate:xa,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Aa(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Sa(e){return 48<=e&&e<=55}function Ca(e){return 48<=e&&e<=57}function Ta(e){if(e===null)return!1;var n=e.length,i=0,r=!1,t;if(!n)return!1;if(t=e[i],(t==="-"||t==="+")&&(t=e[++i]),t==="0"){if(i+1===n)return!0;if(t=e[++i],t==="b"){for(i++;i<n;i++)if(t=e[i],t!=="_"){if(t!=="0"&&t!=="1")return!1;r=!0}return r&&t!=="_"}if(t==="x"){for(i++;i<n;i++)if(t=e[i],t!=="_"){if(!Aa(e.charCodeAt(i)))return!1;r=!0}return r&&t!=="_"}if(t==="o"){for(i++;i<n;i++)if(t=e[i],t!=="_"){if(!Sa(e.charCodeAt(i)))return!1;r=!0}return r&&t!=="_"}}if(t==="_")return!1;for(;i<n;i++)if(t=e[i],t!=="_"){if(!Ca(e.charCodeAt(i)))return!1;r=!0}return!(!r||t==="_")}function Ea(e){var n=e,i=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(i=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function Ia(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!I.isNegativeZero(e)}var at=new O("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ta,construct:Ea,predicate:Ia,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Oa=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Na(e){return!(e===null||!Oa.test(e)||e[e.length-1]==="_")}function La(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var Fa=/^[-+]?[0-9]+e/;function Pa(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(I.isNegativeZero(e))return"-0.0";return i=e.toString(10),Fa.test(i)?i.replace("e",".e"):i}function Ra(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||I.isNegativeZero(e))}var ot=new O("tag:yaml.org,2002:float",{kind:"scalar",resolve:Na,construct:La,predicate:Ra,represent:Pa,defaultStyle:"lowercase"}),ct=rt.extend({implicit:[tt,lt,at,ot]}),st=ct,ut=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),dt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function $a(e){return e===null?!1:ut.exec(e)!==null||dt.exec(e)!==null}function Ma(e){var n,i,r,t,l,o,c,d=0,u=null,f,s,h;if(n=ut.exec(e),n===null&&(n=dt.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],r=+n[2]-1,t=+n[3],!n[4])return new Date(Date.UTC(i,r,t));if(l=+n[4],o=+n[5],c=+n[6],n[7]){for(d=n[7].slice(0,3);d.length<3;)d+="0";d=+d}return n[9]&&(f=+n[10],s=+(n[11]||0),u=(f*60+s)*6e4,n[9]==="-"&&(u=-u)),h=new Date(Date.UTC(i,r,t,l,o,c,d)),u&&h.setTime(h.getTime()-u),h}function Da(e){return e.toISOString()}var ft=new O("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:$a,construct:Ma,instanceOf:Date,represent:Da});function ja(e){return e==="<<"||e===null}var pt=new O("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ja}),gi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
15
|
-
\r`;function Ba(e){if(e===null)return!1;var n,i,r=0,t=e.length,l=gi;for(i=0;i<t;i++)if(n=l.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function Ua(e){var n,i,r=e.replace(/[\r\n=]/g,""),t=r.length,l=gi,o=0,c=[];for(n=0;n<t;n++)n%4===0&&n&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|l.indexOf(r.charAt(n));return i=t%4*6,i===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):i===18?(c.push(o>>10&255),c.push(o>>2&255)):i===12&&c.push(o>>4&255),new Uint8Array(c)}function Ha(e){var n="",i=0,r,t,l=e.length,o=gi;for(r=0;r<l;r++)r%3===0&&r&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]),i=(i<<8)+e[r];return t=l%3,t===0?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]):t===2?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):t===1&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function Wa(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ht=new O("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ba,construct:Ua,predicate:Wa,represent:Ha}),za=Object.prototype.hasOwnProperty,Ya=Object.prototype.toString;function Ka(e){if(e===null)return!0;var n=[],i,r,t,l,o,c=e;for(i=0,r=c.length;i<r;i+=1){if(t=c[i],o=!1,Ya.call(t)!=="[object Object]")return!1;for(l in t)if(za.call(t,l))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(l)===-1)n.push(l);else return!1}return!0}function qa(e){return e!==null?e:[]}var vt=new O("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ka,construct:qa}),Ga=Object.prototype.toString;function Va(e){if(e===null)return!0;var n,i,r,t,l,o=e;for(l=new Array(o.length),n=0,i=o.length;n<i;n+=1){if(r=o[n],Ga.call(r)!=="[object Object]"||(t=Object.keys(r),t.length!==1))return!1;l[n]=[t[0],r[t[0]]]}return!0}function Ja(e){if(e===null)return[];var n,i,r,t,l,o=e;for(l=new Array(o.length),n=0,i=o.length;n<i;n+=1)r=o[n],t=Object.keys(r),l[n]=[t[0],r[t[0]]];return l}var _t=new O("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Va,construct:Ja}),Qa=Object.prototype.hasOwnProperty;function Za(e){if(e===null)return!0;var n,i=e;for(n in i)if(Qa.call(i,n)&&i[n]!==null)return!1;return!0}function Xa(e){return e!==null?e:{}}var mt=new O("tag:yaml.org,2002:set",{kind:"mapping",resolve:Za,construct:Xa}),yi=st.extend({implicit:[ft,pt],explicit:[ht,vt,_t,mt]}),J=Object.prototype.hasOwnProperty,cn=1,gt=2,yt=3,sn=4,Bn=1,eo=2,Ji=3,no=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,io=/[\x85\u2028\u2029]/,ro=/[,\[\]\{\}]/,bt=/^(?:!|!!|![a-z\-]+!)$/i,kt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Qi(e){return Object.prototype.toString.call(e)}function B(e){return e===10||e===13}function ee(e){return e===9||e===32}function P(e){return e===9||e===32||e===10||e===13}function pe(e){return e===44||e===91||e===93||e===123||e===125}function to(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function lo(e){return e===120?2:e===117?4:e===85?8:0}function ao(e){return 48<=e&&e<=57?e-48:-1}function Zi(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
16
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function oo(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function wt(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var xt=new Array(256),At=new Array(256);for(var ue=0;ue<256;ue++)xt[ue]=Zi(ue)?1:0,At[ue]=Zi(ue);function co(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||yi,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function St(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=fa(i),new F(n,i)}function y(e,n){throw St(e,n)}function un(e,n){e.onWarning&&e.onWarning.call(null,St(e,n))}var Xi={YAML:function(n,i,r){var t,l,o;n.version!==null&&y(n,"duplication of %YAML directive"),r.length!==1&&y(n,"YAML directive accepts exactly one argument"),t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),t===null&&y(n,"ill-formed argument of the YAML directive"),l=parseInt(t[1],10),o=parseInt(t[2],10),l!==1&&y(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&un(n,"unsupported YAML version of the document")},TAG:function(n,i,r){var t,l;r.length!==2&&y(n,"TAG directive accepts exactly two arguments"),t=r[0],l=r[1],bt.test(t)||y(n,"ill-formed tag handle (first argument) of the TAG directive"),J.call(n.tagMap,t)&&y(n,'there is a previously declared suffix for "'+t+'" tag handle'),kt.test(l)||y(n,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{y(n,"tag prefix is malformed: "+l)}n.tagMap[t]=l}};function V(e,n,i,r){var t,l,o,c;if(n<i){if(c=e.input.slice(n,i),r)for(t=0,l=c.length;t<l;t+=1)o=c.charCodeAt(t),o===9||32<=o&&o<=1114111||y(e,"expected valid JSON character");else no.test(c)&&y(e,"the stream contains non-printable characters");e.result+=c}}function er(e,n,i,r){var t,l,o,c;for(I.isObject(i)||y(e,"cannot merge mappings; the provided source object is unacceptable"),t=Object.keys(i),o=0,c=t.length;o<c;o+=1)l=t[o],J.call(n,l)||(wt(n,l,i[l]),r[l]=!0)}function he(e,n,i,r,t,l,o,c,d){var u,f;if(Array.isArray(t))for(t=Array.prototype.slice.call(t),u=0,f=t.length;u<f;u+=1)Array.isArray(t[u])&&y(e,"nested arrays are not supported inside keys"),typeof t=="object"&&Qi(t[u])==="[object Object]"&&(t[u]="[object Object]");if(typeof t=="object"&&Qi(t)==="[object Object]"&&(t="[object Object]"),t=String(t),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(u=0,f=l.length;u<f;u+=1)er(e,n,l[u],i);else er(e,n,l,i);else!e.json&&!J.call(i,t)&&J.call(n,t)&&(e.line=o||e.line,e.lineStart=c||e.lineStart,e.position=d||e.position,y(e,"duplicated mapping key")),wt(n,t,l),delete i[t];return n}function bi(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function T(e,n,i){for(var r=0,t=e.input.charCodeAt(e.position);t!==0;){for(;ee(t);)t===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),t=e.input.charCodeAt(++e.position);if(n&&t===35)do t=e.input.charCodeAt(++e.position);while(t!==10&&t!==13&&t!==0);if(B(t))for(bi(e),t=e.input.charCodeAt(e.position),r++,e.lineIndent=0;t===32;)e.lineIndent++,t=e.input.charCodeAt(++e.position);else break}return i!==-1&&r!==0&&e.lineIndent<i&&un(e,"deficient indentation"),r}function In(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||P(i)))}function ki(e,n){n===1?e.result+=" ":n>1&&(e.result+=I.repeat(`
|
|
17
|
-
`,n-1))}function so(e,n,i){var r,t,l,o,c,d,u,f,s=e.kind,h=e.result,p;if(p=e.input.charCodeAt(e.position),P(p)||pe(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(t=e.input.charCodeAt(e.position+1),P(t)||i&&pe(t)))return!1;for(e.kind="scalar",e.result="",l=o=e.position,c=!1;p!==0;){if(p===58){if(t=e.input.charCodeAt(e.position+1),P(t)||i&&pe(t))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),P(r))break}else{if(e.position===e.lineStart&&In(e)||i&&pe(p))break;if(B(p))if(d=e.line,u=e.lineStart,f=e.lineIndent,T(e,!1,-1),e.lineIndent>=n){c=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=d,e.lineStart=u,e.lineIndent=f;break}}c&&(V(e,l,o,!1),ki(e,e.line-d),l=o=e.position,c=!1),ee(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return V(e,l,o,!1),e.result?!0:(e.kind=s,e.result=h,!1)}function uo(e,n){var i,r,t;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=t=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(V(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)r=e.position,e.position++,t=e.position;else return!0;else B(i)?(V(e,r,t,!0),ki(e,T(e,!1,n)),r=t=e.position):e.position===e.lineStart&&In(e)?y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,t=e.position);y(e,"unexpected end of the stream within a single quoted scalar")}function fo(e,n){var i,r,t,l,o,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return V(e,i,e.position,!0),e.position++,!0;if(c===92){if(V(e,i,e.position,!0),c=e.input.charCodeAt(++e.position),B(c))T(e,!1,n);else if(c<256&&xt[c])e.result+=At[c],e.position++;else if((o=lo(c))>0){for(t=o,l=0;t>0;t--)c=e.input.charCodeAt(++e.position),(o=to(c))>=0?l=(l<<4)+o:y(e,"expected hexadecimal character");e.result+=oo(l),e.position++}else y(e,"unknown escape sequence");i=r=e.position}else B(c)?(V(e,i,r,!0),ki(e,T(e,!1,n)),i=r=e.position):e.position===e.lineStart&&In(e)?y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}y(e,"unexpected end of the stream within a double quoted scalar")}function po(e,n){var i=!0,r,t,l,o=e.tag,c,d=e.anchor,u,f,s,h,p,v=Object.create(null),g,b,k,m;if(m=e.input.charCodeAt(e.position),m===91)f=93,p=!1,c=[];else if(m===123)f=125,p=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),m=e.input.charCodeAt(++e.position);m!==0;){if(T(e,!0,n),m=e.input.charCodeAt(e.position),m===f)return e.position++,e.tag=o,e.anchor=d,e.kind=p?"mapping":"sequence",e.result=c,!0;i?m===44&&y(e,"expected the node content, but found ','"):y(e,"missed comma between flow collection entries"),b=g=k=null,s=h=!1,m===63&&(u=e.input.charCodeAt(e.position+1),P(u)&&(s=h=!0,e.position++,T(e,!0,n))),r=e.line,t=e.lineStart,l=e.position,ge(e,n,cn,!1,!0),b=e.tag,g=e.result,T(e,!0,n),m=e.input.charCodeAt(e.position),(h||e.line===r)&&m===58&&(s=!0,m=e.input.charCodeAt(++e.position),T(e,!0,n),ge(e,n,cn,!1,!0),k=e.result),p?he(e,c,v,b,g,k,r,t,l):s?c.push(he(e,null,v,b,g,k,r,t,l)):c.push(g),T(e,!0,n),m=e.input.charCodeAt(e.position),m===44?(i=!0,m=e.input.charCodeAt(++e.position)):i=!1}y(e,"unexpected end of the stream within a flow collection")}function ho(e,n){var i,r,t=Bn,l=!1,o=!1,c=n,d=0,u=!1,f,s;if(s=e.input.charCodeAt(e.position),s===124)r=!1;else if(s===62)r=!0;else return!1;for(e.kind="scalar",e.result="";s!==0;)if(s=e.input.charCodeAt(++e.position),s===43||s===45)Bn===t?t=s===43?Ji:eo:y(e,"repeat of a chomping mode identifier");else if((f=ao(s))>=0)f===0?y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?y(e,"repeat of an indentation width identifier"):(c=n+f-1,o=!0);else break;if(ee(s)){do s=e.input.charCodeAt(++e.position);while(ee(s));if(s===35)do s=e.input.charCodeAt(++e.position);while(!B(s)&&s!==0)}for(;s!==0;){for(bi(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!o||e.lineIndent<c)&&s===32;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>c&&(c=e.lineIndent),B(s)){d++;continue}if(e.lineIndent<c){t===Ji?e.result+=I.repeat(`
|
|
18
|
-
`,l?1+d:d):t===Bn&&l&&(e.result+=`
|
|
19
|
-
`);break}for(r?ee(s)?(u=!0,e.result+=I.repeat(`
|
|
20
|
-
`,l?1+d:d)):u?(u=!1,e.result+=I.repeat(`
|
|
21
|
-
`,d+1)):d===0?l&&(e.result+=" "):e.result+=I.repeat(`
|
|
22
|
-
`,d):e.result+=I.repeat(`
|
|
23
|
-
`,l?1+d:d),l=!0,o=!0,d=0,i=e.position;!B(s)&&s!==0;)s=e.input.charCodeAt(++e.position);V(e,i,e.position,!1)}return!0}function nr(e,n){var i,r=e.tag,t=e.anchor,l=[],o,c=!1,d;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),d=e.input.charCodeAt(e.position);d!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,y(e,"tab characters must not be used in indentation")),!(d!==45||(o=e.input.charCodeAt(e.position+1),!P(o))));){if(c=!0,e.position++,T(e,!0,-1)&&e.lineIndent<=n){l.push(null),d=e.input.charCodeAt(e.position);continue}if(i=e.line,ge(e,n,yt,!1,!0),l.push(e.result),T(e,!0,-1),d=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&d!==0)y(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return c?(e.tag=r,e.anchor=t,e.kind="sequence",e.result=l,!0):!1}function vo(e,n,i){var r,t,l,o,c,d,u=e.tag,f=e.anchor,s={},h=Object.create(null),p=null,v=null,g=null,b=!1,k=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),m=e.input.charCodeAt(e.position);m!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,y(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),l=e.line,(m===63||m===58)&&P(r))m===63?(b&&(he(e,s,h,p,v,null,o,c,d),p=v=g=null),k=!0,b=!0,t=!0):b?(b=!1,t=!0):y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,m=r;else{if(o=e.line,c=e.lineStart,d=e.position,!ge(e,i,gt,!1,!0))break;if(e.line===l){for(m=e.input.charCodeAt(e.position);ee(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),P(m)||y(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(he(e,s,h,p,v,null,o,c,d),p=v=g=null),k=!0,b=!1,t=!1,p=e.tag,v=e.result;else if(k)y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=f,!0}else if(k)y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=f,!0}if((e.line===l||e.lineIndent>n)&&(b&&(o=e.line,c=e.lineStart,d=e.position),ge(e,n,sn,!0,t)&&(b?v=e.result:g=e.result),b||(he(e,s,h,p,v,g,o,c,d),p=v=g=null),T(e,!0,-1),m=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>n)&&m!==0)y(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return b&&he(e,s,h,p,v,null,o,c,d),k&&(e.tag=u,e.anchor=f,e.kind="mapping",e.result=s),k}function _o(e){var n,i=!1,r=!1,t,l,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&y(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(i=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,t="!!",o=e.input.charCodeAt(++e.position)):t="!",n=e.position,i){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(l=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):y(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!P(o);)o===33&&(r?y(e,"tag suffix cannot contain exclamation marks"):(t=e.input.slice(n-1,e.position+1),bt.test(t)||y(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);l=e.input.slice(n,e.position),ro.test(l)&&y(e,"tag suffix cannot contain flow indicator characters")}l&&!kt.test(l)&&y(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{y(e,"tag name is malformed: "+l)}return i?e.tag=l:J.call(e.tagMap,t)?e.tag=e.tagMap[t]+l:t==="!"?e.tag="!"+l:t==="!!"?e.tag="tag:yaml.org,2002:"+l:y(e,'undeclared tag handle "'+t+'"'),!0}function mo(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&y(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!P(i)&&!pe(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function go(e){var n,i,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!P(r)&&!pe(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&y(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),J.call(e.anchorMap,i)||y(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],T(e,!0,-1),!0}function ge(e,n,i,r,t){var l,o,c,d=1,u=!1,f=!1,s,h,p,v,g,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=o=c=sn===i||yt===i,r&&T(e,!0,-1)&&(u=!0,e.lineIndent>n?d=1:e.lineIndent===n?d=0:e.lineIndent<n&&(d=-1)),d===1)for(;_o(e)||mo(e);)T(e,!0,-1)?(u=!0,c=l,e.lineIndent>n?d=1:e.lineIndent===n?d=0:e.lineIndent<n&&(d=-1)):c=!1;if(c&&(c=u||t),(d===1||sn===i)&&(cn===i||gt===i?g=n:g=n+1,b=e.position-e.lineStart,d===1?c&&(nr(e,b)||vo(e,b,g))||po(e,g)?f=!0:(o&&ho(e,g)||uo(e,g)||fo(e,g)?f=!0:go(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&y(e,"alias node should not have any properties")):so(e,g,cn===i)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):d===0&&(f=c&&nr(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),s=0,h=e.implicitTypes.length;s<h;s+=1)if(v=e.implicitTypes[s],v.resolve(e.result)){e.result=v.construct(e.result),e.tag=v.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(J.call(e.typeMap[e.kind||"fallback"],e.tag))v=e.typeMap[e.kind||"fallback"][e.tag];else for(v=null,p=e.typeMap.multi[e.kind||"fallback"],s=0,h=p.length;s<h;s+=1)if(e.tag.slice(0,p[s].tag.length)===p[s].tag){v=p[s];break}v||y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&v.kind!==e.kind&&y(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+v.kind+'", not "'+e.kind+'"'),v.resolve(e.result,e.tag)?(e.result=v.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):y(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function yo(e){var n=e.position,i,r,t,l=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(T(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(l=!0,o=e.input.charCodeAt(++e.position),i=e.position;o!==0&&!P(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(i,e.position),t=[],r.length<1&&y(e,"directive name must not be less than one character in length");o!==0;){for(;ee(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!B(o));break}if(B(o))break;for(i=e.position;o!==0&&!P(o);)o=e.input.charCodeAt(++e.position);t.push(e.input.slice(i,e.position))}o!==0&&bi(e),J.call(Xi,r)?Xi[r](e,r,t):un(e,'unknown document directive "'+r+'"')}if(T(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,T(e,!0,-1)):l&&y(e,"directives end mark is expected"),ge(e,e.lineIndent-1,sn,!1,!0),T(e,!0,-1),e.checkLineBreaks&&io.test(e.input.slice(n,e.position))&&un(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&In(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,T(e,!0,-1));return}if(e.position<e.length-1)y(e,"end of the stream or a document separator is expected");else return}function Ct(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
24
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new co(e,n),r=e.indexOf("\0");for(r!==-1&&(i.position=r,y(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)yo(i);return i.documents}function bo(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var r=Ct(e,i);if(typeof n!="function")return r;for(var t=0,l=r.length;t<l;t+=1)n(r[t])}function ko(e,n){var i=Ct(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new F("expected a single document in the stream, but found more")}}var wo=bo,xo=ko,Tt={loadAll:wo,load:xo},Et=Object.prototype.toString,It=Object.prototype.hasOwnProperty,wi=65279,Ao=9,Re=10,So=13,Co=32,To=33,Eo=34,Xn=35,Io=37,Oo=38,No=39,Lo=42,Ot=44,Fo=45,dn=58,Po=61,Ro=62,$o=63,Mo=64,Nt=91,Lt=93,Do=96,Ft=123,jo=124,Pt=125,L={};L[0]="\\0";L[7]="\\a";L[8]="\\b";L[9]="\\t";L[10]="\\n";L[11]="\\v";L[12]="\\f";L[13]="\\r";L[27]="\\e";L[34]='\\"';L[92]="\\\\";L[133]="\\N";L[160]="\\_";L[8232]="\\L";L[8233]="\\P";var Bo=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Uo=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ho(e,n){var i,r,t,l,o,c,d;if(n===null)return{};for(i={},r=Object.keys(n),t=0,l=r.length;t<l;t+=1)o=r[t],c=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),d=e.compiledTypeMap.fallback[o],d&&It.call(d.styleAliases,c)&&(c=d.styleAliases[c]),i[o]=c;return i}function Wo(e){var n,i,r;if(n=e.toString(16).toUpperCase(),e<=255)i="x",r=2;else if(e<=65535)i="u",r=4;else if(e<=4294967295)i="U",r=8;else throw new F("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+I.repeat("0",r-n.length)+n}var zo=1,$e=2;function Yo(e){this.schema=e.schema||yi,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=I.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Ho(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?$e:zo,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function ir(e,n){for(var i=I.repeat(" ",n),r=0,t=-1,l="",o,c=e.length;r<c;)t=e.indexOf(`
|
|
25
|
-
`,r),t===-1?(o=e.slice(r),r=c):(o=e.slice(r,t+1),r=t+1),o.length&&o!==`
|
|
26
|
-
`&&(l+=i),l+=o;return l}function ei(e,n){return`
|
|
27
|
-
`+I.repeat(" ",e.indent*n)}function Ko(e,n){var i,r,t;for(i=0,r=e.implicitTypes.length;i<r;i+=1)if(t=e.implicitTypes[i],t.resolve(n))return!0;return!1}function fn(e){return e===Co||e===Ao}function Me(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==wi||65536<=e&&e<=1114111}function rr(e){return Me(e)&&e!==wi&&e!==So&&e!==Re}function tr(e,n,i){var r=rr(e),t=r&&!fn(e);return(i?r:r&&e!==Ot&&e!==Nt&&e!==Lt&&e!==Ft&&e!==Pt)&&e!==Xn&&!(n===dn&&!t)||rr(n)&&!fn(n)&&e===Xn||n===dn&&t}function qo(e){return Me(e)&&e!==wi&&!fn(e)&&e!==Fo&&e!==$o&&e!==dn&&e!==Ot&&e!==Nt&&e!==Lt&&e!==Ft&&e!==Pt&&e!==Xn&&e!==Oo&&e!==Lo&&e!==To&&e!==jo&&e!==Po&&e!==Ro&&e!==No&&e!==Eo&&e!==Io&&e!==Mo&&e!==Do}function Go(e){return!fn(e)&&e!==dn}function we(e,n){var i=e.charCodeAt(n),r;return i>=55296&&i<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}function Rt(e){var n=/^\n* /;return n.test(e)}var $t=1,ni=2,Mt=3,Dt=4,de=5;function Vo(e,n,i,r,t,l,o,c){var d,u=0,f=null,s=!1,h=!1,p=r!==-1,v=-1,g=qo(we(e,0))&&Go(we(e,e.length-1));if(n||o)for(d=0;d<e.length;u>=65536?d+=2:d++){if(u=we(e,d),!Me(u))return de;g=g&&tr(u,f,c),f=u}else{for(d=0;d<e.length;u>=65536?d+=2:d++){if(u=we(e,d),u===Re)s=!0,p&&(h=h||d-v-1>r&&e[v+1]!==" ",v=d);else if(!Me(u))return de;g=g&&tr(u,f,c),f=u}h=h||p&&d-v-1>r&&e[v+1]!==" "}return!s&&!h?g&&!o&&!t(e)?$t:l===$e?de:ni:i>9&&Rt(e)?de:o?l===$e?de:ni:h?Dt:Mt}function Jo(e,n,i,r,t){e.dump=function(){if(n.length===0)return e.quotingType===$e?'""':"''";if(!e.noCompatMode&&(Bo.indexOf(n)!==-1||Uo.test(n)))return e.quotingType===$e?'"'+n+'"':"'"+n+"'";var l=e.indent*Math.max(1,i),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),c=r||e.flowLevel>-1&&i>=e.flowLevel;function d(u){return Ko(e,u)}switch(Vo(n,c,e.indent,o,d,e.quotingType,e.forceQuotes&&!r,t)){case $t:return n;case ni:return"'"+n.replace(/'/g,"''")+"'";case Mt:return"|"+lr(n,e.indent)+ar(ir(n,l));case Dt:return">"+lr(n,e.indent)+ar(ir(Qo(n,o),l));case de:return'"'+Zo(n)+'"';default:throw new F("impossible error: invalid scalar style")}}()}function lr(e,n){var i=Rt(e)?String(n):"",r=e[e.length-1]===`
|
|
28
|
-
`,t=r&&(e[e.length-2]===`
|
|
29
|
-
`||e===`
|
|
30
|
-
`),l=t?"+":r?"":"-";return i+l+`
|
|
31
|
-
`}function ar(e){return e[e.length-1]===`
|
|
32
|
-
`?e.slice(0,-1):e}function Qo(e,n){for(var i=/(\n+)([^\n]*)/g,r=function(){var u=e.indexOf(`
|
|
33
|
-
`);return u=u!==-1?u:e.length,i.lastIndex=u,or(e.slice(0,u),n)}(),t=e[0]===`
|
|
34
|
-
`||e[0]===" ",l,o;o=i.exec(e);){var c=o[1],d=o[2];l=d[0]===" ",r+=c+(!t&&!l&&d!==""?`
|
|
35
|
-
`:"")+or(d,n),t=l}return r}function or(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,r,t=0,l,o=0,c=0,d="";r=i.exec(e);)c=r.index,c-t>n&&(l=o>t?o:c,d+=`
|
|
36
|
-
`+e.slice(t,l),t=l+1),o=c;return d+=`
|
|
37
|
-
`,e.length-t>n&&o>t?d+=e.slice(t,o)+`
|
|
38
|
-
`+e.slice(o+1):d+=e.slice(t),d.slice(1)}function Zo(e){for(var n="",i=0,r,t=0;t<e.length;i>=65536?t+=2:t++)i=we(e,t),r=L[i],!r&&Me(i)?(n+=e[t],i>=65536&&(n+=e[t+1])):n+=r||Wo(i);return n}function Xo(e,n,i){var r="",t=e.tag,l,o,c;for(l=0,o=i.length;l<o;l+=1)c=i[l],e.replacer&&(c=e.replacer.call(i,String(l),c)),(K(e,n,c,!1,!1)||typeof c>"u"&&K(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=t,e.dump="["+r+"]"}function cr(e,n,i,r){var t="",l=e.tag,o,c,d;for(o=0,c=i.length;o<c;o+=1)d=i[o],e.replacer&&(d=e.replacer.call(i,String(o),d)),(K(e,n+1,d,!0,!0,!1,!0)||typeof d>"u"&&K(e,n+1,null,!0,!0,!1,!0))&&((!r||t!=="")&&(t+=ei(e,n)),e.dump&&Re===e.dump.charCodeAt(0)?t+="-":t+="- ",t+=e.dump);e.tag=l,e.dump=t||"[]"}function ec(e,n,i){var r="",t=e.tag,l=Object.keys(i),o,c,d,u,f;for(o=0,c=l.length;o<c;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),d=l[o],u=i[d],e.replacer&&(u=e.replacer.call(i,d,u)),K(e,n,d,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),K(e,n,u,!1,!1)&&(f+=e.dump,r+=f));e.tag=t,e.dump="{"+r+"}"}function nc(e,n,i,r){var t="",l=e.tag,o=Object.keys(i),c,d,u,f,s,h;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new F("sortKeys must be a boolean or a function");for(c=0,d=o.length;c<d;c+=1)h="",(!r||t!=="")&&(h+=ei(e,n)),u=o[c],f=i[u],e.replacer&&(f=e.replacer.call(i,u,f)),K(e,n+1,u,!0,!0,!0)&&(s=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,s&&(e.dump&&Re===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,s&&(h+=ei(e,n)),K(e,n+1,f,!0,s)&&(e.dump&&Re===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,t+=h));e.tag=l,e.dump=t||"{}"}function sr(e,n,i){var r,t,l,o,c,d;for(t=i?e.explicitTypes:e.implicitTypes,l=0,o=t.length;l<o;l+=1)if(c=t[l],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof n=="object"&&n instanceof c.instanceOf)&&(!c.predicate||c.predicate(n))){if(i?c.multi&&c.representName?e.tag=c.representName(n):e.tag=c.tag:e.tag="?",c.represent){if(d=e.styleMap[c.tag]||c.defaultStyle,Et.call(c.represent)==="[object Function]")r=c.represent(n,d);else if(It.call(c.represent,d))r=c.represent[d](n,d);else throw new F("!<"+c.tag+'> tag resolver accepts not "'+d+'" style');e.dump=r}return!0}return!1}function K(e,n,i,r,t,l,o){e.tag=null,e.dump=i,sr(e,i,!1)||sr(e,i,!0);var c=Et.call(e.dump),d=r,u;r&&(r=e.flowLevel<0||e.flowLevel>n);var f=c==="[object Object]"||c==="[object Array]",s,h;if(f&&(s=e.duplicates.indexOf(i),h=s!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&n>0)&&(t=!1),h&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(f&&h&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),c==="[object Object]")r&&Object.keys(e.dump).length!==0?(nc(e,n,e.dump,t),h&&(e.dump="&ref_"+s+e.dump)):(ec(e,n,e.dump),h&&(e.dump="&ref_"+s+" "+e.dump));else if(c==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?cr(e,n-1,e.dump,t):cr(e,n,e.dump,t),h&&(e.dump="&ref_"+s+e.dump)):(Xo(e,n,e.dump),h&&(e.dump="&ref_"+s+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&Jo(e,e.dump,n,l,d);else{if(c==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new F("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function ic(e,n){var i=[],r=[],t,l;for(ii(e,i,r),t=0,l=r.length;t<l;t+=1)n.duplicates.push(i[r[t]]);n.usedDuplicates=new Array(l)}function ii(e,n,i){var r,t,l;if(e!==null&&typeof e=="object")if(t=n.indexOf(e),t!==-1)i.indexOf(t)===-1&&i.push(t);else if(n.push(e),Array.isArray(e))for(t=0,l=e.length;t<l;t+=1)ii(e[t],n,i);else for(r=Object.keys(e),t=0,l=r.length;t<l;t+=1)ii(e[r[t]],n,i)}function rc(e,n){n=n||{};var i=new Yo(n);i.noRefs||ic(e,i);var r=e;return i.replacer&&(r=i.replacer.call({"":r},"",r)),K(i,0,r,!0,!0)?i.dump+`
|
|
39
|
-
`:""}var tc=rc,lc={dump:tc};function xi(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var ac=O,oc=Xr,cc=rt,sc=ct,uc=st,dc=yi,fc=Tt.load,pc=Tt.loadAll,hc=lc.dump,vc=F,_c={binary:ht,float:ot,map:it,null:tt,pairs:_t,set:mt,timestamp:ft,bool:lt,int:at,merge:pt,omap:vt,seq:nt,str:et},mc=xi("safeLoad","load"),gc=xi("safeLoadAll","loadAll"),yc=xi("safeDump","dump"),bc={Type:ac,Schema:oc,FAILSAFE_SCHEMA:cc,JSON_SCHEMA:sc,CORE_SCHEMA:uc,DEFAULT_SCHEMA:dc,load:fc,loadAll:pc,dump:hc,YAMLException:vc,types:_c,safeLoad:mc,safeLoadAll:gc,safeDump:yc};function kc(e){if(e.trim()==="")return{};const i=bc.load(e);if(i==null)return{};if(typeof i!="object"||Array.isArray(i))throw new Error(".agent-user.yml must parse to an object");return i}const ur={id:"welcome",title:"Welcome — who are you?",navLabel:"You",subtitle:"Your name and language. Stored in .agent-user.yml; we pre-fill what we can detect.",kind:"welcome"},wc=[{id:"ai-tools",title:"Which AI tools do you use?",navLabel:"AI tools",subtitle:"Pick the editors and CLIs that should pick up this config. Auto-detect runs first; you can override.",kind:"aiTools"},{id:"roles",title:"What do you work on?",navLabel:"Roles",subtitle:"Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in .agent-user.yml.",kind:"roles"},{id:"packs",title:"Which capability packs do you want?",navLabel:"Packs",subtitle:"Founder-strategy, finance-basic, gtm-sales, ops-people, ai-video — pick zero or more. You can change this later.",kind:"packs"}],dr=[{id:"identity",title:"Editor and tooling",navLabel:"Editor",subtitle:"IDE goes into .agent-settings.yml so the agent opens files in the right tool. rtk presence is auto-detected (see the rtk row). Your name lives in .agent-user.yml (later step).",kind:"form",paths:["personal.ide","personal.open_edited_files"]},{id:"personality",title:"How should the agent behave?",navLabel:"Personality",subtitle:"Autonomy, output verbosity, and PR-comment style.",kind:"form",paths:["personal.autonomy","personal.minimal_output","personal.play_by_play","personal.pr_comment_bot_icon"]},{id:"cost",title:"Cost profile and budgets",navLabel:"Cost",subtitle:"Master switch for which rule tiers load, plus optional spending ceilings.",kind:"form",paths:["cost_profile","cost.budgets.daily","cost.budgets.weekly","cost.budgets.monthly","cost.enforcement"]},{id:"roadmap-quality",title:"Roadmap & quality cadence",navLabel:"Roadmap & quality",subtitle:"When the agent runs quality tools and refreshes roadmap dashboards.",kind:"form",paths:["roadmap.quality_cadence","roadmap.dashboard_regen_cadence","quality.local_auto_run","quality.wait_for_remote_ci"]},{id:"memory",title:"Memory & redaction",navLabel:"Memory",subtitle:"Inline-review threshold and transcript-redaction regexes.",kind:"form",paths:["memory.review_threshold","memory.redact_patterns"]},{id:"ai-council",title:"AI Council",navLabel:"AI Council",subtitle:"External second-opinion network. Enable members, pick transport + rounds + budget + impact routing, add provider keys. Writes .ai-council.yml.",kind:"aiCouncil"},{id:"user-md",title:"Your .agent-user.yml",navLabel:"User profile",subtitle:"Identity, voice, preferences. Stored at agents/settings/.agent-user.yml. Skip to leave empty.",kind:"userMd"},{id:"review",title:"Review & finish",navLabel:"Review",subtitle:"These keys will change. Confirm to write .agent-settings.yml and .agent-user.yml atomically.",kind:"review"}];function jt(e={}){return e.extended===!0?[ur,...wc,...dr]:[ur,...dr]}function On(e,n={}){const i=jt(n),r=Math.max(0,Math.min(i.length-1,e));return i[r]}function xc(e,n){const i={type:"object",properties:{},...e.description!==void 0?{description:e.description}:{}},r=i.properties,t=e.properties??{};for(const l of n){const o=l.split(".").filter(D=>D.length>0);if(o.length===0)continue;const[c,d,u]=o;if(c===void 0)continue;const f=t[c];if(f===void 0)continue;if(d===void 0){r[c]=f;continue}const s=f.properties?.[d];if(s===void 0)continue;const p=r[c]??{type:"object",properties:{},...f.description!==void 0?{description:f.description}:{}},v=p.properties??={};if(u===void 0){v[d]=s,r[c]=p;continue}const g=s.properties?.[u];if(g===void 0)continue;const k=v[d]??{type:"object",properties:{},...s.description!==void 0?{description:s.description}:{}},m=k.properties??={};m[u]=g,v[d]=k,r[c]=p}return i}function Ac({current:e,total:n}){const i=Math.max(1,n),r=Math.max(0,Math.min(i-1,e)),t=Array.from({length:i},(o,c)=>c<=r),l=Math.round((r+1)/i*100);return a("div",{class:"ac-wizard__progress",role:"progressbar","aria-valuenow":r+1,"aria-valuemin":1,"aria-valuemax":i,"aria-valuetext":`Step ${r+1} of ${i} (${l}%)`,children:t.map((o,c)=>a("span",{class:`ac-wizard__progress-segment${o?" ac-wizard__progress-segment--filled":""}`,"aria-hidden":"true"},c))})}function Sc({step:e,index:n,total:i}){return a("header",{class:"ac-page__header ac-wizard__header",children:[a("p",{class:"ac-wizard__step-count",children:["Step ",n+1," of ",i]}),a("div",{class:"ac-wizard__header-text",children:[a("h1",{children:e.title}),a("p",{class:"ac-wizard__subtitle",children:e.subtitle})]}),a(Ac,{current:n,total:i})]})}function Cc(e){const n=e.canFinish??!0,i=e.completed??!1;return a("div",{class:"ac-form__actions ac-wizard__nav",children:[a("button",{type:"button",class:"ac-button",disabled:!e.canGoPrev||e.busy,onClick:e.onPrev,children:"Back"}),e.canSkip&&e.onSkip!==void 0?a("button",{type:"button",class:"ac-button ac-wizard__skip",disabled:e.busy,onClick:e.onSkip,children:e.skipLabel??"Skip"}):null,e.isLast?i?null:a("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy||!n,onClick:e.onFinish,children:e.busy?"Saving…":"Finish & save"}):a("button",{type:"button",class:"ac-button ac-button--primary",disabled:!e.canGoNext||e.busy,onClick:e.onNext,children:e.nextLabel??"Next"})]})}function Bt(e,n){return e.kind!=="form"||e.paths===void 0?!1:!!(e.paths.includes(n)||e.id==="cost"&&(n.startsWith("telegraph.")||n.startsWith("verbosity.")))}function Tc(e,n){return e.kind==="userMd"?n==="body"||n.startsWith("body."):Bt(e,n)}function Ec(e,n){for(const i of Object.keys(n.errors))if(Tc(e,i))return!0;return!1}function Ic(e,n){if(Ec(e,n))return{label:"needs attention",tone:"error"};if(e.kind==="userMd")return n.userMdChanged?{label:n.userMdAction==="create"?"will create":"will replace",tone:"changed"}:{label:"",tone:"idle"};if(e.kind==="form"){const i=n.changes.filter(r=>Bt(e,r.path)).length;return i===0?{label:"",tone:"idle"}:{label:`${i} change${i===1?"":"s"}`,tone:"changed"}}if(e.kind==="aiTools"){const i=n.selectedToolsCount??0;return i===0?{label:"",tone:"idle"}:{label:`${i} tool${i===1?"":"s"}`,tone:"changed"}}if(e.kind==="packs"){const i=n.selectedPacksCount??0;return i===0?{label:"",tone:"idle"}:{label:`${i} pack${i===1?"":"s"}`,tone:"changed"}}return{label:"",tone:"idle"}}function Oc(e){const n=e.steps.filter((i,r)=>r!==e.currentIndex);return a(U,{children:a("nav",{class:"ac-wizard__review-nav","aria-label":"Jump back to a step",children:[a("p",{class:"ac-wizard__review-nav-label",children:"Jump back to a step:"}),a("ul",{class:"ac-wizard__review-nav-list",children:n.map(i=>{const r=e.steps.indexOf(i),t=Ic(i,e),l=t.tone==="error"?"ac-wizard__review-nav-button ac-wizard__review-nav-button--error":"ac-wizard__review-nav-button";return a("li",{children:a("button",{type:"button",class:l,onClick:()=>{e.onJump(r)},children:[a("span",{class:"ac-wizard__review-nav-index",children:r+1}),a("span",{class:"ac-wizard__review-nav-text",children:i.navLabel}),t.label!==""?a("span",{class:`ac-wizard__review-nav-status ac-wizard__review-nav-status--${t.tone}`,children:t.label}):null]})},i.id)})})]})})}function Nc(e){const n=e.abortedAt??"unknown time",i=e.abortNote??"no further detail recorded",r=e.writesSinceRollback;return a("aside",{class:"ac-banner ac-banner--recovery",role:"alert",children:[a("strong",{children:"Previous install was interrupted."}),a("p",{children:["Aborted at ",a("code",{children:n})," — ",i,". ",r," write",r===1?"":"s"," landed before the abort marker."]}),a("p",{children:"Pick how to recover before continuing. Resume reopens the wizard fresh, Rollback discards the abort state, Ignore hides this banner without touching the log."}),a("div",{class:"ac-banner__actions",children:[a("button",{type:"button",disabled:e.busy,onClick:()=>e.onResume(),children:"Resume install"}),a("button",{type:"button",disabled:e.busy,onClick:()=>e.onRollback(),children:"Rollback"}),a("button",{type:"button",disabled:e.busy,onClick:()=>e.onIgnore(),children:"Ignore"})]})]})}function Lc(){return a("section",{class:"ac-continue-screen","aria-labelledby":"ac-continue-title",children:[a("h2",{id:"ac-continue-title",children:"Install complete — continue with setup?"}),a("p",{children:"Your install selections (AI tools, roles, capability packs) are captured. Use the footer to continue:"}),a("ul",{children:[a("li",{children:[a("strong",{children:"Next"})," — go through the remaining personalisation steps: editor + tooling, personality, cost profile, roadmap & quality, memory, your",a("code",{children:" .agent-user.yml"}),", and finally the project module roots."]}),a("li",{children:[a("strong",{children:"Finish install here"})," — skip the rest and write ",a("code",{children:".agent-settings.yml"})," with the install-only selections. You can re-run ",a("code",{children:"agent-config setup"}),"later to pick up the personalisation steps."]})]})]})}function Fc(e){const n=e.version??"unknown";return a("section",{class:"ac-backup-screen","aria-labelledby":"ac-backup-title",children:[a("h2",{id:"ac-backup-title",children:"Existing v3 install detected"}),a("p",{children:["Found a v3.x install at ",a("code",{children:e.sourcePath})," ","(VERSION: ",a("code",{children:n}),"). v4 is a hard-cut release with no auto-migration — settings, identity, and history layouts changed. The wizard can back up the v3 tree before writing the v4 layout so you can roll back manually if needed."]}),e.error!==null?a("p",{class:"ac-banner ac-banner--error",children:["Backup failed: ",e.error]}):null,a("ul",{children:[a("li",{children:[a("strong",{children:"Backup v3 and proceed"})," — copies the tree to ",a("code",{children:e.backupTarget}),", then runs the v4 install. Restore later with",a("code",{children:[" mv ",e.backupTarget," ",e.sourcePath]}),"."]}),a("li",{children:[a("strong",{children:"Abort, uninstall v3 first"})," — closes the wizard. You decide what to keep."]})]}),a("div",{class:"ac-backup-screen__actions",children:[a("button",{type:"button",class:"ac-button ac-button--primary",disabled:e.busy,onClick:()=>e.onBackupAndProceed(),children:e.busy?"Backing up…":"Backup v3 and proceed"}),a("button",{type:"button",class:"ac-button",disabled:e.busy,onClick:()=>e.onAbort(),children:"Abort, uninstall v3 first"})]})]})}const Ut=_(!1),Ee=_(null),R=_(null),pn=_(!1),hn=_(!1),te=_(0),Ai=_(null),H=_({}),Ht=_({}),Wt=_(0),ve=_({}),E=_(null),ne=_(null),Si=_(!1),ri=_(!1),Nn=_(!1),zt=_({}),Ln=_([]);_("global");const Ci=_(!1),M=_(!1),Pc=_(!1),vn=_(!1),_n=_(null),Ti=_([]),mn=_({}),gn=_(!0),yn=_(""),bn=_("agents");_(!1);const Yt=_(null),Rc=[{id:"claude-code",label:"Claude Code"},{id:"claude-desktop",label:"Claude Desktop"},{id:"cursor",label:"Cursor"},{id:"windsurf",label:"Windsurf"},{id:"cline",label:"Cline"},{id:"gemini-cli",label:"Gemini CLI"},{id:"copilot",label:"GitHub Copilot"},{id:"augment",label:"Augment"},{id:"aider",label:"Aider"},{id:"codex",label:"Codex"},{id:"roocode",label:"Roo Code"},{id:"continue",label:"Continue"},{id:"kilocode",label:"Kilo Code"},{id:"zed",label:"Zed"},{id:"jetbrains",label:"JetBrains"},{id:"kiro",label:"Kiro"},{id:"qoder",label:"Qoder"},{id:"opencode",label:"OpenCode"},{id:"trae",label:"Trae"},{id:"antigravity",label:"Antigravity"},{id:"codebuddy",label:"CodeBuddy"},{id:"droid",label:"Droid"},{id:"warp",label:"Warp"}],fr=_(!1),Ie=_(!1),ie=_(null),Ei=_([]),Ii=_([]),Fn=_([]),re=_({}),pr=_(!1),Un=_(!1),Kt=_({}),hr=_(!1),qt=_(null),Gt=_(null),Vt=_("https://github.com/event4u-app/rtk"),vr=_(!1),Z=_(null),Jt=_([]),Qt=_({}),Zt=_({}),le=_({}),G=_({}),ti=_(!1),_r=_(!1);_({});_(null);_(null);_(!1);_(null);const kn=_(null),Xt=_(!1),li=_(null),ai=_(!1),oi=_(!1),ci=_(null),Oe=_(null),Je=_(!1);function el(){return jt({extended:M.value})}function De(){return el().length}function $c(e){return e??new Date().toISOString()}function Oi(e){return Math.max(0,Math.min(De()-1,e))}function Mc(e){if("$ref"in e&&e.$ref!==void 0&&"definitions"in e&&e.definitions!==void 0){const n=e.$ref.replace("#/definitions/",""),i=e.definitions[n];if(i!==void 0)return i}return e}async function Dc(){try{return await x("/api/v1/settings")}catch(e){if(e instanceof $&&e.status===404&&e.body.error?.code==="NOT_FOUND"){const n=await x("/api/v1/schema");return{values:{},lastModified:0,path:".agent-settings.yml",schema:n.settings}}throw e}}async function jc(){try{const e=await x("/api/v1/install/recovery");kn.value=e.incomplete?e:null}catch{kn.value=null}}async function Bc(){try{const e=await x("/api/v1/install/legacy-v3");li.value=e.present?e:null}catch{li.value=null}}async function Uc(){oi.value=!0,ci.value=null;try{await x("/api/v1/install/backup-v3",{method:"POST"}),ai.value=!0}catch(e){ci.value=e instanceof $?Y(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e)}finally{oi.value=!1}}async function Hn(e){try{await x("/api/v1/install/recovery/dismiss",{method:"POST",body:{reason:e}})}catch(n){R.value={message:n instanceof Error?n.message:String(n),tone:"error"};return}kn.value=null,Xt.value=!0}async function Hc(){Ee.value=null;try{jc(),Bc();const[e,n]=await Promise.all([x("/api/v1/wizard/state"),Dc()]);Ai.value=Mc(n.schema),Wt.value=n.lastModified,Ht.value=n.values,zt.value=n.legacyHints??{},M.value=e.extendedSteps===!0,Oe.value=e.wizardMode??null;const i=Object.keys(e.partial??{});H.value=i.length>0?{...n.values,...e.partial}:n.values,te.value=Oi(e.step),Ci.value=!1,Ut.value=!0;const r=On(te.value,{extended:M.value});(r.kind==="welcome"||r.kind==="userMd"||r.kind==="review")&&nl(),(r.kind==="roles"||r.kind==="aiTools"||r.kind==="packs")&&il(),r.kind==="aiTools"&&rl(),r.id==="identity"&&tl(),r.kind==="aiCouncil"&&ll(),r.kind==="review"&&al()}catch(e){e instanceof $?Ee.value=Y(e.body.error??{code:"UNKNOWN",message:e.message}):Ee.value=e instanceof Error?e.message:String(e)}}function Wc(e,n){return e.identity.name.trim()!==""?e:{...e,identity:{...e.identity,name:n}}}async function nl(){if(!ri.value)try{const e=await x("/api/v1/user-md");if(Si.value=e.exists,e.exists&&e.identity!==null){const n=Gi(e.identity);ne.value=n,E.value=n}else{let n;try{const r=await x("/api/v1/user-md/template");n=Gi(kc(r.body))}catch{n=Jr()}const i=zt.value.user_name;typeof i=="string"&&i.trim()!==""&&(n=Wc(n,i)),ne.value=n,E.value=n}}catch(e){R.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{ri.value=!0}}const zc=new Set(["python"]);async function il(){if(!(fr.value||Ie.value)){Ie.value=!0,ie.value=null;try{const[e,n]=await Promise.all([x("/api/v1/wizard/manifest"),x("/api/v1/wizard/auto-detect")]),i=(e.packs??[]).map(l=>({id:l.id,label:l.label??l.id,description:l.description??"",requires_hint:l.requires_hint,cluster:l.cluster??void 0,workspaces:l.workspaces}));Ei.value=i,Fn.value=(e.workspaces??[]).filter(l=>l.id!=="agent-config-maintainer").map(l=>({id:l.id,label:l.label??l.id,description:l.description??"",default_packs:l.default_packs??[],optional_packs:l.optional_packs??[],...l.example_roles!==void 0?{example_roles:l.example_roles}:{}}));const r=new Set(i.map(l=>l.id)),t=n.signals.map(l=>l.id.startsWith("pack-")?l.id.slice(5):l.id).filter(l=>r.has(l)).filter(l=>!zc.has(l));Ii.value=t}catch(e){e instanceof $?ie.value=Y(e.body.error??{code:"UNKNOWN",message:e.message}):ie.value=e instanceof Error?e.message:String(e)}finally{Ie.value=!1,fr.value=!0}}}async function rl(){if(!(pr.value||Un.value)){Un.value=!0;try{const e=await x("/api/v1/wizard/detect-tools"),n=e.tools??{},i=e.configured??[];if(Kt.value=n,Object.keys(le.value).length===0){const r={};if(i.length>0)for(const t of i)r[t]=!0;else for(const[t,l]of Object.entries(n))l&&(r[t]=!0);le.value=r}}catch{}finally{Un.value=!1,pr.value=!0}}}async function tl(){if(!hr.value){hr.value=!0;try{const e=await x("/api/v1/wizard/detect-rtk"),n=e.installed===!0;qt.value=n,Gt.value=e.installCommand??null,typeof e.repo=="string"&&(Vt.value=e.repo),H.value={...H.value,"personal.rtk_installed":n}}catch{}}}async function ll(){if(!vr.value){vr.value=!0;try{const e=await x("/api/v1/wizard/ai-council");Z.value=e.config,Jt.value=e.providers??[],Qt.value=e.keyPresence??{},Zt.value=e.keyInstall??{}}catch{}}}async function Yc(e,n){try{await x("/api/v1/wizard/state",{method:"POST",body:{step:e,totalSteps:De(),partial:n,startedAt:$c(null)}})}catch(i){R.value={message:i instanceof Error?i.message:String(i),tone:"error"}}}async function al(){hn.value=!0;try{const e=await x("/api/v1/settings/diff",{method:"POST",body:{values:H.value,ifUnmodifiedSince:Wt.value}});Ln.value=e.changes,ve.value={}}catch(e){e instanceof $?(ve.value=Yr(e.body.error??{message:e.message}),R.value={message:Y(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):R.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{hn.value=!1}}function wn(){return Nn.value?!1:E.value===null||ne.value===null?E.value!==ne.value:JSON.stringify(E.value)!==JSON.stringify(ne.value)}async function xe(e){const n=Oi(e);await Yc(n,H.value),te.value=n,R.value=null;const i=On(n,{extended:M.value});(i.kind==="welcome"||i.kind==="userMd")&&nl(),(i.kind==="roles"||i.kind==="aiTools"||i.kind==="packs")&&il(),i.kind==="packs"&&cl(),i.kind==="aiTools"&&rl(),i.id==="identity"&&tl(),i.kind==="aiCouncil"&&ll(),i.kind==="review"&&al()}function ol(){const e=G.value,n=new Map(Ei.value.map(l=>[l.id,l])),i=Object.entries(e).filter(([,l])=>l===!0).map(([l])=>l).filter(l=>{const o=n.get(l)?.cluster;return o===void 0||e[o]===!0}),r=new Set,t=l=>{if(!r.has(l)){r.add(l);for(const o of n.get(l)?.requires_hint??[])t(o)}};for(const l of i)t(l);return[...r].sort()}function cl(){if(ti.value)return;const e=Object.entries(re.value).filter(([,r])=>r===!0).map(([r])=>r),n=new Map(Fn.value.map(r=>[r.id,r])),i={};for(const r of e)for(const t of n.get(r)?.default_packs??[])i[t]=!0;for(const r of Ii.value)i[r]=!0;G.value=i}function Kc(){const e=Object.entries(le.value).filter(([,r])=>r===!0).map(([r])=>r);if(e.length===0)return null;const n=ol();return{schema_version:"wizard-v2",tools:e,packs:n,settings:H.value}}async function qc(){pn.value=!0,R.value=null;try{const e={settings:H.value},n=Object.entries(re.value).filter(([,u])=>u===!0).map(([u])=>u),i=E.value!==null&&typeof E.value.identity?.name=="string"&&E.value.identity.name.trim().length>0;E.value!==null&&i&&(wn()||n.length>0)&&(e.identity=n.length>0?{...E.value,role:n}:E.value);const r=await x("/api/v1/wizard/finish",{method:"POST",body:e}),t="You can close this browser window now.",l=r.dryRun===!0?"Dry-run complete — no files written. Settings would be saved.":Array.isArray(r.writtenPaths)?`Saved (${r.writtenPaths.join(", ")}). Wizard complete.`:"Wizard complete.",o=M.value?Kc():null;let c="";if(o!==null)try{let u=null;await Pl("/api/v1/wizard/apply",o,h=>{h.type==="error"&&(u=typeof h.message=="string"?h.message:"install failed")});const f=o.tools.length,s=o.packs.length;c=u!==null?` Installer failed: ${u}. Settings were saved; re-run the wizard to retry.`:` Installer applied ${f} tool${f===1?"":"s"}`+(s>0?` and ${s} pack${s===1?"":"s"}.`:".")}catch(u){c=` Installer bridge failed: ${u instanceof $?Y(u.body.error??{code:"UNKNOWN",message:u.message}):u instanceof Error?u.message:String(u)}. Settings were saved; re-run the wizard to retry the install plan.`}let d="";if(M.value&&Z.value!==null)try{await x("/api/v1/wizard/ai-council",{method:"POST",body:Z.value}),d=" AI Council saved."}catch(u){d=` AI Council save failed: ${u instanceof $?Y(u.body.error??{code:"UNKNOWN",message:u.message}):u instanceof Error?u.message:String(u)}.`}R.value={message:`${l}${c}${d} ${t}`,tone:"success"},te.value=Oi(De()-1),Ht.value=H.value,ne.value=wn()?E.value:ne.value,Ln.value=[],Ci.value=!0}catch(e){e instanceof $?(ve.value=Yr(e.body.error??{message:e.message}),R.value={message:Y(e.body.error??{code:"UNKNOWN",message:e.message}),tone:"error"}):R.value={message:e instanceof Error?e.message:String(e),tone:"error"}}finally{pn.value=!1}}const Gc=["de","en","en-US","en-GB","fr","es","it","nl","pt","pt-BR"];function Vc(){if(_r.value)return;const e=E.value;if(e===null)return;_r.value=!0;let n=e;if(e.identity.name.trim()===""){const i=an.value?.systemUser;i!==void 0&&i.trim()!==""&&(n={...n,identity:{...n.identity,name:i}})}if(!Si.value&&typeof navigator<"u"){const i=(navigator.language||"").split("-")[0];i.length>=2&&(n={...n,language:i})}n!==e&&(E.value=n)}function Jc(){const e=E.value;if(je(()=>{Vc()},[e]),e===null)return a("p",{children:"Loading…"});const n=i=>{E.value={...i,last_updated:new Date().toISOString().slice(0,10)},Nn.value=!1};return a("div",{class:"ac-wizard-step-stub ac-wizard__module-fields",children:[a("p",{children:["Tell the agent who you are. We pre-filled what we could detect — adjust freely. Stored in ",a("code",{children:".agent-user.yml"}),"."]}),a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",for:"welcome-name",children:"Name"}),a("input",{class:"ac-input",id:"welcome-name",type:"text",placeholder:"How should the agent address you?",value:e.identity.name,onInput:i=>n({...e,identity:{...e.identity,name:i.currentTarget.value}})})]}),a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",for:"welcome-lang",children:"Language"}),a("input",{class:"ac-input",id:"welcome-lang",type:"text",list:"welcome-lang-list",placeholder:"BCP-47 code, e.g. de, en, en-US",value:e.language,onInput:i=>n({...e,language:i.currentTarget.value})}),a("datalist",{id:"welcome-lang-list",children:Gc.map(i=>a("option",{value:i},i))})]})]})}function Qc(){const e=le.value,n=Kt.value;return a("div",{class:"ac-wizard-step-stub",children:[a("p",{children:"Pick the AI tools you use. Tools detected on this machine are pre-selected on first run. The installer wires each selected tool's surface (skills, rules, commands) on apply; you can change this list later by re-running the wizard."}),a("ul",{class:"ac-wizard__tool-list",children:Rc.map(i=>{const r=n[i.id]===!0;return a("li",{class:"ac-wizard__tool-row",children:[a("label",{class:"ac-wizard__tool-label",children:[a("input",{type:"checkbox",checked:e[i.id]??!1,onChange:t=>{const l=t.currentTarget.checked;le.value={...e,[i.id]:l}}})," ",i.label]}),a("span",{class:`ac-badge ${r?"ac-badge--installed":"ac-badge--missing"}`,title:r?"Detected on this machine":"Not detected on this machine",children:r?"installed":"not installed"})]},i.id)})})]})}function Zc(){if(Ie.value)return a("p",{children:"Loading roles…"});if(ie.value!==null)return a("div",{class:"ac-wizard-step-stub",children:a("p",{class:"ac-banner ac-banner--error",children:["Discovery failed: ",ie.value]})});const e=re.value,n=Fn.value,i=(r,t)=>{re.value={...re.value,[r]:t},cl()};return a("div",{class:"ac-wizard-step-stub",children:[a("p",{children:["Pick the areas you work in. We use them to recommend capability packs on the next step, and they become your roles in",a("code",{children:" .agent-user.yml"}),"."]}),n.length===0?a("p",{children:a("em",{children:"No roles available in the manifest."})}):a("div",{class:"ac-wizard__pack-grid",children:n.map(r=>a("section",{class:"ac-pack-tile",children:[a("label",{class:"ac-pack-tile__head",children:[a("input",{type:"checkbox",checked:e[r.id]??!1,onChange:t=>{i(r.id,t.currentTarget.checked)}}),a("span",{class:"ac-pack-tile__title",children:r.label})]}),(r.example_roles??[]).length>0?a("p",{class:"ac-pack-tile__role",children:["e.g. ",(r.example_roles??[]).join(", ")]}):null,r.description!==""?a("p",{class:"ac-pack-tile__desc",children:r.description}):null]},r.id))})]})}function Xc(){if(Ie.value)return a("p",{children:"Loading discovery manifest…"});if(ie.value!==null)return a("div",{class:"ac-wizard-step-stub",children:[a("p",{class:"ac-banner ac-banner--error",children:["Discovery failed: ",ie.value]}),a("p",{children:"The manifest endpoint is gated on extended-mode. Re-run the server with extended steps enabled to populate this list."})]});const e=G.value,n=new Set(Ii.value),i=new Map(Fn.value.map(s=>[s.id,s.label])),r=re.value,t=s=>{const h=(s??[]).filter(p=>p!=="agent-config-maintainer");return h.length===0?null:a("span",{class:"ac-pack-tile__ws",children:h.map(p=>a("span",{class:`ac-badge ac-badge--ws${r[p]===!0?" ac-badge--ws-active":""}`,title:r[p]===!0?"Matches a role you picked":"Workspace / area",children:i.get(p)??p},p))})},l=Ei.value.filter(s=>s.id!=="engineering-base"),o=new Map;for(const s of l)if(s.cluster!==void 0){const h=o.get(s.cluster)??[];h.push(s),o.set(s.cluster,h)}const c=new Set(l.filter(s=>s.cluster!==void 0).map(s=>s.id)),d=l.filter(s=>!c.has(s.id)),u=(s,h)=>{ti.value=!0,G.value={...G.value,[s]:h}},f=(s,h)=>{ti.value=!0;const p={...G.value,[s]:h};if(h)for(const v of o.get(s)??[])p[v.id]===void 0&&(p[v.id]=!0);G.value=p};return a("div",{class:"ac-wizard-step-stub",children:[a("p",{children:"Pick the capability packs to install. Auto-detected packs are pre-selected; engineering hygiene is included automatically when a pack needs it. A language tile expands to its frameworks — turn the language off to skip them all."}),d.length===0?a("p",{children:a("em",{children:"No packs available in the manifest."})}):a("div",{class:"ac-wizard__pack-grid",children:d.map(s=>{const h=o.get(s.id)??[],p=h.length>0,v=e[s.id]??!1;return a("section",{class:"ac-pack-tile",children:[a("label",{class:"ac-pack-tile__head",children:[a("input",{type:"checkbox",checked:v,onChange:g=>{const b=g.currentTarget.checked;p?f(s.id,b):u(s.id,b)}}),a("span",{class:"ac-pack-tile__title",children:s.label}),n.has(s.id)?a("span",{class:"ac-badge ac-badge--installed",children:"auto-detected"}):null]}),t(s.workspaces),s.description!==""?a("p",{class:"ac-pack-tile__desc",children:s.description}):null,p?a("fieldset",{class:"ac-pack-tile__children",disabled:!v,children:h.map(g=>a("label",{class:"ac-pack-tile__child",children:[a("input",{type:"checkbox",checked:e[g.id]??!1,disabled:!v,onChange:b=>{u(g.id,b.currentTarget.checked)}}),a("span",{children:g.label})]},g.id))}):null]},s.id)})})]})}function es(){const e=qt.value,n=Gt.value;return a("div",{class:"ac-rtk-row",children:[a("div",{class:"ac-rtk-row__head",children:[a("span",{class:"ac-rtk-row__label",children:["rtk ",a("small",{children:"(Rust Token Killer)"})]}),e===null?a("span",{class:"ac-badge ac-badge--missing",children:"detecting…"}):e?a("span",{class:"ac-badge ac-badge--installed",children:"installed"}):a("span",{class:"ac-badge ac-badge--missing",children:"not installed"})]}),e===!1?a("div",{class:"ac-rtk-row__install",children:[a("p",{class:"ac-field__description",children:"rtk wraps verbose CLI output for ~60–90% token savings. Install it, then re-open the wizard to pick up detection:"}),n!==null?a("code",{class:"ac-rtk-row__cmd",children:n}):null,a("a",{class:"ac-button",href:Vt.value,target:"_blank",rel:"noreferrer noopener",children:"Open rtk repo"})]}):null]})}function ns(){const e=Z.value;if(e===null)return a("div",{class:"ac-wizard-step-stub",children:a("p",{class:"ac-banner",children:["AI Council config is unavailable (extended-mode only, or",a("code",{children:" .ai-council.yml "})," could not be read). Configure it later by editing ",a("code",{children:"agents/settings/.ai-council.yml"}),"."]})});const n=Jt.value,i=Qt.value,r=Zt.value,t=o=>{Z.value={...e,...o}},l=(o,c)=>{const d=e.members[o]??{enabled:!1,participateLowImpact:!1};Z.value={...e,members:{...e.members,[o]:{...d,...c}}}};return a("div",{class:"ac-wizard-step-stub ac-council",children:[a("label",{class:"ac-council__master",children:[a("input",{type:"checkbox",checked:e.enabled,onChange:o=>{t({enabled:o.currentTarget.checked})}})," ","Enable the AI Council (external second-opinion network)"]}),a("fieldset",{class:"ac-council__section",disabled:!e.enabled,children:[a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",children:"Transport mode (default for all members)"}),a("select",{class:"ac-input",value:e.defaultMode,onChange:o=>{t({defaultMode:o.currentTarget.value})},children:[a("option",{value:"manual",children:"manual — copy & paste (free, no key)"}),a("option",{value:"api",children:"api — stored key, per-token billing"}),a("option",{value:"cli",children:"cli — subscription auth (flat-rate)"})]})]}),a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",children:"Debate rounds (minimum)"}),a("input",{class:"ac-input",type:"number",min:"1",value:e.minRounds,onInput:o=>{t({minRounds:Math.max(1,Number.parseInt(o.currentTarget.value,10)||1)})}})]}),a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",children:"Cost budget — max total USD per invocation"}),a("input",{class:"ac-input",type:"number",min:"0",step:"0.5",value:e.maxTotalUsd,onInput:o=>{t({maxTotalUsd:Math.max(0,Number.parseFloat(o.currentTarget.value)||0)})}})]}),a("h3",{class:"ac-council__h",children:"Members"}),a("ul",{class:"ac-wizard__tool-list",children:n.map(o=>{const c=e.members[o]??{enabled:!1,participateLowImpact:!1},d=i[o]===!0,u=r[o];return a("li",{class:"ac-pack-tile",children:[a("div",{class:"ac-pack-tile__head",children:[a("label",{class:"ac-pack-tile__head",style:"flex:1;",children:[a("input",{type:"checkbox",checked:c.enabled,onChange:f=>{l(o,{enabled:f.currentTarget.checked})}}),a("span",{class:"ac-pack-tile__title",children:o})]}),a("span",{class:`ac-badge ${d?"ac-badge--installed":"ac-badge--missing"}`,children:d?"key present":"no key"})]}),a("label",{class:"ac-pack-tile__child",children:[a("input",{type:"checkbox",checked:c.participateLowImpact,disabled:!c.enabled,onChange:f=>{l(o,{participateLowImpact:f.currentTarget.checked})}}),a("span",{children:"low-impact fast-path"})]}),d?null:a("p",{class:"ac-field__description",children:u!==void 0?a(U,{children:["Add a key — run in a terminal: ",a("code",{children:u})]}):a(U,{children:["No installer; set ",a("code",{children:["api_key_ref: env:",o.toUpperCase(),"_API_KEY"]})," and export that variable."]})})]},o)})}),a("h3",{class:"ac-council__h",children:"Impact routing"}),["trivial","low_impact","medium_impact"].map(o=>a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",children:o}),a("select",{class:"ac-input",value:e.decision[o]??"agent",onChange:c=>{const d=c.currentTarget.value;Z.value={...e,decision:{...e.decision,[o]:d}}},children:[a("option",{value:"agent",children:"agent — the agent decides"}),a("option",{value:"council",children:"council — poll the council"}),a("option",{value:"user",children:"user — always ask you"})]})]},o)),a("p",{class:"ac-field__description",children:[a("code",{children:"high_impact"})," and ",a("code",{children:"user_required"})," are locked to “user” (Iron Law) and not editable here."]})]})]})}function is(){const e=On(te.value,{extended:M.value});if(M.value&&Oe.value==="install"&&e.id==="identity"&&!Je.value)return a(Lc,{});if(e.kind==="form"){const i=xc(Ai.value,e.paths??[]);return a(U,{children:[e.id==="identity"?a(es,{}):null,a(Kl,{schema:i,values:H.value,errors:ve.value,onChange:r=>{H.value=r}})]})}return e.kind==="userMd"?!ri.value||E.value===null?a("p",{children:"Loading .agent-user.yml…"}):a(Jl,{value:E.value,errors:ve.value,hideRole:M.value&&Oe.value==="install",hideIdentityBasics:M.value&&Oe.value==="install",onChange:i=>{E.value=i,Nn.value=!1}}):e.kind==="welcome"?a(Jc,{}):e.kind==="aiTools"?a(Qc,{}):e.kind==="roles"?a(Zc,{}):e.kind==="packs"?a(Xc,{}):e.kind==="aiCouncil"?a(ns,{}):a(Oc,{steps:el(),currentIndex:te.value,changes:Ln.value,errors:ve.value,userMdChanged:wn(),userMdAction:Si.value?"replace":"create",loading:hn.value,onJump:i=>{xe(i)},selectedToolsCount:Object.values(le.value).filter(Boolean).length,selectedPacksCount:Object.values(G.value).filter(Boolean).length})}function Wn({path:e}){if(je(()=>{Hc()},[]),!Ut.value||Ai.value===null)return a("div",{class:"ac-page",children:[a("h1",{children:"Setup wizard"}),Ee.value!==null?a("p",{class:"ac-banner ac-banner--error",children:Ee.value}):a("p",{children:"Loading…"})]});const n=te.value,i=De(),r=On(n,{extended:M.value}),t=n===i-1,l=r.kind==="aiTools"&&Object.values(le.value).filter(Boolean).length===0||r.kind==="roles"&&Object.values(re.value).filter(Boolean).length===0||r.kind==="packs"&&ol().length===0,o=M.value&&Oe.value==="install"&&r.id==="identity"&&!Je.value,c=kn.value,d=c!==null&&!Xt.value,u=li.value;return u!==null&&u.present&&!ai.value?a("div",{class:"ac-page",children:a(Fc,{sourcePath:u.path,backupTarget:u.backupTarget,version:u.version,busy:oi.value,error:ci.value,onBackupAndProceed:()=>{Uc()},onAbort:()=>{R.value={tone:"info",message:"Aborted. Uninstall v3 manually, then re-run `agent-config install`."},ai.value=!0}})}):a("div",{class:"ac-page",children:[a(Sc,{step:r,index:n,total:i}),d?a(Nc,{abortedAt:c.abortedAt,abortNote:c.abortNote,writesSinceRollback:c.writesSinceRollback,busy:pn.value,onResume:()=>{Hn("resume")},onRollback:()=>{Hn("rollback")},onIgnore:()=>{Hn("ignore")}}):null,R.value!==null?a("p",{class:`ac-banner${R.value.tone==="error"?" ac-banner--error":""}`,children:R.value.message}):null,a("div",{class:"ac-wizard__step",children:a(is,{})}),l?a("p",{class:"ac-wizard__hint",children:r.kind==="aiTools"?"Select at least one AI tool to continue.":r.kind==="roles"?"Select at least one role to continue.":"Select at least one capability pack to continue."}):null,a(Cc,{canGoPrev:n>0,canGoNext:!t&&!l,canSkip:o||r.kind==="userMd",skipLabel:o?"Finish install here":"Skip",isLast:t,busy:pn.value||hn.value,canFinish:Ln.value.length>0||wn(),completed:Ci.value,onPrev:()=>{xe(n-1)},onNext:()=>{if(o){Je.value=!0;return}xe(n+1)},onSkip:()=>{if(o){Je.value=!0,xe(De()-1);return}Nn.value=!0,xe(n+1)},onFinish:()=>{qc()}})]})}const xn=_(!1),_e=_(null);async function rs(){vn.value=!0,_n.value=null;try{const e=await x("/api/v1/modules/detect");Ti.value=e.candidates,Yt.value=e.project_root;const n={};for(const i of e.candidates)n[i.path]=!0;mn.value=n,gn.value=e.proposed_block.enabled,yn.value=e.proposed_block.namespace_template??"",bn.value=e.proposed_block.agent_folder??"agents"}catch(e){_n.value=e instanceof $?Y(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e)}finally{vn.value=!1,Pc.value=!0}}function ts(){const e=new Set(Ti.value.map(r=>r.path)),n=mn.value,i=Object.keys(n).filter(r=>n[r]===!0&&e.has(r));return{enabled:gn.value,root_paths:i,namespace_template:yn.value,agent_folder:bn.value||"agents"}}async function ls(){xn.value=!0,_e.value=null;try{const e=await x("/api/v1/modules/apply",{method:"POST",body:ts()});_e.value={message:e.appliedTo!==null?`Saved project settings to ${e.appliedTo}.`:`Saved project settings to ${e.projectRoot}.`,tone:"success"}}catch(e){const n=e instanceof $?Y(e.body.error??{code:"UNKNOWN",message:e.message}):e instanceof Error?e.message:String(e);_e.value={message:`Could not save project settings: ${n}`,tone:"error"}}finally{xn.value=!1}}function as(){if(vn.value)return a("p",{children:"Detecting module roots…"});if(_n.value!==null)return a("p",{class:"ac-banner ac-banner--error",children:["Module detection failed: ",_n.value]});const e=Ti.value,n=mn.value,i=Yt.value;return a("div",{class:"ac-section",children:[i!==null?a("p",{class:"ac-section__description",children:["Scanning ",a("code",{children:i}),". Pick which detected roots the agent should treat as modules. These write to",a("code",{children:" .agent-project-settings.yml"})," in this repo only."]}):null,a("label",{children:[a("input",{type:"checkbox",checked:gn.value,onChange:r=>{gn.value=r.currentTarget.checked}})," ","Enable module discovery (writes ",a("code",{children:"modules.enabled"}),")"]}),e.length===0?a("p",{children:[a("em",{children:"No module roots detected."})," The scan found no common module layouts (Laravel ",a("code",{children:"app/Modules/"}),", Symfony",a("code",{children:" src/Module/"}),", Node ",a("code",{children:"packages/"}),", Python",a("code",{children:" src/"}),", Go ",a("code",{children:"internal/"}),")."]}):a("ul",{style:"list-style: none; padding-left: 0;",children:e.map(r=>a("li",{children:a("label",{children:[a("input",{type:"checkbox",checked:n[r.path]??!1,onChange:t=>{const l=t.currentTarget.checked;mn.value={...n,[r.path]:l}}})," ",a("code",{children:r.path})," — ",r.stack," ",a("small",{children:["(",r.confidence," confidence)"]})]})},r.path))}),a("div",{class:"ac-wizard__module-fields",children:[a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",for:"ac-modules-namespace",children:"Namespace template"}),a("input",{id:"ac-modules-namespace",class:"ac-input",type:"text",value:yn.value,placeholder:"e.g. App\\\\Modules\\\\{ModuleName}\\\\App",onInput:r=>{yn.value=r.currentTarget.value}}),a("span",{class:"ac-field__description",children:"How a module path maps to its namespace. Leave blank to skip namespacing."})]}),a("div",{class:"ac-field",children:[a("label",{class:"ac-field__label",for:"ac-modules-agent-folder",children:"Agent folder"}),a("input",{id:"ac-modules-agent-folder",class:"ac-input",type:"text",value:bn.value,placeholder:"agents",onInput:r=>{bn.value=r.currentTarget.value}}),a("span",{class:"ac-field__description",children:["Folder name that holds per-module agent docs (default ",a("code",{children:"agents"}),")."]})]})]})]})}function os(){return je(()=>{rs()},[]),a("div",{class:"ac-page",children:[a("header",{class:"ac-page__header",children:[a("h1",{children:"Project settings"}),a("p",{class:"ac-section__description",children:["Configuration scoped to this repository — written to",a("code",{children:" .agent-project-settings.yml"}),", not the global tree."]})]}),_e.value!==null?a("p",{class:`ac-banner ac-banner--${_e.value.tone==="success"?"success":"error"}`,children:_e.value.message}):null,a("section",{class:"ac-section",children:[a("h2",{class:"ac-section__title",children:"Modules"}),a(as,{})]}),a("div",{class:"ac-form__actions ac-wizard__nav",children:a("button",{type:"button",class:"ac-button ac-button--primary",disabled:xn.value||vn.value,onClick:()=>{ls()},children:xn.value?"Saving…":"Save project settings"})})]})}const Qe=_([]),An=_([]),si=_([]),ui=_([]),Sn=_(null),sl=_(!1),Ne=_(null),X=_(null),zn=_("plain");async function cs(){Ne.value=null;try{const[e,n,i,r]=await Promise.all([x("/api/v1/workspace/roles"),x("/api/v1/workspace/sessions?limit=20"),x("/api/v1/workspace/knowledge?limit=20"),x("/api/v1/workspace/documents?limit=20")]);Qe.value=e.roles,An.value=n.sessions,si.value=i.chunks,ui.value=r.documents,sl.value=!0}catch(e){e instanceof $?Ne.value=e.body?.error?.message??e.message:Ne.value=e instanceof Error?e.message:String(e)}}async function ss(e,n){X.value=null;try{const i=await x("/api/v1/workspace/launch",{method:"POST",body:{role:e,task:n,host:"local"}});X.value=`Started session ${i.id} (${i.role} · ${i.task}).`;const r=await x("/api/v1/workspace/sessions?limit=20");An.value=r.sessions}catch(i){i instanceof $?X.value=i.body?.error?.message??i.message:X.value=i instanceof Error?i.message:String(i)}}function us({role:e}){const n=Sn.value===e.slug;return a("button",{type:"button",class:`ac-workspace__role${n?" ac-workspace__role--active":""}`,"aria-current":n?"true":void 0,"aria-label":`Pick role ${e.display_name}`,onClick:()=>{Sn.value=e.slug,X.value=null},children:[a("span",{class:"ac-workspace__role-name",children:e.display_name}),a("span",{class:"ac-workspace__role-status","data-status":e.status,children:e.status}),a("span",{class:"ac-workspace__role-tagline",children:e.tagline})]})}function ds({role:e}){return a("section",{class:"ac-workspace__tasks","aria-labelledby":"task-heading",children:[a("h2",{id:"task-heading",class:"ac-workspace__heading",children:["First tasks · ",e.display_name]}),e.first_tasks.length===0?a("p",{class:"ac-workspace__empty",children:"No tasks scaffolded yet for this role."}):a("ul",{class:"ac-workspace__task-list",children:e.first_tasks.map(n=>a("li",{class:"ac-workspace__task",children:[a("div",{class:"ac-workspace__task-head",children:[a("span",{class:"ac-workspace__task-name",children:n.name}),a("button",{type:"button",class:"ac-button ac-button--primary",onClick:()=>{ss(e.slug,n.name)},children:"Start session"})]}),a("p",{class:"ac-workspace__task-intent",children:n.intent}),n.prompt!==""?a("code",{class:"ac-workspace__task-prompt",children:["prompts/",n.prompt]}):null]},n.name))}),e.skills.length>0?a("details",{class:"ac-workspace__skills",children:[a("summary",{children:["Skill shortlist (",e.skills.length,")"]}),a("ul",{class:"ac-workspace__skill-list",children:[e.skills.slice(0,5).map(n=>a("li",{class:"ac-workspace__skill",children:[a("code",{children:n.id})," — ",n.why]},n.id)),e.skills.length>5?a("li",{class:"ac-workspace__skill-more",children:["+ ",e.skills.length-5," more"]}):null]})]}):null]})}function fs(){return a("section",{class:"ac-workspace__sessions","aria-labelledby":"sessions-heading",children:[a("h2",{id:"sessions-heading",class:"ac-workspace__heading",children:"Recent sessions"}),An.value.length===0?a("p",{class:"ac-workspace__empty",children:"No sessions yet — pick a role and start one."}):a("ul",{class:"ac-workspace__session-list",children:An.value.map(e=>a("li",{class:"ac-workspace__session",children:[a("span",{class:"ac-workspace__session-id",children:e.id.slice(0,16)}),a("span",{class:"ac-workspace__session-role",children:e.role}),a("span",{class:"ac-workspace__session-task",children:e.task})]},e.id))})]})}function ps(){return a("section",{class:"ac-workspace__knowledge","aria-labelledby":"knowledge-heading",children:[a("h2",{id:"knowledge-heading",class:"ac-workspace__heading",children:"Knowledge sources"}),si.value.length===0?a("p",{class:"ac-workspace__empty",children:["No sources yet. Run ",a("code",{children:"/knowledge:ingest <path>"})," to add documents."]}):a("ol",{class:"ac-workspace__citation-list",children:si.value.map((e,n)=>a("li",{class:"ac-workspace__citation",children:[a("span",{class:"ac-workspace__citation-marker","aria-label":`Citation ${n+1}`,children:["[",n+1,"]"]}),a("a",{href:`file://${e.source}`,class:"ac-workspace__citation-source",title:"Open source in OS default app",children:e.source.split("/").pop()??e.source}),e.pinned?a("span",{class:"ac-workspace__citation-pin","aria-label":"pinned",children:"★"}):null,a("p",{class:"ac-workspace__citation-excerpt",children:[e.excerpt.slice(0,200),e.excerpt.length>200?"…":""]})]},e.id))})]})}function hs(){return a("section",{class:"ac-workspace__recent","aria-labelledby":"recent-heading",children:[a("h2",{id:"recent-heading",class:"ac-workspace__heading",children:"Recent documents"}),ui.value.length===0?a("p",{class:"ac-workspace__empty",children:"No documents yet. Saved drafts land here."}):a("ul",{class:"ac-workspace__doc-list",children:ui.value.map(e=>a("li",{class:"ac-workspace__doc",children:[a("span",{class:"ac-workspace__doc-type","data-type":e.type,children:e.type}),a("span",{class:"ac-workspace__doc-title",children:e.title}),a("time",{class:"ac-workspace__doc-time",dateTime:e.updated_at,children:e.updated_at.slice(0,10)})]},`${e.type}/${e.slug}`))})]})}function vs(){const e=zn.value;return a("fieldset",{class:"ac-workspace__explain",children:[a("legend",{class:"ac-workspace__heading",children:"Explanation style"}),a("label",{class:"ac-workspace__explain-option",children:[a("input",{type:"radio",name:"explain-mode",value:"plain",checked:e==="plain",onChange:()=>{zn.value="plain"},"aria-label":"Plain language"}),a("span",{children:"Plain language"})]}),a("label",{class:"ac-workspace__explain-option",children:[a("input",{type:"radio",name:"explain-mode",value:"technical",checked:e==="technical",onChange:()=>{zn.value="technical"},"aria-label":"Technical detail"}),a("span",{children:"Technical detail"})]}),a("p",{class:"ac-workspace__explain-hint",children:e==="plain"?"Replies use everyday words. Toggle to see the technical view.":"Replies keep the technical vocabulary. Toggle for the plain view."})]})}function _s(){if(je(()=>{cs()},[]),Ne.value!==null)return a("div",{class:"ac-page ac-page--error",children:[a("h1",{children:"Workspace"}),a("p",{class:"ac-banner ac-banner--error",children:Ne.value})]});if(!sl.value)return a("div",{class:"ac-page",children:[a("h1",{children:"Workspace"}),a("p",{children:"Loading…"})]});const e=Sn.value!==null?Qe.value.find(n=>n.slug===Sn.value)??null:null;return a("div",{class:"ac-page ac-workspace",children:[a("header",{class:"ac-page__header",children:[a("h1",{children:"Workspace"}),a("p",{class:"ac-page__subtitle",children:"Pick a role, pick a first task, run it."})]}),X.value!==null?a("p",{class:"ac-banner",role:"status",children:X.value}):null,a("div",{class:"ac-workspace__grid",children:[a("section",{class:"ac-workspace__roles","aria-labelledby":"roles-heading",children:[a("h2",{id:"roles-heading",class:"ac-workspace__heading",children:"Roles"}),Qe.value.length===0?a("p",{class:"ac-workspace__empty",children:"No roles installed."}):a("div",{class:"ac-workspace__role-grid",children:Qe.value.map(n=>a(us,{role:n},n.slug))})]}),a("main",{class:"ac-workspace__main","aria-label":"Tasks and sessions",children:[e!==null?a(ds,{role:e}):a("p",{class:"ac-workspace__empty",children:"Pick a role on the left to see its first tasks."}),a(fs,{})]}),a("aside",{class:"ac-workspace__rail","aria-label":"Knowledge and documents",children:[a(ps,{}),a(hs,{}),a(vs,{})]})]})]})}const ul=[{id:"setup",label:"Setup",hashPath:"/setup",matches:["/setup","/wizard"]},{id:"project",label:"Projekt",hashPath:"/project",matches:["/project"]},{id:"tasks",label:"Tasks",hashPath:"/tasks",matches:["/tasks"]},{id:"council",label:"Council",hashPath:"/council",matches:["/council"]},{id:"memory",label:"Memory",hashPath:"/memory",matches:["/memory"]},{id:"explain",label:"Explain",hashPath:"/explain",matches:["/explain"]},{id:"workspace",label:"Workspace",hashPath:"/workspace",matches:["/workspace"]}];function ms(e){for(const n of ul)for(const i of n.matches)if(e===i||e.startsWith(`${i}/`))return n.id;return null}function gs(){const e=fe.value,n=ms(e);return a("header",{class:"ac-topnav",children:a("div",{class:"ac-topnav__inner",children:[a("div",{class:"ac-topnav__brand",children:[a("h1",{class:"ac-topnav__title",children:"@event4u/agent-config"}),a("p",{class:"ac-topnav__subtitle",children:"Browser Wizard"})]}),a("nav",{class:"ac-topnav__tabs","aria-label":"Surfaces",children:ul.map(i=>a("button",{type:"button",class:`ac-topnav__tab${n===i.id?" ac-topnav__tab--active":""}`,"aria-current":n===i.id?"page":void 0,onClick:()=>Qn(i.hashPath),children:i.label},i.id))})]})})}function Ye({name:e}){return a("div",{class:"ac-page",children:[a("header",{class:"ac-page__header",children:a("h1",{children:e})}),a("section",{class:"ac-section",children:[a("p",{class:"ac-section__description",children:["The ",a("strong",{children:e})," surface is currently served by the legacy installer GUI on port ",a("code",{children:"41100"}),". It is being ported to the modern shell in a follow-up phase (road-to-unified-setup § Phase 5)."]}),a("p",{class:"ac-section__description",children:["For now the legacy surface remains reachable via"," ",a("code",{children:"installer gui"}),"."]})]})]})}function ys({path:e}){return a("div",{class:"ac-page ac-page--error",children:[a("h1",{children:"Page not found"}),a("p",{children:["Nothing routed to ",a("code",{children:e}),". Try ",a("a",{href:"#/setup",children:"Setup"}),"."]})]})}function bs(){const e=an.value;return e===null||e.dryRun!==!0?null:a("div",{class:"ac-dryrun-banner",role:"status","aria-live":"polite",children:[a("strong",{children:"DRY RUN"}),a("span",{children:" · no files will be written. Validation + rendering run normally; commits return a preview."})]})}function ks(e){return e==="/"||e==="/setup"||e.startsWith("/setup/")?a(Wn,{path:e}):e.startsWith("/wizard")?a(Wn,{path:e}):e==="/settings"||e.startsWith("/settings/")?a(Wn,{path:"/setup"}):e==="/project"||e.startsWith("/project/")?a(os,{}):e==="/tasks"?a(Ye,{name:"Tasks"}):e==="/council"?a(Ye,{name:"Council"}):e==="/memory"?a(Ye,{name:"Memory"}):e==="/explain"?a(Ye,{name:"Explain"}):e==="/workspace"?a(_s,{}):a(ys,{path:e})}function ws(){return je(()=>{Ll(),(fe.value==="/"||fe.value==="/settings"||fe.value.startsWith("/settings/"))&&Qn("/setup"),Rl()},[]),a(U,{children:[a(bs,{}),a(gs,{}),ks(fe.value)]})}const xs=3e4,As=30*6e4;let Ke=null,mr=!1;function gr(e){if(!mr&&(mr=!0,!(typeof navigator>"u"||typeof navigator.sendBeacon!="function")))try{navigator.sendBeacon(`/api/v1/shutdown?token=${encodeURIComponent(e)}`)}catch{}}function Ss(e){if(typeof window>"u")return()=>{};let n=Date.now();const i=()=>{n=Date.now()},r=["pointerdown","keydown","wheel","touchstart"];for(const c of r)window.addEventListener(c,i,{passive:!0});const t=()=>{document.hidden||i()};document.addEventListener("visibilitychange",t);const l=()=>{Ke!==null&&clearInterval(Ke),Ke=null;for(const c of r)window.removeEventListener(c,i);document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",o)};Ke=setInterval(()=>{if(!document.hidden){if(Date.now()-n>As){gr(e),l();return}x("/api/v1/ping").catch(()=>{})}},xs);function o(){gr(e)}return window.addEventListener("pagehide",o),l}function Cs(){return new URLSearchParams(window.location.search).get("token")}function Ts(){const e=document.getElementById("app");if(e===null)return;const n=Cs();if(n===null){e.textContent="agent-config UI · missing token — re-open via `agent-config ui:serve`.";return}Fl(n),Ss(n),e.textContent="",gl(a(ws,{}),e)}Ts();
|
|
40
|
-
//# sourceMappingURL=index-BAJQeVdX.js.map
|