orc-ai 0.1.62 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.js +898 -802
- package/dist/skills/orc-platform/SKILL.md +1 -1
- package/dist/skills/orc-platform/references/html-kit.md +154 -0
- package/dist/skills/orc-platform/references/scratchpads.md +6 -2
- package/dist/web/assets/{Agents-CHrwONzQ.js → Agents-G5dt5_s6.js} +2 -2
- package/dist/web/assets/Audit-De9E5Tfd.js +1 -0
- package/dist/web/assets/ChatUiRenderer-B1D3eTfy.js +4 -0
- package/dist/web/assets/ConfirmDialog-Cp1PcD4R.js +1 -0
- package/dist/web/assets/{Dashboard-DQC28lbV.js → Dashboard-DWorNfLX.js} +1 -1
- package/dist/web/assets/DocumentWorkspace-DZI0NvGD.js +1 -0
- package/dist/web/assets/FileEditor-CarhD1G9.js +1 -0
- package/dist/web/assets/{IntegrationCallback-CUZ5N-88.js → IntegrationCallback-CuUd_OOy.js} +1 -1
- package/dist/web/assets/JobWebhooks-8emXf4c1.js +1 -0
- package/dist/web/assets/Jobs-ComQ_dFU.js +3 -0
- package/dist/web/assets/Knowledge-Cm2ZVDRs.js +1 -0
- package/dist/web/assets/{MarkdownRenderer-DFhVPrBL.js → MarkdownRenderer-CHALCapQ.js} +5 -5
- package/dist/web/assets/{NativeFolderField-BzXvdqu3.js → NativeFolderField-CdaIEZa-.js} +1 -1
- package/dist/web/assets/PackageCatalog-CcPUM8f8.js +8 -0
- package/dist/web/assets/{PackageRunDialog-9e2Ap03_.js → PackageRunDialog-DV1E6WX3.js} +19 -19
- package/dist/web/assets/{Pager-DQwUM0z7.js → Pager-DZtibAkl.js} +1 -1
- package/dist/web/assets/Projects-BxrWujMD.js +3 -0
- package/dist/web/assets/{ResponsiveFilters-HzhzzjyL.js → ResponsiveFilters-C3siPRT-.js} +1 -1
- package/dist/web/assets/{ResumeActions-M11IqtTQ.js → ResumeActions-0eJvpGmW.js} +1 -1
- package/dist/web/assets/Rules-CHdgAIUd.js +18 -0
- package/dist/web/assets/{ScratchpadDiagramEditor-MXUNosJN.js → ScratchpadDiagramEditor-6R8JsXS3.js} +1 -1
- package/dist/web/assets/Scratchpads-uD9R68sw.js +10 -0
- package/dist/web/assets/{SessionHomeLink-DYWKVgfX.js → SessionHomeLink-CMCZb7Vy.js} +1 -1
- package/dist/web/assets/Sessions-BD9AlzAN.js +4 -0
- package/dist/web/assets/Settings-Bt1even4.js +14 -0
- package/dist/web/assets/Skills-BSsN8kq-.js +3 -0
- package/dist/web/assets/{SourceEditor-x5FG2Umx.js → SourceEditor-V5vL7Aof.js} +4 -4
- package/dist/web/assets/{TagInput-ChFu05vJ.js → TagInput-DU4zMpED.js} +1 -1
- package/dist/web/assets/TaskDetailSheet-C8dGHMsb.js +1 -0
- package/dist/web/assets/{Tasks-D7N3FlZd.js → Tasks-wxRlyx-L.js} +6 -6
- package/dist/web/assets/Terminals-BFRG72xa.js +2 -0
- package/dist/web/assets/{ViewHeader-Bveo_NIZ.js → ViewHeader-CKIR1ZTZ.js} +1 -1
- package/dist/web/assets/{Webhooks-DVSb-CMh.js → Webhooks-Bg3pm4rJ.js} +1 -1
- package/dist/web/assets/{badge-BqTVr27Z.js → badge-DfvoXiLp.js} +1 -1
- package/dist/web/assets/check-DrnDUgkq.js +1 -0
- package/dist/web/assets/chevron-down-C1WyGsAA.js +1 -0
- package/dist/web/assets/chevron-up-ZnWliPW7.js +1 -0
- package/dist/web/assets/{chunk-OB3PAWPO-1IihCzFx.js → chunk-OB3PAWPO-BD6ylT0A.js} +1 -1
- package/dist/web/assets/{circle-check-DWP3C_MJ.js → circle-check-CnioupGj.js} +1 -1
- package/dist/web/assets/{client-954dj6K2.js → client-DigivyCS.js} +1 -1
- package/dist/web/assets/{download-BD7lYc4O.js → download-CNwtbYo1.js} +1 -1
- package/dist/web/assets/{highlighted-body-JLMTFACH-C3KWFdwV.js → highlighted-body-JLMTFACH-dpkthrjz.js} +1 -1
- package/dist/web/assets/{index-NhGnEaeq.js → index-Bc-Nka6Y.js} +50 -49
- package/dist/web/assets/index-BrDTqMtQ.css +1 -0
- package/dist/web/assets/{live-sessions-CGWdUdHs.js → live-sessions-BG3mNXnQ.js} +1 -1
- package/dist/web/assets/{maximize-2-BUxUwGbf.js → maximize-2-CcupqYE8.js} +1 -1
- package/dist/web/assets/mermaid-WFAXDIZX-BX9NWlJb.js +1 -0
- package/dist/web/assets/orc-kit-BZEVA3Qv.js +317 -0
- package/dist/web/assets/{scratchpad-kinds-CaB1JmF7.js → scratchpad-kinds-RGciqVT1.js} +1 -1
- package/dist/web/assets/{scratchpad-routes-BtsIfhUW.js → scratchpad-routes-Q2TRGUnx.js} +1 -1
- package/dist/web/assets/send-0IpktRLv.js +1 -0
- package/dist/web/assets/{upload-CPf6QZHl.js → upload-CaDKCpy5.js} +1 -1
- package/dist/web/assets/{useDetailRoute-DOhAbdV7.js → useDetailRoute-B-xjWsyW.js} +1 -1
- package/dist/web/assets/{useIntegrations-C0MAVKB4.js → useIntegrations-C6zijOMH.js} +1 -1
- package/dist/web/assets/{useJobs-BlWldKP0.js → useJobs-Dly6n-pv.js} +1 -1
- package/dist/web/assets/{useMemories-CAf8HcOI.js → useMemories-jakANU6m.js} +1 -1
- package/dist/web/assets/useProjectScope-DpgzthH7.js +1 -0
- package/dist/web/assets/{useSessions-DiUU2FN8.js → useSessions-tFa1FZ9M.js} +1 -1
- package/dist/web/assets/{view-params-DD7i9s5g.js → view-params-YEmeZppw.js} +1 -1
- package/dist/web/assets/{x-tY-z3woy.js → x-BayoBYp_.js} +1 -1
- package/dist/web/index.html +11 -18
- package/dist/web/sw.js +26 -17
- package/package.json +1 -1
- package/dist/web/assets/Audit-CImYAb-T.js +0 -1
- package/dist/web/assets/ChatUiRenderer-BkqPz_3-.js +0 -4
- package/dist/web/assets/ConfirmDialog-B5es4nUp.js +0 -1
- package/dist/web/assets/DocumentWorkspace-Ba691e5k.js +0 -1
- package/dist/web/assets/FileEditor-DL66rsR_.js +0 -1
- package/dist/web/assets/JobWebhooks-D6N__-Or.js +0 -1
- package/dist/web/assets/Jobs-ByM0xl7-.js +0 -3
- package/dist/web/assets/Knowledge-CPfft_nC.js +0 -1
- package/dist/web/assets/Markdown-C-3YfTSg.js +0 -2
- package/dist/web/assets/MarkdownEditor-Dv5kCc29.js +0 -2
- package/dist/web/assets/PackageCatalog-CkWSxsZn.js +0 -8
- package/dist/web/assets/Projects-B7DXmjIX.js +0 -3
- package/dist/web/assets/Rules-BFW_OcW_.js +0 -18
- package/dist/web/assets/Scratchpads-KW5J8Ufq.js +0 -10
- package/dist/web/assets/Sessions-BrOvkZB8.js +0 -4
- package/dist/web/assets/Settings-CHlPiV6t.js +0 -14
- package/dist/web/assets/Skills-DgOnOKie.js +0 -3
- package/dist/web/assets/TaskDetailSheet-BVmehTN7.js +0 -1
- package/dist/web/assets/Terminals-j55maqYv.js +0 -2
- package/dist/web/assets/check-Cg2_C_4I.js +0 -1
- package/dist/web/assets/chevron-down-KBvm_HoX.js +0 -1
- package/dist/web/assets/dialog-DNIYhwi4.js +0 -1
- package/dist/web/assets/file-kind-BYU1kv95.js +0 -1
- package/dist/web/assets/index-hvCYuRJb.css +0 -1
- package/dist/web/assets/label-Bm_d0NKL.js +0 -1
- package/dist/web/assets/mermaid-WFAXDIZX-Dr-vK9VQ.js +0 -1
- package/dist/web/assets/select-cyLFVkkB.js +0 -1
- package/dist/web/assets/tabs-bEwJLtA0.js +0 -1
- package/dist/web/assets/textarea-CovStda2.js +0 -1
- package/dist/web/assets/useProjectScope-DtEj9j-P.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{n as r,t as i}from"./useMutation-CRAWY7v2.js";import{f as a,u as o}from"./chunk-OB3PAWPO-
|
|
2
|
-
`)}};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{n as r,t as i}from"./useMutation-CRAWY7v2.js";import{f as a,u as o}from"./chunk-OB3PAWPO-BD6ylT0A.js";import{t as s}from"./button-By-NN7c7.js";import{n as c}from"./client-DigivyCS.js";import{t as l}from"./download-CNwtbYo1.js";import{$ as u,An as d,Br as f,Bt as p,En as m,Et as h,Gr as g,Kr as _,Q as v,Qt as y,Rr as b,Vr as x,Yn as S,ct as C,dn as ee,et as te,fn as ne,hn as re,mn as ie,pn as ae,tt as oe,un as se}from"./index-Bc-Nka6Y.js";var ce=Symbol.for(`yaml.alias`),le=Symbol.for(`yaml.document`),w=Symbol.for(`yaml.map`),T=Symbol.for(`yaml.pair`),E=Symbol.for(`yaml.scalar`),ue=Symbol.for(`yaml.seq`),D=Symbol.for(`yaml.node.type`),de=e=>!!e&&typeof e==`object`&&e[D]===ce,fe=e=>!!e&&typeof e==`object`&&e[D]===le,O=e=>!!e&&typeof e==`object`&&e[D]===w,k=e=>!!e&&typeof e==`object`&&e[D]===T,A=e=>!!e&&typeof e==`object`&&e[D]===E,j=e=>!!e&&typeof e==`object`&&e[D]===ue;function M(e){if(e&&typeof e==`object`)switch(e[D]){case w:case ue:return!0}return!1}function N(e){if(e&&typeof e==`object`)switch(e[D]){case ce:case w:case E:case ue:return!0}return!1}var pe=e=>(A(e)||M(e))&&!!e.anchor,P=Symbol(`break visit`),F=Symbol(`skip children`),I=Symbol(`remove node`);function me(e,t){let n=he(t);fe(e)?L(null,e.contents,n,Object.freeze([e]))===I&&(e.contents=null):L(null,e,n,Object.freeze([]))}me.BREAK=P,me.SKIP=F,me.REMOVE=I;function L(e,t,n,r){let i=ge(e,t,n,r);if(N(i)||k(i))return _e(e,r,i),L(e,i,n,r);if(typeof i!=`symbol`){if(M(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=L(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===P)return P;else i===I&&(t.items.splice(e,1),--e)}}else if(k(t)){r=Object.freeze(r.concat(t));let e=L(`key`,t.key,n,r);if(e===P)return P;e===I&&(t.key=null);let i=L(`value`,t.value,n,r);if(i===P)return P;i===I&&(t.value=null)}}return i}function he(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function ge(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(O(t))return n.Map?.(e,t,r);if(j(t))return n.Seq?.(e,t,r);if(k(t))return n.Pair?.(e,t,r);if(A(t))return n.Scalar?.(e,t,r);if(de(t))return n.Alias?.(e,t,r)}function _e(e,t,n){let r=t[t.length-1];if(M(r))r.items[e]=n;else if(k(r))e===`key`?r.key=n:r.value=n;else if(fe(r))r.contents=n;else{let e=de(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var R={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},z=e=>e.replace(/[!,[\]{}]/g,e=>R[e]),B=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+z(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&N(e.contents)){let t={};me(e.contents,(e,n)=>{N(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
2
|
+
`)}};B.defaultYaml={explicit:!1,version:`1.2`},B.defaultTags={"!!":`tag:yaml.org,2002:`};function V(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function H(e){let t=new Set;return me(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function ve(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function ye(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=H(e);let a=ve(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(A(t.node)||M(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function be(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=be(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=be(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=be(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=be(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function U(e,t,n){if(Array.isArray(e))return e.map((e,t)=>U(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!pe(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var W=class{constructor(e){Object.defineProperty(this,D,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!fe(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=U(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?be(i,{"":o},``,o):o}},xe=class extends W{constructor(e){super(ce),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],me(e,{Node:(e,t)=>{(de(t)||pe(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(U(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Se(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(V(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Se(e,t,n){if(de(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(M(t)){let r=0;for(let i of t.items){let t=Se(e,i,n);t>r&&(r=t)}return r}if(k(t)){let r=Se(e,t.key,n),i=Se(e,t.value,n);return Math.max(r,i)}return 1}var Ce=e=>!e||typeof e!=`function`&&typeof e!=`object`,G=class extends W{constructor(e){super(E),this.value=e}toJSON(e,t){return t?.keep?this.value:U(this.value,e,t)}toString(){return String(this.value)}};G.BLOCK_FOLDED=`BLOCK_FOLDED`,G.BLOCK_LITERAL=`BLOCK_LITERAL`,G.PLAIN=`PLAIN`,G.QUOTE_DOUBLE=`QUOTE_DOUBLE`,G.QUOTE_SINGLE=`QUOTE_SINGLE`;var we=`tag:yaml.org,2002:`;function Te(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Ee(e,t,n){if(fe(e)&&(e=e.contents),N(e))return e;if(k(e)){let t=n.schema[w].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new xe(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=we+t.slice(2));let l=Te(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new G(e);return c&&(c.node=t),t}l=e instanceof Map?o[w]:Symbol.iterator in Object(e)?o[ue]:o[w]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new G(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function De(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Ee(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Oe=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,ke=class extends W{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>N(t)||k(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Oe(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(M(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,De(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(M(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&A(i)?i.value:i:M(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!k(t))return!1;let n=t.value;return n==null||e&&A(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return M(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(M(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,De(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ae=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function K(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var je=(e,t,n)=>e.endsWith(`
|
|
3
3
|
`)?K(n,t):n.includes(`
|
|
4
4
|
`)?`
|
|
5
5
|
`+K(n,t):(e.endsWith(` `)?``:` `)+n,Me=`flow`,Ne=`block`,Pe=`quoted`;function Fe(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=Ie(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
@@ -24,29 +24,29 @@ import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./j
|
|
|
24
24
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=Le(r,!0);o!==`folded`&&t!==G.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Fe(`${v}${e}${p}`,l,Ne,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Ge(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
25
25
|
`)||u&&/[[\]{},]/.test(a))return He(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
26
26
|
`)?He(a,t):We(e,t,n,r);if(!s&&!u&&i!==G.PLAIN&&a.includes(`
|
|
27
|
-
`))return We(e,t,n,r);if(Re(a)){if(c===``)return t.forceBlockIndent=!0,We(e,t,n,r);if(s&&c===l)return He(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return He(a,t)}return s?d:Fe(d,c,Me,Le(t,!1))}function Ke(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==G.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=G.QUOTE_DOUBLE);let c=e=>{switch(e){case G.BLOCK_FOLDED:case G.BLOCK_LITERAL:return i||a?He(o.value,t):We(o,t,n,r);case G.QUOTE_DOUBLE:return Be(o.value,t);case G.QUOTE_SINGLE:return Ve(o.value,t);case G.PLAIN:return Ge(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function qe(e,t){let n=Object.assign({blockQuote:!0,commentString:Ae,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Je(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(
|
|
28
|
-
`:``,v){let e=l(v);
|
|
29
|
-
`&&y&&(
|
|
27
|
+
`))return We(e,t,n,r);if(Re(a)){if(c===``)return t.forceBlockIndent=!0,We(e,t,n,r);if(s&&c===l)return He(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return He(a,t)}return s?d:Fe(d,c,Me,Le(t,!1))}function Ke(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==G.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=G.QUOTE_DOUBLE);let c=e=>{switch(e){case G.BLOCK_FOLDED:case G.BLOCK_LITERAL:return i||a?He(o.value,t):We(o,t,n,r);case G.QUOTE_DOUBLE:return Be(o.value,t);case G.QUOTE_SINGLE:return Ve(o.value,t);case G.PLAIN:return Ge(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function qe(e,t){let n=Object.assign({blockQuote:!0,commentString:Ae,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Je(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(A(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Ye(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(A(e)||M(e))&&e.anchor;a&&V(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Xe(e,t,n,r){if(k(e))return e.toString(t,n,r);if(de(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=N(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Je(t.doc.schema.tags,a);let o=Ye(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):A(a)?Ke(a,t,n,r):a.toString(t,n,r);return o?A(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Ze({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=N(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(M(e)||!N(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||M(e)||(A(e)?e.type===G.BLOCK_FOLDED||e.type===G.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Xe(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=je(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=je(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=je(g,n.indent,l(f))));let _,v,y;N(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&A(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&j(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Xe(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
28
|
+
`:``,v){let e=l(v);S+=`\n${K(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
29
|
+
`&&y&&(S=`
|
|
30
30
|
|
|
31
|
-
`):
|
|
32
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=
|
|
33
|
-
`)&&(
|
|
31
|
+
`):S+=`\n${n.indent}`}else if(!p&&M(t)){let e=x[0],r=x.indexOf(`
|
|
32
|
+
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
|
33
|
+
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=je(g,n.indent,l(y)):h&&i&&i(),g}function Qe(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var $e=`<<`,q={identify:e=>e===$e||typeof e==`symbol`&&e.description===$e,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new G(Symbol($e)),{addToJSMap:tt}),stringify:()=>$e},et=(e,t)=>(q.identify(t)||A(t)&&(!t.type||t.type===G.PLAIN)&&q.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===q.tag&&e.default);function tt(e,t,n){let r=rt(e,n);if(j(r))for(let n of r.items)nt(e,t,n);else if(Array.isArray(r))for(let n of r)nt(e,t,n);else nt(e,t,r)}function nt(e,t,n){let r=rt(e,n);if(!O(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function rt(e,t){return e&&de(t)?t.resolve(e.doc,e):t}function it(e,t,{key:n,value:r}){if(N(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(et(e,n))tt(e,t,r);else{let i=U(n,``,e);if(t instanceof Map)t.set(i,U(r,i,e));else if(t instanceof Set)t.add(i);else{let a=at(n,i,e),o=U(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function at(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(N(e)&&n?.doc){let t=qe(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Qe(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function ot(e,t,n){return new J(Ee(e,void 0,n),Ee(t,void 0,n))}var J=class e{constructor(e,t=null){Object.defineProperty(this,D,{value:T}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return N(n)&&(n=n.clone(t)),N(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return it(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Ze(this,e,t,n):JSON.stringify(this)}};function st(e,t,n){return(t.inFlow??e.flow?lt:ct)(e,t,n)}function ct({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(N(i))!d&&i.spaceBefore&&f.push(``),ut(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(k(i)){let e=N(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),ut(n,f,e.commentBefore,d))}d=!1;let s=Xe(i,u,()=>o=null,()=>d=!0);o&&(s+=je(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
34
34
|
`}}return e?(p+=`
|
|
35
|
-
`+K(l(e),c),s&&s()):d&&o&&o(),p}function lt({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(
|
|
35
|
+
`+K(l(e),c),s&&s()):d&&o&&o(),p}function lt({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(N(i))i.spaceBefore&&d.push(``),ut(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(k(i)){let e=N(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),ut(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=N(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Xe(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
36
36
|
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=je(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
37
|
-
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function ut({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=K(t(r),e);n.push(i.trimStart())}}function dt(e,t){let n=
|
|
38
|
-
`:` `)}return Ke({comment:e,type:t,value:s},r,i,a)}};function Pt(e,t){if(
|
|
37
|
+
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function ut({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=K(t(r),e);n.push(i.trimStart())}}function dt(e,t){let n=A(t)?t.value:t;for(let r of e)if(k(r)&&(r.key===t||r.key===n||A(r.key)&&r.key.value===n))return r}var Y=class extends ke{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(w,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(ot(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=k(e)?e:!e||typeof e!=`object`||!(`key`in e)?new J(e,e?.value):new J(e.key,e.value);let r=dt(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);A(r.value)&&Ce(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=dt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=dt(this.items,e)?.value;return(!t&&A(n)?n.value:n)??void 0}has(e){return!!dt(this.items,e)}set(e,t){this.add(new J(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)it(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!k(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),st(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},ft={collection:`map`,default:!0,nodeClass:Y,tag:`tag:yaml.org,2002:map`,resolve(e,t){return O(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Y.from(e,t,n)},pt=class extends ke{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(ue,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=mt(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=mt(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&A(r)?r.value:r}has(e){let t=mt(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=mt(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];A(r)&&Ce(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(U(e,String(r++),t));return n}toString(e,t,n){return e?st(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Ee(a,void 0,n))}}return i}};function mt(e){let t=A(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var ht={collection:`seq`,default:!0,nodeClass:pt,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return j(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>pt.from(e,t,n)},gt={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ke(e,t,n,r)}},_t={identify:e=>e==null,createNode:()=>new G(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new G(null),stringify:({source:e},t)=>typeof e==`string`&&_t.test.test(e)?e:t.options.nullStr},vt={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new G(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&vt.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function X({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var yt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:X},bt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():X(e)}},xt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new G(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:X},St=e=>typeof e==`bigint`||Number.isInteger(e),Ct=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function wt(e,t,n){let{value:r}=e;return St(r)&&r>=0?n+r.toString(t):X(e)}var Tt={identify:e=>St(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Ct(e,2,8,n),stringify:e=>wt(e,8,`0o`)},Et={identify:St,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Ct(e,0,10,n),stringify:X},Dt={identify:e=>St(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Ct(e,2,16,n),stringify:e=>wt(e,16,`0x`)},Ot=[ft,ht,gt,_t,vt,Tt,Et,Dt,yt,bt,xt];function kt(e){return typeof e==`bigint`||Number.isInteger(e)}var At=({value:e})=>JSON.stringify(e),jt=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:At},{identify:e=>e==null,createNode:()=>new G(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:At},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:At},{identify:kt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>kt(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:At}],Mt=[ft,ht].concat(jt,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Nt={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=G.BLOCK_LITERAL,t!==G.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===G.BLOCK_LITERAL?`
|
|
38
|
+
`:` `)}return Ke({comment:e,type:t,value:s},r,i,a)}};function Pt(e,t){if(j(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!k(r)){if(O(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new J(new G(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=k(r)?r:new J(r)}}else t(`Expected a sequence for this tag`);return e}function Ft(e,t,n){let{replacer:r}=n,i=new pt(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(ot(o,s,n))}return i}var It={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Pt,createNode:Ft},Lt=class e extends pt{constructor(){super(),this.add=Y.prototype.add.bind(this),this.delete=Y.prototype.delete.bind(this),this.get=Y.prototype.get.bind(this),this.has=Y.prototype.has.bind(this),this.set=Y.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(k(e)?(r=U(e.key,``,t),i=U(e.value,r,t)):r=U(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Ft(e,t,n),i=new this;return i.items=r.items,i}};Lt.tag=`tag:yaml.org,2002:omap`;var Rt={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Lt,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Pt(e,t),r=[];for(let{key:e}of n.items)A(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Lt,n)},createNode:(e,t,n)=>Lt.from(e,t,n)};function zt({value:e,source:t},n){return t&&(e?Bt:Vt).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Bt={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new G(!0),stringify:zt},Vt={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new G(!1),stringify:zt},Ht={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:X},Ut={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():X(e)}},Wt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new G(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:X},Gt=e=>typeof e==`bigint`||Number.isInteger(e);function Kt(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function qt(e,t,n){let{value:r}=e;if(Gt(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return X(e)}var Jt={identify:Gt,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Kt(e,2,2,n),stringify:e=>qt(e,2,`0b`)},Yt={identify:Gt,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Kt(e,1,8,n),stringify:e=>qt(e,8,`0`)},Xt={identify:Gt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Kt(e,0,10,n),stringify:X},Zt={identify:Gt,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Kt(e,2,16,n),stringify:e=>qt(e,16,`0x`)},Qt=class e extends Y{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=k(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new J(e.key,null):new J(e,null),dt(this.items,t.key)||this.items.push(t)}get(e,t){let n=dt(this.items,e);return!t&&k(n)?A(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=dt(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new J(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(ot(e,null,n));return i}};Qt.tag=`tag:yaml.org,2002:set`;var $t={collection:`map`,identify:e=>e instanceof Set,nodeClass:Qt,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Qt.from(e,t,n),resolve(e,t){if(O(e)){if(e.hasAllNullValues(!0))return Object.assign(new Qt,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function en(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function tn(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return X(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var nn={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>en(e,n),stringify:tn},rn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>en(e,!1),stringify:tn},an={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(an.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=en(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},on=[ft,ht,gt,_t,Bt,Vt,Jt,Yt,Xt,Zt,Ht,Ut,Wt,Nt,q,Rt,It,$t,nn,rn,an],sn=new Map([[`core`,Ot],[`failsafe`,[ft,ht,gt]],[`json`,Mt],[`yaml11`,on],[`yaml-1.1`,on]]),cn={binary:Nt,bool:vt,float:xt,floatExp:bt,floatNaN:yt,floatTime:rn,int:Et,intHex:Dt,intOct:Tt,intTime:nn,map:ft,merge:q,null:_t,omap:Rt,pairs:It,seq:ht,set:$t,timestamp:an},ln={"tag:yaml.org,2002:binary":Nt,"tag:yaml.org,2002:merge":q,"tag:yaml.org,2002:omap":Rt,"tag:yaml.org,2002:pairs":It,"tag:yaml.org,2002:set":$t,"tag:yaml.org,2002:timestamp":an};function un(e,t,n){let r=sn.get(t);if(r&&!e)return n&&!r.includes(q)?r.concat(q):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(sn.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(q)),i.reduce((e,t)=>{let n=typeof t==`string`?cn[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(cn).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var dn=(e,t)=>e.key<t.key?-1:+(e.key>t.key),fn=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?un(e,`compat`):e?un(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?ln:{},this.tags=un(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,w,{value:ft}),Object.defineProperty(this,E,{value:gt}),Object.defineProperty(this,ue,{value:ht}),this.sortMapEntries=typeof a==`function`?a:a===!0?dn:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function pn(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=qe(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(K(t,``))}let o=!1,s=null;if(e.contents){if(N(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(K(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=Xe(e.contents,i,()=>s=null,t);s&&(c+=je(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Xe(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
|
|
39
39
|
`)?(n.push(`...`),n.push(K(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(K(a(t),``)))}return n.join(`
|
|
40
40
|
`)+`
|
|
41
|
-
`}var mn=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,
|
|
42
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function bn(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,
|
|
43
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(xn(t.key)||xn(t.value))return!0}return!1;default:return!0}}function Sn(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&xn(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Cn(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||
|
|
41
|
+
`}var mn=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,D,{value:le});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new B({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[D]:{value:le}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=N(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){hn(this.contents)&&this.contents.add(e)}addIn(e,t){hn(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=H(this);e.anchor=!t||n.has(t)?ve(t||`a`,n):t}return new xe(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=ye(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=Ee(e,l,p);return o&&M(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new J(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return hn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Oe(e)?this.contents!=null&&(this.contents=null,!0):hn(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return M(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Oe(e)?!t&&A(this.contents)?this.contents.value:this.contents:M(this.contents)?this.contents.getIn(e,t):void 0}has(e){return M(this.contents)?this.contents.has(e):!1}hasIn(e){return Oe(e)?this.contents!==void 0:M(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=De(this.schema,[e],t):hn(this.contents)&&this.contents.set(e,t)}setIn(e,t){Oe(e)?this.contents=t:this.contents==null?this.contents=De(this.schema,Array.from(e),t):hn(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new B({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new B({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new fn(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=U(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?be(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return pn(this,e)}};function hn(e){if(M(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var gn=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},_n=class extends gn{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},vn=class extends gn{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},yn=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
42
|
+
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function bn(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function xn(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
43
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(xn(t.key)||xn(t.value))return!0}return!1;default:return!0}}function Sn(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&xn(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Cn(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||A(e)&&A(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var wn=`All mapping items must start at the same column`;function Tn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Y)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=bn(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,wn)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
44
44
|
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||xn(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,wn);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Sn(r.indent,u,i),n.atKey=!1,Cn(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=bn(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&Sn(r.indent,f,i),s=c.range[2];let l=new J(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
45
45
|
`+_.comment:g.comment=_.comment);let e=new J(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function En({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??pt)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=bn(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&Sn(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Dn(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var On=`Block collections are not allowed within flow collections`,kn=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function An({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?Y:pt))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=bn(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
46
|
-
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&xn(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];
|
|
46
|
+
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&xn(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];k(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
47
47
|
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],kn(m)&&i(r.range,`BLOCK_IN_FLOW`,On)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);kn(f)&&i(g.range,`BLOCK_IN_FLOW`,On),n.atKey=!1;let _=bn(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?kn(m)&&i(v.range,`BLOCK_IN_FLOW`,On):_.comment&&(g.comment?g.comment+=`
|
|
48
48
|
`+_.comment:g.comment=_.comment);let y=new J(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Cn(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Y(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=Dn(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
49
|
-
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function jn(e,t,n,r,i,a){let o=n.type===`block-map`?Tn(e,t,n,r,a):n.type===`block-seq`?En(e,t,n,r,a):An(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Mn(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Y.tagName&&s===`map`||o===pt.tagName&&s===`seq`)return jn(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),jn(e,t,n,i,o)}let l=jn(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=
|
|
49
|
+
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function jn(e,t,n,r,i,a){let o=n.type===`block-map`?Tn(e,t,n,r,a):n.type===`block-seq`?En(e,t,n,r,a):An(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Mn(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Y.tagName&&s===`map`||o===pt.tagName&&s===`seq`)return jn(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),jn(e,t,n,i,o)}let l=jn(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=N(u)?u:new G(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Nn(e,t,n){let r=t.offset,i=Pn(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?G.BLOCK_FOLDED:G.BLOCK_LITERAL,o=t.source?Fn(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
50
50
|
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
51
51
|
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===G.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
52
52
|
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
@@ -74,10 +74,10 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
74
74
|
`);)r===`
|
|
75
75
|
`&&(n+=`
|
|
76
76
|
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Hn={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
77
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Un(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Wn(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Nn(e,t,r):In(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[
|
|
77
|
+
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Un(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Wn(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Nn(e,t,r):In(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[E]:c?Gn(e.schema,i,c,n,r):t.type===`scalar`?Kn(e,i,t,r):e.schema[E];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=A(a)?a:new G(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new G(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Gn(e,t,n,r,i){if(n===`!`)return e[E];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[E])}function Kn({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[E];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[E];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function qn(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Jn={composeNode:Yn,composeEmptyNode:Xn};function Yn(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Zn(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Wn(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=Mn(Jn,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Xn(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!A(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Xn(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Wn(e,{type:`scalar`,offset:qn(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Zn({options:e},{offset:t,source:n,end:r},i){let a=new xe(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=Dn(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Qn(e,t,{offset:n,start:r,value:i,end:a},o){let s=new mn(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=bn(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Yn(c,i,l,o):Xn(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Dn(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function $n(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function er(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
78
78
|
|
|
79
79
|
`:`
|
|
80
|
-
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var tr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=$n(e);r?this.warnings.push(new vn(i,t,n)):this.errors.push(new _n(i,t,n))},this.directives=new
|
|
80
|
+
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var tr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=$n(e);r?this.warnings.push(new vn(i,t,n)):this.errors.push(new _n(i,t,n))},this.directives=new B({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=er(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(M(i)&&!i.flow&&i.items.length>0){let e=i.items[0];k(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:er(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=$n(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Qn(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new _n($n(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new _n($n(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Dn(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new _n($n(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new mn(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},nr=Symbol(`break visit`),rr=Symbol(`skip children`),ir=Symbol(`remove item`);function ar(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),or(Object.freeze([]),e,t)}ar.BREAK=nr,ar.SKIP=rr,ar.REMOVE=ir,ar.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},ar.parentCollection=(e,t)=>{let n=ar.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function or(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=or(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===nr)return nr;else r===ir&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function sr(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
81
81
|
`:case`\r
|
|
82
82
|
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Z(e){switch(e){case void 0:case` `:case`
|
|
83
83
|
`:case`\r`:case` `:return!0;default:return!1}}var cr=new Set(`0123456789ABCDEFabcdef`),lr=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),ur=new Set(`,[]{}`),dr=new Set(` ,[]{}
|
|
@@ -102,4 +102,4 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
102
102
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
103
103
|
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){br(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(hr(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=yr(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(hr(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(_r(t.key)&&!hr(t.sep,`newline`)){let e=yr(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):hr(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!hr(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){br(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||hr(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=yr(vr(t));xr(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
104
104
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
105
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=yr(vr(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=yr(vr(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Cr(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mr||null,prettyErrors:t}}function wr(e,t={}){let{lineCounter:n,prettyErrors:r}=Cr(t),i=new Sr(n?.addNewLine),a=new tr(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new _n(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(yn(e,n)),o.warnings.forEach(yn(e,n))),o}function Tr(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return pe(e)&&!r?e.toString(n):new mn(e,r,n).toString(n)}var Q=e(t(),1),$=n();function Er({initial:e,onClose:t}){let[n,ue]=(0,Q.useState)({...e,tool:`apm`}),[de,S]=(0,Q.useState)(),[C,w]=(0,Q.useState)(!1),[fe,T]=(0,Q.useState)(!1),[E,pe]=(0,Q.useState)(`run`),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),k=a(),A=o(),j=x(),M=ae(),me=oe(),N=te(),P=n.host===void 0?M.data?.host??null:n.host,[F,he]=(0,Q.useState)(`terminal`),[I,ge]=(0,Q.useState)(`context`),[_e,ve]=(0,Q.useState)(!1),L=r({queryKey:[`package-tools`,P],queryFn:()=>c.packageTools.list(P),enabled:!!M.data}),R=r({queryKey:[`package-launch-host`,P],queryFn:()=>c.terminals.list(P),enabled:!!M.data,retry:!1}),z=r({queryKey:[`setup-components`,n.packages],enabled:n.packages.length>0,queryFn:()=>Promise.all(n.packages.map(e=>c.agentPackages.get(e)))}),B=r({queryKey:[`agent`,n.agent],queryFn:()=>c.agents.get(n.agent),enabled:!!n.agent}),V=i({mutationFn:c.agentSetups.command});(0,Q.useEffect)(()=>{V.data&&D.current?.scrollIntoView({block:`nearest`})},[V.data]);let ye=z.data?.some(e=>e.format===`agent-plugin`),be=ye&&n.backend===`claude`,H=z.data?.some(e=>e.format===`apm`||n.backend!==`codex`),U=!!(n.cwd.trim()&&(n.packages.length||n.agent)&&n.name.trim())&&L.data?.bun&&(!H||L.data?.apm)&&!be&&!z.error&&!z.isFetching&&!B.error&&!B.isFetching&&!R.isFetching&&!R.error;function W(e){ue(t=>({...t,...e})),V.reset(),T(!1),S(void 0),ve(!1)}async function xe(e){w(!0),S(void 0);try{if(e===`run`&&F===`chat`){let e=await c.chat.fromSetup({...n,host:P});N.openThread(e,{follow:!1}),n.prompt.trim()&&N.send(n.prompt);let r=new URLSearchParams(A.search);r.set(`chat`,`open`),r.set(`chatThread`,e.id),t(),k(`${A.pathname}?${r}`);return}let r=await j.create({kind:n.backend,name:`${n.name}${e===`install`?` · install`:``}`,host:P,setup:{...n,host:P,operation:e}});t(),k(le(`/terminals/${r.id}`,new URLSearchParams(A.search).get(`project`)??`all`,A.search))}catch(e){S(e.message)}finally{w(!1)}}return(0,$.jsx)(b,{open:!0,onOpenChange:e=>!e&&!_e&&!C&&!V.isPending&&t(),children:(0,$.jsxs)(v,{closeDisabled:C||V.isPending||_e,className:`flex min-w-0 w-[min(960px,calc(100vw-2rem))] max-w-none max-h-[calc(var(--app-height,100dvh)-2rem)] flex-col gap-0 overflow-hidden p-0`,children:[(0,$.jsxs)(g,{className:`shrink-0 border-b px-4 py-4 pr-12 sm:px-6`,children:[(0,$.jsx)(y,{children:n.packages.length?`Use package`:`Launch agent`}),(0,$.jsx)(ee,{className:`sr-only`,children:`Choose the context and instructions, then launch or install configuration.`})]}),(0,$.jsxs)(m,{value:I,onValueChange:ge,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(p,{"aria-label":`Launch setup`,className:`shrink-0 justify-start border-b rounded-none px-4 sm:px-6`,children:[(0,$.jsx)(d,{value:`context`,"data-testid":`setup-context-tab`,disabled:C||V.isPending,children:`Context`}),(0,$.jsx)(d,{value:`instructions`,"data-testid":`setup-instructions-tab`,disabled:C||V.isPending,children:`Instructions`})]}),(0,$.jsxs)(`div`,{"data-testid":`package-setup-body`,className:`min-h-0 min-w-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-4 py-4 sm:px-6`,children:[(0,$.jsxs)(`fieldset`,{disabled:C||V.isPending,className:`min-w-0 space-y-4`,children:[(0,$.jsxs)(f,{value:`context`,forceMount:!0,className:`mt-0 space-y-4 data-[state=inactive]:hidden`,children:[(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(h,{htmlFor:`setup-host`,children:`Host`}),(0,$.jsxs)(`select`,{id:`setup-host`,"data-testid":`setup-host`,className:`form-control form-control-single`,value:P??``,onChange:e=>W({host:e.target.value||null,cwd:``}),children:[(0,$.jsx)(`option`,{value:``,children:`Local`}),[...new Set([...M.data?.hosts??[],...M.data?.host?[M.data.host]:[]])].map(e=>(0,$.jsx)(`option`,{value:e,children:e},e))]})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(h,{htmlFor:`setup-backend`,children:`Coding agent`}),(0,$.jsx)(`select`,{id:`setup-backend`,"data-testid":`setup-backend`,className:`form-control form-control-single`,value:n.backend,onChange:e=>W({backend:e.target.value}),children:[`claude`,`codex`,`copilot`].map(e=>(0,$.jsxs)(`option`,{value:e,disabled:!!(ye&&e===`claude`),children:[e,ye&&e===`claude`?` · unsupported for this plugin`:R.data?.launchers.includes(e)?``:` · not installed`]},e))})]})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(h,{htmlFor:`setup-cwd`,children:[`Working folder on `,P??`Local`]}),(0,$.jsxs)(`select`,{"data-testid":`setup-project-folder`,"aria-label":`Fill working folder from a project (optional)`,className:`form-control form-control-single`,value:``,onChange:e=>{e.target.value&&W({cwd:e.target.value})},children:[(0,$.jsx)(`option`,{value:``,children:`Use a project folder (optional)…`}),me.data?.filter(e=>e.scope).map(e=>(0,$.jsx)(`option`,{value:e.scope??``,children:e.name},e.id))]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(ie,{id:`setup-cwd`,"data-testid":`setup-cwd`,value:n.cwd,onChange:e=>W({cwd:e.target.value})}),(0,$.jsx)(s,{type:`button`,variant:`outline`,"data-testid":`setup-browse`,ref:O,disabled:R.isFetching||!!R.error||!P&&!R.data?.ready,onClick:async()=>{if(P)ve(!0);else try{let e=await c.terminals.pickFolder(n.cwd||void 0,null);e.path&&W({cwd:e.path})}catch(e){S(e.message)}},children:`Browse`})]}),(0,$.jsx)(ne,{open:_e&&!!P,onOpenChange:ve,host:P,initial:n.cwd,onPick:e=>W({cwd:e}),returnFocusRef:O})]}),(0,$.jsxs)(`details`,{"data-testid":`setup-components`,className:`text-sm space-y-1`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer min-h-11 content-center sm:min-h-8`,children:`Configuration to apply`}),B.data&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`p`,{children:[B.data.name,` · agent instructions`,B.data.fields.model?` · ${B.data.fields.model}`:``]}),P&&(0,$.jsxs)(`p`,{className:`text-xs text-outline`,children:[`Supporting files referenced by this agent are not transferred. Make them available at the referenced paths on `,P,`.`]})]}),z.isFetching&&(0,$.jsx)(`p`,{children:`Checking package contents…`}),z.data?.map(e=>(0,$.jsxs)(`p`,{className:`wrap-break-word`,children:[e.name,`:`,` `,e.files.filter(e=>/^(skills|\.apm\/skills)\/[^/]+\/SKILL\.md$/.test(e.name)).length,` `,`skill files`,e.files.some(e=>e.name===`mcp.json`)?`, native MCP configuration`:``,e.files.some(e=>e.name.endsWith(`.instructions.md`))?`, shared instructions`:``]},e.name))]})]}),(0,$.jsx)(f,{value:`instructions`,forceMount:!0,className:`mt-0 space-y-4 data-[state=inactive]:hidden`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(h,{htmlFor:`setup-prompt`,children:`What should the agent work on?`}),(0,$.jsx)(u,{id:`setup-prompt`,"data-testid":`setup-prompt`,rows:5,value:n.prompt,onChange:e=>W({prompt:e.target.value})})]})})]}),(0,$.jsxs)(`details`,{className:`text-xs text-outline`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer min-h-11 flex items-center sm:min-h-8`,children:`How configuration is applied`}),(0,$.jsx)(`p`,{children:`Package files are transferred to the selected host when needed. APM deploys agent configuration into the working folder; Codex plugins install into Codex's user cache on that host. These tools must already be installed. Configuration remains after the session; use a terminal for installer trust or conflict prompts.`})]}),be&&(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Choose Codex or Copilot for this Agent Plugin.`}),L.data&&H&&!L.data.apm&&(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm`,children:[`APM 0.33.0 or newer must be available on `,P??`Local`,`.`]}),L.data&&!L.data.bun&&(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm`,children:[`Bun must be available on `,P??`Local`,`.`]}),!R.data?.ready&&F===`terminal`&&(0,$.jsx)(`p`,{role:`alert`,className:`text-sm`,children:R.data?.reason??`Checking terminal availability…`}),F===`chat`&&n.backend===`copilot`&&(0,$.jsx)(`p`,{role:`alert`,className:`text-sm`,children:`Chat requires Claude or Codex. Choose another coding agent in Context.`}),(de||V.error||z.error||B.error||L.error||R.error||M.error)&&(0,$.jsx)(`p`,{role:`alert`,"data-testid":`setup-error`,className:`text-sm text-destructive`,children:de??V.error?.message??z.error?.message??B.error?.message??L.error?.message??R.error?.message??M.error?.message}),(0,$.jsxs)(`div`,{hidden:I!==`instructions`||F!==`command`,className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(h,{htmlFor:`command-mode`,children:`Command for your terminal`}),(0,$.jsxs)(`select`,{id:`command-mode`,className:`form-control form-control-single`,disabled:C||V.isPending,value:E,onChange:e=>{pe(e.target.value),V.reset()},children:[(0,$.jsx)(`option`,{value:`run`,children:`Install and launch the agent`}),(0,$.jsx)(`option`,{value:`install`,children:`Install configuration only`})]})]}),V.data&&(0,$.jsxs)(`div`,{ref:D,className:`min-w-0 space-y-2 rounded border border-surface-highest p-3`,children:[(0,$.jsxs)(h,{htmlFor:`package-command`,children:[`Run in `,V.data.shell,` on `,P??`Local`]}),(0,$.jsx)(u,{id:`package-command`,"data-testid":`package-command`,value:V.data.command,readOnly:!0,rows:3,className:`font-mono text-xs`}),(0,$.jsx)(s,{variant:`outline`,disabled:C||V.isPending,onClick:async()=>{try{await navigator.clipboard.writeText(V.data.command),T(!0)}catch{S(`Copy is unavailable in this browser. Select and copy the command above.`)}},children:fe?`Copied`:`Copy command`})]})]})]})]}),(0,$.jsxs)(_,{className:`shrink-0 flex-row flex-nowrap items-center gap-2 border-t px-4 py-3 pb-[max(12px,env(safe-area-inset-bottom))] sm:px-6`,children:[(0,$.jsxs)(se,{children:[(0,$.jsx)(ce,{asChild:!0,children:(0,$.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,actionHelp:!1,"aria-label":`Install configuration`,title:`Install configuration`,"data-testid":`setup-install-info`,disabled:C||V.isPending,className:`shrink-0 mr-auto`,children:(0,$.jsx)(l,{"aria-hidden":`true`})})}),(0,$.jsxs)(re,{align:`start`,side:`top`,className:`w-80 space-y-3`,"data-testid":`setup-install-explanation`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Install package configuration for your coding agent on `,P??`Local`,`, without launching an agent. Configuration remains after the session. Installer trust or conflict prompts open in a terminal.`]}),!n.packages.length&&(0,$.jsx)(`p`,{className:`text-sm text-outline`,children:`Choose a package to install configuration separately. This saved agent can be launched directly.`}),(0,$.jsx)(s,{"data-testid":`setup-install`,variant:`ghost`,disabled:C||V.isPending||!U||!R.data?.ready||!n.packages.length,onClick:()=>void xe(`install`),children:`Install configuration`})]})]}),(0,$.jsxs)(`select`,{id:`setup-destination`,"data-testid":`setup-destination`,"aria-label":`Launch action`,className:`form-control form-control-single w-auto min-w-0 max-w-36`,disabled:C||V.isPending,value:F,onChange:e=>{let t=e.target.value;he(t),t===`command`&&ge(`instructions`)},children:[(0,$.jsx)(`option`,{value:`terminal`,children:`Terminal`}),(0,$.jsxs)(`option`,{value:`chat`,disabled:n.backend===`copilot`,children:[`Chat`,n.backend===`copilot`?` · requires Claude or Codex`:``]}),(0,$.jsx)(`option`,{value:`command`,children:`Command`})]}),(0,$.jsx)(s,{"data-testid":F===`command`?`setup-command`:`setup-launch`,className:`shrink-0`,disabled:C||V.isPending||!U||(F===`command`?!1:F===`terminal`?!R.data?.ready||!R.data?.launchers.includes(n.backend):!N.ready||n.backend===`copilot`),onClick:()=>F===`command`?V.mutate({...n,host:P,operation:E}):void xe(`run`),children:C||V.isPending?`Preparing…`:F===`command`?`Generate`:F===`chat`?`Open chat`:`Run`})]})]})})}export{A as a,D as i,wr as n,Tr as r,Er as t};
|
|
105
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=yr(vr(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=yr(vr(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Cr(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mr||null,prettyErrors:t}}function wr(e,t={}){let{lineCounter:n,prettyErrors:r}=Cr(t),i=new Sr(n?.addNewLine),a=new tr(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new _n(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(yn(e,n)),o.warnings.forEach(yn(e,n))),o}function Tr(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return fe(e)&&!r?e.toString(n):new mn(e,r,n).toString(n)}var Q=e(t(),1),$=n();function Er({initial:e,onClose:t}){let[n,ce]=(0,Q.useState)({...e,tool:`apm`}),[le,w]=(0,Q.useState)(),[T,E]=(0,Q.useState)(!1),[ue,D]=(0,Q.useState)(!1),[de,fe]=(0,Q.useState)(`run`),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),A=a(),j=o(),M=m(),N=d(),pe=h(),P=S(),F=n.host===void 0?N.data?.host??null:n.host,[I,me]=(0,Q.useState)(`terminal`),[L,he]=(0,Q.useState)(`context`),[ge,_e]=(0,Q.useState)(!1),R=r({queryKey:[`package-tools`,F],queryFn:()=>c.packageTools.list(F),enabled:!!N.data}),z=r({queryKey:[`package-launch-host`,F],queryFn:()=>c.terminals.list(F),enabled:!!N.data,retry:!1}),B=r({queryKey:[`setup-components`,n.packages],enabled:n.packages.length>0,queryFn:()=>Promise.all(n.packages.map(e=>c.agentPackages.get(e)))}),V=r({queryKey:[`agent`,n.agent],queryFn:()=>c.agents.get(n.agent),enabled:!!n.agent}),H=i({mutationFn:c.agentSetups.command});(0,Q.useEffect)(()=>{H.data&&O.current?.scrollIntoView({block:`nearest`})},[H.data]);let ve=B.data?.some(e=>e.format===`agent-plugin`),ye=ve&&n.backend===`claude`,be=B.data?.some(e=>e.format===`apm`||n.backend!==`codex`),U=!!(n.cwd.trim()&&(n.packages.length||n.agent)&&n.name.trim())&&R.data?.bun&&(!be||R.data?.apm)&&!ye&&!B.error&&!B.isFetching&&!V.error&&!V.isFetching&&!z.isFetching&&!z.error;function W(e){ce(t=>({...t,...e})),H.reset(),D(!1),w(void 0),_e(!1)}async function xe(e){E(!0),w(void 0);try{if(e===`run`&&I===`chat`){let e=await c.chat.fromSetup({...n,host:F});P.openThread(e,{follow:!1}),n.prompt.trim()&&P.send(n.prompt);let r=new URLSearchParams(j.search);r.set(`chat`,`open`),r.set(`chatThread`,e.id),t(),A(`${j.pathname}?${r}`);return}let r=await M.create({kind:n.backend,name:`${n.name}${e===`install`?` · install`:``}`,host:F,setup:{...n,host:F,operation:e}});t(),A(p(`/terminals/${r.id}`,new URLSearchParams(j.search).get(`project`)??`all`,j.search))}catch(e){w(e.message)}finally{E(!1)}}return(0,$.jsx)(se,{open:!0,onOpenChange:e=>!e&&!ge&&!T&&!H.isPending&&t(),children:(0,$.jsxs)(ee,{closeDisabled:T||H.isPending||ge,className:`flex min-w-0 w-[min(960px,calc(100vw-2rem))] max-w-none max-h-[calc(var(--app-height,100dvh)-2rem)] flex-col gap-0 overflow-hidden p-0`,children:[(0,$.jsxs)(ie,{className:`shrink-0 border-b px-4 py-4 pr-12 sm:px-6`,children:[(0,$.jsx)(re,{children:n.packages.length?`Use package`:`Launch agent`}),(0,$.jsx)(ne,{className:`sr-only`,children:`Choose the context and instructions, then launch or install configuration.`})]}),(0,$.jsxs)(v,{value:L,onValueChange:he,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(te,{"aria-label":`Launch setup`,className:`shrink-0 justify-start border-b rounded-none px-4 sm:px-6`,children:[(0,$.jsx)(oe,{value:`context`,"data-testid":`setup-context-tab`,disabled:T||H.isPending,children:`Context`}),(0,$.jsx)(oe,{value:`instructions`,"data-testid":`setup-instructions-tab`,disabled:T||H.isPending,children:`Instructions`})]}),(0,$.jsxs)(`div`,{"data-testid":`package-setup-body`,className:`min-h-0 min-w-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-4 py-4 sm:px-6`,children:[(0,$.jsxs)(`fieldset`,{disabled:T||H.isPending,className:`min-w-0 space-y-4`,children:[(0,$.jsxs)(u,{value:`context`,forceMount:!0,className:`mt-0 space-y-4 data-[state=inactive]:hidden`,children:[(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(C,{htmlFor:`setup-host`,children:`Host`}),(0,$.jsxs)(`select`,{id:`setup-host`,"data-testid":`setup-host`,className:`form-control form-control-single`,value:F??``,onChange:e=>W({host:e.target.value||null,cwd:``}),children:[(0,$.jsx)(`option`,{value:``,children:`Local`}),[...new Set([...N.data?.hosts??[],...N.data?.host?[N.data.host]:[]])].map(e=>(0,$.jsx)(`option`,{value:e,children:e},e))]})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(C,{htmlFor:`setup-backend`,children:`Coding agent`}),(0,$.jsx)(`select`,{id:`setup-backend`,"data-testid":`setup-backend`,className:`form-control form-control-single`,value:n.backend,onChange:e=>W({backend:e.target.value}),children:[`claude`,`codex`,`copilot`].map(e=>(0,$.jsxs)(`option`,{value:e,disabled:!!(ve&&e===`claude`),children:[e,ve&&e===`claude`?` · unsupported for this plugin`:z.data?.launchers.includes(e)?``:` · not installed`]},e))})]})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(C,{htmlFor:`setup-cwd`,children:[`Working folder on `,F??`Local`]}),(0,$.jsxs)(`select`,{"data-testid":`setup-project-folder`,"aria-label":`Fill working folder from a project (optional)`,className:`form-control form-control-single`,value:``,onChange:e=>{e.target.value&&W({cwd:e.target.value})},children:[(0,$.jsx)(`option`,{value:``,children:`Use a project folder (optional)…`}),pe.data?.filter(e=>e.scope).map(e=>(0,$.jsx)(`option`,{value:e.scope??``,children:e.name},e.id))]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(_,{id:`setup-cwd`,"data-testid":`setup-cwd`,value:n.cwd,onChange:e=>W({cwd:e.target.value})}),(0,$.jsx)(s,{type:`button`,variant:`outline`,"data-testid":`setup-browse`,ref:k,disabled:z.isFetching||!!z.error||!F&&!z.data?.ready,onClick:async()=>{if(F)_e(!0);else try{let e=await c.terminals.pickFolder(n.cwd||void 0,null);e.path&&W({cwd:e.path})}catch(e){w(e.message)}},children:`Browse`})]}),(0,$.jsx)(y,{open:ge&&!!F,onOpenChange:_e,host:F,initial:n.cwd,onPick:e=>W({cwd:e}),returnFocusRef:k})]}),(0,$.jsxs)(`details`,{"data-testid":`setup-components`,className:`text-sm space-y-1`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer min-h-11 content-center sm:min-h-8`,children:`Configuration to apply`}),V.data&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`p`,{children:[V.data.name,` · agent instructions`,V.data.fields.model?` · ${V.data.fields.model}`:``]}),F&&(0,$.jsxs)(`p`,{className:`text-xs text-outline`,children:[`Supporting files referenced by this agent are not transferred. Make them available at the referenced paths on `,F,`.`]})]}),B.isFetching&&(0,$.jsx)(`p`,{children:`Checking package contents…`}),B.data?.map(e=>(0,$.jsxs)(`p`,{className:`wrap-break-word`,children:[e.name,`:`,` `,e.files.filter(e=>/^(skills|\.apm\/skills)\/[^/]+\/SKILL\.md$/.test(e.name)).length,` `,`skill files`,e.files.some(e=>e.name===`mcp.json`)?`, native MCP configuration`:``,e.files.some(e=>e.name.endsWith(`.instructions.md`))?`, shared instructions`:``]},e.name))]})]}),(0,$.jsx)(u,{value:`instructions`,forceMount:!0,className:`mt-0 space-y-4 data-[state=inactive]:hidden`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(C,{htmlFor:`setup-prompt`,children:`What should the agent work on?`}),(0,$.jsx)(g,{id:`setup-prompt`,"data-testid":`setup-prompt`,rows:5,value:n.prompt,onChange:e=>W({prompt:e.target.value})})]})})]}),(0,$.jsxs)(`details`,{className:`text-xs text-outline`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer min-h-11 flex items-center sm:min-h-8`,children:`How configuration is applied`}),(0,$.jsx)(`p`,{children:`Package files are transferred to the selected host when needed. APM deploys agent configuration into the working folder; Codex plugins install into Codex's user cache on that host. These tools must already be installed. Configuration remains after the session; use a terminal for installer trust or conflict prompts.`})]}),ye&&(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Choose Codex or Copilot for this Agent Plugin.`}),R.data&&be&&!R.data.apm&&(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm`,children:[`APM 0.33.0 or newer must be available on `,F??`Local`,`.`]}),R.data&&!R.data.bun&&(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm`,children:[`Bun must be available on `,F??`Local`,`.`]}),!z.data?.ready&&I===`terminal`&&(0,$.jsx)(`p`,{role:`alert`,className:`text-sm`,children:z.data?.reason??`Checking terminal availability…`}),I===`chat`&&n.backend===`copilot`&&(0,$.jsx)(`p`,{role:`alert`,className:`text-sm`,children:`Chat requires Claude or Codex. Choose another coding agent in Context.`}),(le||H.error||B.error||V.error||R.error||z.error||N.error)&&(0,$.jsx)(`p`,{role:`alert`,"data-testid":`setup-error`,className:`text-sm text-destructive`,children:le??H.error?.message??B.error?.message??V.error?.message??R.error?.message??z.error?.message??N.error?.message}),(0,$.jsxs)(`div`,{hidden:L!==`instructions`||I!==`command`,className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(C,{htmlFor:`command-mode`,children:`Command for your terminal`}),(0,$.jsxs)(`select`,{id:`command-mode`,className:`form-control form-control-single`,disabled:T||H.isPending,value:de,onChange:e=>{fe(e.target.value),H.reset()},children:[(0,$.jsx)(`option`,{value:`run`,children:`Install and launch the agent`}),(0,$.jsx)(`option`,{value:`install`,children:`Install configuration only`})]})]}),H.data&&(0,$.jsxs)(`div`,{ref:O,className:`min-w-0 space-y-2 rounded border border-surface-highest p-3`,children:[(0,$.jsxs)(C,{htmlFor:`package-command`,children:[`Run in `,H.data.shell,` on `,F??`Local`]}),(0,$.jsx)(g,{id:`package-command`,"data-testid":`package-command`,value:H.data.command,readOnly:!0,rows:3,className:`font-mono text-xs`}),(0,$.jsx)(s,{variant:`outline`,disabled:T||H.isPending,onClick:async()=>{try{await navigator.clipboard.writeText(H.data.command),D(!0)}catch{w(`Copy is unavailable in this browser. Select and copy the command above.`)}},children:ue?`Copied`:`Copy command`})]})]})]})]}),(0,$.jsxs)(ae,{className:`shrink-0 flex-row flex-nowrap items-center gap-2 border-t px-4 py-3 pb-[max(12px,env(safe-area-inset-bottom))] sm:px-6`,children:[(0,$.jsxs)(b,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,actionHelp:!1,"aria-label":`Install configuration`,title:`Install configuration`,"data-testid":`setup-install-info`,disabled:T||H.isPending,className:`shrink-0 mr-auto`,children:(0,$.jsx)(l,{"aria-hidden":`true`})})}),(0,$.jsxs)(f,{align:`start`,side:`top`,className:`w-80 space-y-3`,"data-testid":`setup-install-explanation`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Install package configuration for your coding agent on `,F??`Local`,`, without launching an agent. Configuration remains after the session. Installer trust or conflict prompts open in a terminal.`]}),!n.packages.length&&(0,$.jsx)(`p`,{className:`text-sm text-outline`,children:`Choose a package to install configuration separately. This saved agent can be launched directly.`}),(0,$.jsx)(s,{"data-testid":`setup-install`,variant:`ghost`,disabled:T||H.isPending||!U||!z.data?.ready||!n.packages.length,onClick:()=>void xe(`install`),children:`Install configuration`})]})]}),(0,$.jsxs)(`select`,{id:`setup-destination`,"data-testid":`setup-destination`,"aria-label":`Launch action`,className:`form-control form-control-single w-auto min-w-0 max-w-36`,disabled:T||H.isPending,value:I,onChange:e=>{let t=e.target.value;me(t),t===`command`&&he(`instructions`)},children:[(0,$.jsx)(`option`,{value:`terminal`,children:`Terminal`}),(0,$.jsxs)(`option`,{value:`chat`,disabled:n.backend===`copilot`,children:[`Chat`,n.backend===`copilot`?` · requires Claude or Codex`:``]}),(0,$.jsx)(`option`,{value:`command`,children:`Command`})]}),(0,$.jsx)(s,{"data-testid":I===`command`?`setup-command`:`setup-launch`,className:`shrink-0`,disabled:T||H.isPending||!U||(I===`command`?!1:I===`terminal`?!z.data?.ready||!z.data?.launchers.includes(n.backend):!P.ready||n.backend===`copilot`),onClick:()=>I===`command`?H.mutate({...n,host:F,operation:de}):void xe(`run`),children:T||H.isPending?`Preparing…`:I===`command`?`Generate`:I===`chat`?`Open chat`:`Run`})]})]})})}export{j as a,O as i,wr as n,Tr as r,Er as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CVMpzJz9.js";import{
|
|
1
|
+
import{t as e}from"./jsx-runtime-CVMpzJz9.js";import{Ai as t,ji as n}from"./index-Bc-Nka6Y.js";var r=e(),i=`inline-flex min-h-11 items-center gap-1 font-label text-xs text-primary hover:text-on-surface disabled:opacity-40 disabled:hover:text-primary`;function a({page:e,pageSize:a,total:o,onPage:s}){let c=Math.max(1,Math.ceil(o/a));if(o<=a)return null;let l=e*a+1,u=Math.min(o,(e+1)*a);return(0,r.jsxs)(`div`,{"data-testid":`pager`,className:`flex flex-wrap gap-2 items-center justify-between border-t border-surface-highest px-3 py-2`,children:[(0,r.jsxs)(`span`,{className:`font-label text-xs text-outline`,children:[l,`–`,u,` of `,o]}),(0,r.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,r.jsxs)(`button`,{type:`button`,"data-testid":`pager-prev`,className:i,disabled:e===0,onClick:()=>s(e-1),children:[(0,r.jsx)(n,{className:`h-3 w-3`}),`Prev`]}),(0,r.jsxs)(`span`,{className:`font-label text-xs text-outline`,children:[`Page `,e+1,` / `,c]}),(0,r.jsxs)(`button`,{type:`button`,"data-testid":`pager-next`,className:i,disabled:e>=c-1,onClick:()=>s(e+1),children:[`Next`,(0,r.jsx)(t,{className:`h-3 w-3`})]})]})]})}export{a as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{h as r,t as i}from"./chunk-OB3PAWPO-BD6ylT0A.js";import{t as a}from"./button-By-NN7c7.js";import{t as o}from"./TaskDetailSheet-C8dGHMsb.js";import{t as s}from"./ResponsiveFilters-C3siPRT-.js";import{$ as c,Ct as ee,Dt as l,Et as te,G as u,Gr as d,J as f,K as p,Kr as m,O as h,Ot as g,Q as _,Rt as v,Tt as y,W as ne,X as re,Y as b,Yr as x,Z as S,_ as C,at as w,ct as T,dt as E,ei as D,et as O,ft as k,hn as A,ht as j,ii as M,it as N,lt as P,mn as F,nt as I,ot as L,pn as R,rt as z,st as B,tt as ie,ut as V,y as H,z as U}from"./index-Bc-Nka6Y.js";import{t as W}from"./ConfirmDialog-Cp1PcD4R.js";import{t as G}from"./ErrorState-DB0nWfcc.js";import{t as K}from"./ViewHeader-CKIR1ZTZ.js";import{t as q}from"./useDetailRoute-B-xjWsyW.js";import{t as J}from"./view-params-YEmeZppw.js";import{t as ae}from"./EmptyState-YM4VSLR9.js";import{a as oe,i as Y,n as se,o as ce,r as X,t as le}from"./table-COm8Aml-.js";import{n as ue,t as de}from"./useListSelection-BnMxiGpC.js";var Z=e(t(),1),Q=n(),fe=[{value:`all`,label:`All`},{value:`active`,label:`Active`},{value:`archived`,label:`Archived`},{value:`paused`,label:`Paused`}];function pe(){let e=v(`xl`),{data:t,isLoading:n,error:i,refetch:d}=te(),[f,p]=J(`projectQuery`,``),[,g]=r(),[y,re]=J(`status`,`all`,[`all`,`active`,`archived`,`paused`]),[b,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),[T,E]=(0,Z.useState)(null),[k,A]=(0,Z.useState)(null),{selectedId:j,openDetail:N,closeDetail:P}=q(`/projects`,`projectId`),F=ee(),I=j?(t??[]).find(e=>e.id===j)??null:null,L=(0,Z.useMemo)(()=>{let e=f.trim().toLowerCase();return(t??[]).filter(t=>!e||`${t.name} ${t.description??``} ${t.scope??``} ${(t.tags??[]).join(` `)}`.toLowerCase().includes(e))},[t,f]),R=(0,Z.useMemo)(()=>y===`all`?L:L.filter(e=>e.status===y),[L,y]),z=JSON.stringify([y,f]),B=de(R.map(e=>e.id),z),V=l(),U=V.data?.scope===z?V.data:void 0;async function pe(e){let t=await V.mutateAsync({ids:B.selectedIds,status:e,scope:z});B.select(t.failed.map(e=>e.id))}let $=(0,Z.useMemo)(()=>L.reduce((e,t)=>(e[t.status]=(e[t.status]??0)+1,e),{}),[L]);return i?(0,Q.jsx)(G,{message:i.message,onRetry:()=>d()}):(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(K,{title:`Projects`,meta:f||y!==`all`?`${R.length} of ${(t??[]).length}`:(t??[]).length,action:(0,Q.jsxs)(a,{"data-testid":`new-project-button`,size:`sm`,onClick:()=>S(!0),className:`font-label text-sm bg-primary text-primary-foreground hover:bg-primary/90`,children:[(0,Q.jsx)(M,{size:12,className:`mr-1`}),`New project`]})}),(0,Q.jsxs)(_,{value:y,onValueChange:e=>re(e),className:`mb-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`div`,{className:`relative min-w-0 flex-1 lg:max-w-md`,children:[(0,Q.jsx)(D,{size:14,"aria-hidden":!0,className:`absolute left-3 top-1/2 -translate-y-1/2 text-outline`}),(0,Q.jsx)(m,{type:`search`,"data-testid":`project-search`,"aria-label":`Search projects`,placeholder:`Search projects…`,value:f,onChange:e=>p(e.target.value,{replace:!0}),className:`pl-9`})]}),(0,Q.jsx)(s,{activeCount:Number(y!==`all`),children:(0,Q.jsx)(O,{"aria-label":`Project status`,className:`bg-transparent gap-1 h-auto max-w-full flex-wrap justify-start p-0`,children:fe.map(({value:e,label:t})=>(0,Q.jsxs)(ie,{"data-testid":`projects-filter-${e}`,value:e,className:`font-label text-[13px] px-3 py-1.5 rounded-md
|
|
2
|
+
data-[state=active]:bg-surface-highest data-[state=active]:text-on-surface data-[state=active]:shadow-none
|
|
3
|
+
text-muted-foreground hover:text-on-surface`,children:[t,e!==`all`&&$[e]!=null&&(0,Q.jsx)(`span`,{className:`ml-1.5 text-xs text-muted-foreground px-1.5 py-0.5`,children:$[e]})]},e))})})]}),R.length>0&&(0,Q.jsx)(ue,{resourceLabel:`projects`,count:B.selectedIds.length,allSelected:B.allSelected,someSelected:B.someSelected,onSelectAll:B.selectAll,onClear:B.clear,disabled:V.isPending,children:u.map(e=>(0,Q.jsxs)(a,{type:`button`,size:`sm`,variant:`outline`,disabled:V.isPending,"data-testid":`projects-bulk-${e}`,onClick:()=>void pe(e),children:[e===`active`?`Activate`:e===`paused`?`Pause`:`Archive`,` `,`selected`]},e))}),V.isPending&&(0,Q.jsx)(`p`,{role:`status`,className:`mb-3 text-sm text-outline`,children:`Updating selected projects...`}),!V.isPending&&U&&(0,Q.jsxs)(`div`,{role:`status`,className:`mb-3 space-y-1 text-sm`,"data-testid":`projects-bulk-result`,children:[(0,Q.jsxs)(`p`,{children:[U.succeeded.length,` `,U.succeeded.length===1?`project`:`projects`,` set to`,` `,U.status,`.`]}),U.failed.map(e=>(0,Q.jsxs)(`p`,{className:`text-error`,children:[t?.find(t=>t.id===e.id)?.name??e.id,`: `,e.error,`. Still selected for retry.`]},e.id))]}),(0,Q.jsx)(c,{value:y,children:n?(0,Q.jsx)(`div`,{className:`space-y-2`,children:[...[,,,]].map((e,t)=>(0,Q.jsx)(h,{className:`h-12 w-full bg-surface-highest`},t))}):R.length===0?f||y!==`all`?(0,Q.jsxs)(`div`,{"data-testid":`empty-state`,className:`flex flex-col items-center justify-center gap-2 py-16 text-sm text-outline`,children:[(0,Q.jsx)(`p`,{children:`No matching projects`}),(0,Q.jsx)(a,{variant:`ghost`,"data-testid":`project-clear-filters`,onClick:()=>g(e=>{let t=new URLSearchParams(e);return t.delete(`projectQuery`),t.delete(`status`),t}),children:`Clear filters`})]}):(0,Q.jsx)(ae,{message:`No projects`}):e?(0,Q.jsx)(`div`,{className:`overflow-hidden`,children:(0,Q.jsxs)(le,{children:[(0,Q.jsx)(oe,{children:(0,Q.jsxs)(ce,{className:`border-b border-outline-variant hover:bg-transparent`,children:[(0,Q.jsx)(Y,{className:`w-11`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Select projects`})}),(0,Q.jsx)(Y,{className:`font-label text-sm text-muted-foreground`,children:`Name`}),(0,Q.jsx)(Y,{className:`font-label text-sm text-muted-foreground`,children:`Description`}),(0,Q.jsx)(Y,{className:`font-label text-sm text-muted-foreground w-28`,children:`Status`}),(0,Q.jsx)(Y,{className:`font-label text-sm text-muted-foreground w-36`,children:`Tags`}),(0,Q.jsx)(Y,{className:`font-label text-sm text-muted-foreground w-24`,children:`Max workers`}),(0,Q.jsx)(Y,{className:`font-label text-sm text-muted-foreground w-24`,children:`Created`}),(0,Q.jsx)(Y,{className:`w-10`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,Q.jsx)(se,{children:R.map(e=>(0,Q.jsxs)(ce,{"data-testid":`project-row`,"data-project-id":e.id,"data-project-name":e.name,className:`border-b border-outline-variant/50 hover:bg-surface-high cursor-pointer`,onClick:()=>N(e.id),children:[(0,Q.jsx)(X,{children:(0,Q.jsx)(`input`,{type:`checkbox`,"data-testid":`project-select`,"aria-label":`Select ${e.name}`,className:`size-4 accent-primary`,checked:B.selectedIds.includes(e.id),disabled:V.isPending,onClick:e=>e.stopPropagation(),onChange:()=>B.toggle(e.id)})}),(0,Q.jsx)(X,{className:`font-body text-sm font-medium text-on-surface`,children:(0,Q.jsx)(`button`,{type:`button`,className:`min-h-8 text-left hover:text-primary`,"aria-label":`Edit project: ${e.name}`,onClick:t=>{t.stopPropagation(),N(e.id)},children:e.name})}),(0,Q.jsx)(X,{className:`font-body text-sm text-muted-foreground max-w-xs truncate`,children:e.description??`—`}),(0,Q.jsx)(X,{children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-xs font-normal capitalize text-muted-foreground`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 shrink-0 rounded-full ${e.status===`active`?`bg-secondary`:e.status===`paused`?`bg-tertiary`:`bg-outline`}`}),e.status]})}),(0,Q.jsx)(X,{children:(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(e.tags??[]).map(e=>(0,Q.jsx)(`span`,{className:`font-label text-sm px-1.5 py-0.5 text-muted-foreground`,children:e},e))})}),(0,Q.jsx)(X,{className:`font-label text-sm text-on-surface text-center`,children:e.max_workers??`—`}),(0,Q.jsx)(X,{className:`font-label text-sm text-muted-foreground`,children:new Date(e.created_at).toLocaleDateString()}),(0,Q.jsx)(X,{children:(0,Q.jsx)(`button`,{type:`button`,"data-testid":`project-delete`,"aria-label":`Delete project: ${e.name}`,onClick:t=>{t.stopPropagation(),A(e)},className:`text-muted-foreground hover:text-error transition-colors p-1`,children:(0,Q.jsx)(x,{size:12})})})]},e.id))})]})}):(0,Q.jsx)(`div`,{className:`divide-y divide-border`,children:R.map(e=>(0,Q.jsxs)(`article`,{"data-testid":`project-row`,"data-project-id":e.id,"data-project-name":e.name,className:`flex min-w-0 items-start gap-1 py-3`,children:[(0,Q.jsx)(`label`,{className:`flex size-11 shrink-0 items-center justify-center`,children:(0,Q.jsx)(`input`,{type:`checkbox`,"data-testid":`project-select`,"aria-label":`Select ${e.name}`,className:`size-4 accent-primary`,checked:B.selectedIds.includes(e.id),disabled:V.isPending,onChange:()=>B.toggle(e.id)})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`button`,{type:`button`,"data-testid":`project-open`,"aria-label":`Edit project: ${e.name}`,className:`min-h-11 w-full text-left text-sm font-medium wrap-break-word hover:text-primary`,onClick:()=>N(e.id),children:e.name}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 capitalize`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full ${e.status===`active`?`bg-secondary`:e.status===`paused`?`bg-tertiary`:`bg-outline`}`}),e.status]}),e.max_workers!=null&&(0,Q.jsxs)(`span`,{children:[e.max_workers,` workers`]})]}),e.description&&(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground wrap-break-word`,children:e.description})]}),(0,Q.jsx)(a,{type:`button`,variant:`ghost`,size:`icon`,"data-testid":`project-delete`,"aria-label":`Delete project: ${e.name}`,onClick:()=>A(e),className:`shrink-0 text-muted-foreground hover:text-error`,children:(0,Q.jsx)(x,{size:14})})]},e.id))})})]}),b&&(0,Q.jsx)(ne,{open:b,onClose:()=>S(!1),onFirstTask:w}),C&&(0,Q.jsx)(H,{open:!0,defaultProjectId:C,onClose:()=>w(null),onCreated:E}),(0,Q.jsx)(o,{taskId:T,open:!!T,onOpenChange:e=>{e||E(null)}}),I&&(0,Q.jsx)(me,{open:!!I,project:I,onClose:P,onFirstTask:e=>{P(),w(e)}},I.id),k&&(0,Q.jsx)(W,{open:!!k,title:`Delete project`,description:`This deletes the project, its memories and its scratchpads. Its tasks, jobs and sessions are kept without a project. This action cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,isPending:F.isPending,onConfirm:()=>{F.mutate(k.id,{onSuccess:()=>A(null)})},onCancel:()=>A(null)})]})}function me({open:e,project:t,onClose:n,onFirstTask:r}){let i=S([{id:`details`,label:`Details`},{id:`configuration`,label:`Configuration`},{id:`workspace`,label:`Workspace`}],e),[o,s]=(0,Z.useState)(t.name),[c,ee]=(0,Z.useState)(t.description??``),[l,te]=(0,Z.useState)(t.status),[h,_]=(0,Z.useState)((t.tags??[]).join(`, `)),[v,ne]=(0,Z.useState)(t.scope??``),[x,C]=(0,Z.useState)(t.git_remote_url??``),[D,O]=(0,Z.useState)(t.github_sync??{enabled:!1,status_labels:j}),[M,ie]=(0,Z.useState)(t.upload_directory??``),[H,U]=(0,Z.useState)(t.max_workers==null?``:String(t.max_workers)),[W,G]=(0,Z.useState)(()=>t.workspace?k(t.workspace):E()),K=g(),{data:q}=y(t.id),J=JSON.stringify([o,c,l,h,v,x,D,H,M,W])!==JSON.stringify([t.name,t.description??``,t.status,(t.tags??[]).join(`, `),t.scope??``,t.git_remote_url??``,t.github_sync??{enabled:!1,status_labels:j},t.max_workers==null?``:String(t.max_workers),t.upload_directory??``,t.workspace?k(t.workspace):E()]),ae=(e,n)=>{if(e.preventDefault(),!o.trim())return;let r=V.safeParse(W);if(!r.success){i.invalid(`workspace`,r.error.issues[0].message);return}let a={id:t.id,name:o.trim(),description:c.trim()||null,status:l,tags:h.trim()?h.split(`,`).map(e=>e.trim()).filter(Boolean):null,scope:v.trim()||null,git_remote_url:x.trim()||null,github_sync:D,max_workers:H?Number(H):null,upload_directory:M.trim()||null,workspace:r.data};K.mutate(a,{onSuccess:n})};return(0,Q.jsx)(P,{open:e,onClose:n,dirty:J,busy:K.isPending,testId:`edit-project-dialog`,children:(e,n)=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{children:(0,Q.jsx)(A,{className:`font-headline text-base text-on-surface`,children:`Edit project`})}),(0,Q.jsx)(`form`,{noValidate:!0,ref:i.form,onSubmit:e=>i.submit(e,()=>ae(e,n)),className:`min-h-0`,children:(0,Q.jsxs)(re,{steps:i,children:[(0,Q.jsxs)(`div`,{className:`work-form-body space-y-4`,children:[(0,Q.jsxs)(b,{steps:i,id:`details`,children:[q&&(0,Q.jsx)(`div`,{className:`md:col-span-2`,children:(0,Q.jsx)($,{summary:q,allowNavigation:!J})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:col-span-2`,children:[(0,Q.jsx)(a,{type:`button`,"data-testid":`project-create-task`,variant:`outline`,size:`sm`,onClick:()=>r(t.id),disabled:J||K.isPending,children:`Create task in this project`}),J&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Save changes before opening related work.`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(T,{className:`font-label text-sm text-muted-foreground`,children:`Name *`}),(0,Q.jsx)(m,{"aria-label":`Name`,"data-testid":`edit-project-name-input`,required:!0,value:o,onChange:e=>s(e.target.value),className:`bg-background border-control-border text-on-surface font-body text-sm`,autoFocus:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(T,{className:`font-label text-sm text-muted-foreground`,children:`Description`}),(0,Q.jsx)(d,{"aria-label":`Description`,value:c,onChange:e=>ee(e.target.value),rows:2,className:`bg-background border-control-border text-on-surface font-body text-sm resize-none`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(T,{className:`font-label text-sm text-muted-foreground`,children:`Status`}),(0,Q.jsxs)(I,{value:l,onValueChange:e=>te(e),children:[(0,Q.jsx)(w,{"aria-label":`Status`,className:`bg-background border-control-border text-on-surface font-label text-sm`,children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(z,{className:`bg-surface border-outline-variant`,children:u.map(e=>(0,Q.jsx)(N,{value:e,className:`font-label text-sm`,children:e},e))})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(T,{className:`font-label text-sm text-muted-foreground`,children:`Tags (comma separated)`}),(0,Q.jsx)(m,{"aria-label":`Tags (comma separated)`,value:h,onChange:e=>_(e.target.value),className:`bg-background border-control-border text-on-surface font-body text-sm`})]})]}),(0,Q.jsxs)(b,{steps:i,id:`configuration`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(T,{className:`font-label text-sm text-muted-foreground`,children:`Scope`}),(0,Q.jsx)(m,{"aria-label":`Scope`,value:v,onChange:e=>ne(e.target.value),className:`bg-background border-control-border text-on-surface font-body text-sm`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5 md:col-span-2`,children:[(0,Q.jsx)(T,{htmlFor:`edit-project-git-remote-url`,className:`font-label text-sm text-muted-foreground`,children:`Git remote URL (optional)`}),(0,Q.jsx)(m,{id:`edit-project-git-remote-url`,className:`bg-background border-control-border text-on-surface font-body text-sm`,"data-testid":`edit-project-git-remote-url`,value:x,onChange:e=>C(e.target.value),placeholder:`https://github.com/owner/repo.git or git@github.com:owner/repo.git`}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Clear this field to remove the saved address.`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5 md:col-span-2`,children:[(0,Q.jsx)(T,{htmlFor:`edit-project-upload-directory`,children:`Upload directory (optional)`}),(0,Q.jsx)(m,{id:`edit-project-upload-directory`,"data-testid":`edit-project-upload-directory`,value:M,onChange:e=>ie(e.target.value),placeholder:`.orc/sessions`}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Relative to the conversation folder, or an absolute path on its execution host. External folders may require agent read permission. Empty uses .orc/sessions.`})]}),(0,Q.jsx)(B,{value:D,onChange:O,state:t.github_sync_state}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(T,{className:`font-label text-sm text-muted-foreground`,children:`Max workers`}),(0,Q.jsx)(m,{"aria-label":`Max Workers`,type:`number`,min:1,value:H,onChange:e=>U(e.target.value),placeholder:`1`,className:`bg-background border-control-border text-on-surface font-body text-sm`})]})]}),(0,Q.jsx)(b,{steps:i,id:`workspace`,children:(0,Q.jsx)(p,{value:W,onChange:G})}),K.error&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-error md:col-span-2`,children:K.error.message}),i.error&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-error`,children:i.error})]}),(0,Q.jsxs)(R,{className:`work-form-footer`,children:[(0,Q.jsx)(a,{type:`button`,variant:`ghost`,size:`sm`,onClick:e,className:`font-label text-sm text-muted-foreground`,children:`Cancel`}),(0,Q.jsx)(f,{steps:i,busy:K.isPending,children:(0,Q.jsx)(a,{"data-testid":`edit-project-submit`,type:`submit`,size:`sm`,disabled:K.isPending,className:`font-label text-sm bg-primary text-primary-foreground hover:bg-primary/90`,children:K.isPending?`Saving…`:`Save changes`})})]})]})})]})})}function $({summary:e,allowNavigation:t=!0}){return(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-4 py-3 border-t border-outline-variant mt-2`,children:[(0,Q.jsxs)(U,{label:`Tasks`,children:[(0,Q.jsx)(`span`,{className:`font-label text-sm text-primary`,children:e.tasks.total}),Object.keys(e.tasks.by_status).length>0&&(0,Q.jsxs)(`span`,{className:`text-muted-foreground text-sm ml-1`,children:[`(`,Object.entries(e.tasks.by_status).map(([e,t])=>`${t} ${e}`).join(`, `),`)`]})]}),(0,Q.jsx)(U,{label:`Memories`,children:t?(0,Q.jsx)(i,{"data-testid":`project-memories-link`,to:`${C}?project=${encodeURIComponent(e.project.id)}`,className:`font-label text-sm text-primary underline`,children:e.memories}):(0,Q.jsx)(`span`,{className:`font-label text-sm text-muted-foreground`,children:e.memories})}),(0,Q.jsx)(U,{label:`Jobs`,children:(0,Q.jsx)(`span`,{className:`font-label text-sm text-primary`,children:e.jobs})})]})}export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{c as r,t as i}from"./button-By-NN7c7.js";import{h as a}from"./client-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{c as r,t as i}from"./button-By-NN7c7.js";import{h as a}from"./client-DigivyCS.js";var o={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};o.node;var s=a(o),c=e(t(),1),l=n();function u({children:e,activeCount:t=0}){let[n,a]=(0,c.useState)(!1),o=(0,c.useId)();return(0,l.jsxs)(`div`,{className:`contents`,children:[(0,l.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0 lg:hidden`,"aria-expanded":n,"aria-controls":o,"data-testid":`view-filters-toggle`,onClick:()=>a(!n),children:[(0,l.jsx)(s,{"aria-hidden":!0}),`Filters`,t>0?` (${t})`:``]}),(0,l.jsx)(`div`,{id:o,"data-testid":`view-filters`,className:r(`order-last w-full flex-wrap items-center gap-2 border-t border-border pt-3 lg:order-none lg:flex lg:w-auto lg:border-0 lg:pt-0 lg:[&>select]:w-auto`,n?`flex`:`hidden`),children:e})]})}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{f as r,
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{f as r,h as i}from"./chunk-OB3PAWPO-BD6ylT0A.js";import{n as a}from"./client-DigivyCS.js";import{t as o}from"./check-DrnDUgkq.js";import{t as s}from"./chevron-down-C1WyGsAA.js";import{$t as c,Br as l,En as u,Rr as d,Ti as f,Vr as p,Xr as m,Yn as h,ci as g,en as _,fi as v,fr as y,nn as b,tn as x}from"./index-Bc-Nka6Y.js";import{a as S,o as C,s as w}from"./live-sessions-BG3mNXnQ.js";var T=e(t(),1),E=n(),D=`inline-flex min-h-9 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-border px-2 py-1 text-xs text-primary hover:bg-surface-highest disabled:opacity-50`;function O({session:e}){let{openLiveSession:t,info:n,terminals:O}=u(),k=r(),A=h(),[j]=i(),[M,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(!1),[I,L]=(0,T.useState)(null),[R,z]=(0,T.useState)(null),[B,V]=(0,T.useState)(!1),H=S(e),U=_(O,e.id),W=j.get(`project`)??e.project_id,G=y(e.agent)??(!H||!e.cwd?`Session has no native session ID or working folder.`:void 0);(0,T.useEffect)(()=>{if(!R)return;let e=setTimeout(()=>z(null),2e3);return()=>clearTimeout(e)},[R]);async function K(){if(V(!1),L(null),U)k(w(b(U.id),W));else{N(!0);try{await t(e)}catch(e){L(e instanceof Error?e.message:`Could not open terminal`)}finally{N(!1)}}}async function q(e,t){V(!1),L(null);try{await navigator.clipboard.writeText(e),z(t)}catch{L(`Clipboard access failed. Allow clipboard access and try again.`)}}async function J(){V(!1),F(!0),L(null);try{A.openThread(await a.chat.resume(e.id));let t=new URLSearchParams(j);t.delete(`session`),t.set(`chat`,`open`),k({search:t.toString()})}catch(e){L(e instanceof Error?e.message:`Could not resume in chat`)}finally{F(!1)}}return!H&&!U?(0,E.jsx)(`span`,{"data-testid":`resume-unavailable`,className:`block max-w-64 text-xs text-outline`,children:C(e)}):(0,E.jsxs)(`div`,{className:`max-w-72 space-y-1 text-left`,children:[(0,E.jsxs)(`fieldset`,{"aria-label":`Resume session`,className:`inline-flex`,children:[(0,E.jsxs)(`button`,{type:`button`,"data-testid":`open-chat-resume`,disabled:M||P||!!G,title:G??`Resume in chat`,onClick:()=>void J(),className:`${D} rounded-r-none`,children:[(0,E.jsx)(g,{size:13}),P?`Resuming…`:`Resume`]}),(0,E.jsxs)(d,{open:B,onOpenChange:V,children:[(0,E.jsx)(p,{asChild:!0,children:(0,E.jsx)(`button`,{type:`button`,"data-testid":`resume-actions-menu`,"aria-label":`More session actions`,className:`${D} rounded-l-none border-l-0 px-2`,children:(0,E.jsx)(s,{size:13})})}),(0,E.jsxs)(l,{align:`end`,sideOffset:4,collisionPadding:8,"aria-label":`Session actions`,"data-testid":`resume-actions-dropdown`,className:`z-50 w-56 rounded-md border border-border bg-surface-high p-1 shadow-lg`,children:[(0,E.jsxs)(`button`,{type:`button`,"data-testid":`open-terminal-resume`,disabled:M||P||!U&&!n?.ready,title:!U&&!n?.ready?n?.reason??`Integrated terminals are unavailable`:`Resume in terminal`,onClick:()=>void K(),className:`${D} min-h-11 w-full justify-start border-0`,children:[(0,E.jsx)(m,{size:13}),M?`Resuming…`:`Terminal`]}),H&&(0,E.jsxs)(`button`,{type:`button`,"data-testid":`copy-resume`,className:`${D} w-full justify-start border-0`,title:H,onClick:()=>void q(H,`Resume command copied`),children:[R===`Resume command copied`?(0,E.jsx)(o,{size:13}):(0,E.jsx)(f,{size:13}),`Copy resume command`]}),(0,E.jsxs)(`button`,{type:`button`,"data-testid":`copy-terminal-link`,className:`${D} w-full justify-start border-0`,"aria-label":`Copy terminal link`,title:`Copy terminal link`,onClick:()=>void q(c(w(x(e.id),W)),`Terminal link copied`),children:[(0,E.jsx)(v,{size:13}),`Copy terminal link`]})]})]})]}),G&&(0,E.jsx)(`p`,{"data-testid":`chat-resume-unavailable`,className:`text-xs text-outline`,children:G}),R&&(0,E.jsx)(`p`,{role:`status`,"data-testid":`resume-feedback`,className:`text-xs text-outline`,children:R}),I&&(0,E.jsx)(`p`,{role:`alert`,className:`text-xs text-error wrap-break-word`,children:I})]})}export{O as t};
|