@nudojs/core 1.9.4 → 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.
package/dist/exec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Abs, M as MayThrowEffect, b as Phi } from './run-WZKUu1y1.js';
2
- export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, g as EvalFallbackStats, aa as MAX_EVAL_CALL_DEPTH, ab as MAX_EVAL_TOTAL_CALLS, ac as RUNTIME_IMPORT_RE, V as RunTranspiledOptions, ae as TranspiledCallResult, as as bindingsOf, av as callTranspiledExport, aw as callTranspiledExportApply, ax as callTranspiledExportFull, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, aC as evalExprAbs, p as exitEvalCallBudgetSession, v as getEvalCallBudgetState, aF as getEvalCallCollector, w as getEvalFallbackStats, aN as isAbsVal, b3 as noteEvalCallRecord, b4 as noteEvalFallback, bl as resetEvalCallBudget, H as resetEvalFallbackStats, bF as routeApplyThrows, bm as runTranspiled, bn as runTranspiledOptionsMemoKey, bo as setEvalAssignCollector, bp as setEvalBindingSink, bq as setEvalCallCollector, br as setEvalFallbackCollector, bC as tryRunTranspiled, O as withEvalBudgetOverride } from './run-WZKUu1y1.js';
1
+ import { A as Abs, M as MayThrowEffect, b as Phi } from './run-Bgj2tCrv.js';
2
+ export { W as $assignRecord, X as $call, Y as $callNamed, bI as $nodoPos, Z as $recordBinding, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, g as EvalFallbackStats, a8 as EvalPosRecord, ab as MAX_EVAL_CALL_DEPTH, ac as MAX_EVAL_TOTAL_CALLS, ad as RUNTIME_IMPORT_RE, V as RunTranspiledOptions, af as TranspiledCallResult, at as bindingsOf, aw as callTranspiledExport, ax as callTranspiledExportApply, ay as callTranspiledExportFull, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, aD as evalExprAbs, p as exitEvalCallBudgetSession, v as getEvalCallBudgetState, aG as getEvalCallCollector, w as getEvalFallbackStats, bJ as getPosCollector, aO as isAbsVal, aQ as isCjsMainRun, b5 as noteEvalCallRecord, b6 as noteEvalFallback, bn as resetEvalCallBudget, H as resetEvalFallbackStats, bK as routeApplyThrows, bo as runTranspiled, bp as runTranspiledOptionsMemoKey, bq as setEvalAssignCollector, br as setEvalBindingSink, bs as setEvalCallCollector, bt as setEvalFallbackCollector, bv as setPosCollector, bF as tryRunTranspiled, O as withEvalBudgetOverride } from './run-Bgj2tCrv.js';
3
3
  import { Node, Expression, File } from '@babel/types';
4
4
 
5
5
  /**
@@ -192,8 +192,9 @@ declare function lookupObjAccessor(o: Abs, key: string): {
192
192
  set?: (t: Abs, v: Abs) => Abs;
193
193
  } | undefined;
194
194
  /**
195
- * `key in obj`:闭形状精确判定(含 Object.prototype 名、数组下标/length、
196
- * class 方法/访问器与内建 brand 方法);prim/nullish 接收者原生抛 TypeError →
195
+ * `key in obj`:闭形状精确判定(含 Object.prototype/Array.prototype 名、
196
+ * 数组下标/length、class 方法/访问器与内建 brand 方法/访问器);
197
+ * prim/nullish 接收者原生抛 TypeError →
197
198
  * unknown;抽象键/开形状 → boolean。
198
199
  */
199
200
  declare function $in(key: Abs, o: Abs): Abs;
@@ -338,8 +339,11 @@ declare function $idx(a: Abs, i: Abs, opts?: {
338
339
  }): Abs;
339
340
  /** 下标写 a[i]=v → 新 tuple(越界写按 JS 语义增长,空洞为 undefined) */
340
341
  declare function $idxSet(a: Abs, i: Abs, value: Abs): Abs;
341
- /** 数组/字符串长度 */
342
- declare function $len(a: Abs): Abs;
342
+ /** 数组/字符串长度。opts.silent:可选链(a?.length)守卫臂——接收者已过
343
+ * $removeNullish,仅 any 不记 may-throw(Bug 3,与 $get 的 silent 同口径)。 */
344
+ declare function $len(a: Abs, opts?: {
345
+ silent?: boolean;
346
+ }): Abs;
343
347
  /** 对象字面量 → Abs obj(槽位写走 setSlot,`__proto__` 不踩宿主 setter) */
344
348
  declare function $obj(slots: Record<string, Abs>): Abs;
345
349
  /**
@@ -368,7 +372,9 @@ declare function $iterCheck(a: unknown): void;
368
372
  /** 元素列表(tuple 展开;arr 抽象;C1 Set/Map 逐条目;matchAll 迭代器逐匹配项;
369
373
  * 字符串按 code points)。Map 迭代语义是 entry `[key, value]` 元组,不是裸 value。
370
374
  * 消费前先过可迭代性守卫(Bug 6):prim 字面量接收者 → 原生 definite
371
- * TypeError;any/unknown → may。$forOf 与 call/new spread 实参路径继承。 */
375
+ * TypeError;any/unknown → may。$forOf 与 call/new spread 实参路径继承。
376
+ * Bug 34:生成器对象的体内延迟异常(definite 抛 / soft may-throw 重记)
377
+ * 在消费点重放——迭代不再静默截断成前缀。 */
372
378
  declare function $elems(a: Abs): Abs[];
