@nudojs/core 1.3.0 → 1.5.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/{check-report-BWmfy810.d.ts → check-report-Ci1dDysO.d.ts} +52 -27
- package/dist/{chunk-CKH6GQAI.js → chunk-W2MP6REI.js} +2351 -1896
- package/dist/{chunk-5YNR4Q7E.js → chunk-YO4GKCNE.js} +817 -169
- package/dist/exec.d.ts +8 -16
- package/dist/exec.js +9 -1
- package/dist/index.d.ts +125 -110
- package/dist/index.js +174 -94
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +39 -27
- package/dist/{run-Dk08Q5zl.d.ts → run-WJfj477N.d.ts} +186 -3
- package/package.json +1 -1
package/dist/internal.js
CHANGED
|
@@ -15,8 +15,10 @@ import {
|
|
|
15
15
|
resetHashSourceCache,
|
|
16
16
|
resolveDepPath,
|
|
17
17
|
sidecarSpecsOf,
|
|
18
|
-
stableAnalyzeKeySource
|
|
19
|
-
|
|
18
|
+
stableAnalyzeKeySource,
|
|
19
|
+
stablePathKey,
|
|
20
|
+
stablePathKeyGraph
|
|
21
|
+
} from "./chunk-YO4GKCNE.js";
|
|
20
22
|
import {
|
|
21
23
|
$tryDigestSoft,
|
|
22
24
|
$tryMarkSoft,
|
|
@@ -41,6 +43,8 @@ import {
|
|
|
41
43
|
callBudgetKey,
|
|
42
44
|
classChainNames,
|
|
43
45
|
classFromMethods,
|
|
46
|
+
clearPureCallMemo,
|
|
47
|
+
clearPureMemo,
|
|
44
48
|
coerceAsyncReturn,
|
|
45
49
|
concatString,
|
|
46
50
|
createTemplateAbs,
|
|
@@ -153,7 +157,7 @@ import {
|
|
|
153
157
|
withEvalBudgetOverride,
|
|
154
158
|
withFnBudgetOverride,
|
|
155
159
|
wrapPromise
|
|
156
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-W2MP6REI.js";
|
|
157
161
|
|
|
158
162
|
// src/algebra/inlay.ts
|
|
159
163
|
function listFunctions(source) {
|
|
@@ -211,12 +215,13 @@ function formatReturnDisplay(g) {
|
|
|
211
215
|
const t = stripParens(renameTypeVars(termToString(m.term), varMap));
|
|
212
216
|
return { key: `app:${t}`, text: t };
|
|
213
217
|
}
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
const lvR = litValue(m);
|
|
219
|
+
if (lvR.ok) {
|
|
220
|
+
const lv = lvR.value;
|
|
221
|
+
if (typeof lv === "number" && !Number.isFinite(lv)) {
|
|
222
|
+
return { key: `lit:${String(lv)}`, text: String(lv) };
|
|
223
|
+
}
|
|
224
|
+
return { key: `lit:${String(lv)}`, text: JSON.stringify(lv) ?? "undefined" };
|
|
220
225
|
}
|
|
221
226
|
return { key: `shape:${formatShape(m)}`, text: formatShape(m) };
|
|
222
227
|
};
|
|
@@ -327,9 +332,8 @@ function sanitizeCommentText(text) {
|
|
|
327
332
|
|
|
328
333
|
// src/algebra/denote.ts
|
|
329
334
|
function denoteGuard(a, v) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return eqGuard(v, lv);
|
|
335
|
+
if (a.term?.op === "lit" && (!a.pred || a.pred.op === "true")) {
|
|
336
|
+
return eqGuard(v, a.term.value);
|
|
333
337
|
}
|
|
334
338
|
const shape = denoteShape(a.shape, v);
|
|
335
339
|
const pred = denotePred(a, v);
|
|
@@ -377,11 +381,19 @@ function denoteShape(s, v) {
|
|
|
377
381
|
case "tuple": {
|
|
378
382
|
const checks = [`Array.isArray(${v})`];
|
|
379
383
|
const minLen = s.elements.length;
|
|
384
|
+
const holes = new Set(s.holes ?? []);
|
|
380
385
|
checks.push(s.rest ? `${v}.length >= ${minLen}` : `${v}.length === ${minLen}`);
|
|
381
386
|
s.elements.forEach((el, i) => {
|
|
387
|
+
if (holes.has(i)) {
|
|
388
|
+
checks.push(`!(${i} in ${v})`);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
382
391
|
const inner = denoteGuard(el, `${v}[${i}]`);
|
|
383
392
|
if (inner !== "true") checks.push(inner);
|
|
384
393
|
});
|
|
394
|
+
for (const i of holes) {
|
|
395
|
+
if (i >= minLen) checks.push(`!(${i} in ${v})`);
|
|
396
|
+
}
|
|
385
397
|
if (s.rest) {
|
|
386
398
|
const rest = denoteGuard(s.rest, "item");
|
|
387
399
|
if (rest !== "true") {
|
|
@@ -407,8 +419,7 @@ function denoteShape(s, v) {
|
|
|
407
419
|
function denotePred(a, v) {
|
|
408
420
|
const p = a.pred;
|
|
409
421
|
if (!p || p.op === "true") {
|
|
410
|
-
|
|
411
|
-
if (lv !== void 0) return eqGuard(v, lv);
|
|
422
|
+
if (a.term?.op === "lit") return eqGuard(v, a.term.value);
|
|
412
423
|
return "true";
|
|
413
424
|
}
|
|
414
425
|
return predAsJs(p, v, a);
|
|
@@ -435,17 +446,17 @@ function predAsJs(p, v, a) {
|
|
|
435
446
|
case "ne": {
|
|
436
447
|
const op = { gt: ">", ge: ">=", lt: "<", le: "<=", eq: "===", ne: "!==" }[p.op];
|
|
437
448
|
const leftIsValue = termIsValue(p.a, a);
|
|
438
|
-
const
|
|
439
|
-
if (leftIsValue &&
|
|
440
|
-
return cmpOp(v, op,
|
|
449
|
+
const rightLitTerm = p.b.op === "lit" ? p.b : void 0;
|
|
450
|
+
if (leftIsValue && rightLitTerm) {
|
|
451
|
+
return cmpOp(v, op, rightLitTerm.value);
|
|
441
452
|
}
|
|
442
|
-
const
|
|
453
|
+
const leftLitTerm = p.a.op === "lit" ? p.a : void 0;
|
|
443
454
|
const rightIsValue = termIsValue(p.b, a);
|
|
444
|
-
if (rightIsValue &&
|
|
445
|
-
return cmpLitValue(
|
|
455
|
+
if (rightIsValue && leftLitTerm) {
|
|
456
|
+
return cmpLitValue(leftLitTerm.value, op, v);
|
|
446
457
|
}
|
|
447
|
-
if (
|
|
448
|
-
return `${jsLit(
|
|
458
|
+
if (leftLitTerm && rightLitTerm) {
|
|
459
|
+
return `${jsLit(leftLitTerm.value)} ${op} ${jsLit(rightLitTerm.value)}`;
|
|
449
460
|
}
|
|
450
461
|
return "true";
|
|
451
462
|
}
|
|
@@ -453,12 +464,10 @@ function predAsJs(p, v, a) {
|
|
|
453
464
|
return "true";
|
|
454
465
|
}
|
|
455
466
|
}
|
|
456
|
-
function litOfTerm(t) {
|
|
457
|
-
return t.op === "lit" ? t.value : void 0;
|
|
458
|
-
}
|
|
459
467
|
function jsLit(v) {
|
|
460
468
|
if (v === void 0) return "undefined";
|
|
461
469
|
if (v === null) return "null";
|
|
470
|
+
if (typeof v === "bigint") return `${v}n`;
|
|
462
471
|
if (typeof v === "number") {
|
|
463
472
|
if (Number.isNaN(v)) return "NaN";
|
|
464
473
|
if (v === Infinity) return "Infinity";
|
|
@@ -488,8 +497,7 @@ function cmpLitValue(lit, op, v) {
|
|
|
488
497
|
function termIsValue(t, a) {
|
|
489
498
|
if (t.op === "var") return true;
|
|
490
499
|
if (t.op === "lit") {
|
|
491
|
-
|
|
492
|
-
return lv !== void 0 && Object.is(lv, t.value);
|
|
500
|
+
return a.term?.op === "lit" && Object.is(a.term.value, t.value);
|
|
493
501
|
}
|
|
494
502
|
return false;
|
|
495
503
|
}
|
|
@@ -519,6 +527,8 @@ export {
|
|
|
519
527
|
checkInjectedDomainEvidence,
|
|
520
528
|
classChainNames,
|
|
521
529
|
classFromMethods,
|
|
530
|
+
clearPureCallMemo,
|
|
531
|
+
clearPureMemo,
|
|
522
532
|
coerceAsyncReturn,
|
|
523
533
|
collectAbsInlays,
|
|
524
534
|
concatString,
|
|
@@ -629,6 +639,8 @@ export {
|
|
|
629
639
|
sourceHasRequireCall,
|
|
630
640
|
stableAnalyzeKeySource,
|
|
631
641
|
stableCallId,
|
|
642
|
+
stablePathKey,
|
|
643
|
+
stablePathKeyGraph,
|
|
632
644
|
stripCommentsAndStrings,
|
|
633
645
|
stripStringsKeepComments,
|
|
634
646
|
superNameOf,
|
|
@@ -2,7 +2,7 @@ import * as _babel_types from '@babel/types';
|
|
|
2
2
|
import { Node, ImportDeclaration, File } from '@babel/types';
|
|
3
3
|
|
|
4
4
|
/** 项(Term):抽象值的身份。字面量是项的特例。 */
|
|
5
|
-
type LiteralValue = string | number | boolean | null | undefined;
|
|
5
|
+
type LiteralValue = string | number | boolean | bigint | null | undefined;
|
|
6
6
|
type Term = {
|
|
7
7
|
op: "lit";
|
|
8
8
|
value: LiteralValue;
|
|
@@ -247,7 +247,17 @@ declare function isStrPrim(a: Abs): boolean;
|
|
|
247
247
|
declare function isBigPrim(a: Abs): boolean;
|
|
248
248
|
/** 置信度:字面量全确定 */
|
|
249
249
|
declare function isExactLit(a: Abs): boolean;
|
|
250
|
-
|
|
250
|
+
/**
|
|
251
|
+
* tagged result:把「无字面量」与「字面量 undefined」分开。
|
|
252
|
+
* 判定是否是字面量必须看 `ok`,禁止用 `value !== undefined` / `(litValue(...).ok ? litValue(...).value : undefined) !== undefined`。
|
|
253
|
+
*/
|
|
254
|
+
type LitValueResult = {
|
|
255
|
+
ok: true;
|
|
256
|
+
value: LiteralValue;
|
|
257
|
+
} | {
|
|
258
|
+
ok: false;
|
|
259
|
+
};
|
|
260
|
+
declare function litValue(a: Abs): LitValueResult;
|
|
251
261
|
|
|
252
262
|
/**
|
|
253
263
|
* may-throw 效果收集(design-cli-semantics §3.3)。
|
|
@@ -321,6 +331,27 @@ declare function filterIgnoredThrows(effects: MayThrowEffect[], ignore: readonly
|
|
|
321
331
|
*/
|
|
322
332
|
declare function filterDeclaredThrows(effects: MayThrowEffect[], declared: readonly string[] | "*" | undefined): MayThrowEffect[];
|
|
323
333
|
|
|
334
|
+
/**
|
|
335
|
+
* 调用 Abs 一等函数(absFunction impl)或 mock apply。
|
|
336
|
+
* 供 求值引擎 import 绑定包装:`(...args) => $call(absFn, args)`。
|
|
337
|
+
*
|
|
338
|
+
* 统一顺序:apply → body → relation → isRelFn(委托 applyAbsFn)。
|
|
339
|
+
* 行为对齐说明(与旧 $call 的差异,均属刻意):
|
|
340
|
+
* 1. 带 body 的函数也进 call-budget(递归会 truncated 而非爆栈)
|
|
341
|
+
* 2. body 抛错与 apply 同径 rethrow(不吞成 never 返回,调用边界决定吸收)
|
|
342
|
+
* 3. 无 impl 时 isRelFn 可走 E 路径(旧版恒 unknown)
|
|
343
|
+
*/
|
|
344
|
+
|
|
345
|
+
/** 清空 pure memo(宿主入口 / 会话缓存失效) */
|
|
346
|
+
declare function clearPureMemo(): void;
|
|
347
|
+
/**
|
|
348
|
+
* apply 返回的 throws 面 → 调用方控制流通道(H1 单点路由)。
|
|
349
|
+
* always-throw(abs=never)→ NudoThrow,由调用边界收成 throws;
|
|
350
|
+
* may-throw → pushThrowExit 记入调用方 throwExits(try/catch 可吸收)。
|
|
351
|
+
*/
|
|
352
|
+
declare function routeApplyThrows(r: Abs, throws: Abs | undefined): Abs;
|
|
353
|
+
declare function $call(fn: Abs, args: Abs[], thisVal?: Abs): Abs;
|
|
354
|
+
|
|
324
355
|
/**
|
|
325
356
|
* 求值引擎调用点记录:transpile 把 `f(args)` 改成 $callNamed,
|
|
326
357
|
* 分析时可收集 call@ 所需的 AbsCallRecord。
|
|
@@ -337,6 +368,8 @@ type EvalCallRecord = {
|
|
|
337
368
|
};
|
|
338
369
|
threw?: boolean;
|
|
339
370
|
};
|
|
371
|
+
/** 清空 pureCallMemo(宿主入口 / 会话缓存失效) */
|
|
372
|
+
declare function clearPureCallMemo(): void;
|
|
340
373
|
/** B 赋值记录(与 ast-records.ts AbsAssignRecord 同形;structuralAssignIssues 消费) */
|
|
341
374
|
type EvalAbsAssignRecord = {
|
|
342
375
|
name: string;
|
|
@@ -463,6 +496,147 @@ type AstEnv = {
|
|
|
463
496
|
hofCollect?: HofCollectCtx;
|
|
464
497
|
};
|
|
465
498
|
|
|
499
|
+
/**
|
|
500
|
+
* Abs 上的一等函数:shape 是 fn,实现在旁路(不污染 Shape)。
|
|
501
|
+
* 与 term-registry 同一纪律:不给共享单例挂 impl。
|
|
502
|
+
*/
|
|
503
|
+
|
|
504
|
+
/** Abs 原生 env/builtin 实现(evaluator 优先) */
|
|
505
|
+
type AbsSigImpl = (args: Abs[], thisVal?: Abs) => Abs | undefined;
|
|
506
|
+
/**
|
|
507
|
+
* 已知不抛的 apply 返回面(裸 Abs,无 throws 通道)。
|
|
508
|
+
* 等价 `Abs`,仅作意图标注:impl 作者写死「本 apply 不抛」时用它收窄签名,
|
|
509
|
+
* 调用侧仍应经 `absOnly` / `isAbsApplyResult` 取 abs(`AbsFnImpl.apply` 静态面是宽的)。
|
|
510
|
+
*/
|
|
511
|
+
type AbsApplyNoThrow = Abs;
|
|
512
|
+
/**
|
|
513
|
+
* 已知不抛的 apply 实现签名(`AbsSigImpl` 的 apply 对偶)。
|
|
514
|
+
* 返回裸 `Abs` = 不抛;需要 throws 面时改用 `AbsFnImpl["apply"]`(`AbsApplyReturn`)。
|
|
515
|
+
*/
|
|
516
|
+
type AbsApplyNoThrowFn = (args: Abs[], thisVal?: Abs) => AbsApplyNoThrow;
|
|
517
|
+
/**
|
|
518
|
+
* apply 契约返回的 throws 通道(H1 / DESIGN-003)。
|
|
519
|
+
* `throws` 必填:不抛传 `never`。$call 统一路由——
|
|
520
|
+
* always-throw(abs=never)→ NudoThrow 由调用边界收成 throws;
|
|
521
|
+
* may-throw → pushThrowExit 记入调用方 throwExits(try/catch 可吸收)。
|
|
522
|
+
* 包装 `callTranspiledExportFull` 必须走 `callTranspiledExportApply`,
|
|
523
|
+
* 不得手拆 `.result`(会静默丢 throws 面)。
|
|
524
|
+
*
|
|
525
|
+
* 构造只经 `makeAbsApplyResult`(打上 brand);`isAbsApplyResult` 只认 brand,
|
|
526
|
+
* 避免裸对象靠 `!shape` 误判成 apply 结果、吞掉 throws 面。
|
|
527
|
+
*/
|
|
528
|
+
type AbsApplyResult = {
|
|
529
|
+
abs: Abs;
|
|
530
|
+
throws: Abs;
|
|
531
|
+
/** Discriminator stamped by makeAbsApplyResult. */
|
|
532
|
+
readonly applyResult: true;
|
|
533
|
+
};
|
|
534
|
+
/** apply 可返回裸 Abs(无 throws)或带 throws 通道的 AbsApplyResult */
|
|
535
|
+
type AbsApplyReturn = Abs | AbsApplyResult;
|
|
536
|
+
/** 唯一构造入口:打上 applyResult brand。 */
|
|
537
|
+
declare function makeAbsApplyResult(abs: Abs, throws: Abs): AbsApplyResult;
|
|
538
|
+
/** AbsApplyResult 判别:只认 brand(不靠 !shape 结构猜)。 */
|
|
539
|
+
declare function isAbsApplyResult(v: AbsApplyReturn): v is AbsApplyResult;
|
|
540
|
+
/**
|
|
541
|
+
* apply 返回值取 abs 面(已知不抛 / 测试面只想看结果时用)。
|
|
542
|
+
* 丢弃 throws 通道——若 impl 可能抛,必须走 `$call` 统一路由,不得用本函数吞 throws。
|
|
543
|
+
*/
|
|
544
|
+
declare function absOnly(r: AbsApplyReturn): AbsApplyNoThrow;
|
|
545
|
+
type AbsFnImpl = {
|
|
546
|
+
params: string[];
|
|
547
|
+
/** 可选:无 body 时走 relation(纯关系 fn) */
|
|
548
|
+
body?: Node;
|
|
549
|
+
async?: boolean;
|
|
550
|
+
/** 声明时捕获的环境(闭包) */
|
|
551
|
+
env?: AstEnv;
|
|
552
|
+
kind?: string;
|
|
553
|
+
/**
|
|
554
|
+
* 调用时直接派发(mock withArgs 等),优先于 body。
|
|
555
|
+
* 返回裸 Abs = 不抛;返回 AbsApplyResult 时 throws 面经 $call 统一路由,
|
|
556
|
+
* 不得在 apply 内自行 re-throw / pushThrowExit(会与 $call 路由叠算)。
|
|
557
|
+
*/
|
|
558
|
+
apply?: (args: Abs[], thisVal?: Abs) => AbsApplyReturn;
|
|
559
|
+
/**
|
|
560
|
+
* 对象方法(ObjectMethod / 方法型 FunctionExpression):$invoke 时把
|
|
561
|
+
* receiver 作为 apply 的**首参**注入。shape.params 仍是用户可见形参
|
|
562
|
+
* (不含 receiver),自由调用不注入 → this 为 unbound(JS 语义)。
|
|
563
|
+
*/
|
|
564
|
+
bindThis?: boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Optional content key for cache fingerprints. formatAbs cannot see
|
|
567
|
+
* WeakMap-side mock semantics (returns/withArgs/callsFake), so hosts that
|
|
568
|
+
* build mocks should stamp a stable fingerprint here.
|
|
569
|
+
* relation-only 必填(未传时 relationFn 自动生成)。
|
|
570
|
+
*/
|
|
571
|
+
fingerprint?: string;
|
|
572
|
+
/** 无 body 时,按 paramTypes 做 α 替换得到返回 */
|
|
573
|
+
relation?: {
|
|
574
|
+
paramTypes: Abs[];
|
|
575
|
+
returnType: Abs;
|
|
576
|
+
/**
|
|
577
|
+
* 条件类型 infer:绑定 fromVar 后从 via 投出 inferVar
|
|
578
|
+
* (`T extends (infer E)[]` → via: "arr";`T extends Promise<infer U>` → "promise")。
|
|
579
|
+
*/
|
|
580
|
+
inferFrom?: {
|
|
581
|
+
fromVar: string;
|
|
582
|
+
via: "arr" | "promise";
|
|
583
|
+
inferVar: string;
|
|
584
|
+
};
|
|
585
|
+
/** extends 不成立时的假分支(如 never) */
|
|
586
|
+
condFallback?: Abs;
|
|
587
|
+
};
|
|
588
|
+
/** `@nudo:pure`:调用结果按实参记忆化(无副作用契约) */
|
|
589
|
+
pureName?: string;
|
|
590
|
+
};
|
|
591
|
+
declare function attachFnImpl(a: Abs, impl: AbsFnImpl): void;
|
|
592
|
+
declare function getFnImpl(a: Abs): AbsFnImpl | undefined;
|
|
593
|
+
/** 标记纯函数(@nudo:pure):调用结果可按实参记忆化 */
|
|
594
|
+
declare function markPureFn(target: object, name: string): void;
|
|
595
|
+
/** 读纯函数标记(Abs impl 或对象属性 `_memoize`) */
|
|
596
|
+
declare function pureFnNameOf(fn: unknown): string | undefined;
|
|
597
|
+
/** 造一个带实现的 Abs 函数值 */
|
|
598
|
+
declare function absFunction(params: string[], impl: Omit<AbsFnImpl, "params">, opts?: {
|
|
599
|
+
name?: string;
|
|
600
|
+
paramTypes?: Abs[];
|
|
601
|
+
returnType?: Abs;
|
|
602
|
+
slots?: Record<string, {
|
|
603
|
+
value: Abs;
|
|
604
|
+
optional?: boolean;
|
|
605
|
+
readonly?: boolean;
|
|
606
|
+
}>;
|
|
607
|
+
conf?: Confidence;
|
|
608
|
+
}): Abs;
|
|
609
|
+
/** relationFn 稳定 fingerprint(同签名共享,见 §3.3 已知限制) */
|
|
610
|
+
declare function relationFingerprint(paramTypes: Abs[], returnType: Abs): string;
|
|
611
|
+
/**
|
|
612
|
+
* 无 body、纯关系的 fn Abs。params 仅记 arity。
|
|
613
|
+
*
|
|
614
|
+
* **双写纪律:** 同一份关系数据必须同时写到——
|
|
615
|
+
* 1. `shape.paramTypes` / `shape.returnType` —— format / leq / 展示读这里
|
|
616
|
+
* 2. `impl.relation` —— D 路径应用读这里
|
|
617
|
+
* 两槽共享同一数组/对象引用(防内容分叉);构造后请勿原地 mutate。
|
|
618
|
+
*
|
|
619
|
+
* 默认 conf="path"(与提升产物一致)。禁止静默对齐 absFunction 的 "exact"。
|
|
620
|
+
* fingerprint 必填(call-budget);未传时由 paramTypes+returnType 稳定序列化生成。
|
|
621
|
+
* 同签名 relationFn 共享 fingerprint → 共享 budget 键(见 design §3.3 已知限制)。
|
|
622
|
+
*/
|
|
623
|
+
declare function relationFn(paramTypes: Abs[], returnType: Abs, opts?: {
|
|
624
|
+
params?: string[];
|
|
625
|
+
conf?: Confidence;
|
|
626
|
+
fingerprint?: string;
|
|
627
|
+
inferFrom?: {
|
|
628
|
+
fromVar: string;
|
|
629
|
+
via: "arr" | "promise";
|
|
630
|
+
inferVar: string;
|
|
631
|
+
};
|
|
632
|
+
condFallback?: Abs;
|
|
633
|
+
}): Abs;
|
|
634
|
+
/** 仅写 shape 槽(E 路径 / §5.2 提升产物);禁止 attachFnImpl */
|
|
635
|
+
declare function shapeOnlyFn(paramTypes: Abs[], returnType: Abs, opts?: {
|
|
636
|
+
params?: string[];
|
|
637
|
+
conf?: Confidence;
|
|
638
|
+
}): Abs;
|
|
639
|
+
|
|
466
640
|
/**
|
|
467
641
|
* Abs 模块面(无 fs):import 绑定 + export 收集。
|
|
468
642
|
* 解析路径/读文件在 host;core 只吃「specifier → 导出表」。
|
|
@@ -582,5 +756,14 @@ declare function callTranspiledExportFull(exports: Record<string, unknown>, name
|
|
|
582
756
|
}): TranspiledCallResult;
|
|
583
757
|
/** 调用 runTranspiled 导出(仅结果) */
|
|
584
758
|
declare function callTranspiledExport(exports: Record<string, unknown>, name: string, args: Abs[]): Abs;
|
|
759
|
+
/**
|
|
760
|
+
* 包装 runTranspiled 导出为 Abs apply 钩子——throws 面经返回值通道强制保留
|
|
761
|
+
* (H1 / DESIGN-003)。这是包装 `callTranspiledExportFull` 的**唯一入口**:
|
|
762
|
+
* 返回 AbsApplyResult(`{abs, throws}`),$call 统一路由 throws。
|
|
763
|
+
* 手拆 `.result` 会静默丢 throws 面(BUG-006 根因)。
|
|
764
|
+
*
|
|
765
|
+
* `exports` 可传惰性 getter(互递归模块桥:导出表在桥创建后才赋值)。
|
|
766
|
+
*/
|
|
767
|
+
declare function callTranspiledExportApply(exports: Record<string, unknown> | (() => Record<string, unknown>), name: string): (args: Abs[], thisVal?: Abs) => AbsApplyResult;
|
|
585
768
|
|
|
586
|
-
export { $tryDigestSoft as $, type Abs as A,
|
|
769
|
+
export { $tryDigestSoft as $, type Abs as A, runWithMayThrowSession as B, type Confidence as C, setMayThrowCollector as D, ERROR_FAMILY as E, throwAbsToKinds as F, throwsKindCovered as G, withEvalBudgetOverride as H, type HofCollectCtx as I, type HofSite as J, type AbsModuleExports as K, type LiteralValue as L, type MayThrowEffect as M, type RunTranspiledOptions as N, $assignRecord as O, type PrimName as P, $call as Q, type RelSource as R, type Shape as S, type Term as T, $callNamed as U, $recordBinding as V, type AbsApplyNoThrow as W, type AbsApplyNoThrowFn as X, type AbsApplyResult as Y, type AbsApplyReturn as Z, type AbsFnImpl as _, type Pred as a, num as a$, type AbsSigImpl as a0, type EvalAbsAssignRecord as a1, type EvalCallRecord as a2, type EvalFallback as a3, type ImplicationOracle as a4, type LitValueResult as a5, MAX_EVAL_CALL_DEPTH as a6, MAX_EVAL_TOTAL_CALLS as a7, RUNTIME_IMPORT_RE as a8, TYPEOF_NAMES as a9, geNum as aA, getEvalCallCollector as aB, getFnImpl as aC, getImplicationOracle as aD, gt as aE, gtNum as aF, implies as aG, isAbsApplyResult as aH, isBigPrim as aI, isExactLit as aJ, isNumPrim as aK, isStrPrim as aL, le as aM, leNum as aN, lit as aO, litValue as aP, lt as aQ, ltNum as aR, makeAbsApplyResult as aS, markPureFn as aT, namespaceAbsOf as aU, ne as aV, negatePred as aW, never as aX, not as aY, noteEvalCallRecord as aZ, noteEvalFallback as a_, type TranspiledCallResult as aa, type TypeofName as ab, abs as ac, absFunction as ad, absOnly as ae, absToString as af, and as ag, anyAbs as ah, anyVar as ai, app as aj, assumeFinite as ak, attachFnImpl as al, bigintLit as am, bindImports as an, bindingsOf as ao, bool as ap, boolLit as aq, callTranspiledExport as ar, callTranspiledExportApply as as, callTranspiledExportFull as at, collectAbsExports as au, confJoin as av, emptyPhi as aw, eq as ax, evalExprAbs as ay, ge as az, type Phi as b, numLit as b0, numVar as b1, obj as b2, or as b3, pFalse as b4, pTrue as b5, phiAnd as b6, predEquals as b7, predToString as b8, predVars as b9, primToTypeof as ba, ptypeof as bb, pureFnNameOf as bc, relationFingerprint as bd, relationFn as be, resetEvalCallBudget as bf, runTranspiled as bg, runTranspiledOptionsMemoKey as bh, setEvalAssignCollector as bi, setEvalBindingSink as bj, setEvalCallCollector as bk, setEvalFallbackCollector as bl, setImplicationOracle as bm, shapeOfTerm as bn, shapeOnlyFn as bo, shapeToString as bp, simplifyTerm as bq, str as br, strLit as bs, substPred as bt, termEquals as bu, termToString as bv, tryRunTranspiled as bw, unknown as bx, v as by, routeApplyThrows as bz, type AstEnv as c, $tryMarkSoft as d, $tryReleaseSoft as e, type EvalFallbackStats as f, clearPureCallMemo as g, clearPureMemo as h, enterEvalCallBudgetSession as i, errorTypeAbs as j, exitEvalCallBudgetSession as k, filterDeclaredThrows as l, filterGateThrows as m, filterIgnoredThrows as n, flushMayThrowEffects as o, formatThrowsAbs as p, getEvalCallBudgetState as q, getEvalFallbackStats as r, getMayThrowCollector as s, isThrowsIgnored as t, mayThrowEffectsToAbs as u, orphanMayThrowEffects as v, popMayThrowFrame as w, pushMayThrowFrame as x, recordMayThrow as y, resetEvalFallbackStats as z };
|