@nudojs/service 1.0.1 → 3.0.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/{chunk-2VHITMTM.js → chunk-ADFCZP72.js} +70 -2
- package/dist/config-Cqj8zeZH.d.ts +117 -0
- package/dist/evaluator/evaluator-api.d.ts +3 -12
- package/dist/evaluator/evaluator-api.js +3 -1
- package/dist/index.d.ts +436 -18
- package/dist/index.js +2046 -237
- package/package.json +5 -5
- package/dist/config-NqDRWWpn.d.ts +0 -68
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Node, File } from '@babel/types';
|
|
2
|
-
import { Abs, PolyFn, AbsModuleExports, AstEnv, Phi, BMemberDiag, BCallRecord, TranspiledCallResult, NudoConstraint } from '@nudojs/core';
|
|
2
|
+
import { FormalParam, Abs, InterfaceSource, InterfaceTierOpts, PolyFn, AbsModuleExports, AstEnv, Phi, BMemberDiag, BCallRecord, TranspiledCallResult, NudoConstraint } from '@nudojs/core';
|
|
3
3
|
export { AbsInlay, BMemberDiag, collectAbsInlays } from '@nudojs/core';
|
|
4
|
-
import { C as CallRecord } from './config-
|
|
5
|
-
export { I as InterfaceConfig, N as NudoConfig, f as findProjectConfig, i as interfaceConfig, m as matchesEmitAllowlist } from './config-
|
|
4
|
+
import { C as CallRecord, D as DiagnosticsLevel, A as AnalysisConfig } from './config-Cqj8zeZH.js';
|
|
5
|
+
export { a as AnalysisMode, b as DEFAULT_ANALYSIS_MODE, I as InterfaceConfig, N as NudoConfig, c as analysisConfig, d as clearPathEnvCaches, e as diskCacheRoot, f as findProjectConfig, i as interfaceConfig, m as matchesEmitAllowlist } from './config-Cqj8zeZH.js';
|
|
6
6
|
import { HarvestedEnv } from '@nudojs/harvester';
|
|
7
7
|
import { FunctionWithDirectives } from '@nudojs/parser';
|
|
8
8
|
|
|
@@ -76,6 +76,8 @@ type FunctionAnalysis = {
|
|
|
76
76
|
name: string;
|
|
77
77
|
loc: SourceLocation;
|
|
78
78
|
paramNames: string[];
|
|
79
|
+
/** C4.1 形参表面:draft/契约对齐(解构 placeholder + bound 名) */
|
|
80
|
+
formals?: FormalParam[];
|
|
79
81
|
cases: CaseResult[];
|
|
80
82
|
/** cases 结果 Abs 的 join;dts 返回位源 */
|
|
81
83
|
combinedAbs?: Abs;
|
|
@@ -90,6 +92,24 @@ type FunctionAnalysis = {
|
|
|
90
92
|
noDeclaration?: boolean;
|
|
91
93
|
/** absolute path of the module this function is imported from (externalFunctions only) */
|
|
92
94
|
fromModule?: string;
|
|
95
|
+
/**
|
|
96
|
+
* HOF / entry shape 关系快照(generalizeFromAst),供 dts 泛型投影(C3.3)。
|
|
97
|
+
* 只存投影所需的 Abs,不挂 PolyFn 本体(缓存可克隆)。
|
|
98
|
+
*/
|
|
99
|
+
hof?: {
|
|
100
|
+
/** 函数形参:外延关系 Abs(fn 形状,paramTypes/returnType) */
|
|
101
|
+
fnRels?: Array<{
|
|
102
|
+
param: string;
|
|
103
|
+
abs: Abs;
|
|
104
|
+
}>;
|
|
105
|
+
/** 值形参提升快照(如 items → arr(A1)) */
|
|
106
|
+
entryShapes?: Array<{
|
|
107
|
+
param: string;
|
|
108
|
+
abs: Abs;
|
|
109
|
+
}>;
|
|
110
|
+
/** 符号返回 Abs(含自由 α / B:param) */
|
|
111
|
+
symbolic?: Abs;
|
|
112
|
+
};
|
|
93
113
|
};
|
|
94
114
|
type BindingInfo = {
|
|
95
115
|
/** 无损 Abs */
|
|
@@ -152,14 +172,18 @@ declare function buildModuleGraph(files: string[], cache?: ModuleGraphCache): {
|
|
|
152
172
|
declare function computeDirtySet(dependents: Map<string, Set<string>>, changedFile: string): string[];
|
|
153
173
|
/** Topological order with dependencies before dependents (only imports edges internal to dirty; cycles tolerated — remaining files appended in arbitrary order). */
|
|
154
174
|
declare function topoSortDirty(imports: Map<string, Set<string>>, dirty: string[]): string[];
|
|
175
|
+
/** Optional module loader for analysis (sidecar / relative imports). */
|
|
176
|
+
type AnalyzeLoadModule = (spec: string, fromFile: string) => string | undefined;
|
|
155
177
|
/**
|
|
156
178
|
* Async entry to analyzeFile: preloads path-based env files
|
|
157
179
|
* (`/// @nudo:env ./nudo-harvest-node.ts`) via dynamic import — impossible
|
|
158
180
|
* synchronously in ESM — then runs the sync analysis, which picks the
|
|
159
|
-
* preloaded factories up from the env-loader cache.
|
|
160
|
-
*
|
|
181
|
+
* preloaded factories up from the env-loader cache.
|
|
182
|
+
* `loadModule` is optional; when provided it is used for relative imports /
|
|
183
|
+
* sidecar ambient bindings (LSP buffer-aware path). Default remains
|
|
184
|
+
* `defaultLoadModule` (disk).
|
|
161
185
|
*/
|
|
162
|
-
declare function analyzeFileAsync(filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[]): Promise<AnalysisResult>;
|
|
186
|
+
declare function analyzeFileAsync(filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], loadModule?: AnalyzeLoadModule): Promise<AnalysisResult>;
|
|
163
187
|
/**
|
|
164
188
|
* 调用点发现(阶段一):在"使用现场"文件(测试 / 上层应用)中求值
|
|
165
189
|
* 顶层代码,收集它对(外部模块导出的)函数的调用记录。每条记录带
|
|
@@ -171,16 +195,32 @@ declare function analyzeFileAsync(filePath: string, source: string, activeCases?
|
|
|
171
195
|
* 依赖未 mock 的全局,收集不到就收集不到,不能拖垮主分析)。
|
|
172
196
|
*/
|
|
173
197
|
declare function collectCallRecords(filePath: string, source: string): CallRecord[];
|
|
198
|
+
declare function analysisFileCacheKey(filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], analysisCfg?: {
|
|
199
|
+
mode: string;
|
|
200
|
+
evalMissingSlot: string;
|
|
201
|
+
callSiteBudget: number;
|
|
202
|
+
diagnostics: string;
|
|
203
|
+
}, loadModule?: AnalyzeLoadModule, projectEnvNames?: string[],
|
|
204
|
+
/** ambient 侧车绑定:变更必须 miss(dep 指纹故意不编码 autoBind) */
|
|
205
|
+
autoBind?: boolean): {
|
|
206
|
+
filePath: string;
|
|
207
|
+
source: string;
|
|
208
|
+
auxKey: string;
|
|
209
|
+
noCache?: boolean;
|
|
210
|
+
};
|
|
174
211
|
/**
|
|
175
212
|
* 整文件分析。同 (path, source, cases, external) 命中 memo → O(1)。
|
|
176
213
|
* 不再每次 clearBPathCache:B 路径按本文件 source 键控。
|
|
177
214
|
*
|
|
215
|
+
* `loadModule`:可选;提供时用于相对 import / 侧车 ambient(LSP
|
|
216
|
+
* buffer-aware)。未提供时走 defaultLoadModule(磁盘)。
|
|
217
|
+
*
|
|
178
218
|
* 宿主契约:入口 source 未变但依赖模块内容变了时,必须调用
|
|
179
219
|
* `evictBPathCacheForFiles` / `evictAnalysisFileCacheForFiles` /
|
|
180
220
|
* `evictFnAnalysisCacheForFiles`(LSP 已接好)。非 LSP 宿主
|
|
181
221
|
* (CLI watch / vite-plugin)在 dep 变更时应 `clearBPathCache()` 或上述逐出。
|
|
182
222
|
*/
|
|
183
|
-
declare function analyzeFile(filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[]): AnalysisResult;
|
|
223
|
+
declare function analyzeFile(filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: CallRecord[], loadModule?: AnalyzeLoadModule): AnalysisResult;
|
|
184
224
|
|
|
185
225
|
type CaseInfo = {
|
|
186
226
|
functionName: string;
|
|
@@ -214,7 +254,13 @@ type HoverInfo = {
|
|
|
214
254
|
abs?: string;
|
|
215
255
|
/** 无损 Abs 多行展示 */
|
|
216
256
|
absMultiline?: string;
|
|
257
|
+
/** CodeLens `● interface` 同源档位(A7);仅本地 named export */
|
|
258
|
+
interfaceSource?: InterfaceSource;
|
|
259
|
+
/** 有效契约展示(handwritten/generated);implicit 为 undefined */
|
|
260
|
+
interfaceDisplay?: string;
|
|
217
261
|
};
|
|
262
|
+
/** A7:hover/inlay 与 CodeLens interface 档同源(design-refine-derivation §8) */
|
|
263
|
+
type HoverInterfaceOpts = InterfaceTierOpts;
|
|
218
264
|
/**
|
|
219
265
|
* LSP hover:优先无损 Abs(类型即计算本体)。
|
|
220
266
|
* 节点表也是 Abs(collectAbsNodeTypes),不经 bridge。
|
|
@@ -223,8 +269,12 @@ type HoverInfo = {
|
|
|
223
269
|
* intension 一律走 generalize/formatPoly(HOF fnRels 在这里);
|
|
224
270
|
* typeText 仍落 B-path Abs(调用点显示结果类型,不是函数签名)。
|
|
225
271
|
* 禁止用 B-path 的 arity-only fn Abs 冒充权威关系源。
|
|
272
|
+
*
|
|
273
|
+
* A7 default 档:函数名 hover 附带 interfaceTierOf 来源 + 契约展示,
|
|
274
|
+
* 与 CodeLens `● interface / <source>` 同源;选 case 时 body 仍走
|
|
275
|
+
* activeCases 重放,interface 档标注不变。
|
|
226
276
|
*/
|
|
227
|
-
declare function getHoverAtPosition(filePath: string, source: string, line: number, column: number, activeCases?: Map<string, number
|
|
277
|
+
declare function getHoverAtPosition(filePath: string, source: string, line: number, column: number, activeCases?: Map<string, number>, opts?: HoverInterfaceOpts): HoverInfo | null;
|
|
228
278
|
declare function getCompletionsAtPosition(filePath: string, source: string, line: number, column: number): CompletionItem[];
|
|
229
279
|
|
|
230
280
|
/**
|
|
@@ -305,8 +355,10 @@ declare function serializeInferJson(result: AnalysisResult, file: string): Infer
|
|
|
305
355
|
* 一律 false。显式排除:
|
|
306
356
|
* - .d.ts —— 类型声明文件(harvester 的输入),不是可求值的实现源码;
|
|
307
357
|
* - .tsx / .jsx —— JSX 构造的求值超出 nudo 推断器范围;
|
|
308
|
-
* - *.nudo.js / *.nudo.ts —— 侧车契约模块(interface
|
|
309
|
-
*
|
|
358
|
+
* - *.nudo.js / *.nudo.mjs / *.nudo.ts —— 侧车契约模块(interface 绑定源),
|
|
359
|
+
* 不是源码推断目标;目录级 check/infer/doctor 展开不得把它们当实现分析;
|
|
360
|
+
* - *.nudo.draft.js / *.nudo.draft.mjs / *.nudo.draft.ts —— draft 产物,
|
|
361
|
+
* 明确不被 ambient 绑定,也不得当实现源码分析。
|
|
310
362
|
*
|
|
311
363
|
* 消费方:CLI 的 collectNudoFiles/watch 过滤/doctor 目录展开(.ts 放开后统一
|
|
312
364
|
* 走本函数,避免各处手写 endsWith 漂移),以及 LSP 的 isNudoFile(接线由
|
|
@@ -314,6 +366,51 @@ declare function serializeInferJson(result: AnalysisResult, file: string): Infer
|
|
|
314
366
|
*/
|
|
315
367
|
declare function isNudoTargetPath(path: string): boolean;
|
|
316
368
|
|
|
369
|
+
/** Formal sidecar contracts only — drafts never ambient-bind and need not reanalyze */
|
|
370
|
+
declare function isSidecarPath(path: string): boolean;
|
|
371
|
+
declare function isProjectConfigPath(path: string): boolean;
|
|
372
|
+
/** Watch accept gate: analysis targets + sidecar/config/env-template invalidators */
|
|
373
|
+
declare function isWatchRelevantPath(path: string): boolean;
|
|
374
|
+
/** `lib.nudo.js|ts` → candidate ambient sources next to it */
|
|
375
|
+
declare function ambientSourcesOfSidecar(sidecarPath: string): string[];
|
|
376
|
+
|
|
377
|
+
/** 源码里的 path-based load specs 解析为绝对路径后登记反向边 */
|
|
378
|
+
declare function noteEnvPathDeps(sourcePath: string, source: string): void;
|
|
379
|
+
/** 依赖该 env 模板的源文件列表 */
|
|
380
|
+
declare function envPathDependents(envPath: string): string[];
|
|
381
|
+
declare function clearEnvPathDeps(): void;
|
|
382
|
+
/** watch 门禁:env 模板变更必须可被接收(即便扩展名不进 isNudoTargetPath) */
|
|
383
|
+
declare function isEnvTemplatePath(path: string): boolean;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* 分析范围判定(A1/A2,design-analysis-scope.md)。
|
|
387
|
+
* CLI 显式路径不受 mode 限制;本模块供 LSP/watch 自动验证使用。
|
|
388
|
+
*/
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* 按 analysis.diagnostics 档过滤 evaluator/check **显示路径**诊断。
|
|
392
|
+
* - off:显示层全静音(与 errors 档区分)。check 门禁(CLI `nudo check` /
|
|
393
|
+
* checkSource)独立于本过滤,不受 off 影响。
|
|
394
|
+
* - errors:只发 severity=error
|
|
395
|
+
* - default:error + warning(静音 NOISY_WARNING_CODES)
|
|
396
|
+
* - verbose:全量
|
|
397
|
+
*/
|
|
398
|
+
declare function filterDiagnosticsByLevel<T extends {
|
|
399
|
+
severity: string;
|
|
400
|
+
code?: string;
|
|
401
|
+
}>(diags: T[], level: DiagnosticsLevel): T[];
|
|
402
|
+
declare function diagnosticsLevelForFile(filePath: string): DiagnosticsLevel;
|
|
403
|
+
declare function hasNudoDirectives(source: string): boolean;
|
|
404
|
+
/**
|
|
405
|
+
* 是否应对该文件跑分析(自动路径,如 LSP validate)。
|
|
406
|
+
* - 非 target 路径 → false
|
|
407
|
+
* - exclude 命中 / include 未命中 → false
|
|
408
|
+
* - mode=directives → 仅有指令
|
|
409
|
+
* - mode=exports → 指令 | export | 同名侧车
|
|
410
|
+
* - mode=all → true
|
|
411
|
+
*/
|
|
412
|
+
declare function shouldAnalyzeFile(filePath: string, source: string | undefined, config?: AnalysisConfig): boolean;
|
|
413
|
+
|
|
317
414
|
/**
|
|
318
415
|
* 相对/绝对 specifier → 模块源码。
|
|
319
416
|
* CLI / LSP / vite / check 共用同一扩展名表,避免门禁结果分叉。
|
|
@@ -382,7 +479,7 @@ declare function lookupHarvested(h: PackageHarvest, moduleName: string, exportNa
|
|
|
382
479
|
* 手动 `nudo harvest` 仍保留;这里是分析路径上的按需注入。
|
|
383
480
|
*/
|
|
384
481
|
|
|
385
|
-
/** 裸说明符 → 包名(含 scope);相对/绝对/node: 内建返回 undefined */
|
|
482
|
+
/** 裸说明符 → 包名(含 scope);相对/绝对/node: 与裸 Node 内建返回 undefined */
|
|
386
483
|
declare function barePackageName(spec: string): string | undefined;
|
|
387
484
|
declare function collectBarePackages(source: string): string[];
|
|
388
485
|
declare function harvestPackageCached(pkg: string, fromDir: string): PackageHarvest | null;
|
|
@@ -476,6 +573,34 @@ declare function bareSpecToAbsModules(spec: string, fromFile: string): AbsModule
|
|
|
476
573
|
declare function collectEnvGlobals(envNames: string[]): Record<string, Abs>;
|
|
477
574
|
/** @nudo:env modules(path / node:path / fs…)→ AbsModuleExports */
|
|
478
575
|
declare function collectEnvModules(envNames: string[]): Record<string, AbsModuleExports>;
|
|
576
|
+
/** Conflict when handwritten env overwrote a harvest module/export (B8). */
|
|
577
|
+
type EnvHarvestConflict = {
|
|
578
|
+
module: string;
|
|
579
|
+
/** export names where env replaced a harvest binding (empty + defaulted = default only) */
|
|
580
|
+
exports: string[];
|
|
581
|
+
defaultOverwritten: boolean;
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* Install conflict collector; returns the previous one so nested/concurrent
|
|
585
|
+
* analyzeFile callers can save/restore (module-global is not re-entrant).
|
|
586
|
+
*/
|
|
587
|
+
declare function setEnvHarvestConflictCollector(collector: ((c: EnvHarvestConflict) => void) | null): ((c: EnvHarvestConflict) => void) | null;
|
|
588
|
+
/** Read-only peek for tests / nested restore. */
|
|
589
|
+
declare function getEnvHarvestConflictCollector(): ((c: EnvHarvestConflict) => void) | null;
|
|
590
|
+
type MergeHarvestOptions = {
|
|
591
|
+
/**
|
|
592
|
+
* Per-call conflict sink. Takes precedence over the module-global collector
|
|
593
|
+
* installed via `setEnvHarvestConflictCollector`.
|
|
594
|
+
*/
|
|
595
|
+
onConflict?: (c: EnvHarvestConflict) => void;
|
|
596
|
+
};
|
|
597
|
+
/**
|
|
598
|
+
* Handwritten `@nudojs/env` wins over harvest / graph modules on overlapping
|
|
599
|
+
* module keys and overlapping export names (docs/versioning.md B8 + website
|
|
600
|
+
* harvester API). Harvest-only modules/exports are kept as fill-in.
|
|
601
|
+
* Overwrites notify `opts.onConflict` or the global collector.
|
|
602
|
+
*/
|
|
603
|
+
declare function mergeHarvestUnderEnv(harvestModules: Record<string, AbsModuleExports>, envModules: Record<string, AbsModuleExports>, opts?: MergeHarvestOptions): Record<string, AbsModuleExports>;
|
|
479
604
|
/** 收集 @nudo:replace + @nudo:as → transpile 注入表 */
|
|
480
605
|
declare function collectBPathReplacements(source: string): {
|
|
481
606
|
targets: Array<{
|
|
@@ -565,6 +690,129 @@ declare function clearAnalysisSessionCaches(): void;
|
|
|
565
690
|
/** 比 clearAnalysisSessionCaches 更彻底:再丢 AST LRU(测试 / 进程复用场景) */
|
|
566
691
|
declare function resetAllAnalysisCaches(): void;
|
|
567
692
|
|
|
693
|
+
/**
|
|
694
|
+
* B5:workspace 级 AnalysisSession——LSP 与 CLI(同进程)共享的分析 memo 面。
|
|
695
|
+
*
|
|
696
|
+
* core/service 的 analyzeFile / B-path / generalize / checkSource 都是
|
|
697
|
+
* 进程级模块缓存;本模块把「清空 / 定向逐出 / 依赖变更」收成一个显式
|
|
698
|
+
* session 对象,避免宿主各接一套失效逻辑,也便于测试隔离。
|
|
699
|
+
*
|
|
700
|
+
* 宿主契约:
|
|
701
|
+
* - 依赖内容变更 → `session.evictForDependents(files)`
|
|
702
|
+
* - 全量重置(watch 批前 / vite buildStart)→ `session.clear()`
|
|
703
|
+
* - LSP validate 与 agent check/hover/interface 在同一进程共用默认 session
|
|
704
|
+
*/
|
|
705
|
+
|
|
706
|
+
type AnalysisSession = {
|
|
707
|
+
/** 依赖变更:按「以这些文件为入口」的路径定向逐出 */
|
|
708
|
+
evictForDependents(files: string[]): void;
|
|
709
|
+
/** 清空 service+core 会话 memo(不含 AST LRU) */
|
|
710
|
+
clear(): void;
|
|
711
|
+
/** 彻底重置(含 AST LRU) */
|
|
712
|
+
reset(): void;
|
|
713
|
+
/**
|
|
714
|
+
* 与 analyzeFile 同源,但强制走本 session 的 memo(进程内默认即共享)。
|
|
715
|
+
* LSP / CLI / agent 工具都应调用这里,而不是旁路第二套缓存。
|
|
716
|
+
*/
|
|
717
|
+
analyze(filePath: string, source: string, activeCases?: Map<string, number>, externalCallRecords?: unknown): AnalysisResult;
|
|
718
|
+
};
|
|
719
|
+
/** 进程内默认 AnalysisSession(LSP server / CLI watch / agent tools 共用) */
|
|
720
|
+
declare function getAnalysisSession(): AnalysisSession;
|
|
721
|
+
/** 测试:替换默认 session(返回旧值以便恢复) */
|
|
722
|
+
declare function setAnalysisSession(session: AnalysisSession | undefined): AnalysisSession | undefined;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* 磁盘内容寻址缓存(B3,design-persistent-cache.md L1 骨架)。
|
|
726
|
+
* - 键:sha256(analysisAbi + relative paths + content hashes + import deps)
|
|
727
|
+
* - fail-open:读写失败/版本不符 → miss,绝不 throw
|
|
728
|
+
* - 不存 Abs;只存可 JSON 再执行投影(如 CheckJson)
|
|
729
|
+
* - 缓存根解析见 `evaluator/config.ts` 的 `diskCacheRoot`(唯一入口)
|
|
730
|
+
*/
|
|
731
|
+
/**
|
|
732
|
+
* 带包版本:升级 @nudojs/* 后旧 CheckJson 不得继续命中。
|
|
733
|
+
* 语义大改仍可手工再抬 major(`nudo-check-cache-v3`)。
|
|
734
|
+
*/
|
|
735
|
+
declare const ANALYSIS_ABI: string;
|
|
736
|
+
type DiskCacheOptions = {
|
|
737
|
+
/** 缓存根目录;undefined = 禁用 */
|
|
738
|
+
root?: string | undefined;
|
|
739
|
+
/** 命名空间子目录(check / interface …) */
|
|
740
|
+
namespace: string;
|
|
741
|
+
};
|
|
742
|
+
declare function sha256Hex(data: string | Buffer): string;
|
|
743
|
+
/** 相对化路径,避免绝对路径进磁盘键;树外路径用稳定内容 hash */
|
|
744
|
+
declare function relativizePath(p: string, root?: string): string;
|
|
745
|
+
declare class DiskCache {
|
|
746
|
+
private readonly root;
|
|
747
|
+
private readonly ns;
|
|
748
|
+
enabled: boolean;
|
|
749
|
+
constructor(opts: DiskCacheOptions);
|
|
750
|
+
private pathFor;
|
|
751
|
+
get<T>(key: string): T | undefined;
|
|
752
|
+
set(key: string, value: unknown): void;
|
|
753
|
+
clearNamespace(): void;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* check 报告键:abi + 相对路径 + 源码 sha + autoBind + **侧车 sha** +
|
|
757
|
+
* **@nudo:import / 传递契约依赖内容 sha**(依赖变更必须 miss)。
|
|
758
|
+
* dep 路径同样相对化(`relativizePath`):绝对路径进键会让同内容在不同
|
|
759
|
+
* 机器/checkout 上键不同,缓存无法跨环境复用。
|
|
760
|
+
*/
|
|
761
|
+
declare function checkCacheKey(filePath: string, source: string, opts: {
|
|
762
|
+
autoBind: boolean;
|
|
763
|
+
projectDir?: string;
|
|
764
|
+
sidecarContent?: string | null;
|
|
765
|
+
depContents?: Array<{
|
|
766
|
+
path: string;
|
|
767
|
+
content: string | null;
|
|
768
|
+
}>;
|
|
769
|
+
/** package.json#nudo.env 等项目维(named env 不在 path-dep 指纹里) */
|
|
770
|
+
projectEnvNames?: string[];
|
|
771
|
+
/** analysis knobs that can change check surface */
|
|
772
|
+
analysisCfg?: {
|
|
773
|
+
mode?: string;
|
|
774
|
+
evalMissingSlot?: string;
|
|
775
|
+
callSiteBudget?: number;
|
|
776
|
+
};
|
|
777
|
+
}): string;
|
|
778
|
+
/**
|
|
779
|
+
* effectiveInterface 表键(L1 Phase B,design-persistent-cache)。
|
|
780
|
+
* 维度:相对路径 + 源码 sha256 + autoBind + 侧车内容 sha256 + import 依赖
|
|
781
|
+
* (dep 路径相对化,与 checkCacheKey 同口径)。
|
|
782
|
+
* **不含** emit allowlist(白名单不影响契约读取)。
|
|
783
|
+
*/
|
|
784
|
+
declare function ifaceCacheKey(filePath: string, source: string, opts: {
|
|
785
|
+
autoBind: boolean;
|
|
786
|
+
projectDir?: string;
|
|
787
|
+
/** 侧车源码(已读入);undefined = 无侧车或 autoBind 关 */
|
|
788
|
+
sidecarSource?: string | undefined;
|
|
789
|
+
depContents?: Array<{
|
|
790
|
+
path: string;
|
|
791
|
+
content: string | null;
|
|
792
|
+
}>;
|
|
793
|
+
projectEnvNames?: string[];
|
|
794
|
+
}): string;
|
|
795
|
+
/** 从源码提取 `@nudo:import` / `@nudo:import * as` 的 specifier */
|
|
796
|
+
declare function extractNudoImportSpecs(source: string): string[];
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* check/iface 磁盘缓存键的依赖内容采集。
|
|
800
|
+
* 走 core `loadModuleDepsFingerprint`:覆盖 ESM from / require / dynamic import /
|
|
801
|
+
* `@nudo:import` / ambient 侧车闭包——不只 `@nudo:import` 注释。
|
|
802
|
+
*
|
|
803
|
+
* 内容必须优先取 loadModule 解析结果(fingerprint.contents),不得回读磁盘:
|
|
804
|
+
* LSP buffer-aware loadModule 与自定义 loader 的内容可能与磁盘不一致,
|
|
805
|
+
* 回读会让缓存键分叉(buffer 编辑后仍命中磁盘旧内容)。
|
|
806
|
+
*/
|
|
807
|
+
type DepContent = {
|
|
808
|
+
path: string;
|
|
809
|
+
content: string | null;
|
|
810
|
+
};
|
|
811
|
+
declare function collectLoadDepContents(filePath: string, source: string, loadModule: (spec: string, fromFile: string) => string | undefined): {
|
|
812
|
+
depContents: DepContent[];
|
|
813
|
+
truncated: boolean;
|
|
814
|
+
};
|
|
815
|
+
|
|
568
816
|
/**
|
|
569
817
|
* B 路径静态诊断(AST,不执行):
|
|
570
818
|
* - unreachable:同块 return/throw 之后的语句
|
|
@@ -601,18 +849,57 @@ declare function collectBPathDiagnostics(source: string, extraKnown?: Iterable<s
|
|
|
601
849
|
/**
|
|
602
850
|
* 预置 Node API env:从 @types/node 的 .d.ts harvest。
|
|
603
851
|
* 与 packages/env 的手写 env 并行;此路径自动、可刷新。
|
|
852
|
+
*
|
|
853
|
+
* Productization (P0-B B2/B7):
|
|
854
|
+
* - In-process cache keyed by package root + package.json mtime/size.
|
|
855
|
+
* - Terminal failures (`not-found`/`no-dts`/`failed`) also cache — no retry storm.
|
|
856
|
+
* `disabled` is never cached (env var can flip mid-process).
|
|
857
|
+
* - `clearNodeHarvestCache()` for tests / watch invalidation.
|
|
858
|
+
* - `NUDO_HARVEST_NODE=off` disables harvest (explicit skip, not silent).
|
|
859
|
+
* - Defaults stay IDE-budgeted: maxFiles=12, maxMs=2500.
|
|
604
860
|
*/
|
|
605
861
|
|
|
862
|
+
/** IDE-startup budgets for @types/node harvest. Do not raise casually. */
|
|
863
|
+
declare const HARVEST_NODE_DEFAULT_MAX_FILES = 12;
|
|
864
|
+
declare const HARVEST_NODE_DEFAULT_MAX_MS = 2500;
|
|
865
|
+
type HarvestNodeStats = {
|
|
866
|
+
files: number;
|
|
867
|
+
symbols: number;
|
|
868
|
+
skipped: number;
|
|
869
|
+
};
|
|
606
870
|
type NodeEnvResult = {
|
|
607
871
|
ok: true;
|
|
608
872
|
env: HarvestedEnv;
|
|
609
873
|
root: string;
|
|
610
874
|
files: number;
|
|
875
|
+
stats: HarvestNodeStats;
|
|
876
|
+
/** true when this result came from the in-process cache */
|
|
877
|
+
cached: boolean;
|
|
611
878
|
} | {
|
|
612
879
|
ok: false;
|
|
613
880
|
error: string;
|
|
881
|
+
reason: "disabled" | "not-found" | "no-dts" | "failed";
|
|
882
|
+
/** true when this failure came from the in-process cache */
|
|
883
|
+
cached?: boolean;
|
|
614
884
|
};
|
|
615
|
-
/**
|
|
885
|
+
/**
|
|
886
|
+
* Clear the in-process @types/node harvest cache.
|
|
887
|
+
* Drops **success and terminal-failure** entries (including `not-found`), so
|
|
888
|
+
* a mid-session `@types/node` install becomes visible without process restart.
|
|
889
|
+
* Tests, watch-mode dep-hash invalidation, and package-manager hooks should
|
|
890
|
+
* call this when `node_modules/@types/node` changes underneath the process.
|
|
891
|
+
*/
|
|
892
|
+
declare function clearNodeHarvestCache(): void;
|
|
893
|
+
/** Number of cached harvest results (diagnostics / tests). */
|
|
894
|
+
declare function getNodeHarvestCacheSize(): number;
|
|
895
|
+
declare function isHarvestNodeDisabled(env?: NodeJS.ProcessEnv): boolean;
|
|
896
|
+
/**
|
|
897
|
+
* harvest @types/node(限制文件数 + 时间预算,避免拖垮启动)。
|
|
898
|
+
* Success **and** terminal failures (`not-found` / `no-dts` / `failed`) are
|
|
899
|
+
* cached in-process so IDE analysis does not re-walk / re-timeout every file.
|
|
900
|
+
* `disabled` is never cached — the env var can flip mid-process.
|
|
901
|
+
* Call `clearNodeHarvestCache()` after `@types/node` changes.
|
|
902
|
+
*/
|
|
616
903
|
declare function harvestNodeTypes(fromDir?: string, maxFiles?: number, maxMs?: number): NodeEnvResult;
|
|
617
904
|
/** 把 harvest 结果压成「模块名 → 导出名列表」摘要,便于日志/测试 */
|
|
618
905
|
declare function summarizeNodeEnv(env: HarvestedEnv): {
|
|
@@ -626,10 +913,11 @@ declare function summarizeNodeEnv(env: HarvestedEnv): {
|
|
|
626
913
|
* 与 LSP server capabilities 里声明的 legend 必须逐字对齐——server.ts 直接
|
|
627
914
|
* 导入本常量注册,保证「提取端索引」与「客户端图例」单一来源。
|
|
628
915
|
* 顺序沿用 lsp 包原 legend(function/variable/parameter/property 在前),
|
|
629
|
-
* 末尾追加 method
|
|
916
|
+
* 末尾追加 method(对象字面量方法键)与 interface 档 modifier(A7),
|
|
917
|
+
* 只追加不重排,客户端索引稳定。
|
|
630
918
|
*/
|
|
631
919
|
declare const SEMANTIC_TOKEN_TYPES: readonly ["function", "variable", "parameter", "property", "type", "keyword", "string", "number", "comment", "decorator", "method"];
|
|
632
|
-
declare const SEMANTIC_TOKEN_MODIFIERS: readonly ["declaration", "readonly", "deprecated", "unreachable"];
|
|
920
|
+
declare const SEMANTIC_TOKEN_MODIFIERS: readonly ["declaration", "readonly", "deprecated", "unreachable", "contract", "generated", "derived"];
|
|
633
921
|
type SemanticToken = {
|
|
634
922
|
line: number;
|
|
635
923
|
char: number;
|
|
@@ -639,6 +927,11 @@ type SemanticToken = {
|
|
|
639
927
|
};
|
|
640
928
|
/** LSP 标准相对五元组编码:deltaLine/deltaStartChar/length/tokenType/tokenModifiers。 */
|
|
641
929
|
declare function encodeSemanticTokens(tokens: SemanticToken[]): number[];
|
|
930
|
+
/** A7:interface 档 → semantic token modifier(与 CodeLens 同源) */
|
|
931
|
+
declare function interfaceTierModifierBit(src: InterfaceSource): number;
|
|
932
|
+
type BuildSemanticTokensOpts = InterfaceTierOpts & {
|
|
933
|
+
loadModule?: (spec: string, fromFile: string) => string | undefined;
|
|
934
|
+
};
|
|
642
935
|
/**
|
|
643
936
|
* 从源码提取 semantic tokens 并按 LSP 相对编码返回扁平 number[]。
|
|
644
937
|
*
|
|
@@ -648,15 +941,24 @@ declare function encodeSemanticTokens(tokens: SemanticToken[]): number[];
|
|
|
648
941
|
* - 函数声明/函数表达式的名字 → function;所有函数的参数 → parameter;
|
|
649
942
|
* - 对象字面量的键:值为函数 → method,否则 property。
|
|
650
943
|
*
|
|
944
|
+
* A7:本地 named export 的函数绑定额外带 interface 档 modifier
|
|
945
|
+
* (contract / generated / derived),与 CodeLens `● interface` 同源。
|
|
946
|
+
* 非导出绑定只带 declaration,不假装进档。
|
|
947
|
+
*
|
|
651
948
|
* 推断优先 Abs 模块图绑定(TypeValue 退出主路径);失败时复用
|
|
652
949
|
* evaluateProgram。解析失败返回 []。
|
|
653
950
|
*/
|
|
654
|
-
declare function buildSemanticTokens(filePath: string, source: string): number[];
|
|
951
|
+
declare function buildSemanticTokens(filePath: string, source: string, opts?: BuildSemanticTokensOpts): number[];
|
|
655
952
|
|
|
656
|
-
/**
|
|
657
|
-
|
|
953
|
+
/**
|
|
954
|
+
* Abs → TS 类型串。有损:pred / 非 lit term 落到 shape 基类型。
|
|
955
|
+
* `typeVars`:term var id → TS 类型参数名(HOF 泛型投影时传入;
|
|
956
|
+
* `any`+var 在此映射下渲染为该参数名,否则 `unknown`)。
|
|
957
|
+
*/
|
|
958
|
+
declare function absToTSType(a: Abs, typeVars?: Map<string, string>): string;
|
|
658
959
|
/**
|
|
659
960
|
* 为单个函数生成 .d.ts 声明行(JSDoc + 单一 widen 主签名)。
|
|
961
|
+
* 有 hof 关系时优先泛型投影(C3.3);否则 case-widen。
|
|
660
962
|
* service 的 generateDts 与 CLI `--dts`(infer/watch)共用本函数,
|
|
661
963
|
* 两条路径输出保持一致。
|
|
662
964
|
*/
|
|
@@ -748,6 +1050,10 @@ declare function mockDirectivesToAbsSeeds(functions: Array<{
|
|
|
748
1050
|
* autoBind 沿 package.json#nudo.interface(findProjectConfig → interfaceConfig)
|
|
749
1051
|
* 下传,可用 opts 覆盖(测试 / CLI 显式开关);读盘用 defaultLoadModule
|
|
750
1052
|
* (与 check 的 refine 解析同一扩展名表)。
|
|
1053
|
+
*
|
|
1054
|
+
* B3 Phase B:`nudo.cache` / NUDO_CACHE_DIR 打开时,整文件 effectiveInterface
|
|
1055
|
+
* 表(含 implicit 负缓存 null)落盘;二次冷启动跳过侧车 exec / 契约合并。
|
|
1056
|
+
* 缓存只服务打印/表面,不加速 B-path 分析(design-persistent-cache §0)。
|
|
751
1057
|
*/
|
|
752
1058
|
|
|
753
1059
|
type InterfaceSurfaceEntry = {
|
|
@@ -768,6 +1074,8 @@ type InterfaceSurfaceOpts = {
|
|
|
768
1074
|
loadModule?: LoadModule;
|
|
769
1075
|
/** 跨文件调用记录(--callsites 采集):implicit 展示的实参域原料 */
|
|
770
1076
|
records?: CallRecord[];
|
|
1077
|
+
/** 打开 buffer 覆盖磁盘源码(E5:agent/LSP 与 hover 同口径) */
|
|
1078
|
+
source?: string;
|
|
771
1079
|
};
|
|
772
1080
|
/** 单条 interface 打印行(CLI runInterface 与 LSP agent 面共用) */
|
|
773
1081
|
declare function formatInterfaceSurfaceLine(e: InterfaceSurfaceEntry): string;
|
|
@@ -816,6 +1124,10 @@ type EmitInterfaceOpts = {
|
|
|
816
1124
|
* 外部使用现场记录)的投影原料;缺省时仅用本文件调用点证据。
|
|
817
1125
|
*/
|
|
818
1126
|
records?: CallRecord[];
|
|
1127
|
+
/** 缓冲源(E5:agent/LSP 与 validate 同源);缺省读盘 */
|
|
1128
|
+
source?: string;
|
|
1129
|
+
/** 模块装载器(buffer-aware 侧车可见);缺省 defaultLoadModule */
|
|
1130
|
+
loadModule?: (spec: string, fromFile: string) => string | undefined;
|
|
819
1131
|
};
|
|
820
1132
|
type EmitInterfaceResult = {
|
|
821
1133
|
written: string[];
|
|
@@ -849,6 +1161,112 @@ declare function emitInterface(filePath: string, opts: EmitInterfaceOpts): Promi
|
|
|
849
1161
|
*/
|
|
850
1162
|
declare function formatEmitSummary(sourcePath: string, sidecarRel: string, result: EmitInterfaceResult): string[];
|
|
851
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* `nudo interface --draft`:从已有 JS **逻辑** 生成 interface 草稿。
|
|
1166
|
+
*
|
|
1167
|
+
* 产品位(代码优先 / 迁移):先写实现,再反推可审阅的 `fn({…}, …)` 草稿;
|
|
1168
|
+
* 人审后迁入 `*.nudo.js` 才成为契约。
|
|
1169
|
+
*
|
|
1170
|
+
* 证据分层(与 C0 一致:草稿 ≠ ambient 义务):
|
|
1171
|
+
* - callsite / directive case → joinThenProject 值域(迁移最可信)
|
|
1172
|
+
* - body 触达(**仅草稿展示**)→ 参数上被读到的字段名建议;不进 check
|
|
1173
|
+
* - generalize symbolic → 返回位兜底
|
|
1174
|
+
* - 无证据 → 参数槽省略 + 注释 TODO(不发明义务)
|
|
1175
|
+
* - 已有 handwritten 契约 → **跳过**(手写优先,不覆盖)
|
|
1176
|
+
*
|
|
1177
|
+
* 写盘:默认只打印;`--write` 写入 `<file>.nudo.draft.js`——**不会**被
|
|
1178
|
+
* sidecar 自动绑定(loadModule 只认 `*.nudo.js`)。审阅后复制进正式侧车。
|
|
1179
|
+
*/
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* DraftEvidence `body` = 仅来自函数体对形参的成员读取(草稿建议,非义务)。
|
|
1183
|
+
* check / effectiveInterface **永不**消费该档。
|
|
1184
|
+
*/
|
|
1185
|
+
type DraftEvidence = "callsite" | "directive" | "symbolic" | "body" | "none";
|
|
1186
|
+
type InterfaceDraftEntry = {
|
|
1187
|
+
fn: string;
|
|
1188
|
+
/** 全部形参(含无证据槽,便于人读) */
|
|
1189
|
+
params: Array<{
|
|
1190
|
+
name: string;
|
|
1191
|
+
constraint?: NudoConstraint;
|
|
1192
|
+
display: string;
|
|
1193
|
+
/** false = 无证据,DSL 对象里省略该槽 */
|
|
1194
|
+
projected: boolean;
|
|
1195
|
+
/** 函数体读到的字段名(草稿建议;与 projected 无关) */
|
|
1196
|
+
bodyAccesses?: string[];
|
|
1197
|
+
}>;
|
|
1198
|
+
returns?: {
|
|
1199
|
+
constraint?: NudoConstraint;
|
|
1200
|
+
display: string;
|
|
1201
|
+
projected: boolean;
|
|
1202
|
+
};
|
|
1203
|
+
paramEvidence: DraftEvidence;
|
|
1204
|
+
returnEvidence: DraftEvidence;
|
|
1205
|
+
skipped?: "handwritten" | "not-an-export";
|
|
1206
|
+
/** 草稿 DSL:`fn({ … }, …)`;handwritten / 非导出时 undefined */
|
|
1207
|
+
dsl?: string;
|
|
1208
|
+
};
|
|
1209
|
+
type InterfaceDraftOpts = {
|
|
1210
|
+
fnNames?: string[];
|
|
1211
|
+
records?: CallRecord[];
|
|
1212
|
+
loadModule?: LoadModule;
|
|
1213
|
+
/**
|
|
1214
|
+
* Accepted for API compatibility; **ignored**. The handwritten-contract probe
|
|
1215
|
+
* always uses `effectiveInterface(..., { autoBind: true })` so draft skips
|
|
1216
|
+
* disk sidecars even when ambient autoBind is off (product: draft asks
|
|
1217
|
+
* "does a contract already exist?", not "is ambient binding on?").
|
|
1218
|
+
*/
|
|
1219
|
+
autoBind?: boolean;
|
|
1220
|
+
/** 默认 true:收集 body 成员读取作草稿建议(永不进 check) */
|
|
1221
|
+
bodyAccesses?: boolean;
|
|
1222
|
+
/** 打开 buffer 源(E5:与 hover/interface 同口径) */
|
|
1223
|
+
source?: string;
|
|
1224
|
+
};
|
|
1225
|
+
type InterfaceDraftResult = {
|
|
1226
|
+
file: string;
|
|
1227
|
+
entries: InterfaceDraftEntry[];
|
|
1228
|
+
draftSource: string;
|
|
1229
|
+
sidecarPath: string;
|
|
1230
|
+
};
|
|
1231
|
+
/**
|
|
1232
|
+
* Draft-only:收集每个顶层函数形参上的成员读取键(`user.name` → name)。
|
|
1233
|
+
* **不是** C0 禁止的 body→义务通道——只进草稿注释/建议,check 不读此表。
|
|
1234
|
+
*/
|
|
1235
|
+
declare function collectParamBodyAccesses(source: string): Map<string, Map<string, Set<string>>>;
|
|
1236
|
+
/**
|
|
1237
|
+
* 为单文件顶层导出生成 interface 草稿(不写盘)。
|
|
1238
|
+
* handwritten 跳过;已有 @generated 仍出草稿(便于对照)。
|
|
1239
|
+
*/
|
|
1240
|
+
declare function draftInterface(filePath: string, opts?: InterfaceDraftOpts): Promise<InterfaceDraftResult>;
|
|
1241
|
+
/** 草稿模块文本(人读 + 可复制到 *.nudo.js / *.nudo.ts) */
|
|
1242
|
+
declare function formatDraftModule(filePath: string, entries: InterfaceDraftEntry[], sidecarPath?: string): string;
|
|
1243
|
+
/** `lib.js|ts` → `lib.nudo.draft.js|ts`(不进 ambient sidecar 表) */
|
|
1244
|
+
declare function sidecarDraftPath(filePath: string): string;
|
|
1245
|
+
type WriteDraftResult = {
|
|
1246
|
+
draftPath: string;
|
|
1247
|
+
written: boolean;
|
|
1248
|
+
changed: boolean;
|
|
1249
|
+
draftable: boolean;
|
|
1250
|
+
draftSource: string;
|
|
1251
|
+
};
|
|
1252
|
+
/** Parse-layer draftable: at least one entry has generated DSL and was not skipped */
|
|
1253
|
+
declare function isDraftableEntry(entries: ReadonlyArray<Pick<InterfaceDraftEntry, "dsl" | "skipped">>): boolean;
|
|
1254
|
+
/**
|
|
1255
|
+
* 写入 `*.nudo.draft.js`(覆盖草稿文件本身;不碰正式 `*.nudo.js`)。
|
|
1256
|
+
* 基础路径防护:拒绝 node_modules;拒绝 draft 路径与正式侧车重合;
|
|
1257
|
+
* 拒绝 draft 路径落在源文件目录之外的穿越。
|
|
1258
|
+
*
|
|
1259
|
+
* `opts.entries` / `opts.draftable`:解析层判定(优先)。缺省时用 Unicode
|
|
1260
|
+
* 感知 export 正则兜底——`\w` 会静默丢掉 `计算` 这类标识符。
|
|
1261
|
+
*/
|
|
1262
|
+
declare function writeInterfaceDraft(filePath: string, draftSource: string, opts?: {
|
|
1263
|
+
dryRun?: boolean;
|
|
1264
|
+
projectDir?: string;
|
|
1265
|
+
entries?: ReadonlyArray<Pick<InterfaceDraftEntry, "dsl" | "skipped">>;
|
|
1266
|
+
draftable?: boolean;
|
|
1267
|
+
}): WriteDraftResult;
|
|
1268
|
+
declare function formatDraftSummary(sourceRel: string, draftRel: string, result: InterfaceDraftResult, write?: WriteDraftResult): string[];
|
|
1269
|
+
|
|
852
1270
|
/**
|
|
853
1271
|
* Root 驱动的契约下行(design-refine-derivation §4.2 / §11 Phase 2)。
|
|
854
1272
|
*
|
|
@@ -970,4 +1388,4 @@ declare function emitDerivedFromRoot(rootFile: string, opts: {
|
|
|
970
1388
|
refreshExistingOnly?: boolean;
|
|
971
1389
|
}): EmitDerivedResult;
|
|
972
1390
|
|
|
973
|
-
export { type AbsGraphOptions, type AbsMockSeeds, type AbsModuleCacheEntry, type AbsModuleGraphResult, type AbsModuleLoadIssue, type AnalysisResult, type BPathBuiltinUnknown, type BPathDiagnostics, type BPathRunResult, type BPathUnreachable, type BindingInfo, CallRecord, type CaseHint, type CaseInfo, type CaseResult, type CompletionItem, type ConstraintSourceExpr, type DerivedExport, type DerivedParam, type Diagnostic, type DiagnosticSeverity, type DiagnosticTag, type EmitDerivedResult, type EmitInterfaceOpts, type EmitInterfaceResult, type EmitInterfaceSkipReason, type EmitResult, type EmitSkipReason, type FunctionAnalysis, type HoverInfo, type InferJson, type InferJsonCase, type InferJsonFunction, type InterfaceSurfaceEntry, type InterfaceSurfaceOpts, type LoadModule, type ModuleExports, type ModuleGraphCache, type NodeEnvResult, type PackageHarvest, type ReferenceInfo, type RootDeriveOpts, type RootDeriveResult, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES, type SemanticToken, type SourceLocation, type SymbolInfo, type SymbolTable, absToTSType, absToZodSchema, analyzeExportsFromSource, analyzeFile, analyzeFileAsync, autoHarvestModules, barePackageName, bareSpecToAbsModules, buildCaseDirective, buildModuleGraph, buildSemanticTokens, clearAbsModuleCache, clearAnalysisFileCache, clearAnalysisSessionCaches, clearBPathCache, clearFnAnalysisCache, clearHarvestCache, collectAbsBindingsFromGraph, collectBPathDiagnostics, collectBPathReplacements, collectBarePackages, collectCallRecords, collectDependencySpecs, collectDtsFromEntry, collectEnvGlobals, collectEnvModules, collectStaticImports, computeDirtySet, defaultAbsLoadModule, defaultLoadModule, deriveFromRoot, emitDerivedFromRoot, emitInterface, encodeSemanticTokens, evalAbsModuleGraph, evalProgramAbsWithModules, evictAbsModuleCacheFiles, evictAnalysisCachesForFiles, evictAnalysisFileCacheForFiles, evictBPathCacheForFiles, evictFnAnalysisCacheForFiles, extractFnConstraintSources, formatDerivedSection, formatEmitSummary, formatHarvestSummary, formatInterfaceSurfaceLine, generateDts, generateFunctionDtsLines, generateGuardFunction, generateGuardFunctionFromAbs, getAbsAtPosition, getAbsAtPositionAsync, getAnalysisFileCacheSize, getCasesForFile, getCompletionsAtPosition, getHoverAtPosition, getTypeAtPosition, getTypeAtPositionAsync, harvestNodeTypes, harvestPackage, harvestPackageCached, harvestToAbsModules, harvestedValueToAbs, insertGeneratedCaseDirectives, interfaceSurface, isBPathCapable, isNudoTargetPath, lookupHarvested, mockDirectivesToAbsSeeds, packageHarvestToAbsModules, resetAllAnalysisCaches, resolvePackageRoot, serializeCaseArg, serializeInferJson, stripGeneratedCaseDirectives, summarizeNodeEnv, topoSortDirty, tryBPathCall, tryBPathCallFull, tryRunBPath, unifiedDiff };
|
|
1391
|
+
export { ANALYSIS_ABI, type AbsGraphOptions, type AbsMockSeeds, type AbsModuleCacheEntry, type AbsModuleGraphResult, type AbsModuleLoadIssue, AnalysisConfig, type AnalysisResult, type AnalysisSession, type BPathBuiltinUnknown, type BPathDiagnostics, type BPathRunResult, type BPathUnreachable, type BindingInfo, type BuildSemanticTokensOpts, CallRecord, type CaseHint, type CaseInfo, type CaseResult, type CompletionItem, type ConstraintSourceExpr, type DepContent, type DerivedExport, type DerivedParam, type Diagnostic, type DiagnosticSeverity, type DiagnosticTag, DiagnosticsLevel, DiskCache, type DiskCacheOptions, type DraftEvidence, type EmitDerivedResult, type EmitInterfaceOpts, type EmitInterfaceResult, type EmitInterfaceSkipReason, type EmitResult, type EmitSkipReason, type EnvHarvestConflict, type FunctionAnalysis, HARVEST_NODE_DEFAULT_MAX_FILES, HARVEST_NODE_DEFAULT_MAX_MS, type HarvestNodeStats, type HoverInfo, type InferJson, type InferJsonCase, type InferJsonFunction, type InterfaceDraftEntry, type InterfaceDraftOpts, type InterfaceDraftResult, type InterfaceSurfaceEntry, type InterfaceSurfaceOpts, type LoadModule, type MergeHarvestOptions, type ModuleExports, type ModuleGraphCache, type NodeEnvResult, type PackageHarvest, type ReferenceInfo, type RootDeriveOpts, type RootDeriveResult, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES, type SemanticToken, type SourceLocation, type SymbolInfo, type SymbolTable, type WriteDraftResult, absToTSType, absToZodSchema, ambientSourcesOfSidecar, analysisFileCacheKey, analyzeExportsFromSource, analyzeFile, analyzeFileAsync, autoHarvestModules, barePackageName, bareSpecToAbsModules, buildCaseDirective, buildModuleGraph, buildSemanticTokens, checkCacheKey, clearAbsModuleCache, clearAnalysisFileCache, clearAnalysisSessionCaches, clearBPathCache, clearEnvPathDeps, clearFnAnalysisCache, clearHarvestCache, clearNodeHarvestCache, collectAbsBindingsFromGraph, collectBPathDiagnostics, collectBPathReplacements, collectBarePackages, collectCallRecords, collectDependencySpecs, collectDtsFromEntry, collectEnvGlobals, collectEnvModules, collectLoadDepContents, collectParamBodyAccesses, collectStaticImports, computeDirtySet, defaultAbsLoadModule, defaultLoadModule, deriveFromRoot, diagnosticsLevelForFile, draftInterface, emitDerivedFromRoot, emitInterface, encodeSemanticTokens, envPathDependents, evalAbsModuleGraph, evalProgramAbsWithModules, evictAbsModuleCacheFiles, evictAnalysisCachesForFiles, evictAnalysisFileCacheForFiles, evictBPathCacheForFiles, evictFnAnalysisCacheForFiles, extractFnConstraintSources, extractNudoImportSpecs, filterDiagnosticsByLevel, formatDerivedSection, formatDraftModule, formatDraftSummary, formatEmitSummary, formatHarvestSummary, formatInterfaceSurfaceLine, generateDts, generateFunctionDtsLines, generateGuardFunction, generateGuardFunctionFromAbs, getAbsAtPosition, getAbsAtPositionAsync, getAnalysisFileCacheSize, getAnalysisSession, getCasesForFile, getCompletionsAtPosition, getEnvHarvestConflictCollector, getHoverAtPosition, getNodeHarvestCacheSize, getTypeAtPosition, getTypeAtPositionAsync, harvestNodeTypes, harvestPackage, harvestPackageCached, harvestToAbsModules, harvestedValueToAbs, ifaceCacheKey, insertGeneratedCaseDirectives, interfaceSurface, interfaceTierModifierBit, isBPathCapable, isDraftableEntry, isEnvTemplatePath, isHarvestNodeDisabled, isNudoTargetPath, isProjectConfigPath, isSidecarPath, isWatchRelevantPath, lookupHarvested, mergeHarvestUnderEnv, mockDirectivesToAbsSeeds, noteEnvPathDeps, packageHarvestToAbsModules, relativizePath, resetAllAnalysisCaches, resolvePackageRoot, serializeCaseArg, serializeInferJson, setAnalysisSession, setEnvHarvestConflictCollector, sha256Hex, shouldAnalyzeFile, sidecarDraftPath, hasNudoDirectives as sourceHasNudoDirectives, stripGeneratedCaseDirectives, summarizeNodeEnv, topoSortDirty, tryBPathCall, tryBPathCallFull, tryRunBPath, unifiedDiff, writeInterfaceDraft };
|