373
379
  /** 模板标签对象(GetTemplateObject,Bug 34):冻结的类数组 obj——数字槽
374
380
  * 为 cooked 字符串(无效转义序列时 cooked 是 undefined,原生实测)、
@@ -428,15 +434,17 @@ declare function $asyncReturn(v: Abs): Abs;
428
434
  /** function* 体:收集所有 yield 值;返回带迭代器协议面的生成器对象 Abs;
429
435
  * 抽象分支时降 conf(P0-6)
430
436
  *
431
- * Bug 58:调用生成器是原生全操作——体只在首个 next() 执行。此前 body()
432
- * eager 执行把体内 may-throw(成员读 any)/显式 throw 折进**调用方** throws
433
- * 域(每生成器入口假 entry-may-throw)。现以丢弃式 may-throw 帧包裹:
434
- * soft 效果进帧后丢弃、NudoThrow/宿主异常吞掉(迭代期语义,调用期不表面)。
435
- * yield 收集保持 eager(既有值域建模,注释口径不变)。
437
+ * Bug 58:调用生成器是原生全操作——体只在首个 next() 执行。body() eager
438
+ * 执行的体内效果(成员读 may-throw / 显式 throw)不折进**调用方** throws
439
+ * 域——以捕获式 may-throw 帧包裹:soft 效果与 NudoThrow 挂生成器对象
440
+ * (Bug 34 延迟重放:首个触达抛点的 next()/迭代消费,仅构造不消费不
441
+ * 表面)。yield 收集保持 eager(既有值域建模,注释口径不变)。
442
+ * Bug 2:thunk 返回值 = 终末 return 值——不再丢弃,经 makeGenObject 在
443
+ * 首个 done:true 作为 value 交付(node 实测:此后 next 回 undefined)。
436
444
  * Bug 22:结果从 yield 元组数组改为生成器对象(next/return/throw 方法面 +
437
445
  * constructor 身份);元素域经侧表保留($arr 的 ≤cap tuple / >cap arr
438
446
  * widen 策略不变),迭代路径(for-of/spread/Array.from)继续工作。 */
439
- declare function $gen(body: () => void): Abs;
447
+ declare function $gen(body: () => Abs): Abs;
440
448
  /** yield v:压入当前生成器收集器;表达式值用 unknown */
441
449
  declare function $yield(v: Abs): Abs;
442
450
  /** yield* v(Bug 82):委托迭代 ≠ yield v——GetIterator 校验先行($elems
@@ -496,6 +504,18 @@ declare function $removeMemberNullish(a: Abs, key: string): Abs;
496
504
  * 原样返回(臂不可达的保守近似,与 $removeNullish 空集口径一致)。
497
505
  */
498
506
  declare function $narrowTypeOf(a: Abs, typeOf: string, keep: boolean): Abs;
507
+ /**
508
+ * 关系守卫臂剪影(Bug 1):`x >= 0` 真臂把 x 重绑为带 ge(x,0) 界的 Abs
509
+ * ——守卫建立的隐含约束随**普通变量读取**进入返回值 / 签名面。此前只有
510
+ * 算术折叠消费 exec Φ(`x + 0` 携带界),裸 `return x` 丢守卫事实 →
511
+ * return-constraint gate 假阳(可证合规的函数过不了 CI)。只做事实臂:
512
+ * ¬(x≥0) 含 NaN 可能(NaN 与任何比较皆假),补集界不可健全表示。精确
513
+ * 字面量(lit term)的界由域隶属折叠,不加 pred 保持精确面干净。
514
+ * 只精化 number prim:any 的真臂还含 bigint(`10n >= 0` 为真)与
515
+ * ToPrimitive 对象面,refineAbsForRelTrue 的 number|string 并集会
516
+ * 凭空排除 bigint → 假证明;any/unknown 保持原样(宁缺毋假)。
517
+ */
518
+ declare function $refineRel(a: Abs, op: "gt" | "ge" | "lt" | "le", k: number): Abs;
499
519
  /**
500
520
  * 判别等值守卫臂剪影(issue #126):`x.key === lit` 事实臂(keep=true)内把
501
521
  * x 重绑为「key 值域可能等于 lit」的成员子集(剪 "never" 成员);对偶补集臂
@@ -575,6 +595,16 @@ type TranspileOptions = {
575
595
  destrTmpSeq?: {
576
596
  n: number;
577
597
  };
598
+ /**
599
+ * try 临时名单调计数器(`__nudoTm_`/`__nudoE_`;transpileFile /
600
+ * transpileBodyNode 创建,单次转译输出内共享)。此前按源行号命名——
601
+ * 同一作用域同一行两个 try(压缩/生成代码)重名 → 重复 `const` 声明 →
602
+ * `new Function` SyntaxError 整模块 fail-closed;计数器与行号解耦
603
+ * (含 loc 缺失 `?? 0` 的碰撞),跨语句单调。
604
+ */
605
+ tryTmpSeq?: {
606
+ n: number;
607
+ };
578
608
  /**
579
609
  * 当前词法作用域可见的 const 绑定名(用户层再赋值须 TypeError)。
580
610
  * 成员/下标写对根的内部重绑不在用户赋值路径,不走此表。
@@ -591,6 +621,14 @@ type TranspileOptions = {
591
621
  * 声明语句),此类名字从提升集扣除、不发改赋值。
592
622
  */
593
623
  keepVarDecl?: boolean;
624
+ /**
625
+ * 节点级 Abs 记录插桩(hover 重放用):Identifier 值读与
626
+ * 静态成员读的转译输出包 `$nodoPos(<src>, line, column)`,
627
+ * 运行时把 (行, 列) → Abs 记入活跃的位置 collector(无收
628
+ * 集器时 no-op 直通)。默认关——热路径(check/模块图)不
629
+ * 承担插桩开销;仅 replayFnAbsNodes 重放开。
630
+ */
631
+ recordPositions?: boolean;
594
632
  };
595
633
 
596
634
  /**
@@ -619,6 +657,12 @@ declare function transpileBodyNode(node: Node, opts: TranspileOptions): string;
619
657
  * 表达式发射:transpileExpression / transpileShortCircuitExpr。
620
658
  */
621
659
 
660
+ /**
661
+ * 表达式发射入口(位置插桩包装层)。recordPositions 时把
662
+ * Identifier 值读 / 静态成员读的转译输出包 `$nodoPos`——
663
+ * 运行时记 (行, 列) → Abs 并原样返回(语义恒等;无收集
664
+ * 器时直通)。内部递归经本包装——每个子表达式恰包一次。
665
+ */
622
666
  declare function transpileExpression(expr: Expression, opts?: TranspileOptions): string;
623
667
 
