faf-cli 7.14.0 → 7.15.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.
@@ -1,89 +1,19 @@
1
1
  import type { FafData } from '../core/types.js';
2
2
  import { type RenderedResult } from '../core/render-hash.js';
3
+ import { type FafaDoc, type ProjectedA2A } from './pack.js';
3
4
  import { type ServerCardOptions } from './servercard.js';
4
5
  /** A2A extension URI — dereference, not the MCP `_meta` key `one.faf/context`. */
5
6
  export declare const A2A_CONTEXT_URI = "https://faf.one/ext/context/v1";
6
- export declare const A2A_PROTOCOL_BINDING = "JSONRPC";
7
- export declare const A2A_PROTOCOL_VERSION = "1.0";
8
- /** The three FAF-family media types the extension advertises, in family order. */
9
- export declare const FAF_MEDIA_TYPES: readonly ["application/vnd.faf+yaml", "application/vnd.fafm+yaml", "application/vnd.fafa+yaml"];
7
+ export { A2A_PROTOCOL_BINDING, A2A_PROTOCOL_VERSION, FAF_MEDIA_TYPES, a2aEndpoints, a2aDoors, } from './pack.js';
8
+ export type { FafaAgent, FafaCapability, FafaEndpoint, FafaDoc, ProjectedA2A } from './pack.js';
10
9
  export type CardTarget = 'a2a' | 'mcp' | 'registry' | 'catalog';
11
10
  export declare const CARD_TARGETS: CardTarget[];
12
- export interface FafaAgent {
13
- name?: string;
14
- displayName?: string;
15
- id?: string;
16
- vendor?: string;
17
- version?: string;
18
- description?: string;
19
- homepage?: string;
20
- }
21
- export interface FafaCapability {
22
- name?: string;
23
- description?: string;
24
- tags?: unknown;
25
- /** MIME type this capability reads, when it's one of the FAF family — drives the skill's `inputModes` and the card's `defaultInputModes`. */
26
- cites_spec?: string;
27
- }
28
- export interface FafaEndpoint {
29
- protocol?: string;
30
- transport?: string;
31
- location?: string;
32
- version?: string;
33
- }
34
- export interface FafaDoc {
35
- /** `.fafa` spec version this document is authored against, e.g. `"1.0"` — not `agent.version`. */
36
- version?: string;
37
- agent?: FafaAgent;
38
- capabilities?: FafaCapability[];
39
- endpoints?: FafaEndpoint[];
40
- provenance?: Record<string, unknown>;
41
- metadata?: {
42
- persona?: string;
43
- };
44
- [key: string]: unknown;
45
- }
46
11
  export interface ProjectCardsOptions extends ServerCardOptions {
47
12
  /** Public URL of the emitted A2A card (catalog row). */
48
13
  a2aCardUrl?: string;
49
14
  /** Caller-supplied A2A door when `.fafa` has no `endpoints[].protocol: a2a`. */
50
15
  doorUrl?: string;
51
16
  }
