@hotdocx/endash-kernel 0.1.0-preview.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +9 -1
  2. package/README.md +24 -2
  3. package/bin/endash-cli.cjs +4 -0
  4. package/bin/endash-mcp.cjs +7 -0
  5. package/browser.d.ts +44 -0
  6. package/endash-browser.js +698 -0
  7. package/index.cjs +704 -14
  8. package/index.d.ts +19 -11
  9. package/index.mjs +704 -14
  10. package/node.cjs +116606 -0
  11. package/node.d.ts +8 -0
  12. package/node.mjs +53 -0
  13. package/package.json +51 -7
  14. package/types/ast.d.ts +964 -0
  15. package/types/book/book_compiler.d.ts +57 -0
  16. package/types/book/html_renderer.d.ts +27 -0
  17. package/types/book/literate_en.d.ts +40 -0
  18. package/types/book/schema.d.ts +279 -0
  19. package/types/browser.d.ts +44 -0
  20. package/types/builders.d.ts +191 -0
  21. package/types/cache/core_snapshot.d.ts +259 -0
  22. package/types/cas/bar_hochschild.d.ts +106 -0
  23. package/types/cas/cotangent_deformation.d.ts +100 -0
  24. package/types/cas/cyclic_homology.d.ts +100 -0
  25. package/types/cas/derham_hkr.d.ts +117 -0
  26. package/types/cas/ext_algebra.d.ts +112 -0
  27. package/types/cas/groebner_syzygy.d.ts +43 -0
  28. package/types/cas/hilbert_proj_ag.d.ts +97 -0
  29. package/types/cas/hnf_snf.d.ts +49 -0
  30. package/types/cas/lefschetz_weil.d.ts +114 -0
  31. package/types/cas/localization_cech.d.ts +201 -0
  32. package/types/cas/matrix.d.ts +45 -0
  33. package/types/cas/modules_complexes.d.ts +141 -0
  34. package/types/cas/perm_coset_cgt.d.ts +166 -0
  35. package/types/cas/poly.d.ts +66 -0
  36. package/types/cas/reify_proofs.d.ts +104 -0
  37. package/types/cas/resolutions_spectral_seq.d.ts +193 -0
  38. package/types/cas/rings.d.ts +70 -0
  39. package/types/cas/smith_resultant_gauss.d.ts +164 -0
  40. package/types/cas/theta_stepanov.d.ts +182 -0
  41. package/types/check.d.ts +65 -0
  42. package/types/cli/endash_cli.d.ts +19 -0
  43. package/types/context.d.ts +110 -0
  44. package/types/duality.d.ts +76 -0
  45. package/types/elab/elab_ast.d.ts +274 -0
  46. package/types/elab/elaborate.d.ts +106 -0
  47. package/types/elab/env.d.ts +170 -0
  48. package/types/elab/match.d.ts +123 -0
  49. package/types/elab/pretty.d.ts +14 -0
  50. package/types/elab/structure.d.ts +46 -0
  51. package/types/elab/tactics.d.ts +238 -0
  52. package/types/elab/typeclass.d.ts +31 -0
  53. package/types/elab/unify.d.ts +166 -0
  54. package/types/eval.d.ts +28 -0
  55. package/types/index.d.ts +98 -0
  56. package/types/kernel_ops.d.ts +196 -0
  57. package/types/mcp/endash_mcp_server.d.ts +63 -0
  58. package/types/module/comparator.d.ts +86 -0
  59. package/types/module/desugar.d.ts +94 -0
  60. package/types/module/goal_inspector.d.ts +104 -0
  61. package/types/module/loader.d.ts +105 -0
  62. package/types/module/node_fs_provider.d.ts +26 -0
  63. package/types/module/package_builder.d.ts +83 -0
  64. package/types/module/proof_graph.d.ts +80 -0
  65. package/types/module/quasiquote.d.ts +37 -0
  66. package/types/module/stdlib_fresh_builders.d.ts +10 -0
  67. package/types/module/stdlib_tactic_hooks.d.ts +20 -0
  68. package/types/parser/lexer.d.ts +12 -0
  69. package/types/parser/parser.d.ts +78 -0
  70. package/types/parser/pratt.d.ts +17 -0
  71. package/types/parser/span.d.ts +26 -0
  72. package/types/parser/surface_ast.d.ts +501 -0
  73. package/types/stdlib_types.d.ts +113 -0
  74. package/types/value.d.ts +942 -0
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Core Semantic Operations, Došen Spine Normalizer, Leibniz Laxity Evaluator,
3
+ * 2-Periodic Polarized Sigma, and Type-Directed Conversion (`conv`) for `endash`.
4
+ */
5
+ import { SigmaPolarity } from './ast';
6
+ import { Duality, TransfMode } from './duality';
7
+ import { VBaseCellCatCore, VCat, VCatCore, VCellAtom, VCellSpine, VFun, VGluedHead, VGrpd, VGrpdWhnf, VModif, VNeutral, VPathAtom, VPathSpine, VTransf, Value } from './value';
8
+ export declare function mkCat(core: VCatCore, dual?: Duality): VCat;
9
+ export declare function dualizeCat(sigma: Duality, cat: VCat): VCat;
10
+ export declare function grpdLevel(rawG: VGrpd): number;
11
+ export declare function evalObjGrpd(cat: VCat): VGrpd;
12
+ export declare function homCatVal(cat: VCat, src: Value, dst: Value): VCat;
13
+ export declare function memoThunk<T>(compute: () => T): () => T;
14
+ export declare function unwrapGluedGrpd(rawG: VGrpd): VGrpdWhnf;
15
+ export declare function unwrapGluedVal(rawV: Value): Exclude<Value, {
16
+ tag: 'v-glued' | 'v-glued-grpd';
17
+ }>;
18
+ export declare function mkNatLit(n: bigint): Value;
19
+ export declare function mkSuccVal(pred: Value): Value;
20
+ export declare function unwrapSuccPred(rawV: Value): Value | null;
21
+ export declare function mkGluedVal(head: VGluedHead, ty: VGrpd): Value;
22
+ export declare function mkGluedDefVal(name: string, height: number, rootTy: VGrpd, rootVal: Value): Value;
23
+ export declare function extractNeutralHead(v: Value): VNeutral | undefined;
24
+ export declare function expectCatVal(rawV: Value): VCat;
25
+ export declare function expectGrpdVal(v: Value): VGrpd;
26
+ export declare function expectFunVal(rawV: Value): VFun;
27
+ export declare function expectTransfVal(rawV: Value): VTransf;
28
+ export declare function expectModifVal(rawV: Value): VModif;
29
+ export declare function expectPathSpine(rawV: Value): VPathSpine;
30
+ export declare function expectCellSpine(rawV: Value): VCellSpine;
31
+ export declare function fstVal(v: Value): Value;
32
+ export declare function sndVal(v: Value): Value;
33
+ export declare function appGrpdVal(fn: Value, arg: Value, argTy?: VGrpd): Value;
34
+ /** Head-eta-expand a `VNeutral` according to its semantic `VGrpd` type. */
35
+ export declare function etaWrapNeutral(ne: VNeutral, rawTy: VGrpd): Value;
36
+ /** Allocate an object/groupoid variable `x0 : ty` (subject to `Unit` and `Sigma` eta). */
37
+ export declare function mkObjVar(level: number, name: string, ty: VGrpd): Value;
38
+ /**
39
+ * Allocate a **generic functorial variable** `x :^f cat` for finite omega-functor
40
+ * conversion (`NC-3` safe: collapses ONLY when `cat` is `TerminalCat`, NEVER
41
+ * merely when `Obj(cat) = Unit`!).
42
+ */
43
+ export declare function mkFunVar(level: number, name: string, cat: VCat): Value;
44
+ export declare function reflVal(ty: VGrpd, val: Value): VPathSpine;
45
+ export declare function eqTransVal(ty: VGrpd, x: Value, _y: Value, z: Value, second: VPathSpine, first: VPathSpine): VPathSpine;
46
+ export declare function eqSymVal(ty: VGrpd, lhs: Value, rhs: Value, path: VPathSpine): VPathSpine;
47
+ export declare function eqApAtom(dom: VGrpd, cod: VGrpd, fn: (v: Value) => Value, atom: VPathAtom): readonly VPathAtom[];
48
+ export declare function eqApVal(dom: VGrpd, cod: VGrpd, fn: (v: Value) => Value, lhs: Value, rhs: Value, path: VPathSpine): VPathSpine;
49
+ export declare function eqJVal(ty: VGrpd, base: Value, motive: (y: Value, p: Value) => VGrpd, reflCase: Value, target: Value, path: VPathSpine): Value;
50
+ export declare function uaGrpdVal(level: number, fwdDom: VGrpd, fwdCod: VGrpd, toFn: Value, fromFn: Value, retrProof: Value, sectProof: Value): VPathSpine;
51
+ export declare function coeAtomVal(level: number, atom: VPathAtom, cur: Value): Value;
52
+ export declare function coeVal(level: number, _srcTy: VGrpd, _dstTy: VGrpd, tyPath: VPathSpine, val: Value): Value;
53
+ export declare function piFunextVal(nameHint: string, dom: VGrpd, cod: (x: Value) => VGrpd, lhsFn: Value, rhsFn: Value, homotopy: Value): VPathSpine;
54
+ export declare function piHapplyVal(nameHint: string, dom: VGrpd, cod: (x: Value) => VGrpd, lhsFn: Value, rhsFn: Value, fnPath: VPathSpine, arg: Value): VPathSpine;
55
+ export declare function apdVal(ty: VGrpd, motiveLevel: number, fam: (v: Value) => VGrpd, fn: (v: Value) => Value, lhs: Value, rhs: Value, path: VPathSpine): VPathSpine;
56
+ export declare function circleLoopVal(): VPathSpine;
57
+ export declare function circlePathOverLoopType(motiveLevel: number, motive: (x: Value) => VGrpd, baseCase: Value): VGrpd;
58
+ export declare function circleIndVal(nameHint: string, motiveLevel: number, motive: (x: Value) => VGrpd, baseCase: Value, loopCase: Value, rawScrutinee: Value): Value;
59
+ export declare function circleIndLoopBetaTypeAndVal(nameHint: string, motiveLevel: number, motive: (x: Value) => VGrpd, baseCase: Value, loopCase: Value): {
60
+ readonly ty: VGrpd;
61
+ readonly val: Value;
62
+ };
63
+ export declare function uaIdLoopVal(level: number, ty: VGrpd, homotopy: Value): VPathSpine;
64
+ export declare function uaIdLoopBetaTypeAndVal(level: number, ty: VGrpd, homotopy: Value, arg: Value): {
65
+ readonly ty: VGrpd;
66
+ readonly val: Value;
67
+ };
68
+ export declare function mkPushoutGrpdVal(leftTy: VGrpd, rightTy: VGrpd, spanTy: VGrpd, leftMap: Value, rightMap: Value): Extract<VGrpd, {
69
+ tag: 'v-pushout-grpd';
70
+ }>;
71
+ export declare function pushoutGlueVal(pushoutTy: Extract<VGrpd, {
72
+ tag: 'v-pushout-grpd';
73
+ }>, point: Value): VPathSpine;
74
+ export declare function pushoutPathOverGlueType(pushoutTy: Extract<VGrpd, {
75
+ tag: 'v-pushout-grpd';
76
+ }>, motiveLevel: number, motive: (u: Value) => VGrpd, inlCase: (a: Value) => Value, inrCase: (b: Value) => Value, point: Value): VGrpd;
77
+ export declare function pushoutIndVal(pushoutTy: Extract<VGrpd, {
78
+ tag: 'v-pushout-grpd';
79
+ }>, motiveNameHint: string, motiveLevel: number, motive: (u: Value) => VGrpd, inlNameHint: string, inlCase: (a: Value) => Value, inrNameHint: string, inrCase: (b: Value) => Value, glueNameHint: string, glueCase: (c: Value) => Value, rawScrutinee: Value): Value;
80
+ export declare function pushoutIndGlueBetaTypeAndVal(pushoutTy: Extract<VGrpd, {
81
+ tag: 'v-pushout-grpd';
82
+ }>, motiveNameHint: string, motiveLevel: number, motive: (u: Value) => VGrpd, inlNameHint: string, inlCase: (a: Value) => Value, inrNameHint: string, inrCase: (b: Value) => Value, glueNameHint: string, glueCase: (c: Value) => Value, point: Value): {
83
+ readonly ty: VGrpd;
84
+ readonly val: Value;
85
+ };
86
+ export declare function trunc0IndVal(truncTy: Extract<VGrpd, {
87
+ tag: 'v-trunc0-grpd';
88
+ }>, motiveNameHint: string, motiveLevel: number, motive: (u: Value) => VGrpd, isSetMotiveTy: VGrpd, isSetMotive: Value, inNameHint: string, inCase: (x: Value) => Value, rawScrutinee: Value): Value;
89
+ export declare function idVal(cat: VCat, x: Value): Value;
90
+ export declare function isIdentityCellVal(cat: VCat, src: Value, dst: Value, cell: Value, lvl?: number): boolean;
91
+ export declare function compVal(cat: VCat, x: Value, y: Value, z: Value, second: Value, first: Value): Value;
92
+ /**
93
+ * Substitution-stable Došen spine concatenation in diagrammatic order `first` (`x -> y`)
94
+ * followed by `second` (`y -> z`), performing inward neutral functor fusion!
95
+ */
96
+ export declare function concatCellSpines(homCore: VBaseCellCatCore, src: Value, dst: Value, first: VCellSpine, second: VCellSpine): VCellSpine;
97
+ export declare function applyFunctorToObjWithCoreFusion(fun: VFun, x: Value): Value;
98
+ export declare function neutralFunFromHead(funNe: VNeutral, dom: VCat, cod: VCat): VFun;
99
+ export declare function idFunVal(cat: VCat): VFun;
100
+ export declare function compFunVal(_a: VCat, _b: VCat, _c: VCat, second: VFun, first: VFun): VFun;
101
+ export declare function constFunVal(dom: VCat, cod: VCat, val: Value): VFun;
102
+ export declare function dualFunVal(sigma: Duality, dom: VCat, cod: VCat, fun: VFun): VFun;
103
+ export declare function postcompFunVal(cat: VCat, w: Value, x: Value, y: Value, g: Value): VFun;
104
+ export declare function precompFunVal(cat: VCat, x: Value, y: Value, z: Value, f: Value): VFun;
105
+ /**
106
+ * Simultaneous Cartesian product composition `Hom(x,y) x Hom(y,z) -> Hom(x,z)`
107
+ * for `cat : StrictCat` ONLY (`NC-1`: never constructed for `CatLax`!).
108
+ */
109
+ export declare function compProdFunVal(cat: VCat, x: Value, y: Value, z: Value): VFun;
110
+ export declare function pathMapFunVal(domGrpd: VGrpd, codGrpd: VGrpd, fn: (v: Value) => Value): VFun;
111
+ export declare function coreInclAtomsVal(cat: VCat, src: Value, dst: Value, atoms: readonly VPathAtom[]): Value;
112
+ export declare function coreInclFunVal(cat: VCat): VFun;
113
+ export declare function laxityEndpoints(mode: TransfMode, dom: VCat, cod: VCat, src: VFun, dst: VFun, epsAtObj: (x: Value) => Value, x: Value, y: Value): {
114
+ readonly lhs: VFun;
115
+ readonly rhs: VFun;
116
+ };
117
+ export declare function mkStrictTransfVal(dom: VCat, cod: VCat, src: VFun, dst: VFun, atObj: (x: Value) => Value, neutralHead?: VNeutral): VTransf;
118
+ export declare function idTransfVal(mode: TransfMode, dom: VCat, cod: VCat, fun: VFun): VTransf;
119
+ export declare function constTransfVal(mode: TransfMode, dom: VCat, cod: VCat, srcObj: Value, dstObj: Value, arrow: Value): VTransf;
120
+ export declare function forgetStrictTransfVal(targetMode: 'lax' | 'oplax', dom: VCat, cod: VCat, src: VFun, dst: VFun, strictTransf: VTransf): VTransf;
121
+ export declare function strictNatEqVal(dom: VCat, cod: VCat, src: VFun, dst: VFun, strictTransf: VTransf, x: Value, y: Value, p: Value): VPathSpine;
122
+ /**
123
+ * Evaluate a Leibniz spine derivation `λ_ε([a_1, ..., a_n])` on `VCellSpine`
124
+ * given `atomLaxity(u, v, atom)`.
125
+ */
126
+ export declare function evalLeibnizSpine(mode: 'lax' | 'oplax', dom: VCat, cod: VCat, src: VFun, dst: VFun, epsAtObj: (x: Value) => Value, x: Value, y: Value, spine: VCellSpine, atomLaxity: (u: Value, v: Value, atom: VCellAtom) => Value): Value;
127
+ export declare function neutralTransfFromHead(transfNe: VNeutral, mode: TransfMode, dom: VCat, cod: VCat, src: VFun, dst: VFun): VTransf;
128
+ export declare function vcompTransfVal(mode: TransfMode, dom: VCat, cod: VCat, f: VFun, g: VFun, h: VFun, eta: VTransf, eps: VTransf): VTransf;
129
+ export declare function prewhiskerTransfVal(mode: TransfMode, a0: VCat, a: VCat, b: VCat, preFun: VFun, srcFun: VFun, dstFun: VFun, transf: VTransf): VTransf;
130
+ export declare function postwhiskerTransfVal(mode: TransfMode, a: VCat, b: VCat, c: VCat, postFun: VFun, srcFun: VFun, dstFun: VFun, transf: VTransf): VTransf;
131
+ /**
132
+ * Kosta Došen's Off-Diagonal Functor `tapp1(eps, x, y) : Hom_A(x, y) -> Hom_B(F[x], G[y])`.
133
+ * - For `lax` / `cart`: strict pre/right leg `p |-> eps[y] o F[p]`.
134
+ * - For `oplax`: strict post/left leg `p |-> G[p] o eps[x]`.
135
+ */
136
+ export declare function tapp1FunVal(mode: TransfMode, dom: VCat, cod: VCat, src: VFun, dst: VFun, transf: VTransf, x: Value, y: Value): VFun;
137
+ export declare function dualTransfVal(sigma: Duality, mode: TransfMode, dom: VCat, cod: VCat, src: VFun, dst: VFun, transf: VTransf): VTransf;
138
+ /**
139
+ * Isomorphism `Transf(lax, K, CatCart(u), Const(1), Const(C)) <-> Functor(K, C)`
140
+ * at all omega-dimensions (using the Leibniz derivation law!).
141
+ */
142
+ export declare function constSecToFunVal(dom: VCat, cod: VCat, sec: VTransf): VFun;
143
+ export declare function funToConstSecVal(level: number, dom: VCat, cod: VCat, fun: VFun): VTransf;
144
+ export declare function familyDualFunVal(sigma: Duality, level: number, base: VCat, fam: VFun): VFun;
145
+ export declare function opCatCartFunVal(level: number): VFun;
146
+ export declare function totalOpCatFunVal(level: number, cartOnly: boolean): VFun;
147
+ /**
148
+ * Covariant represented Hom family `Rep(C, x) = Hom_C(x, -) : Functor(C, CatCart(level))`
149
+ * (`C : StrictCat` required by Godement interchange!).
150
+ */
151
+ export declare function homRepFunVal(level: number, cat: VCat, srcObj: Value): VFun;
152
+ /**
153
+ * 2-Periodic `Sigma_map(pol, K, E, D, FF) : Functor(Sigma(pol, K, E), Sigma(pol, K, D))`
154
+ * ping-ponging `(+, lax) <-> (-, oplax)` to all omega-dimensions with zero `TotalOp` wrappers!
155
+ */
156
+ export declare function sigmaMapFunVal(pol: SigmaPolarity, level: number, base: VCat, srcFam: VFun, dstFam: VFun, funcd: VTransf): VFun;
157
+ /**
158
+ * Contextual Directed HIT Eliminator `walking_ind_funcd(R, D, u, sigma) : Functord(R, D)`
159
+ * with judgmental base beta `u`, judgmental loop beta `sigma`, and Leibniz spine evaluation!
160
+ */
161
+ export declare function walkingIndFuncdVal(level: number, srcFam: VFun, dstFam: VFun, baseFun: VFun, loopCoherence: VTransf): VTransf;
162
+ /**
163
+ * Strict functor recursor `walking_arrow_rec(cod, zeroObj, oneObj, segCell) : Functor(WalkingArrow, cod)`
164
+ * into ANY category `cod` (`StrictCat` or `GrayCat`), with judgmental object and generator beta!
165
+ */
166
+ export declare function walkingArrowRecVal(cod: VCat, zeroObj: Value, oneObj: Value, segCell: Value): VFun;
167
+ /**
168
+ * Transformation eliminator `walking_arrow_ind_transf(mode, cod, srcFun, dstFun, zeroCell, oneCell, segCell)`
169
+ * inhabiting `Transf(mode, WalkingArrow, cod, srcFun, dstFun)` for ANY `cod` (`StrictCat` or `GrayCat`)!
170
+ */
171
+ export declare function walkingArrowIndTransfVal(mode: 'lax' | 'oplax', cod: VCat, srcFun: VFun, dstFun: VFun, zeroCell: Value, oneCell: Value, segCell: Value): VTransf;
172
+ export declare function groupoidifyUnitFunVal(cat: VCat): VFun;
173
+ export declare function groupoidifyRecVal(cat: VCat, targetGrpd: VGrpd, fun: VFun, rawScrutinee: Value): Value;
174
+ export declare function joinInlFunVal(left: VCat, right: VCat): VFun;
175
+ export declare function joinInrFunVal(left: VCat, right: VCat): VFun;
176
+ export declare function homBifunVal(cat: VCat, level: number): VFun;
177
+ export declare function joinTerminalProfVal(left: VCat, right: VCat, codLevel: number): VFun;
178
+ export declare function joinHomProfVal(left: VCat, right: VCat, cod: VCat, leftFun: VFun, rightFun: VFun): VFun;
179
+ export declare function joinCrossTransfType(left: VCat, right: VCat, cod: VCat, leftFun: VFun, rightFun: VFun): Extract<VGrpd, {
180
+ tag: 'v-transf-type';
181
+ }>;
182
+ export declare function joinElimFunVal(left: VCat, right: VCat, cod: VCat, leftFun: VFun, rightFun: VFun, crossTransf: VTransf): VFun;
183
+ export declare function joinObserveCrossVal(left: VCat, right: VCat, cod: VCat, fun: VFun): VTransf;
184
+ export declare function joinCone1CatSignature(left: VCat, right: VCat, cod: VCat, leftFun: VFun, rightFun: VFun): {
185
+ readonly crossCellTy: VGrpd;
186
+ readonly mkLeftNatTy: (crossCellVal: Value) => VGrpd;
187
+ readonly mkRightNatTy: (crossCellVal: Value) => VGrpd;
188
+ };
189
+ export declare function joinCone1CatTransfVal(left: VCat, right: VCat, cod: VCat, isOneCatTy: VGrpd, codIsOneCat: Value, leftFun: VFun, rightFun: VFun, crossCellTy: VGrpd, crossCell: Value, leftNatTy: VGrpd, leftNat: Value, rightNatTy: VGrpd, rightNat: Value): VTransf;
190
+ export declare function tryConvGluedHeads(h1: VGluedHead, h2: VGluedHead, lvl: number): boolean;
191
+ export declare function convGrpd(rawG1: VGrpd, rawG2: VGrpd, lvl: number): boolean;
192
+ export declare function convCat(c1: VCat, c2: VCat, lvl: number): boolean;
193
+ export declare function convFun(dom: VCat, cod: VCat, f1: VFun, f2: VFun, lvl: number): boolean;
194
+ export declare function convTransf(mode: TransfMode, dom: VCat, cod: VCat, src: VFun, dst: VFun, e1: VTransf, e2: VTransf, lvl: number): boolean;
195
+ export declare function convVal(rawTy: VGrpd, v1: Value, v2: Value, lvl: number): boolean;
196
+ export declare function convNeutral(n1: VNeutral, n2: VNeutral, lvl: number): boolean;
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Zero-Dependency JSON-RPC 2.0 STDIO Model Context Protocol (MCP) Server
4
+ * (`endash/src/mcp/endash_mcp_server.ts`).
5
+ *
6
+ * Exposes 5 kernel-verified agentic proof & CAS tools (`0` external npm dependencies,
7
+ * `0 LOC` TCB delta):
8
+ * 1. `endash_check_module` — Elaborate & kernel-check `.en` source or workspace file,
9
+ * enforcing `requireAxiomFree` (`default: true`) to reject `sorry`-tainted modules (`NC-12b`).
10
+ * 2. `endash_goals_at` — Query live `goalsBefore` / `goalsAfter` at 1-based `(line, column)`.
11
+ * 3. `endash_run_tactic_probe` — Execute interactive tactic step(s) against a theorem goal.
12
+ * 4. `endash_cas_certify` — Compute & LCF-certify `P^1` Čech cohomology or SNF over `Z`/`Q`/`F2`.
13
+ * 5. `endash_list_stdlib` — List all built-in stdlib modules & `.en` showcases.
14
+ *
15
+ * Soundness & Confinement (`NC-12b`):
16
+ * - Strict JSON-RPC 2.0 validation (`-32700` Parse error, `-32600` Invalid Request,
17
+ * `-32601` Method not found, `-32602` Invalid params);
18
+ * - Strict workspace path confinement — every `filePath` escaping `workspaceRoot` (`../`,
19
+ * absolute outside root, or symlink traversal) is deterministically rejected with
20
+ * `WORKSPACE_ACCESS_DENIED`.
21
+ */
22
+ export interface JsonRpcRequest {
23
+ readonly jsonrpc: '2.0';
24
+ readonly id?: string | number | null;
25
+ readonly method: string;
26
+ readonly params?: Record<string, unknown>;
27
+ }
28
+ export interface JsonRpcErrorObject {
29
+ readonly code: number;
30
+ readonly message: string;
31
+ readonly data?: unknown;
32
+ }
33
+ export interface JsonRpcResponse {
34
+ readonly jsonrpc: '2.0';
35
+ readonly id: string | number | null;
36
+ readonly result?: unknown;
37
+ readonly error?: JsonRpcErrorObject;
38
+ }
39
+ export interface McpToolDefinition {
40
+ readonly name: string;
41
+ readonly description: string;
42
+ readonly inputSchema: Record<string, unknown>;
43
+ }
44
+ export declare const ENDASH_MCP_TOOLS: readonly McpToolDefinition[];
45
+ export declare class EndashMcpServer {
46
+ readonly workspaceRoot: string;
47
+ private readonly _stdlibShowcasesDir;
48
+ constructor(workspaceRoot?: string);
49
+ /**
50
+ * Enforce strict workspace confinement (`NC-12b`):
51
+ * resolves `userPath` relative to `workspaceRoot` and rejects any path escaping `workspaceRoot`!
52
+ */
53
+ resolveConfinedPath(userPath: string): string;
54
+ private _readSourceFromParams;
55
+ handleRawJsonLine(rawJson: string): JsonRpcResponse | null;
56
+ handleRequestObject(reqObj: unknown): JsonRpcResponse | null;
57
+ private _callTool;
58
+ }
59
+ /**
60
+ * Start the STDIO JSON-RPC 2.0 MCP loop, supporting BOTH newline-delimited JSON-RPC
61
+ * messages (standard MCP STDIO transport) and `Content-Length: N\r\n\r\n` LSP-framed messages!
62
+ */
63
+ export declare function startStdioMcpServer(workspaceRoot?: string): EndashMcpServer;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Browser-Safe Challenge Comparator, Anti-Goodhart Unused-Binder Gate, & Semantic Ablation
3
+ * Harness (`endash/src/module/comparator.ts`).
4
+ *
5
+ * Inspired by `formal-ag/weil-conjectures` (`Comparator`), Lean `lean4checker` / `SafeVerify`,
6
+ * and `deeptheory-labs/GRH` anti-vacuity & semantic ablation gates:
7
+ * 1. Elaborates `challengeSource` (recording frozen `def`/`structure`/`class` declarations
8
+ * and target `theorem`/`axiom` statements) and `solutionSource` in isolated sessions.
9
+ * 2. Verifies every frozen definition/structure/class in `challengeSource` is preserved
10
+ * in `solutionSource` without tampering (`DEFINITION_TAMPERED`, checked via NbE `convGrpd`/`convVal`).
11
+ * 3. Verifies every target theorem from `challengeSource` exists in `solutionSource`
12
+ * (`MISSING_TARGET_DECL`), is 100% axiom- and `sorry`-free (`AXIOM_TAINTED`), and has an
13
+ * NbE-convertible type statement (`STATEMENT_MISMATCH` via trusted kernel `convGrpd`).
14
+ * 4. Audits theorem binder domains for vacuous hypotheses (`VACUOUS_HYPOTHESIS`), transitive
15
+ * dependency bypasses (`MISSING_REQUIRED_DEPENDENCY`), and discarded proof binders
16
+ * (`DISCARDED_PROOF_ARGUMENT`, `NC-24c`).
17
+ * 5. `runSemanticAblationCheck`: verifies `baseSource` checks with `0` axioms while mutating
18
+ * exponents or dropping hypotheses in `ablatedSource` causes genuine kernel failure!
19
+ *
20
+ * 100% browser-safe (zero `node:*` imports), `0` `any` casts, and 100% outside the TCB (`0 LOC` TCB delta).
21
+ */
22
+ import { ElabEnv } from '../elab/env';
23
+ import { ModuleSourceProvider } from './loader';
24
+ export type ChallengeViolationCode = 'PARSE_OR_ELAB_ERROR' | 'MISSING_TARGET_DECL' | 'AXIOM_TAINTED' | 'DEFINITION_TAMPERED' | 'STATEMENT_MISMATCH' | 'VACUOUS_HYPOTHESIS' | 'MISSING_REQUIRED_DEPENDENCY' | 'DISCARDED_PROOF_ARGUMENT' | 'THEOREM_DATA_PROJECTION';
25
+ export interface ChallengeViolation {
26
+ readonly code: ChallengeViolationCode;
27
+ readonly declName?: string;
28
+ readonly message: string;
29
+ }
30
+ export interface CompareChallengeOptions {
31
+ readonly challengeModuleName?: string;
32
+ readonly solutionModuleName?: string;
33
+ readonly extraProviders?: readonly ModuleSourceProvider[];
34
+ /** Disable vacuous-hypothesis audit only when intentionally testing false/contradictory premises. */
35
+ readonly auditVacuity?: boolean;
36
+ /**
37
+ * Optional per-target required load-bearing dependencies (`NC-23c`):
38
+ * maps a target declaration's full name (or unqualified short name) to declaration names
39
+ * that MUST appear inside its transitive Core `global-ref` closure.
40
+ */
41
+ readonly requiredDependencies?: Readonly<Record<string, readonly string[]>>;
42
+ /**
43
+ * When true (`NC-24c`), rejects any target theorem or helper declaration in `solutionSource`
44
+ * whose elaborated body discards a relational/proof argument without referencing it.
45
+ */
46
+ readonly rejectDiscardedProofArgs?: boolean;
47
+ /**
48
+ * When enabled (`default: true`, `NC-25a` Part 2), rejects any computational `def` in
49
+ * `solutionSource` that projects computational data (`.fst`/`.snd`) out of a `theorem`.
50
+ */
51
+ readonly rejectTheoremDataProjections?: boolean;
52
+ }
53
+ export interface RequiredDependencyClosureReport {
54
+ readonly ok: boolean;
55
+ readonly targetDecl: string;
56
+ readonly closureSize: number;
57
+ readonly missing: readonly string[];
58
+ }
59
+ export declare function auditRequiredDependencyClosure(env: ElabEnv, targetDecl: string, requiredDeps: readonly string[]): RequiredDependencyClosureReport;
60
+ export interface CompareChallengeReport {
61
+ readonly ok: boolean;
62
+ readonly frozenDefsChecked: readonly string[];
63
+ readonly targetTheoremsVerified: readonly string[];
64
+ readonly violations: readonly ChallengeViolation[];
65
+ }
66
+ export interface SemanticAblationOptions {
67
+ readonly baseModuleName?: string;
68
+ readonly ablatedModuleName?: string;
69
+ readonly extraProviders?: readonly ModuleSourceProvider[];
70
+ }
71
+ export interface SemanticAblationResult {
72
+ readonly ok: boolean;
73
+ readonly baseVerified: boolean;
74
+ readonly ablatedRejected: boolean;
75
+ readonly ablatedError?: string;
76
+ readonly reason: string;
77
+ }
78
+ /**
79
+ * Programmatic Semantic Ablation Check (`NC-24c` Part 2b):
80
+ * 1. Verifies `baseSource` elaborates and kernel-checks cleanly with `0` axioms across all
81
+ * declared symbols;
82
+ * 2. Verifies `ablatedSource` (with weakened exponent, dropped hypothesis, or uncentered term)
83
+ * either fails parsing/elaboration/kernel checking or incurs axiom/sorry taint!
84
+ */
85
+ export declare function runSemanticAblationCheck(baseSource: string, ablatedSource: string, opts?: SemanticAblationOptions): SemanticAblationResult;
86
+ export declare function compareChallengeAndSolution(challengeSource: string, solutionSource: string, opts?: CompareChallengeOptions): CompareChallengeReport;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * `.en` Surface AST Desugarer & Command Execution Engine (`endash/src/module/desugar.ts`).
3
+ *
4
+ * Lowers parsed `.en` expressions, patterns, tactics, functorial `fun^f` abstractions,
5
+ * structures, classes, instances, notations, and `#check`/`#eval`/`#print axioms`
6
+ * commands into `ElabEnv` — completely outside the trusted kernel.
7
+ */
8
+ import { Term } from '../ast';
9
+ import { ElabBinder, ElabCatTerm, ElabTerm } from '../elab/elab_ast';
10
+ import { ElabEnv } from '../elab/env';
11
+ import { ProofState, Tactic } from '../elab/tactics';
12
+ import { OperatorTable } from '../parser/pratt';
13
+ import { SourceSpan } from '../parser/span';
14
+ import { SurfaceBinder, SurfaceExpr, SurfaceModule, SurfaceTactic } from '../parser/surface_ast';
15
+ export interface FormattedGoalView {
16
+ readonly hypotheses: readonly {
17
+ readonly name: string;
18
+ readonly type: string;
19
+ }[];
20
+ readonly target: string;
21
+ readonly formatted: string;
22
+ }
23
+ export interface TacticStepTrace {
24
+ readonly theoremName: string;
25
+ readonly tacticTag: string;
26
+ readonly tacticSummary: string;
27
+ readonly span: SourceSpan;
28
+ readonly theoremSpan: SourceSpan;
29
+ readonly goalsBefore: readonly FormattedGoalView[];
30
+ readonly goalsAfter: readonly FormattedGoalView[];
31
+ readonly error?: string;
32
+ }
33
+ export interface CommandOutput {
34
+ readonly kind: 'check' | 'eval' | 'probe' | 'print-axioms' | 'tags';
35
+ readonly subject: string;
36
+ readonly output: string;
37
+ readonly axioms?: readonly string[];
38
+ readonly span: SourceSpan;
39
+ }
40
+ export interface ModuleRunOptions {
41
+ readonly file?: string;
42
+ readonly operators?: OperatorTable;
43
+ readonly splices?: readonly ElabTerm[];
44
+ readonly onImport?: (moduleId: string, targetEnv: ElabEnv, ops: OperatorTable, span: SourceSpan) => void;
45
+ readonly onTacticStep?: (trace: TacticStepTrace) => void;
46
+ readonly allowIncompleteProofs?: boolean;
47
+ }
48
+ export interface ModuleRunResult {
49
+ readonly env: ElabEnv;
50
+ readonly operators: OperatorTable;
51
+ readonly outputs: readonly CommandOutput[];
52
+ readonly declaredNames: readonly string[];
53
+ }
54
+ interface RecursiveDefContext {
55
+ readonly selfShortName: string;
56
+ readonly selfFullName: string;
57
+ readonly recParamName: string;
58
+ readonly recParamIndex: number;
59
+ readonly fixedPrefixNames: readonly string[];
60
+ }
61
+ export interface DesugarScope {
62
+ readonly env?: ElabEnv;
63
+ readonly operators: OperatorTable;
64
+ readonly splices: readonly ElabTerm[];
65
+ readonly localTypes: ReadonlyMap<string, SurfaceExpr | undefined>;
66
+ readonly funVars: ReadonlyMap<string, Term>;
67
+ readonly universeBindings?: ReadonlyMap<string, number>;
68
+ readonly recCtx?: RecursiveDefContext;
69
+ readonly activeRecPredVar?: {
70
+ readonly predVar: string;
71
+ readonly ihIdent: string;
72
+ };
73
+ }
74
+ export declare function desugarBinder(b: SurfaceBinder, scope: DesugarScope): ElabBinder;
75
+ export declare function desugarBinders(binders: readonly SurfaceBinder[], scope: DesugarScope): {
76
+ readonly elabBinders: readonly ElabBinder[];
77
+ readonly innerScope: DesugarScope;
78
+ };
79
+ export declare function desugarCatSurface(expr: SurfaceExpr, scope: DesugarScope): ElabCatTerm;
80
+ export declare function desugarExpr(expr: SurfaceExpr, scope: DesugarScope): ElabTerm;
81
+ interface TacticTraceContext {
82
+ readonly theoremName: string;
83
+ readonly theoremSpan: SourceSpan;
84
+ readonly onTacticStep?: (trace: TacticStepTrace) => void;
85
+ readonly allowIncompleteProofs?: boolean;
86
+ }
87
+ export declare function snapshotProofGoals(state: ProofState): readonly FormattedGoalView[];
88
+ export declare function desugarTacticsToCombinator(tactics: readonly SurfaceTactic[], scope: DesugarScope, traceCtx?: TacticTraceContext): Tactic;
89
+ export declare function executeSurfaceModule(env: ElabEnv, mod: SurfaceModule, opts?: ModuleRunOptions): ModuleRunResult;
90
+ /**
91
+ * Convenience helper: parse and execute `.en` source code directly on `env`.
92
+ */
93
+ export declare function enRun(env: ElabEnv, source: string, opts?: ModuleRunOptions): ModuleRunResult;
94
+ export {};
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Browser-Safe Cursor `line:col` Tactic Goal-State Inspector & Live Tactic Probe
3
+ * (`endash/src/module/goal_inspector.ts`).
4
+ *
5
+ * 100% browser-safe (zero `node:*` imports) and 100% outside the trusted kernel (`0 LOC` TCB delta):
6
+ * shared across the `endash` CLI (`endash goals`), the `endash-mcp` server (`endash_goals_at`,
7
+ * `endash_run_tactic_probe`), and the zero-backend Browser Playground (`playground/index.html`).
8
+ */
9
+ import { ElabEnv } from '../elab/env';
10
+ import { SourceSpan } from '../parser/span';
11
+ import { CommandOutput, FormattedGoalView, TacticStepTrace } from './desugar';
12
+ import { ModuleLoader, ModuleSourceProvider } from './loader';
13
+ export type { FormattedGoalView, TacticStepTrace };
14
+ export interface InspectorDiagnostic {
15
+ readonly severity: 'error' | 'warning';
16
+ readonly code: string;
17
+ readonly message: string;
18
+ readonly line?: number;
19
+ readonly column?: number;
20
+ }
21
+ export interface ModuleInspectionReport {
22
+ readonly ok: boolean;
23
+ readonly file: string;
24
+ readonly declaredNames: readonly string[];
25
+ readonly axiomTaintedDecls: readonly {
26
+ readonly name: string;
27
+ readonly axioms: readonly string[];
28
+ }[];
29
+ readonly outputs: readonly CommandOutput[];
30
+ readonly traces: readonly TacticStepTrace[];
31
+ readonly diagnostics: readonly InspectorDiagnostic[];
32
+ readonly env: ElabEnv;
33
+ }
34
+ export interface InspectGoalsOptions {
35
+ readonly file?: string;
36
+ readonly providers?: readonly ModuleSourceProvider[];
37
+ readonly loader?: ModuleLoader;
38
+ }
39
+ export interface CursorGoalQueryResult {
40
+ readonly found: boolean;
41
+ readonly file: string;
42
+ readonly line: number;
43
+ readonly column: number;
44
+ readonly theoremName?: string;
45
+ readonly tacticTag?: string;
46
+ readonly tacticSummary?: string;
47
+ readonly positionRole?: 'before' | 'after' | 'by-entry';
48
+ readonly span?: SourceSpan;
49
+ readonly goalsBefore: readonly FormattedGoalView[];
50
+ readonly goalsAfter: readonly FormattedGoalView[];
51
+ readonly activeGoals: readonly FormattedGoalView[];
52
+ readonly stepError?: string;
53
+ readonly diagnostics: readonly InspectorDiagnostic[];
54
+ }
55
+ /**
56
+ * Elaborate an `.en` source module in fault-tolerant inspector mode, capturing
57
+ * every tactic step's `(span, goalsBefore, goalsAfter)` trace, command outputs,
58
+ * axiom footprints, and structured diagnostics.
59
+ */
60
+ export declare function inspectModuleSource(source: string, opts?: InspectGoalsOptions): ModuleInspectionReport;
61
+ /**
62
+ * Inspect the live tactic proof state at 1-based `(line, column)` in `source`.
63
+ *
64
+ * Selection semantics (Lean 4 InfoView style):
65
+ * 1. If `(line, column)` lies inside one or more tactic step spans, selects the
66
+ * tightest (smallest character-span) non-entry tactic step (or the `by` entry
67
+ * trace if on the `by` keyword itself):
68
+ * - If cursor is strictly at/past `span.end` (or at the last character of a
69
+ * single-line tactic when `column >= span.end.column`), `activeGoals = goalsAfter`;
70
+ * - Otherwise (cursor inside the tactic text), `activeGoals = goalsBefore`
71
+ * (while returning BOTH `goalsBefore` and `goalsAfter` for rich UI display!).
72
+ * 2. If `(line, column)` is in trailing whitespace on the same line after a tactic,
73
+ * selects the last tactic ending on that line and sets `activeGoals = goalsAfter`.
74
+ * 3. Otherwise, if `(line, column)` lies inside a `theorem ... := by ...` block,
75
+ * selects the most recent preceding tactic in that theorem (`goalsAfter`).
76
+ */
77
+ export declare function inspectGoalsAt(source: string, line: number, column: number, opts?: InspectGoalsOptions): CursorGoalQueryResult;
78
+ export interface TacticProbeOptions {
79
+ readonly imports?: readonly string[];
80
+ readonly preamble?: string;
81
+ readonly theoremSignature: string;
82
+ readonly tactics: readonly string[] | string;
83
+ readonly providers?: readonly ModuleSourceProvider[];
84
+ readonly loader?: ModuleLoader;
85
+ }
86
+ export interface TacticProbeResult {
87
+ readonly solved: boolean;
88
+ readonly axiomFree: boolean;
89
+ readonly axiomsUsed: readonly string[];
90
+ readonly remainingGoals: readonly FormattedGoalView[];
91
+ readonly steps: readonly {
92
+ readonly tacticSummary: string;
93
+ readonly goalsBefore: readonly FormattedGoalView[];
94
+ readonly goalsAfter: readonly FormattedGoalView[];
95
+ readonly error?: string;
96
+ }[];
97
+ readonly diagnostics: readonly InspectorDiagnostic[];
98
+ }
99
+ /**
100
+ * Run an interactive tactic probe against `theoremSignature` (`(n : Nat) : n + 0 = n` or
101
+ * full `theorem foo ... : ...`), returning step-by-step goal states and kernel verification!
102
+ */
103
+ export declare function runTacticProbe(opts: TacticProbeOptions): TacticProbeResult;
104
+ export declare function formatCursorGoalReport(res: CursorGoalQueryResult): string;
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Browser-Safe VFS & Node FS Acyclic `.en` Module Loader (`endash/src/module/loader.ts`).
3
+ *
4
+ * Inspired by `src/v3_2/lf_fragment_module_workspace.ts`, decoupled from Node `fs`
5
+ * by default (`MemoryModuleProvider` uses zero Node built-ins) with optional
6
+ * `NodeFsModuleProvider` for loading `.en` files from disk, diamond-import
7
+ * `ElabEnv` deduplication, cyclic-import detection (`NC-9b`), and content-keyed
8
+ * snapshot caching.
9
+ */
10
+ import { SerializedModuleDeltaSnapshot, VerifiedEnEnsnapBundleCache, VerifiedStdlibBundleCache } from '../cache/core_snapshot';
11
+ import { ElabEnv } from '../elab/env';
12
+ import { OperatorTable } from '../parser/pratt';
13
+ import { CommandOutput } from './desugar';
14
+ import { attachBuiltinStdlibCrossRefTags, attachBuiltinStdlibRuntimeHooks } from './stdlib_tactic_hooks';
15
+ export { attachBuiltinStdlibCrossRefTags, attachBuiltinStdlibRuntimeHooks };
16
+ export type EndashModuleErrorCode = 'MODULE_NOT_FOUND' | 'CYCLIC_IMPORT' | 'DUPLICATE_MODULE';
17
+ export declare class EndashModuleError extends Error {
18
+ readonly code: EndashModuleErrorCode;
19
+ constructor(code: EndashModuleErrorCode, message: string);
20
+ }
21
+ export interface ModuleSourceEntry {
22
+ readonly moduleId: string;
23
+ readonly filePath: string;
24
+ readonly source: string;
25
+ }
26
+ export interface ModuleSourceProvider {
27
+ resolve(moduleId: string): ModuleSourceEntry | undefined;
28
+ }
29
+ /**
30
+ * Pure in-memory Virtual File System provider (100% browser-safe, zero Node built-ins).
31
+ */
32
+ export declare class MemoryModuleProvider implements ModuleSourceProvider {
33
+ private readonly _files;
34
+ constructor(initial?: Readonly<Record<string, string>>);
35
+ register(moduleId: string, source: string, filePath?: string): void;
36
+ resolve(moduleId: string): ModuleSourceEntry | undefined;
37
+ delete(moduleId: string): void;
38
+ }
39
+ export declare const ALL_BUILTIN_STDLIB_MODULES: readonly string[];
40
+ export interface EnElaborationMemoEntry {
41
+ readonly delta: SerializedModuleDeltaSnapshot;
42
+ readonly outputs: readonly CommandOutput[];
43
+ }
44
+ export interface EnElaborationMemoStats {
45
+ readonly size: number;
46
+ readonly hits: number;
47
+ readonly misses: number;
48
+ readonly skippedTainted: number;
49
+ }
50
+ export interface HostEnDiskCacheProvider {
51
+ read(cacheKey: string, expectedModuleId: string, expectedSourceSha256: string, filePath: string): EnElaborationMemoEntry | undefined;
52
+ write(cacheKey: string, entry: EnElaborationMemoEntry, filePath: string): void;
53
+ }
54
+ export declare function getHostEnDiskCacheProvider(): HostEnDiskCacheProvider | null;
55
+ export declare function setHostEnDiskCacheProvider(provider: HostEnDiskCacheProvider | null): void;
56
+ export declare function clearEnElaborationMemo(): void;
57
+ export declare function getEnElaborationMemoStats(): EnElaborationMemoStats;
58
+ export declare function getEnElaborationMemoEntry(cacheKey: string): EnElaborationMemoEntry | undefined;
59
+ export declare function setEnElaborationMemoEntry(cacheKey: string, entry: EnElaborationMemoEntry): void;
60
+ export declare function withEnElaborationMemoDisabled<T>(fn: () => T): T;
61
+ export declare function setHostStdlibBundleProvider(provider: (() => VerifiedStdlibBundleCache | null) | null): void;
62
+ export declare function registerVerifiedStdlibBundle(bundle: VerifiedStdlibBundleCache | null): void;
63
+ export declare function getRegisteredVerifiedStdlibBundle(): VerifiedStdlibBundleCache | null;
64
+ export declare function setHostEnEnsnapBundleProvider(provider: (() => VerifiedEnEnsnapBundleCache | null) | null): void;
65
+ export declare function registerVerifiedEnEnsnapBundle(bundle: VerifiedEnEnsnapBundleCache | null): void;
66
+ export declare function getRegisteredVerifiedEnEnsnapBundle(): VerifiedEnEnsnapBundleCache | null;
67
+ export declare function withEnEnsnapBundleDisabled<T>(fn: () => T): T;
68
+ /**
69
+ * Elaborate all built-in stdlib modules from scratch (ignoring any disk snapshot)
70
+ * for snapshot generation and full uncached conformance verification.
71
+ */
72
+ export declare function buildAllFreshStdlibSnapshots(): readonly {
73
+ readonly moduleId: string;
74
+ readonly env: ElabEnv;
75
+ readonly operators: OperatorTable;
76
+ }[];
77
+ export interface CompiledModuleSnapshot {
78
+ readonly moduleId: string;
79
+ readonly sourceKey: string;
80
+ readonly env: ElabEnv;
81
+ readonly operators: OperatorTable;
82
+ readonly outputs: readonly CommandOutput[];
83
+ readonly declaredNames: readonly string[];
84
+ }
85
+ export declare class ModuleLoader {
86
+ private readonly _providers;
87
+ private readonly _compiledCache;
88
+ private readonly _cacheKeys;
89
+ constructor(providers?: readonly ModuleSourceProvider[]);
90
+ private resolveEntry;
91
+ evictModule(moduleId: string): void;
92
+ loadModuleReadOnly(moduleId: string): CompiledModuleSnapshot;
93
+ /**
94
+ * Load and kernel-verify `moduleId` and all its transitive `import`s, detecting
95
+ * any import cycle (`CYCLIC_IMPORT`, `NC-9b`) and caching compiled snapshots.
96
+ */
97
+ loadModule(moduleId: string, activeStack?: readonly string[]): CompiledModuleSnapshot;
98
+ private loadModuleInternal;
99
+ }
100
+ export declare function scanLeadingImports(source: string): {
101
+ readonly moduleId: string;
102
+ readonly line: number;
103
+ readonly col: number;
104
+ }[];
105
+ export { NodeEnDiskCacheStats, NodeFsModuleProvider, clearNodeEnDiskCache, clearNodeEnDiskCacheStats, getNodeEnDiskCacheDir, getNodeEnDiskCacheStats, setNodeEnDiskCacheDir, } from './node_fs_provider';