624
668
  /**
@@ -773,4 +817,4 @@ declare class NudoUnsupportedError extends Error {
773
817
  detail?: string);
774
818
  }
775
819
 
776
- export { $absVal, $add, $arguments, $arr, $arrMutContainer, $arrRest, $arrWithHoles, $async, $asyncReturn, $await, $bitand, $bitnot, $bitor, $bitxor, $catchVal, $class, $classExpr, $collectionForEach, $concat, $copy, $del, $delRes, $div, $dynamicImport, $elems, $eq, $eqLoose, $fnVal, $for, $forInKeys, $forIter, $forOf, $fork, $ge, $gen, $get, $getSuper, $getSuperObj, $gt, $idx, $idxSet, $importMeta, $in, $instanceof, $instanceofNonIdent, $invoke, $invokeSuper, $invokeSuperKey, $invokeSuperObj, $isBreakTo, $isForkExit, $iterCheck, $join, $le, $len, $lit, $loopBreak, $loopContinue, $loopReturn, $lt, $mod, $mul, $narrowMemberEq, $narrowTypeOf, $ne, $neLoose, $neg, $new, $newTarget, $not, $nullishTest, $obj, $objAccessor, $objAccessorKey, $objRest, $optionalGet, $optionalInvoke, $orDefault, $pow, $pushLoopExit, $rawThis, $reStateCall, $regex, $removeMemberNullish, $removeNull, $removeNullish, $removeUndefined, $restBind, $rethrowIfNudoReturn, $set, $setKey, $setProto, $shl, $shr, $spread, $staticInit, $staticInvoke, $sub, $super, $switch, $thisGet, $thisSet, $throw, $toNumber, $toNumeric, $tpl, $tryCurrentMark, $tryDetachSoftCatch, $tryDigestSoftCatch, $tryDiscardSoft, $tryMark, $tryOrphanSoft, $tryPopMark, $tryReleaseSoftCatch, $tryReleaseSoftOut, $tryTakeSince, $typeof, $unknown, $updateAdd, $updateSub, $ushr, $while, $whileSeq, $yield, $yieldStar, DEFAULT_MAX_LOOP_ITERS, type EvalClassSpec, NudoLoopSignal, NudoReturn, NudoThrow, NudoUnsupportedError, type TranspileOptions, asAbsVal, callAtFunctionBoundary, clearBClasses, clearStaleTermPred, currentExecPhi, fillTuple, foldRequireSpecArg, foldStaticStringExpr, getEvalClass, isArrMutator, isDefinitelyFalse, isDefinitelyTrue, isNudoBreak, isNudoContinue, isNudoReturn, isNudoThrow, litTruth, lookupObjAccessor, namespaceNameOf, pushLoopExit, pushThrowExit, registerEvalClass, runWithLoopExits, runtimeImportOf, takeLoopExits, takeThrowExits, transpile, transpileBodyNode, transpileExpression, transpileFile, transpileSource, withExecPhi };
820
+ export { $absVal, $add, $arguments, $arr, $arrMutContainer, $arrRest, $arrWithHoles, $async, $asyncReturn, $await, $bitand, $bitnot, $bitor, $bitxor, $catchVal, $class, $classExpr, $collectionForEach, $concat, $copy, $del, $delRes, $div, $dynamicImport, $elems, $eq, $eqLoose, $fnVal, $for, $forInKeys, $forIter, $forOf, $fork, $ge, $gen, $get, $getSuper, $getSuperObj, $gt, $idx, $idxSet, $importMeta, $in, $instanceof, $instanceofNonIdent, $invoke, $invokeSuper, $invokeSuperKey, $invokeSuperObj, $isBreakTo, $isForkExit, $iterCheck, $join, $le, $len, $lit, $loopBreak, $loopContinue, $loopReturn, $lt, $mod, $mul, $narrowMemberEq, $narrowTypeOf, $ne, $neLoose, $neg, $new, $newTarget, $not, $nullishTest, $obj, $objAccessor, $objAccessorKey, $objRest, $optionalGet, $optionalInvoke, $orDefault, $pow, $pushLoopExit, $rawThis, $reStateCall, $refineRel, $regex, $removeMemberNullish, $removeNull, $removeNullish, $removeUndefined, $restBind, $rethrowIfNudoReturn, $set, $setKey, $setProto, $shl, $shr, $spread, $staticInit, $staticInvoke, $sub, $super, $switch, $thisGet, $thisSet, $throw, $toNumber, $toNumeric, $tpl, $tryCurrentMark, $tryDetachSoftCatch, $tryDigestSoftCatch, $tryDiscardSoft, $tryMark, $tryOrphanSoft, $tryPopMark, $tryReleaseSoftCatch, $tryReleaseSoftOut, $tryTakeSince, $typeof, $unknown, $updateAdd, $updateSub, $ushr, $while, $whileSeq, $yield, $yieldStar, DEFAULT_MAX_LOOP_ITERS, type EvalClassSpec, NudoLoopSignal, NudoReturn, NudoThrow, NudoUnsupportedError, type TranspileOptions, asAbsVal, callAtFunctionBoundary, clearBClasses, clearStaleTermPred, currentExecPhi, fillTuple, foldRequireSpecArg, foldStaticStringExpr, getEvalClass, isArrMutator, isDefinitelyFalse, isDefinitelyTrue, isNudoBreak, isNudoContinue, isNudoReturn, isNudoThrow, litTruth, lookupObjAccessor, namespaceNameOf, pushLoopExit, pushThrowExit, registerEvalClass, runWithLoopExits, runtimeImportOf, takeLoopExits, takeThrowExits, transpile, transpileBodyNode, transpileExpression, transpileFile, transpileSource, withExecPhi };
package/dist/exec.js CHANGED
@@ -72,6 +72,7 @@ import {
72
72
  $neg,
73
73
  $new,
74
74
  $newTarget,
75
+ $nodoPos,
75
76
  $not,
76
77
  $nullishTest,
77
78
  $obj,
@@ -86,6 +87,7 @@ import {
86
87
  $rawThis,
87
88
  $reStateCall,
88
89
  $recordBinding,
90
+ $refineRel,
89
91
  $regex,
90
92
  $removeMemberNullish,
91
93
  $removeNull,
@@ -158,8 +160,10 @@ import {
158
160
  getEvalCallCollector,
159
161
  getEvalClass,
160
162
  getEvalFallbackStats,
163
+ getPosCollector,
161
164
  isAbsVal,
162
165
  isArrMutator,
166
+ isCjsMainRun,
163
167
  isDefinitelyFalse,
164
168
  isDefinitelyTrue,
165
169
  isNudoBreak,
@@ -185,6 +189,7 @@ import {
185
189
  setEvalBindingSink,
186
190
  setEvalCallCollector,
187
191
  setEvalFallbackCollector,
192
+ setPosCollector,
188
193
  takeLoopExits,
189
194
  takeThrowExits,
190
195
  transpile,
@@ -195,7 +200,7 @@ import {
195
200
  tryRunTranspiled,
196
201
  withEvalBudgetOverride,
197
202
  withExecPhi
198
- } from "./chunk-PGTNSUTE.js";
203
+ } from "./chunk-YREYFITQ.js";
199
204
  export {
200
205
  $absVal,
201
206
  $add,
@@ -269,6 +274,7 @@ export {
269
274
  $neg,
270
275
  $new,
271
276
  $newTarget,
277
+ $nodoPos,
272
278
  $not,
273
279
  $nullishTest,
274
280
  $obj,
@@ -283,6 +289,7 @@ export {
283
289
  $rawThis,
284
290
  $reStateCall,
285
291
  $recordBinding,
292
+ $refineRel,
286
293
  $regex,
287
294
  $removeMemberNullish,
288
295
  $removeNull,
@@ -355,8 +362,10 @@ export {
355
362
  getEvalCallCollector,
356
363
  getEvalClass,
357
364
  getEvalFallbackStats,
365
+ getPosCollector,
358
366
  isAbsVal,
359
367
  isArrMutator,
368
+ isCjsMainRun,
360
369
  isDefinitelyFalse,
361
370
  isDefinitelyTrue,
362
371
  isNudoBreak,
@@ -382,6 +391,7 @@ export {
382
391
  setEvalBindingSink,
383
392
  setEvalCallCollector,
384
393
  setEvalFallbackCollector,
394
+ setPosCollector,
385
395
  takeLoopExits,
386
396
  takeThrowExits,
387
397
  transpile,
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { d as AstEnv, A as Abs, b as Phi, T as Term, Q as HofCollectCtx, C as Confidence, S as Shape, a as Pred, R as RelSource, U as HofSite, c as AbsModuleExports, V as RunTranspiledOptions } from './run-WZKUu1y1.js';
2
- export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, _ as AbsApplyNoThrow, a0 as AbsApplyNoThrowFn, a1 as AbsApplyResult, a2 as AbsApplyReturn, a3 as AbsFnImpl, a4 as AbsSigImpl, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, a8 as ImplicationOracle, a9 as LitValueResult, L as LiteralValue, aa as MAX_EVAL_CALL_DEPTH, ab as MAX_EVAL_TOTAL_CALLS, P as PrimName, ac as RUNTIME_IMPORT_RE, ad as TYPEOF_NAMES, ae as TranspiledCallResult, af as TypeofName, ag as abs, ah as absFunction, ai as absOnly, aj as absToString, ak as and, al as anyAbs, am as anyVar, an as app, ao as assumeFinite, ap as attachFnImpl, aq as bigintLit, ar as bindImports, as as bindingsOf, at as bool, au as boolLit, av as callTranspiledExport, aw as callTranspiledExportApply, ax as callTranspiledExportFull, ay as collectAbsExports, az as confJoin, aA as emptyPhi, aB as eq, aC as evalExprAbs, aD as ge, aE as geNum, aF as getEvalCallCollector, aG as getFnImpl, aH as getImplicationOracle, aI as gt, aJ as gtNum, aK as hostFnCtorFacet, aL as implies, aM as isAbsApplyResult, aN as isAbsVal, aO as isBigPrim, aP as isExactLit, aQ as isNumPrim, aR as isStrPrim, aS as le, aT as leNum, aU as lit, aV as litValue, aW as lt, aX as ltNum, aY as makeAbsApplyResult, aZ as markPureFn, a_ as namespaceAbsOf, a$ as ne, b0 as negatePred, b1 as never, b2 as not, b3 as noteEvalCallRecord, b4 as noteEvalFallback, b5 as num, b6 as numLit, b7 as numVar, b8 as obj, b9 as or, ba as pFalse, bb as pTrue, bc as phiAnd, bd as predEquals, be as predToString, bf as predVars, bg as primToTypeof, bh as ptypeof, bi as pureFnNameOf, bj as relationFingerprint, bk as relationFn, bl as resetEvalCallBudget, bm as runTranspiled, bn as runTranspiledOptionsMemoKey, bo as setEvalAssignCollector, bp as setEvalBindingSink, bq as setEvalCallCollector, br as setEvalFallbackCollector, bs as setImplicationOracle, bt as shapeOfTerm, bu as shapeOnlyFn, bv as shapeToString, bw as simplifyTerm, bx as str, by as strLit, bz as substPred, bA as termEquals, bB as termToString, bC as tryRunTranspiled, bD as unknown, bE as v } from './run-WZKUu1y1.js';
1
+ import { d as AstEnv, A as Abs, b as Phi, T as Term, Q as HofCollectCtx, C as Confidence, S as Shape, a as Pred, R as RelSource, U as HofSite, c as AbsModuleExports, V as RunTranspiledOptions } from './run-Bgj2tCrv.js';
2
+ export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, _ as AbsApplyNoThrow, a0 as AbsApplyNoThrowFn, a1 as AbsApplyResult, a2 as AbsApplyReturn, a3 as AbsFnImpl, a4 as AbsSigImpl, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, a8 as EvalPosRecord, a9 as ImplicationOracle, aa as LitValueResult, L as LiteralValue, ab as MAX_EVAL_CALL_DEPTH, ac as MAX_EVAL_TOTAL_CALLS, P as PrimName, ad as RUNTIME_IMPORT_RE, ae as TYPEOF_NAMES, af as TranspiledCallResult, ag as TypeofName, ah as abs, ai as absFunction, aj as absOnly, ak as absToString, al as and, am as anyAbs, an as anyVar, ao as app, ap as assumeFinite, aq as attachFnImpl, ar as bigintLit, as as bindImports, at as bindingsOf, au as bool, av as boolLit, aw as callTranspiledExport, ax as callTranspiledExportApply, ay as callTranspiledExportFull, az as collectAbsExports, aA as confJoin, aB as emptyPhi, aC as eq, aD as evalExprAbs, aE as ge, aF as geNum, aG as getEvalCallCollector, aH as getFnImpl, aI as getImplicationOracle, aJ as gt, aK as gtNum, aL as hostFnCtorFacet, aM as implies, aN as isAbsApplyResult, aO as isAbsVal, aP as isBigPrim, aQ as isCjsMainRun, aR as isExactLit, aS as isNumPrim, aT as isStrPrim, aU as le, aV as leNum, aW as lit, aX as litValue, aY as lt, aZ as ltNum, a_ as makeAbsApplyResult, a$ as markPureFn, b0 as namespaceAbsOf, b1 as ne, b2 as negatePred, b3 as never, b4 as not, b5 as noteEvalCallRecord, b6 as noteEvalFallback, b7 as num, b8 as numLit, b9 as numVar, ba as obj, bb as or, bc as pFalse, bd as pTrue, be as phiAnd, bf as predEquals, bg as predToString, bh as predVars, bi as primToTypeof, bj as ptypeof, bk as pureFnNameOf, bl as relationFingerprint, bm as relationFn, bn as resetEvalCallBudget, bo as runTranspiled, bp as runTranspiledOptionsMemoKey, bq as setEvalAssignCollector, br as setEvalBindingSink, bs as setEvalCallCollector, bt as setEvalFallbackCollector, bu as setImplicationOracle, bv as setPosCollector, bw as shapeOfTerm, bx as shapeOnlyFn, by as shapeToString, bz as simplifyTerm, bA as str, bB as strLit, bC as substPred, bD as termEquals, bE as termToString, bF as tryRunTranspiled, bG as unknown, bH as v } from './run-Bgj2tCrv.js';
3
3
  import { Node, File } from '@babel/types';
4
- import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, v as CheckReport, N as NudoConstraint, c as ProjectionBudget } from './projection-budget-Dm1YWZ1U.js';
5
- export { w as CONSTRAINT_BUILDERS, x as CONSTRAINT_BUILDER_NAMES, y as CONSTRAINT_EXPR_RE, z as CheckAction, C as CheckIssue, A as CheckJson, B as CheckJsonMulti, D as ConstraintBuilder, F as Diagnostic, G as EffectiveInterface, H as GitlabCodeQualityIssue, J as INTERFACE_SOURCE_ABBR, K as InterfaceDiag, I as InterfaceSource, O as InterfaceTierInfo, a as InterfaceTierOpts, Q as NamedImport, R as NudoField, S as NudoFnConstraint, T as NudoSidecarError, U as NudoSig, V as RefineDiag, W as RefineEntry, X as RefineResolveOpts, Y as SELF, Z as actionsForIssue, _ as andC, $ as any, a0 as array, a1 as boolean, a2 as checkArg, a3 as checkCall, a4 as constraintAdmitsNullish, a5 as constraintToEntryAbs, a6 as derefConstraint, a7 as drainPromiseMicros, a8 as effectiveInterface, a9 as enterPromiseExecutorScope, aa as evalPromiseCtor, ab as evalPromiseMethod, ac as evalPromiseStatic, ad as execNudoModule, ae as extractDeclaredThrows, af as extractFnBudget, ag as extractNudoImports, ah as extractRefineReturnFromSource, ai as extractRefinesFromSource, aj as fn, ak as fnConstraintToEntryReqs, al as formatCheckReport, am as formatConstraint, an as formatDiagnostics, ao as formatEffectiveInterfaceDisplay, ap as formatGithubAnnotations, aq as formatGitlabCodeQuality, ar as formatInterfaceTierLine, as as generatedExportNames, at as getParseSourceCacheSize, au as getTerm, av as instantiateConstraint, aw as interfaceDiagCount, ax as interfaceSourceOf, ay as interfaceTierOf, az as isIntFlag, aA as isNodeModulesPath, aB as isNudoConstraint, aC as lazy, aD as leavePromiseExecutorScope, aE as lenTerm, aF as litC, aG as localNamedExports, aH as notePromiseExecutorFork, aI as nullable, aJ as number, aK as omit, aL as partial, aM as pick, aN as queuePromiseMicro, aO as refineDiagCount, aP as refineToIndexedFull, aQ as resetNudoModuleExecCache, aR as resetParseSourceCache, aS as resetSidecarLoadFailureCache, aT as serializeCheckJson, aU as serializeCheckJsonMulti, aV as setInterfaceDiagCollector, aW as setRefineDiagCollector, aX as shape, aY as sidecarClosureFingerprint, aZ as sidecarPathOf, a_ as string, a$ as takeInterfaceDiags, b0 as takeInterfaceDiagsSince, b1 as takeRefineDiags, b2 as takeRefineDiagsSince, b3 as throwConstraintToKinds, b4 as union } from './projection-budget-Dm1YWZ1U.js';
4
+ import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, v as CheckReport, N as NudoConstraint, c as ProjectionBudget } from './projection-budget-Dey0IUJa.js';
5
+ export { w as CONSTRAINT_BUILDERS, x as CONSTRAINT_BUILDER_NAMES, y as CONSTRAINT_EXPR_RE, z as CheckAction, C as CheckIssue, A as CheckJson, B as CheckJsonMulti, D as ConstraintBuilder, F as Diagnostic, G as EffectiveInterface, H as GitlabCodeQualityIssue, J as INTERFACE_SOURCE_ABBR, K as InterfaceDiag, I as InterfaceSource, O as InterfaceTierInfo, a as InterfaceTierOpts, Q as NamedImport, R as NudoField, S as NudoFnConstraint, T as NudoSidecarError, U as NudoSig, V as RefineDiag, W as RefineEntry, X as RefineResolveOpts, Y as SELF, Z as actionsForIssue, _ as andC, $ as any, a0 as array, a1 as boolean, a2 as checkArg, a3 as checkCall, a4 as constraintAdmitsNullish, a5 as constraintToEntryAbs, a6 as derefConstraint, a7 as drainPromiseMicros, a8 as effectiveInterface, a9 as enterPromiseExecutorScope, aa as evalPromiseCtor, ab as evalPromiseMethod, ac as evalPromiseStatic, ad as execNudoModule, ae as extractDeclaredThrows, af as extractFnBudget, ag as extractNudoImports, ah as extractRefineReturnFromSource, ai as extractRefinesFromSource, aj as fn, ak as fnConstraintToEntryReqs, al as formatCheckReport, am as formatConstraint, an as formatDiagnostics, ao as formatEffectiveInterfaceDisplay, ap as formatGithubAnnotations, aq as formatGitlabCodeQuality, ar as formatInterfaceTierLine, as as generatedExportNames, at as getParseSourceCacheSize, au as getTerm, av as instantiateConstraint, aw as interfaceDiagCount, ax as interfaceSourceOf, ay as interfaceTierOf, az as isIntFlag, aA as isNodeModulesPath, aB as isNudoConstraint, aC as lazy, aD as leavePromiseExecutorScope, aE as lenTerm, aF as litC, aG as localNamedExports, aH as notePromiseExecutorFork, aI as nullable, aJ as number, aK as omit, aL as partial, aM as pick, aN as queuePromiseMicro, aO as refineDiagCount, aP as refineToIndexedFull, aQ as resetNudoModuleExecCache, aR as resetParseSourceCache, aS as resetSidecarLoadFailureCache, aT as serializeCheckJson, aU as serializeCheckJsonMulti, aV as setInterfaceDiagCollector, aW as setRefineDiagCollector, aX as shape, aY as sidecarClosureFingerprint, aZ as sidecarPathOf, a_ as string, a$ as takeInterfaceDiags, b0 as takeInterfaceDiagsSince, b1 as takeRefineDiags, b2 as takeRefineDiagsSince, b3 as throwConstraintToKinds, b4 as union } from './projection-budget-Dey0IUJa.js';
6
6
  export { $add, $arguments, $arr, $arrMutContainer, $arrRest, $arrWithHoles, $async, $asyncReturn, $await, $bitand, $bitnot, $bitor, $bitxor, $catchVal, $class, $classExpr, $collectionForEach, $concat, $copy, $del, $delRes, $div, $dynamicImport, $elems, $eq, $eqLoose, $fnVal, $for, $forInKeys, $forIter, $forOf, $fork, $ge, $gen, $get, $gt, $idx, $idxSet, $importMeta, $in, $instanceof, $instanceofNonIdent, $invoke, $invokeSuper, $isBreakTo, $isForkExit, $join, $le, $len, $lit, $loopBreak, $loopContinue, $loopReturn, $lt, $mod, $mul, $ne, $neLoose, $neg, $new, $not, $nullishTest, $obj, $objAccessor, $objRest, $optionalGet, $optionalInvoke, $orDefault, $pow, $pushLoopExit, $rawThis, $reStateCall, $regex, $rethrowIfNudoReturn, $set, $setKey, $shl, $shr, $spread, $staticInvoke, $sub, $super, $switch, $thisGet, $thisSet, $throw, $toNumber, $toNumeric, $tryCurrentMark, $tryDetachSoftCatch, $tryDigestSoftCatch, $tryDiscardSoft, $tryMark, $tryOrphanSoft, $tryPopMark, $tryReleaseSoftCatch, $tryReleaseSoftOut, $tryTakeSince, $typeof, $unknown, $updateAdd, $updateSub, $ushr, $while, $whileSeq, $yield, DEFAULT_MAX_LOOP_ITERS, EvalClassSpec, NudoLoopSignal, NudoReturn, NudoThrow, NudoUnsupportedError, TranspileOptions, asAbsVal, callAtFunctionBoundary, clearBClasses, clearStaleTermPred, currentExecPhi, fillTuple, foldRequireSpecArg, foldStaticStringExpr, getEvalClass, isArrMutator, isDefinitelyFalse, isDefinitelyTrue, isNudoBreak, isNudoContinue, isNudoReturn, isNudoThrow, litTruth, lookupObjAccessor, namespaceNameOf, pushLoopExit, pushThrowExit, registerEvalClass, runWithLoopExits, runtimeImportOf, takeLoopExits, takeThrowExits, transpile, transpileBodyNode, transpileExpression, transpileFile, transpileSource, withExecPhi } from './exec.js';
7
7
 
8
8
  /**
@@ -689,13 +689,20 @@ declare function isMapAbs(a: Abs | undefined): boolean;
689
689
  declare function isSetAbs(a: Abs | undefined): boolean;
690
690
  /**
691
691
  * 构造器实参**确定**非法(原生 TypeError 域):
692
- * - 非可迭代字面量(number/boolean/symbol/bigint、闭对象字面量)→ 四个集合构造器都抛
693
- * - Map/WeakMap 条目必须是对象:外层 iterable 出现 lit prim 条目(含字符串实参的
694
- * 每个字符、tuple/Set 元素)→ TypeError(空串例外:零条目合法);
695
- * WeakMap 键还必须可弱持有——tuple 条目首元素(键)为 prim → TypeError
696
- * (Map 键可以是 prim,仅 WeakMap 抛 "Invalid value used as weak map key")
697
- * - WeakSet 元素必须可弱持有:prim 元素(含字符串字符)→ TypeError
698
- * 抽象形态不确定 → false(保守)。
692
+ * - 非可迭代字面量(number/boolean/symbol/bigint、闭对象字面量、symbol
693
+ * 字面量)→ 四个集合构造器都抛
694
+ * - Map/WeakMap 条目必须是对象(IsObject):prim 条目(含字符串实参的
695
+ * 每个字符、tuple/Set 元素)与 nullish 字面量条目 → TypeError
696
+ * (Bug 8:null/undefined/symbol 字面量挂 shape unknown + lit term,
697
+ * 旧 primEntry 只查 prim 形态 → 漏抛)
698
+ * - WeakMap 键 = Get(entry, "0") 须可弱持有(classifyCanBeHeldWeakly 同
699
+ * 口径):零/一元组、闭对象/fn/无 0 槽 brand 条目键 undefined、prim/
700
+ * nullish 键 → TypeError(Bug 8:旧口径只查 ≥2 元组首元素 prim)
701
+ * - WeakSet 元素须可弱持有:prim/nullish 字面量元素(含字符串字符)→
702
+ * TypeError;symbol 元素合法(node 实测 new WeakSet([Symbol()]) 不抛)
703
+ * - Bug 8 gate 面:抽象外层 iterable(any/unknown/开放 obj/fn/其它 brand)
704
+ * 可能非可迭代、抽象元素(含抽象字符串实参的字符臂)可能非 entry/
705
+ * 非弱键 → recordMayThrow(三个分派点共用本判定,集中记录)
699
706
  */
