@typescape-ai/cli 0.0.1 → 0.1.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 (3) hide show
  1. package/README.md +52 -28
  2. package/dist/cli.js +334 -0
  3. package/package.json +33 -6
package/README.md CHANGED
@@ -1,45 +1,69 @@
1
1
  # @typescape-ai/cli
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ Typescape CLI - Create review sessions, export feedback, and integrate with AI workflows.
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ ## Requirements
6
6
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
7
+ - [Bun](https://bun.sh/) >= 1.0.0
8
8
 
9
- ## Purpose
9
+ ## Installation
10
10
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@typescape-ai/cli`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
11
+ ```bash
12
+ # Using bun
13
+ bun add -D @typescape-ai/cli
15
14
 
16
- ## What is OIDC Trusted Publishing?
15
+ # Using npm/pnpm/yarn (still requires Bun runtime)
16
+ npm install -D @typescape-ai/cli
17
+ ```
17
18
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
+ ## Quick Start
19
20
 
20
- ## Setup Instructions
21
+ 1. Initialize config in your repo:
21
22
 
22
- To properly configure OIDC trusted publishing for this package:
23
+ ```bash
24
+ bunx typescape init
25
+ ```
23
26
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
27
+ 2. Set your API token:
28
28
 
29
- ## DO NOT USE THIS PACKAGE
29
+ ```bash
30
+ export TYPESCAPE_API_TOKEN=your-token-here
31
+ ```
30
32
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
33
+ 3. Create a review session:
36
34
 
37
- ## More Information
35
+ ```bash
36
+ bunx typescape session create --file docs/README.md
37
+ ```
38
38
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
39
+ 4. Export feedback:
42
40
 
43
- ---
41
+ ```bash
42
+ bunx typescape session export --session ses_xxx
43
+ ```
44
44
 
45
- **Maintained for OIDC setup purposes only**
45
+ ## Commands
46
+
47
+ | Command | Description |
48
+ | ----------------- | ------------------------------------------- |
49
+ | `init` | Create `.typescape/config.yaml` |
50
+ | `config validate` | Validate config and show effective settings |
51
+ | `session create` | Create a new review session |
52
+ | `session export` | Export feedback as JSON |
53
+ | `smoke-test` | End-to-end sanity check |
54
+
55
+ ## Configuration
56
+
57
+ Create `.typescape/config.yaml`:
58
+
59
+ ```yaml
60
+ version: 1
61
+ server:
62
+ base_url: https://your-typescape-instance.com
63
+ ```
64
+
65
+ Set `TYPESCAPE_API_TOKEN` environment variable with your operator token.
66
+
67
+ ## License
68
+
69
+ MIT
package/dist/cli.js ADDED
@@ -0,0 +1,334 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ var E9=Object.create;var{getPrototypeOf:y9,defineProperty:e$,getOwnPropertyNames:k9}=Object;var x9=Object.prototype.hasOwnProperty;var h9=(q,$,Z)=>{Z=q!=null?E9(y9(q)):{};let z=$||!q||!q.__esModule?e$(Z,"default",{value:q,enumerable:!0}):Z;for(let Q of k9(q))if(!x9.call(z,Q))e$(z,Q,{get:()=>q[Q],enumerable:!0});return z};var P=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var i0=import.meta.require;var b=P((c9)=>{var xq=Symbol.for("yaml.alias"),Z2=Symbol.for("yaml.document"),s0=Symbol.for("yaml.map"),z2=Symbol.for("yaml.pair"),hq=Symbol.for("yaml.scalar"),r0=Symbol.for("yaml.seq"),d=Symbol.for("yaml.node.type"),g9=(q)=>!!q&&typeof q==="object"&&q[d]===xq,u9=(q)=>!!q&&typeof q==="object"&&q[d]===Z2,v9=(q)=>!!q&&typeof q==="object"&&q[d]===s0,m9=(q)=>!!q&&typeof q==="object"&&q[d]===z2,Q2=(q)=>!!q&&typeof q==="object"&&q[d]===hq,d9=(q)=>!!q&&typeof q==="object"&&q[d]===r0;function J2(q){if(q&&typeof q==="object")switch(q[d]){case s0:case r0:return!0}return!1}function l9(q){if(q&&typeof q==="object")switch(q[d]){case xq:case s0:case hq:case r0:return!0}return!1}var p9=(q)=>(Q2(q)||J2(q))&&!!q.anchor;c9.ALIAS=xq;c9.DOC=Z2;c9.MAP=s0;c9.NODE_TYPE=d;c9.PAIR=z2;c9.SCALAR=hq;c9.SEQ=r0;c9.hasAnchor=p9;c9.isAlias=g9;c9.isCollection=J2;c9.isDocument=u9;c9.isMap=v9;c9.isNode=l9;c9.isPair=m9;c9.isScalar=Q2;c9.isSeq=d9});var w0=P((Y4)=>{var E=b(),y=Symbol("break visit"),G2=Symbol("skip children"),v=Symbol("remove node");function n0(q,$){let Z=H2($);if(E.isDocument(q)){if(B0(null,q.contents,Z,Object.freeze([q]))===v)q.contents=null}else B0(null,q,Z,Object.freeze([]))}n0.BREAK=y;n0.SKIP=G2;n0.REMOVE=v;function B0(q,$,Z,z){let Q=Y2(q,$,Z,z);if(E.isNode(Q)||E.isPair(Q))return B2(q,z,Q),B0(q,Q,Z,z);if(typeof Q!=="symbol"){if(E.isCollection($)){z=Object.freeze(z.concat($));for(let J=0;J<$.items.length;++J){let G=B0(J,$.items[J],Z,z);if(typeof G==="number")J=G-1;else if(G===y)return y;else if(G===v)$.items.splice(J,1),J-=1}}else if(E.isPair($)){z=Object.freeze(z.concat($));let J=B0("key",$.key,Z,z);if(J===y)return y;else if(J===v)$.key=null;let G=B0("value",$.value,Z,z);if(G===y)return y;else if(G===v)$.value=null}}return Q}async function o0(q,$){let Z=H2($);if(E.isDocument(q)){if(await U0(null,q.contents,Z,Object.freeze([q]))===v)q.contents=null}else await U0(null,q,Z,Object.freeze([]))}o0.BREAK=y;o0.SKIP=G2;o0.REMOVE=v;async function U0(q,$,Z,z){let Q=await Y2(q,$,Z,z);if(E.isNode(Q)||E.isPair(Q))return B2(q,z,Q),U0(q,Q,Z,z);if(typeof Q!=="symbol"){if(E.isCollection($)){z=Object.freeze(z.concat($));for(let J=0;J<$.items.length;++J){let G=await U0(J,$.items[J],Z,z);if(typeof G==="number")J=G-1;else if(G===y)return y;else if(G===v)$.items.splice(J,1),J-=1}}else if(E.isPair($)){z=Object.freeze(z.concat($));let J=await U0("key",$.key,Z,z);if(J===y)return y;else if(J===v)$.key=null;let G=await U0("value",$.value,Z,z);if(G===y)return y;else if(G===v)$.value=null}}return Q}function H2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function Y2(q,$,Z,z){if(typeof Z==="function")return Z(q,$,z);if(E.isMap($))return Z.Map?.(q,$,z);if(E.isSeq($))return Z.Seq?.(q,$,z);if(E.isPair($))return Z.Pair?.(q,$,z);if(E.isScalar($))return Z.Scalar?.(q,$,z);if(E.isAlias($))return Z.Alias?.(q,$,z);return}function B2(q,$,Z){let z=$[$.length-1];if(E.isCollection(z))z.items[q]=Z;else if(E.isPair(z))if(q==="key")z.key=Z;else z.value=Z;else if(E.isDocument(z))z.contents=Z;else{let Q=E.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${Q} parent`)}}Y4.visit=n0;Y4.visitAsync=o0});var gq=P((L4)=>{var U2=b(),W4=w0(),X4={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},F4=(q)=>q.replace(/[!,[\]{}]/g,($)=>X4[$]);class k{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},k.defaultYaml,q),this.tags=Object.assign({},k.defaultTags,$)}clone(){let q=new k(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new k(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:k.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},k.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:k.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},k.defaultTags),this.atNextDocument=!1;let Z=q.trim().split(/[ \t]+/),z=Z.shift();switch(z){case"%TAG":{if(Z.length!==2){if($(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[Q,J]=Z;return this.tags[Q]=J,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[Q]=Z;if(Q==="1.1"||Q==="1.2")return this.yaml.version=Q,!0;else{let J=/^\d+\.\d+$/.test(Q);return $(6,`Unsupported YAML version ${Q}`,J),!1}}default:return $(0,`Unknown directive ${z}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let J=q.slice(2,-1);if(J==="!"||J==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return J}let[,Z,z]=q.match(/^(.*!)([^!]*)$/s);if(!z)$(`The ${q} tag has no suffix`);let Q=this.tags[Z];if(Q)try{return Q+decodeURIComponent(z)}catch(J){return $(String(J)),null}if(Z==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,Z]of Object.entries(this.tags))if(q.startsWith(Z))return $+F4(q.substring(Z.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),z;if(q&&Z.length>0&&U2.isNode(q.contents)){let Q={};W4.visit(q.contents,(J,G)=>{if(U2.isNode(G)&&G.tag)Q[G.tag]=!0}),z=Object.keys(Q)}else z=[];for(let[Q,J]of Z){if(Q==="!!"&&J==="tag:yaml.org,2002:")continue;if(!q||z.some((G)=>G.startsWith(J)))$.push(`%TAG ${Q} ${J}`)}return $.join(`
4
+ `)}}k.defaultYaml={explicit:!1,version:"1.2"};k.defaultTags={"!!":"tag:yaml.org,2002:"};L4.Directives=k});var t0=P((O4)=>{var W2=b(),M4=w0();function V4(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(Z)}return!0}function X2(q){let $=new Set;return M4.visit(q,{Value(Z,z){if(z.anchor)$.add(z.anchor)}}),$}function F2(q,$){for(let Z=1;;++Z){let z=`${q}${Z}`;if(!$.has(z))return z}}function P4(q,$){let Z=[],z=new Map,Q=null;return{onAnchor:(J)=>{Z.push(J),Q??(Q=X2(q));let G=F2($,Q);return Q.add(G),G},setAnchors:()=>{for(let J of Z){let G=z.get(J);if(typeof G==="object"&&G.anchor&&(W2.isScalar(G.node)||W2.isCollection(G.node)))G.node.anchor=G.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=J,H}}},sourceObjects:z}}O4.anchorIsValid=V4;O4.anchorNames=X2;O4.createNodeAnchors=P4;O4.findNewAnchor=F2});var uq=P((N4)=>{function T0(q,$,Z,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let Q=0,J=z.length;Q<J;++Q){let G=z[Q],H=T0(q,z,String(Q),G);if(H===void 0)delete z[Q];else if(H!==G)z[Q]=H}else if(z instanceof Map)for(let Q of Array.from(z.keys())){let J=z.get(Q),G=T0(q,z,Q,J);if(G===void 0)z.delete(Q);else if(G!==J)z.set(Q,G)}else if(z instanceof Set)for(let Q of Array.from(z)){let J=T0(q,z,Q,Q);if(J===void 0)z.delete(Q);else if(J!==Q)z.delete(Q),z.add(J)}else for(let[Q,J]of Object.entries(z)){let G=T0(q,z,Q,J);if(G===void 0)delete z[Q];else if(G!==J)z[Q]=G}return q.call($,Z,z)}N4.applyReviver=T0});var c=P((b4)=>{var A4=b();function L2(q,$,Z){if(Array.isArray(q))return q.map((z,Q)=>L2(z,String(Q),Z));if(q&&typeof q.toJSON==="function"){if(!Z||!A4.hasAnchor(q))return q.toJSON($,Z);let z={aliasCount:0,count:1,res:void 0};Z.anchors.set(q,z),Z.onCreate=(J)=>{z.res=J,delete Z.onCreate};let Q=q.toJSON($,Z);if(Z.onCreate)Z.onCreate(Q);return Q}if(typeof q==="bigint"&&!Z?.keep)return Number(q);return q}b4.toJS=L2});var e0=P((C4)=>{var j4=uq(),D2=b(),S4=c();class M2{constructor(q){Object.defineProperty(this,D2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:Z,onAnchor:z,reviver:Q}={}){if(!D2.isDocument(q))throw TypeError("A document argument is required");let J={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},G=S4.toJS(this,"",J);if(typeof z==="function")for(let{count:H,res:Y}of J.anchors.values())z(Y,H);return typeof Q==="function"?j4.applyReviver(Q,{"":G},"",G):G}}C4.NodeBase=M2});var _0=P((h4)=>{var E4=t0(),y4=w0(),W0=b(),k4=e0(),x4=c();class V2 extends k4.NodeBase{constructor(q){super(W0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let Z;if($?.aliasResolveCache)Z=$.aliasResolveCache;else if(Z=[],y4.visit(q,{Node:(Q,J)=>{if(W0.isAlias(J)||W0.hasAnchor(J))Z.push(J)}}),$)$.aliasResolveCache=Z;let z=void 0;for(let Q of Z){if(Q===this)break;if(Q.anchor===this.source)z=Q}return z}toJSON(q,$){if(!$)return{source:this.source};let{anchors:Z,doc:z,maxAliasCount:Q}=$,J=this.resolve(z,$);if(!J){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let G=Z.get(J);if(!G)x4.toJS(J,null,$),G=Z.get(J);if(G?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Q>=0){if(G.count+=1,G.aliasCount===0)G.aliasCount=qq(z,J,Z);if(G.count*G.aliasCount>Q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return G.res}toString(q,$,Z){let z=`*${this.source}`;if(q){if(E4.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Q)}if(q.implicitKey)return`${z} `}return z}}function qq(q,$,Z){if(W0.isAlias($)){let z=$.resolve(q),Q=Z&&z&&Z.get(z);return Q?Q.count*Q.aliasCount:0}else if(W0.isCollection($)){let z=0;for(let Q of $.items){let J=qq(q,Q,Z);if(J>z)z=J}return z}else if(W0.isPair($)){let z=qq(q,$.key,Z),Q=qq(q,$.value,Z);return Math.max(z,Q)}return 1}h4.Alias=V2});var S=P((l4)=>{var u4=b(),v4=e0(),m4=c(),d4=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class $0 extends v4.NodeBase{constructor(q){super(u4.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:m4.toJS(this.value,q,$)}toString(){return String(this.value)}}$0.BLOCK_FOLDED="BLOCK_FOLDED";$0.BLOCK_LITERAL="BLOCK_LITERAL";$0.PLAIN="PLAIN";$0.QUOTE_DOUBLE="QUOTE_DOUBLE";$0.QUOTE_SINGLE="QUOTE_SINGLE";l4.Scalar=$0;l4.isScalarValue=d4});var N0=P((n4)=>{var a4=_0(),Z0=b(),P2=S(),i4="tag:yaml.org,2002:";function s4(q,$,Z){if($){let z=Z.filter((J)=>J.tag===$),Q=z.find((J)=>!J.format)??z[0];if(!Q)throw Error(`Tag ${$} not found`);return Q}return Z.find((z)=>z.identify?.(q)&&!z.format)}function r4(q,$,Z){if(Z0.isDocument(q))q=q.contents;if(Z0.isNode(q))return q;if(Z0.isPair(q)){let U=Z.schema[Z0.MAP].createNode?.(Z.schema,null,Z);return U.items.push(q),U}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:z,onAnchor:Q,onTagObj:J,schema:G,sourceObjects:H}=Z,Y=void 0;if(z&&q&&typeof q==="object")if(Y=H.get(q),Y)return Y.anchor??(Y.anchor=Q(q)),new a4.Alias(Y.anchor);else Y={anchor:null,node:null},H.set(q,Y);if($?.startsWith("!!"))$=i4+$.slice(2);let B=s4(q,$,G.tags);if(!B){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let U=new P2.Scalar(q);if(Y)Y.node=U;return U}B=q instanceof Map?G[Z0.MAP]:(Symbol.iterator in Object(q))?G[Z0.SEQ]:G[Z0.MAP]}if(J)J(B),delete Z.onTagObj;let L=B?.createNode?B.createNode(Z.schema,q,Z):typeof B?.nodeClass?.from==="function"?B.nodeClass.from(Z.schema,q,Z):new P2.Scalar(q);if($)L.tag=$;else if(!B.default)L.tag=B.tag;if(Y)Y.node=L;return L}n4.createNode=r4});var $q=P((qZ)=>{var t4=N0(),m=b(),e4=e0();function vq(q,$,Z){let z=Z;for(let Q=$.length-1;Q>=0;--Q){let J=$[Q];if(typeof J==="number"&&Number.isInteger(J)&&J>=0){let G=[];G[J]=z,z=G}else z=new Map([[J,z]])}return t4.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var O2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class K2 extends e4.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((Z)=>m.isNode(Z)||m.isPair(Z)?Z.clone(q):Z),this.range)$.range=this.range.slice();return $}addIn(q,$){if(O2(q))this.add($);else{let[Z,...z]=q,Q=this.get(Z,!0);if(m.isCollection(Q))Q.addIn(z,$);else if(Q===void 0&&this.schema)this.set(Z,vq(this.schema,z,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}}deleteIn(q){let[$,...Z]=q;if(Z.length===0)return this.delete($);let z=this.get($,!0);if(m.isCollection(z))return z.deleteIn(Z);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${Z}`)}getIn(q,$){let[Z,...z]=q,Q=this.get(Z,!0);if(z.length===0)return!$&&m.isScalar(Q)?Q.value:Q;else return m.isCollection(Q)?Q.getIn(z,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!m.isPair($))return!1;let Z=$.value;return Z==null||q&&m.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn(q){let[$,...Z]=q;if(Z.length===0)return this.has($);let z=this.get($,!0);return m.isCollection(z)?z.hasIn(Z):!1}setIn(q,$){let[Z,...z]=q;if(z.length===0)this.set(Z,$);else{let Q=this.get(Z,!0);if(m.isCollection(Q))Q.setIn(z,$);else if(Q===void 0&&this.schema)this.set(Z,vq(this.schema,z,$));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}}}qZ.Collection=K2;qZ.collectionFromPath=vq;qZ.isEmptyPath=O2});var R0=P((GZ)=>{var QZ=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function mq(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var JZ=(q,$,Z)=>q.endsWith(`
5
+ `)?mq(Z,$):Z.includes(`
6
+ `)?`
7
+ `+mq(Z,$):(q.endsWith(" ")?"":" ")+Z;GZ.indentComment=mq;GZ.lineComment=JZ;GZ.stringifyComment=QZ});var T2=P((WZ)=>{function UZ(q,$,Z="flow",{indentAtStart:z,lineWidth:Q=80,minContentWidth:J=20,onFold:G,onOverflow:H}={}){if(!Q||Q<0)return q;if(Q<J)J=0;let Y=Math.max(1+J,1+Q-$.length);if(q.length<=Y)return q;let B=[],L={},U=Q-$.length;if(typeof z==="number")if(z>Q-Math.max(2,J))B.push(0);else U=Q-z;let W=void 0,D=void 0,V=!1,F=-1,X=-1,M=-1;if(Z==="block"){if(F=w2(q,F,$.length),F!==-1)U=F+Y}for(let w;w=q[F+=1];){if(Z==="quoted"&&w==="\\"){switch(X=F,q[F+1]){case"x":F+=3;break;case"u":F+=5;break;case"U":F+=9;break;default:F+=1}M=F}if(w===`
8
+ `){if(Z==="block")F=w2(q,F,$.length);U=F+$.length+Y,W=void 0}else{if(w===" "&&D&&D!==" "&&D!==`
9
+ `&&D!=="\t"){let T=q[F+1];if(T&&T!==" "&&T!==`
10
+ `&&T!=="\t")W=F}if(F>=U)if(W)B.push(W),U=W+Y,W=void 0;else if(Z==="quoted"){while(D===" "||D==="\t")D=w,w=q[F+=1],V=!0;let T=F>M+1?F-2:X-1;if(L[T])return q;B.push(T),L[T]=!0,U=T+Y,W=void 0}else V=!0}D=w}if(V&&H)H();if(B.length===0)return q;if(G)G();let K=q.slice(0,B[0]);for(let w=0;w<B.length;++w){let T=B[w],_=B[w+1]||q.length;if(T===0)K=`
11
+ ${$}${q.slice(0,_)}`;else{if(Z==="quoted"&&L[T])K+=`${q[T]}\\`;K+=`
12
+ ${$}${q.slice(T+1,_)}`}}return K}function w2(q,$,Z){let z=$,Q=$+1,J=q[Q];while(J===" "||J==="\t")if($<Q+Z)J=q[++$];else{do J=q[++$];while(J&&J!==`
13
+ `);z=$,Q=$+1,J=q[Q]}return z}WZ.FOLD_BLOCK="block";WZ.FOLD_FLOW="flow";WZ.FOLD_QUOTED="quoted";WZ.foldFlowLines=UZ});var b0=P((OZ)=>{var g=S(),a=T2(),zq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Qq=(q)=>/^(%|---|\.\.\.)/m.test(q);function MZ(q,$,Z){if(!$||$<0)return!1;let z=$-Z,Q=q.length;if(Q<=z)return!1;for(let J=0,G=0;J<Q;++J)if(q[J]===`
14
+ `){if(J-G>z)return!0;if(G=J+1,Q-G<=z)return!1}return!0}function A0(q,$){let Z=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return Z;let{implicitKey:z}=$,Q=$.options.doubleQuotedMinMultiLineLength,J=$.indent||(Qq(q)?" ":""),G="",H=0;for(let Y=0,B=Z[Y];B;B=Z[++Y]){if(B===" "&&Z[Y+1]==="\\"&&Z[Y+2]==="n")G+=Z.slice(H,Y)+"\\ ",Y+=1,H=Y,B="\\";if(B==="\\")switch(Z[Y+1]){case"u":{G+=Z.slice(H,Y);let L=Z.substr(Y+2,4);switch(L){case"0000":G+="\\0";break;case"0007":G+="\\a";break;case"000b":G+="\\v";break;case"001b":G+="\\e";break;case"0085":G+="\\N";break;case"00a0":G+="\\_";break;case"2028":G+="\\L";break;case"2029":G+="\\P";break;default:if(L.substr(0,2)==="00")G+="\\x"+L.substr(2);else G+=Z.substr(Y,6)}Y+=5,H=Y+1}break;case"n":if(z||Z[Y+2]==='"'||Z.length<Q)Y+=1;else{G+=Z.slice(H,Y)+`
15
+
16
+ `;while(Z[Y+2]==="\\"&&Z[Y+3]==="n"&&Z[Y+4]!=='"')G+=`
17
+ `,Y+=2;if(G+=J,Z[Y+2]===" ")G+="\\";Y+=1,H=Y+1}break;default:Y+=1}}return G=H?G+Z.slice(H):Z,z?G:a.foldFlowLines(G,J,a.FOLD_QUOTED,zq($,!1))}function dq(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
18
+ `)||/[ \t]\n|\n[ \t]/.test(q))return A0(q,$);let Z=$.indent||(Qq(q)?" ":""),z="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
19
+ ${Z}`)+"'";return $.implicitKey?z:a.foldFlowLines(z,Z,a.FOLD_FLOW,zq($,!1))}function X0(q,$){let{singleQuote:Z}=$.options,z;if(Z===!1)z=A0;else{let Q=q.includes('"'),J=q.includes("'");if(Q&&!J)z=dq;else if(J&&!Q)z=A0;else z=Z?dq:A0}return z(q,$)}var lq;try{lq=new RegExp(`(^|(?<!
20
+ ))
21
+ +(?!
22
+ |$)`,"g")}catch{lq=/\n+(?!\n|$)/g}function Zq({comment:q,type:$,value:Z},z,Q,J){let{blockQuote:G,commentString:H,lineWidth:Y}=z.options;if(!G||/\n[\t ]+$/.test(Z))return X0(Z,z);let B=z.indent||(z.forceBlockIndent||Qq(Z)?" ":""),L=G==="literal"?!0:G==="folded"||$===g.Scalar.BLOCK_FOLDED?!1:$===g.Scalar.BLOCK_LITERAL?!0:!MZ(Z,Y,B.length);if(!Z)return L?`|
23
+ `:`>
24
+ `;let U,W;for(W=Z.length;W>0;--W){let _=Z[W-1];if(_!==`
25
+ `&&_!=="\t"&&_!==" ")break}let D=Z.substring(W),V=D.indexOf(`
26
+ `);if(V===-1)U="-";else if(Z===D||V!==D.length-1){if(U="+",J)J()}else U="";if(D){if(Z=Z.slice(0,-D.length),D[D.length-1]===`
27
+ `)D=D.slice(0,-1);D=D.replace(lq,`$&${B}`)}let F=!1,X,M=-1;for(X=0;X<Z.length;++X){let _=Z[X];if(_===" ")F=!0;else if(_===`
28
+ `)M=X;else break}let K=Z.substring(0,M<X?M+1:X);if(K)Z=Z.substring(K.length),K=K.replace(/\n+/g,`$&${B}`);let T=(F?B?"2":"1":"")+U;if(q){if(T+=" "+H(q.replace(/ ?[\r\n]+/g," ")),Q)Q()}if(!L){let _=Z.replace(/\n+/g,`
29
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${B}`),N=!1,j=zq(z,!0);if(G!=="folded"&&$!==g.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{N=!0};let O=a.foldFlowLines(`${K}${_}${D}`,B,a.FOLD_BLOCK,j);if(!N)return`>${T}
30
+ ${B}${O}`}return Z=Z.replace(/\n+/g,`$&${B}`),`|${T}
31
+ ${B}${K}${Z}${D}`}function VZ(q,$,Z,z){let{type:Q,value:J}=q,{actualString:G,implicitKey:H,indent:Y,indentStep:B,inFlow:L}=$;if(H&&J.includes(`
32
+ `)||L&&/[[\]{},]/.test(J))return X0(J,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(J))return H||L||!J.includes(`
33
+ `)?X0(J,$):Zq(q,$,Z,z);if(!H&&!L&&Q!==g.Scalar.PLAIN&&J.includes(`
34
+ `))return Zq(q,$,Z,z);if(Qq(J)){if(Y==="")return $.forceBlockIndent=!0,Zq(q,$,Z,z);else if(H&&Y===B)return X0(J,$)}let U=J.replace(/\n+/g,`$&
35
+ ${Y}`);if(G){let W=(F)=>F.default&&F.tag!=="tag:yaml.org,2002:str"&&F.test?.test(U),{compat:D,tags:V}=$.doc.schema;if(V.some(W)||D?.some(W))return X0(J,$)}return H?U:a.foldFlowLines(U,Y,a.FOLD_FLOW,zq($,!1))}function PZ(q,$,Z,z){let{implicitKey:Q,inFlow:J}=$,G=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:H}=q;if(H!==g.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(G.value))H=g.Scalar.QUOTE_DOUBLE}let Y=(L)=>{switch(L){case g.Scalar.BLOCK_FOLDED:case g.Scalar.BLOCK_LITERAL:return Q||J?X0(G.value,$):Zq(G,$,Z,z);case g.Scalar.QUOTE_DOUBLE:return A0(G.value,$);case g.Scalar.QUOTE_SINGLE:return dq(G.value,$);case g.Scalar.PLAIN:return VZ(G,$,Z,z);default:return null}},B=Y(H);if(B===null){let{defaultKeyType:L,defaultStringType:U}=$.options,W=Q&&L||U;if(B=Y(W),B===null)throw Error(`Unsupported default string type ${W}`)}return B}OZ.stringifyString=PZ});var I0=P((IZ)=>{var wZ=t0(),i=b(),TZ=R0(),_Z=b0();function NZ(q,$){let Z=Object.assign({blockQuote:!0,commentString:TZ.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,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,$),z;switch(Z.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:q,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:z,options:Z}}function RZ(q,$){if($.tag){let Q=q.filter((J)=>J.tag===$.tag);if(Q.length>0)return Q.find((J)=>J.format===$.format)??Q[0]}let Z=void 0,z;if(i.isScalar($)){z=$.value;let Q=q.filter((J)=>J.identify?.(z));if(Q.length>1){let J=Q.filter((G)=>G.test);if(J.length>0)Q=J}Z=Q.find((J)=>J.format===$.format)??Q.find((J)=>!J.format)}else z=$,Z=q.find((Q)=>Q.nodeClass&&z instanceof Q.nodeClass);if(!Z){let Q=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${Q} value`)}return Z}function AZ(q,$,{anchors:Z,doc:z}){if(!z.directives)return"";let Q=[],J=(i.isScalar(q)||i.isCollection(q))&&q.anchor;if(J&&wZ.anchorIsValid(J))Z.add(J),Q.push(`&${J}`);let G=q.tag??($.default?null:$.tag);if(G)Q.push(z.directives.tagString(G));return Q.join(" ")}function bZ(q,$,Z,z){if(i.isPair(q))return q.toString($,Z,z);if(i.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let Q=void 0,J=i.isNode(q)?q:$.doc.createNode(q,{onTagObj:(Y)=>Q=Y});Q??(Q=RZ($.doc.schema.tags,J));let G=AZ(J,Q,$);if(G.length>0)$.indentAtStart=($.indentAtStart??0)+G.length+1;let H=typeof Q.stringify==="function"?Q.stringify(J,$,Z,z):i.isScalar(J)?_Z.stringifyString(J,$,Z,z):J.toString($,Z,z);if(!G)return H;return i.isScalar(J)||H[0]==="{"||H[0]==="["?`${G} ${H}`:`${G}
36
+ ${$.indent}${H}`}IZ.createStringifyContext=NZ;IZ.stringify=bZ});var R2=P((fZ)=>{var l=b(),_2=S(),N2=I0(),j0=R0();function CZ({key:q,value:$},Z,z,Q){let{allNullValues:J,doc:G,indent:H,indentStep:Y,options:{commentString:B,indentSeq:L,simpleKeys:U}}=Z,W=l.isNode(q)&&q.comment||null;if(U){if(W)throw Error("With simple keys, key nodes cannot have comments");if(l.isCollection(q)||!l.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let D=!U&&(!q||W&&$==null&&!Z.inFlow||l.isCollection(q)||(l.isScalar(q)?q.type===_2.Scalar.BLOCK_FOLDED||q.type===_2.Scalar.BLOCK_LITERAL:typeof q==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!D&&(U||!J),indent:H+Y});let V=!1,F=!1,X=N2.stringify(q,Z,()=>V=!0,()=>F=!0);if(!D&&!Z.inFlow&&X.length>1024){if(U)throw Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(Z.inFlow){if(J||$==null){if(V&&z)z();return X===""?"?":D?`? ${X}`:X}}else if(J&&!U||$==null&&D){if(X=`? ${X}`,W&&!V)X+=j0.lineComment(X,Z.indent,B(W));else if(F&&Q)Q();return X}if(V)W=null;if(D){if(W)X+=j0.lineComment(X,Z.indent,B(W));X=`? ${X}
37
+ ${H}:`}else if(X=`${X}:`,W)X+=j0.lineComment(X,Z.indent,B(W));let M,K,w;if(l.isNode($))M=!!$.spaceBefore,K=$.commentBefore,w=$.comment;else if(M=!1,K=null,w=null,$&&typeof $==="object")$=G.createNode($);if(Z.implicitKey=!1,!D&&!W&&l.isScalar($))Z.indentAtStart=X.length+1;if(F=!1,!L&&Y.length>=2&&!Z.inFlow&&!D&&l.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)Z.indent=Z.indent.substring(2);let T=!1,_=N2.stringify($,Z,()=>T=!0,()=>F=!0),N=" ";if(W||M||K){if(N=M?`
38
+ `:"",K){let j=B(K);N+=`
39
+ ${j0.indentComment(j,Z.indent)}`}if(_===""&&!Z.inFlow){if(N===`
40
+ `&&w)N=`
41
+
42
+ `}else N+=`
43
+ ${Z.indent}`}else if(!D&&l.isCollection($)){let j=_[0],O=_.indexOf(`
44
+ `),C=O!==-1,p=Z.inFlow??$.flow??$.items.length===0;if(C||!p){let Y0=!1;if(C&&(j==="&"||j==="!")){let f=_.indexOf(" ");if(j==="&"&&f!==-1&&f<O&&_[f+1]==="!")f=_.indexOf(" ",f+1);if(f===-1||O<f)Y0=!0}if(!Y0)N=`
45
+ ${Z.indent}`}}else if(_===""||_[0]===`
46
+ `)N="";if(X+=N+_,Z.inFlow){if(T&&z)z()}else if(w&&!T)X+=j0.lineComment(X,Z.indent,B(w));else if(F&&Q)Q();return X}fZ.stringifyPair=CZ});var pq=P((xZ)=>{var A2=i0("process");function yZ(q,...$){if(q==="debug")console.log(...$)}function kZ(q,$){if(q==="debug"||q==="warn")if(typeof A2.emitWarning==="function")A2.emitWarning($);else console.warn($)}xZ.debug=yZ;xZ.warn=kZ});var Hq=P((vZ)=>{var S0=b(),b2=S(),Jq="<<",Gq={identify:(q)=>q===Jq||typeof q==="symbol"&&q.description===Jq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new b2.Scalar(Symbol(Jq)),{addToJSMap:I2}),stringify:()=>Jq},uZ=(q,$)=>(Gq.identify($)||S0.isScalar($)&&(!$.type||$.type===b2.Scalar.PLAIN)&&Gq.identify($.value))&&q?.doc.schema.tags.some((Z)=>Z.tag===Gq.tag&&Z.default);function I2(q,$,Z){if(Z=q&&S0.isAlias(Z)?Z.resolve(q.doc):Z,S0.isSeq(Z))for(let z of Z.items)cq(q,$,z);else if(Array.isArray(Z))for(let z of Z)cq(q,$,z);else cq(q,$,Z)}function cq(q,$,Z){let z=q&&S0.isAlias(Z)?Z.resolve(q.doc):Z;if(!S0.isMap(z))throw Error("Merge sources must be maps or map aliases");let Q=z.toJSON(null,q,Map);for(let[J,G]of Q)if($ instanceof Map){if(!$.has(J))$.set(J,G)}else if($ instanceof Set)$.add(J);else if(!Object.prototype.hasOwnProperty.call($,J))Object.defineProperty($,J,{value:G,writable:!0,enumerable:!0,configurable:!0});return $}vZ.addMergeToJSMap=I2;vZ.isMergeKey=uZ;vZ.merge=Gq});var iq=P((sZ)=>{var pZ=pq(),j2=Hq(),cZ=I0(),S2=b(),aq=c();function aZ(q,$,{key:Z,value:z}){if(S2.isNode(Z)&&Z.addToJSMap)Z.addToJSMap(q,$,z);else if(j2.isMergeKey(q,Z))j2.addMergeToJSMap(q,$,z);else{let Q=aq.toJS(Z,"",q);if($ instanceof Map)$.set(Q,aq.toJS(z,Q,q));else if($ instanceof Set)$.add(Q);else{let J=iZ(Z,Q,q),G=aq.toJS(z,J,q);if(J in $)Object.defineProperty($,J,{value:G,writable:!0,enumerable:!0,configurable:!0});else $[J]=G}}return $}function iZ(q,$,Z){if($===null)return"";if(typeof $!=="object")return String($);if(S2.isNode(q)&&Z?.doc){let z=cZ.createStringifyContext(Z.doc,{});z.anchors=new Set;for(let J of Z.anchors.keys())z.anchors.add(J.anchor);z.inFlow=!0,z.inStringifyKey=!0;let Q=q.toString(z);if(!Z.mapKeyWarned){let J=JSON.stringify(Q);if(J.length>40)J=J.substring(0,36)+'..."';pZ.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${J}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return Q}return JSON.stringify($)}sZ.addPairToJSMap=aZ});var s=P((eZ)=>{var C2=N0(),nZ=R2(),oZ=iq(),Yq=b();function tZ(q,$,Z){let z=C2.createNode(q,void 0,Z),Q=C2.createNode($,void 0,Z);return new Bq(z,Q)}class Bq{constructor(q,$=null){Object.defineProperty(this,Yq.NODE_TYPE,{value:Yq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:Z}=this;if(Yq.isNode($))$=$.clone(q);if(Yq.isNode(Z))Z=Z.clone(q);return new Bq($,Z)}toJSON(q,$){let Z=$?.mapAsMap?new Map:{};return oZ.addPairToJSMap($,Z,this)}toString(q,$,Z){return q?.doc?nZ.stringifyPair(this,q,$,Z):JSON.stringify(this)}}eZ.Pair=Bq;eZ.createPair=tZ});var sq=P((J5)=>{var z0=b(),f2=I0(),Uq=R0();function Z5(q,$,Z){return($.inFlow??q.flow?Q5:z5)(q,$,Z)}function z5({comment:q,items:$},Z,{blockItemPrefix:z,flowChars:Q,itemIndent:J,onChompKeep:G,onComment:H}){let{indent:Y,options:{commentString:B}}=Z,L=Object.assign({},Z,{indent:J,type:null}),U=!1,W=[];for(let V=0;V<$.length;++V){let F=$[V],X=null;if(z0.isNode(F)){if(!U&&F.spaceBefore)W.push("");if(Wq(Z,W,F.commentBefore,U),F.comment)X=F.comment}else if(z0.isPair(F)){let K=z0.isNode(F.key)?F.key:null;if(K){if(!U&&K.spaceBefore)W.push("");Wq(Z,W,K.commentBefore,U)}}U=!1;let M=f2.stringify(F,L,()=>X=null,()=>U=!0);if(X)M+=Uq.lineComment(M,J,B(X));if(U&&X)U=!1;W.push(z+M)}let D;if(W.length===0)D=Q.start+Q.end;else{D=W[0];for(let V=1;V<W.length;++V){let F=W[V];D+=F?`
47
+ ${Y}${F}`:`
48
+ `}}if(q){if(D+=`
49
+ `+Uq.indentComment(B(q),Y),H)H()}else if(U&&G)G();return D}function Q5({items:q},$,{flowChars:Z,itemIndent:z}){let{indent:Q,indentStep:J,flowCollectionPadding:G,options:{commentString:H}}=$;z+=J;let Y=Object.assign({},$,{indent:z,inFlow:!0,type:null}),B=!1,L=0,U=[];for(let V=0;V<q.length;++V){let F=q[V],X=null;if(z0.isNode(F)){if(F.spaceBefore)U.push("");if(Wq($,U,F.commentBefore,!1),F.comment)X=F.comment}else if(z0.isPair(F)){let K=z0.isNode(F.key)?F.key:null;if(K){if(K.spaceBefore)U.push("");if(Wq($,U,K.commentBefore,!1),K.comment)B=!0}let w=z0.isNode(F.value)?F.value:null;if(w){if(w.comment)X=w.comment;if(w.commentBefore)B=!0}else if(F.value==null&&K?.comment)X=K.comment}if(X)B=!0;let M=f2.stringify(F,Y,()=>X=null);if(V<q.length-1)M+=",";if(X)M+=Uq.lineComment(M,z,H(X));if(!B&&(U.length>L||M.includes(`
50
+ `)))B=!0;U.push(M),L=U.length}let{start:W,end:D}=Z;if(U.length===0)return W+D;else{if(!B){let V=U.reduce((F,X)=>F+X.length+2,2);B=$.options.lineWidth>0&&V>$.options.lineWidth}if(B){let V=W;for(let F of U)V+=F?`
51
+ ${J}${Q}${F}`:`
52
+ `;return`${V}
53
+ ${Q}${D}`}else return`${W}${G}${U.join(" ")}${G}${D}`}}function Wq({indent:q,options:{commentString:$}},Z,z,Q){if(z&&Q)z=z.replace(/^\n+/,"");if(z){let J=Uq.indentComment($(z),q);Z.push(J.trimStart())}}J5.stringifyCollection=Z5});var n=P((W5)=>{var H5=sq(),Y5=iq(),B5=$q(),r=b(),Xq=s(),U5=S();function C0(q,$){let Z=r.isScalar($)?$.value:$;for(let z of q)if(r.isPair(z)){if(z.key===$||z.key===Z)return z;if(r.isScalar(z.key)&&z.key.value===Z)return z}return}class E2 extends B5.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(r.MAP,q);this.items=[]}static from(q,$,Z){let{keepUndefined:z,replacer:Q}=Z,J=new this(q),G=(H,Y)=>{if(typeof Q==="function")Y=Q.call($,H,Y);else if(Array.isArray(Q)&&!Q.includes(H))return;if(Y!==void 0||z)J.items.push(Xq.createPair(H,Y,Z))};if($ instanceof Map)for(let[H,Y]of $)G(H,Y);else if($&&typeof $==="object")for(let H of Object.keys($))G(H,$[H]);if(typeof q.sortMapEntries==="function")J.items.sort(q.sortMapEntries);return J}add(q,$){let Z;if(r.isPair(q))Z=q;else if(!q||typeof q!=="object"||!("key"in q))Z=new Xq.Pair(q,q?.value);else Z=new Xq.Pair(q.key,q.value);let z=C0(this.items,Z.key),Q=this.schema?.sortMapEntries;if(z){if(!$)throw Error(`Key ${Z.key} already set`);if(r.isScalar(z.value)&&U5.isScalarValue(Z.value))z.value.value=Z.value;else z.value=Z.value}else if(Q){let J=this.items.findIndex((G)=>Q(Z,G)<0);if(J===-1)this.items.push(Z);else this.items.splice(J,0,Z)}else this.items.push(Z)}delete(q){let $=C0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let z=C0(this.items,q)?.value;return(!$&&r.isScalar(z)?z.value:z)??void 0}has(q){return!!C0(this.items,q)}set(q,$){this.add(new Xq.Pair(q,$),!0)}toJSON(q,$,Z){let z=Z?new Z:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(z);for(let Q of this.items)Y5.addPairToJSMap($,z,Q);return z}toString(q,$,Z){if(!q)return JSON.stringify(this);for(let z of this.items)if(!r.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return H5.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:Z,onComment:$})}}W5.YAMLMap=E2;W5.findPair=C0});var F0=P((M5)=>{var L5=b(),y2=n(),D5={collection:"map",default:!0,nodeClass:y2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!L5.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,Z)=>y2.YAMLMap.from(q,$,Z)};M5.map=D5});var o=P((_5)=>{var P5=N0(),O5=sq(),K5=$q(),Lq=b(),w5=S(),T5=c();class k2 extends K5.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(Lq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=Fq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let Z=Fq(q);if(typeof Z!=="number")return;let z=this.items[Z];return!$&&Lq.isScalar(z)?z.value:z}has(q){let $=Fq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let Z=Fq(q);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${q}.`);let z=this.items[Z];if(Lq.isScalar(z)&&w5.isScalarValue($))z.value=$;else this.items[Z]=$}toJSON(q,$){let Z=[];if($?.onCreate)$.onCreate(Z);let z=0;for(let Q of this.items)Z.push(T5.toJS(Q,String(z++),$));return Z}toString(q,$,Z){if(!q)return JSON.stringify(this);return O5.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:Z,onComment:$})}static from(q,$,Z){let{replacer:z}=Z,Q=new this(q);if($&&Symbol.iterator in Object($)){let J=0;for(let G of $){if(typeof z==="function"){let H=$ instanceof Set?G:String(J++);G=z.call($,H,G)}Q.items.push(P5.createNode(G,void 0,Z))}}return Q}}function Fq(q){let $=Lq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}_5.YAMLSeq=k2});var L0=P((b5)=>{var R5=b(),x2=o(),A5={collection:"seq",default:!0,nodeClass:x2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!R5.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,Z)=>x2.YAMLSeq.from(q,$,Z)};b5.seq=A5});var f0=P((C5)=>{var j5=b0(),S5={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,Z,z){return $=Object.assign({actualString:!0},$),j5.stringifyString(q,$,Z,z)}};C5.string=S5});var Dq=P((E5)=>{var h2=S(),g2={identify:(q)=>q==null,createNode:()=>new h2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h2.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&g2.test.test(q)?q:$.options.nullStr};E5.nullTag=g2});var rq=P((x5)=>{var k5=S(),u2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new k5.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},Z){if(q&&u2.test.test(q)){let z=q[0]==="t"||q[0]==="T";if($===z)return q}return $?Z.options.trueStr:Z.options.falseStr}};x5.boolTag=u2});var D0=P((u5)=>{function g5({format:q,minFractionDigits:$,tag:Z,value:z}){if(typeof z==="bigint")return String(z);let Q=typeof z==="number"?z:Number(z);if(!isFinite(Q))return isNaN(Q)?".nan":Q<0?"-.inf":".inf";let J=Object.is(z,-0)?"-0":JSON.stringify(z);if(!q&&$&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(J)){let G=J.indexOf(".");if(G<0)G=J.length,J+=".";let H=$-(J.length-G-1);while(H-- >0)J+="0"}return J}u5.stringifyNumber=g5});var oq=P((c5)=>{var m5=S(),nq=D0(),d5={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:nq.stringifyNumber},l5={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():nq.stringifyNumber(q)}},p5={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new m5.Scalar(parseFloat(q)),Z=q.indexOf(".");if(Z!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-Z-1;return $},stringify:nq.stringifyNumber};c5.float=p5;c5.floatExp=l5;c5.floatNaN=d5});var eq=P((t5)=>{var v2=D0(),Mq=(q)=>typeof q==="bigint"||Number.isInteger(q),tq=(q,$,Z,{intAsBigInt:z})=>z?BigInt(q):parseInt(q.substring($),Z);function m2(q,$,Z){let{value:z}=q;if(Mq(z)&&z>=0)return Z+z.toString($);return v2.stringifyNumber(q)}var r5={identify:(q)=>Mq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,Z)=>tq(q,2,8,Z),stringify:(q)=>m2(q,8,"0o")},n5={identify:Mq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,Z)=>tq(q,0,10,Z),stringify:v2.stringifyNumber},o5={identify:(q)=>Mq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,Z)=>tq(q,2,16,Z),stringify:(q)=>m2(q,16,"0x")};t5.int=n5;t5.intHex=o5;t5.intOct=r5});var d2=P((Y6)=>{var Z6=F0(),z6=Dq(),Q6=L0(),J6=f0(),G6=rq(),q$=oq(),$$=eq(),H6=[Z6.map,Q6.seq,J6.string,z6.nullTag,G6.boolTag,$$.intOct,$$.int,$$.intHex,q$.floatNaN,q$.floatExp,q$.float];Y6.schema=H6});var p2=P((M6)=>{var U6=S(),W6=F0(),X6=L0();function l2(q){return typeof q==="bigint"||Number.isInteger(q)}var Vq=({value:q})=>JSON.stringify(q),F6=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:Vq},{identify:(q)=>q==null,createNode:()=>new U6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:Vq},{identify:l2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:Z})=>Z?BigInt(q):parseInt(q,10),stringify:({value:q})=>l2(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:Vq}],L6={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},D6=[W6.map,X6.seq].concat(F6,L6);M6.schema=D6});var z$=P((K6)=>{var E0=i0("buffer"),Z$=S(),P6=b0(),O6={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof E0.Buffer==="function")return E0.Buffer.from(q,"base64");else if(typeof atob==="function"){let Z=atob(q.replace(/[\n\r]/g,"")),z=new Uint8Array(Z.length);for(let Q=0;Q<Z.length;++Q)z[Q]=Z.charCodeAt(Q);return z}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:Z},z,Q,J){if(!Z)return"";let G=Z,H;if(typeof E0.Buffer==="function")H=G instanceof E0.Buffer?G.toString("base64"):E0.Buffer.from(G.buffer).toString("base64");else if(typeof btoa==="function"){let Y="";for(let B=0;B<G.length;++B)Y+=String.fromCharCode(G[B]);H=btoa(Y)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=Z$.Scalar.BLOCK_LITERAL),$!==Z$.Scalar.QUOTE_DOUBLE){let Y=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),B=Math.ceil(H.length/Y),L=Array(B);for(let U=0,W=0;U<B;++U,W+=Y)L[U]=H.substr(W,Y);H=L.join($===Z$.Scalar.BLOCK_LITERAL?`
54
+ `:" ")}return P6.stringifyString({comment:q,type:$,value:H},z,Q,J)}};K6.binary=O6});var Oq=P((R6)=>{var Pq=b(),Q$=s(),T6=S(),_6=o();function c2(q,$){if(Pq.isSeq(q))for(let Z=0;Z<q.items.length;++Z){let z=q.items[Z];if(Pq.isPair(z))continue;else if(Pq.isMap(z)){if(z.items.length>1)$("Each pair must have its own sequence indicator");let Q=z.items[0]||new Q$.Pair(new T6.Scalar(null));if(z.commentBefore)Q.key.commentBefore=Q.key.commentBefore?`${z.commentBefore}
55
+ ${Q.key.commentBefore}`:z.commentBefore;if(z.comment){let J=Q.value??Q.key;J.comment=J.comment?`${z.comment}
56
+ ${J.comment}`:z.comment}z=Q}q.items[Z]=Pq.isPair(z)?z:new Q$.Pair(z)}else $("Expected a sequence for this tag");return q}function a2(q,$,Z){let{replacer:z}=Z,Q=new _6.YAMLSeq(q);Q.tag="tag:yaml.org,2002:pairs";let J=0;if($&&Symbol.iterator in Object($))for(let G of $){if(typeof z==="function")G=z.call($,String(J++),G);let H,Y;if(Array.isArray(G))if(G.length===2)H=G[0],Y=G[1];else throw TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let B=Object.keys(G);if(B.length===1)H=B[0],Y=G[H];else throw TypeError(`Expected tuple with one key, not ${B.length} keys`)}else H=G;Q.items.push(Q$.createPair(H,Y,Z))}return Q}var N6={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:c2,createNode:a2};R6.createPairs=a2;R6.pairs=N6;R6.resolvePairs=c2});var G$=P((C6)=>{var i2=b(),J$=c(),y0=n(),j6=o(),s2=Oq();class Q0 extends j6.YAMLSeq{constructor(){super();this.add=y0.YAMLMap.prototype.add.bind(this),this.delete=y0.YAMLMap.prototype.delete.bind(this),this.get=y0.YAMLMap.prototype.get.bind(this),this.has=y0.YAMLMap.prototype.has.bind(this),this.set=y0.YAMLMap.prototype.set.bind(this),this.tag=Q0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let Z=new Map;if($?.onCreate)$.onCreate(Z);for(let z of this.items){let Q,J;if(i2.isPair(z))Q=J$.toJS(z.key,"",$),J=J$.toJS(z.value,Q,$);else Q=J$.toJS(z,"",$);if(Z.has(Q))throw Error("Ordered maps must not include duplicate keys");Z.set(Q,J)}return Z}static from(q,$,Z){let z=s2.createPairs(q,$,Z),Q=new this;return Q.items=z.items,Q}}Q0.tag="tag:yaml.org,2002:omap";var S6={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:Q0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let Z=s2.resolvePairs(q,$),z=[];for(let{key:Q}of Z.items)if(i2.isScalar(Q))if(z.includes(Q.value))$(`Ordered maps must not include duplicate keys: ${Q.value}`);else z.push(Q.value);return Object.assign(new Q0,Z)},createNode:(q,$,Z)=>Q0.from(q,$,Z)};C6.YAMLOMap=Q0;C6.omap=S6});var e2=P((y6)=>{var r2=S();function n2({value:q,source:$},Z){if($&&(q?o2:t2).test.test($))return $;return q?Z.options.trueStr:Z.options.falseStr}var o2={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new r2.Scalar(!0),stringify:n2},t2={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new r2.Scalar(!1),stringify:n2};y6.falseTag=t2;y6.trueTag=o2});var q1=P((m6)=>{var h6=S(),H$=D0(),g6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:H$.stringifyNumber},u6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():H$.stringifyNumber(q)}},v6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new h6.Scalar(parseFloat(q.replace(/_/g,""))),Z=q.indexOf(".");if(Z!==-1){let z=q.substring(Z+1).replace(/_/g,"");if(z[z.length-1]==="0")$.minFractionDigits=z.length}return $},stringify:H$.stringifyNumber};m6.float=v6;m6.floatExp=u6;m6.floatNaN=g6});var Z1=P((r6)=>{var $1=D0(),k0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Kq(q,$,Z,{intAsBigInt:z}){let Q=q[0];if(Q==="-"||Q==="+")$+=1;if(q=q.substring($).replace(/_/g,""),z){switch(Z){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let G=BigInt(q);return Q==="-"?BigInt(-1)*G:G}let J=parseInt(q,Z);return Q==="-"?-1*J:J}function Y$(q,$,Z){let{value:z}=q;if(k0(z)){let Q=z.toString($);return z<0?"-"+Z+Q.substr(1):Z+Q}return $1.stringifyNumber(q)}var c6={identify:k0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,Z)=>Kq(q,2,2,Z),stringify:(q)=>Y$(q,2,"0b")},a6={identify:k0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,Z)=>Kq(q,1,8,Z),stringify:(q)=>Y$(q,8,"0")},i6={identify:k0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,Z)=>Kq(q,0,10,Z),stringify:$1.stringifyNumber},s6={identify:k0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,Z)=>Kq(q,2,16,Z),stringify:(q)=>Y$(q,16,"0x")};r6.int=i6;r6.intBin=c6;r6.intHex=s6;r6.intOct=a6});var B$=P(($8)=>{var _q=b(),wq=s(),Tq=n();class J0 extends Tq.YAMLMap{constructor(q){super(q);this.tag=J0.tag}add(q){let $;if(_q.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new wq.Pair(q.key,null);else $=new wq.Pair(q,null);if(!Tq.findPair(this.items,$.key))this.items.push($)}get(q,$){let Z=Tq.findPair(this.items,q);return!$&&_q.isPair(Z)?_q.isScalar(Z.key)?Z.key.value:Z.key:Z}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let Z=Tq.findPair(this.items,q);if(Z&&!$)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&$)this.items.push(new wq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,Z){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,Z);else throw Error("Set items must all have null values")}static from(q,$,Z){let{replacer:z}=Z,Q=new this(q);if($&&Symbol.iterator in Object($))for(let J of $){if(typeof z==="function")J=z.call($,J,J);Q.items.push(wq.createPair(J,null,Z))}return Q}}J0.tag="tag:yaml.org,2002:set";var q8={collection:"map",identify:(q)=>q instanceof Set,nodeClass:J0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,Z)=>J0.from(q,$,Z),resolve(q,$){if(_q.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new J0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};$8.YAMLSet=J0;$8.set=q8});var W$=P((H8)=>{var Q8=D0();function U$(q,$){let Z=q[0],z=Z==="-"||Z==="+"?q.substring(1):q,Q=(G)=>$?BigInt(G):Number(G),J=z.replace(/_/g,"").split(":").reduce((G,H)=>G*Q(60)+Q(H),Q(0));return Z==="-"?Q(-1)*J:J}function z1(q){let{value:$}=q,Z=(G)=>G;if(typeof $==="bigint")Z=(G)=>BigInt(G);else if(isNaN($)||!isFinite($))return Q8.stringifyNumber(q);let z="";if($<0)z="-",$*=Z(-1);let Q=Z(60),J=[$%Q];if($<60)J.unshift(0);else if($=($-J[0])/Q,J.unshift($%Q),$>=60)$=($-J[0])/Q,J.unshift($);return z+J.map((G)=>String(G).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var J8={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:Z})=>U$(q,Z),stringify:z1},G8={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>U$(q,!1),stringify:z1},Q1={identify:(q)=>q 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(q){let $=q.match(Q1.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,z,Q,J,G,H]=$.map(Number),Y=$[7]?Number(($[7]+"00").substr(1,3)):0,B=Date.UTC(Z,z-1,Q,J||0,G||0,H||0,Y),L=$[8];if(L&&L!=="Z"){let U=U$(L,!1);if(Math.abs(U)<30)U*=60;B-=60000*U}return new Date(B)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};H8.floatTime=G8;H8.intTime=J8;H8.timestamp=Q1});var G1=P((w8)=>{var W8=F0(),X8=Dq(),F8=L0(),L8=f0(),D8=z$(),J1=e2(),X$=q1(),Nq=Z1(),M8=Hq(),V8=G$(),P8=Oq(),O8=B$(),F$=W$(),K8=[W8.map,F8.seq,L8.string,X8.nullTag,J1.trueTag,J1.falseTag,Nq.intBin,Nq.intOct,Nq.int,Nq.intHex,X$.floatNaN,X$.floatExp,X$.float,D8.binary,M8.merge,V8.omap,P8.pairs,O8.set,F$.intTime,F$.floatTime,F$.timestamp];w8.schema=K8});var M1=P((S8)=>{var U1=F0(),_8=Dq(),W1=L0(),N8=f0(),R8=rq(),L$=oq(),D$=eq(),A8=d2(),b8=p2(),X1=z$(),x0=Hq(),F1=G$(),L1=Oq(),H1=G1(),D1=B$(),Rq=W$(),Y1=new Map([["core",A8.schema],["failsafe",[U1.map,W1.seq,N8.string]],["json",b8.schema],["yaml11",H1.schema],["yaml-1.1",H1.schema]]),B1={binary:X1.binary,bool:R8.boolTag,float:L$.float,floatExp:L$.floatExp,floatNaN:L$.floatNaN,floatTime:Rq.floatTime,int:D$.int,intHex:D$.intHex,intOct:D$.intOct,intTime:Rq.intTime,map:U1.map,merge:x0.merge,null:_8.nullTag,omap:F1.omap,pairs:L1.pairs,seq:W1.seq,set:D1.set,timestamp:Rq.timestamp},I8={"tag:yaml.org,2002:binary":X1.binary,"tag:yaml.org,2002:merge":x0.merge,"tag:yaml.org,2002:omap":F1.omap,"tag:yaml.org,2002:pairs":L1.pairs,"tag:yaml.org,2002:set":D1.set,"tag:yaml.org,2002:timestamp":Rq.timestamp};function j8(q,$,Z){let z=Y1.get($);if(z&&!q)return Z&&!z.includes(x0.merge)?z.concat(x0.merge):z.slice();let Q=z;if(!Q)if(Array.isArray(q))Q=[];else{let J=Array.from(Y1.keys()).filter((G)=>G!=="yaml11").map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${J} or define customTags array`)}if(Array.isArray(q))for(let J of q)Q=Q.concat(J);else if(typeof q==="function")Q=q(Q.slice());if(Z)Q=Q.concat(x0.merge);return Q.reduce((J,G)=>{let H=typeof G==="string"?B1[G]:G;if(!H){let Y=JSON.stringify(G),B=Object.keys(B1).map((L)=>JSON.stringify(L)).join(", ");throw Error(`Unknown custom tag ${Y}; use one of ${B}`)}if(!J.includes(H))J.push(H);return J},[])}S8.coreKnownTags=I8;S8.getTags=j8});var P$=P((h8)=>{var M$=b(),E8=F0(),y8=L0(),k8=f0(),Aq=M1(),x8=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class V${constructor({compat:q,customTags:$,merge:Z,resolveKnownTags:z,schema:Q,sortMapEntries:J,toStringDefaults:G}){this.compat=Array.isArray(q)?Aq.getTags(q,"compat"):q?Aq.getTags(null,q):null,this.name=typeof Q==="string"&&Q||"core",this.knownTags=z?Aq.coreKnownTags:{},this.tags=Aq.getTags($,this.name,Z),this.toStringOptions=G??null,Object.defineProperty(this,M$.MAP,{value:E8.map}),Object.defineProperty(this,M$.SCALAR,{value:k8.string}),Object.defineProperty(this,M$.SEQ,{value:y8.seq}),this.sortMapEntries=typeof J==="function"?J:J===!0?x8:null}clone(){let q=Object.create(V$.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}h8.Schema=V$});var V1=P((m8)=>{var u8=b(),O$=I0(),h0=R0();function v8(q,$){let Z=[],z=$.directives===!0;if($.directives!==!1&&q.directives){let Y=q.directives.toString(q);if(Y)Z.push(Y),z=!0;else if(q.directives.docStart)z=!0}if(z)Z.push("---");let Q=O$.createStringifyContext(q,$),{commentString:J}=Q.options;if(q.commentBefore){if(Z.length!==1)Z.unshift("");let Y=J(q.commentBefore);Z.unshift(h0.indentComment(Y,""))}let G=!1,H=null;if(q.contents){if(u8.isNode(q.contents)){if(q.contents.spaceBefore&&z)Z.push("");if(q.contents.commentBefore){let L=J(q.contents.commentBefore);Z.push(h0.indentComment(L,""))}Q.forceBlockIndent=!!q.comment,H=q.contents.comment}let Y=H?void 0:()=>G=!0,B=O$.stringify(q.contents,Q,()=>H=null,Y);if(H)B+=h0.lineComment(B,"",J(H));if((B[0]==="|"||B[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${B}`;else Z.push(B)}else Z.push(O$.stringify(q.contents,Q));if(q.directives?.docEnd)if(q.comment){let Y=J(q.comment);if(Y.includes(`
57
+ `))Z.push("..."),Z.push(h0.indentComment(Y,""));else Z.push(`... ${Y}`)}else Z.push("...");else{let Y=q.comment;if(Y&&G)Y=Y.replace(/^\n+/,"");if(Y){if((!G||H)&&Z[Z.length-1]!=="")Z.push("");Z.push(h0.indentComment(J(Y),""))}}return Z.join(`
58
+ `)+`
59
+ `}m8.stringifyDocument=v8});var g0=P((n8)=>{var l8=_0(),M0=$q(),x=b(),p8=s(),c8=c(),a8=P$(),i8=V1(),K$=t0(),s8=uq(),r8=N0(),w$=gq();class T${constructor(q,$,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,x.NODE_TYPE,{value:x.DOC});let z=null;if(typeof $==="function"||Array.isArray($))z=$;else if(Z===void 0&&$)Z=$,$=void 0;let Q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=Q;let{version:J}=Q;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)J=this.directives.yaml.version}else this.directives=new w$.Directives({version:J});this.setSchema(J,Z),this.contents=q===void 0?null:this.createNode(q,z,Z)}clone(){let q=Object.create(T$.prototype,{[x.NODE_TYPE]:{value:x.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=x.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(V0(this.contents))this.contents.add(q)}addIn(q,$){if(V0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let Z=K$.anchorNames(this);q.anchor=!$||Z.has($)?K$.findNewAnchor($||"a",Z):$}return new l8.Alias(q.anchor)}createNode(q,$,Z){let z=void 0;if(typeof $==="function")q=$.call({"":q},"",q),z=$;else if(Array.isArray($)){let F=(M)=>typeof M==="number"||M instanceof String||M instanceof Number,X=$.filter(F).map(String);if(X.length>0)$=$.concat(X);z=$}else if(Z===void 0&&$)Z=$,$=void 0;let{aliasDuplicateObjects:Q,anchorPrefix:J,flow:G,keepUndefined:H,onTagObj:Y,tag:B}=Z??{},{onAnchor:L,setAnchors:U,sourceObjects:W}=K$.createNodeAnchors(this,J||"a"),D={aliasDuplicateObjects:Q??!0,keepUndefined:H??!1,onAnchor:L,onTagObj:Y,replacer:z,schema:this.schema,sourceObjects:W},V=r8.createNode(q,B,D);if(G&&x.isCollection(V))V.flow=!0;return U(),V}createPair(q,$,Z={}){let z=this.createNode(q,null,Z),Q=this.createNode($,null,Z);return new p8.Pair(z,Q)}delete(q){return V0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(M0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return V0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return x.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(M0.isEmptyPath(q))return!$&&x.isScalar(this.contents)?this.contents.value:this.contents;return x.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return x.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(M0.isEmptyPath(q))return this.contents!==void 0;return x.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,[q],$);else if(V0(this.contents))this.contents.set(q,$)}setIn(q,$){if(M0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,Array.from(q),$);else if(V0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let Z;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new w$.Directives({version:"1.1"});Z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new w$.Directives({version:q});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let z=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(Z)this.schema=new a8.Schema(Object.assign(Z,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:Z,maxAliasCount:z,onAnchor:Q,reviver:J}={}){let G={anchors:new Map,doc:this,keep:!q,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},H=c8.toJS(this.contents,$??"",G);if(typeof Q==="function")for(let{count:Y,res:B}of G.anchors.values())Q(B,Y);return typeof J==="function"?s8.applyReviver(J,{"":H},"",H):H}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return i8.stringifyDocument(this,q)}}function V0(q){if(x.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}n8.Document=T$});var u0=P((e8)=>{class bq extends Error{constructor(q,$,Z,z){super();this.name=q,this.code=Z,this.message=z,this.pos=$}}class P1 extends bq{constructor(q,$,Z){super("YAMLParseError",q,$,Z)}}class O1 extends bq{constructor(q,$,Z){super("YAMLWarning",q,$,Z)}}var t8=(q,$)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((H)=>$.linePos(H));let{line:z,col:Q}=Z.linePos[0];Z.message+=` at line ${z}, column ${Q}`;let J=Q-1,G=q.substring($.lineStarts[z-1],$.lineStarts[z]).replace(/[\n\r]+$/,"");if(J>=60&&G.length>80){let H=Math.min(J-39,G.length-79);G="\u2026"+G.substring(H),J-=H-1}if(G.length>80)G=G.substring(0,79)+"\u2026";if(z>1&&/^ *$/.test(G.substring(0,J))){let H=q.substring($.lineStarts[z-2],$.lineStarts[z-1]);if(H.length>80)H=H.substring(0,79)+`\u2026
60
+ `;G=H+G}if(/[^ ]/.test(G)){let H=1,Y=Z.linePos[1];if(Y?.line===z&&Y.col>Q)H=Math.max(1,Math.min(Y.col-Q,80-J));let B=" ".repeat(J)+"^".repeat(H);Z.message+=`:
61
+
62
+ ${G}
63
+ ${B}
64
+ `}};e8.YAMLError=bq;e8.YAMLParseError=P1;e8.YAMLWarning=O1;e8.prettifyError=t8});var v0=P((J3)=>{function Q3(q,{flow:$,indicator:Z,next:z,offset:Q,onError:J,parentIndent:G,startOnNewline:H}){let Y=!1,B=H,L=H,U="",W="",D=!1,V=!1,F=null,X=null,M=null,K=null,w=null,T=null,_=null;for(let O of q){if(V){if(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma")J(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(F){if(B&&O.type!=="comment"&&O.type!=="newline")J(F,"TAB_AS_INDENT","Tabs are not allowed as indentation");F=null}switch(O.type){case"space":if(!$&&(Z!=="doc-start"||z?.type!=="flow-collection")&&O.source.includes("\t"))F=O;L=!0;break;case"comment":{if(!L)J(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=O.source.substring(1)||" ";if(!U)U=C;else U+=W+C;W="",B=!1;break}case"newline":if(B){if(U)U+=O.source;else if(!T||Z!=="seq-item-ind")Y=!0}else W+=O.source;if(B=!0,D=!0,X||M)K=O;L=!0;break;case"anchor":if(X)J(O,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(O.source.endsWith(":"))J(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);X=O,_??(_=O.offset),B=!1,L=!1,V=!0;break;case"tag":{if(M)J(O,"MULTIPLE_TAGS","A node can have at most one tag");M=O,_??(_=O.offset),B=!1,L=!1,V=!0;break}case Z:if(X||M)J(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`);if(T)J(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${$??"collection"}`);T=O,B=Z==="seq-item-ind"||Z==="explicit-key-ind",L=!1;break;case"comma":if($){if(w)J(O,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);w=O,B=!1,L=!1;break}default:J(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),B=!1,L=!1}}let N=q[q.length-1],j=N?N.offset+N.source.length:Q;if(V&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))J(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(F&&(B&&F.indent<=G||z?.type==="block-map"||z?.type==="block-seq"))J(F,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:w,found:T,spaceBefore:Y,comment:U,hasNewline:D,anchor:X,tag:M,newlineAfterProp:K,end:j,start:_??j}}J3.resolveProps=Q3});var Iq=P((H3)=>{function _$(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
65
+ `))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let Z of $.start)if(Z.type==="newline")return!0;if($.sep){for(let Z of $.sep)if(Z.type==="newline")return!0}if(_$($.key)||_$($.value))return!0}return!1;default:return!0}}H3.containsNewline=_$});var N$=P((W3)=>{var B3=Iq();function U3(q,$,Z){if($?.type==="flow-collection"){let z=$.end[0];if(z.indent===q&&(z.source==="]"||z.source==="}")&&B3.containsNewline($))Z(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}W3.flowIndentCheck=U3});var R$=P((L3)=>{var K1=b();function F3(q,$,Z){let{uniqueKeys:z}=q.options;if(z===!1)return!1;let Q=typeof z==="function"?z:(J,G)=>J===G||K1.isScalar(J)&&K1.isScalar(G)&&J.value===G.value;return $.some((J)=>Q(J.key,Z))}L3.mapIncludes=F3});var R1=P((K3)=>{var w1=s(),M3=n(),T1=v0(),V3=Iq(),_1=N$(),P3=R$(),N1="All mapping items must start at the same column";function O3({composeNode:q,composeEmptyNode:$},Z,z,Q,J){let H=new(J?.nodeClass??M3.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let Y=z.offset,B=null;for(let L of z.items){let{start:U,key:W,sep:D,value:V}=L,F=T1.resolveProps(U,{indicator:"explicit-key-ind",next:W??D?.[0],offset:Y,onError:Q,parentIndent:z.indent,startOnNewline:!0}),X=!F.found;if(X){if(W){if(W.type==="block-seq")Q(Y,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==z.indent)Q(Y,"BAD_INDENT",N1)}if(!F.anchor&&!F.tag&&!D){if(B=F.end,F.comment)if(H.comment)H.comment+=`
66
+ `+F.comment;else H.comment=F.comment;continue}if(F.newlineAfterProp||V3.containsNewline(W))Q(W??U[U.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(F.found?.indent!==z.indent)Q(Y,"BAD_INDENT",N1);Z.atKey=!0;let M=F.end,K=W?q(Z,W,F,Q):$(Z,M,U,null,F,Q);if(Z.schema.compat)_1.flowIndentCheck(z.indent,W,Q);if(Z.atKey=!1,P3.mapIncludes(Z,H.items,K))Q(M,"DUPLICATE_KEY","Map keys must be unique");let w=T1.resolveProps(D??[],{indicator:"map-value-ind",next:V,offset:K.range[2],onError:Q,parentIndent:z.indent,startOnNewline:!W||W.type==="block-scalar"});if(Y=w.end,w.found){if(X){if(V?.type==="block-map"&&!w.hasNewline)Q(Y,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&F.start<w.found.offset-1024)Q(K.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let T=V?q(Z,V,w,Q):$(Z,Y,D,null,w,Q);if(Z.schema.compat)_1.flowIndentCheck(z.indent,V,Q);Y=T.range[2];let _=new w1.Pair(K,T);if(Z.options.keepSourceTokens)_.srcToken=L;H.items.push(_)}else{if(X)Q(K.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(w.comment)if(K.comment)K.comment+=`
67
+ `+w.comment;else K.comment=w.comment;let T=new w1.Pair(K);if(Z.options.keepSourceTokens)T.srcToken=L;H.items.push(T)}}if(B&&B<Y)Q(B,"IMPOSSIBLE","Map comment with trailing content");return H.range=[z.offset,Y,B??Y],H}K3.resolveBlockMap=O3});var A1=P((A3)=>{var T3=o(),_3=v0(),N3=N$();function R3({composeNode:q,composeEmptyNode:$},Z,z,Q,J){let H=new(J?.nodeClass??T3.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let Y=z.offset,B=null;for(let{start:L,value:U}of z.items){let W=_3.resolveProps(L,{indicator:"seq-item-ind",next:U,offset:Y,onError:Q,parentIndent:z.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||U)if(U?.type==="block-seq")Q(W.end,"BAD_INDENT","All sequence items must start at the same column");else Q(Y,"MISSING_CHAR","Sequence item without - indicator");else{if(B=W.end,W.comment)H.comment=W.comment;continue}let D=U?q(Z,U,W,Q):$(Z,W.end,L,null,W,Q);if(Z.schema.compat)N3.flowIndentCheck(z.indent,U,Q);Y=D.range[2],H.items.push(D)}return H.range=[z.offset,Y,B??Y],H}A3.resolveBlockSeq=R3});var P0=P((j3)=>{function I3(q,$,Z,z){let Q="";if(q){let J=!1,G="";for(let H of q){let{source:Y,type:B}=H;switch(B){case"space":J=!0;break;case"comment":{if(Z&&!J)z(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=Y.substring(1)||" ";if(!Q)Q=L;else Q+=G+L;G="";break}case"newline":if(Q)G+=Y;J=!0;break;default:z(H,"UNEXPECTED_TOKEN",`Unexpected ${B} at node end`)}$+=Y.length}}return{comment:Q,offset:$}}j3.resolveEnd=I3});var j1=P((g3)=>{var C3=b(),f3=s(),b1=n(),E3=o(),y3=P0(),I1=v0(),k3=Iq(),x3=R$(),A$="Block collections are not allowed within flow collections",b$=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function h3({composeNode:q,composeEmptyNode:$},Z,z,Q,J){let G=z.start.source==="{",H=G?"flow map":"flow sequence",B=new(J?.nodeClass??(G?b1.YAMLMap:E3.YAMLSeq))(Z.schema);B.flow=!0;let L=Z.atRoot;if(L)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let U=z.offset+z.start.source.length;for(let X=0;X<z.items.length;++X){let M=z.items[X],{start:K,key:w,sep:T,value:_}=M,N=I1.resolveProps(K,{flow:H,indicator:"explicit-key-ind",next:w??T?.[0],offset:U,onError:Q,parentIndent:z.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!T&&!_){if(X===0&&N.comma)Q(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(X<z.items.length-1)Q(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(N.comment)if(B.comment)B.comment+=`
68
+ `+N.comment;else B.comment=N.comment;U=N.end;continue}if(!G&&Z.options.strict&&k3.containsNewline(w))Q(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(X===0){if(N.comma)Q(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!N.comma)Q(N.start,"MISSING_CHAR",`Missing , between ${H} items`);if(N.comment){let j="";q:for(let O of K)switch(O.type){case"comma":case"space":break;case"comment":j=O.source.substring(1);break q;default:break q}if(j){let O=B.items[B.items.length-1];if(C3.isPair(O))O=O.value??O.key;if(O.comment)O.comment+=`
69
+ `+j;else O.comment=j;N.comment=N.comment.substring(j.length+1)}}}if(!G&&!T&&!N.found){let j=_?q(Z,_,N,Q):$(Z,N.end,T,null,N,Q);if(B.items.push(j),U=j.range[2],b$(_))Q(j.range,"BLOCK_IN_FLOW",A$)}else{Z.atKey=!0;let j=N.end,O=w?q(Z,w,N,Q):$(Z,j,K,null,N,Q);if(b$(w))Q(O.range,"BLOCK_IN_FLOW",A$);Z.atKey=!1;let C=I1.resolveProps(T??[],{flow:H,indicator:"map-value-ind",next:_,offset:O.range[2],onError:Q,parentIndent:z.indent,startOnNewline:!1});if(C.found){if(!G&&!N.found&&Z.options.strict){if(T)for(let f of T){if(f===C.found)break;if(f.type==="newline"){Q(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(N.start<C.found.offset-1024)Q(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(_)if("source"in _&&_.source?.[0]===":")Q(_,"MISSING_CHAR",`Missing space after : in ${H}`);else Q(C.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let p=_?q(Z,_,C,Q):C.found?$(Z,C.end,T,null,C,Q):null;if(p){if(b$(_))Q(p.range,"BLOCK_IN_FLOW",A$)}else if(C.comment)if(O.comment)O.comment+=`
70
+ `+C.comment;else O.comment=C.comment;let Y0=new f3.Pair(O,p);if(Z.options.keepSourceTokens)Y0.srcToken=M;if(G){let f=B;if(x3.mapIncludes(Z,f.items,O))Q(j,"DUPLICATE_KEY","Map keys must be unique");f.items.push(Y0)}else{let f=new b1.YAMLMap(Z.schema);f.flow=!0,f.items.push(Y0);let t$=(p??O).range;f.range=[O.range[0],t$[1],t$[2]],B.items.push(f)}U=p?p.range[2]:C.end}}let W=G?"}":"]",[D,...V]=z.end,F=U;if(D?.source===W)F=D.offset+D.source.length;else{let X=H[0].toUpperCase()+H.substring(1),M=L?`${X} must end with a ${W}`:`${X} in block collection must be sufficiently indented and end with a ${W}`;if(Q(U,L?"MISSING_CHAR":"BAD_INDENT",M),D&&D.source.length!==1)V.unshift(D)}if(V.length>0){let X=y3.resolveEnd(V,F,Z.options.strict,Q);if(X.comment)if(B.comment)B.comment+=`
71
+ `+X.comment;else B.comment=X.comment;B.range=[z.offset,F,X.offset]}else B.range=[z.offset,F,F];return B}g3.resolveFlowCollection=h3});var S1=P((s3)=>{var v3=b(),m3=S(),d3=n(),l3=o(),p3=R1(),c3=A1(),a3=j1();function I$(q,$,Z,z,Q,J){let G=Z.type==="block-map"?p3.resolveBlockMap(q,$,Z,z,J):Z.type==="block-seq"?c3.resolveBlockSeq(q,$,Z,z,J):a3.resolveFlowCollection(q,$,Z,z,J),H=G.constructor;if(Q==="!"||Q===H.tagName)return G.tag=H.tagName,G;if(Q)G.tag=Q;return G}function i3(q,$,Z,z,Q){let J=z.tag,G=!J?null:$.directives.tagName(J.source,(W)=>Q(J,"TAG_RESOLVE_FAILED",W));if(Z.type==="block-seq"){let{anchor:W,newlineAfterProp:D}=z,V=W&&J?W.offset>J.offset?W:J:W??J;if(V&&(!D||D.offset<V.offset))Q(V,"MISSING_CHAR","Missing newline after block sequence props")}let H=Z.type==="block-map"?"map":Z.type==="block-seq"?"seq":Z.start.source==="{"?"map":"seq";if(!J||!G||G==="!"||G===d3.YAMLMap.tagName&&H==="map"||G===l3.YAMLSeq.tagName&&H==="seq")return I$(q,$,Z,Q,G);let Y=$.schema.tags.find((W)=>W.tag===G&&W.collection===H);if(!Y){let W=$.schema.knownTags[G];if(W?.collection===H)$.schema.tags.push(Object.assign({},W,{default:!1})),Y=W;else{if(W)Q(J,"BAD_COLLECTION_TYPE",`${W.tag} used for ${H} collection, but expects ${W.collection??"scalar"}`,!0);else Q(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${G}`,!0);return I$(q,$,Z,Q,G)}}let B=I$(q,$,Z,Q,G,Y),L=Y.resolve?.(B,(W)=>Q(J,"TAG_RESOLVE_FAILED",W),$.options)??B,U=v3.isNode(L)?L:new m3.Scalar(L);if(U.range=B.range,U.tag=G,Y?.format)U.format=Y.format;return U}s3.composeCollection=i3});var S$=P((e3)=>{var j$=S();function n3(q,$,Z){let z=$.offset,Q=o3($,q.options.strict,Z);if(!Q)return{value:"",type:null,comment:"",range:[z,z,z]};let J=Q.mode===">"?j$.Scalar.BLOCK_FOLDED:j$.Scalar.BLOCK_LITERAL,G=$.source?t3($.source):[],H=G.length;for(let F=G.length-1;F>=0;--F){let X=G[F][1];if(X===""||X==="\r")H=F;else break}if(H===0){let F=Q.chomp==="+"&&G.length>0?`
72
+ `.repeat(Math.max(1,G.length-1)):"",X=z+Q.length;if($.source)X+=$.source.length;return{value:F,type:J,comment:Q.comment,range:[z,X,X]}}let Y=$.indent+Q.indent,B=$.offset+Q.length,L=0;for(let F=0;F<H;++F){let[X,M]=G[F];if(M===""||M==="\r"){if(Q.indent===0&&X.length>Y)Y=X.length}else{if(X.length<Y)Z(B+X.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Q.indent===0)Y=X.length;if(L=F,Y===0&&!q.atRoot)Z(B,"BAD_INDENT","Block scalar values in collections must be indented");break}B+=X.length+M.length+1}for(let F=G.length-1;F>=H;--F)if(G[F][0].length>Y)H=F+1;let U="",W="",D=!1;for(let F=0;F<L;++F)U+=G[F][0].slice(Y)+`
73
+ `;for(let F=L;F<H;++F){let[X,M]=G[F];B+=X.length+M.length+1;let K=M[M.length-1]==="\r";if(K)M=M.slice(0,-1);if(M&&X.length<Y){let T=`Block scalar lines must not be less indented than their ${Q.indent?"explicit indentation indicator":"first line"}`;Z(B-M.length-(K?2:1),"BAD_INDENT",T),X=""}if(J===j$.Scalar.BLOCK_LITERAL)U+=W+X.slice(Y)+M,W=`
74
+ `;else if(X.length>Y||M[0]==="\t"){if(W===" ")W=`
75
+ `;else if(!D&&W===`
76
+ `)W=`
77
+
78
+ `;U+=W+X.slice(Y)+M,W=`
79
+ `,D=!0}else if(M==="")if(W===`
80
+ `)U+=`
81
+ `;else W=`
82
+ `;else U+=W+M,W=" ",D=!1}switch(Q.chomp){case"-":break;case"+":for(let F=H;F<G.length;++F)U+=`
83
+ `+G[F][0].slice(Y);if(U[U.length-1]!==`
84
+ `)U+=`
85
+ `;break;default:U+=`
86
+ `}let V=z+Q.length+$.source.length;return{value:U,type:J,comment:Q.comment,range:[z,V,V]}}function o3({offset:q,props:$},Z,z){if($[0].type!=="block-scalar-header")return z($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Q}=$[0],J=Q[0],G=0,H="",Y=-1;for(let W=1;W<Q.length;++W){let D=Q[W];if(!H&&(D==="-"||D==="+"))H=D;else{let V=Number(D);if(!G&&V)G=V;else if(Y===-1)Y=q+W}}if(Y!==-1)z(Y,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Q}`);let B=!1,L="",U=Q.length;for(let W=1;W<$.length;++W){let D=$[W];switch(D.type){case"space":B=!0;case"newline":U+=D.source.length;break;case"comment":if(Z&&!B)z(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");U+=D.source.length,L=D.source.substring(1);break;case"error":z(D,"UNEXPECTED_TOKEN",D.message),U+=D.source.length;break;default:{let V=`Unexpected token in block scalar header: ${D.type}`;z(D,"UNEXPECTED_TOKEN",V);let F=D.source;if(F&&typeof F==="string")U+=F.length}}}return{mode:J,indent:G,chomp:H,comment:L,length:U}}function t3(q){let $=q.split(/\n( *)/),Z=$[0],z=Z.match(/^( *)/),J=[z?.[1]?[z[1],Z.slice(z[1].length)]:["",Z]];for(let G=1;G<$.length;G+=2)J.push([$[G],$[G+1]]);return J}e3.resolveBlockScalar=n3});var f$=P((B7)=>{var C$=S(),$7=P0();function Z7(q,$,Z){let{offset:z,type:Q,source:J,end:G}=q,H,Y,B=(W,D,V)=>Z(z+W,D,V);switch(Q){case"scalar":H=C$.Scalar.PLAIN,Y=z7(J,B);break;case"single-quoted-scalar":H=C$.Scalar.QUOTE_SINGLE,Y=Q7(J,B);break;case"double-quoted-scalar":H=C$.Scalar.QUOTE_DOUBLE,Y=J7(J,B);break;default:return Z(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Q}`),{value:"",type:null,comment:"",range:[z,z+J.length,z+J.length]}}let L=z+J.length,U=$7.resolveEnd(G,L,$,Z);return{value:Y,type:H,comment:U.comment,range:[z,L,U.offset]}}function z7(q,$){let Z="";switch(q[0]){case"\t":Z="a tab character";break;case",":Z="flow indicator character ,";break;case"%":Z="directive indicator character %";break;case"|":case">":{Z=`block scalar indicator ${q[0]}`;break}case"@":case"`":{Z=`reserved character ${q[0]}`;break}}if(Z)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${Z}`);return C1(q)}function Q7(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return C1(q.slice(1,-1)).replace(/''/g,"'")}function C1(q){let $,Z;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
88
+ `,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=$.exec(q);if(!z)return q;let Q=z[1],J=" ",G=$.lastIndex;Z.lastIndex=G;while(z=Z.exec(q)){if(z[1]==="")if(J===`
89
+ `)Q+=J;else J=`
90
+ `;else Q+=J+z[1],J=" ";G=Z.lastIndex}let H=/[ \t]*(.*)/sy;return H.lastIndex=G,z=H.exec(q),Q+J+(z?.[1]??"")}function J7(q,$){let Z="";for(let z=1;z<q.length-1;++z){let Q=q[z];if(Q==="\r"&&q[z+1]===`
91
+ `)continue;if(Q===`
92
+ `){let{fold:J,offset:G}=G7(q,z);Z+=J,z=G}else if(Q==="\\"){let J=q[++z],G=H7[J];if(G)Z+=G;else if(J===`
93
+ `){J=q[z+1];while(J===" "||J==="\t")J=q[++z+1]}else if(J==="\r"&&q[z+1]===`
94
+ `){J=q[++z+1];while(J===" "||J==="\t")J=q[++z+1]}else if(J==="x"||J==="u"||J==="U"){let H={x:2,u:4,U:8}[J];Z+=Y7(q,z+1,H,$),z+=H}else{let H=q.substr(z-1,2);$(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),Z+=H}}else if(Q===" "||Q==="\t"){let J=z,G=q[z+1];while(G===" "||G==="\t")G=q[++z+1];if(G!==`
95
+ `&&!(G==="\r"&&q[z+2]===`
96
+ `))Z+=z>J?q.slice(J,z+1):Q}else Z+=Q}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return Z}function G7(q,$){let Z="",z=q[$+1];while(z===" "||z==="\t"||z===`
97
+ `||z==="\r"){if(z==="\r"&&q[$+2]!==`
98
+ `)break;if(z===`
99
+ `)Z+=`
100
+ `;$+=1,z=q[$+1]}if(!Z)Z=" ";return{fold:Z,offset:$}}var H7={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
101
+ `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Y7(q,$,Z,z){let Q=q.substr($,Z),G=Q.length===Z&&/^[0-9a-fA-F]+$/.test(Q)?parseInt(Q,16):NaN;if(isNaN(G)){let H=q.substr($-2,Z+2);return z($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}return String.fromCodePoint(G)}B7.resolveFlowScalar=Z7});var E1=P((M7)=>{var G0=b(),f1=S(),W7=S$(),X7=f$();function F7(q,$,Z,z){let{value:Q,type:J,comment:G,range:H}=$.type==="block-scalar"?W7.resolveBlockScalar(q,$,z):X7.resolveFlowScalar($,q.options.strict,z),Y=Z?q.directives.tagName(Z.source,(U)=>z(Z,"TAG_RESOLVE_FAILED",U)):null,B;if(q.options.stringKeys&&q.atKey)B=q.schema[G0.SCALAR];else if(Y)B=L7(q.schema,Q,Y,Z,z);else if($.type==="scalar")B=D7(q,Q,$,z);else B=q.schema[G0.SCALAR];let L;try{let U=B.resolve(Q,(W)=>z(Z??$,"TAG_RESOLVE_FAILED",W),q.options);L=G0.isScalar(U)?U:new f1.Scalar(U)}catch(U){let W=U instanceof Error?U.message:String(U);z(Z??$,"TAG_RESOLVE_FAILED",W),L=new f1.Scalar(Q)}if(L.range=H,L.source=Q,J)L.type=J;if(Y)L.tag=Y;if(B.format)L.format=B.format;if(G)L.comment=G;return L}function L7(q,$,Z,z,Q){if(Z==="!")return q[G0.SCALAR];let J=[];for(let H of q.tags)if(!H.collection&&H.tag===Z)if(H.default&&H.test)J.push(H);else return H;for(let H of J)if(H.test?.test($))return H;let G=q.knownTags[Z];if(G&&!G.collection)return q.tags.push(Object.assign({},G,{default:!1,test:void 0})),G;return Q(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),q[G0.SCALAR]}function D7({atKey:q,directives:$,schema:Z},z,Q,J){let G=Z.tags.find((H)=>(H.default===!0||q&&H.default==="key")&&H.test?.test(z))||Z[G0.SCALAR];if(Z.compat){let H=Z.compat.find((Y)=>Y.default&&Y.test?.test(z))??Z[G0.SCALAR];if(G.tag!==H.tag){let Y=$.tagString(G.tag),B=$.tagString(H.tag),L=`Value may be parsed as either ${Y} or ${B}`;J(Q,"TAG_RESOLVE_FAILED",L,!0)}}return G}M7.composeScalar=F7});var y1=P((O7)=>{function P7(q,$,Z){if($){Z??(Z=$.length);for(let z=Z-1;z>=0;--z){let Q=$[z];switch(Q.type){case"space":case"comment":case"newline":q-=Q.source.length;continue}Q=$[++z];while(Q?.type==="space")q+=Q.source.length,Q=$[++z];break}}return q}O7.emptyScalarPosition=P7});var h1=P((I7)=>{var w7=_0(),T7=b(),_7=S1(),k1=E1(),N7=P0(),R7=y1(),A7={composeNode:x1,composeEmptyNode:E$};function x1(q,$,Z,z){let Q=q.atKey,{spaceBefore:J,comment:G,anchor:H,tag:Y}=Z,B,L=!0;switch($.type){case"alias":if(B=b7(q,$,z),H||Y)z($,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(B=k1.composeScalar(q,$,Y,z),H)B.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(B=_7.composeCollection(A7,q,$,Z,z),H)B.anchor=H.source.substring(1);break;default:{let U=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;z($,"UNEXPECTED_TOKEN",U),B=E$(q,$.offset,void 0,null,Z,z),L=!1}}if(H&&B.anchor==="")z(H,"BAD_ALIAS","Anchor cannot be an empty string");if(Q&&q.options.stringKeys&&(!T7.isScalar(B)||typeof B.value!=="string"||B.tag&&B.tag!=="tag:yaml.org,2002:str"))z(Y??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(J)B.spaceBefore=!0;if(G)if($.type==="scalar"&&$.source==="")B.comment=G;else B.commentBefore=G;if(q.options.keepSourceTokens&&L)B.srcToken=$;return B}function E$(q,$,Z,z,{spaceBefore:Q,comment:J,anchor:G,tag:H,end:Y},B){let L={type:"scalar",offset:R7.emptyScalarPosition($,Z,z),indent:-1,source:""},U=k1.composeScalar(q,L,H,B);if(G){if(U.anchor=G.source.substring(1),U.anchor==="")B(G,"BAD_ALIAS","Anchor cannot be an empty string")}if(Q)U.spaceBefore=!0;if(J)U.comment=J,U.range[2]=Y;return U}function b7({options:q},{offset:$,source:Z,end:z},Q){let J=new w7.Alias(Z.substring(1));if(J.source==="")Q($,"BAD_ALIAS","Alias cannot be an empty string");if(J.source.endsWith(":"))Q($+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let G=$+Z.length,H=N7.resolveEnd(z,G,q.strict,Q);if(J.range=[$,G,H.offset],H.comment)J.comment=H.comment;return J}I7.composeEmptyNode=E$;I7.composeNode=x1});var u1=P((k7)=>{var C7=g0(),g1=h1(),f7=P0(),E7=v0();function y7(q,$,{offset:Z,start:z,value:Q,end:J},G){let H=Object.assign({_directives:$},q),Y=new C7.Document(void 0,H),B={atKey:!1,atRoot:!0,directives:Y.directives,options:Y.options,schema:Y.schema},L=E7.resolveProps(z,{indicator:"doc-start",next:Q??J?.[0],offset:Z,onError:G,parentIndent:0,startOnNewline:!0});if(L.found){if(Y.directives.docStart=!0,Q&&(Q.type==="block-map"||Q.type==="block-seq")&&!L.hasNewline)G(L.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}Y.contents=Q?g1.composeNode(B,Q,L,G):g1.composeEmptyNode(B,L.end,z,null,L,G);let U=Y.contents.range[2],W=f7.resolveEnd(J,U,!1,G);if(W.comment)Y.comment=W.comment;return Y.range=[Z,U,W.offset],Y}k7.composeDoc=y7});var y$=P((d7)=>{var h7=i0("process"),g7=gq(),u7=g0(),m0=u0(),v1=b(),v7=u1(),m7=P0();function d0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:Z}=q;return[$,$+(typeof Z==="string"?Z.length:1)]}function m1(q){let $="",Z=!1,z=!1;for(let Q=0;Q<q.length;++Q){let J=q[Q];switch(J[0]){case"#":$+=($===""?"":z?`
102
+
103
+ `:`
104
+ `)+(J.substring(1)||" "),Z=!0,z=!1;break;case"%":if(q[Q+1]?.[0]!=="#")Q+=1;Z=!1;break;default:if(!Z)z=!0;Z=!1}}return{comment:$,afterEmptyLine:z}}class d1{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,Z,z,Q)=>{let J=d0($);if(Q)this.warnings.push(new m0.YAMLWarning(J,Z,z));else this.errors.push(new m0.YAMLParseError(J,Z,z))},this.directives=new g7.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:Z,afterEmptyLine:z}=m1(this.prelude);if(Z){let Q=q.contents;if($)q.comment=q.comment?`${q.comment}
105
+ ${Z}`:Z;else if(z||q.directives.docStart||!Q)q.commentBefore=Z;else if(v1.isCollection(Q)&&!Q.flow&&Q.items.length>0){let J=Q.items[0];if(v1.isPair(J))J=J.key;let G=J.commentBefore;J.commentBefore=G?`${Z}
106
+ ${G}`:Z}else{let J=Q.commentBefore;Q.commentBefore=J?`${Z}
107
+ ${J}`:Z}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:m1(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,Z=-1){for(let z of q)yield*this.next(z);yield*this.end($,Z)}*next(q){if(h7.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,Z,z)=>{let Q=d0(q);Q[0]+=$,this.onError(Q,"BAD_DIRECTIVE",Z,z)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=v7.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,Z=new m0.YAMLParseError(d0(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(Z);else this.doc.errors.push(Z);break}case"doc-end":{if(!this.doc){this.errors.push(new m0.YAMLParseError(d0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=m7.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
108
+ ${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new m0.YAMLParseError(d0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let Z=Object.assign({_directives:this.directives},this.options),z=new u7.Document(void 0,Z);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,$,$],this.decorate(z,!1),yield z}}}d7.Composer=d1});var c1=P((o7)=>{var p7=S$(),c7=f$(),a7=u0(),l1=b0();function i7(q,$=!0,Z){if(q){let z=(Q,J,G)=>{let H=typeof Q==="number"?Q:Array.isArray(Q)?Q[0]:Q.offset;if(Z)Z(H,J,G);else throw new a7.YAMLParseError([H,H+1],J,G)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return c7.resolveFlowScalar(q,$,z);case"block-scalar":return p7.resolveBlockScalar({options:{strict:$}},q,z)}}return null}function s7(q,$){let{implicitKey:Z=!1,indent:z,inFlow:Q=!1,offset:J=-1,type:G="PLAIN"}=$,H=l1.stringifyString({type:G,value:q},{implicitKey:Z,indent:z>0?" ".repeat(z):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}}),Y=$.end??[{type:"newline",offset:-1,indent:z,source:`
109
+ `}];switch(H[0]){case"|":case">":{let B=H.indexOf(`
110
+ `),L=H.substring(0,B),U=H.substring(B+1)+`
111
+ `,W=[{type:"block-scalar-header",offset:J,indent:z,source:L}];if(!p1(W,Y))W.push({type:"newline",offset:-1,indent:z,source:`
112
+ `});return{type:"block-scalar",offset:J,indent:z,props:W,source:U}}case'"':return{type:"double-quoted-scalar",offset:J,indent:z,source:H,end:Y};case"'":return{type:"single-quoted-scalar",offset:J,indent:z,source:H,end:Y};default:return{type:"scalar",offset:J,indent:z,source:H,end:Y}}}function r7(q,$,Z={}){let{afterKey:z=!1,implicitKey:Q=!1,inFlow:J=!1,type:G}=Z,H="indent"in q?q.indent:null;if(z&&typeof H==="number")H+=2;if(!G)switch(q.type){case"single-quoted-scalar":G="QUOTE_SINGLE";break;case"double-quoted-scalar":G="QUOTE_DOUBLE";break;case"block-scalar":{let B=q.props[0];if(B.type!=="block-scalar-header")throw Error("Invalid block scalar header");G=B.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:G="PLAIN"}let Y=l1.stringifyString({type:G,value:$},{implicitKey:Q||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}});switch(Y[0]){case"|":case">":n7(q,Y);break;case'"':k$(q,Y,"double-quoted-scalar");break;case"'":k$(q,Y,"single-quoted-scalar");break;default:k$(q,Y,"scalar")}}function n7(q,$){let Z=$.indexOf(`
113
+ `),z=$.substring(0,Z),Q=$.substring(Z+1)+`
114
+ `;if(q.type==="block-scalar"){let J=q.props[0];if(J.type!=="block-scalar-header")throw Error("Invalid block scalar header");J.source=z,q.source=Q}else{let{offset:J}=q,G="indent"in q?q.indent:-1,H=[{type:"block-scalar-header",offset:J,indent:G,source:z}];if(!p1(H,"end"in q?q.end:void 0))H.push({type:"newline",offset:-1,indent:G,source:`
115
+ `});for(let Y of Object.keys(q))if(Y!=="type"&&Y!=="offset")delete q[Y];Object.assign(q,{type:"block-scalar",indent:G,props:H,source:Q})}}function p1(q,$){if($)for(let Z of $)switch(Z.type){case"space":case"comment":q.push(Z);break;case"newline":return q.push(Z),!0}return!1}function k$(q,$,Z){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=Z,q.source=$;break;case"block-scalar":{let z=q.props.slice(1),Q=$.length;if(q.props[0].type==="block-scalar-header")Q-=q.props[0].source.length;for(let J of z)J.offset+=Q;delete q.props,Object.assign(q,{type:Z,source:$,end:z});break}case"block-map":case"block-seq":{let Q={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
116
+ `};delete q.items,Object.assign(q,{type:Z,source:$,end:[Q]});break}default:{let z="indent"in q?q.indent:-1,Q="end"in q&&Array.isArray(q.end)?q.end.filter((J)=>J.type==="space"||J.type==="comment"||J.type==="newline"):[];for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:Z,indent:z,source:$,end:Q})}}}o7.createScalarToken=s7;o7.resolveAsScalar=i7;o7.setScalarValue=r7});var a1=P((Zz)=>{var $z=(q)=>("type"in q)?Sq(q):jq(q);function Sq(q){switch(q.type){case"block-scalar":{let $="";for(let Z of q.props)$+=Sq(Z);return $+q.source}case"block-map":case"block-seq":{let $="";for(let Z of q.items)$+=jq(Z);return $}case"flow-collection":{let $=q.start.source;for(let Z of q.items)$+=jq(Z);for(let Z of q.end)$+=Z.source;return $}case"document":{let $=jq(q);if(q.end)for(let Z of q.end)$+=Z.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let Z of q.end)$+=Z.source;return $}}}function jq({start:q,key:$,sep:Z,value:z}){let Q="";for(let J of q)Q+=J.source;if($)Q+=Sq($);if(Z)for(let J of Z)Q+=J.source;if(z)Q+=Sq(z);return Q}Zz.stringify=$z});var r1=P((Jz)=>{var x$=Symbol("break visit"),Qz=Symbol("skip children"),i1=Symbol("remove item");function H0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};s1(Object.freeze([]),q,$)}H0.BREAK=x$;H0.SKIP=Qz;H0.REMOVE=i1;H0.itemAtPath=(q,$)=>{let Z=q;for(let[z,Q]of $){let J=Z?.[z];if(J&&"items"in J)Z=J.items[Q];else return}return Z};H0.parentCollection=(q,$)=>{let Z=H0.itemAtPath(q,$.slice(0,-1)),z=$[$.length-1][0],Q=Z?.[z];if(Q&&"items"in Q)return Q;throw Error("Parent collection not found")};function s1(q,$,Z){let z=Z($,q);if(typeof z==="symbol")return z;for(let Q of["key","value"]){let J=$[Q];if(J&&"items"in J){for(let G=0;G<J.items.length;++G){let H=s1(Object.freeze(q.concat([[Q,G]])),J.items[G],Z);if(typeof H==="number")G=H-1;else if(H===x$)return x$;else if(H===i1)J.items.splice(G,1),G-=1}if(typeof z==="function"&&Q==="key")z=z($,q)}}return typeof z==="function"?z($,q):z}Jz.visit=H0});var Cq=P((Fz)=>{var h$=c1(),Hz=a1(),Yz=r1(),g$="\uFEFF",u$="\x02",v$="\x18",m$="\x1F",Bz=(q)=>!!q&&("items"in q),Uz=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function Wz(q){switch(q){case g$:return"<BOM>";case u$:return"<DOC>";case v$:return"<FLOW_END>";case m$:return"<SCALAR>";default:return JSON.stringify(q)}}function Xz(q){switch(q){case g$:return"byte-order-mark";case u$:return"doc-mode";case v$:return"flow-error-end";case m$:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
117
+ `:case`\r
118
+ `: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(q[0]){case" ":case"\t":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}Fz.createScalarToken=h$.createScalarToken;Fz.resolveAsScalar=h$.resolveAsScalar;Fz.setScalarValue=h$.setScalarValue;Fz.stringify=Hz.stringify;Fz.visit=Yz.visit;Fz.BOM=g$;Fz.DOCUMENT=u$;Fz.FLOW_END=v$;Fz.SCALAR=m$;Fz.isCollection=Bz;Fz.isScalar=Uz;Fz.prettyToken=Wz;Fz.tokenType=Xz});var l$=P((jz)=>{var l0=Cq();function u(q){switch(q){case void 0:case" ":case`
119
+ `:case"\r":case"\t":return!0;default:return!1}}var n1=new Set("0123456789ABCDEFabcdef"),bz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),fq=new Set(",[]{}"),Iz=new Set(` ,[]{}
120
+ \r `),d$=(q)=>!q||Iz.has(q);class o1{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let Z=this.next??"stream";while(Z&&($||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
121
+ `)return!0;if($==="\r")return this.buffer[q+1]===`
122
+ `;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let Z=0;while($===" ")$=this.buffer[++Z+q];if($==="\r"){let z=this.buffer[Z+q+1];if(z===`
123
+ `||!z&&!this.atEnd)return q+Z+1}return $===`
124
+ `||Z>=this.indentNext||!$&&!this.atEnd?q+Z:-1}if($==="-"||$==="."){let Z=this.buffer.substr(q,3);if((Z==="---"||Z==="...")&&u(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
125
+ `,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===l0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,Z=q.indexOf("#");while(Z!==-1){let Q=q[Z-1];if(Q===" "||Q==="\t"){$=Z-1;break}else Z=q.indexOf("#",Z+1)}while(!0){let Q=q[$-1];if(Q===" "||Q==="\t")$-=1;else break}let z=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-z),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield l0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&u(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!u(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&u($)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(d$),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,Z=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=Z=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let z=this.getLine();if(z===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&z[0]!=="#"||Z===0&&(z.startsWith("---")||z.startsWith("..."))&&u(z[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield l0.FLOW_END,yield*this.parseLineStart()}let Q=0;while(z[Q]===",")Q+=yield*this.pushCount(1),Q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Q+=yield*this.pushIndicators(),z[Q]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-Q),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(d$),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let J=this.charAt(1);if(this.flowKey||u(J)||J===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let Q=0;while(this.buffer[$-1-Q]==="\\")Q+=1;if(Q%2===0)break;$=this.buffer.indexOf('"',$+1)}let Z=this.buffer.substring(0,$),z=Z.indexOf(`
126
+ `,this.pos);if(z!==-1){while(z!==-1){let Q=this.continueScalar(z+1);if(Q===-1)break;z=Z.indexOf(`
127
+ `,Q)}if(z!==-1)$=z-(Z[z-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>u($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,Z;q:for(let Q=this.pos;Z=this.buffer[Q];++Q)switch(Z){case" ":$+=1;break;case`
128
+ `:q=Q,$=0;break;case"\r":{let J=this.buffer[Q+1];if(!J&&!this.atEnd)return this.setNext("block-scalar");if(J===`
129
+ `)break}default:break q}if(!Z&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let Q=this.continueScalar(q+1);if(Q===-1)break;q=this.buffer.indexOf(`
130
+ `,Q)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let z=q+1;Z=this.buffer[z];while(Z===" ")Z=this.buffer[++z];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
131
+ `)Z=this.buffer[++z];q=z-1}else if(!this.blockScalarKeep)do{let Q=q-1,J=this.buffer[Q];if(J==="\r")J=this.buffer[--Q];let G=Q;while(J===" ")J=this.buffer[--Q];if(J===`
132
+ `&&Q>=this.pos&&Q+1+$>G)q=Q;else break}while(!0);return yield l0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,Z=this.pos-1,z;while(z=this.buffer[++Z])if(z===":"){let Q=this.buffer[Z+1];if(u(Q)||q&&fq.has(Q))break;$=Z}else if(u(z)){let Q=this.buffer[Z+1];if(z==="\r")if(Q===`
133
+ `)Z+=1,z=`
134
+ `,Q=this.buffer[Z+1];else $=Z;if(Q==="#"||q&&fq.has(Q))break;if(z===`
135
+ `){let J=this.continueScalar(Z+1);if(J===-1)break;Z=Math.max(Z,J-2)}}else{if(q&&fq.has(z))break;$=Z}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield l0.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let Z=this.buffer.slice(this.pos,q);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if($)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(d$))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(u($)||q&&fq.has($)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,$=this.buffer[q];while(!u($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(bz.has($))$=this.buffer[++q];else if($==="%"&&n1.has(this.buffer[q+1])&&n1.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
136
+ `)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
137
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,Z;do Z=this.buffer[++$];while(Z===" "||q&&Z==="\t");let z=$-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=$;return z}*pushUntil(q){let $=this.pos,Z=this.buffer[$];while(!q(Z))Z=this.buffer[++$];return yield*this.pushToIndex($,!1)}}jz.Lexer=o1});var p$=P((Cz)=>{class t1{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,Z=this.lineStarts.length;while($<Z){let Q=$+Z>>1;if(this.lineStarts[Q]<q)$=Q+1;else Z=Q}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let z=this.lineStarts[$-1];return{line:$,col:q-z+1}}}}Cz.LineCounter=t1});var c$=P((kz)=>{var Ez=i0("process"),e1=Cq(),yz=l$();function t(q,$){for(let Z=0;Z<q.length;++Z)if(q[Z].type===$)return!0;return!1}function q9(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function Z9(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Eq(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function O0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function $9(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!t($.start,"explicit-key-ind")&&!t($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,Z9($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class z9{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new yz.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Z of this.lexer.lex(q,$))yield*this.next(Z);if(!$)yield*this.end()}*next(q){if(this.source=q,Ez.env.LOG_TOKENS)console.log("|",e1.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=e1.tokenType(q);if(!$){let Z=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:Z,source:q}),this.offset+=q.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let Z=this.peek(1);if($.type==="block-scalar")$.indent="indent"in Z?Z.indent:0;else if($.type==="flow-collection"&&Z.type==="document")$.indent=0;if($.type==="flow-collection")$9($);switch(Z.type){case"document":Z.value=$;break;case"block-scalar":Z.props.push($);break;case"block-map":{let z=Z.items[Z.items.length-1];if(z.value){Z.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=$;else{Object.assign(z,{key:$,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=Z.items[Z.items.length-1];if(z.value)Z.items.push({start:[],value:$});else z.value=$;break}case"flow-collection":{let z=Z.items[Z.items.length-1];if(!z||z.value)Z.items.push({start:[],key:$,sep:[]});else if(z.sep)z.value=$;else Object.assign(z,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let z=$.items[$.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&q9(z.start)===-1&&($.indent===0||z.start.every((Q)=>Q.type!=="comment"||Q.indent<$.indent))){if(Z.type==="document")Z.end=z.start;else Z.items.push({start:z.start});$.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(q9(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=Eq(this.peek(2)),Z=O0($),z;if(q.end)z=q.end,z.push(this.sourceToken),delete q.end;else z=[this.sourceToken];let Q={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Z,key:q,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
138
+ `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
139
+ `,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,$.start),z.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let Z=!this.onKeyLine&&this.indent===q.indent,z=Z&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",Q=[];if(z&&$.sep&&!$.value){let J=[];for(let G=0;G<$.sep.length;++G){let H=$.sep[G];switch(H.type){case"newline":J.push(G);break;case"space":break;case"comment":if(H.indent>q.indent)J.length=0;break;default:J.length=0}}if(J.length>=2)Q=$.sep.splice(J[1])}switch(this.type){case"anchor":case"tag":if(z||$.value)Q.push(this.sourceToken),q.items.push({start:Q}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(z||$.value)Q.push(this.sourceToken),q.items.push({start:Q,explicitKey:!0});else 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($.explicitKey)if(!$.sep)if(t($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let J=O0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]});else if(Z9($.key)&&!t($.sep,"newline")){let J=O0($.start),G=$.key,H=$.sep;H.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:G,sep:H}]})}else if(Q.length>0)$.sep=$.sep.concat(Q,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||z)q.items.push({start:Q,key:null,sep:[this.sourceToken]});else if(t($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let J=this.flowScalar(this.type);if(z||$.value)q.items.push({start:Q,key:J,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(J);else Object.assign($,{key:J,sep:[]}),this.onKeyLine=!0;return}default:{let J=this.startBlockValue(q);if(J){if(J.type==="block-seq"){if(!$.explicitKey&&$.sep&&!t($.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(Z)q.items.push({start:Q});this.stack.push(J);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let Z="end"in $.value?$.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,$.start),z.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||t($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let Z=this.startBlockValue(q);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:z,sep:[]});else if($.sep)this.stack.push(z);else Object.assign($,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===q.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let z=Eq(Z),Q=O0(z);$9(q);let J=q.end.splice(1,q.end.length);J.push(this.sourceToken);let G={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:Q,key:q,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
140
+ `)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
141
+ `,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){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 $=Eq(q),Z=O0($);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=Eq(q),Z=O0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){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;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}kz.Parser=z9});var Y9=P((pz)=>{var Q9=y$(),hz=g0(),p0=u0(),gz=pq(),uz=b(),vz=p$(),J9=c$();function G9(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new vz.LineCounter||null,prettyErrors:$}}function mz(q,$={}){let{lineCounter:Z,prettyErrors:z}=G9($),Q=new J9.Parser(Z?.addNewLine),J=new Q9.Composer($),G=Array.from(J.compose(Q.parse(q)));if(z&&Z)for(let H of G)H.errors.forEach(p0.prettifyError(q,Z)),H.warnings.forEach(p0.prettifyError(q,Z));if(G.length>0)return G;return Object.assign([],{empty:!0},J.streamInfo())}function H9(q,$={}){let{lineCounter:Z,prettyErrors:z}=G9($),Q=new J9.Parser(Z?.addNewLine),J=new Q9.Composer($),G=null;for(let H of J.compose(Q.parse(q),!0,q.length))if(!G)G=H;else if(G.options.logLevel!=="silent"){G.errors.push(new p0.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Z)G.errors.forEach(p0.prettifyError(q,Z)),G.warnings.forEach(p0.prettifyError(q,Z));return G}function dz(q,$,Z){let z=void 0;if(typeof $==="function")z=$;else if(Z===void 0&&$&&typeof $==="object")Z=$;let Q=H9(q,Z);if(!Q)return null;if(Q.warnings.forEach((J)=>gz.warn(Q.options.logLevel,J)),Q.errors.length>0)if(Q.options.logLevel!=="silent")throw Q.errors[0];else Q.errors=[];return Q.toJS(Object.assign({reviver:z},Z))}function lz(q,$,Z){let z=null;if(typeof $==="function"||Array.isArray($))z=$;else if(Z===void 0&&$)Z=$;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let Q=Math.round(Z);Z=Q<1?void 0:Q>8?{indent:8}:{indent:Q}}if(q===void 0){let{keepUndefined:Q}=Z??$??{};if(!Q)return}if(uz.isDocument(q)&&!z)return q.toString(Z);return new hz.Document(q,z,Z).toString(Z)}pz.parse=dz;pz.parseAllDocuments=mz;pz.parseDocument=H9;pz.stringify=lz});var R9=P((dH,PJ)=>{PJ.exports={name:"@typescape-ai/cli",version:"0.0.1",description:"Typescape CLI - Create review sessions, export feedback, and integrate with AI workflows",type:"module",bin:{typescape:"./dist/cli.js"},files:["dist","README.md"],exports:{".":"./dist/cli.js"},publishConfig:{access:"public"},scripts:{build:"bun build src/index.ts --outfile=dist/cli.js --target=bun --bundle --minify",dev:"bun run --watch src/index.ts",test:"bun test",typecheck:"tsc --noEmit",lint:"eslint src",prepublishOnly:"bun run build"},dependencies:{},devDependencies:{"@types/bun":"1.1.14","@typescape/schemas":"workspace:*",yaml:"2.8.2",zod:"4.3.0"},engines:{bun:">=1.0.0"},keywords:["typescape","cli","review","documentation","ai","feedback","bun"],repository:{type:"git",url:"https://github.com/voidserf/typescape-docs.git",directory:"apps/cli"},license:"MIT"}});var I=0,R=2,q0=3,q2=4,kq=5;function $2(q){if(q>=500)return 4;if(q===401||q===403)return 3;if(q>=400&&q<500)return 2;return 0}function h(q,$){if($==="json")console.log(JSON.stringify(q,null,2));else if(typeof q==="string")console.log(q);else if(typeof q==="object"&&q!==null)for(let[Z,z]of Object.entries(q))console.log(`${Z}: ${z}`);else console.log(String(q))}function A(q,$){console.error(JSON.stringify({error:q},null,2)),process.exit($)}import{existsSync as EQ,readFileSync as yQ}from"fs";import{resolve as U9}from"path";var rz=y$(),nz=g0(),oz=P$(),a$=u0(),tz=_0(),e=b(),ez=s(),qQ=S(),$Q=n(),ZQ=o(),sG=Cq(),zQ=l$(),QQ=p$(),JQ=c$(),yq=Y9(),B9=w0();var GQ=rz.Composer,HQ=nz.Document,YQ=oz.Schema,BQ=a$.YAMLError,UQ=a$.YAMLParseError,WQ=a$.YAMLWarning,XQ=tz.Alias,FQ=e.isAlias,LQ=e.isCollection,DQ=e.isDocument,MQ=e.isMap,VQ=e.isNode,PQ=e.isPair,OQ=e.isScalar,KQ=e.isSeq,wQ=ez.Pair,TQ=qQ.Scalar,_Q=$Q.YAMLMap,NQ=ZQ.YAMLSeq;var RQ=zQ.Lexer,AQ=QQ.LineCounter,bQ=JQ.Parser,c0=yq.parse,IQ=yq.parseAllDocuments,jQ=yq.parseDocument,SQ=yq.stringify,CQ=B9.visit,fQ=B9.visitAsync;var i$=".typescape/config.yaml",kQ="TYPESCAPE_API_TOKEN",W9="TYPESCAPE_BASE_URL",a0=1;function xQ(q){if(q)return U9(q);return U9(i$)}function s$(q){let $=xQ(q);if(!EQ($))A({code:"config_not_found",message:`Configuration file not found: ${$}. Create a .typescape/config.yaml file or use --config to specify a path.`},R);let Z;try{let Y=yQ($,"utf-8");Z=c0(Y)}catch(Y){let B=Y instanceof Error?Y.message:String(Y);A({code:"config_parse_error",message:`Failed to parse config file: ${B}`},R)}if(Z.version!==void 0&&Z.version!==a0)A({code:"unsupported_config_version",message:`Unsupported config version: ${Z.version}. Only version ${a0} is supported.`},R);let z=process.env[W9],Q=Z.server?.base_url,J=z||Q;if(!J)A({code:"missing_base_url",message:`Missing server.base_url in config file. Set server.base_url in ${$} or set the ${W9} environment variable.`},R);let G=Z.server?.api_token_env||kQ,H=process.env[G];if(!H)A({code:"missing_api_token",message:`Environment variable ${G} is not set. Set it to your operator API token.`},q0);return{baseUrl:J,apiToken:H,repoId:Z.repo?.id,configPath:$}}class r$ extends Error{status;code;requestId;constructor(q,$,Z,z){super(Z);this.status=q;this.code=$;this.requestId=z;this.name="ApiError"}}function n$(q){let $=q.baseUrl.replace(/\/$/,""),Z="/v1";async function z(Q,J,G={}){let H=`${$}/v1${J}`;if(G.query&&Object.keys(G.query).length>0){let D=new URLSearchParams(G.query);H+=`?${D.toString()}`}let Y={Authorization:`Bearer ${q.apiToken}`,Accept:"application/json",...G.headers};if(G.body!==void 0)Y["Content-Type"]="application/json";let B;try{B=await fetch(H,{method:Q,headers:Y,body:G.body!==void 0?JSON.stringify(G.body):void 0})}catch(D){let V=D instanceof Error?D.message:String(D);A({code:"network_error",message:`Network error: ${V}`},q0)}let L;if((B.headers.get("Content-Type")||"").includes("application/json"))try{L=await B.json()}catch{L={}}else L={};let W=L?.request_id||B.headers.get("X-Request-Id")||"unknown";if(!B.ok){let D=L,V=D.error?.code||"api_error",F=D.error?.message||`API request failed with status ${B.status}`,X=$2(B.status);A({code:V,message:`${F} (request_id: ${W})`},X)}return{status:B.status,body:L,requestId:W}}return{async get(Q,J){return z("GET",Q,J)},async post(Q,J){return z("POST",Q,J)},async put(Q,J){return z("PUT",Q,J)},async patch(Q,J){return z("PATCH",Q,J)},async delete(Q,J){return z("DELETE",Q,J)},request:z}}var{spawn:hQ}=globalThis.Bun;async function K0(q){if(!q||typeof q==="number")return"";return new Response(q).text()}function gQ(q){let $={file:"",reviewers:[],approvers:[],format:"json"},Z=0;while(Z<q.length){let z=q[Z];if(z==="--file")$.file=q[Z+1]||"",Z+=2;else if(z.startsWith("--file="))$.file=z.slice(7),Z++;else if(z==="--repo")$.repo=q[Z+1],Z+=2;else if(z.startsWith("--repo="))$.repo=z.slice(7),Z++;else if(z==="--sha")$.sha=q[Z+1],Z+=2;else if(z.startsWith("--sha="))$.sha=z.slice(6),Z++;else if(z==="--title")$.title=q[Z+1],Z+=2;else if(z.startsWith("--title="))$.title=z.slice(8),Z++;else if(z==="--reviewer")$.reviewers.push(q[Z+1]||""),Z+=2;else if(z.startsWith("--reviewer="))$.reviewers.push(z.slice(11)),Z++;else if(z==="--approver")$.approvers.push(q[Z+1]||""),Z+=2;else if(z.startsWith("--approver="))$.approvers.push(z.slice(11)),Z++;else if(z==="--reviewers-from")$.reviewersFrom=q[Z+1],Z+=2;else if(z.startsWith("--reviewers-from="))$.reviewersFrom=z.slice(17),Z++;else if(z==="--idempotency-key")$.idempotencyKey=q[Z+1],Z+=2;else if(z.startsWith("--idempotency-key="))$.idempotencyKey=z.slice(18),Z++;else if(z==="--format")$.format=q[Z+1]||"json",Z+=2;else if(z.startsWith("--format="))$.format=z.slice(9),Z++;else Z++}return $}async function uQ(){try{let q=hQ({cmd:["git","rev-parse","HEAD"],stdout:"pipe",stderr:"pipe"}),$=await K0(q.stdout);if(await q.exited!==0)A({code:"git_resolve_failed",message:"Could not resolve HEAD. Use --sha to provide a commit SHA explicitly."},R);let z=$.trim();if(!/^[a-f0-9]{40}$/i.test(z))A({code:"git_resolve_failed",message:`Invalid SHA format: ${z}. Use --sha to provide a commit SHA explicitly.`},R);return z.toLowerCase()}catch(q){A({code:"git_resolve_failed",message:"Could not resolve HEAD. Use --sha to provide a commit SHA explicitly."},R)}}function vQ(q){let $=[];for(let Z of q.reviewers)if(Z.trim())$.push({email:Z.trim(),roles:["reviewer"]});for(let Z of q.approvers)if(Z.trim())$.push({email:Z.trim(),roles:["approver"]});return $}async function X9(q,$,Z){let z=gQ(q);if(!z.file)A({code:"missing_required_flag",message:"Missing required flag: --file"},R);let Q=z.repo;if(!Q||Q===".")Q=$.repoId;if(!Q)A({code:"repo_id_missing",message:"Could not determine repo_id. Set repo.id in .typescape/config.yaml or use --repo."},R);let J=z.sha;if(!J)J=await uQ();else{if(!/^[a-f0-9]{40}$/i.test(J))A({code:"invalid_sha_format",message:`Invalid SHA format: ${J}. Must be a 40-character hex string.`},R);J=J.toLowerCase()}let G=vQ(z),H={repo_id:Q,git_sha:J,file_path:z.file};if(z.title)H.title=z.title;if(G.length>0)H.participants=G;if(z.idempotencyKey)H.idempotency_key=z.idempotencyKey;let Y={};if(z.idempotencyKey)Y["Idempotency-Key"]=z.idempotencyKey;let B=await Z.post("/sessions",{body:H,headers:Y});if(z.format==="json")h(B.body,"json");else{let L=B.body.session?.id||"unknown",U=B.body.invitations?.[0]?.review_url||"";if(console.log(`Session created: ${L}`),U)console.log(`Review URL: ${U}`)}process.exit(I)}import{writeFileSync as mQ}from"fs";function dQ(q){let $={session:"",schema:"v1",format:"json"},Z=0;while(Z<q.length){let z=q[Z];if(z==="--session")$.session=q[Z+1]||"",Z+=2;else if(z.startsWith("--session="))$.session=z.slice(10),Z++;else if(z==="--out")$.out=q[Z+1],Z+=2;else if(z.startsWith("--out="))$.out=z.slice(6),Z++;else if(z==="--schema")$.schema=q[Z+1]||"v1",Z+=2;else if(z.startsWith("--schema="))$.schema=z.slice(9),Z++;else if(z==="--format")$.format=q[Z+1]||"json",Z+=2;else if(z.startsWith("--format="))$.format=z.slice(9),Z++;else Z++}return $}async function F9(q,$,Z){let z=dQ(q);if(!z.session)A({code:"missing_required_flag",message:"Missing required flag: --session"},R);if(z.schema!=="v1")A({code:"unsupported_schema_version",message:`Unsupported schema version: ${z.schema}. Only v1 is supported.`},R);let Q=await Z.get(`/sessions/${encodeURIComponent(z.session)}/export`,{query:{schema:z.schema}}),J=JSON.stringify(Q.body,null,2);if(z.out)mQ(z.out,J,"utf-8"),console.error(`Export written to ${z.out}`);else if(z.format==="json")console.log(J);else{let G=Q.body.session,H=Q.body.threads?.length??0,Y=Q.body.approvals?.length??0;console.log(`Session ID: ${G?.id??"unknown"}`),console.log(`File Path: ${G?.file_path??"unknown"}`),console.log(`Source Type: ${G?.source_type??"unknown"}`),console.log(`Git SHA: ${G?.git_sha??"N/A"}`),console.log(`Schema Version: ${Q.body.schema_version}`),console.log(`Threads: ${H}`),console.log(`Approvals: ${Y}`),console.log(`Request ID: ${Q.body.request_id}`)}process.exit(I)}import{existsSync as o$,mkdirSync as lQ,writeFileSync as L9}from"fs";import{join as D9,basename as pQ,resolve as cQ}from"path";import{createInterface as aQ}from"readline";function iQ(q){let $={yes:!1,force:!1,format:"text"},Z=0;while(Z<q.length){let z=q[Z];if(z==="--yes"||z==="-y")$.yes=!0,Z++;else if(z==="--force"||z==="-f")$.force=!0,Z++;else if(z==="--base-url")$.baseUrl=q[Z+1],Z+=2;else if(z.startsWith("--base-url="))$.baseUrl=z.slice(11),Z++;else if(z==="--format"){let Q=q[Z+1];if(Q==="json"||Q==="text")$.format=Q;Z+=2}else if(z.startsWith("--format=")){let Q=z.slice(9);if(Q==="json"||Q==="text")$.format=Q;Z++}else Z++}return $}async function sQ(){try{let q=Bun.spawn(["git","remote","get-url","origin"],{stdout:"pipe",stderr:"pipe"}),$=await K0(q.stdout);if(await q.exited===0&&$.trim()){let Q=$.trim().match(/\/([^/]+?)(?:\.git)?$/);if(Q)return Q[1]}}catch{}return pQ(process.cwd())}async function M9(q,$,Z){if(Z.yes)return $;if(!process.stdin.isTTY)return $;let z=aQ({input:process.stdin,output:process.stdout});return new Promise((Q)=>{z.question(`${q} [${$}]: `,(J)=>{z.close(),Q(J.trim()||$)})})}function rQ(q,$){return`version: 1
142
+
143
+ deployment:
144
+ profile: "standard"
145
+
146
+ server:
147
+ base_url: "${$}"
148
+
149
+ repo:
150
+ id: "${q}"
151
+ local_path: "."
152
+
153
+ review:
154
+ link_policy:
155
+ mode: "email_otp"
156
+ allow_read_without_identity: true
157
+ require_identity_for:
158
+ comment: true
159
+ approve: true
160
+
161
+ parsing:
162
+ block_id_scheme: "v1"
163
+ block_key_scheme: "v1"
164
+ `}async function V9(q){let $=iQ(q),Z=cQ(".typescape"),z=D9(Z,"config.yaml");if(o$(z)&&!$.force){if($.format==="json")h({status:"exists",message:"Configuration already exists",path:z},$.format);else console.log(`Configuration already exists at ${z}`),console.log("Use --force to overwrite.");process.exit(I)}let Q=await sQ(),J,G;if($.yes)J=Q,G=$.baseUrl||"http://localhost:3000";else{if($.format==="text"&&process.stdin.isTTY)console.log(`Welcome to Typescape!
165
+ `),console.log(`This will create a .typescape/ directory in your repo.
166
+ `);J=await M9("Repository ID",Q,$),G=await M9("API base URL",$.baseUrl||"http://localhost:3000",$)}try{if(!o$(Z))lQ(Z,{recursive:!0})}catch(Y){let B=Y instanceof Error?Y.message:String(Y);A({code:"directory_create_failed",message:`Failed to create .typescape/: ${B}`},R)}try{let Y=rQ(J,G);L9(z,Y,"utf-8")}catch(Y){let B=Y instanceof Error?Y.message:String(Y);A({code:"file_write_failed",message:`Failed to write config file: ${B}`},R)}let H=D9(Z,".gitkeep");if(!o$(H))try{L9(H,"","utf-8")}catch{}if($.format==="json")h({status:"created",path:z,repo_id:J,base_url:G},$.format);else console.log(`
167
+ Created ${z}`),console.log(`
168
+ Next steps:`),console.log("1. Commit the .typescape/ directory"),console.log("2. Create your first review session:"),console.log(" $ typescape session create --file README.md");process.exit(I)}import{existsSync as nQ,readFileSync as oQ}from"fs";import{resolve as tQ}from"path";import{createHash as eQ}from"crypto";var P9=new Set(["version","deployment","deployment.profile","server","server.base_url","server.api_token_env","server.max_file_size_bytes","server.max_comment_bytes","repo","repo.id","repo.local_path","review","review.link_policy","review.link_policy.mode","review.link_policy.allow_read_without_identity","review.link_policy.require_identity_for","review.link_policy.require_identity_for.comment","review.link_policy.require_identity_for.approve","parsing","parsing.block_id_scheme","parsing.block_key_scheme"]),O9={"server.max_file_size_bytes":1048576,"server.max_comment_bytes":8000,"server.api_token_env":"TYPESCAPE_API_TOKEN","deployment.profile":"standard","parsing.block_id_scheme":"v1","parsing.block_key_scheme":"v1","review.link_policy.mode":"email_otp","review.link_policy.allow_read_without_identity":!0,"review.link_policy.require_identity_for.comment":!0,"review.link_policy.require_identity_for.approve":!0};function qJ(q){let $={format:"text"},Z=0;while(Z<q.length){let z=q[Z];if(z==="--config")$.config=q[Z+1],Z+=2;else if(z.startsWith("--config="))$.config=z.slice(9),Z++;else if(z==="--profile")$.profile=q[Z+1],Z+=2;else if(z.startsWith("--profile="))$.profile=z.slice(10),Z++;else if(z==="--format"){let Q=q[Z+1];if(Q==="json"||Q==="text")$.format=Q;Z+=2}else if(z.startsWith("--format=")){let Q=z.slice(9);if(Q==="json"||Q==="text")$.format=Q;Z++}else Z++}return $}function K9(q,$=""){let Z=[];for(let[z,Q]of Object.entries(q)){let J=$?`${$}.${z}`:z;if(Z.push(J),Q&&typeof Q==="object"&&!Array.isArray(Q))Z.push(...K9(Q,J))}return Z}function $J(q,$){let Z=$.split("."),z=q;for(let Q of Z)if(z&&typeof z==="object"&&!Array.isArray(z))z=z[Q];else return;return z}function ZJ(q){let $=q.split("."),Z=$[$.length-1];for(let z of P9){let Q=z.split("."),J=Q[Q.length-1];if(Math.abs(Z.length-J.length)<=2&&Z.slice(0,3)===J.slice(0,3))return z}return null}function zJ(q){return`sha256:${eQ("sha256").update(q).digest("hex").slice(0,16)}`}function QJ(q,$,Z){let z={valid:!0,profile:Z||q.deployment?.profile||"standard",config_hash:zJ($),applied_defaults:[],warnings:[],errors:[]};if(q.version!==void 0&&q.version!==a0)z.valid=!1,z.errors.push(`version: Unsupported version ${q.version}. Only version ${a0} is supported.`);if(!q.server||!q.server.base_url)z.valid=!1,z.errors.push("server.base_url: Required field missing");let Q=K9(q);for(let J of Q)if(!P9.has(J)){let G=ZJ(J);if(G)z.errors.push(`${J}: Unknown key (did you mean "${G}"?)`);else z.warnings.push(`${J}: Unknown configuration key`)}for(let[J,G]of Object.entries(O9))if($J(q,J)===void 0)z.applied_defaults.push(J);return z}async function w9(q){let $=qJ(q),Z=tQ($.config||i$);if(!nQ(Z))if($.format==="json")h({valid:!1,errors:[`Config file not found: ${Z}`],warnings:[]},$.format),process.exit(R);else A({code:"config_not_found",message:`Config file not found: ${Z}`},R);let z,Q;try{z=oQ(Z,"utf-8"),Q=c0(z)}catch(G){let H=G instanceof Error?G.message:String(G);if($.format==="json")h({valid:!1,errors:[`Failed to parse config: ${H}`],warnings:[]},$.format),process.exit(R);else A({code:"config_parse_error",message:`Failed to parse config: ${H}`},R);return}let J=QJ(Q,z,$.profile);if(J.errors.length>0)J.valid=!1;if($.format==="json")h(J,$.format),process.exit(J.valid?I:R);else if(J.valid){if(console.log(`\u2713 Config valid
169
+ `),console.log(`Profile: ${J.profile}`),console.log(`Config hash: ${J.config_hash}`),J.applied_defaults.length>0){console.log(`
170
+ Applied defaults:`);for(let G of J.applied_defaults){let H=O9[G];console.log(` ${G}: ${JSON.stringify(H)}`)}}if(J.warnings.length>0){console.log(`
171
+ Warnings:`);for(let G of J.warnings)console.log(` - ${G}`)}console.log(`
172
+ Warnings: ${J.warnings.length}`),console.log(`Errors: ${J.errors.length}`),process.exit(I)}else{if(console.log(`\u2717 Config invalid
173
+ `),J.errors.length>0){console.log("Errors:");for(let G of J.errors)console.log(` - ${G}`)}if(J.warnings.length>0){console.log(`
174
+ Warnings:`);for(let G of J.warnings)console.log(` - ${G}`)}console.log(`
175
+ Exit code: ${R}`),process.exit(R)}}function JJ(q){let $={sha:"HEAD",format:"text",cleanup:!0},Z=0;while(Z<q.length){let z=q[Z];if(z==="--repo")$.repo=q[Z+1],Z+=2;else if(z.startsWith("--repo="))$.repo=z.slice(7),Z++;else if(z==="--file")$.file=q[Z+1],Z+=2;else if(z.startsWith("--file="))$.file=z.slice(7),Z++;else if(z==="--sha")$.sha=q[Z+1],Z+=2;else if(z.startsWith("--sha="))$.sha=z.slice(6),Z++;else if(z==="--format"){let Q=q[Z+1];if(Q==="json"||Q==="text")$.format=Q;Z+=2}else if(z.startsWith("--format=")){let Q=z.slice(9);if(Q==="json"||Q==="text")$.format=Q;Z++}else if(z==="--cleanup")$.cleanup=!0,Z++;else if(z==="--no-cleanup")$.cleanup=!1,Z++;else Z++}return $}async function GJ(q){if(/^[0-9a-f]{40}$/i.test(q))return q;let $=Bun.spawn(["git","rev-parse",q],{stdout:"pipe",stderr:"pipe"}),Z=await K0($.stdout);if(await $.exited!==0)throw Error(`Failed to resolve git ref: ${q}`);return Z.trim()}async function HJ(q,$,Z,z){return{sessionId:(await q.post("/sessions",{body:{source:{source_type:"git",repo_id:$,git_sha:Z,file_path:z}}})).body.session.id}}async function YJ(q,$){let Z=await q.get(`/sessions/${$}/render`);if(!Z.body.blocks||Z.body.blocks.length===0)throw Error("No blocks found in session");return Z.body.blocks[0].id}async function BJ(q,$,Z){let z=await q.post(`/sessions/${$}/threads`,{body:{anchor:{block_id:Z},comment:{body_md:"Smoke test comment",severity:"suggestion"}}});return{threadId:z.body.thread.id,commentId:z.body.comment.id}}async function UJ(q,$){let Z=await q.get(`/sessions/${$}/export`,{query:{schema:"v1"}}),z=JSON.stringify(Z.body);return{export:Z.body,size:z.length}}function WJ(q){let $=q,Z=$.schema_version,z=$.session,Q=$.threads,J=0;if(Q)for(let H of Q){let Y=H.comments;if(Y)J+=Y.length}return{valid:Z==="v1"&&z!==void 0&&typeof z.source_content_sha256==="string"&&z.source_content_sha256.length>0,schemaVersion:Z||"unknown",threadCount:Q?.length||0,commentCount:J}}async function XJ(q,$){try{await q.post(`/sessions/${$}/archive`,{body:{}})}catch{}}async function _9(q,$,Z){let z=JJ(q);if(!z.repo&&!$.repoId)A({code:"missing_required_flag",message:"Missing required flag: --repo"},R);if(!z.file)A({code:"missing_required_flag",message:"Missing required flag: --file"},R);let Q=z.repo||$.repoId,J=z.file,G;try{G=await GJ(z.sha)}catch(X){let M=X instanceof Error?X.message:String(X);A({code:"git_resolve_failed",message:M},R);return}let H=[],Y;if(z.format==="text")process.stdout.write("Step 1/4: Creating session... ");try{if(Y=(await HJ(Z,Q,G,J)).sessionId,H.push({name:"create_session",success:!0,data:{session_id:Y}}),z.format==="text")console.log(`\u2713 (${Y})`)}catch(X){let M=X instanceof r$?X:null,K=X instanceof Error?X.message:String(X);if(H.push({name:"create_session",success:!1,error:K}),z.format==="text")console.log("\u2717");let w=kq;if(M){if(M.status===0||M.status===401||M.status===403)w=q0;else if(M.status>=500)w=q2}T9(H,z,w);return}if(z.format==="text")process.stdout.write("Step 2/4: Posting comment... ");let B,L;try{let X=await YJ(Z,Y),M=await BJ(Z,Y,X);if(B=M.threadId,L=M.commentId,H.push({name:"post_comment",success:!0,data:{thread_id:B,comment_id:L}}),z.format==="text")console.log(`\u2713 (${B}, ${L})`)}catch(X){let M=X instanceof Error?X.message:String(X);if(H.push({name:"post_comment",success:!1,error:M}),z.format==="text")console.log("\u2717")}if(z.format==="text")process.stdout.write("Step 3/4: Exporting... ");let U,W;try{let X=await UJ(Z,Y);if(U=X.export,W=X.size,H.push({name:"export",success:!0,data:{size_bytes:W}}),z.format==="text"){let M=(W/1024).toFixed(1);console.log(`\u2713 (feedback.json, ${M}KB)`)}}catch(X){let M=X instanceof Error?X.message:String(X);if(H.push({name:"export",success:!1,error:M}),z.format==="text")console.log("\u2717")}if(z.format==="text")process.stdout.write("Step 4/4: Verifying export... ");if(U){let X=WJ(U);if(H.push({name:"validate_export",success:X.valid,data:X}),z.format==="text")if(X.valid)console.log(`\u2713 (schema valid, ${X.threadCount} thread, ${X.commentCount} comment)`);else console.log("\u2717 (schema invalid)")}else if(H.push({name:"validate_export",success:!1,error:"No export data to validate"}),z.format==="text")console.log("\u2717 (skipped - no export data)");if(z.cleanup&&Y)await XJ(Z,Y);let D=H.every((X)=>X.success),V=H.some((X)=>X.success);T9(H,z,D?I:V?kq:q0)}function T9(q,$,Z){let z=q.every((Q)=>Q.success);if($.format==="json")h({success:z,steps:q.map((Q)=>({name:Q.name,success:Q.success,...Q.data?{data:Q.data}:{},...Q.error?{error:Q.error}:{}}))},$.format);else if(z)console.log(`
176
+ All checks passed.`);else console.log(`
177
+ Some checks failed.`);process.exit(Z)}import{randomBytes as FJ,createHmac as LJ}from"crypto";function DJ(q){let $={format:"text",length:32},Z=0;while(Z<q.length){let z=q[Z];if(z==="--format"){let Q=q[Z+1];if(Q==="json"||Q==="text")$.format=Q;Z+=2}else if(z.startsWith("--format=")){let Q=z.slice(9);if(Q==="json"||Q==="text")$.format=Q;Z++}else if(z==="--length")$.length=parseInt(q[Z+1],10)||32,Z+=2;else if(z.startsWith("--length="))$.length=parseInt(z.slice(9),10)||32,Z++;else Z++}return $}function MJ(q){return FJ(q).toString("hex")}function VJ(q){return`sha256:${LJ("sha256","typescape").update(q).digest("hex")}`}function N9(q,$){let Z=DJ(q);if($)Z.format=$;let z=MJ(Z.length),Q=VJ(z),J={raw_token:z,token_hash:Q,instructions:{client:"Set TYPESCAPE_API_TOKEN to the raw_token value",server:"Add token_hash to TYPESCAPE_API_TOKENS env var"}};if(Z.format==="json")console.log(JSON.stringify(J,null,2));else console.log(`
178
+ Typescape API Token Generated
179
+ ==============================
180
+
181
+ Raw Token (for your CLI/client):
182
+ ${J.raw_token}
183
+
184
+ Token Hash (for server TYPESCAPE_API_TOKENS):
185
+ ${J.token_hash}
186
+
187
+ Setup Instructions:
188
+ -------------------
189
+
190
+ 1. In your local environment or CI:
191
+ export TYPESCAPE_API_TOKEN="${J.raw_token}"
192
+
193
+ 2. In Vercel/server environment variables:
194
+ TYPESCAPE_API_TOKENS="${J.token_hash}"
195
+
196
+ (For multiple tokens, comma-separate the hashes)
197
+
198
+ 3. Test the connection:
199
+ bunx typescape config validate
200
+ `);process.exit(I)}var OJ=await Promise.resolve().then(() => h9(R9(),1)),j9=OJ.version;function KJ(q){let $={format:"json",help:!1,version:!1},Z=[],z=0;while(z<q.length){let Q=q[z];if(Q==="--help"||Q==="-h")$.help=!0,z++;else if(Q==="--version")$.version=!0,z++;else if(Q==="--format"){let J=q[z+1];if(J!=="json"&&J!=="text")A({code:"invalid_format",message:`Invalid format: ${J}. Must be 'json' or 'text'.`},R);$.format=J,z+=2}else if(Q.startsWith("--format=")){let J=Q.slice(9);if(J!=="json"&&J!=="text")A({code:"invalid_format",message:`Invalid format: ${J}. Must be 'json' or 'text'.`},R);$.format=J,z++}else if(Q==="--config")$.config=q[z+1],z+=2;else if(Q.startsWith("--config="))$.config=Q.slice(9),z++;else if(Q.startsWith("-"))Z.push(Q),z++;else Z.push(Q),z++}return{options:$,remaining:Z}}function A9(){console.log(`Typescape CLI v${j9}
201
+
202
+ Usage: typescape [options] <command> [command-options]
203
+
204
+ Commands:
205
+ init Create a .typescape/ directory with starter config
206
+ config validate Validate config schema and print effective config
207
+ token generate Generate an API token and its hash for server config
208
+ session create Create a new review session from a git repository
209
+ session export Export feedback from a session in schema=v1 format
210
+ smoke-test Run end-to-end sanity check
211
+
212
+ Global Options:
213
+ --format <json|text> Output format (default: json)
214
+ --config <path> Config file path (default: .typescape/config.yaml)
215
+ --help, -h Show help
216
+ --version Show version
217
+
218
+ Examples:
219
+ typescape init
220
+ typescape config validate
221
+ typescape session create --repo . --file docs/API.md
222
+ typescape session export --session ses_abc123 --format json
223
+ typescape smoke-test --repo myrepo --file README.md
224
+ typescape --help
225
+ `)}function S9(){console.log(`Typescape CLI - session commands
226
+
227
+ Usage: typescape session <command> [options]
228
+
229
+ Commands:
230
+ create Create a new review session from a git repository
231
+ export Export feedback from a session in schema=v1 format
232
+
233
+ Use 'typescape session <command> --help' for more information about a command.
234
+ `)}function C9(){console.log(`Typescape CLI - session create
235
+
236
+ Create a new review session from a git repository.
237
+
238
+ Usage: typescape session create [options]
239
+
240
+ Options:
241
+ --repo <path> Path to git repository (default: .)
242
+ --file <path> Path to Markdown file within repository
243
+ --sha <commit> Git commit SHA (default: HEAD)
244
+ --participants <list> Comma-separated participant emails
245
+ --idempotency-key <key> Idempotency key for request deduplication
246
+ --format <json|text> Output format (default: json)
247
+ --help, -h Show help
248
+
249
+ Examples:
250
+ typescape session create --repo . --file docs/API.md
251
+ typescape session create --file README.md --sha abc1234
252
+ `)}function f9(){console.log(`Typescape CLI - session export
253
+
254
+ Export feedback from a session in schema=v1 format.
255
+
256
+ Usage: typescape session export [options]
257
+
258
+ Options:
259
+ --session <id> Session ID to export (required)
260
+ --out <path> Output file path (default: stdout)
261
+ --format <json|text> Output format (default: json)
262
+ --help, -h Show help
263
+
264
+ Examples:
265
+ typescape session export --session ses_abc123
266
+ typescape session export --session ses_abc123 --out feedback.json
267
+ `)}function wJ(){console.log(`Typescape CLI - init
268
+
269
+ Create a .typescape/ directory with a starter config file.
270
+
271
+ Usage: typescape init [options]
272
+
273
+ Options:
274
+ --yes, -y Non-interactive mode (use defaults)
275
+ --force, -f Overwrite existing config
276
+ --base-url <url> Set server.base_url (default: http://localhost:3000)
277
+ --format <json|text> Output format (default: text)
278
+ --help, -h Show help
279
+
280
+ Examples:
281
+ typescape init
282
+ typescape init --yes
283
+ typescape init --base-url https://review.example.com
284
+ `)}function b9(){console.log(`Typescape CLI - config validate
285
+
286
+ Validate config schema and print effective configuration.
287
+
288
+ Usage: typescape config validate [options]
289
+
290
+ Options:
291
+ --config <path> Config file path (default: .typescape/config.yaml)
292
+ --profile <profile> Override deployment profile for validation
293
+ --format <json|text> Output format (default: text)
294
+ --help, -h Show help
295
+
296
+ Examples:
297
+ typescape config validate
298
+ typescape config validate --format json
299
+ typescape config validate --profile production
300
+ `)}function I9(){console.log(`Typescape CLI - token generate
301
+
302
+ Generate an API token and its hash for server configuration.
303
+
304
+ Usage: typescape token generate [options]
305
+
306
+ Options:
307
+ --length <bytes> Token length in bytes (default: 32)
308
+ --format <json|text> Output format (default: text)
309
+ --help, -h Show help
310
+
311
+ Examples:
312
+ typescape token generate
313
+ typescape token generate --format json
314
+ typescape token generate --length 64
315
+ `)}function TJ(){console.log(`Typescape CLI - smoke-test
316
+
317
+ Run end-to-end sanity check: create session -> post comment -> export -> verify.
318
+
319
+ Usage: typescape smoke-test [options]
320
+
321
+ Options:
322
+ --repo <id> Repository ID (required unless in config)
323
+ --file <path> Markdown file to review (required)
324
+ --sha <sha> Git commit SHA (default: HEAD)
325
+ --cleanup Archive test session after (default: true)
326
+ --no-cleanup Keep test session
327
+ --format <json|text> Output format (default: text)
328
+ --help, -h Show help
329
+
330
+ Examples:
331
+ typescape smoke-test --repo myrepo --file README.md
332
+ typescape smoke-test --file docs/API.md --sha abc1234
333
+ typescape smoke-test --repo myrepo --file README.md --no-cleanup
334
+ `)}async function _J(q,$){if($.options.help||q.includes("--help")||q.includes("-h"))C9(),process.exit(I);await X9(q,$.config,$.api)}async function NJ(q,$){if($.options.help||q.includes("--help")||q.includes("-h"))f9(),process.exit(I);await F9(q,$.config,$.api)}async function RJ(q,$){if(q.length===0||q[0]==="--help"||q[0]==="-h")S9(),process.exit(I);let Z=q[0],z=q.slice(1);switch(Z){case"create":await _J(z,$);break;case"export":await NJ(z,$);break;default:A({code:"unknown_command",message:`Unknown session command: ${Z}`},R)}}async function AJ(){let q=process.argv.slice(2),{options:$,remaining:Z}=KJ(q);if($.version)console.log(j9),process.exit(I);if($.help&&Z.length===0)A9(),process.exit(I);if(Z.length===0)A9(),process.exit(I);let z=Z[0],Q=Z.slice(1),J=$.help||Q.includes("--help")||Q.includes("-h")||Q.length>0&&(Q[0]==="--help"||Q[0]==="-h");switch(z){case"init":if(J)wJ(),process.exit(I);await V9(Q);break;case"config":if(Q[0]==="validate"){let G=Q.slice(1);if(J||G.includes("--help")||G.includes("-h"))b9(),process.exit(I);await w9(G)}else if(Q[0]==="--help"||Q[0]==="-h"||Q.length===0)b9(),process.exit(I);else A({code:"unknown_command",message:`Unknown config command: ${Q[0]}`},R);break;case"token":if(Q[0]==="generate"){let G=Q.slice(1);if(J||G.includes("--help")||G.includes("-h"))I9(),process.exit(I);N9(G,$.format)}else if(Q[0]==="--help"||Q[0]==="-h"||Q.length===0)I9(),process.exit(I);else A({code:"unknown_command",message:`Unknown token command: ${Q[0]}`},R);break;case"smoke-test":if(J)TJ(),process.exit(I);{let G=s$($.config),H=n$(G);await _9(Q,G,H)}break;case"session":if(J)bJ(Q,$);else{let G=s$($.config),H=n$(G);await RJ(Q,{options:$,config:G,api:H})}break;default:A({code:"unknown_command",message:`Unknown command: ${z}`},R)}}function bJ(q,$){if(q.length===0||q[0]==="--help"||q[0]==="-h")S9(),process.exit(I);let Z=q[0],z=q.slice(1);if($.help||z.includes("--help")||z.includes("-h")){switch(Z){case"create":C9();break;case"export":f9();break;default:A({code:"unknown_command",message:`Unknown session command: ${Z}`},R);return}process.exit(I)}A({code:"config_required",message:"Session commands require a configuration file"},R)}AJ().catch((q)=>{A({code:"internal_error",message:q instanceof Error?q.message:String(q)},R)});
package/package.json CHANGED
@@ -1,10 +1,37 @@
1
1
  {
2
2
  "name": "@typescape-ai/cli",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @typescape-ai/cli",
3
+ "version": "0.1.0",
4
+ "description": "Typescape CLI - Create review sessions, export feedback, and integrate with AI workflows",
5
+ "type": "module",
6
+ "bin": {
7
+ "typescape": "./dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "exports": {
14
+ ".": "./dist/cli.js"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "engines": {
20
+ "bun": ">=1.0.0"
21
+ },
5
22
  "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
23
+ "typescape",
24
+ "cli",
25
+ "review",
26
+ "documentation",
27
+ "ai",
28
+ "feedback",
29
+ "bun"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/voidserf/typescape-docs.git",
34
+ "directory": "apps/cli"
35
+ },
36
+ "license": "MIT"
10
37
  }