@likec4/mcp 1.49.0 → 1.50.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/README.md +11 -1
- package/dist/THIRD-PARTY-LICENSES.md +77 -81
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +30 -0
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +7 -7
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +1 -0
- package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/_chunks/libs/chevrotain.mjs +35 -35
- package/dist/_chunks/libs/citty.mjs +1 -1
- package/dist/_chunks/libs/isexe.mjs +1 -0
- package/dist/_chunks/libs/langium.mjs +18 -17
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +2 -2
- package/dist/_chunks/libs/mdast-util-gfm.mjs +9 -9
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +7 -7
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -1
- package/dist/_chunks/libs/mnemonist.mjs +1 -1
- package/dist/_chunks/libs/nano-spawn.mjs +3 -0
- package/dist/_chunks/libs/remeda.mjs +2 -1
- package/dist/_chunks/libs/unified.mjs +1 -1
- package/dist/_chunks/libs/which.mjs +1 -0
- package/dist/index.mjs +737 -63
- package/package.json +12 -12
- package/dist/_chunks/libs/@chevrotain/gast.mjs +0 -1
- package/dist/_chunks/libs/pathe.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
For Further details.`,i}function
|
|
1
|
+
import{i as e,l as t,r as n,u as r}from"./chevrotain.mjs";import{C as i,E as a,L as o,N as s,P as c,_ as l,c as u,d,f,h as p,l as m,o as h,p as g,q as _,u as v,x as y,z as b}from"./@chevrotain/cst-dts-gen.mjs";function x(e,t,n){return`${e.name}_${t}_${n}`}var S=class{constructor(e){this.target=e}isEpsilon(){return!1}},C=class extends S{constructor(e,t){super(e),this.tokenType=t}},w=class extends S{constructor(e){super(e)}isEpsilon(){return!0}},T=class extends S{constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}};function ee(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};te(t,e);let n=e.length;for(let r=0;r<n;r++){let n=e[r],i=k(t,n,n);i!==void 0&&ce(t,n,i)}return t}function te(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r],i=R(e,n,void 0,{type:2}),a=R(e,n,void 0,{type:7});i.stop=a,e.ruleToStartState.set(n,i),e.ruleToStopState.set(n,a)}}function E(e,t,n){return n instanceof p?I(e,t,n.terminalType,n):n instanceof u?se(e,t,n):n instanceof h?ie(e,t,n):n instanceof m?ae(e,t,n):n instanceof v?D(e,t,n):n instanceof g?O(e,t,n):n instanceof d?ne(e,t,n):n instanceof f?re(e,t,n):k(e,t,n)}function D(e,t,n){let r=R(e,t,n,{type:5});return M(e,r),j(e,t,n,N(e,t,r,n,k(e,t,n)))}function O(e,t,n){let r=R(e,t,n,{type:5});return M(e,r),j(e,t,n,N(e,t,r,n,k(e,t,n)),I(e,t,n.separator,n))}function ne(e,t,n){let r=R(e,t,n,{type:4});return M(e,r),A(e,t,n,N(e,t,r,n,k(e,t,n)))}function re(e,t,n){let r=R(e,t,n,{type:4});return M(e,r),A(e,t,n,N(e,t,r,n,k(e,t,n)),I(e,t,n.separator,n))}function ie(e,t,n){let r=R(e,t,n,{type:1});return M(e,r),N(e,t,r,n,...c(n.definition,n=>E(e,t,n)))}function ae(e,t,n){let r=R(e,t,n,{type:1});return M(e,r),oe(e,t,n,N(e,t,r,n,k(e,t,n)))}function k(e,t,n){let r=o(c(n.definition,n=>E(e,t,n)),e=>e!==void 0);return r.length===1?r[0]:r.length===0?void 0:F(e,r)}function A(e,t,n,r,i){let a=r.left,o=r.right,s=R(e,t,n,{type:11});M(e,s);let c=R(e,t,n,{type:12});return a.loopback=s,c.loopback=s,e.decisionMap[x(t,i?`RepetitionMandatoryWithSeparator`:`RepetitionMandatory`,n.idx)]=s,L(o,s),i===void 0?(L(s,a),L(s,c)):(L(s,c),L(s,i.left),L(i.right,a)),{left:a,right:c}}function j(e,t,n,r,i){let a=r.left,o=r.right,s=R(e,t,n,{type:10});M(e,s);let c=R(e,t,n,{type:12}),l=R(e,t,n,{type:9});return s.loopback=l,c.loopback=l,L(s,a),L(s,c),L(o,l),i===void 0?L(l,s):(L(l,c),L(l,i.left),L(i.right,a)),e.decisionMap[x(t,i?`RepetitionWithSeparator`:`Repetition`,n.idx)]=s,{left:s,right:c}}function oe(e,t,n,r){let i=r.left,a=r.right;return L(i,a),e.decisionMap[x(t,`Option`,n.idx)]=i,r}function M(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function N(e,t,n,r,...i){let a=R(e,t,r,{type:8,start:n});n.end=a;for(let e of i)e===void 0?L(n,a):(L(n,e.left),L(e.right,a));let o={left:n,right:a};return e.decisionMap[x(t,P(r),r.idx)]=n,o}function P(e){if(e instanceof h)return`Alternation`;if(e instanceof m)return`Option`;if(e instanceof v)return`Repetition`;if(e instanceof g)return`RepetitionWithSeparator`;if(e instanceof d)return`RepetitionMandatory`;if(e instanceof f)return`RepetitionMandatoryWithSeparator`;throw Error(`Invalid production type encountered`)}function F(e,t){let n=t.length;for(let r=0;r<n-1;r++){let n=t[r],i;n.left.transitions.length===1&&(i=n.left.transitions[0]);let a=i instanceof T,o=i,s=t[r+1].left;n.left.type===1&&n.right.type===1&&i!==void 0&&(a&&o.followState===n.right||i.target===n.right)?(a?o.followState=s:i.target=s,B(e,n.right)):L(n.right,s)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function I(e,t,n,r){let i=R(e,t,r,{type:1}),a=R(e,t,r,{type:1});return z(i,new C(a,n)),{left:i,right:a}}function se(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),a=R(e,t,n,{type:1}),o=R(e,t,n,{type:1});return z(a,new T(i,r,o)),{left:a,right:o}}function ce(e,t,n){let r=e.ruleToStartState.get(t);L(r,n.left);let i=e.ruleToStopState.get(t);return L(n.right,i),{left:r,right:i}}function L(e,t){z(e,new w(t))}function R(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function z(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function B(e,t){e.states.splice(e.states.indexOf(t),1)}const V={};var H=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=U(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return c(this.configs,e=>e.alt)}get key(){let e=``;for(let t in this.map)e+=t+`:`;return e}};function U(e,t=!0){return`${t?`a${e.alt}`:``}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join(`_`)}`}function W(e,t){let n={};return r=>{let i=r.toString(),a=n[i];return a===void 0?(a={atnStartState:e,decision:t,states:{}},n[i]=a,a):a}}var G=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e=``,t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?`1`:`0`;return e}};const K=new G;var le=class extends n{constructor(e){super(),this.logging=e?.logging??(e=>console.log(e))}initialize(e){this.atn=ee(e.rules),this.dfas=J(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:a}=t,o=this.dfas,s=this.logging,l=x(r,`Alternation`,n),u=this.atn.decisionMap[l].decision,d=c(e({maxLookahead:1,occurrence:n,prodType:`Alternation`,rule:r}),e=>c(e,e=>e[0]));if(q(d,!1)&&!a){let e=y(d,(e,t,n)=>(b(t,t=>{t&&(e[t.tokenTypeIdx]=n,b(t.categoryMatches,t=>{e[t]=n}))}),e),{});return i?function(t){let n=e[this.LA(1).tokenTypeIdx];if(t!==void 0&&n!==void 0){let e=t[n]?.GATE;if(e!==void 0&&e.call(this)===!1)return}return n}:function(){return e[this.LA(1).tokenTypeIdx]}}else if(i)return function(e){let t=new G,n=e===void 0?0:e.length;for(let r=0;r<n;r++){let n=e?.[r].GATE;t.set(r,n===void 0||n.call(this))}let r=Y.call(this,o,u,t,s);return typeof r==`number`?r:void 0};else return function(){let e=Y.call(this,o,u,K,s);return typeof e==`number`?e:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:o}=t,s=this.dfas,l=this.logging,u=x(r,i,n),d=this.atn.decisionMap[u].decision,f=c(e({maxLookahead:1,occurrence:n,prodType:i,rule:r}),e=>c(e,e=>e[0]));if(q(f)&&f[0][0]&&!o){let e=f[0],t=_(e);if(t.length===1&&a(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=y(t,(e,t)=>(t!==void 0&&(e[t.tokenTypeIdx]=!0,b(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}return function(){let e=Y.call(this,s,d,K,l);return typeof e==`object`?!1:e===0}}};function q(e,t=!0){let n=new Set;for(let r of e){let e=new Set;for(let i of r){if(i===void 0){if(t)break;return!1}let r=[i.tokenTypeIdx].concat(i.categoryMatches);for(let t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function J(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=W(e.decisionStates[r],r);return n}function Y(e,t,n,r){let i=e[t](n),a=i.start;return a===void 0&&(a=Q(i,X(be(i.atnStartState))),i.start=a),ue.apply(this,[i,a,n,r])}function ue(e,t,n,r){let i=t,a=1,o=[],s=this.LA(a++);for(;;){let t=ge(i,s);if(t===void 0&&(t=de.apply(this,[e,i,s,a,n,r])),t===V)return he(o,i,s);if(t.isAcceptState===!0)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function de(e,t,n,r,a,o){let s=_e(t.configs,n,a);if(s.size===0)return Z(e,t,n,V),V;let c=X(s),l=ye(s,a);if(l!==void 0)c.isAcceptState=!0,c.prediction=l,c.configs.uniqueAlt=l;else if(we(s)){let t=i(s.alts);c.isAcceptState=!0,c.prediction=t,c.configs.uniqueAlt=t,fe.apply(this,[e,r,s.alts,o])}return c=Z(e,t,n,c),c}function fe(e,t,n,r){let i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);let a=e.atnStartState,o=a.rule,s=a.production;r(pe({topLevelRule:o,ambiguityIndices:n,production:s,prefixPath:i}))}function pe(e){let n=c(e.prefixPath,e=>t(e)).join(`, `),r=e.production.idx===0?``:e.production.idx,i=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(`, `)}> in <${me(e.production)}${r}> inside <${e.topLevelRule.name}> Rule,\n<${n}> may appears as a prefix path in all these alternatives.\n`;return i+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
2
|
+
For Further details.`,i}function me(e){if(e instanceof u)return`SUBRULE`;if(e instanceof m)return`OPTION`;if(e instanceof h)return`OR`;if(e instanceof d)return`AT_LEAST_ONE`;if(e instanceof f)return`AT_LEAST_ONE_SEP`;if(e instanceof g)return`MANY_SEP`;if(e instanceof v)return`MANY`;if(e instanceof p)return`CONSUME`;throw Error(`non exhaustive match`)}function he(e,t,n){return{actualToken:n,possibleTokenTypes:l(s(t.configs.elements,e=>e.state.transitions).filter(e=>e instanceof C).map(e=>e.tokenType),e=>e.tokenTypeIdx),tokenPath:e}}function ge(e,t){return e.edges[t.tokenTypeIdx]}function _e(e,t,n){let r=new H,i=[];for(let a of e.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===7){i.push(a);continue}let e=a.state.transitions.length;for(let n=0;n<e;n++){let e=a.state.transitions[n],i=ve(e,t);i!==void 0&&r.add({state:i,alt:a.alt,stack:a.stack})}}let a;if(i.length===0&&r.size===1&&(a=r),a===void 0){a=new H;for(let e of r.elements)$(e,a)}if(i.length>0&&!Se(a))for(let e of i)a.add(e);return a}function ve(e,t){if(e instanceof C&&r(t,e.tokenType))return e.target}function ye(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function X(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function Z(e,t,n,r){return r=Q(e,r),t.edges[n.tokenTypeIdx]=r,r}function Q(e,t){if(t===V)return t;let n=t.configs.key,r=e.states[n];return r===void 0?(t.configs.finalize(),e.states[n]=t,t):r}function be(e){let t=new H,n=e.transitions.length;for(let r=0;r<n;r++)$({state:e.transitions[r].target,alt:r,stack:[]},t);return t}function $(e,t){let n=e.state;if(n.type===7){if(e.stack.length>0){let n=[...e.stack];$({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let r=n.transitions[i],a=xe(e,r);a!==void 0&&$(a,t)}}function xe(e,t){if(t instanceof w)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof T){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function Se(e){for(let t of e.elements)if(t.state.type===7)return!0;return!1}function Ce(e){for(let t of e.elements)if(t.state.type!==7)return!1;return!0}function we(e){if(Ce(e))return!0;let t=Te(e.elements);return Ee(t)&&!De(t)}function Te(e){let t=new Map;for(let n of e){let e=U(n,!1),r=t.get(e);r===void 0&&(r={},t.set(e,r)),r[n.alt]=!0}return t}function Ee(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function De(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}export{le as t};
|