@rpamis/comet 0.4.0-rc.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +332 -333
  3. package/assets/manifest.json +1 -1
  4. package/assets/skills/comet/scripts/comet-archive.mjs +56 -51
  5. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +22 -20
  6. package/assets/skills/comet/scripts/comet-guard.mjs +93 -88
  7. package/assets/skills/comet/scripts/comet-handoff.mjs +111 -106
  8. package/assets/skills/comet/scripts/comet-hook-guard.mjs +54 -49
  9. package/assets/skills/comet/scripts/comet-hook-router.mjs +106 -106
  10. package/assets/skills/comet/scripts/comet-intent.mjs +12 -7
  11. package/assets/skills/comet/scripts/comet-resume-probe.mjs +50 -45
  12. package/assets/skills/comet/scripts/comet-runtime.mjs +180 -175
  13. package/assets/skills/comet/scripts/comet-state.mjs +80 -75
  14. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +57 -52
  15. package/assets/skills/comet-classic/reference/scripts.md +1 -1
  16. package/assets/skills/comet-native/SKILL.md +3 -3
  17. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +31 -31
  18. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +51 -51
  19. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +3 -3
  20. package/assets/skills/comet-native/scripts/comet-native-init.mjs +37 -37
  21. package/assets/skills/comet-native/scripts/comet-native-new.mjs +33 -33
  22. package/assets/skills/comet-native/scripts/comet-native-next.mjs +43 -43
  23. package/assets/skills/comet-native/scripts/comet-native-root.mjs +3 -3
  24. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +71 -71
  25. package/assets/skills/comet-native/scripts/comet-native-select.mjs +36 -36
  26. package/assets/skills/comet-native/scripts/comet-native-show.mjs +27 -27
  27. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +23 -23
  28. package/assets/skills/comet-native/scripts/comet-native-status.mjs +39 -39
  29. package/assets/skills-zh/comet-classic/reference/scripts.md +1 -1
  30. package/assets/skills-zh/comet-native/SKILL.md +3 -3
  31. package/bin/fast-runtime-router.js +1 -1
  32. package/dist/app/cli/index.js +7 -1
  33. package/dist/app/cli/index.js.map +1 -1
  34. package/dist/app/commands/classic.js +4 -0
  35. package/dist/app/commands/classic.js.map +1 -1
  36. package/dist/app/commands/doctor.d.ts +1 -1
  37. package/dist/app/commands/doctor.d.ts.map +1 -1
  38. package/dist/app/commands/doctor.js +2 -1
  39. package/dist/app/commands/doctor.js.map +1 -1
  40. package/dist/app/commands/eval.js +2 -2
  41. package/dist/app/commands/eval.js.map +1 -1
  42. package/dist/app/commands/init.d.ts.map +1 -1
  43. package/dist/app/commands/init.js +16 -5
  44. package/dist/app/commands/init.js.map +1 -1
  45. package/dist/app/commands/personal-memory.d.ts.map +1 -1
  46. package/dist/app/commands/personal-memory.js +5 -0
  47. package/dist/app/commands/personal-memory.js.map +1 -1
  48. package/dist/app/commands/project-knowledge.d.ts.map +1 -1
  49. package/dist/app/commands/project-knowledge.js +26 -2
  50. package/dist/app/commands/project-knowledge.js.map +1 -1
  51. package/dist/app/commands/status.d.ts.map +1 -1
  52. package/dist/app/commands/status.js +17 -10
  53. package/dist/app/commands/status.js.map +1 -1
  54. package/dist/app/commands/uninstall.d.ts.map +1 -1
  55. package/dist/app/commands/uninstall.js +5 -1
  56. package/dist/app/commands/uninstall.js.map +1 -1
  57. package/dist/app/commands/update.d.ts.map +1 -1
  58. package/dist/app/commands/update.js +10 -4
  59. package/dist/app/commands/update.js.map +1 -1
  60. package/dist/domains/agent-learning/context-director.d.ts.map +1 -1
  61. package/dist/domains/agent-learning/context-director.js +14 -10
  62. package/dist/domains/agent-learning/context-director.js.map +1 -1
  63. package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -1
  64. package/dist/domains/comet-classic/classic-archive.js +3 -0
  65. package/dist/domains/comet-classic/classic-archive.js.map +1 -1
  66. package/dist/domains/comet-classic/classic-cli-help.d.ts +3 -0
  67. package/dist/domains/comet-classic/classic-cli-help.d.ts.map +1 -0
  68. package/dist/domains/comet-classic/classic-cli-help.js +40 -0
  69. package/dist/domains/comet-classic/classic-cli-help.js.map +1 -0
  70. package/dist/domains/comet-classic/classic-cli.d.ts +1 -0
  71. package/dist/domains/comet-classic/classic-cli.d.ts.map +1 -1
  72. package/dist/domains/comet-classic/classic-cli.js +5 -0
  73. package/dist/domains/comet-classic/classic-cli.js.map +1 -1
  74. package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
  75. package/dist/domains/comet-classic/classic-guard.js +12 -2
  76. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  77. package/dist/domains/comet-classic/classic-handoff.d.ts.map +1 -1
  78. package/dist/domains/comet-classic/classic-handoff.js +11 -10
  79. package/dist/domains/comet-classic/classic-handoff.js.map +1 -1
  80. package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -1
  81. package/dist/domains/comet-classic/classic-script-entry.js +4 -1
  82. package/dist/domains/comet-classic/classic-script-entry.js.map +1 -1
  83. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  84. package/dist/domains/comet-classic/classic-state-command.js +37 -18
  85. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  86. package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
  87. package/dist/domains/comet-classic/classic-validate-command.js +2 -0
  88. package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
  89. package/dist/domains/comet-classic/classic-workspace.d.ts +1 -0
  90. package/dist/domains/comet-classic/classic-workspace.d.ts.map +1 -1
  91. package/dist/domains/comet-classic/classic-workspace.js +2 -1
  92. package/dist/domains/comet-classic/classic-workspace.js.map +1 -1
  93. package/dist/domains/comet-entry/entry-runtime.d.ts.map +1 -1
  94. package/dist/domains/comet-entry/entry-runtime.js +13 -3
  95. package/dist/domains/comet-entry/entry-runtime.js.map +1 -1
  96. package/dist/domains/comet-memory/plugin.js +4 -9
  97. package/dist/domains/comet-memory/plugin.js.map +1 -1
  98. package/dist/domains/comet-memory/repository.d.ts +3 -0
  99. package/dist/domains/comet-memory/repository.d.ts.map +1 -1
  100. package/dist/domains/comet-memory/repository.js +117 -25
  101. package/dist/domains/comet-memory/repository.js.map +1 -1
  102. package/dist/domains/comet-memory/review-contract.d.ts.map +1 -1
  103. package/dist/domains/comet-memory/review-contract.js +4 -2
  104. package/dist/domains/comet-memory/review-contract.js.map +1 -1
  105. package/dist/domains/comet-native/native-check-command.d.ts.map +1 -1
  106. package/dist/domains/comet-native/native-check-command.js +5 -1
  107. package/dist/domains/comet-native/native-check-command.js.map +1 -1
  108. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -1
  109. package/dist/domains/comet-native/native-cli-help.js +7 -2
  110. package/dist/domains/comet-native/native-cli-help.js.map +1 -1
  111. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  112. package/dist/domains/comet-native/native-next-command.js +22 -1
  113. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  114. package/dist/domains/comet-native/native-output-language.d.ts.map +1 -1
  115. package/dist/domains/comet-native/native-output-language.js +3 -1
  116. package/dist/domains/comet-native/native-output-language.js.map +1 -1
  117. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
  118. package/dist/domains/comet-native/native-portable-continuation.js +11 -0
  119. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
  120. package/dist/domains/comet-plugin/integration.d.ts.map +1 -1
  121. package/dist/domains/comet-plugin/integration.js +14 -8
  122. package/dist/domains/comet-plugin/integration.js.map +1 -1
  123. package/dist/domains/comet-plugin/plugin-runtime.d.ts +2 -2
  124. package/dist/domains/comet-plugin/plugin-runtime.d.ts.map +1 -1
  125. package/dist/domains/comet-plugin/plugin-runtime.js +89 -77
  126. package/dist/domains/comet-plugin/plugin-runtime.js.map +1 -1
  127. package/dist/domains/comet-plugin/types.d.ts +2 -0
  128. package/dist/domains/comet-plugin/types.d.ts.map +1 -1
  129. package/dist/domains/dashboard/server.d.ts.map +1 -1
  130. package/dist/domains/dashboard/server.js +20 -0
  131. package/dist/domains/dashboard/server.js.map +1 -1
  132. package/dist/domains/dashboard/web/index.html +14 -14
  133. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  134. package/dist/domains/integrations/openspec.js +4 -3
  135. package/dist/domains/integrations/openspec.js.map +1 -1
  136. package/dist/domains/integrations/superpowers.js +2 -2
  137. package/dist/domains/integrations/superpowers.js.map +1 -1
  138. package/dist/domains/project-knowledge/corpus.d.ts.map +1 -1
  139. package/dist/domains/project-knowledge/corpus.js +5 -2
  140. package/dist/domains/project-knowledge/corpus.js.map +1 -1
  141. package/dist/domains/skill/languages.d.ts +3 -1
  142. package/dist/domains/skill/languages.d.ts.map +1 -1
  143. package/dist/domains/skill/languages.js +26 -1
  144. package/dist/domains/skill/languages.js.map +1 -1
  145. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  146. package/dist/domains/skill/uninstall.js +16 -0
  147. package/dist/domains/skill/uninstall.js.map +1 -1
  148. package/dist/platform/process/git-environment.d.ts +3 -0
  149. package/dist/platform/process/git-environment.d.ts.map +1 -0
  150. package/dist/platform/process/git-environment.js +26 -0
  151. package/dist/platform/process/git-environment.js.map +1 -0
  152. package/eval/langsmith/tests/tasks/test_tasks.py +6 -0
  153. package/eval/local/tests/scaffold/test_langsmith_conftest.py +10 -0
  154. package/package.json +2 -2
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var Dl=Object.create;var gn=Object.defineProperty;var Ml=Object.getOwnPropertyDescriptor;var Fl=Object.getOwnPropertyNames;var Bl=Object.getPrototypeOf,Kl=Object.prototype.hasOwnProperty;var Ht=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var T=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ul=(t,e)=>{for(var r in e)gn(t,r,{get:e[r],enumerable:!0})},Gl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fl(e))!Kl.call(t,i)&&i!==r&&gn(t,i,{get:()=>e[i],enumerable:!(n=Ml(e,i))||n.enumerable});return t};var it=(t,e,r)=>(r=t!=null?Dl(Bl(t)):{},Gl(e||!t||!t.__esModule?gn(r,"default",{value:t,enumerable:!0}):r,t));function jo(t,e){let r=t;for(let n of e)r+="\0"+(typeof n=="string"?n:JSON.stringify(n));return r}function _e(t,e){return(...r)=>{let n=Io;if(n===null)return e(...r);let i=jo(`async:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r).catch(a=>{throw n.entries.delete(i),a});return n.entries.set(i,{value:s}),s}}function wn(t,e){return(...r)=>{let n=Io;if(n===null)return e(...r);let i=jo(`sync:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r);return n.entries.set(i,{value:s}),s}}var Io,ot=T(()=>{"use strict";Io=null});var _=g(j=>{"use strict";var bn=Symbol.for("yaml.alias"),Lo=Symbol.for("yaml.document"),Yt=Symbol.for("yaml.map"),$o=Symbol.for("yaml.pair"),vn=Symbol.for("yaml.scalar"),Jt=Symbol.for("yaml.seq"),te=Symbol.for("yaml.node.type"),Jl=t=>!!t&&typeof t=="object"&&t[te]===bn,Vl=t=>!!t&&typeof t=="object"&&t[te]===Lo,zl=t=>!!t&&typeof t=="object"&&t[te]===Yt,Xl=t=>!!t&&typeof t=="object"&&t[te]===$o,Wo=t=>!!t&&typeof t=="object"&&t[te]===vn,Ql=t=>!!t&&typeof t=="object"&&t[te]===Jt;function qo(t){if(t&&typeof t=="object")switch(t[te]){case Yt:case Jt:return!0}return!1}function Zl(t){if(t&&typeof t=="object")switch(t[te]){case bn:case Yt:case vn:case Jt:return!0}return!1}var eu=t=>(Wo(t)||qo(t))&&!!t.anchor;j.ALIAS=bn;j.DOC=Lo;j.MAP=Yt;j.NODE_TYPE=te;j.PAIR=$o;j.SCALAR=vn;j.SEQ=Jt;j.hasAnchor=eu;j.isAlias=Jl;j.isCollection=qo;j.isDocument=Vl;j.isMap=zl;j.isNode=Zl;j.isPair=Xl;j.isScalar=Wo;j.isSeq=Ql});var st=g(kn=>{"use strict";var I=_(),M=Symbol("break visit"),Do=Symbol("skip children"),Q=Symbol("remove node");function Vt(t,e){let r=Mo(e);I.isDocument(t)?De(null,t.contents,r,Object.freeze([t]))===Q&&(t.contents=null):De(null,t,r,Object.freeze([]))}Vt.BREAK=M;Vt.SKIP=Do;Vt.REMOVE=Q;function De(t,e,r,n){let i=Fo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Bo(t,n,i),De(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=De(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===M)return M;s===Q&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=De("key",e.key,r,n);if(o===M)return M;o===Q&&(e.key=null);let s=De("value",e.value,r,n);if(s===M)return M;s===Q&&(e.value=null)}}return i}async function zt(t,e){let r=Mo(e);I.isDocument(t)?await Me(null,t.contents,r,Object.freeze([t]))===Q&&(t.contents=null):await Me(null,t,r,Object.freeze([]))}zt.BREAK=M;zt.SKIP=Do;zt.REMOVE=Q;async function Me(t,e,r,n){let i=await Fo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Bo(t,n,i),Me(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=await Me(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===M)return M;s===Q&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=await Me("key",e.key,r,n);if(o===M)return M;o===Q&&(e.key=null);let s=await Me("value",e.value,r,n);if(s===M)return M;s===Q&&(e.value=null)}}return i}function Mo(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Fo(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(I.isMap(e))return r.Map?.(t,e,n);if(I.isSeq(e))return r.Seq?.(t,e,n);if(I.isPair(e))return r.Pair?.(t,e,n);if(I.isScalar(e))return r.Scalar?.(t,e,n);if(I.isAlias(e))return r.Alias?.(t,e,n)}function Bo(t,e,r){let n=e[e.length-1];if(I.isCollection(n))n.items[t]=r;else if(I.isPair(n))t==="key"?n.key=r:n.value=r;else if(I.isDocument(n))n.contents=r;else{let i=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}kn.visit=Vt;kn.visitAsync=zt});var Cn=g(Uo=>{"use strict";var Ko=_(),tu=st(),ru={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},nu=t=>t.replace(/[!,[\]{}]/g,e=>ru[e]),at=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+nu(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Ko.isNode(e.contents)){let o={};tu.visit(e.contents,(s,a)=>{Ko.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(`
5
- `)}};at.defaultYaml={explicit:!1,version:"1.2"};at.defaultTags={"!!":"tag:yaml.org,2002:"};Uo.Directives=at});var Xt=g(ct=>{"use strict";var Go=_(),iu=st();function ou(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Ho(t){let e=new Set;return iu.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function Yo(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function su(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=Ho(t));let s=Yo(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(Go.isScalar(s.node)||Go.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:n}}ct.anchorIsValid=ou;ct.anchorNames=Ho;ct.createNodeAnchors=su;ct.findNewAnchor=Yo});var Sn=g(Jo=>{"use strict";function lt(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=lt(t,n,String(i),s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=lt(t,n,i,o);s===void 0?n.delete(i):s!==o&&n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=lt(t,n,i,i);o===void 0?n.delete(i):o!==i&&(n.delete(i),n.add(o))}else for(let[i,o]of Object.entries(n)){let s=lt(t,n,i,o);s===void 0?delete n[i]:s!==o&&(n[i]=s)}return t.call(e,r,n)}Jo.applyReviver=lt});var ue=g(zo=>{"use strict";var au=_();function Vo(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Vo(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!au.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}zo.toJS=Vo});var Qt=g(Qo=>{"use strict";var cu=Sn(),Xo=_(),lu=ue(),En=class{constructor(e){Object.defineProperty(this,Xo.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:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!Xo.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=lu.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?cu.applyReviver(o,{"":a},"",a):a}};Qo.NodeBase=En});var ut=g(Zo=>{"use strict";var uu=Xt(),fu=st(),Fe=_(),du=Qt(),pu=ue(),_n=class extends du.NodeBase{constructor(e){super(Fe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],fu.visit(e,{Node:(o,s)=>{(Fe.isAlias(s)||Fe.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(pu.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Zt(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(uu.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 Zt(t,e,r){if(Fe.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Fe.isCollection(e)){let n=0;for(let i of e.items){let o=Zt(t,i,r);o>n&&(n=o)}return n}else if(Fe.isPair(e)){let n=Zt(t,e.key,r),i=Zt(t,e.value,r);return Math.max(n,i)}return 1}Zo.Alias=_n});var A=g(Pn=>{"use strict";var mu=_(),hu=Qt(),gu=ue(),wu=t=>!t||typeof t!="function"&&typeof t!="object",fe=class extends hu.NodeBase{constructor(e){super(mu.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:gu.toJS(this.value,e,r)}toString(){return String(this.value)}};fe.BLOCK_FOLDED="BLOCK_FOLDED";fe.BLOCK_LITERAL="BLOCK_LITERAL";fe.PLAIN="PLAIN";fe.QUOTE_DOUBLE="QUOTE_DOUBLE";fe.QUOTE_SINGLE="QUOTE_SINGLE";Pn.Scalar=fe;Pn.isScalarValue=wu});var ft=g(ts=>{"use strict";var yu=ut(),Pe=_(),es=A(),bu="tag:yaml.org,2002:";function vu(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function ku(t,e,r){if(Pe.isDocument(t)&&(t=t.contents),Pe.isNode(t))return t;if(Pe.isPair(t)){let f=r.schema[Pe.MAP].createNode?.(r.schema,null,r);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new yu.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=bu+e.slice(2));let l=vu(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new es.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[Pe.MAP]:Symbol.iterator in Object(t)?s[Pe.SEQ]:s[Pe.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new es.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}ts.createNode=ku});var tr=g(er=>{"use strict";var Cu=ft(),Z=_(),Su=Qt();function xn(t,e,r){let n=r;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]=n,n=s}else n=new Map([[o,n]])}return Cu.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var rs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,On=class extends Su.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Z.isNode(n)||Z.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(rs(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Z.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,xn(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Z.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Z.isScalar(o)?o.value:o:Z.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Z.isPair(r))return!1;let n=r.value;return n==null||e&&Z.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Z.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Z.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,xn(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};er.Collection=On;er.collectionFromPath=xn;er.isEmptyPath=rs});var dt=g(rr=>{"use strict";var Eu=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function An(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var _u=(t,e,r)=>t.endsWith(`
4
+ var Ml=Object.create;var gn=Object.defineProperty;var Fl=Object.getOwnPropertyDescriptor;var Bl=Object.getOwnPropertyNames;var Kl=Object.getPrototypeOf,Ul=Object.prototype.hasOwnProperty;var Gt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var T=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Hl=(t,e)=>{for(var r in e)gn(t,r,{get:e[r],enumerable:!0})},Gl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Bl(e))!Ul.call(t,i)&&i!==r&&gn(t,i,{get:()=>e[i],enumerable:!(n=Fl(e,i))||n.enumerable});return t};var it=(t,e,r)=>(r=t!=null?Ml(Kl(t)):{},Gl(e||!t||!t.__esModule?gn(r,"default",{value:t,enumerable:!0}):r,t));function jo(t,e){let r=t;for(let n of e)r+="\0"+(typeof n=="string"?n:JSON.stringify(n));return r}function _e(t,e){return(...r)=>{let n=Io;if(n===null)return e(...r);let i=jo(`async:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r).catch(a=>{throw n.entries.delete(i),a});return n.entries.set(i,{value:s}),s}}function wn(t,e){return(...r)=>{let n=Io;if(n===null)return e(...r);let i=jo(`sync:${t}`,r),o=n.entries.get(i);if(o)return o.value;let s=e(...r);return n.entries.set(i,{value:s}),s}}var Io,ot=T(()=>{"use strict";Io=null});var _=g(j=>{"use strict";var bn=Symbol.for("yaml.alias"),Lo=Symbol.for("yaml.document"),Yt=Symbol.for("yaml.map"),$o=Symbol.for("yaml.pair"),vn=Symbol.for("yaml.scalar"),Jt=Symbol.for("yaml.seq"),te=Symbol.for("yaml.node.type"),Vl=t=>!!t&&typeof t=="object"&&t[te]===bn,zl=t=>!!t&&typeof t=="object"&&t[te]===Lo,Xl=t=>!!t&&typeof t=="object"&&t[te]===Yt,Ql=t=>!!t&&typeof t=="object"&&t[te]===$o,Wo=t=>!!t&&typeof t=="object"&&t[te]===vn,Zl=t=>!!t&&typeof t=="object"&&t[te]===Jt;function qo(t){if(t&&typeof t=="object")switch(t[te]){case Yt:case Jt:return!0}return!1}function eu(t){if(t&&typeof t=="object")switch(t[te]){case bn:case Yt:case vn:case Jt:return!0}return!1}var tu=t=>(Wo(t)||qo(t))&&!!t.anchor;j.ALIAS=bn;j.DOC=Lo;j.MAP=Yt;j.NODE_TYPE=te;j.PAIR=$o;j.SCALAR=vn;j.SEQ=Jt;j.hasAnchor=tu;j.isAlias=Vl;j.isCollection=qo;j.isDocument=zl;j.isMap=Xl;j.isNode=eu;j.isPair=Ql;j.isScalar=Wo;j.isSeq=Zl});var st=g(kn=>{"use strict";var I=_(),M=Symbol("break visit"),Do=Symbol("skip children"),Q=Symbol("remove node");function Vt(t,e){let r=Mo(e);I.isDocument(t)?De(null,t.contents,r,Object.freeze([t]))===Q&&(t.contents=null):De(null,t,r,Object.freeze([]))}Vt.BREAK=M;Vt.SKIP=Do;Vt.REMOVE=Q;function De(t,e,r,n){let i=Fo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Bo(t,n,i),De(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=De(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===M)return M;s===Q&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=De("key",e.key,r,n);if(o===M)return M;o===Q&&(e.key=null);let s=De("value",e.value,r,n);if(s===M)return M;s===Q&&(e.value=null)}}return i}async function zt(t,e){let r=Mo(e);I.isDocument(t)?await Me(null,t.contents,r,Object.freeze([t]))===Q&&(t.contents=null):await Me(null,t,r,Object.freeze([]))}zt.BREAK=M;zt.SKIP=Do;zt.REMOVE=Q;async function Me(t,e,r,n){let i=await Fo(t,e,r,n);if(I.isNode(i)||I.isPair(i))return Bo(t,n,i),Me(t,i,r,n);if(typeof i!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o<e.items.length;++o){let s=await Me(o,e.items[o],r,n);if(typeof s=="number")o=s-1;else{if(s===M)return M;s===Q&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let o=await Me("key",e.key,r,n);if(o===M)return M;o===Q&&(e.key=null);let s=await Me("value",e.value,r,n);if(s===M)return M;s===Q&&(e.value=null)}}return i}function Mo(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Fo(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(I.isMap(e))return r.Map?.(t,e,n);if(I.isSeq(e))return r.Seq?.(t,e,n);if(I.isPair(e))return r.Pair?.(t,e,n);if(I.isScalar(e))return r.Scalar?.(t,e,n);if(I.isAlias(e))return r.Alias?.(t,e,n)}function Bo(t,e,r){let n=e[e.length-1];if(I.isCollection(n))n.items[t]=r;else if(I.isPair(n))t==="key"?n.key=r:n.value=r;else if(I.isDocument(n))n.contents=r;else{let i=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}kn.visit=Vt;kn.visitAsync=zt});var Cn=g(Uo=>{"use strict";var Ko=_(),ru=st(),nu={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},iu=t=>t.replace(/[!,[\]{}]/g,e=>nu[e]),at=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+iu(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Ko.isNode(e.contents)){let o={};ru.visit(e.contents,(s,a)=>{Ko.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(`
5
+ `)}};at.defaultYaml={explicit:!1,version:"1.2"};at.defaultTags={"!!":"tag:yaml.org,2002:"};Uo.Directives=at});var Xt=g(ct=>{"use strict";var Ho=_(),ou=st();function su(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Go(t){let e=new Set;return ou.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function Yo(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function au(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=Go(t));let s=Yo(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(Ho.isScalar(s.node)||Ho.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:n}}ct.anchorIsValid=su;ct.anchorNames=Go;ct.createNodeAnchors=au;ct.findNewAnchor=Yo});var Sn=g(Jo=>{"use strict";function lt(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i<o;++i){let s=n[i],a=lt(t,n,String(i),s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let o=n.get(i),s=lt(t,n,i,o);s===void 0?n.delete(i):s!==o&&n.set(i,s)}else if(n instanceof Set)for(let i of Array.from(n)){let o=lt(t,n,i,i);o===void 0?n.delete(i):o!==i&&(n.delete(i),n.add(o))}else for(let[i,o]of Object.entries(n)){let s=lt(t,n,i,o);s===void 0?delete n[i]:s!==o&&(n[i]=s)}return t.call(e,r,n)}Jo.applyReviver=lt});var ue=g(zo=>{"use strict";var cu=_();function Vo(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Vo(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!cu.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}zo.toJS=Vo});var Qt=g(Qo=>{"use strict";var lu=Sn(),Xo=_(),uu=ue(),En=class{constructor(e){Object.defineProperty(this,Xo.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:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!Xo.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=uu.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?lu.applyReviver(o,{"":a},"",a):a}};Qo.NodeBase=En});var ut=g(Zo=>{"use strict";var fu=Xt(),du=st(),Fe=_(),pu=Qt(),mu=ue(),_n=class extends pu.NodeBase{constructor(e){super(Fe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],du.visit(e,{Node:(o,s)=>{(Fe.isAlias(s)||Fe.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(mu.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Zt(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(fu.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 Zt(t,e,r){if(Fe.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Fe.isCollection(e)){let n=0;for(let i of e.items){let o=Zt(t,i,r);o>n&&(n=o)}return n}else if(Fe.isPair(e)){let n=Zt(t,e.key,r),i=Zt(t,e.value,r);return Math.max(n,i)}return 1}Zo.Alias=_n});var A=g(Pn=>{"use strict";var hu=_(),gu=Qt(),wu=ue(),yu=t=>!t||typeof t!="function"&&typeof t!="object",fe=class extends gu.NodeBase{constructor(e){super(hu.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:wu.toJS(this.value,e,r)}toString(){return String(this.value)}};fe.BLOCK_FOLDED="BLOCK_FOLDED";fe.BLOCK_LITERAL="BLOCK_LITERAL";fe.PLAIN="PLAIN";fe.QUOTE_DOUBLE="QUOTE_DOUBLE";fe.QUOTE_SINGLE="QUOTE_SINGLE";Pn.Scalar=fe;Pn.isScalarValue=yu});var ft=g(ts=>{"use strict";var bu=ut(),Pe=_(),es=A(),vu="tag:yaml.org,2002:";function ku(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function Cu(t,e,r){if(Pe.isDocument(t)&&(t=t.contents),Pe.isNode(t))return t;if(Pe.isPair(t)){let f=r.schema[Pe.MAP].createNode?.(r.schema,null,r);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new bu.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=vu+e.slice(2));let l=ku(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new es.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[Pe.MAP]:Symbol.iterator in Object(t)?s[Pe.SEQ]:s[Pe.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new es.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}ts.createNode=Cu});var tr=g(er=>{"use strict";var Su=ft(),Z=_(),Eu=Qt();function xn(t,e,r){let n=r;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]=n,n=s}else n=new Map([[o,n]])}return Su.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var rs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,On=class extends Eu.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Z.isNode(n)||Z.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(rs(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Z.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,xn(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Z.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Z.isScalar(o)?o.value:o:Z.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Z.isPair(r))return!1;let n=r.value;return n==null||e&&Z.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Z.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Z.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,xn(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};er.Collection=On;er.collectionFromPath=xn;er.isEmptyPath=rs});var dt=g(rr=>{"use strict";var _u=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function An(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Pu=(t,e,r)=>t.endsWith(`
6
6
  `)?An(r,e):r.includes(`
7
7
  `)?`
8
- `+An(r,e):(t.endsWith(" ")?"":" ")+r;rr.indentComment=An;rr.lineComment=_u;rr.stringifyComment=Eu});var is=g(pt=>{"use strict";var Pu="flow",Nn="block",nr="quoted";function xu(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;let l=[],u={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,o)?l.push(0):f=i-n);let d,h,w=!1,p=-1,m=-1,y=-1;r===Nn&&(p=ns(t,p,e.length),p!==-1&&(f=p+c));for(let k;k=t[p+=1];){if(r===nr&&k==="\\"){switch(m=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(k===`
8
+ `+An(r,e):(t.endsWith(" ")?"":" ")+r;rr.indentComment=An;rr.lineComment=Pu;rr.stringifyComment=_u});var is=g(pt=>{"use strict";var xu="flow",Nn="block",nr="quoted";function Ou(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;let l=[],u={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,o)?l.push(0):f=i-n);let d,h,w=!1,p=-1,m=-1,y=-1;r===Nn&&(p=ns(t,p,e.length),p!==-1&&(f=p+c));for(let k;k=t[p+=1];){if(r===nr&&k==="\\"){switch(m=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(k===`
9
9
  `)r===Nn&&(p=ns(t,p,e.length)),f=p+e.length+c,d=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
10
10
  `&&h!==" "){let C=t[p+1];C&&C!==" "&&C!==`
11
11
  `&&C!==" "&&(d=p)}if(p>=f)if(d)l.push(d),f=d+c,d=void 0;else if(r===nr){for(;h===" "||h===" ";)h=k,k=t[p+=1],w=!0;let C=p>y+1?p-2:m-1;if(u[C])return t;l.push(C),u[C]=!0,f=C+c,d=void 0}else w=!0}h=k}if(w&&a&&a(),l.length===0)return t;s&&s();let v=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let C=l[k],S=l[k+1]||t.length;C===0?v=`
12
12
  ${e}${t.slice(0,S)}`:(r===nr&&u[C]&&(v+=`${t[C]}\\`),v+=`
13
13
  ${e}${t.slice(C+1,S)}`)}return v}function ns(t,e,r){let n=e,i=e+1,o=t[i];for(;o===" "||o===" ";)if(e<i+r)o=t[++e];else{do o=t[++e];while(o&&o!==`
14
- `);n=e,i=e+1,o=t[i]}return n}pt.FOLD_BLOCK=Nn;pt.FOLD_FLOW=Pu;pt.FOLD_QUOTED=nr;pt.foldFlowLines=xu});var ht=g(os=>{"use strict";var Y=A(),de=is(),or=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),sr=t=>/^(%|---|\.\.\.)/m.test(t);function Ou(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
14
+ `);n=e,i=e+1,o=t[i]}return n}pt.FOLD_BLOCK=Nn;pt.FOLD_FLOW=xu;pt.FOLD_QUOTED=nr;pt.foldFlowLines=Ou});var ht=g(os=>{"use strict";var Y=A(),de=is(),or=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),sr=t=>/^(%|---|\.\.\.)/m.test(t);function Au(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
15
15
  `){if(o-s>n)return!0;if(s=o+1,i-s<=n)return!1}return!0}function mt(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(sr(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){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:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{for(s+=r.slice(a,c)+`
16
16
 
17
17
  `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)s+=`
@@ -20,7 +20,7 @@ ${e}${t.slice(C+1,S)}`)}return v}function ns(t,e,r){let n=e,i=e+1,o=t[i];for(;o=
20
20
  ${r}`)+"'";return e.implicitKey?n:de.foldFlowLines(n,r,de.FOLD_FLOW,or(e,!1))}function Be(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=mt;else{let i=t.includes('"'),o=t.includes("'");i&&!o?n=Rn:o&&!i?n=mt:n=r?Rn:mt}return n(t,e)}var Tn;try{Tn=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{Tn=/\n+(?!\n|$)/g}function ir({comment:t,type:e,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return Be(r,n);let l=n.indent||(n.forceBlockIndent||sr(r)?" ":""),u=s==="literal"?!0:s==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!Ou(r,c,l.length);if(!r)return u?`|
23
+ |$)`,"g")}catch{Tn=/\n+(?!\n|$)/g}function ir({comment:t,type:e,value:r},n,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=n.options;if(!s||/\n[\t ]+$/.test(r))return Be(r,n);let l=n.indent||(n.forceBlockIndent||sr(r)?" ":""),u=s==="literal"?!0:s==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!Au(r,c,l.length);if(!r)return u?`|
24
24
  `:`>
25
25
  `;let f,d;for(d=r.length;d>0;--d){let S=r[d-1];if(S!==`
26
26
  `&&S!==" "&&S!==" ")break}let h=r.substring(d),w=h.indexOf(`
@@ -29,12 +29,12 @@ ${r}`)+"'";return e.implicitKey?n:de.foldFlowLines(n,r,de.FOLD_FLOW,or(e,!1))}fu
29
29
  `)y=m;else break}let v=r.substring(0,y<m?y+1:m);v&&(r=r.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let C=(p?l?"2":"1":"")+f;if(t&&(C+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let S=r.replace(/\n+/g,`
30
30
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,x=or(n,!0);s!=="folded"&&e!==Y.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let b=de.foldFlowLines(`${v}${S}${h}`,l,de.FOLD_BLOCK,x);if(!E)return`>${C}
31
31
  ${l}${b}`}return r=r.replace(/\n+/g,`$&${l}`),`|${C}
32
- ${l}${v}${r}${h}`}function Au(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
32
+ ${l}${v}${r}${h}`}function Nu(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
33
33
  `)||u&&/[[\]{},]/.test(o))return Be(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
34
34
  `)?Be(o,e):ir(t,e,r,n);if(!a&&!u&&i!==Y.Scalar.PLAIN&&o.includes(`
35
35
  `))return ir(t,e,r,n);if(sr(o)){if(c==="")return e.forceBlockIndent=!0,ir(t,e,r,n);if(a&&c===l)return Be(o,e)}let f=o.replace(/\n+/g,`$&
36
- ${c}`);if(s){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:h,tags:w}=e.doc.schema;if(w.some(d)||h?.some(d))return Be(o,e)}return a?f:de.foldFlowLines(f,c,de.FOLD_FLOW,or(e,!1))}function Nu(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Y.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return i||o?Be(s.value,e):ir(s,e,r,n);case Y.Scalar.QUOTE_DOUBLE:return mt(s.value,e);case Y.Scalar.QUOTE_SINGLE:return Rn(s.value,e);case Y.Scalar.PLAIN:return Au(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}os.stringifyString=Nu});var gt=g(In=>{"use strict";var Ru=Xt(),pe=_(),Tu=dt(),Iu=ht();function ju(t,e){let r=Object.assign({blockQuote:!0,commentString:Tu.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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Lu(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(pe.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function $u(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(pe.isScalar(t)||pe.isCollection(t))&&t.anchor;o&&Ru.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Wu(t,e,r,n){if(pe.isPair(t))return t.toString(e,r,n);if(pe.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=pe.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Lu(e.doc.schema.tags,o));let s=$u(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):pe.isScalar(o)?Iu.stringifyString(o,e,r,n):o.toString(e,r,n);return s?pe.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
- ${e.indent}${a}`:a}In.createStringifyContext=ju;In.stringify=Wu});var ls=g(cs=>{"use strict";var re=_(),ss=A(),as=gt(),wt=dt();function qu({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=r,d=re.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(re.isCollection(t)||!re.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!f&&(!t||d&&e==null&&!r.inFlow||re.isCollection(t)||(re.isScalar(t)?t.type===ss.Scalar.BLOCK_FOLDED||t.type===ss.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!h&&(f||!o),indent:a+c});let w=!1,p=!1,m=as.stringify(t,r,()=>w=!0,()=>p=!0);if(!h&&!r.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(r.inFlow){if(o||e==null)return w&&n&&n(),m===""?"?":h?`? ${m}`:m}else if(o&&!f||e==null&&h)return m=`? ${m}`,d&&!w?m+=wt.lineComment(m,r.indent,l(d)):p&&i&&i(),m;w&&(d=null),h?(d&&(m+=wt.lineComment(m,r.indent,l(d))),m=`? ${m}
36
+ ${c}`);if(s){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:h,tags:w}=e.doc.schema;if(w.some(d)||h?.some(d))return Be(o,e)}return a?f:de.foldFlowLines(f,c,de.FOLD_FLOW,or(e,!1))}function Ru(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Y.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return i||o?Be(s.value,e):ir(s,e,r,n);case Y.Scalar.QUOTE_DOUBLE:return mt(s.value,e);case Y.Scalar.QUOTE_SINGLE:return Rn(s.value,e);case Y.Scalar.PLAIN:return Nu(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}os.stringifyString=Ru});var gt=g(In=>{"use strict";var Tu=Xt(),pe=_(),Iu=dt(),ju=ht();function Lu(t,e){let r=Object.assign({blockQuote:!0,commentString:Iu.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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function $u(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(pe.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Wu(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(pe.isScalar(t)||pe.isCollection(t))&&t.anchor;o&&Tu.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function qu(t,e,r,n){if(pe.isPair(t))return t.toString(e,r,n);if(pe.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=pe.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=$u(e.doc.schema.tags,o));let s=Wu(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):pe.isScalar(o)?ju.stringifyString(o,e,r,n):o.toString(e,r,n);return s?pe.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
+ ${e.indent}${a}`:a}In.createStringifyContext=Lu;In.stringify=qu});var ls=g(cs=>{"use strict";var re=_(),ss=A(),as=gt(),wt=dt();function Du({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=r,d=re.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(re.isCollection(t)||!re.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!f&&(!t||d&&e==null&&!r.inFlow||re.isCollection(t)||(re.isScalar(t)?t.type===ss.Scalar.BLOCK_FOLDED||t.type===ss.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!h&&(f||!o),indent:a+c});let w=!1,p=!1,m=as.stringify(t,r,()=>w=!0,()=>p=!0);if(!h&&!r.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(r.inFlow){if(o||e==null)return w&&n&&n(),m===""?"?":h?`? ${m}`:m}else if(o&&!f||e==null&&h)return m=`? ${m}`,d&&!w?m+=wt.lineComment(m,r.indent,l(d)):p&&i&&i(),m;w&&(d=null),h?(d&&(m+=wt.lineComment(m,r.indent,l(d))),m=`? ${m}
38
38
  ${a}:`):(m=`${m}:`,d&&(m+=wt.lineComment(m,r.indent,l(d))));let y,v,k;re.isNode(e)?(y=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(y=!1,v=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!h&&!d&&re.isScalar(e)&&(r.indentAtStart=m.length+1),p=!1,!u&&c.length>=2&&!r.inFlow&&!h&&re.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let C=!1,S=as.stringify(e,r,()=>C=!0,()=>p=!0),E=" ";if(d||y||v){if(E=y?`
39
39
  `:"",v){let x=l(v);E+=`
40
40
  ${wt.indentComment(x,r.indent)}`}S===""&&!r.inFlow?E===`
@@ -44,32 +44,32 @@ ${wt.indentComment(x,r.indent)}`}S===""&&!r.inFlow?E===`
44
44
  ${r.indent}`}else if(!h&&re.isCollection(e)){let x=S[0],b=S.indexOf(`
45
45
  `),N=b!==-1,le=r.inFlow??e.flow??e.items.length===0;if(N||!le){let qe=!1;if(N&&(x==="&"||x==="!")){let R=S.indexOf(" ");x==="&"&&R!==-1&&R<b&&S[R+1]==="!"&&(R=S.indexOf(" ",R+1)),(R===-1||b<R)&&(qe=!0)}qe||(E=`
46
46
  ${r.indent}`)}}else(S===""||S[0]===`
47
- `)&&(E="");return m+=E+S,r.inFlow?C&&n&&n():k&&!C?m+=wt.lineComment(m,r.indent,l(k)):p&&i&&i(),m}cs.stringifyPair=qu});var Ln=g(jn=>{"use strict";var us=Ht("process");function Du(t,...e){t==="debug"&&console.log(...e)}function Mu(t,e){(t==="debug"||t==="warn")&&(typeof us.emitWarning=="function"?us.emitWarning(e):console.warn(e))}jn.debug=Du;jn.warn=Mu});var fr=g(ur=>{"use strict";var lr=_(),fs=A(),ar="<<",cr={identify:t=>t===ar||typeof t=="symbol"&&t.description===ar,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new fs.Scalar(Symbol(ar)),{addToJSMap:ds}),stringify:()=>ar},Fu=(t,e)=>(cr.identify(e)||lr.isScalar(e)&&(!e.type||e.type===fs.Scalar.PLAIN)&&cr.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===cr.tag&&r.default);function ds(t,e,r){let n=ps(t,r);if(lr.isSeq(n))for(let i of n.items)$n(t,e,i);else if(Array.isArray(n))for(let i of n)$n(t,e,i);else $n(t,e,n)}function $n(t,e,r){let n=ps(t,r);if(!lr.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,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 ps(t,e){return t&&lr.isAlias(e)?e.resolve(t.doc,t):e}ur.addMergeToJSMap=ds;ur.isMergeKey=Fu;ur.merge=cr});var qn=g(gs=>{"use strict";var Bu=Ln(),ms=fr(),Ku=gt(),hs=_(),Wn=ue();function Uu(t,e,{key:r,value:n}){if(hs.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(ms.isMergeKey(t,r))ms.addMergeToJSMap(t,e,n);else{let i=Wn.toJS(r,"",t);if(e instanceof Map)e.set(i,Wn.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Gu(r,i,t),s=Wn.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Gu(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(hs.isNode(t)&&r?.doc){let n=Ku.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Bu.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}gs.addPairToJSMap=Uu});var me=g(Dn=>{"use strict";var ws=ft(),Hu=ls(),Yu=qn(),dr=_();function Ju(t,e,r){let n=ws.createNode(t,void 0,r),i=ws.createNode(e,void 0,r);return new pr(n,i)}var pr=class t{constructor(e,r=null){Object.defineProperty(this,dr.NODE_TYPE,{value:dr.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return dr.isNode(r)&&(r=r.clone(e)),dr.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Yu.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Hu.stringifyPair(this,e,r,n):JSON.stringify(this)}};Dn.Pair=pr;Dn.createPair=Ju});var Mn=g(bs=>{"use strict";var xe=_(),ys=gt(),mr=dt();function Vu(t,e,r){return(e.inFlow??t.flow?Xu:zu)(t,e,r)}function zu({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],m=null;if(xe.isNode(p))!f&&p.spaceBefore&&d.push(""),hr(r,d,p.commentBefore,f),p.comment&&(m=p.comment);else if(xe.isPair(p)){let v=xe.isNode(p.key)?p.key:null;v&&(!f&&v.spaceBefore&&d.push(""),hr(r,d,v.commentBefore,f))}f=!1;let y=ys.stringify(p,u,()=>m=null,()=>f=!0);m&&(y+=mr.lineComment(y,o,l(m))),f&&m&&(f=!1),d.push(n+y)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let w=1;w<d.length;++w){let p=d[w];h+=p?`
47
+ `)&&(E="");return m+=E+S,r.inFlow?C&&n&&n():k&&!C?m+=wt.lineComment(m,r.indent,l(k)):p&&i&&i(),m}cs.stringifyPair=Du});var Ln=g(jn=>{"use strict";var us=Gt("process");function Mu(t,...e){t==="debug"&&console.log(...e)}function Fu(t,e){(t==="debug"||t==="warn")&&(typeof us.emitWarning=="function"?us.emitWarning(e):console.warn(e))}jn.debug=Mu;jn.warn=Fu});var fr=g(ur=>{"use strict";var lr=_(),fs=A(),ar="<<",cr={identify:t=>t===ar||typeof t=="symbol"&&t.description===ar,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new fs.Scalar(Symbol(ar)),{addToJSMap:ds}),stringify:()=>ar},Bu=(t,e)=>(cr.identify(e)||lr.isScalar(e)&&(!e.type||e.type===fs.Scalar.PLAIN)&&cr.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===cr.tag&&r.default);function ds(t,e,r){let n=ps(t,r);if(lr.isSeq(n))for(let i of n.items)$n(t,e,i);else if(Array.isArray(n))for(let i of n)$n(t,e,i);else $n(t,e,n)}function $n(t,e,r){let n=ps(t,r);if(!lr.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,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 ps(t,e){return t&&lr.isAlias(e)?e.resolve(t.doc,t):e}ur.addMergeToJSMap=ds;ur.isMergeKey=Bu;ur.merge=cr});var qn=g(gs=>{"use strict";var Ku=Ln(),ms=fr(),Uu=gt(),hs=_(),Wn=ue();function Hu(t,e,{key:r,value:n}){if(hs.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(ms.isMergeKey(t,r))ms.addMergeToJSMap(t,e,n);else{let i=Wn.toJS(r,"",t);if(e instanceof Map)e.set(i,Wn.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Gu(r,i,t),s=Wn.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Gu(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(hs.isNode(t)&&r?.doc){let n=Uu.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Ku.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}gs.addPairToJSMap=Hu});var me=g(Dn=>{"use strict";var ws=ft(),Yu=ls(),Ju=qn(),dr=_();function Vu(t,e,r){let n=ws.createNode(t,void 0,r),i=ws.createNode(e,void 0,r);return new pr(n,i)}var pr=class t{constructor(e,r=null){Object.defineProperty(this,dr.NODE_TYPE,{value:dr.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return dr.isNode(r)&&(r=r.clone(e)),dr.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Ju.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Yu.stringifyPair(this,e,r,n):JSON.stringify(this)}};Dn.Pair=pr;Dn.createPair=Vu});var Mn=g(bs=>{"use strict";var xe=_(),ys=gt(),mr=dt();function zu(t,e,r){return(e.inFlow??t.flow?Qu:Xu)(t,e,r)}function Xu({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],m=null;if(xe.isNode(p))!f&&p.spaceBefore&&d.push(""),hr(r,d,p.commentBefore,f),p.comment&&(m=p.comment);else if(xe.isPair(p)){let v=xe.isNode(p.key)?p.key:null;v&&(!f&&v.spaceBefore&&d.push(""),hr(r,d,v.commentBefore,f))}f=!1;let y=ys.stringify(p,u,()=>m=null,()=>f=!0);m&&(y+=mr.lineComment(y,o,l(m))),f&&m&&(f=!1),d.push(n+y)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let w=1;w<d.length;++w){let p=d[w];h+=p?`
48
48
  ${c}${p}`:`
49
49
  `}}return t?(h+=`
50
- `+mr.indentComment(l(t),c),a&&a()):f&&s&&s(),h}function Xu({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],m=null;if(xe.isNode(p))p.spaceBefore&&f.push(""),hr(e,f,p.commentBefore,!1),p.comment&&(m=p.comment);else if(xe.isPair(p)){let v=xe.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&f.push(""),hr(e,f,v.commentBefore,!1),v.comment&&(l=!0));let k=xe.isNode(p.value)?p.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(m=v.comment)}m&&(l=!0);let y=ys.stringify(p,c,()=>m=null);l||(l=f.length>u||y.includes(`
50
+ `+mr.indentComment(l(t),c),a&&a()):f&&s&&s(),h}function Qu({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],m=null;if(xe.isNode(p))p.spaceBefore&&f.push(""),hr(e,f,p.commentBefore,!1),p.comment&&(m=p.comment);else if(xe.isPair(p)){let v=xe.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&f.push(""),hr(e,f,v.commentBefore,!1),v.comment&&(l=!0));let k=xe.isNode(p.value)?p.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(m=v.comment)}m&&(l=!0);let y=ys.stringify(p,c,()=>m=null);l||(l=f.length>u||y.includes(`
51
51
  `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((v,k)=>v+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),m&&(y+=mr.lineComment(y,n,a(m))),f.push(y),u=f.length}let{start:d,end:h}=r;if(f.length===0)return d+h;if(!l){let w=f.reduce((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=d;for(let p of f)w+=p?`
52
52
  ${o}${i}${p}`:`
53
53
  `;return`${w}
54
- ${i}${h}`}else return`${d}${s}${f.join(" ")}${s}${h}`}function hr({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=mr.indentComment(e(n),t);r.push(o.trimStart())}}bs.stringifyCollection=Vu});var ge=g(Bn=>{"use strict";var Qu=Mn(),Zu=qn(),ef=tr(),he=_(),gr=me(),tf=A();function yt(t,e){let r=he.isScalar(e)?e.value:e;for(let n of t)if(he.isPair(n)&&(n.key===e||n.key===r||he.isScalar(n.key)&&n.key.value===r))return n}var Fn=class extends ef.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(he.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(gr.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;he.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new gr.Pair(e,e?.value):n=new gr.Pair(e.key,e.value);let i=yt(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);he.isScalar(i.value)&&tf.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=yt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=yt(this.items,e)?.value;return(!r&&he.isScalar(i)?i.value:i)??void 0}has(e){return!!yt(this.items,e)}set(e,r){this.add(new gr.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)Zu.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!he.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})),Qu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Bn.YAMLMap=Fn;Bn.findPair=yt});var Ke=g(ks=>{"use strict";var rf=_(),vs=ge(),nf={collection:"map",default:!0,nodeClass:vs.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return rf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>vs.YAMLMap.from(t,e,r)};ks.map=nf});var we=g(Cs=>{"use strict";var of=ft(),sf=Mn(),af=tr(),yr=_(),cf=A(),lf=ue(),Kn=class extends af.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yr.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=wr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=wr(e);if(typeof n!="number")return;let i=this.items[n];return!r&&yr.isScalar(i)?i.value:i}has(e){let r=wr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=wr(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];yr.isScalar(i)&&cf.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let o of this.items)n.push(lf.toJS(o,String(i++),r));return n}toString(e,r,n){return e?sf.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r)){let s=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(s++);a=i.call(r,c,a)}o.items.push(of.createNode(a,void 0,n))}}return o}};function wr(t){let e=yr.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Cs.YAMLSeq=Kn});var Ue=g(Es=>{"use strict";var uf=_(),Ss=we(),ff={collection:"seq",default:!0,nodeClass:Ss.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return uf.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Ss.YAMLSeq.from(t,e,r)};Es.seq=ff});var bt=g(_s=>{"use strict";var df=ht(),pf={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),df.stringifyString(t,e,r,n)}};_s.string=pf});var br=g(Os=>{"use strict";var Ps=A(),xs={identify:t=>t==null,createNode:()=>new Ps.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ps.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&xs.test.test(t)?t:e.options.nullStr};Os.nullTag=xs});var Un=g(Ns=>{"use strict";var mf=A(),As={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new mf.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&As.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Ns.boolTag=As});var Ge=g(Rs=>{"use strict";function hf({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="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}Rs.stringifyNumber=hf});var Hn=g(vr=>{"use strict";var gf=A(),Gn=Ge(),wf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Gn.stringifyNumber},yf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Gn.stringifyNumber(t)}},bf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new gf.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Gn.stringifyNumber};vr.float=bf;vr.floatExp=yf;vr.floatNaN=wf});var Jn=g(Cr=>{"use strict";var Ts=Ge(),kr=t=>typeof t=="bigint"||Number.isInteger(t),Yn=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function Is(t,e,r){let{value:n}=t;return kr(n)&&n>=0?r+n.toString(e):Ts.stringifyNumber(t)}var vf={identify:t=>kr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Yn(t,2,8,r),stringify:t=>Is(t,8,"0o")},kf={identify:kr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Yn(t,0,10,r),stringify:Ts.stringifyNumber},Cf={identify:t=>kr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Yn(t,2,16,r),stringify:t=>Is(t,16,"0x")};Cr.int=kf;Cr.intHex=Cf;Cr.intOct=vf});var Ls=g(js=>{"use strict";var Sf=Ke(),Ef=br(),_f=Ue(),Pf=bt(),xf=Un(),Vn=Hn(),zn=Jn(),Of=[Sf.map,_f.seq,Pf.string,Ef.nullTag,xf.boolTag,zn.intOct,zn.int,zn.intHex,Vn.floatNaN,Vn.floatExp,Vn.float];js.schema=Of});var qs=g(Ws=>{"use strict";var Af=A(),Nf=Ke(),Rf=Ue();function $s(t){return typeof t=="bigint"||Number.isInteger(t)}var Sr=({value:t})=>JSON.stringify(t),Tf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Sr},{identify:t=>t==null,createNode:()=>new Af.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Sr},{identify:$s,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>$s(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Sr}],If={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},jf=[Nf.map,Rf.seq].concat(Tf,If);Ws.schema=jf});var Qn=g(Ds=>{"use strict";var vt=Ht("buffer"),Xn=A(),Lf=ht(),$f={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof vt.Buffer=="function")return vt.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof vt.Buffer=="function")a=s instanceof vt.Buffer?s.toString("base64"):vt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Xn.Scalar.BLOCK_LITERAL),e!==Xn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===Xn.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return Lf.stringifyString({comment:t,type:e,value:a},n,i,o)}};Ds.binary=$f});var Pr=g(_r=>{"use strict";var Er=_(),Zn=me(),Wf=A(),qf=we();function Ms(t,e){if(Er.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Er.isPair(n)){if(Er.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Zn.Pair(new Wf.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
54
+ ${i}${h}`}else return`${d}${s}${f.join(" ")}${s}${h}`}function hr({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=mr.indentComment(e(n),t);r.push(o.trimStart())}}bs.stringifyCollection=zu});var ge=g(Bn=>{"use strict";var Zu=Mn(),ef=qn(),tf=tr(),he=_(),gr=me(),rf=A();function yt(t,e){let r=he.isScalar(e)?e.value:e;for(let n of t)if(he.isPair(n)&&(n.key===e||n.key===r||he.isScalar(n.key)&&n.key.value===r))return n}var Fn=class extends tf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(he.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(gr.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;he.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new gr.Pair(e,e?.value):n=new gr.Pair(e.key,e.value);let i=yt(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);he.isScalar(i.value)&&rf.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=yt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=yt(this.items,e)?.value;return(!r&&he.isScalar(i)?i.value:i)??void 0}has(e){return!!yt(this.items,e)}set(e,r){this.add(new gr.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)ef.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!he.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})),Zu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Bn.YAMLMap=Fn;Bn.findPair=yt});var Ke=g(ks=>{"use strict";var nf=_(),vs=ge(),of={collection:"map",default:!0,nodeClass:vs.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return nf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>vs.YAMLMap.from(t,e,r)};ks.map=of});var we=g(Cs=>{"use strict";var sf=ft(),af=Mn(),cf=tr(),yr=_(),lf=A(),uf=ue(),Kn=class extends cf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yr.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=wr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=wr(e);if(typeof n!="number")return;let i=this.items[n];return!r&&yr.isScalar(i)?i.value:i}has(e){let r=wr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=wr(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];yr.isScalar(i)&&lf.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let o of this.items)n.push(uf.toJS(o,String(i++),r));return n}toString(e,r,n){return e?af.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r)){let s=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(s++);a=i.call(r,c,a)}o.items.push(sf.createNode(a,void 0,n))}}return o}};function wr(t){let e=yr.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Cs.YAMLSeq=Kn});var Ue=g(Es=>{"use strict";var ff=_(),Ss=we(),df={collection:"seq",default:!0,nodeClass:Ss.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return ff.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Ss.YAMLSeq.from(t,e,r)};Es.seq=df});var bt=g(_s=>{"use strict";var pf=ht(),mf={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),pf.stringifyString(t,e,r,n)}};_s.string=mf});var br=g(Os=>{"use strict";var Ps=A(),xs={identify:t=>t==null,createNode:()=>new Ps.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ps.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&xs.test.test(t)?t:e.options.nullStr};Os.nullTag=xs});var Un=g(Ns=>{"use strict";var hf=A(),As={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new hf.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&As.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Ns.boolTag=As});var He=g(Rs=>{"use strict";function gf({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="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}Rs.stringifyNumber=gf});var Gn=g(vr=>{"use strict";var wf=A(),Hn=He(),yf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hn.stringifyNumber},bf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Hn.stringifyNumber(t)}},vf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new wf.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Hn.stringifyNumber};vr.float=vf;vr.floatExp=bf;vr.floatNaN=yf});var Jn=g(Cr=>{"use strict";var Ts=He(),kr=t=>typeof t=="bigint"||Number.isInteger(t),Yn=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function Is(t,e,r){let{value:n}=t;return kr(n)&&n>=0?r+n.toString(e):Ts.stringifyNumber(t)}var kf={identify:t=>kr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Yn(t,2,8,r),stringify:t=>Is(t,8,"0o")},Cf={identify:kr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Yn(t,0,10,r),stringify:Ts.stringifyNumber},Sf={identify:t=>kr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Yn(t,2,16,r),stringify:t=>Is(t,16,"0x")};Cr.int=Cf;Cr.intHex=Sf;Cr.intOct=kf});var Ls=g(js=>{"use strict";var Ef=Ke(),_f=br(),Pf=Ue(),xf=bt(),Of=Un(),Vn=Gn(),zn=Jn(),Af=[Ef.map,Pf.seq,xf.string,_f.nullTag,Of.boolTag,zn.intOct,zn.int,zn.intHex,Vn.floatNaN,Vn.floatExp,Vn.float];js.schema=Af});var qs=g(Ws=>{"use strict";var Nf=A(),Rf=Ke(),Tf=Ue();function $s(t){return typeof t=="bigint"||Number.isInteger(t)}var Sr=({value:t})=>JSON.stringify(t),If=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Sr},{identify:t=>t==null,createNode:()=>new Nf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Sr},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Sr},{identify:$s,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>$s(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Sr}],jf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Lf=[Rf.map,Tf.seq].concat(If,jf);Ws.schema=Lf});var Qn=g(Ds=>{"use strict";var vt=Gt("buffer"),Xn=A(),$f=ht(),Wf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof vt.Buffer=="function")return vt.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,o){if(!r)return"";let s=r,a;if(typeof vt.Buffer=="function")a=s instanceof vt.Buffer?s.toString("base64"):vt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Xn.Scalar.BLOCK_LITERAL),e!==Xn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===Xn.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return $f.stringifyString({comment:t,type:e,value:a},n,i,o)}};Ds.binary=Wf});var Pr=g(_r=>{"use strict";var Er=_(),Zn=me(),qf=A(),Df=we();function Ms(t,e){if(Er.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Er.isPair(n)){if(Er.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Zn.Pair(new qf.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
56
56
  ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment}
57
- ${o.comment}`:n.comment}n=i}t.items[r]=Er.isPair(n)?n:new Zn.Pair(n)}}else e("Expected a sequence for this tag");return t}function Fs(t,e,r){let{replacer:n}=r,i=new qf.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Zn.createPair(a,c,r))}return i}var Df={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ms,createNode:Fs};_r.createPairs=Fs;_r.pairs=Df;_r.resolvePairs=Ms});var ri=g(ti=>{"use strict";var Bs=_(),ei=ue(),kt=ge(),Mf=we(),Ks=Pr(),Oe=class t extends Mf.YAMLSeq{constructor(){super(),this.add=kt.YAMLMap.prototype.add.bind(this),this.delete=kt.YAMLMap.prototype.delete.bind(this),this.get=kt.YAMLMap.prototype.get.bind(this),this.has=kt.YAMLMap.prototype.has.bind(this),this.set=kt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(Bs.isPair(i)?(o=ei.toJS(i.key,"",r),s=ei.toJS(i.value,o,r)):o=ei.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=Ks.createPairs(e,r,n),o=new this;return o.items=i.items,o}};Oe.tag="tag:yaml.org,2002:omap";var Ff={collection:"seq",identify:t=>t instanceof Map,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ks.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Bs.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Oe,r)},createNode:(t,e,r)=>Oe.from(t,e,r)};ti.YAMLOMap=Oe;ti.omap=Ff});var Js=g(ni=>{"use strict";var Us=A();function Gs({value:t,source:e},r){return e&&(t?Hs:Ys).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Hs={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Us.Scalar(!0),stringify:Gs},Ys={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Us.Scalar(!1),stringify:Gs};ni.falseTag=Ys;ni.trueTag=Hs});var Vs=g(xr=>{"use strict";var Bf=A(),ii=Ge(),Kf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ii.stringifyNumber},Uf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ii.stringifyNumber(t)}},Gf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Bf.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ii.stringifyNumber};xr.float=Gf;xr.floatExp=Uf;xr.floatNaN=Kf});var Xs=g(St=>{"use strict";var zs=Ge(),Ct=t=>typeof t=="bigint"||Number.isInteger(t);function Or(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function oi(t,e,r){let{value:n}=t;if(Ct(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return zs.stringifyNumber(t)}var Hf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Or(t,2,2,r),stringify:t=>oi(t,2,"0b")},Yf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Or(t,1,8,r),stringify:t=>oi(t,8,"0")},Jf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Or(t,0,10,r),stringify:zs.stringifyNumber},Vf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Or(t,2,16,r),stringify:t=>oi(t,16,"0x")};St.int=Jf;St.intBin=Hf;St.intHex=Vf;St.intOct=Yf});var ai=g(si=>{"use strict";var Rr=_(),Ar=me(),Nr=ge(),Ae=class t extends Nr.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Rr.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ar.Pair(e.key,null):r=new Ar.Pair(e,null),Nr.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Nr.findPair(this.items,e);return!r&&Rr.isPair(n)?Rr.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Nr.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ar.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Ar.createPair(s,null,n));return o}};Ae.tag="tag:yaml.org,2002:set";var zf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ae.from(t,e,r),resolve(t,e){if(Rr.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};si.YAMLSet=Ae;si.set=zf});var li=g(Tr=>{"use strict";var Xf=Ge();function ci(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function Qs(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Xf.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(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))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Qf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>ci(t,r),stringify:Qs},Zf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>ci(t,!1),stringify:Qs},Zs={identify:t=>t 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(t){let e=t.match(Zs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=ci(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Tr.floatTime=Zf;Tr.intTime=Qf;Tr.timestamp=Zs});var ra=g(ta=>{"use strict";var ed=Ke(),td=br(),rd=Ue(),nd=bt(),id=Qn(),ea=Js(),ui=Vs(),Ir=Xs(),od=fr(),sd=ri(),ad=Pr(),cd=ai(),fi=li(),ld=[ed.map,rd.seq,nd.string,td.nullTag,ea.trueTag,ea.falseTag,Ir.intBin,Ir.intOct,Ir.int,Ir.intHex,ui.floatNaN,ui.floatExp,ui.float,id.binary,od.merge,sd.omap,ad.pairs,cd.set,fi.intTime,fi.floatTime,fi.timestamp];ta.schema=ld});var da=g(mi=>{"use strict";var sa=Ke(),ud=br(),aa=Ue(),fd=bt(),dd=Un(),di=Hn(),pi=Jn(),pd=Ls(),md=qs(),ca=Qn(),Et=fr(),la=ri(),ua=Pr(),na=ra(),fa=ai(),jr=li(),ia=new Map([["core",pd.schema],["failsafe",[sa.map,aa.seq,fd.string]],["json",md.schema],["yaml11",na.schema],["yaml-1.1",na.schema]]),oa={binary:ca.binary,bool:dd.boolTag,float:di.float,floatExp:di.floatExp,floatNaN:di.floatNaN,floatTime:jr.floatTime,int:pi.int,intHex:pi.intHex,intOct:pi.intOct,intTime:jr.intTime,map:sa.map,merge:Et.merge,null:ud.nullTag,omap:la.omap,pairs:ua.pairs,seq:aa.seq,set:fa.set,timestamp:jr.timestamp},hd={"tag:yaml.org,2002:binary":ca.binary,"tag:yaml.org,2002:merge":Et.merge,"tag:yaml.org,2002:omap":la.omap,"tag:yaml.org,2002:pairs":ua.pairs,"tag:yaml.org,2002:set":fa.set,"tag:yaml.org,2002:timestamp":jr.timestamp};function gd(t,e,r){let n=ia.get(e);if(n&&!t)return r&&!n.includes(Et.merge)?n.concat(Et.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(ia.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(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Et.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?oa[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(oa).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}mi.coreKnownTags=hd;mi.getTags=gd});var wi=g(pa=>{"use strict";var hi=_(),wd=Ke(),yd=Ue(),bd=bt(),Lr=da(),vd=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,gi=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Lr.getTags(e,"compat"):e?Lr.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Lr.coreKnownTags:{},this.tags=Lr.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,hi.MAP,{value:wd.map}),Object.defineProperty(this,hi.SCALAR,{value:bd.string}),Object.defineProperty(this,hi.SEQ,{value:yd.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?vd:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};pa.Schema=gi});var ha=g(ma=>{"use strict";var kd=_(),yi=gt(),_t=dt();function Cd(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=yi.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(_t.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(kd.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(_t.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=yi.stringify(t.contents,i,()=>a=null,c);a&&(l+=_t.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(yi.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
57
+ ${o.comment}`:n.comment}n=i}t.items[r]=Er.isPair(n)?n:new Zn.Pair(n)}}else e("Expected a sequence for this tag");return t}function Fs(t,e,r){let{replacer:n}=r,i=new Df.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Zn.createPair(a,c,r))}return i}var Mf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ms,createNode:Fs};_r.createPairs=Fs;_r.pairs=Mf;_r.resolvePairs=Ms});var ri=g(ti=>{"use strict";var Bs=_(),ei=ue(),kt=ge(),Ff=we(),Ks=Pr(),Oe=class t extends Ff.YAMLSeq{constructor(){super(),this.add=kt.YAMLMap.prototype.add.bind(this),this.delete=kt.YAMLMap.prototype.delete.bind(this),this.get=kt.YAMLMap.prototype.get.bind(this),this.has=kt.YAMLMap.prototype.has.bind(this),this.set=kt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(Bs.isPair(i)?(o=ei.toJS(i.key,"",r),s=ei.toJS(i.value,o,r)):o=ei.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=Ks.createPairs(e,r,n),o=new this;return o.items=i.items,o}};Oe.tag="tag:yaml.org,2002:omap";var Bf={collection:"seq",identify:t=>t instanceof Map,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ks.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Bs.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Oe,r)},createNode:(t,e,r)=>Oe.from(t,e,r)};ti.YAMLOMap=Oe;ti.omap=Bf});var Js=g(ni=>{"use strict";var Us=A();function Hs({value:t,source:e},r){return e&&(t?Gs:Ys).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Gs={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Us.Scalar(!0),stringify:Hs},Ys={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Us.Scalar(!1),stringify:Hs};ni.falseTag=Ys;ni.trueTag=Gs});var Vs=g(xr=>{"use strict";var Kf=A(),ii=He(),Uf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ii.stringifyNumber},Hf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ii.stringifyNumber(t)}},Gf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Kf.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ii.stringifyNumber};xr.float=Gf;xr.floatExp=Hf;xr.floatNaN=Uf});var Xs=g(St=>{"use strict";var zs=He(),Ct=t=>typeof t=="bigint"||Number.isInteger(t);function Or(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function oi(t,e,r){let{value:n}=t;if(Ct(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return zs.stringifyNumber(t)}var Yf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Or(t,2,2,r),stringify:t=>oi(t,2,"0b")},Jf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Or(t,1,8,r),stringify:t=>oi(t,8,"0")},Vf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Or(t,0,10,r),stringify:zs.stringifyNumber},zf={identify:Ct,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Or(t,2,16,r),stringify:t=>oi(t,16,"0x")};St.int=Vf;St.intBin=Yf;St.intHex=zf;St.intOct=Jf});var ai=g(si=>{"use strict";var Rr=_(),Ar=me(),Nr=ge(),Ae=class t extends Nr.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Rr.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ar.Pair(e.key,null):r=new Ar.Pair(e,null),Nr.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Nr.findPair(this.items,e);return!r&&Rr.isPair(n)?Rr.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Nr.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ar.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Ar.createPair(s,null,n));return o}};Ae.tag="tag:yaml.org,2002:set";var Xf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ae.from(t,e,r),resolve(t,e){if(Rr.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};si.YAMLSet=Ae;si.set=Xf});var li=g(Tr=>{"use strict";var Qf=He();function ci(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function Qs(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Qf.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(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))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Zf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>ci(t,r),stringify:Qs},ed={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>ci(t,!1),stringify:Qs},Zs={identify:t=>t 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(t){let e=t.match(Zs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=ci(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Tr.floatTime=ed;Tr.intTime=Zf;Tr.timestamp=Zs});var ra=g(ta=>{"use strict";var td=Ke(),rd=br(),nd=Ue(),id=bt(),od=Qn(),ea=Js(),ui=Vs(),Ir=Xs(),sd=fr(),ad=ri(),cd=Pr(),ld=ai(),fi=li(),ud=[td.map,nd.seq,id.string,rd.nullTag,ea.trueTag,ea.falseTag,Ir.intBin,Ir.intOct,Ir.int,Ir.intHex,ui.floatNaN,ui.floatExp,ui.float,od.binary,sd.merge,ad.omap,cd.pairs,ld.set,fi.intTime,fi.floatTime,fi.timestamp];ta.schema=ud});var da=g(mi=>{"use strict";var sa=Ke(),fd=br(),aa=Ue(),dd=bt(),pd=Un(),di=Gn(),pi=Jn(),md=Ls(),hd=qs(),ca=Qn(),Et=fr(),la=ri(),ua=Pr(),na=ra(),fa=ai(),jr=li(),ia=new Map([["core",md.schema],["failsafe",[sa.map,aa.seq,dd.string]],["json",hd.schema],["yaml11",na.schema],["yaml-1.1",na.schema]]),oa={binary:ca.binary,bool:pd.boolTag,float:di.float,floatExp:di.floatExp,floatNaN:di.floatNaN,floatTime:jr.floatTime,int:pi.int,intHex:pi.intHex,intOct:pi.intOct,intTime:jr.intTime,map:sa.map,merge:Et.merge,null:fd.nullTag,omap:la.omap,pairs:ua.pairs,seq:aa.seq,set:fa.set,timestamp:jr.timestamp},gd={"tag:yaml.org,2002:binary":ca.binary,"tag:yaml.org,2002:merge":Et.merge,"tag:yaml.org,2002:omap":la.omap,"tag:yaml.org,2002:pairs":ua.pairs,"tag:yaml.org,2002:set":fa.set,"tag:yaml.org,2002:timestamp":jr.timestamp};function wd(t,e,r){let n=ia.get(e);if(n&&!t)return r&&!n.includes(Et.merge)?n.concat(Et.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(ia.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(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Et.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?oa[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(oa).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}mi.coreKnownTags=gd;mi.getTags=wd});var wi=g(pa=>{"use strict";var hi=_(),yd=Ke(),bd=Ue(),vd=bt(),Lr=da(),kd=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,gi=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Lr.getTags(e,"compat"):e?Lr.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Lr.coreKnownTags:{},this.tags=Lr.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,hi.MAP,{value:yd.map}),Object.defineProperty(this,hi.SCALAR,{value:vd.string}),Object.defineProperty(this,hi.SEQ,{value:bd.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?kd:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};pa.Schema=gi});var ha=g(ma=>{"use strict";var Cd=_(),yi=gt(),_t=dt();function Sd(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=yi.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(_t.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Cd.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(_t.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=yi.stringify(t.contents,i,()=>a=null,c);a&&(l+=_t.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(yi.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
58
  `)?(r.push("..."),r.push(_t.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(_t.indentComment(o(c),"")))}return r.join(`
59
59
  `)+`
60
- `}ma.stringifyDocument=Cd});var Pt=g(ga=>{"use strict";var Sd=ut(),He=tr(),H=_(),Ed=me(),_d=ue(),Pd=wi(),xd=ha(),bi=Xt(),Od=Sn(),Ad=ft(),vi=Cn(),ki=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,H.NODE_TYPE,{value:H.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new vi.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[H.NODE_TYPE]:{value:H.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=H.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ye(this.contents)&&this.contents.add(e)}addIn(e,r){Ye(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=bi.anchorNames(this);e.anchor=!r||n.has(r)?bi.findNewAnchor(r||"a",n):r}return new Sd.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let m=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=r.filter(m).map(String);y.length>0&&(r=r.concat(y)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=bi.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},p=Ad.createNode(e,u,w);return a&&H.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Ed.Pair(i,o)}delete(e){return Ye(this.contents)?this.contents.delete(e):!1}deleteIn(e){return He.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ye(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return H.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return He.isEmptyPath(e)?!r&&H.isScalar(this.contents)?this.contents.value:this.contents:H.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return H.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return He.isEmptyPath(e)?this.contents!==void 0:H.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=He.collectionFromPath(this.schema,[e],r):Ye(this.contents)&&this.contents.set(e,r)}setIn(e,r){He.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=He.collectionFromPath(this.schema,Array.from(e),r):Ye(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vi.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vi.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=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(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Pd.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=_d.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Od.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return xd.stringifyDocument(this,e)}};function Ye(t){if(H.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}ga.Document=ki});var At=g(Ot=>{"use strict";var xt=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},Ci=class extends xt{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Si=class extends xt{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Nd=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
60
+ `}ma.stringifyDocument=Sd});var Pt=g(ga=>{"use strict";var Ed=ut(),Ge=tr(),G=_(),_d=me(),Pd=ue(),xd=wi(),Od=ha(),bi=Xt(),Ad=Sn(),Nd=ft(),vi=Cn(),ki=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G.NODE_TYPE,{value:G.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new vi.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[G.NODE_TYPE]:{value:G.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=G.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ye(this.contents)&&this.contents.add(e)}addIn(e,r){Ye(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=bi.anchorNames(this);e.anchor=!r||n.has(r)?bi.findNewAnchor(r||"a",n):r}return new Ed.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let m=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=r.filter(m).map(String);y.length>0&&(r=r.concat(y)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=bi.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},p=Nd.createNode(e,u,w);return a&&G.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new _d.Pair(i,o)}delete(e){return Ye(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ge.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ye(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return G.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Ge.isEmptyPath(e)?!r&&G.isScalar(this.contents)?this.contents.value:this.contents:G.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return G.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ge.isEmptyPath(e)?this.contents!==void 0:G.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Ge.collectionFromPath(this.schema,[e],r):Ye(this.contents)&&this.contents.set(e,r)}setIn(e,r){Ge.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Ge.collectionFromPath(this.schema,Array.from(e),r):Ye(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vi.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vi.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=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(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new xd.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Pd.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Ad.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Od.stringifyDocument(this,e)}};function Ye(t){if(G.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}ga.Document=ki});var At=g(Ot=>{"use strict";var xt=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},Ci=class extends xt{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Si=class extends xt{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Rd=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
61
61
  `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`:
62
62
 
63
63
  ${s}
64
64
  ${l}
65
- `}};Ot.YAMLError=xt;Ot.YAMLParseError=Ci;Ot.YAMLWarning=Si;Ot.prettifyError=Nd});var Nt=g(wa=>{"use strict";function Rd(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",h=!1,w=!1,p=null,m=null,y=null,v=null,k=null,C=null,S=null;for(let b of t)switch(w&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&o(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),u=!0;break;case"comment":{u||o(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=b.source.substring(1)||" ";f?f+=d+N:f=N,d="",l=!1;break}case"newline":l?f?f+=b.source:(!C||r!=="seq-item-ind")&&(c=!0):d+=b.source,l=!0,h=!0,(m||y)&&(v=b),u=!0;break;case"anchor":m&&o(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&o(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,S??(S=b.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&o(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,S??(S=b.offset),l=!1,u=!1,w=!0;break}case r:(m||y)&&o(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),C&&o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),C=b,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,u=!1;break}default:o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:i;return w&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:C,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:x,start:S??x}}wa.resolveProps=Rd});var $r=g(ya=>{"use strict";function Ei(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
66
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Ei(e.key)||Ei(e.value))return!0}return!1;default:return!0}}ya.containsNewline=Ei});var _i=g(ba=>{"use strict";var Td=$r();function Id(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Td.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ba.flowIndentCheck=Id});var Pi=g(ka=>{"use strict";var va=_();function jd(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||va.isScalar(o)&&va.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}ka.mapIncludes=jd});var xa=g(Pa=>{"use strict";var Ca=me(),Ld=ge(),Sa=Nt(),$d=$r(),Ea=_i(),Wd=Pi(),_a="All mapping items must start at the same column";function qd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Ld.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:f,key:d,sep:h,value:w}=u,p=Sa.resolveProps(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!p.found;if(m){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==n.indent&&i(c,"BAD_INDENT",_a)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
67
- `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||$d.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&i(c,"BAD_INDENT",_a);r.atKey=!0;let y=p.end,v=d?t(r,d,p,i):e(r,y,f,null,p,i);r.schema.compat&&Ea.flowIndentCheck(n.indent,d,i),r.atKey=!1,Wd.mapIncludes(r,a.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=Sa.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){m&&(w?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=w?t(r,w,k,i):e(r,c,h,null,k,i);r.schema.compat&&Ea.flowIndentCheck(n.indent,w,i),c=C.range[2];let S=new Ca.Pair(v,C);r.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}else{m&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
68
- `+k.comment:v.comment=k.comment);let C=new Ca.Pair(v);r.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}Pa.resolveBlockMap=qd});var Aa=g(Oa=>{"use strict";var Dd=we(),Md=Nt(),Fd=_i();function Bd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Dd.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:f}of n.items){let d=Md.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let h=f?t(r,f,d,i):e(r,d.end,u,null,d,i);r.schema.compat&&Fd.flowIndentCheck(n.indent,f,i),c=h.range[2],a.items.push(h)}return a.range=[n.offset,c,l??c],a}Oa.resolveBlockSeq=Bd});var Je=g(Na=>{"use strict";function Kd(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Na.resolveEnd=Kd});var ja=g(Ia=>{"use strict";var Ud=_(),Gd=me(),Ra=ge(),Hd=we(),Yd=Je(),Ta=Nt(),Jd=$r(),Vd=Pi(),xi="Block collections are not allowed within flow collections",Oi=t=>t&&(t.type==="block-map"||t.type==="block-seq");function zd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Ra.YAMLMap:Hd.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset+n.start.source.length;for(let m=0;m<n.items.length;++m){let y=n.items[m],{start:v,key:k,sep:C,value:S}=y,E=Ta.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??C?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!C&&!S){m===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<n.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
- `+E.comment:l.comment=E.comment),f=E.end;continue}!s&&r.options.strict&&Jd.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let b of v)switch(b.type){case"comma":case"space":break;case"comment":x=b.source.substring(1);break e;default:break e}if(x){let b=l.items[l.items.length-1];Ud.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
65
+ `}};Ot.YAMLError=xt;Ot.YAMLParseError=Ci;Ot.YAMLWarning=Si;Ot.prettifyError=Rd});var Nt=g(wa=>{"use strict";function Td(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",h=!1,w=!1,p=null,m=null,y=null,v=null,k=null,C=null,S=null;for(let b of t)switch(w&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&o(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),u=!0;break;case"comment":{u||o(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=b.source.substring(1)||" ";f?f+=d+N:f=N,d="",l=!1;break}case"newline":l?f?f+=b.source:(!C||r!=="seq-item-ind")&&(c=!0):d+=b.source,l=!0,h=!0,(m||y)&&(v=b),u=!0;break;case"anchor":m&&o(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&o(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,S??(S=b.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&o(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,S??(S=b.offset),l=!1,u=!1,w=!0;break}case r:(m||y)&&o(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),C&&o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),C=b,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,u=!1;break}default:o(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:i;return w&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:C,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:x,start:S??x}}wa.resolveProps=Td});var $r=g(ya=>{"use strict";function Ei(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
66
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Ei(e.key)||Ei(e.value))return!0}return!1;default:return!0}}ya.containsNewline=Ei});var _i=g(ba=>{"use strict";var Id=$r();function jd(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Id.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ba.flowIndentCheck=jd});var Pi=g(ka=>{"use strict";var va=_();function Ld(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||va.isScalar(o)&&va.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}ka.mapIncludes=Ld});var xa=g(Pa=>{"use strict";var Ca=me(),$d=ge(),Sa=Nt(),Wd=$r(),Ea=_i(),qd=Pi(),_a="All mapping items must start at the same column";function Dd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??$d.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:f,key:d,sep:h,value:w}=u,p=Sa.resolveProps(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!p.found;if(m){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==n.indent&&i(c,"BAD_INDENT",_a)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
67
+ `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Wd.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&i(c,"BAD_INDENT",_a);r.atKey=!0;let y=p.end,v=d?t(r,d,p,i):e(r,y,f,null,p,i);r.schema.compat&&Ea.flowIndentCheck(n.indent,d,i),r.atKey=!1,qd.mapIncludes(r,a.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=Sa.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){m&&(w?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=w?t(r,w,k,i):e(r,c,h,null,k,i);r.schema.compat&&Ea.flowIndentCheck(n.indent,w,i),c=C.range[2];let S=new Ca.Pair(v,C);r.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}else{m&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
68
+ `+k.comment:v.comment=k.comment);let C=new Ca.Pair(v);r.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}Pa.resolveBlockMap=Dd});var Aa=g(Oa=>{"use strict";var Md=we(),Fd=Nt(),Bd=_i();function Kd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Md.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:f}of n.items){let d=Fd.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let h=f?t(r,f,d,i):e(r,d.end,u,null,d,i);r.schema.compat&&Bd.flowIndentCheck(n.indent,f,i),c=h.range[2],a.items.push(h)}return a.range=[n.offset,c,l??c],a}Oa.resolveBlockSeq=Kd});var Je=g(Na=>{"use strict";function Ud(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Na.resolveEnd=Ud});var ja=g(Ia=>{"use strict";var Hd=_(),Gd=me(),Ra=ge(),Yd=we(),Jd=Je(),Ta=Nt(),Vd=$r(),zd=Pi(),xi="Block collections are not allowed within flow collections",Oi=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Xd({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Ra.YAMLMap:Yd.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset+n.start.source.length;for(let m=0;m<n.items.length;++m){let y=n.items[m],{start:v,key:k,sep:C,value:S}=y,E=Ta.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??C?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!C&&!S){m===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<n.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
+ `+E.comment:l.comment=E.comment),f=E.end;continue}!s&&r.options.strict&&Vd.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let b of v)switch(b.type){case"comma":case"space":break;case"comment":x=b.source.substring(1);break e;default:break e}if(x){let b=l.items[l.items.length-1];Hd.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
70
70
  `+x:b.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!s&&!C&&!E.found){let x=S?t(r,S,E,i):e(r,E.end,C,null,E,i);l.items.push(x),f=x.range[2],Oi(S)&&i(x.range,"BLOCK_IN_FLOW",xi)}else{r.atKey=!0;let x=E.end,b=k?t(r,k,E,i):e(r,x,v,null,E,i);Oi(k)&&i(b.range,"BLOCK_IN_FLOW",xi),r.atKey=!1;let N=Ta.resolveProps(C??[],{flow:a,indicator:"map-value-ind",next:S,offset:b.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(N.found){if(!s&&!E.found&&r.options.strict){if(C)for(let R of C){if(R===N.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<N.found.offset-1024&&i(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?i(S,"MISSING_CHAR",`Missing space after : in ${a}`):i(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let le=S?t(r,S,N,i):N.found?e(r,N.end,C,null,N,i):null;le?Oi(S)&&i(le.range,"BLOCK_IN_FLOW",xi):N.comment&&(b.comment?b.comment+=`
71
- `+N.comment:b.comment=N.comment);let qe=new Gd.Pair(b,le);if(r.options.keepSourceTokens&&(qe.srcToken=y),s){let R=l;Vd.mapIncludes(r,R.items,b)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(qe)}else{let R=new Ra.YAMLMap(r.schema);R.flow=!0,R.items.push(qe);let Ro=(le??b).range;R.range=[b.range[0],Ro[1],Ro[2]],l.items.push(R)}f=le?le.range[2]:N.end}}let d=s?"}":"]",[h,...w]=n.end,p=f;if(h?.source===d)p=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=u?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let m=Yd.resolveEnd(w,p,r.options.strict,i);m.comment&&(l.comment?l.comment+=`
72
- `+m.comment:l.comment=m.comment),l.range=[n.offset,p,m.offset]}else l.range=[n.offset,p,p];return l}Ia.resolveFlowCollection=zd});var $a=g(La=>{"use strict";var Xd=_(),Qd=A(),Zd=ge(),ep=we(),tp=xa(),rp=Aa(),np=ja();function Ai(t,e,r,n,i,o){let s=r.type==="block-map"?tp.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?rp.resolveBlockSeq(t,e,r,n,o):np.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function ip(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,d=>i(o,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=n,w=d&&o?d.offset>o.offset?d:o:d??o;w&&(!h||h.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Zd.YAMLMap.tagName&&a==="map"||s===ep.YAMLSeq.tagName&&a==="seq")return Ai(t,e,r,i,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),Ai(t,e,r,i,s)}let l=Ai(t,e,r,i,s,c),u=c.resolve?.(l,d=>i(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Xd.isNode(u)?u:new Qd.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}La.composeCollection=ip});var Ri=g(Wa=>{"use strict";var Ni=A();function op(t,e,r){let n=e.offset,i=sp(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?Ni.Scalar.BLOCK_FOLDED:Ni.Scalar.BLOCK_LITERAL,s=e.source?ap(e.source):[],a=s.length;for(let p=s.length-1;p>=0;--p){let m=s[p][1];if(m===""||m==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&s.length>0?`
71
+ `+N.comment:b.comment=N.comment);let qe=new Gd.Pair(b,le);if(r.options.keepSourceTokens&&(qe.srcToken=y),s){let R=l;zd.mapIncludes(r,R.items,b)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(qe)}else{let R=new Ra.YAMLMap(r.schema);R.flow=!0,R.items.push(qe);let Ro=(le??b).range;R.range=[b.range[0],Ro[1],Ro[2]],l.items.push(R)}f=le?le.range[2]:N.end}}let d=s?"}":"]",[h,...w]=n.end,p=f;if(h?.source===d)p=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=u?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let m=Jd.resolveEnd(w,p,r.options.strict,i);m.comment&&(l.comment?l.comment+=`
72
+ `+m.comment:l.comment=m.comment),l.range=[n.offset,p,m.offset]}else l.range=[n.offset,p,p];return l}Ia.resolveFlowCollection=Xd});var $a=g(La=>{"use strict";var Qd=_(),Zd=A(),ep=ge(),tp=we(),rp=xa(),np=Aa(),ip=ja();function Ai(t,e,r,n,i,o){let s=r.type==="block-map"?rp.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?np.resolveBlockSeq(t,e,r,n,o):ip.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function op(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,d=>i(o,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=n,w=d&&o?d.offset>o.offset?d:o:d??o;w&&(!h||h.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===ep.YAMLMap.tagName&&a==="map"||s===tp.YAMLSeq.tagName&&a==="seq")return Ai(t,e,r,i,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),Ai(t,e,r,i,s)}let l=Ai(t,e,r,i,s,c),u=c.resolve?.(l,d=>i(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Qd.isNode(u)?u:new Zd.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}La.composeCollection=op});var Ri=g(Wa=>{"use strict";var Ni=A();function sp(t,e,r){let n=e.offset,i=ap(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?Ni.Scalar.BLOCK_FOLDED:Ni.Scalar.BLOCK_LITERAL,s=e.source?cp(e.source):[],a=s.length;for(let p=s.length-1;p>=0;--p){let m=s[p][1];if(m===""||m==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&s.length>0?`
73
73
  `.repeat(Math.max(1,s.length-1)):"",m=n+i.length;return e.source&&(m+=e.source.length),{value:p,type:o,comment:i.comment,range:[n,m,m]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let p=0;p<a;++p){let[m,y]=s[p];if(y===""||y==="\r")i.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&r(l+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=m.length),u=p,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=m.length+y.length+1}for(let p=s.length-1;p>=a;--p)s[p][0].length>c&&(a=p+1);let f="",d="",h=!1;for(let p=0;p<u;++p)f+=s[p][0].slice(c)+`
74
74
  `;for(let p=u;p<a;++p){let[m,y]=s[p];l+=m.length+y.length+1;let v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&m.length<c){let C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-y.length-(v?2:1),"BAD_INDENT",C),m=""}o===Ni.Scalar.BLOCK_LITERAL?(f+=d+m.slice(c)+y,d=`
75
75
  `):m.length>c||y[0]===" "?(d===" "?d=`
@@ -84,46 +84,46 @@ ${l}
84
84
  `+s[p][0].slice(c);f[f.length-1]!==`
85
85
  `&&(f+=`
86
86
  `);break;default:f+=`
87
- `}let w=n+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[n,w,w]}}function sp({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let d=1;d<i.length;++d){let h=i[d];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!s&&w?s=w:c===-1&&(c=t+d)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":l=!0;case"newline":f+=h.source.length;break;case"comment":r&&!l&&n(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":n(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;n(h,"UNEXPECTED_TOKEN",w);let p=h.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function ap(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Wa.resolveBlockScalar=op});var Ii=g(Da=>{"use strict";var Ti=A(),cp=Je();function lp(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(d,h,w)=>r(n+d,h,w);switch(i){case"scalar":a=Ti.Scalar.PLAIN,c=up(o,l);break;case"single-quoted-scalar":a=Ti.Scalar.QUOTE_SINGLE,c=fp(o,l);break;case"double-quoted-scalar":a=Ti.Scalar.QUOTE_DOUBLE,c=dp(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,f=cp.resolveEnd(s,u,e,r);return{value:c,type:a,comment:f.comment,range:[n,u,f.offset]}}function up(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),qa(t)}function fp(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),qa(t.slice(1,-1)).replace(/''/g,"'")}function qa(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let w=n+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[n,w,w]}}function ap({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let d=1;d<i.length;++d){let h=i[d];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!s&&w?s=w:c===-1&&(c=t+d)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":l=!0;case"newline":f+=h.source.length;break;case"comment":r&&!l&&n(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":n(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;n(h,"UNEXPECTED_TOKEN",w);let p=h.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function cp(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),o=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Wa.resolveBlockScalar=sp});var Ii=g(Da=>{"use strict";var Ti=A(),lp=Je();function up(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(d,h,w)=>r(n+d,h,w);switch(i){case"scalar":a=Ti.Scalar.PLAIN,c=fp(o,l);break;case"single-quoted-scalar":a=Ti.Scalar.QUOTE_SINGLE,c=dp(o,l);break;case"double-quoted-scalar":a=Ti.Scalar.QUOTE_DOUBLE,c=pp(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,f=lp.resolveEnd(s,u,e,r);return{value:c,type:a,comment:f.comment,range:[n,u,f.offset]}}function fp(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),qa(t)}function dp(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),qa(t.slice(1,-1)).replace(/''/g,"'")}function qa(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
89
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],o=" ",s=e.lastIndex;for(r.lastIndex=s;n=r.exec(t);)n[1]===""?o===`
90
90
  `?i+=o:o=`
91
- `:(i+=o+n[1],o=" "),s=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,n=a.exec(t),i+o+(n?.[1]??"")}function dp(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
91
+ `:(i+=o+n[1],o=" "),s=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,n=a.exec(t),i+o+(n?.[1]??"")}function pp(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
92
92
  `))if(i===`
93
- `){let{fold:o,offset:s}=pp(t,n);r+=o,n=s}else if(i==="\\"){let o=t[++n],s=mp[o];if(s)r+=s;else if(o===`
93
+ `){let{fold:o,offset:s}=mp(t,n);r+=o,n=s}else if(i==="\\"){let o=t[++n],s=hp[o];if(s)r+=s;else if(o===`
94
94
  `)for(o=t[n+1];o===" "||o===" ";)o=t[++n+1];else if(o==="\r"&&t[n+1]===`
95
- `)for(o=t[++n+1];o===" "||o===" ";)o=t[++n+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=hp(t,n+1,a,e),n+=a}else{let a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let o=n,s=t[n+1];for(;s===" "||s===" ";)s=t[++n+1];s!==`
95
+ `)for(o=t[++n+1];o===" "||o===" ";)o=t[++n+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;r+=gp(t,n+1,a,e),n+=a}else{let a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let o=n,s=t[n+1];for(;s===" "||s===" ";)s=t[++n+1];s!==`
96
96
  `&&!(s==="\r"&&t[n+2]===`
97
- `)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function pp(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
97
+ `)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function mp(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
98
98
  `||n==="\r")&&!(n==="\r"&&t[e+2]!==`
99
99
  `);)n===`
100
100
  `&&(r+=`
101
- `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var mp={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hp(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Da.resolveFlowScalar=lp});var Ba=g(Fa=>{"use strict";var Ne=_(),Ma=A(),gp=Ri(),wp=Ii();function yp(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?gp.resolveBlockScalar(t,e,n):wp.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,f=>n(r,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ne.SCALAR]:c?l=bp(t.schema,i,c,r,n):e.type==="scalar"?l=vp(t,i,e,n):l=t.schema[Ne.SCALAR];let u;try{let f=l.resolve(i,d=>n(r??e,"TAG_RESOLVE_FAILED",d),t.options);u=Ne.isScalar(f)?f:new Ma.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(r??e,"TAG_RESOLVE_FAILED",d),u=new Ma.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function bp(t,e,r,n,i){if(r==="!")return t[Ne.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)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=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ne.SCALAR])}function vp({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Ne.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Ne.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}Fa.composeScalar=yp});var Ua=g(Ka=>{"use strict";function kp(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}Ka.emptyScalarPosition=kp});var Ya=g(Li=>{"use strict";var Cp=ut(),Sp=_(),Ep=$a(),Ga=Ba(),_p=Je(),Pp=Ua(),xp={composeNode:Ha,composeEmptyNode:ji};function Ha(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Op(t,e,n),(a||c)&&n(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":l=Ga.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Ep.composeCollection(xp,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=ji(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Sp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ji(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Pp.emptyScalarPosition(e,r,n),indent:-1,source:""},f=Ga.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function Op({options:t},{offset:e,source:r,end:n},i){let o=new Cp.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=_p.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Li.composeEmptyNode=ji;Li.composeNode=Ha});var za=g(Va=>{"use strict";var Ap=Pt(),Ja=Ya(),Np=Je(),Rp=Nt();function Tp(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Ap.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Rp.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Ja.composeNode(l,i,u,s):Ja.composeEmptyNode(l,u.end,n,null,u,s);let f=c.contents.range[2],d=Np.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[r,f,d.offset],c}Va.composeDoc=Tp});var Wi=g(Za=>{"use strict";var Ip=Ht("process"),jp=Cn(),Lp=Pt(),Rt=At(),Xa=_(),$p=za(),Wp=Je();function Tt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function Qa(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":n?`
101
+ `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var hp={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gp(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Da.resolveFlowScalar=up});var Ba=g(Fa=>{"use strict";var Ne=_(),Ma=A(),wp=Ri(),yp=Ii();function bp(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?wp.resolveBlockScalar(t,e,n):yp.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,f=>n(r,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ne.SCALAR]:c?l=vp(t.schema,i,c,r,n):e.type==="scalar"?l=kp(t,i,e,n):l=t.schema[Ne.SCALAR];let u;try{let f=l.resolve(i,d=>n(r??e,"TAG_RESOLVE_FAILED",d),t.options);u=Ne.isScalar(f)?f:new Ma.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(r??e,"TAG_RESOLVE_FAILED",d),u=new Ma.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function vp(t,e,r,n,i){if(r==="!")return t[Ne.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)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=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ne.SCALAR])}function kp({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Ne.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Ne.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}Fa.composeScalar=bp});var Ua=g(Ka=>{"use strict";function Cp(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}Ka.emptyScalarPosition=Cp});var Ya=g(Li=>{"use strict";var Sp=ut(),Ep=_(),_p=$a(),Ha=Ba(),Pp=Je(),xp=Ua(),Op={composeNode:Ga,composeEmptyNode:ji};function Ga(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Ap(t,e,n),(a||c)&&n(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":l=Ha.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=_p.composeCollection(Op,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=ji(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Ep.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ji(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:xp.emptyScalarPosition(e,r,n),indent:-1,source:""},f=Ha.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function Ap({options:t},{offset:e,source:r,end:n},i){let o=new Sp.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Pp.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Li.composeEmptyNode=ji;Li.composeNode=Ga});var za=g(Va=>{"use strict";var Np=Pt(),Ja=Ya(),Rp=Je(),Tp=Nt();function Ip(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Np.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Tp.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Ja.composeNode(l,i,u,s):Ja.composeEmptyNode(l,u.end,n,null,u,s);let f=c.contents.range[2],d=Rp.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[r,f,d.offset],c}Va.composeDoc=Ip});var Wi=g(Za=>{"use strict";var jp=Gt("process"),Lp=Cn(),$p=Pt(),Rt=At(),Xa=_(),Wp=za(),qp=Je();function Tt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function Qa(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":n?`
103
103
 
104
104
  `:`
105
- `)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var $i=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Tt(r);o?this.warnings.push(new Rt.YAMLWarning(s,n,i)):this.errors.push(new Rt.YAMLParseError(s,n,i))},this.directives=new jp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=Qa(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
105
+ `)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var $i=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Tt(r);o?this.warnings.push(new Rt.YAMLWarning(s,n,i)):this.errors.push(new Rt.YAMLParseError(s,n,i))},this.directives=new Lp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=Qa(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
106
106
  ${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(Xa.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];Xa.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n}
107
107
  ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n}
108
- ${s}`:n}}if(r){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:Qa(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(Ip.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let o=Tt(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=$p.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Rt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Rt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Wp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
109
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Rt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Lp.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};Za.Composer=$i});var rc=g(Wr=>{"use strict";var qp=Ri(),Dp=Ii(),Mp=At(),ec=ht();function Fp(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Mp.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Dp.resolveFlowScalar(t,e,n);case"block-scalar":return qp.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Bp(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=ec.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
108
+ ${s}`:n}}if(r){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:Qa(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(jp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let o=Tt(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Wp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Rt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Rt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=qp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
109
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Rt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new $p.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};Za.Composer=$i});var rc=g(Wr=>{"use strict";var Dp=Ri(),Mp=Ii(),Fp=At(),ec=ht();function Bp(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Fp.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Mp.resolveFlowScalar(t,e,n);case"block-scalar":return Dp.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Kp(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=ec.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
110
110
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
111
111
  `),u=a.substring(0,l),f=a.substring(l+1)+`
112
112
  `,d=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return tc(d,c)||d.push({type:"newline",offset:-1,indent:n,source:`
113
- `}),{type:"block-scalar",offset:o,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Kp(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=ec.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Up(t,c);break;case'"':qi(t,c,"double-quoted-scalar");break;case"'":qi(t,c,"single-quoted-scalar");break;default:qi(t,c,"scalar")}}function Up(t,e){let r=e.indexOf(`
113
+ `}),{type:"block-scalar",offset:o,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Up(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=ec.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Hp(t,c);break;case'"':qi(t,c,"double-quoted-scalar");break;case"'":qi(t,c,"single-quoted-scalar");break;default:qi(t,c,"scalar")}}function Hp(t,e){let r=e.indexOf(`
114
114
  `),n=e.substring(0,r),i=e.substring(r+1)+`
115
115
  `;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];tc(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
116
116
  `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function tc(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function qi(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Wr.createScalarToken=Bp;Wr.resolveAsScalar=Fp;Wr.setScalarValue=Kp});var ic=g(nc=>{"use strict";var Gp=t=>"type"in t?Dr(t):qr(t);function Dr(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Dr(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=qr(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=qr(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=qr(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function qr({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Dr(e)),r)for(let o of r)i+=o.source;return n&&(i+=Dr(n)),i}nc.stringify=Gp});var cc=g(ac=>{"use strict";var Di=Symbol("break visit"),Hp=Symbol("skip children"),oc=Symbol("remove item");function Re(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),sc(Object.freeze([]),t,e)}Re.BREAK=Di;Re.SKIP=Hp;Re.REMOVE=oc;Re.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Re.parentCollection=(t,e)=>{let r=Re.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function sc(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;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=sc(Object.freeze(t.concat([[i,s]])),o.items[s],r);if(typeof a=="number")s=a-1;else{if(a===Di)return Di;a===oc&&(o.items.splice(s,1),s-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}ac.visit=Re});var Mr=g(F=>{"use strict";var Mi=rc(),Yp=ic(),Jp=cc(),Fi="\uFEFF",Bi="",Ki="",Ui="",Vp=t=>!!t&&"items"in t,zp=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Xp(t){switch(t){case Fi:return"<BOM>";case Bi:return"<DOC>";case Ki:return"<FLOW_END>";case Ui:return"<SCALAR>";default:return JSON.stringify(t)}}function Qp(t){switch(t){case Fi:return"byte-order-mark";case Bi:return"doc-mode";case Ki:return"flow-error-end";case Ui:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
117
+ `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Wr.createScalarToken=Kp;Wr.resolveAsScalar=Bp;Wr.setScalarValue=Up});var ic=g(nc=>{"use strict";var Gp=t=>"type"in t?Dr(t):qr(t);function Dr(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Dr(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=qr(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=qr(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=qr(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function qr({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Dr(e)),r)for(let o of r)i+=o.source;return n&&(i+=Dr(n)),i}nc.stringify=Gp});var cc=g(ac=>{"use strict";var Di=Symbol("break visit"),Yp=Symbol("skip children"),oc=Symbol("remove item");function Re(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),sc(Object.freeze([]),t,e)}Re.BREAK=Di;Re.SKIP=Yp;Re.REMOVE=oc;Re.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Re.parentCollection=(t,e)=>{let r=Re.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function sc(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;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=sc(Object.freeze(t.concat([[i,s]])),o.items[s],r);if(typeof a=="number")s=a-1;else{if(a===Di)return Di;a===oc&&(o.items.splice(s,1),s-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}ac.visit=Re});var Mr=g(F=>{"use strict";var Mi=rc(),Jp=ic(),Vp=cc(),Fi="\uFEFF",Bi="",Ki="",Ui="",zp=t=>!!t&&"items"in t,Xp=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Qp(t){switch(t){case Fi:return"<BOM>";case Bi:return"<DOC>";case Ki:return"<FLOW_END>";case Ui:return"<SCALAR>";default:return JSON.stringify(t)}}function Zp(t){switch(t){case Fi:return"byte-order-mark";case Bi:return"doc-mode";case Ki:return"flow-error-end";case Ui:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
118
118
  `:case`\r
119
- `: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(t[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}F.createScalarToken=Mi.createScalarToken;F.resolveAsScalar=Mi.resolveAsScalar;F.setScalarValue=Mi.setScalarValue;F.stringify=Yp.stringify;F.visit=Jp.visit;F.BOM=Fi;F.DOCUMENT=Bi;F.FLOW_END=Ki;F.SCALAR=Ui;F.isCollection=Vp;F.isScalar=zp;F.prettyToken=Xp;F.tokenType=Qp});var Yi=g(uc=>{"use strict";var It=Mr();function J(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var lc=new Set("0123456789ABCDEFabcdef"),Zp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Fr=new Set(",[]{}"),em=new Set(` ,[]{}
121
- \r `),Gi=t=>!t||em.has(t),Hi=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,r=!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=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
119
+ `: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(t[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}F.createScalarToken=Mi.createScalarToken;F.resolveAsScalar=Mi.resolveAsScalar;F.setScalarValue=Mi.setScalarValue;F.stringify=Jp.stringify;F.visit=Vp.visit;F.BOM=Fi;F.DOCUMENT=Bi;F.FLOW_END=Ki;F.SCALAR=Ui;F.isCollection=zp;F.isScalar=Xp;F.prettyToken=Qp;F.tokenType=Zp});var Yi=g(uc=>{"use strict";var It=Mr();function J(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var lc=new Set("0123456789ABCDEFabcdef"),em=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Fr=new Set(",[]{}"),tm=new Set(` ,[]{}
121
+ \r `),Hi=t=>!t||tm.has(t),Gi=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,r=!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=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
122
122
  `?!0:r==="\r"?this.buffer[e+1]===`
123
123
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
124
124
  `||!i&&!this.atEnd)return e+n+1}return r===`
125
125
  `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&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(`
126
- `,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]===It.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let o=e[n-1];if(o===" "||o===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield It.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 r=this.peek(3);if((r==="---"||r==="...")&&J(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"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,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);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(Gi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield It.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(Gi),"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),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
126
+ `,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]===It.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let o=e[n-1];if(o===" "||o===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield It.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 r=this.peek(3);if((r==="---"||r==="...")&&J(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"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,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);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(Hi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield It.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(Hi),"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),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
127
127
  `,this.pos);if(i!==-1){for(;i!==-1;){let o=this.continueScalar(i+1);if(o===-1)break;i=n.indexOf(`
128
128
  `,o)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>J(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case`
129
129
  `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
@@ -133,21 +133,26 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
133
133
  `&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield It.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(J(o)||e&&Fr.has(o))break;r=n}else if(J(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===`
134
134
  `?(n+=1,i=`
135
135
  `,o=this.buffer[n+1]):r=n),o==="#"||e&&Fr.has(o))break;if(i===`
136
- `){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Fr.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield It.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(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(Gi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(J(n)||r&&Fr.has(n)){r?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,r=this.buffer[e];for(;!J(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(Zp.has(r))r=this.buffer[++e];else if(r==="%"&&lc.has(this.buffer[e+1])&&lc.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
136
+ `){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Fr.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield It.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(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(Hi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(J(n)||r&&Fr.has(n)){r?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,r=this.buffer[e];for(;!J(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(em.has(r))r=this.buffer[++e];else if(r==="%"&&lc.has(this.buffer[e+1])&&lc.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
137
137
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
138
- `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};uc.Lexer=Hi});var Vi=g(fc=>{"use strict";var Ji=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let o=r+n>>1;this.lineStarts[o]<e?r=o+1:n=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};fc.LineCounter=Ji});var Xi=g(gc=>{"use strict";var tm=Ht("process"),dc=Mr(),rm=Yi();function ye(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function pc(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function hc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Br(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ve(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Kr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function mc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ye(e.start,"explicit-key-ind")&&!ye(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,hc(e.value)?e.value.end?Kr(e.value.end,e.sep):e.value.end=e.sep:Kr(e.start,e.sep),delete e.sep)}var zi=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 rm.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,tm.env.LOG_TOKENS&&console.log("|",dc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=dc.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&mc(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&pc(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{pc(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=Br(this.peek(2)),n=Ve(r),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:n,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 r=this.source.indexOf(`
138
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};uc.Lexer=Gi});var Vi=g(fc=>{"use strict";var Ji=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let o=r+n>>1;this.lineStarts[o]<e?r=o+1:n=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};fc.LineCounter=Ji});var Xi=g(gc=>{"use strict";var rm=Gt("process"),dc=Mr(),nm=Yi();function ye(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function pc(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function hc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Br(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ve(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Kr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function mc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ye(e.start,"explicit-key-ind")&&!ye(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,hc(e.value)?e.value.end?Kr(e.value.end,e.sep):e.value.end=e.sep:Kr(e.start,e.sep),delete e.sep)}var zi=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 nm.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,rm.env.LOG_TOKENS&&console.log("|",dc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=dc.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&mc(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&pc(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{pc(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=Br(this.peek(2)),n=Ve(r),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:n,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 r=this.source.indexOf(`
139
139
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
140
140
  `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Kr(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;a<r.sep.length;++a){let c=r.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ye(r.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(hc(r.key)&&!ye(r.sep,"newline")){let s=Ve(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(ye(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=Ve(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):ye(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{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||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!ye(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Kr(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||ye(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Br(n),o=Ve(i);mc(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 r=this.source.indexOf(`
141
141
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
142
- `,r)+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 r=Br(e),n=Ve(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Br(e),n=Ve(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};gc.Parser=zi});var kc=g(Lt=>{"use strict";var wc=Wi(),nm=Pt(),jt=At(),im=Ln(),om=_(),sm=Vi(),yc=Xi();function bc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new sm.LineCounter||null,prettyErrors:e}}function am(t,e={}){let{lineCounter:r,prettyErrors:n}=bc(e),i=new yc.Parser(r?.addNewLine),o=new wc.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(jt.prettifyError(t,r)),a.warnings.forEach(jt.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function vc(t,e={}){let{lineCounter:r,prettyErrors:n}=bc(e),i=new yc.Parser(r?.addNewLine),o=new wc.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new jt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(jt.prettifyError(t,r)),s.warnings.forEach(jt.prettifyError(t,r))),s}function cm(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=vc(t,r);if(!i)return null;if(i.warnings.forEach(o=>im.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:n},r))}function lm(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return om.isDocument(t)&&!n?t.toString(r):new nm.Document(t,n,r).toString(r)}Lt.parse=cm;Lt.parseAllDocuments=am;Lt.parseDocument=vc;Lt.stringify=lm});var ze=g(P=>{"use strict";var um=Wi(),fm=Pt(),dm=wi(),Qi=At(),pm=ut(),be=_(),mm=me(),hm=A(),gm=ge(),wm=we(),ym=Mr(),bm=Yi(),vm=Vi(),km=Xi(),Ur=kc(),Cc=st();P.Composer=um.Composer;P.Document=fm.Document;P.Schema=dm.Schema;P.YAMLError=Qi.YAMLError;P.YAMLParseError=Qi.YAMLParseError;P.YAMLWarning=Qi.YAMLWarning;P.Alias=pm.Alias;P.isAlias=be.isAlias;P.isCollection=be.isCollection;P.isDocument=be.isDocument;P.isMap=be.isMap;P.isNode=be.isNode;P.isPair=be.isPair;P.isScalar=be.isScalar;P.isSeq=be.isSeq;P.Pair=mm.Pair;P.Scalar=hm.Scalar;P.YAMLMap=gm.YAMLMap;P.YAMLSeq=wm.YAMLSeq;P.CST=ym;P.Lexer=bm.Lexer;P.LineCounter=vm.LineCounter;P.Parser=km.Parser;P.parse=Ur.parse;P.parseAllDocuments=Ur.parseAllDocuments;P.parseDocument=Ur.parseDocument;P.stringify=Ur.stringify;P.visit=Cc.visit;P.visitAsync=Cc.visitAsync});import ve from"path";function Om(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||ve.posix.isAbsolute(r)||ve.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let n=r.replaceAll("\\","/").split("/");if(n.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(n.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return n}function Gr(t){let e=Om(t,"native.artifact_root");return e.length===0?".":e.join("/")}function xc(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Qe(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim().replaceAll("\\","/");if(n.length===0||ve.posix.isAbsolute(n)||ve.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be relative to its declared path base`);let i=n.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(!r&&/[*?]/u.test(n))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function ie(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Oc(t,e,r){let n=t??e;if(n!=="en"&&n!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return n}function Ac(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>to)throw new Error(`${e} exceeds ${to} characters`);let r=0;for(let n=0;n<t.length;n+=1)t[n]==="?"?r+=1:t[n]==="*"&&(r+=1,t[n+1]==="*"&&(n+=1));if(r>ro)throw new Error(`${e} contains more than ${ro} wildcard tokens`);return t}function Pc(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(n=>Ac(n,e)))].sort((n,i)=>n.localeCompare(i,"en"))}function eo(t,e,r){let n=t??e;if(!Number.isSafeInteger(n)||n<1)throw new Error(`${r} must be a positive integer`);return n}function Am(t){if(t===void 0)return{...ne,include:[...ne.include],exclude:[...ne.exclude]};let e=ie(t,"native.snapshot");return{include:Pc(e.include,"native.snapshot.include",ne.include),exclude:Pc(e.exclude,"native.snapshot.exclude",ne.exclude),max_files:eo(e.max_files,ne.max_files,"native.snapshot.max_files"),max_total_bytes:eo(e.max_total_bytes,ne.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:eo(e.max_duration_ms,ne.max_duration_ms,"native.snapshot.max_duration_ms")}}function Nm(t){if(t===void 0)return;let e=ie(t,"native.pending_root_move"),r=e.id,n=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof n!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=ie(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:r,fromArtifactRoot:Gr(n),toArtifactRoot:Gr(i),stage:o,...s?{cleanup:s}:{}}}function Rm(t){if(t===void 0)return;let e=ie(t,"native.finish");if(e.pull_request===void 0)return{};let r=ie(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let n=r.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(ve.posix.isAbsolute(n[0])||ve.win32.isAbsolute(n[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=r.timeout_ms??Em;if(!Number.isSafeInteger(i)||i<1||i>_c)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${_c}`);return{pull_request:{provider:"repository-command",command:n,timeout_ms:i}}}function Tm(t,e={}){let r=ie(t,"native"),n=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof n!="string")throw new Error("native.artifact_root must be a string");let i=r.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=r.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=r.max_verify_failures??Cm;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Nm(r.pending_root_move),c=Rm(r.finish);return{artifact_root:Gr(n),language:Oc(r.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,snapshot:Am(r.snapshot),...c?{finish:c}:{},...a?{pending_root_move:a}:{}}}function Im(t){let e=ie(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let n=e.review_mode??"standard";if(n!=="off"&&n!=="standard"&&n!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:xc(e.artifact_layout),language:Oc(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:n,auto_transition:i}}function jm(t){let r=ie(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((n,i)=>Qe(n,`hook.allow_paths[${i}]`)))]}}function Lm(t){if(t===void 0)return{...Zi};let e=ie(t,"memory"),r=e.learning??Zi.learning,n=e.retrieval??Zi.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof n!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:n}}function io(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function $m(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||ve.posix.isAbsolute(r)||ve.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(i=>i===""||i==="."||i===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>Sc)throw new Error(`${e} exceeds ${Sc} characters`);let n=0;for(let i=0;i<r.length;i+=1)r[i]==="?"?n+=1:r[i]==="*"&&(n+=1,r[i+1]==="*"&&(i+=1));if(n>Ec)throw new Error(`${e} contains more than ${Ec} wildcard tokens`);return r}function Wm(t){let r=io(t,"knowledge.local").include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(r.map((n,i)=>$m(n,`knowledge.local.include[${i}]`)))]}}function qm(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),n=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&n))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Dm(t){let e=io(t,"knowledge.remote"),r=qm(e.endpoint),n=e.token_env;if(n!==void 0&&(typeof n!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(n)))throw new Error("knowledge.remote.token_env must be an environment variable name");let i=e.scope;if(i!==void 0&&(typeof i!="string"||i.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let o=e.timeout_ms??5e3;if(typeof o!="number"||!Number.isSafeInteger(o)||o<100||o>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...n===void 0?{}:{token_env:n},...i===void 0?{}:{scope:i},timeout_ms:o}}function Mm(t){if(t===void 0)return{...Sm};let e=io(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let n=e.local===void 0?void 0:Wm(e.local);if(r==="local")return{provider:r,...n?{local:n}:{}};let i=e.remote===void 0?void 0:Dm(e.remote);if(i===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...n?{local:n}:{},remote:i}}function Fm(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Bm(t,e,r,n,i,o,s,a){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.allowPartialProject&&!c)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let u=t.workflows??[t.default_workflow];if(!Array.isArray(u)||u.length===0||u.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let f=[...new Set(u)];if(!f.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(f.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:f,ambient_resume:s,...e?{hook:e}:{},memory:r,knowledge:n,...i?{native:i}:{},...o?{classic:o}:{}}}function Ze(t,e={}){let r=(0,no.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let n=r.toJS();if(n==null)return{value:{},config:null,ambient_resume:!0};if(typeof n!="object"||Array.isArray(n))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=n,o=Fm(i.ambient_resume),s=i.hook===void 0?void 0:jm(i.hook),a=Lm(i.memory),c=Mm(i.knowledge),l=i.native===void 0?void 0:Tm(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),u=i.classic===void 0?void 0:Im(i.classic),f=Bm(i,s,a,c,l,u,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:f,ambient_resume:o,memory:a,knowledge:c,...s?{hook:s}:{},...l?{native:l}:{},...u?{classic:u}:{}}}var no,Xe,to,ro,Sc,Ec,Cm,Zi,Sm,Em,_c,_m,Pm,xm,ne,oe=T(()=>{"use strict";no=it(ze(),1),Xe=64*1024,to=1024,ro=64,Sc=1024,Ec=64,Cm=5,Zi={learning:!0,retrieval:!0},Sm={provider:"local"},Em=12e4,_c=6e5,_m=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".devin/skills/**",".dsh/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".grok/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".omp/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],Pm=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],xm=[..._m,...Pm].sort((t,e)=>t.localeCompare(e,"en")),ne={include:["**/*"],exclude:[...xm],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function ke(t){return t!==0&&t!==0n&&t!=="0"}function Nc(t,e){return ke(t.dev)&&ke(e.dev)&&ke(t.ino)&&ke(e.ino)}function Ce(t,e){let r=ke(t.dev)&&ke(e.dev);if(r&&t.dev!==e.dev)return!1;let n=ke(t.ino)&&ke(e.ino);return n&&t.ino!==e.ino?!1:r&&n?!0:t.birthtime===e.birthtime}var Hr=T(()=>{"use strict"});import{constants as Yr,promises as Te}from"fs";function oo(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Rc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function $t(t){return{dev:t.dev,ino:t.ino,birthtime:oo(t)}}function Jr(t,e){let r=$t(t),n=$t(e);return Nc(r,n)?Ce(r,n):Ce(r,n)&&oo(t)===oo(e)&&Rc(t)===Rc(e)&&t.size===e.size}async function Vr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let n=r.label??"file",i=r.bigint===!0,o=await Te.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new Se("not-regular-file",`${n} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new Se("too-large",`${n} exceeds ${e} bytes`);let s=await Te.realpath(t);await r.verify?.("pre-open",{realPath:s,identity:$t(o)});let a=process.platform==="win32"?Yr.O_RDONLY:Yr.O_RDONLY|Yr.O_NOFOLLOW|Yr.O_NONBLOCK,c;try{c=await Te.open(t,a)}catch(l){throw l.code==="ELOOP"?new Se("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:i}),Te.lstat(t,{bigint:i}),Te.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!Jr(o,l)||!Jr(o,u))throw new Se("changed",`${n} changed while opening`);await r.verify?.("post-open",{realPath:f,identity:$t(l)}),await r.hooks?.afterOpen?.();let d=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let v=e+1-h,{bytesRead:k}=await c.read(w,0,Math.min(w.length,v),null);if(k===0)break;if(h+=k,h>e)throw new Se("too-large",`${n} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,m,y]=await Promise.all([c.stat({bigint:i}),Te.lstat(t,{bigint:i}),Te.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||y!==s||!Jr(o,p)||!Jr(o,m))throw new Se("changed",`${n} changed while reading`);return await r.verify?.("post-read",{realPath:y,identity:$t(p)}),{bytes:Buffer.concat(d,h),stat:p,realPath:y}}finally{await c.close()}}var Se,so=T(()=>{"use strict";Hr();Se=class extends Error{reason;constructor(e,r,n){super(r,n),this.name="RaceSafeReadError",this.reason=e}}});import{promises as zr}from"fs";import Ee from"path";function Km(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ao(t,e){let r=Ee.relative(t,e);return r===""||!Ee.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ee.sep}`)}async function Tc(t,e){let r=Ee.resolve(t),n=await zr.lstat(r);if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return zr.realpath(r)}async function Ic(t,e,r,n){let i=t;for(let o=0;o<r.length;o++){i=Ee.join(i,r[o]);let s;try{s=await zr.lstat(i)}catch(u){if(Km(u))return{exists:!1,kind:"missing"};throw u}let a=Ee.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${a}`);let c=o===r.length-1;if(!c&&!s.isDirectory())throw new Error(`${n.label} ancestor ${a} must be a real directory`);if(c&&(n.expected==="file"&&!s.isFile()||n.expected==="directory"&&!s.isDirectory()||n.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${n.label} must be a real ${n.expected}`);let l=await zr.realpath(i);if(!ao(e,l))throw new Error(`${n.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function W(t,e,r){let n=Qe(e,r.label),i=Ee.resolve(t),o=await Tc(i,r.label),s=n.split("/"),a=Ee.resolve(i,...s);if(!ao(i,a))throw new Error(`${r.label} must stay inside the project root`);let c=await Ic(i,o,s,r);return{projectRoot:i,target:a,relative:n,exists:c.exists,kind:c.kind}}async function U(t,e,r,n){let i=await W(t,e,{label:n.label,expected:"file"});if(!i.exists){let s=new Error(`${n.label} does not exist`);throw s.code="ENOENT",s}let o=await Tc(i.projectRoot,n.label);return Vr(i.target,r,{...n,verify:async(s,a)=>{if(!ao(o,a.realPath))throw new Error(`${n.label} resolves outside the project root`);await Ic(i.projectRoot,o,i.relative.split("/"),{label:n.label,expected:"file"})}})}var V=T(()=>{"use strict";so();oe()});import{createHash as Um}from"crypto";function Gm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function qt(t,e={}){return(await Xr(t,e)).document}async function Hm(t){try{return(await U(t,Wt,Xe,{label:Wt})).bytes}catch(e){if(Gm(e))return null;throw e}}function Ym(t){return t?{exists:!0,sha256:Um("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Xr(t,e={}){let r=await Hm(t);return{document:r?Ze(r.toString("utf8"),e):null,identity:Ym(r)}}async function co(t){return(await qt(t))?.config??null}var Wt,Ie=T(()=>{"use strict";oe();V();Wt=".comet/config.yaml"});import{randomUUID as Jm}from"crypto";import{constants as Vm,promises as O}from"fs";import L from"path";async function lo(t,e){try{return await O.link(t,e),{linked:!0}}catch(r){let n=r.code;if(n!=="ENOTSUP"&&n!=="EOPNOTSUPP")throw r}return await O.copyFile(t,e,Vm.COPYFILE_EXCL),{linked:!1}}function je(t,e){let r=L.relative(t,e);return r===""||!L.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${L.sep}`)}function Qr(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function zm(t,e){return Ce(t,Qr(e))}function Zr(t,e){return Ce(Qr(t),Qr(e))}function jc(t,e){return Zr(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function en(t){let e=await O.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await O.realpath(t),...Qr(e)}}async function se(t){for(let e of t){let r=await O.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!zm(e,r)||await O.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Xm(t,e,r){let[n,i]=await Promise.all([O.lstat(t),O.realpath(t),se(r)]);if(!n.isFile()||n.isSymbolicLink()||!Zr(n,e)||!je(r[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return n}async function Qm(t,e){let r=L.resolve(t),n=L.resolve(e);if(!je(r,n))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await en(r)],o=L.relative(r,n).split(L.sep).filter(Boolean),s=r;for(let a of o){await se(i),s=L.join(s,a);try{await O.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await en(s);if(!je(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(c)}return await se(i),i}async function Zm(t,e){let r=L.resolve(t),n=L.resolve(e);if(!je(r,n))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await en(r)],o=L.relative(r,n).split(L.sep).filter(Boolean),s=r;for(let a of o){s=L.join(s,a);try{let c=await en(s);if(!je(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await se(i),i}async function Lc(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(r){let n=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(n??""))throw r}finally{await e?.close()}}async function eh(t,e,r){let n=L.dirname(t),i=await Qm(r.containedRoot,n),o=L.join(n,`.${L.basename(t)}.${Jm()}.tmp`),s,a,c;try{await r.beforeTemporaryOpen?.(),s=await O.open(o,"wx"),a=await s.stat();let[l,u]=await Promise.all([O.lstat(o),O.realpath(o)]);if(await se(i),!l.isFile()||l.isSymbolicLink()||!Zr(a,l)||!je(i[0].realPath,u))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(),c=await s.stat(),!Zr(a,c))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await Xm(o,c,i),await r.beforeCommit?.(),await se(i);let f=await O.lstat(o);if(!f.isFile()||f.isSymbolicLink()||!c||!jc(f,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await lo(o,t),await O.unlink(o)):await O.rename(o,t),await Lc(n)}catch(l){await s?.close();try{await se(i),await O.rm(o,{force:!0})}catch{}throw l}}async function z(t,e,r){await eh(t,e,r)}async function uo(t,e){let r=L.dirname(t),n=await Zm(e.containedRoot,r);if(!n)return!1;let i,o;try{i=await O.lstat(t),o=await O.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!je(n[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await se(n);let[s,a]=await Promise.all([O.lstat(t),O.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!jc(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await O.unlink(t),await se(n),await Lc(r),!0}var ae=T(()=>{"use strict";Hr()});var Ty,fo=T(()=>{"use strict";ae();Ie();V();Ty=16*1024});var tn=T(()=>{"use strict";ae();oe();Ie();V();fo()});import q from"path";function Gc(t,e){let r=q.relative(t,e);return r===""||!q.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${q.sep}`)}function wh(t,e){let r=q.isAbsolute(e)?q.resolve(e):q.resolve(t,e),n=q.relative(q.resolve(t),r);return n===""||q.isAbsolute(n)||n===".."||n.startsWith(`..${q.sep}`)?null:n.replaceAll("\\","/")}function Hc(t){return process.platform==="win32"?t.toLowerCase():t}async function yo(t,e,r=[]){let n=q.isAbsolute(e)?q.resolve(e):q.resolve(t,e),i=q.resolve(t);if(!Gc(i,n)||r.some(c=>Gc(q.resolve(c),n)))return null;let o=wh(t,e);if(!o)return null;let a=(await gh(t)).allow_paths.find(c=>{let l=Hc(o),u=Hc(c);return l===u||l.startsWith(`${u}/`)});return a?`${o} (configured Hook allow path: ${a})`:null}var gh,bo=T(()=>{"use strict";ot();Ie();gh=_e("hookWritePolicy",async t=>(await co(t))?.hook??{allow_paths:[]})});var an=T(()=>{"use strict"});var Zc=T(()=>{"use strict"});var Co=T(()=>{"use strict";an()});var el=T(()=>{"use strict";an();Co()});var Wh,tl=T(()=>{"use strict";Wh=it(ze(),1);ae();oe();V()});var Lb,rl=T(()=>{"use strict";ae();V();Lb=4*1024*1024});var nl=T(()=>{"use strict";an();ae();Zc();el();oe();tl();V();Ie();tn();rl();bo();fo();Co()});import{TextDecoder as qh}from"util";function il(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Dh(t,e){try{return new qh("utf-8",{fatal:!0}).decode(t.bytes)}catch(r){throw new Error(`${e} is not valid UTF-8`,{cause:r})}}async function So(t,e,r,n,i={}){try{let o=await U(t,e,r,{label:n,hooks:i.hooks});return{result:o,text:Dh(o,n)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function ol(t,e,r,n,i={}){return(await So(t,e,r,n,i))?.text??null}async function sl(t,e,r,n,i,o={}){if(Buffer.byteLength(r,"utf8")>n)throw new Error(`${i} exceeds ${n} bytes`);let s=await So(t,e,n,i),a=await W(t,e,{label:i,expected:"file"});await z(a.target,r,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await So(t,e,n,i);if(!(!s&&!c)){if(!s||!c)throw new Error(`${i} changed before commit`);if(s.result.realPath!==c.result.realPath||!Ce(il(s.result.stat),il(c.result.stat))||s.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function al(t,e,r,n={}){let i=await W(t,e,{label:r,expected:"file"});return i.exists?uo(i.target,{containedRoot:i.projectRoot,beforeRemove:n.beforeRemove}):!1}var cl=T(()=>{"use strict";nl();Hr()});var pl={};Ul(pl,{RUN_STATE_FILE:()=>ln,applyRunStateToDocument:()=>ul,readRunState:()=>Eo,removeRunState:()=>dl,runStateFromDocument:()=>cn,writeRunState:()=>_o});import Mh from"path";function Bt(t,e){let r=t[e];if(typeof r!="string"||r.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return r}function Ft(t,e){let r=Bt(t,e);if(Mh.isAbsolute(r)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return r}function Fh(t){let e=t.run_retries??"{}",r;try{r=typeof e=="string"?JSON.parse(e):e}catch(n){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:n})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let n of Object.values(r))if(!Number.isInteger(n)||Number(n)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return r}function cn(t){if(!t.run_id)return null;let e=Bt(t,"run_id"),r=Bt(t,"skill"),n=Bt(t,"skill_version"),i=Bt(t,"skill_hash"),o=Ft(t,"pending_ref"),s=Ft(t,"trajectory_ref"),a=Ft(t,"context_ref"),c=Ft(t,"artifacts_ref"),l=Ft(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:r,skillVersion:n,skillHash:i,orchestration:t.orchestration,currentStep:ll(t,"current_step"),iteration:u,pending:ll(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:Fh(t)}}function ul(t,e){e?t.run_id=e.runId:delete t.run_id}function Bh(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function Kh(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return cn(e)}async function Eo(t,e={}){let r=await ol(t,ln,fl,"Run state",e);if(r===null)return null;let n=JSON.parse(r);return Kh(n)}async function _o(t,e,r={}){await sl(t,ln,JSON.stringify(Bh(e),null,2),fl,"Run state",r)}async function dl(t,e={}){await al(t,ln,"Run state",e)}var ll,ln,fl,un=T(()=>{"use strict";cl();ll=(t,e)=>{let r=t[e];return r==null?null:String(r)};ln=".comet/run-state.json",fl=256*1024});import{promises as hn,readFileSync as mg}from"fs";import K from"path";function To(t){return t.charCodeAt(0)===65279?t.slice(1):t}ot();import{promises as ih}from"fs";import B from"path";import{promises as Hl}from"fs";async function yn(t){try{return await Hl.access(t),!0}catch(e){if(Yl(e))return!1;throw e}}function Yl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}oe();Ie();tn();V();var et=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},qc=".comet/config.yaml";function oh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function sh(t){await W(t,qc,{label:qc,expected:"file"})}function mo(t,e){let r=B.resolve(t),n=e==="docs"?B.join(r,"docs"):r,i=B.join(n,"openspec"),o=B.join(r,"docs","superpowers");return{projectRoot:r,artifactLayout:e,openSpecBase:n,openSpecRoot:i,changesDir:B.join(i,"changes"),archiveDir:B.join(i,"changes","archive"),specsDir:B.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:B.join(o,"specs"),superpowersPlansDir:B.join(o,"plans"),superpowersReportsDir:B.join(o,"reports")}}async function Mc(t){await sh(t);let e=await qt(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new et;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new et("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function ah(t,e){return mo(t,e??await Mc(t))}async function ch(t){try{return await ih.lstat(t),!0}catch(e){if(oh(e))return!1;throw e}}async function lh(t,e){let r=await ah(t,e),n=r.artifactLayout==="legacy"?"docs":"legacy",i=mo(t,n).openSpecRoot,[o,s]=await Promise.all([W(r.projectRoot,$(r.projectRoot,r.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),ch(i)]),a=o.exists;return{paths:r,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function uh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let r of e){let n=$(t.projectRoot,r);await W(t.projectRoot,n,{label:`Classic managed physical path ${n}`,expected:"directory"})}}async function Le(t,e){let r=await lh(t,e);if(await uh(r.paths),!r.configuredRootExists){let n=$(r.paths.projectRoot,r.paths.openSpecRoot),i=$(r.paths.projectRoot,r.alternateRoot);throw new et(`Configured Classic OpenSpec root is missing: ${n} (alternate ${i} is ${r.alternateRootExists?"present":"missing"})`)}return r.paths}async function ho(t,e){let r=B.join(B.resolve(t),".comet","classic-root-move.json");if(await yn(r))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let n=await Le(t,e);if(!await yn(n.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${$(n.projectRoot,n.openSpecRoot)}`);return n}function $(t,e){return B.relative(B.resolve(t),e).replaceAll("\\","/")}import Bc from"path";ae();oe();V();import Dt from"path";var Zy=2*1024*1024;function dh(t,e,r){let n=Dt.resolve(t),i=Dt.isAbsolute(e)?Dt.resolve(e):Dt.resolve(n,e),o=Dt.relative(n,i).replaceAll("\\","/");return{root:n,relative:Qe(o,r),target:i}}async function tt(t,e,r){let n=dh(t,e,r.label);return W(n.root,n.relative,r)}async function Fc(t,e,r){return(await tt(t,e,{label:r.label,expected:r.expected??"any"})).exists}function go(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
143
- Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function rn(t){let e=go(t);if(e)throw new Error(e)}function ph(t,e){return{label:$(t,e),directory:e}}async function mh(t,e,r){let n=ph(t,e);if(!(await tt(t,e,{label:r,expected:"directory"})).exists)return{change:n,exists:!1,stateExists:!1};let o=await tt(t,Bc.join(e,".comet.yaml"),{label:`${r} state`,expected:"file"});return{change:n,exists:!0,stateExists:o.exists}}async function rt(t,e=process.cwd()){rn(t);let r=await Le(e),n=await mh(r.projectRoot,Bc.join(r.changesDir,t),`Classic active change ${t}`);return{...n.change,exists:n.exists,stateExists:n.stateExists}}import{promises as wo}from"fs";import G from"path";function Kc(t,e){let r=G.relative(t,e);return r===""||r!==".."&&!r.startsWith(`..${G.sep}`)&&!G.isAbsolute(r)}async function hh(t){let e=G.resolve(t),r=G.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await wo.realpath(i);return G.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(G.basename(i)),i=G.dirname(i)}try{let o=await wo.realpath(r);return G.join(o,...n.reverse())}catch{return null}}async function Uc(t,e){let r=G.resolve(t),n=await wo.realpath(r),i=[],o=[];for(let s of e){let a=G.isAbsolute(s)?G.resolve(s):G.resolve(r,s),c=await hh(a);((c?Kc(n,c):Kc(r,a))?i:o).push(s)}return{projectTargets:i,externalTargets:o}}bo();var vo=it(ze(),1);ot();import{execFileSync as Yc}from"child_process";import{randomUUID as yh}from"crypto";import{promises as Mt}from"fs";import Jc from"path";function bh(t){try{let e=Yc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0}).trim();return e&&e!=="HEAD"?e:null}catch{return null}}var vh=wn("liveGitBranch",t=>bh(t));function kh(t){try{return Yc("git",["rev-parse","--is-inside-work-tree"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0}).trim()==="true"}catch{return!1}}var Ch=wn("isGitWorkTree",t=>kh(t)),Sh=["current","branch","worktree"];function Vc(t){return Sh.includes(t)}function Eh(t){return Vc(t.isolation)?t.boundBranch===null&&t.currentBranch===null&&t.gitWorkTree===!1?{status:"not-applicable"}:t.boundBranch===null?t.currentBranch===null?{status:"unbound-detached"}:{status:"needs-heal",branch:t.currentBranch}:t.currentBranch===t.boundBranch?{status:"ok"}:{status:"drift",boundBranch:t.boundBranch,currentBranch:t.currentBranch}:{status:"not-applicable"}}async function nn(t,e){let r=Jc.join(t,".comet.yaml"),n=(0,vo.parseDocument)(await Mt.readFile(r,"utf8"),{uniqueKeys:!1});if(n.errors.length>0)throw new Error(`Invalid .comet.yaml: ${n.errors[0].message}`);let i=n.toJS()??{},o=typeof i.isolation=="string"?i.isolation:null,s=typeof i.bound_branch=="string"&&i.bound_branch!==""?i.bound_branch:null,a=Vc(o),c=vh(e.cwd),l=a&&s===null&&c===null?Ch(e.cwd):!0,u=Eh({isolation:o,boundBranch:s,currentBranch:c,gitWorkTree:l});return u.status==="needs-heal"&&e.heal?(await _h(t,u.branch),{status:"healed",branch:u.branch,bindingRequired:a,currentBranch:c}):{...u,bindingRequired:a,currentBranch:c}}async function _h(t,e){let r=Jc.join(t,".comet.yaml"),n=(0,vo.parseDocument)(await Mt.readFile(r,"utf8"),{uniqueKeys:!1});n.set("bound_branch",e);let i=`${r}.${yh()}.tmp`;try{await Mt.writeFile(i,n.toString(),"utf8"),await Mt.rename(i,r)}catch(o){throw await Mt.rm(i,{force:!0}),o}}function Ph(t){return t??"detached HEAD"}function on(t,e,r){return`change '${t}' is bound to branch '${e}', but current branch is '${Ph(r)}'`}function sn(t){return`change '${t}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`}so();import xh from"path";var ko="comet.selection.v2",Oh=16*1024;function Xc(t){return xh.join(t,".comet","current-change.json")}function Ah(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function zc(t){return t===null||typeof t=="string"}function Nh(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error(`current change selection contains invalid JSON: ${r instanceof Error?r.message:String(r)}`,{cause:r})}if(!Ah(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!zc(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:ko,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==ko)throw new Error(`current change selection schema must be ${ko}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!zc(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function Qc(t){let e;try{let n=Xc(t),{bytes:i}=await Vr(n,Oh,{label:"current change selection"});e=i.toString("utf8")}catch(n){if(n.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{status:"selected",...Nh(e)}}ot();var pn=it(ze(),1);ae();V();import dn from"path";un();var xo=["full","hotfix","tweak"],ml=1,gl=["open","design","build","verify","archive"],Uh=["en","zh-CN"],Gh=["off","beta"],Hh=["subagent-driven-development","executing-plans","direct"],Yh=["plan-ready"],Jh=["confirmed"],Vh=["tdd","direct"],zh=["off","standard","thorough"],Xh=["current","branch","worktree"],Qh=["light","full"],Zh=["pending","pass","fail"],eg=["pending","handled"],tg=["pending","confirmed"],Oo=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],rg=["run_id"],wl=new Set([...Oo,...rg]),ng=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function hl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function nt(t,e){let r=t[e];if(r==null||r==="")return null;if(typeof r!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return r}function D(t,e,r,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!r.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${r.join(", ")}${n?" or null":""}`);return i}function Po(t,e,r=!0){let n=t[e];if(n==null||n===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof n!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return n}function ig(t,e,r=0){let n=t[e];if(n==null||n==="")return r;if(typeof n!="number"||!Number.isInteger(n)||n<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return n}function fn(t,e){let r=nt(t,e);if(r===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return r}function og(t,e){let r=nt(t,e);if(r!==null&&!/^[a-f0-9]{64}$/u.test(r))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return r}function sg(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==ml)throw new Error(`Invalid Classic state: classic_migration must be ${ml}`);return e}function ag(t){if(!Oo.some(r=>hl(t,r)))return null;for(let r of ng)if(!hl(t,r))return null;return{workflow:D(t,"workflow",xo,!1),language:D(t,"language",Uh),phase:D(t,"phase",gl,!1),contextCompression:D(t,"context_compression",Gh),buildMode:D(t,"build_mode",Hh),buildPause:D(t,"build_pause",Yh),subagentDispatch:D(t,"subagent_dispatch",Jh),tddMode:D(t,"tdd_mode",Vh),reviewMode:D(t,"review_mode",zh),isolation:D(t,"isolation",Xh),boundBranch:nt(t,"bound_branch"),verifyMode:D(t,"verify_mode",Qh),autoTransition:Po(t,"auto_transition"),baseRef:nt(t,"base_ref"),designDoc:fn(t,"design_doc"),plan:fn(t,"plan"),verifyResult:D(t,"verify_result",Zh,!1),verifyFailures:ig(t,"verify_failures"),verificationReport:fn(t,"verification_report"),branchStatus:D(t,"branch_status",eg),createdAt:nt(t,"created_at"),verifiedAt:nt(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",tg),archived:Po(t,"archived",!1),directOverride:Po(t,"direct_override"),handoffContext:fn(t,"handoff_context"),handoffHash:og(t,"handoff_hash"),classicProfile:D(t,"classic_profile",xo),classicMigration:sg(t)}}function yl(t,e){let r=e??null;if(r===null&&e===void 0&&t.run_id&&t.skill)try{r=cn(t)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:n})}return{classic:ag(t),run:r,unknownKeys:Object.keys(t).filter(n=>!wl.has(n))}}function bl(t){let e=t.workflow,r=t.phase,n=t.archived,i=t.design_doc;return{workflow:typeof e=="string"&&xo.includes(e)?e:null,phase:typeof r=="string"&&gl.includes(r)?r:null,archived:n===!0,designDoc:typeof i=="string"&&i!==""?i:null,unknownKeys:Object.keys(t).filter(o=>!wl.has(o))}}un();var cg=2*1024*1024;function Kt(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function lg(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let r of e)t.delete(r)}function ug(t){let e=!1;for(let r of["build_command","verify_command"])t.has(r)&&(t.delete(r),e=!0);return e}async function vl(t){let e;try{e=(await U(dn.dirname(t),dn.basename(t),cg,{label:"Classic state document"})).bytes.toString("utf8")}catch(n){if(n.code!=="ENOENT")throw n;return new pn.Document({})}let r=(0,pn.parseDocument)(e);if(r.errors.length>0)throw new Error(`Invalid Classic state document: ${r.errors[0].message}`);return Kt(r),r}async function mn(t,e={}){let r=e.migrate!==!1,n=dn.join(t,".comet.yaml"),i=await vl(n),o=Kt(i),s=ug(i);s&&(o=Kt(i));let a=await Eo(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(un(),pl));a=c(o),a&&r&&(await _o(t,a),lg(i),s=!0)}return s&&r&&await z(n,i.toString(),{containedRoot:t}),yl(Kt(i),a)}async function kl(t){let e=await vl(dn.join(t,".comet.yaml"));return bl(Kt(e))}var fg=it(ze(),1);var qv=8*1024*1024;Ie();tn();V();oe();ae();var dg=_e("readCometCurrentSelection",t=>Qc(t));async function pg(t,e){rn(e);let r=await rt(e,t);if(!r.stateExists)throw new Error(`Cannot select current change '${e}': active change state not found`);let n=await mn(r.directory,{migrate:!1});if(!n.classic)throw new Error(`Cannot select current change '${e}': Classic state is incomplete`);if(n.classic.archived)throw new Error(`Cannot select current change '${e}': change is archived`);return r.directory}async function Cl(t){let e;try{e=await dg(t)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}if(e.status==="missing")return{status:"missing"};if(e.selection.workflow!=="classic")return{status:"stale",reason:`current change '${e.selection.change}' belongs to Native, not Classic`};let r=e.selection,n;try{n=await pg(t,r.change)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}let i=await nn(n,{heal:!1,cwd:t});return i.status==="drift"?{status:"stale",reason:on(r.change,i.boundBranch,i.currentBranch)}:i.status==="unbound-detached"?{status:"stale",reason:sn(r.change)}:i.status==="ok"?{status:"selected",selection:r}:r.branch!==null&&i.currentBranch!==r.branch?{status:"stale",reason:`current change '${r.change}' was selected on branch '${r.branch}', current branch is '${i.currentBranch??"detached HEAD"}'`}:{status:"selected",selection:r}}function Ao(t){return t==="zh-CN"?"zh-CN":"en"}function Sl(t,e,r){return t==="zh-CN"?r:e}function El(t,e){let n={open:{en:"Source code edits are paused while the request is still being clarified.",zh:"需求仍在澄清中,暂时不修改源代码。"},design:{en:"Source code edits are paused until the design is agreed and recorded.",zh:"方案确定并记录之前,暂不修改源代码。"},build:{en:"A required design or plan record is missing, so source edits stay paused.",zh:"缺少必需的设计或计划记录,源代码修改暂被搁置。"},verify:{en:"Implementation edits are paused during verification; only verification output is accepted.",zh:"验证期间暂停修改实现,仅接受验证产出。"},archive:{en:"Source code edits are paused while the change is being archived.",zh:"归档期间暂不修改源代码。"}}[t]??{en:"This write is paused by the current workflow stage.",zh:"当前工作流阶段暂不允许这次写入。"};return{summary:Sl(e,"This write was blocked on purpose, not by an error.","这次写入是被有意拦下的,不是发生了错误。"),user_message:Sl(e,n.en,n.zh)}}import $e from"node:path";async function _l(t,e){if(!e||e==="null")return{status:"missing",recordedPath:null};let r=await Le(t),n=$e.resolve(t,e),i=$e.relative(r.superpowersPlansDir,n);return $e.isAbsolute(e)||!i||i.startsWith(`..${$e.sep}`)||$e.isAbsolute(i)||i.includes($e.sep)||$e.extname(i).toLowerCase()!==".md"?{status:"broken",recordedPath:e}:await Fc(t,e,{label:`Classic build plan ${e}`,expected:"file"})?{status:"ready",recordedPath:e}:{status:"broken",recordedPath:e}}function ee(t,e){return{exitCode:t,stderr:e+`
144
- `}}function X(t){return ee(0,`[COMET-HOOK] allowed: ${t}`)}function hg(){if(process.env.FILE_PATH)return process.env.FILE_PATH;if(process.stdin.isTTY)return"";let t=To(mg(0,"utf8"));if(!t)return"";try{let e=JSON.parse(t);return typeof e.tool_input?.file_path=="string"?e.tool_input.file_path:""}catch{return""}}function Gt(t){return t.replaceAll("\\","/").replace(/\/+/gu,"/")}function We(t){let e=Gt(t);return process.platform==="win32"?e.toLowerCase():e}function gg(t){let e=t.indexOf("--project-root"),r=e>=0?t[e+1]:void 0;return K.resolve(r&&!r.startsWith("--")?r:process.cwd())}function Pl(t,e){let r=Gt(K.relative(e,t));return r===""?"":r.startsWith("../")||r===".."||K.isAbsolute(r)?null:r}async function wg(t){let e=K.resolve(t),r=K.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await hn.realpath(i);return K.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(K.basename(i)),i=K.dirname(i)}try{let o=await hn.realpath(r);return K.join(o,...n.reverse())}catch{return null}}async function yg(t,e){let r=K.isAbsolute(t)?t:K.resolve(e,t),n=Gt(r),i=Pl(r,e);if(i!==null)return i;try{let o=await wg(r),s=await hn.realpath(e);if(o){let a=Pl(o,s);if(a!==null)return a;n=Gt(o)}}catch{if(!K.isAbsolute(t))return Gt(t).replace(/^\.\//u,"")}return n.replace(/^\.\//u,"")}async function Nl(t){try{let e=await mn(t,{migrate:!1}),r=Array.from(new Set(e.unknownKeys)).sort();if(r.length>0)throw new Error(`Invalid Classic state: unknown field(s): ${r.join(", ")}`);if(!e.classic)throw new Error("Classic state projection is unavailable");return{changeDir:t,phase:e.classic.phase,classic:e.classic,archived:e.classic.archived}}catch(e){let r=await kl(t);return r.phase?{changeDir:t,phase:r.phase,classic:null,archived:r.archived,invalidState:e instanceof Error&&e.message.includes("unknown field")}:null}}async function bg(t){let e=(await Le(t)).changesDir,r=[];if(!(await tt(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return r;for(let i of(await hn.readdir(e,{withFileTypes:!0})).sort((o,s)=>o.name.localeCompare(s.name))){if(i.name==="archive"||go(i.name))continue;let o=await rt(i.name,t);if(!o.exists||!o.stateExists)continue;let s=await Nl(o.directory);!s||s.archived||r.push(s)}return r}var No=_e("classicActiveChanges",t=>bg(t)),Rl=_e("classicPlanReadiness",_l);function Tl(t,e){return`${$(t,e.superpowersRoot)}/`}function Il(t,e){return We(t).startsWith(We(e))}function vg(t,e){return[{prefix:`${$(t,e.superpowersSpecsDir)}/`,field:"designDoc",wireField:"design_doc",phase:"design"},{prefix:`${$(t,e.superpowersPlansDir)}/`,field:"plan",wireField:"plan",phase:"build"},{prefix:`${$(t,e.superpowersReportsDir)}/`,field:"verificationReport",wireField:"verification_report",phase:"verify"}]}function kg(t,e){let r=We(t),n=e.find(o=>r.startsWith(We(o.prefix)));if(!n)return null;let i=r.slice(We(n.prefix).length);return!i||i.includes("/")||!i.endsWith(".md")?null:n}function jl(t,e){return t.classic?.[e.field]??null}function Cg(t,e){return t.classic!==null&&t.phase===e.phase&&!jl(t,e)}async function xl(t,e,r){return Cg(e,r)?!0:r.field!=="plan"||e.phase!=="build"?!1:(await Rl(t,e.classic?.plan??null)).status==="broken"}function Ll(t){return t.phase==="design"||t.phase==="build"||t.phase==="verify"}function ce(t){return t.changeDir?K.basename(t.changeDir):null}var Sg=new Set(["design","plan","verify","verification","verification-report","report"]);function Ol(t){return t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function Eg(t,e){return[e.classic?.designDoc,e.classic?.plan,e.classic?.verificationReport].some(n=>n&&We(n)===We(t))}function _g(t,e){let n=(t.split("/").at(-1)??t).replace(/\.[^.]+$/u,"");if(n===e)return!0;let i=[...Sg].map(Ol).join("|");return new RegExp(`(^|[-_.])${Ol(e)}[-_.](${i})$`,"u").test(n)}async function Pg(t,e){let r=await No(e),n=r.find(s=>Eg(t,s));if(n)return{governing:n,match:"recorded"};let o=r.filter(Ll).filter(s=>{let a=ce(s);return a!==null&&_g(t,a)}).sort((s,a)=>(ce(a)?.length??0)-(ce(s)?.length??0))[0];return o?{governing:o,match:"named"}:null}async function Al(t,e,r){let n=await No(t);if(n.length===0)return null;if(r)return n.find(s=>ce(s)===r)??{blockedResult:Ut(e,`selected change '${r}' is no longer active`)};let i=await Cl(t);if(i.status==="stale")return{blockedResult:Ut(e,i.reason)};if(i.status==="selected"){let o=n.find(s=>ce(s)===i.selection.change);return o||{blockedResult:Ut(e,`selected change '${i.selection.change}' is no longer active`)}}if(n.length===1){let o=n[0];if(o.changeDir!==null){let s=await nn(o.changeDir,{heal:!1,cwd:t}),a=ce(o)??"unknown";if(s.status==="drift")return{blockedResult:Ut(e,on(a,s.boundBranch,s.currentBranch))};if(s.status==="unbound-detached")return{blockedResult:Ut(e,sn(a))}}return o}return{blockedResult:$g(e,n.map(o=>ce(o)).filter(Boolean))}}async function xg(t,e,r,n){let i=`${$(e,r.changesDir)}/`;if(t.startsWith(i)){let o=t.slice(i.length),[s]=o.split("/");if(s&&s!=="archive"){let a=await rt(s,e);if(a.stateExists){let c=await Nl(a.directory);return c||{changeDir:a.directory,phase:"open",classic:null,archived:!1}}return{changeDir:a.directory,phase:"open",classic:null,archived:!1}}}if(Il(t,Tl(e,r))){let o=await Pg(t,e);if(o?.match==="recorded")return{...o.governing,superpowersArtifact:"matched"};let s=kg(t,vg(e,r));if(o)return s?{...o.governing,superpowersArtifact:await xl(e,o.governing,s)?"matched":"unmatched",superpowersSlot:s}:{...o.governing,superpowersArtifact:"matched"};if(s){let l=await Al(e,t,n);return!l||"blockedResult"in l?l:{...l,superpowersArtifact:await xl(e,l,s)?"matched":"unmatched",superpowersSlot:s}}let a=await No(e),c=n?a.find(l=>ce(l)===n)??null:a[0]??null;return c?{...c,superpowersArtifact:"unmatched"}:null}return Al(e,t,n)}function Og(t){return!t.includes("/")&&t.endsWith(".md")}function Ag(t){return t.startsWith(".comet/")||t.includes("/.comet/")}function Ng(t){return t===".superpowers"||t.startsWith(".superpowers/")}function Rg(t,e,r){if(!t.startsWith(r))return null;let n=t.endsWith("/.comet.yaml")||t.endsWith("/.openspec.yaml"),i=t.endsWith("/proposal.md")||t.endsWith("/design.md")||t.endsWith("/tasks.md"),o=t.includes("/.comet/"),s=t.includes("/specs/");return e==="open"&&(i||n||o||s)?`${t} (phase: open, openspec artifacts)`:e==="design"&&(i||n||o||s)?`${t} (phase: design, handoff/spec)`:e==="build"&&(t.endsWith("/tasks.md")||n||s)?`${t} (phase: build, spec/tasks)`:e==="verify"&&n?`${t} (phase: verify, state)`:e==="archive"&&n?`${t} (phase: archive, state)`:null}function Tg(t,e,r){return $l(t,e,e,r,e==="open"?[" BLOCKED: source writes are not allowed during open"," This phase does not allow source writes"," ALLOWED: create proposal/design/tasks artifacts and run guard"," NEXT: finish clarification and artifacts, then run guard --apply"]:e==="design"?[" BLOCKED: source writes are not allowed during design"," This phase does not allow source writes"," ALLOWED: run brainstorming, create the Design Doc, and run guard"," NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"]:e==="verify"?[" BLOCKED: implementation writes are not allowed during verify"," This phase allows verification reports and state updates only"," NEXT: run verify-fail and return to build before repairing implementation"]:[" BLOCKED: source writes are not allowed during archive"," This phase does not allow source writes"," ALLOWED: confirm archive state and run the archive script"])}function $l(t,e,r,n,i){let o=El(r,n);return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e}`,` Target file: ${t}`,"",` ${o.summary}`,` RELAY TO USER: ${o.user_message}`,"",...i,""].join(`
145
- `))}function Ig(t,e){return $l(t,"build (workflow: full), but design_doc is empty","build",e,[" BLOCKED: full workflow source writes require a recorded Design Doc"," This phase does not allow source writes until design_doc is recorded"," NEXT: return to design, create/link the Design Doc, then run guard again"])}function jg(t,e,r,n,i){let o=ce(e)??"<change-name>",s=r.status==="missing",a=s?"classic-build-plan-missing":"classic-build-plan-broken",c=s?"plan is not recorded":"the recorded plan path does not resolve to a file",l=s?[]:[`RECORDED_PLAN: ${r.recordedPath}`],u=e.changeDir?$(n,e.changeDir):"<classic-change-dir>",f=$(n,i.superpowersPlansDir),d=s?`comet state set ${o} plan <repository-relative-plan-path>`:`comet state set ${o} plan <new-repository-relative-plan-path>`,h=s?["2. Load the Superpowers writing-plans Skill.",`3. Read the Design Doc path from "comet state get ${o} design_doc" and read ${u}/tasks.md.`,`4. Create the implementation plan under ${f}/.`,"5. Record the plan path:",` ${d}`]:[`2. Restore the plan file at ${r.recordedPath}, or load the Superpowers writing-plans Skill and create a replacement under ${f}/.`,"3. When creating a replacement, record its path:",` ${d}`];return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",`ERROR_CODE: ${a}`,`CHANGE: ${o}`,"WORKFLOW: full","PHASE: build",`TARGET: ${t}`,`STATE: ${c}`,...l,"","BLOCKED: project source writes require a ready Superpowers implementation plan.","","ALLOWED_RECOVERY_WRITES:",`- ${f}/<plan-file>.md`,"- Comet state updates performed by the comet CLI",`- ${u} artifacts allowed by the build phase`,"","RECOVERY:",`1. Invoke /comet-build for ${o} and resume Step 1.`,...h,`${s?"6":"4"}. Verify recovery:`,` comet state check ${o} build --recover`,"","SUCCESS: plan is reported as DONE and recovery advances beyond plan creation.",`RETRY: retry the original Write/Edit for ${t} only after SUCCESS.`,"PROHIBITED: do not treat tasks.md as the implementation plan or write project source before SUCCESS.","If writing-plans is unavailable, stop and report the missing Skill instead of bypassing this check.",""].join(`
146
- `))}function Lg(t,e){let r=e.superpowersSlot,n=r?jl(e,r):null,i=r?e.phase!==r.phase?[` BLOCKED: ${r.wireField} cannot be first-written in phase ${e.phase}`,` Expected phase: ${r.phase}`," NEXT: resume the matching Comet phase or use an already recorded artifact path"]:n?[` BLOCKED: ${r.wireField} is already recorded for this change`,` Recorded path: ${n}`," NEXT: write the recorded artifact or explicitly correct the state path"]:[" BLOCKED: standard Superpowers artifact state is incomplete"," NEXT: validate the active change state, then retry the matching phase"]:[" BLOCKED: unmatched Superpowers artifact"," This docs/superpowers/ path does not match any active change artifact"," NEXT: use a recorded artifact path or a standard phase artifact directory"];return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e.phase}`,` Target file: ${t}`,"",...i,""].join(`
147
- `))}function $g(t,e){return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: multiple active changes require a current change",` Target file: ${t}`,` Active changes: ${e.join(", ")}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
142
+ `,r)+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 r=Br(e),n=Ve(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Br(e),n=Ve(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};gc.Parser=zi});var kc=g(Lt=>{"use strict";var wc=Wi(),im=Pt(),jt=At(),om=Ln(),sm=_(),am=Vi(),yc=Xi();function bc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new am.LineCounter||null,prettyErrors:e}}function cm(t,e={}){let{lineCounter:r,prettyErrors:n}=bc(e),i=new yc.Parser(r?.addNewLine),o=new wc.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(jt.prettifyError(t,r)),a.warnings.forEach(jt.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function vc(t,e={}){let{lineCounter:r,prettyErrors:n}=bc(e),i=new yc.Parser(r?.addNewLine),o=new wc.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new jt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(jt.prettifyError(t,r)),s.warnings.forEach(jt.prettifyError(t,r))),s}function lm(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=vc(t,r);if(!i)return null;if(i.warnings.forEach(o=>om.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:n},r))}function um(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return sm.isDocument(t)&&!n?t.toString(r):new im.Document(t,n,r).toString(r)}Lt.parse=lm;Lt.parseAllDocuments=cm;Lt.parseDocument=vc;Lt.stringify=um});var ze=g(P=>{"use strict";var fm=Wi(),dm=Pt(),pm=wi(),Qi=At(),mm=ut(),be=_(),hm=me(),gm=A(),wm=ge(),ym=we(),bm=Mr(),vm=Yi(),km=Vi(),Cm=Xi(),Ur=kc(),Cc=st();P.Composer=fm.Composer;P.Document=dm.Document;P.Schema=pm.Schema;P.YAMLError=Qi.YAMLError;P.YAMLParseError=Qi.YAMLParseError;P.YAMLWarning=Qi.YAMLWarning;P.Alias=mm.Alias;P.isAlias=be.isAlias;P.isCollection=be.isCollection;P.isDocument=be.isDocument;P.isMap=be.isMap;P.isNode=be.isNode;P.isPair=be.isPair;P.isScalar=be.isScalar;P.isSeq=be.isSeq;P.Pair=hm.Pair;P.Scalar=gm.Scalar;P.YAMLMap=wm.YAMLMap;P.YAMLSeq=ym.YAMLSeq;P.CST=bm;P.Lexer=vm.Lexer;P.LineCounter=km.LineCounter;P.Parser=Cm.Parser;P.parse=Ur.parse;P.parseAllDocuments=Ur.parseAllDocuments;P.parseDocument=Ur.parseDocument;P.stringify=Ur.stringify;P.visit=Cc.visit;P.visitAsync=Cc.visitAsync});import ve from"path";function Am(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||ve.posix.isAbsolute(r)||ve.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let n=r.replaceAll("\\","/").split("/");if(n.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(n.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return n}function Hr(t){let e=Am(t,"native.artifact_root");return e.length===0?".":e.join("/")}function xc(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Qe(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim().replaceAll("\\","/");if(n.length===0||ve.posix.isAbsolute(n)||ve.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be relative to its declared path base`);let i=n.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(!r&&/[*?]/u.test(n))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function ie(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Oc(t,e,r){let n=t??e;if(n!=="en"&&n!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return n}function Ac(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>to)throw new Error(`${e} exceeds ${to} characters`);let r=0;for(let n=0;n<t.length;n+=1)t[n]==="?"?r+=1:t[n]==="*"&&(r+=1,t[n+1]==="*"&&(n+=1));if(r>ro)throw new Error(`${e} contains more than ${ro} wildcard tokens`);return t}function Pc(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(n=>Ac(n,e)))].sort((n,i)=>n.localeCompare(i,"en"))}function eo(t,e,r){let n=t??e;if(!Number.isSafeInteger(n)||n<1)throw new Error(`${r} must be a positive integer`);return n}function Nm(t){if(t===void 0)return{...ne,include:[...ne.include],exclude:[...ne.exclude]};let e=ie(t,"native.snapshot");return{include:Pc(e.include,"native.snapshot.include",ne.include),exclude:Pc(e.exclude,"native.snapshot.exclude",ne.exclude),max_files:eo(e.max_files,ne.max_files,"native.snapshot.max_files"),max_total_bytes:eo(e.max_total_bytes,ne.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:eo(e.max_duration_ms,ne.max_duration_ms,"native.snapshot.max_duration_ms")}}function Rm(t){if(t===void 0)return;let e=ie(t,"native.pending_root_move"),r=e.id,n=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof n!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=ie(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:r,fromArtifactRoot:Hr(n),toArtifactRoot:Hr(i),stage:o,...s?{cleanup:s}:{}}}function Tm(t){if(t===void 0)return;let e=ie(t,"native.finish");if(e.pull_request===void 0)return{};let r=ie(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let n=r.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(ve.posix.isAbsolute(n[0])||ve.win32.isAbsolute(n[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=r.timeout_ms??_m;if(!Number.isSafeInteger(i)||i<1||i>_c)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${_c}`);return{pull_request:{provider:"repository-command",command:n,timeout_ms:i}}}function Im(t,e={}){let r=ie(t,"native"),n=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof n!="string")throw new Error("native.artifact_root must be a string");let i=r.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=r.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=r.max_verify_failures??Sm;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Rm(r.pending_root_move),c=Tm(r.finish);return{artifact_root:Hr(n),language:Oc(r.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,snapshot:Nm(r.snapshot),...c?{finish:c}:{},...a?{pending_root_move:a}:{}}}function jm(t){let e=ie(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let n=e.review_mode??"standard";if(n!=="off"&&n!=="standard"&&n!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:xc(e.artifact_layout),language:Oc(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:n,auto_transition:i}}function Lm(t){let r=ie(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((n,i)=>Qe(n,`hook.allow_paths[${i}]`)))]}}function $m(t){if(t===void 0)return{...Zi};let e=ie(t,"memory"),r=e.learning??Zi.learning,n=e.retrieval??Zi.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof n!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:n}}function io(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Wm(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||ve.posix.isAbsolute(r)||ve.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(i=>i===""||i==="."||i===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>Sc)throw new Error(`${e} exceeds ${Sc} characters`);let n=0;for(let i=0;i<r.length;i+=1)r[i]==="?"?n+=1:r[i]==="*"&&(n+=1,r[i+1]==="*"&&(i+=1));if(n>Ec)throw new Error(`${e} contains more than ${Ec} wildcard tokens`);return r}function qm(t){let r=io(t,"knowledge.local").include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(r.map((n,i)=>Wm(n,`knowledge.local.include[${i}]`)))]}}function Dm(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),n=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&n))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Mm(t){let e=io(t,"knowledge.remote"),r=Dm(e.endpoint),n=e.token_env;if(n!==void 0&&(typeof n!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(n)))throw new Error("knowledge.remote.token_env must be an environment variable name");let i=e.scope;if(i!==void 0&&(typeof i!="string"||i.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let o=e.timeout_ms??5e3;if(typeof o!="number"||!Number.isSafeInteger(o)||o<100||o>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...n===void 0?{}:{token_env:n},...i===void 0?{}:{scope:i},timeout_ms:o}}function Fm(t){if(t===void 0)return{...Em};let e=io(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let n=e.local===void 0?void 0:qm(e.local);if(r==="local")return{provider:r,...n?{local:n}:{}};let i=e.remote===void 0?void 0:Mm(e.remote);if(i===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...n?{local:n}:{},remote:i}}function Bm(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Km(t,e,r,n,i,o,s,a){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.allowPartialProject&&!c)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let u=t.workflows??[t.default_workflow];if(!Array.isArray(u)||u.length===0||u.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let f=[...new Set(u)];if(!f.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(f.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:f,ambient_resume:s,...e?{hook:e}:{},memory:r,knowledge:n,...i?{native:i}:{},...o?{classic:o}:{}}}function Ze(t,e={}){let r=(0,no.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let n=r.toJS();if(n==null)return{value:{},config:null,ambient_resume:!0};if(typeof n!="object"||Array.isArray(n))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=n,o=Bm(i.ambient_resume),s=i.hook===void 0?void 0:Lm(i.hook),a=$m(i.memory),c=Fm(i.knowledge),l=i.native===void 0?void 0:Im(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),u=i.classic===void 0?void 0:jm(i.classic),f=Km(i,s,a,c,l,u,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:f,ambient_resume:o,memory:a,knowledge:c,...s?{hook:s}:{},...l?{native:l}:{},...u?{classic:u}:{}}}var no,Xe,to,ro,Sc,Ec,Sm,Zi,Em,_m,_c,Pm,xm,Om,ne,oe=T(()=>{"use strict";no=it(ze(),1),Xe=64*1024,to=1024,ro=64,Sc=1024,Ec=64,Sm=5,Zi={learning:!0,retrieval:!0},Em={provider:"local"},_m=12e4,_c=6e5,Pm=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".devin/skills/**",".dsh/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".grok/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".omp/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],xm=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],Om=[...Pm,...xm].sort((t,e)=>t.localeCompare(e,"en")),ne={include:["**/*"],exclude:[...Om],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function ke(t){return t!==0&&t!==0n&&t!=="0"}function Nc(t,e){return ke(t.dev)&&ke(e.dev)&&ke(t.ino)&&ke(e.ino)}function Ce(t,e){let r=ke(t.dev)&&ke(e.dev);if(r&&t.dev!==e.dev)return!1;let n=ke(t.ino)&&ke(e.ino);return n&&t.ino!==e.ino?!1:r&&n?!0:t.birthtime===e.birthtime}var Gr=T(()=>{"use strict"});import{constants as Yr,promises as Te}from"fs";function oo(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Rc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function $t(t){return{dev:t.dev,ino:t.ino,birthtime:oo(t)}}function Jr(t,e){let r=$t(t),n=$t(e);return Nc(r,n)?Ce(r,n):Ce(r,n)&&oo(t)===oo(e)&&Rc(t)===Rc(e)&&t.size===e.size}async function Vr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let n=r.label??"file",i=r.bigint===!0,o=await Te.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new Se("not-regular-file",`${n} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new Se("too-large",`${n} exceeds ${e} bytes`);let s=await Te.realpath(t);await r.verify?.("pre-open",{realPath:s,identity:$t(o)});let a=process.platform==="win32"?Yr.O_RDONLY:Yr.O_RDONLY|Yr.O_NOFOLLOW|Yr.O_NONBLOCK,c;try{c=await Te.open(t,a)}catch(l){throw l.code==="ELOOP"?new Se("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:i}),Te.lstat(t,{bigint:i}),Te.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!Jr(o,l)||!Jr(o,u))throw new Se("changed",`${n} changed while opening`);await r.verify?.("post-open",{realPath:f,identity:$t(l)}),await r.hooks?.afterOpen?.();let d=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let v=e+1-h,{bytesRead:k}=await c.read(w,0,Math.min(w.length,v),null);if(k===0)break;if(h+=k,h>e)throw new Se("too-large",`${n} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,m,y]=await Promise.all([c.stat({bigint:i}),Te.lstat(t,{bigint:i}),Te.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||y!==s||!Jr(o,p)||!Jr(o,m))throw new Se("changed",`${n} changed while reading`);return await r.verify?.("post-read",{realPath:y,identity:$t(p)}),{bytes:Buffer.concat(d,h),stat:p,realPath:y}}finally{await c.close()}}var Se,so=T(()=>{"use strict";Gr();Se=class extends Error{reason;constructor(e,r,n){super(r,n),this.name="RaceSafeReadError",this.reason=e}}});import{promises as zr}from"fs";import Ee from"path";function Um(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ao(t,e){let r=Ee.relative(t,e);return r===""||!Ee.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ee.sep}`)}async function Tc(t,e){let r=Ee.resolve(t),n=await zr.lstat(r);if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return zr.realpath(r)}async function Ic(t,e,r,n){let i=t;for(let o=0;o<r.length;o++){i=Ee.join(i,r[o]);let s;try{s=await zr.lstat(i)}catch(u){if(Um(u))return{exists:!1,kind:"missing"};throw u}let a=Ee.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${a}`);let c=o===r.length-1;if(!c&&!s.isDirectory())throw new Error(`${n.label} ancestor ${a} must be a real directory`);if(c&&(n.expected==="file"&&!s.isFile()||n.expected==="directory"&&!s.isDirectory()||n.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${n.label} must be a real ${n.expected}`);let l=await zr.realpath(i);if(!ao(e,l))throw new Error(`${n.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function W(t,e,r){let n=Qe(e,r.label),i=Ee.resolve(t),o=await Tc(i,r.label),s=n.split("/"),a=Ee.resolve(i,...s);if(!ao(i,a))throw new Error(`${r.label} must stay inside the project root`);let c=await Ic(i,o,s,r);return{projectRoot:i,target:a,relative:n,exists:c.exists,kind:c.kind}}async function U(t,e,r,n){let i=await W(t,e,{label:n.label,expected:"file"});if(!i.exists){let s=new Error(`${n.label} does not exist`);throw s.code="ENOENT",s}let o=await Tc(i.projectRoot,n.label);return Vr(i.target,r,{...n,verify:async(s,a)=>{if(!ao(o,a.realPath))throw new Error(`${n.label} resolves outside the project root`);await Ic(i.projectRoot,o,i.relative.split("/"),{label:n.label,expected:"file"})}})}var V=T(()=>{"use strict";so();oe()});import{createHash as Hm}from"crypto";function Gm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function qt(t,e={}){return(await Xr(t,e)).document}async function Ym(t){try{return(await U(t,Wt,Xe,{label:Wt})).bytes}catch(e){if(Gm(e))return null;throw e}}function Jm(t){return t?{exists:!0,sha256:Hm("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Xr(t,e={}){let r=await Ym(t);return{document:r?Ze(r.toString("utf8"),e):null,identity:Jm(r)}}async function co(t){return(await qt(t))?.config??null}var Wt,Ie=T(()=>{"use strict";oe();V();Wt=".comet/config.yaml"});import{randomUUID as Vm}from"crypto";import{constants as zm,promises as O}from"fs";import L from"path";async function lo(t,e){try{return await O.link(t,e),{linked:!0}}catch(r){let n=r.code;if(n!=="ENOTSUP"&&n!=="EOPNOTSUPP")throw r}return await O.copyFile(t,e,zm.COPYFILE_EXCL),{linked:!1}}function je(t,e){let r=L.relative(t,e);return r===""||!L.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${L.sep}`)}function Qr(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Xm(t,e){return Ce(t,Qr(e))}function Zr(t,e){return Ce(Qr(t),Qr(e))}function jc(t,e){return Zr(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function en(t){let e=await O.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await O.realpath(t),...Qr(e)}}async function se(t){for(let e of t){let r=await O.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Xm(e,r)||await O.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Qm(t,e,r){let[n,i]=await Promise.all([O.lstat(t),O.realpath(t),se(r)]);if(!n.isFile()||n.isSymbolicLink()||!Zr(n,e)||!je(r[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return n}async function Zm(t,e){let r=L.resolve(t),n=L.resolve(e);if(!je(r,n))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await en(r)],o=L.relative(r,n).split(L.sep).filter(Boolean),s=r;for(let a of o){await se(i),s=L.join(s,a);try{await O.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await en(s);if(!je(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(c)}return await se(i),i}async function eh(t,e){let r=L.resolve(t),n=L.resolve(e);if(!je(r,n))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await en(r)],o=L.relative(r,n).split(L.sep).filter(Boolean),s=r;for(let a of o){s=L.join(s,a);try{let c=await en(s);if(!je(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await se(i),i}async function Lc(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(r){let n=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(n??""))throw r}finally{await e?.close()}}async function th(t,e,r){let n=L.dirname(t),i=await Zm(r.containedRoot,n),o=L.join(n,`.${L.basename(t)}.${Vm()}.tmp`),s,a,c;try{await r.beforeTemporaryOpen?.(),s=await O.open(o,"wx"),a=await s.stat();let[l,u]=await Promise.all([O.lstat(o),O.realpath(o)]);if(await se(i),!l.isFile()||l.isSymbolicLink()||!Zr(a,l)||!je(i[0].realPath,u))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(),c=await s.stat(),!Zr(a,c))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await Qm(o,c,i),await r.beforeCommit?.(),await se(i);let f=await O.lstat(o);if(!f.isFile()||f.isSymbolicLink()||!c||!jc(f,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await lo(o,t),await O.unlink(o)):await O.rename(o,t),await Lc(n)}catch(l){await s?.close();try{await se(i),await O.rm(o,{force:!0})}catch{}throw l}}async function z(t,e,r){await th(t,e,r)}async function uo(t,e){let r=L.dirname(t),n=await eh(e.containedRoot,r);if(!n)return!1;let i,o;try{i=await O.lstat(t),o=await O.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!je(n[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await se(n);let[s,a]=await Promise.all([O.lstat(t),O.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!jc(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await O.unlink(t),await se(n),await Lc(r),!0}var ae=T(()=>{"use strict";Gr()});var Iy,fo=T(()=>{"use strict";ae();Ie();V();Iy=16*1024});var tn=T(()=>{"use strict";ae();oe();Ie();V();fo()});import q from"path";function Hc(t,e){let r=q.relative(t,e);return r===""||!q.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${q.sep}`)}function yh(t,e){let r=q.isAbsolute(e)?q.resolve(e):q.resolve(t,e),n=q.relative(q.resolve(t),r);return n===""||q.isAbsolute(n)||n===".."||n.startsWith(`..${q.sep}`)?null:n.replaceAll("\\","/")}function Gc(t){return process.platform==="win32"?t.toLowerCase():t}async function yo(t,e,r=[]){let n=q.isAbsolute(e)?q.resolve(e):q.resolve(t,e),i=q.resolve(t);if(!Hc(i,n)||r.some(c=>Hc(q.resolve(c),n)))return null;let o=yh(t,e);if(!o)return null;let a=(await wh(t)).allow_paths.find(c=>{let l=Gc(o),u=Gc(c);return l===u||l.startsWith(`${u}/`)});return a?`${o} (configured Hook allow path: ${a})`:null}var wh,bo=T(()=>{"use strict";ot();Ie();wh=_e("hookWritePolicy",async t=>(await co(t))?.hook??{allow_paths:[]})});var an=T(()=>{"use strict"});var Zc=T(()=>{"use strict"});var Co=T(()=>{"use strict";an()});var el=T(()=>{"use strict";an();Co()});var qh,tl=T(()=>{"use strict";qh=it(ze(),1);ae();oe();V()});var $b,rl=T(()=>{"use strict";ae();V();$b=4*1024*1024});var nl=T(()=>{"use strict";an();ae();Zc();el();oe();tl();V();Ie();tn();rl();bo();fo();Co()});import{TextDecoder as Dh}from"util";function il(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Mh(t,e){try{return new Dh("utf-8",{fatal:!0}).decode(t.bytes)}catch(r){throw new Error(`${e} is not valid UTF-8`,{cause:r})}}async function So(t,e,r,n,i={}){try{let o=await U(t,e,r,{label:n,hooks:i.hooks});return{result:o,text:Mh(o,n)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function ol(t,e,r,n,i={}){return(await So(t,e,r,n,i))?.text??null}async function sl(t,e,r,n,i,o={}){if(Buffer.byteLength(r,"utf8")>n)throw new Error(`${i} exceeds ${n} bytes`);let s=await So(t,e,n,i),a=await W(t,e,{label:i,expected:"file"});await z(a.target,r,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await So(t,e,n,i);if(!(!s&&!c)){if(!s||!c)throw new Error(`${i} changed before commit`);if(s.result.realPath!==c.result.realPath||!Ce(il(s.result.stat),il(c.result.stat))||s.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function al(t,e,r,n={}){let i=await W(t,e,{label:r,expected:"file"});return i.exists?uo(i.target,{containedRoot:i.projectRoot,beforeRemove:n.beforeRemove}):!1}var cl=T(()=>{"use strict";nl();Gr()});var pl={};Hl(pl,{RUN_STATE_FILE:()=>ln,applyRunStateToDocument:()=>ul,readRunState:()=>Eo,removeRunState:()=>dl,runStateFromDocument:()=>cn,writeRunState:()=>_o});import Fh from"path";function Bt(t,e){let r=t[e];if(typeof r!="string"||r.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return r}function Ft(t,e){let r=Bt(t,e);if(Fh.isAbsolute(r)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return r}function Bh(t){let e=t.run_retries??"{}",r;try{r=typeof e=="string"?JSON.parse(e):e}catch(n){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:n})}if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let n of Object.values(r))if(!Number.isInteger(n)||Number(n)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return r}function cn(t){if(!t.run_id)return null;let e=Bt(t,"run_id"),r=Bt(t,"skill"),n=Bt(t,"skill_version"),i=Bt(t,"skill_hash"),o=Ft(t,"pending_ref"),s=Ft(t,"trajectory_ref"),a=Ft(t,"context_ref"),c=Ft(t,"artifacts_ref"),l=Ft(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:r,skillVersion:n,skillHash:i,orchestration:t.orchestration,currentStep:ll(t,"current_step"),iteration:u,pending:ll(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:Bh(t)}}function ul(t,e){e?t.run_id=e.runId:delete t.run_id}function Kh(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function Uh(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return cn(e)}async function Eo(t,e={}){let r=await ol(t,ln,fl,"Run state",e);if(r===null)return null;let n=JSON.parse(r);return Uh(n)}async function _o(t,e,r={}){await sl(t,ln,JSON.stringify(Kh(e),null,2),fl,"Run state",r)}async function dl(t,e={}){await al(t,ln,"Run state",e)}var ll,ln,fl,un=T(()=>{"use strict";cl();ll=(t,e)=>{let r=t[e];return r==null?null:String(r)};ln=".comet/run-state.json",fl=256*1024});import{promises as hn,readFileSync as hg}from"fs";import K from"path";function To(t){return t.charCodeAt(0)===65279?t.slice(1):t}ot();import{promises as oh}from"fs";import B from"path";import{promises as Yl}from"fs";async function yn(t){try{return await Yl.access(t),!0}catch(e){if(Jl(e))return!1;throw e}}function Jl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}oe();Ie();tn();V();var et=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},qc=".comet/config.yaml";function sh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function ah(t){await W(t,qc,{label:qc,expected:"file"})}function mo(t,e){let r=B.resolve(t),n=e==="docs"?B.join(r,"docs"):r,i=B.join(n,"openspec"),o=B.join(r,"docs","superpowers");return{projectRoot:r,artifactLayout:e,openSpecBase:n,openSpecRoot:i,changesDir:B.join(i,"changes"),archiveDir:B.join(i,"changes","archive"),specsDir:B.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:B.join(o,"specs"),superpowersPlansDir:B.join(o,"plans"),superpowersReportsDir:B.join(o,"reports")}}async function Mc(t){await ah(t);let e=await qt(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new et;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new et("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function ch(t,e){return mo(t,e??await Mc(t))}async function lh(t){try{return await oh.lstat(t),!0}catch(e){if(sh(e))return!1;throw e}}async function uh(t,e){let r=await ch(t,e),n=r.artifactLayout==="legacy"?"docs":"legacy",i=mo(t,n).openSpecRoot,[o,s]=await Promise.all([W(r.projectRoot,$(r.projectRoot,r.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),lh(i)]),a=o.exists;return{paths:r,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function fh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let r of e){let n=$(t.projectRoot,r);await W(t.projectRoot,n,{label:`Classic managed physical path ${n}`,expected:"directory"})}}async function Le(t,e){let r=await uh(t,e);if(await fh(r.paths),!r.configuredRootExists){let n=$(r.paths.projectRoot,r.paths.openSpecRoot),i=$(r.paths.projectRoot,r.alternateRoot);throw new et(`Configured Classic OpenSpec root is missing: ${n} (alternate ${i} is ${r.alternateRootExists?"present":"missing"})`)}return r.paths}async function ho(t,e){let r=B.join(B.resolve(t),".comet","classic-root-move.json");if(await yn(r))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let n=await Le(t,e);if(!await yn(n.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${$(n.projectRoot,n.openSpecRoot)}`);return n}function $(t,e){return B.relative(B.resolve(t),e).replaceAll("\\","/")}import Bc from"path";ae();oe();V();import Dt from"path";var eb=2*1024*1024;function ph(t,e,r){let n=Dt.resolve(t),i=Dt.isAbsolute(e)?Dt.resolve(e):Dt.resolve(n,e),o=Dt.relative(n,i).replaceAll("\\","/");return{root:n,relative:Qe(o,r),target:i}}async function tt(t,e,r){let n=ph(t,e,r.label);return W(n.root,n.relative,r)}async function Fc(t,e,r){return(await tt(t,e,{label:r.label,expected:r.expected??"any"})).exists}function go(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
143
+ Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function rn(t){let e=go(t);if(e)throw new Error(e)}function mh(t,e){return{label:$(t,e),directory:e}}async function hh(t,e,r){let n=mh(t,e);if(!(await tt(t,e,{label:r,expected:"directory"})).exists)return{change:n,exists:!1,stateExists:!1};let o=await tt(t,Bc.join(e,".comet.yaml"),{label:`${r} state`,expected:"file"});return{change:n,exists:!0,stateExists:o.exists}}async function rt(t,e=process.cwd()){rn(t);let r=await Le(e),n=await hh(r.projectRoot,Bc.join(r.changesDir,t),`Classic active change ${t}`);return{...n.change,exists:n.exists,stateExists:n.stateExists}}import{promises as wo}from"fs";import H from"path";function Kc(t,e){let r=H.relative(t,e);return r===""||r!==".."&&!r.startsWith(`..${H.sep}`)&&!H.isAbsolute(r)}async function gh(t){let e=H.resolve(t),r=H.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await wo.realpath(i);return H.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(H.basename(i)),i=H.dirname(i)}try{let o=await wo.realpath(r);return H.join(o,...n.reverse())}catch{return null}}async function Uc(t,e){let r=H.resolve(t),n=await wo.realpath(r),i=[],o=[];for(let s of e){let a=H.isAbsolute(s)?H.resolve(s):H.resolve(r,s),c=await gh(a);((c?Kc(n,c):Kc(r,a))?i:o).push(s)}return{projectTargets:i,externalTargets:o}}bo();var vo=it(ze(),1);ot();import{execFileSync as Yc}from"child_process";import{randomUUID as bh}from"crypto";import{promises as Mt}from"fs";import Jc from"path";function vh(t){try{let e=Yc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0}).trim();return e&&e!=="HEAD"?e:null}catch{return null}}var kh=wn("liveGitBranch",t=>vh(t));function Ch(t){try{return Yc("git",["rev-parse","--is-inside-work-tree"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0}).trim()==="true"}catch{return!1}}var Sh=wn("isGitWorkTree",t=>Ch(t)),Eh=["current","branch","worktree"];function Vc(t){return Eh.includes(t)}function _h(t){return Vc(t.isolation)?t.boundBranch===null&&t.currentBranch===null&&t.gitWorkTree===!1?{status:"not-applicable"}:t.boundBranch===null?t.currentBranch===null?{status:"unbound-detached"}:{status:"needs-heal",branch:t.currentBranch}:t.currentBranch===t.boundBranch?{status:"ok"}:{status:"drift",boundBranch:t.boundBranch,currentBranch:t.currentBranch}:{status:"not-applicable"}}async function nn(t,e){let r=Jc.join(t,".comet.yaml"),n=(0,vo.parseDocument)(await Mt.readFile(r,"utf8"),{uniqueKeys:!1});if(n.errors.length>0)throw new Error(`Invalid .comet.yaml: ${n.errors[0].message}`);let i=n.toJS()??{},o=typeof i.isolation=="string"?i.isolation:null,s=typeof i.bound_branch=="string"&&i.bound_branch!==""?i.bound_branch:null,a=Vc(o),c=kh(e.cwd),l=a&&s===null&&c===null?Sh(e.cwd):!0,u=_h({isolation:o,boundBranch:s,currentBranch:c,gitWorkTree:l});return u.status==="needs-heal"&&e.heal?(await Ph(t,u.branch),{status:"healed",branch:u.branch,bindingRequired:a,currentBranch:c}):{...u,bindingRequired:a,currentBranch:c}}async function Ph(t,e){let r=Jc.join(t,".comet.yaml"),n=(0,vo.parseDocument)(await Mt.readFile(r,"utf8"),{uniqueKeys:!1});n.set("bound_branch",e);let i=`${r}.${bh()}.tmp`;try{await Mt.writeFile(i,n.toString(),"utf8"),await Mt.rename(i,r)}catch(o){throw await Mt.rm(i,{force:!0}),o}}function xh(t){return t??"detached HEAD"}function on(t,e,r){return`change '${t}' is bound to branch '${e}', but current branch is '${xh(r)}'`}function sn(t){return`change '${t}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`}so();import Oh from"path";var ko="comet.selection.v2",Ah=16*1024;function Xc(t){return Oh.join(t,".comet","current-change.json")}function Nh(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function zc(t){return t===null||typeof t=="string"}function Rh(t){let e;try{e=JSON.parse(t)}catch(r){throw new Error(`current change selection contains invalid JSON: ${r instanceof Error?r.message:String(r)}`,{cause:r})}if(!Nh(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!zc(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:ko,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==ko)throw new Error(`current change selection schema must be ${ko}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!zc(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function Qc(t){let e;try{let n=Xc(t),{bytes:i}=await Vr(n,Ah,{label:"current change selection"});e=i.toString("utf8")}catch(n){if(n.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{status:"selected",...Rh(e)}}ot();var pn=it(ze(),1);ae();V();import dn from"path";un();var xo=["full","hotfix","tweak"],ml=1,gl=["open","design","build","verify","archive"],Hh=["en","zh-CN"],Gh=["off","beta"],Yh=["subagent-driven-development","executing-plans","direct"],Jh=["plan-ready"],Vh=["confirmed"],zh=["tdd","direct"],Xh=["off","standard","thorough"],Qh=["current","branch","worktree"],Zh=["light","full"],eg=["pending","pass","fail"],tg=["pending","handled"],rg=["pending","confirmed"],Oo=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],ng=["run_id"],wl=new Set([...Oo,...ng]),ig=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function hl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function nt(t,e){let r=t[e];if(r==null||r==="")return null;if(typeof r!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return r}function D(t,e,r,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!r.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${r.join(", ")}${n?" or null":""}`);return i}function Po(t,e,r=!0){let n=t[e];if(n==null||n===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof n!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return n}function og(t,e,r=0){let n=t[e];if(n==null||n==="")return r;if(typeof n!="number"||!Number.isInteger(n)||n<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return n}function fn(t,e){let r=nt(t,e);if(r===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(r)||r.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return r}function sg(t,e){let r=nt(t,e);if(r!==null&&!/^[a-f0-9]{64}$/u.test(r))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return r}function ag(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==ml)throw new Error(`Invalid Classic state: classic_migration must be ${ml}`);return e}function cg(t){if(!Oo.some(r=>hl(t,r)))return null;for(let r of ig)if(!hl(t,r))return null;return{workflow:D(t,"workflow",xo,!1),language:D(t,"language",Hh),phase:D(t,"phase",gl,!1),contextCompression:D(t,"context_compression",Gh),buildMode:D(t,"build_mode",Yh),buildPause:D(t,"build_pause",Jh),subagentDispatch:D(t,"subagent_dispatch",Vh),tddMode:D(t,"tdd_mode",zh),reviewMode:D(t,"review_mode",Xh),isolation:D(t,"isolation",Qh),boundBranch:nt(t,"bound_branch"),verifyMode:D(t,"verify_mode",Zh),autoTransition:Po(t,"auto_transition"),baseRef:nt(t,"base_ref"),designDoc:fn(t,"design_doc"),plan:fn(t,"plan"),verifyResult:D(t,"verify_result",eg,!1),verifyFailures:og(t,"verify_failures"),verificationReport:fn(t,"verification_report"),branchStatus:D(t,"branch_status",tg),createdAt:nt(t,"created_at"),verifiedAt:nt(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",rg),archived:Po(t,"archived",!1),directOverride:Po(t,"direct_override"),handoffContext:fn(t,"handoff_context"),handoffHash:sg(t,"handoff_hash"),classicProfile:D(t,"classic_profile",xo),classicMigration:ag(t)}}function yl(t,e){let r=e??null;if(r===null&&e===void 0&&t.run_id&&t.skill)try{r=cn(t)}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:n})}return{classic:cg(t),run:r,unknownKeys:Object.keys(t).filter(n=>!wl.has(n))}}function bl(t){let e=t.workflow,r=t.phase,n=t.archived,i=t.design_doc;return{workflow:typeof e=="string"&&xo.includes(e)?e:null,phase:typeof r=="string"&&gl.includes(r)?r:null,archived:n===!0,designDoc:typeof i=="string"&&i!==""?i:null,unknownKeys:Object.keys(t).filter(o=>!wl.has(o))}}un();var lg=2*1024*1024;function Kt(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function ug(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let r of e)t.delete(r)}function fg(t){let e=!1;for(let r of["build_command","verify_command"])t.has(r)&&(t.delete(r),e=!0);return e}async function vl(t){let e;try{e=(await U(dn.dirname(t),dn.basename(t),lg,{label:"Classic state document"})).bytes.toString("utf8")}catch(n){if(n.code!=="ENOENT")throw n;return new pn.Document({})}let r=(0,pn.parseDocument)(e);if(r.errors.length>0)throw new Error(`Invalid Classic state document: ${r.errors[0].message}`);return Kt(r),r}async function mn(t,e={}){let r=e.migrate!==!1,n=dn.join(t,".comet.yaml"),i=await vl(n),o=Kt(i),s=fg(i);s&&(o=Kt(i));let a=await Eo(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(un(),pl));a=c(o),a&&r&&(await _o(t,a),ug(i),s=!0)}return s&&r&&await z(n,i.toString(),{containedRoot:t}),yl(Kt(i),a)}async function kl(t){let e=await vl(dn.join(t,".comet.yaml"));return bl(Kt(e))}var dg=it(ze(),1);var Dv=8*1024*1024;Ie();tn();V();oe();ae();var pg=_e("readCometCurrentSelection",t=>Qc(t));async function mg(t,e){rn(e);let r=await rt(e,t);if(!r.stateExists)throw new Error(`Cannot select current change '${e}': active change state not found`);let n=await mn(r.directory,{migrate:!1});if(!n.classic)throw new Error(`Cannot select current change '${e}': Classic state is incomplete`);if(n.classic.archived)throw new Error(`Cannot select current change '${e}': change is archived`);return r.directory}async function Cl(t){let e;try{e=await pg(t)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}if(e.status==="missing")return{status:"missing"};if(e.selection.workflow!=="classic")return{status:"stale",reason:`current change '${e.selection.change}' belongs to Native, not Classic`};let r=e.selection,n;try{n=await mg(t,r.change)}catch(o){return{status:"stale",reason:o instanceof Error?o.message:String(o)}}let i=await nn(n,{heal:!1,cwd:t});return i.status==="drift"?{status:"stale",reason:on(r.change,i.boundBranch,i.currentBranch)}:i.status==="unbound-detached"?{status:"stale",reason:sn(r.change)}:i.status==="ok"?{status:"selected",selection:r}:r.branch!==null&&i.currentBranch!==r.branch?{status:"stale",reason:`current change '${r.change}' was selected on branch '${r.branch}', current branch is '${i.currentBranch??"detached HEAD"}'`}:{status:"selected",selection:r}}function Ao(t){return t==="zh-CN"?"zh-CN":"en"}function Sl(t,e,r){return t==="zh-CN"?r:e}function El(t,e){let n={open:{en:"Source code edits are paused while the request is still being clarified.",zh:"需求仍在澄清中,暂时不修改源代码。"},design:{en:"Source code edits are paused until the design is agreed and recorded.",zh:"方案确定并记录之前,暂不修改源代码。"},build:{en:"A required design or plan record is missing, so source edits stay paused.",zh:"缺少必需的设计或计划记录,源代码修改暂被搁置。"},verify:{en:"Implementation edits are paused during verification; only verification output is accepted.",zh:"验证期间暂停修改实现,仅接受验证产出。"},archive:{en:"Source code edits are paused while the change is being archived.",zh:"归档期间暂不修改源代码。"}}[t]??{en:"This write is paused by the current workflow stage.",zh:"当前工作流阶段暂不允许这次写入。"};return{summary:Sl(e,"This write was blocked on purpose, not by an error.","这次写入是被有意拦下的,不是发生了错误。"),user_message:Sl(e,n.en,n.zh)}}import $e from"node:path";async function _l(t,e){if(!e||e==="null")return{status:"missing",recordedPath:null};let r=await Le(t),n=$e.resolve(t,e),i=$e.relative(r.superpowersPlansDir,n);return $e.isAbsolute(e)||!i||i.startsWith(`..${$e.sep}`)||$e.isAbsolute(i)||i.includes($e.sep)||$e.extname(i).toLowerCase()!==".md"?{status:"broken",recordedPath:e}:await Fc(t,e,{label:`Classic build plan ${e}`,expected:"file"})?{status:"ready",recordedPath:e}:{status:"broken",recordedPath:e}}function ee(t,e){return{exitCode:t,stderr:e+`
144
+ `}}function X(t){return ee(0,`[COMET-HOOK] allowed: ${t}`)}function gg(){if(process.env.FILE_PATH)return process.env.FILE_PATH;if(process.stdin.isTTY)return"";let t=To(hg(0,"utf8"));if(!t)return"";try{let e=JSON.parse(t);return typeof e.tool_input?.file_path=="string"?e.tool_input.file_path:""}catch{return""}}function Ht(t){return t.replaceAll("\\","/").replace(/\/+/gu,"/")}function We(t){let e=Ht(t);return process.platform==="win32"?e.toLowerCase():e}function wg(t){let e=t.indexOf("--project-root"),r=e>=0?t[e+1]:void 0;return K.resolve(r&&!r.startsWith("--")?r:process.cwd())}function Pl(t,e){let r=Ht(K.relative(e,t));return r===""?"":r.startsWith("../")||r===".."||K.isAbsolute(r)?null:r}async function yg(t){let e=K.resolve(t),r=K.parse(e).root,n=[],i=e;for(;i&&i!==r;)try{let o=await hn.realpath(i);return K.join(o,...n.reverse())}catch(o){let s=o.code;if(s!=="ENOENT"&&s!=="ENOTDIR")throw o;n.push(K.basename(i)),i=K.dirname(i)}try{let o=await hn.realpath(r);return K.join(o,...n.reverse())}catch{return null}}async function bg(t,e){let r=K.isAbsolute(t)?t:K.resolve(e,t),n=Ht(r),i=Pl(r,e);if(i!==null)return i;try{let o=await yg(r),s=await hn.realpath(e);if(o){let a=Pl(o,s);if(a!==null)return a;n=Ht(o)}}catch{if(!K.isAbsolute(t))return Ht(t).replace(/^\.\//u,"")}return n.replace(/^\.\//u,"")}async function Nl(t){try{let e=await mn(t,{migrate:!1}),r=Array.from(new Set(e.unknownKeys)).sort();if(r.length>0)throw new Error(`Invalid Classic state: unknown field(s): ${r.join(", ")}`);if(!e.classic)throw new Error("Classic state projection is unavailable");return{changeDir:t,phase:e.classic.phase,classic:e.classic,archived:e.classic.archived}}catch(e){let r=await kl(t);return r.phase?{changeDir:t,phase:r.phase,classic:null,archived:r.archived,invalidState:e instanceof Error&&e.message.includes("unknown field")}:null}}async function vg(t){let e=(await Le(t)).changesDir,r=[];if(!(await tt(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return r;for(let i of(await hn.readdir(e,{withFileTypes:!0})).sort((o,s)=>o.name.localeCompare(s.name))){if(i.name==="archive"||go(i.name))continue;let o=await rt(i.name,t);if(!o.exists||!o.stateExists)continue;let s=await Nl(o.directory);!s||s.archived||r.push(s)}return r}var No=_e("classicActiveChanges",t=>vg(t)),Rl=_e("classicPlanReadiness",_l);function Tl(t,e){return`${$(t,e.superpowersRoot)}/`}function Il(t,e){return We(t).startsWith(We(e))}function kg(t,e){return[{prefix:`${$(t,e.superpowersSpecsDir)}/`,field:"designDoc",wireField:"design_doc",phase:"design"},{prefix:`${$(t,e.superpowersPlansDir)}/`,field:"plan",wireField:"plan",phase:"build"},{prefix:`${$(t,e.superpowersReportsDir)}/`,field:"verificationReport",wireField:"verification_report",phase:"verify"}]}function Cg(t,e){let r=We(t),n=e.find(o=>r.startsWith(We(o.prefix)));if(!n)return null;let i=r.slice(We(n.prefix).length);return!i||i.includes("/")||!i.endsWith(".md")?null:n}function jl(t,e){return t.classic?.[e.field]??null}function Sg(t,e){return t.classic!==null&&t.phase===e.phase&&!jl(t,e)}async function xl(t,e,r){return Sg(e,r)?!0:r.field!=="plan"||e.phase!=="build"?!1:(await Rl(t,e.classic?.plan??null)).status==="broken"}function Ll(t){return t.phase==="design"||t.phase==="build"||t.phase==="verify"}function ce(t){return t.changeDir?K.basename(t.changeDir):null}var Eg=new Set(["design","plan","verify","verification","verification-report","report"]);function Ol(t){return t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function _g(t,e){return[e.classic?.designDoc,e.classic?.plan,e.classic?.verificationReport].some(n=>n&&We(n)===We(t))}function Pg(t,e){let n=(t.split("/").at(-1)??t).replace(/\.[^.]+$/u,"");if(n===e)return!0;let i=[...Eg].map(Ol).join("|");return new RegExp(`(^|[-_.])${Ol(e)}[-_.](${i})$`,"u").test(n)}async function xg(t,e){let r=await No(e),n=r.find(s=>_g(t,s));if(n)return{governing:n,match:"recorded"};let o=r.filter(Ll).filter(s=>{let a=ce(s);return a!==null&&Pg(t,a)}).sort((s,a)=>(ce(a)?.length??0)-(ce(s)?.length??0))[0];return o?{governing:o,match:"named"}:null}async function Al(t,e,r){let n=await No(t);if(n.length===0)return null;if(r)return n.find(s=>ce(s)===r)??{blockedResult:Ut(e,`selected change '${r}' is no longer active`)};let i=await Cl(t);if(i.status==="stale")return{blockedResult:Ut(e,i.reason)};if(i.status==="selected"){let o=n.find(s=>ce(s)===i.selection.change);return o||{blockedResult:Ut(e,`selected change '${i.selection.change}' is no longer active`)}}if(n.length===1){let o=n[0];if(o.changeDir!==null){let s=await nn(o.changeDir,{heal:!1,cwd:t}),a=ce(o)??"unknown";if(s.status==="drift")return{blockedResult:Ut(e,on(a,s.boundBranch,s.currentBranch))};if(s.status==="unbound-detached")return{blockedResult:Ut(e,sn(a))}}return o}return{blockedResult:Wg(e,n.map(o=>ce(o)).filter(Boolean))}}async function Og(t,e,r,n){let i=`${$(e,r.changesDir)}/`;if(t.startsWith(i)){let o=t.slice(i.length),[s]=o.split("/");if(s&&s!=="archive"){let a=await rt(s,e);if(a.stateExists){let c=await Nl(a.directory);return c||{changeDir:a.directory,phase:"open",classic:null,archived:!1}}return{changeDir:a.directory,phase:"open",classic:null,archived:!1}}}if(Il(t,Tl(e,r))){let o=await xg(t,e);if(o?.match==="recorded")return{...o.governing,superpowersArtifact:"matched"};let s=Cg(t,kg(e,r));if(o)return s?{...o.governing,superpowersArtifact:await xl(e,o.governing,s)?"matched":"unmatched",superpowersSlot:s}:{...o.governing,superpowersArtifact:"matched"};if(s){let l=await Al(e,t,n);return!l||"blockedResult"in l?l:{...l,superpowersArtifact:await xl(e,l,s)?"matched":"unmatched",superpowersSlot:s}}let a=await No(e),c=n?a.find(l=>ce(l)===n)??null:a[0]??null;return c?{...c,superpowersArtifact:"unmatched"}:null}return Al(e,t,n)}function Ag(t){return!t.includes("/")&&t.endsWith(".md")}function Ng(t){return t.startsWith(".comet/")||t.includes("/.comet/")}function Rg(t){return t===".superpowers"||t.startsWith(".superpowers/")}function Tg(t,e,r){if(!t.startsWith(r))return null;let n=t.endsWith("/.comet.yaml")||t.endsWith("/.openspec.yaml"),i=t.endsWith("/proposal.md")||t.endsWith("/design.md")||t.endsWith("/tasks.md"),o=t.includes("/.comet/"),s=t.includes("/specs/");return e==="open"&&(i||n||o||s)?`${t} (phase: open, openspec artifacts)`:e==="design"&&(i||n||o||s)?`${t} (phase: design, handoff/spec)`:e==="build"&&(t.endsWith("/tasks.md")||n||s)?`${t} (phase: build, spec/tasks)`:e==="verify"&&n?`${t} (phase: verify, state)`:e==="archive"&&n?`${t} (phase: archive, state)`:null}function Ig(t,e,r){return $l(t,e,e,r,e==="open"?[" BLOCKED: source writes are not allowed during open"," This phase does not allow source writes"," ALLOWED: create proposal/design/tasks artifacts and run guard"," NEXT: finish clarification and artifacts, then run guard --apply"]:e==="design"?[" BLOCKED: source writes are not allowed during design"," This phase does not allow source writes"," ALLOWED: run brainstorming, create the Design Doc, and run guard"," NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"]:e==="verify"?[" BLOCKED: implementation writes are not allowed during verify"," This phase allows verification reports and state updates only"," NEXT: run verify-fail and return to build before repairing implementation"]:[" BLOCKED: source writes are not allowed during archive"," This phase does not allow source writes"," ALLOWED: confirm archive state and run the archive script"])}function $l(t,e,r,n,i){let o=El(r,n);return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e}`,` Target file: ${t}`,"",` ${o.summary}`,` RELAY TO USER: ${o.user_message}`,"",...i,""].join(`
145
+ `))}function jg(t,e){return $l(t,"build (workflow: full), but design_doc is empty","build",e,[" BLOCKED: full workflow source writes require a recorded Design Doc"," This phase does not allow source writes until design_doc is recorded"," NEXT: return to design, create/link the Design Doc, then run guard again"])}function Lg(t,e,r,n,i){let o=ce(e)??"<change-name>",s=r.status==="missing",a=s?"classic-build-plan-missing":"classic-build-plan-broken",c=s?"plan is not recorded":"the recorded plan path does not resolve to a file",l=s?[]:[`RECORDED_PLAN: ${r.recordedPath}`],u=e.changeDir?$(n,e.changeDir):"<classic-change-dir>",f=$(n,i.superpowersPlansDir),d=s?`comet state set ${o} plan <repository-relative-plan-path>`:`comet state set ${o} plan <new-repository-relative-plan-path>`,h=s?["2. Load the Superpowers writing-plans Skill.",`3. Read the Design Doc path from "comet state get ${o} design_doc" and read ${u}/tasks.md.`,`4. Create the implementation plan under ${f}/.`,"5. Record the plan path:",` ${d}`]:[`2. Restore the plan file at ${r.recordedPath}, or load the Superpowers writing-plans Skill and create a replacement under ${f}/.`,"3. When creating a replacement, record its path:",` ${d}`];return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",`ERROR_CODE: ${a}`,`CHANGE: ${o}`,"WORKFLOW: full","PHASE: build",`TARGET: ${t}`,`STATE: ${c}`,...l,"","BLOCKED: project source writes require a ready Superpowers implementation plan.","","ALLOWED_RECOVERY_WRITES:",`- ${f}/<plan-file>.md`,"- Comet state updates performed by the comet CLI",`- ${u} artifacts allowed by the build phase`,"","RECOVERY:",`1. Invoke /comet-build for ${o} and resume Step 1.`,...h,`${s?"6":"4"}. Verify recovery:`,` comet state check ${o} build --recover`,"","SUCCESS: plan is reported as DONE and recovery advances beyond plan creation.",`RETRY: retry the original Write/Edit for ${t} only after SUCCESS.`,"PROHIBITED: do not treat tasks.md as the implementation plan or write project source before SUCCESS.","If writing-plans is unavailable, stop and report the missing Skill instead of bypassing this check.",""].join(`
146
+ `))}function $g(t,e){let r=e.superpowersSlot,n=r?jl(e,r):null,i=r?e.phase!==r.phase?[` BLOCKED: ${r.wireField} cannot be first-written in phase ${e.phase}`,` Expected phase: ${r.phase}`," NEXT: resume the matching Comet phase or use an already recorded artifact path"]:n?[` BLOCKED: ${r.wireField} is already recorded for this change`,` Recorded path: ${n}`," NEXT: write the recorded artifact or explicitly correct the state path"]:[" BLOCKED: standard Superpowers artifact state is incomplete"," NEXT: validate the active change state, then retry the matching phase"]:[" BLOCKED: unmatched Superpowers artifact"," This docs/superpowers/ path does not match any active change artifact"," NEXT: use a recorded artifact path or a standard phase artifact directory"];return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e.phase}`,` Target file: ${t}`,"",...i,""].join(`
147
+ `))}function Wg(t,e){return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: multiple active changes require a current change",` Target file: ${t}`,` Active changes: ${e.join(", ")}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
148
148
  `))}function Ut(t,e){return ee(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: current change selection is stale or invalid",` Target file: ${t}`,` Reason: ${e}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
149
- `))}async function Wg(t,e,r,n=Uc){try{if((await n(t,[e])).projectTargets.length===0)return X(`${e} (outside guarded project)`)}catch(u){return ee(2,[`[COMET-HOOK] blocked: scope could not be determined safely for ${e}.`,`REASON: ${u instanceof Error?u.message:String(u)}`,"NEXT: verify that the project root is accessible, then retry the write."].join(`
150
- `))}let i=await yg(e,t),o;try{o=await ho(t)}catch(u){return ee(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(Ag(i))return X(`${i} (whitelist: comet config)`);if(Ng(i))return X(`${i} (whitelist: superpowers workspace)`);if(i==="CLAUDE.md"||i==="CHANGELOG.md"||i==="README.md"||Og(i))return X(`${i} (whitelist: root markdown)`);let s=await yo(t,e,[K.join(t,".comet"),o.openSpecRoot,o.superpowersRoot]);if(s)return X(s);let a;try{a=await xg(i,t,o,r)}catch(u){return ee(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(!a)return X("no active comet change");if("blockedResult"in a)return a.blockedResult;if(a.archived)return X(`${i} (own change archived)`);let c=a.phase,l=Rg(i,c,`${$(t,o.openSpecRoot)}/`);if(l)return X(l);if(Il(i,Tl(t,o))){if(a.superpowersArtifact==="matched"&&Ll(a))return X(`${i} (phase: ${c}, superpowers)`);if(a.superpowersArtifact==="unmatched")return Lg(i,a)}if(a.invalidState)return ee(2,`[COMET-HOOK] blocked: active Classic state is invalid; repair .comet.yaml before writing ${i}`);if(c==="build"&&a.classic?.workflow==="full"&&!a.classic.designDoc)return Ig(i,Ao(a.classic?.language));if(c==="build"&&a.classic?.workflow==="full"){let u=await Rl(t,a.classic.plan);if(u.status!=="ready")return jg(i,a,u,t,o)}return c==="build"?X(`${i} (phase: ${c})`):Tg(i,c,Ao(a.classic?.language))}var Wl=async t=>{let e=gg(t),r=hg();return r?Wg(e,r):X("no file path in tool input")};function qg(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.envelope===void 0?{}:{summary:e.envelope.summary,...e.envelope.next===void 0?{}:{next:e.envelope.next},...e.envelope.user_message===void 0?{}:{user_message:e.envelope.user_message}},...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
151
- `,...e.envelope===void 0?{}:{envelope:e.envelope}}}async function ql(t,e,r=process.argv.slice(2)){let n=r.includes("--json"),i=r.filter(a=>a!=="--json"),o;try{o=await e(i,{json:n})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=n?qg(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
149
+ `))}async function qg(t,e,r,n=Uc){try{if((await n(t,[e])).projectTargets.length===0)return X(`${e} (outside guarded project)`)}catch(u){return ee(2,[`[COMET-HOOK] blocked: scope could not be determined safely for ${e}.`,`REASON: ${u instanceof Error?u.message:String(u)}`,"NEXT: verify that the project root is accessible, then retry the write."].join(`
150
+ `))}let i=await bg(e,t),o;try{o=await ho(t)}catch(u){return ee(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(Ng(i))return X(`${i} (whitelist: comet config)`);if(Rg(i))return X(`${i} (whitelist: superpowers workspace)`);if(i==="CLAUDE.md"||i==="CHANGELOG.md"||i==="README.md"||Ag(i))return X(`${i} (whitelist: root markdown)`);let s=await yo(t,e,[K.join(t,".comet"),o.openSpecRoot,o.superpowersRoot]);if(s)return X(s);let a;try{a=await Og(i,t,o,r)}catch(u){return ee(2,`[COMET-HOOK] blocked: ${u instanceof Error?u.message:String(u)}`)}if(!a)return X("no active comet change");if("blockedResult"in a)return a.blockedResult;if(a.archived)return X(`${i} (own change archived)`);let c=a.phase,l=Tg(i,c,`${$(t,o.openSpecRoot)}/`);if(l)return X(l);if(Il(i,Tl(t,o))){if(a.superpowersArtifact==="matched"&&Ll(a))return X(`${i} (phase: ${c}, superpowers)`);if(a.superpowersArtifact==="unmatched")return $g(i,a)}if(a.invalidState)return ee(2,`[COMET-HOOK] blocked: active Classic state is invalid; repair .comet.yaml before writing ${i}`);if(c==="build"&&a.classic?.workflow==="full"&&!a.classic.designDoc)return jg(i,Ao(a.classic?.language));if(c==="build"&&a.classic?.workflow==="full"){let u=await Rl(t,a.classic.plan);if(u.status!=="ready")return Lg(i,a,u,t,o)}return c==="build"?X(`${i} (phase: ${c})`):Ig(i,c,Ao(a.classic?.language))}var Wl=async t=>{let e=wg(t),r=gg();return r?qg(e,r):X("no file path in tool input")};function ql(t,e){if(!e.includes("--help")&&!e.includes("-h"))return;let n={state:["comet state <command> [args]","init <change-name> <full|hotfix|tweak> [--isolation <current|branch|worktree>]","get <change-name> <field>","set <change-name> <field> <value>","transition <change-name> <event>","check <change-name> <phase> [--recover]","scale <change-name>","record-check <change-name> <build|verify> --command <text> --exit-code <int> [--cwd <path>]","task-checkoff <file> <task-text>","select <change-name> | rebind <change-name> | next <change-name>","current | clear-selection"],guard:["comet guard <change-name> <open|design|build|verify|archive> [--apply]","Checks only by default; --apply advances the phase after all checks pass."],handoff:["comet handoff <change-name> design --write [--full]","comet handoff <change-name> --hash-only"],archive:["comet archive <change-name> [--dry-run]"],validate:["comet classic validate <change-name>"],workspace:["comet classic workspace prepare <change-name> --isolation <current|branch|worktree> [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]","comet classic workspace resolve <change-name>"]}[t];return n?`Usage: ${n.join(`
151
+ `)}
152
+
153
+ Options: --json (machine-readable output), --help
154
+ Unknown options are rejected; command placeholders must be replaced with actual values.
155
+ `:void 0}function Dg(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.data===void 0?{}:{data:e.data},...e.envelope===void 0?{}:{summary:e.envelope.summary,...e.envelope.next===void 0?{}:{next:e.envelope.next},...e.envelope.user_message===void 0?{}:{user_message:e.envelope.user_message}},...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
156
+ `,...e.envelope===void 0?{}:{envelope:e.envelope}}}async function Dl(t,e,r=process.argv.slice(2)){let n=r.includes("--json"),i=r.filter(a=>a!=="--json"),o;try{let a=ql(t,i);o=a?{exitCode:0,stdout:a}:await e(i,{json:n})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=n?Dg(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
152
157
  `)?"":`
153
- `)),s.exitCode}process.exitCode=await ql("hook-guard",Wl);
158
+ `)),s.exitCode}process.exitCode=await Dl("hook-guard",Wl);