52
- export interface ProjectedA2A {
53
- name: string;
54
- description: string;
55
- supportedInterfaces: Array<{
56
- url: string;
57
- protocolBinding: string;
58
- protocolVersion: string;
59
- }>;
60
- /** Omitted entirely when `agent.vendor` or `agent.homepage` is absent — A2A optional, never a guessed org name. */
61
- provider?: {
62
- organization: string;
63
- url: string;
64
- };
65
- version: string;
66
- capabilities: {
67
- streaming: boolean;
68
- pushNotifications: boolean;
69
- extendedAgentCard: boolean;
70
- extensions: Array<{
71
- uri: string;
72
- description: string;
73
- required: boolean;
74
- params: Record<string, unknown>;
75
- }>;
76
- };
77
- defaultInputModes: string[];
78
- defaultOutputModes: string[];
79
- skills: Array<{
80
- id: string;
81
- name: string;
82
- description: string;
83
- tags: string[];
84
- inputModes?: string[];
85
- }>;
86
- }
87
17
  export interface CatalogEntry {
88
18
  identifier: string;
89
19
  displayName?: string;
@@ -112,10 +42,8 @@ export interface ProjectedCards {
112
42
  export declare function readFafa(path: string): FafaDoc;
113
43
  /** Discover agent.fafa / .fafa (cwd, then one parent). */
114
44
  export declare function findFafaFile(dir?: string): string | null;
115
- export declare function a2aEndpoints(fafa: FafaDoc): FafaEndpoint[];
116
- /** Authored A2A endpoints, else a single `doorUrl`. Never invents a door. */
117
- export declare function a2aDoors(fafa: FafaDoc, opts?: ProjectCardsOptions): FafaEndpoint[];
118
- /** Build the A2A Agent Card (JSON) from a .fafa + .faf. */
45
+ /** Build the A2A Agent Card (JSON) from a .fafa + .faf: the core card
46
+ * ({@link projectA2ACard}) carrying FAF's context extension. */
119
47
  export declare function buildA2ACard(fafa: FafaDoc, faf: FafData, opts?: ProjectCardsOptions): ProjectedA2A;
120
48
  /** @deprecated Use {@link buildA2ACard}. Removed in the next major. */
121
49
  export declare const generateA2ACard: typeof buildA2ACard;
@@ -0,0 +1,204 @@
1
+ export declare const A2A_PROTOCOL_BINDING = "JSONRPC";
2
+ export declare const A2A_PROTOCOL_VERSION = "1.0";
3
+ /** The three FAF-family media types, in family order. */
4
+ export declare const FAF_MEDIA_TYPES: readonly ["application/vnd.faf+yaml", "application/vnd.fafm+yaml", "application/vnd.fafa+yaml"];
5
+ /** The only `$schema` a Server Card may carry (modelcontextprotocol/ext-server-card). */
6
+ export declare const SERVER_CARD_SCHEMA = "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json";
7
+ /** The dated registry schema a `server.json` declares (latest release 2025-12-11). */
8
+ export declare const SERVER_JSON_SCHEMA = "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json";
9
+ export declare const AI_CATALOG_SPEC_VERSION = "1.0";
10
+ export declare const FAFA_SPEC_VERSION = "1.0";
11
+ /** Media types a catalog entry uses for each card it lists (AI Catalog's own list). */
12
+ export declare const CARD_MEDIA_TYPES: {
13
+ readonly a2a: "application/a2a-agent-card+json";
14
+ readonly server_card: "application/mcp-server-card+json";
15
+ readonly fafa: "application/vnd.fafa+yaml";
16
+ };
17
+ export interface FafaAgent {
18
+ name?: string;
19
+ displayName?: string;
20
+ id?: string;
21
+ vendor?: string;
22
+ version?: string;
23
+ description?: string;
24
+ homepage?: string;
25
+ license?: string;
26
+ }
27
+ export interface FafaCapability {
28
+ name?: string;
29
+ type?: string;
30
+ description?: string;
31
+ tags?: unknown;
32
+ /** MIME type this capability reads, when it's one of the FAF family — drives the skill's `inputModes` and the card's `defaultInputModes`. */
33
+ cites_spec?: string;
34
+ }
35
+ export interface FafaEndpoint {
36
+ protocol?: string;
37
+ transport?: string;
38
+ location?: string;
39
+ version?: string;
40
+ }
41
+ /** Facts only some cards carry, kept in the `.fafa` under `metadata.cards` so the file stays the one source. */
42
+ export interface PackExtras {
43
+ domain?: string;
44
+ repository?: string;
45
+ icon?: string;
46
+ organizationUrl?: string;
47
+ keywords?: string[];
48
+ examples?: string[];
49
+ packages?: PackPackage[];
50
+ }
51
+ export interface PackPackage {
52
+ registryType: string;
53
+ identifier: string;
54
+ version?: string;
55
+ }
56
+ export interface FafaDoc {
57
+ /** `.fafa` spec version this document is authored against, e.g. `"1.0"` — not `agent.version`. */
58
+ version?: string;
59
+ agent?: FafaAgent;
60
+ capabilities?: FafaCapability[];
61
+ endpoints?: FafaEndpoint[];
62
+ provenance?: Record<string, unknown>;
63
+ metadata?: {
64
+ persona?: string;
65
+ cards?: PackExtras;
66
+ [key: string]: unknown;
67
+ };
68
+ [key: string]: unknown;
69
+ }
70
+ export interface A2AExtension {
71
+ uri: string;
72
+ description: string;
73
+ required: boolean;
74
+ params: Record<string, unknown>;
75
+ }
76
+ export interface ProjectedA2A {
77
+ name: string;
78
+ description: string;
79
+ supportedInterfaces: Array<{
80
+ url: string;
81
+ protocolBinding: string;
82
+ protocolVersion: string;
83
+ }>;
84
+ /** Omitted entirely when `agent.vendor` or `agent.homepage` is absent — A2A optional, never a guessed org name. */
85
+ provider?: {
86
+ organization: string;
87
+ url: string;
88
+ };
89
+ version: string;
90
+ capabilities: {
91
+ streaming: boolean;
92
+ pushNotifications: boolean;
93
+ extendedAgentCard: boolean;
94
+ extensions: A2AExtension[];
95
+ };
96
+ defaultInputModes: string[];
97
+ defaultOutputModes: string[];
98
+ skills: Array<{
99
+ id: string;
100
+ name: string;
101
+ description: string;
102
+ tags: string[];
103
+ inputModes?: string[];
104
+ }>;
105
+ }
106
+ export declare function a2aEndpoints(fafa: FafaDoc): FafaEndpoint[];
107
+ /** Authored A2A endpoints, else a single `doorUrl`. Never invents a door. */
108
+ export declare function a2aDoors(fafa: FafaDoc, opts?: {
109
+ doorUrl?: string;
110
+ }): FafaEndpoint[];
111
+ /**
112
+ * The A2A Agent Card from a `.fafa`: every field comes from the document, and
113
+ * `capabilities.extensions` holds exactly the extensions passed (none by default).
114
+ */
115
+ export declare function projectA2ACard(fafa: FafaDoc, opts?: {
116
+ doorUrl?: string;
117
+ extensions?: A2AExtension[];
118
+ }): ProjectedA2A;
119
+ /** What someone tells the front door. Keys match the crosswalk's slot ids. */
120
+ export interface PackAnswers {
121
+ display_name: string;
122
+ handle: string;
123
+ domain: string;
124
+ description: string;
125
+ version: string;
126
+ endpoints?: Array<{
127
+ protocol: string;
128
+ url: string;
129
+ }>;
130
+ skills?: Array<{
131
+ name: string;
132
+ description?: string;
133
+ type?: string;
134
+ }>;
135
+ organization?: string;
136
+ organization_url?: string;
137
+ homepage?: string;
138
+ icon?: string;
139
+ repository?: string;
140
+ license?: string;
141
+ tags?: string[];
142
+ example_requests?: string[];
143
+ packages?: PackPackage[];
144
+ }
145
+ /** Write the `.fafa` a set of answers describes. Throws, naming the answer, when one is missing or malformed. */
146
+ export declare function answersToFafa(a: PackAnswers): FafaDoc;
147
+ /** The `.fafa` as the YAML document people keep. */
148
+ export declare function fafaYaml(fafa: FafaDoc): string;
149
+ /** Where the `.fafa` says it is published: `agent.id` (urn:air), else metadata, else the homepage host. */
150
+ export declare function fafaDomain(fafa: FafaDoc): string;
151
+ /** MCP names are reverse-DNS: example.com + weather → com.example/weather. */
152
+ export declare function mcpName(fafa: FafaDoc): string;
153
+ /** The MCP Server Card for a remote MCP server. */
154
+ export declare function projectServerCard(fafa: FafaDoc): Record<string, unknown>;
155
+ /** The MCP Registry `server.json` (publishing it stays the owner's step). */
156
+ export declare function projectServerJson(fafa: FafaDoc): Record<string, unknown>;
157
+ export type PackCard = 'a2a' | 'server_card' | 'server_json' | 'ai_catalog' | 'ard' | 'fafa';
158
+ export interface CatalogRow {
159
+ identifier: string;
160
+ displayName: string;
161
+ type: string;
162
+ description: string;
163
+ url: string;
164
+ version?: string;
165
+ updatedAt: string;
166
+ }
167
+ /** One row per card the domain serves: the A2A card, the Server Card, and the `.fafa` only when asked. */
168
+ export declare function catalogRows(fafa: FafaDoc, cards: PackCard[], opts?: {
169
+ now?: string;
170
+ listFafa?: boolean;
171
+ }): CatalogRow[];
172
+ /** The AI Catalog for the domain: every row above, with the host named. */
173
+ export declare function projectAiCatalog(fafa: FafaDoc, cards: PackCard[], opts?: {
174
+ now?: string;
175
+ listFafa?: boolean;
176
+ }): Record<string, unknown>;
177
+ /** The ARD manifest: the same rows, plus the search hints ARD reads (keywords, example requests). */
178
+ export declare function projectArd(fafa: FafaDoc, cards: PackCard[], opts?: {
179
+ now?: string;
180
+ listFafa?: boolean;
181
+ }): Record<string, unknown>;
182
+ export interface PackOptions {
183
+ /** Which cards to build; the `.fafa` is always written. */
184
+ cards: PackCard[];
185
+ /** `updatedAt` for catalog rows (tests); otherwise now. */
186
+ now?: string;
187
+ /** List the `.fafa` itself in the catalog and ARD manifest (it is then served at /.well-known/fafa). */
188
+ listFafa?: boolean;
189
+ /** Extensions to put on the A2A card; none by default. */
190
+ a2aExtensions?: A2AExtension[];
191
+ }
192
+ export interface Pack {
193
+ fafa: FafaDoc;
194
+ fafaText: string;
195
+ a2a?: ProjectedA2A;
196
+ server_card?: Record<string, unknown>;
197
+ server_json?: Record<string, unknown>;
198
+ ai_catalog?: Record<string, unknown>;
199
+ ard?: Record<string, unknown>;
200
+ }
201
+ /** Every card a `.fafa` can feed, for the cards asked. */
202
+ export declare function projectPack(fafa: FafaDoc, opts: PackOptions): Pack;
203
+ /** Answers in, the `.fafa` and every card asked for out. */
204
+ export declare function buildPack(answers: PackAnswers, opts: PackOptions): Pack;
package/dist/pack.js ADDED
@@ -0,0 +1,61 @@
1
+ var C0=Symbol.for("yaml.alias"),E0=Symbol.for("yaml.document"),x=Symbol.for("yaml.map"),J$=Symbol.for("yaml.pair"),X0=Symbol.for("yaml.scalar"),r=Symbol.for("yaml.seq"),g=Symbol.for("yaml.node.type"),u=($)=>!!$&&typeof $==="object"&&$[g]===C0,m=($)=>!!$&&typeof $==="object"&&$[g]===E0,v=($)=>!!$&&typeof $==="object"&&$[g]===x,L=($)=>!!$&&typeof $==="object"&&$[g]===J$,O=($)=>!!$&&typeof $==="object"&&$[g]===X0,d=($)=>!!$&&typeof $==="object"&&$[g]===r;function P($){if($&&typeof $==="object")switch($[g]){case x:case r:return!0}return!1}function D($){if($&&typeof $==="object")switch($[g]){case C0:case x:case X0:case r:return!0}return!1}var g0=($)=>(O($)||P($))&&!!$.anchor;var f=Symbol("break visit"),g$=Symbol("skip children"),c=Symbol("remove node");function s($,U){let H=f$(U);if(m($)){if(W0(null,$.contents,H,Object.freeze([$]))===c)$.contents=null}else W0(null,$,H,Object.freeze([]))}s.BREAK=f;s.SKIP=g$;s.REMOVE=c;function W0($,U,H,X){let Z=y$($,U,H,X);if(D(Z)||L(Z))return h$($,X,Z),W0($,Z,H,X);if(typeof Z!=="symbol"){if(P(U)){X=Object.freeze(X.concat(U));for(let G=0;G<U.items.length;++G){let z=W0(G,U.items[G],H,X);if(typeof z==="number")G=z-1;else if(z===f)return f;else if(z===c)U.items.splice(G,1),G-=1}}else if(L(U)){X=Object.freeze(X.concat(U));let G=W0("key",U.key,H,X);if(G===f)return f;else if(G===c)U.key=null;let z=W0("value",U.value,H,X);if(z===f)return f;else if(z===c)U.value=null}}return Z}async function f0($,U){let H=f$(U);if(m($)){if(await T0(null,$.contents,H,Object.freeze([$]))===c)$.contents=null}else await T0(null,$,H,Object.freeze([]))}f0.BREAK=f;f0.SKIP=g$;f0.REMOVE=c;async function T0($,U,H,X){let Z=await y$($,U,H,X);if(D(Z)||L(Z))return h$($,X,Z),T0($,Z,H,X);if(typeof Z!=="symbol"){if(P(U)){X=Object.freeze(X.concat(U));for(let G=0;G<U.items.length;++G){let z=await T0(G,U.items[G],H,X);if(typeof z==="number")G=z-1;else if(z===f)return f;else if(z===c)U.items.splice(G,1),G-=1}}else if(L(U)){X=Object.freeze(X.concat(U));let G=await T0("key",U.key,H,X);if(G===f)return f;else if(G===c)U.key=null;let z=await T0("value",U.value,H,X);if(z===f)return f;else if(z===c)U.value=null}}return Z}function f$($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function y$($,U,H,X){if(typeof H==="function")return H($,U,X);if(v(U))return H.Map?.($,U,X);if(d(U))return H.Seq?.($,U,X);if(L(U))return H.Pair?.($,U,X);if(O(U))return H.Scalar?.($,U,X);if(u(U))return H.Alias?.($,U,X);return}function h$($,U,H){let X=U[U.length-1];if(P(X))X.items[$]=H;else if(L(X))if($==="key")X.key=H;else X.value=H;else if(m(X))X.contents=H;else{let Z=u(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Z} parent`)}}var _2={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},O2=($)=>$.replace(/[!,[\]{}]/g,(U)=>_2[U]);class S{constructor($,U){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},S.defaultYaml,$),this.tags=Object.assign({},S.defaultTags,U)}clone(){let $=new S(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new S(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:S.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},S.defaultTags);break}return $}add($,U){if(this.atNextDocument)this.yaml={explicit:S.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},S.defaultTags),this.atNextDocument=!1;let H=$.trim().split(/[ \t]+/),X=H.shift();switch(X){case"%TAG":{if(H.length!==2){if(U(0,"%TAG directive should contain exactly two parts"),H.length<2)return!1}let[Z,G]=H;return this.tags[Z]=G,!0}case"%YAML":{if(this.yaml.explicit=!0,H.length!==1)return U(0,"%YAML directive should contain exactly one part"),!1;let[Z]=H;if(Z==="1.1"||Z==="1.2")return this.yaml.version=Z,!0;else{let G=/^\d+\.\d+$/.test(Z);return U(6,`Unsupported YAML version ${Z}`,G),!1}}default:return U(0,`Unknown directive ${X}`,!0),!1}}tagName($,U){if($==="!")return"!";if($[0]!=="!")return U(`Not a valid tag: ${$}`),null;if($[1]==="<"){let G=$.slice(2,-1);if(G==="!"||G==="!!")return U(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")U("Verbatim tags must end with a >");return G}let[,H,X]=$.match(/^(.*!)([^!]*)$/s);if(!X)U(`The ${$} tag has no suffix`);let Z=this.tags[H];if(Z)try{return Z+decodeURIComponent(X)}catch(G){return U(String(G)),null}if(H==="!")return $;return U(`Could not resolve tag: ${$}`),null}tagString($){for(let[U,H]of Object.entries(this.tags))if($.startsWith(H))return U+O2($.substring(H.length));return $[0]==="!"?$:`!<${$}>`}toString($){let U=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],H=Object.entries(this.tags),X;if($&&H.length>0&&D($.contents)){let Z={};s($.contents,(G,z)=>{if(D(z)&&z.tag)Z[z.tag]=!0}),X=Object.keys(Z)}else X=[];for(let[Z,G]of H){if(Z==="!!"&&G==="tag:yaml.org,2002:")continue;if(!$||X.some((z)=>z.startsWith(G)))U.push(`%TAG ${Z} ${G}`)}return U.join(`
2
+ `)}}S.defaultYaml={explicit:!1,version:"1.2"};S.defaultTags={"!!":"tag:yaml.org,2002:"};function y0($){if(/[\x00-\x19\s,[\]{}]/.test($)){let H=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(H)}return!0}function Q$($){let U=new Set;return s($,{Value(H,X){if(X.anchor)U.add(X.anchor)}}),U}function B$($,U){for(let H=1;;++H){let X=`${$}${H}`;if(!U.has(X))return X}}function k$($,U){let H=[],X=new Map,Z=null;return{onAnchor:(G)=>{H.push(G),Z??(Z=Q$($));let z=B$(U,Z);return Z.add(z),z},setAnchors:()=>{for(let G of H){let z=X.get(G);if(typeof z==="object"&&z.anchor&&(O(z.node)||P(z.node)))z.node.anchor=z.anchor;else{let Q=Error("Failed to resolve repeated object (this should not happen)");throw Q.source=G,Q}}},sourceObjects:X}}function e($,U,H,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Z=0,G=X.length;Z<G;++Z){let z=X[Z],Q=e($,X,String(Z),z);if(Q===void 0)delete X[Z];else if(Q!==z)X[Z]=Q}else if(X instanceof Map)for(let Z of Array.from(X.keys())){let G=X.get(Z),z=e($,X,Z,G);if(z===void 0)X.delete(Z);else if(z!==G)X.set(Z,z)}else if(X instanceof Set)for(let Z of Array.from(X)){let G=e($,X,Z,Z);if(G===void 0)X.delete(Z);else if(G!==Z)X.delete(Z),X.add(G)}else for(let[Z,G]of Object.entries(X)){let z=e($,X,Z,G);if(z===void 0)delete X[Z];else if(z!==G)X[Z]=z}return $.call(U,H,X)}function N($,U,H){if(Array.isArray($))return $.map((X,Z)=>N(X,String(Z),H));if($&&typeof $.toJSON==="function"){if(!H||!g0($))return $.toJSON(U,H);let X={aliasCount:0,count:1,res:void 0};H.anchors.set($,X),H.onCreate=(G)=>{X.res=G,delete H.onCreate};let Z=$.toJSON(U,H);if(H.onCreate)H.onCreate(Z);return Z}if(typeof $==="bigint"&&!H?.keep)return Number($);return $}class Z0{constructor($){Object.defineProperty(this,g,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:U,maxAliasCount:H,onAnchor:X,reviver:Z}={}){if(!m($))throw TypeError("A document argument is required");let G={anchors:new Map,doc:$,keep:!0,mapAsMap:U===!0,mapKeyWarned:!1,maxAliasCount:typeof H==="number"?H:100},z=N(this,"",G);if(typeof X==="function")for(let{count:Q,res:J}of G.anchors.values())X(J,Q);return typeof Z==="function"?e(Z,{"":z},"",z):z}}class G0 extends Z0{constructor($){super(C0);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,U){if(U?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let H;if(U?.aliasResolveCache)H=U.aliasResolveCache;else if(H=[],s($,{Node:(Z,G)=>{if(u(G)||g0(G))H.push(G)}}),U)U.aliasResolveCache=H;let X=void 0;for(let Z of H){if(Z===this)break;if(Z.anchor===this.source)X=Z}return X}toJSON($,U){if(!U)return{source:this.source};let{anchors:H,doc:X,maxAliasCount:Z}=U,G=this.resolve(X,U);if(!G){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Q)}let z=H.get(G);if(!z)N(G,null,U),z=H.get(G);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Z>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=h0(X,G,H);if(z.count*z.aliasCount>Z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString($,U,H){let X=`*${this.source}`;if($){if(y0(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let Z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Z)}if($.implicitKey)return`${X} `}return X}}function h0($,U,H){if(u(U)){let X=U.resolve($),Z=H&&X&&H.get(X);return Z?Z.count*Z.aliasCount:0}else if(P(U)){let X=0;for(let Z of U.items){let G=h0($,Z,H);if(G>X)X=G}return X}else if(L(U)){let X=h0($,U.key,H),Z=h0($,U.value,H);return Math.max(X,Z)}return 1}var k0=($)=>!$||typeof $!=="function"&&typeof $!=="object";class I extends Z0{constructor($){super(X0);this.value=$}toJSON($,U){return U?.keep?this.value:N(this.value,$,U)}toString(){return String(this.value)}}I.BLOCK_FOLDED="BLOCK_FOLDED";I.BLOCK_LITERAL="BLOCK_LITERAL";I.PLAIN="PLAIN";I.QUOTE_DOUBLE="QUOTE_DOUBLE";I.QUOTE_SINGLE="QUOTE_SINGLE";var L2="tag:yaml.org,2002:";function D2($,U,H){if(U){let X=H.filter((G)=>G.tag===U),Z=X.find((G)=>!G.format)??X[0];if(!Z)throw Error(`Tag ${U} not found`);return Z}return H.find((X)=>X.identify?.($)&&!X.format)}function o($,U,H){if(m($))$=$.contents;if(D($))return $;if(L($)){let W=H.schema[x].createNode?.(H.schema,null,H);return W.items.push($),W}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:X,onAnchor:Z,onTagObj:G,schema:z,sourceObjects:Q}=H,J=void 0;if(X&&$&&typeof $==="object")if(J=Q.get($),J)return J.anchor??(J.anchor=Z($)),new G0(J.anchor);else J={anchor:null,node:null},Q.set($,J);if(U?.startsWith("!!"))U=L2+U.slice(2);let B=D2($,U,z.tags);if(!B){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let W=new I($);if(J)J.node=W;return W}B=$ instanceof Map?z[x]:(Symbol.iterator in Object($))?z[r]:z[x]}if(G)G(B),delete H.onTagObj;let F=B?.createNode?B.createNode(H.schema,$,H):typeof B?.nodeClass?.from==="function"?B.nodeClass.from(H.schema,$,H):new I($);if(U)F.tag=U;else if(!B.default)F.tag=B.tag;if(J)J.node=F;return F}function L0($,U,H){let X=H;for(let Z=U.length-1;Z>=0;--Z){let G=U[Z];if(typeof G==="number"&&Number.isInteger(G)&&G>=0){let z=[];z[G]=X,X=z}else X=new Map([[G,X]])}return o(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var V0=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class D0 extends Z0{constructor($,U){super($);Object.defineProperty(this,"schema",{value:U,configurable:!0,enumerable:!1,writable:!0})}clone($){let U=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)U.schema=$;if(U.items=U.items.map((H)=>D(H)||L(H)?H.clone($):H),this.range)U.range=this.range.slice();return U}addIn($,U){if(V0($))this.add(U);else{let[H,...X]=$,Z=this.get(H,!0);if(P(Z))Z.addIn(X,U);else if(Z===void 0&&this.schema)this.set(H,L0(this.schema,X,U));else throw Error(`Expected YAML collection at ${H}. Remaining path: ${X}`)}}deleteIn($){let[U,...H]=$;if(H.length===0)return this.delete(U);let X=this.get(U,!0);if(P(X))return X.deleteIn(H);else throw Error(`Expected YAML collection at ${U}. Remaining path: ${H}`)}getIn($,U){let[H,...X]=$,Z=this.get(H,!0);if(X.length===0)return!U&&O(Z)?Z.value:Z;else return P(Z)?Z.getIn(X,U):void 0}hasAllNullValues($){return this.items.every((U)=>{if(!L(U))return!1;let H=U.value;return H==null||$&&O(H)&&H.value==null&&!H.commentBefore&&!H.comment&&!H.tag})}hasIn($){let[U,...H]=$;if(H.length===0)return this.has(U);let X=this.get(U,!0);return P(X)?X.hasIn(H):!1}setIn($,U){let[H,...X]=$;if(X.length===0)this.set(H,U);else{let Z=this.get(H,!0);if(P(Z))Z.setIn(X,U);else if(Z===void 0&&this.schema)this.set(H,L0(this.schema,X,U));else throw Error(`Expected YAML collection at ${H}. Remaining path: ${X}`)}}}var x$=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function y($,U){if(/^\n+$/.test($))return $.substring(1);return U?$.replace(/^(?! *$)/gm,U):$}var a=($,U,H)=>$.endsWith(`
3
+ `)?y(H,U):H.includes(`
4
+ `)?`
5
+ `+y(H,U):($.endsWith(" ")?"":" ")+H;var W$="flow",m$="block",v$="quoted";function K0($,U,H="flow",{indentAtStart:X,lineWidth:Z=80,minContentWidth:G=20,onFold:z,onOverflow:Q}={}){if(!Z||Z<0)return $;if(Z<G)G=0;let J=Math.max(1+G,1+Z-U.length);if($.length<=J)return $;let B=[],F={},W=Z-U.length;if(typeof X==="number")if(X>Z-Math.max(2,G))B.push(0);else W=Z-X;let V=void 0,R=void 0,_=!1,T=-1,Y=-1,w=-1;if(H==="block"){if(T=u$($,T,U.length),T!==-1)W=T+J}for(let M;M=$[T+=1];){if(H==="quoted"&&M==="\\"){switch(Y=T,$[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}w=T}if(M===`
6
+ `){if(H==="block")T=u$($,T,U.length);W=T+U.length+J,V=void 0}else{if(M===" "&&R&&R!==" "&&R!==`
7
+ `&&R!=="\t"){let b=$[T+1];if(b&&b!==" "&&b!==`
8
+ `&&b!=="\t")V=T}if(T>=W)if(V)B.push(V),W=V+J,V=void 0;else if(H==="quoted"){while(R===" "||R==="\t")R=M,M=$[T+=1],_=!0;let b=T>w+1?T-2:Y-1;if(F[b])return $;B.push(b),F[b]=!0,W=b+J,V=void 0}else _=!0}R=M}if(_&&Q)Q();if(B.length===0)return $;if(z)z();let K=$.slice(0,B[0]);for(let M=0;M<B.length;++M){let b=B[M],A=B[M+1]||$.length;if(b===0)K=`
9
+ ${U}${$.slice(0,A)}`;else{if(H==="quoted"&&F[b])K+=`${$[b]}\\`;K+=`
10
+ ${U}${$.slice(b+1,A)}`}}return K}function u$($,U,H){let X=U,Z=U+1,G=$[Z];while(G===" "||G==="\t")if(U<Z+H)G=$[++U];else{do G=$[++U];while(G&&G!==`
11
+ `);X=U,Z=U+1,G=$[Z]}return X}var u0=($,U)=>({indentAtStart:U?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),m0=($)=>/^(%|---|\.\.\.)/m.test($);function K2($,U,H){if(!U||U<0)return!1;let X=U-H,Z=$.length;if(Z<=X)return!1;for(let G=0,z=0;G<Z;++G)if($[G]===`
12
+ `){if(G-z>X)return!0;if(z=G+1,Z-z<=X)return!1}return!0}function P0($,U){let H=JSON.stringify($);if(U.options.doubleQuotedAsJSON)return H;let{implicitKey:X}=U,Z=U.options.doubleQuotedMinMultiLineLength,G=U.indent||(m0($)?" ":""),z="",Q=0;for(let J=0,B=H[J];B;B=H[++J]){if(B===" "&&H[J+1]==="\\"&&H[J+2]==="n")z+=H.slice(Q,J)+"\\ ",J+=1,Q=J,B="\\";if(B==="\\")switch(H[J+1]){case"u":{z+=H.slice(Q,J);let F=H.substr(J+2,4);switch(F){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(F.substr(0,2)==="00")z+="\\x"+F.substr(2);else z+=H.substr(J,6)}J+=5,Q=J+1}break;case"n":if(X||H[J+2]==='"'||H.length<Z)J+=1;else{z+=H.slice(Q,J)+`
13
+
14
+ `;while(H[J+2]==="\\"&&H[J+3]==="n"&&H[J+4]!=='"')z+=`
15
+ `,J+=2;if(z+=G,H[J+2]===" ")z+="\\";J+=1,Q=J+1}break;default:J+=1}}return z=Q?z+H.slice(Q):H,X?z:K0(z,G,v$,u0(U,!1))}function T$($,U){if(U.options.singleQuote===!1||U.implicitKey&&$.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test($))return P0($,U);let H=U.indent||(m0($)?" ":""),X="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${H}`)+"'";return U.implicitKey?X:K0(X,H,W$,u0(U,!1))}function q0($,U){let{singleQuote:H}=U.options,X;if(H===!1)X=P0;else{let Z=$.includes('"'),G=$.includes("'");if(Z&&!G)X=T$;else if(G&&!Z)X=P0;else X=H?T$:P0}return X($,U)}var V$;try{V$=new RegExp(`(^|(?<!
18
+ ))
19
+ +(?!
20
+ |$)`,"g")}catch{V$=/\n+(?!\n|$)/g}function x0({comment:$,type:U,value:H},X,Z,G){let{blockQuote:z,commentString:Q,lineWidth:J}=X.options;if(!z||/\n[\t ]+$/.test(H))return q0(H,X);let B=X.indent||(X.forceBlockIndent||m0(H)?" ":""),F=z==="literal"?!0:z==="folded"||U===I.BLOCK_FOLDED?!1:U===I.BLOCK_LITERAL?!0:!K2(H,J,B.length);if(!H)return F?`|
21
+ `:`>
22
+ `;let W,V;for(V=H.length;V>0;--V){let A=H[V-1];if(A!==`
23
+ `&&A!=="\t"&&A!==" ")break}let R=H.substring(V),_=R.indexOf(`
24
+ `);if(_===-1)W="-";else if(H===R||_!==R.length-1){if(W="+",G)G()}else W="";if(R){if(H=H.slice(0,-R.length),R[R.length-1]===`
25
+ `)R=R.slice(0,-1);R=R.replace(V$,`$&${B}`)}let T=!1,Y,w=-1;for(Y=0;Y<H.length;++Y){let A=H[Y];if(A===" ")T=!0;else if(A===`
26
+ `)w=Y;else break}let K=H.substring(0,w<Y?w+1:Y);if(K)H=H.substring(K.length),K=K.replace(/\n+/g,`$&${B}`);let b=(T?B?"2":"1":"")+W;if($){if(b+=" "+Q($.replace(/ ?[\r\n]+/g," ")),Z)Z()}if(!F){let A=H.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${B}`),k=!1,n=u0(X,!0);if(z!=="folded"&&U!==I.BLOCK_FOLDED)n.onOverflow=()=>{k=!0};let O0=K0(`${K}${A}${R}`,B,m$,n);if(!k)return`>${b}
28
+ ${B}${O0}`}return H=H.replace(/\n+/g,`$&${B}`),`|${b}
29
+ ${B}${K}${H}${R}`}function P2($,U,H,X){let{type:Z,value:G}=$,{actualString:z,implicitKey:Q,indent:J,indentStep:B,inFlow:F}=U;if(Q&&G.includes(`
30
+ `)||F&&/[[\]{},]/.test(G))return q0(G,U);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(G))return Q||F||!G.includes(`
31
+ `)?q0(G,U):x0($,U,H,X);if(!Q&&!F&&Z!==I.PLAIN&&G.includes(`
32
+ `))return x0($,U,H,X);if(m0(G)){if(J==="")return U.forceBlockIndent=!0,x0($,U,H,X);else if(Q&&J===B)return q0(G,U)}let W=G.replace(/\n+/g,`$&
33
+ ${J}`);if(z){let V=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(W),{compat:R,tags:_}=U.doc.schema;if(_.some(V)||R?.some(V))return q0(G,U)}return Q?W:K0(W,J,W$,u0(U,!1))}function z0($,U,H,X){let{implicitKey:Z,inFlow:G}=U,z=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:Q}=$;if(Q!==I.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))Q=I.QUOTE_DOUBLE}let J=(F)=>{switch(F){case I.BLOCK_FOLDED:case I.BLOCK_LITERAL:return Z||G?q0(z.value,U):x0(z,U,H,X);case I.QUOTE_DOUBLE:return P0(z.value,U);case I.QUOTE_SINGLE:return T$(z.value,U);case I.PLAIN:return P2(z,U,H,X);default:return null}},B=J(Q);if(B===null){let{defaultKeyType:F,defaultStringType:W}=U.options,V=Z&&F||W;if(B=J(V),B===null)throw Error(`Unsupported default string type ${V}`)}return B}function v0($,U){let H=Object.assign({blockQuote:!0,commentString:x$,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,U),X;switch(H.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:$,flowCollectionPadding:H.flowCollectionPadding?" ":"",indent:"",indentStep:typeof H.indent==="number"?" ".repeat(H.indent):" ",inFlow:X,options:H}}function w2($,U){if(U.tag){let Z=$.filter((G)=>G.tag===U.tag);if(Z.length>0)return Z.find((G)=>G.format===U.format)??Z[0]}let H=void 0,X;if(O(U)){X=U.value;let Z=$.filter((G)=>G.identify?.(X));if(Z.length>1){let G=Z.filter((z)=>z.test);if(G.length>0)Z=G}H=Z.find((G)=>G.format===U.format)??Z.find((G)=>!G.format)}else X=U,H=$.find((Z)=>Z.nodeClass&&X instanceof Z.nodeClass);if(!H){let Z=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${Z} value`)}return H}function M2($,U,{anchors:H,doc:X}){if(!X.directives)return"";let Z=[],G=(O($)||P($))&&$.anchor;if(G&&y0(G))H.add(G),Z.push(`&${G}`);let z=$.tag??(U.default?null:U.tag);if(z)Z.push(X.directives.tagString(z));return Z.join(" ")}function t($,U,H,X){if(L($))return $.toString(U,H,X);if(u($)){if(U.doc.directives)return $.toString(U);if(U.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(U.resolvedAliases)U.resolvedAliases.add($);else U.resolvedAliases=new Set([$]);$=$.resolve(U.doc)}}let Z=void 0,G=D($)?$:U.doc.createNode($,{onTagObj:(J)=>Z=J});Z??(Z=w2(U.doc.schema.tags,G));let z=M2(G,Z,U);if(z.length>0)U.indentAtStart=(U.indentAtStart??0)+z.length+1;let Q=typeof Z.stringify==="function"?Z.stringify(G,U,H,X):O(G)?z0(G,U,H,X):G.toString(U,H,X);if(!z)return Q;return O(G)||Q[0]==="{"||Q[0]==="["?`${z} ${Q}`:`${z}
34
+ ${U.indent}${Q}`}function d$({key:$,value:U},H,X,Z){let{allNullValues:G,doc:z,indent:Q,indentStep:J,options:{commentString:B,indentSeq:F,simpleKeys:W}}=H,V=D($)&&$.comment||null;if(W){if(V)throw Error("With simple keys, key nodes cannot have comments");if(P($)||!D($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let R=!W&&(!$||V&&U==null&&!H.inFlow||P($)||(O($)?$.type===I.BLOCK_FOLDED||$.type===I.BLOCK_LITERAL:typeof $==="object"));H=Object.assign({},H,{allNullValues:!1,implicitKey:!R&&(W||!G),indent:Q+J});let _=!1,T=!1,Y=t($,H,()=>_=!0,()=>T=!0);if(!R&&!H.inFlow&&Y.length>1024){if(W)throw Error("With simple keys, single line scalar must not span more than 1024 characters");R=!0}if(H.inFlow){if(G||U==null){if(_&&X)X();return Y===""?"?":R?`? ${Y}`:Y}}else if(G&&!W||U==null&&R){if(Y=`? ${Y}`,V&&!_)Y+=a(Y,H.indent,B(V));else if(T&&Z)Z();return Y}if(_)V=null;if(R){if(V)Y+=a(Y,H.indent,B(V));Y=`? ${Y}
35
+ ${Q}:`}else if(Y=`${Y}:`,V)Y+=a(Y,H.indent,B(V));let w,K,M;if(D(U))w=!!U.spaceBefore,K=U.commentBefore,M=U.comment;else if(w=!1,K=null,M=null,U&&typeof U==="object")U=z.createNode(U);if(H.implicitKey=!1,!R&&!V&&O(U))H.indentAtStart=Y.length+1;if(T=!1,!F&&J.length>=2&&!H.inFlow&&!R&&d(U)&&!U.flow&&!U.tag&&!U.anchor)H.indent=H.indent.substring(2);let b=!1,A=t(U,H,()=>b=!0,()=>T=!0),k=" ";if(V||w||K){if(k=w?`
36
+ `:"",K){let n=B(K);k+=`
37
+ ${y(n,H.indent)}`}if(A===""&&!H.inFlow){if(k===`
38
+ `&&M)k=`
39
+
40
+ `}else k+=`
41
+ ${H.indent}`}else if(!R&&P(U)){let n=A[0],O0=A.indexOf(`
42
+ `),C$=O0!==-1,F2=H.inFlow??U.flow??U.items.length===0;if(C$||!F2){let E$=!1;if(C$&&(n==="&"||n==="!")){let H0=A.indexOf(" ");if(n==="&"&&H0!==-1&&H0<O0&&A[H0+1]==="!")H0=A.indexOf(" ",H0+1);if(H0===-1||O0<H0)E$=!0}if(!E$)k=`
43
+ ${H.indent}`}}else if(A===""||A[0]===`
44
+ `)k="";if(Y+=k+A,H.inFlow){if(b&&X)X()}else if(M&&!b)Y+=a(Y,H.indent,B(M));else if(T&&Z)Z();return Y}function q$($,U){if($==="debug"||$==="warn")console.warn(U)}var d0="<<",p={identify:($)=>$===d0||typeof $==="symbol"&&$.description===d0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new I(Symbol(d0)),{addToJSMap:I$}),stringify:()=>d0},p$=($,U)=>(p.identify(U)||O(U)&&(!U.type||U.type===I.PLAIN)&&p.identify(U.value))&&$?.doc.schema.tags.some((H)=>H.tag===p.tag&&H.default);function I$($,U,H){let X=l$($,H);if(d(X))for(let Z of X.items)Y$($,U,Z);else if(Array.isArray(X))for(let Z of X)Y$($,U,Z);else Y$($,U,X)}function Y$($,U,H){let X=l$($,H);if(!v(X))throw Error("Merge sources must be maps or map aliases");let Z=X.toJSON(null,$,Map);for(let[G,z]of Z)if(U instanceof Map){if(!U.has(G))U.set(G,z)}else if(U instanceof Set)U.add(G);else if(!Object.prototype.hasOwnProperty.call(U,G))Object.defineProperty(U,G,{value:z,writable:!0,enumerable:!0,configurable:!0});return U}function l$($,U){return $&&u(U)?U.resolve($.doc,$):U}function p0($,U,{key:H,value:X}){if(D(H)&&H.addToJSMap)H.addToJSMap($,U,X);else if(p$($,H))I$($,U,X);else{let Z=N(H,"",$);if(U instanceof Map)U.set(Z,N(X,Z,$));else if(U instanceof Set)U.add(Z);else{let G=b2(H,Z,$),z=N(X,G,$);if(G in U)Object.defineProperty(U,G,{value:z,writable:!0,enumerable:!0,configurable:!0});else U[G]=z}}return U}function b2($,U,H){if(U===null)return"";if(typeof U!=="object")return String(U);if(D($)&&H?.doc){let X=v0(H.doc,{});X.anchors=new Set;for(let G of H.anchors.keys())X.anchors.add(G.anchor);X.inFlow=!0,X.inStringifyKey=!0;let Z=$.toString(X);if(!H.mapKeyWarned){let G=JSON.stringify(Z);if(G.length>40)G=G.substring(0,36)+'..."';q$(H.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${G}. Set mapAsMap: true to use object keys.`),H.mapKeyWarned=!0}return Z}return JSON.stringify(U)}function Y0($,U,H){let X=o($,void 0,H),Z=o(U,void 0,H);return new j(X,Z)}class j{constructor($,U=null){Object.defineProperty(this,g,{value:J$}),this.key=$,this.value=U}clone($){let{key:U,value:H}=this;if(D(U))U=U.clone($);if(D(H))H=H.clone($);return new j(U,H)}toJSON($,U){let H=U?.mapAsMap?new Map:{};return p0(U,H,this)}toString($,U,H){return $?.doc?d$(this,$,U,H):JSON.stringify(this)}}function i0($,U,H){return(U.inFlow??$.flow?N2:A2)($,U,H)}function A2({comment:$,items:U},H,{blockItemPrefix:X,flowChars:Z,itemIndent:G,onChompKeep:z,onComment:Q}){let{indent:J,options:{commentString:B}}=H,F=Object.assign({},H,{indent:G,type:null}),W=!1,V=[];for(let _=0;_<U.length;++_){let T=U[_],Y=null;if(D(T)){if(!W&&T.spaceBefore)V.push("");if(l0(H,V,T.commentBefore,W),T.comment)Y=T.comment}else if(L(T)){let K=D(T.key)?T.key:null;if(K){if(!W&&K.spaceBefore)V.push("");l0(H,V,K.commentBefore,W)}}W=!1;let w=t(T,F,()=>Y=null,()=>W=!0);if(Y)w+=a(w,G,B(Y));if(W&&Y)W=!1;V.push(X+w)}let R;if(V.length===0)R=Z.start+Z.end;else{R=V[0];for(let _=1;_<V.length;++_){let T=V[_];R+=T?`
45
+ ${J}${T}`:`
46
+ `}}if($){if(R+=`
47
+ `+y(B($),J),Q)Q()}else if(W&&z)z();return R}function N2({items:$},U,{flowChars:H,itemIndent:X}){let{indent:Z,indentStep:G,flowCollectionPadding:z,options:{commentString:Q}}=U;X+=G;let J=Object.assign({},U,{indent:X,inFlow:!0,type:null}),B=!1,F=0,W=[];for(let _=0;_<$.length;++_){let T=$[_],Y=null;if(D(T)){if(T.spaceBefore)W.push("");if(l0(U,W,T.commentBefore,!1),T.comment)Y=T.comment}else if(L(T)){let K=D(T.key)?T.key:null;if(K){if(K.spaceBefore)W.push("");if(l0(U,W,K.commentBefore,!1),K.comment)B=!0}let M=D(T.value)?T.value:null;if(M){if(M.comment)Y=M.comment;if(M.commentBefore)B=!0}else if(T.value==null&&K?.comment)Y=K.comment}if(Y)B=!0;let w=t(T,J,()=>Y=null);if(B||(B=W.length>F||w.includes(`
48
+ `)),_<$.length-1)w+=",";else if(U.options.trailingComma){if(U.options.lineWidth>0)B||(B=W.reduce((K,M)=>K+M.length+2,2)+(w.length+2)>U.options.lineWidth);if(B)w+=","}if(Y)w+=a(w,X,Q(Y));W.push(w),F=W.length}let{start:V,end:R}=H;if(W.length===0)return V+R;else{if(!B){let _=W.reduce((T,Y)=>T+Y.length+2,2);B=U.options.lineWidth>0&&_>U.options.lineWidth}if(B){let _=V;for(let T of W)_+=T?`
49
+ ${G}${Z}${T}`:`
50
+ `;return`${_}
51
+ ${Z}${R}`}else return`${V}${z}${W.join(" ")}${z}${R}`}}function l0({indent:$,options:{commentString:U}},H,X,Z){if(X&&Z)X=X.replace(/^\n+/,"");if(X){let G=y(U(X),$);H.push(G.trimStart())}}function $0($,U){let H=O(U)?U.value:U;for(let X of $)if(L(X)){if(X.key===U||X.key===H)return X;if(O(X.key)&&X.key.value===H)return X}return}class C extends D0{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(x,$);this.items=[]}static from($,U,H){let{keepUndefined:X,replacer:Z}=H,G=new this($),z=(Q,J)=>{if(typeof Z==="function")J=Z.call(U,Q,J);else if(Array.isArray(Z)&&!Z.includes(Q))return;if(J!==void 0||X)G.items.push(Y0(Q,J,H))};if(U instanceof Map)for(let[Q,J]of U)z(Q,J);else if(U&&typeof U==="object")for(let Q of Object.keys(U))z(Q,U[Q]);if(typeof $.sortMapEntries==="function")G.items.sort($.sortMapEntries);return G}add($,U){let H;if(L($))H=$;else if(!$||typeof $!=="object"||!("key"in $))H=new j($,$?.value);else H=new j($.key,$.value);let X=$0(this.items,H.key),Z=this.schema?.sortMapEntries;if(X){if(!U)throw Error(`Key ${H.key} already set`);if(O(X.value)&&k0(H.value))X.value.value=H.value;else X.value=H.value}else if(Z){let G=this.items.findIndex((z)=>Z(H,z)<0);if(G===-1)this.items.push(H);else this.items.splice(G,0,H)}else this.items.push(H)}delete($){let U=$0(this.items,$);if(!U)return!1;return this.items.splice(this.items.indexOf(U),1).length>0}get($,U){let X=$0(this.items,$)?.value;return(!U&&O(X)?X.value:X)??void 0}has($){return!!$0(this.items,$)}set($,U){this.add(new j($,U),!0)}toJSON($,U,H){let X=H?new H:U?.mapAsMap?new Map:{};if(U?.onCreate)U.onCreate(X);for(let Z of this.items)p0(U,X,Z);return X}toString($,U,H){if(!$)return JSON.stringify(this);for(let X of this.items)if(!L(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return i0(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:H,onComment:U})}}var l={collection:"map",default:!0,nodeClass:C,tag:"tag:yaml.org,2002:map",resolve($,U){if(!v($))U("Expected a mapping for this tag");return $},createNode:($,U,H)=>C.from($,U,H)};class h extends D0{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(r,$);this.items=[]}add($){this.items.push($)}delete($){let U=c0($);if(typeof U!=="number")return!1;return this.items.splice(U,1).length>0}get($,U){let H=c0($);if(typeof H!=="number")return;let X=this.items[H];return!U&&O(X)?X.value:X}has($){let U=c0($);return typeof U==="number"&&U<this.items.length}set($,U){let H=c0($);if(typeof H!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[H];if(O(X)&&k0(U))X.value=U;else this.items[H]=U}toJSON($,U){let H=[];if(U?.onCreate)U.onCreate(H);let X=0;for(let Z of this.items)H.push(N(Z,String(X++),U));return H}toString($,U,H){if(!$)return JSON.stringify(this);return i0(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:H,onComment:U})}static from($,U,H){let{replacer:X}=H,Z=new this($);if(U&&Symbol.iterator in Object(U)){let G=0;for(let z of U){if(typeof X==="function"){let Q=U instanceof Set?z:String(G++);z=X.call(U,Q,z)}Z.items.push(o(z,void 0,H))}}return Z}}function c0($){let U=O($)?$.value:$;if(U&&typeof U==="string")U=Number(U);return typeof U==="number"&&Number.isInteger(U)&&U>=0?U:null}var i={collection:"seq",default:!0,nodeClass:h,tag:"tag:yaml.org,2002:seq",resolve($,U){if(!d($))U("Expected a sequence for this tag");return $},createNode:($,U,H)=>h.from($,U,H)};var U0={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,U,H,X){return U=Object.assign({actualString:!0},U),z0($,U,H,X)}};var J0={identify:($)=>$==null,createNode:()=>new I(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new I(null),stringify:({source:$},U)=>typeof $==="string"&&J0.test.test($)?$:U.options.nullStr};var w0={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new I($[0]==="t"||$[0]==="T"),stringify({source:$,value:U},H){if($&&w0.test.test($)){let X=$[0]==="t"||$[0]==="T";if(U===X)return $}return U?H.options.trueStr:H.options.falseStr}};function E({format:$,minFractionDigits:U,tag:H,value:X}){if(typeof X==="bigint")return String(X);let Z=typeof X==="number"?X:Number(X);if(!isFinite(Z))return isNaN(Z)?".nan":Z<0?"-.inf":".inf";let G=Object.is(X,-0)?"-0":JSON.stringify(X);if(!$&&U&&(!H||H==="tag:yaml.org,2002:float")&&/^-?\d/.test(G)&&!G.includes("e")){let z=G.indexOf(".");if(z<0)z=G.length,G+=".";let Q=U-(G.length-z-1);while(Q-- >0)G+="0"}return G}var s0={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E},a0={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let U=Number($.value);return isFinite(U)?U.toExponential():E($)}},n0={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let U=new I(parseFloat($)),H=$.indexOf(".");if(H!==-1&&$[$.length-1]==="0")U.minFractionDigits=$.length-H-1;return U},stringify:E};var r0=($)=>typeof $==="bigint"||Number.isInteger($),R$=($,U,H,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(U),H);function i$($,U,H){let{value:X}=$;if(r0(X)&&X>=0)return H+X.toString(U);return E($)}var o0={identify:($)=>r0($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,U,H)=>R$($,2,8,H),stringify:($)=>i$($,8,"0o")},t0={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,U,H)=>R$($,0,10,H),stringify:E},e0={identify:($)=>r0($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,U,H)=>R$($,2,16,H),stringify:($)=>i$($,16,"0x")};var c$=[l,i,U0,J0,w0,o0,t0,e0,s0,a0,n0];function s$($){return typeof $==="bigint"||Number.isInteger($)}var $$=({value:$})=>JSON.stringify($),j2=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:$$},{identify:($)=>$==null,createNode:()=>new I(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:$$},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:$$},{identify:s$,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,U,{intAsBigInt:H})=>H?BigInt($):parseInt($,10),stringify:({value:$})=>s$($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:$$}],S2={default:!0,tag:"",test:/^/,resolve($,U){return U(`Unresolved plain scalar ${JSON.stringify($)}`),$}},a$=[l,i].concat(j2,S2);var M0={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,U){if(typeof atob==="function"){let H=atob($.replace(/[\n\r]/g,"")),X=new Uint8Array(H.length);for(let Z=0;Z<H.length;++Z)X[Z]=H.charCodeAt(Z);return X}else return U("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:U,value:H},X,Z,G){if(!H)return"";let z=H,Q;if(typeof btoa==="function"){let J="";for(let B=0;B<z.length;++B)J+=String.fromCharCode(z[B]);Q=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(U??(U=I.BLOCK_LITERAL),U!==I.QUOTE_DOUBLE){let J=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),B=Math.ceil(Q.length/J),F=Array(B);for(let W=0,V=0;W<B;++W,V+=J)F[W]=Q.substr(V,J);Q=F.join(U===I.BLOCK_LITERAL?`
52
+ `:" ")}return z0({comment:$,type:U,value:Q},X,Z,G)}};function F$($,U){if(d($))for(let H=0;H<$.items.length;++H){let X=$.items[H];if(L(X))continue;else if(v(X)){if(X.items.length>1)U("Each pair must have its own sequence indicator");let Z=X.items[0]||new j(new I(null));if(X.commentBefore)Z.key.commentBefore=Z.key.commentBefore?`${X.commentBefore}
53
+ ${Z.key.commentBefore}`:X.commentBefore;if(X.comment){let G=Z.value??Z.key;G.comment=G.comment?`${X.comment}
54
+ ${G.comment}`:X.comment}X=Z}$.items[H]=L(X)?X:new j(X)}else U("Expected a sequence for this tag");return $}function _$($,U,H){let{replacer:X}=H,Z=new h($);Z.tag="tag:yaml.org,2002:pairs";let G=0;if(U&&Symbol.iterator in Object(U))for(let z of U){if(typeof X==="function")z=X.call(U,String(G++),z);let Q,J;if(Array.isArray(z))if(z.length===2)Q=z[0],J=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let B=Object.keys(z);if(B.length===1)Q=B[0],J=z[Q];else throw TypeError(`Expected tuple with one key, not ${B.length} keys`)}else Q=z;Z.items.push(Y0(Q,J,H))}return Z}var b0={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:F$,createNode:_$};class I0 extends h{constructor(){super();this.add=C.prototype.add.bind(this),this.delete=C.prototype.delete.bind(this),this.get=C.prototype.get.bind(this),this.has=C.prototype.has.bind(this),this.set=C.prototype.set.bind(this),this.tag=I0.tag}toJSON($,U){if(!U)return super.toJSON($);let H=new Map;if(U?.onCreate)U.onCreate(H);for(let X of this.items){let Z,G;if(L(X))Z=N(X.key,"",U),G=N(X.value,Z,U);else Z=N(X,"",U);if(H.has(Z))throw Error("Ordered maps must not include duplicate keys");H.set(Z,G)}return H}static from($,U,H){let X=_$($,U,H),Z=new this;return Z.items=X.items,Z}}I0.tag="tag:yaml.org,2002:omap";var A0={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:I0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,U){let H=F$($,U),X=[];for(let{key:Z}of H.items)if(O(Z))if(X.includes(Z.value))U(`Ordered maps must not include duplicate keys: ${Z.value}`);else X.push(Z.value);return Object.assign(new I0,H)},createNode:($,U,H)=>I0.from($,U,H)};function n$({value:$,source:U},H){if(U&&($?O$:L$).test.test(U))return U;return $?H.options.trueStr:H.options.falseStr}var O$={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new I(!0),stringify:n$},L$={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new I(!1),stringify:n$};var r$={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:E},o$={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let U=Number($.value);return isFinite(U)?U.toExponential():E($)}},t$={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let U=new I(parseFloat($.replace(/_/g,""))),H=$.indexOf(".");if(H!==-1){let X=$.substring(H+1).replace(/_/g,"");if(X[X.length-1]==="0")U.minFractionDigits=X.length}return U},stringify:E};var N0=($)=>typeof $==="bigint"||Number.isInteger($);function U$($,U,H,{intAsBigInt:X}){let Z=$[0];if(Z==="-"||Z==="+")U+=1;if($=$.substring(U).replace(/_/g,""),X){switch(H){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let z=BigInt($);return Z==="-"?BigInt(-1)*z:z}let G=parseInt($,H);return Z==="-"?-1*G:G}function D$($,U,H){let{value:X}=$;if(N0(X)){let Z=X.toString(U);return X<0?"-"+H+Z.substr(1):H+Z}return E($)}var e$={identify:N0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,U,H)=>U$($,2,2,H),stringify:($)=>D$($,2,"0b")},$2={identify:N0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,U,H)=>U$($,1,8,H),stringify:($)=>D$($,8,"0")},U2={identify:N0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,U,H)=>U$($,0,10,H),stringify:E},H2={identify:N0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,U,H)=>U$($,2,16,H),stringify:($)=>D$($,16,"0x")};class R0 extends C{constructor($){super($);this.tag=R0.tag}add($){let U;if(L($))U=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)U=new j($.key,null);else U=new j($,null);if(!$0(this.items,U.key))this.items.push(U)}get($,U){let H=$0(this.items,$);return!U&&L(H)?O(H.key)?H.key.value:H.key:H}set($,U){if(typeof U!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof U}`);let H=$0(this.items,$);if(H&&!U)this.items.splice(this.items.indexOf(H),1);else if(!H&&U)this.items.push(new j($))}toJSON($,U){return super.toJSON($,U,Set)}toString($,U,H){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),U,H);else throw Error("Set items must all have null values")}static from($,U,H){let{replacer:X}=H,Z=new this($);if(U&&Symbol.iterator in Object(U))for(let G of U){if(typeof X==="function")G=X.call(U,G,G);Z.items.push(Y0(G,null,H))}return Z}}R0.tag="tag:yaml.org,2002:set";var j0={collection:"map",identify:($)=>$ instanceof Set,nodeClass:R0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,U,H)=>R0.from($,U,H),resolve($,U){if(v($))if($.hasAllNullValues(!0))return Object.assign(new R0,$);else U("Set items must all have null values");else U("Expected a mapping for this tag");return $}};function K$($,U){let H=$[0],X=H==="-"||H==="+"?$.substring(1):$,Z=(z)=>U?BigInt(z):Number(z),G=X.replace(/_/g,"").split(":").reduce((z,Q)=>z*Z(60)+Z(Q),Z(0));return H==="-"?Z(-1)*G:G}function X2($){let{value:U}=$,H=(z)=>z;if(typeof U==="bigint")H=(z)=>BigInt(z);else if(isNaN(U)||!isFinite(U))return E($);let X="";if(U<0)X="-",U*=H(-1);let Z=H(60),G=[U%Z];if(U<60)G.unshift(0);else if(U=(U-G[0])/Z,G.unshift(U%Z),U>=60)U=(U-G[0])/Z,G.unshift(U);return X+G.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var H$={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,U,{intAsBigInt:H})=>K$($,H),stringify:X2},X$={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>K$($,!1),stringify:X2},F0={identify:($)=>$ 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($){let U=$.match(F0.test);if(!U)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,H,X,Z,G,z,Q]=U.map(Number),J=U[7]?Number((U[7]+"00").substr(1,3)):0,B=Date.UTC(H,X-1,Z,G||0,z||0,Q||0,J),F=U[8];if(F&&F!=="Z"){let W=K$(F,!1);if(Math.abs(W)<30)W*=60;B-=60000*W}return new Date(B)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var P$=[l,i,U0,J0,O$,L$,e$,$2,U2,H2,r$,o$,t$,M0,p,A0,b0,j0,H$,X$,F0];var Z2=new Map([["core",c$],["failsafe",[l,i,U0]],["json",a$],["yaml11",P$],["yaml-1.1",P$]]),G2={binary:M0,bool:w0,float:n0,floatExp:a0,floatNaN:s0,floatTime:X$,int:t0,intHex:e0,intOct:o0,intTime:H$,map:l,merge:p,null:J0,omap:A0,pairs:b0,seq:i,set:j0,timestamp:F0},z2={"tag:yaml.org,2002:binary":M0,"tag:yaml.org,2002:merge":p,"tag:yaml.org,2002:omap":A0,"tag:yaml.org,2002:pairs":b0,"tag:yaml.org,2002:set":j0,"tag:yaml.org,2002:timestamp":F0};function Z$($,U,H){let X=Z2.get(U);if(X&&!$)return H&&!X.includes(p)?X.concat(p):X.slice();let Z=X;if(!Z)if(Array.isArray($))Z=[];else{let G=Array.from(Z2.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${U}"; use one of ${G} or define customTags array`)}if(Array.isArray($))for(let G of $)Z=Z.concat(G);else if(typeof $==="function")Z=$(Z.slice());if(H)Z=Z.concat(p);return Z.reduce((G,z)=>{let Q=typeof z==="string"?G2[z]:z;if(!Q){let J=JSON.stringify(z),B=Object.keys(G2).map((F)=>JSON.stringify(F)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${B}`)}if(!G.includes(Q))G.push(Q);return G},[])}var C2=($,U)=>$.key<U.key?-1:$.key>U.key?1:0;class S0{constructor({compat:$,customTags:U,merge:H,resolveKnownTags:X,schema:Z,sortMapEntries:G,toStringDefaults:z}){this.compat=Array.isArray($)?Z$($,"compat"):$?Z$(null,$):null,this.name=typeof Z==="string"&&Z||"core",this.knownTags=X?z2:{},this.tags=Z$(U,this.name,H),this.toStringOptions=z??null,Object.defineProperty(this,x,{value:l}),Object.defineProperty(this,X0,{value:U0}),Object.defineProperty(this,r,{value:i}),this.sortMapEntries=typeof G==="function"?G:G===!0?C2:null}clone(){let $=Object.create(S0.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}function J2($,U){let H=[],X=U.directives===!0;if(U.directives!==!1&&$.directives){let J=$.directives.toString($);if(J)H.push(J),X=!0;else if($.directives.docStart)X=!0}if(X)H.push("---");let Z=v0($,U),{commentString:G}=Z.options;if($.commentBefore){if(H.length!==1)H.unshift("");let J=G($.commentBefore);H.unshift(y(J,""))}let z=!1,Q=null;if($.contents){if(D($.contents)){if($.contents.spaceBefore&&X)H.push("");if($.contents.commentBefore){let F=G($.contents.commentBefore);H.push(y(F,""))}Z.forceBlockIndent=!!$.comment,Q=$.contents.comment}let J=Q?void 0:()=>z=!0,B=t($.contents,Z,()=>Q=null,J);if(Q)B+=a(B,"",G(Q));if((B[0]==="|"||B[0]===">")&&H[H.length-1]==="---")H[H.length-1]=`--- ${B}`;else H.push(B)}else H.push(t($.contents,Z));if($.directives?.docEnd)if($.comment){let J=G($.comment);if(J.includes(`
55
+ `))H.push("..."),H.push(y(J,""));else H.push(`... ${J}`)}else H.push("...");else{let J=$.comment;if(J&&z)J=J.replace(/^\n+/,"");if(J){if((!z||Q)&&H[H.length-1]!=="")H.push("");H.push(y(G(J),""))}}return H.join(`
56
+ `)+`
57
+ `}class Q0{constructor($,U,H){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g,{value:E0});let X=null;if(typeof U==="function"||Array.isArray(U))X=U;else if(H===void 0&&U)H=U,U=void 0;let Z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},H);this.options=Z;let{version:G}=Z;if(H?._directives){if(this.directives=H._directives.atDocument(),this.directives.yaml.explicit)G=this.directives.yaml.version}else this.directives=new S({version:G});this.setSchema(G,H),this.contents=$===void 0?null:this.createNode($,X,H)}clone(){let $=Object.create(Q0.prototype,{[g]:{value:E0}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=D(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(_0(this.contents))this.contents.add($)}addIn($,U){if(_0(this.contents))this.contents.addIn($,U)}createAlias($,U){if(!$.anchor){let H=Q$(this);$.anchor=!U||H.has(U)?B$(U||"a",H):U}return new G0($.anchor)}createNode($,U,H){let X=void 0;if(typeof U==="function")$=U.call({"":$},"",$),X=U;else if(Array.isArray(U)){let T=(w)=>typeof w==="number"||w instanceof String||w instanceof Number,Y=U.filter(T).map(String);if(Y.length>0)U=U.concat(Y);X=U}else if(H===void 0&&U)H=U,U=void 0;let{aliasDuplicateObjects:Z,anchorPrefix:G,flow:z,keepUndefined:Q,onTagObj:J,tag:B}=H??{},{onAnchor:F,setAnchors:W,sourceObjects:V}=k$(this,G||"a"),R={aliasDuplicateObjects:Z??!0,keepUndefined:Q??!1,onAnchor:F,onTagObj:J,replacer:X,schema:this.schema,sourceObjects:V},_=o($,B,R);if(z&&P(_))_.flow=!0;return W(),_}createPair($,U,H={}){let X=this.createNode($,null,H),Z=this.createNode(U,null,H);return new j(X,Z)}delete($){return _0(this.contents)?this.contents.delete($):!1}deleteIn($){if(V0($)){if(this.contents==null)return!1;return this.contents=null,!0}return _0(this.contents)?this.contents.deleteIn($):!1}get($,U){return P(this.contents)?this.contents.get($,U):void 0}getIn($,U){if(V0($))return!U&&O(this.contents)?this.contents.value:this.contents;return P(this.contents)?this.contents.getIn($,U):void 0}has($){return P(this.contents)?this.contents.has($):!1}hasIn($){if(V0($))return this.contents!==void 0;return P(this.contents)?this.contents.hasIn($):!1}set($,U){if(this.contents==null)this.contents=L0(this.schema,[$],U);else if(_0(this.contents))this.contents.set($,U)}setIn($,U){if(V0($))this.contents=U;else if(this.contents==null)this.contents=L0(this.schema,Array.from($),U);else if(_0(this.contents))this.contents.setIn($,U)}setSchema($,U={}){if(typeof $==="number")$=String($);let H;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new S({version:"1.1"});H={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new S({version:$});H={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;H=null;break;default:{let X=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if(U.schema instanceof Object)this.schema=U.schema;else if(H)this.schema=new S0(Object.assign(H,U));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:U,mapAsMap:H,maxAliasCount:X,onAnchor:Z,reviver:G}={}){let z={anchors:new Map,doc:this,keep:!$,mapAsMap:H===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},Q=N(this.contents,U??"",z);if(typeof Z==="function")for(let{count:J,res:B}of z.anchors.values())Z(B,J);return typeof G==="function"?e(G,{"":Q},"",Q):Q}toJSON($,U){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:U})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let U=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${U}`)}return J2(this,$)}}function _0($){if(P($))return!0;throw Error("Expected a YAML collection as document contents")}var b$=Symbol("break visit"),k2=Symbol("skip children"),B2=Symbol("remove item");function B0($,U){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};W2(Object.freeze([]),$,U)}B0.BREAK=b$;B0.SKIP=k2;B0.REMOVE=B2;B0.itemAtPath=($,U)=>{let H=$;for(let[X,Z]of U){let G=H?.[X];if(G&&"items"in G)H=G.items[Z];else return}return H};B0.parentCollection=($,U)=>{let H=B0.itemAtPath($,U.slice(0,-1)),X=U[U.length-1][0],Z=H?.[X];if(Z&&"items"in Z)return Z;throw Error("Parent collection not found")};function W2($,U,H){let X=H(U,$);if(typeof X==="symbol")return X;for(let Z of["key","value"]){let G=U[Z];if(G&&"items"in G){for(let z=0;z<G.items.length;++z){let Q=W2(Object.freeze($.concat([[Z,z]])),G.items[z],H);if(typeof Q==="number")z=Q-1;else if(Q===b$)return b$;else if(Q===B2)G.items.splice(z,1),z-=1}if(typeof X==="function"&&Z==="key")X=X(U,$)}}return typeof X==="function"?X(U,$):X}var E8=new Set("0123456789ABCDEFabcdef"),g8=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),f8=new Set(",[]{}"),y8=new Set(` ,[]{}
58
+ \r `);function A$($,U,H){let X=null;if(typeof U==="function"||Array.isArray(U))X=U;else if(H===void 0&&U)H=U;if(typeof H==="string")H=H.length;if(typeof H==="number"){let Z=Math.round(H);H=Z<1?void 0:Z>8?{indent:8}:{indent:Z}}if($===void 0){let{keepUndefined:Z}=H??U??{};if(!Z)return}if(m($)&&!X)return $.toString(H);return new Q0($,X,H).toString(H)}var l2="JSONRPC",V2="1.0",q2=["application/vnd.faf+yaml","application/vnd.fafm+yaml","application/vnd.fafa+yaml"],i2="https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",c2="https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",s2="1.0",a2="1.0",N$={a2a:"application/a2a-agent-card+json",server_card:"application/mcp-server-card+json",fafa:"application/vnd.fafa+yaml"};function n2($){return($.endpoints??[]).filter((U)=>String(U.protocol??"").toLowerCase()==="a2a"&&U.location)}function r2($,U={}){let H=n2($);if(H.length>0)return H;let X=U.doorUrl?.trim();if(X)return[{protocol:"a2a",location:X,version:V2}];return[]}function o2($){let U=new Set;for(let H of $.capabilities??[])if(H.cites_spec&&q2.includes(H.cites_spec))U.add(H.cites_spec);return["text/plain",...U]}function t2($,U={}){let H=$.agent??{},X=r2($,U);if(X.length===0)throw Error("No A2A endpoint in .fafa (need endpoints[].protocol: a2a + location). Will not invent a door.");let Z=String(H.displayName??$.metadata?.persona??H.name??"").trim(),G=String(H.description??"").trim(),z=String(H.version??"").trim();if(!Z||!G||!z)throw Error("A2A card needs agent.displayName|name, description, version in .fafa");let Q=String(H.vendor??"").trim(),J=String(H.homepage??"").trim(),B=Q&&J?{organization:Q,url:J}:void 0,F=($.capabilities??[]).map((W)=>{let V=String(W.name??"").trim();if(!V)throw Error("A2A skill missing capabilities[].name");let R=Array.isArray(W.tags)?W.tags.map(String):[],_=W.cites_spec&&q2.includes(W.cites_spec)?[W.cites_spec,"text/plain"]:void 0;return{id:V,name:V,description:String(W.description??"").trim()||V,tags:R,..._?{inputModes:_}:{}}});return{name:Z,description:G,supportedInterfaces:X.map((W)=>({url:String(W.location),protocolBinding:l2,protocolVersion:String(W.version??V2)})),...B?{provider:B}:{},version:z,capabilities:{streaming:!1,pushNotifications:!1,extendedAgentCard:!1,extensions:[...U.extensions??[]]},defaultInputModes:o2($),defaultOutputModes:["text/plain","application/json"],skills:F}}var e2=/^[a-z0-9][a-z0-9._-]*$/,$9=/^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/;function q($){return String($??"").trim()}function z$($){return Array.isArray($)?$.map(q).filter(Boolean):[]}function U9($){return q($).toLowerCase().replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/^www\./,"")}function H9($,U,H){let X=["display_name","description","version"].filter((Z)=>!q($[Z]));if(X.length)throw Error(`Missing answer: ${X.join(", ")}`);if(!e2.test(U))throw Error("Short name: lowercase letters, digits, dots, hyphens or underscores.");if(!$9.test(H))throw Error(`Domain "${$.domain}" is not a domain name (e.g. example.com).`)}function X9($,U){return($.skills??[]).filter((H)=>q(H.name)).map((H)=>({name:q(H.name),type:q(H.type)||"tool",description:q(H.description)||q(H.name),tags:U.length?U:[q(H.name).toLowerCase()]}))}function Z9($){return($.packages??[]).filter((U)=>q(U.registryType)&&q(U.identifier)).map((U)=>({registryType:q(U.registryType),identifier:q(U.identifier),...q(U.version)?{version:q(U.version)}:{}}))}function G9($,U){let H=[...($.endpoints??[]).filter((X)=>q(X.url)).map((X)=>({protocol:q(X.protocol).toLowerCase(),transport:"http",location:q(X.url)})),...U.map((X)=>({protocol:"mcp",transport:"stdio",location:X.identifier}))];if(H.length===0)throw Error("Missing answer: endpoints (a URL, or a package people install)");return H}function z9($,U,H,X){let Z={domain:U},G=[["repository",q($.repository)],["icon",q($.icon)],["organizationUrl",q($.organization_url)]];for(let[Q,J]of G)if(J)Z[Q]=J;if(H.length)Z.keywords=H;let z=z$($.example_requests);if(z.length)Z.examples=z;if(X.length)Z.packages=X;return Z}function J9($){let U=q($.handle).toLowerCase(),H=U9($.domain);H9($,U,H);let X=z$($.tags),Z=Z9($),G={name:U,displayName:q($.display_name),id:`urn:air:${H}:agent:${U}`,...q($.organization)?{vendor:q($.organization)}:{},version:q($.version),description:q($.description),homepage:q($.homepage)||`https://${H}`,...q($.license)?{license:q($.license)}:{}};return{version:a2,agent:G,capabilities:X9($,X),endpoints:G9($,Z),metadata:{cards:z9($,H,X,Z)}}}function Q9($){return A$($,{lineWidth:0})}function j$($){let U=q($.agent?.id),H=/^urn:air:([^:]+):/.exec(U);if(H)return H[1];let X=q($.metadata?.cards?.domain);if(X)return X;try{return new URL(q($.agent?.homepage)).hostname.replace(/^www\./,"")}catch{throw Error("The .fafa names no domain (agent.id urn:air, metadata.cards.domain or agent.homepage).")}}function Y2($){let U=q($.agent?.name).toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/^-+|-+$/g,"");if(!U)throw Error("The .fafa needs agent.name (the short name).");return U}function B9($){return`${j$($).split(".").reverse().join(".")}/${Y2($)}`}function T2($){let U=$.replace(/\s+/g," ").trim();return U.length<=100?U:`${U.slice(0,97).trimEnd()}...`}function S$($){return($.endpoints??[]).filter((U)=>q(U.protocol).toLowerCase()==="mcp"&&/^https?:\/\//.test(q(U.location))).map((U)=>({type:"streamable-http",url:q(U.location)}))}function W9($){if(!$)return;try{let U=new URL($).hostname.replace(/^www\./,"");return{url:$,source:U.split(".")[0]}}catch{return}}function I2($){let U=$.agent??{},H=$.metadata?.cards??{},X=q(U.description),Z=q(U.version);if(!X||!Z)throw Error("An MCP card needs agent.description and agent.version in .fafa");let G={name:B9($),version:Z,description:T2(X)},z=q(U.displayName);if(z)G.title=T2(z);let Q=q(U.homepage);if(Q)G.websiteUrl=Q;let J=W9(q(H.repository));if(J)G.repository=J;if(q(H.icon))G.icons=[{src:q(H.icon)}];return G}function T9($){let U=S$($);if(U.length===0)throw Error("A Server Card describes a remote MCP server: the .fafa has no mcp endpoint at an http(s) URL.");return{$schema:i2,...I2($),remotes:U}}function V9($){let U=S$($),H=($.metadata?.cards?.packages??[]).map((X)=>({registryType:q(X.registryType),identifier:q(X.identifier),...q(X.version)?{version:q(X.version)}:{},transport:{type:"stdio"}}));if(U.length===0&&H.length===0)throw Error("A registry entry needs a package people install or a remote MCP URL.");return{$schema:c2,...I2($),...H.length?{packages:H}:{},...U.length?{remotes:U}:{}}}function R2($,U,H={}){let X=j$($),Z=Y2($),G=$.agent??{},z=q(G.displayName)||q(G.name),Q=q(G.description),J=q(G.version),B=H.now??new Date().toISOString(),F=(V,R,_)=>({identifier:`urn:air:${X}:${V}:${Z}`,displayName:z,type:R,description:Q,url:_,...J?{version:J}:{},updatedAt:B}),W=[];if(U.includes("a2a"))W.push(F("a2a",N$.a2a,`https://${X}/.well-known/agent-card.json`));if(U.includes("server_card")){let V=S$($)[0];if(V)W.push(F("mcp",N$.server_card,`${V.url.replace(/\/+$/,"")}/server-card`))}if(H.listFafa)W.push(F("agent",N$.fafa,`https://${X}/.well-known/fafa`));return W}function q9($,U,H={}){let X=$.agent??{},Z=q(X.vendor)||q(X.displayName)||q(X.name);return{specVersion:s2,host:{displayName:Z,identifier:j$($)},entries:R2($,U,H)}}function Y9($,U,H={}){let X=$.metadata?.cards??{},Z=z$(X.keywords),G=z$(X.examples);return{entries:R2($,U,H).map((z)=>({...z,...Z.length?{tags:Z}:{},...G.length?{representativeQueries:G}:{}}))}}function I9($,U){let H=new Set(U.cards),X={fafa:$,fafaText:Q9($)};if(H.has("a2a"))X.a2a=t2($,{extensions:U.a2aExtensions});if(H.has("server_card"))X.server_card=T9($);if(H.has("server_json"))X.server_json=V9($);let Z={now:U.now,listFafa:U.listFafa};if(H.has("ai_catalog"))X.ai_catalog=q9($,U.cards,Z);if(H.has("ard"))X.ard=Y9($,U.cards,Z);return X}function OZ($,U){return I9(J9($),U)}export{V9 as projectServerJson,T9 as projectServerCard,I9 as projectPack,Y9 as projectArd,q9 as projectAiCatalog,t2 as projectA2ACard,B9 as mcpName,Q9 as fafaYaml,j$ as fafaDomain,R2 as catalogRows,OZ as buildPack,J9 as answersToFafa,n2 as a2aEndpoints,r2 as a2aDoors,c2 as SERVER_JSON_SCHEMA,i2 as SERVER_CARD_SCHEMA,q2 as FAF_MEDIA_TYPES,a2 as FAFA_SPEC_VERSION,N$ as CARD_MEDIA_TYPES,s2 as AI_CATALOG_SPEC_VERSION,V2 as A2A_PROTOCOL_VERSION,l2 as A2A_PROTOCOL_BINDING};
59
+
60
+ //# debugId=BB416E8FB185B27864756E2164756E21
61
+ //# sourceMappingURL=pack.js.map