@pro-fa/expreszo
Advanced tools
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
| import { W as setVar, c as Precedence, ae as add, ac as sub, a6 as concat, ab as mul, aa as div, a8 as mod, O as coalesce, a7 as pow, U as arrayIndexOrProperty, M as neg, L as pos, K as fac, af as condition, a4 as equal, a3 as notEqual, a0 as lessThan, Y as lessThanEqual, a2 as greaterThan, _ as greaterThanEqual, S as inOperator, R as notInOperator, Q as orOperator, T as andOperator, n as not, J as abs, I as acos, H as acosh, G as asin, D as asinh, C as atan, z as atanh, y as cbrt, x as ceil, w as cos, v as cosh, u as exp, q as expm1, p as floor, l as log10, m as log, k as log1p, j as log2, r as round, i as sign, h as sin, g as sinh, f as sqrt, e as tan, d as tanh, t as trunc, B as BUILTIN_FUNCTIONS, o as length, N as asOperator } from "./trigonometric-MG7O1EZ1.mjs"; | ||
| const CORE_OPERATORS = [ | ||
| { symbol: "=", kind: "infix", arity: 2, precedence: Precedence.Assignment, associativity: "right", optionName: "assignment", pure: false, impl: setVar }, | ||
| { symbol: "+", kind: "infix", arity: 2, precedence: Precedence.AddSub, associativity: "left", optionName: "add", pure: true, impl: add }, | ||
| { symbol: "-", kind: "infix", arity: 2, precedence: Precedence.AddSub, associativity: "left", optionName: "subtract", pure: true, impl: sub }, | ||
| { symbol: "|", kind: "infix", arity: 2, precedence: Precedence.AddSub, associativity: "left", optionName: "concatenate", pure: true, impl: concat }, | ||
| { symbol: "*", kind: "infix", arity: 2, precedence: Precedence.MulDiv, associativity: "left", optionName: "multiply", pure: true, impl: mul }, | ||
| { symbol: "/", kind: "infix", arity: 2, precedence: Precedence.MulDiv, associativity: "left", optionName: "divide", pure: true, impl: div }, | ||
| { symbol: "%", kind: "infix", arity: 2, precedence: Precedence.MulDiv, associativity: "left", optionName: "remainder", pure: true, impl: mod }, | ||
| { symbol: "??", kind: "infix", arity: 2, precedence: Precedence.Coalesce, associativity: "left", optionName: "coalesce", pure: true, impl: coalesce }, | ||
| { symbol: "^", kind: "infix", arity: 2, precedence: Precedence.Exponent, associativity: "right", optionName: "power", pure: true, impl: pow }, | ||
| { symbol: "[", kind: "infix", arity: 2, precedence: Precedence.Member, associativity: "left", optionName: "array", pure: true, impl: arrayIndexOrProperty }, | ||
| { symbol: "-", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "subtract", pure: true, impl: neg }, | ||
| { symbol: "+", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "add", pure: true, impl: pos }, | ||
| { symbol: "!", kind: "postfix", arity: 1, precedence: Precedence.Postfix, associativity: "left", optionName: "factorial", pure: true, impl: fac }, | ||
| { symbol: "?", kind: "ternary", arity: 3, precedence: Precedence.Ternary, associativity: "right", optionName: "conditional", pure: true, impl: condition } | ||
| ]; | ||
| const CORE_FUNCTIONS = []; | ||
| const COMPARISON_OPERATORS = [ | ||
| { symbol: "==", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: equal }, | ||
| { symbol: "!=", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: notEqual }, | ||
| { symbol: "<", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: lessThan }, | ||
| { symbol: "<=", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: lessThanEqual }, | ||
| { symbol: ">", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: greaterThan }, | ||
| { symbol: ">=", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: greaterThanEqual }, | ||
| { symbol: "in", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "in", pure: true, impl: inOperator }, | ||
| { symbol: "not in", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "in", pure: true, impl: notInOperator } | ||
| ]; | ||
| const LOGICAL_OPERATORS = [ | ||
| { symbol: "or", kind: "infix", arity: 2, precedence: Precedence.Or, associativity: "left", optionName: "logical", pure: true, impl: orOperator }, | ||
| { symbol: "||", kind: "infix", arity: 2, precedence: Precedence.Or, associativity: "left", optionName: "logical", pure: true, impl: orOperator }, | ||
| { symbol: "and", kind: "infix", arity: 2, precedence: Precedence.And, associativity: "left", optionName: "logical", pure: true, impl: andOperator }, | ||
| { symbol: "&&", kind: "infix", arity: 2, precedence: Precedence.And, associativity: "left", optionName: "logical", pure: true, impl: andOperator }, | ||
| { symbol: "not", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "logical", pure: true, impl: not } | ||
| ]; | ||
| const MATH_OPERATORS = [ | ||
| { symbol: "abs", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "abs", pure: true, impl: abs }, | ||
| { symbol: "acos", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "acos", pure: true, impl: acos }, | ||
| { symbol: "acosh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "acosh", pure: true, impl: acosh }, | ||
| { symbol: "asin", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "asin", pure: true, impl: asin }, | ||
| { symbol: "asinh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "asinh", pure: true, impl: asinh }, | ||
| { symbol: "atan", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "atan", pure: true, impl: atan }, | ||
| { symbol: "atanh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "atanh", pure: true, impl: atanh }, | ||
| { symbol: "cbrt", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "cbrt", pure: true, impl: cbrt }, | ||
| { symbol: "ceil", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "ceil", pure: true, impl: ceil }, | ||
| { symbol: "cos", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "cos", pure: true, impl: cos }, | ||
| { symbol: "cosh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "cosh", pure: true, impl: cosh }, | ||
| { symbol: "exp", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "exp", pure: true, impl: exp }, | ||
| { symbol: "expm1", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "expm1", pure: true, impl: expm1 }, | ||
| { symbol: "floor", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "floor", pure: true, impl: floor }, | ||
| { symbol: "lg", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "lg", pure: true, impl: log10 }, | ||
| { symbol: "ln", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "ln", pure: true, impl: log }, | ||
| { symbol: "log", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log", pure: true, impl: log }, | ||
| { symbol: "log1p", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log1p", pure: true, impl: log1p }, | ||
| { symbol: "log2", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log2", pure: true, impl: log2 }, | ||
| { symbol: "log10", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log10", pure: true, impl: log10 }, | ||
| { symbol: "round", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "round", pure: true, impl: round }, | ||
| { symbol: "sign", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sign", pure: true, impl: sign }, | ||
| { symbol: "sin", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sin", pure: true, impl: sin }, | ||
| { symbol: "sinh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sinh", pure: true, impl: sinh }, | ||
| { symbol: "sqrt", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sqrt", pure: true, impl: sqrt }, | ||
| { symbol: "tan", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "tan", pure: true, impl: tan }, | ||
| { symbol: "tanh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "tanh", pure: true, impl: tanh }, | ||
| { symbol: "trunc", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "trunc", pure: true, impl: trunc } | ||
| ]; | ||
| const MATH_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "math" | ||
| ); | ||
| const STRING_OPERATORS = [ | ||
| { symbol: "length", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "length", pure: true, impl: length } | ||
| ]; | ||
| const STRING_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "string" | ||
| ); | ||
| const ARRAY_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "array" | ||
| ); | ||
| const OBJECT_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "object" | ||
| ); | ||
| const TYPE_CHECK_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "type-check" | ||
| ); | ||
| const UTILITY_OPERATORS = [ | ||
| { symbol: "as", kind: "infix", arity: 2, precedence: Precedence.Coalesce, associativity: "left", optionName: "conversion", pure: true, impl: asOperator } | ||
| ]; | ||
| const UTILITY_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "utility" | ||
| ); | ||
| const coreParser = { | ||
| operators: CORE_OPERATORS, | ||
| functions: CORE_FUNCTIONS | ||
| }; | ||
| const withComparison = { | ||
| operators: COMPARISON_OPERATORS, | ||
| functions: [] | ||
| }; | ||
| const withLogical = { | ||
| operators: LOGICAL_OPERATORS, | ||
| functions: [] | ||
| }; | ||
| const withMath = { | ||
| operators: MATH_OPERATORS, | ||
| functions: MATH_FUNCTIONS | ||
| }; | ||
| const withString = { | ||
| operators: STRING_OPERATORS, | ||
| functions: STRING_FUNCTIONS | ||
| }; | ||
| const withArray = { | ||
| operators: [], | ||
| functions: ARRAY_FUNCTIONS | ||
| }; | ||
| const withObject = { | ||
| operators: [], | ||
| functions: OBJECT_FUNCTIONS | ||
| }; | ||
| const withTypeCheck = { | ||
| operators: [], | ||
| functions: TYPE_CHECK_FUNCTIONS | ||
| }; | ||
| const withUtility = { | ||
| operators: UTILITY_OPERATORS, | ||
| functions: UTILITY_FUNCTIONS | ||
| }; | ||
| const fullParser = { | ||
| operators: [ | ||
| ...CORE_OPERATORS, | ||
| ...COMPARISON_OPERATORS, | ||
| ...LOGICAL_OPERATORS, | ||
| ...MATH_OPERATORS, | ||
| ...STRING_OPERATORS, | ||
| ...UTILITY_OPERATORS | ||
| ], | ||
| functions: [ | ||
| ...CORE_FUNCTIONS, | ||
| ...MATH_FUNCTIONS, | ||
| ...STRING_FUNCTIONS, | ||
| ...ARRAY_FUNCTIONS, | ||
| ...OBJECT_FUNCTIONS, | ||
| ...TYPE_CHECK_FUNCTIONS, | ||
| ...UTILITY_FUNCTIONS | ||
| ] | ||
| }; | ||
| export { | ||
| ARRAY_FUNCTIONS as A, | ||
| COMPARISON_OPERATORS as C, | ||
| LOGICAL_OPERATORS as L, | ||
| MATH_FUNCTIONS as M, | ||
| OBJECT_FUNCTIONS as O, | ||
| STRING_FUNCTIONS as S, | ||
| TYPE_CHECK_FUNCTIONS as T, | ||
| UTILITY_FUNCTIONS as U, | ||
| withComparison as a, | ||
| withLogical as b, | ||
| coreParser as c, | ||
| withMath as d, | ||
| withObject as e, | ||
| fullParser as f, | ||
| withString as g, | ||
| withTypeCheck as h, | ||
| withUtility as i, | ||
| MATH_OPERATORS as j, | ||
| STRING_OPERATORS as k, | ||
| UTILITY_OPERATORS as l, | ||
| withArray as w | ||
| }; |
| import { OperatorDescriptor } from '../registry/operator-descriptor.js'; | ||
| import { FunctionDescriptor } from '../registry/function-descriptor.js'; | ||
| import { Value } from '../types/values.js'; | ||
| export interface Plugin { | ||
| readonly name: string; | ||
| readonly version?: string; | ||
| readonly operators?: readonly OperatorDescriptor[]; | ||
| readonly functions?: readonly FunctionDescriptor[]; | ||
| readonly constants?: Readonly<Record<string, Value>>; | ||
| } | ||
| export interface UsePluginOptions { | ||
| readonly override?: boolean; | ||
| } | ||
| //# sourceMappingURL=plugin.d.ts.map |
| {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/api/plugin.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,WAAW,MAAM;IAErB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;CACtD;AAGD,MAAM,WAAW,gBAAgB;IAM/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B"} |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { A, w } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { A, w } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ A as ARRAY_FUNCTIONS, |
@@ -1,2 +0,2 @@ | ||
| import { C, a } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { C, a } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ C as COMPARISON_OPERATORS, |
+5
-5
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| import { P as Parser } from "./chunks/parser-Djw13Y_R.mjs"; | ||
| import { B, E } from "./chunks/parser-Djw13Y_R.mjs"; | ||
| import { c } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { A, a, E as E2, b, F, P, bt, V } from "./chunks/trigonometric-GSdbj3Rp.mjs"; | ||
| import { P as Parser } from "./chunks/parser-CRUZ4SXd.mjs"; | ||
| import { B, E } from "./chunks/parser-CRUZ4SXd.mjs"; | ||
| import { c } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| import { A, a, E as E2, b, F, P, c as c2, V } from "./chunks/trigonometric-MG7O1EZ1.mjs"; | ||
| function defineParser(config) { | ||
@@ -55,3 +55,3 @@ var _a, _b; | ||
| Parser, | ||
| bt as Precedence, | ||
| c2 as Precedence, | ||
| V as VariableError, | ||
@@ -58,0 +58,0 @@ c as coreParser, |
+4
-0
@@ -12,4 +12,8 @@ import { Expression } from './src/core/expression.js'; | ||
| export type { ParserPreset } from './src/api/presets.js'; | ||
| export type { Plugin, UsePluginOptions } from './src/api/plugin.js'; | ||
| export type { OperatorDescriptor, OperatorKind, OperatorAssociativity, PrecedenceLevel } from './src/registry/operator-descriptor.js'; | ||
| export { Precedence } from './src/registry/operator-descriptor.js'; | ||
| export type { FunctionDescriptor, FunctionCategory, FunctionDocs, FunctionParamDoc, ParamType } from './src/registry/function-descriptor.js'; | ||
| export type { DeprecationHandler } from './src/utils/deprecation.js'; | ||
| export { setDeprecationHandler, createLanguageService, Expression, Parser, defineParser, coreParser, withComparison, withLogical, withMath, withString, withArray, withObject, withTypeCheck, withUtility, fullParser }; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;EASE;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EACV,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,kBAAkB,EAClB,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,SAAS,EACV,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACV,MAAM,EACN,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,E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AE,MAAM,uCAAuC,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAE7I,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACV,MAAM,EACN,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACX,CAAC"} |
+5
-4
@@ -1,5 +0,5 @@ | ||
| import { E, P } from "./chunks/parser-Djw13Y_R.mjs"; | ||
| import { A, a, E as E2, b, F, P as P2, V, s } from "./chunks/trigonometric-GSdbj3Rp.mjs"; | ||
| import { E, P } from "./chunks/parser-CRUZ4SXd.mjs"; | ||
| import { A, a, E as E2, b, F, P as P2, c, V, s } from "./chunks/trigonometric-MG7O1EZ1.mjs"; | ||
| import { defineParser } from "./core.mjs"; | ||
| import { c, f, w, a as a2, b as b2, d, e, g, h, i } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { c as c2, f, w, a as a2, b as b2, d, e, g, h, i } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| import { createLanguageService } from "./language-service.mjs"; | ||
@@ -15,4 +15,5 @@ export { | ||
| P as Parser, | ||
| c as Precedence, | ||
| V as VariableError, | ||
| c as coreParser, | ||
| c2 as coreParser, | ||
| createLanguageService, | ||
@@ -19,0 +20,0 @@ defineParser, |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { L, b } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { L, b } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ L as LOGICAL_OPERATORS, |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { M, j, d } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { M, j, d } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ M as MATH_FUNCTIONS, |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { O, e } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { O, e } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ O as OBJECT_FUNCTIONS, |
@@ -5,2 +5,3 @@ export { defineParser } from './define-parser.js'; | ||
| export type { ParserPreset } from './presets.js'; | ||
| export type { Plugin, UsePluginOptions } from './plugin.js'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"} |
@@ -7,2 +7,3 @@ export { Parser } from '../parsing/parser.js'; | ||
| export type { ParserPreset } from '../api/presets.js'; | ||
| export type { Plugin, UsePluginOptions } from '../api/plugin.js'; | ||
| export type { Value, Values, ParserOptions, UnaryOperator, BinaryOperator, SymbolOptions, VariableAlias, VariableValue, VariableResolveResult, VariableResolver, OperatorFunction } from '../types/index.js'; | ||
@@ -9,0 +10,0 @@ export { ExpressionError, ParseError, EvaluationError, ArgumentError, AccessError, VariableError, FunctionError } from '../types/errors.js'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/entries/core.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,YAAY,EACV,KAAK,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACd,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACnI,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG/H,YAAY,EAAE,IAAI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,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"language-service.d.ts","sourceRoot":"","sources":["../../../src/language-service/language-service.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,sBAAsB,EAStB,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAoDlC,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAAsB,GAAG,SAAqB,GAAG,kBAAkB,CA0bjH"} | ||
| {"version":3,"file":"language-service.d.ts","sourceRoot":"","sources":["../../../src/language-service/language-service.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,sBAAsB,EAStB,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAqDlC,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAAsB,GAAG,SAAqB,GAAG,kBAAkB,CA2cjH"} |
| import { Parser } from '../parsing/parser'; | ||
| import { FunctionParamDoc } from '../registry/function-descriptor.js'; | ||
| import { FunctionDocs, FunctionParamDoc } from '../registry/function-descriptor.js'; | ||
| import { ArityInfo } from './language-service.types'; | ||
@@ -9,3 +9,3 @@ import { SignatureInformation } from 'vscode-languageserver-types'; | ||
| private readonly docBlock; | ||
| constructor(parser: Parser, name: string); | ||
| constructor(parser: Parser, name: string, pluginDocs?: ReadonlyMap<string, FunctionDocs>); | ||
| params(): readonly FunctionParamDoc[]; | ||
@@ -12,0 +12,0 @@ private arity; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"language-service.models.d.ts","sourceRoot":"","sources":["../../../src/language-service/language-service.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,KAAK,EAAgB,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAwB,MAAM,6BAA6B,CAAC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 import { Values } from '../types'; | ||
| import { TextDocument } from 'vscode-languageserver-textdocument'; | ||
| import { Plugin } from '../api/plugin.js'; | ||
| export type { Plugin } from '../api/plugin.js'; | ||
| export interface LanguageServiceApi { | ||
@@ -71,2 +73,3 @@ getCompletions(params: GetCompletionsParams): CompletionItem[]; | ||
| operators?: Record<string, boolean>; | ||
| plugins?: readonly Plugin[]; | ||
| } | ||
@@ -73,0 +76,0 @@ export interface GetCompletionsParams { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"language-service.types.d.ts","sourceRoot":"","sources":["../../../src/language-service/language-service.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EACV,QAAQ,EACR,KAAK,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,UAAU,EACV,KAAK,EACL,QAAQ,EACR,aAAa,EACb,SAAS,EACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAKvE,MAAM,WAAW,kBAAkB;IAK/B,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,EAAE,CAAC;IAM/D,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC;IAM1C,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,cAAc,EAAE,CAAC;IAO9D,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,EAAE,CAAC;IAM3D,kBAAkB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,GAAG,cAAc,EAAE,CAAC;IAM7E,gBAAgB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,GAAG,YAAY,EAAE,CAAC;IAOzE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AW,oBAAoB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE;QACL,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;QACnC,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACL;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAClH,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACjD;AAED,MAAM,WAAW,sBAAsB;IAGnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,OAAQ,SAAQ,KAAK;IAClC,QAAQ,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE,YAAY,CAAC;IAM3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD,MAAM,WAAW,SAAS;IAEtB,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B"} | ||
| {"version":3,"file":"language-service.types.d.ts","sourceRoot":"","sources":["../../../src/language-service/language-service.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAA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UAAU,GAAG,SAAS,CAAC;IAClH,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACjD;AAED,MAAM,WAAW,sBAAsB;IAGnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAKpC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,OAAQ,SAAQ,KAAK;IAClC,QAAQ,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE,YAAY,CAAC;IAM3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD,MAAM,WAAW,SAAS;IAEtB,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B"} |
@@ -5,2 +5,3 @@ import { Expression } from '../core/expression.js'; | ||
| import { DeprecationHandler } from '../utils/deprecation.js'; | ||
| import { Plugin, UsePluginOptions } from '../api/plugin.js'; | ||
| interface ParserOptions { | ||
@@ -23,2 +24,3 @@ allowMemberAccess?: boolean; | ||
| constructor(options?: ParserOptions); | ||
| use(plugin: Plugin, options?: UsePluginOptions): this; | ||
| parse(expr: string): Expression; | ||
@@ -25,0 +27,0 @@ evaluate(expr: string, resolver: VariableResolver): Value | Promise<Value>; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"parser.d.ts","sourceRoot":"","s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AAW,GAAG,WAAW,EAChD,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,gBAAgB,GACzB,CAAC;IACJ,cAAc,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAChD,MAAM,EAAE,WAAW,EACnB,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,CAAC;IAgDJ,aAAa,CAAC,CAAC,GAAG,KAAK,EACrB,KAAK,EAAE,SAAS,KAAK,EAAE,EACvB,QAAQ,EAAE,gBAAgB,GACzB,CAAC,EAAE;IACN,aAAa,CAAC,CAAC,GAAG,KAAK,EACrB,KAAK,EAAE,SAAS,KAAK,EAAE,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,CAAC,EAAE;IAoBN,OAAO,CAAC,YAAY;IAyCpB,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,IAAI;IAI3E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CA4B1B;IAEX,OAAO,CAAC,MAAM,CAAC,aAAa;IAgB5B,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAMvC"} |
| import { OperatorFunction } from '../types/parser.js'; | ||
| export type FunctionCategory = 'math' | 'array' | 'string' | 'object' | 'utility' | 'type-check'; | ||
| export type FunctionCategory = 'math' | 'array' | 'string' | 'object' | 'utility' | 'type-check' | 'datetime'; | ||
| export type ParamType = 'number' | 'string' | 'boolean' | 'array' | 'object' | 'function' | 'any'; | ||
@@ -4,0 +4,0 @@ export interface FunctionParamDoc { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"function-descriptor.d.ts","sourceRoot":"","sources":["../../../src/registry/function-descriptor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAO3D,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,OAAO,G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QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,UAAU,GACV,KAAK,CAAC;AAMV,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;CAC3B;AAOD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAOpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAMvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAMvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAKxB,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;CAC9B"} |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { S, k, g } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { S, k, g } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ S as STRING_FUNCTIONS, |
@@ -1,2 +0,2 @@ | ||
| import { T, h } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { T, h } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ T as TYPE_CHECK_FUNCTIONS, |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { U, l, i } from "./chunks/utility-C2sKfxCE.mjs"; | ||
| import { U, l, i } from "./chunks/utility-Cm-9CA2b.mjs"; | ||
| export { | ||
@@ -3,0 +3,0 @@ U as UTILITY_FUNCTIONS, |
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| var _a; | ||
| import { U as setVar, bt as Precedence, O as orOperator, S as andOperator, a3 as equal, a2 as notEqual, $ as lessThan, X as lessThanEqual, a1 as greaterThan, Z as greaterThanEqual, R as inOperator, Q as notInOperator, ad as add, ab as sub, a5 as concat, aa as mul, a9 as div, a7 as mod, N as coalesce, M as asOperator, a6 as pow, T as arrayIndexOrProperty, L as neg, K as pos, n as not, J as fac, I as abs, H as acos, G as acosh, D as asin, C as asinh, z as atan, y as atanh, x as cbrt, w as ceil, v as cos, u as cosh, q as exp, p as expm1, o as floor, m as length, l as log10, k as log, j as log1p, i as log2, r as round, h as sign, g as sin, f as sinh, e as sqrt, d as tan, c as tanh, t as trunc, ae as condition, bu as DANGEROUS_PROPERTIES, A as AccessError, F as FunctionError, B as BUILTIN_FUNCTIONS } from "./chunks/trigonometric-GSdbj3Rp.mjs"; | ||
| import { W as setVar, c as Precedence, Q as orOperator, T as andOperator, a4 as equal, a3 as notEqual, a0 as lessThan, Y as lessThanEqual, a2 as greaterThan, _ as greaterThanEqual, S as inOperator, R as notInOperator, ae as add, ac as sub, a6 as concat, ab as mul, aa as div, a8 as mod, O as coalesce, N as asOperator, a7 as pow, U as arrayIndexOrProperty, M as neg, L as pos, n as not, K as fac, J as abs, I as acos, H as acosh, G as asin, D as asinh, C as atan, z as atanh, y as cbrt, x as ceil, w as cos, v as cosh, u as exp, q as expm1, p as floor, o as length, l as log10, m as log, k as log1p, j as log2, r as round, i as sign, h as sin, g as sinh, f as sqrt, e as tan, d as tanh, t as trunc, af as condition, bu as DANGEROUS_PROPERTIES, A as AccessError, F as FunctionError, B as BUILTIN_FUNCTIONS } from "./chunks/trigonometric-MG7O1EZ1.mjs"; | ||
| const BINARY_OPERATORS = [ | ||
@@ -6,0 +6,0 @@ { symbol: "=", kind: "infix", arity: 2, precedence: Precedence.Assignment, associativity: "right", optionName: "assignment", pure: false, impl: setVar }, |
+6
-30
| { | ||
| "name": "@pro-fa/expreszo", | ||
| "version": "0.5.0", | ||
| "version": "0.6.0", | ||
| "description": "Mathematical expression evaluator", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| "node": ">=20.0.0" | ||
| }, | ||
@@ -81,11 +81,4 @@ "main": "dist/index.mjs", | ||
| "import": "./dist/language-service.mjs" | ||
| }, | ||
| "./mcp-server": { | ||
| "types": "./dist/mcp-server.d.ts", | ||
| "import": "./dist/mcp-server.mjs" | ||
| } | ||
| }, | ||
| "bin": { | ||
| "expreszo-mcp": "dist/bin/mcp-server.mjs" | ||
| }, | ||
| "directories": { | ||
@@ -121,6 +114,3 @@ "test": "test" | ||
| "clean": "rimraf dist", | ||
| "prepublish": "npm run build", | ||
| "playground": "npm run build:umd && node samples/language-service-sample/serve-sample.cjs", | ||
| "mcp:dev": "tsx src/mcp-server/bin.ts", | ||
| "mcp:inspect": "npx @modelcontextprotocol/inspector tsx src/mcp-server/bin.ts" | ||
| "prepublish": "npm run build" | ||
| }, | ||
@@ -139,3 +129,3 @@ "devDependencies": { | ||
| "eslint-plugin-promise": "^7.0.0", | ||
| "rimraf": "^6.0.1", | ||
| "rimraf": "^5.0.10", | ||
| "terser": "^5.44.1", | ||
@@ -153,10 +143,7 @@ "tinybench": "^5.0.1", | ||
| }, | ||
| "_bundlesize_note": "bundlesize measures gzipped sizes by default. The UMD bundle currently sits at ~45 KB gzipped; the 60 KB cap leaves ~33% headroom for incremental growth. The ESM entry is a thin re-export barrel, so we don't gate it (the real weight lives in dist/chunks/*.mjs). bundlesize is NOT wired into CI today; this field documents the intended budget.", | ||
| "bundlesize": [ | ||
| { | ||
| "path": "./dist/bundle.min.js", | ||
| "maxSize": "50kb" | ||
| }, | ||
| { | ||
| "path": "./dist/index.mjs", | ||
| "maxSize": "80kb" | ||
| "maxSize": "60kb" | ||
| } | ||
@@ -166,14 +153,3 @@ ], | ||
| "vscode-languageserver-textdocument": "^1.0.12" | ||
| }, | ||
| "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", | ||
| "optionalDependencies": { | ||
| "@modelcontextprotocol/sdk": "^1.29.0", | ||
| "zod": "^4.3.6" | ||
| }, | ||
| "overrides": { | ||
| "hono": "^4.12.14" | ||
| }, | ||
| "resolutions": { | ||
| "hono": "^4.12.14" | ||
| } | ||
| } |
+55
-15
| <picture> | ||
| <source media="(prefers-color-scheme: dark)" srcset="docs/logo_dark.png"> | ||
| <img src="docs/logo.png" alt="ExpresZo" width="420"> | ||
| <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Pro-Fa/expreszo-typescript/main/packages/expreszo/docs/logo_dark.png"> | ||
| <img src="https://raw.githubusercontent.com/Pro-Fa/expreszo-typescript/main/packages/expreszo/docs/logo.png" alt="ExpresZo" width="420"> | ||
| </picture> | ||
@@ -24,2 +24,20 @@ | ||
| ## Companion packages | ||
| This package is the core. Two optional companions extend it without bloating the core install — pick them up only when you need them: | ||
| - **[`@pro-fa/expreszo-datetime`](https://www.npmjs.com/package/@pro-fa/expreszo-datetime)** — ~70 [Luxon](https://moment.github.io/luxon/)-backed date/time functions (`now`, `parseISO`, `addDuration`, `format`, `isWeekend`, `daysUntil`, `toRelative`, `dateRange`, …). Polymorphic inputs accept Luxon `DateTime`, JS `Date`, ISO strings, and millisecond timestamps. The core never imports Luxon. | ||
| - **[`@pro-fa/expreszo-mcp-server`](https://www.npmjs.com/package/@pro-fa/expreszo-mcp-server)** — MCP server that exposes the language service to AI assistants (Claude Desktop, Claude Code, Cursor, …). Ships an `expreszo-mcp` CLI. | ||
| Companions register with the new `parser.use(plugin)` API: | ||
| ```ts | ||
| import { defineParser, fullParser } from '@pro-fa/expreszo'; | ||
| import { dateTimePlugin } from '@pro-fa/expreszo-datetime'; | ||
| const parser = defineParser({ ...fullParser }).use(dateTimePlugin); | ||
| parser.parse("format(addDuration(now(), 7, 'days'), 'yyyy-MM-dd')").evaluate(); | ||
| ``` | ||
| ## Why ExpresZo? | ||
@@ -119,4 +137,5 @@ | ||
| |:---------|:------------| | ||
| | [Quick Reference](docs/quick-reference.md) | Cheat sheet of operators, functions, and syntax | | ||
| | [Expression Syntax](docs/syntax.md) | Complete syntax reference with examples | | ||
| | [Quick Reference](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/quick-reference.md) | Cheat sheet of operators, functions, and syntax | | ||
| | [Expression Syntax](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/syntax.md) | Complete syntax reference with examples | | ||
| | [Date / Time functions](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/datetime.md) | ~70 date/time functions (provided by the optional `@pro-fa/expreszo-datetime` package) | | ||
@@ -127,8 +146,9 @@ ### For Developers | ||
| |:---------|:------------| | ||
| | [Parser](docs/parser.md) | Parser configuration, methods, and customization | | ||
| | [Expression](docs/expression.md) | Expression object methods: evaluate, simplify, variables | | ||
| | [Advanced Features](docs/advanced-features.md) | Promises, custom resolution, type conversion, operator customization | | ||
| | [Language Service](docs/language-service.md) | IDE integration: completions, hover info, diagnostics, Monaco Editor | | ||
| | [MCP Server](docs/mcp-server.md) | Model Context Protocol server exposing the language service to AI assistants | | ||
| | [Migration Guide](docs/migration.md) | Migrating from expr-eval, legacy mode, version history | | ||
| | [Parser](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/parser.md) | Parser configuration, methods, customization, and the `parser.use(plugin)` API | | ||
| | [Expression](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/expression.md) | Expression object methods: evaluate, simplify, variables | | ||
| | [Advanced Features](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/advanced-features.md) | Promises, custom resolution, type conversion, operator customization | | ||
| | [Date / Time integration](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/datetime-integration.md) | Wiring `@pro-fa/expreszo-datetime` into a parser | | ||
| | [Language Service](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/language-service.md) | IDE integration: completions, hover info, diagnostics, Monaco Editor | | ||
| | [MCP Server](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/mcp-server.md) | Model Context Protocol server exposing the language service to AI assistants | | ||
| | [Migration Guide](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/migration.md) | Migrating from expr-eval, legacy mode, version history | | ||
@@ -139,9 +159,9 @@ ### For Contributors | ||
| |:---------|:------------| | ||
| | [Contributing](CONTRIBUTING.md) | Development setup, code style, and PR guidelines | | ||
| | [Performance Testing](docs/performance.md) | Benchmarks, profiling, and optimization guidance | | ||
| | [Breaking Changes](BREAKING_CHANGES.md) | Version-by-version breaking change documentation | | ||
| | [Contributing](https://github.com/Pro-Fa/expreszo-typescript/blob/main/CONTRIBUTING.md) | Development setup, code style, and PR guidelines | | ||
| | [Performance Testing](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/performance.md) | Benchmarks, profiling, and optimization guidance | | ||
| | [Breaking Changes](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/BREAKING_CHANGES.md) | Version-by-version breaking change documentation | | ||
| ## Coming from expr-eval? | ||
| ExpresZo is a direct successor to [expr-eval](https://github.com/silentmatt/expr-eval). Existing expressions work out of the box. A `{ legacy: true }` option preserves older operator semantics while you migrate incrementally. See the [Migration Guide](docs/migration.md) for details. | ||
| ExpresZo is a direct successor to [expr-eval](https://github.com/silentmatt/expr-eval). Existing expressions work out of the box. A `{ legacy: true }` option preserves older operator semantics while you migrate incrementally. See the [Migration Guide](https://github.com/Pro-Fa/expreszo-typescript/blob/main/packages/expreszo/docs/migration.md) for details. | ||
@@ -152,4 +172,24 @@ ## Origins | ||
| ## Working in this repository | ||
| The repo is a **yarn workspace monorepo** with three published packages under `packages/`: | ||
| | Package | Path | | ||
| |---------|------| | ||
| | `@pro-fa/expreszo` | `packages/expreszo/` | | ||
| | `@pro-fa/expreszo-datetime` | `packages/expreszo-datetime/` | | ||
| | `@pro-fa/expreszo-mcp-server` | `packages/expreszo-mcp-server/` | | ||
| ```bash | ||
| yarn install --frozen-lockfile # install all workspaces | ||
| yarn workspaces run lint # eslint all packages | ||
| yarn workspaces run type-check # tsc/tsgo on all packages | ||
| yarn workspaces run build # produce dist/ for each package | ||
| yarn workspaces run test # build + vitest in each package | ||
| ``` | ||
| This file (`README.md`) is the canonical README. The publish workflow copies it into `packages/expreszo/` before `npm publish`, so the npm package always ships the same content. | ||
| ## License | ||
| See [LICENSE.txt](LICENSE.txt) for license information. | ||
| See [LICENSE.txt](https://github.com/Pro-Fa/expreszo-typescript/blob/main/LICENSE.txt) for license information. |
| export {} |
| #!/usr/bin/env node | ||
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; | ||
| import { c as createMcpServer } from "../chunks/server-6CnZULfl.mjs"; | ||
| async function main() { | ||
| const server = createMcpServer(); | ||
| const transport = new StdioServerTransport(); | ||
| const shutdown = /* @__PURE__ */ __name(async () => { | ||
| try { | ||
| await server.close(); | ||
| } finally { | ||
| process.exit(0); | ||
| } | ||
| }, "shutdown"); | ||
| process.on("SIGINT", shutdown); | ||
| process.on("SIGTERM", shutdown); | ||
| await server.connect(transport); | ||
| } | ||
| __name(main, "main"); | ||
| main().catch((err) => { | ||
| console.error("[expreszo-mcp] fatal:", err); | ||
| process.exit(1); | ||
| }); |
Sorry, the diff of this file is too big to display
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | ||
| import { createLanguageService } from "../language-service.mjs"; | ||
| import { z } from "zod"; | ||
| const _FullTextDocument = class _FullTextDocument { | ||
| constructor(uri, languageId, version, content) { | ||
| this._uri = uri; | ||
| this._languageId = languageId; | ||
| this._version = version; | ||
| this._content = content; | ||
| this._lineOffsets = void 0; | ||
| } | ||
| get uri() { | ||
| return this._uri; | ||
| } | ||
| get languageId() { | ||
| return this._languageId; | ||
| } | ||
| get version() { | ||
| return this._version; | ||
| } | ||
| getText(range) { | ||
| if (range) { | ||
| const start = this.offsetAt(range.start); | ||
| const end = this.offsetAt(range.end); | ||
| return this._content.substring(start, end); | ||
| } | ||
| return this._content; | ||
| } | ||
| update(changes, version) { | ||
| for (const change of changes) { | ||
| if (_FullTextDocument.isIncremental(change)) { | ||
| const range = getWellformedRange(change.range); | ||
| const startOffset = this.offsetAt(range.start); | ||
| const endOffset = this.offsetAt(range.end); | ||
| this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); | ||
| const startLine = Math.max(range.start.line, 0); | ||
| const endLine = Math.max(range.end.line, 0); | ||
| let lineOffsets = this._lineOffsets; | ||
| const addedLineOffsets = computeLineOffsets(change.text, false, startOffset); | ||
| if (endLine - startLine === addedLineOffsets.length) { | ||
| for (let i = 0, len = addedLineOffsets.length; i < len; i++) { | ||
| lineOffsets[i + startLine + 1] = addedLineOffsets[i]; | ||
| } | ||
| } else { | ||
| if (addedLineOffsets.length < 1e4) { | ||
| lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets); | ||
| } else { | ||
| this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); | ||
| } | ||
| } | ||
| const diff = change.text.length - (endOffset - startOffset); | ||
| if (diff !== 0) { | ||
| for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { | ||
| lineOffsets[i] = lineOffsets[i] + diff; | ||
| } | ||
| } | ||
| } else if (_FullTextDocument.isFull(change)) { | ||
| this._content = change.text; | ||
| this._lineOffsets = void 0; | ||
| } else { | ||
| throw new Error("Unknown change event received"); | ||
| } | ||
| } | ||
| this._version = version; | ||
| } | ||
| getLineOffsets() { | ||
| if (this._lineOffsets === void 0) { | ||
| this._lineOffsets = computeLineOffsets(this._content, true); | ||
| } | ||
| return this._lineOffsets; | ||
| } | ||
| positionAt(offset) { | ||
| offset = Math.max(Math.min(offset, this._content.length), 0); | ||
| const lineOffsets = this.getLineOffsets(); | ||
| let low = 0, high = lineOffsets.length; | ||
| if (high === 0) { | ||
| return { line: 0, character: offset }; | ||
| } | ||
| while (low < high) { | ||
| const mid = Math.floor((low + high) / 2); | ||
| if (lineOffsets[mid] > offset) { | ||
| high = mid; | ||
| } else { | ||
| low = mid + 1; | ||
| } | ||
| } | ||
| const line = low - 1; | ||
| offset = this.ensureBeforeEOL(offset, lineOffsets[line]); | ||
| return { line, character: offset - lineOffsets[line] }; | ||
| } | ||
| offsetAt(position) { | ||
| const lineOffsets = this.getLineOffsets(); | ||
| if (position.line >= lineOffsets.length) { | ||
| return this._content.length; | ||
| } else if (position.line < 0) { | ||
| return 0; | ||
| } | ||
| const lineOffset = lineOffsets[position.line]; | ||
| if (position.character <= 0) { | ||
| return lineOffset; | ||
| } | ||
| const nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; | ||
| const offset = Math.min(lineOffset + position.character, nextLineOffset); | ||
| return this.ensureBeforeEOL(offset, lineOffset); | ||
| } | ||
| ensureBeforeEOL(offset, lineOffset) { | ||
| while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) { | ||
| offset--; | ||
| } | ||
| return offset; | ||
| } | ||
| get lineCount() { | ||
| return this.getLineOffsets().length; | ||
| } | ||
| static isIncremental(event) { | ||
| const candidate = event; | ||
| return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number"); | ||
| } | ||
| static isFull(event) { | ||
| const candidate = event; | ||
| return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0; | ||
| } | ||
| }; | ||
| __name(_FullTextDocument, "FullTextDocument"); | ||
| let FullTextDocument = _FullTextDocument; | ||
| var TextDocument; | ||
| (function(TextDocument2) { | ||
| function create(uri, languageId, version, content) { | ||
| return new FullTextDocument(uri, languageId, version, content); | ||
| } | ||
| __name(create, "create"); | ||
| TextDocument2.create = create; | ||
| function update(document, changes, version) { | ||
| if (document instanceof FullTextDocument) { | ||
| document.update(changes, version); | ||
| return document; | ||
| } else { | ||
| throw new Error("TextDocument.update: document must be created by TextDocument.create"); | ||
| } | ||
| } | ||
| __name(update, "update"); | ||
| TextDocument2.update = update; | ||
| function applyEdits(document, edits) { | ||
| const text = document.getText(); | ||
| const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a, b) => { | ||
| const diff = a.range.start.line - b.range.start.line; | ||
| if (diff === 0) { | ||
| return a.range.start.character - b.range.start.character; | ||
| } | ||
| return diff; | ||
| }); | ||
| let lastModifiedOffset = 0; | ||
| const spans = []; | ||
| for (const e of sortedEdits) { | ||
| const startOffset = document.offsetAt(e.range.start); | ||
| if (startOffset < lastModifiedOffset) { | ||
| throw new Error("Overlapping edit"); | ||
| } else if (startOffset > lastModifiedOffset) { | ||
| spans.push(text.substring(lastModifiedOffset, startOffset)); | ||
| } | ||
| if (e.newText.length) { | ||
| spans.push(e.newText); | ||
| } | ||
| lastModifiedOffset = document.offsetAt(e.range.end); | ||
| } | ||
| spans.push(text.substr(lastModifiedOffset)); | ||
| return spans.join(""); | ||
| } | ||
| __name(applyEdits, "applyEdits"); | ||
| TextDocument2.applyEdits = applyEdits; | ||
| })(TextDocument || (TextDocument = {})); | ||
| function mergeSort(data, compare) { | ||
| if (data.length <= 1) { | ||
| return data; | ||
| } | ||
| const p = data.length / 2 | 0; | ||
| const left = data.slice(0, p); | ||
| const right = data.slice(p); | ||
| mergeSort(left, compare); | ||
| mergeSort(right, compare); | ||
| let leftIdx = 0; | ||
| let rightIdx = 0; | ||
| let i = 0; | ||
| while (leftIdx < left.length && rightIdx < right.length) { | ||
| const ret = compare(left[leftIdx], right[rightIdx]); | ||
| if (ret <= 0) { | ||
| data[i++] = left[leftIdx++]; | ||
| } else { | ||
| data[i++] = right[rightIdx++]; | ||
| } | ||
| } | ||
| while (leftIdx < left.length) { | ||
| data[i++] = left[leftIdx++]; | ||
| } | ||
| while (rightIdx < right.length) { | ||
| data[i++] = right[rightIdx++]; | ||
| } | ||
| return data; | ||
| } | ||
| __name(mergeSort, "mergeSort"); | ||
| function computeLineOffsets(text, isAtLineStart, textOffset = 0) { | ||
| const result = isAtLineStart ? [textOffset] : []; | ||
| for (let i = 0; i < text.length; i++) { | ||
| const ch = text.charCodeAt(i); | ||
| if (isEOL(ch)) { | ||
| if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) { | ||
| i++; | ||
| } | ||
| result.push(textOffset + i + 1); | ||
| } | ||
| } | ||
| return result; | ||
| } | ||
| __name(computeLineOffsets, "computeLineOffsets"); | ||
| function isEOL(char) { | ||
| return char === 13 || char === 10; | ||
| } | ||
| __name(isEOL, "isEOL"); | ||
| function getWellformedRange(range) { | ||
| const start = range.start; | ||
| const end = range.end; | ||
| if (start.line > end.line || start.line === end.line && start.character > end.character) { | ||
| return { start: end, end: start }; | ||
| } | ||
| return range; | ||
| } | ||
| __name(getWellformedRange, "getWellformedRange"); | ||
| function getWellformedEdit(textEdit) { | ||
| const range = getWellformedRange(textEdit.range); | ||
| if (range !== textEdit.range) { | ||
| return { newText: textEdit.newText, range }; | ||
| } | ||
| return textEdit; | ||
| } | ||
| __name(getWellformedEdit, "getWellformedEdit"); | ||
| function resolvePosition(doc, input) { | ||
| if ("offset" in input) { | ||
| return doc.positionAt(input.offset); | ||
| } | ||
| return { line: input.line, character: input.character }; | ||
| } | ||
| __name(resolvePosition, "resolvePosition"); | ||
| const DEFAULT_URI = "expreszo://inline"; | ||
| const positionSchema = z.union([ | ||
| z.object({ offset: z.number().int().min(0) }).strict(), | ||
| z.object({ | ||
| line: z.number().int().min(0), | ||
| character: z.number().int().min(0) | ||
| }).strict() | ||
| ]); | ||
| const variablesSchema = z.record(z.string(), z.unknown()); | ||
| const rangeSchema = z.object({ | ||
| start: z.object({ | ||
| line: z.number().int().min(0), | ||
| character: z.number().int().min(0) | ||
| }).strict(), | ||
| end: z.object({ | ||
| line: z.number().int().min(0), | ||
| character: z.number().int().min(0) | ||
| }).strict() | ||
| }).strict(); | ||
| const diagnosticSchema = z.object({ | ||
| range: rangeSchema, | ||
| severity: z.number().int().optional(), | ||
| message: z.string(), | ||
| code: z.union([z.string(), z.number()]).optional(), | ||
| source: z.string().optional() | ||
| }).passthrough(); | ||
| const baseShape = { | ||
| expression: z.string().min(1).describe("The expreszo expression source text."), | ||
| uri: z.string().optional().describe('Optional document URI. Defaults to "expreszo://inline".') | ||
| }; | ||
| const positionFieldShape = { | ||
| position: positionSchema.describe( | ||
| "Cursor position. Either { offset } (0-based index into expression) or { line, character } (LSP style, both 0-based)." | ||
| ) | ||
| }; | ||
| const variablesFieldShape = { | ||
| variables: variablesSchema.optional().describe("Optional map of variable names to runtime values, used to include them in completions/hover.") | ||
| }; | ||
| function jsonResult(value) { | ||
| return { | ||
| content: [ | ||
| { | ||
| type: "text", | ||
| text: JSON.stringify(value, null, 2) | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
| __name(jsonResult, "jsonResult"); | ||
| function errorResult(err) { | ||
| const message = err instanceof Error ? err.message : String(err); | ||
| return { | ||
| isError: true, | ||
| content: [ | ||
| { | ||
| type: "text", | ||
| text: message | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
| __name(errorResult, "errorResult"); | ||
| function buildDocument(expression, uri) { | ||
| return TextDocument.create(uri ?? DEFAULT_URI, "plaintext", 1, expression); | ||
| } | ||
| __name(buildDocument, "buildDocument"); | ||
| function registerTools(server, ls) { | ||
| server.registerTool( | ||
| "expreszo_get_completions", | ||
| { | ||
| title: "Expreszo: get completions", | ||
| description: "Returns LSP-style completion items (functions, constants, keywords, provided variables) for an expreszo expression at the given cursor position.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape, | ||
| ...variablesFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, position, variables }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getCompletions({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position), | ||
| variables | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_hover", | ||
| { | ||
| title: "Expreszo: get hover", | ||
| description: "Returns hover information (signature, documentation) for the identifier at the given cursor position in an expreszo expression.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape, | ||
| ...variablesFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, position, variables }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getHover({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position), | ||
| variables | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_highlighting", | ||
| { | ||
| title: "Expreszo: get syntax highlighting", | ||
| description: "Returns an array of syntax highlighting tokens (numbers, strings, names, keywords, operators, functions, punctuation, constants) for an expreszo expression.", | ||
| inputSchema: { | ||
| ...baseShape | ||
| } | ||
| }, | ||
| async ({ expression, uri }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getHighlighting(doc); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_diagnostics", | ||
| { | ||
| title: "Expreszo: get diagnostics", | ||
| description: "Returns diagnostics (parse errors, invalid function arity, unknown identifiers) for an expreszo expression as LSP Diagnostic objects. Passing `variables` enables the unknown-identifier check.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...variablesFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, variables }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getDiagnostics({ | ||
| textDocument: doc, | ||
| variables | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_document_symbols", | ||
| { | ||
| title: "Expreszo: get document symbols", | ||
| description: "Returns LSP DocumentSymbol entries for every unique identifier, function call, and member chain used in the expression.", | ||
| inputSchema: { | ||
| ...baseShape | ||
| } | ||
| }, | ||
| async ({ expression, uri }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getDocumentSymbols({ textDocument: doc }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_folding_ranges", | ||
| { | ||
| title: "Expreszo: get folding ranges", | ||
| description: "Returns LSP FoldingRange entries for multi-line case blocks, array literals, and object literals.", | ||
| inputSchema: { | ||
| ...baseShape | ||
| } | ||
| }, | ||
| async ({ expression, uri }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getFoldingRanges({ textDocument: doc }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_definition", | ||
| { | ||
| title: "Expreszo: get definition", | ||
| description: "Returns the LSP Location of the definition of the identifier at the given position (first occurrence within the expression), or null if the position is not on a named symbol.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, position }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getDefinition({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position) | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_references", | ||
| { | ||
| title: "Expreszo: get references", | ||
| description: "Returns every LSP Location where the identifier at the given position is referenced in the expression, including the definition itself.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, position }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getReferences({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position) | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_signature_help", | ||
| { | ||
| title: "Expreszo: get signature help", | ||
| description: "Returns LSP SignatureHelp for the function call enclosing the given cursor position, including the active parameter index. Returns null when the cursor is not inside a recognized call.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, position }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getSignatureHelp({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position) | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_code_actions", | ||
| { | ||
| title: "Expreszo: get code actions", | ||
| description: 'Returns LSP CodeAction quick fixes for the diagnostics supplied in `context.diagnostics`. Handles arity-too-few (adds placeholder arguments) and unknown-ident (Levenshtein "did you mean" replacement).', | ||
| inputSchema: { | ||
| ...baseShape, | ||
| range: rangeSchema.describe("Range the editor is requesting actions for."), | ||
| context: z.object({ | ||
| diagnostics: z.array(diagnosticSchema), | ||
| variables: variablesSchema.optional() | ||
| }).describe("LSP CodeActionContext: the diagnostics to act on and optional variables.") | ||
| } | ||
| }, | ||
| async ({ expression, uri, range, context }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getCodeActions({ | ||
| textDocument: doc, | ||
| range, | ||
| context: { | ||
| diagnostics: context.diagnostics, | ||
| variables: context.variables | ||
| } | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_semantic_tokens", | ||
| { | ||
| title: "Expreszo: get semantic tokens", | ||
| description: "Returns LSP SemanticTokens (delta-encoded 5-tuples) for the expression. Decode with the legend exported from the language service package.", | ||
| inputSchema: { | ||
| ...baseShape | ||
| } | ||
| }, | ||
| async ({ expression, uri }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getSemanticTokens({ textDocument: doc }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_format", | ||
| { | ||
| title: "Expreszo: format expression", | ||
| description: "Format an expreszo expression using the built-in pretty-printer. Returns an array with at most one whole-document TextEdit, or an empty array if the document is already formatted or fails to parse.", | ||
| inputSchema: { | ||
| ...baseShape | ||
| } | ||
| }, | ||
| async ({ expression, uri }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.format({ textDocument: doc }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_prepare_rename", | ||
| { | ||
| title: "Expreszo: prepare rename", | ||
| description: "Returns the source range of the symbol at the given position if it is renameable, or null when the cursor is on a built-in function name, constant, keyword, or any non-identifier token. Call this before expreszo_rename to confirm the operation is valid and to learn which text range will be replaced.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape | ||
| } | ||
| }, | ||
| async ({ expression, uri, position }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.prepareRename({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position) | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_rename", | ||
| { | ||
| title: "Expreszo: rename symbol", | ||
| description: "Renames the identifier at the given position to `newName`, returning an LSP WorkspaceEdit that replaces every body reference AND every lambda / function-def parameter declaration site in a single edit. Returns null when the cursor is not on a renameable identifier (built-in functions and constants are rejected) or when the document fails to parse.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| ...positionFieldShape, | ||
| newName: z.string().min(1).describe("The replacement identifier. Must be non-empty; callers are responsible for ensuring it is a valid expreszo identifier.") | ||
| } | ||
| }, | ||
| async ({ expression, uri, position, newName }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.rename({ | ||
| textDocument: doc, | ||
| position: resolvePosition(doc, position), | ||
| newName | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| server.registerTool( | ||
| "expreszo_get_inlay_hints", | ||
| { | ||
| title: "Expreszo: get inlay hints", | ||
| description: "Returns LSP InlayHint entries for parameter-name labels at each argument of every built-in function call with two or more documented parameters. For example, `pow(2, 8)` yields hints `base:` before `2` and `exp:` before `8`. Single-parameter functions (sin, abs, ...) are intentionally skipped. Pass an optional `range` to limit hints to a subregion.", | ||
| inputSchema: { | ||
| ...baseShape, | ||
| range: rangeSchema.optional().describe("Optional viewport range; hints outside it are omitted. When omitted, hints for the whole expression are returned.") | ||
| } | ||
| }, | ||
| async ({ expression, uri, range }) => { | ||
| try { | ||
| const doc = buildDocument(expression, uri); | ||
| const result = ls.getInlayHints({ | ||
| textDocument: doc, | ||
| range | ||
| }); | ||
| return jsonResult(result); | ||
| } catch (err) { | ||
| return errorResult(err); | ||
| } | ||
| } | ||
| ); | ||
| } | ||
| __name(registerTools, "registerTools"); | ||
| const DEFAULT_MCP_SERVER_VERSION = "0.5.0"; | ||
| function createMcpServer(options = {}) { | ||
| const server = new McpServer({ | ||
| name: options.name ?? "expreszo-mcp", | ||
| version: options.version ?? DEFAULT_MCP_SERVER_VERSION | ||
| }); | ||
| const ls = createLanguageService({ operators: options.operators }); | ||
| registerTools(server, ls); | ||
| return server; | ||
| } | ||
| __name(createMcpServer, "createMcpServer"); | ||
| export { | ||
| createMcpServer as c | ||
| }; |
Sorry, the diff of this file is too big to display
| import { U as setVar, bt as Precedence, ad as add, ab as sub, a5 as concat, aa as mul, a9 as div, a7 as mod, N as coalesce, a6 as pow, T as arrayIndexOrProperty, L as neg, K as pos, J as fac, ae as condition, a3 as equal, a2 as notEqual, $ as lessThan, X as lessThanEqual, a1 as greaterThan, Z as greaterThanEqual, R as inOperator, Q as notInOperator, O as orOperator, S as andOperator, n as not, I as abs, H as acos, G as acosh, D as asin, C as asinh, z as atan, y as atanh, x as cbrt, w as ceil, v as cos, u as cosh, q as exp, p as expm1, o as floor, l as log10, k as log, j as log1p, i as log2, r as round, h as sign, g as sin, f as sinh, e as sqrt, d as tan, c as tanh, t as trunc, B as BUILTIN_FUNCTIONS, m as length, M as asOperator } from "./trigonometric-GSdbj3Rp.mjs"; | ||
| const CORE_OPERATORS = [ | ||
| { symbol: "=", kind: "infix", arity: 2, precedence: Precedence.Assignment, associativity: "right", optionName: "assignment", pure: false, impl: setVar }, | ||
| { symbol: "+", kind: "infix", arity: 2, precedence: Precedence.AddSub, associativity: "left", optionName: "add", pure: true, impl: add }, | ||
| { symbol: "-", kind: "infix", arity: 2, precedence: Precedence.AddSub, associativity: "left", optionName: "subtract", pure: true, impl: sub }, | ||
| { symbol: "|", kind: "infix", arity: 2, precedence: Precedence.AddSub, associativity: "left", optionName: "concatenate", pure: true, impl: concat }, | ||
| { symbol: "*", kind: "infix", arity: 2, precedence: Precedence.MulDiv, associativity: "left", optionName: "multiply", pure: true, impl: mul }, | ||
| { symbol: "/", kind: "infix", arity: 2, precedence: Precedence.MulDiv, associativity: "left", optionName: "divide", pure: true, impl: div }, | ||
| { symbol: "%", kind: "infix", arity: 2, precedence: Precedence.MulDiv, associativity: "left", optionName: "remainder", pure: true, impl: mod }, | ||
| { symbol: "??", kind: "infix", arity: 2, precedence: Precedence.Coalesce, associativity: "left", optionName: "coalesce", pure: true, impl: coalesce }, | ||
| { symbol: "^", kind: "infix", arity: 2, precedence: Precedence.Exponent, associativity: "right", optionName: "power", pure: true, impl: pow }, | ||
| { symbol: "[", kind: "infix", arity: 2, precedence: Precedence.Member, associativity: "left", optionName: "array", pure: true, impl: arrayIndexOrProperty }, | ||
| { symbol: "-", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "subtract", pure: true, impl: neg }, | ||
| { symbol: "+", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "add", pure: true, impl: pos }, | ||
| { symbol: "!", kind: "postfix", arity: 1, precedence: Precedence.Postfix, associativity: "left", optionName: "factorial", pure: true, impl: fac }, | ||
| { symbol: "?", kind: "ternary", arity: 3, precedence: Precedence.Ternary, associativity: "right", optionName: "conditional", pure: true, impl: condition } | ||
| ]; | ||
| const CORE_FUNCTIONS = []; | ||
| const COMPARISON_OPERATORS = [ | ||
| { symbol: "==", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: equal }, | ||
| { symbol: "!=", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: notEqual }, | ||
| { symbol: "<", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: lessThan }, | ||
| { symbol: "<=", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: lessThanEqual }, | ||
| { symbol: ">", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: greaterThan }, | ||
| { symbol: ">=", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "comparison", pure: true, impl: greaterThanEqual }, | ||
| { symbol: "in", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "in", pure: true, impl: inOperator }, | ||
| { symbol: "not in", kind: "infix", arity: 2, precedence: Precedence.Comparison, associativity: "left", optionName: "in", pure: true, impl: notInOperator } | ||
| ]; | ||
| const LOGICAL_OPERATORS = [ | ||
| { symbol: "or", kind: "infix", arity: 2, precedence: Precedence.Or, associativity: "left", optionName: "logical", pure: true, impl: orOperator }, | ||
| { symbol: "||", kind: "infix", arity: 2, precedence: Precedence.Or, associativity: "left", optionName: "logical", pure: true, impl: orOperator }, | ||
| { symbol: "and", kind: "infix", arity: 2, precedence: Precedence.And, associativity: "left", optionName: "logical", pure: true, impl: andOperator }, | ||
| { symbol: "&&", kind: "infix", arity: 2, precedence: Precedence.And, associativity: "left", optionName: "logical", pure: true, impl: andOperator }, | ||
| { symbol: "not", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "logical", pure: true, impl: not } | ||
| ]; | ||
| const MATH_OPERATORS = [ | ||
| { symbol: "abs", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "abs", pure: true, impl: abs }, | ||
| { symbol: "acos", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "acos", pure: true, impl: acos }, | ||
| { symbol: "acosh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "acosh", pure: true, impl: acosh }, | ||
| { symbol: "asin", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "asin", pure: true, impl: asin }, | ||
| { symbol: "asinh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "asinh", pure: true, impl: asinh }, | ||
| { symbol: "atan", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "atan", pure: true, impl: atan }, | ||
| { symbol: "atanh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "atanh", pure: true, impl: atanh }, | ||
| { symbol: "cbrt", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "cbrt", pure: true, impl: cbrt }, | ||
| { symbol: "ceil", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "ceil", pure: true, impl: ceil }, | ||
| { symbol: "cos", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "cos", pure: true, impl: cos }, | ||
| { symbol: "cosh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "cosh", pure: true, impl: cosh }, | ||
| { symbol: "exp", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "exp", pure: true, impl: exp }, | ||
| { symbol: "expm1", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "expm1", pure: true, impl: expm1 }, | ||
| { symbol: "floor", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "floor", pure: true, impl: floor }, | ||
| { symbol: "lg", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "lg", pure: true, impl: log10 }, | ||
| { symbol: "ln", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "ln", pure: true, impl: log }, | ||
| { symbol: "log", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log", pure: true, impl: log }, | ||
| { symbol: "log1p", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log1p", pure: true, impl: log1p }, | ||
| { symbol: "log2", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log2", pure: true, impl: log2 }, | ||
| { symbol: "log10", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "log10", pure: true, impl: log10 }, | ||
| { symbol: "round", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "round", pure: true, impl: round }, | ||
| { symbol: "sign", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sign", pure: true, impl: sign }, | ||
| { symbol: "sin", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sin", pure: true, impl: sin }, | ||
| { symbol: "sinh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sinh", pure: true, impl: sinh }, | ||
| { symbol: "sqrt", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "sqrt", pure: true, impl: sqrt }, | ||
| { symbol: "tan", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "tan", pure: true, impl: tan }, | ||
| { symbol: "tanh", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "tanh", pure: true, impl: tanh }, | ||
| { symbol: "trunc", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "trunc", pure: true, impl: trunc } | ||
| ]; | ||
| const MATH_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "math" | ||
| ); | ||
| const STRING_OPERATORS = [ | ||
| { symbol: "length", kind: "prefix", arity: 1, precedence: Precedence.Prefix, associativity: "right", optionName: "length", pure: true, impl: length } | ||
| ]; | ||
| const STRING_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "string" | ||
| ); | ||
| const ARRAY_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "array" | ||
| ); | ||
| const OBJECT_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "object" | ||
| ); | ||
| const TYPE_CHECK_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "type-check" | ||
| ); | ||
| const UTILITY_OPERATORS = [ | ||
| { symbol: "as", kind: "infix", arity: 2, precedence: Precedence.Coalesce, associativity: "left", optionName: "conversion", pure: true, impl: asOperator } | ||
| ]; | ||
| const UTILITY_FUNCTIONS = BUILTIN_FUNCTIONS.filter( | ||
| (d) => d.category === "utility" | ||
| ); | ||
| const coreParser = { | ||
| operators: CORE_OPERATORS, | ||
| functions: CORE_FUNCTIONS | ||
| }; | ||
| const withComparison = { | ||
| operators: COMPARISON_OPERATORS, | ||
| functions: [] | ||
| }; | ||
| const withLogical = { | ||
| operators: LOGICAL_OPERATORS, | ||
| functions: [] | ||
| }; | ||
| const withMath = { | ||
| operators: MATH_OPERATORS, | ||
| functions: MATH_FUNCTIONS | ||
| }; | ||
| const withString = { | ||
| operators: STRING_OPERATORS, | ||
| functions: STRING_FUNCTIONS | ||
| }; | ||
| const withArray = { | ||
| operators: [], | ||
| functions: ARRAY_FUNCTIONS | ||
| }; | ||
| const withObject = { | ||
| operators: [], | ||
| functions: OBJECT_FUNCTIONS | ||
| }; | ||
| const withTypeCheck = { | ||
| operators: [], | ||
| functions: TYPE_CHECK_FUNCTIONS | ||
| }; | ||
| const withUtility = { | ||
| operators: UTILITY_OPERATORS, | ||
| functions: UTILITY_FUNCTIONS | ||
| }; | ||
| const fullParser = { | ||
| operators: [ | ||
| ...CORE_OPERATORS, | ||
| ...COMPARISON_OPERATORS, | ||
| ...LOGICAL_OPERATORS, | ||
| ...MATH_OPERATORS, | ||
| ...STRING_OPERATORS, | ||
| ...UTILITY_OPERATORS | ||
| ], | ||
| functions: [ | ||
| ...CORE_FUNCTIONS, | ||
| ...MATH_FUNCTIONS, | ||
| ...STRING_FUNCTIONS, | ||
| ...ARRAY_FUNCTIONS, | ||
| ...OBJECT_FUNCTIONS, | ||
| ...TYPE_CHECK_FUNCTIONS, | ||
| ...UTILITY_FUNCTIONS | ||
| ] | ||
| }; | ||
| export { | ||
| ARRAY_FUNCTIONS as A, | ||
| COMPARISON_OPERATORS as C, | ||
| LOGICAL_OPERATORS as L, | ||
| MATH_FUNCTIONS as M, | ||
| OBJECT_FUNCTIONS as O, | ||
| STRING_FUNCTIONS as S, | ||
| TYPE_CHECK_FUNCTIONS as T, | ||
| UTILITY_FUNCTIONS as U, | ||
| withComparison as a, | ||
| withLogical as b, | ||
| coreParser as c, | ||
| withMath as d, | ||
| withObject as e, | ||
| fullParser as f, | ||
| withString as g, | ||
| withTypeCheck as h, | ||
| withUtility as i, | ||
| MATH_OPERATORS as j, | ||
| STRING_OPERATORS as k, | ||
| UTILITY_OPERATORS as l, | ||
| withArray as w | ||
| }; |
| export * from './src/entries/mcp-server' | ||
| export {} |
| import { c } from "./chunks/server-6CnZULfl.mjs"; | ||
| export { | ||
| c as createMcpServer | ||
| }; |
| export * from '../mcp-server/index.js'; | ||
| //# sourceMappingURL=mcp-server.d.ts.map |
| {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../src/entries/mcp-server.ts"],"names":[],"mappings":"AAKA,cAAc,wBAAwB,CAAC"} |
| export {}; | ||
| //# sourceMappingURL=bin.d.ts.map |
| {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/bin.ts"],"names":[],"mappings":""} |
| export { createMcpServer } from './server.js'; | ||
| export type { CreateMcpServerOptions } from './server.js'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"} |
| import { Position } from 'vscode-languageserver-types'; | ||
| import { TextDocument } from 'vscode-languageserver-textdocument'; | ||
| export type PositionInput = { | ||
| offset: number; | ||
| } | { | ||
| line: number; | ||
| character: number; | ||
| }; | ||
| export declare function resolvePosition(doc: TextDocument, input: PositionInput): Position; | ||
| //# sourceMappingURL=position.d.ts.map |
| {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,GAAG,QAAQ,CAKjF"} |
| import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; | ||
| import { LanguageServiceOptions } from '../language-service/language-service.types.js'; | ||
| export interface CreateMcpServerOptions { | ||
| operators?: LanguageServiceOptions['operators']; | ||
| name?: string; | ||
| version?: string; | ||
| } | ||
| export declare function createMcpServer(options?: CreateMcpServerOptions): McpServer; | ||
| //# sourceMappingURL=server.d.ts.map |
| {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAK5F,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,SAAS,CAU/E"} |
| import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; | ||
| import { LanguageServiceApi } from '../language-service/language-service.types.js'; | ||
| export declare function registerTools(server: McpServer, ls: LanguageServiceApi): void; | ||
| //# sourceMappingURL=tools.d.ts.map |
| {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AA+ExF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAiX7E"} |
-21
| The MIT License (MIT) | ||
| Copyright (c) 2015 Matthew Crumley | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1
-66.67%191
26.49%1057305
-1.35%260
-5.8%22403
-2.45%