@nudojs/core 1.2.0 → 1.3.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.
@@ -1,5 +1,5 @@
1
1
  import { File } from '@babel/types';
2
- import { T as Term, A as Abs, P as PrimName, a as Pred, b as Phi, C as Confidence } from './hof-types-COqDeD5F.js';
2
+ import { A as Abs, T as Term, P as PrimName, a as Pred, b as Phi, C as Confidence } from './run-Dk08Q5zl.js';
3
3
 
4
4
  declare function resetParseSourceCache(): void;
5
5
  declare function getParseSourceCacheSize(): number;
@@ -8,6 +8,30 @@ declare function parseSource(source: string, opts?: {
8
8
  keepTs?: boolean;
9
9
  }): File;
10
10
 
11
+ /**
12
+ * Promise 构造 / then 链 / 静态方法 + micro 队列
13
+ */
14
+
15
+ declare function enterPromiseExecutorScope(): void;
16
+ declare function leavePromiseExecutorScope(): number;
17
+ /** $fork 在 executor 内发生时打点(多臂 resolve 需 join,不得 first-wins 假精确) */
18
+ declare function notePromiseExecutorFork(): void;
19
+ /** 队列硬上限:无界增长是 LSP 长会话泄漏点(只进不出的模块求值路径) */
20
+ declare const MAX_PROMISE_MICROS = 1024;
21
+ declare function queuePromiseMicro(task: () => void): void;
22
+ declare function getPromiseMicrosLength(): number;
23
+ declare function drainPromiseMicros(): void;
24
+ /**
25
+ * new Promise(executor):调用 executor(resolve, reject),收集 resolve 实参作为
26
+ * promise inner。原生只认第一次 settle——顺序双 resolve 取第一次;执行器内
27
+ * $fork 分叉时各臂 settle 值 join(路径敏感,不得 first-wins 假精确)。
28
+ * reject 不填 resolved 通道;永不 settle / 抽象 fn / 执行抛 → promise<unknown>。
29
+ */
30
+ declare function evalPromiseCtor(args: Abs[]): Abs;
31
+ /** then/catch/finally:可映射回调 → 新 inner;做不到诚实 promise<unknown> */
32
+ declare function evalPromiseMethod(name: string, recv: Abs, args: Abs[]): Abs | undefined;
33
+ declare function evalPromiseStatic(name: string, args: Abs[]): Abs | undefined;
34
+
11
35
  /**
12
36
  * 项(Term)防爆炸:深度/宽度阈值 → leak 为新鲜 var + 等式约束。
13
37
  */
