@nudojs/core 1.9.3 → 1.10.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.
@@ -400,6 +400,9 @@ type EvalCallRecord = {
400
400
  * (resultAbs=payload、throwsAbs=never,isLeakedCallRecord
401
401
  * 的 never+never 拦不住)。5 处 emitter 均已显式设置。 */
402
402
  threw: boolean;
403
+ /** 调用方帧深度(0 = 最外层求值帧;递归内层帧 ≥1)。
404
+ * 局部量投影按帧过滤重入记录(与 $nodoPos 同口径)。 */
405
+ depth?: number;
403
406
  };
404
407
  /** 清空 pureCallMemo(宿主入口 / 会话缓存失效) */
405
408
  declare function clearPureCallMemo(): void;
@@ -411,11 +414,36 @@ type EvalAbsAssignRecord = {
411
414
  line?: number;
412
415
  column?: number;
413
416
  conditional?: boolean;
417
+ /** 调用方帧深度(0 = 最外层求值帧;与 EvalCallRecord.depth 同口径) */
418
+ depth?: number;
414
419
  };
415
420
  /** 返回先前 collector,便于嵌套调用 save/restore(禁止 finally 置 null 砸外层) */
416
421
  declare function setEvalAssignCollector(collector: ((r: EvalAbsAssignRecord) => void) | null): ((r: EvalAbsAssignRecord) => void) | null;
417
422
  /** 结构赋值记录(transpile 插桩调用;无收集器时 no-op) */
418
423
  declare function $assignRecord(name: string, prev: Abs | undefined, next: Abs, line: number, column: number, conditional: boolean): void;
424
+ /** 位置级 Abs 记录(hover 重放插桩 `$nodoPos` 消费):
425
+ * (1-based 行, 0-based 列) → 该位置表达式求值态 Abs */
426
+ type EvalPosRecord = {
427
+ line: number;
428
+ column: number;
429
+ abs: Abs;
430
+ };
431
+ /** 返回先前 collector,便于嵌套调用 save/restore(禁止 finally 置 null 砸外层) */
432
+ declare function setPosCollector(collector: ((r: EvalPosRecord) => void) | null): ((r: EvalPosRecord) => void) | null;
433
+ declare function getPosCollector(): ((r: EvalPosRecord) => void) | null;
434
+ /**
435
+ * 位置级 Abs 记录(transpile 插桩调用——`recordPositions` 时
436
+ * Identifier 值读 / 静态成员读包此调用):把 (行, 列) → Abs
437
+ * 记入活跃 collector 并**原样返回**(语义恒等);无收集器时
438
+ * 直通(热路径零开销——仅重放开插桩)。
439
+ *
440
+ * 仅记最外层求值帧(evalCallDepth === 0):递归函数的内层帧
441
+ * ($callNamed/$new 预算帧)会以重入态重执行同一源码位置——
442
+ * 自递归类型(lazy 自引用契约)下内层帧携带 cycle 截断的
443
+ * opaque unknown,first-wins 记录会以外层正确值被污染为序;
444
+ * 编辑器位置的语义以最外层调用帧(hover 重放的单次入口)为准。
445
+ */
446
+ declare function $nodoPos(v: Abs, line: number, column: number): Abs;
419
447
  declare function setEvalBindingSink(sink: Map<string, unknown> | null): void;
420
448
  /** 顶层绑定记录(transpile 插桩调用) */
421
449
  declare function $recordBinding(name: string, value: unknown): void;
@@ -701,6 +729,12 @@ type AbsModuleExports = {
701
729
  * 成功求值的表报(zero-FP,避免与 module-missing 叠报)。
702
730
  */
703
731
  evaluated?: boolean;
732
+ /**
733
+ * CJS `module.exports = X` 重赋值形态(Bug 10 回归修复):原生 require
734
+ * 返回 X 本身(常为可调用函数),而非命名空间对象。requireFromModules
735
+ * 据此返回 default(= module.exports 值);缺省按命名空间对象口径。
736
+ */
737
+ cjsMain?: boolean;
704
738
  };
705
739
  /**
706
740
  * 命名空间 Abs(`import * as ns` / `export * as ns` / CJS require 绑定):
@@ -746,6 +780,9 @@ type RunTranspiledOptions = {
746
780
  envGlobals?: Record<string, Abs>;
747
781
  /** @nudo:mock 注入值:name → Abs(mockDirectivesToAbsSeeds 产物) */
748
782
  mocks?: Record<string, Abs>;
783
+ /** 节点级 Abs 记录插桩(hover 重放用——透传 transpile 的
784
+ * recordPositions:Identifier 值读 / 静态成员读包 $nodoPos) */
785
+ recordPositions?: boolean;
749
786
  /** 宽松全局(调用点发现 exec 采集:未声明全局调用保守 unknown 不中断) */
