comet-dsh-plugin 0.0.0-stage → 0.5.3
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/LICENSE +21 -0
- package/README.en.md +176 -0
- package/README.md +152 -2
- package/client.js +349 -0
- package/cordis.patch.yml +4 -0
- package/icon.png +0 -0
- package/index.js +183 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +57 -4
- package/rules/comet-workflow-guard.md +63 -0
- package/rules/migration-assets.json +218 -0
- package/server/comet-plugin-setup.mjs +192 -0
- package/skills/comet/SKILL.md +37 -0
- package/skills/comet/agents/openai.yaml +3 -0
- package/skills/comet/reference/change-walkthrough.md +77 -0
- package/skills/comet/reference/edit-review.md +26 -0
- package/skills/comet/reference/host-check.md +11 -0
- package/skills/comet/reference/platform-execution.md +34 -0
- package/skills/comet/reference/task-learning.md +39 -0
- package/skills/comet/runtime/classic/checks.yaml +6 -0
- package/skills/comet/runtime/classic/guardrails.yaml +13 -0
- package/skills/comet/runtime/classic/skill.yaml +122 -0
- package/skills/comet/scripts/comet-archive.mjs +310 -0
- package/skills/comet/scripts/comet-check.mjs +179 -0
- package/skills/comet/scripts/comet-entry-runtime.mjs +151 -0
- package/skills/comet/scripts/comet-env.mjs +15 -0
- package/skills/comet/scripts/comet-guard.mjs +335 -0
- package/skills/comet/scripts/comet-handoff.mjs +289 -0
- package/skills/comet/scripts/comet-hook-guard.mjs +294 -0
- package/skills/comet/scripts/comet-hook-router-guard.mjs +628 -0
- package/skills/comet/scripts/comet-hook-router.mjs +17 -0
- package/skills/comet/scripts/comet-intent.mjs +181 -0
- package/skills/comet/scripts/comet-plugin-hook.mjs +213 -0
- package/skills/comet/scripts/comet-resume-probe.mjs +205 -0
- package/skills/comet/scripts/comet-runtime.mjs +571 -0
- package/skills/comet/scripts/comet-state.mjs +381 -0
- package/skills/comet/scripts/comet-yaml-validate.mjs +182 -0
- package/skills/comet-any/SKILL.md +47 -0
- package/skills/comet-any/agents/openai.yaml +5 -0
- package/skills/comet-any/reference/sdk-creation.md +100 -0
- package/skills/comet-archive/SKILL.md +28 -0
- package/skills/comet-archive/agents/openai.yaml +5 -0
- package/skills/comet-archive/reference/compat.md +188 -0
- package/skills/comet-build/SKILL.md +35 -0
- package/skills/comet-build/agents/openai.yaml +5 -0
- package/skills/comet-build/reference/compat.md +191 -0
- package/skills/comet-classic/SKILL.md +98 -0
- package/skills/comet-classic/agents/openai.yaml +3 -0
- package/skills/comet-classic/reference/auto-transition.md +34 -0
- package/skills/comet-classic/reference/classic-layout.md +36 -0
- package/skills/comet-classic/reference/comet-yaml-fields.md +82 -0
- package/skills/comet-classic/reference/context-recovery.md +128 -0
- package/skills/comet-classic/reference/debug-gate.md +30 -0
- package/skills/comet-classic/reference/decision-point.md +109 -0
- package/skills/comet-classic/reference/dirty-worktree.md +59 -0
- package/skills/comet-classic/reference/file-structure.md +32 -0
- package/skills/comet-classic/reference/intent-frame.md +132 -0
- package/skills/comet-classic/reference/scripts.md +144 -0
- package/skills/comet-classic/reference/sdk-methods.md +136 -0
- package/skills/comet-classic/reference/subagent-dispatch.md +75 -0
- package/skills/comet-classic/reference/workspace.md +23 -0
- package/skills/comet-design/SKILL.md +25 -0
- package/skills/comet-design/agents/openai.yaml +5 -0
- package/skills/comet-design/reference/compat.md +191 -0
- package/skills/comet-hotfix/SKILL.md +46 -0
- package/skills/comet-hotfix/agents/openai.yaml +5 -0
- package/skills/comet-hotfix/reference/compat.md +240 -0
- package/skills/comet-memory/SKILL.md +68 -0
- package/skills/comet-memory/agents/openai.yaml +5 -0
- package/skills/comet-native/SKILL.md +139 -0
- package/skills/comet-native/agents/openai.yaml +3 -0
- package/skills/comet-native/reference/artifacts.md +118 -0
- package/skills/comet-native/reference/clarification.md +120 -0
- package/skills/comet-native/reference/commands.md +321 -0
- package/skills/comet-native/reference/edit-review.md +26 -0
- package/skills/comet-native/reference/recovery.md +64 -0
- package/skills/comet-native/reference/workspace.md +70 -0
- package/skills/comet-native/scripts/comet-native-archive.mjs +475 -0
- package/skills/comet-native/scripts/comet-native-cancel.mjs +461 -0
- package/skills/comet-native/scripts/comet-native-doctor.mjs +475 -0
- package/skills/comet-native/scripts/comet-native-hook-guard.mjs +470 -0
- package/skills/comet-native/scripts/comet-native-init.mjs +465 -0
- package/skills/comet-native/scripts/comet-native-new.mjs +478 -0
- package/skills/comet-native/scripts/comet-native-next.mjs +464 -0
- package/skills/comet-native/scripts/comet-native-root.mjs +472 -0
- package/skills/comet-native/scripts/comet-native-runtime.mjs +525 -0
- package/skills/comet-native/scripts/comet-native-select.mjs +468 -0
- package/skills/comet-native/scripts/comet-native-show.mjs +462 -0
- package/skills/comet-native/scripts/comet-native-spec.mjs +468 -0
- package/skills/comet-native/scripts/comet-native-status.mjs +467 -0
- package/skills/comet-native/scripts/comet-native-transfer.mjs +466 -0
- package/skills/comet-open/SKILL.md +265 -0
- package/skills/comet-open/agents/openai.yaml +5 -0
- package/skills/comet-open/reference/batch-changes.md +51 -0
- package/skills/comet-review/SKILL.md +121 -0
- package/skills/comet-review/agents/openai.yaml +5 -0
- package/skills/comet-tweak/SKILL.md +49 -0
- package/skills/comet-tweak/agents/openai.yaml +5 -0
- package/skills/comet-tweak/reference/compat.md +232 -0
- package/skills/comet-verify/SKILL.md +30 -0
- package/skills/comet-verify/agents/openai.yaml +5 -0
- package/skills/comet-verify/reference/compat.md +202 -0
package/index.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import {createRequire as __cometCreateRequire} from 'node:module'; const require=__cometCreateRequire(import.meta.url);
|
|
2
|
+
var ol=Object.create;var Ni=Object.defineProperty;var sl=Object.getOwnPropertyDescriptor;var al=Object.getOwnPropertyNames;var ll=Object.getPrototypeOf,cl=Object.prototype.hasOwnProperty;var kt=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var k=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var ul=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of al(e))!cl.call(n,i)&&i!==t&&Ni(n,i,{get:()=>e[i],enumerable:!(r=sl(e,i))||r.enumerable});return n};var Nn=(n,e,t)=>(t=n!=null?ol(ll(n)):{},ul(e||!n||!n.__esModule?Ni(t,"default",{value:n,enumerable:!0}):t,n));var _=k(R=>{"use strict";var Tn=Symbol.for("yaml.alias"),$i=Symbol.for("yaml.document"),St=Symbol.for("yaml.map"),Fi=Symbol.for("yaml.pair"),Rn=Symbol.for("yaml.scalar"),Ct=Symbol.for("yaml.seq"),G=Symbol.for("yaml.node.type"),wl=n=>!!n&&typeof n=="object"&&n[G]===Tn,yl=n=>!!n&&typeof n=="object"&&n[G]===$i,kl=n=>!!n&&typeof n=="object"&&n[G]===St,bl=n=>!!n&&typeof n=="object"&&n[G]===Fi,Wi=n=>!!n&&typeof n=="object"&&n[G]===Rn,vl=n=>!!n&&typeof n=="object"&&n[G]===Ct;function Bi(n){if(n&&typeof n=="object")switch(n[G]){case St:case Ct:return!0}return!1}function Sl(n){if(n&&typeof n=="object")switch(n[G]){case Tn:case St:case Rn:case Ct:return!0}return!1}var Cl=n=>(Wi(n)||Bi(n))&&!!n.anchor;R.ALIAS=Tn;R.DOC=$i;R.MAP=St;R.NODE_TYPE=G;R.PAIR=Fi;R.SCALAR=Rn;R.SEQ=Ct;R.hasAnchor=Cl;R.isAlias=wl;R.isCollection=Bi;R.isDocument=yl;R.isMap=kl;R.isNode=Sl;R.isPair=bl;R.isScalar=Wi;R.isSeq=vl});var qe=k(Ln=>{"use strict";var T=_(),M=Symbol("break visit"),Hi=Symbol("skip children"),z=Symbol("remove node");function Et(n,e){let t=Ki(e);T.isDocument(n)?Ee(null,n.contents,t,Object.freeze([n]))===z&&(n.contents=null):Ee(null,n,t,Object.freeze([]))}Et.BREAK=M;Et.SKIP=Hi;Et.REMOVE=z;function Ee(n,e,t,r){let i=Ji(n,e,t,r);if(T.isNode(i)||T.isPair(i))return zi(n,r,i),Ee(n,i,t,r);if(typeof i!="symbol"){if(T.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=Ee(o,e.items[o],t,r);if(typeof s=="number")o=s-1;else{if(s===M)return M;s===z&&(e.items.splice(o,1),o-=1)}}}else if(T.isPair(e)){r=Object.freeze(r.concat(e));let o=Ee("key",e.key,t,r);if(o===M)return M;o===z&&(e.key=null);let s=Ee("value",e.value,t,r);if(s===M)return M;s===z&&(e.value=null)}}return i}async function Pt(n,e){let t=Ki(e);T.isDocument(n)?await Pe(null,n.contents,t,Object.freeze([n]))===z&&(n.contents=null):await Pe(null,n,t,Object.freeze([]))}Pt.BREAK=M;Pt.SKIP=Hi;Pt.REMOVE=z;async function Pe(n,e,t,r){let i=await Ji(n,e,t,r);if(T.isNode(i)||T.isPair(i))return zi(n,r,i),Pe(n,i,t,r);if(typeof i!="symbol"){if(T.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=await Pe(o,e.items[o],t,r);if(typeof s=="number")o=s-1;else{if(s===M)return M;s===z&&(e.items.splice(o,1),o-=1)}}}else if(T.isPair(e)){r=Object.freeze(r.concat(e));let o=await Pe("key",e.key,t,r);if(o===M)return M;o===z&&(e.key=null);let s=await Pe("value",e.value,t,r);if(s===M)return M;s===z&&(e.value=null)}}return i}function Ki(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Ji(n,e,t,r){if(typeof t=="function")return t(n,e,r);if(T.isMap(e))return t.Map?.(n,e,r);if(T.isSeq(e))return t.Seq?.(n,e,r);if(T.isPair(e))return t.Pair?.(n,e,r);if(T.isScalar(e))return t.Scalar?.(n,e,r);if(T.isAlias(e))return t.Alias?.(n,e,r)}function zi(n,e,t){let r=e[e.length-1];if(T.isCollection(r))r.items[n]=t;else if(T.isPair(r))n==="key"?r.key=t:r.value=t;else if(T.isDocument(r))r.contents=t;else{let i=T.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Ln.visit=Et;Ln.visitAsync=Pt});var Dn=k(Yi=>{"use strict";var Ui=_(),El=qe(),Pl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_l=n=>n.replace(/[!,[\]{}]/g,e=>Pl[e]),$e=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return t(6,`Unsupported YAML version ${o}`,s),!1}}default:return t(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 s=e.slice(2,-1);return s==="!"||s==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),s)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return t(String(s)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+_l(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&Ui.isNode(e.contents)){let o={};El.visit(e.contents,(s,a)=>{Ui.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&t.push(`%TAG ${o} ${s}`);return t.join(`
|
|
3
|
+
`)}};$e.defaultYaml={explicit:!1,version:"1.2"};$e.defaultTags={"!!":"tag:yaml.org,2002:"};Yi.Directives=$e});var _t=k(Fe=>{"use strict";var Vi=_(),Al=qe();function Il(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Gi(n){let e=new Set;return Al.visit(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function Qi(n,e){for(let t=1;;++t){let r=`${n}${t}`;if(!e.has(r))return r}}function Ol(n,e){let t=[],r=new Map,i=null;return{onAnchor:o=>{t.push(o),i??(i=Gi(n));let s=Qi(e,i);return i.add(s),s},setAnchors:()=>{for(let o of t){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(Vi.isScalar(s.node)||Vi.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}Fe.anchorIsValid=Il;Fe.anchorNames=Gi;Fe.createNodeAnchors=Ol;Fe.findNewAnchor=Qi});var Mn=k(Xi=>{"use strict";function We(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=We(n,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=We(n,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=We(n,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(let[i,o]of Object.entries(r)){let s=We(n,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return n.call(e,t,r)}Xi.applyReviver=We});var te=k(eo=>{"use strict";var Nl=_();function Zi(n,e,t){if(Array.isArray(n))return n.map((r,i)=>Zi(r,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!Nl.hasAnchor(n))return n.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=o=>{r.res=o,delete t.onCreate};let i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}eo.toJS=Zi});var At=k(no=>{"use strict";var jl=Mn(),to=_(),xl=te(),qn=class{constructor(e){Object.defineProperty(this,to.NODE_TYPE,{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:r,onAnchor:i,reviver:o}={}){if(!to.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=xl.toJS(this,"",s);if(typeof i=="function")for(let{count:l,res:c}of s.anchors.values())i(c,l);return typeof o=="function"?jl.applyReviver(o,{"":a},"",a):a}};no.NodeBase=qn});var Be=k(ro=>{"use strict";var Tl=_t(),Rl=qe(),_e=_(),Ll=At(),Dl=te(),$n=class extends Ll.NodeBase{constructor(e){super(_e.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],Rl.visit(e,{Node:(o,s)=>{(_e.isAlias(s)||_e.hasAnchor(s))&&r.push(s)}}),t&&(t.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:o}=t,s=this.resolve(i,t);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(s);if(a||(Dl.toJS(s,null,t),a=r.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=It(i,s,r)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,r){let i=`*${this.source}`;if(e){if(Tl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function It(n,e,t){if(_e.isAlias(e)){let r=e.resolve(n),i=t&&r&&t.get(r);return i?i.count*i.aliasCount:0}else if(_e.isCollection(e)){let r=0;for(let i of e.items){let o=It(n,i,t);o>r&&(r=o)}return r}else if(_e.isPair(e)){let r=It(n,e.key,t),i=It(n,e.value,t);return Math.max(r,i)}return 1}ro.Alias=$n});var j=k(Fn=>{"use strict";var Ml=_(),ql=At(),$l=te(),Fl=n=>!n||typeof n!="function"&&typeof n!="object",ne=class extends ql.NodeBase{constructor(e){super(Ml.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:$l.toJS(this.value,e,t)}toString(){return String(this.value)}};ne.BLOCK_FOLDED="BLOCK_FOLDED";ne.BLOCK_LITERAL="BLOCK_LITERAL";ne.PLAIN="PLAIN";ne.QUOTE_DOUBLE="QUOTE_DOUBLE";ne.QUOTE_SINGLE="QUOTE_SINGLE";Fn.Scalar=ne;Fn.isScalarValue=Fl});var He=k(oo=>{"use strict";var Wl=Be(),he=_(),io=j(),Bl="tag:yaml.org,2002:";function Hl(n,e,t){if(e){let r=t.filter(o=>o.tag===e),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(r=>r.identify?.(n)&&!r.format)}function Kl(n,e,t){if(he.isDocument(n)&&(n=n.contents),he.isNode(n))return n;if(he.isPair(n)){let f=t.schema[he.MAP].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=t,l;if(r&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=i(n)),new Wl.Alias(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=Bl+e.slice(2));let c=Hl(n,e,s.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let f=new io.Scalar(n);return l&&(l.node=f),f}c=n instanceof Map?s[he.MAP]:Symbol.iterator in Object(n)?s[he.SEQ]:s[he.MAP]}o&&(o(c),delete t.onTagObj);let m=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new io.Scalar(n);return e?m.tag=e:c.default||(m.tag=c.tag),l&&(l.node=m),m}oo.createNode=Kl});var Nt=k(Ot=>{"use strict";var Jl=He(),U=_(),zl=At();function Wn(n,e,t){let r=t;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return Jl.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var so=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Bn=class extends zl.NodeBase{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(r=>U.isNode(r)||U.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(so(e))this.add(t);else{let[r,...i]=e,o=this.get(r,!0);if(U.isCollection(o))o.addIn(i,t);else if(o===void 0&&this.schema)this.set(r,Wn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(U.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,o=this.get(r,!0);return i.length===0?!t&&U.isScalar(o)?o.value:o:U.isCollection(o)?o.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!U.isPair(t))return!1;let r=t.value;return r==null||e&&U.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return U.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...i]=e;if(i.length===0)this.set(r,t);else{let o=this.get(r,!0);if(U.isCollection(o))o.setIn(i,t);else if(o===void 0&&this.schema)this.set(r,Wn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};Ot.Collection=Bn;Ot.collectionFromPath=Wn;Ot.isEmptyPath=so});var Ke=k(jt=>{"use strict";var Ul=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Hn(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var Yl=(n,e,t)=>n.endsWith(`
|
|
4
|
+
`)?Hn(t,e):t.includes(`
|
|
5
|
+
`)?`
|
|
6
|
+
`+Hn(t,e):(n.endsWith(" ")?"":" ")+t;jt.indentComment=Hn;jt.lineComment=Yl;jt.stringifyComment=Ul});var lo=k(Je=>{"use strict";var Vl="flow",Kn="block",xt="quoted";function Gl(n,e,t="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return n;i<o&&(o=0);let l=Math.max(1+o,1+i-e.length);if(n.length<=l)return n;let c=[],m={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,o)?c.push(0):f=i-r);let u,h,g=!1,d=-1,p=-1,w=-1;t===Kn&&(d=ao(n,d,e.length),d!==-1&&(f=d+l));for(let v;v=n[d+=1];){if(t===xt&&v==="\\"){switch(p=d,n[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}w=d}if(v===`
|
|
7
|
+
`)t===Kn&&(d=ao(n,d,e.length)),f=d+e.length+l,u=void 0;else{if(v===" "&&h&&h!==" "&&h!==`
|
|
8
|
+
`&&h!==" "){let b=n[d+1];b&&b!==" "&&b!==`
|
|
9
|
+
`&&b!==" "&&(u=d)}if(d>=f)if(u)c.push(u),f=u+l,u=void 0;else if(t===xt){for(;h===" "||h===" ";)h=v,v=n[d+=1],g=!0;let b=d>w+1?d-2:p-1;if(m[b])return n;c.push(b),m[b]=!0,f=b+l,u=void 0}else g=!0}h=v}if(g&&a&&a(),c.length===0)return n;s&&s();let y=n.slice(0,c[0]);for(let v=0;v<c.length;++v){let b=c[v],E=c[v+1]||n.length;b===0?y=`
|
|
10
|
+
${e}${n.slice(0,E)}`:(t===xt&&m[b]&&(y+=`${n[b]}\\`),y+=`
|
|
11
|
+
${e}${n.slice(b+1,E)}`)}return y}function ao(n,e,t){let r=e,i=e+1,o=n[i];for(;o===" "||o===" ";)if(e<i+t)o=n[++e];else{do o=n[++e];while(o&&o!==`
|
|
12
|
+
`);r=e,i=e+1,o=n[i]}return r}Je.FOLD_BLOCK=Kn;Je.FOLD_FLOW=Vl;Je.FOLD_QUOTED=xt;Je.foldFlowLines=Gl});var Ue=k(co=>{"use strict";var K=j(),re=lo(),Rt=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Lt=n=>/^(%|---|\.\.\.)/m.test(n);function Ql(n,e,t){if(!e||e<0)return!1;let r=e-t,i=n.length;if(i<=r)return!1;for(let o=0,s=0;o<i;++o)if(n[o]===`
|
|
13
|
+
`){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function ze(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Lt(n)?" ":""),s="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(s+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{s+=t.slice(a,l);let m=t.substr(l+2,4);switch(m){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:m.substr(0,2)==="00"?s+="\\x"+m.substr(2):s+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||t[l+2]==='"'||t.length<i)l+=1;else{for(s+=t.slice(a,l)+`
|
|
14
|
+
|
|
15
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)s+=`
|
|
16
|
+
`,l+=2;s+=o,t[l+2]===" "&&(s+="\\"),l+=1,a=l+1}break;default:l+=1}return s=a?s+t.slice(a):t,r?s:re.foldFlowLines(s,o,re.FOLD_QUOTED,Rt(e,!1))}function Jn(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return ze(n,e);let t=e.indent||(Lt(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${t}`)+"'";return e.implicitKey?r:re.foldFlowLines(r,t,re.FOLD_FLOW,Rt(e,!1))}function Ae(n,e){let{singleQuote:t}=e.options,r;if(t===!1)r=ze;else{let i=n.includes('"'),o=n.includes("'");i&&!o?r=Jn:o&&!i?r=ze:r=t?Jn:ze}return r(n,e)}var zn;try{zn=new RegExp(`(^|(?<!
|
|
19
|
+
))
|
|
20
|
+
+(?!
|
|
21
|
+
|$)`,"g")}catch{zn=/\n+(?!\n|$)/g}function Tt({comment:n,type:e,value:t},r,i,o){let{blockQuote:s,commentString:a,lineWidth:l}=r.options;if(!s||/\n[\t ]+$/.test(t))return Ae(t,r);let c=r.indent||(r.forceBlockIndent||Lt(t)?" ":""),m=s==="literal"?!0:s==="folded"||e===K.Scalar.BLOCK_FOLDED?!1:e===K.Scalar.BLOCK_LITERAL?!0:!Ql(t,l,c.length);if(!t)return m?`|
|
|
22
|
+
`:`>
|
|
23
|
+
`;let f,u;for(u=t.length;u>0;--u){let E=t[u-1];if(E!==`
|
|
24
|
+
`&&E!==" "&&E!==" ")break}let h=t.substring(u),g=h.indexOf(`
|
|
25
|
+
`);g===-1?f="-":t===h||g!==h.length-1?(f="+",o&&o()):f="",h&&(t=t.slice(0,-h.length),h[h.length-1]===`
|
|
26
|
+
`&&(h=h.slice(0,-1)),h=h.replace(zn,`$&${c}`));let d=!1,p,w=-1;for(p=0;p<t.length;++p){let E=t[p];if(E===" ")d=!0;else if(E===`
|
|
27
|
+
`)w=p;else break}let y=t.substring(0,w<p?w+1:p);y&&(t=t.substring(y.length),y=y.replace(/\n+/g,`$&${c}`));let b=(d?c?"2":"1":"")+f;if(n&&(b+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){let E=t.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),C=!1,P=Rt(r,!0);s!=="folded"&&e!==K.Scalar.BLOCK_FOLDED&&(P.onOverflow=()=>{C=!0});let S=re.foldFlowLines(`${y}${E}${h}`,c,re.FOLD_BLOCK,P);if(!C)return`>${b}
|
|
29
|
+
${c}${S}`}return t=t.replace(/\n+/g,`$&${c}`),`|${b}
|
|
30
|
+
${c}${y}${t}${h}`}function Xl(n,e,t,r){let{type:i,value:o}=n,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:m}=e;if(a&&o.includes(`
|
|
31
|
+
`)||m&&/[[\]{},]/.test(o))return Ae(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||m||!o.includes(`
|
|
32
|
+
`)?Ae(o,e):Tt(n,e,t,r);if(!a&&!m&&i!==K.Scalar.PLAIN&&o.includes(`
|
|
33
|
+
`))return Tt(n,e,t,r);if(Lt(o)){if(l==="")return e.forceBlockIndent=!0,Tt(n,e,t,r);if(a&&l===c)return Ae(o,e)}let f=o.replace(/\n+/g,`$&
|
|
34
|
+
${l}`);if(s){let u=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),{compat:h,tags:g}=e.doc.schema;if(g.some(u)||h?.some(u))return Ae(o,e)}return a?f:re.foldFlowLines(f,l,re.FOLD_FLOW,Rt(e,!1))}function Zl(n,e,t,r){let{implicitKey:i,inFlow:o}=e,s=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==K.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=K.Scalar.QUOTE_DOUBLE);let l=m=>{switch(m){case K.Scalar.BLOCK_FOLDED:case K.Scalar.BLOCK_LITERAL:return i||o?Ae(s.value,e):Tt(s,e,t,r);case K.Scalar.QUOTE_DOUBLE:return ze(s.value,e);case K.Scalar.QUOTE_SINGLE:return Jn(s.value,e);case K.Scalar.PLAIN:return Xl(s,e,t,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:m,defaultStringType:f}=e.options,u=i&&m||f;if(c=l(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}co.stringifyString=Zl});var Ye=k(Un=>{"use strict";var ec=_t(),ie=_(),tc=Ke(),nc=Ue();function rc(n,e){let t=Object.assign({blockQuote:!0,commentString:tc.stringifyComment,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},n.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function ic(n,e){if(e.tag){let i=n.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let t,r;if(ie.isScalar(e)){r=e.value;let i=n.filter(o=>o.identify?.(r));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}t=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else r=e,t=n.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!t){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return t}function oc(n,e,{anchors:t,doc:r}){if(!r.directives)return"";let i=[],o=(ie.isScalar(n)||ie.isCollection(n))&&n.anchor;o&&ec.anchorIsValid(o)&&(t.add(o),i.push(`&${o}`));let s=n.tag??(e.default?null:e.tag);return s&&i.push(r.directives.tagString(s)),i.join(" ")}function sc(n,e,t,r){if(ie.isPair(n))return n.toString(e,t,r);if(ie.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i,o=ie.isNode(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=ic(e.doc.schema.tags,o));let s=oc(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,t,r):ie.isScalar(o)?nc.stringifyString(o,e,t,r):o.toString(e,t,r);return s?ie.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
35
|
+
${e.indent}${a}`:a}Un.createStringifyContext=rc;Un.stringify=sc});var po=k(mo=>{"use strict";var Q=_(),uo=j(),fo=Ye(),Ve=Ke();function ac({key:n,value:e},t,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:m,simpleKeys:f}}=t,u=Q.isNode(n)&&n.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(Q.isCollection(n)||!Q.isNode(n)&&typeof n=="object"){let P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let h=!f&&(!n||u&&e==null&&!t.inFlow||Q.isCollection(n)||(Q.isScalar(n)?n.type===uo.Scalar.BLOCK_FOLDED||n.type===uo.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!h&&(f||!o),indent:a+l});let g=!1,d=!1,p=fo.stringify(n,t,()=>g=!0,()=>d=!0);if(!h&&!t.inFlow&&p.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(t.inFlow){if(o||e==null)return g&&r&&r(),p===""?"?":h?`? ${p}`:p}else if(o&&!f||e==null&&h)return p=`? ${p}`,u&&!g?p+=Ve.lineComment(p,t.indent,c(u)):d&&i&&i(),p;g&&(u=null),h?(u&&(p+=Ve.lineComment(p,t.indent,c(u))),p=`? ${p}
|
|
36
|
+
${a}:`):(p=`${p}:`,u&&(p+=Ve.lineComment(p,t.indent,c(u))));let w,y,v;Q.isNode(e)?(w=!!e.spaceBefore,y=e.commentBefore,v=e.comment):(w=!1,y=null,v=null,e&&typeof e=="object"&&(e=s.createNode(e))),t.implicitKey=!1,!h&&!u&&Q.isScalar(e)&&(t.indentAtStart=p.length+1),d=!1,!m&&l.length>=2&&!t.inFlow&&!h&&Q.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let b=!1,E=fo.stringify(e,t,()=>b=!0,()=>d=!0),C=" ";if(u||w||y){if(C=w?`
|
|
37
|
+
`:"",y){let P=c(y);C+=`
|
|
38
|
+
${Ve.indentComment(P,t.indent)}`}E===""&&!t.inFlow?C===`
|
|
39
|
+
`&&v&&(C=`
|
|
40
|
+
|
|
41
|
+
`):C+=`
|
|
42
|
+
${t.indent}`}else if(!h&&Q.isCollection(e)){let P=E[0],S=E.indexOf(`
|
|
43
|
+
`),O=S!==-1,Z=t.inFlow??e.flow??e.items.length===0;if(O||!Z){let Ce=!1;if(O&&(P==="&"||P==="!")){let x=E.indexOf(" ");P==="&"&&x!==-1&&x<S&&E[x+1]==="!"&&(x=E.indexOf(" ",x+1)),(x===-1||S<x)&&(Ce=!0)}Ce||(C=`
|
|
44
|
+
${t.indent}`)}}else(E===""||E[0]===`
|
|
45
|
+
`)&&(C="");return p+=C+E,t.inFlow?b&&r&&r():v&&!b?p+=Ve.lineComment(p,t.indent,c(v)):d&&i&&i(),p}mo.stringifyPair=ac});var Vn=k(Yn=>{"use strict";var ho=kt("process");function lc(n,...e){n==="debug"&&console.log(...e)}function cc(n,e){(n==="debug"||n==="warn")&&(typeof ho.emitWarning=="function"?ho.emitWarning(e):console.warn(e))}Yn.debug=lc;Yn.warn=cc});var Ft=k($t=>{"use strict";var qt=_(),go=j(),Dt="<<",Mt={identify:n=>n===Dt||typeof n=="symbol"&&n.description===Dt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new go.Scalar(Symbol(Dt)),{addToJSMap:wo}),stringify:()=>Dt},uc=(n,e)=>(Mt.identify(e)||qt.isScalar(e)&&(!e.type||e.type===go.Scalar.PLAIN)&&Mt.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Mt.tag&&t.default);function wo(n,e,t){let r=yo(n,t);if(qt.isSeq(r))for(let i of r.items)Gn(n,e,i);else if(Array.isArray(r))for(let i of r)Gn(n,e,i);else Gn(n,e,r)}function Gn(n,e,t){let r=yo(n,t);if(!qt.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,n,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function yo(n,e){return n&&qt.isAlias(e)?e.resolve(n.doc,n):e}$t.addMergeToJSMap=wo;$t.isMergeKey=uc;$t.merge=Mt});var Xn=k(vo=>{"use strict";var fc=Vn(),ko=Ft(),dc=Ye(),bo=_(),Qn=te();function mc(n,e,{key:t,value:r}){if(bo.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(ko.isMergeKey(n,t))ko.addMergeToJSMap(n,e,r);else{let i=Qn.toJS(t,"",n);if(e instanceof Map)e.set(i,Qn.toJS(r,i,n));else if(e instanceof Set)e.add(i);else{let o=pc(t,i,n),s=Qn.toJS(r,o,n);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function pc(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(bo.isNode(n)&&t?.doc){let r=dc.createStringifyContext(t.doc,{});r.anchors=new Set;for(let o of t.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=n.toString(r);if(!t.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),fc.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}vo.addPairToJSMap=mc});var oe=k(Zn=>{"use strict";var So=He(),hc=po(),gc=Xn(),Wt=_();function wc(n,e,t){let r=So.createNode(n,void 0,t),i=So.createNode(e,void 0,t);return new Bt(r,i)}var Bt=class n{constructor(e,t=null){Object.defineProperty(this,Wt.NODE_TYPE,{value:Wt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return Wt.isNode(t)&&(t=t.clone(e)),Wt.isNode(r)&&(r=r.clone(e)),new n(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return gc.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?hc.stringifyPair(this,e,t,r):JSON.stringify(this)}};Zn.Pair=Bt;Zn.createPair=wc});var er=k(Eo=>{"use strict";var ge=_(),Co=Ye(),Ht=Ke();function yc(n,e,t){return(e.inFlow??n.flow?bc:kc)(n,e,t)}function kc({comment:n,items:e},t,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=t,m=Object.assign({},t,{indent:o,type:null}),f=!1,u=[];for(let g=0;g<e.length;++g){let d=e[g],p=null;if(ge.isNode(d))!f&&d.spaceBefore&&u.push(""),Kt(t,u,d.commentBefore,f),d.comment&&(p=d.comment);else if(ge.isPair(d)){let y=ge.isNode(d.key)?d.key:null;y&&(!f&&y.spaceBefore&&u.push(""),Kt(t,u,y.commentBefore,f))}f=!1;let w=Co.stringify(d,m,()=>p=null,()=>f=!0);p&&(w+=Ht.lineComment(w,o,c(p))),f&&p&&(f=!1),u.push(r+w)}let h;if(u.length===0)h=i.start+i.end;else{h=u[0];for(let g=1;g<u.length;++g){let d=u[g];h+=d?`
|
|
46
|
+
${l}${d}`:`
|
|
47
|
+
`}}return n?(h+=`
|
|
48
|
+
`+Ht.indentComment(c(n),l),a&&a()):f&&s&&s(),h}function bc({items:n},e,{flowChars:t,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;r+=o;let l=Object.assign({},e,{indent:r,inFlow:!0,type:null}),c=!1,m=0,f=[];for(let g=0;g<n.length;++g){let d=n[g],p=null;if(ge.isNode(d))d.spaceBefore&&f.push(""),Kt(e,f,d.commentBefore,!1),d.comment&&(p=d.comment);else if(ge.isPair(d)){let y=ge.isNode(d.key)?d.key:null;y&&(y.spaceBefore&&f.push(""),Kt(e,f,y.commentBefore,!1),y.comment&&(c=!0));let v=ge.isNode(d.value)?d.value:null;v?(v.comment&&(p=v.comment),v.commentBefore&&(c=!0)):d.value==null&&y?.comment&&(p=y.comment)}p&&(c=!0);let w=Co.stringify(d,l,()=>p=null);c||(c=f.length>m||w.includes(`
|
|
49
|
+
`)),g<n.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((y,v)=>y+v.length+2,2)+(w.length+2)>e.options.lineWidth)),c&&(w+=",")),p&&(w+=Ht.lineComment(w,r,a(p))),f.push(w),m=f.length}let{start:u,end:h}=t;if(f.length===0)return u+h;if(!c){let g=f.reduce((d,p)=>d+p.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=u;for(let d of f)g+=d?`
|
|
50
|
+
${o}${i}${d}`:`
|
|
51
|
+
`;return`${g}
|
|
52
|
+
${i}${h}`}else return`${u}${s}${f.join(" ")}${s}${h}`}function Kt({indent:n,options:{commentString:e}},t,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=Ht.indentComment(e(r),n);t.push(o.trimStart())}}Eo.stringifyCollection=yc});var ae=k(nr=>{"use strict";var vc=er(),Sc=Xn(),Cc=Nt(),se=_(),Jt=oe(),Ec=j();function Ge(n,e){let t=se.isScalar(e)?e.value:e;for(let r of n)if(se.isPair(r)&&(r.key===e||r.key===t||se.isScalar(r.key)&&r.key.value===t))return r}var tr=class extends Cc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(se.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:i,replacer:o}=r,s=new this(e),a=(l,c)=>{if(typeof o=="function")c=o.call(t,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||i)&&s.items.push(Jt.createPair(l,c,r))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,t){let r;se.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Jt.Pair(e,e?.value):r=new Jt.Pair(e.key,e.value);let i=Ge(this.items,r.key),o=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${r.key} already set`);se.isScalar(i.value)&&Ec.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(o){let s=this.items.findIndex(a=>o(r,a)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(e){let t=Ge(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Ge(this.items,e)?.value;return(!t&&se.isScalar(i)?i.value:i)??void 0}has(e){return!!Ge(this.items,e)}set(e,t){this.add(new Jt.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let o of this.items)Sc.addPairToJSMap(t,i,o);return i}toString(e,t,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!se.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),vc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};nr.YAMLMap=tr;nr.findPair=Ge});var Ie=k(_o=>{"use strict";var Pc=_(),Po=ae(),_c={collection:"map",default:!0,nodeClass:Po.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return Pc.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>Po.YAMLMap.from(n,e,t)};_o.map=_c});var le=k(Ao=>{"use strict";var Ac=He(),Ic=er(),Oc=Nt(),Ut=_(),Nc=j(),jc=te(),rr=class extends Oc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ut.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=zt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=zt(e);if(typeof r!="number")return;let i=this.items[r];return!t&&Ut.isScalar(i)?i.value:i}has(e){let t=zt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=zt(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];Ut.isScalar(i)&&Nc.isScalarValue(t)?i.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let i=0;for(let o of this.items)r.push(jc.toJS(o,String(i++),t));return r}toString(e,t,r){return e?Ic.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:i}=r,o=new this(e);if(t&&Symbol.iterator in Object(t)){let s=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(s++);a=i.call(t,l,a)}o.items.push(Ac.createNode(a,void 0,r))}}return o}};function zt(n){let e=Ut.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ao.YAMLSeq=rr});var Oe=k(Oo=>{"use strict";var xc=_(),Io=le(),Tc={collection:"seq",default:!0,nodeClass:Io.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return xc.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>Io.YAMLSeq.from(n,e,t)};Oo.seq=Tc});var Qe=k(No=>{"use strict";var Rc=Ue(),Lc={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),Rc.stringifyString(n,e,t,r)}};No.string=Lc});var Yt=k(To=>{"use strict";var jo=j(),xo={identify:n=>n==null,createNode:()=>new jo.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new jo.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&xo.test.test(n)?n:e.options.nullStr};To.nullTag=xo});var ir=k(Lo=>{"use strict";var Dc=j(),Ro={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new Dc.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&Ro.test.test(n)){let r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};Lo.boolTag=Ro});var Ne=k(Do=>{"use strict";function Mc({format:n,minFractionDigits:e,tag:t,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 o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Do.stringifyNumber=Mc});var sr=k(Vt=>{"use strict";var qc=j(),or=Ne(),$c={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:or.stringifyNumber},Fc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():or.stringifyNumber(n)}},Wc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new qc.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:or.stringifyNumber};Vt.float=Wc;Vt.floatExp=Fc;Vt.floatNaN=$c});var lr=k(Qt=>{"use strict";var Mo=Ne(),Gt=n=>typeof n=="bigint"||Number.isInteger(n),ar=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function qo(n,e,t){let{value:r}=n;return Gt(r)&&r>=0?t+r.toString(e):Mo.stringifyNumber(n)}var Bc={identify:n=>Gt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>ar(n,2,8,t),stringify:n=>qo(n,8,"0o")},Hc={identify:Gt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>ar(n,0,10,t),stringify:Mo.stringifyNumber},Kc={identify:n=>Gt(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>ar(n,2,16,t),stringify:n=>qo(n,16,"0x")};Qt.int=Hc;Qt.intHex=Kc;Qt.intOct=Bc});var Fo=k($o=>{"use strict";var Jc=Ie(),zc=Yt(),Uc=Oe(),Yc=Qe(),Vc=ir(),cr=sr(),ur=lr(),Gc=[Jc.map,Uc.seq,Yc.string,zc.nullTag,Vc.boolTag,ur.intOct,ur.int,ur.intHex,cr.floatNaN,cr.floatExp,cr.float];$o.schema=Gc});var Ho=k(Bo=>{"use strict";var Qc=j(),Xc=Ie(),Zc=Oe();function Wo(n){return typeof n=="bigint"||Number.isInteger(n)}var Xt=({value:n})=>JSON.stringify(n),eu=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Xt},{identify:n=>n==null,createNode:()=>new Qc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Xt},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Xt},{identify:Wo,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Wo(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Xt}],tu={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},nu=[Xc.map,Zc.seq].concat(eu,tu);Bo.schema=nu});var dr=k(Ko=>{"use strict";var Xe=kt("buffer"),fr=j(),ru=Ue(),iu={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Xe.Buffer=="function")return Xe.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},r,i,o){if(!t)return"";let s=t,a;if(typeof Xe.Buffer=="function")a=s instanceof Xe.Buffer?s.toString("base64"):Xe.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=fr.Scalar.BLOCK_LITERAL),e!==fr.Scalar.QUOTE_DOUBLE){let l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),m=new Array(c);for(let f=0,u=0;f<c;++f,u+=l)m[f]=a.substr(u,l);a=m.join(e===fr.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return ru.stringifyString({comment:n,type:e,value:a},r,i,o)}};Ko.binary=iu});var tn=k(en=>{"use strict";var Zt=_(),mr=oe(),ou=j(),su=le();function Jo(n,e){if(Zt.isSeq(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!Zt.isPair(r)){if(Zt.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new mr.Pair(new ou.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
54
|
+
${i.key.commentBefore}`:r.commentBefore),r.comment){let o=i.value??i.key;o.comment=o.comment?`${r.comment}
|
|
55
|
+
${o.comment}`:r.comment}r=i}n.items[t]=Zt.isPair(r)?r:new mr.Pair(r)}}else e("Expected a sequence for this tag");return n}function zo(n,e,t){let{replacer:r}=t,i=new su.YAMLSeq(n);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof r=="function"&&(s=r.call(e,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;i.items.push(mr.createPair(a,l,t))}return i}var au={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jo,createNode:zo};en.createPairs=zo;en.pairs=au;en.resolvePairs=Jo});var gr=k(hr=>{"use strict";var Uo=_(),pr=te(),Ze=ae(),lu=le(),Yo=tn(),we=class n extends lu.YAMLSeq{constructor(){super(),this.add=Ze.YAMLMap.prototype.add.bind(this),this.delete=Ze.YAMLMap.prototype.delete.bind(this),this.get=Ze.YAMLMap.prototype.get.bind(this),this.has=Ze.YAMLMap.prototype.has.bind(this),this.set=Ze.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t?.onCreate&&t.onCreate(r);for(let i of this.items){let o,s;if(Uo.isPair(i)?(o=pr.toJS(i.key,"",t),s=pr.toJS(i.value,o,t)):o=pr.toJS(i,"",t),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(e,t,r){let i=Yo.createPairs(e,t,r),o=new this;return o.items=i.items,o}};we.tag="tag:yaml.org,2002:omap";var cu={collection:"seq",identify:n=>n instanceof Map,nodeClass:we,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=Yo.resolvePairs(n,e),r=[];for(let{key:i}of t.items)Uo.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new we,t)},createNode:(n,e,t)=>we.from(n,e,t)};hr.YAMLOMap=we;hr.omap=cu});var Zo=k(wr=>{"use strict";var Vo=j();function Go({value:n,source:e},t){return e&&(n?Qo:Xo).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var Qo={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Vo.Scalar(!0),stringify:Go},Xo={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Vo.Scalar(!1),stringify:Go};wr.falseTag=Xo;wr.trueTag=Qo});var es=k(nn=>{"use strict";var uu=j(),yr=Ne(),fu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yr.stringifyNumber},du={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():yr.stringifyNumber(n)}},mu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new uu.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:yr.stringifyNumber};nn.float=mu;nn.floatExp=du;nn.floatNaN=fu});var ns=k(tt=>{"use strict";var ts=Ne(),et=n=>typeof n=="bigint"||Number.isInteger(n);function rn(n,e,t,{intAsBigInt:r}){let i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let s=BigInt(n);return i==="-"?BigInt(-1)*s:s}let o=parseInt(n,t);return i==="-"?-1*o:o}function kr(n,e,t){let{value:r}=n;if(et(r)){let i=r.toString(e);return r<0?"-"+t+i.substr(1):t+i}return ts.stringifyNumber(n)}var pu={identify:et,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>rn(n,2,2,t),stringify:n=>kr(n,2,"0b")},hu={identify:et,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>rn(n,1,8,t),stringify:n=>kr(n,8,"0")},gu={identify:et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>rn(n,0,10,t),stringify:ts.stringifyNumber},wu={identify:et,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>rn(n,2,16,t),stringify:n=>kr(n,16,"0x")};tt.int=gu;tt.intBin=pu;tt.intHex=wu;tt.intOct=hu});var vr=k(br=>{"use strict";var an=_(),on=oe(),sn=ae(),ye=class n extends sn.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;an.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new on.Pair(e.key,null):t=new on.Pair(e,null),sn.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=sn.findPair(this.items,e);return!t&&an.isPair(r)?an.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=sn.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new on.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:i}=r,o=new this(e);if(t&&Symbol.iterator in Object(t))for(let s of t)typeof i=="function"&&(s=i.call(t,s,s)),o.items.push(on.createPair(s,null,r));return o}};ye.tag="tag:yaml.org,2002:set";var yu={collection:"map",identify:n=>n instanceof Set,nodeClass:ye,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>ye.from(n,e,t),resolve(n,e){if(an.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new ye,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};br.YAMLSet=ye;br.set=yu});var Cr=k(ln=>{"use strict";var ku=Ne();function Sr(n,e){let t=n[0],r=t==="-"||t==="+"?n.substring(1):n,i=s=>e?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return t==="-"?i(-1)*o:o}function rs(n){let{value:e}=n,t=s=>s;if(typeof e=="bigint")t=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return ku.stringifyNumber(n);let r="";e<0&&(r="-",e*=t(-1));let i=t(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var bu={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Sr(n,t),stringify:rs},vu={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Sr(n,!1),stringify:rs},is={identify:n=>n 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(n){let e=n.match(is.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,i,o,s,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,r-1,i,o||0,s||0,a||0,l),m=e[8];if(m&&m!=="Z"){let f=Sr(m,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ln.floatTime=vu;ln.intTime=bu;ln.timestamp=is});var as=k(ss=>{"use strict";var Su=Ie(),Cu=Yt(),Eu=Oe(),Pu=Qe(),_u=dr(),os=Zo(),Er=es(),cn=ns(),Au=Ft(),Iu=gr(),Ou=tn(),Nu=vr(),Pr=Cr(),ju=[Su.map,Eu.seq,Pu.string,Cu.nullTag,os.trueTag,os.falseTag,cn.intBin,cn.intOct,cn.int,cn.intHex,Er.floatNaN,Er.floatExp,Er.float,_u.binary,Au.merge,Iu.omap,Ou.pairs,Nu.set,Pr.intTime,Pr.floatTime,Pr.timestamp];ss.schema=ju});var ws=k(Ir=>{"use strict";var fs=Ie(),xu=Yt(),ds=Oe(),Tu=Qe(),Ru=ir(),_r=sr(),Ar=lr(),Lu=Fo(),Du=Ho(),ms=dr(),nt=Ft(),ps=gr(),hs=tn(),ls=as(),gs=vr(),un=Cr(),cs=new Map([["core",Lu.schema],["failsafe",[fs.map,ds.seq,Tu.string]],["json",Du.schema],["yaml11",ls.schema],["yaml-1.1",ls.schema]]),us={binary:ms.binary,bool:Ru.boolTag,float:_r.float,floatExp:_r.floatExp,floatNaN:_r.floatNaN,floatTime:un.floatTime,int:Ar.int,intHex:Ar.intHex,intOct:Ar.intOct,intTime:un.intTime,map:fs.map,merge:nt.merge,null:xu.nullTag,omap:ps.omap,pairs:hs.pairs,seq:ds.seq,set:gs.set,timestamp:un.timestamp},Mu={"tag:yaml.org,2002:binary":ms.binary,"tag:yaml.org,2002:merge":nt.merge,"tag:yaml.org,2002:omap":ps.omap,"tag:yaml.org,2002:pairs":hs.pairs,"tag:yaml.org,2002:set":gs.set,"tag:yaml.org,2002:timestamp":un.timestamp};function qu(n,e,t){let r=cs.get(e);if(r&&!n)return t&&!r.includes(nt.merge)?r.concat(nt.merge):r.slice();let i=r;if(!i)if(Array.isArray(n))i=[];else{let o=Array.from(cs.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(n))for(let o of n)i=i.concat(o);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(nt.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?us[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(us).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}Ir.coreKnownTags=Mu;Ir.getTags=qu});var jr=k(ys=>{"use strict";var Or=_(),$u=Ie(),Fu=Oe(),Wu=Qe(),fn=ws(),Bu=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,Nr=class n{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?fn.getTags(e,"compat"):e?fn.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?fn.coreKnownTags:{},this.tags=fn.getTags(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Or.MAP,{value:$u.map}),Object.defineProperty(this,Or.SCALAR,{value:Wu.string}),Object.defineProperty(this,Or.SEQ,{value:Fu.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Bu:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ys.Schema=Nr});var bs=k(ks=>{"use strict";var Hu=_(),xr=Ye(),rt=Ke();function Ku(n,e){let t=[],r=e.directives===!0;if(e.directives!==!1&&n.directives){let l=n.directives.toString(n);l?(t.push(l),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");let i=xr.createStringifyContext(n,e),{commentString:o}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=o(n.commentBefore);t.unshift(rt.indentComment(l,""))}let s=!1,a=null;if(n.contents){if(Hu.isNode(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){let m=o(n.contents.commentBefore);t.push(rt.indentComment(m,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>s=!0,c=xr.stringify(n.contents,i,()=>a=null,l);a&&(c+=rt.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(xr.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let l=o(n.comment);l.includes(`
|
|
56
|
+
`)?(t.push("..."),t.push(rt.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||a)&&t[t.length-1]!==""&&t.push(""),t.push(rt.indentComment(o(l),"")))}return t.join(`
|
|
57
|
+
`)+`
|
|
58
|
+
`}ks.stringifyDocument=Ku});var it=k(vs=>{"use strict";var Ju=Be(),je=Nt(),B=_(),zu=oe(),Uu=te(),Yu=jr(),Vu=bs(),Tr=_t(),Gu=Mn(),Qu=He(),Rr=Dn(),Lr=class n{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:r===void 0&&t&&(r=t,t=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:s}=o;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new Rr.Directives({version:s}),this.setSchema(s,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(n.prototype,{[B.NODE_TYPE]:{value:B.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){xe(this.contents)&&this.contents.add(e)}addIn(e,t){xe(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=Tr.anchorNames(this);e.anchor=!t||r.has(t)?Tr.findNewAnchor(t||"a",r):t}return new Ju.Alias(e.anchor)}createNode(e,t,r){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=y=>typeof y=="number"||y instanceof String||y instanceof Number,w=t.filter(p).map(String);w.length>0&&(t=t.concat(w)),i=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:c,tag:m}=r??{},{onAnchor:f,setAnchors:u,sourceObjects:h}=Tr.createNodeAnchors(this,s||"a"),g={aliasDuplicateObjects:o??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},d=Qu.createNode(e,m,g);return a&&B.isCollection(d)&&(d.flow=!0),u(),d}createPair(e,t,r={}){let i=this.createNode(e,null,r),o=this.createNode(t,null,r);return new zu.Pair(i,o)}delete(e){return xe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return je.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):xe(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return je.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return je.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=je.collectionFromPath(this.schema,[e],t):xe(this.contents)&&this.contents.set(e,t)}setIn(e,t){je.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=je.collectionFromPath(this.schema,Array.from(e),t):xe(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Rr.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Rr.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new Yu.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Uu.toJS(this.contents,t??"",a);if(typeof o=="function")for(let{count:c,res:m}of a.anchors.values())o(m,c);return typeof s=="function"?Gu.applyReviver(s,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new 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 new Error(`"indent" option must be a positive integer, not ${t}`)}return Vu.stringifyDocument(this,e)}};function xe(n){if(B.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}vs.Document=Lr});var at=k(st=>{"use strict";var ot=class extends Error{constructor(e,t,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=t}},Dr=class extends ot{constructor(e,t,r){super("YAMLParseError",e,t,r)}},Mr=class extends ot{constructor(e,t,r){super("YAMLWarning",e,t,r)}},Xu=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:i}=t.linePos[0];t.message+=` at line ${r}, column ${i}`;let o=i-1,s=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(s.substring(0,o))){let a=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
59
|
+
`),s=a+s}if(/[^ ]/.test(s)){let a=1,l=t.linePos[1];l?.line===r&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-o)));let c=" ".repeat(o)+"^".repeat(a);t.message+=`:
|
|
60
|
+
|
|
61
|
+
${s}
|
|
62
|
+
${c}
|
|
63
|
+
`}};st.YAMLError=ot;st.YAMLParseError=Dr;st.YAMLWarning=Mr;st.prettifyError=Xu});var lt=k(Ss=>{"use strict";function Zu(n,{flow:e,indicator:t,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,m=a,f="",u="",h=!1,g=!1,d=null,p=null,w=null,y=null,v=null,b=null,E=null;for(let S of n)switch(g&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&o(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),d&&(c&&S.type!=="comment"&&S.type!=="newline"&&o(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),S.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&S.source.includes(" ")&&(d=S),m=!0;break;case"comment":{m||o(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=S.source.substring(1)||" ";f?f+=u+O:f=O,u="",c=!1;break}case"newline":c?f?f+=S.source:(!b||t!=="seq-item-ind")&&(l=!0):u+=S.source,c=!0,h=!0,(p||w)&&(y=S),m=!0;break;case"anchor":p&&o(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&o(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=S,E??(E=S.offset),c=!1,m=!1,g=!0;break;case"tag":{w&&o(S,"MULTIPLE_TAGS","A node can have at most one tag"),w=S,E??(E=S.offset),c=!1,m=!1,g=!0;break}case t:(p||w)&&o(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),b&&o(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),b=S,c=t==="seq-item-ind"||t==="explicit-key-ind",m=!1;break;case"comma":if(e){v&&o(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=S,c=!1,m=!1;break}default:o(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,m=!1}let C=n[n.length-1],P=C?C.offset+C.source.length:i;return g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=s||r?.type==="block-map"||r?.type==="block-seq")&&o(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:b,spaceBefore:l,comment:f,hasNewline:h,anchor:p,tag:w,newlineAfterProp:y,end:P,start:E??P}}Ss.resolveProps=Zu});var dn=k(Cs=>{"use strict";function qr(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
64
|
+
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(qr(e.key)||qr(e.value))return!0}return!1;default:return!0}}Cs.containsNewline=qr});var $r=k(Es=>{"use strict";var ef=dn();function tf(n,e,t){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&ef.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Es.flowIndentCheck=tf});var Fr=k(_s=>{"use strict";var Ps=_();function nf(n,e,t){let{uniqueKeys:r}=n.options;if(r===!1)return!1;let i=typeof r=="function"?r:(o,s)=>o===s||Ps.isScalar(o)&&Ps.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,t))}_s.mapIncludes=nf});var xs=k(js=>{"use strict";var As=oe(),rf=ae(),Is=lt(),of=dn(),Os=$r(),sf=Fr(),Ns="All mapping items must start at the same column";function af({composeNode:n,composeEmptyNode:e},t,r,i,o){let s=o?.nodeClass??rf.YAMLMap,a=new s(t.schema);t.atRoot&&(t.atRoot=!1);let l=r.offset,c=null;for(let m of r.items){let{start:f,key:u,sep:h,value:g}=m,d=Is.resolveProps(f,{indicator:"explicit-key-ind",next:u??h?.[0],offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),p=!d.found;if(p){if(u&&(u.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==r.indent&&i(l,"BAD_INDENT",Ns)),!d.anchor&&!d.tag&&!h){c=d.end,d.comment&&(a.comment?a.comment+=`
|
|
65
|
+
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||of.containsNewline(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==r.indent&&i(l,"BAD_INDENT",Ns);t.atKey=!0;let w=d.end,y=u?n(t,u,d,i):e(t,w,f,null,d,i);t.schema.compat&&Os.flowIndentCheck(r.indent,u,i),t.atKey=!1,sf.mapIncludes(t,a.items,y)&&i(w,"DUPLICATE_KEY","Map keys must be unique");let v=Is.resolveProps(h??[],{indicator:"map-value-ind",next:g,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=v.end,v.found){p&&(g?.type==="block-map"&&!v.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<v.found.offset-1024&&i(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let b=g?n(t,g,v,i):e(t,l,h,null,v,i);t.schema.compat&&Os.flowIndentCheck(r.indent,g,i),l=b.range[2];let E=new As.Pair(y,b);t.options.keepSourceTokens&&(E.srcToken=m),a.items.push(E)}else{p&&i(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(y.comment?y.comment+=`
|
|
66
|
+
`+v.comment:y.comment=v.comment);let b=new As.Pair(y);t.options.keepSourceTokens&&(b.srcToken=m),a.items.push(b)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}js.resolveBlockMap=af});var Rs=k(Ts=>{"use strict";var lf=le(),cf=lt(),uf=$r();function ff({composeNode:n,composeEmptyNode:e},t,r,i,o){let s=o?.nodeClass??lf.YAMLSeq,a=new s(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=r.offset,c=null;for(let{start:m,value:f}of r.items){let u=cf.resolveProps(m,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(a.comment=u.comment);continue}let h=f?n(t,f,u,i):e(t,u.end,m,null,u,i);t.schema.compat&&uf.flowIndentCheck(r.indent,f,i),l=h.range[2],a.items.push(h)}return a.range=[r.offset,l,c??l],a}Ts.resolveBlockSeq=ff});var Te=k(Ls=>{"use strict";function df(n,e,t,r){let i="";if(n){let o=!1,s="";for(let a of n){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{t&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=l.substring(1)||" ";i?i+=s+m:i=m,s="";break}case"newline":i&&(s+=l),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}Ls.resolveEnd=df});var $s=k(qs=>{"use strict";var mf=_(),pf=oe(),Ds=ae(),hf=le(),gf=Te(),Ms=lt(),wf=dn(),yf=Fr(),Wr="Block collections are not allowed within flow collections",Br=n=>n&&(n.type==="block-map"||n.type==="block-seq");function kf({composeNode:n,composeEmptyNode:e},t,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?Ds.YAMLMap:hf.YAMLSeq),c=new l(t.schema);c.flow=!0;let m=t.atRoot;m&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=r.offset+r.start.source.length;for(let p=0;p<r.items.length;++p){let w=r.items[p],{start:y,key:v,sep:b,value:E}=w,C=Ms.resolveProps(y,{flow:a,indicator:"explicit-key-ind",next:v??b?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!b&&!E){p===0&&C.comma?i(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<r.items.length-1&&i(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),C.comment&&(c.comment?c.comment+=`
|
|
67
|
+
`+C.comment:c.comment=C.comment),f=C.end;continue}!s&&t.options.strict&&wf.containsNewline(v)&&i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)C.comma&&i(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(C.comma||i(C.start,"MISSING_CHAR",`Missing , between ${a} items`),C.comment){let P="";e:for(let S of y)switch(S.type){case"comma":case"space":break;case"comment":P=S.source.substring(1);break e;default:break e}if(P){let S=c.items[c.items.length-1];mf.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
68
|
+
`+P:S.comment=P,C.comment=C.comment.substring(P.length+1)}}if(!s&&!b&&!C.found){let P=E?n(t,E,C,i):e(t,C.end,b,null,C,i);c.items.push(P),f=P.range[2],Br(E)&&i(P.range,"BLOCK_IN_FLOW",Wr)}else{t.atKey=!0;let P=C.end,S=v?n(t,v,C,i):e(t,P,y,null,C,i);Br(v)&&i(S.range,"BLOCK_IN_FLOW",Wr),t.atKey=!1;let O=Ms.resolveProps(b??[],{flow:a,indicator:"map-value-ind",next:E,offset:S.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(O.found){if(!s&&!C.found&&t.options.strict){if(b)for(let x of b){if(x===O.found)break;if(x.type==="newline"){i(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<O.found.offset-1024&&i(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?i(E,"MISSING_CHAR",`Missing space after : in ${a}`):i(O.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Z=E?n(t,E,O,i):O.found?e(t,O.end,b,null,O,i):null;Z?Br(E)&&i(Z.range,"BLOCK_IN_FLOW",Wr):O.comment&&(S.comment?S.comment+=`
|
|
69
|
+
`+O.comment:S.comment=O.comment);let Ce=new pf.Pair(S,Z);if(t.options.keepSourceTokens&&(Ce.srcToken=w),s){let x=c;yf.mapIncludes(t,x.items,S)&&i(P,"DUPLICATE_KEY","Map keys must be unique"),x.items.push(Ce)}else{let x=new Ds.YAMLMap(t.schema);x.flow=!0,x.items.push(Ce);let Oi=(Z??S).range;x.range=[S.range[0],Oi[1],Oi[2]],c.items.push(x)}f=Z?Z.range[2]:O.end}}let u=s?"}":"]",[h,...g]=r.end,d=f;if(h?.source===u)d=h.offset+h.source.length;else{let p=a[0].toUpperCase()+a.substring(1),w=m?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(f,m?"MISSING_CHAR":"BAD_INDENT",w),h&&h.source.length!==1&&g.unshift(h)}if(g.length>0){let p=gf.resolveEnd(g,d,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
70
|
+
`+p.comment:c.comment=p.comment),c.range=[r.offset,d,p.offset]}else c.range=[r.offset,d,d];return c}qs.resolveFlowCollection=kf});var Ws=k(Fs=>{"use strict";var bf=_(),vf=j(),Sf=ae(),Cf=le(),Ef=xs(),Pf=Rs(),_f=$s();function Hr(n,e,t,r,i,o){let s=t.type==="block-map"?Ef.resolveBlockMap(n,e,t,r,o):t.type==="block-seq"?Pf.resolveBlockSeq(n,e,t,r,o):_f.resolveFlowCollection(n,e,t,r,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Af(n,e,t,r,i){let o=r.tag,s=o?e.directives.tagName(o.source,u=>i(o,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){let{anchor:u,newlineAfterProp:h}=r,g=u&&o?u.offset>o.offset?u:o:u??o;g&&(!h||h.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Sf.YAMLMap.tagName&&a==="map"||s===Cf.YAMLSeq.tagName&&a==="seq")return Hr(n,e,t,i,s);let l=e.schema.tags.find(u=>u.tag===s&&u.collection===a);if(!l){let u=e.schema.knownTags[s];if(u?.collection===a)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?i(o,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),Hr(n,e,t,i,s)}let c=Hr(n,e,t,i,s,l),m=l.resolve?.(c,u=>i(o,"TAG_RESOLVE_FAILED",u),e.options)??c,f=bf.isNode(m)?m:new vf.Scalar(m);return f.range=c.range,f.tag=s,l?.format&&(f.format=l.format),f}Fs.composeCollection=Af});var Jr=k(Bs=>{"use strict";var Kr=j();function If(n,e,t){let r=e.offset,i=Of(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?Kr.Scalar.BLOCK_FOLDED:Kr.Scalar.BLOCK_LITERAL,s=e.source?Nf(e.source):[],a=s.length;for(let d=s.length-1;d>=0;--d){let p=s[d][1];if(p===""||p==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&s.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,s.length-1)):"",p=r+i.length;return e.source&&(p+=e.source.length),{value:d,type:o,comment:i.comment,range:[r,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,m=0;for(let d=0;d<a;++d){let[p,w]=s[d];if(w===""||w==="\r")i.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=p.length),m=d,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+w.length+1}for(let d=s.length-1;d>=a;--d)s[d][0].length>l&&(a=d+1);let f="",u="",h=!1;for(let d=0;d<m;++d)f+=s[d][0].slice(l)+`
|
|
72
|
+
`;for(let d=m;d<a;++d){let[p,w]=s[d];c+=p.length+w.length+1;let y=w[w.length-1]==="\r";if(y&&(w=w.slice(0,-1)),w&&p.length<l){let b=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-w.length-(y?2:1),"BAD_INDENT",b),p=""}o===Kr.Scalar.BLOCK_LITERAL?(f+=u+p.slice(l)+w,u=`
|
|
73
|
+
`):p.length>l||w[0]===" "?(u===" "?u=`
|
|
74
|
+
`:!h&&u===`
|
|
75
|
+
`&&(u=`
|
|
76
|
+
|
|
77
|
+
`),f+=u+p.slice(l)+w,u=`
|
|
78
|
+
`,h=!0):w===""?u===`
|
|
79
|
+
`?f+=`
|
|
80
|
+
`:u=`
|
|
81
|
+
`:(f+=u+w,u=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d<s.length;++d)f+=`
|
|
82
|
+
`+s[d][0].slice(l);f[f.length-1]!==`
|
|
83
|
+
`&&(f+=`
|
|
84
|
+
`);break;default:f+=`
|
|
85
|
+
`}let g=r+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[r,g,g]}}function Of({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",l=-1;for(let u=1;u<i.length;++u){let h=i[u];if(!a&&(h==="-"||h==="+"))a=h;else{let g=Number(h);!s&&g?s=g:l===-1&&(l=n+u)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,m="",f=i.length;for(let u=1;u<e.length;++u){let h=e[u];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":t&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,m=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let g=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",g);let d=h.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:o,indent:s,chomp:a,comment:m,length:f}}function Nf(n){let e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),o=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Bs.resolveBlockScalar=If});var Ur=k(Ks=>{"use strict";var zr=j(),jf=Te();function xf(n,e,t){let{offset:r,type:i,source:o,end:s}=n,a,l,c=(u,h,g)=>t(r+u,h,g);switch(i){case"scalar":a=zr.Scalar.PLAIN,l=Tf(o,c);break;case"single-quoted-scalar":a=zr.Scalar.QUOTE_SINGLE,l=Rf(o,c);break;case"double-quoted-scalar":a=zr.Scalar.QUOTE_DOUBLE,l=Lf(o,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let m=r+o.length,f=jf.resolveEnd(s,m,e,t);return{value:l,type:a,comment:f.comment,range:[r,m,f.offset]}}function Tf(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Hs(n)}function Rf(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Hs(n.slice(1,-1)).replace(/''/g,"'")}function Hs(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let i=r[1],o=" ",s=e.lastIndex;for(t.lastIndex=s;r=t.exec(n);)r[1]===""?o===`
|
|
88
|
+
`?i+=o:o=`
|
|
89
|
+
`:(i+=o+r[1],o=" "),s=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,r=a.exec(n),i+o+(r?.[1]??"")}function Lf(n,e){let t="";for(let r=1;r<n.length-1;++r){let i=n[r];if(!(i==="\r"&&n[r+1]===`
|
|
90
|
+
`))if(i===`
|
|
91
|
+
`){let{fold:o,offset:s}=Df(n,r);t+=o,r=s}else if(i==="\\"){let o=n[++r],s=Mf[o];if(s)t+=s;else if(o===`
|
|
92
|
+
`)for(o=n[r+1];o===" "||o===" ";)o=n[++r+1];else if(o==="\r"&&n[r+1]===`
|
|
93
|
+
`)for(o=n[++r+1];o===" "||o===" ";)o=n[++r+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;t+=qf(n,r+1,a,e),r+=a}else{let a=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let o=r,s=n[r+1];for(;s===" "||s===" ";)s=n[++r+1];s!==`
|
|
94
|
+
`&&!(s==="\r"&&n[r+2]===`
|
|
95
|
+
`)&&(t+=r>o?n.slice(o,r+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function Df(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
|
|
96
|
+
`||r==="\r")&&!(r==="\r"&&n[e+2]!==`
|
|
97
|
+
`);)r===`
|
|
98
|
+
`&&(t+=`
|
|
99
|
+
`),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}var Mf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function qf(n,e,t,r){let i=n.substr(e,t),s=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Ks.resolveFlowScalar=xf});var Us=k(zs=>{"use strict";var ke=_(),Js=j(),$f=Jr(),Ff=Ur();function Wf(n,e,t,r){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?$f.resolveBlockScalar(n,e,r):Ff.resolveFlowScalar(e,n.options.strict,r),l=t?n.directives.tagName(t.source,f=>r(t,"TAG_RESOLVE_FAILED",f)):null,c;n.options.stringKeys&&n.atKey?c=n.schema[ke.SCALAR]:l?c=Bf(n.schema,i,l,t,r):e.type==="scalar"?c=Hf(n,i,e,r):c=n.schema[ke.SCALAR];let m;try{let f=c.resolve(i,u=>r(t??e,"TAG_RESOLVE_FAILED",u),n.options);m=ke.isScalar(f)?f:new Js.Scalar(f)}catch(f){let u=f instanceof Error?f.message:String(f);r(t??e,"TAG_RESOLVE_FAILED",u),m=new Js.Scalar(i)}return m.range=a,m.source=i,o&&(m.type=o),l&&(m.tag=l),c.format&&(m.format=c.format),s&&(m.comment=s),m}function Bf(n,e,t,r,i){if(t==="!")return n[ke.SCALAR];let o=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=n.knownTags[t];return s&&!s.collection?(n.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[ke.SCALAR])}function Hf({atKey:n,directives:e,schema:t},r,i,o){let s=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(r))||t[ke.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(r))??t[ke.SCALAR];if(s.tag!==a.tag){let l=e.tagString(s.tag),c=e.tagString(a.tag),m=`Value may be parsed as either ${l} or ${c}`;o(i,"TAG_RESOLVE_FAILED",m,!0)}}return s}zs.composeScalar=Wf});var Vs=k(Ys=>{"use strict";function Kf(n,e,t){if(e){t??(t=e.length);for(let r=t-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++r];i?.type==="space";)n+=i.source.length,i=e[++r];break}}return n}Ys.emptyScalarPosition=Kf});var Xs=k(Vr=>{"use strict";var Jf=Be(),zf=_(),Uf=Ws(),Gs=Us(),Yf=Te(),Vf=Vs(),Gf={composeNode:Qs,composeEmptyNode:Yr};function Qs(n,e,t,r){let i=n.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=t,c,m=!0;switch(e.type){case"alias":c=Qf(n,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Gs.composeScalar(n,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Uf.composeCollection(Gf,n,e,t,r),a&&(c.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);r(e,"RESOURCE_EXHAUSTION",u)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),m=!1}}return c??(c=Yr(n,e.offset,void 0,null,t,r)),a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!zf.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?c.comment=s:c.commentBefore=s),n.options.keepSourceTokens&&m&&(c.srcToken=e),c}function Yr(n,e,t,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:l},c){let m={type:"scalar",offset:Vf.emptyScalarPosition(e,t,r),indent:-1,source:""},f=Gs.composeScalar(n,m,a,c);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=l),f}function Qf({options:n},{offset:e,source:t,end:r},i){let o=new Jf.Alias(t.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+t.length,a=Yf.resolveEnd(r,s,n.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Vr.composeEmptyNode=Yr;Vr.composeNode=Qs});var ta=k(ea=>{"use strict";var Xf=it(),Zs=Xs(),Zf=Te(),ed=lt();function td(n,e,{offset:t,start:r,value:i,end:o},s){let a=Object.assign({_directives:e},n),l=new Xf.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},m=ed.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:t,onError:s,parentIndent:0,startOnNewline:!0});m.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&s(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Zs.composeNode(c,i,m,s):Zs.composeEmptyNode(c,m.end,r,null,m,s);let f=l.contents.range[2],u=Zf.resolveEnd(o,f,!1,s);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}ea.composeDoc=td});var Qr=k(ia=>{"use strict";var nd=kt("process"),rd=Dn(),id=it(),ct=at(),na=_(),od=ta(),sd=Te();function ut(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function ra(n){let e="",t=!1,r=!1;for(let i=0;i<n.length;++i){let o=n[i];switch(o[0]){case"#":e+=(e===""?"":r?`
|
|
101
|
+
|
|
102
|
+
`:`
|
|
103
|
+
`)+(o.substring(1)||" "),t=!0,r=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var Gr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,i,o)=>{let s=ut(t);o?this.warnings.push(new ct.YAMLWarning(s,r,i)):this.errors.push(new ct.YAMLParseError(s,r,i))},this.directives=new rd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:i}=ra(this.prelude);if(r){let o=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
|
+
${r}`:r;else if(i||e.directives.docStart||!o)e.commentBefore=r;else if(na.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];na.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${r}
|
|
105
|
+
${a}`:r}else{let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
106
|
+
${s}`:r}}if(t){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ra(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(t,r)}*next(e){switch(nd.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,i)=>{let o=ut(e);o[0]+=t,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=od.composeDoc(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,r=new ct.YAMLParseError(ut(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new ct.YAMLParseError(ut(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=sd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
107
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ct.YAMLParseError(ut(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 r=Object.assign({_directives:this.directives},this.options),i=new id.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};ia.Composer=Gr});var aa=k(mn=>{"use strict";var ad=Jr(),ld=Ur(),cd=at(),oa=Ue();function ud(n,e=!0,t){if(n){let r=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,o,s);else throw new cd.YAMLParseError([a,a+1],o,s)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ld.resolveFlowScalar(n,e,r);case"block-scalar":return ad.resolveBlockScalar({options:{strict:e}},n,r)}}return null}function fd(n,e){let{implicitKey:t=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=oa.stringifyString({type:s,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
108
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
|
+
`),m=a.substring(0,c),f=a.substring(c+1)+`
|
|
110
|
+
`,u=[{type:"block-scalar-header",offset:o,indent:r,source:m}];return sa(u,l)||u.push({type:"newline",offset:-1,indent:r,source:`
|
|
111
|
+
`}),{type:"block-scalar",offset:o,indent:r,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:l};default:return{type:"scalar",offset:o,indent:r,source:a,end:l}}}function dd(n,e,t={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=t,a="indent"in n?n.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(n.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=n.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=oa.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":md(n,l);break;case'"':Xr(n,l,"double-quoted-scalar");break;case"'":Xr(n,l,"single-quoted-scalar");break;default:Xr(n,l,"scalar")}}function md(n,e){let t=e.indexOf(`
|
|
112
|
+
`),r=e.substring(0,t),i=e.substring(t+1)+`
|
|
113
|
+
`;if(n.type==="block-scalar"){let o=n.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,n.source=i}else{let{offset:o}=n,s="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];sa(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
|
|
114
|
+
`});for(let l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:s,props:a,source:i})}}function sa(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Xr(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let r=n.props.slice(1),i=e.length;n.props[0].type==="block-scalar-header"&&(i-=n.props[0].source.length);for(let o of r)o.offset+=i;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
115
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[i]});break}default:{let r="indent"in n?n.indent:-1,i="end"in n&&Array.isArray(n.end)?n.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(n))o!=="type"&&o!=="offset"&&delete n[o];Object.assign(n,{type:t,indent:r,source:e,end:i})}}}mn.createScalarToken=fd;mn.resolveAsScalar=ud;mn.setScalarValue=dd});var ca=k(la=>{"use strict";var pd=n=>"type"in n?hn(n):pn(n);function hn(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=hn(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=pn(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=pn(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=pn(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function pn({start:n,key:e,sep:t,value:r}){let i="";for(let o of n)i+=o.source;if(e&&(i+=hn(e)),t)for(let o of t)i+=o.source;return r&&(i+=hn(r)),i}la.stringify=pd});var ma=k(da=>{"use strict";var Zr=Symbol("break visit"),hd=Symbol("skip children"),ua=Symbol("remove item");function be(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),fa(Object.freeze([]),n,e)}be.BREAK=Zr;be.SKIP=hd;be.REMOVE=ua;be.itemAtPath=(n,e)=>{let t=n;for(let[r,i]of e){let o=t?.[r];if(o&&"items"in o)t=o.items[i];else return}return t};be.parentCollection=(n,e)=>{let t=be.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],i=t?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function fa(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=fa(Object.freeze(n.concat([[i,s]])),o.items[s],t);if(typeof a=="number")s=a-1;else{if(a===Zr)return Zr;a===ua&&(o.items.splice(s,1),s-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}da.visit=be});var gn=k(q=>{"use strict";var ei=aa(),gd=ca(),wd=ma(),ti="\uFEFF",ni="",ri="",ii="",yd=n=>!!n&&"items"in n,kd=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function bd(n){switch(n){case ti:return"<BOM>";case ni:return"<DOC>";case ri:return"<FLOW_END>";case ii:return"<SCALAR>";default:return JSON.stringify(n)}}function vd(n){switch(n){case ti:return"byte-order-mark";case ni:return"doc-mode";case ri:return"flow-error-end";case ii:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
|
+
`:case`\r
|
|
117
|
+
`: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(n[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}q.createScalarToken=ei.createScalarToken;q.resolveAsScalar=ei.resolveAsScalar;q.setScalarValue=ei.setScalarValue;q.stringify=gd.stringify;q.visit=wd.visit;q.BOM=ti;q.DOCUMENT=ni;q.FLOW_END=ri;q.SCALAR=ii;q.isCollection=yd;q.isScalar=kd;q.prettyToken=bd;q.tokenType=vd});var ai=k(ha=>{"use strict";var ft=gn();function J(n){switch(n){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case" ":return!0;default:return!1}}var pa=new Set("0123456789ABCDEFabcdef"),Sd=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),wn=new Set(",[]{}"),Cd=new Set(` ,[]{}
|
|
119
|
+
\r `),oi=n=>!n||Cd.has(n),si=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
120
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
121
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let i=this.buffer[r+e+1];if(i===`
|
|
122
|
+
`||!i&&!this.atEnd)return e+r+1}return t===`
|
|
123
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&J(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
124
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ft.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){let o=e[r-1];if(o===" "||o===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let o=e[t-1];if(o===" "||o===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ft.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&J(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!J(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(oi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ft.FLOW_END,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(oi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||J(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let o=0;for(;this.buffer[t-1-o]==="\\";)o+=1;if(o%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),i=r.indexOf(`
|
|
125
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let o=this.continueScalar(i+1);if(o===-1)break;i=r.indexOf(`
|
|
126
|
+
`,o)}i!==-1&&(t=i-(r[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>J(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":t+=1;break;case`
|
|
127
|
+
`:e=o,t=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
128
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
|
|
129
|
+
`,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
130
|
+
`;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
|
|
131
|
+
`&&o>=this.pos&&o+1+t>a)e=o;else break}while(!0);return yield ft.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let o=this.buffer[r+1];if(J(o)||e&&wn.has(o))break;t=r}else if(J(i)){let o=this.buffer[r+1];if(i==="\r"&&(o===`
|
|
132
|
+
`?(r+=1,i=`
|
|
133
|
+
`,o=this.buffer[r+1]):t=r),o==="#"||e&&wn.has(o))break;if(i===`
|
|
134
|
+
`){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(e&&wn.has(i))break;t=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ft.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(oi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(J(r)||t&&wn.has(r)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!J(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Sd.has(t))t=this.buffer[++e];else if(t==="%"&&pa.has(this.buffer[e+1])&&pa.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
135
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
136
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};ha.Lexer=si});var ci=k(ga=>{"use strict";var li=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let o=t+r>>1;this.lineStarts[o]<e?t=o+1:r=o}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};ga.LineCounter=li});var fi=k(va=>{"use strict";var Ed=kt("process"),wa=gn(),Pd=ai();function ce(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function ya(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ba(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function yn(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Re(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function kn(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function ka(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!ce(e.start,"explicit-key-ind")&&!ce(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ba(e.value)?e.value.end?kn(e.value.end,e.sep):e.value.end=e.sep:kn(e.start,e.sep),delete e.sep)}var ui=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Pd.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,Ed.env.LOG_TOKENS&&console.log("|",wa.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=wa.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ka(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ya(i.start)===-1&&(t.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<t.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{ya(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=yn(this.peek(2)),r=Re(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
+
`,t)+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 r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.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 i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){kn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&t.sep&&!t.value){let s=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":s.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(o.push(this.sourceToken),e.items.push({start:o}),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):i||t.value?(o.push(this.sourceToken),e.items.push({start:o,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(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ce(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(ba(t.key)&&!ce(t.sep,"newline")){let s=Re(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(ce(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let s=Re(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):ce(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 s=this.flowScalar(this.type);i||t.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ce(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 r&&e.items.push({start:o});this.stack.push(s);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 r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.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 i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){kn(i,t.start),i.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||ce(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.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 i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=yn(r),o=Re(i);ka(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
+
`,t)+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=yn(e),r=Re(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=yn(e),r=Re(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.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())}}};va.Parser=ui});var _a=k(mt=>{"use strict";var Sa=Qr(),_d=it(),dt=at(),Ad=Vn(),Id=_(),Od=ci(),Ca=fi();function Ea(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Od.LineCounter||null,prettyErrors:e}}function Nd(n,e={}){let{lineCounter:t,prettyErrors:r}=Ea(e),i=new Ca.Parser(t?.addNewLine),o=new Sa.Composer(e),s=Array.from(o.compose(i.parse(n)));if(r&&t)for(let a of s)a.errors.forEach(dt.prettifyError(n,t)),a.warnings.forEach(dt.prettifyError(n,t));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function Pa(n,e={}){let{lineCounter:t,prettyErrors:r}=Ea(e),i=new Ca.Parser(t?.addNewLine),o=new Sa.Composer(e),s=null;for(let a of o.compose(i.parse(n),!0,n.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new dt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(s.errors.forEach(dt.prettifyError(n,t)),s.warnings.forEach(dt.prettifyError(n,t))),s}function jd(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=Pa(n,t);if(!i)return null;if(i.warnings.forEach(o=>Ad.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},t))}function xd(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return Id.isDocument(n)&&!r?n.toString(t):new _d.Document(n,r,t).toString(t)}mt.parse=jd;mt.parseAllDocuments=Nd;mt.parseDocument=Pa;mt.stringify=xd});var vn=k(A=>{"use strict";var Td=Qr(),Rd=it(),Ld=jr(),di=at(),Dd=Be(),ue=_(),Md=oe(),qd=j(),$d=ae(),Fd=le(),Wd=gn(),Bd=ai(),Hd=ci(),Kd=fi(),bn=_a(),Aa=qe();A.Composer=Td.Composer;A.Document=Rd.Document;A.Schema=Ld.Schema;A.YAMLError=di.YAMLError;A.YAMLParseError=di.YAMLParseError;A.YAMLWarning=di.YAMLWarning;A.Alias=Dd.Alias;A.isAlias=ue.isAlias;A.isCollection=ue.isCollection;A.isDocument=ue.isDocument;A.isMap=ue.isMap;A.isNode=ue.isNode;A.isPair=ue.isPair;A.isScalar=ue.isScalar;A.isSeq=ue.isSeq;A.Pair=Md.Pair;A.Scalar=qd.Scalar;A.YAMLMap=$d.YAMLMap;A.YAMLSeq=Fd.YAMLSeq;A.CST=Wd;A.Lexer=Bd.Lexer;A.LineCounter=Hd.LineCounter;A.Parser=Kd.Parser;A.parse=bn.parse;A.parseAllDocuments=bn.parseAllDocuments;A.parseDocument=bn.parseDocument;A.stringify=bn.stringify;A.visit=Aa.visit;A.visitAsync=Aa.visitAsync});import{spawn as tl}from"node:child_process";import{chmodSync as Lm,mkdtempSync as Dm,readFileSync as _i,readdirSync as Mm,rmSync as qm,writeFileSync as $m}from"node:fs";import Za from"node:http";import{createRequire as nl}from"node:module";import{connect as Fm}from"node:net";import{tmpdir as Wm}from"node:os";import F from"node:path";import{fileURLToPath as Bm,pathToFileURL as Hm}from"node:url";import{promises as V}from"node:fs";import N from"node:path";import xm from"node:os";import{createHash as Tm}from"node:crypto";import{randomUUID as pl}from"node:crypto";import{promises as ee}from"node:fs";import Me from"node:path";import{performance as Li}from"node:perf_hooks";import{createRequire as fl}from"node:module";var dl=fl(import.meta.url??__filename),bt;function ji(n,e){if(!bt){let t=process.emitWarning;process.emitWarning=((r,...i)=>{String(r instanceof Error?r.message:r).startsWith("SQLite is an experimental feature and might change at any time")||Reflect.apply(t,process,[r,...i])});try{bt=dl("node:sqlite").DatabaseSync}finally{process.emitWarning=t}}return e===void 0?new bt(n):new bt(n,e)}import{AsyncLocalStorage as ml}from"node:async_hooks";var xi=new ml,jn=class extends Error{code="OPERATION_BUDGET_EXCEEDED";constructor(){super("Operation time budget exceeded; unfinished work can be resumed.")}};function Ti(n){return Math.max(0,Math.min(n,(xi.getStore()?.deadline??1/0)-performance.now()))}function Ri(){let n=xi.getStore();if(n&&(n.signal.aborted||performance.now()>=n.deadline))throw new jn}async function Di(n){let e,t;try{let r=await ee.lstat(n);if(!r.isFile()||r.isSymbolicLink())throw new Error("File lock metadata must be a regular file: "+n);t=[r.dev,r.ino,r.size,r.mtimeMs].join(":"),e=await ee.readFile(n,"utf8")}catch(r){if(r.code==="ENOENT")return null;throw r}try{let r=JSON.parse(e),i=r.nonce??r.id,o=typeof r.createdAt=="number"?r.createdAt:Date.parse(r.createdAt);if(typeof i=="string"&&i&&Number.isFinite(o))return{owner:{nonce:i,createdAt:o,...r.protocolVersion===2?{protocolVersion:2}:{},...typeof r.operation=="string"?{operation:r.operation}:{}},token:i,legacy:r.protocolVersion!==2}}catch{}return{owner:null,token:t,legacy:!0}}async function hl(n){let e=n+".sqlite";try{let r=await ee.lstat(e);if(!r.isFile()||r.isSymbolicLink())throw new Error("File lock database must be a regular file: "+e)}catch(r){if(r.code!=="ENOENT")throw r}let t;try{t=ji(Me.toNamespacedPath(e))}catch(r){throw new Error("Unable to open Runtime lock database "+e,{cause:r})}try{return t.exec("PRAGMA busy_timeout=0; BEGIN IMMEDIATE;"),t}catch(r){if(t.close(),/database is (?:locked|busy)/iu.test(String(r)))return null;throw new Error("Unable to acquire Runtime lock transaction "+e,{cause:r})}}function Mi(n){try{n.exec("ROLLBACK;")}finally{n.close()}}async function gl(n,e={}){n=Me.resolve(n),await ee.mkdir(Me.dirname(n),{recursive:!0});let t=await ee.lstat(Me.dirname(n));if(!t.isDirectory()||t.isSymbolicLink())throw new Error("File lock parent must be a real directory: "+Me.dirname(n));let r=Li.now()+Ti(e.timeoutMs??3e4),i;for(;Ri(),i=await hl(n),!i;){if(Li.now()>=r)throw new Error("Timed out waiting for file lock: "+n);await new Promise(a=>setTimeout(a,e.retryMs??20))}let o={protocolVersion:2,nonce:pl(),createdAt:Date.now(),...e.operation?{operation:e.operation}:{}};try{let a=await Di(n);if(a?.legacy)throw new Error("Legacy lock requires confirmation that its previous operation stopped: "+n+`
|
|
141
|
+
Inspect argv: `+JSON.stringify(["comet","doctor","--lock-file",n,"--json"]));a&&await ee.unlink(n),await ee.writeFile(n,JSON.stringify(o),{mode:384,flag:"wx"})}catch(a){throw Mi(i),a}let s=!1;return{owner:o,async release(){if(s)return!0;s=!0;let a=!0;try{let l=await Di(n);l?.token===o.nonce?l.owner?.createdAt===o.createdAt&&l.owner.operation===o.operation?await ee.unlink(n):(a=!1,process.stderr.write("[comet] lock metadata changed while held; kept "+n+`
|
|
142
|
+
`)):l&&(a=!1,process.stderr.write("[comet] lock owned by another holder; kept "+n+`
|
|
143
|
+
`))}finally{Mi(i)}return a}}}async function xn(n,e,t={}){let r=await gl(n,t),i;try{i=await e()}catch(o){try{await r.release()}catch(s){process.stderr.write("[comet] lock cleanup failed; preserved the original operation error: "+String(s)+`
|
|
144
|
+
`)}throw o}return await r.release(),i}function vt(n){let e=Buffer.from(JSON.stringify(n)).toString("base64");if(!/^[A-Za-z0-9+/]*={0,2}$/u.test(e))throw new TypeError("Hook \u53C2\u6570\u7F16\u7801\u5305\u542B\u65E0\u6548\u5B57\u7B26");return`node -e "const r=require('node:child_process').spawnSync(process.execPath,JSON.parse(Buffer.from('${e}','base64').toString()),{stdio:'inherit'});process.exit(r.status??1)"`}function qi(n){if(typeof n!="string")return null;let e=/Buffer\.from\('([A-Za-z0-9+/=]+)','base64'\)/u.exec(n)?.[1];if(!e)return null;try{let t=JSON.parse(Buffer.from(e,"base64").toString());return!Array.isArray(t)||!t.every(r=>typeof r=="string")?null:vt(t)===n?t:null}catch{return null}}import Sm from"path";import{fileURLToPath as Cm}from"url";var Jd=Nn(vn(),1),Ia=[{id:"en",label:"English"},{id:"zh-CN",label:"Simplified Chinese"}];function zd(){return Ia.map(n=>n.id).join(" | ")}function Oa(n){let e=n??"en",t=Ia.find(r=>r.id===e);if(!t)throw new Error(`Invalid artifact language: '${e}'. Valid values: ${zd()}`);return t}import{promises as Y}from"fs";import I from"path";import{AsyncLocalStorage as Xd}from"node:async_hooks";import{constants as de,promises as $}from"fs";import{createHash as Ud}from"node:crypto";function fe(n){return n!==0&&n!==0n&&n!=="0"}function Na(n,e){return fe(n.dev)&&fe(e.dev)&&fe(n.ino)&&fe(e.ino)}function Le(n,e){let t=fe(n.dev)&&fe(e.dev);if(t&&n.dev!==e.dev)return!1;let r=fe(n.ino)&&fe(e.ino);return r&&n.ino!==e.ino?!1:t&&r?!0:n.birthtime===e.birthtime}var H=class extends Error{reason;constructor(e,t,r){super(t,r),this.name="RaceSafeReadError",this.reason=e}};function mi(n){return"birthtimeNs"in n&&typeof n.birthtimeNs=="bigint"?n.birthtimeNs:n.birthtimeMs}function Sn(n){return"ctimeNs"in n&&typeof n.ctimeNs=="bigint"?n.ctimeNs:n.ctimeMs}function pe(n){return{dev:n.dev,ino:n.ino,birthtime:mi(n)}}function Yd(n,e){let t=pe(n),r=pe(e);return Na(t,r)?Le(t,r):Le(t,r)&&mi(n)===mi(e)&&Sn(n)===Sn(e)&&n.size===e.size}function me(n,e){let t=r=>"mtimeNs"in r?r.mtimeNs:r.mtimeMs;return Yd(n,e)&&n.size===e.size&&n.mode===e.mode&&t(n)===t(e)&&Sn(n)===Sn(e)}async function ja(n,e,t={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=t.label??"file",i=t.bigint===!0,o=await $.lstat(n,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new H("not-regular-file",`${r} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new H("too-large",`${r} exceeds ${e} bytes`);let s=await $.realpath(n);await t.verify?.("pre-open",{realPath:s,identity:pe(o)});let a=process.platform==="win32"?de.O_RDONLY:de.O_RDONLY|de.O_NOFOLLOW|de.O_NONBLOCK,l;try{l=await $.open(n,a)}catch(c){throw c.code==="ELOOP"?new H("not-regular-file",`${r} must be a regular file`,{cause:c}):c}try{let[c,m,f]=await Promise.all([l.stat({bigint:i}),$.lstat(n,{bigint:i}),$.realpath(n)]);if(!c.isFile()||!m.isFile()||m.isSymbolicLink()||f!==s||!me(o,c)||!me(o,m))throw new H("changed",`${r} changed while opening`);await t.verify?.("post-open",{realPath:f,identity:pe(c)}),await t.hooks?.afterOpen?.();let u=[],h=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let y=e+1-h,{bytesRead:v}=await l.read(g,0,Math.min(g.length,y),null);if(v===0)break;if(h+=v,h>e)throw new H("too-large",`${r} exceeds ${e} bytes`);u.push(Buffer.from(g.subarray(0,v)))}await t.hooks?.beforeFinalCheck?.();let[d,p,w]=await Promise.all([l.stat({bigint:i}),$.lstat(n,{bigint:i}),$.realpath(n)]);if(!p.isFile()||p.isSymbolicLink()||w!==s||!me(o,d)||!me(o,p))throw new H("changed",`${r} changed while reading`);return await t.verify?.("post-read",{realPath:w,identity:pe(d)}),{bytes:Buffer.concat(u,h),stat:d,realPath:w}}finally{await l.close()}}async function xa(n,e={}){let t=e.label??"file",r=e.bigint===!0,i=await $.lstat(n,{bigint:r});if(!i.isFile()||i.isSymbolicLink())throw new H("not-regular-file",`${t} must be a regular file`);let o=await $.realpath(n);await e.verify?.("pre-open",{realPath:o,identity:pe(i)});let s=process.platform==="win32"?de.O_RDONLY:de.O_RDONLY|de.O_NOFOLLOW|de.O_NONBLOCK,a;try{a=await $.open(n,s)}catch(l){throw l.code==="ELOOP"?new H("not-regular-file",`${t} must be a regular file`,{cause:l}):l}try{let[l,c,m]=await Promise.all([a.stat({bigint:r}),$.lstat(n,{bigint:r}),$.realpath(n)]);if(!l.isFile()||!c.isFile()||c.isSymbolicLink()||m!==o||!me(i,l)||!me(i,c))throw new H("changed",`${t} changed while opening`);await e.verify?.("post-open",{realPath:m,identity:pe(l)}),await e.hooks?.afterOpen?.();let f=Ud(e.algorithm??"sha256"),u=Buffer.allocUnsafe(64*1024);for(;;){let{bytesRead:p}=await a.read(u,0,u.length,null);if(p===0)break;f.update(u.subarray(0,p))}await e.hooks?.beforeFinalCheck?.();let[h,g,d]=await Promise.all([a.stat({bigint:r}),$.lstat(n,{bigint:r}),$.realpath(n)]);if(!g.isFile()||g.isSymbolicLink()||d!==o||!me(i,h)||!me(i,g))throw new H("changed",`${t} changed while reading`);return await e.verify?.("post-read",{realPath:d,identity:pe(h)}),{digest:f.digest("hex"),stat:h,realPath:d}}finally{await a.close()}}import Ta from"path";var ve=Nn(vn(),1),pi=Number.MAX_SAFE_INTEGER;var Vd={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",change_walkthrough:`# Generate a standalone HTML change walkthrough for Native and Classic. Enabling it uses extra explanation tokens.
|
|
145
|
+
# change_walkthrough: true | false (default: true)`,ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
|
|
146
|
+
# ambient_resume: true | false`,memory:"# Project policy for automatic personal-memory learning and retrieval.","memory.learning":`# Allows workflow events in this project to form new personal memories automatically.
|
|
147
|
+
# learning: true | false`,"memory.retrieval":`# Allows personal memories to be injected into Agent context for this project.
|
|
148
|
+
# retrieval: true | false`,knowledge:"# Project knowledge retrieval provider used by ordinary Comet tasks.","knowledge.provider":`# Provider for project knowledge.
|
|
149
|
+
# provider: local | remote`,"knowledge.local":"# Additional project-relative Markdown globs used by the local provider.","knowledge.local.include":"# One project-relative Markdown glob per list item; appended to the built-in corpus.","knowledge.local.max_file_mb":"# Maximum size in MB for one local Markdown document. Increase it for long specifications or verification reports.","knowledge.local.max_total_mb":"# Maximum total size in MB of the local Markdown retrieval corpus.","knowledge.remote":"# Fixed Comet Retrieval API v1 settings used when provider is remote.","knowledge.remote.endpoint":"# HTTPS endpoint; loopback HTTP is allowed.","knowledge.remote.token_env":"# Optional environment variable containing the bearer token.","knowledge.remote.scope":"# Optional opaque remote knowledge scope.","knowledge.remote.timeout_ms":"# Remote request timeout in milliseconds (100-30000).",hook:"# Hook write policy shared by Native and Classic. Paths are project-relative.","hook.allow_paths":"# Project-relative directories allowed during guarded phases. Use one path per list item; empty by default.",native:"# Native workflow settings. They do not change Classic state or behavior.","native.artifact_root":"# Root directory where Native stores Comet specs and changes. Runtime data stays under .comet.","native.language":`# Artifact language used by Native workflow documents.
|
|
150
|
+
# language: en | zh-CN`,"native.clarification_mode":`# Controls how Native asks clarifying questions: batch asks every currently answerable question per round (default), sequential asks one at a time.
|
|
151
|
+
# clarification_mode: batch | sequential`,"native.archive_confirmation":`# Controls whether Native archives automatically after a successful preview or waits for explicit user confirmation.
|
|
152
|
+
# archive_confirmation: automatic | required`,"native.max_verify_failures":"# Maximum failed Verify outcomes allowed for one confirmed acceptance target before Native stops the completion loop.","native.max_parallel_children":"# Maximum dispatched Supervisor children awaiting integration and archive. Defaults to 2; single-session always uses 1. Changes apply at the next dispatch.","native.document_writes":`# Controls documentation file writes during Shape, Verify, and Archive: allow treats them as neutral instead of returning the change to Build, revert restores the strict behavior.
|
|
153
|
+
# document_writes: allow | revert`,"native.finish":"# Optional repository-owned finish providers. Native keeps commit, push, generic remote verification, and recovery ownership.",classic:"# Classic workflow settings. They do not change Native state or behavior.","classic.artifact_layout":`# Selects the Classic artifact layout. The default is docs; update preserves detected root-level legacy artifacts.
|
|
154
|
+
# artifact_layout: legacy | docs`,"classic.language":`# Artifact language used by Classic workflow documents.
|
|
155
|
+
# language: en | zh-CN`,"classic.context_compression":`# Controls beta context compression for new Classic changes.
|
|
156
|
+
# context_compression: off | beta`,"classic.review_mode":`# Sets the default review depth for new Classic changes.
|
|
157
|
+
# review_mode: off | standard | thorough`,"classic.auto_transition":`# Automatically enters the next Classic phase after a phase passes.
|
|
158
|
+
# auto_transition: true | false`,"classic.check_timeout_ms":"# Default check timeout in milliseconds (1-3600000); --timeout-ms overrides it. Default: 300000.","classic.document_evidence":`# Controls how documentation edits affect recorded check evidence: neutral keeps build and verify evidence valid when only documentation files changed, strict binds every working-tree file again.
|
|
159
|
+
# document_evidence: neutral | strict`},"zh-CN":{schema:"# Comet \u4F7F\u7528\u7684\u914D\u7F6E\u683C\u5F0F\u7248\u672C\uFF0C\u8BF7\u52FF\u4FEE\u6539\u6B64\u503C\u3002",default_workflow:"# `/comet` \u9ED8\u8BA4\u8FDB\u5165\u7684\u5DE5\u4F5C\u6D41\uFF1B\u8BE5\u503C\u4E5F\u5FC5\u987B\u51FA\u73B0\u5728 workflows \u4E2D\u3002",workflows:"# \u6B64\u9879\u76EE\u542F\u7528\u7684\u5DE5\u4F5C\u6D41\uFF0C\u53EF\u586B\u5199 native\u3001classic \u6216\u540C\u65F6\u542F\u7528\u4E24\u8005\u3002",change_walkthrough:`# \u662F\u5426\u751F\u6210\u53EF\u76F4\u63A5\u6253\u5F00\u7684 HTML \u53D8\u66F4\u8BF4\u660E\uFF0C\u540C\u65F6\u4F5C\u7528\u4E8E Native \u548C Classic\uFF1B\u5F00\u542F\u4F1A\u589E\u52A0\u8BB2\u89E3\u5185\u5BB9\u7684 token \u6D88\u8017\u3002
|
|
160
|
+
# change_walkthrough: true | false\uFF08\u9ED8\u8BA4 true\uFF09`,ambient_resume:`# \u662F\u5426\u542F\u7528\u53EA\u8BFB\u7684\u73AF\u5883\u611F\u77E5\u6062\u590D\u63A2\u9488\uFF0C\u540C\u65F6\u4F5C\u7528\u4E8E Native \u548C Classic\uFF1B\u8BBE\u4E3A false \u53EF\u5173\u95ED\u81EA\u52A8\u5DE5\u4F5C\u6D41\u6062\u590D\u3002
|
|
161
|
+
# ambient_resume: true | false`,memory:"# \u5F53\u524D\u9879\u76EE\u7684\u4E2A\u4EBA\u8BB0\u5FC6\u81EA\u52A8\u5B66\u4E60\u4E0E\u6CE8\u5165\u7B56\u7565\u3002","memory.learning":`# \u662F\u5426\u5141\u8BB8\u5F53\u524D\u9879\u76EE\u901A\u8FC7\u5DE5\u4F5C\u6D41\u4E8B\u4EF6\u81EA\u52A8\u6C89\u6DC0\u65B0\u7684\u4E2A\u4EBA\u8BB0\u5FC6\u3002
|
|
162
|
+
# \u53EF\u9009\u503C\uFF1Atrue | false`,"memory.retrieval":`# \u662F\u5426\u5141\u8BB8\u5F53\u524D\u9879\u76EE\u628A\u4E2A\u4EBA\u8BB0\u5FC6\u81EA\u52A8\u6CE8\u5165 Agent \u4E0A\u4E0B\u6587\u3002
|
|
163
|
+
# \u53EF\u9009\u503C\uFF1Atrue | false`,knowledge:"# \u666E\u901A Comet \u4EFB\u52A1\u4F7F\u7528\u7684\u9879\u76EE\u77E5\u8BC6\u68C0\u7D22 Provider\u3002","knowledge.provider":`# \u9879\u76EE\u77E5\u8BC6 Provider\u3002
|
|
164
|
+
# \u53EF\u9009\u503C\uFF1Alocal | remote`,"knowledge.local":"# Local Provider \u989D\u5916\u52A0\u8F7D\u7684\u9879\u76EE\u76F8\u5BF9 Markdown \u8DEF\u5F84\u3002","knowledge.local.include":"# \u6BCF\u9879\u586B\u5199\u4E00\u4E2A\u9879\u76EE\u76F8\u5BF9 Markdown glob\uFF1B\u4F1A\u8FFD\u52A0\u5230\u5185\u7F6E\u8BED\u6599\u3002","knowledge.local.max_file_mb":"# \u5355\u4E2A\u672C\u5730 Markdown \u6587\u6863\u5141\u8BB8\u53C2\u4E0E\u68C0\u7D22\u7684\u6700\u5927 MB \u6570\uFF1B\u8F83\u957F\u7684\u89C4\u683C\u6216\u9A8C\u8BC1\u62A5\u544A\u53EF\u6309\u9700\u63D0\u9AD8\u3002","knowledge.local.max_total_mb":"# \u672C\u5730 Markdown \u68C0\u7D22\u8BED\u6599\u5141\u8BB8\u8BFB\u53D6\u7684\u603B MB \u6570\u3002","knowledge.remote":"# provider \u4E3A remote \u65F6\u4F7F\u7528\u7684\u56FA\u5B9A Comet Retrieval API v1 \u914D\u7F6E\u3002","knowledge.remote.endpoint":"# HTTPS \u5730\u5740\uFF1Bloopback \u5730\u5740\u5141\u8BB8\u4F7F\u7528 HTTP\u3002","knowledge.remote.token_env":"# \u53EF\u9009\u7684 Bearer Token \u73AF\u5883\u53D8\u91CF\u540D\u3002","knowledge.remote.scope":"# \u53EF\u9009\u7684\u4E0D\u900F\u660E\u8FDC\u7AEF\u77E5\u8BC6\u5E93\u8303\u56F4\u3002","knowledge.remote.timeout_ms":"# \u8FDC\u7AEF\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF0C100-30000\uFF09\u3002",hook:"# Native \u548C Classic \u5171\u4EAB\u7684 Hook \u5199\u5165\u7B56\u7565\uFF1B\u8DEF\u5F84\u5FC5\u987B\u662F\u9879\u76EE\u76F8\u5BF9\u8DEF\u5F84\u3002","hook.allow_paths":"# \u5728\u53D7\u4FDD\u62A4\u9636\u6BB5\u5141\u8BB8\u5199\u5165\u7684\u9879\u76EE\u76F8\u5BF9\u76EE\u5F55\uFF1B\u6BCF\u9879\u586B\u5199\u4E00\u4E2A\u76EE\u5F55\uFF0C\u9ED8\u8BA4\u4E3A\u7A7A\u3002",native:"# Native \u5DE5\u4F5C\u6D41\u914D\u7F6E\uFF0C\u4E0D\u4F1A\u6539\u53D8 Classic \u7684\u72B6\u6001\u6216\u884C\u4E3A\u3002","native.artifact_root":"# Native \u89C4\u683C\u548C change \u7684\u5B58\u653E\u6839\u76EE\u5F55\uFF1B\u8FD0\u884C\u65F6\u6570\u636E\u59CB\u7EC8\u4F4D\u4E8E .comet\u3002","native.language":`# Native \u5DE5\u4F5C\u6D41\u6587\u6863\u4F7F\u7528\u7684\u4EA7\u7269\u8BED\u8A00\u3002
|
|
165
|
+
# \u53EF\u9009\u503C\uFF1Aen | zh-CN`,"native.clarification_mode":`# Native \u63D0\u95EE\u6F84\u6E05\u95EE\u9898\u7684\u65B9\u5F0F\uFF1Abatch \u6BCF\u8F6E\u4E00\u6B21\u63D0\u51FA\u5F53\u524D\u6240\u6709\u53EF\u56DE\u7B54\u7684\u95EE\u9898\uFF08\u9ED8\u8BA4\uFF09\uFF0Csequential \u6BCF\u8F6E\u53EA\u95EE\u4E00\u4E2A\u3002
|
|
166
|
+
# \u53EF\u9009\u503C\uFF1Abatch | sequential`,"native.archive_confirmation":`# Native \u5F52\u6863\u68C0\u67E5\u6210\u529F\u540E\u81EA\u52A8\u5F52\u6863\uFF0C\u6216\u7B49\u5F85\u7528\u6237\u660E\u786E\u786E\u8BA4\u3002
|
|
167
|
+
# \u53EF\u9009\u503C\uFF1Aautomatic | required`,"native.max_verify_failures":"# \u540C\u4E00\u4E2A\u5DF2\u786E\u8BA4\u9A8C\u6536\u76EE\u6807\u6700\u591A\u5141\u8BB8\u7684 Verify \u5931\u8D25\u6B21\u6570\uFF1B\u8FBE\u5230\u4E0A\u9650\u540E\u505C\u6B62\u5B8C\u6210\u5FAA\u73AF\u3002","native.max_parallel_children":"# Supervisor \u5DF2\u6D3E\u53D1\u4E14\u5C1A\u672A\u5B8C\u6210\u96C6\u6210\u5F52\u6863\u7684\u5B50\u4EFB\u52A1\u4E0A\u9650\uFF1B\u9ED8\u8BA4 2\uFF0Csingle-session \u56FA\u5B9A\u4E3A 1\uFF1B\u8C03\u6574\u4ECE\u4E0B\u4E00\u8F6E\u6D3E\u53D1\u751F\u6548\u3002","native.document_writes":`# Shape\u3001Verify \u548C Archive \u9636\u6BB5\u7684\u6587\u6863\u7C7B\u5199\u5165\u5904\u7406\u65B9\u5F0F\uFF1Aallow \u89C6\u4E3A\u4E2D\u6027\u5199\u5165\u3001\u4E0D\u518D\u628A change \u6253\u56DE Build\uFF0Crevert \u6062\u590D\u4E25\u683C\u884C\u4E3A\u3002
|
|
168
|
+
# \u53EF\u9009\u503C\uFF1Aallow | revert`,"native.finish":"# \u53EF\u9009\u7684\u4ED3\u5E93\u81EA\u6709\u6536\u5C3E provider\uFF1B\u63D0\u4EA4\u3001\u63A8\u9001\u3001\u901A\u7528\u8FDC\u7AEF\u6838\u9A8C\u548C\u6062\u590D\u4ECD\u7531 Native \u8D1F\u8D23\u3002",classic:"# Classic \u5DE5\u4F5C\u6D41\u914D\u7F6E\uFF0C\u4E0D\u4F1A\u6539\u53D8 Native \u7684\u72B6\u6001\u6216\u884C\u4E3A\u3002","classic.artifact_layout":`# Classic \u4EA7\u7269\u5E03\u5C40\uFF1B\u9ED8\u8BA4\u4F7F\u7528 docs\uFF0Cupdate \u68C0\u6D4B\u5230\u6839\u76EE\u5F55 legacy \u4EA7\u7269\u65F6\u4E88\u4EE5\u4FDD\u7559\u3002
|
|
169
|
+
# \u53EF\u9009\u503C\uFF1Alegacy | docs`,"classic.language":`# Classic \u5DE5\u4F5C\u6D41\u6587\u6863\u4F7F\u7528\u7684\u4EA7\u7269\u8BED\u8A00\u3002
|
|
170
|
+
# \u53EF\u9009\u503C\uFF1Aen | zh-CN`,"classic.context_compression":`# \u65B0\u5EFA Classic change \u662F\u5426\u542F\u7528 beta \u4E0A\u4E0B\u6587\u538B\u7F29\u3002
|
|
171
|
+
# \u53EF\u9009\u503C\uFF1Aoff | beta`,"classic.review_mode":`# \u65B0\u5EFA Classic change \u9ED8\u8BA4\u4F7F\u7528\u7684\u5BA1\u67E5\u6DF1\u5EA6\u3002
|
|
172
|
+
# \u53EF\u9009\u503C\uFF1Aoff | standard | thorough`,"classic.auto_transition":`# Classic \u9636\u6BB5\u901A\u8FC7\u540E\u662F\u5426\u81EA\u52A8\u8FDB\u5165\u4E0B\u4E00\u9636\u6BB5\u3002
|
|
173
|
+
# \u53EF\u9009\u503C\uFF1Atrue | false`,"classic.check_timeout_ms":"# \u68C0\u67E5\u547D\u4EE4\u9ED8\u8BA4\u8D85\u65F6\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u8303\u56F4 1-3600000\uFF0C\u7F3A\u7701\u4E3A 300000\uFF1B\u547D\u4EE4\u884C --timeout-ms \u4F18\u5148\u3002","classic.document_evidence":`# \u6587\u6863\u7F16\u8F91\u5BF9\u5DF2\u8BB0\u5F55\u68C0\u67E5\u8BC1\u636E\u7684\u5F71\u54CD\uFF1Aneutral \u5728\u53EA\u6709\u6587\u6863\u6587\u4EF6\u53D8\u5316\u65F6\u4FDD\u6301 build \u548C verify \u8BC1\u636E\u6709\u6548\uFF0Cstrict \u91CD\u65B0\u7ED1\u5B9A\u5DE5\u4F5C\u533A\u7684\u5168\u90E8\u6587\u4EF6\u3002
|
|
174
|
+
# \u53EF\u9009\u503C\uFF1Aneutral | strict`}};function W(n,e){return Vd[e][n]}function hi(n,e,t=!1){if(typeof n!="string")throw new Error(`${e} must be a string`);let r=n.trim().replaceAll("\\","/");if(r.length===0||Ta.posix.isAbsolute(r)||Ta.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!t&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}import{AsyncLocalStorage as Gd}from"node:async_hooks";var Qd=new Gd;function Ra(){let n=Qd.getStore();return n?.active?n:null}function La(n,e){let t=n;for(let r of e)t+="\0"+(typeof r=="string"?r:JSON.stringify(r));return t}function pt(n,e){return(...t)=>{let r=Ra();if(r===null)return e(...t);let i=La(`async:${n}`,t),o=r.entries.get(i);if(o)return o.value;let s=e(...t).catch(a=>{throw r.entries.get(i)?.value===s&&r.entries.delete(i),a});return r.entries.set(i,{value:s}),s}}function Da(n,e){return(...t)=>{let r=Ra();if(r===null)return e(...t);let i=La(`sync:${n}`,t),o=r.entries.get(i);if(o)return o.value;let s=e(...t);return r.entries.set(i,{value:s}),s}}var Zd=new Xd;async function Ma(n,e,t={}){let r=I.resolve(n),i=await Fa(r,e),o=new Map,s=!1,a=u=>[u.dev,u.ino,u.mode,u.birthtimeNs,u.mtimeNs,u.ctimeNs].join(":"),l=u=>[u.dev,u.ino,u.mode,u.birthtimeNs].join(":"),c=async(u,h)=>JSON.stringify((await Y.readdir(u,{withFileTypes:!0})).filter(g=>!h(g)).map(g=>[g.name,g.isDirectory(),g.isSymbolicLink()]).sort((g,d)=>String(g[0]).localeCompare(String(d[0]),"en"))),m=u=>{let h=o.get(u);return h||(h=(async()=>{let g=await Y.lstat(u,{bigint:!0});if(!g.isDirectory()||g.isSymbolicLink())throw new Error(`${e} crosses a symbolic link, junction or invalid directory at ${I.relative(r,u)||"."}`);let d=await Y.realpath(u);if(!ht(i,d))throw new Error(`${e} resolves outside the project root`);let p=t.ignoredDirectoryEntries?.(I.relative(r,u).replaceAll("\\","/")||".");return{stat:g,real:d,...p?{ignoreEntry:p,namespace:await c(u,p)}:{}}})(),h=h.catch(g=>{throw o.delete(u),g}),o.set(u,h)),h};await m(r);let f=async u=>{if(s)throw new Error(`${e} read session is already finished`);let h=hi(u,e),g=r;for(let d of h.split("/").slice(0,-1))g=I.join(g,d),await m(g);return I.resolve(r,...h.split("/"))};return{observePath:f,async observeDirectory(u){let h=await f(u);return await m(h),h},async stat(u){let h=await f(u),g=await Y.lstat(h,{bigint:!0});if(!g.isFile()||g.isSymbolicLink())throw new Error(`${e} must be a real file: ${u}`);return{target:h,stat:g}},async hash(u){let h=await f(u);return xa(h,{bigint:!0,label:`${e} ${u}`,verify:async(g,d)=>{if(!ht(i,d.realPath))throw new Error(`${e} resolves outside the project root`);let p=r,w=[r];for(let y of I.relative(r,I.dirname(h)).split(I.sep).filter(Boolean))p=I.join(p,y),w.push(p);for(let y of w){let v=await o.get(y),b=await Y.lstat(y,{bigint:!0});if(!b.isDirectory()||b.isSymbolicLink()||l(b)!==l(v.stat))throw new Error(`${e} directory changed while reading: ${I.relative(r,y)||"."}`)}}})},async read(u,h,g={}){let d=await f(u);return ja(d,h,{...g,label:`${e} ${u}`,verify:async(p,w)=>{if(!ht(i,w.realPath))throw new Error(`${e} resolves outside the project root`);if(t.deferDirectoryChecks)return;let y=r,v=[r];for(let b of I.relative(r,I.dirname(d)).split(I.sep).filter(Boolean))y=I.join(y,b),v.push(y);for(let b of v){let E=await o.get(b),C=await Y.lstat(b,{bigint:!0});if(!C.isDirectory()||C.isSymbolicLink()||l(C)!==l(E.stat))throw new Error(`${e} directory changed while reading: ${I.relative(r,b)||"."}`)}}})},async finish(u={}){if(s)throw new Error(`${e} read session is already finished`);s=!0;let h=[];for(let[g,d]of o){let p=await d,w=await Y.lstat(g,{bigint:!0});if(!w.isDirectory()||w.isSymbolicLink()||l(p.stat)!==l(w)||!u.allowDirectoryContentChanges&&a(p.stat)!==a(w)&&(!p.ignoreEntry||await c(g,p.ignoreEntry)!==p.namespace)||await Y.realpath(g)!==p.real)throw new Error(`${e} directory changed while observing: ${I.relative(r,g)||"."}`);a(p.stat)!==a(w)&&h.push(I.relative(r,g).replaceAll("\\","/")||".")}return{changedDirectories:h}}}}function em(n){let e=n?.code;return e==="ENOENT"||e==="ENOTDIR"}function ht(n,e){let t=I.relative(n,e);return t===""||!I.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${I.sep}`)}var qa=pt("protectedChainLstat",n=>Y.lstat(n)),$a=pt("protectedChainRealpath",n=>Y.realpath(n)),tm=Da("protectedChainInside",ht);async function Fa(n,e){let t=I.resolve(n),r=await qa(t);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return $a(t)}async function nm(n,e,t,r){let i=n;for(let o=0;o<t.length;o++){i=I.join(i,t[o]);let s;try{s=await qa(i)}catch(c){if(em(c))return{exists:!1,kind:"missing"};throw c}if(s.isSymbolicLink()){let c=I.relative(n,i).replaceAll("\\","/");throw new Error(`${r.label} crosses a symbolic link or junction at ${c}`)}let a=o===t.length-1;if(!a&&!s.isDirectory()){let c=I.relative(n,i).replaceAll("\\","/");throw new Error(`${r.label} ancestor ${c} must be a real directory`)}if(a&&(r.expected==="file"&&!s.isFile()||r.expected==="directory"&&!s.isDirectory()||r.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let l=await $a(i);if(!tm(e,l))throw new Error(`${r.label} resolves outside the project root`);if(a)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function rm(n,e,t){let r=hi(e,t.label),i=I.resolve(n),o=await Fa(i,t.label),s=r.split("/"),a=I.resolve(i,...s);if(!ht(i,a))throw new Error(`${t.label} must stay inside the project root`);let l=await nm(i,o,s,t);return{projectRoot:i,target:a,relative:r,exists:l.exists,kind:l.kind}}var ig=pt("protectedInspectPath",(n,e,t)=>rm(n,e,{label:"Protected project path",expected:t}));async function im(n,e,t,r){let i=!r.hooks&&!r.bigint?Zd.getStore():void 0;if(i){let a=I.resolve(n),l=i.get(a);return l||(l=Ma(a,r.label,{deferDirectoryChecks:!0}).catch(c=>{throw i.delete(a),c}),i.set(a,l)),(await l).read(e,t,r)}let o=await Ma(n,r.label),s=await o.read(e,t,r);return await o.finish({allowDirectoryContentChanges:!0}),s}var om="Cached protected project read",og=pt("protectedReadFile",(n,e,t)=>im(n,e,t,{label:om}));import{promises as Ba}from"node:fs";var sm=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),wi=[50,100,200];async function Ha(n,e){let t;for(let r=0;r<=wi.length;r+=1)try{return await n()}catch(i){t=i;let o=i.code;if(r===wi.length||!sm.has(o??""))throw i;await new Promise(s=>setTimeout(s,wi[r]))}throw t}async function Ka(n,e){await Ha(()=>Ba.rename(n,e),`rename ${e}`)}async function yi(n,e){await Ha(()=>Ba.link(n,e),`link ${e}`)}import{randomUUID as am}from"crypto";import{constants as lm,promises as D}from"fs";import L from"path";async function ki(n,e){try{return await yi(n,e),{linked:!0}}catch(t){let r=t.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw t}return await D.copyFile(n,e,lm.COPYFILE_EXCL),{linked:!1}}function De(n,e){let t=L.relative(n,e);return t===""||!L.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${L.sep}`)}function Cn(n){return{dev:n.dev,ino:n.ino,birthtime:n.birthtimeMs}}function cm(n,e){return Le(n,Cn(e))}function En(n,e){return Le(Cn(n),Cn(e))}function um(n,e){return En(n,e)&&n.birthtimeMs===e.birthtimeMs&&n.ctimeMs===e.ctimeMs&&n.mtimeMs===e.mtimeMs&&n.size===e.size}async function Pn(n){let e=await D.lstat(n);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${n}`);return{path:n,realPath:await D.realpath(n),...Cn(e)}}async function Se(n){for(let e of n){let t=await D.lstat(e.path);if(!t.isDirectory()||t.isSymbolicLink()||!cm(e,t)||await D.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function fm(n,e,t){let[r,i]=await Promise.all([D.lstat(n),D.realpath(n),Se(t)]);if(!r.isFile()||r.isSymbolicLink()||!En(r,e)||!De(t[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return r}async function dm(n,e){let t=await mm(n,e);if(t)return t;let r=L.resolve(n),i=L.resolve(e);if(!De(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let o=[await Pn(r)],s=L.relative(r,i).split(L.sep).filter(Boolean),a=r;for(let l of s){await Se(o),a=L.join(a,l);try{await D.mkdir(a)}catch(m){if(m.code!=="EEXIST")throw m}let c=await Pn(a);if(!De(o[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${a}`);o.push(c)}return await Se(o),o}async function mm(n,e){let t=L.resolve(n),r=L.resolve(e);if(!De(t,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Pn(t)],o=L.relative(t,r).split(L.sep).filter(Boolean),s=t;for(let a of o){s=L.join(s,a);try{let l=await Pn(s);if(!De(i[0].realPath,l.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(l)}catch(l){if(l.code==="ENOENT")return null;throw l}}return await Se(i),i}async function pm(n){let e;try{e=await D.open(n,"r"),await e.sync()}catch(t){let r=t.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw t}finally{await e?.close()}}async function Ja(n,e,t){let r=L.dirname(n),i=await dm(t.containedRoot,r),o=L.join(r,`.${L.basename(n)}.${am()}.tmp`),s,a,l;try{await t.beforeTemporaryOpen?.(),s=await D.open(o,"wx"),a=await s.stat();let[c,m]=await Promise.all([D.lstat(o),D.realpath(o)]);if(await Se(i),!c.isFile()||c.isSymbolicLink()||!En(a,c)||!De(i[0].realPath,m))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),l=await s.stat(),!En(a,l))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await t.afterTemporaryClose?.(),!l)throw new Error("Contained atomic write temporary file was not written");l=await fm(o,l,i),await t.beforeCommit?.(),await Se(i);let f=await D.lstat(o);if(!f.isFile()||f.isSymbolicLink()||!l||!um(f,l))throw new Error("Contained atomic write temporary file changed before commit");t.exclusive?(t.requireAtomicPublication?await yi(o,n):await ki(o,n),await D.unlink(o)):await Ka(o,n),await pm(r)}catch(c){await s?.close();try{await Se(i),await D.rm(o,{force:!0})}catch{}throw c}}async function gt(n,e,t){await Ja(n,e,t)}async function bi(n,e,t){await Ja(n,e,t)}var jg=Number.MAX_SAFE_INTEGER;var An=Nn(vn(),1);var bm="<!-- COMET:DSH:START -->",vm="<!-- COMET:DSH:END -->";var mw=new RegExp(`${Ya(bm)}[\\s\\S]*?${Ya(vm)}`,"u");function Ya(n){return n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}var Em=Cm(import.meta.url),$w=Sm.dirname(Em);function Pm(n){let e=[],t="",r,i=!1,o=!1;for(let s=0;s<n.length;s++){let a=n[s];if(r){a===r?(r=void 0,o=!0):a==="\\"&&n[s+1]===r?(t+=r,s++):t+=a;continue}if(a==="\r"||a===`
|
|
175
|
+
`||";|&<>`".includes(a))return;if(/\s/u.test(a)){i&&(e.push(t),t="",i=!1,o=!1);continue}if(o)return;if(a==='"'||a==="'"){if(i)return;r=a,i=!0;continue}t+=a,i=!0}if(!r)return i&&e.push(t),e}function Ga(n,e,t){if(typeof n!="string")return!1;let r=a=>a.replace(/\\/g,"/").replace(/\.(?:sh|mjs)$/u,""),i=a=>e.some(l=>r(a).endsWith(`/skills/${r(l.replace(/\\/g,"/"))}`));if(Array.isArray(t)){let a=n.replace(/\\/g,"/").split("/").pop()?.toLowerCase(),l=t[0];return(a==="node"||a==="node.exe")&&typeof l=="string"&&i(l)}let o=qi(n);if(o)return typeof o[0]=="string"&&i(o[0]);let s=Pm(n.trim());return!s||s.length<2||!["node","bash","sh"].includes(s[0])?!1:i(s[1].replace(/\\/g,"/"))}function Qa(n,e,t){return[...n.flatMap(i=>{if(!i||typeof i!="object"||Array.isArray(i))return[i];let o=i;if(!Array.isArray(o.hooks))return[o];let s=o.hooks.filter(c=>{let m=c&&typeof c=="object"?c:{};return!Ga(m.command,t,m.args)}),a=s.length!==o.hooks.length,l=Object.keys(o).every(c=>c==="matcher"||c==="hooks");return a&&s.length===0&&l?[]:[{...o,hooks:s}]}),...e]}function _m(n="en"){let e=Oa(n),t=e.id==="zh-CN"?"zh-CN":"en",r=[{key:"change_walkthrough",def:"true",comment:W("change_walkthrough",t)},{key:"ambient_resume",def:"true",comment:W("ambient_resume",t)}],i=[{key:"artifact_layout",def:"docs",comment:W("classic.artifact_layout",t)},{key:"language",def:e.id,comment:W("classic.language",t)},{key:"context_compression",def:"off",comment:W("classic.context_compression",t)},{key:"review_mode",def:"standard",comment:W("classic.review_mode",t)},{key:"auto_transition",def:"true",comment:W("classic.auto_transition",t)}],o=[{key:"artifact_root",def:"docs",comment:W("native.artifact_root",t)},{key:"language",def:"en",comment:W("native.language",t)},{key:"clarification_mode",def:"batch",comment:W("native.clarification_mode",t)},{key:"archive_confirmation",def:"automatic",comment:W("native.archive_confirmation",t)},{key:"max_verify_failures",def:"5",comment:W("native.max_verify_failures",t)}];return{top:r,native:o,classic:i}}var Fw=_m();var dy=!!"".isWellFormed;var Ei="comet/scripts/comet-plugin-hook.mjs";async function Rm(n){let e=Tm("sha256").update(N.resolve(n));async function t(r){for(let i of(await V.readdir(r)).sort()){let o=N.join(r,i),s=await V.lstat(o);if(s.isSymbolicLink())throw new Error(`Comet \u63D2\u4EF6\u8D44\u6E90\u4E0D\u80FD\u662F\u7B26\u53F7\u94FE\u63A5\uFF1A${o}`);s.isDirectory()?await t(o):(await yt(o),e.update(N.relative(n,o)),e.update("\0"),e.update(await V.readFile(o)))}}return await t(N.join(n,"skills")),await t(N.join(n,"rules")),e.digest("hex")}async function yt(n,e=!1){let t=await V.lstat(n).catch(r=>{if(e&&r.code==="ENOENT")return null;throw r});if(t&&(!t.isFile()||t.isSymbolicLink()))throw new Error(`Comet \u63D2\u4EF6\u6587\u4EF6\u4E0D\u662F\u666E\u901A\u6587\u4EF6\uFF1A${n}`)}async function Xa(n){let{platform:e}=n,t=N.resolve(n.pluginRoot),r=n.homeDir??xm.homedir(),i=n.env??process.env,o=N.resolve(e==="codex"?i.CODEX_HOME??N.join(r,".codex"):i.DSH_HOME??N.join(r,".dsh")),s=N.join(t,"skills",Ei);await yt(s),await yt(N.join(t,"rules/comet-workflow-guard.md"));let a=await V.readFile(s),l=await Rm(t),c=l.slice(0,24),m=N.join(o,"comet-plugin",c),f=N.join(m,"skills",Ei),u=e==="codex"?N.join(o,"hooks.json"):N.join(m,"hooks.json");if(await V.mkdir(o,{recursive:!0}),(await V.lstat(o)).isSymbolicLink())throw new Error("Comet \u63D2\u4EF6\u914D\u7F6E\u76EE\u5F55\u4E0D\u80FD\u662F\u7B26\u53F7\u94FE\u63A5");if(await yt(f,!0),await V.readFile(f).catch(()=>null)===null&&await bi(f,a,{containedRoot:o,exclusive:!0}).catch(p=>{if(p.code!=="EEXIST")throw p}),!(await V.readFile(f)).equals(a))throw new Error("Comet \u63D2\u4EF6\u542F\u52A8\u5668\u5185\u5BB9\u4E0E\u5B89\u88C5\u5305\u4E0D\u4E00\u81F4");let g=N.basename(N.dirname(t))==="comet"?`comet@${N.basename(N.dirname(N.dirname(t)))}`:void 0,d=p=>vt([f,"--platform",e,"--plugin-root",t,"--event",p,"--config-root",o,"--package-hash",l,...g&&e==="codex"?["--plugin-key",g]:[],...n.cliEntry?["--cli-entry",n.cliEntry]:[]]);return await xn(N.join(o,"comet-plugin-setup.lock"),async()=>{await yt(u,!0);let p=await V.readFile(u,"utf8").catch(b=>{if(b.code==="ENOENT")return"{}";throw b}),w=JSON.parse(p);if(!w||typeof w!="object"||Array.isArray(w))throw new Error("Hook \u914D\u7F6E\u5FC5\u987B\u662F JSON \u5BF9\u8C61");if(w.hooks!==void 0&&(!w.hooks||typeof w.hooks!="object"||Array.isArray(w.hooks)))throw new Error("hooks \u5FC5\u987B\u662F JSON \u5BF9\u8C61");let y=w.hooks??{};for(let b of["SessionStart","PreToolUse"]){if(y[b]!==void 0&&!Array.isArray(y[b]))throw new Error(`${b} \u5FC5\u987B\u662F\u6570\u7EC4`);y[b]=Qa(y[b]??[],[{matcher:e==="dsh"&&b==="PreToolUse"?"write|edit":"",hooks:[{type:"command",command:d(b)}]}],[Ei])}w.hooks=y;let v=`${JSON.stringify(w,null,2)}
|
|
176
|
+
`;p!==v&&await gt(u,v,{containedRoot:o})},{timeoutMs:3e4,retryMs:50}),{platform:e,hookConfigPath:u,requiresHookTrust:e==="codex"}}var Xy="comet",Zy=["skills"];async function Km(){let n=[import.meta.url];process.argv[1]&&n.push(Hm(F.resolve(process.argv[1])).href);for(let e of n){let t=nl(e);try{t.resolve("@deepseek-ai/dsh-hooks-claude-code")}catch{continue}return t("@deepseek-ai/dsh-hooks-claude-code")}throw new Error("Comet \u7F3A\u5C11\u5B98\u65B9 dsh-hooks-claude-code \u4F9D\u8D56\uFF0C\u8BF7\u91CD\u65B0\u5B89\u88C5\u63D2\u4EF6")}var On=F.dirname(Bm(import.meta.url)),Pi=F.join(On,"skills"),Jm="/comet-plugin/status",zm="/comet-plugin/dashboard",rl="comet.dsh-plugin.v1",Um="comet.dsh-dashboard.v1",Ai=JSON.parse(_i(F.join(On,"package.json"),"utf8")).version,Ym=3e4,Vm=1500;function Gm(n){let e=n.trim();return e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1).replaceAll("''","'"):e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Qm(n,e){let t=F.join(e,"SKILL.md"),r=_i(t,"utf8"),i=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(r);if(i===null)throw new Error(`Comet skill ${t} has no frontmatter block`);let o=/^description:[ \t]*(.+?)[ \t]*$/mu.exec(i[1]);if(o===null)throw new Error(`Comet skill ${t} has no description`);let s=r.slice(i[0].length).replace(/^\r?\n/u,""),a=Gm(o[1]);return{directory:e,description:a,registration:{name:n,description:a,content:s,invocation:{modelInvocable:!0,userInvocable:!0},source:"bundled",path:t,resourceBase:{kind:"directory",path:e}}}}var In;function il(){if(In!==void 0)return In;let n=Mm(Pi,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).sort();if(n.length===0)throw new Error(`Comet bundle has no skills in ${Pi}`);return In=n.map(e=>Qm(e,F.join(Pi,e))),In}function Ii(){let n;try{n=nl(import.meta.url).resolve("@rpamis/comet/package.json")}catch{return}try{let e=JSON.parse(_i(n,"utf8")),t=typeof e.bin=="string"?e.bin:e.bin?.comet;return typeof t!="string"||t===""?void 0:{packageRoot:F.dirname(n),binPath:F.resolve(F.dirname(n),t),version:typeof e.version=="string"?e.version:void 0}}catch{return}}async function Xm(n,e=Ii()){return e!==void 0?{source:"bundled",version:e.version,command:process.execPath,argsPrefix:[e.binPath],env:{ELECTRON_RUN_AS_NODE:"1"}}:{source:"path",command:await n.resolveExecutable("comet"),argsPrefix:[],env:{}}}function Zm(n){let e=Dm(F.join(Wm(),"comet-dsh-cli-")),t=process.platform==="win32",r=F.join(e,t?"comet.cmd":"comet"),i=n.argsPrefix.map(l=>`"${l}"`).join(" "),o=t?`@echo off\r
|
|
177
|
+
setlocal DisableDelayedExpansion\r
|
|
178
|
+
set "ELECTRON_RUN_AS_NODE=1"\r
|
|
179
|
+
"${n.command}" ${i} %*\r
|
|
180
|
+
`:`#!/bin/sh
|
|
181
|
+
export ELECTRON_RUN_AS_NODE=1
|
|
182
|
+
exec "${n.command}" ${i} "$@"
|
|
183
|
+
`;$m(r,o),t||Lm(r,493);let s=t?Object.keys(process.env).find(l=>l.toUpperCase()==="PATH")??"PATH":"PATH",a=process.env[s];return process.env[s]=a?`${e}${F.delimiter}${a}`:e,{file:r,dispose(){if(process.env[s]!==void 0){let l=process.env[s].split(F.delimiter).filter(c=>c!==e).join(F.delimiter);l===""&&a===void 0?delete process.env[s]:process.env[s]=l}qm(e,{recursive:!0,force:!0})}}}function ep(n,e,t=process.platform,r=process.env.ComSpec){let i=n.command,o=i.toLowerCase(),s=n.env??{};if(t==="win32"&&(o.endsWith(".cmd")||o.endsWith(".bat"))){if(/["\r\n\0]/u.test(i)||/["\r\n\0]/u.test(e))throw new Error("Comet Dashboard paths cannot contain double quotes");return{command:r||"cmd.exe",args:["/d","/v:off","/s","/c",'""%COMET_DSH_CLI%" dashboard "%COMET_DSH_CWD%" --no-open"'],verbatim:!0,env:{...s,COMET_DSH_CLI:i,COMET_DSH_CWD:e}}}return{command:i,args:[...n.argsPrefix??[],"dashboard",e,"--no-open"],verbatim:!1,env:s}}function tp(n){return new Promise(e=>{let t;try{t=new URL(n)}catch{e(!1);return}let r=Number(t.port===""?t.protocol==="https:"?443:80:t.port),i=Fm({host:t.hostname,port:r}),o=s=>{i.destroy(),e(s)};i.setTimeout(Vm,()=>o(!1)),i.once("connect",()=>o(!0)),i.once("error",()=>o(!1))})}function np(n,e){if(e==="win32"&&n.pid!==void 0){tl("taskkill",["/pid",String(n.pid),"/T","/F"],{windowsHide:!0,stdio:"ignore"});return}n.kill()}function rp(n){return new Promise((e,t)=>{let r;try{r=new URL(n)}catch(s){t(s);return}let i=r.port===""?r.protocol==="https:"?443:80:Number(r.port),o=Za.createServer((s,a)=>{let l={...s.headers,host:r.host};delete l.origin,delete l["sec-fetch-site"],delete l["sec-fetch-dest"],delete l["sec-fetch-mode"];let c=Za.request({hostname:r.hostname,port:i,path:s.url,method:s.method,headers:l},m=>{a.writeHead(m.statusCode??502,m.headers),m.pipe(a)});c.on("error",()=>{a.headersSent||a.writeHead(502,{"content-type":"text/plain; charset=utf-8"}),a.end("Comet Dashboard is unavailable")}),s.pipe(c)});o.once("error",t),o.listen(0,"127.0.0.1",()=>{let s=o.address(),a=typeof s=="object"&&s!==null?s.port:0;e({origin:`http://127.0.0.1:${a}`,close(){return typeof o.closeAllConnections=="function"&&o.closeAllConnections(),new Promise(l=>o.close(()=>l()))}})})})}function ip({spawnProcess:n=tl,probe:e=tp,stopProcess:t=np,createProxy:r=rp,timeoutMs:i=Ym,platform:o=process.platform}={}){let s=new Map,a=new Map,l=u=>o==="win32"?u.toLowerCase():u,c=u=>{try{t(u,o)}catch{}},m=u=>{u!==void 0&&Promise.resolve(u.close()).catch(()=>{})},f=async(u,h)=>{let g=ep(u,h,o),d=n(g.command,g.args,{cwd:h,env:{...process.env,...g.env},stdio:["ignore","pipe","pipe"],windowsHide:!0,windowsVerbatimArguments:g.verbatim}),p="",w=await new Promise((v,b)=>{let E=setTimeout(()=>b(new Error(`Comet Dashboard did not report a URL within ${i} ms`)),i),C=(P,S)=>{clearTimeout(E),P(S)};d.stdout?.on("data",P=>{let S=String(P);if(!S.includes("Comet Dashboard running at"))return;let O=/Comet Dashboard running at (https?:\/\/\S+)/u.exec(S);O!==null&&C(v,O[1])}),d.stderr?.on("data",P=>{p=`${p}${String(P)}`.slice(-2e3)}),d.once("error",P=>C(b,P)),d.once("exit",P=>{C(b,new Error(`Comet Dashboard exited with code ${P}: ${p.trim()}`))})}).catch(v=>{throw c(d),v}),y;try{y=await r(w)}catch(v){throw c(d),v}return s.set(l(h),{child:d,url:w,proxy:y}),{url:w,webUrl:y.origin}};return{async open(u,h){let g=l(h),d=s.get(g);if(d!==void 0&&await e(d.url))return{url:d.url,webUrl:d.proxy.origin,started:!1};d!==void 0&&(c(d.child),m(d.proxy),s.delete(g));let p=a.get(g);if(p!==void 0)return{...await p,started:!0};let w=f(u,h);a.set(g,w);try{return{...await w,started:!0}}finally{a.delete(g)}},dispose(){for(let u of s.values())c(u.child),m(u.proxy);s.clear(),a.clear()}}}function el(n,e=200){return new Response(JSON.stringify(n),{status:e,headers:{"content-type":"application/json; charset=utf-8","cache-control":"no-store"}})}function op(){return new Response("Method Not Allowed",{status:405,headers:{allow:"GET, HEAD"}})}function X(n,e,t,r={}){n.writeHead(e,{"content-type":"application/json; charset=utf-8","cache-control":"no-store",...r}),n.end(JSON.stringify(t))}async function sp(n,e=16384){let t=[],r=0;for await(let o of n){let s=Buffer.isBuffer(o)?o:Buffer.from(String(o));if(r+=s.length,r>e)return{error:"body-too-large"};t.push(s)}let i=Buffer.concat(t).toString("utf8");if(i==="")return{value:{}};try{return{value:JSON.parse(i)}}catch{return{error:"invalid-json"}}}async function ap(n,e){let t=await n.skills.list(),r=new Map(t.map(o=>[o.name,o])),i=Ii();return{schema:rl,version:Ai,integration:e,cli:i!==void 0&&i.version!==void 0?{source:"bundled",version:i.version}:{source:"path"},skills:il().map(o=>{let s=r.get(o.registration.name);return{name:o.registration.name,description:s?.description??o.description,provider:s?.provider??null,source:s?.source??null,pluginOwned:s?.provider==="runtime"}})}}async function lp({agents:n,workingDirectory:e,subprocess:t,launcher:r},i,o){if(i.method!=="POST"){X(o,405,{error:"method-not-allowed"},{allow:"POST"});return}if(String(i.headers["content-type"]??"").split(";",1)[0].trim().toLowerCase()!=="application/json"){X(o,415,{error:"json-required"});return}let a=await sp(i);if(a.error!==void 0){X(o,a.error==="body-too-large"?413:400,{error:a.error});return}let l=typeof a.value?.sessionId=="string"?a.value.sessionId.trim():"";if(l===""){X(o,400,{error:"session-required"});return}let c=n.get(l);if(c===void 0){X(o,404,{error:"unknown-session"});return}let m;try{m=await e.ensure(c)}catch(u){X(o,409,{error:"workspace-unavailable",message:String(u?.message??u)});return}let f;try{f=await Xm(t)}catch(u){X(o,503,{error:"cli-unavailable",message:String(u?.message??u)});return}try{let u=await r.open(f,m);X(o,200,{schema:Um,version:Ai,cwd:m,cli:{source:f.source,...f.version===void 0?{}:{cliVersion:f.version}},...u})}catch(u){X(o,503,{error:"dashboard-unavailable",message:String(u?.message??u)})}}function ek(n){let e={status:"starting"},t=il();n.effect(()=>{let o=t.map(s=>n.skills.register(s.registration));return()=>{for(let s of o.reverse())s()}},"comet: bundled skills"),n.logger?.info?.(`Comet plugin registered ${t.length} bundled skills`);let r=ip();n.effect(()=>()=>r.dispose(),"comet: dashboard processes");let i=Ii();if(i!==void 0){let o;try{o=Zm({command:process.execPath,argsPrefix:[i.binPath]})}catch(s){n.logger?.warn?.(`Comet plugin could not prepare its bundled CLI: ${String(s?.message??s)}`)}o!==void 0&&n.effect(()=>()=>o.dispose(),"comet: bundled CLI shim")}n.inject(["agents","workingDirectory","subprocess","webServer"],o=>{let s=!1,a;o.effect(()=>()=>{s=!0,a?.dispose()},"comet: workflow bridge"),typeof o.plugin!="function"?(e.status="unavailable",e.message="\u5F53\u524D DSH \u672A\u63D0\u4F9B Cordis \u63D2\u4EF6\u6302\u8F7D\u5165\u53E3"):(async()=>{let c=await Xa({platform:"dsh",pluginRoot:On}),m=await Km();s||(a=o.plugin(m,{configPath:c.hookConfigPath,pluginRoot:On}),e.status="ready",e.hookConfigPath=c.hookConfigPath)})().catch(c=>{e.status="failed",e.message=String(c?.message??c),n.logger?.warn?.(`Comet \u81EA\u52A8\u63A5\u5165\u5931\u8D25\uFF1A${e.message}`)});let l={agents:o.agents,workingDirectory:o.workingDirectory,subprocess:o.subprocess,launcher:r};o.effect(()=>o.webServer.register({kind:"exact",path:Jm,resource:async c=>{let m=c.method.toUpperCase();if(m!=="GET"&&m!=="HEAD")return op();try{return el(await ap(n,e))}catch(f){return el({schema:rl,version:Ai,error:String(f?.message??f)},500)}}}),"comet: status route"),o.effect(()=>o.webServer.register({kind:"exact",path:zm,handler:(c,m)=>lp(l,c,m)}),"comet: dashboard route")})}export{ek as apply,Zm as createCometShim,ip as createDashboardLauncher,ep as dashboardCommand,Zy as inject,Xy as name,Ii as resolveBundledComet,Xm as resolveCometCli,Km as resolveDshHookBridge,rp as startDashboardProxy};
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Comet",
|
|
4
|
+
"description": "Comet is a resumable long-running workflow and Skill platform for agents. Move from requirements through implementation, verification and archiving while retaining personal memory and project knowledge. In DeepSeek Harness, open the current project Dashboard from the sidebar and use the matching Comet CLI installed with the plugin.",
|
|
5
|
+
"detail": "README.en.md"
|
|
6
|
+
}
|
|
7
|
+
}
|