@@ -152,6 +176,18 @@ declare function shape(fields: Record<string, NudoConstraint | ConstraintBuilder
152
176
  declare function litC(v: number | string | boolean | null | undefined): ConstraintBuilder;
153
177
  /** union(...cs):成员析取;instantiate 为 or(...),entry Abs 为成员 joinAbs。空参 throw */
154
178
  declare function union(...cs: (NudoConstraint | ConstraintBuilder | number | string | boolean | null | undefined)[]): ConstraintBuilder;
179
+ /**
180
+ * nullable(c):允许 null / undefined 的约束(nullish 显式化)。
181
+ * 糖 = union(c, lit(null), lit(undefined))。
182
+ * `return null` / `return undefined` 只对含 nullish 的契约合法;
183
+ * 对不含 nullish 的契约(如 number().gt(0))报 constraint-violated。
184
+ */
185
+ declare function nullable(c: NudoConstraint | ConstraintBuilder | number | string | boolean): ConstraintBuilder;
186
+ /**
187
+ * 契约域是否包含 nullish(null / undefined)。
188
+ * union 任一成员含 nullish 即含;lit(null)/lit(undefined) 的 eq 谓词识别。
189
+ */
190
+ declare function constraintAdmitsNullish(c: NudoConstraint): boolean;
155
191
  /**
156
192
  * fn(params, returns?, { throws? }):一等函数约束。
157
193
  * Phase 1 只展示不执法:参数位 instantiate 恒真(pTrue),
@@ -284,6 +320,20 @@ declare function extractRefineReturnFromSource(source: string, fnName: string, o
284
320
  * undefined = 无申报(L2 照常执法)。
285
321
  */
286
322
  declare function extractDeclaredThrows(source: string, fnName: string): string[] | "*" | undefined;
323
+ /**
324
+ * 函数级预算旋钮(#64 P4):
325
+ * @nudo:budget forks=20000
326
+ * @nudo:budget calls=50000 depth=128
327
+ * @nudo:budget forks=20000, calls=50000
328
+ *
329
+ * 与 @nudo:throws 同路径扫函数前注释块。只抬高预算(不降低全局默认);
330
+ * 未声明的维度沿用全局。非法值忽略。
331
+ */
332
+ declare function extractFnBudget(source: string, fnName: string): {
333
+ forks?: number;
334
+ calls?: number;
335
+ depth?: number;
336
+ } | undefined;
287
337
 
288
338
  /**
289
339
  * Interface 分层推导(design-refine-derivation §2.1/§2.2/§11 第 0 步):
@@ -386,6 +436,8 @@ type EffectiveInterface = {
386
436
  returns?: boolean;
387
437
  };
388
438
  };
439
+ /** 与 resetNudoModuleExecCache 同口径:分析会话/测试间清空失败去重表 */
440
+ declare function resetSidecarLoadFailureCache(): void;
389
441
  /**
390
442
  * 单点读取口:手写 ∪ 侧车同名 ∪ 生成段 → 有效契约(含来源标注)。
391
443
  * 无任何契约 → undefined(implicit 由调用方处理)。
@@ -658,4 +710,4 @@ declare function formatGitlabCodeQuality(r: CheckReport, opts?: {
658
710
  workspaceRoot?: string;
659
711
  }): GitlabCodeQualityIssue[];
660
712
 
661
- export { fn as $, NudoSidecarError as A, type NudoSig as B, type CheckIssue as C, type Diagnostic as D, type EffectiveInterfaceOpts as E, type RefineEntry as F, type GitlabCodeQualityIssue as G, type RefineResolveOpts as H, type InterfaceSource as I, actionsForIssue as J, andC as K, type LeakBudget as L, any as M, type NudoConstraint as N, array as O, boolean as P, checkArg as Q, type RefineDiag as R, SELF as S, checkCall as T, constraintToEntryAbs as U, effectiveInterface as V, execNudoModule as W, extractDeclaredThrows as X, extractNudoImports as Y, extractRefineReturnFromSource as Z, extractRefinesFromSource as _, type InterfaceTierOpts as a, fnConstraintToEntryReqs as a0, formatCheckReport as a1, formatConstraint as a2, formatDiagnostics as a3, formatEffectiveInterfaceDisplay as a4, formatGithubAnnotations as a5, formatGitlabCodeQuality as a6, formatInterfaceTierLine as a7, generatedExportNames as a8, getParseSourceCacheSize as a9, string as aA, takeInterfaceDiags as aB, takeInterfaceDiagsSince as aC, takeRefineDiags as aD, takeRefineDiagsSince as aE, throwConstraintToKinds as aF, union as aG, getTerm as aa, instantiateConstraint as ab, interfaceDiagCount as ac, interfaceSourceOf as ad, interfaceTierOf as ae, isIntFlag as af, isNodeModulesPath as ag, isNudoConstraint as ah, lenTerm as ai, litC as aj, localNamedExports as ak, number as al, omit as am, partial as an, pick as ao, refineDiagCount as ap, refineToIndexedFull as aq, resetNudoModuleExecCache as ar, resetParseSourceCache as as, serializeCheckJson as at, serializeCheckJsonMulti as au, setInterfaceDiagCollector as av, setRefineDiagCollector as aw, shape as ax, sidecarClosureFingerprint as ay, sidecarPathOf as az, type LoadDepsFingerprint as b, extractAllLoadSpecs as c, defaultLeakBudget as d, exceedsBudget as e, loadModuleDepsFingerprint as f, resolveDepPath as g, termNodes as h, type CheckReport as i, type CheckAction as j, type CheckJson as k, leakIfNeeded as l, maybeLeak as m, normPath as n, type CheckJsonMulti as o, parseSource as p, type ConstraintBuilder as q, resetLeakCounter as r, sidecarSpecsOf as s, termDepth as t, type EffectiveInterface as u, type InterfaceDiag as v, type InterfaceTierInfo as w, type NamedImport as x, type NudoField as y, type NudoFnConstraint as z };
713
+ export { evalPromiseCtor as $, type NudoFnConstraint as A, NudoSidecarError as B, type CheckIssue as C, type Diagnostic as D, type EffectiveInterfaceOpts as E, type NudoSig as F, type GitlabCodeQualityIssue as G, type RefineEntry as H, type InterfaceSource as I, type RefineResolveOpts as J, actionsForIssue as K, type LeakBudget as L, MAX_PROMISE_MICROS as M, type NudoConstraint as N, andC as O, any as P, array as Q, type RefineDiag as R, SELF as S, boolean as T, checkArg as U, checkCall as V, constraintAdmitsNullish as W, constraintToEntryAbs as X, drainPromiseMicros as Y, effectiveInterface as Z, enterPromiseExecutorScope as _, type InterfaceTierOpts as a, evalPromiseMethod as a0, evalPromiseStatic as a1, execNudoModule as a2, extractDeclaredThrows as a3, extractFnBudget as a4, extractNudoImports as a5, extractRefineReturnFromSource as a6, extractRefinesFromSource as a7, fn as a8, fnConstraintToEntryReqs as a9, pick as aA, queuePromiseMicro as aB, refineDiagCount as aC, refineToIndexedFull as aD, resetNudoModuleExecCache as aE, resetParseSourceCache as aF, resetSidecarLoadFailureCache as aG, serializeCheckJson as aH, serializeCheckJsonMulti as aI, setInterfaceDiagCollector as aJ, setRefineDiagCollector as aK, shape as aL, sidecarClosureFingerprint as aM, sidecarPathOf as aN, string as aO, takeInterfaceDiags as aP, takeInterfaceDiagsSince as aQ, takeRefineDiags as aR, takeRefineDiagsSince as aS, throwConstraintToKinds as aT, union as aU, formatCheckReport as aa, formatConstraint as ab, formatDiagnostics as ac, formatEffectiveInterfaceDisplay as ad, formatGithubAnnotations as ae, formatGitlabCodeQuality as af, formatInterfaceTierLine as ag, generatedExportNames as ah, getParseSourceCacheSize as ai, getTerm as aj, instantiateConstraint as ak, interfaceDiagCount as al, interfaceSourceOf as am, interfaceTierOf as an, isIntFlag as ao, isNodeModulesPath as ap, isNudoConstraint as aq, leavePromiseExecutorScope as ar, lenTerm as as, litC as at, localNamedExports as au, notePromiseExecutorFork as av, nullable as aw, number as ax, omit as ay, partial as az, type LoadDepsFingerprint as b, extractAllLoadSpecs as c, defaultLeakBudget as d, exceedsBudget as e, loadModuleDepsFingerprint as f, getPromiseMicrosLength as g, resolveDepPath as h, termNodes as i, type CheckReport as j, type CheckAction as k, leakIfNeeded as l, maybeLeak as m, normPath as n, type CheckJson as o, parseSource as p, type CheckJsonMulti as q, resetLeakCounter as r, sidecarSpecsOf as s, termDepth as t, type ConstraintBuilder as u, type EffectiveInterface as v, type InterfaceDiag as w, type InterfaceTierInfo as x, type NamedImport as y, type NudoField as z };