@kilocode/cli-darwin-arm64 7.5.16 → 7.6.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.
- package/bin/console/assets/AgentsRoute-CM6fw2cq.js +3 -0
- package/bin/console/assets/CliNotificationsRoute-BczmRSyg.js +1 -0
- package/bin/console/assets/CliUiRoute-CY-IjU1R.js +1 -0
- package/bin/console/assets/ConfigLayout-BnoOuJ0J.js +1 -0
- package/bin/console/assets/ConfigLayout-DjHPFaCq.css +1 -0
- package/bin/console/assets/ConfigPage-CF46-J2f.js +1 -0
- package/bin/console/assets/ConfirmDialog-BxeZcJR2.js +1 -0
- package/bin/console/assets/ConsoleUiRoute-BrZ2QFr6.js +1 -0
- package/bin/console/assets/CustomSelect-Bv8ga_sb.js +1 -0
- package/bin/console/assets/FormattersRoute-5K8HEXB2.css +1 -0
- package/bin/console/assets/FormattersRoute-CuG-ehXq.js +3 -0
- package/bin/console/assets/GhosttyTerminal-DOfViera.js +13 -0
- package/bin/console/assets/IndexingRoute-D0nIx9Pv.css +1 -0
- package/bin/console/assets/IndexingRoute-QzgacqGk.js +1 -0
- package/bin/console/assets/KeybindsRoute-BSo2-u5g.js +1 -0
- package/bin/console/assets/KeybindsRoute-DPP8xngh.css +1 -0
- package/bin/console/assets/LoginRoute-BvXKCbLf.js +1 -0
- package/bin/console/assets/McpRoute-D-Grz23A.js +138 -0
- package/bin/console/assets/McpRoute-D22Npdv0.css +1 -0
- package/bin/console/assets/ModelsRoute-Dk1uAzWQ.css +1 -0
- package/bin/console/assets/ModelsRoute-FzKm3GFg.js +1 -0
- package/bin/console/assets/OverviewRoute-DzMpRpg0.js +1 -0
- package/bin/console/assets/OverviewRoute-neFLWBjP.css +1 -0
- package/bin/console/assets/PermissionsRoute-BIjHuwFU.css +1 -0
- package/bin/console/assets/PermissionsRoute-D79Jf9T-.js +1 -0
- package/bin/console/assets/ProfileRoute-DY1DmDkk.js +1 -0
- package/bin/console/assets/ProjectConsoleRoute-B2CEEUWZ.js +4 -0
- package/bin/console/assets/ProjectConsoleRoute-Df0w2iOW.css +1 -0
- package/bin/console/assets/ProvidersRoute-jdHnKSmI.js +5 -0
- package/bin/console/assets/ServersRoute-BBRszzTY.css +1 -0
- package/bin/console/assets/ServersRoute-CLKvecV4.js +1 -0
- package/bin/console/assets/SourcesRoute-DIzmjUWT.js +1 -0
- package/bin/console/assets/SourcesRoute-DMunRt3T.css +1 -0
- package/bin/console/assets/ToolsRoute-Br8SrorE.js +1 -0
- package/bin/console/assets/agents-tools-DXx49OgX.css +1 -0
- package/bin/console/assets/button-DUESCiL9.js +1 -0
- package/bin/console/assets/cli-ui-DymkjzY0.css +1 -0
- package/bin/console/assets/config-rLoO0LDc.js +1 -0
- package/bin/console/assets/console-D_ICjwvI.js +1 -0
- package/bin/console/assets/dialogs-BCnEWnpn.css +1 -0
- package/bin/console/assets/file-PqLbqN2Z.js +649 -0
- package/bin/console/assets/index-5EVEMIHJ.css +1 -0
- package/bin/console/assets/index-aE_EEdSy.js +19 -0
- package/bin/console/assets/models-CkIsKFzm.css +1 -0
- package/bin/console/assets/models-wZrb2WKp.js +1 -0
- package/bin/console/assets/profile-Do_gK9qi.css +1 -0
- package/bin/console/assets/profile-tmBfOA4S.js +1 -0
- package/bin/console/assets/session-review-DUVNnuDV.js +30 -0
- package/bin/console/assets/tag-CWrSVrX3.js +1 -0
- package/bin/console/assets/ui-hTWDRfzG.js +1 -0
- package/bin/console/index.html +2 -2
- package/bin/kilo +0 -0
- package/package.json +1 -1
- package/bin/console/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/bin/console/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/bin/console/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/bin/console/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/bin/console/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/bin/console/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/bin/console/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/bin/console/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/bin/console/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/bin/console/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/bin/console/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/bin/console/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/bin/console/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/bin/console/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/bin/console/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/bin/console/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/bin/console/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/bin/console/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/bin/console/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/bin/console/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/bin/console/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/bin/console/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/bin/console/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/bin/console/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/bin/console/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/bin/console/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/bin/console/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/bin/console/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/bin/console/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/bin/console/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/bin/console/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/bin/console/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/bin/console/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/bin/console/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/bin/console/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/bin/console/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/bin/console/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/bin/console/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/bin/console/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/bin/console/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/bin/console/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/bin/console/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/bin/console/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/bin/console/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/bin/console/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/bin/console/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/bin/console/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/bin/console/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/bin/console/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/bin/console/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/bin/console/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/bin/console/assets/index-B2oknisZ.css +0 -1
- package/bin/console/assets/index-oVVWPmdA.js +0 -857
- package/bin/console/logo.lottie +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.kilo-console .indexing-builder .agent-builder-card:has(.indexing-select[open]){position:relative;z-index:40;overflow:visible}.kilo-console .indexing-select[open]{z-index:41}.kilo-console .indexing-toggle-tags{display:inline-flex;gap:.5rem;align-items:center;justify-content:flex-end}.kilo-console .indexing-field-title{display:flex;gap:.5rem;align-items:center;justify-content:space-between;min-width:0}.kilo-console .indexing-field-title>:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kilo-console .indexing-note{grid-column:1 / -1;border:1px solid color-mix(in oklab,var(--primary) 35%,var(--border));border-radius:var(--radius-md);background:color-mix(in oklab,var(--primary) 8%,transparent);color:var(--muted-foreground);font-size:.6875rem;line-height:1.5;padding:.625rem}.kilo-console .indexing-errors{display:grid;gap:.25rem;border-top:1px solid var(--border);color:var(--destructive);font-size:.6875rem;padding:.75rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as P,c as _,b as ce,e as ue,f as n,h as ge,ac as ve,i as d,C as O,m as he,S,g as h,F as W,s as j,t as v,v as me}from"./index-aE_EEdSy.js";import{B as G}from"./button-DUESCiL9.js";import{C as N}from"./CustomSelect-Bv8ga_sb.js";import{u as be}from"./config-rLoO0LDc.js";import{b as X,S as x,a as pe}from"./ConfigPage-CF46-J2f.js";/* empty css */import"./tag-CWrSVrX3.js";const fe=/^\.?[A-Za-z0-9][A-Za-z0-9_+-]*$/;function ye(e){return fe.test(e.trim())}function $e(e){if(!e)return;const t=new Set;for(const l of e){const s=l.trim().toLowerCase();s&&t.add(s.startsWith(".")?s:`.${s}`)}return t.size>0?[...t].sort():void 0}function xe(e){const t=e.split(",").map(l=>l.trim()).filter(Boolean);return t.length>0?$e(t):void 0}function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ke(e){return structuredClone(e??{})}function _e(e,t,l,s,g){return e!==t||!l&&s!==g}function z(e,t){const l={...e??{}};for(const[s,g]of Object.entries(t??{})){if(C(g)&&C(l[s])){l[s]={...l[s],...g};continue}l[s]=g}return l}function H(e){if(typeof e=="string")return e.trim()||void 0;if(Array.isArray(e))return e.length>0?e:void 0;if(!C(e))return e??void 0;const t=Object.entries(e).flatMap(([l,s])=>{const g=H(s);return g===void 0?[]:[[l,g]]});if(t.length!==0)return Object.fromEntries(t)}function J(e){return H(e)??{}}function Se(e,t){return{provider:e||void 0,model:e==="kilo"&&t||void 0,dimension:void 0}}function Y(e,t,l){if(!C(e))return[];const s=C(t)?t:{};return Object.entries(e).flatMap(([g,y])=>{const m=[...l,g];return g in s?C(y)&&C(s[g])?Y(y,s[g],m):[]:[m]})}function Be(e,t){return Y(e,t,["indexing"])}function Ae(e){const t=[];e.fileExtensions?.some(s=>!ye(s))&&t.push("File extensions must contain only a name with an optional leading dot."),e.dimension!==void 0&&e.dimension!==null&&(!Number.isInteger(e.dimension)||e.dimension<=0)&&t.push("Vector dimension must be a positive integer."),e.searchMinScore!==void 0&&(e.searchMinScore<0||e.searchMinScore>1)&&t.push("Search minimum score must be between 0 and 1.");const l=[["Search maximum results",e.searchMaxResults],["Embedding batch size",e.embeddingBatchSize],["Scanner maximum retries",e.scannerMaxBatchRetries]];for(const[s,g]of l)g!==void 0&&(!Number.isInteger(g)||g<=0)&&t.push(`${s} must be a positive integer.`);return t}var Ce=v('<div class="ui-field agent-builder-field"><div class=agent-builder-field-head><div><span></span></div></div><div class=agent-builder-control>'),Ee=v("<small>"),Me=v("<div class=agent-builder-field-actions>"),we=v("<button class=ui-toggle type=button><span><strong></strong><small></small></span><span class=indexing-toggle-tags>"),Ie=v("<header class=ui-card-header><div><h2>Indexing</h2><p>Build and maintain an embedding index used by semantic search."),q=v('<div class="ui-form agent-builder-form">'),Ke=v("<header class=ui-card-header><div><h2>Embeddings</h2><p>Select the provider and model used to turn code into searchable vectors."),Pe=v("<input type=number min=1 step=1 placeholder=Auto-detect>"),Te=v("<div class=indexing-note>Kilo embeddings use the account currently signed in to this Kilo server. Model dimensions are supplied by the catalog."),Oe=v("<header class=ui-card-header><div><h2>Vector Store</h2><p>Choose where indexed embeddings and metadata are stored."),qe=v("<input placeholder=http://localhost:6333>"),je=v('<input type=password placeholder="Optional API key">'),Le=v("<header class=ui-card-header><div><h2>Search and Scanning</h2><p>Tune result filtering, batching, and retries."),Re=v('<input placeholder=".php, .js, .css">'),Fe=v("<input type=number min=0 max=1 step=0.05 placeholder=0.4>"),Ne=v("<input type=number min=1 step=1 placeholder=50>"),ze=v("<input type=number min=1 step=1 placeholder=60>"),De=v("<input type=number min=1 step=1 placeholder=3>"),Ue=v("<footer class=indexing-errors>"),Qe=v('<div class="builder indexing-builder"><section class="builder-form agent-builder-stack">'),Ve=v('<input placeholder="Provider default">'),We=v("<input>"),Ge=v('<input placeholder="Default Kilo state directory">'),Je=v("<span>");const Ze=[{value:"",label:"Automatic"},{value:"kilo",label:"Kilo"},{value:"openai",label:"OpenAI"},{value:"ollama",label:"Ollama (local)"},{value:"openai-compatible",label:"OpenAI-compatible"},{value:"gemini",label:"Gemini"},{value:"mistral",label:"Mistral"},{value:"vercel-ai-gateway",label:"Vercel AI Gateway"},{value:"bedrock",label:"AWS Bedrock"},{value:"openrouter",label:"OpenRouter"},{value:"voyage",label:"Voyage"}],Xe=[{value:"lancedb",label:"LanceDB (default)"},{value:"qdrant",label:"Qdrant"}],He={kilo:[],openai:[{key:"apiKey",label:"API key",placeholder:"sk-...",secret:!0}],ollama:[{key:"baseUrl",label:"Base URL",placeholder:"http://localhost:11434"}],"openai-compatible":[{key:"baseUrl",label:"Base URL",placeholder:"https://api.example.com/v1"},{key:"apiKey",label:"API key",placeholder:"sk-...",secret:!0}],gemini:[{key:"apiKey",label:"API key",placeholder:"AI...",secret:!0}],mistral:[{key:"apiKey",label:"API key",placeholder:"...",secret:!0}],"vercel-ai-gateway":[{key:"apiKey",label:"API key",placeholder:"...",secret:!0}],bedrock:[{key:"region",label:"AWS region",placeholder:"us-east-1"},{key:"profile",label:"AWS profile",placeholder:"default"}],openrouter:[{key:"apiKey",label:"API key",placeholder:"sk-or-...",secret:!0},{key:"specificProvider",label:"Specific provider",placeholder:"Optional routing provider"}],voyage:[{key:"apiKey",label:"API key",placeholder:"pa-...",secret:!0}]};function Z(e,t){const l=e[t];return!l||typeof l!="object"?{}:l}function p(e){return(()=>{var t=Ce(),l=t.firstChild,s=l.firstChild,g=s.firstChild,y=l.nextSibling;return d(g,()=>e.label),d(s,n(S,{get when(){return e.description},children:m=>(()=>{var $=Ee();return d($,m),$})()}),null),d(l,n(S,{get when(){return e.actions},children:m=>(()=>{var $=Me();return d($,m),$})()}),null),d(y,()=>e.children),t})()}function Ye(e){return(()=>{var t=we(),l=t.firstChild,s=l.firstChild,g=s.nextSibling,y=l.nextSibling;return me(t,"click",e.onChange,!0),d(s,()=>e.label),d(g,()=>e.description),d(y,n(x,{get source(){return e.source},get inherited(){return e.inherited},get overridden(){return e.overridden}}),null),d(y,n(X,{get tone(){return e.checked?"success":"neutral"},get children(){return e.checked?"On":"Off"}}),null),h(m=>{var $=!!e.checked,I=e.checked,E=e.disabled;return $!==m.e&&t.classList.toggle("selected",m.e=$),I!==m.t&&j(t,"aria-pressed",m.t=I),E!==m.a&&(t.disabled=m.a=E),m},{e:void 0,t:void 0,a:void 0}),t})()}function or(){const e=be(),[t,l]=P({}),[s,g]=P(""),[y,m]=P(!1),[$,I]=P(""),E=()=>e.query()?.scope??"global",[ee,re]=P(E()),B=()=>E()==="project",L=_(()=>e.data()?.overlay.global.indexing??{}),R=_(()=>{const i=e.data()?.overlay;return i?(B()?i.project.indexing:i.global.indexing)??{}:{}}),b=_(()=>B()?z(L(),t()):t()),M=_(()=>b().provider),D=_(()=>b().vectorStore??"lancedb"),[T]=ce(e.query,ve),te=_(()=>{const i=T()?.models??[];return i.length===0?[{value:"",label:"No Kilo embedding models available",disabled:!0}]:i.map(o=>({value:o.id,label:`${o.name} (${o.note?`${o.note}, `:""}${o.dimension}d)`}))}),ne=_(()=>{const i=T();if(!i)return"";const o=b().model??i.defaultModel;return i.aliases[o]??o}),F=_(()=>Ae(J(t()))),ie=_(()=>Object.keys(R()).length>0);ue(()=>{const i=E(),o=R(),a=JSON.stringify(o);if(!_e(ee(),i,y(),s(),a))return;re(i),g(a),l(ke(o));const r=B()?z(L(),o).fileExtensions:o.fileExtensions;I(r?.join(", ")??""),m(!1)});function u(i){return e.data()?.overlay.fields[`indexing.${i}`]}function f(i){l(o=>z(o,i)),m(!0)}function le(i,o){f({[i]:o||void 0})}function K(i,o){f({[i]:o?Number(o):void 0})}function ae(i,o,a){f({[i]:{...Z(t(),i),[o]:a||void 0}})}function oe(i){f(Se(i,T()?.defaultModel))}function de(){const i=J(t()),o=Be(R(),i);e.patch({indexing:i},o.length?o:void 0),l(i),g(JSON.stringify(i)),m(!1)}function se(){e.unset([["indexing"]]),l({}),g("{}"),m(!1)}return n(pe,{title:"Code Indexing",get description(){return B()?"Configure semantic code search for this project. Unchanged values inherit from global settings.":"Configure semantic code search defaults for every project."},get actions(){return[n(S,{get when(){return ie()},get children(){return n(G,{variant:"secondary",get disabled(){return!!e.saving()},onClick:se,get children(){return B()?"Use global settings":"Clear settings"}})}}),n(G,{variant:"primary",get disabled(){return!!e.saving()||!y()||F().length>0},onClick:de,children:"Save"})]},get children(){var i=Qe(),o=i.firstChild;return d(o,n(O,{class:"ui-card agent-builder-card",padding:0,get children(){return[(()=>{var a=Ie();return a.firstChild,d(a,n(X,{get children(){return B()?"Project":"Global"}}),null),a})(),(()=>{var a=q();return d(a,n(Ye,{label:"Enable indexing",get description(){return he(()=>!!(B()&&t().enabled===void 0))()?`Inherited from global settings (${L().enabled?"on":"off"}).`:"Scan source files and keep their semantic index up to date."},get checked(){return b().enabled??!1},get disabled(){return!!e.saving()},get source(){return u("enabled")?.source},get inherited(){return u("enabled")?.inherited},get overridden(){return u("enabled")?.overridden},onChange:()=>f({enabled:!(b().enabled??!1)})})),a})()]}}),null),d(o,n(O,{class:"ui-card agent-builder-card",padding:0,get children(){return[Ke(),(()=>{var a=q();return d(a,n(p,{label:"Provider",description:"Automatic uses Kilo when signed in, otherwise the provider runtime default.",get actions(){return n(x,{get source(){return u("provider")?.source},get inherited(){return u("provider")?.inherited},get overridden(){return u("provider")?.overridden}})},get children(){return n(N,{class:"indexing-select",label:"Embedding provider",get value(){return M()??""},options:Ze,get disabled(){return!!e.saving()},onSelect:oe})}}),null),d(a,n(p,{label:"Model",get description(){return M()==="kilo"?"Select a Kilo-hosted embedding model.":"Leave empty to use the provider's default embedding model."},get actions(){return n(x,{get source(){return u("model")?.source},get inherited(){return u("model")?.inherited},get overridden(){return u("model")?.overridden}})},get children(){return n(S,{get when(){return M()==="kilo"},get fallback(){return(()=>{var r=Ve();return r.$$input=c=>le("model",c.currentTarget.value),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().model??""),r})()},get children(){return n(N,{class:"indexing-select",label:"Kilo embedding model",get value(){return ne()},get options(){return te()},get disabled(){return!!e.saving()||!T()?.models.length},onSelect:r=>f({model:r,dimension:void 0})})}})}}),null),d(a,n(p,{label:"Vector dimension",description:"Leave empty to derive the dimension from known model metadata.",get actions(){return n(x,{get source(){return u("dimension")?.source},get inherited(){return u("dimension")?.inherited},get overridden(){return u("dimension")?.overridden}})},get children(){var r=Pe();return r.$$input=c=>K("dimension",c.currentTarget.value),h(()=>r.disabled=!!e.saving()||M()==="kilo"),h(()=>r.value=b().dimension??""),r}}),null),d(a,n(S,{get when(){return M()==="kilo"},get children(){return Te()}}),null),d(a,n(S,{get when(){return M()},keyed:!0,children:r=>n(W,{get each(){return He[r]},children:c=>{const w=()=>u(`${r}.${c.key}`);return n(p,{get label(){return c.label},description:"Provider-specific connection setting.",get actions(){return n(x,{get source(){return w()?.source},get inherited(){return w()?.inherited},get overridden(){return w()?.overridden}})},get children(){var A=We();return A.$$input=k=>ae(r,c.key,k.currentTarget.value),j(A,"spellcheck",!1),h(k=>{var U=c.secret?"password":"text",Q=c.placeholder,V=!!e.saving();return U!==k.e&&j(A,"type",k.e=U),Q!==k.t&&j(A,"placeholder",k.t=Q),V!==k.a&&(A.disabled=k.a=V),k},{e:void 0,t:void 0,a:void 0}),h(()=>A.value=Z(b(),r)[c.key]??""),A}})}})}),null),a})()]}}),null),d(o,n(O,{class:"ui-card agent-builder-card",padding:0,get children(){return[Oe(),(()=>{var a=q();return d(a,n(p,{label:"Backend",description:"LanceDB stores vectors locally by default. Qdrant connects to an external service.",get actions(){return n(x,{get source(){return u("vectorStore")?.source},get inherited(){return u("vectorStore")?.inherited},get overridden(){return u("vectorStore")?.overridden}})},get children(){return n(N,{class:"indexing-select",label:"Vector store",get value(){return D()},options:Xe,get disabled(){return!!e.saving()},onSelect:r=>f({vectorStore:r})})}}),null),d(a,n(S,{get when(){return D()==="qdrant"},get fallback(){return n(p,{label:"LanceDB directory",description:"Optional directory for local LanceDB storage.",get actions(){return n(x,{get source(){return u("lancedb.directory")?.source},get inherited(){return u("lancedb.directory")?.inherited},get overridden(){return u("lancedb.directory")?.overridden}})},get children(){var r=Ge();return r.$$input=c=>f({lancedb:{...t().lancedb,directory:c.currentTarget.value||void 0}}),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().lancedb?.directory??""),r}})},get children(){return[n(p,{label:"Qdrant URL",description:"Server URL for the Qdrant instance.",get actions(){return n(x,{get source(){return u("qdrant.url")?.source},get inherited(){return u("qdrant.url")?.inherited},get overridden(){return u("qdrant.url")?.overridden}})},get children(){var r=qe();return r.$$input=c=>f({qdrant:{...t().qdrant,url:c.currentTarget.value||void 0}}),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().qdrant?.url??""),r}}),n(p,{label:"Qdrant API key",description:"Optional API key for authenticated Qdrant instances.",get actions(){return n(x,{get source(){return u("qdrant.apiKey")?.source},get inherited(){return u("qdrant.apiKey")?.inherited},get overridden(){return u("qdrant.apiKey")?.overridden}})},get children(){var r=je();return r.$$input=c=>f({qdrant:{...t().qdrant,apiKey:c.currentTarget.value||void 0}}),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().qdrant?.apiKey??""),r}})]}}),null),a})()]}}),null),d(o,n(O,{class:"ui-card agent-builder-card",padding:0,get children(){return[Le(),(()=>{var a=q();return d(a,n(p,{label:"File extensions",description:"Comma-separated allowlist. Leave empty to use the built-in defaults.",get actions(){return n(x,{get source(){return u("fileExtensions")?.source},get inherited(){return u("fileExtensions")?.inherited},get overridden(){return u("fileExtensions")?.overridden}})},get children(){var r=Re();return r.$$input=c=>{const w=c.currentTarget.value;I(w),f({fileExtensions:xe(w)})},h(()=>r.disabled=!!e.saving()),h(()=>r.value=$()),r}}),null),d(a,n(p,{label:"Minimum search score",description:"Similarity threshold from 0 to 1. Default is model-specific or 0.4.",get children(){var r=Fe();return r.$$input=c=>K("searchMinScore",c.currentTarget.value),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().searchMinScore??""),r}}),null),d(a,n(p,{label:"Maximum search results",description:"Maximum number of semantic matches returned per search.",get children(){var r=Ne();return r.$$input=c=>K("searchMaxResults",c.currentTarget.value),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().searchMaxResults??""),r}}),null),d(a,n(p,{label:"Embedding batch size",description:"Number of code segments sent in each embedding batch.",get children(){var r=ze();return r.$$input=c=>K("embeddingBatchSize",c.currentTarget.value),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().embeddingBatchSize??""),r}}),null),d(a,n(p,{label:"Scanner retry limit",description:"Maximum retry attempts for a failed embedding batch.",get children(){var r=De();return r.$$input=c=>K("scannerMaxBatchRetries",c.currentTarget.value),h(()=>r.disabled=!!e.saving()),h(()=>r.value=b().scannerMaxBatchRetries??""),r}}),null),a})(),n(S,{get when(){return F().length>0},get children(){var a=Ue();return d(a,n(W,{get each(){return F()},children:r=>(()=>{var c=Je();return d(c,r),c})()})),a}})]}}),null),i}})}ge(["click","input"]);export{or as IndexingRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as x,c as b,e as G,y as L,o as H,ab as J,f as a,h as O,w as Q,i,S as I,F as R,X as W,g as j,s as q,v as Y,m as Z,t as u}from"./index-aE_EEdSy.js";import{B as w}from"./button-DUESCiL9.js";import{d as ee,e as D,c as ne,S as te,b as re,a as ie}from"./ConfigPage-CF46-J2f.js";import{u as ae}from"./config-rLoO0LDc.js";import"./tag-CWrSVrX3.js";const se=new Set(["alt","control","meta","shift"]);function M(e){return e.trim().toLowerCase().replace(/\s+/g,"")}function P(e){return M(e)==="none"?[]:J(e).map(M)}function le(e){const t=e.toLowerCase();return t===" "?"space":t==="arrowleft"?"left":t==="arrowright"?"right":t==="arrowup"?"up":t==="arrowdown"?"down":t==="escape"?"escape":t==="enter"?"return":t==="pageup"?"pageup":t==="pagedown"?"pagedown":t==="backspace"?"backspace":t==="delete"?"delete":t==="home"?"home":t==="end"?"end":t==="tab"?"tab":t==="dead"||t==="unidentified"?"":t}function de(e){const t=le(e.key);return!t||se.has(t)?"":[e.ctrlKey&&"ctrl",e.altKey&&"alt",e.metaKey&&"super",e.shiftKey&&"shift",t].filter(Boolean).join("+")}function oe(){const e=ae(),t=()=>e.data(),[o,c]=x("closed"),[h,s]=x(""),[d,l]=x(!1),[m,B]=x(""),[f,y]=x(""),g=b(()=>t()?.keybinds.keybinds??[]),T=b(()=>new Set(g().map(n=>n.id)));function k(n){return t()?.tui.keybinds?.[n.id]??n.default}function $(n,r){const p=new Set(P(r));return p.size?g().filter(K=>K.id!==n.id&&P(k(K)).some(V=>p.has(V))).map(K=>K.id):[]}const S=b(()=>g().map(n=>{const r=k(n);return{item:n,binding:r,source:r===n.default?"default":e.query()?.scope??"project",conflicts:r===n.default?[]:$(n,r)}})),E=b(()=>{const n=h().trim().toLowerCase();return n?S().filter(r=>`${r.item.label} ${r.item.id} ${r.item.group} ${r.item.description} ${r.binding} ${r.item.default}`.toLowerCase().includes(n)):S()}),U=b(()=>Array.from(E().reduce((n,r)=>{const p=n.get(r.item.group)??[];return p.push(r),n.set(r.item.group,p),n},new Map),([n,r])=>({name:n,rows:r}))),C=b(()=>g().find(n=>n.id===m())),_=b(()=>{const n=C();return n?L(f())===n.default?[]:$(n,f()):[]}),v=b(()=>C()?.default===L(f()));G(()=>{if(!d())return;const n=r=>{r.preventDefault(),r.stopImmediatePropagation();const p=de(r);p&&(y(p),l(!1))};window.addEventListener("keydown",n,!0),H(()=>window.removeEventListener("keydown",n,!0))});function A(n){B(n.id),y(k(n)),l(!1),c("edit")}function F(){l(!1),c("closed")}function X(){const n=C();n&&y(n.default)}function z(){y("none")}function N(){const n=L(m()),r=L(f());if(!t()||!n||!r){e.fail("Enter a TUI keybind name and binding before saving.");return}if(!T().has(n)){e.fail(`Unknown TUI keybind: ${n}`);return}e.tui({keybinds:{[n]:r}}),F()}return{ctx:e,mode:o,close:F,open:A,search:h,setSearch:s,capture:d,setCapture:l,keybinds:g,rows:S,visible:E,groups:U,selected:C,binding:f,setBinding:y,conflicts:_,defaulted:v,reset:X,none:z,save:N}}var ce=u("<div class=keybinds>"),ue=u("<span class=config-title-count>Keybinds"),fe=u("<p class=empty>No keybinds match this filter."),ge=u("<section class=keybind-group><div class=keybind-rows>"),pe=u("<span class=keybind-subtitle><span class=keybind-id></span><span class=keybind-description>"),be=u("<div class=keybind-meta><span class=keybind-binding>"),he=u("<div class=drawer-scrim>"),me=u('<p class="keybind-warning wide">Duplicate binding with: '),ye=u('<aside class="provider-drawer keybind-drawer"aria-label="Keybind configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form keybind-form"><section class="keybind-command-card wide"><span></span><p></p><code></code></section><label class="required-field wide keybind-binding-field">Binding<div class=keybind-input-row><input placeholder=ctrl+x,shift+return,none></div></label><p class="keybind-help wide">Press Capture, then type a shortcut. Enter comma-separated bindings manually to define alternatives.</p><div class="keybind-default-card wide"><span>Default binding</span><code></code></div></div><footer class="drawer-footer keybind-footer">');function we(){const e=oe();return a(ie,{get title(){return(()=>{var t=ue();return t.firstChild,i(t,a(D,{get children(){return e.keybinds().length}}),null),t})()},description:"Review and override every terminal UI keybind command exposed by the CLI. Use none to disable a binding.",get children(){return[a(Q,{label:"Filter keybinds",get value(){return e.search()},placeholder:"Filter by command, group, binding, or description...",get onValue(){return e.setSearch}}),(()=>{var t=ce();return i(t,a(I,{get when(){return e.groups().length},get fallback(){return fe()},get children(){return a(R,{get each(){return e.groups()},children:o=>(()=>{var c=ge(),h=c.firstChild;return i(c,a(ee,{get trailing(){return a(D,{get children(){return o.rows.length}})},get children(){return o.name}}),h),i(h,a(R,{get each(){return o.rows},children:s=>a(ne,{get title(){return s.item.label},get subtitle(){return(()=>{var d=pe(),l=d.firstChild,m=l.nextSibling;return i(l,()=>s.item.id),i(m,()=>s.item.description),d})()},get status(){return(()=>{var d=be(),l=d.firstChild;return i(l,()=>s.binding),i(d,a(te,{get source(){return s.source}}),null),i(d,a(I,{get when(){return s.conflicts.length},get children(){return a(re,{tone:"warning",children:"Conflict"})}}),null),j(()=>q(l,"data-empty",s.binding==="none"||void 0)),d})()},get actions(){return a(W,{icon:"edit",variant:"ghost",get"aria-label"(){return`Edit ${s.item.label}`},get disabled(){return!!e.ctx.saving()},onClick:()=>e.open(s.item)})}})})),c})()})}})),t})(),a(I,{get when(){return Z(()=>e.mode()==="edit")()&&e.selected()},children:t=>[(()=>{var o=he();return Y(o,"click",e.close,!0),o})(),(()=>{var o=ye(),c=o.firstChild,h=c.firstChild,s=h.firstChild,d=s.nextSibling,l=c.nextSibling,m=l.firstChild,B=m.firstChild,f=B.nextSibling,y=f.nextSibling,g=m.nextSibling,T=g.firstChild,k=T.nextSibling,$=k.firstChild,S=g.nextSibling,E=S.nextSibling,U=E.firstChild,C=U.nextSibling,_=l.nextSibling;return i(s,()=>t().label),i(d,()=>t().id),i(c,a(w,{variant:"ghost","aria-label":"Close keybind overlay",get onClick(){return e.close},children:"X"}),null),i(B,()=>t().group),i(f,()=>t().description),i(y,()=>t().id),$.$$input=v=>e.setBinding(v.currentTarget.value),q($,"spellcheck",!1),i(k,a(w,{get variant(){return e.capture()?"primary":"secondary"},get"aria-pressed"(){return e.capture()},onClick:()=>e.setCapture(!e.capture()),get children(){return e.capture()?"Listening...":"Capture"}}),null),i(C,()=>t().default),i(l,a(I,{get when(){return e.conflicts().length},get children(){var v=me();return v.firstChild,i(v,()=>e.conflicts().join(", "),null),v}}),null),i(_,a(w,{variant:"ghost",get onClick(){return e.close},children:"Cancel"}),null),i(_,a(w,{variant:"secondary",get disabled(){return!!e.ctx.saving()},get onClick(){return e.none},children:"Set none"}),null),i(_,a(w,{variant:"secondary",get disabled(){return!!e.ctx.saving()||e.defaulted()},get onClick(){return e.reset},children:"Use default"}),null),i(_,a(w,{variant:"primary",get disabled(){return!!e.ctx.saving()||!e.binding()},get onClick(){return e.save},children:"Save keybind"}),null),j(()=>$.value=e.binding()),o})()]})]}})}O(["click","input"]);export{we as KeybindsRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.kilo-console .keybinds,.kilo-console .keybind-group,.kilo-console .keybind-rows{display:grid;gap:.5rem}.kilo-console .keybind-group [data-component=section-title]{margin:.75rem 0 .25rem}.kilo-console .keybinds [data-component=config-row]{align-items:flex-start}.kilo-console .keybinds [data-slot=config-row-subtitle]{overflow:visible;white-space:normal}.kilo-console .keybind-subtitle{display:grid;gap:.125rem;min-width:0}.kilo-console .keybind-id,.kilo-console .keybind-binding,.kilo-console .keybind-command-card code,.kilo-console .keybind-default-card code{font-family:var(--font-family-mono)}.kilo-console .keybind-id{overflow:hidden;color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap}.kilo-console .keybind-description{overflow-wrap:anywhere;white-space:normal}.kilo-console .keybind-meta{display:flex;gap:.5rem;align-items:center;justify-content:flex-end;flex-wrap:wrap}.kilo-console .keybind-binding{display:inline-flex;align-items:center;max-width:18rem;min-height:1.5rem;overflow:hidden;border:1px solid var(--border-weak-base);border-radius:var(--radius-md);background:var(--surface-base);color:var(--foreground);font-size:.6875rem;line-height:1rem;padding:.1875rem .5rem;text-overflow:ellipsis;white-space:nowrap}.kilo-console .keybind-binding[data-empty=true]{color:var(--muted-foreground)}.kilo-console .keybind-drawer{width:min(38rem,calc(100vw - var(--app-rail-width)))}.kilo-console .keybind-form{grid-template-columns:minmax(0,1fr);align-content:start;padding:1rem}.kilo-console .keybind-form .wide{grid-column:1}.kilo-console .keybind-command-card,.kilo-console .keybind-default-card{display:grid;gap:.35rem;border:1px solid var(--border-weak-base);border-radius:var(--radius-lg);background:var(--card);padding:.75rem}.kilo-console .keybind-command-card span,.kilo-console .keybind-default-card span{color:var(--muted-foreground);font-size:.6875rem;line-height:1.35}.kilo-console .keybind-command-card p{margin:0;color:var(--foreground);font-size:.75rem;line-height:1.45}.kilo-console .keybind-command-card code,.kilo-console .keybind-default-card code{overflow-wrap:anywhere;color:var(--foreground);font-size:.75rem;line-height:1.45}.kilo-console .keybind-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;align-items:center}.kilo-console .keybind-input-row input,.kilo-console .keybind-input-row [data-component=button]{height:2.35rem;min-height:2.35rem}.kilo-console .keybind-input-row [data-component=button]{white-space:nowrap}.kilo-console .keybind-help,.kilo-console .keybind-warning{margin:0;font-size:.75rem;line-height:1.45}.kilo-console .keybind-help{color:var(--muted-foreground)}.kilo-console .keybind-warning{border:1px solid color-mix(in srgb,var(--warning) 45%,var(--border));border-radius:var(--radius-md);background:color-mix(in srgb,var(--warning) 12%,var(--card));color:var(--foreground);padding:.75rem}.kilo-console .keybind-footer{flex-wrap:wrap}@media(max-width:760px){.kilo-console .keybind-input-row{grid-template-columns:minmax(0,1fr)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as re,a as ne,c as ie,d,e as L,o as U,i as s,f as r,t as o,h as se,L as le,m as D,S as _,C as N,g as O,s as j,p as oe,M as g,q as ae,r as ce,l as ue,j as W}from"./index-aE_EEdSy.js";import{B as f}from"./button-DUESCiL9.js";import{u as pe,g as de,e as F,p as ge,s as fe}from"./profile-tmBfOA4S.js";var he=o("<strong>Kilo server not found"),ve=o("<p>Start a local Kilo server or pass a server URL with ?server=."),me=o("<a class=profile-link-button>Back to Profile"),$e=o("<div class=profile-login-state><span class=profile-spinner aria-hidden=true></span><strong>Starting login...</strong><p>Preparing a secure browser authorization request."),_e=o("<div class=profile-login-flow><div class=profile-login-step><span>Step 1</span><strong>Open this URL</strong><div class=profile-login-url><span></span></div></div><div class=profile-login-waiting><span class=profile-spinner aria-hidden=true></span><span>Waiting for authorization (<!>)"),we=o('<div class="profile-login-state success"><strong>Login successful</strong><p>Redirecting back to your profile.'),be=o('<div class="profile-login-state error"><strong>Login failed</strong><p></p><div class=profile-login-actions><a class=profile-link-button>Back to Profile'),Ce=o("<div class=profile-login-state><strong>Login cancelled</strong><p>No credentials were saved."),ye=o("<section class=route-empty><div class=profile-login-page><header class=profile-login-header><p class=eyebrow>Kilo Login</p><h1>Login to Kilo</h1><p>Authorize this Kilo Console through the same device auth flow used by the editor clients."),Se=o("<div class=profile-login-step><span>Step 2</span><strong>Enter this code</strong><button type=button class=profile-login-code><small>");function xe(h){const w=Math.floor(h/60),u=h%60;return`${w}:${u.toString().padStart(2,"0")}`}function Ke(){const h=re(),w=ne(),u=ie(()=>new URLSearchParams(h.search)),a=pe(u),[n,c]=d({status:"idle"}),[G,A]=d(900),[v,b]=d(0),[K,C]=d(),[y,q]=d(""),H=()=>fe(u().get("return")),R=()=>ge(u(),"/profile");function S(){K()?.abort(),C(void 0)}function J(){window.setTimeout(()=>w(H(),{replace:!0}),650)}function x(e=a.query()){if(!e)return;S();const l=new AbortController,t=v()+1;b(t),C(l),c({status:"initiating"}),ae(e).then(i=>v()!==t?!1:(c({status:"pending",code:de(i.instructions),url:i.url,expiresIn:900}),ce(e,l.signal).then(()=>!0))).then(i=>{!i||v()!==t||(c({status:"success"}),ue(e).then(()=>F(!1)).catch(()=>F(!1)).finally(J))}).catch(i=>{v()===t&&c({status:"error",error:W(i)})}).finally(()=>{K()===l&&C(void 0)})}function Q(){S(),b(e=>e+1),c({status:"cancelled"})}function M(e,l){l&&navigator.clipboard.writeText(l).then(()=>{q(e),window.setTimeout(()=>{y()===e&&q("")},1400)}).catch(t=>c({status:"error",error:W(t)}))}function V(){const e=n().url;e&&window.open(e,"_blank","noopener,noreferrer")}return L(()=>{const e=a.query();!e||n().status!=="idle"||x(e)}),L(()=>{const e=n();if(e.status!=="pending")return;A(e.expiresIn??900);const l=window.setInterval(()=>A(t=>Math.max(0,t-1)),1e3);U(()=>window.clearInterval(l))}),L(()=>{n().status==="success"&&a.remember()}),U(()=>{S(),b(e=>e+1)}),(()=>{var e=ye(),l=e.firstChild;return l.firstChild,s(l,r(_,{get when(){return D(()=>!a.query())()&&a.discoverable()},get children(){return r(le,{variant:"fullscreen"})}}),null),s(l,r(_,{get when(){return D(()=>!a.query())()&&!a.discoverable()},get children(){return r(N,{class:"profile-login-card",variant:"warning",get children(){return[he(),ve(),(()=>{var t=me();return O(()=>j(t,"href",R())),t})()]}})}}),null),s(l,r(_,{get when(){return a.query()},get children(){return r(N,{class:"profile-login-card",get children(){return r(oe,{get children(){return[r(g,{get when(){return n().status==="idle"||n().status==="initiating"},get children(){return $e()}}),r(g,{get when(){return n().status==="pending"},get children(){var t=_e(),i=t.firstChild,m=i.firstChild,$=m.nextSibling,p=$.nextSibling,X=p.firstChild,P=i.nextSibling,Y=P.firstChild,B=Y.nextSibling,Z=B.firstChild,E=Z.nextSibling;return E.nextSibling,s(X,()=>n().url),s(p,r(f,{variant:"secondary",type:"button",onClick:()=>M("url",n().url),get children(){return y()==="url"?"Copied":"Copy"}}),null),s(i,r(f,{variant:"primary",type:"button",onClick:V,children:"Open Browser"}),null),s(t,r(_,{get when(){return n().code},children:I=>(()=>{var T=Se(),ee=T.firstChild,te=ee.nextSibling,k=te.nextSibling,z=k.firstChild;return k.$$click=()=>M("code",I()),s(k,I,z),s(z,()=>y()==="code"?"Copied":"Click to copy"),T})()}),P),s(B,()=>xe(G()),E),s(t,r(f,{variant:"ghost",type:"button",onClick:Q,children:"Cancel"}),null),t}}),r(g,{get when(){return n().status==="success"},get children(){return we()}}),r(g,{get when(){return n().status==="error"},get children(){var t=be(),i=t.firstChild,m=i.nextSibling,$=m.nextSibling,p=$.firstChild;return s(m,()=>n().error),s($,r(f,{variant:"primary",type:"button",onClick:()=>x(),children:"Try Again"}),p),O(()=>j(p,"href",R())),t}}),r(g,{get when(){return n().status==="cancelled"},get children(){var t=Ce(),i=t.firstChild;return i.nextSibling,s(t,r(f,{variant:"primary",type:"button",onClick:()=>x(),children:"Start Again"}),null),t}})]}})}})}}),null),e})()}se(["click"]);export{Ke as LoginRoute};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import{d as R,b as Ln,c as z,b8 as Mn,b9 as Pn,ba as Bn,y as re,aa as jn,j as ct,Y as Kn,f as S,h as Dn,w as us,i as $,S as D,F as ve,m as Be,X as hs,g as x,v as It,C as qn,s as ie,t as I}from"./index-aE_EEdSy.js";import{B as V}from"./button-DUESCiL9.js";import{a as Rn,S as Un,b as Xe,f as Fn,e as Vn}from"./ConfigPage-CF46-J2f.js";import{C as Jn}from"./ConfirmDialog-BxeZcJR2.js";import{C as ze}from"./CustomSelect-Bv8ga_sb.js";import{u as xn}from"./config-rLoO0LDc.js";import"./tag-CWrSVrX3.js";const Yt=Symbol.for("yaml.alias"),Rt=Symbol.for("yaml.document"),fe=Symbol.for("yaml.map"),Os=Symbol.for("yaml.pair"),se=Symbol.for("yaml.scalar"),Ee=Symbol.for("yaml.seq"),W=Symbol.for("yaml.node.type"),ye=s=>!!s&&typeof s=="object"&&s[W]===Yt,ft=s=>!!s&&typeof s=="object"&&s[W]===Rt,Ve=s=>!!s&&typeof s=="object"&&s[W]===fe,j=s=>!!s&&typeof s=="object"&&s[W]===Os,E=s=>!!s&&typeof s=="object"&&s[W]===se,Je=s=>!!s&&typeof s=="object"&&s[W]===Ee;function P(s){if(s&&typeof s=="object")switch(s[W]){case fe:case Ee:return!0}return!1}function B(s){if(s&&typeof s=="object")switch(s[W]){case Yt:case fe:case se:case Ee:return!0}return!1}const As=s=>(E(s)||P(s))&&!!s.anchor,he=Symbol("break visit"),Yn=Symbol("skip children"),qe=Symbol("remove node");function Le(s,e){const t=Gn(e);ft(s)?Ne(null,s.contents,t,Object.freeze([s]))===qe&&(s.contents=null):Ne(null,s,t,Object.freeze([]))}Le.BREAK=he;Le.SKIP=Yn;Le.REMOVE=qe;function Ne(s,e,t,n){const i=Hn(s,e,t,n);if(B(i)||j(i))return Qn(s,n,i),Ne(s,i,t,n);if(typeof i!="symbol"){if(P(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const l=Ne(r,e.items[r],t,n);if(typeof l=="number")r=l-1;else{if(l===he)return he;l===qe&&(e.items.splice(r,1),r-=1)}}}else if(j(e)){n=Object.freeze(n.concat(e));const r=Ne("key",e.key,t,n);if(r===he)return he;r===qe&&(e.key=null);const l=Ne("value",e.value,t,n);if(l===he)return he;l===qe&&(e.value=null)}}return i}function Gn(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Hn(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(Ve(e))return t.Map?.(s,e,n);if(Je(e))return t.Seq?.(s,e,n);if(j(e))return t.Pair?.(s,e,n);if(E(e))return t.Scalar?.(s,e,n);if(ye(e))return t.Alias?.(s,e,n)}function Qn(s,e,t){const n=e[e.length-1];if(P(n))n.items[s]=t;else if(j(n))s==="key"?n.key=t:n.value=t;else if(ft(n))n.contents=t;else{const i=ye(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Wn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Xn=s=>s.replace(/[!,[\]{}]/g,e=>Wn[e]);class U{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},U.defaultYaml,e),this.tags=Object.assign({},U.defaultTags,t)}clone(){const e=new U(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new U(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:U.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},U.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:U.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},U.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,l]=n;return this.tags[r]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const l=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,l),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const l=e.slice(2,-1);return l==="!"||l==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),l)}const[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(l){return t(String(l)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Xn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&B(e.contents)){const r={};Le(e.contents,(l,o)=>{B(o)&&o.tag&&(r[o.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,l]of n)r==="!!"&&l==="tag:yaml.org,2002:"||(!e||i.some(o=>o.startsWith(l)))&&t.push(`%TAG ${r} ${l}`);return t.join(`
|
|
2
|
+
`)}}U.defaultYaml={explicit:!1,version:"1.2"};U.defaultTags={"!!":"tag:yaml.org,2002:"};function _s(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Ts(s){const e=new Set;return Le(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Is(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function zn(s,e){const t=[],n=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=Ts(s));const l=Is(e,i);return i.add(l),l},setAnchors:()=>{for(const r of t){const l=n.get(r);if(typeof l=="object"&&l.anchor&&(E(l.node)||P(l.node)))l.node.anchor=l.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=r,o}}},sourceObjects:n}}function Ce(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const l=n[i],o=Ce(s,n,String(i),l);o===void 0?delete n[i]:o!==l&&(n[i]=o)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),l=Ce(s,n,i,r);l===void 0?n.delete(i):l!==r&&n.set(i,l)}else if(n instanceof Set)for(const i of Array.from(n)){const r=Ce(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const l=Ce(s,n,i,r);l===void 0?delete n[i]:l!==r&&(n[i]=l)}return s.call(e,t,n)}function Q(s,e,t){if(Array.isArray(s))return s.map((n,i)=>Q(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!As(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}class Gt{constructor(e){Object.defineProperty(this,W,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!ft(e))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=Q(this,"",l);if(typeof i=="function")for(const{count:a,res:c}of l.anchors.values())i(c,a);return typeof r=="function"?Ce(r,{"":o},"",o):o}}class Ht extends Gt{constructor(e){super(Yt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Le(e,{Node:(r,l)=>{(ye(l)||As(l))&&n.push(l)}}),t&&(t.aliasResolveCache=n));let i;for(const r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=t,l=this.resolve(i,t);if(!l){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let o=n.get(l);if(o||(Q(l,null,t),o=n.get(l)),o?.res===void 0){const a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=it(i,l,n)),o.count*o.aliasCount>r)){const a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return o.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(_s(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function it(s,e,t){if(ye(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(P(e)){let n=0;for(const i of e.items){const r=it(s,i,t);r>n&&(n=r)}return n}else if(j(e)){const n=it(s,e.key,t),i=it(s,e.value,t);return Math.max(n,i)}return 1}const Es=s=>!s||typeof s!="function"&&typeof s!="object";class _ extends Gt{constructor(e){super(se),this.value=e}toJSON(e,t){return t?.keep?this.value:Q(this.value,e,t)}toString(){return String(this.value)}}_.BLOCK_FOLDED="BLOCK_FOLDED";_.BLOCK_LITERAL="BLOCK_LITERAL";_.PLAIN="PLAIN";_.QUOTE_DOUBLE="QUOTE_DOUBLE";_.QUOTE_SINGLE="QUOTE_SINGLE";const Zn="tag:yaml.org,2002:";function ei(s,e,t){if(e){const n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function Ue(s,e,t){if(ft(s)&&(s=s.contents),B(s))return s;if(j(s)){const f=t.schema[fe].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:l,sourceObjects:o}=t;let a;if(n&&s&&typeof s=="object"){if(a=o.get(s),a)return a.anchor??(a.anchor=i(s)),new Ht(a.anchor);a={anchor:null,node:null},o.set(s,a)}e?.startsWith("!!")&&(e=Zn+e.slice(2));let c=ei(s,e,l.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const f=new _(s);return a&&(a.node=f),f}c=s instanceof Map?l[fe]:Symbol.iterator in Object(s)?l[Ee]:l[fe]}r&&(r(c),delete t.onTagObj);const d=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new _(s);return e?d.tag=e:c.default||(d.tag=c.tag),a&&(a.node=d),d}function ot(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const l=[];l[r]=n,n=l}else n=new Map([[r,n]])}return Ue(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Ke=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class Ls extends Gt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>B(n)||j(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ke(e))this.add(t);else{const[n,...i]=e,r=this.get(n,!0);if(P(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,ot(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if(P(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&E(r)?r.value:r:P(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j(t))return!1;const n=t.value;return n==null||e&&E(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return P(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const r=this.get(n,!0);if(P(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,ot(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const ti=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function le(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const de=(s,e,t)=>s.endsWith(`
|
|
3
|
+
`)?le(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+le(t,e):(s.endsWith(" ")?"":" ")+t,Ms="flow",Ut="block",rt="quoted";function ut(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:l,onOverflow:o}={}){if(!i||i<0)return s;i<r&&(r=0);const a=Math.max(1+r,1+i-e.length);if(s.length<=a)return s;const c=[],d={};let f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let u,m,y=!1,h=-1,p=-1,g=-1;t===Ut&&(h=ds(s,h,e.length),h!==-1&&(f=h+a));for(let b;b=s[h+=1];){if(t===rt&&b==="\\"){switch(p=h,s[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}g=h}if(b===`
|
|
6
|
+
`)t===Ut&&(h=ds(s,h,e.length)),f=h+e.length+a,u=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
|
|
7
|
+
`&&m!==" "){const N=s[h+1];N&&N!==" "&&N!==`
|
|
8
|
+
`&&N!==" "&&(u=h)}if(h>=f)if(u)c.push(u),f=u+a,u=void 0;else if(t===rt){for(;m===" "||m===" ";)m=b,b=s[h+=1],y=!0;const N=h>g+1?h-2:p-1;if(d[N])return s;c.push(N),d[N]=!0,f=N+a,u=void 0}else y=!0}m=b}if(y&&o&&o(),c.length===0)return s;l&&l();let w=s.slice(0,c[0]);for(let b=0;b<c.length;++b){const N=c[b],C=c[b+1]||s.length;N===0?w=`
|
|
9
|
+
${e}${s.slice(0,C)}`:(t===rt&&d[N]&&(w+=`${s[N]}\\`),w+=`
|
|
10
|
+
${e}${s.slice(N+1,C)}`)}return w}function ds(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
|
|
11
|
+
`);n=e,i=e+1,r=s[i]}return n}const ht=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),dt=s=>/^(%|---|\.\.\.)/m.test(s);function si(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,l=0;r<i;++r)if(s[r]===`
|
|
12
|
+
`){if(r-l>n)return!0;if(l=r+1,i-l<=n)return!1}return!0}function Re(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(dt(s)?" ":"");let l="",o=0;for(let a=0,c=t[a];c;c=t[++a])if(c===" "&&t[a+1]==="\\"&&t[a+2]==="n"&&(l+=t.slice(o,a)+"\\ ",a+=1,o=a,c="\\"),c==="\\")switch(t[a+1]){case"u":{l+=t.slice(o,a);const d=t.substr(a+2,4);switch(d){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:d.substr(0,2)==="00"?l+="\\x"+d.substr(2):l+=t.substr(a,6)}a+=5,o=a+1}break;case"n":if(n||t[a+2]==='"'||t.length<i)a+=1;else{for(l+=t.slice(o,a)+`
|
|
13
|
+
|
|
14
|
+
`;t[a+2]==="\\"&&t[a+3]==="n"&&t[a+4]!=='"';)l+=`
|
|
15
|
+
`,a+=2;l+=r,t[a+2]===" "&&(l+="\\"),a+=1,o=a+1}break;default:a+=1}return l=o?l+t.slice(o):t,n?l:ut(l,r,rt,ht(e,!1))}function Ft(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Re(s,e);const t=e.indent||(dt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?n:ut(n,t,Ms,ht(e,!1))}function Oe(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Re;else{const i=s.includes('"'),r=s.includes("'");i&&!r?n=Ft:r&&!i?n=Re:n=t?Ft:Re}return n(s,e)}let Vt;try{Vt=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{Vt=/\n+(?!\n|$)/g}function lt({comment:s,type:e,value:t},n,i,r){const{blockQuote:l,commentString:o,lineWidth:a}=n.options;if(!l||/\n[\t ]+$/.test(t))return Oe(t,n);const c=n.indent||(n.forceBlockIndent||dt(t)?" ":""),d=l==="literal"?!0:l==="folded"||e===_.BLOCK_FOLDED?!1:e===_.BLOCK_LITERAL?!0:!si(t,a,c.length);if(!t)return d?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let f,u;for(u=t.length;u>0;--u){const C=t[u-1];if(C!==`
|
|
23
|
+
`&&C!==" "&&C!==" ")break}let m=t.substring(u);const y=m.indexOf(`
|
|
24
|
+
`);y===-1?f="-":t===m||y!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
25
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Vt,`$&${c}`));let h=!1,p,g=-1;for(p=0;p<t.length;++p){const C=t[p];if(C===" ")h=!0;else if(C===`
|
|
26
|
+
`)g=p;else break}let w=t.substring(0,g<p?g+1:p);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let N=(h?c?"2":"1":"")+f;if(s&&(N+=" "+o(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){const C=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let O=!1;const T=ht(n,!0);l!=="folded"&&e!==_.BLOCK_FOLDED&&(T.onOverflow=()=>{O=!0});const v=ut(`${w}${C}${m}`,c,Ut,T);if(!O)return`>${N}
|
|
28
|
+
${c}${v}`}return t=t.replace(/\n+/g,`$&${c}`),`|${N}
|
|
29
|
+
${c}${w}${t}${m}`}function ni(s,e,t,n){const{type:i,value:r}=s,{actualString:l,implicitKey:o,indent:a,indentStep:c,inFlow:d}=e;if(o&&r.includes(`
|
|
30
|
+
`)||d&&/[[\]{},]/.test(r))return Oe(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return o||d||!r.includes(`
|
|
31
|
+
`)?Oe(r,e):lt(s,e,t,n);if(!o&&!d&&i!==_.PLAIN&&r.includes(`
|
|
32
|
+
`))return lt(s,e,t,n);if(dt(r)){if(a==="")return e.forceBlockIndent=!0,lt(s,e,t,n);if(o&&a===c)return Oe(r,e)}const f=r.replace(/\n+/g,`$&
|
|
33
|
+
${a}`);if(l){const u=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),{compat:m,tags:y}=e.doc.schema;if(y.some(u)||m?.some(u))return Oe(r,e)}return o?f:ut(f,a,Ms,ht(e,!1))}function Qt(s,e,t,n){const{implicitKey:i,inFlow:r}=e,l=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:o}=s;o!==_.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(o=_.QUOTE_DOUBLE);const a=d=>{switch(d){case _.BLOCK_FOLDED:case _.BLOCK_LITERAL:return i||r?Oe(l.value,e):lt(l,e,t,n);case _.QUOTE_DOUBLE:return Re(l.value,e);case _.QUOTE_SINGLE:return Ft(l.value,e);case _.PLAIN:return ni(l,e,t,n);default:return null}};let c=a(o);if(c===null){const{defaultKeyType:d,defaultStringType:f}=e.options,u=i&&d||f;if(c=a(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}function Ps(s,e){const t=Object.assign({blockQuote:!0,commentString:ti,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},s.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function ii(s,e){if(e.tag){const i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(E(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));if(i.length>1){const r=i.filter(l=>l.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){const i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function ri(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],r=(E(s)||P(s))&&s.anchor;r&&_s(r)&&(t.add(r),i.push(`&${r}`));const l=s.tag??(e.default?null:e.tag);return l&&i.push(n.directives.tagString(l)),i.join(" ")}function Te(s,e,t,n){if(j(s))return s.toString(e,t,n);if(ye(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i;const r=B(s)?s:e.doc.createNode(s,{onTagObj:a=>i=a});i??(i=ii(e.doc.schema.tags,r));const l=ri(r,i,e);l.length>0&&(e.indentAtStart=(e.indentAtStart??0)+l.length+1);const o=typeof i.stringify=="function"?i.stringify(r,e,t,n):E(r)?Qt(r,e,t,n):r.toString(e,t,n);return l?E(r)||o[0]==="{"||o[0]==="["?`${l} ${o}`:`${l}
|
|
34
|
+
${e.indent}${o}`:o}function li({key:s,value:e},t,n,i){const{allNullValues:r,doc:l,indent:o,indentStep:a,options:{commentString:c,indentSeq:d,simpleKeys:f}}=t;let u=B(s)&&s.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(P(s)||!B(s)&&typeof s=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!f&&(!s||u&&e==null&&!t.inFlow||P(s)||(E(s)?s.type===_.BLOCK_FOLDED||s.type===_.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:o+a});let y=!1,h=!1,p=Te(s,t,()=>y=!0,()=>h=!0);if(!m&&!t.inFlow&&p.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),p===""?"?":m?`? ${p}`:p}else if(r&&!f||e==null&&m)return p=`? ${p}`,u&&!y?p+=de(p,t.indent,c(u)):h&&i&&i(),p;y&&(u=null),m?(u&&(p+=de(p,t.indent,c(u))),p=`? ${p}
|
|
35
|
+
${o}:`):(p=`${p}:`,u&&(p+=de(p,t.indent,c(u))));let g,w,b;B(e)?(g=!!e.spaceBefore,w=e.commentBefore,b=e.comment):(g=!1,w=null,b=null,e&&typeof e=="object"&&(e=l.createNode(e))),t.implicitKey=!1,!m&&!u&&E(e)&&(t.indentAtStart=p.length+1),h=!1,!d&&a.length>=2&&!t.inFlow&&!m&&Je(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1;const C=Te(e,t,()=>N=!0,()=>h=!0);let O=" ";if(u||g||w){if(O=g?`
|
|
36
|
+
`:"",w){const T=c(w);O+=`
|
|
37
|
+
${le(T,t.indent)}`}C===""&&!t.inFlow?O===`
|
|
38
|
+
`&&b&&(O=`
|
|
39
|
+
|
|
40
|
+
`):O+=`
|
|
41
|
+
${t.indent}`}else if(!m&&P(e)){const T=C[0],v=C.indexOf(`
|
|
42
|
+
`),L=v!==-1,X=t.inFlow??e.flow??e.items.length===0;if(L||!X){let te=!1;if(L&&(T==="&"||T==="!")){let M=C.indexOf(" ");T==="&"&&M!==-1&&M<v&&C[M+1]==="!"&&(M=C.indexOf(" ",M+1)),(M===-1||v<M)&&(te=!0)}te||(O=`
|
|
43
|
+
${t.indent}`)}}else(C===""||C[0]===`
|
|
44
|
+
`)&&(O="");return p+=O+C,t.inFlow?N&&n&&n():b&&!N?p+=de(p,t.indent,c(b)):h&&i&&i(),p}function Bs(s,e){(s==="debug"||s==="warn")&&console.warn(e)}const Ze="<<",oe={identify:s=>s===Ze||typeof s=="symbol"&&s.description===Ze,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new _(Symbol(Ze)),{addToJSMap:js}),stringify:()=>Ze},oi=(s,e)=>(oe.identify(e)||E(e)&&(!e.type||e.type===_.PLAIN)&&oe.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===oe.tag&&t.default);function js(s,e,t){if(t=s&&ye(t)?t.resolve(s.doc):t,Je(t))for(const n of t.items)Et(s,e,n);else if(Array.isArray(t))for(const n of t)Et(s,e,n);else Et(s,e,t)}function Et(s,e,t){const n=s&&ye(t)?t.resolve(s.doc):t;if(!Ve(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[r,l]of i)e instanceof Map?e.has(r)||e.set(r,l):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:l,writable:!0,enumerable:!0,configurable:!0});return e}function Ks(s,e,{key:t,value:n}){if(B(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(oi(s,t))js(s,e,n);else{const i=Q(t,"",s);if(e instanceof Map)e.set(i,Q(n,i,s));else if(e instanceof Set)e.add(i);else{const r=ai(t,i,s),l=Q(n,r,s);r in e?Object.defineProperty(e,r,{value:l,writable:!0,enumerable:!0,configurable:!0}):e[r]=l}}return e}function ai(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(B(s)&&t?.doc){const n=Ps(t.doc,{});n.anchors=new Set;for(const r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Bs(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Wt(s,e,t){const n=Ue(s,void 0,t),i=Ue(e,void 0,t);return new F(n,i)}class F{constructor(e,t=null){Object.defineProperty(this,W,{value:Os}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return B(t)&&(t=t.clone(e)),B(n)&&(n=n.clone(e)),new F(t,n)}toJSON(e,t){const n=t?.mapAsMap?new Map:{};return Ks(t,n,this)}toString(e,t,n){return e?.doc?li(this,e,t,n):JSON.stringify(this)}}function Ds(s,e,t){return(e.inFlow??s.flow?fi:ci)(s,e,t)}function ci({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:l,onComment:o}){const{indent:a,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null});let f=!1;const u=[];for(let y=0;y<e.length;++y){const h=e[y];let p=null;if(B(h))!f&&h.spaceBefore&&u.push(""),at(t,u,h.commentBefore,f),h.comment&&(p=h.comment);else if(j(h)){const w=B(h.key)?h.key:null;w&&(!f&&w.spaceBefore&&u.push(""),at(t,u,w.commentBefore,f))}f=!1;let g=Te(h,d,()=>p=null,()=>f=!0);p&&(g+=de(g,r,c(p))),f&&p&&(f=!1),u.push(n+g)}let m;if(u.length===0)m=i.start+i.end;else{m=u[0];for(let y=1;y<u.length;++y){const h=u[y];m+=h?`
|
|
45
|
+
${a}${h}`:`
|
|
46
|
+
`}}return s?(m+=`
|
|
47
|
+
`+le(c(s),a),o&&o()):f&&l&&l(),m}function fi({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:l,options:{commentString:o}}=e;n+=r;const a=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,d=0;const f=[];for(let y=0;y<s.length;++y){const h=s[y];let p=null;if(B(h))h.spaceBefore&&f.push(""),at(e,f,h.commentBefore,!1),h.comment&&(p=h.comment);else if(j(h)){const w=B(h.key)?h.key:null;w&&(w.spaceBefore&&f.push(""),at(e,f,w.commentBefore,!1),w.comment&&(c=!0));const b=B(h.value)?h.value:null;b?(b.comment&&(p=b.comment),b.commentBefore&&(c=!0)):h.value==null&&w?.comment&&(p=w.comment)}p&&(c=!0);let g=Te(h,a,()=>p=null);c||(c=f.length>d||g.includes(`
|
|
48
|
+
`)),y<s.length-1?g+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((w,b)=>w+b.length+2,2)+(g.length+2)>e.options.lineWidth)),c&&(g+=",")),p&&(g+=de(g,n,o(p))),f.push(g),d=f.length}const{start:u,end:m}=t;if(f.length===0)return u+m;if(!c){const y=f.reduce((h,p)=>h+p.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=u;for(const h of f)y+=h?`
|
|
49
|
+
${r}${i}${h}`:`
|
|
50
|
+
`;return`${y}
|
|
51
|
+
${i}${m}`}else return`${u}${l}${f.join(" ")}${l}${m}`}function at({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=le(e(n),s);t.push(r.trimStart())}}function pe(s,e){const t=E(e)?e.value:e;for(const n of s)if(j(n)&&(n.key===e||n.key===t||E(n.key)&&n.key.value===t))return n}class H extends Ls{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fe,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:r}=n,l=new this(e),o=(a,c)=>{if(typeof r=="function")c=r.call(t,a,c);else if(Array.isArray(r)&&!r.includes(a))return;(c!==void 0||i)&&l.items.push(Wt(a,c,n))};if(t instanceof Map)for(const[a,c]of t)o(a,c);else if(t&&typeof t=="object")for(const a of Object.keys(t))o(a,t[a]);return typeof e.sortMapEntries=="function"&&l.items.sort(e.sortMapEntries),l}add(e,t){let n;j(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new F(e,e?.value):n=new F(e.key,e.value);const i=pe(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);E(i.value)&&Es(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const l=this.items.findIndex(o=>r(n,o)<0);l===-1?this.items.push(n):this.items.splice(l,0,n)}else this.items.push(n)}delete(e){const t=pe(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const i=pe(this.items,e)?.value;return(!t&&E(i)?i.value:i)??void 0}has(e){return!!pe(this.items,e)}set(e,t){this.add(new F(e,t),!0)}toJSON(e,t,n){const i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const r of this.items)Ks(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!j(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ds(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Me={collection:"map",default:!0,nodeClass:H,tag:"tag:yaml.org,2002:map",resolve(s,e){return Ve(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>H.from(s,e,t)};class me extends Ls{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ee,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=et(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=et(e);if(typeof n!="number")return;const i=this.items[n];return!t&&E(i)?i.value:i}has(e){const t=et(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=et(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];E(i)&&Es(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let i=0;for(const r of this.items)n.push(Q(r,String(i++),t));return n}toString(e,t,n){return e?Ds(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let l=0;for(let o of t){if(typeof i=="function"){const a=t instanceof Set?o:String(l++);o=i.call(t,a,o)}r.items.push(Ue(o,void 0,n))}}return r}}function et(s){let e=E(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Pe={collection:"seq",default:!0,nodeClass:me,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Je(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>me.from(s,e,t)},pt={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Qt(s,e,t,n)}},mt={identify:s=>s==null,createNode:()=>new _(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _(null),stringify:({source:s},e)=>typeof s=="string"&&mt.test.test(s)?s:e.options.nullStr},Xt={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new _(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Xt.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function ee({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let l=r.indexOf(".");l<0&&(l=r.length,r+=".");let o=e-(r.length-l-1);for(;o-- >0;)r+="0"}return r}const qs={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ee},Rs={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():ee(s)}},Us={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new _(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:ee},gt=s=>typeof s=="bigint"||Number.isInteger(s),zt=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Fs(s,e,t){const{value:n}=s;return gt(n)&&n>=0?t+n.toString(e):ee(s)}const Vs={identify:s=>gt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>zt(s,2,8,t),stringify:s=>Fs(s,8,"0o")},Js={identify:gt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>zt(s,0,10,t),stringify:ee},xs={identify:s=>gt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>zt(s,2,16,t),stringify:s=>Fs(s,16,"0x")},ui=[Me,Pe,pt,mt,Xt,Vs,Js,xs,qs,Rs,Us];function ps(s){return typeof s=="bigint"||Number.isInteger(s)}const tt=({value:s})=>JSON.stringify(s),hi=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:tt},{identify:s=>s==null,createNode:()=>new _(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tt},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:tt},{identify:ps,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>ps(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:tt}],di={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},pi=[Me,Pe].concat(hi,di),Zt={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){const t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";const l=t;let o;if(typeof btoa=="function"){let a="";for(let c=0;c<l.length;++c)a+=String.fromCharCode(l[c]);o=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=_.BLOCK_LITERAL),e!==_.QUOTE_DOUBLE){const a=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(o.length/a),d=new Array(c);for(let f=0,u=0;f<c;++f,u+=a)d[f]=o.substr(u,a);o=d.join(e===_.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return Qt({comment:s,type:e,value:o},n,i,r)}};function Ys(s,e){if(Je(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!j(n)){if(Ve(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const i=n.items[0]||new F(new _(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
53
|
+
${i.key.commentBefore}`:n.commentBefore),n.comment){const r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
54
|
+
${r.comment}`:n.comment}n=i}s.items[t]=j(n)?n:new F(n)}}else e("Expected a sequence for this tag");return s}function Gs(s,e,t){const{replacer:n}=t,i=new me(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let l of e){typeof n=="function"&&(l=n.call(e,String(r++),l));let o,a;if(Array.isArray(l))if(l.length===2)o=l[0],a=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const c=Object.keys(l);if(c.length===1)o=c[0],a=l[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=l;i.items.push(Wt(o,a,t))}return i}const es={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ys,createNode:Gs};class Ae extends me{constructor(){super(),this.add=H.prototype.add.bind(this),this.delete=H.prototype.delete.bind(this),this.get=H.prototype.get.bind(this),this.has=H.prototype.has.bind(this),this.set=H.prototype.set.bind(this),this.tag=Ae.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const i of this.items){let r,l;if(j(i)?(r=Q(i.key,"",t),l=Q(i.value,r,t)):r=Q(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,l)}return n}static from(e,t,n){const i=Gs(e,t,n),r=new this;return r.items=i.items,r}}Ae.tag="tag:yaml.org,2002:omap";const ts={collection:"seq",identify:s=>s instanceof Map,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=Ys(s,e),n=[];for(const{key:i}of t.items)E(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ae,t)},createNode:(s,e,t)=>Ae.from(s,e,t)};function Hs({value:s,source:e},t){return e&&(s?Qs:Ws).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const Qs={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _(!0),stringify:Hs},Ws={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _(!1),stringify:Hs},mi={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ee},gi={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():ee(s)}},yi={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new _(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ee},xe=s=>typeof s=="bigint"||Number.isInteger(s);function yt(s,e,t,{intAsBigInt:n}){const i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}const l=BigInt(s);return i==="-"?BigInt(-1)*l:l}const r=parseInt(s,t);return i==="-"?-1*r:r}function ss(s,e,t){const{value:n}=s;if(xe(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return ee(s)}const bi={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>yt(s,2,2,t),stringify:s=>ss(s,2,"0b")},wi={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>yt(s,1,8,t),stringify:s=>ss(s,8,"0")},ki={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>yt(s,0,10,t),stringify:ee},vi={identify:xe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>yt(s,2,16,t),stringify:s=>ss(s,16,"0x")};class _e extends H{constructor(e){super(e),this.tag=_e.tag}add(e){let t;j(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new F(e.key,null):t=new F(e,null),pe(this.items,t.key)||this.items.push(t)}get(e,t){const n=pe(this.items,e);return!t&&j(n)?E(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=pe(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new F(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let l of t)typeof i=="function"&&(l=i.call(t,l,l)),r.items.push(Wt(l,null,n));return r}}_e.tag="tag:yaml.org,2002:set";const ns={collection:"map",identify:s=>s instanceof Set,nodeClass:_e,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>_e.from(s,e,t),resolve(s,e){if(Ve(s)){if(s.hasAllNullValues(!0))return Object.assign(new _e,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function is(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=l=>e?BigInt(l):Number(l),r=n.replace(/_/g,"").split(":").reduce((l,o)=>l*i(60)+i(o),i(0));return t==="-"?i(-1)*r:r}function Xs(s){let{value:e}=s,t=l=>l;if(typeof e=="bigint")t=l=>BigInt(l);else if(isNaN(e)||!isFinite(e))return ee(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const zs={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>is(s,t),stringify:Xs},Zs={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>is(s,!1),stringify:Xs},bt={identify:s=>s 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(s){const e=s.match(bt.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,r,l,o]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,i,r||0,l||0,o||0,a);const d=e[8];if(d&&d!=="Z"){let f=is(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},ms=[Me,Pe,pt,mt,Qs,Ws,bi,wi,ki,vi,mi,gi,yi,Zt,oe,ts,es,ns,zs,Zs,bt],gs=new Map([["core",ui],["failsafe",[Me,Pe,pt]],["json",pi],["yaml11",ms],["yaml-1.1",ms]]),ys={binary:Zt,bool:Xt,float:Us,floatExp:Rs,floatNaN:qs,floatTime:Zs,int:Js,intHex:xs,intOct:Vs,intTime:zs,map:Me,merge:oe,null:mt,omap:ts,pairs:es,seq:Pe,set:ns,timestamp:bt},Si={"tag:yaml.org,2002:binary":Zt,"tag:yaml.org,2002:merge":oe,"tag:yaml.org,2002:omap":ts,"tag:yaml.org,2002:pairs":es,"tag:yaml.org,2002:set":ns,"tag:yaml.org,2002:timestamp":bt};function Lt(s,e,t){const n=gs.get(e);if(n&&!s)return t&&!n.includes(oe)?n.concat(oe):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{const r=Array.from(gs.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(const r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(oe)),i.reduce((r,l)=>{const o=typeof l=="string"?ys[l]:l;if(!o){const a=JSON.stringify(l),c=Object.keys(ys).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return r.includes(o)||r.push(o),r},[])}const $i=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class rs{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:l,toStringDefaults:o}){this.compat=Array.isArray(e)?Lt(e,"compat"):e?Lt(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Si:{},this.tags=Lt(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,fe,{value:Me}),Object.defineProperty(this,se,{value:pt}),Object.defineProperty(this,Ee,{value:Pe}),this.sortMapEntries=typeof l=="function"?l:l===!0?$i:null}clone(){const e=Object.create(rs.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Ni(s,e){const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const a=s.directives.toString(s);a?(t.push(a),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=Ps(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const a=r(s.commentBefore);t.unshift(le(a,""))}let l=!1,o=null;if(s.contents){if(B(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const d=r(s.contents.commentBefore);t.push(le(d,""))}i.forceBlockIndent=!!s.comment,o=s.contents.comment}const a=o?void 0:()=>l=!0;let c=Te(s.contents,i,()=>o=null,a);o&&(c+=de(c,"",r(o))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Te(s.contents,i));if(s.directives?.docEnd)if(s.comment){const a=r(s.comment);a.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(le(a,""))):t.push(`... ${a}`)}else t.push("...");else{let a=s.comment;a&&l&&(a=a.replace(/^\n+/,"")),a&&((!l||o)&&t[t.length-1]!==""&&t.push(""),t.push(le(r(a),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}class wt{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,W,{value:Rt});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:l}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new U({version:l}),this.setSchema(l,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(wt.prototype,{[W]:{value:Rt}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=B(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Se(this.contents)&&this.contents.add(e)}addIn(e,t){Se(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Ts(this);e.anchor=!t||n.has(t)?Is(t||"a",n):t}return new Ht(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const p=w=>typeof w=="number"||w instanceof String||w instanceof Number,g=t.filter(p).map(String);g.length>0&&(t=t.concat(g)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:l,flow:o,keepUndefined:a,onTagObj:c,tag:d}=n??{},{onAnchor:f,setAnchors:u,sourceObjects:m}=zn(this,l||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},h=Ue(e,d,y);return o&&P(h)&&(h.flow=!0),u(),h}createPair(e,t,n={}){const i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new F(i,r)}delete(e){return Se(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ke(e)?this.contents==null?!1:(this.contents=null,!0):Se(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return P(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ke(e)?!t&&E(this.contents)?this.contents.value:this.contents:P(this.contents)?this.contents.getIn(e,t):void 0}has(e){return P(this.contents)?this.contents.has(e):!1}hasIn(e){return Ke(e)?this.contents!==void 0:P(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ot(this.schema,[e],t):Se(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ke(e)?this.contents=t:this.contents==null?this.contents=ot(this.schema,Array.from(e),t):Se(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new U({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new U({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new rs(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:l}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=Q(this.contents,t??"",o);if(typeof r=="function")for(const{count:c,res:d}of o.anchors.values())r(d,c);return typeof l=="function"?Ce(l,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Ni(this,e)}}function Se(s){if(P(s))return!0;throw new Error("Expected a YAML collection as document contents")}class en extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class De extends en{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Ci extends en{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const bs=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,l=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&l.length>80){const o=Math.min(r-39,l.length-79);l="…"+l.substring(o),r-=o-1}if(l.length>80&&(l=l.substring(0,79)+"…"),n>1&&/^ *$/.test(l.substring(0,r))){let o=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);o.length>80&&(o=o.substring(0,79)+`…
|
|
58
|
+
`),l=o+l}if(/[^ ]/.test(l)){let o=1;const a=t.linePos[1];a?.line===n&&a.col>i&&(o=Math.max(1,Math.min(a.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(o);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${l}
|
|
61
|
+
${c}
|
|
62
|
+
`}};function Ie(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:l,startOnNewline:o}){let a=!1,c=o,d=o,f="",u="",m=!1,y=!1,h=null,p=null,g=null,w=null,b=null,N=null,C=null;for(const v of s)switch(y&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&r(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),h&&(c&&v.type!=="comment"&&v.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),v.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&v.source.includes(" ")&&(h=v),d=!0;break;case"comment":{d||r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=v.source.substring(1)||" ";f?f+=u+L:f=L,u="",c=!1;break}case"newline":c?f?f+=v.source:(!N||t!=="seq-item-ind")&&(a=!0):u+=v.source,c=!0,m=!0,(p||g)&&(w=v),d=!0;break;case"anchor":p&&r(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&r(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=v,C??(C=v.offset),c=!1,d=!1,y=!0;break;case"tag":{g&&r(v,"MULTIPLE_TAGS","A node can have at most one tag"),g=v,C??(C=v.offset),c=!1,d=!1,y=!0;break}case t:(p||g)&&r(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),N&&r(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),N=v,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){b&&r(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=v,c=!1,d=!1;break}default:r(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),c=!1,d=!1}const O=s[s.length-1],T=O?O.offset+O.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=l||n?.type==="block-map"||n?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:N,spaceBefore:a,comment:f,hasNewline:m,anchor:p,tag:g,newlineAfterProp:w,end:T,start:C??T}}function Fe(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Fe(e.key)||Fe(e.value))return!0}return!1;default:return!0}}function Jt(s,e,t){if(e?.type==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Fe(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function tn(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,l)=>r===l||E(r)&&E(l)&&r.value===l.value;return e.some(r=>i(r.key,t))}const ws="All mapping items must start at the same column";function Oi({composeNode:s,composeEmptyNode:e},t,n,i,r){const l=r?.nodeClass??H,o=new l(t.schema);t.atRoot&&(t.atRoot=!1);let a=n.offset,c=null;for(const d of n.items){const{start:f,key:u,sep:m,value:y}=d,h=Ie(f,{indicator:"explicit-key-ind",next:u??m?.[0],offset:a,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!h.found;if(p){if(u&&(u.type==="block-seq"?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&i(a,"BAD_INDENT",ws)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(o.comment?o.comment+=`
|
|
64
|
+
`+h.comment:o.comment=h.comment);continue}(h.newlineAfterProp||Fe(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(a,"BAD_INDENT",ws);t.atKey=!0;const g=h.end,w=u?s(t,u,h,i):e(t,g,f,null,h,i);t.schema.compat&&Jt(n.indent,u,i),t.atKey=!1,tn(t,o.items,w)&&i(g,"DUPLICATE_KEY","Map keys must be unique");const b=Ie(m??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||u.type==="block-scalar"});if(a=b.end,b.found){p&&(y?.type==="block-map"&&!b.hasNewline&&i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<b.found.offset-1024&&i(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=y?s(t,y,b,i):e(t,a,m,null,b,i);t.schema.compat&&Jt(n.indent,y,i),a=N.range[2];const C=new F(w,N);t.options.keepSourceTokens&&(C.srcToken=d),o.items.push(C)}else{p&&i(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(w.comment?w.comment+=`
|
|
65
|
+
`+b.comment:w.comment=b.comment);const N=new F(w);t.options.keepSourceTokens&&(N.srcToken=d),o.items.push(N)}}return c&&c<a&&i(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[n.offset,a,c??a],o}function Ai({composeNode:s,composeEmptyNode:e},t,n,i,r){const l=r?.nodeClass??me,o=new l(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let a=n.offset,c=null;for(const{start:d,value:f}of n.items){const u=Ie(d,{indicator:"seq-item-ind",next:f,offset:a,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(o.comment=u.comment);continue}const m=f?s(t,f,u,i):e(t,u.end,d,null,u,i);t.schema.compat&&Jt(n.indent,f,i),a=m.range[2],o.items.push(m)}return o.range=[n.offset,a,c??a],o}function Ye(s,e,t,n){let i="";if(s){let r=!1,l="";for(const o of s){const{source:a,type:c}=o;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=a.substring(1)||" ";i?i+=l+d:i=d,l="";break}case"newline":i&&(l+=a),r=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:i,offset:e}}const Mt="Block collections are not allowed within flow collections",Pt=s=>s&&(s.type==="block-map"||s.type==="block-seq");function _i({composeNode:s,composeEmptyNode:e},t,n,i,r){const l=n.start.source==="{",o=l?"flow map":"flow sequence",a=r?.nodeClass??(l?H:me),c=new a(t.schema);c.flow=!0;const d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){const g=n.items[p],{start:w,key:b,sep:N,value:C}=g,O=Ie(w,{flow:o,indicator:"explicit-key-ind",next:b??N?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!N&&!C){p===0&&O.comma?i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):p<n.items.length-1&&i(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),O.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+O.comment:c.comment=O.comment),f=O.end;continue}!l&&t.options.strict&&Fe(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)O.comma&&i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(O.comma||i(O.start,"MISSING_CHAR",`Missing , between ${o} items`),O.comment){let T="";e:for(const v of w)switch(v.type){case"comma":case"space":break;case"comment":T=v.source.substring(1);break e;default:break e}if(T){let v=c.items[c.items.length-1];j(v)&&(v=v.value??v.key),v.comment?v.comment+=`
|
|
67
|
+
`+T:v.comment=T,O.comment=O.comment.substring(T.length+1)}}if(!l&&!N&&!O.found){const T=C?s(t,C,O,i):e(t,O.end,N,null,O,i);c.items.push(T),f=T.range[2],Pt(C)&&i(T.range,"BLOCK_IN_FLOW",Mt)}else{t.atKey=!0;const T=O.end,v=b?s(t,b,O,i):e(t,T,w,null,O,i);Pt(b)&&i(v.range,"BLOCK_IN_FLOW",Mt),t.atKey=!1;const L=Ie(N??[],{flow:o,indicator:"map-value-ind",next:C,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(L.found){if(!l&&!O.found&&t.options.strict){if(N)for(const M of N){if(M===L.found)break;if(M.type==="newline"){i(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<L.found.offset-1024&&i(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${o}`):i(L.start,"MISSING_CHAR",`Missing , or : between ${o} items`));const X=C?s(t,C,L,i):L.found?e(t,L.end,N,null,L,i):null;X?Pt(C)&&i(X.range,"BLOCK_IN_FLOW",Mt):L.comment&&(v.comment?v.comment+=`
|
|
68
|
+
`+L.comment:v.comment=L.comment);const te=new F(v,X);if(t.options.keepSourceTokens&&(te.srcToken=g),l){const M=c;tn(t,M.items,v)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),M.items.push(te)}else{const M=new H(t.schema);M.flow=!0,M.items.push(te);const be=(X??v).range;M.range=[v.range[0],be[1],be[2]],c.items.push(M)}f=X?X.range[2]:L.end}}const u=l?"}":"]",[m,...y]=n.end;let h=f;if(m?.source===u)h=m.offset+m.source.length;else{const p=o[0].toUpperCase()+o.substring(1),g=d?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(f,d?"MISSING_CHAR":"BAD_INDENT",g),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){const p=Ye(y,h,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+p.comment:c.comment=p.comment),c.range=[n.offset,h,p.offset]}else c.range=[n.offset,h,h];return c}function Bt(s,e,t,n,i,r){const l=t.type==="block-map"?Oi(s,e,t,n,r):t.type==="block-seq"?Ai(s,e,t,n,r):_i(s,e,t,n,r),o=l.constructor;return i==="!"||i===o.tagName?(l.tag=o.tagName,l):(i&&(l.tag=i),l)}function Ti(s,e,t,n,i){const r=n.tag,l=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){const{anchor:u,newlineAfterProp:m}=n,y=u&&r?u.offset>r.offset?u:r:u??r;y&&(!m||m.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}const o=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!l||l==="!"||l===H.tagName&&o==="map"||l===me.tagName&&o==="seq")return Bt(s,e,t,i,l);let a=e.schema.tags.find(u=>u.tag===l&&u.collection===o);if(!a){const u=e.schema.knownTags[l];if(u?.collection===o)e.schema.tags.push(Object.assign({},u,{default:!1})),a=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${o} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Bt(s,e,t,i,l)}const c=Bt(s,e,t,i,l,a),d=a.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=B(d)?d:new _(d);return f.range=c.range,f.tag=l,a?.format&&(f.format=a.format),f}function Ii(s,e,t){const n=e.offset,i=Ei(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?_.BLOCK_FOLDED:_.BLOCK_LITERAL,l=e.source?Li(e.source):[];let o=l.length;for(let h=l.length-1;h>=0;--h){const p=l[h][1];if(p===""||p==="\r")o=h;else break}if(o===0){const h=i.chomp==="+"&&l.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,l.length-1)):"";let p=n+i.length;return e.source&&(p+=e.source.length),{value:h,type:r,comment:i.comment,range:[n,p,p]}}let a=e.indent+i.indent,c=e.offset+i.length,d=0;for(let h=0;h<o;++h){const[p,g]=l[h];if(g===""||g==="\r")i.indent===0&&p.length>a&&(a=p.length);else{p.length<a&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(a=p.length),d=h,a===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+g.length+1}for(let h=l.length-1;h>=o;--h)l[h][0].length>a&&(o=h+1);let f="",u="",m=!1;for(let h=0;h<d;++h)f+=l[h][0].slice(a)+`
|
|
71
|
+
`;for(let h=d;h<o;++h){let[p,g]=l[h];c+=p.length+g.length+1;const w=g[g.length-1]==="\r";if(w&&(g=g.slice(0,-1)),g&&p.length<a){const N=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-g.length-(w?2:1),"BAD_INDENT",N),p=""}r===_.BLOCK_LITERAL?(f+=u+p.slice(a)+g,u=`
|
|
72
|
+
`):p.length>a||g[0]===" "?(u===" "?u=`
|
|
73
|
+
`:!m&&u===`
|
|
74
|
+
`&&(u=`
|
|
75
|
+
|
|
76
|
+
`),f+=u+p.slice(a)+g,u=`
|
|
77
|
+
`,m=!0):g===""?u===`
|
|
78
|
+
`?f+=`
|
|
79
|
+
`:u=`
|
|
80
|
+
`:(f+=u+g,u=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=o;h<l.length;++h)f+=`
|
|
81
|
+
`+l[h][0].slice(a);f[f.length-1]!==`
|
|
82
|
+
`&&(f+=`
|
|
83
|
+
`);break;default:f+=`
|
|
84
|
+
`}const y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function Ei({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let l=0,o="",a=-1;for(let u=1;u<i.length;++u){const m=i[u];if(!o&&(m==="-"||m==="+"))o=m;else{const y=Number(m);!l&&y?l=y:a===-1&&(a=s+u)}}a!==-1&&n(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",f=i.length;for(let u=1;u<e.length;++u){const m=e[u];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,d=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{const y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);const h=m.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:l,chomp:o,comment:d,length:f}}function Li(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let l=1;l<e.length;l+=2)r.push([e[l],e[l+1]]);return r}function Mi(s,e,t){const{offset:n,type:i,source:r,end:l}=s;let o,a;const c=(u,m,y)=>t(n+u,m,y);switch(i){case"scalar":o=_.PLAIN,a=Pi(r,c);break;case"single-quoted-scalar":o=_.QUOTE_SINGLE,a=Bi(r,c);break;case"double-quoted-scalar":o=_.QUOTE_DOUBLE,a=ji(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const d=n+r.length,f=Ye(l,d,e,t);return{value:a,type:o,comment:f.comment,range:[n,d,f.offset]}}function Pi(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),sn(s)}function Bi(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),sn(s.slice(1,-1)).replace(/''/g,"'")}function sn(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",l=e.lastIndex;for(t.lastIndex=l;n=t.exec(s);)n[1]===""?r===`
|
|
87
|
+
`?i+=r:r=`
|
|
88
|
+
`:(i+=r+n[1],r=" "),l=t.lastIndex;const o=/[ \t]*(.*)/sy;return o.lastIndex=l,n=o.exec(s),i+r+(n?.[1]??"")}function ji(s,e){let t="";for(let n=1;n<s.length-1;++n){const i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){const{fold:r,offset:l}=Ki(s,n);t+=r,n=l}else if(i==="\\"){let r=s[++n];const l=Di[r];if(l)t+=l;else if(r===`
|
|
91
|
+
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
92
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){const o={x:2,u:4,U:8}[r];t+=qi(s,n+1,o,e),n+=o}else{const o=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(i===" "||i===" "){const r=n;let l=s[n+1];for(;l===" "||l===" ";)l=s[++n+1];l!==`
|
|
93
|
+
`&&!(l==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function Ki(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
95
|
+
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
96
|
+
`);)n===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const Di={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function qi(s,e,t,n){const i=s.substr(e,t),l=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const o=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(l)}function nn(s,e,t,n){const{value:i,type:r,comment:l,range:o}=e.type==="block-scalar"?Ii(s,e,n):Mi(e,s.options.strict,n),a=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null;let c;s.options.stringKeys&&s.atKey?c=s.schema[se]:a?c=Ri(s.schema,i,a,t,n):e.type==="scalar"?c=Ui(s,i,e,n):c=s.schema[se];let d;try{const f=c.resolve(i,u=>n(t??e,"TAG_RESOLVE_FAILED",u),s.options);d=E(f)?f:new _(f)}catch(f){const u=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",u),d=new _(i)}return d.range=o,d.source=i,r&&(d.type=r),a&&(d.tag=a),c.format&&(d.format=c.format),l&&(d.comment=l),d}function Ri(s,e,t,n,i){if(t==="!")return s[se];const r=[];for(const o of s.tags)if(!o.collection&&o.tag===t)if(o.default&&o.test)r.push(o);else return o;for(const o of r)if(o.test?.test(e))return o;const l=s.knownTags[t];return l&&!l.collection?(s.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[se])}function Ui({atKey:s,directives:e,schema:t},n,i,r){const l=t.tags.find(o=>(o.default===!0||s&&o.default==="key")&&o.test?.test(n))||t[se];if(t.compat){const o=t.compat.find(a=>a.default&&a.test?.test(n))??t[se];if(l.tag!==o.tag){const a=e.tagString(l.tag),c=e.tagString(o.tag),d=`Value may be parsed as either ${a} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return l}function Fi(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}const Vi={composeNode:rn,composeEmptyNode:ls};function rn(s,e,t,n){const i=s.atKey,{spaceBefore:r,comment:l,anchor:o,tag:a}=t;let c,d=!0;switch(e.type){case"alias":c=Ji(s,e,n),(o||a)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=nn(s,e,a,n),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ti(Vi,s,e,t,n),o&&(c.anchor=o.source.substring(1))}catch(f){const u=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",u)}break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),d=!1}}return c??(c=ls(s,e.offset,void 0,null,t,n)),o&&c.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!E(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),l&&(e.type==="scalar"&&e.source===""?c.comment=l:c.commentBefore=l),s.options.keepSourceTokens&&d&&(c.srcToken=e),c}function ls(s,e,t,n,{spaceBefore:i,comment:r,anchor:l,tag:o,end:a},c){const d={type:"scalar",offset:Fi(e,t,n),indent:-1,source:""},f=nn(s,d,o,c);return l&&(f.anchor=l.source.substring(1),f.anchor===""&&c(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=a),f}function Ji({options:s},{offset:e,source:t,end:n},i){const r=new Ht(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=e+t.length,o=Ye(n,l,s.strict,i);return r.range=[e,l,o.offset],o.comment&&(r.comment=o.comment),r}function xi(s,e,{offset:t,start:n,value:i,end:r},l){const o=Object.assign({_directives:e},s),a=new wt(void 0,o),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},d=Ie(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:l,parentIndent:0,startOnNewline:!0});d.found&&(a.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&l(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=i?rn(c,i,d,l):ls(c,d.end,n,null,d,l);const f=a.contents.range[2],u=Ye(r,f,!1,l);return u.comment&&(a.comment=u.comment),a.range=[t,f,u.offset],a}function je(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function ks(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){const r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class Yi{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{const l=je(t);r?this.warnings.push(new Ci(l,n,i)):this.errors.push(new De(l,n,i))},this.directives=new U({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:i}=ks(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(P(r)&&!r.flow&&r.items.length>0){let l=r.items[0];j(l)&&(l=l.key);const o=l.commentBefore;l.commentBefore=o?`${n}
|
|
104
|
+
${o}`:n}else{const l=r.commentBefore;r.commentBefore=l?`${n}
|
|
105
|
+
${l}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ks(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{const r=je(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=xi(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new De(je(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new De(je(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=Ye(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new De(je(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const n=Object.assign({_directives:this.directives},this.options),i=new wt(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const ln="\uFEFF",on="",an="",xt="";function Gi(s){switch(s){case ln:return"byte-order-mark";case on:return"doc-mode";case an:return"flow-error-end";case xt:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
107
|
+
`:case`\r
|
|
108
|
+
`: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(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Z(s){switch(s){case void 0:case" ":case`
|
|
109
|
+
`:case"\r":case" ":return!0;default:return!1}}const vs=new Set("0123456789ABCDEFabcdef"),Hi=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),st=new Set(",[]{}"),Qi=new Set(` ,[]{}
|
|
110
|
+
\r `),jt=s=>!s||Qi.has(s);class Wi{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
111
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
112
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){const i=this.buffer[n+e+1];if(i===`
|
|
113
|
+
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
114
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Z(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
115
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ln&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield on,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&Z(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Z(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Z(t)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(jt),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Z(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield an,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"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(jt),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||Z(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let i=n.indexOf(`
|
|
116
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
117
|
+
`,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Z(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
|
|
118
|
+
`:e=r,t=0;break;case"\r":{const l=this.buffer[r+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
|
|
119
|
+
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
120
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
121
|
+
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,l=this.buffer[r];l==="\r"&&(l=this.buffer[--r]);const o=r;for(;l===" ";)l=this.buffer[--r];if(l===`
|
|
122
|
+
`&&r>=this.pos&&r+1+t>o)e=r;else break}while(!0);return yield xt,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(Z(r)||e&&st.has(r))break;t=n}else if(Z(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
123
|
+
`?(n+=1,i=`
|
|
124
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&st.has(r))break;if(i===`
|
|
125
|
+
`){const l=this.continueScalar(n+1);if(l===-1)break;n=Math.max(n,l-2)}}else{if(e&&st.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield xt,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(jt))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Z(t)||e&&st.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Z(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Hi.has(t))t=this.buffer[++e];else if(t==="%"&&vs.has(this.buffer[e+1])&&vs.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
126
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
127
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Xi{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function ce(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Ss(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function cn(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function nt(s){switch(s.type){case"document":return s.start;case"block-map":{const e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function $e(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function $s(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!ce(e.start,"explicit-key-ind")&&!ce(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,cn(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class zi{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Wi,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Gi(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&$s(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Ss(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Ss(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=nt(this.peek(2)),n=$e(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
128
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
129
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const l=[];for(let o=0;o<t.sep.length;++o){const a=t.sep[o];switch(a.type){case"newline":l.push(o);break;case"space":break;case"comment":a.indent>e.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(r=t.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ce(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(cn(t.key)&&!ce(t.sep,"newline")){const l=$e(t.start),o=t.key,a=t.sep;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:o,sep:a}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ce(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const l=$e(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ce(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:l,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(l):(Object.assign(t,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(e);if(l){if(l.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ce(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:r});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ce(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=nt(n),r=$e(i);$s(e);const l=e.end.splice(1,e.end.length);l.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
130
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
131
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=nt(e),n=$e(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=nt(e),n=$e(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Zi(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Xi||null,prettyErrors:e}}function er(s,e={}){const{lineCounter:t,prettyErrors:n}=Zi(e),i=new zi(t?.addNewLine),r=new Yi(e);let l=null;for(const o of r.compose(i.parse(s),!0,s.length))if(!l)l=o;else if(l.options.logLevel!=="silent"){l.errors.push(new De(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(l.errors.forEach(bs(s,t)),l.warnings.forEach(bs(s,t))),l}function tr(s,e,t){let n;const i=er(s,t);if(!i)return null;if(i.warnings.forEach(r=>Bs(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}const sr="https://api.kilo.ai/api/marketplace/mcps",nr=/^[\w\-@.]+$/;function ne(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:{}}function G(s){return typeof s=="string"?s:""}function ge(s){return Array.isArray(s)?s.filter(e=>typeof e=="string"):[]}function Kt(s){return s==null?"":JSON.stringify(s,null,2)}function Dt(s){const e=ne(s),t=Object.entries(e).flatMap(([n,i])=>typeof i=="string"?[[n,i]]:[]);if(t.length)return Object.fromEntries(t)}function Ns(s,e,t){const n=re(s);if(!n)return{};try{const i=JSON.parse(n);if(!i||typeof i!="object"||Array.isArray(i)){t(`${e} must be a JSON object.`);return}for(const[r,l]of Object.entries(i))if(typeof l!="string"){t(`${e}.${r} must be a string.`);return}return i}catch(i){t(`${e}: ${ct(i)}`);return}}function ir(s,e){const t=re(s);if(t)try{const n=JSON.parse(t);if(n===!1)return!1;if(!n||typeof n!="object"||Array.isArray(n)){e("OAuth must be a JSON object or false.");return}for(const[i,r]of Object.entries(n))if(typeof r!="string"){e(`OAuth.${i} must be a string.`);return}return n}catch(n){e(`OAuth: ${ct(n)}`);return}}function rr(s,e){const t=re(s);if(!t)return;const n=Number(t);if(Number.isFinite(n)&&n>0)return n;e("Timeout must be a positive number of milliseconds.")}function lr(s){const e=ne(s),t=G(e.name),n=G(e.content);if(!t||!n)return;const i=fn(e.parameters),r=ge(e.prerequisites);return{name:t,content:n,...i.length?{parameters:i}:{},...r.length?{prerequisites:r}:{}}}function or(s){const e=ne(s),t=G(e.key),n=G(e.name)||t;if(!t||!n)return;const i=G(e.placeholder);return{name:n,key:t,...i?{placeholder:i}:{},...e.optional===!0?{optional:!0}:{}}}function fn(s){return Array.isArray(s)?s.flatMap(e=>{const t=or(e);return t?[t]:[]}):[]}function ar(s){return Array.isArray(s)?s.flatMap(e=>{const t=lr(e);return t?[t]:[]}):[]}function cr(s){const e=ne(s),t=G(e.id),n=G(e.name)||t,i=G(e.description),r=ar(e.content),l=typeof e.content=="string"?e.content:r;if(!t||!n||!i)return[];if(Array.isArray(l)&&!l.length)return[];const o=ge(e.tags),a=fn(e.parameters),c=ge(e.prerequisites),d=G(e.author),f=G(e.authorUrl),u=G(e.url);return[{type:"mcp",id:t,name:n,description:i,content:l,...d?{author:d}:{},...f?{authorUrl:f}:{},...u?{url:u}:{},...o.length?{tags:o}:{},...a.length?{parameters:a}:{},...c.length?{prerequisites:c}:{}}]}async function fr(){const s=await fetch(sr);if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);const e=await s.text(),t=(()=>{try{return JSON.parse(e)}catch{return tr(e)}})();return(Array.isArray(t.items)?t.items:[]).flatMap(cr).sort((i,r)=>i.name.localeCompare(r.name))}function ur(s){return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function hr(s,e){return Object.entries(e).reduce((t,[n,i])=>{const r=ur(String(i??""));return t.replaceAll(`{{${n}}}`,r).replaceAll(`\${${n}}`,r)},s)}function dr(s){if(s.type==="local"&&Array.isArray(s.command)){const t={type:"local",command:ge(s.command)},n=Dt(s.environment??s.env);return n&&(t.environment=n),s.enabled===!1&&(t.enabled=!1),typeof s.timeout=="number"&&(t.timeout=s.timeout),t}if(typeof s.url=="string"){const e={type:"remote",url:s.url},t=Dt(s.headers),n=s.oauth===!1||ne(s.oauth)===s.oauth?s.oauth:void 0;return t&&(e.headers=t),(n===!1||n&&typeof n=="object")&&(e.oauth=n),s.enabled===!1&&(e.enabled=!1),typeof s.timeout=="number"&&(e.timeout=s.timeout),e}if(typeof s.command=="string"){const e={type:"local",command:[s.command,...ge(s.args)]},t=Dt(s.env);return t&&(e.environment=t),s.enabled===!1&&(e.enabled=!1),typeof s.timeout=="number"&&(e.timeout=s.timeout),e}return s}function pr(s,e,t){try{const n=JSON.parse(hr(s,e));if(!n||typeof n!="object"||Array.isArray(n)){t("Marketplace MCP content must resolve to a JSON object.");return}return dr(n)}catch(n){t(`Invalid MCP marketplace config: ${ct(n)}`);return}}function mr(s){const e=ne(s);return e.type==="remote"&&typeof e.url=="string"?e.url:Array.isArray(e.command)?ge(e.command).join(" "):e.enabled===!1?"Disabled override":Kn(s)}function Cs(s){const e=ne(s);return e.type==="remote"||typeof e.url=="string"?"remote":e.type==="local"||Array.isArray(e.command)||typeof e.command=="string"?"local":"override"}function gr(s){return ne(s).enabled!==!1}function yr(s,e){return s?.local??e??s?.value}function br(s){return s?.source??"system"}function wr(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>re(e)!==""))}function kr(){const s=xn(),e=()=>s.data(),[t,n]=R("closed"),[i,r]=R(""),[l,o]=R(""),[a,c]=R("all"),[d,f]=R([]),[u,m]=R(),[y,h]=R(""),[p,g]=R({}),[w,b]=R(),[N,C]=R(),[O,T]=R(""),[v,L]=R("local"),[X,te]=R(""),[M,be]=R(""),[os,kt]=R(""),[as,vt]=R(""),[St,$t]=R(""),[Nt,Ct]=R(""),[Ot,At]=R(!0),[we,un]=Ln(fr),Ge=z(()=>{const k=e();if(!k)return[];const A=new Map(k.overlay.collections.mcp.map(K=>[K.key,K])),q=new Map((we()??[]).map(K=>[K.id,K])),Y=k.effective.mcp??{};return[...new Set([...Object.keys(Y),...Object.keys(k.mcp),...A.keys()])].sort((K,J)=>K.localeCompare(J)).map(K=>{const J=A.get(K),ae=yr(J,Y[K]),ke=q.get(K);return{id:K,name:ke?.name??K,summary:mr(ae),kind:Cs(ae),enabled:gr(ae),config:ae,status:k.mcp[K],source:br(J),inherited:J?.inherited,overridden:J?.overridden,editable:J?.editable,revert:k.overlay.scope==="project"&&J?.local!==void 0&&J.global!==void 0,path:J?.path,market:ke}})}),hn=z(()=>{const k=i().trim().toLowerCase();return k?Ge().filter(A=>`${A.name} ${A.id} ${A.summary} ${A.status?.status??""}`.toLowerCase().includes(k)):Ge()}),He=z(()=>new Set(Ge().map(k=>k.id))),dn=z(()=>{const k=new Map;for(const A of we()??[])for(const q of A.tags??[])k.set(q,(k.get(q)??0)+1);return[...k.keys()].sort((A,q)=>A.localeCompare(q))}),pn=z(()=>we.error?ct(we.error):""),mn=z(()=>{const k=l().trim().toLowerCase(),A=d(),q=a();return(we()??[]).filter(Y=>{const ue=He().has(Y.id);return q==="installed"&&!ue||q==="notInstalled"&&ue||A.length&&!A.some(K=>Y.tags?.includes(K))?!1:k?`${Y.name} ${Y.id} ${Y.description} ${Y.author??""}`.toLowerCase().includes(k):!0})}),_t=z(()=>{const k=u();return!k||typeof k.content=="string"?[]:k.content}),Qe=z(()=>_t().find(k=>k.name===y())??_t()[0]),cs=z(()=>Qe()?.parameters??u()?.parameters??[]),gn=z(()=>Qe()?.prerequisites??u()?.prerequisites??[]),fs=z(()=>cs().every(k=>k.optional||re(p()[k.key]??"")));function Tt(){n("closed")}function yn(){n("market")}function bn(){b(void 0),T(""),L("local"),te(""),be(""),kt(""),vt(""),$t(""),Ct(""),At(!0),n("config")}function wn(k){m(k);const A=Array.isArray(k.content)?k.content:[];h(A[0]?.name??""),g({}),n("install")}function kn(k){const A=ne(k.config);b(k.id),T(k.id),L(Cs(k.config)==="remote"?"remote":"local"),te(Array.isArray(A.command)?ge(A.command).join(" "):""),be(G(A.url)),kt(Kt(A.environment??A.env)),vt(Kt(A.headers)),$t(Kt(A.oauth)),Ct(typeof A.timeout=="number"?String(A.timeout):""),At(A.enabled!==!1),n("config")}function vn(k,A){g({...p(),[k]:A})}function Sn(k){const A=d();f(A.includes(k)?A.filter(q=>q!==k):[...A,k])}function $n(){const k=u();if(!k)return;if(He().has(k.id)){s.fail("MCP server is already installed. Remove it before installing again.");return}if(!fs()){s.fail("Fill all required MCP installation parameters before installing.");return}const A=typeof k.content=="string"?k.content:Qe()?.content;if(!A){s.fail("Marketplace item does not include MCP installation content.");return}const q=pr(A,wr(p()),s.fail);q&&(s.save({mcp:{[k.id]:q}}),Tt())}function Nn(){const k=re(O());if(!k||!nr.test(k)||k.includes("..")||k.includes("/")||k.includes("\\")){s.fail("MCP server ID must contain only letters, numbers, underscores, dashes, dots, or @.");return}if(!w()&&He().has(k)){s.fail("MCP server ID is already configured.");return}const A=rr(Nt(),s.fail);if(re(Nt())&&A===void 0)return;const q=(()=>{if(v()==="remote"){const J=re(M());if(!J){s.fail("Enter the remote MCP server URL before saving.");return}const ae=Ns(as(),"Headers",s.fail),ke=ir(St(),s.fail);if(!ae||re(St())&&ke===void 0)return;const We={type:"remote",url:J,enabled:Ot(),command:null,environment:null,env:null};return We.headers=Object.keys(ae).length?ae:null,We.oauth=ke!==void 0?ke:null,We.timeout=A!==void 0?A:null,We}const Y=jn(X());if(!Y.length){s.fail("Enter the local MCP command before saving.");return}const ue=Ns(os(),"Environment",s.fail);if(!ue)return;const K={type:"local",command:Y,enabled:Ot(),url:null,headers:null,oauth:null,env:null};return K.environment=Object.keys(ue).length?ue:null,K.timeout=A!==void 0?A:null,K})();q&&(s.save({mcp:{[k]:q}}),Tt())}function Cn(k){const q={...ne(k.config),enabled:!k.enabled};s.save({mcp:{[k.id]:q}})}function On(k){s.run("Connecting MCP server",()=>Bn(s.target(),k.id))}function An(k){s.run("Disconnecting MCP server",()=>Pn(s.target(),k.id))}function _n(k){s.run("Authenticating MCP server",()=>Mn(s.target(),k.id))}function Tn(k){C(k)}function In(){C(void 0)}function En(){const k=N();k?.path&&(s.unset([k.path]),C(void 0))}return{ctx:s,snap:e,mode:t,search:i,setSearch:r,filter:l,setFilter:o,status:a,setStatus:c,picked:d,catalog:we,catalogActions:un,rows:Ge,visible:hn,installed:He,tags:dn,marketError:pn,marketVisible:mn,choice:u,methods:_t,method:Qe,methodName:y,setMethodName:h,parameters:cs,prerequisites:gn,params:p,setParam:vn,valid:fs,editing:w,pending:N,id:O,setId:T,type:v,setType:L,command:X,setCommand:te,url:M,setUrl:be,env:os,setEnv:kt,headers:as,setHeaders:vt,auth:St,setAuth:$t,limit:Nt,setLimit:Ct,enabled:Ot,setEnabled:At,close:Tt,openMarket:yn,openManual:bn,openInstall:wn,edit:kn,toggleTag:Sn,install:$n,save:Nn,toggle:Cn,connect:On,disconnect:An,authenticate:_n,ask:Tn,cancel:In,confirm:En}}var vr=I('<div class="providers mcp-servers">'),qt=I("<div class=drawer-scrim>"),Sr=I("<div class=mcp-tag-filters>"),$r=I("<div class=mcp-market-grid>"),Nr=I('<aside class="provider-drawer mcp-drawer"aria-label="Install MCP server"><header class=drawer-header><div><h2>Install MCP server</h2><span>Browse the Kilo Marketplace MCP catalog and install into the current settings scope.</span></div></header><div class=mcp-market-body><div class=mcp-market-filters><div class=mcp-status-filter><span>Status'),Cr=I('<label class="wide required-field">URL<input placeholder=https://mcp.example.com>'),Or=I(`<label class="wide optional-field">Headers JSON<textarea placeholder="{
|
|
132
|
+
"Authorization": "Bearer {env:MCP_TOKEN}"
|
|
133
|
+
}">`),Ar=I(`<label class="wide optional-field">OAuth JSON or false<textarea placeholder="{
|
|
134
|
+
"clientId": "...",
|
|
135
|
+
"scope": "read"
|
|
136
|
+
}">`),_r=I('<aside class="provider-drawer mcp-drawer"aria-label="MCP server configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form mcp-config-form"><label class=required-field>Server ID<input placeholder=github></label><label class=required-field>Type</label><label class=optional-field>State</label><label class=optional-field>Timeout ms<input inputmode=numeric placeholder=30000></label></div><footer class=drawer-footer>'),Tr=I("<span class=config-title-count>MCP Servers"),Ir=I("<p class=empty>"),Er=I("<p class=mcp-server-error>"),Lr=I('<article class="provider configured-provider mcp-server"><div class="provider-title mcp-title"><div><strong></strong><span></span><em></em></div></div><div class="tags mcp-server-tags"></div><div class="provider-actions mcp-server-actions">'),Mr=I("<button class=mcp-tag-filter type=button>"),Pr=I("<p class=empty>Loading marketplace MCP servers..."),Br=I("<p class=empty>No marketplace MCP servers match this filter."),jr=I('<article class=mcp-market-card><div class=mcp-market-card-head><div><strong></strong><span class=mcp-market-id></span></div></div><p></p><div class="tags mcp-market-card-tags"></div><div class=mcp-market-card-footer><div>'),Kr=I("<span class=mcp-market-author>by "),Dr=I("<a target=_blank rel=noreferrer>Source"),qr=I("<label>Installation method"),Rr=I("<section class=mcp-install-section><span>Prerequisites</span><ul>"),Ur=I("<section class=mcp-install-section><span>Parameters"),Fr=I('<aside class="provider-drawer mcp-drawer"aria-label="MCP install parameters"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-auth mcp-install-form"><p></p></div><footer class=drawer-footer>'),Vr=I("<li>"),Jr=I("<p>No parameters are required for this server."),xr=I("<label><input>"),Yr=I('<label class="wide required-field">Command<input placeholder="npx -y @modelcontextprotocol/server-filesystem .">'),Gr=I(`<label class="wide optional-field">Environment JSON<textarea placeholder="{
|
|
137
|
+
"GITHUB_TOKEN": "{env:GITHUB_TOKEN}"
|
|
138
|
+
}">`);const Hr=[{value:"all",label:"All"},{value:"installed",label:"Installed"},{value:"notInstalled",label:"Not installed"}],Qr=[{value:"local",label:"Local command"},{value:"remote",label:"Remote URL"}],Wr=[{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}];function il(){const s=kr();return S(D,{get when(){return s.snap()},children:e=>S(Rn,{get title(){return(()=>{var t=Tr();return t.firstChild,$(t,S(Vn,{get children(){return s.rows().length}}),null),t})()},description:"Install, configure, and manage Model Context Protocol servers available to Kilo agents.",get actions(){return[S(V,{icon:"plus",variant:"primary",get disabled(){return!!s.ctx.saving()},get onClick(){return s.openMarket},children:"Install MCP"}),S(V,{variant:"secondary",get disabled(){return!!s.ctx.saving()},get onClick(){return s.openManual},children:"Manual server"})]},get children(){return[S(us,{label:"Filter MCP servers",get value(){return s.search()},placeholder:"Filter by name, ID, command, URL, or status...",get onValue(){return s.setSearch}}),(()=>{var t=vr();return $(t,S(D,{get when(){return s.visible().length},get fallback(){return(()=>{var n=Ir();return $(n,()=>s.rows().length?"No MCP servers match this filter.":"No MCP servers configured. Install one from the Marketplace or add a manual server."),n})()},get children(){return S(ve,{get each(){return s.visible()},children:n=>(()=>{var i=Lr(),r=i.firstChild,l=r.firstChild,o=l.firstChild,a=o.nextSibling,c=a.nextSibling,d=r.nextSibling,f=d.nextSibling;return $(o,()=>n.name),$(a,()=>n.id),$(c,()=>n.summary),$(d,S(Un,{get source(){return n.source},get inherited(){return n.inherited},get overridden(){return n.overridden}}),null),$(d,S(Xe,{get children(){return n.kind}}),null),$(d,S(Fn,{get status(){return n.status?.status??(n.enabled?"configured":"disabled")}}),null),$(f,S(D,{get when(){return n.status?.status==="needs_auth"||n.status?.status==="needs_client_registration"},get children(){return S(V,{variant:"secondary",get disabled(){return!!s.ctx.saving()},onClick:()=>s.authenticate(n),children:"Authenticate"})}}),null),$(f,S(D,{get when(){return n.status?.status==="connected"},get children(){return S(V,{variant:"secondary",get disabled(){return!!s.ctx.saving()},onClick:()=>s.disconnect(n),children:"Disconnect"})}}),null),$(f,S(D,{get when(){return Be(()=>n.status?.status==="disabled")()&&n.enabled},get children(){return S(V,{variant:"secondary",get disabled(){return!!s.ctx.saving()},onClick:()=>s.connect(n),children:"Connect"})}}),null),$(f,S(V,{variant:"secondary",get disabled(){return!!s.ctx.saving()},onClick:()=>s.toggle(n),get children(){return n.enabled?"Disable":"Enable"}}),null),$(f,S(hs,{icon:"edit",variant:"ghost",get"aria-label"(){return`Configure ${n.name}`},get disabled(){return!!s.ctx.saving()||n.editable===!1||!n.config},onClick:()=>s.edit(n)}),null),$(f,S(hs,{icon:"trash",variant:"ghost",get"aria-label"(){return`${n.revert?"Revert":"Delete"} ${n.name}`},get disabled(){return!!s.ctx.saving()||!n.path||n.inherited&&!n.overridden},onClick:()=>s.ask(n)}),null),$(i,S(D,{get when(){return n.status?.status==="failed"||n.status?.status==="needs_client_registration"},get children(){var u=Er();return $(u,(()=>{var m=Be(()=>!!(n.status&&"error"in n.status));return()=>m()?n.status.error:"Authentication setup is required."})()),u}}),null),x(()=>i.classList.toggle("inherited",!!n.inherited)),i})()})}})),t})(),S(D,{get when(){return s.mode()==="market"},get children(){return[(()=>{var t=qt();return It(t,"click",s.close,!0),t})(),(()=>{var t=Nr(),n=t.firstChild;n.firstChild;var i=n.nextSibling,r=i.firstChild,l=r.firstChild;return l.firstChild,$(n,S(V,{variant:"ghost","aria-label":"Close MCP marketplace overlay",get onClick(){return s.close},children:"X"}),null),$(r,S(us,{class:"drawer-search mcp-market-search",label:"Filter marketplace MCP servers",get value(){return s.filter()},variant:"drawer",placeholder:"Search marketplace by name, ID, author, or description...",get onValue(){return s.setFilter}}),l),$(l,S(ze,{label:"Status filter",get value(){return s.status()},options:Hr,class:"mcp-status-select",get onSelect(){return s.setStatus}}),null),$(i,S(D,{get when(){return s.tags().length},get children(){var o=Sr();return $(o,S(ve,{get each(){return s.tags()},children:a=>(()=>{var c=Mr();return c.$$click=()=>s.toggleTag(a),$(c,S(Xe,{children:a})),x(()=>c.classList.toggle("active",!!s.picked().includes(a))),c})()})),o}}),null),$(i,S(D,{get when(){return s.marketError()},children:o=>S(qn,{class:"banner",variant:"info",get children(){return["Marketplace catalog could not be loaded: ",Be(()=>o())]}})}),null),$(i,S(D,{get when(){return!s.catalog.loading},get fallback(){return Pr()},get children(){return S(D,{get when(){return s.marketVisible().length},get fallback(){return Br()},get children(){var o=$r();return $(o,S(ve,{get each(){return s.marketVisible()},children:a=>(()=>{var c=jr(),d=c.firstChild,f=d.firstChild,u=f.firstChild,m=u.nextSibling,y=d.nextSibling,h=y.nextSibling,p=h.nextSibling,g=p.firstChild;return $(u,()=>a.name),$(f,S(D,{get when(){return a.author},children:w=>(()=>{var b=Kr();return b.firstChild,$(b,w,null),b})()}),m),$(m,()=>a.id),$(d,S(D,{get when(){return s.installed().has(a.id)},get children(){return S(Xe,{tone:"success",children:"Installed"})}}),null),$(y,()=>a.description),$(h,S(ve,{get each(){return a.tags??[]},children:w=>S(Xe,{children:w})})),$(g,S(D,{get when(){return a.url},children:w=>(()=>{var b=Dr();return x(()=>ie(b,"href",w())),b})()}),null),$(g,S(V,{variant:"primary",get disabled(){return!!s.ctx.saving()||s.installed().has(a.id)},onClick:()=>s.openInstall(a),children:"Install"}),null),c})()})),o}})}}),null),t})()]}}),S(D,{get when(){return Be(()=>s.mode()==="install")()&&s.choice()},children:t=>[(()=>{var n=qt();return It(n,"click",s.close,!0),n})(),(()=>{var n=Fr(),i=n.firstChild,r=i.firstChild,l=r.firstChild,o=l.nextSibling,a=i.nextSibling,c=a.firstChild,d=a.nextSibling;return $(l,()=>t().name),$(o,()=>t().id),$(i,S(V,{variant:"ghost","aria-label":"Close MCP install overlay",get onClick(){return s.close},children:"X"}),null),$(c,()=>t().description),$(a,S(D,{get when(){return s.methods().length>1},get children(){var f=qr();return f.firstChild,$(f,S(ze,{label:"Installation method",get value(){return s.methodName()},get options(){return s.methods().map(u=>({value:u.name,label:u.name}))},get onSelect(){return s.setMethodName}}),null),f}}),null),$(a,S(D,{get when(){return s.prerequisites().length},get children(){var f=Rr(),u=f.firstChild,m=u.nextSibling;return $(m,S(ve,{get each(){return s.prerequisites()},children:y=>(()=>{var h=Vr();return $(h,y),h})()})),f}}),null),$(a,S(D,{get when(){return s.parameters().length},get fallback(){return Jr()},get children(){var f=Ur();return f.firstChild,$(f,S(ve,{get each(){return s.parameters()},children:u=>(()=>{var m=xr(),y=m.firstChild;return $(m,()=>u.name,y),$(m,()=>u.optional?" (optional)":"",y),y.$$input=h=>s.setParam(u.key,h.currentTarget.value),ie(y,"spellcheck",!1),x(h=>{var p=!u.optional,g=u.placeholder??u.key;return p!==h.e&&m.classList.toggle("required-field",h.e=p),g!==h.t&&ie(y,"placeholder",h.t=g),h},{e:void 0,t:void 0}),x(()=>y.value=s.params()[u.key]??""),m})()}),null),f}}),null),$(d,S(V,{variant:"ghost",get onClick(){return s.openMarket},children:"Back"}),null),$(d,S(V,{variant:"primary",get disabled(){return!!s.ctx.saving()||!s.valid()},get onClick(){return s.install},children:"Install MCP"}),null),n})()]}),S(D,{get when(){return s.mode()==="config"},get children(){return[(()=>{var t=qt();return It(t,"click",s.close,!0),t})(),(()=>{var t=_r(),n=t.firstChild,i=n.firstChild,r=i.firstChild,l=r.nextSibling,o=n.nextSibling,a=o.firstChild,c=a.firstChild,d=c.nextSibling,f=a.nextSibling;f.firstChild;var u=f.nextSibling;u.firstChild;var m=u.nextSibling,y=m.firstChild,h=y.nextSibling,p=o.nextSibling;return $(r,()=>s.editing()?"Configure MCP server":"Add manual MCP server"),$(l,()=>s.editing()??"New MCP server"),$(n,S(V,{variant:"ghost","aria-label":"Close MCP configuration overlay",get onClick(){return s.close},children:"X"}),null),d.$$input=g=>s.setId(g.currentTarget.value),ie(d,"spellcheck",!1),$(f,S(ze,{label:"MCP server type",get value(){return s.type()},options:Qr,class:"mcp-config-select",get onSelect(){return s.setType}}),null),$(u,S(ze,{label:"MCP server state",get value(){return s.enabled()?"enabled":"disabled"},options:Wr,class:"mcp-config-select",onSelect:g=>s.setEnabled(g==="enabled")}),null),h.$$input=g=>s.setLimit(g.currentTarget.value),$(o,S(D,{get when(){return s.type()==="remote"},get fallback(){return[(()=>{var g=Yr(),w=g.firstChild,b=w.nextSibling;return b.$$input=N=>s.setCommand(N.currentTarget.value),ie(b,"spellcheck",!1),x(()=>b.value=s.command()),g})(),(()=>{var g=Gr(),w=g.firstChild,b=w.nextSibling;return b.$$input=N=>s.setEnv(N.currentTarget.value),ie(b,"spellcheck",!1),x(()=>b.value=s.env()),g})()]},get children(){return[(()=>{var g=Cr(),w=g.firstChild,b=w.nextSibling;return b.$$input=N=>s.setUrl(N.currentTarget.value),ie(b,"spellcheck",!1),x(()=>b.value=s.url()),g})(),(()=>{var g=Or(),w=g.firstChild,b=w.nextSibling;return b.$$input=N=>s.setHeaders(N.currentTarget.value),ie(b,"spellcheck",!1),x(()=>b.value=s.headers()),g})(),(()=>{var g=Ar(),w=g.firstChild,b=w.nextSibling;return b.$$input=N=>s.setAuth(N.currentTarget.value),ie(b,"spellcheck",!1),x(()=>b.value=s.auth()),g})()]}}),null),$(p,S(V,{variant:"ghost",get onClick(){return s.close},children:"Cancel"}),null),$(p,S(V,{variant:"primary",get disabled(){return!!s.ctx.saving()},get onClick(){return s.save},children:"Save MCP"}),null),x(()=>d.disabled=!!s.editing()),x(()=>d.value=s.id()),x(()=>h.value=s.limit()),t})()]}}),S(Jn,{get open(){return!!s.pending()},get title(){return`${s.pending()?.revert?"Revert":"Delete"} MCP server ${s.pending()?.name??""}?`},get message(){return Be(()=>!!s.pending()?.revert)()?`This removes the current-scope override for ${s.pending()?.id??"the MCP server"}.`:`This removes ${s.pending()?.id??"the MCP server"} from the current configuration.`},get confirm(){return s.pending()?.revert?"Revert":"Delete"},get busy(){return!!s.ctx.saving()},get onCancel(){return s.cancel},get onConfirm(){return s.confirm}})]}})})}Dn(["click","input"]);export{il as McpRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.kilo-console .mcp-server{position:relative}.kilo-console .mcp-title{align-items:flex-start}.kilo-console .mcp-title em{display:block;overflow:hidden;max-width:38rem;color:var(--muted-foreground);font-size:.6875rem;font-style:normal;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.kilo-console .mcp-server-tags{justify-content:flex-end}.kilo-console .mcp-server-actions{flex-wrap:nowrap}.kilo-console .mcp-server-error{grid-column:1 / -1;margin:-.25rem 0 0;border-top:1px solid var(--border-weak-base);color:var(--status-error-base);font-size:.6875rem;line-height:1.45;padding-top:.5rem}.kilo-console .mcp-drawer{width:min(52rem,calc(100vw - var(--app-rail-width)))}.kilo-console .mcp-market-body{flex:1 1 auto;display:flex;flex-direction:column;gap:.75rem;min-height:0;overflow:hidden;padding:1rem}.kilo-console .mcp-market-filters{display:grid;grid-template-columns:minmax(0,1fr) 11rem;gap:.75rem;align-items:end}.kilo-console .mcp-market-filters label,.kilo-console .mcp-status-filter{display:grid;gap:.35rem;color:var(--text-weak);font-size:var(--font-size-small)}.kilo-console .mcp-status-filter{align-content:end}.kilo-console .mcp-status-select{width:100%}.kilo-console .mcp-market-search{padding:0}.kilo-console .mcp-tag-filters{display:flex;gap:.375rem;flex-wrap:wrap;max-height:4.75rem;overflow:auto;padding-right:.25rem}.kilo-console .mcp-tag-filter{display:inline-flex;flex:0 0 auto;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;padding:0}.kilo-console .mcp-tag-filter.active [data-component=tag]{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 14%,var(--surface-base));color:var(--text-brand)}.kilo-console .mcp-market-grid{flex:1 1 auto;display:grid;align-content:start;align-items:start;grid-template-columns:1fr;grid-auto-rows:max-content;gap:.5rem;min-height:0;overflow:auto;padding-right:.25rem}.kilo-console .mcp-market-card{display:grid;align-content:start;gap:.625rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card);padding:.75rem}.kilo-console .mcp-market-card-head,.kilo-console .mcp-market-card-footer,.kilo-console .mcp-market-card-footer>div{display:flex;gap:.5rem;align-items:center}.kilo-console .mcp-market-card-head,.kilo-console .mcp-market-card-footer{justify-content:space-between}.kilo-console .mcp-market-card-head>div{min-width:0}.kilo-console .mcp-market-card strong,.kilo-console .mcp-market-card span{display:block}.kilo-console .mcp-market-card strong{overflow:hidden;color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.kilo-console .mcp-market-card span{color:var(--muted-foreground);font-family:var(--font-family-mono);font-size:.6875rem}.kilo-console .mcp-market-card .mcp-market-author{overflow:hidden;color:var(--muted-foreground);font-family:var(--font-family-sans);text-overflow:ellipsis;white-space:nowrap}.kilo-console .mcp-market-card .mcp-market-id{margin-top:.125rem}.kilo-console .mcp-market-card p{display:-webkit-box;overflow:hidden;min-height:2.9em;margin:0;-webkit-box-orient:vertical;color:var(--text-weak);font-size:.75rem;line-height:1.45;-webkit-line-clamp:2}.kilo-console .mcp-market-card-tags{justify-content:flex-start;min-height:1.25rem}.kilo-console .mcp-market-card-footer{align-self:end;justify-content:flex-end;color:var(--text-weaker);font-size:.6875rem}.kilo-console .mcp-market-card a{color:var(--text-brand);text-decoration:none}.kilo-console .mcp-install-form{gap:.875rem}.kilo-console .mcp-install-section{display:grid;gap:.5rem}.kilo-console .mcp-install-section>span{color:var(--text-base);font-size:.75rem;font-weight:500}.kilo-console .mcp-install-section ul{display:grid;gap:.375rem;margin:0;color:var(--text-weak);font-size:.75rem;padding-left:1rem}.kilo-console .mcp-config-form{grid-template-columns:1fr;align-content:start;gap:.75rem;overflow:auto;padding:1rem}.kilo-console .mcp-config-form textarea{min-height:7rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.kilo-console .resolved-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(18rem,1fr));gap:.85rem}.kilo-console .model-defaults{grid-template-columns:repeat(2,minmax(0,1fr))}.kilo-console .model-default-fields{gap:.5rem}.kilo-console .model-default-fields .default-model-card{gap:0;border-color:var(--border);border-radius:var(--radius-lg);background:var(--card);padding:1rem}.kilo-console .model-default-fields .default-model-header{align-items:flex-start;gap:.75rem}.kilo-console .model-default-fields .default-model-header>span{color:var(--muted-foreground);font-size:.6875rem;font-weight:400;letter-spacing:0;line-height:1rem;text-transform:none}.kilo-console .model-default-fields .default-model-actions{gap:.375rem;margin-top:-.125rem}.kilo-console .model-default-fields .default-model-value{gap:.25rem}.kilo-console .model-default-fields .default-model-value strong{color:var(--foreground);font-size:.75rem;font-weight:500;line-height:1.45}.kilo-console .model-default-fields .default-model-value .default-model-id{color:var(--muted-foreground);font-size:.6875rem;font-weight:400;line-height:1.45}.kilo-console .resolved-card{display:flex;gap:1rem;align-items:center;justify-content:space-between;border:1px solid var(--border-weak-base);border-radius:var(--radius-xl, var(--radius-lg));background:var(--surface-raised-base);padding:1rem}.kilo-console .resolved-card>div:first-child{display:grid;gap:.25rem;min-width:0}.kilo-console .resolved-card span:where(:not([data-component=tag]):not([data-slot=source-badge])){color:var(--text-weaker);font-size:var(--font-size-small);font-weight:700;text-transform:uppercase}.kilo-console .resolved-card strong{overflow:hidden;color:var(--text-strong);font-family:var(--font-family-mono, monospace);text-overflow:ellipsis;white-space:nowrap}.kilo-console .default-model-card{display:grid;align-items:stretch;gap:1rem;grid-template-columns:minmax(0,1fr);justify-content:stretch}.kilo-console .default-model-header{display:flex;gap:1rem;align-items:center;justify-content:space-between;min-width:0;width:100%}.kilo-console .default-model-actions{flex:0 0 auto;align-items:center}.kilo-console .default-model-value{display:grid;gap:.35rem;min-width:0}.kilo-console .default-model-value strong{font-family:var(--font-family-sans)}.kilo-console .default-model-value .default-model-id{overflow:hidden;color:var(--text-weaker);font-family:var(--font-family-mono, monospace);font-size:var(--font-size-small);font-weight:600;text-overflow:ellipsis;text-transform:none;white-space:nowrap}
|