750
787
  lenientGlobals?: boolean;
751
788
  };
@@ -792,6 +829,8 @@ declare function noteEvalFallback(e: unknown): void;
792
829
  * unsupported:*(能力边界)/ internal(B 缺陷)都记录到收集器;
793
830
  * 返回 undefined 表示调用方应走解释路径。
794
831
  */
832
+ /** run 表是否来自 CJS `module.exports = X` 重赋值形态(供桥接层标 cjsMain)。 */
833
+ declare function isCjsMainRun(run: Record<string, unknown>): boolean;
795
834
  declare function tryRunTranspiled(source: string, opts?: RunTranspiledOptions): Record<string, unknown> | undefined;
796
835
  type TranspiledCallResult = {
797
836
  result: Abs;
@@ -817,4 +856,4 @@ declare function callTranspiledExport(exports: Record<string, unknown>, name: st
817
856
  */
818
857
  declare function callTranspiledExportApply(exports: Record<string, unknown> | (() => Record<string, unknown>), name: string): (args: Abs[], thisVal?: Abs) => AbsApplyResult;
819
858
 
820
- export { $tryDigestSoft as $, type Abs as A, orphanMayThrowEffects as B, type Confidence as C, popMayThrowFrame as D, ERROR_FAMILY as E, pushMayThrowFrame as F, recordMayThrow as G, resetEvalFallbackStats as H, runWithMayThrowSession as I, setMayThrowCollector as J, throwAbsToKinds as K, type LiteralValue as L, type MayThrowEffect as M, throwsKindCovered as N, withEvalBudgetOverride as O, type PrimName as P, type HofCollectCtx as Q, type RelSource as R, type Shape as S, type Term as T, type HofSite as U, type RunTranspiledOptions as V, $assignRecord as W, $call as X, $callNamed as Y, $recordBinding as Z, type AbsApplyNoThrow as _, type Pred as a, ne as a$, type AbsApplyNoThrowFn as a0, type AbsApplyResult as a1, type AbsApplyReturn as a2, type AbsFnImpl as a3, type AbsSigImpl as a4, type EvalAbsAssignRecord as a5, type EvalCallRecord as a6, type EvalFallback as a7, type ImplicationOracle as a8, type LitValueResult as a9, emptyPhi as aA, eq as aB, evalExprAbs as aC, ge as aD, geNum as aE, getEvalCallCollector as aF, getFnImpl as aG, getImplicationOracle as aH, gt as aI, gtNum as aJ, hostFnCtorFacet as aK, implies as aL, isAbsApplyResult as aM, isAbsVal as aN, isBigPrim as aO, isExactLit as aP, isNumPrim as aQ, isStrPrim as aR, le as aS, leNum as aT, lit as aU, litValue as aV, lt as aW, ltNum as aX, makeAbsApplyResult as aY, markPureFn as aZ, namespaceAbsOf as a_, MAX_EVAL_CALL_DEPTH as aa, MAX_EVAL_TOTAL_CALLS as ab, RUNTIME_IMPORT_RE as ac, TYPEOF_NAMES as ad, type TranspiledCallResult as ae, type TypeofName as af, abs as ag, absFunction as ah, absOnly as ai, absToString as aj, and as ak, anyAbs as al, anyVar as am, app as an, assumeFinite as ao, attachFnImpl as ap, bigintLit as aq, bindImports as ar, bindingsOf as as, bool as at, boolLit as au, callTranspiledExport as av, callTranspiledExportApply as aw, callTranspiledExportFull as ax, collectAbsExports as ay, confJoin as az, type Phi as b, negatePred as b0, never as b1, not as b2, noteEvalCallRecord as b3, noteEvalFallback as b4, num as b5, numLit as b6, numVar as b7, obj as b8, or as b9, termEquals as bA, termToString as bB, tryRunTranspiled as bC, unknown as bD, v as bE, routeApplyThrows as bF, pFalse as ba, pTrue as bb, phiAnd as bc, predEquals as bd, predToString as be, predVars as bf, primToTypeof as bg, ptypeof as bh, pureFnNameOf as bi, relationFingerprint as bj, relationFn as bk, resetEvalCallBudget as bl, runTranspiled as bm, runTranspiledOptionsMemoKey as bn, setEvalAssignCollector as bo, setEvalBindingSink as bp, setEvalCallCollector as bq, setEvalFallbackCollector as br, setImplicationOracle as bs, shapeOfTerm as bt, shapeOnlyFn as bu, shapeToString as bv, simplifyTerm as bw, str as bx, strLit as by, substPred as bz, type AbsModuleExports as c, type AstEnv as d, $tryMarkSoft as e, $tryReleaseSoft as f, type EvalFallbackStats as g, absLit as h, absNumLit as i, absStrLit as j, allAbsStr as k, clearPureCallMemo as l, clearPureMemo as m, enterEvalCallBudgetSession as n, errorTypeAbs as o, exitEvalCallBudgetSession as p, filterDeclaredThrows as q, filterGateThrows as r, filterIgnoredThrows as s, flushMayThrowEffects as t, formatThrowsAbs as u, getEvalCallBudgetState as v, getEvalFallbackStats as w, getMayThrowCollector as x, isThrowsIgnored as y, mayThrowEffectsToAbs as z };
859
+ export { $tryDigestSoft as $, type Abs as A, orphanMayThrowEffects as B, type Confidence as C, popMayThrowFrame as D, ERROR_FAMILY as E, pushMayThrowFrame as F, recordMayThrow as G, resetEvalFallbackStats as H, runWithMayThrowSession as I, setMayThrowCollector as J, throwAbsToKinds as K, type LiteralValue as L, type MayThrowEffect as M, throwsKindCovered as N, withEvalBudgetOverride as O, type PrimName as P, type HofCollectCtx as Q, type RelSource as R, type Shape as S, type Term as T, type HofSite as U, type RunTranspiledOptions as V, $assignRecord as W, $call as X, $callNamed as Y, $recordBinding as Z, type AbsApplyNoThrow as _, type Pred as a, markPureFn as a$, type AbsApplyNoThrowFn as a0, type AbsApplyResult as a1, type AbsApplyReturn as a2, type AbsFnImpl as a3, type AbsSigImpl as a4, type EvalAbsAssignRecord as a5, type EvalCallRecord as a6, type EvalFallback as a7, type EvalPosRecord as a8, type ImplicationOracle as a9, confJoin as aA, emptyPhi as aB, eq as aC, evalExprAbs as aD, ge as aE, geNum as aF, getEvalCallCollector as aG, getFnImpl as aH, getImplicationOracle as aI, gt as aJ, gtNum as aK, hostFnCtorFacet as aL, implies as aM, isAbsApplyResult as aN, isAbsVal as aO, isBigPrim as aP, isCjsMainRun as aQ, isExactLit as aR, isNumPrim as aS, isStrPrim as aT, le as aU, leNum as aV, lit as aW, litValue as aX, lt as aY, ltNum as aZ, makeAbsApplyResult as a_, type LitValueResult as aa, MAX_EVAL_CALL_DEPTH as ab, MAX_EVAL_TOTAL_CALLS as ac, RUNTIME_IMPORT_RE as ad, TYPEOF_NAMES as ae, type TranspiledCallResult as af, type TypeofName as ag, abs as ah, absFunction as ai, absOnly as aj, absToString as ak, and as al, anyAbs as am, anyVar as an, app as ao, assumeFinite as ap, attachFnImpl as aq, bigintLit as ar, bindImports as as, bindingsOf as at, bool as au, boolLit as av, callTranspiledExport as aw, callTranspiledExportApply as ax, callTranspiledExportFull as ay, collectAbsExports as az, type Phi as b, namespaceAbsOf as b0, ne as b1, negatePred as b2, never as b3, not as b4, noteEvalCallRecord as b5, noteEvalFallback as b6, num as b7, numLit as b8, numVar as b9, str as bA, strLit as bB, substPred as bC, termEquals as bD, termToString as bE, tryRunTranspiled as bF, unknown as bG, v as bH, $nodoPos as bI, getPosCollector as bJ, routeApplyThrows as bK, obj as ba, or as bb, pFalse as bc, pTrue as bd, phiAnd as be, predEquals as bf, predToString as bg, predVars as bh, primToTypeof as bi, ptypeof as bj, pureFnNameOf as bk, relationFingerprint as bl, relationFn as bm, resetEvalCallBudget as bn, runTranspiled as bo, runTranspiledOptionsMemoKey as bp, setEvalAssignCollector as bq, setEvalBindingSink as br, setEvalCallCollector as bs, setEvalFallbackCollector as bt, setImplicationOracle as bu, setPosCollector as bv, shapeOfTerm as bw, shapeOnlyFn as bx, shapeToString as by, simplifyTerm as bz, type AbsModuleExports as c, type AstEnv as d, $tryMarkSoft as e, $tryReleaseSoft as f, type EvalFallbackStats as g, absLit as h, absNumLit as i, absStrLit as j, allAbsStr as k, clearPureCallMemo as l, clearPureMemo as m, enterEvalCallBudgetSession as n, errorTypeAbs as o, exitEvalCallBudgetSession as p, filterDeclaredThrows as q, filterGateThrows as r, filterIgnoredThrows as s, flushMayThrowEffects as t, formatThrowsAbs as u, getEvalCallBudgetState as v, getEvalFallbackStats as w, getMayThrowCollector as x, isThrowsIgnored as y, mayThrowEffectsToAbs as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nudojs/core",
3
- "version": "1.9.3",
3
+ "version": "1.10.0",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },