@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
@@ -2,22 +2,22 @@
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
4
  var cd=Object.create;var Fo=Object.defineProperty;var ld=Object.getOwnPropertyDescriptor;var ud=Object.getOwnPropertyNames;var dd=Object.getPrototypeOf,fd=Object.prototype.hasOwnProperty;var jr=(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 w=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var v=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var hd=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ud(e))!fd.call(t,n)&&n!==r&&Fo(t,n,{get:()=>e[n],enumerable:!(i=ld(e,n))||i.enumerable});return t};var Pt=(t,e,r)=>(r=t!=null?cd(dd(t)):{},hd(e||!t||!t.__esModule?Fo(r,"default",{value:t,enumerable:!0}):r,t));var P=v(B=>{"use strict";var pn=Symbol.for("yaml.alias"),Vo=Symbol.for("yaml.document"),$r=Symbol.for("yaml.map"),qo=Symbol.for("yaml.pair"),mn=Symbol.for("yaml.scalar"),Or=Symbol.for("yaml.seq"),pe=Symbol.for("yaml.node.type"),pd=t=>!!t&&typeof t=="object"&&t[pe]===pn,md=t=>!!t&&typeof t=="object"&&t[pe]===Vo,vd=t=>!!t&&typeof t=="object"&&t[pe]===$r,gd=t=>!!t&&typeof t=="object"&&t[pe]===qo,Wo=t=>!!t&&typeof t=="object"&&t[pe]===mn,wd=t=>!!t&&typeof t=="object"&&t[pe]===Or;function zo(t){if(t&&typeof t=="object")switch(t[pe]){case $r:case Or:return!0}return!1}function yd(t){if(t&&typeof t=="object")switch(t[pe]){case pn:case $r:case mn:case Or:return!0}return!1}var Nd=t=>(Wo(t)||zo(t))&&!!t.anchor;B.ALIAS=pn;B.DOC=Vo;B.MAP=$r;B.NODE_TYPE=pe;B.PAIR=qo;B.SCALAR=mn;B.SEQ=Or;B.hasAnchor=Nd;B.isAlias=pd;B.isCollection=zo;B.isDocument=md;B.isMap=vd;B.isNode=yd;B.isPair=gd;B.isScalar=Wo;B.isSeq=wd});var Rt=v(vn=>{"use strict";var H=P(),q=Symbol("break visit"),Jo=Symbol("skip children"),ne=Symbol("remove node");function Hr(t,e){let r=Go(e);H.isDocument(t)?at(null,t.contents,r,Object.freeze([t]))===ne&&(t.contents=null):at(null,t,r,Object.freeze([]))}Hr.BREAK=q;Hr.SKIP=Jo;Hr.REMOVE=ne;function at(t,e,r,i){let n=Uo(t,e,r,i);if(H.isNode(n)||H.isPair(n))return Ko(t,i,n),at(t,n,r,i);if(typeof n!="symbol"){if(H.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=at(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===q)return q;o===ne&&(e.items.splice(a,1),a-=1)}}}else if(H.isPair(e)){i=Object.freeze(i.concat(e));let a=at("key",e.key,r,i);if(a===q)return q;a===ne&&(e.key=null);let o=at("value",e.value,r,i);if(o===q)return q;o===ne&&(e.value=null)}}return n}async function Dr(t,e){let r=Go(e);H.isDocument(t)?await ot(null,t.contents,r,Object.freeze([t]))===ne&&(t.contents=null):await ot(null,t,r,Object.freeze([]))}Dr.BREAK=q;Dr.SKIP=Jo;Dr.REMOVE=ne;async function ot(t,e,r,i){let n=await Uo(t,e,r,i);if(H.isNode(n)||H.isPair(n))return Ko(t,i,n),ot(t,n,r,i);if(typeof n!="symbol"){if(H.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=await ot(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===q)return q;o===ne&&(e.items.splice(a,1),a-=1)}}}else if(H.isPair(e)){i=Object.freeze(i.concat(e));let a=await ot("key",e.key,r,i);if(a===q)return q;a===ne&&(e.key=null);let o=await ot("value",e.value,r,i);if(o===q)return q;o===ne&&(e.value=null)}}return n}function Go(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 Uo(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(H.isMap(e))return r.Map?.(t,e,i);if(H.isSeq(e))return r.Seq?.(t,e,i);if(H.isPair(e))return r.Pair?.(t,e,i);if(H.isScalar(e))return r.Scalar?.(t,e,i);if(H.isAlias(e))return r.Alias?.(t,e,i)}function Ko(t,e,r){let i=e[e.length-1];if(H.isCollection(i))i.items[t]=r;else if(H.isPair(i))t==="key"?i.key=r:i.value=r;else if(H.isDocument(i))i.contents=r;else{let n=H.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}vn.visit=Hr;vn.visitAsync=Dr});var gn=v(Xo=>{"use strict";var Yo=P(),bd=Rt(),kd={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Sd=t=>t.replace(/[!,[\]{}]/g,e=>kd[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 i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[a,o]=i;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let a=this.tags[i];if(a)try{return a+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+Sd(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&Yo.isNode(e.contents)){let a={};bd.visit(e.contents,(o,s)=>{Yo.isNode(s)&&s.tag&&(a[s.tag]=!0)}),n=Object.keys(a)}else n=[];for(let[a,o]of i)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
5
- `)}};At.defaultYaml={explicit:!1,version:"1.2"};At.defaultTags={"!!":"tag:yaml.org,2002:"};Xo.Directives=At});var Lr=v(_t=>{"use strict";var Qo=P(),Ed=Rt();function Cd(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 Zo(t){let e=new Set;return Ed.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function es(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function xd(t,e){let r=[],i=new Map,n=null;return{onAnchor:a=>{r.push(a),n??(n=Zo(t));let o=es(e,n);return n.add(o),o},setAnchors:()=>{for(let a of r){let o=i.get(a);if(typeof o=="object"&&o.anchor&&(Qo.isScalar(o.node)||Qo.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:i}}_t.anchorIsValid=Cd;_t.anchorNames=Zo;_t.createNodeAnchors=xd;_t.findNewAnchor=es});var wn=v(ts=>{"use strict";function It(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,a=i.length;n<a;++n){let o=i[n],s=It(t,i,String(n),o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let a=i.get(n),o=It(t,i,n,a);o===void 0?i.delete(n):o!==a&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let a=It(t,i,n,n);a===void 0?i.delete(n):a!==n&&(i.delete(n),i.add(a))}else for(let[n,a]of Object.entries(i)){let o=It(t,i,n,a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}return t.call(e,r,i)}ts.applyReviver=It});var Se=v(is=>{"use strict";var Pd=P();function rs(t,e,r){if(Array.isArray(t))return t.map((i,n)=>rs(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!Pd.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=a=>{i.res=a,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}is.toJS=rs});var Br=v(as=>{"use strict";var Rd=wn(),ns=P(),Ad=Se(),yn=class{constructor(e){Object.defineProperty(this,ns.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:i,onAnchor:n,reviver:a}={}){if(!ns.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=Ad.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?Rd.applyReviver(a,{"":s},"",s):s}};as.NodeBase=yn});var Tt=v(os=>{"use strict";var _d=Lr(),Id=Rt(),st=P(),Td=Br(),jd=Se(),Nn=class extends Td.NodeBase{constructor(e){super(st.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 i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],Id.visit(e,{Node:(a,o)=>{(st.isAlias(o)||st.hasAnchor(o))&&i.push(o)}}),r&&(r.aliasResolveCache=i));let n;for(let a of i){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:a}=r,o=this.resolve(n,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(o);if(s||(jd.toJS(o,null,r),s=i.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=Mr(n,o,i)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(_d.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}};function Mr(t,e,r){if(st.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(st.isCollection(e)){let i=0;for(let n of e.items){let a=Mr(t,n,r);a>i&&(i=a)}return i}else if(st.isPair(e)){let i=Mr(t,e.key,r),n=Mr(t,e.value,r);return Math.max(i,n)}return 1}os.Alias=Nn});var T=v(bn=>{"use strict";var $d=P(),Od=Br(),Hd=Se(),Dd=t=>!t||typeof t!="function"&&typeof t!="object",Ee=class extends Od.NodeBase{constructor(e){super($d.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Hd.toJS(this.value,e,r)}toString(){return String(this.value)}};Ee.BLOCK_FOLDED="BLOCK_FOLDED";Ee.BLOCK_LITERAL="BLOCK_LITERAL";Ee.PLAIN="PLAIN";Ee.QUOTE_DOUBLE="QUOTE_DOUBLE";Ee.QUOTE_SINGLE="QUOTE_SINGLE";bn.Scalar=Ee;bn.isScalarValue=Dd});var jt=v(cs=>{"use strict";var Ld=Tt(),ze=P(),ss=T(),Bd="tag:yaml.org,2002:";function Md(t,e,r){if(e){let i=r.filter(a=>a.tag===e),n=i.find(a=>!a.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function Fd(t,e,r){if(ze.isDocument(t)&&(t=t.contents),ze.isNode(t))return t;if(ze.isPair(t)){let u=r.schema[ze.MAP].createNode?.(r.schema,null,r);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new Ld.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=Bd+e.slice(2));let l=Md(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new ss.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[ze.MAP]:Symbol.iterator in Object(t)?o[ze.SEQ]:o[ze.MAP]}a&&(a(l),delete r.onTagObj);let f=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new ss.Scalar(t);return e?f.tag=e:l.default||(f.tag=l.tag),c&&(c.node=f),f}cs.createNode=Fd});var Vr=v(Fr=>{"use strict";var Vd=jt(),ae=P(),qd=Br();function kn(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=i,i=o}else i=new Map([[a,i]])}return Vd.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var ls=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Sn=class extends qd.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(i=>ae.isNode(i)||ae.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(ls(e))this.add(r);else{let[i,...n]=e,a=this.get(i,!0);if(ae.isCollection(a))a.addIn(n,r);else if(a===void 0&&this.schema)this.set(i,kn(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(ae.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,a=this.get(i,!0);return n.length===0?!r&&ae.isScalar(a)?a.value:a:ae.isCollection(a)?a.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ae.isPair(r))return!1;let i=r.value;return i==null||e&&ae.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return ae.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let a=this.get(i,!0);if(ae.isCollection(a))a.setIn(n,r);else if(a===void 0&&this.schema)this.set(i,kn(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};Fr.Collection=Sn;Fr.collectionFromPath=kn;Fr.isEmptyPath=ls});var $t=v(qr=>{"use strict";var Wd=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function En(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var zd=(t,e,r)=>t.endsWith(`
5
+ `)}};At.defaultYaml={explicit:!1,version:"1.2"};At.defaultTags={"!!":"tag:yaml.org,2002:"};Xo.Directives=At});var Lr=v(_t=>{"use strict";var Qo=P(),Ed=Rt();function xd(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 Zo(t){let e=new Set;return Ed.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function es(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function Cd(t,e){let r=[],i=new Map,n=null;return{onAnchor:a=>{r.push(a),n??(n=Zo(t));let o=es(e,n);return n.add(o),o},setAnchors:()=>{for(let a of r){let o=i.get(a);if(typeof o=="object"&&o.anchor&&(Qo.isScalar(o.node)||Qo.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:i}}_t.anchorIsValid=xd;_t.anchorNames=Zo;_t.createNodeAnchors=Cd;_t.findNewAnchor=es});var wn=v(ts=>{"use strict";function It(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,a=i.length;n<a;++n){let o=i[n],s=It(t,i,String(n),o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let a=i.get(n),o=It(t,i,n,a);o===void 0?i.delete(n):o!==a&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let a=It(t,i,n,n);a===void 0?i.delete(n):a!==n&&(i.delete(n),i.add(a))}else for(let[n,a]of Object.entries(i)){let o=It(t,i,n,a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}return t.call(e,r,i)}ts.applyReviver=It});var Se=v(is=>{"use strict";var Pd=P();function rs(t,e,r){if(Array.isArray(t))return t.map((i,n)=>rs(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!Pd.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=a=>{i.res=a,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}is.toJS=rs});var Br=v(as=>{"use strict";var Rd=wn(),ns=P(),Ad=Se(),yn=class{constructor(e){Object.defineProperty(this,ns.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:i,onAnchor:n,reviver:a}={}){if(!ns.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=Ad.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?Rd.applyReviver(a,{"":s},"",s):s}};as.NodeBase=yn});var Tt=v(os=>{"use strict";var _d=Lr(),Id=Rt(),st=P(),Td=Br(),jd=Se(),Nn=class extends Td.NodeBase{constructor(e){super(st.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 i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],Id.visit(e,{Node:(a,o)=>{(st.isAlias(o)||st.hasAnchor(o))&&i.push(o)}}),r&&(r.aliasResolveCache=i));let n;for(let a of i){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:a}=r,o=this.resolve(n,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(o);if(s||(jd.toJS(o,null,r),s=i.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=Mr(n,o,i)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(_d.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}};function Mr(t,e,r){if(st.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(st.isCollection(e)){let i=0;for(let n of e.items){let a=Mr(t,n,r);a>i&&(i=a)}return i}else if(st.isPair(e)){let i=Mr(t,e.key,r),n=Mr(t,e.value,r);return Math.max(i,n)}return 1}os.Alias=Nn});var T=v(bn=>{"use strict";var $d=P(),Od=Br(),Hd=Se(),Dd=t=>!t||typeof t!="function"&&typeof t!="object",Ee=class extends Od.NodeBase{constructor(e){super($d.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Hd.toJS(this.value,e,r)}toString(){return String(this.value)}};Ee.BLOCK_FOLDED="BLOCK_FOLDED";Ee.BLOCK_LITERAL="BLOCK_LITERAL";Ee.PLAIN="PLAIN";Ee.QUOTE_DOUBLE="QUOTE_DOUBLE";Ee.QUOTE_SINGLE="QUOTE_SINGLE";bn.Scalar=Ee;bn.isScalarValue=Dd});var jt=v(cs=>{"use strict";var Ld=Tt(),ze=P(),ss=T(),Bd="tag:yaml.org,2002:";function Md(t,e,r){if(e){let i=r.filter(a=>a.tag===e),n=i.find(a=>!a.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function Fd(t,e,r){if(ze.isDocument(t)&&(t=t.contents),ze.isNode(t))return t;if(ze.isPair(t)){let u=r.schema[ze.MAP].createNode?.(r.schema,null,r);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new Ld.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=Bd+e.slice(2));let l=Md(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new ss.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[ze.MAP]:Symbol.iterator in Object(t)?o[ze.SEQ]:o[ze.MAP]}a&&(a(l),delete r.onTagObj);let f=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new ss.Scalar(t);return e?f.tag=e:l.default||(f.tag=l.tag),c&&(c.node=f),f}cs.createNode=Fd});var Vr=v(Fr=>{"use strict";var Vd=jt(),ae=P(),qd=Br();function kn(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=i,i=o}else i=new Map([[a,i]])}return Vd.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var ls=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Sn=class extends qd.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(i=>ae.isNode(i)||ae.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(ls(e))this.add(r);else{let[i,...n]=e,a=this.get(i,!0);if(ae.isCollection(a))a.addIn(n,r);else if(a===void 0&&this.schema)this.set(i,kn(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(ae.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,a=this.get(i,!0);return n.length===0?!r&&ae.isScalar(a)?a.value:a:ae.isCollection(a)?a.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ae.isPair(r))return!1;let i=r.value;return i==null||e&&ae.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return ae.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let a=this.get(i,!0);if(ae.isCollection(a))a.setIn(n,r);else if(a===void 0&&this.schema)this.set(i,kn(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};Fr.Collection=Sn;Fr.collectionFromPath=kn;Fr.isEmptyPath=ls});var $t=v(qr=>{"use strict";var Wd=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function En(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var zd=(t,e,r)=>t.endsWith(`
6
6
  `)?En(r,e):r.includes(`
7
7
  `)?`
8
- `+En(r,e):(t.endsWith(" ")?"":" ")+r;qr.indentComment=En;qr.lineComment=zd;qr.stringifyComment=Wd});var ds=v(Ot=>{"use strict";var Jd="flow",Cn="block",Wr="quoted";function Gd(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return t;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(t.length<=c)return t;let l=[],f={},u=n-e.length;typeof i=="number"&&(i>n-Math.max(2,a)?l.push(0):u=n-i);let d,m,g=!1,h=-1,p=-1,y=-1;r===Cn&&(h=us(t,h,e.length),h!==-1&&(u=h+c));for(let k;k=t[h+=1];){if(r===Wr&&k==="\\"){switch(p=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(k===`
9
- `)r===Cn&&(h=us(t,h,e.length)),u=h+e.length+c,d=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
8
+ `+En(r,e):(t.endsWith(" ")?"":" ")+r;qr.indentComment=En;qr.lineComment=zd;qr.stringifyComment=Wd});var ds=v(Ot=>{"use strict";var Jd="flow",xn="block",Wr="quoted";function Gd(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return t;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(t.length<=c)return t;let l=[],f={},u=n-e.length;typeof i=="number"&&(i>n-Math.max(2,a)?l.push(0):u=n-i);let d,m,g=!1,h=-1,p=-1,y=-1;r===xn&&(h=us(t,h,e.length),h!==-1&&(u=h+c));for(let k;k=t[h+=1];){if(r===Wr&&k==="\\"){switch(p=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(k===`
9
+ `)r===xn&&(h=us(t,h,e.length)),u=h+e.length+c,d=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
10
10
  `&&m!==" "){let S=t[h+1];S&&S!==" "&&S!==`
11
11
  `&&S!==" "&&(d=h)}if(h>=u)if(d)l.push(d),u=d+c,d=void 0;else if(r===Wr){for(;m===" "||m===" ";)m=k,k=t[h+=1],g=!0;let S=h>y+1?h-2:p-1;if(f[S])return t;l.push(S),f[S]=!0,u=S+c,d=void 0}else g=!0}m=k}if(g&&s&&s(),l.length===0)return t;o&&o();let b=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let S=l[k],E=l[k+1]||t.length;S===0?b=`
12
12
  ${e}${t.slice(0,E)}`:(r===Wr&&f[S]&&(b+=`${t[S]}\\`),b+=`
13
13
  ${e}${t.slice(S+1,E)}`)}return b}function us(t,e,r){let i=e,n=e+1,a=t[n];for(;a===" "||a===" ";)if(e<n+r)a=t[++e];else{do a=t[++e];while(a&&a!==`
14
- `);i=e,n=e+1,a=t[n]}return i}Ot.FOLD_BLOCK=Cn;Ot.FOLD_FLOW=Jd;Ot.FOLD_QUOTED=Wr;Ot.foldFlowLines=Gd});var Dt=v(fs=>{"use strict";var Q=T(),Ce=ds(),Jr=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Gr=t=>/^(%|---|\.\.\.)/m.test(t);function Ud(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let a=0,o=0;a<n;++a)if(t[a]===`
14
+ `);i=e,n=e+1,a=t[n]}return i}Ot.FOLD_BLOCK=xn;Ot.FOLD_FLOW=Jd;Ot.FOLD_QUOTED=Wr;Ot.foldFlowLines=Gd});var Dt=v(fs=>{"use strict";var Q=T(),xe=ds(),Jr=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Gr=t=>/^(%|---|\.\.\.)/m.test(t);function Ud(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let a=0,o=0;a<n;++a)if(t[a]===`
15
15
  `){if(a-o>i)return!0;if(o=a+1,n-o<=i)return!1}return!0}function Ht(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(Gr(t)?" ":""),o="",s=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(s,c);let f=r.substr(c+2,4);switch(f){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:f.substr(0,2)==="00"?o+="\\x"+f.substr(2):o+=r.substr(c,6)}c+=5,s=c+1}break;case"n":if(i||r[c+2]==='"'||r.length<n)c+=1;else{for(o+=r.slice(s,c)+`
16
16
 
17
17
  `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)o+=`
18
- `,c+=2;o+=a,r[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+r.slice(s):r,i?o:Ce.foldFlowLines(o,a,Ce.FOLD_QUOTED,Jr(e,!1))}function xn(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
18
+ `,c+=2;o+=a,r[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+r.slice(s):r,i?o:xe.foldFlowLines(o,a,xe.FOLD_QUOTED,Jr(e,!1))}function Cn(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
19
  `)||/[ \t]\n|\n[ \t]/.test(t))return Ht(t,e);let r=e.indent||(Gr(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
- ${r}`)+"'";return e.implicitKey?i:Ce.foldFlowLines(i,r,Ce.FOLD_FLOW,Jr(e,!1))}function ct(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=Ht;else{let n=t.includes('"'),a=t.includes("'");n&&!a?i=xn:a&&!n?i=Ht:i=r?xn:Ht}return i(t,e)}var Pn;try{Pn=new RegExp(`(^|(?<!
20
+ ${r}`)+"'";return e.implicitKey?i:xe.foldFlowLines(i,r,xe.FOLD_FLOW,Jr(e,!1))}function ct(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=Ht;else{let n=t.includes('"'),a=t.includes("'");n&&!a?i=Cn:a&&!n?i=Ht:i=r?Cn:Ht}return i(t,e)}var Pn;try{Pn=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
23
  |$)`,"g")}catch{Pn=/\n+(?!\n|$)/g}function zr({comment:t,type:e,value:r},i,n,a){let{blockQuote:o,commentString:s,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(r))return ct(r,i);let l=i.indent||(i.forceBlockIndent||Gr(r)?" ":""),f=o==="literal"?!0:o==="folded"||e===Q.Scalar.BLOCK_FOLDED?!1:e===Q.Scalar.BLOCK_LITERAL?!0:!Ud(r,c,l.length);if(!r)return f?`|
@@ -27,34 +27,34 @@ ${r}`)+"'";return e.implicitKey?i:Ce.foldFlowLines(i,r,Ce.FOLD_FLOW,Jr(e,!1))}fu
27
27
  `);g===-1?u="-":r===m||g!==m.length-1?(u="+",a&&a()):u="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
28
28
  `&&(m=m.slice(0,-1)),m=m.replace(Pn,`$&${l}`));let h=!1,p,y=-1;for(p=0;p<r.length;++p){let E=r[p];if(E===" ")h=!0;else if(E===`
29
29
  `)y=p;else break}let b=r.substring(0,y<p?y+1:p);b&&(r=r.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let S=(h?l?"2":"1":"")+u;if(t&&(S+=" "+s(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!f){let E=r.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),C=!1,A=Jr(i,!0);o!=="folded"&&e!==Q.Scalar.BLOCK_FOLDED&&(A.onOverflow=()=>{C=!0});let N=Ce.foldFlowLines(`${b}${E}${m}`,l,Ce.FOLD_BLOCK,A);if(!C)return`>${S}
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),x=!1,A=Jr(i,!0);o!=="folded"&&e!==Q.Scalar.BLOCK_FOLDED&&(A.onOverflow=()=>{x=!0});let N=xe.foldFlowLines(`${b}${E}${m}`,l,xe.FOLD_BLOCK,A);if(!x)return`>${S}
31
31
  ${l}${N}`}return r=r.replace(/\n+/g,`$&${l}`),`|${S}
32
32
  ${l}${b}${r}${m}`}function Kd(t,e,r,i){let{type:n,value:a}=t,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:f}=e;if(s&&a.includes(`
33
33
  `)||f&&/[[\]{},]/.test(a))return ct(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||f||!a.includes(`
34
34
  `)?ct(a,e):zr(t,e,r,i);if(!s&&!f&&n!==Q.Scalar.PLAIN&&a.includes(`
35
35
  `))return zr(t,e,r,i);if(Gr(a)){if(c==="")return e.forceBlockIndent=!0,zr(t,e,r,i);if(s&&c===l)return ct(a,e)}let u=a.replace(/\n+/g,`$&
36
- ${c}`);if(o){let d=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m?.some(d))return ct(a,e)}return s?u:Ce.foldFlowLines(u,c,Ce.FOLD_FLOW,Jr(e,!1))}function Yd(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==Q.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Q.Scalar.QUOTE_DOUBLE);let c=f=>{switch(f){case Q.Scalar.BLOCK_FOLDED:case Q.Scalar.BLOCK_LITERAL:return n||a?ct(o.value,e):zr(o,e,r,i);case Q.Scalar.QUOTE_DOUBLE:return Ht(o.value,e);case Q.Scalar.QUOTE_SINGLE:return xn(o.value,e);case Q.Scalar.PLAIN:return Kd(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:f,defaultStringType:u}=e.options,d=n&&f||u;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}fs.stringifyString=Yd});var Lt=v(Rn=>{"use strict";var Xd=Lr(),xe=P(),Qd=$t(),Zd=Dt();function ef(t,e){let r=Object.assign({blockQuote:!0,commentString:Qd.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),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function tf(t,e){if(e.tag){let n=t.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let r,i;if(xe.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function rf(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],a=(xe.isScalar(t)||xe.isCollection(t))&&t.anchor;a&&Xd.anchorIsValid(a)&&(r.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function nf(t,e,r,i){if(xe.isPair(t))return t.toString(e,r,i);if(xe.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 n,a=xe.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=tf(e.doc.schema.tags,a));let o=rf(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,r,i):xe.isScalar(a)?Zd.stringifyString(a,e,r,i):a.toString(e,r,i);return o?xe.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
36
+ ${c}`);if(o){let d=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m?.some(d))return ct(a,e)}return s?u:xe.foldFlowLines(u,c,xe.FOLD_FLOW,Jr(e,!1))}function Yd(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==Q.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Q.Scalar.QUOTE_DOUBLE);let c=f=>{switch(f){case Q.Scalar.BLOCK_FOLDED:case Q.Scalar.BLOCK_LITERAL:return n||a?ct(o.value,e):zr(o,e,r,i);case Q.Scalar.QUOTE_DOUBLE:return Ht(o.value,e);case Q.Scalar.QUOTE_SINGLE:return Cn(o.value,e);case Q.Scalar.PLAIN:return Kd(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:f,defaultStringType:u}=e.options,d=n&&f||u;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}fs.stringifyString=Yd});var Lt=v(Rn=>{"use strict";var Xd=Lr(),Ce=P(),Qd=$t(),Zd=Dt();function ef(t,e){let r=Object.assign({blockQuote:!0,commentString:Qd.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),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function tf(t,e){if(e.tag){let n=t.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let r,i;if(Ce.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function rf(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],a=(Ce.isScalar(t)||Ce.isCollection(t))&&t.anchor;a&&Xd.anchorIsValid(a)&&(r.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function nf(t,e,r,i){if(Ce.isPair(t))return t.toString(e,r,i);if(Ce.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 n,a=Ce.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=tf(e.doc.schema.tags,a));let o=rf(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,r,i):Ce.isScalar(a)?Zd.stringifyString(a,e,r,i):a.toString(e,r,i);return o?Ce.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
37
37
  ${e.indent}${s}`:s}Rn.createStringifyContext=ef;Rn.stringify=nf});var vs=v(ms=>{"use strict";var me=P(),hs=T(),ps=Lt(),Bt=$t();function af({key:t,value:e},r,i,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:f,simpleKeys:u}}=r,d=me.isNode(t)&&t.comment||null;if(u){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(me.isCollection(t)||!me.isNode(t)&&typeof t=="object"){let A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!u&&(!t||d&&e==null&&!r.inFlow||me.isCollection(t)||(me.isScalar(t)?t.type===hs.Scalar.BLOCK_FOLDED||t.type===hs.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(u||!a),indent:s+c});let g=!1,h=!1,p=ps.stringify(t,r,()=>g=!0,()=>h=!0);if(!m&&!r.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(a||e==null)return g&&i&&i(),p===""?"?":m?`? ${p}`:p}else if(a&&!u||e==null&&m)return p=`? ${p}`,d&&!g?p+=Bt.lineComment(p,r.indent,l(d)):h&&n&&n(),p;g&&(d=null),m?(d&&(p+=Bt.lineComment(p,r.indent,l(d))),p=`? ${p}
38
- ${s}:`):(p=`${p}:`,d&&(p+=Bt.lineComment(p,r.indent,l(d))));let y,b,k;me.isNode(e)?(y=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(y=!1,b=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!m&&!d&&me.isScalar(e)&&(r.indentAtStart=p.length+1),h=!1,!f&&c.length>=2&&!r.inFlow&&!m&&me.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let S=!1,E=ps.stringify(e,r,()=>S=!0,()=>h=!0),C=" ";if(d||y||b){if(C=y?`
39
- `:"",b){let A=l(b);C+=`
40
- ${Bt.indentComment(A,r.indent)}`}E===""&&!r.inFlow?C===`
41
- `&&k&&(C=`
38
+ ${s}:`):(p=`${p}:`,d&&(p+=Bt.lineComment(p,r.indent,l(d))));let y,b,k;me.isNode(e)?(y=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(y=!1,b=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!m&&!d&&me.isScalar(e)&&(r.indentAtStart=p.length+1),h=!1,!f&&c.length>=2&&!r.inFlow&&!m&&me.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let S=!1,E=ps.stringify(e,r,()=>S=!0,()=>h=!0),x=" ";if(d||y||b){if(x=y?`
39
+ `:"",b){let A=l(b);x+=`
40
+ ${Bt.indentComment(A,r.indent)}`}E===""&&!r.inFlow?x===`
41
+ `&&k&&(x=`
42
42
 
43
- `):C+=`
43
+ `):x+=`
44
44
  ${r.indent}`}else if(!m&&me.isCollection(e)){let A=E[0],N=E.indexOf(`
45
- `),$=N!==-1,ke=r.inFlow??e.flow??e.items.length===0;if($||!ke){let nt=!1;if($&&(A==="&"||A==="!")){let O=E.indexOf(" ");A==="&"&&O!==-1&&O<N&&E[O+1]==="!"&&(O=E.indexOf(" ",O+1)),(O===-1||N<O)&&(nt=!0)}nt||(C=`
45
+ `),$=N!==-1,ke=r.inFlow??e.flow??e.items.length===0;if($||!ke){let nt=!1;if($&&(A==="&"||A==="!")){let O=E.indexOf(" ");A==="&"&&O!==-1&&O<N&&E[O+1]==="!"&&(O=E.indexOf(" ",O+1)),(O===-1||N<O)&&(nt=!0)}nt||(x=`
46
46
  ${r.indent}`)}}else(E===""||E[0]===`
47
- `)&&(C="");return p+=C+E,r.inFlow?S&&i&&i():k&&!S?p+=Bt.lineComment(p,r.indent,l(k)):h&&n&&n(),p}ms.stringifyPair=af});var _n=v(An=>{"use strict";var gs=jr("process");function of(t,...e){t==="debug"&&console.log(...e)}function sf(t,e){(t==="debug"||t==="warn")&&(typeof gs.emitWarning=="function"?gs.emitWarning(e):console.warn(e))}An.debug=of;An.warn=sf});var Qr=v(Xr=>{"use strict";var Yr=P(),ws=T(),Ur="<<",Kr={identify:t=>t===Ur||typeof t=="symbol"&&t.description===Ur,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ws.Scalar(Symbol(Ur)),{addToJSMap:ys}),stringify:()=>Ur},cf=(t,e)=>(Kr.identify(e)||Yr.isScalar(e)&&(!e.type||e.type===ws.Scalar.PLAIN)&&Kr.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Kr.tag&&r.default);function ys(t,e,r){let i=Ns(t,r);if(Yr.isSeq(i))for(let n of i.items)In(t,e,n);else if(Array.isArray(i))for(let n of i)In(t,e,n);else In(t,e,i)}function In(t,e,r){let i=Ns(t,r);if(!Yr.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[a,o]of n)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ns(t,e){return t&&Yr.isAlias(e)?e.resolve(t.doc,t):e}Xr.addMergeToJSMap=ys;Xr.isMergeKey=cf;Xr.merge=Kr});var jn=v(Ss=>{"use strict";var lf=_n(),bs=Qr(),uf=Lt(),ks=P(),Tn=Se();function df(t,e,{key:r,value:i}){if(ks.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(bs.isMergeKey(t,r))bs.addMergeToJSMap(t,e,i);else{let n=Tn.toJS(r,"",t);if(e instanceof Map)e.set(n,Tn.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let a=ff(r,n,t),o=Tn.toJS(i,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function ff(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(ks.isNode(t)&&r?.doc){let i=uf.createStringifyContext(r.doc,{});i.anchors=new Set;for(let a of r.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),lf.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}Ss.addPairToJSMap=df});var Pe=v($n=>{"use strict";var Es=jt(),hf=vs(),pf=jn(),Zr=P();function mf(t,e,r){let i=Es.createNode(t,void 0,r),n=Es.createNode(e,void 0,r);return new ei(i,n)}var ei=class t{constructor(e,r=null){Object.defineProperty(this,Zr.NODE_TYPE,{value:Zr.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return Zr.isNode(r)&&(r=r.clone(e)),Zr.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return pf.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?hf.stringifyPair(this,e,r,i):JSON.stringify(this)}};$n.Pair=ei;$n.createPair=mf});var On=v(xs=>{"use strict";var Je=P(),Cs=Lt(),ti=$t();function vf(t,e,r){return(e.inFlow??t.flow?wf:gf)(t,e,r)}function gf({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=r,f=Object.assign({},r,{indent:a,type:null}),u=!1,d=[];for(let g=0;g<e.length;++g){let h=e[g],p=null;if(Je.isNode(h))!u&&h.spaceBefore&&d.push(""),ri(r,d,h.commentBefore,u),h.comment&&(p=h.comment);else if(Je.isPair(h)){let b=Je.isNode(h.key)?h.key:null;b&&(!u&&b.spaceBefore&&d.push(""),ri(r,d,b.commentBefore,u))}u=!1;let y=Cs.stringify(h,f,()=>p=null,()=>u=!0);p&&(y+=ti.lineComment(y,a,l(p))),u&&p&&(u=!1),d.push(i+y)}let m;if(d.length===0)m=n.start+n.end;else{m=d[0];for(let g=1;g<d.length;++g){let h=d[g];m+=h?`
47
+ `)&&(x="");return p+=x+E,r.inFlow?S&&i&&i():k&&!S?p+=Bt.lineComment(p,r.indent,l(k)):h&&n&&n(),p}ms.stringifyPair=af});var _n=v(An=>{"use strict";var gs=jr("process");function of(t,...e){t==="debug"&&console.log(...e)}function sf(t,e){(t==="debug"||t==="warn")&&(typeof gs.emitWarning=="function"?gs.emitWarning(e):console.warn(e))}An.debug=of;An.warn=sf});var Qr=v(Xr=>{"use strict";var Yr=P(),ws=T(),Ur="<<",Kr={identify:t=>t===Ur||typeof t=="symbol"&&t.description===Ur,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ws.Scalar(Symbol(Ur)),{addToJSMap:ys}),stringify:()=>Ur},cf=(t,e)=>(Kr.identify(e)||Yr.isScalar(e)&&(!e.type||e.type===ws.Scalar.PLAIN)&&Kr.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Kr.tag&&r.default);function ys(t,e,r){let i=Ns(t,r);if(Yr.isSeq(i))for(let n of i.items)In(t,e,n);else if(Array.isArray(i))for(let n of i)In(t,e,n);else In(t,e,i)}function In(t,e,r){let i=Ns(t,r);if(!Yr.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[a,o]of n)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ns(t,e){return t&&Yr.isAlias(e)?e.resolve(t.doc,t):e}Xr.addMergeToJSMap=ys;Xr.isMergeKey=cf;Xr.merge=Kr});var jn=v(Ss=>{"use strict";var lf=_n(),bs=Qr(),uf=Lt(),ks=P(),Tn=Se();function df(t,e,{key:r,value:i}){if(ks.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(bs.isMergeKey(t,r))bs.addMergeToJSMap(t,e,i);else{let n=Tn.toJS(r,"",t);if(e instanceof Map)e.set(n,Tn.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let a=ff(r,n,t),o=Tn.toJS(i,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function ff(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(ks.isNode(t)&&r?.doc){let i=uf.createStringifyContext(r.doc,{});i.anchors=new Set;for(let a of r.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),lf.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}Ss.addPairToJSMap=df});var Pe=v($n=>{"use strict";var Es=jt(),hf=vs(),pf=jn(),Zr=P();function mf(t,e,r){let i=Es.createNode(t,void 0,r),n=Es.createNode(e,void 0,r);return new ei(i,n)}var ei=class t{constructor(e,r=null){Object.defineProperty(this,Zr.NODE_TYPE,{value:Zr.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return Zr.isNode(r)&&(r=r.clone(e)),Zr.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return pf.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?hf.stringifyPair(this,e,r,i):JSON.stringify(this)}};$n.Pair=ei;$n.createPair=mf});var On=v(Cs=>{"use strict";var Je=P(),xs=Lt(),ti=$t();function vf(t,e,r){return(e.inFlow??t.flow?wf:gf)(t,e,r)}function gf({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=r,f=Object.assign({},r,{indent:a,type:null}),u=!1,d=[];for(let g=0;g<e.length;++g){let h=e[g],p=null;if(Je.isNode(h))!u&&h.spaceBefore&&d.push(""),ri(r,d,h.commentBefore,u),h.comment&&(p=h.comment);else if(Je.isPair(h)){let b=Je.isNode(h.key)?h.key:null;b&&(!u&&b.spaceBefore&&d.push(""),ri(r,d,b.commentBefore,u))}u=!1;let y=xs.stringify(h,f,()=>p=null,()=>u=!0);p&&(y+=ti.lineComment(y,a,l(p))),u&&p&&(u=!1),d.push(i+y)}let m;if(d.length===0)m=n.start+n.end;else{m=d[0];for(let g=1;g<d.length;++g){let h=d[g];m+=h?`
48
48
  ${c}${h}`:`
49
49
  `}}return t?(m+=`
50
- `+ti.indentComment(l(t),c),s&&s()):u&&o&&o(),m}function wf({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;i+=a;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,f=0,u=[];for(let g=0;g<t.length;++g){let h=t[g],p=null;if(Je.isNode(h))h.spaceBefore&&u.push(""),ri(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(Je.isPair(h)){let b=Je.isNode(h.key)?h.key:null;b&&(b.spaceBefore&&u.push(""),ri(e,u,b.commentBefore,!1),b.comment&&(l=!0));let k=Je.isNode(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(l=!0)):h.value==null&&b?.comment&&(p=b.comment)}p&&(l=!0);let y=Cs.stringify(h,c,()=>p=null);l||(l=u.length>f||y.includes(`
50
+ `+ti.indentComment(l(t),c),s&&s()):u&&o&&o(),m}function wf({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;i+=a;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,f=0,u=[];for(let g=0;g<t.length;++g){let h=t[g],p=null;if(Je.isNode(h))h.spaceBefore&&u.push(""),ri(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(Je.isPair(h)){let b=Je.isNode(h.key)?h.key:null;b&&(b.spaceBefore&&u.push(""),ri(e,u,b.commentBefore,!1),b.comment&&(l=!0));let k=Je.isNode(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(l=!0)):h.value==null&&b?.comment&&(p=b.comment)}p&&(l=!0);let y=xs.stringify(h,c,()=>p=null);l||(l=u.length>f||y.includes(`
51
51
  `)),g<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((b,k)=>b+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),p&&(y+=ti.lineComment(y,i,s(p))),u.push(y),f=u.length}let{start:d,end:m}=r;if(u.length===0)return d+m;if(!l){let g=u.reduce((h,p)=>h+p.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=d;for(let h of u)g+=h?`
52
52
  ${a}${n}${h}`:`
53
53
  `;return`${g}
54
- ${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function ri({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=ti.indentComment(e(i),t);r.push(a.trimStart())}}xs.stringifyCollection=vf});var Ae=v(Dn=>{"use strict";var yf=On(),Nf=jn(),bf=Vr(),Re=P(),ii=Pe(),kf=T();function Mt(t,e){let r=Re.isScalar(e)?e.value:e;for(let i of t)if(Re.isPair(i)&&(i.key===e||i.key===r||Re.isScalar(i.key)&&i.key.value===r))return i}var Hn=class extends bf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Re.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(ii.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;Re.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new ii.Pair(e,e?.value):i=new ii.Pair(e.key,e.value);let n=Mt(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);Re.isScalar(n.value)&&kf.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=Mt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=Mt(this.items,e)?.value;return(!r&&Re.isScalar(n)?n.value:n)??void 0}has(e){return!!Mt(this.items,e)}set(e,r){this.add(new ii.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)Nf.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Re.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),yf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Dn.YAMLMap=Hn;Dn.findPair=Mt});var lt=v(Rs=>{"use strict";var Sf=P(),Ps=Ae(),Ef={collection:"map",default:!0,nodeClass:Ps.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Sf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Ps.YAMLMap.from(t,e,r)};Rs.map=Ef});var _e=v(As=>{"use strict";var Cf=jt(),xf=On(),Pf=Vr(),ai=P(),Rf=T(),Af=Se(),Ln=class extends Pf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ai.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=ni(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=ni(e);if(typeof i!="number")return;let n=this.items[i];return!r&&ai.isScalar(n)?n.value:n}has(e){let r=ni(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=ni(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];ai.isScalar(n)&&Rf.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(Af.toJS(a,String(n++),r));return i}toString(e,r,i){return e?xf.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(Cf.createNode(s,void 0,i))}}return a}};function ni(t){let e=ai.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}As.YAMLSeq=Ln});var ut=v(Is=>{"use strict";var _f=P(),_s=_e(),If={collection:"seq",default:!0,nodeClass:_s.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return _f.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>_s.YAMLSeq.from(t,e,r)};Is.seq=If});var Ft=v(Ts=>{"use strict";var Tf=Dt(),jf={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),Tf.stringifyString(t,e,r,i)}};Ts.string=jf});var oi=v(Os=>{"use strict";var js=T(),$s={identify:t=>t==null,createNode:()=>new js.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new js.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&$s.test.test(t)?t:e.options.nullStr};Os.nullTag=$s});var Bn=v(Ds=>{"use strict";var $f=T(),Hs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new $f.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Hs.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Ds.boolTag=Hs});var dt=v(Ls=>{"use strict";function Of({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Ls.stringifyNumber=Of});var Fn=v(si=>{"use strict";var Hf=T(),Mn=dt(),Df={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:Mn.stringifyNumber},Lf={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():Mn.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 Hf.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Mn.stringifyNumber};si.float=Bf;si.floatExp=Lf;si.floatNaN=Df});var qn=v(li=>{"use strict";var Bs=dt(),ci=t=>typeof t=="bigint"||Number.isInteger(t),Vn=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Ms(t,e,r){let{value:i}=t;return ci(i)&&i>=0?r+i.toString(e):Bs.stringifyNumber(t)}var Mf={identify:t=>ci(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Vn(t,2,8,r),stringify:t=>Ms(t,8,"0o")},Ff={identify:ci,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Vn(t,0,10,r),stringify:Bs.stringifyNumber},Vf={identify:t=>ci(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Vn(t,2,16,r),stringify:t=>Ms(t,16,"0x")};li.int=Ff;li.intHex=Vf;li.intOct=Mf});var Vs=v(Fs=>{"use strict";var qf=lt(),Wf=oi(),zf=ut(),Jf=Ft(),Gf=Bn(),Wn=Fn(),zn=qn(),Uf=[qf.map,zf.seq,Jf.string,Wf.nullTag,Gf.boolTag,zn.intOct,zn.int,zn.intHex,Wn.floatNaN,Wn.floatExp,Wn.float];Fs.schema=Uf});var zs=v(Ws=>{"use strict";var Kf=T(),Yf=lt(),Xf=ut();function qs(t){return typeof t=="bigint"||Number.isInteger(t)}var ui=({value:t})=>JSON.stringify(t),Qf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ui},{identify:t=>t==null,createNode:()=>new Kf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ui},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ui},{identify:qs,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})=>qs(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:ui}],Zf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},eh=[Yf.map,Xf.seq].concat(Qf,Zf);Ws.schema=eh});var Gn=v(Js=>{"use strict";var Vt=jr("buffer"),Jn=T(),th=Dt(),rh={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,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}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},i,n,a){if(!r)return"";let o=r,s;if(typeof Vt.Buffer=="function")s=o instanceof Vt.Buffer?o.toString("base64"):Vt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Jn.Scalar.BLOCK_LITERAL),e!==Jn.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),f=new Array(l);for(let u=0,d=0;u<l;++u,d+=c)f[u]=s.substr(d,c);s=f.join(e===Jn.Scalar.BLOCK_LITERAL?`
54
+ ${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function ri({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=ti.indentComment(e(i),t);r.push(a.trimStart())}}Cs.stringifyCollection=vf});var Ae=v(Dn=>{"use strict";var yf=On(),Nf=jn(),bf=Vr(),Re=P(),ii=Pe(),kf=T();function Mt(t,e){let r=Re.isScalar(e)?e.value:e;for(let i of t)if(Re.isPair(i)&&(i.key===e||i.key===r||Re.isScalar(i.key)&&i.key.value===r))return i}var Hn=class extends bf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Re.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(ii.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;Re.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new ii.Pair(e,e?.value):i=new ii.Pair(e.key,e.value);let n=Mt(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);Re.isScalar(n.value)&&kf.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=Mt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=Mt(this.items,e)?.value;return(!r&&Re.isScalar(n)?n.value:n)??void 0}has(e){return!!Mt(this.items,e)}set(e,r){this.add(new ii.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)Nf.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Re.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),yf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Dn.YAMLMap=Hn;Dn.findPair=Mt});var lt=v(Rs=>{"use strict";var Sf=P(),Ps=Ae(),Ef={collection:"map",default:!0,nodeClass:Ps.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Sf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Ps.YAMLMap.from(t,e,r)};Rs.map=Ef});var _e=v(As=>{"use strict";var xf=jt(),Cf=On(),Pf=Vr(),ai=P(),Rf=T(),Af=Se(),Ln=class extends Pf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ai.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=ni(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=ni(e);if(typeof i!="number")return;let n=this.items[i];return!r&&ai.isScalar(n)?n.value:n}has(e){let r=ni(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=ni(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];ai.isScalar(n)&&Rf.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(Af.toJS(a,String(n++),r));return i}toString(e,r,i){return e?Cf.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(xf.createNode(s,void 0,i))}}return a}};function ni(t){let e=ai.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}As.YAMLSeq=Ln});var ut=v(Is=>{"use strict";var _f=P(),_s=_e(),If={collection:"seq",default:!0,nodeClass:_s.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return _f.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>_s.YAMLSeq.from(t,e,r)};Is.seq=If});var Ft=v(Ts=>{"use strict";var Tf=Dt(),jf={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),Tf.stringifyString(t,e,r,i)}};Ts.string=jf});var oi=v(Os=>{"use strict";var js=T(),$s={identify:t=>t==null,createNode:()=>new js.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new js.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&$s.test.test(t)?t:e.options.nullStr};Os.nullTag=$s});var Bn=v(Ds=>{"use strict";var $f=T(),Hs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new $f.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Hs.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Ds.boolTag=Hs});var dt=v(Ls=>{"use strict";function Of({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Ls.stringifyNumber=Of});var Fn=v(si=>{"use strict";var Hf=T(),Mn=dt(),Df={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:Mn.stringifyNumber},Lf={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():Mn.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 Hf.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Mn.stringifyNumber};si.float=Bf;si.floatExp=Lf;si.floatNaN=Df});var qn=v(li=>{"use strict";var Bs=dt(),ci=t=>typeof t=="bigint"||Number.isInteger(t),Vn=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Ms(t,e,r){let{value:i}=t;return ci(i)&&i>=0?r+i.toString(e):Bs.stringifyNumber(t)}var Mf={identify:t=>ci(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Vn(t,2,8,r),stringify:t=>Ms(t,8,"0o")},Ff={identify:ci,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Vn(t,0,10,r),stringify:Bs.stringifyNumber},Vf={identify:t=>ci(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Vn(t,2,16,r),stringify:t=>Ms(t,16,"0x")};li.int=Ff;li.intHex=Vf;li.intOct=Mf});var Vs=v(Fs=>{"use strict";var qf=lt(),Wf=oi(),zf=ut(),Jf=Ft(),Gf=Bn(),Wn=Fn(),zn=qn(),Uf=[qf.map,zf.seq,Jf.string,Wf.nullTag,Gf.boolTag,zn.intOct,zn.int,zn.intHex,Wn.floatNaN,Wn.floatExp,Wn.float];Fs.schema=Uf});var zs=v(Ws=>{"use strict";var Kf=T(),Yf=lt(),Xf=ut();function qs(t){return typeof t=="bigint"||Number.isInteger(t)}var ui=({value:t})=>JSON.stringify(t),Qf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ui},{identify:t=>t==null,createNode:()=>new Kf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ui},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ui},{identify:qs,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})=>qs(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:ui}],Zf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},eh=[Yf.map,Xf.seq].concat(Qf,Zf);Ws.schema=eh});var Gn=v(Js=>{"use strict";var Vt=jr("buffer"),Jn=T(),th=Dt(),rh={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,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}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},i,n,a){if(!r)return"";let o=r,s;if(typeof Vt.Buffer=="function")s=o instanceof Vt.Buffer?o.toString("base64"):Vt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Jn.Scalar.BLOCK_LITERAL),e!==Jn.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),f=new Array(l);for(let u=0,d=0;u<l;++u,d+=c)f[u]=s.substr(d,c);s=f.join(e===Jn.Scalar.BLOCK_LITERAL?`
55
55
  `:" ")}return th.stringifyString({comment:t,type:e,value:s},i,n,a)}};Js.binary=rh});var hi=v(fi=>{"use strict";var di=P(),Un=Pe(),ih=T(),nh=_e();function Gs(t,e){if(di.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!di.isPair(i)){if(di.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Un.Pair(new ih.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
56
56
  ${n.key.commentBefore}`:i.commentBefore),i.comment){let a=n.value??n.key;a.comment=a.comment?`${i.comment}
57
- ${a.comment}`:i.comment}i=n}t.items[r]=di.isPair(i)?i:new Un.Pair(i)}}else e("Expected a sequence for this tag");return t}function Us(t,e,r){let{replacer:i}=r,n=new nh.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(Un.createPair(s,c,r))}return n}var ah={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Gs,createNode:Us};fi.createPairs=Us;fi.pairs=ah;fi.resolvePairs=Gs});var Xn=v(Yn=>{"use strict";var Ks=P(),Kn=Se(),qt=Ae(),oh=_e(),Ys=hi(),Ge=class t extends oh.YAMLSeq{constructor(){super(),this.add=qt.YAMLMap.prototype.add.bind(this),this.delete=qt.YAMLMap.prototype.delete.bind(this),this.get=qt.YAMLMap.prototype.get.bind(this),this.has=qt.YAMLMap.prototype.has.bind(this),this.set=qt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(Ks.isPair(n)?(a=Kn.toJS(n.key,"",r),o=Kn.toJS(n.value,a,r)):a=Kn.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=Ys.createPairs(e,r,i),a=new this;return a.items=n.items,a}};Ge.tag="tag:yaml.org,2002:omap";var sh={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ge,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ys.resolvePairs(t,e),i=[];for(let{key:n}of r.items)Ks.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new Ge,r)},createNode:(t,e,r)=>Ge.from(t,e,r)};Yn.YAMLOMap=Ge;Yn.omap=sh});var tc=v(Qn=>{"use strict";var Xs=T();function Qs({value:t,source:e},r){return e&&(t?Zs:ec).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Zs={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 Xs.Scalar(!0),stringify:Qs},ec={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 Xs.Scalar(!1),stringify:Qs};Qn.falseTag=ec;Qn.trueTag=Zs});var rc=v(pi=>{"use strict";var ch=T(),Zn=dt(),lh={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:Zn.stringifyNumber},uh={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():Zn.stringifyNumber(t)}},dh={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 ch.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Zn.stringifyNumber};pi.float=dh;pi.floatExp=uh;pi.floatNaN=lh});var nc=v(zt=>{"use strict";var ic=dt(),Wt=t=>typeof t=="bigint"||Number.isInteger(t);function mi(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,r);return n==="-"?-1*a:a}function ea(t,e,r){let{value:i}=t;if(Wt(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return ic.stringifyNumber(t)}var fh={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>mi(t,2,2,r),stringify:t=>ea(t,2,"0b")},hh={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>mi(t,1,8,r),stringify:t=>ea(t,8,"0")},ph={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>mi(t,0,10,r),stringify:ic.stringifyNumber},mh={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>mi(t,2,16,r),stringify:t=>ea(t,16,"0x")};zt.int=ph;zt.intBin=fh;zt.intHex=mh;zt.intOct=hh});var ra=v(ta=>{"use strict";var wi=P(),vi=Pe(),gi=Ae(),Ue=class t extends gi.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;wi.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new vi.Pair(e.key,null):r=new vi.Pair(e,null),gi.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=gi.findPair(this.items,e);return!r&&wi.isPair(i)?wi.isScalar(i.key)?i.key.value:i.key:i}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 i=gi.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new vi.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(vi.createPair(o,null,i));return a}};Ue.tag="tag:yaml.org,2002:set";var vh={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ue.from(t,e,r),resolve(t,e){if(wi.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ta.YAMLSet=Ue;ta.set=vh});var na=v(yi=>{"use strict";var gh=dt();function ia(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function ac(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return gh.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var wh={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})=>ia(t,r),stringify:ac},yh={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=>ia(t,!1),stringify:ac},oc={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(oc.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),f=e[8];if(f&&f!=="Z"){let u=ia(f,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};yi.floatTime=yh;yi.intTime=wh;yi.timestamp=oc});var lc=v(cc=>{"use strict";var Nh=lt(),bh=oi(),kh=ut(),Sh=Ft(),Eh=Gn(),sc=tc(),aa=rc(),Ni=nc(),Ch=Qr(),xh=Xn(),Ph=hi(),Rh=ra(),oa=na(),Ah=[Nh.map,kh.seq,Sh.string,bh.nullTag,sc.trueTag,sc.falseTag,Ni.intBin,Ni.intOct,Ni.int,Ni.intHex,aa.floatNaN,aa.floatExp,aa.float,Eh.binary,Ch.merge,xh.omap,Ph.pairs,Rh.set,oa.intTime,oa.floatTime,oa.timestamp];cc.schema=Ah});var yc=v(la=>{"use strict";var hc=lt(),_h=oi(),pc=ut(),Ih=Ft(),Th=Bn(),sa=Fn(),ca=qn(),jh=Vs(),$h=zs(),mc=Gn(),Jt=Qr(),vc=Xn(),gc=hi(),uc=lc(),wc=ra(),bi=na(),dc=new Map([["core",jh.schema],["failsafe",[hc.map,pc.seq,Ih.string]],["json",$h.schema],["yaml11",uc.schema],["yaml-1.1",uc.schema]]),fc={binary:mc.binary,bool:Th.boolTag,float:sa.float,floatExp:sa.floatExp,floatNaN:sa.floatNaN,floatTime:bi.floatTime,int:ca.int,intHex:ca.intHex,intOct:ca.intOct,intTime:bi.intTime,map:hc.map,merge:Jt.merge,null:_h.nullTag,omap:vc.omap,pairs:gc.pairs,seq:pc.seq,set:wc.set,timestamp:bi.timestamp},Oh={"tag:yaml.org,2002:binary":mc.binary,"tag:yaml.org,2002:merge":Jt.merge,"tag:yaml.org,2002:omap":vc.omap,"tag:yaml.org,2002:pairs":gc.pairs,"tag:yaml.org,2002:set":wc.set,"tag:yaml.org,2002:timestamp":bi.timestamp};function Hh(t,e,r){let i=dc.get(e);if(i&&!t)return r&&!i.includes(Jt.merge)?i.concat(Jt.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(dc.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(Jt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?fc[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(fc).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}la.coreKnownTags=Oh;la.getTags=Hh});var fa=v(Nc=>{"use strict";var ua=P(),Dh=lt(),Lh=ut(),Bh=Ft(),ki=yc(),Mh=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,da=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?ki.getTags(e,"compat"):e?ki.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?ki.coreKnownTags:{},this.tags=ki.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,ua.MAP,{value:Dh.map}),Object.defineProperty(this,ua.SCALAR,{value:Bh.string}),Object.defineProperty(this,ua.SEQ,{value:Lh.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Mh:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Nc.Schema=da});var kc=v(bc=>{"use strict";var Fh=P(),ha=Lt(),Gt=$t();function Vh(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=ha.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(Gt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(Fh.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let f=a(t.contents.commentBefore);r.push(Gt.indentComment(f,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=ha.stringify(t.contents,n,()=>s=null,c);s&&(l+=Gt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(ha.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
57
+ ${a.comment}`:i.comment}i=n}t.items[r]=di.isPair(i)?i:new Un.Pair(i)}}else e("Expected a sequence for this tag");return t}function Us(t,e,r){let{replacer:i}=r,n=new nh.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(Un.createPair(s,c,r))}return n}var ah={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Gs,createNode:Us};fi.createPairs=Us;fi.pairs=ah;fi.resolvePairs=Gs});var Xn=v(Yn=>{"use strict";var Ks=P(),Kn=Se(),qt=Ae(),oh=_e(),Ys=hi(),Ge=class t extends oh.YAMLSeq{constructor(){super(),this.add=qt.YAMLMap.prototype.add.bind(this),this.delete=qt.YAMLMap.prototype.delete.bind(this),this.get=qt.YAMLMap.prototype.get.bind(this),this.has=qt.YAMLMap.prototype.has.bind(this),this.set=qt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(Ks.isPair(n)?(a=Kn.toJS(n.key,"",r),o=Kn.toJS(n.value,a,r)):a=Kn.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=Ys.createPairs(e,r,i),a=new this;return a.items=n.items,a}};Ge.tag="tag:yaml.org,2002:omap";var sh={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ge,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ys.resolvePairs(t,e),i=[];for(let{key:n}of r.items)Ks.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new Ge,r)},createNode:(t,e,r)=>Ge.from(t,e,r)};Yn.YAMLOMap=Ge;Yn.omap=sh});var tc=v(Qn=>{"use strict";var Xs=T();function Qs({value:t,source:e},r){return e&&(t?Zs:ec).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Zs={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 Xs.Scalar(!0),stringify:Qs},ec={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 Xs.Scalar(!1),stringify:Qs};Qn.falseTag=ec;Qn.trueTag=Zs});var rc=v(pi=>{"use strict";var ch=T(),Zn=dt(),lh={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:Zn.stringifyNumber},uh={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():Zn.stringifyNumber(t)}},dh={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 ch.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Zn.stringifyNumber};pi.float=dh;pi.floatExp=uh;pi.floatNaN=lh});var nc=v(zt=>{"use strict";var ic=dt(),Wt=t=>typeof t=="bigint"||Number.isInteger(t);function mi(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,r);return n==="-"?-1*a:a}function ea(t,e,r){let{value:i}=t;if(Wt(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return ic.stringifyNumber(t)}var fh={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>mi(t,2,2,r),stringify:t=>ea(t,2,"0b")},hh={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>mi(t,1,8,r),stringify:t=>ea(t,8,"0")},ph={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>mi(t,0,10,r),stringify:ic.stringifyNumber},mh={identify:Wt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>mi(t,2,16,r),stringify:t=>ea(t,16,"0x")};zt.int=ph;zt.intBin=fh;zt.intHex=mh;zt.intOct=hh});var ra=v(ta=>{"use strict";var wi=P(),vi=Pe(),gi=Ae(),Ue=class t extends gi.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;wi.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new vi.Pair(e.key,null):r=new vi.Pair(e,null),gi.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=gi.findPair(this.items,e);return!r&&wi.isPair(i)?wi.isScalar(i.key)?i.key.value:i.key:i}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 i=gi.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new vi.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(vi.createPair(o,null,i));return a}};Ue.tag="tag:yaml.org,2002:set";var vh={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ue.from(t,e,r),resolve(t,e){if(wi.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ta.YAMLSet=Ue;ta.set=vh});var na=v(yi=>{"use strict";var gh=dt();function ia(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function ac(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return gh.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var wh={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})=>ia(t,r),stringify:ac},yh={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=>ia(t,!1),stringify:ac},oc={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(oc.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),f=e[8];if(f&&f!=="Z"){let u=ia(f,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};yi.floatTime=yh;yi.intTime=wh;yi.timestamp=oc});var lc=v(cc=>{"use strict";var Nh=lt(),bh=oi(),kh=ut(),Sh=Ft(),Eh=Gn(),sc=tc(),aa=rc(),Ni=nc(),xh=Qr(),Ch=Xn(),Ph=hi(),Rh=ra(),oa=na(),Ah=[Nh.map,kh.seq,Sh.string,bh.nullTag,sc.trueTag,sc.falseTag,Ni.intBin,Ni.intOct,Ni.int,Ni.intHex,aa.floatNaN,aa.floatExp,aa.float,Eh.binary,xh.merge,Ch.omap,Ph.pairs,Rh.set,oa.intTime,oa.floatTime,oa.timestamp];cc.schema=Ah});var yc=v(la=>{"use strict";var hc=lt(),_h=oi(),pc=ut(),Ih=Ft(),Th=Bn(),sa=Fn(),ca=qn(),jh=Vs(),$h=zs(),mc=Gn(),Jt=Qr(),vc=Xn(),gc=hi(),uc=lc(),wc=ra(),bi=na(),dc=new Map([["core",jh.schema],["failsafe",[hc.map,pc.seq,Ih.string]],["json",$h.schema],["yaml11",uc.schema],["yaml-1.1",uc.schema]]),fc={binary:mc.binary,bool:Th.boolTag,float:sa.float,floatExp:sa.floatExp,floatNaN:sa.floatNaN,floatTime:bi.floatTime,int:ca.int,intHex:ca.intHex,intOct:ca.intOct,intTime:bi.intTime,map:hc.map,merge:Jt.merge,null:_h.nullTag,omap:vc.omap,pairs:gc.pairs,seq:pc.seq,set:wc.set,timestamp:bi.timestamp},Oh={"tag:yaml.org,2002:binary":mc.binary,"tag:yaml.org,2002:merge":Jt.merge,"tag:yaml.org,2002:omap":vc.omap,"tag:yaml.org,2002:pairs":gc.pairs,"tag:yaml.org,2002:set":wc.set,"tag:yaml.org,2002:timestamp":bi.timestamp};function Hh(t,e,r){let i=dc.get(e);if(i&&!t)return r&&!i.includes(Jt.merge)?i.concat(Jt.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(dc.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(Jt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?fc[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(fc).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}la.coreKnownTags=Oh;la.getTags=Hh});var fa=v(Nc=>{"use strict";var ua=P(),Dh=lt(),Lh=ut(),Bh=Ft(),ki=yc(),Mh=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,da=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?ki.getTags(e,"compat"):e?ki.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?ki.coreKnownTags:{},this.tags=ki.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,ua.MAP,{value:Dh.map}),Object.defineProperty(this,ua.SCALAR,{value:Bh.string}),Object.defineProperty(this,ua.SEQ,{value:Lh.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Mh:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Nc.Schema=da});var kc=v(bc=>{"use strict";var Fh=P(),ha=Lt(),Gt=$t();function Vh(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=ha.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(Gt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(Fh.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let f=a(t.contents.commentBefore);r.push(Gt.indentComment(f,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=ha.stringify(t.contents,n,()=>s=null,c);s&&(l+=Gt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(ha.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
58
58
  `)?(r.push("..."),r.push(Gt.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&r[r.length-1]!==""&&r.push(""),r.push(Gt.indentComment(a(c),"")))}return r.join(`
59
59
  `)+`
60
60
  `}bc.stringifyDocument=Vh});var Ut=v(Sc=>{"use strict";var qh=Tt(),ft=Vr(),K=P(),Wh=Pe(),zh=Se(),Jh=fa(),Gh=kc(),pa=Lr(),Uh=wn(),Kh=jt(),ma=gn(),va=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K.NODE_TYPE,{value:K.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:o}=a;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ma.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[K.NODE_TYPE]:{value:K.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=K.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ht(this.contents)&&this.contents.add(e)}addIn(e,r){ht(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=pa.anchorNames(this);e.anchor=!r||i.has(r)?pa.findNewAnchor(r||"a",i):r}return new qh.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let p=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=r.filter(p).map(String);y.length>0&&(r=r.concat(y)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:f}=i??{},{onAnchor:u,setAnchors:d,sourceObjects:m}=pa.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:m},h=Kh.createNode(e,f,g);return s&&K.isCollection(h)&&(h.flow=!0),d(),h}createPair(e,r,i={}){let n=this.createNode(e,null,i),a=this.createNode(r,null,i);return new Wh.Pair(n,a)}delete(e){return ht(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ft.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ht(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return K.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return ft.isEmptyPath(e)?!r&&K.isScalar(this.contents)?this.contents.value:this.contents:K.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return K.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return ft.isEmptyPath(e)?this.contents!==void 0:K.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=ft.collectionFromPath(this.schema,[e],r):ht(this.contents)&&this.contents.set(e,r)}setIn(e,r){ft.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=ft.collectionFromPath(this.schema,Array.from(e),r):ht(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ma.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ma.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new Jh.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=zh.toJS(this.contents,r??"",s);if(typeof a=="function")for(let{count:l,res:f}of s.anchors.values())a(f,l);return typeof o=="function"?Uh.applyReviver(o,{"":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 Gh.stringifyDocument(this,e)}};function ht(t){if(K.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Sc.Document=va});var Xt=v(Yt=>{"use strict";var Kt=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},ga=class extends Kt{constructor(e,r,i){super("YAMLParseError",e,r,i)}},wa=class extends Kt{constructor(e,r,i){super("YAMLWarning",e,r,i)}},Yh=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(s=>e.linePos(s));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let a=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){let s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,a))){let s=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`…
@@ -62,16 +62,16 @@ ${a.comment}`:i.comment}i=n}t.items[r]=di.isPair(i)?i:new Un.Pair(i)}}else e("Ex
62
62
 
63
63
  ${o}
64
64
  ${l}
65
- `}};Yt.YAMLError=Kt;Yt.YAMLParseError=ga;Yt.YAMLWarning=wa;Yt.prettifyError=Yh});var Qt=v(Ec=>{"use strict";function Xh(t,{flow:e,indicator:r,next:i,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,f=s,u="",d="",m=!1,g=!1,h=null,p=null,y=null,b=null,k=null,S=null,E=null;for(let N of t)switch(g&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&a(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&N.type!=="comment"&&N.type!=="newline"&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),N.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&N.source.includes(" ")&&(h=N),f=!0;break;case"comment":{f||a(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let $=N.source.substring(1)||" ";u?u+=d+$:u=$,d="",l=!1;break}case"newline":l?u?u+=N.source:(!S||r!=="seq-item-ind")&&(c=!0):d+=N.source,l=!0,m=!0,(p||y)&&(b=N),f=!0;break;case"anchor":p&&a(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&a(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=N,E??(E=N.offset),l=!1,f=!1,g=!0;break;case"tag":{y&&a(N,"MULTIPLE_TAGS","A node can have at most one tag"),y=N,E??(E=N.offset),l=!1,f=!1,g=!0;break}case r:(p||y)&&a(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),S&&a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${e??"collection"}`),S=N,l=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){k&&a(N,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=N,l=!1,f=!1;break}default:a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),l=!1,f=!1}let C=t[t.length-1],A=C?C.offset+C.source.length:n;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:m,anchor:p,tag:y,newlineAfterProp:b,end:A,start:E??A}}Ec.resolveProps=Xh});var Si=v(Cc=>{"use strict";function ya(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(ya(e.key)||ya(e.value))return!0}return!1;default:return!0}}Cc.containsNewline=ya});var Na=v(xc=>{"use strict";var Qh=Si();function Zh(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Qh.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}xc.flowIndentCheck=Zh});var ba=v(Rc=>{"use strict";var Pc=P();function ep(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||Pc.isScalar(a)&&Pc.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Rc.mapIncludes=ep});var $c=v(jc=>{"use strict";var Ac=Pe(),tp=Ae(),_c=Qt(),rp=Si(),Ic=Na(),ip=ba(),Tc="All mapping items must start at the same column";function np({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??tp.YAMLMap,s=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,l=null;for(let f of i.items){let{start:u,key:d,sep:m,value:g}=f,h=_c.resolveProps(u,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),p=!h.found;if(p){if(d&&(d.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&n(c,"BAD_INDENT",Tc)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(s.comment?s.comment+=`
65
+ `}};Yt.YAMLError=Kt;Yt.YAMLParseError=ga;Yt.YAMLWarning=wa;Yt.prettifyError=Yh});var Qt=v(Ec=>{"use strict";function Xh(t,{flow:e,indicator:r,next:i,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,f=s,u="",d="",m=!1,g=!1,h=null,p=null,y=null,b=null,k=null,S=null,E=null;for(let N of t)switch(g&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&a(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&N.type!=="comment"&&N.type!=="newline"&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),N.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&N.source.includes(" ")&&(h=N),f=!0;break;case"comment":{f||a(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let $=N.source.substring(1)||" ";u?u+=d+$:u=$,d="",l=!1;break}case"newline":l?u?u+=N.source:(!S||r!=="seq-item-ind")&&(c=!0):d+=N.source,l=!0,m=!0,(p||y)&&(b=N),f=!0;break;case"anchor":p&&a(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&a(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=N,E??(E=N.offset),l=!1,f=!1,g=!0;break;case"tag":{y&&a(N,"MULTIPLE_TAGS","A node can have at most one tag"),y=N,E??(E=N.offset),l=!1,f=!1,g=!0;break}case r:(p||y)&&a(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),S&&a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${e??"collection"}`),S=N,l=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){k&&a(N,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=N,l=!1,f=!1;break}default:a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),l=!1,f=!1}let x=t[t.length-1],A=x?x.offset+x.source.length:n;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:m,anchor:p,tag:y,newlineAfterProp:b,end:A,start:E??A}}Ec.resolveProps=Xh});var Si=v(xc=>{"use strict";function ya(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(ya(e.key)||ya(e.value))return!0}return!1;default:return!0}}xc.containsNewline=ya});var Na=v(Cc=>{"use strict";var Qh=Si();function Zh(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Qh.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Cc.flowIndentCheck=Zh});var ba=v(Rc=>{"use strict";var Pc=P();function ep(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||Pc.isScalar(a)&&Pc.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Rc.mapIncludes=ep});var $c=v(jc=>{"use strict";var Ac=Pe(),tp=Ae(),_c=Qt(),rp=Si(),Ic=Na(),ip=ba(),Tc="All mapping items must start at the same column";function np({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??tp.YAMLMap,s=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,l=null;for(let f of i.items){let{start:u,key:d,sep:m,value:g}=f,h=_c.resolveProps(u,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),p=!h.found;if(p){if(d&&(d.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&n(c,"BAD_INDENT",Tc)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(s.comment?s.comment+=`
67
67
  `+h.comment:s.comment=h.comment);continue}(h.newlineAfterProp||rp.containsNewline(d))&&n(d??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==i.indent&&n(c,"BAD_INDENT",Tc);r.atKey=!0;let y=h.end,b=d?t(r,d,h,n):e(r,y,u,null,h,n);r.schema.compat&&Ic.flowIndentCheck(i.indent,d,n),r.atKey=!1,ip.mapIncludes(r,s.items,b)&&n(y,"DUPLICATE_KEY","Map keys must be unique");let k=_c.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:b.range[2],onError:n,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){p&&(g?.type==="block-map"&&!k.hasNewline&&n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<k.found.offset-1024&&n(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=g?t(r,g,k,n):e(r,c,m,null,k,n);r.schema.compat&&Ic.flowIndentCheck(i.indent,g,n),c=S.range[2];let E=new Ac.Pair(b,S);r.options.keepSourceTokens&&(E.srcToken=f),s.items.push(E)}else{p&&n(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(b.comment?b.comment+=`
68
- `+k.comment:b.comment=k.comment);let S=new Ac.Pair(b);r.options.keepSourceTokens&&(S.srcToken=f),s.items.push(S)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}jc.resolveBlockMap=np});var Hc=v(Oc=>{"use strict";var ap=_e(),op=Qt(),sp=Na();function cp({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??ap.YAMLSeq,s=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,l=null;for(let{start:f,value:u}of i.items){let d=op.resolveProps(f,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||u)u?.type==="block-seq"?n(d.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(s.comment=d.comment);continue}let m=u?t(r,u,d,n):e(r,d.end,f,null,d,n);r.schema.compat&&sp.flowIndentCheck(i.indent,u,n),c=m.range[2],s.items.push(m)}return s.range=[i.offset,c,l??c],s}Oc.resolveBlockSeq=cp});var pt=v(Dc=>{"use strict";function lp(t,e,r,i){let n="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=c.substring(1)||" ";n?n+=o+f:n=f,o="";break}case"newline":n&&(o+=c),a=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}Dc.resolveEnd=lp});var Fc=v(Mc=>{"use strict";var up=P(),dp=Pe(),Lc=Ae(),fp=_e(),hp=pt(),Bc=Qt(),pp=Si(),mp=ba(),ka="Block collections are not allowed within flow collections",Sa=t=>t&&(t.type==="block-map"||t.type==="block-seq");function vp({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=i.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Lc.YAMLMap:fp.YAMLSeq),l=new c(r.schema);l.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=i.offset+i.start.source.length;for(let p=0;p<i.items.length;++p){let y=i.items[p],{start:b,key:k,sep:S,value:E}=y,C=Bc.resolveProps(b,{flow:s,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!S&&!E){p===0&&C.comma?n(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):p<i.items.length-1&&n(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),C.comment&&(l.comment?l.comment+=`
69
- `+C.comment:l.comment=C.comment),u=C.end;continue}!o&&r.options.strict&&pp.containsNewline(k)&&n(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)C.comma&&n(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(C.comma||n(C.start,"MISSING_CHAR",`Missing , between ${s} items`),C.comment){let A="";e:for(let N of b)switch(N.type){case"comma":case"space":break;case"comment":A=N.source.substring(1);break e;default:break e}if(A){let N=l.items[l.items.length-1];up.isPair(N)&&(N=N.value??N.key),N.comment?N.comment+=`
70
- `+A:N.comment=A,C.comment=C.comment.substring(A.length+1)}}if(!o&&!S&&!C.found){let A=E?t(r,E,C,n):e(r,C.end,S,null,C,n);l.items.push(A),u=A.range[2],Sa(E)&&n(A.range,"BLOCK_IN_FLOW",ka)}else{r.atKey=!0;let A=C.end,N=k?t(r,k,C,n):e(r,A,b,null,C,n);Sa(k)&&n(N.range,"BLOCK_IN_FLOW",ka),r.atKey=!1;let $=Bc.resolveProps(S??[],{flow:s,indicator:"map-value-ind",next:E,offset:N.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if($.found){if(!o&&!C.found&&r.options.strict){if(S)for(let O of S){if(O===$.found)break;if(O.type==="newline"){n(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<$.found.offset-1024&&n($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?n(E,"MISSING_CHAR",`Missing space after : in ${s}`):n($.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let ke=E?t(r,E,$,n):$.found?e(r,$.end,S,null,$,n):null;ke?Sa(E)&&n(ke.range,"BLOCK_IN_FLOW",ka):$.comment&&(N.comment?N.comment+=`
68
+ `+k.comment:b.comment=k.comment);let S=new Ac.Pair(b);r.options.keepSourceTokens&&(S.srcToken=f),s.items.push(S)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}jc.resolveBlockMap=np});var Hc=v(Oc=>{"use strict";var ap=_e(),op=Qt(),sp=Na();function cp({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??ap.YAMLSeq,s=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,l=null;for(let{start:f,value:u}of i.items){let d=op.resolveProps(f,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||u)u?.type==="block-seq"?n(d.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(s.comment=d.comment);continue}let m=u?t(r,u,d,n):e(r,d.end,f,null,d,n);r.schema.compat&&sp.flowIndentCheck(i.indent,u,n),c=m.range[2],s.items.push(m)}return s.range=[i.offset,c,l??c],s}Oc.resolveBlockSeq=cp});var pt=v(Dc=>{"use strict";function lp(t,e,r,i){let n="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=c.substring(1)||" ";n?n+=o+f:n=f,o="";break}case"newline":n&&(o+=c),a=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}Dc.resolveEnd=lp});var Fc=v(Mc=>{"use strict";var up=P(),dp=Pe(),Lc=Ae(),fp=_e(),hp=pt(),Bc=Qt(),pp=Si(),mp=ba(),ka="Block collections are not allowed within flow collections",Sa=t=>t&&(t.type==="block-map"||t.type==="block-seq");function vp({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=i.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Lc.YAMLMap:fp.YAMLSeq),l=new c(r.schema);l.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=i.offset+i.start.source.length;for(let p=0;p<i.items.length;++p){let y=i.items[p],{start:b,key:k,sep:S,value:E}=y,x=Bc.resolveProps(b,{flow:s,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!S&&!E){p===0&&x.comma?n(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):p<i.items.length-1&&n(x.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),x.comment&&(l.comment?l.comment+=`
69
+ `+x.comment:l.comment=x.comment),u=x.end;continue}!o&&r.options.strict&&pp.containsNewline(k)&&n(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)x.comma&&n(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(x.comma||n(x.start,"MISSING_CHAR",`Missing , between ${s} items`),x.comment){let A="";e:for(let N of b)switch(N.type){case"comma":case"space":break;case"comment":A=N.source.substring(1);break e;default:break e}if(A){let N=l.items[l.items.length-1];up.isPair(N)&&(N=N.value??N.key),N.comment?N.comment+=`
70
+ `+A:N.comment=A,x.comment=x.comment.substring(A.length+1)}}if(!o&&!S&&!x.found){let A=E?t(r,E,x,n):e(r,x.end,S,null,x,n);l.items.push(A),u=A.range[2],Sa(E)&&n(A.range,"BLOCK_IN_FLOW",ka)}else{r.atKey=!0;let A=x.end,N=k?t(r,k,x,n):e(r,A,b,null,x,n);Sa(k)&&n(N.range,"BLOCK_IN_FLOW",ka),r.atKey=!1;let $=Bc.resolveProps(S??[],{flow:s,indicator:"map-value-ind",next:E,offset:N.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if($.found){if(!o&&!x.found&&r.options.strict){if(S)for(let O of S){if(O===$.found)break;if(O.type==="newline"){n(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}x.start<$.found.offset-1024&&n($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?n(E,"MISSING_CHAR",`Missing space after : in ${s}`):n($.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let ke=E?t(r,E,$,n):$.found?e(r,$.end,S,null,$,n):null;ke?Sa(E)&&n(ke.range,"BLOCK_IN_FLOW",ka):$.comment&&(N.comment?N.comment+=`
71
71
  `+$.comment:N.comment=$.comment);let nt=new dp.Pair(N,ke);if(r.options.keepSourceTokens&&(nt.srcToken=y),o){let O=l;mp.mapIncludes(r,O.items,N)&&n(A,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(nt)}else{let O=new Lc.YAMLMap(r.schema);O.flow=!0,O.items.push(nt);let Mo=(ke??N).range;O.range=[N.range[0],Mo[1],Mo[2]],l.items.push(O)}u=ke?ke.range[2]:$.end}}let d=o?"}":"]",[m,...g]=i.end,h=u;if(m?.source===d)h=m.offset+m.source.length;else{let p=s[0].toUpperCase()+s.substring(1),y=f?`${p} must end with a ${d}`:`${p} in block collection must be sufficiently indented and end with a ${d}`;n(u,f?"MISSING_CHAR":"BAD_INDENT",y),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let p=hp.resolveEnd(g,h,r.options.strict,n);p.comment&&(l.comment?l.comment+=`
72
- `+p.comment:l.comment=p.comment),l.range=[i.offset,h,p.offset]}else l.range=[i.offset,h,h];return l}Mc.resolveFlowCollection=vp});var qc=v(Vc=>{"use strict";var gp=P(),wp=T(),yp=Ae(),Np=_e(),bp=$c(),kp=Hc(),Sp=Fc();function Ea(t,e,r,i,n,a){let o=r.type==="block-map"?bp.resolveBlockMap(t,e,r,i,a):r.type==="block-seq"?kp.resolveBlockSeq(t,e,r,i,a):Sp.resolveFlowCollection(t,e,r,i,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function Ep(t,e,r,i,n){let a=i.tag,o=a?e.directives.tagName(a.source,d=>n(a,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=i,g=d&&a?d.offset>a.offset?d:a:d??a;g&&(!m||m.offset<g.offset)&&n(g,"MISSING_CHAR","Missing newline after block sequence props")}let s=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===yp.YAMLMap.tagName&&s==="map"||o===Np.YAMLSeq.tagName&&s==="seq")return Ea(t,e,r,n,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===s);if(!c){let d=e.schema.knownTags[o];if(d?.collection===s)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?n(a,"BAD_COLLECTION_TYPE",`${d.tag} used for ${s} collection, but expects ${d.collection??"scalar"}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ea(t,e,r,n,o)}let l=Ea(t,e,r,n,o,c),f=c.resolve?.(l,d=>n(a,"TAG_RESOLVE_FAILED",d),e.options)??l,u=gp.isNode(f)?f:new wp.Scalar(f);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Vc.composeCollection=Ep});var xa=v(Wc=>{"use strict";var Ca=T();function Cp(t,e,r){let i=e.offset,n=xp(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let a=n.mode===">"?Ca.Scalar.BLOCK_FOLDED:Ca.Scalar.BLOCK_LITERAL,o=e.source?Pp(e.source):[],s=o.length;for(let h=o.length-1;h>=0;--h){let p=o[h][1];if(p===""||p==="\r")s=h;else break}if(s===0){let h=n.chomp==="+"&&o.length>0?`
72
+ `+p.comment:l.comment=p.comment),l.range=[i.offset,h,p.offset]}else l.range=[i.offset,h,h];return l}Mc.resolveFlowCollection=vp});var qc=v(Vc=>{"use strict";var gp=P(),wp=T(),yp=Ae(),Np=_e(),bp=$c(),kp=Hc(),Sp=Fc();function Ea(t,e,r,i,n,a){let o=r.type==="block-map"?bp.resolveBlockMap(t,e,r,i,a):r.type==="block-seq"?kp.resolveBlockSeq(t,e,r,i,a):Sp.resolveFlowCollection(t,e,r,i,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function Ep(t,e,r,i,n){let a=i.tag,o=a?e.directives.tagName(a.source,d=>n(a,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=i,g=d&&a?d.offset>a.offset?d:a:d??a;g&&(!m||m.offset<g.offset)&&n(g,"MISSING_CHAR","Missing newline after block sequence props")}let s=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===yp.YAMLMap.tagName&&s==="map"||o===Np.YAMLSeq.tagName&&s==="seq")return Ea(t,e,r,n,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===s);if(!c){let d=e.schema.knownTags[o];if(d?.collection===s)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?n(a,"BAD_COLLECTION_TYPE",`${d.tag} used for ${s} collection, but expects ${d.collection??"scalar"}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ea(t,e,r,n,o)}let l=Ea(t,e,r,n,o,c),f=c.resolve?.(l,d=>n(a,"TAG_RESOLVE_FAILED",d),e.options)??l,u=gp.isNode(f)?f:new wp.Scalar(f);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Vc.composeCollection=Ep});var Ca=v(Wc=>{"use strict";var xa=T();function xp(t,e,r){let i=e.offset,n=Cp(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let a=n.mode===">"?xa.Scalar.BLOCK_FOLDED:xa.Scalar.BLOCK_LITERAL,o=e.source?Pp(e.source):[],s=o.length;for(let h=o.length-1;h>=0;--h){let p=o[h][1];if(p===""||p==="\r")s=h;else break}if(s===0){let h=n.chomp==="+"&&o.length>0?`
73
73
  `.repeat(Math.max(1,o.length-1)):"",p=i+n.length;return e.source&&(p+=e.source.length),{value:h,type:a,comment:n.comment,range:[i,p,p]}}let c=e.indent+n.indent,l=e.offset+n.length,f=0;for(let h=0;h<s;++h){let[p,y]=o[h];if(y===""||y==="\r")n.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&r(l+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(c=p.length),f=h,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+y.length+1}for(let h=o.length-1;h>=s;--h)o[h][0].length>c&&(s=h+1);let u="",d="",m=!1;for(let h=0;h<f;++h)u+=o[h][0].slice(c)+`
74
- `;for(let h=f;h<s;++h){let[p,y]=o[h];l+=p.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&p.length<c){let S=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(l-y.length-(b?2:1),"BAD_INDENT",S),p=""}a===Ca.Scalar.BLOCK_LITERAL?(u+=d+p.slice(c)+y,d=`
74
+ `;for(let h=f;h<s;++h){let[p,y]=o[h];l+=p.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&p.length<c){let S=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(l-y.length-(b?2:1),"BAD_INDENT",S),p=""}a===xa.Scalar.BLOCK_LITERAL?(u+=d+p.slice(c)+y,d=`
75
75
  `):p.length>c||y[0]===" "?(d===" "?d=`
76
76
  `:!m&&d===`
77
77
  `&&(d=`
@@ -84,7 +84,7 @@ ${l}
84
84
  `+o[h][0].slice(c);u[u.length-1]!==`
85
85
  `&&(u+=`
86
86
  `);break;default:u+=`
87
- `}let g=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,g,g]}}function xp({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],a=n[0],o=0,s="",c=-1;for(let d=1;d<n.length;++d){let m=n[d];if(!s&&(m==="-"||m==="+"))s=m;else{let g=Number(m);!o&&g?o=g:c===-1&&(c=t+d)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,f="",u=n.length;for(let d=1;d<e.length;++d){let m=e[d];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":r&&!l&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,f=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",g);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:a,indent:o,chomp:s,comment:f,length:u}}function Pp(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}Wc.resolveBlockScalar=Cp});var Ra=v(Jc=>{"use strict";var Pa=T(),Rp=pt();function Ap(t,e,r){let{offset:i,type:n,source:a,end:o}=t,s,c,l=(d,m,g)=>r(i+d,m,g);switch(n){case"scalar":s=Pa.Scalar.PLAIN,c=_p(a,l);break;case"single-quoted-scalar":s=Pa.Scalar.QUOTE_SINGLE,c=Ip(a,l);break;case"double-quoted-scalar":s=Pa.Scalar.QUOTE_DOUBLE,c=Tp(a,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}let f=i+a.length,u=Rp.resolveEnd(o,f,e,r);return{value:c,type:s,comment:u.comment,range:[i,f,u.offset]}}function _p(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}`),zc(t)}function Ip(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),zc(t.slice(1,-1)).replace(/''/g,"'")}function zc(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let g=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,g,g]}}function Cp({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],a=n[0],o=0,s="",c=-1;for(let d=1;d<n.length;++d){let m=n[d];if(!s&&(m==="-"||m==="+"))s=m;else{let g=Number(m);!o&&g?o=g:c===-1&&(c=t+d)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,f="",u=n.length;for(let d=1;d<e.length;++d){let m=e[d];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":r&&!l&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,f=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",g);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:a,indent:o,chomp:s,comment:f,length:u}}function Pp(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}Wc.resolveBlockScalar=xp});var Ra=v(Jc=>{"use strict";var Pa=T(),Rp=pt();function Ap(t,e,r){let{offset:i,type:n,source:a,end:o}=t,s,c,l=(d,m,g)=>r(i+d,m,g);switch(n){case"scalar":s=Pa.Scalar.PLAIN,c=_p(a,l);break;case"single-quoted-scalar":s=Pa.Scalar.QUOTE_SINGLE,c=Ip(a,l);break;case"double-quoted-scalar":s=Pa.Scalar.QUOTE_DOUBLE,c=Tp(a,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}let f=i+a.length,u=Rp.resolveEnd(o,f,e,r);return{value:c,type:s,comment:u.comment,range:[i,f,u.offset]}}function _p(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}`),zc(t)}function Ip(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),zc(t.slice(1,-1)).replace(/''/g,"'")}function zc(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 i=e.exec(t);if(!i)return t;let n=i[1],a=" ",o=e.lastIndex;for(r.lastIndex=o;i=r.exec(t);)i[1]===""?a===`
90
90
  `?n+=a:a=`
@@ -99,14 +99,14 @@ ${l}
99
99
  `);)i===`
100
100
  `&&(r+=`
101
101
  `),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var $p={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Op(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}Jc.resolveFlowScalar=Ap});var Kc=v(Uc=>{"use strict";var Ke=P(),Gc=T(),Hp=xa(),Dp=Ra();function Lp(t,e,r,i){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?Hp.resolveBlockScalar(t,e,i):Dp.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ke.SCALAR]:c?l=Bp(t.schema,n,c,r,i):e.type==="scalar"?l=Mp(t,n,e,i):l=t.schema[Ke.SCALAR];let f;try{let u=l.resolve(n,d=>i(r??e,"TAG_RESOLVE_FAILED",d),t.options);f=Ke.isScalar(u)?u:new Gc.Scalar(u)}catch(u){let d=u instanceof Error?u.message:String(u);i(r??e,"TAG_RESOLVE_FAILED",d),f=new Gc.Scalar(n)}return f.range=s,f.source=n,a&&(f.type=a),c&&(f.tag=c),l.format&&(f.format=l.format),o&&(f.comment=o),f}function Bp(t,e,r,i,n){if(r==="!")return t[Ke.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===r)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ke.SCALAR])}function Mp({atKey:t,directives:e,schema:r},i,n,a){let o=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[Ke.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[Ke.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),f=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",f,!0)}}return o}Uc.composeScalar=Lp});var Xc=v(Yc=>{"use strict";function Fp(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}Yc.emptyScalarPosition=Fp});var el=v(_a=>{"use strict";var Vp=Tt(),qp=P(),Wp=qc(),Qc=Kc(),zp=pt(),Jp=Xc(),Gp={composeNode:Zc,composeEmptyNode:Aa};function Zc(t,e,r,i){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=r,l,f=!0;switch(e.type){case"alias":l=Up(t,e,i),(s||c)&&i(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=Qc.composeScalar(t,e,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Wp.composeCollection(Gp,t,e,r,i),s&&(l.anchor=s.source.substring(1))}catch(u){let d=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),f=!1}}return l??(l=Aa(t,e.offset,void 0,null,r,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!qp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&f&&(l.srcToken=e),l}function Aa(t,e,r,i,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let f={type:"scalar",offset:Jp.emptyScalarPosition(e,r,i),indent:-1,source:""},u=Qc.composeScalar(t,f,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Up({options:t},{offset:e,source:r,end:i},n){let a=new Vp.Alias(r.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,s=zp.resolveEnd(i,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}_a.composeEmptyNode=Aa;_a.composeNode=Zc});var il=v(rl=>{"use strict";var Kp=Ut(),tl=el(),Yp=pt(),Xp=Qt();function Qp(t,e,{offset:r,start:i,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new Kp.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},f=Xp.resolveProps(i,{indicator:"doc-start",next:n??a?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});f.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!f.hasNewline&&o(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?tl.composeNode(l,n,f,o):tl.composeEmptyNode(l,f.end,i,null,f,o);let u=c.contents.range[2],d=Yp.resolveEnd(a,u,!1,o);return d.comment&&(c.comment=d.comment),c.range=[r,u,d.offset],c}rl.composeDoc=Qp});var Ta=v(ol=>{"use strict";var Zp=jr("process"),em=gn(),tm=Ut(),Zt=Xt(),nl=P(),rm=il(),im=pt();function er(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 al(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":i?`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Op(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}Jc.resolveFlowScalar=Ap});var Kc=v(Uc=>{"use strict";var Ke=P(),Gc=T(),Hp=Ca(),Dp=Ra();function Lp(t,e,r,i){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?Hp.resolveBlockScalar(t,e,i):Dp.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ke.SCALAR]:c?l=Bp(t.schema,n,c,r,i):e.type==="scalar"?l=Mp(t,n,e,i):l=t.schema[Ke.SCALAR];let f;try{let u=l.resolve(n,d=>i(r??e,"TAG_RESOLVE_FAILED",d),t.options);f=Ke.isScalar(u)?u:new Gc.Scalar(u)}catch(u){let d=u instanceof Error?u.message:String(u);i(r??e,"TAG_RESOLVE_FAILED",d),f=new Gc.Scalar(n)}return f.range=s,f.source=n,a&&(f.type=a),c&&(f.tag=c),l.format&&(f.format=l.format),o&&(f.comment=o),f}function Bp(t,e,r,i,n){if(r==="!")return t[Ke.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===r)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ke.SCALAR])}function Mp({atKey:t,directives:e,schema:r},i,n,a){let o=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[Ke.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[Ke.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),f=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",f,!0)}}return o}Uc.composeScalar=Lp});var Xc=v(Yc=>{"use strict";function Fp(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}Yc.emptyScalarPosition=Fp});var el=v(_a=>{"use strict";var Vp=Tt(),qp=P(),Wp=qc(),Qc=Kc(),zp=pt(),Jp=Xc(),Gp={composeNode:Zc,composeEmptyNode:Aa};function Zc(t,e,r,i){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=r,l,f=!0;switch(e.type){case"alias":l=Up(t,e,i),(s||c)&&i(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=Qc.composeScalar(t,e,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Wp.composeCollection(Gp,t,e,r,i),s&&(l.anchor=s.source.substring(1))}catch(u){let d=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),f=!1}}return l??(l=Aa(t,e.offset,void 0,null,r,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!qp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&f&&(l.srcToken=e),l}function Aa(t,e,r,i,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let f={type:"scalar",offset:Jp.emptyScalarPosition(e,r,i),indent:-1,source:""},u=Qc.composeScalar(t,f,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Up({options:t},{offset:e,source:r,end:i},n){let a=new Vp.Alias(r.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,s=zp.resolveEnd(i,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}_a.composeEmptyNode=Aa;_a.composeNode=Zc});var il=v(rl=>{"use strict";var Kp=Ut(),tl=el(),Yp=pt(),Xp=Qt();function Qp(t,e,{offset:r,start:i,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new Kp.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},f=Xp.resolveProps(i,{indicator:"doc-start",next:n??a?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});f.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!f.hasNewline&&o(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?tl.composeNode(l,n,f,o):tl.composeEmptyNode(l,f.end,i,null,f,o);let u=c.contents.range[2],d=Yp.resolveEnd(a,u,!1,o);return d.comment&&(c.comment=d.comment),c.range=[r,u,d.offset],c}rl.composeDoc=Qp});var Ta=v(ol=>{"use strict";var Zp=jr("process"),em=gn(),tm=Ut(),Zt=Xt(),nl=P(),rm=il(),im=pt();function er(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 al(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":i?`
103
103
 
104
104
  `:`
105
105
  `)+(a.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var Ia=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,a)=>{let o=er(r);a?this.warnings.push(new Zt.YAMLWarning(o,i,n)):this.errors.push(new Zt.YAMLParseError(o,i,n))},this.directives=new em.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=al(this.prelude);if(i){let a=e.contents;if(r)e.comment=e.comment?`${e.comment}
106
106
  ${i}`:i;else if(n||e.directives.docStart||!a)e.commentBefore=i;else if(nl.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];nl.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${i}
107
107
  ${s}`:i}else{let o=a.commentBefore;a.commentBefore=o?`${i}
108
108
  ${o}`:i}}if(r){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:al(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(Zp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let a=er(e);a[0]+=r,this.onError(a,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=rm.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,i=new Zt.YAMLParseError(er(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Zt.YAMLParseError(er(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=im.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Zt.YAMLParseError(er(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 i=Object.assign({_directives:this.directives},this.options),n=new tm.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};ol.Composer=Ia});var ll=v(Ei=>{"use strict";var nm=xa(),am=Ra(),om=Xt(),sl=Dt();function sm(t,e=!0,r){if(t){let i=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,a,o);else throw new om.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return am.resolveFlowScalar(t,e,i);case"block-scalar":return nm.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function cm(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=sl.stringifyString({type:o,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
109
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Zt.YAMLParseError(er(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 i=Object.assign({_directives:this.directives},this.options),n=new tm.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};ol.Composer=Ia});var ll=v(Ei=>{"use strict";var nm=Ca(),am=Ra(),om=Xt(),sl=Dt();function sm(t,e=!0,r){if(t){let i=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,a,o);else throw new om.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return am.resolveFlowScalar(t,e,i);case"block-scalar":return nm.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function cm(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=sl.stringifyString({type:o,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
110
110
  `}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
111
111
  `),f=s.substring(0,l),u=s.substring(l+1)+`
112
112
  `,d=[{type:"block-scalar-header",offset:a,indent:i,source:f}];return cl(d,c)||d.push({type:"newline",offset:-1,indent:i,source:`
@@ -114,7 +114,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
114
114
  `),i=e.substring(0,r),n=e.substring(r+1)+`
115
115
  `;if(t.type==="block-scalar"){let a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=i,t.source=n}else{let{offset:a}=t,o="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:i}];cl(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
116
116
  `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:n})}}function cl(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 ja(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 i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let a of i)a.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}Ei.createScalarToken=cm;Ei.resolveAsScalar=sm;Ei.setScalarValue=lm});var dl=v(ul=>{"use strict";var dm=t=>"type"in t?xi(t):Ci(t);function xi(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=xi(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Ci(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Ci(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Ci(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 Ci({start:t,key:e,sep:r,value:i}){let n="";for(let a of t)n+=a.source;if(e&&(n+=xi(e)),r)for(let a of r)n+=a.source;return i&&(n+=xi(i)),n}ul.stringify=dm});var ml=v(pl=>{"use strict";var $a=Symbol("break visit"),fm=Symbol("skip children"),fl=Symbol("remove item");function Ye(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),hl(Object.freeze([]),t,e)}Ye.BREAK=$a;Ye.SKIP=fm;Ye.REMOVE=fl;Ye.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let a=r?.[i];if(a&&"items"in a)r=a.items[n];else return}return r};Ye.parentCollection=(t,e)=>{let r=Ye.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function hl(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let a=e[n];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=hl(Object.freeze(t.concat([[n,o]])),a.items[o],r);if(typeof s=="number")o=s-1;else{if(s===$a)return $a;s===fl&&(a.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}pl.visit=Ye});var Pi=v(W=>{"use strict";var Oa=ll(),hm=dl(),pm=ml(),Ha="\uFEFF",Da="",La="",Ba="",mm=t=>!!t&&"items"in t,vm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function gm(t){switch(t){case Ha:return"<BOM>";case Da:return"<DOC>";case La:return"<FLOW_END>";case Ba:return"<SCALAR>";default:return JSON.stringify(t)}}function wm(t){switch(t){case Ha:return"byte-order-mark";case Da:return"doc-mode";case La:return"flow-error-end";case Ba:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
117
+ `};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}Ei.createScalarToken=cm;Ei.resolveAsScalar=sm;Ei.setScalarValue=lm});var dl=v(ul=>{"use strict";var dm=t=>"type"in t?Ci(t):xi(t);function Ci(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Ci(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=xi(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=xi(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=xi(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 xi({start:t,key:e,sep:r,value:i}){let n="";for(let a of t)n+=a.source;if(e&&(n+=Ci(e)),r)for(let a of r)n+=a.source;return i&&(n+=Ci(i)),n}ul.stringify=dm});var ml=v(pl=>{"use strict";var $a=Symbol("break visit"),fm=Symbol("skip children"),fl=Symbol("remove item");function Ye(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),hl(Object.freeze([]),t,e)}Ye.BREAK=$a;Ye.SKIP=fm;Ye.REMOVE=fl;Ye.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let a=r?.[i];if(a&&"items"in a)r=a.items[n];else return}return r};Ye.parentCollection=(t,e)=>{let r=Ye.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function hl(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let a=e[n];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=hl(Object.freeze(t.concat([[n,o]])),a.items[o],r);if(typeof s=="number")o=s-1;else{if(s===$a)return $a;s===fl&&(a.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}pl.visit=Ye});var Pi=v(W=>{"use strict";var Oa=ll(),hm=dl(),pm=ml(),Ha="\uFEFF",Da="",La="",Ba="",mm=t=>!!t&&"items"in t,vm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function gm(t){switch(t){case Ha:return"<BOM>";case Da:return"<DOC>";case La:return"<FLOW_END>";case Ba:return"<SCALAR>";default:return JSON.stringify(t)}}function wm(t){switch(t){case Ha:return"byte-order-mark";case Da:return"doc-mode";case La:return"flow-error-end";case Ba:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
118
118
  `:case`\r
119
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}W.createScalarToken=Oa.createScalarToken;W.resolveAsScalar=Oa.resolveAsScalar;W.setScalarValue=Oa.setScalarValue;W.stringify=hm.stringify;W.visit=pm.visit;W.BOM=Ha;W.DOCUMENT=Da;W.FLOW_END=La;W.SCALAR=Ba;W.isCollection=mm;W.isScalar=vm;W.prettyToken=gm;W.tokenType=wm});var Va=v(gl=>{"use strict";var tr=Pi();function Z(t){switch(t){case void 0:case" ":case`
120
120
  `:case"\r":case" ":return!0;default:return!1}}var vl=new Set("0123456789ABCDEFabcdef"),ym=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ri=new Set(",[]{}"),Nm=new Set(` ,[]{}
@@ -139,7 +139,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
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 i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){_i(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&r.sep&&!r.value){let o=[];for(let s=0;s<r.sep.length;++s){let c=r.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(a.push(this.sourceToken),e.items.push({start:a}),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):n||r.value?(a.push(this.sourceToken),e.items.push({start:a,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(Ie(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(kl(r.key)&&!Ie(r.sep,"newline")){let o=mt(r.start),s=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:o,key:s,sep:c}]})}else a.length>0?r.sep=r.sep.concat(a,this.sourceToken):r.sep.push(this.sourceToken);else if(Ie(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=mt(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):Ie(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 o=this.flowScalar(this.type);n||r.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Ie(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 i&&e.items.push({start:a});this.stack.push(o);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 i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){_i(n,r.start),n.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||Ie(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.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 n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=Ai(i),a=mt(n);bl(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}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=Ai(e),i=mt(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Ai(e),i=mt(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.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())}}};Sl.Parser=za});var Rl=v(ir=>{"use strict";var El=Ta(),Sm=Ut(),rr=Xt(),Em=_n(),Cm=P(),xm=Wa(),Cl=Ja();function xl(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new xm.LineCounter||null,prettyErrors:e}}function Pm(t,e={}){let{lineCounter:r,prettyErrors:i}=xl(e),n=new Cl.Parser(r?.addNewLine),a=new El.Composer(e),o=Array.from(a.compose(n.parse(t)));if(i&&r)for(let s of o)s.errors.forEach(rr.prettifyError(t,r)),s.warnings.forEach(rr.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Pl(t,e={}){let{lineCounter:r,prettyErrors:i}=xl(e),n=new Cl.Parser(r?.addNewLine),a=new El.Composer(e),o=null;for(let s of a.compose(n.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new rr.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(o.errors.forEach(rr.prettifyError(t,r)),o.warnings.forEach(rr.prettifyError(t,r))),o}function Rm(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=Pl(t,r);if(!n)return null;if(n.warnings.forEach(a=>Em.warn(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function Am(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return Cm.isDocument(t)&&!i?t.toString(r):new Sm.Document(t,i,r).toString(r)}ir.parse=Rm;ir.parseAllDocuments=Pm;ir.parseDocument=Pl;ir.stringify=Am});var vt=v(R=>{"use strict";var _m=Ta(),Im=Ut(),Tm=fa(),Ga=Xt(),jm=Tt(),Te=P(),$m=Pe(),Om=T(),Hm=Ae(),Dm=_e(),Lm=Pi(),Bm=Va(),Mm=Wa(),Fm=Ja(),Ii=Rl(),Al=Rt();R.Composer=_m.Composer;R.Document=Im.Document;R.Schema=Tm.Schema;R.YAMLError=Ga.YAMLError;R.YAMLParseError=Ga.YAMLParseError;R.YAMLWarning=Ga.YAMLWarning;R.Alias=jm.Alias;R.isAlias=Te.isAlias;R.isCollection=Te.isCollection;R.isDocument=Te.isDocument;R.isMap=Te.isMap;R.isNode=Te.isNode;R.isPair=Te.isPair;R.isScalar=Te.isScalar;R.isSeq=Te.isSeq;R.Pair=$m.Pair;R.Scalar=Om.Scalar;R.YAMLMap=Hm.YAMLMap;R.YAMLSeq=Dm.YAMLSeq;R.CST=Lm;R.Lexer=Bm.Lexer;R.LineCounter=Mm.LineCounter;R.Parser=Fm.Parser;R.parse=Ii.parse;R.parseAllDocuments=Ii.parseAllDocuments;R.parseDocument=Ii.parseDocument;R.stringify=Ii.stringify;R.visit=Al.visit;R.visitAsync=Al.visitAsync});import je from"path";function Ol(t){let e=[...t],r=new Set(t);for(let i of $l)r.has(i)||(r.add(i),e.push(i));return e}function Hl(t,e){return gt[e][t]}function zm(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in gt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in gt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in gt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in gt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in gt.en)return s}return null}function sr(t,e){let r=[],i=null,n=null,a=null;for(let o of(0,ar.stringify)(t).trimEnd().split(`
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=Ai(e),i=mt(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Ai(e),i=mt(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.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())}}};Sl.Parser=za});var Rl=v(ir=>{"use strict";var El=Ta(),Sm=Ut(),rr=Xt(),Em=_n(),xm=P(),Cm=Wa(),xl=Ja();function Cl(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cm.LineCounter||null,prettyErrors:e}}function Pm(t,e={}){let{lineCounter:r,prettyErrors:i}=Cl(e),n=new xl.Parser(r?.addNewLine),a=new El.Composer(e),o=Array.from(a.compose(n.parse(t)));if(i&&r)for(let s of o)s.errors.forEach(rr.prettifyError(t,r)),s.warnings.forEach(rr.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Pl(t,e={}){let{lineCounter:r,prettyErrors:i}=Cl(e),n=new xl.Parser(r?.addNewLine),a=new El.Composer(e),o=null;for(let s of a.compose(n.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new rr.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(o.errors.forEach(rr.prettifyError(t,r)),o.warnings.forEach(rr.prettifyError(t,r))),o}function Rm(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=Pl(t,r);if(!n)return null;if(n.warnings.forEach(a=>Em.warn(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function Am(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return xm.isDocument(t)&&!i?t.toString(r):new Sm.Document(t,i,r).toString(r)}ir.parse=Rm;ir.parseAllDocuments=Pm;ir.parseDocument=Pl;ir.stringify=Am});var vt=v(R=>{"use strict";var _m=Ta(),Im=Ut(),Tm=fa(),Ga=Xt(),jm=Tt(),Te=P(),$m=Pe(),Om=T(),Hm=Ae(),Dm=_e(),Lm=Pi(),Bm=Va(),Mm=Wa(),Fm=Ja(),Ii=Rl(),Al=Rt();R.Composer=_m.Composer;R.Document=Im.Document;R.Schema=Tm.Schema;R.YAMLError=Ga.YAMLError;R.YAMLParseError=Ga.YAMLParseError;R.YAMLWarning=Ga.YAMLWarning;R.Alias=jm.Alias;R.isAlias=Te.isAlias;R.isCollection=Te.isCollection;R.isDocument=Te.isDocument;R.isMap=Te.isMap;R.isNode=Te.isNode;R.isPair=Te.isPair;R.isScalar=Te.isScalar;R.isSeq=Te.isSeq;R.Pair=$m.Pair;R.Scalar=Om.Scalar;R.YAMLMap=Hm.YAMLMap;R.YAMLSeq=Dm.YAMLSeq;R.CST=Lm;R.Lexer=Bm.Lexer;R.LineCounter=Mm.LineCounter;R.Parser=Fm.Parser;R.parse=Ii.parse;R.parseAllDocuments=Ii.parseAllDocuments;R.parseDocument=Ii.parseDocument;R.stringify=Ii.stringify;R.visit=Al.visit;R.visitAsync=Al.visitAsync});import je from"path";function Ol(t){let e=[...t],r=new Set(t);for(let i of $l)r.has(i)||(r.add(i),e.push(i));return e}function Hl(t,e){return gt[e][t]}function zm(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in gt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in gt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in gt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in gt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in gt.en)return s}return null}function sr(t,e){let r=[],i=null,n=null,a=null;for(let o of(0,ar.stringify)(t).trimEnd().split(`
143
143
  `)){let s=zm(o,i,n,a);if(s){let c=o.match(/^\s*/u)?.[0]??"";for(let l of Hl(s,e).split(`
144
144
  `))r.push(`${c}${l}`)}r.push(o),/^[a-z_]+:/u.test(o)?(o.startsWith("native:")?i="native":o.startsWith("classic:")?i="classic":o.startsWith("hook:")?i="hook":o.startsWith("memory:")?i="memory":o.startsWith("knowledge:")?i="knowledge":i=null,n=null,a=null):/^ {2}[a-z_]+:/u.test(o)&&(i==="native"&&(n=o.startsWith(" snapshot:")?"snapshot":null),i==="knowledge"&&(a=o.startsWith(" local:")?"local":o.startsWith(" remote:")?"remote":null))}return r.push(""),r.join(`
145
145
  `)}function Jm(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||je.posix.isAbsolute(r)||je.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function Xe(t){let e=Jm(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Dl(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 $i(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||je.posix.isAbsolute(i)||je.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.split("/");if(n.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(n.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function ve(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Ll(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function Xa(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>Ti)throw new Error(`${e} exceeds ${Ti} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>ji)throw new Error(`${e} contains more than ${ji} wildcard tokens`);return t}function jl(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(i=>Xa(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function Ua(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function Gm(t){if(t===void 0)return{...U,include:[...U.include],exclude:[...U.exclude]};let e=ve(t,"native.snapshot");return{include:jl(e.include,"native.snapshot.include",U.include),exclude:jl(e.exclude,"native.snapshot.exclude",U.exclude),max_files:Ua(e.max_files,U.max_files,"native.snapshot.max_files"),max_total_bytes:Ua(e.max_total_bytes,U.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Ua(e.max_duration_ms,U.max_duration_ms,"native.snapshot.max_duration_ms")}}function Um(t){if(t===void 0)return;let e=ve(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=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 i!="string"||typeof n!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=ve(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,f=s.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 f!="string"||!/^[a-f0-9]{64}$/u.test(f))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:f}}return{id:r,fromArtifactRoot:Xe(i),toArtifactRoot:Xe(n),stage:a,...o?{cleanup:o}:{}}}function Km(t){if(t===void 0)return;let e=ve(t,"native.finish");if(e.pull_request===void 0)return{};let r=ve(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 i=r.command.map((a,o)=>{if(typeof a!="string"||a.trim().length===0||a.length>4096||/[\0\r\n]/u.test(a))throw new Error(`native.finish.pull_request.command[${o}] must be a non-empty single-line string of at most 4096 characters`);return a});if(je.posix.isAbsolute(i[0])||je.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??Vm;if(!Number.isSafeInteger(n)||n<1||n>Tl)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Tl}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Ym(t,e={}){let r=ve(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??Ka;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=Um(r.pending_root_move),c=Km(r.finish);return{artifact_root:Xe(i),language:Ll(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,snapshot:Gm(r.snapshot),...c?{finish:c}:{},...s?{pending_root_move:s}:{}}}function Xm(t){let e=ve(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:Dl(e.artifact_layout),language:Ll(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n}}function Qm(t){let r=ve(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((i,n)=>$i(i,`hook.allow_paths[${n}]`)))]}}function Zm(t){if(t===void 0)return{...nr};let e=ve(t,"memory"),r=e.learning??nr.learning,i=e.retrieval??nr.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function Qa(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function ev(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")||je.posix.isAbsolute(r)||je.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))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>_l)throw new Error(`${e} exceeds ${_l} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>Il)throw new Error(`${e} contains more than ${Il} wildcard tokens`);return r}function tv(t){let r=Qa(t,"knowledge.local").include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(r.map((i,n)=>ev(i,`knowledge.local.include[${n}]`)))]}}function rv(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,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function iv(t){let e=Qa(t,"knowledge.remote"),r=rv(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function nv(t){if(t===void 0)return{...Ya};let e=Qa(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:tv(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:iv(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function av(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function ov(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.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 f=t.workflows??[t.default_workflow];if(!Array.isArray(f)||f.length===0||f.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(f)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function wt(t,e={}){let r=(0,ar.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=av(n.ambient_resume),o=n.hook===void 0?void 0:Qm(n.hook),s=Zm(n.memory),c=nv(n.knowledge),l=n.native===void 0?void 0:Ym(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),f=n.classic===void 0?void 0:Xm(n.classic),u=ov(n,o,s,c,l,f,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...f?{classic:f}:{}}}function Bl(t){return{id:t.id,from_artifact_root:t.fromArtifactRoot,to_artifact_root:t.toArtifactRoot,stage:t.stage,...t.cleanup?{cleanup:{kind:t.cleanup.kind,state:t.cleanup.state,manifest_hash:t.cleanup.manifestHash}}:{}}}function Ml(t){let e=t.knowledge??{...Ya};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...nr},knowledge:{provider:e.provider,...e.local&&e.local.include.length>0?{local:{include:[...e.local.include]}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...t.hook?{hook:{allow_paths:[...t.hook.allow_paths]}}:{},...t.native?{native:{artifact_root:t.native.artifact_root,language:t.native.language,clarification_mode:t.native.clarification_mode,archive_confirmation:t.native.archive_confirmation,max_verify_failures:t.native.max_verify_failures,...t.native.finish?.pull_request?{finish:{pull_request:{provider:t.native.finish.pull_request.provider,command:[...t.native.finish.pull_request.command],timeout_ms:t.native.finish.pull_request.timeout_ms}}}:{},...t.native.pending_root_move?{pending_root_move:Bl(t.native.pending_root_move)}:{}}}:{},...t.classic?{classic:{artifact_layout:t.classic.artifact_layout,language:t.classic.language,context_compression:t.classic.context_compression,review_mode:t.classic.review_mode,auto_transition:t.classic.auto_transition}}:{}}}function G(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function cr(t,e){let r=Ml(e),i=wt((0,ar.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...G(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=G(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=G(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local&&i.knowledge.local.include.length>0?o.local={...G(a.local),include:[...i.knowledge.local.include]}:delete o.local,i.knowledge.remote){let c={...G(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=G(t.native),o={...a,artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures};if(i.native.finish?.pull_request){let s=G(a.finish);o.finish={...s,pull_request:{...G(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...G(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=G(a.pending_root_move),c=Bl(i.native.pending_root_move),l=G(s.cleanup),f=G(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...f}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...G(t.classic),artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition}),n}function Oi(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...nr},knowledge:{...Ya},native:{artifact_root:Xe(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:Ka,snapshot:{...U,include:[...U.include],exclude:[...U.exclude]}}}}var ar,or,Ti,ji,_l,Il,Ka,nr,Ya,Vm,Tl,qm,Wm,$l,U,gt,$e=w(()=>{"use strict";ar=Pt(vt(),1),or=64*1024,Ti=1024,ji=64,_l=1024,Il=64,Ka=5,nr={learning:!0,retrieval:!0},Ya={provider:"local"},Vm=12e4,Tl=6e5,qm=[".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/**"],Wm=["**/.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"],$l=[...qm,...Wm].sort((t,e)=>t.localeCompare(e,"en"));U={include:["**/*"],exclude:[...$l],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4},gt={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
@@ -166,18 +166,18 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
166
166
  # 可选值:en | zh-CN`,"classic.context_compression":`# 新建 Classic change 是否启用 beta 上下文压缩。
167
167
  # 可选值:off | beta`,"classic.review_mode":`# 新建 Classic change 默认使用的审查深度。
168
168
  # 可选值:off | standard | thorough`,"classic.auto_transition":`# Classic 阶段通过后是否自动进入下一阶段。
169
- # 可选值:true | false`}}});function Oe(t){return t!==0&&t!==0n&&t!=="0"}function He(t,e){return Oe(t.dev)&&Oe(e.dev)&&Oe(t.ino)&&Oe(e.ino)}function D(t,e){let r=Oe(t.dev)&&Oe(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Oe(t.ino)&&Oe(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var lr=w(()=>{"use strict"});import{constants as Hi,promises as Qe}from"fs";function Za(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Fl(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function ur(t){return{dev:t.dev,ino:t.ino,birthtime:Za(t)}}function Di(t,e){let r=ur(t),i=ur(e);return He(r,i)?D(r,i):D(r,i)&&Za(t)===Za(e)&&Fl(t)===Fl(e)&&t.size===e.size}async function dr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await Qe.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new oe("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new oe("too-large",`${i} exceeds ${e} bytes`);let o=await Qe.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:ur(a)});let s=process.platform==="win32"?Hi.O_RDONLY:Hi.O_RDONLY|Hi.O_NOFOLLOW|Hi.O_NONBLOCK,c;try{c=await Qe.open(t,s)}catch(l){throw l.code==="ELOOP"?new oe("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,f,u]=await Promise.all([c.stat({bigint:n}),Qe.lstat(t,{bigint:n}),Qe.realpath(t)]);if(!l.isFile()||!f.isFile()||f.isSymbolicLink()||u!==o||!Di(a,l)||!Di(a,f))throw new oe("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:ur(l)}),await r.hooks?.afterOpen?.();let d=[],m=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-m,{bytesRead:k}=await c.read(g,0,Math.min(g.length,b),null);if(k===0)break;if(m+=k,m>e)throw new oe("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[h,p,y]=await Promise.all([c.stat({bigint:n}),Qe.lstat(t,{bigint:n}),Qe.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==o||!Di(a,h)||!Di(a,p))throw new oe("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:y,identity:ur(h)}),{bytes:Buffer.concat(d,m),stat:h,realPath:y}}finally{await c.close()}}var oe,fr=w(()=>{"use strict";lr();oe=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Li}from"fs";import De from"path";function sv(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function eo(t,e){let r=De.relative(t,e);return r===""||!De.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${De.sep}`)}async function Vl(t,e){let r=De.resolve(t),i=await Li.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Li.realpath(r)}async function ql(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=De.join(n,r[a]);let o;try{o=await Li.lstat(n)}catch(f){if(sv(f))return{exists:!1,kind:"missing"};throw f}let s=De.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Li.realpath(n);if(!eo(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function ge(t,e,r){let i=$i(e,r.label),n=De.resolve(t),a=await Vl(n,r.label),o=i.split("/"),s=De.resolve(n,...o);if(!eo(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await ql(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function se(t,e,r,i){let n=await ge(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await Vl(n.projectRoot,i.label);return dr(n.target,r,{...i,verify:async(o,s)=>{if(!eo(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await ql(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var Ze=w(()=>{"use strict";fr();$e()});import{createHash as cv}from"crypto";function to(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function lv(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Bi(t,e={}){return(await pr(t,e)).document}async function Wl(t){try{return(await se(t,hr,or,{label:hr})).bytes}catch(e){if(lv(e))return null;throw e}}function zl(t){return t?{exists:!0,sha256:cv("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Mi(t){return zl(await Wl(t))}async function pr(t,e={}){let r=await Wl(t);return{document:r?wt(r.toString("utf8"),e):null,identity:zl(r)}}async function ro(t){return(await Bi(t))?.config??null}var hr,yt=w(()=>{"use strict";$e();Ze();hr=".comet/config.yaml"});import{randomUUID as uv}from"crypto";import{constants as dv,promises as M}from"fs";import ee from"path";async function io(t,e){try{return await M.link(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await M.copyFile(t,e,dv.COPYFILE_EXCL),{linked:!1}}function Fi(t,e){let r=ee.relative(t,e);return r===""||!ee.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ee.sep}`)}function Vi(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function fv(t,e){return D(t,Vi(e))}function qi(t,e){return D(Vi(t),Vi(e))}function hv(t,e){return qi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Jl(t){let e=await M.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 M.realpath(t),...Vi(e)}}async function Nt(t){for(let e of t){let r=await M.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!fv(e,r)||await M.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function pv(t,e,r){let[i,n]=await Promise.all([M.lstat(t),M.realpath(t),Nt(r)]);if(!i.isFile()||i.isSymbolicLink()||!qi(i,e)||!Fi(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function mv(t,e){let r=ee.resolve(t),i=ee.resolve(e);if(!Fi(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await Jl(r)],a=ee.relative(r,i).split(ee.sep).filter(Boolean),o=r;for(let s of a){await Nt(n),o=ee.join(o,s);try{await M.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Jl(o);if(!Fi(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Nt(n),n}async function vv(t){let e;try{e=await M.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function gv(t,e,r){let i=ee.dirname(t),n=await mv(r.containedRoot,i),a=ee.join(i,`.${ee.basename(t)}.${uv()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await M.open(a,"wx"),s=await o.stat();let[l,f]=await Promise.all([M.lstat(a),M.realpath(a)]);if(await Nt(n),!l.isFile()||l.isSymbolicLink()||!qi(s,l)||!Fi(n[0].realPath,f))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!qi(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await pv(a,c,n),await r.beforeCommit?.(),await Nt(n);let u=await M.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!hv(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await io(a,t),await M.unlink(a)):await M.rename(a,t),await vv(i)}catch(l){await o?.close();try{await Nt(n),await M.rm(a,{force:!0})}catch{}throw l}}async function et(t,e,r){await gv(t,e,r)}var bt=w(()=>{"use strict";lr()});var SN,no=w(()=>{"use strict";bt();yt();Ze();SN=16*1024});async function ao(t,e){if(!e)return;let r=await Mi(t);if(!to(r,e))throw new Error("Project config changed before commit; rerun the operation")}var oo=w(()=>{"use strict";bt();$e();yt();Ze();no()});var ce=w(()=>{"use strict";lr()});import{randomUUID as Nv}from"crypto";import{promises as L}from"fs";import te from"path";function Wi(t,e){let r=te.relative(t,e);return r===""||!te.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${te.sep}`)}function bv(t,e){return D({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function zi(t,e){return D({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function kv(t,e){return zi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Gl(t){let e=await L.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await L.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function kt(t){for(let e of t){let r=await L.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!bv(e,r)||await L.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function Sv(t,e,r){let[i,n]=await Promise.all([L.lstat(t),L.realpath(t),r?kt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!zi(i,e)||r&&!Wi(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function Ev(t,e){let r=te.resolve(t),i=te.resolve(e);if(!Wi(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Gl(r)],a=te.relative(r,i).split(te.sep).filter(Boolean),o=r;for(let s of a){await kt(n),o=te.join(o,s);try{await L.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Gl(o);if(!Wi(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await kt(n),n}async function Cv(t){let e;try{e=await L.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function xv(t,e,r={}){let i=te.dirname(t),n=r.containedRoot?await Ev(r.containedRoot,i):null;n||await L.mkdir(i,{recursive:!0});let a=te.join(i,`.${te.basename(t)}.${Nv()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await L.open(a,"wx"),s=await o.stat(),n){let[l,f]=await Promise.all([L.lstat(a),L.realpath(a)]);if(await kt(n),!l.isFile()||l.isSymbolicLink()||!zi(s,l)||!Wi(n[0].realPath,f))throw new Error("Native atomic write temporary file opened outside its managed parent")}if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!zi(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await Sv(a,c,n),await r.beforeCommit?.(),n){await kt(n);let l=await L.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!kv(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await L.link(a,t),await L.unlink(a)):await L.rename(a,t),await Cv(i)}catch(l){if(await o?.close(),!n)await L.rm(a,{force:!0});else try{await kt(n),await L.rm(a,{force:!0})}catch{}throw l}}async function we(t,e,r={}){await xv(t,e,r)}var j=w(()=>{"use strict";ce()});import{existsSync as MN,promises as ye}from"fs";import _ from"path";import Pv from"os";async function so(t){try{return await ye.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Rv(t){try{let e=await ye.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function mr(t,e){let r=_.relative(t,e);return r===""||!_.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${_.sep}`)}async function St(t){let e=[],r=t;for(;!await so(r);){let n=_.dirname(r);if(n===r)break;e.push(_.basename(r)),r=n}let i=await ye.realpath(r);return _.resolve(i,...e.reverse())}async function co(t){try{return(await ye.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function lo(t){let e=_.resolve(t);try{(await ye.stat(e)).isDirectory()||(e=_.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=_.resolve(Pv.homedir());for(;;){if(!(e===i&&r!==i)){let o=_.join(e,...Ji.split("/")),s=e===r||await Rv(o);if(await so(o)&&s)return e}if(await so(_.join(e,".git")))return e;let a=_.dirname(e);if(a===e)return r;e=a}}function vr(t){return Xe(t)}async function Av(t,e){let r=vr(e),i=_.resolve(t,...r.split("/")),n=await ye.realpath(t),a=await St(i);if(!mr(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function tt(t,e){let r=vr(e),i=await Av(t,r),n=_.join(i,"comet");if(await co(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([St(i),St(n)]);if(!mr(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=_.resolve(t),c=_.join(s,".comet","runtime","native");if(await co(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,f]=await Promise.all([ye.realpath(s),St(c)]);if(!mr(l,f))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:_.join(t,...Ji.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:_.join(n,"specs"),changesDir:_.join(n,"changes"),archiveDir:_.join(n,"archive"),runtimeDir:c,changesRuntimeDir:_.join(c,"changes"),locksDir:_.join(c,"locks"),transactionsDir:_.join(c,"transactions")}}async function Ul(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await F(t.nativeRoot,e),await ye.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await F(t.projectRoot,e),await ye.mkdir(e,{recursive:!0})}))}async function F(t,e){let r=_.resolve(t),i=_.resolve(e);if(!mr(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await co(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([St(r),St(i)]);if(!mr(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var Ji,I=w(()=>{"use strict";$e();Ji=".comet/config.yaml"});import _v from"path";function Yl(t="docs",e="en"){return Oi(t,e)}async function le(t){let e=(await Bi(t))?.config??null;return e?.native?e:null}async function gr(t,e,r={}){let i=await pr(t,{allowPartialProject:!0}),n=cr(i.document?.value??{},e),a=_v.join(t,...Ji.split("/"));await we(a,sr(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await ao(t,i.identity)}})}var Kl,Y=w(()=>{"use strict";$e();yt();oo();j();I();Kl=Ol});import{promises as Iv}from"node:fs";import Tv from"node:path";function jv(t){return t.includes(`\r
169
+ # 可选值:true | false`}}});function Oe(t){return t!==0&&t!==0n&&t!=="0"}function He(t,e){return Oe(t.dev)&&Oe(e.dev)&&Oe(t.ino)&&Oe(e.ino)}function D(t,e){let r=Oe(t.dev)&&Oe(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Oe(t.ino)&&Oe(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var lr=w(()=>{"use strict"});import{constants as Hi,promises as Qe}from"fs";function Za(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Fl(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function ur(t){return{dev:t.dev,ino:t.ino,birthtime:Za(t)}}function Di(t,e){let r=ur(t),i=ur(e);return He(r,i)?D(r,i):D(r,i)&&Za(t)===Za(e)&&Fl(t)===Fl(e)&&t.size===e.size}async function dr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await Qe.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new oe("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new oe("too-large",`${i} exceeds ${e} bytes`);let o=await Qe.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:ur(a)});let s=process.platform==="win32"?Hi.O_RDONLY:Hi.O_RDONLY|Hi.O_NOFOLLOW|Hi.O_NONBLOCK,c;try{c=await Qe.open(t,s)}catch(l){throw l.code==="ELOOP"?new oe("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,f,u]=await Promise.all([c.stat({bigint:n}),Qe.lstat(t,{bigint:n}),Qe.realpath(t)]);if(!l.isFile()||!f.isFile()||f.isSymbolicLink()||u!==o||!Di(a,l)||!Di(a,f))throw new oe("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:ur(l)}),await r.hooks?.afterOpen?.();let d=[],m=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-m,{bytesRead:k}=await c.read(g,0,Math.min(g.length,b),null);if(k===0)break;if(m+=k,m>e)throw new oe("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[h,p,y]=await Promise.all([c.stat({bigint:n}),Qe.lstat(t,{bigint:n}),Qe.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==o||!Di(a,h)||!Di(a,p))throw new oe("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:y,identity:ur(h)}),{bytes:Buffer.concat(d,m),stat:h,realPath:y}}finally{await c.close()}}var oe,fr=w(()=>{"use strict";lr();oe=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Li}from"fs";import De from"path";function sv(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function eo(t,e){let r=De.relative(t,e);return r===""||!De.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${De.sep}`)}async function Vl(t,e){let r=De.resolve(t),i=await Li.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Li.realpath(r)}async function ql(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=De.join(n,r[a]);let o;try{o=await Li.lstat(n)}catch(f){if(sv(f))return{exists:!1,kind:"missing"};throw f}let s=De.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Li.realpath(n);if(!eo(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function ge(t,e,r){let i=$i(e,r.label),n=De.resolve(t),a=await Vl(n,r.label),o=i.split("/"),s=De.resolve(n,...o);if(!eo(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await ql(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function se(t,e,r,i){let n=await ge(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await Vl(n.projectRoot,i.label);return dr(n.target,r,{...i,verify:async(o,s)=>{if(!eo(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await ql(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var Ze=w(()=>{"use strict";fr();$e()});import{createHash as cv}from"crypto";function to(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function lv(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Bi(t,e={}){return(await pr(t,e)).document}async function Wl(t){try{return(await se(t,hr,or,{label:hr})).bytes}catch(e){if(lv(e))return null;throw e}}function zl(t){return t?{exists:!0,sha256:cv("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Mi(t){return zl(await Wl(t))}async function pr(t,e={}){let r=await Wl(t);return{document:r?wt(r.toString("utf8"),e):null,identity:zl(r)}}async function ro(t){return(await Bi(t))?.config??null}var hr,yt=w(()=>{"use strict";$e();Ze();hr=".comet/config.yaml"});import{randomUUID as uv}from"crypto";import{constants as dv,promises as M}from"fs";import ee from"path";async function io(t,e){try{return await M.link(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await M.copyFile(t,e,dv.COPYFILE_EXCL),{linked:!1}}function Fi(t,e){let r=ee.relative(t,e);return r===""||!ee.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ee.sep}`)}function Vi(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function fv(t,e){return D(t,Vi(e))}function qi(t,e){return D(Vi(t),Vi(e))}function hv(t,e){return qi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Jl(t){let e=await M.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 M.realpath(t),...Vi(e)}}async function Nt(t){for(let e of t){let r=await M.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!fv(e,r)||await M.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function pv(t,e,r){let[i,n]=await Promise.all([M.lstat(t),M.realpath(t),Nt(r)]);if(!i.isFile()||i.isSymbolicLink()||!qi(i,e)||!Fi(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function mv(t,e){let r=ee.resolve(t),i=ee.resolve(e);if(!Fi(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await Jl(r)],a=ee.relative(r,i).split(ee.sep).filter(Boolean),o=r;for(let s of a){await Nt(n),o=ee.join(o,s);try{await M.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Jl(o);if(!Fi(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Nt(n),n}async function vv(t){let e;try{e=await M.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function gv(t,e,r){let i=ee.dirname(t),n=await mv(r.containedRoot,i),a=ee.join(i,`.${ee.basename(t)}.${uv()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await M.open(a,"wx"),s=await o.stat();let[l,f]=await Promise.all([M.lstat(a),M.realpath(a)]);if(await Nt(n),!l.isFile()||l.isSymbolicLink()||!qi(s,l)||!Fi(n[0].realPath,f))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!qi(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await pv(a,c,n),await r.beforeCommit?.(),await Nt(n);let u=await M.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!hv(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await io(a,t),await M.unlink(a)):await M.rename(a,t),await vv(i)}catch(l){await o?.close();try{await Nt(n),await M.rm(a,{force:!0})}catch{}throw l}}async function et(t,e,r){await gv(t,e,r)}var bt=w(()=>{"use strict";lr()});var SN,no=w(()=>{"use strict";bt();yt();Ze();SN=16*1024});async function ao(t,e){if(!e)return;let r=await Mi(t);if(!to(r,e))throw new Error("Project config changed before commit; rerun the operation")}var oo=w(()=>{"use strict";bt();$e();yt();Ze();no()});var ce=w(()=>{"use strict";lr()});import{randomUUID as Nv}from"crypto";import{promises as L}from"fs";import te from"path";function Wi(t,e){let r=te.relative(t,e);return r===""||!te.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${te.sep}`)}function bv(t,e){return D({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function zi(t,e){return D({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function kv(t,e){return zi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Gl(t){let e=await L.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await L.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function kt(t){for(let e of t){let r=await L.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!bv(e,r)||await L.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function Sv(t,e,r){let[i,n]=await Promise.all([L.lstat(t),L.realpath(t),r?kt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!zi(i,e)||r&&!Wi(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function Ev(t,e){let r=te.resolve(t),i=te.resolve(e);if(!Wi(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Gl(r)],a=te.relative(r,i).split(te.sep).filter(Boolean),o=r;for(let s of a){await kt(n),o=te.join(o,s);try{await L.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Gl(o);if(!Wi(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await kt(n),n}async function xv(t){let e;try{e=await L.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function Cv(t,e,r={}){let i=te.dirname(t),n=r.containedRoot?await Ev(r.containedRoot,i):null;n||await L.mkdir(i,{recursive:!0});let a=te.join(i,`.${te.basename(t)}.${Nv()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await L.open(a,"wx"),s=await o.stat(),n){let[l,f]=await Promise.all([L.lstat(a),L.realpath(a)]);if(await kt(n),!l.isFile()||l.isSymbolicLink()||!zi(s,l)||!Wi(n[0].realPath,f))throw new Error("Native atomic write temporary file opened outside its managed parent")}if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!zi(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await Sv(a,c,n),await r.beforeCommit?.(),n){await kt(n);let l=await L.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!kv(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await L.link(a,t),await L.unlink(a)):await L.rename(a,t),await xv(i)}catch(l){if(await o?.close(),!n)await L.rm(a,{force:!0});else try{await kt(n),await L.rm(a,{force:!0})}catch{}throw l}}async function we(t,e,r={}){await Cv(t,e,r)}var j=w(()=>{"use strict";ce()});import{existsSync as MN,promises as ye}from"fs";import _ from"path";import Pv from"os";async function so(t){try{return await ye.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Rv(t){try{let e=await ye.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function mr(t,e){let r=_.relative(t,e);return r===""||!_.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${_.sep}`)}async function St(t){let e=[],r=t;for(;!await so(r);){let n=_.dirname(r);if(n===r)break;e.push(_.basename(r)),r=n}let i=await ye.realpath(r);return _.resolve(i,...e.reverse())}async function co(t){try{return(await ye.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function lo(t){let e=_.resolve(t);try{(await ye.stat(e)).isDirectory()||(e=_.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=_.resolve(Pv.homedir());for(;;){if(!(e===i&&r!==i)){let o=_.join(e,...Ji.split("/")),s=e===r||await Rv(o);if(await so(o)&&s)return e}if(await so(_.join(e,".git")))return e;let a=_.dirname(e);if(a===e)return r;e=a}}function vr(t){return Xe(t)}async function Av(t,e){let r=vr(e),i=_.resolve(t,...r.split("/")),n=await ye.realpath(t),a=await St(i);if(!mr(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function tt(t,e){let r=vr(e),i=await Av(t,r),n=_.join(i,"comet");if(await co(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([St(i),St(n)]);if(!mr(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=_.resolve(t),c=_.join(s,".comet","runtime","native");if(await co(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,f]=await Promise.all([ye.realpath(s),St(c)]);if(!mr(l,f))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:_.join(t,...Ji.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:_.join(n,"specs"),changesDir:_.join(n,"changes"),archiveDir:_.join(n,"archive"),runtimeDir:c,changesRuntimeDir:_.join(c,"changes"),locksDir:_.join(c,"locks"),transactionsDir:_.join(c,"transactions")}}async function Ul(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await F(t.nativeRoot,e),await ye.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await F(t.projectRoot,e),await ye.mkdir(e,{recursive:!0})}))}async function F(t,e){let r=_.resolve(t),i=_.resolve(e);if(!mr(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await co(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([St(r),St(i)]);if(!mr(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var Ji,I=w(()=>{"use strict";$e();Ji=".comet/config.yaml"});import _v from"path";function Yl(t="docs",e="en"){return Oi(t,e)}async function le(t){let e=(await Bi(t))?.config??null;return e?.native?e:null}async function gr(t,e,r={}){let i=await pr(t,{allowPartialProject:!0}),n=cr(i.document?.value??{},e),a=_v.join(t,...Ji.split("/"));await we(a,sr(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await ao(t,i.identity)}})}var Kl,Y=w(()=>{"use strict";$e();yt();oo();j();I();Kl=Ol});import{promises as Iv}from"node:fs";import Tv from"node:path";function jv(t){return t.includes(`\r
170
170
  `)?`\r
171
171
  `:`
172
172
  `}function $v(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Ov(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function Hv(t){let e=[],r=!1;for(let i of $v(t)){let n=Ov(i);if(n===Ql){if(r)throw new Error("Comet .gitignore managed block is malformed");r=!0;continue}if(n===Zl){if(!r)throw new Error("Comet .gitignore managed block is malformed");r=!1;continue}r||e.push(i)}if(r)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function eu(t){let e=jv(t),r=Hv(t);return r.length>0&&!/(?:\r\n|\n|\r)$/u.test(r)&&(r+=e),r+[Ql,"!/.comet/","/.comet/*","!/.comet/config.yaml",Zl,""].join(e)}async function uo(t){let e=Tv.resolve(t),r=await ge(e,wr,{label:"project .gitignore",expected:"file"}),i="",n=new Uint8Array;r.exists&&(n=(await se(e,wr,Xl,{label:"project .gitignore"})).bytes,i=Buffer.from(n).toString("utf8"));let a=eu(i);a!==i&&(await et(r.target,a,{containedRoot:e,exclusive:!r.exists,beforeCommit:r.exists?async()=>{if(!(await se(e,wr,Xl,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await ge(e,wr,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}}),await ge(e,wr,{label:"project .gitignore",expected:"file"}),await Iv.access(r.target))}var wr,Xl,Ql,Zl,fo=w(()=>{"use strict";bt();Ze();wr=".gitignore",Xl=4*1024*1024,Ql="# >>> Comet managed project state >>>",Zl="# <<< Comet managed project state <<<"});import{execFileSync as Dv}from"child_process";import Gi from"path";function ho(t,e){return Dv("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim()}function Lv(t,e){let r=Gi.normalize(t),i=Gi.normalize(e);return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function Le(t){try{let e=Gi.resolve(ho(t,["rev-parse","--show-toplevel"])),i=ho(t,["worktree","list","--porcelain","-z"]).split("\0").find(o=>o.startsWith("worktree ")),n=i?Gi.resolve(i.slice(9)):e,a=null;try{a=ho(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!Lv(e,n),currentWorktreeRoot:e,primaryWorktreeRoot:n,currentBranch:a}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}var Be=w(()=>{"use strict"});function Vv(t,e){return po[t][e]}function Ui(t){return["outcome","scope","nonGoals","acceptanceExamples","constraints","decisions","openQuestions","verificationExpectations"].map(r=>`# ${Vv(t,r)}
173
173
  `).join(`
174
- `)}var po,Bv,Mv,Fv,nu,rt=w(()=>{"use strict";po={en:{outcome:"Outcome",scope:"Scope",nonGoals:"Non-goals",acceptanceExamples:"Acceptance examples",constraints:"Constraints and invariants",decisions:"Decisions",openQuestions:"Open questions",verificationExpectations:"Verification expectations"},"zh-CN":{outcome:"目标",scope:"范围",nonGoals:"非目标",acceptanceExamples:"验收示例",constraints:"约束与不变量",decisions:"决策",openQuestions:"待解决问题",verificationExpectations:"验证预期"}},Bv={en:{verification:"Verification",currentResult:"Current result",acceptance:"Acceptance",checks:"Checks",blockers:"Blockers",risks:"Risks and skipped work",previousIterations:"Previous iterations",conclusion:"Conclusion"},"zh-CN":{verification:"验证",currentResult:"当前结果",acceptance:"验收",checks:"检查",blockers:"阻塞项",risks:"风险与跳过的工作",previousIterations:"之前的迭代",conclusion:"结论"}},Mv={en:{acceptanceEvidence:"Acceptance evidence",commandsAndResults:"Commands and results",skippedChecks:"Skipped checks",specConsistency:"Spec consistency",knownLimitationsAndRisks:"Known limitations and risks",conclusion:"Conclusion"},"zh-CN":{acceptanceEvidence:"验收证据",commandsAndResults:"命令与结果",skippedChecks:"跳过的检查",specConsistency:"规格一致性",knownLimitationsAndRisks:"已知限制与风险",conclusion:"结论"}},Fv=new Map,nu=new Map;for(let t of Object.keys(po)){for(let[e,r]of Object.entries(po[t]))Fv.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Bv[t]))nu.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Mv[t]))nu.set(r.toLocaleLowerCase("en-US"),e)}});var yr=w(()=>{"use strict"});var vo,ue=w(()=>{"use strict";yr();ce();vo=1024*1024});import{AsyncLocalStorage as qv}from"async_hooks";var xb,Pb,Nr=w(()=>{"use strict";fr();I();ce();xb=16*1024,Pb=new qv});import{createHash as Wv}from"crypto";function re(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function zv(t,e){e.has(t)&&re("cyclic structures are not supported"),e.add(t);try{let r=Object.keys(t);for(let i=0;i<t.length;i+=1)Object.prototype.hasOwnProperty.call(t,i)||re("sparse arrays are not supported");return(r.length!==t.length||r.some((i,n)=>i!==String(n)))&&re("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&re("symbol properties are not supported"),`[${t.map(i=>go(i,e)).join(",")}]`}finally{e.delete(t)}}function Jv(t,e){let r=Object.getPrototypeOf(t);r!==Object.prototype&&r!==null&&re("only plain objects are supported"),e.has(t)&&re("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&re("symbol properties are not supported"),e.add(t);try{let i=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=i[o];return(!s||!("value"in s))&&re("accessor properties are not supported"),`${JSON.stringify(o)}:${go(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function go(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||re("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?zv(t,e):Jv(t,e);case"bigint":case"function":case"symbol":case"undefined":return re(`${typeof t} values are not supported`)}return re("unsupported value type")}function wo(t){return go(t,new Set)}function z(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return Wv("sha256").update(`${t}
175
- ${wo(e)}`).digest("hex")}var J=w(()=>{"use strict"});var jb,au,Ki=w(()=>{"use strict";rt();J();jb=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),au=Object.freeze({maxCriteria:1024})});var yo=w(()=>{"use strict";Ki()});var Yi=w(()=>{"use strict"});var ou,br=w(()=>{"use strict";ou=Pt(vt(),1);j();Yi()});var Xi=w(()=>{"use strict"});var Qi=w(()=>{"use strict"});var lu=w(()=>{"use strict";V();yo();br();Xi();Yi();Qi()});var du,rk,ik,No=w(()=>{"use strict";ue();lu();du="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",rk=new RegExp(`^portable-archive-(${du})\\.json$`,"u"),ik=new RegExp(`^portable-migration-(${du})\\.json$`,"u")});var de=w(()=>{"use strict";j();ce()});import{TextDecoder as ng}from"util";var mk,vk,gk,wk,yk,en=w(()=>{"use strict";j();I();de();mk=256*1024,vk=1024*1024,gk=16*1024,wk=64*1024*1024,yk=new ng("utf-8",{fatal:!0})});var ie=w(()=>{"use strict";Y();Nr();No();en()});var vu=w(()=>{"use strict"});import{createHash as og}from"crypto";function X(t){return og("sha256").update(t).digest("hex")}var he=w(()=>{"use strict"});var Vk,qk,Wk,zk,Jk,Gk,Uk,kr=w(()=>{"use strict";j();Y();he();ce();I();de();yr();Vk={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024},qk=8*1024*1024,Wk=64*1024,zk=64*1024,Jk={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},Gk={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024},Uk=(1n<<256n)-1n});var Sr=w(()=>{"use strict"});var tn=w(()=>{"use strict"});var gu=w(()=>{"use strict"});var ko=w(()=>{"use strict";tn()});var wu=w(()=>{"use strict";tn();ko()});var hg,yu=w(()=>{"use strict";hg=Pt(vt(),1);bt();$e();Ze()});function mg(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function Nu(t,e){return(...r)=>{let i=pg;if(i===null)return e(...r);let n=mg(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}var pg,bu=w(()=>{"use strict";pg=null});var dS,ku=w(()=>{"use strict";bu();yt();dS=Nu("hookWritePolicy",async t=>(await ro(t))?.hook??{allow_paths:[]})});var Su=w(()=>{"use strict";tn();bt();gu();wu();$e();yu();Ze();yt();oo();fo();ku();no();ko()});var Eu=w(()=>{"use strict";Su();lr()});var nE,Cu=w(()=>{"use strict";Eu();nE=256*1024});var xu=w(()=>{"use strict";Cu();Sr()});var gE,Er=w(()=>{"use strict";Sr();xu();j();ce();gE={runStateBytes:256*1024,trajectoryBytes:8*1024*1024,trajectoryEvents:4096,trajectoryEventBytes:256*1024,checkpointBytes:256*1024,pendingActionBytes:256*1024,contextBytes:1024*1024,artifactsBytes:1024*1024}});var So=w(()=>{"use strict";Sr();ie();I();Er()});var IE,TE,rn=w(()=>{"use strict";Be();j();ue();ie();I();IE=16*1024,TE=process.platform});var Iu,Tu,iC,yg,nC,nn,Cr,an,aC,V=w(()=>{"use strict";Iu=Pt(vt(),1);Be();ue();j();rt();Y();ie();I();de();vu();kr();So();rn();Qi();Tu=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],iC=new Set(Tu),yg=new Set([...Tu,"minimum_runtime_version","revision"]),nC=new Set([...yg,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]),nn=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Cr=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},an=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},aC=Ui("en")});var ju,Et=w(()=>{"use strict";J();kr();ju=1024*1024});var it=w(()=>{"use strict"});var on=w(()=>{"use strict";J();it();yr();Et()});var Ou,Sg,Eg,Cg,_C,xg,IC,xo=w(()=>{"use strict";J();Ou="scoped-text-safety",Sg=1,Eg=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128}),Cg="comet.native.checker-policy.v1",_C=z(Cg,{policy:Ou,version:Sg,limits:Eg,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"}),xg=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],IC=new Set(xg)});var sn=w(()=>{"use strict";J();xo();it()});var Ag,UC,Ct=w(()=>{"use strict";j();I();ce();Et();on();sn();Ag=ju,UC=3*Ag});var vP,cn=w(()=>{"use strict";vP=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ")});var Po=w(()=>{"use strict"});var RA,Ar=w(()=>{"use strict";RA=8*1024*1024});var Ao=w(()=>{"use strict";Ar();j()});var _o=w(()=>{"use strict";cn();Po();it()});var _r=w(()=>{"use strict"});var un=w(()=>{"use strict";_r()});var Fu=w(()=>{"use strict"});var zA,Vu=w(()=>{"use strict";cn();zA=8*1024*1024});var qu=w(()=>{"use strict";Vu()});var dn,Io=w(()=>{"use strict";Ar();Be();Y();Ao();Nr();I();dn=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation}});var To=w(()=>{"use strict";Ao();j();J();_o();un();ie();I();Y();Be();Fu();Ar();qu();Io()});var pw,Wu=w(()=>{"use strict";pw=Pt(vt(),1);Be();Ar();ue();J();Y();I();br();To()});Y();fo();I();fr();import Ir from"path";import{realpathSync as Iw}from"fs";Be();var Ne={next:"NEXT:",relay:"RELAY TO USER:",detail:"DETAIL:",details:"--- machine projection (run with --json to consume it) ---"};function tu(t){return t?t.command?`${Ne.next} ${t.command}`:t.ask_user?`${Ne.next} ${t.ask_user}`:null:null}function ru(t,e){let r=[t.summary],i=tu(t.next);return i&&r.push(i),t.user_message&&r.push("",Ne.relay,t.user_message),e!==void 0&&r.push("",Ne.details,JSON.stringify(e,null,2)),`${r.join(`
174
+ `)}var po,Bv,Mv,Fv,nu,rt=w(()=>{"use strict";po={en:{outcome:"Outcome",scope:"Scope",nonGoals:"Non-goals",acceptanceExamples:"Acceptance examples",constraints:"Constraints and invariants",decisions:"Decisions",openQuestions:"Open questions",verificationExpectations:"Verification expectations"},"zh-CN":{outcome:"目标",scope:"范围",nonGoals:"非目标",acceptanceExamples:"验收示例",constraints:"约束与不变量",decisions:"决策",openQuestions:"待解决问题",verificationExpectations:"验证预期"}},Bv={en:{verification:"Verification",currentResult:"Current result",acceptance:"Acceptance",checks:"Checks",blockers:"Blockers",risks:"Risks and skipped work",previousIterations:"Previous iterations",conclusion:"Conclusion"},"zh-CN":{verification:"验证",currentResult:"当前结果",acceptance:"验收",checks:"检查",blockers:"阻塞项",risks:"风险与跳过的工作",previousIterations:"之前的迭代",conclusion:"结论"}},Mv={en:{acceptanceEvidence:"Acceptance evidence",commandsAndResults:"Commands and results",skippedChecks:"Skipped checks",specConsistency:"Spec consistency",knownLimitationsAndRisks:"Known limitations and risks",conclusion:"Conclusion"},"zh-CN":{acceptanceEvidence:"验收证据",commandsAndResults:"命令与结果",skippedChecks:"跳过的检查",specConsistency:"规格一致性",knownLimitationsAndRisks:"已知限制与风险",conclusion:"结论"}},Fv=new Map,nu=new Map;for(let t of Object.keys(po)){for(let[e,r]of Object.entries(po[t]))Fv.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Bv[t]))nu.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Mv[t]))nu.set(r.toLocaleLowerCase("en-US"),e)}});var yr=w(()=>{"use strict"});var vo,ue=w(()=>{"use strict";yr();ce();vo=1024*1024});import{AsyncLocalStorage as qv}from"async_hooks";var Cb,Pb,Nr=w(()=>{"use strict";fr();I();ce();Cb=16*1024,Pb=new qv});import{createHash as Wv}from"crypto";function re(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function zv(t,e){e.has(t)&&re("cyclic structures are not supported"),e.add(t);try{let r=Object.keys(t);for(let i=0;i<t.length;i+=1)Object.prototype.hasOwnProperty.call(t,i)||re("sparse arrays are not supported");return(r.length!==t.length||r.some((i,n)=>i!==String(n)))&&re("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&re("symbol properties are not supported"),`[${t.map(i=>go(i,e)).join(",")}]`}finally{e.delete(t)}}function Jv(t,e){let r=Object.getPrototypeOf(t);r!==Object.prototype&&r!==null&&re("only plain objects are supported"),e.has(t)&&re("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&re("symbol properties are not supported"),e.add(t);try{let i=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=i[o];return(!s||!("value"in s))&&re("accessor properties are not supported"),`${JSON.stringify(o)}:${go(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function go(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||re("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?zv(t,e):Jv(t,e);case"bigint":case"function":case"symbol":case"undefined":return re(`${typeof t} values are not supported`)}return re("unsupported value type")}function wo(t){return go(t,new Set)}function z(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return Wv("sha256").update(`${t}
175
+ ${wo(e)}`).digest("hex")}var J=w(()=>{"use strict"});var jb,au,Ki=w(()=>{"use strict";rt();J();jb=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),au=Object.freeze({maxCriteria:1024})});var yo=w(()=>{"use strict";Ki()});var Yi=w(()=>{"use strict"});var ou,br=w(()=>{"use strict";ou=Pt(vt(),1);j();Yi()});var Xi=w(()=>{"use strict"});var Qi=w(()=>{"use strict"});var lu=w(()=>{"use strict";V();yo();br();Xi();Yi();Qi()});var du,rk,ik,No=w(()=>{"use strict";ue();lu();du="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",rk=new RegExp(`^portable-archive-(${du})\\.json$`,"u"),ik=new RegExp(`^portable-migration-(${du})\\.json$`,"u")});var de=w(()=>{"use strict";j();ce()});import{TextDecoder as ng}from"util";var mk,vk,gk,wk,yk,en=w(()=>{"use strict";j();I();de();mk=256*1024,vk=1024*1024,gk=16*1024,wk=64*1024*1024,yk=new ng("utf-8",{fatal:!0})});var ie=w(()=>{"use strict";Y();Nr();No();en()});var vu=w(()=>{"use strict"});import{createHash as og}from"crypto";function X(t){return og("sha256").update(t).digest("hex")}var he=w(()=>{"use strict"});var Vk,qk,Wk,zk,Jk,Gk,Uk,kr=w(()=>{"use strict";j();Y();he();ce();I();de();yr();Vk={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024},qk=8*1024*1024,Wk=64*1024,zk=64*1024,Jk={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},Gk={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024},Uk=(1n<<256n)-1n});var Sr=w(()=>{"use strict"});var tn=w(()=>{"use strict"});var gu=w(()=>{"use strict"});var ko=w(()=>{"use strict";tn()});var wu=w(()=>{"use strict";tn();ko()});var hg,yu=w(()=>{"use strict";hg=Pt(vt(),1);bt();$e();Ze()});function mg(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function Nu(t,e){return(...r)=>{let i=pg;if(i===null)return e(...r);let n=mg(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}var pg,bu=w(()=>{"use strict";pg=null});var dS,ku=w(()=>{"use strict";bu();yt();dS=Nu("hookWritePolicy",async t=>(await ro(t))?.hook??{allow_paths:[]})});var Su=w(()=>{"use strict";tn();bt();gu();wu();$e();yu();Ze();yt();oo();fo();ku();no();ko()});var Eu=w(()=>{"use strict";Su();lr()});var nE,xu=w(()=>{"use strict";Eu();nE=256*1024});var Cu=w(()=>{"use strict";xu();Sr()});var gE,Er=w(()=>{"use strict";Sr();Cu();j();ce();gE={runStateBytes:256*1024,trajectoryBytes:8*1024*1024,trajectoryEvents:4096,trajectoryEventBytes:256*1024,checkpointBytes:256*1024,pendingActionBytes:256*1024,contextBytes:1024*1024,artifactsBytes:1024*1024}});var So=w(()=>{"use strict";Sr();ie();I();Er()});var IE,TE,rn=w(()=>{"use strict";Be();j();ue();ie();I();IE=16*1024,TE=process.platform});var Iu,Tu,ix,yg,nx,nn,xr,an,ax,V=w(()=>{"use strict";Iu=Pt(vt(),1);Be();ue();j();rt();Y();ie();I();de();vu();kr();So();rn();Qi();Tu=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],ix=new Set(Tu),yg=new Set([...Tu,"minimum_runtime_version","revision"]),nx=new Set([...yg,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]),nn=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},xr=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},an=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},ax=Ui("en")});var ju,Et=w(()=>{"use strict";J();kr();ju=1024*1024});var it=w(()=>{"use strict"});var on=w(()=>{"use strict";J();it();yr();Et()});var Ou,Sg,Eg,xg,_x,Cg,Ix,Co=w(()=>{"use strict";J();Ou="scoped-text-safety",Sg=1,Eg=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128}),xg="comet.native.checker-policy.v1",_x=z(xg,{policy:Ou,version:Sg,limits:Eg,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"}),Cg=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],Ix=new Set(Cg)});var sn=w(()=>{"use strict";J();Co();it()});var Ag,Ux,xt=w(()=>{"use strict";j();I();ce();Et();on();sn();Ag=ju,Ux=3*Ag});var vP,cn=w(()=>{"use strict";vP=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ")});var Po=w(()=>{"use strict"});var RA,Ar=w(()=>{"use strict";RA=8*1024*1024});var Ao=w(()=>{"use strict";Ar();j()});var _o=w(()=>{"use strict";cn();Po();it()});var _r=w(()=>{"use strict"});var un=w(()=>{"use strict";_r()});var Fu=w(()=>{"use strict"});var zA,Vu=w(()=>{"use strict";cn();zA=8*1024*1024});var qu=w(()=>{"use strict";Vu()});var dn,Io=w(()=>{"use strict";Ar();Be();Y();Ao();Nr();I();dn=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation}});var To=w(()=>{"use strict";Ao();j();J();_o();un();ie();I();Y();Be();Fu();Ar();qu();Io()});var pw,Wu=w(()=>{"use strict";pw=Pt(vt(),1);Be();Ar();ue();J();Y();I();br();To()});Y();fo();I();fr();import Ir from"path";import{realpathSync as Iw}from"fs";Be();var Ne={next:"NEXT:",relay:"RELAY TO USER:",detail:"DETAIL:",details:"--- machine projection (run with --json to consume it) ---"};function tu(t){return t?t.command?`${Ne.next} ${t.command}`:t.ask_user?`${Ne.next} ${t.ask_user}`:null:null}function ru(t,e){let r=[t.summary],i=tu(t.next);return i&&r.push(i),t.user_message&&r.push("",Ne.relay,t.user_message),e!==void 0&&r.push("",Ne.details,JSON.stringify(e,null,2)),`${r.join(`
176
176
  `)}
177
177
  `}function iu(t,e,r){let i=[t.summary],n=tu(t.next);return n&&i.push(n),t.user_message&&i.push("",Ne.relay,t.user_message),i.push("",`${Ne.detail} ${e}`),r!==void 0&&i.push("",Ne.details,JSON.stringify(r,null,2)),i.join(`
178
- `)}rt();V();ue();he();I();var bg=["outcome","scope","nonGoals","acceptanceExamples"],hC=[...bg,"constraints","decisions","openQuestions","verificationExpectations"];Er();J();ue();V();J();var kg=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});Ct();de();rn();V();Y();I();Sr();j();V();he();Nr();ie();I();de();it();J();J();on();Et();he();var Hu={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},Ig=X("comet-native-runtime:v3:scope-reopen"),bx=[{skillVersion:"3",skillHash:X("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:X("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:X("comet-native-runtime:v1")}];Er();he();Er();he();So();Qi();var Lu=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],tP=new Set(Lu),Lg=new Set([...Lu,"minimum_runtime_version","revision"]),rP=new Set([...Lg,"operation"]),iP=512*1024,Bg=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),nP=new Set([...Bg,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);Ki();ue();V();ue();Ki();J();var lP={maxAcceptanceCriteria:au.maxCriteria};var pP={maxSpecs:64,maxFileBytes:vo,maxTotalBytes:4*1024*1024};Ct();kr();Et();on();import{execFile as Yg}from"node:child_process";cn();Po();V();import{promisify as Xg}from"node:util";V();j();V();he();I();de();yr();it();var PP={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};ie();j();xo();I();ce();var UP=512*1024;Ct();ie();it();var Rr=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};kr();sn();Et();var gR=64*1024;var wR=3600*1e3;var yR=Xg(Yg);sn();var ln=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};rn();he();de();var iA={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};j();ce();I();de();en();var mA=16*1024*1024,vA=256*1024,gA=16*1024;V();j();rt();V();Ct();var SA=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});he();Nr();ie();I();de();fr();var xA=16*1024;V();Y();ie();Be();j();ue();J();Wu();To();V();_o();br();Xi();_r();un();j();Yi();ie();yo();br();No();Xi();_r();un();j();rt();_r();I();rt();Ct();Y();var hT=Ui("en");var RT=16*1024;en();var yj=16*1024*1024,fn=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},hn=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};V();I();Y();function x(t,e,r){return t==="zh-CN"?r:e}var jo={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function zu(t,e){return typeof t=="string"&&jo[t]?x(e,jo[t].en,jo[t].zh):typeof t=="string"?t:""}function $o(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function gw(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function Ju(t,e){let r=[];t.failed>0&&r.push(x(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(x(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(x(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=x(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function Gu(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function Oo(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function ww(t,e,r){return t==="done"?x(r,"complete","已完成"):t==="await-user"?x(r,"waiting for a user decision","等待用户决定"):t==="blocked"?x(r,"paused: needs attention","已暂停,需要处理"):e?x(r,"waiting for a user decision","等待用户决定"):x(r,"ready to continue","可继续推进")}function yw(t,e,r){let i=Oo(t),n=[];r&&n.push(r);let a=x(i,`Change ${t.change}`,`需求 ${t.change}`),o=zu(t.phase,i),s=ww(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push(Ju(e,i));let c=t.userCommunication,l=Uu(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function Uu(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:x(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:x(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:x(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function Nw(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function bw(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=zu(t.phase,e),n=t.status==="await-user"?x(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?x(e,"paused","已暂停"):t.status==="done"?x(e,"complete","已完成"):x(e,"in progress","进行中"),a=$o(t.acceptance)?`${x(e,", ",",")}${Ju(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function kw(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function Sw(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function Ew(t){if(t.healthy){let i=t.repaired?x("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):x("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=Cw(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:x("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:x("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function Cw(t){return Gu(t)?Uu(t,Oo(t)):void 0}function Ku(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Sw(e))return Ew(e);if(Nw(e)){let i=kw(e.items);return{summary:[e.total===e.items.length?x(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):x(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>bw(a,i))].join(`
179
- `)}}let r=e.continuation;if(Gu(r))return yw(r,xw(e),Pw(e,Oo(r)));if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:x(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function xw(t){if($o(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if($o(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return gw(r.acceptance)}return null}function Pw(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return x(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?x(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Yu(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"conflict":return{summary:x("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:x("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:x("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:x("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:x("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:x("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:x("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:x("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:x("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}Io();var Xu=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],Do=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec remove Record a complete capability removal intent.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","check <change-name> Run the read-only Native verification check.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Xu,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN","comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:`comet native spec remove <change-name> <capability>
180
- comet native spec sync <change-name> <capability> --input <json-file>`,purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["remove <change-name> <capability> Record a capability removal.","sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections without changing prose or acceptance."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},"spec sync":{usage:"comet native spec sync <change-name> <capability> --input <json-file>",purpose:"Sync local Markdown link destinations in an already confirmed target spec; semantic edits require Shape.",options:["--input <json-file> Fields: expectedStateVersion, actor, reason, affectedAcceptanceIds, replacements [{from,to}]. Include all acceptance IDs from the affected spec."],output:"The audited portable state, preserved unaffected acceptance results and Build continuation for re-verification."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"The portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries, parent child readiness, or the exact next Runner action.",options:["--cursor <token> Continue a status-list page, or a named details/history page.","--details Include one fixed-size page of acceptance, Spec, handoff, verification, history, workspace, and report details."],output:"A compact v2 status page or one compact Loop projection with local execution availability. Use --details and --cursor to read fixed-size detail pages; parent changes expose childSummary and readyChildren.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--coordination-mode multi-session|single-session] [--max-parallel <n>] [--expected-state-version <n>] [--expected-action <action>]
178
+ `)}rt();V();ue();he();I();var bg=["outcome","scope","nonGoals","acceptanceExamples"],hx=[...bg,"constraints","decisions","openQuestions","verificationExpectations"];Er();J();ue();V();J();var kg=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});xt();de();rn();V();Y();I();Sr();j();V();he();Nr();ie();I();de();it();J();J();on();Et();he();var Hu={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},Ig=X("comet-native-runtime:v3:scope-reopen"),bC=[{skillVersion:"3",skillHash:X("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:X("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:X("comet-native-runtime:v1")}];Er();he();Er();he();So();Qi();var Lu=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],tP=new Set(Lu),Lg=new Set([...Lu,"minimum_runtime_version","revision"]),rP=new Set([...Lg,"operation"]),iP=512*1024,Bg=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),nP=new Set([...Bg,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);Ki();ue();V();ue();Ki();J();var lP={maxAcceptanceCriteria:au.maxCriteria};var pP={maxSpecs:64,maxFileBytes:vo,maxTotalBytes:4*1024*1024};xt();kr();Et();on();import{execFile as Yg}from"node:child_process";cn();Po();V();import{promisify as Xg}from"node:util";V();j();V();he();I();de();yr();it();var PP={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};ie();j();Co();I();ce();var UP=512*1024;xt();ie();it();var Rr=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};kr();sn();Et();var gR=64*1024;var wR=3600*1e3;var yR=Xg(Yg);sn();var ln=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};rn();he();de();var iA={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};j();ce();I();de();en();var mA=16*1024*1024,vA=256*1024,gA=16*1024;V();j();rt();V();xt();var SA=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});he();Nr();ie();I();de();fr();var CA=16*1024;V();Y();ie();Be();j();ue();J();Wu();To();V();_o();br();Xi();_r();un();j();Yi();ie();yo();br();No();Xi();_r();un();j();rt();_r();I();rt();xt();Y();var hT=Ui("en");var RT=16*1024;en();var yj=16*1024*1024,fn=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},hn=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};V();I();Y();function C(t,e,r){return t==="zh-CN"?r:e}var jo={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function zu(t,e){return typeof t=="string"&&jo[t]?C(e,jo[t].en,jo[t].zh):typeof t=="string"?t:""}function $o(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function gw(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function Ju(t,e){let r=[];t.failed>0&&r.push(C(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(C(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(C(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=C(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function Gu(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function Oo(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function ww(t,e,r){return t==="done"?C(r,"complete","已完成"):t==="await-user"?C(r,"waiting for a user decision","等待用户决定"):t==="blocked"?C(r,"paused: needs attention","已暂停,需要处理"):e?C(r,"waiting for a user decision","等待用户决定"):C(r,"ready to continue","可继续推进")}function yw(t,e,r){let i=Oo(t),n=[];r&&n.push(r);let a=C(i,`Change ${t.change}`,`需求 ${t.change}`),o=zu(t.phase,i),s=ww(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push(Ju(e,i));let c=t.userCommunication,l=Uu(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function Uu(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:C(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:C(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:r.required&&r.message?r.agentInstruction:C(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function Nw(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function bw(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=zu(t.phase,e),n=t.status==="await-user"?C(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?C(e,"paused","已暂停"):t.status==="done"?C(e,"complete","已完成"):C(e,"in progress","进行中"),a=$o(t.acceptance)?`${C(e,", ",",")}${Ju(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function kw(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function Sw(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function Ew(t){if(t.healthy){let i=t.repaired?C("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):C("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=xw(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:C("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:C("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function xw(t){return Gu(t)?Uu(t,Oo(t)):void 0}function Ku(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Sw(e))return Ew(e);if(Nw(e)){let i=kw(e.items);return{summary:[e.total===e.items.length?C(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):C(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>bw(a,i))].join(`
179
+ `)}}let r=e.continuation;if(Gu(r))return yw(r,Cw(e),Pw(e,Oo(r)));if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:C(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function Cw(t){if($o(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if($o(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return gw(r.acceptance)}return null}function Pw(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return C(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?C(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Yu(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"conflict":return{summary:C("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:C("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:C("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:C("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:C("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:C("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:C("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:C("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:C("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}Io();var Xu=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],Do=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec remove Record a complete capability removal intent.","spec sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Xu,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN","comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:`comet native spec remove <change-name> <capability>
180
+ comet native spec sync <change-name> <capability> --input <json-file>`,purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["remove <change-name> <capability> Record a capability removal.","sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections without changing prose or acceptance."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},"spec sync":{usage:"comet native spec sync <change-name> <capability> --input <json-file>",purpose:"Sync local Markdown link destinations in an already confirmed target spec; semantic edits require Shape.",options:["--input <json-file> Fields: expectedStateVersion, actor, reason, affectedAcceptanceIds, replacements [{from,to}]. Include all acceptance IDs from the affected spec."],output:"The audited portable state, preserved unaffected acceptance results and Build continuation for re-verification."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"A compact summary and NEXT action by default. Use --json to read the portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required. Fill command-template placeholders before executing NEXT commands."},check:{usage:"comet native check <change-name>",purpose:"Legacy-only verification command; not supported for current portable changes.",output:"For current changes, run comet native status <change-name> --json and follow the continuation to dispatch verification through comet native next."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries, parent child readiness, or the exact next Runner action.",options:["--cursor <token> Continue a status-list page, or a named details/history page.","--details Include one fixed-size page of acceptance, Spec, handoff, verification, history, workspace, and report details."],output:"A compact v2 status page or one compact Loop projection with local execution availability. Use --details and --cursor to read fixed-size detail pages; parent changes expose childSummary and readyChildren.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--coordination-mode multi-session|single-session] [--max-parallel <n>] [--expected-state-version <n>] [--expected-action <action>]
181
181
  comet native next <change-name> --summary <text> [--confirmed|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker] [--expected-state-version <n>] [--expected-action <action>]
182
182
  comet native next <change-name> --runner-input <json-file>`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, handle Supervisor task operations, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm the persisted Shape boundary with both expected guards, or confirm an explicitly degraded verifier-unavailable fallback before Archive.","--coordination-mode multi-session|single-session Select how a multi-child Supervisor proceeds while preparing its Shape confirmation; final Shape confirmation is a later, separate step.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify or Archive to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a failed or unavailable Verifier when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--max-parallel <n> Supervisor task concurrency cap; defaults to 2, use 1 for serial fallback.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, verifier-response, verifier-execution-error, or verifier-unavailable. Identity/provider/execution/candidate fields are rejected."," builder-handoff fields: kind, summary, addressed_acceptance_ids, checks, known_limits, review. review fields: status=passed, summary, reviewer_execution_ref from a separate read-only review."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," verifier-response fields: kind, response (request-checks or final-result)."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."," Supervisor task fields: supervisor-builder-result (child, runId, candidateCommit), supervisor-builder-failure (child, runId, reason), supervisor-verifier-result (child, runId, verdict, verification data), supervisor-reconnect (child, runId), supervisor-cancel (child, runId, reason), or supervisor-integrate (child, checks)."," supervisor-checks fields: kind, child, runId, checks (non-empty repeatable Runtime check plans), materials [{name,content}]. Returns checkExecution with operationId, status and receiptRef. Repeated running plans return the same handle."," supervisor-verifier-result evidence fields: summary, checks (informal notes), acceptance [{id,result,reason}], receiptRef. verdict is pass, fail or blocked; every task acceptance ID must appear exactly once. Runtime receipts determine formal check status; receiptRef may be null for fail or blocked."," supervisor-integrate checks are non-empty Runtime check plans executed after the merge in the integration worktree, not declared statuses."],output:'A compact portable state summary, explicit skill-coordinated label, Runtime-owned check results, scoped verifierDispatch, bounded request-check response, continuation.runnerAction, machine-readable continuation.inputOptions, and continuation.userCommunication with a user-ready message and Agent relay guidance. Read acceptance text and other long fields from paged status --details output. Human-readable verification statuses include "Host independently verified", "Checks completed, but your confirmation is required", "Full verification was unavailable; only automatic checks completed", and "You accepted the incomplete verification result". This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.',examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed --expected-state-version <n> --expected-action confirm-shape','comet native next session-timeout --summary "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep]
183
183
  comet native archive <change-name> [--confirmed] [--serial-first <current-change>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Run the complete read-only Archive and workspace-finish readiness check; it persists only an explicit --finish choice.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness, every blocker, and the exact next continuation, or the completed Archive transaction and workspace finish result. Execute the returned confirmed command only after ready is true; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function Ho(t,e){return`${t}:
@@ -186,7 +186,7 @@ ${e.map(r=>` ${r}`).join(`
186
186
  ${r.output}`),r.examples&&i.push("",Ho("Examples",r.examples)),e===""&&i.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${i.join(`
187
187
  `)}
188
188
  `}}var _w=Aw().usage;var Bj=10*1024*1024,We=class extends Error{};function Bo(t,e){let r=t.flatMap((i,n)=>i===e?[n]:[]);if(r.length>1)throw new We(`${e} may only be provided once`);return r.length===0?!1:(t.splice(r[0],1),!0)}function Tr(t,e){let r=t.flatMap((a,o)=>a===e?[o]:[]);if(r.length>1)throw new We(`${e} may only be provided once`);if(r.length===0)return;let i=r[0],n=t[i+1];if(n===void 0||n.startsWith("--"))throw new We(`${e} requires a value`);return t.splice(i,2),n}function Zu(t){if(t.length>0)throw new We(`Unexpected argument: ${t[0]}`)}function ed(t,e="en"){let r=Tr(t,"--language")??e;if(r!=="en"&&r!=="zh-CN")throw new We("--language must be en or zh-CN");return r}function Lo(t,e){let r=Ir.normalize(Qu(t)),i=Ir.normalize(Qu(e));return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function Qu(t){let e=Ir.resolve(t);try{return Iw.native(e)}catch{return e}}function Tw(t){let e=Ir.resolve(t),r=Le(process.cwd());if(!r.isSecondaryWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null)return e;let i=Le(e);return!i.isGitWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null||!Lo(r.primaryWorktreeRoot,i.primaryWorktreeRoot)||Lo(r.currentWorktreeRoot,i.currentWorktreeRoot)?e:Lo(process.cwd(),r.currentWorktreeRoot)?Ir.resolve(process.cwd()):r.currentWorktreeRoot}async function td(t){return t?Tw(t):lo(process.cwd())}function rd(t){return JSON.stringify(t,null,2)+`
189
- `}function id(t,e,r){return{command:t,exitCode:0,data:e,text:r??rd(e)}}function jw(t,e){if(e instanceof We)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof fn)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof hn)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof nn)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof Cr)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof dn)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof an)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof ln)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Rr)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let r=e.code;if(r&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(r))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let i=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:i?73:65,error:{code:i?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function nd(t,e){let r=jw(t,e),i=r.error;if(!i)return r;let n=Yu({code:i.code,message:i.message,data:r.data});return n?{...r,envelope:n}:r}function ad(t,e,r=!1){let i=t.envelope??Ku(t.data);return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...i===void 0?{}:{summary:i.summary,...i.next===void 0?{}:{next:i.next},...i.user_message===void 0?{}:{user_message:i.user_message}},...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
189
+ `}function id(t,e,r){return{command:t,exitCode:0,data:e,text:r??rd(e)}}function jw(t,e){if(e instanceof We)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof fn)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof hn)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof nn)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof xr)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof dn)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof an)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof ln)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Rr)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let r=e.code;if(r&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(r))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let i=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:i?73:65,error:{code:i?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function nd(t,e){let r=jw(t,e),i=r.error;if(!i)return r;let n=Yu({code:i.code,message:i.message,data:r.data});return n?{...r,envelope:n}:r}function ad(t,e,r=!1){let i=t.envelope??Ku(t.data);return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...i===void 0?{}:{summary:i.summary,...i.next===void 0?{}:{next:i.next},...i.user_message===void 0?{}:{user_message:i.user_message}},...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
190
190
  `}:t.error?{exitCode:t.exitCode,stderr:i?iu(i,t.error.message,r?t.data:void 0):t.error.message}:i?{exitCode:t.exitCode,stdout:ru(i,r?t.data:void 0)}:r&&t.text!==void 0&&t.data!==void 0&&t.text!==rd(t.data)?{exitCode:t.exitCode,stdout:`${t.text}
191
191
  ${Ne.details}
192
192
  ${JSON.stringify(t.data,null,2)}