700
707
  declare function ctorArgDefinitelyInvalid(name: "Map" | "Set" | "WeakMap" | "WeakSet", iterable: Abs | undefined): boolean;
701
708
  declare function makeMapAbs(iterable?: Abs): Abs;
@@ -807,7 +814,11 @@ type FormatOptions = {
807
814
  declare function formatAbs(a: Abs, opts?: FormatOptions): string;
808
815
  /** fn/arr 槽位:shape + 非 lit term(禁止在 format 里内联复制 term 逻辑) */
809
816
  declare function formatShapeSlot(a: Abs): string;
810
- declare function formatShape(a: Abs): string;
817
+ declare function formatShape(a: Abs, opts?: {
818
+ maxDepth?: number;
819
+ showLits?: boolean;
820
+ pretty?: boolean;
821
+ }): string;
811
822
  /** 多行展示,CLI 用 */
812
823
  declare function formatAbsMultiline(a: Abs, label?: string): string;
813
824
 
@@ -926,6 +937,7 @@ type PolyFn = {
926
937
  entryReqs?: Array<{
927
938
  param: string;
928
939
  pred: Pred;
940
+ display?: string;
929
941
  }>;
930
942
  /**
931
943
  * 形参表面(C4.1):默认/rest/解构的契约可绑定名。
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ import {
64
64
  takeInterfaceDiagsSince,
65
65
  takeRefineDiags,
66
66
  takeRefineDiagsSince
67
- } from "./chunk-S7HJL5GW.js";
67
+ } from "./chunk-HX4IEPRI.js";
68
68
  import {
69
69
  $add,
70
70
  $arguments,
@@ -328,6 +328,7 @@ import {
328
328
  isAbsVal,
329
329
  isArrMutator,
330
330
  isBigPrim,
331
+ isCjsMainRun,
331
332
  isDefinitelyFalse,
332
333
  isDefinitelyTrue,
333
334
  isErrorCtorName,
@@ -469,6 +470,7 @@ import {
469
470
  setHasEntry,
470
471
  setImplicationOracle,
471
472
  setMayThrowCollector,
473
+ setPosCollector,
472
474
  setPropFlags,
473
475
  setSizeAbs,
474
476
  shape,
@@ -520,7 +522,7 @@ import {
520
522
  v,
521
523
  withExecPhi,
522
524
  withVar
523
- } from "./chunk-PGTNSUTE.js";
525
+ } from "./chunk-YREYFITQ.js";
524
526
 
525
527
  // src/environment.ts
526
528
  function createEnvironment(parent, bindings = /* @__PURE__ */ new Map()) {
@@ -3434,6 +3436,7 @@ export {
3434
3436
  isAbsVal,
3435
3437
  isArrMutator,
3436
3438
  isBigPrim,
3439
+ isCjsMainRun,
3437
3440
  isDefinitelyFalse,
3438
3441
  isDefinitelyTrue,
3439
3442
  isErrorCtorName,
@@ -3593,6 +3596,7 @@ export {
3593
3596
  setHasEntry,
3594
3597
  setImplicationOracle,
3595
3598
  setInterfaceDiagCollector,
3599
+ setPosCollector,
3596
3600
  setPropFlags,
3597
3601
  setRefineDiagCollector,
3598
3602
  setSizeAbs,
@@ -1,7 +1,7 @@
1
- import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-Dm1YWZ1U.js';
2
- export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as defaultLeakBudget, f as exceedsBudget, g as exportedNameOfLocal, h as extractAllLoadSpecs, i as getPromiseMicrosLength, l as leakIfNeeded, j as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, k as resolveDepPath, s as sidecarSpecsOf, o as stablePathKey, q as stablePathKeyGraph, t as termDepth, u as termNodes } from './projection-budget-Dm1YWZ1U.js';
3
- import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-WZKUu1y1.js';
4
- export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-WZKUu1y1.js';
1
+ import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-Dey0IUJa.js';
2
+ export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as defaultLeakBudget, f as exceedsBudget, g as exportedNameOfLocal, h as extractAllLoadSpecs, i as getPromiseMicrosLength, l as leakIfNeeded, j as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, k as resolveDepPath, s as sidecarSpecsOf, o as stablePathKey, q as stablePathKeyGraph, t as termDepth, u as termNodes } from './projection-budget-Dey0IUJa.js';
3
+ import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-Bgj2tCrv.js';
4
+ export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-Bgj2tCrv.js';
5
5
  import { File, Node } from '@babel/types';
6
6
 
7
7
  /**
@@ -385,6 +385,8 @@ type AbsInlay = {
385
385
  interfaceSource?: InterfaceSource;
386
386
  /** true = 隐式推导展示(非义务契约),label 已带 `· derived` */
387
387
  derived?: boolean;
388
+ /** 折叠展示时的完整 pred 文本(hover tooltip;display 缺席时无) */
389
+ tooltip?: string;
388
390
  };
389
391
  type CollectAbsInlaysOpts = InterfaceTierOpts & {
390
392
  loadModule?: (spec: string, fromFile: string) => string | undefined;
package/dist/internal.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  stableAnalyzeKeySource,
22
22
  stablePathKey,
23
23
  stablePathKeyGraph
24
- } from "./chunk-S7HJL5GW.js";
24
+ } from "./chunk-HX4IEPRI.js";
25
25
  import {
26
26
  $tryDigestSoft,
27
27
  $tryMarkSoft,
@@ -169,7 +169,7 @@ import {
169
169
  withEvalBudgetOverride,
170
170
  withFnBudgetOverride,
171
171
  wrapPromise
172
- } from "./chunk-PGTNSUTE.js";
172
+ } from "./chunk-YREYFITQ.js";
173
173
 
174
174
  // src/algebra/inlay.ts
175
175
  function listFunctions(source) {
@@ -282,7 +282,9 @@ function collectAbsInlays(source, opts) {
282
282
  const predsByName = /* @__PURE__ */ new Map();
283
283
  if (g.entryReqs) {
284
284
  for (const r of g.entryReqs) {
285
- predsByName.set(r.param, [r.pred]);
285
+ predsByName.set(r.param, [
286
+ { pred: r.pred, ...r.display !== void 0 ? { display: r.display } : {} }
287
+ ]);
286
288
  }
287
289
  }
288
290
  const fnNode = node;
@@ -293,12 +295,15 @@ function collectAbsInlays(source, opts) {
293
295
  if (!p?.loc || !pname) continue;
294
296
  const preds = predsByName.get(pname);
295
297
  if (preds && preds.length > 0) {
296
- const text = preds.map(predToString).join(" \u2227 ");
298
+ const text = preds.map((p2) => predToString(p2.pred)).join(" \u2227 ");
299
+ const displays = preds.map((p2) => p2.display);
300
+ const display = displays.every((d) => d !== void 0) ? displays.map((d) => d).join(" \u2227 ") : void 0;
297
301
  inlays.push({
298
302
  line: p.loc.end.line,
299
303
  character: p.loc.end.column,
300
- label: ` where ${text}`,
304
+ label: display !== void 0 ? ` where ${display}` : ` where ${text}`,
301
305
  kind: "parameter",
306
+ ...display !== void 0 ? { tooltip: text } : {},
302
307
  ...tierSrc ? { interfaceSource: tierSrc } : {}
303
308
  });
304
309
  }
@@ -1,5 +1,5 @@
1
1
  import { File } from '@babel/types';
2
- import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-WZKUu1y1.js';
2
+ import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-Bgj2tCrv.js';
3
3
 
4
4
  declare function resetParseSourceCache(): void;
5
5
  declare function getParseSourceCacheSize(): number;
@@ -338,14 +338,15 @@ type RefineResolveOpts = {
338
338
  };
339
339
  declare function resetNudoModuleExecCache(): void;
340
340
  /**
341
- * 解析 `ms delay` / `n percent` → [param, Pred]
342
- * 多条用 && 或换行连接。
341
+ * @nudo:contract 提取条目(pred 相对 param 项)。
343
342
  * 同时保留原始 NudoConstraint(shape 字段检查用)。
344
343
  */
345
344
  type RefineEntry = {
346
345
  param: string;
347
346
  pred: Pred;
348
347
  constraint: NudoConstraint;
348
+ /** 指令引用的约束名(`@nudo:contract x positive` 的 `positive`);display 折叠用 */
349
+ name?: string;
349
350
  };
350
351
  declare function extractRefinesFromSource(source: string, fnName: string, opts?: RefineResolveOpts): RefineEntry[];
351
352
  /** refine 参数 → 带约束模板的下标表(shape 检查用) */
@@ -485,9 +486,11 @@ type EffectiveInterfaceOpts = RefineResolveOpts & {
485
486
  };
486
487
  type EffectiveInterface = {
487
488
  fnName: string;
489
+ /** display = 表达式原文/约束名折叠形(运行时标志);缺席 = 消费端回落 pred 全展 */
488
490
  params: Array<{
489
491
  param: string;
490
492
  constraint: NudoConstraint;
493
+ display?: string;
491
494
  }>;
492
495
  returns?: {
493
496
  constraint: NudoConstraint;
@@ -496,6 +499,10 @@ type EffectiveInterface = {
496
499
  throws?: {
497
500
  kinds: string[] | "*";
498
501
  };
502
+ /** 契约来源侧车 canonical 路径(侧车绑定时);契约原文链接跳转用 */
503
+ sidecarPath?: string;
504
+ /** 侧车绑定声明行(1-based;契约原文链接 `#L<n>` 跳转目标) */
505
+ sidecarLine?: number;
499
506
  source: InterfaceSource;
500
507
  /**
501
508
  * 合取不可满足标记:params = 常数界交叉矛盾(或 prim 矛盾等 and() 不可
@@ -537,6 +544,10 @@ type InterfaceTierInfo = {
537
544
  source: InterfaceSource;
538
545
  /** handwritten/generated 时的契约展示;implicit 为 undefined */
539
546
  display?: string;
547
+ /** 契约来源侧车 canonical 路径(侧车绑定时);契约原文链接跳转用 */
548
+ sidecarPath?: string;
549
+ /** 侧车绑定声明行(1-based;契约原文链接 `#L<n>` 跳转目标) */
550
+ sidecarLine?: number;
540
551
  };
541
552
  type InterfaceTierOpts = EffectiveInterfaceOpts;
542
553
  /**
@@ -832,6 +843,14 @@ declare class ProjectionBudget {
832
843
  #private;
833
844
  /** 粘性:本次投影是否发生过截断("cycle" / "depth"),供台账记录 */
834
845
  truncated: ProjectionStopReason | undefined;
846
+ /** 展示口径:eq(self, lit(v)) pred 渲染为 lit(v)(lit 判别值
847
+ * 可见——hover 求值态面);默认 false(纯 shape 外延渲染,
848
+ * 与既有全部展示面同口径) */
849
+ showLits: boolean;
850
+ /** 展示口径:多行缩进渲染(hover 弹窗面)——obj 槽位每槽一行 +
851
+ * 尾逗号 + 2 空格缩进递增,复合臂 union 按臂断行;默认 false
852
+ * (单行——check 签名 / dts / inlay 等既有面字节不变) */
853
+ pretty: boolean;
835
854
  constructor(maxDepth?: number);
836
855
  /**
837
856
  * 进入一个 Abs(或 Shape)子树。返回 null → 继续递归,之后必须配对
@@ -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.4",
3
+ "version": "1.10.0",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },