@i18nprune/core 0.1.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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +165 -0
  3. package/dist/adapters-gp1lXp0T.d.ts +12 -0
  4. package/dist/capabilities-x74cD2Hu.d.ts +48 -0
  5. package/dist/cleanup.d.ts +64 -0
  6. package/dist/cleanup.js +3999 -0
  7. package/dist/config.d.ts +201 -0
  8. package/dist/config.js +2865 -0
  9. package/dist/coreContext-DMaWLvmB.d.ts +388 -0
  10. package/dist/fs-BUYD8ZhA.d.ts +20 -0
  11. package/dist/generate.d.ts +487 -0
  12. package/dist/generate.js +9389 -0
  13. package/dist/humanEmit-ygNlYX-S.d.ts +79 -0
  14. package/dist/index-BQuLEQ9b.d.ts +7 -0
  15. package/dist/index-B_ow_Xvr.d.ts +97 -0
  16. package/dist/index-BgG01AKL.d.ts +287 -0
  17. package/dist/index-CIzZl4W8.d.ts +124 -0
  18. package/dist/index-Csm1w7XD.d.ts +58 -0
  19. package/dist/index-DLwTogCo.d.ts +43 -0
  20. package/dist/index-DVT26v11.d.ts +61 -0
  21. package/dist/index-DdjljwMj.d.ts +39 -0
  22. package/dist/index-DeIw-cZd.d.ts +52 -0
  23. package/dist/index-X50E1FIX.d.ts +50 -0
  24. package/dist/index.d.ts +9180 -0
  25. package/dist/index.js +21888 -0
  26. package/dist/init.d.ts +86 -0
  27. package/dist/init.js +848 -0
  28. package/dist/listWindow-XEFxQZi1.d.ts +30 -0
  29. package/dist/localeTargetCodes-BBIQjauw.d.ts +11 -0
  30. package/dist/locales.d.ts +39 -0
  31. package/dist/locales.js +2288 -0
  32. package/dist/missing-BVCvgUC8.d.ts +10 -0
  33. package/dist/missing.d.ts +85 -0
  34. package/dist/missing.js +5892 -0
  35. package/dist/modeResolve-cGVaY5Hh.d.ts +25 -0
  36. package/dist/path-Bfn3SAts.d.ts +11 -0
  37. package/dist/profile-BwOP9WKh.d.ts +9 -0
  38. package/dist/providers-0uMEfT6q.d.ts +82 -0
  39. package/dist/prune-c6hKZCv_.d.ts +33 -0
  40. package/dist/quality.d.ts +36 -0
  41. package/dist/quality.js +3868 -0
  42. package/dist/report-D5-6bVFj.d.ts +8 -0
  43. package/dist/report-schema.d.ts +102 -0
  44. package/dist/report-schema.js +42 -0
  45. package/dist/resumeCandidates-xR13eEwt.d.ts +200 -0
  46. package/dist/root-2-kCaBvQ.d.ts +1110 -0
  47. package/dist/runtime/edge.d.ts +21 -0
  48. package/dist/runtime/edge.js +87 -0
  49. package/dist/runtime/helpers/sync.d.ts +16 -0
  50. package/dist/runtime/helpers/sync.js +117 -0
  51. package/dist/runtime/node.d.ts +24 -0
  52. package/dist/runtime/node.js +204 -0
  53. package/dist/runtime/web.d.ts +21 -0
  54. package/dist/runtime/web.js +84 -0
  55. package/dist/shared.d.ts +1177 -0
  56. package/dist/shared.js +4897 -0
  57. package/dist/sourceContext-1LQg3HiQ.d.ts +36 -0
  58. package/dist/sourceSurface-mDtwGo1E.d.ts +122 -0
  59. package/dist/sync.d.ts +86 -0
  60. package/dist/sync.js +4971 -0
  61. package/dist/syncSegment-Bx6He2Mu.d.ts +149 -0
  62. package/dist/targets-EmtKyr6F.d.ts +23 -0
  63. package/dist/template-CGM-_WLT.d.ts +139 -0
  64. package/dist/translate-CIHYp7wi.d.ts +77 -0
  65. package/dist/types/shared.d.ts +21 -0
  66. package/dist/types/shared.js +1 -0
  67. package/dist/types.d.ts +1345 -0
  68. package/dist/types.js +1 -0
  69. package/dist/validate.d.ts +126 -0
  70. package/dist/validate.js +3717 -0
  71. package/package.json +128 -0
@@ -0,0 +1,388 @@
1
+ import { F as LocaleSegmentSource, b as LocalesFilesystemConfig, G as ScanExcludeConfig, I as I18nPruneConfig } from './root-2-kCaBvQ.js';
2
+ import { a as RuntimeSystemPort } from './capabilities-x74cD2Hu.js';
3
+ import { R as RuntimePathPort } from './path-Bfn3SAts.js';
4
+ import { R as RuntimeFsPort } from './fs-BUYD8ZhA.js';
5
+ import { R as RuntimeAdapters } from './adapters-gp1lXp0T.js';
6
+
7
+ /**
8
+ * Canonical **translation surface** for locale JSON: one row per logical key path
9
+ * (legacy string terminals or structured `{ value, … }` objects — same path layout as the source locale).
10
+ */
11
+ type TranslationSurfaceShape = 'legacy_string' | 'structured';
12
+ type TranslationSurfaceLeaf = {
13
+ path: string;
14
+ value: string;
15
+ shape: TranslationSurfaceShape;
16
+ status?: string;
17
+ confidence: number | null;
18
+ needsReview: boolean | null;
19
+ needsTranslationAgain?: boolean | null;
20
+ /** Structured-locale JSON `source` field (`manual`, provider id, …) — same name as on-disk JSON. */
21
+ source?: string;
22
+ /** In-memory segment file provenance for multi-file layouts; never persisted as this object. */
23
+ fileOrigin?: LocaleSegmentSource;
24
+ structuredMetaComplete?: boolean;
25
+ };
26
+
27
+ /**
28
+ * Structured scan-walk debug events (directory / file skips while listing sources).
29
+ *
30
+ * Core does not print these — it only invokes an optional listener so hosts stay
31
+ * runtime-agnostic (no `console` in core). Register via {@link RunOptions.onScanDebug}
32
+ * or pass `onScanDebug` to {@link listSourceFiles}.
33
+ */
34
+ type ScanDebugSkipDirectoryEvent = {
35
+ kind: 'skip_directory';
36
+ /** Path relative to scan root (POSIX separators). */
37
+ relativePath: string;
38
+ /** Directory entry basename. */
39
+ basename: string;
40
+ /** Human-readable reason (built-in skip, `exclude.dirs`, regex, …). */
41
+ reason: string;
42
+ };
43
+ type ScanDebugSkipFileEvent = {
44
+ kind: 'skip_file';
45
+ relativePath: string;
46
+ basename: string;
47
+ reason: string;
48
+ };
49
+ type ScanDebugEvent = ScanDebugSkipDirectoryEvent | ScanDebugSkipFileEvent;
50
+ /** Optional per-call listener for {@link listSourceFiles} (overrides global when both set: per-call wins). */
51
+ type ListSourceFilesOptions = {
52
+ onScanDebug?: (event: ScanDebugEvent) => void;
53
+ };
54
+
55
+ /** Shared hard cap for translation worker concurrency across core and hosts. */
56
+ declare const TRANSLATE_WORKERS_CAP = 64;
57
+ /**
58
+ * Environment variable **names** consumed by the translator. Hosts pass an `env` map; core never
59
+ * touches `process.*`. Keep these co-located with the constants the resolvers read.
60
+ */
61
+ declare const ENV_TRANSLATE_MAX_WORKERS: "I18NPRUNE_TRANSLATE_MAX_WORKERS";
62
+ declare const ENV_TRANSLATE_PROVIDER: "I18NPRUNE_TRANSLATE_PROVIDER";
63
+ declare const ENV_TRANSLATE_DEEPL_API_KEY: "I18NPRUNE_TRANSLATE_DEEPL_API_KEY";
64
+ declare const ENV_TRANSLATE_LIBRE_URL: "I18NPRUNE_TRANSLATE_LIBRE_URL";
65
+ declare const ENV_TRANSLATE_LLM_API_KEY: "I18NPRUNE_TRANSLATE_LLM_API_KEY";
66
+ declare const ENV_TRANSLATE_LLM_BASE_URL: "I18NPRUNE_TRANSLATE_LLM_BASE_URL";
67
+ declare const ENV_TRANSLATE_LLM_MODEL: "I18NPRUNE_TRANSLATE_LLM_MODEL";
68
+ type TranslatorEnv = Readonly<Record<string, string | undefined>>;
69
+
70
+ /** Global CLI run flags surfaced on `Context.run`. */
71
+ type RunOptions = {
72
+ json: boolean;
73
+ /** Pretty-print JSON envelopes when `--json` is enabled. */
74
+ jsonPretty: boolean;
75
+ /** Less non-essential output. */
76
+ quiet: boolean;
77
+ /** Suppress informational and warning lines; still emit errors. */
78
+ silent: boolean;
79
+ /**
80
+ * When true, the CLI registers {@link RunOptions.onScanDebug} to print scan skip events to stderr.
81
+ * Hosts may set this for their own UX without wiring a sink.
82
+ */
83
+ debugScan: boolean;
84
+ /** When true, the CLI may print report-cache dispatch/invalidation diagnostics. */
85
+ debugCache: boolean;
86
+ /**
87
+ * When set and {@link RunOptions.silent} is false, the scanner invokes this for each skip
88
+ * (directory walk skip, file excluded, non-source extension). Core never uses `console`;
89
+ * the Node CLI assigns a listener that formats lines to stderr when `--debug-scan` is on
90
+ * (the sink may still choose to suppress output when {@link RunOptions.quiet} is true).
91
+ */
92
+ onScanDebug?: (event: ScanDebugEvent) => void;
93
+ };
94
+
95
+ /** File-level diff between a baseline and the current scan, used for `--debug-cache` output. */
96
+ type CacheFileDelta = {
97
+ added: string[];
98
+ changed: string[];
99
+ deleted: string[];
100
+ unchanged: string[];
101
+ };
102
+
103
+ /** Whether the on-disk `files.json` index is usable as a diff baseline. */
104
+ type FilesIndexStatus = {
105
+ kind: 'ok';
106
+ } | {
107
+ kind: 'missing';
108
+ } | {
109
+ kind: 'malformed';
110
+ } | {
111
+ kind: 'empty';
112
+ };
113
+ declare function filesIndexIsUsable(status: FilesIndexStatus): boolean;
114
+
115
+ type CacheRebuildMode = 'partial' | 'full';
116
+ type AnalysisRebuildStrategy = 'full' | 'partial' | 'reuse';
117
+ type CacheRebuildConfig = {
118
+ rebuild: CacheRebuildMode;
119
+ fullRescanThresholdPercent: number;
120
+ };
121
+ type ClassifiedSrcDelta = {
122
+ added: string[];
123
+ changed: string[];
124
+ deleted: string[];
125
+ };
126
+ type ClassifiedCacheFileDelta = {
127
+ src: ClassifiedSrcDelta;
128
+ sourceLocale: string[];
129
+ targetLocale: string[];
130
+ layoutChanged: boolean;
131
+ filesIndexStatus: FilesIndexStatus;
132
+ };
133
+ type AnalysisRebuildReason = 'config_rebuild_full' | 'layout_changed' | 'source_locale_changed' | 'source_locale_partial' | 'target_locale_only' | 'locale_or_non_src_changed' | 'no_previous_cache' | 'src_threshold' | 'src_partial' | 'files_index_missing' | 'files_index_malformed' | 'files_index_empty' | 'files_index_stale' | 'files_index_recovered';
134
+ type AnalysisRebuildDecision = {
135
+ strategy: AnalysisRebuildStrategy;
136
+ reason: AnalysisRebuildReason;
137
+ thresholdPercent?: number;
138
+ srcAffected?: number;
139
+ trackedSrcCount?: number;
140
+ /** Present on miss when src bucket was classified (debug-cache detail). */
141
+ srcDelta?: ClassifiedSrcDelta;
142
+ };
143
+ /** Context passed to `CachedProjectInput.producer` on cache miss. */
144
+ type CacheProducerContext<T> = {
145
+ delta: CacheFileDelta;
146
+ classified: ClassifiedCacheFileDelta;
147
+ previous?: T;
148
+ trackedSrcCount: number;
149
+ rebuildConfig: CacheRebuildConfig;
150
+ analysisRebuild?: AnalysisRebuildDecision;
151
+ };
152
+
153
+ /** Resolved filesystem layout for locale bundle I/O (after defaults). */
154
+ type LocalesLayoutMode = NonNullable<LocalesFilesystemConfig['mode']>;
155
+ type LocalesLayoutStructure = NonNullable<LocalesFilesystemConfig['structure']>;
156
+ /**
157
+ * Normalized layout descriptor passed to {@link readLocaleBundle} / {@link writeLocaleBundle}.
158
+ *
159
+ * @remarks `directoryAbsolute` is the configured bundle root (`paths.localesDir` on core context).
160
+ */
161
+ type ResolvedLocalesLayout = {
162
+ mode: LocalesLayoutMode;
163
+ structure: LocalesLayoutStructure;
164
+ directoryAbsolute: string;
165
+ config: LocalesFilesystemConfig;
166
+ };
167
+
168
+ /** Layout fingerprint stored in `files.json` (`mode` + `structure` + config paths). */
169
+ type CachedLocalesLayout = {
170
+ mode: LocalesLayoutMode;
171
+ structure: LocalesLayoutStructure;
172
+ directory: string;
173
+ source: string;
174
+ };
175
+
176
+ /** Per-file hash/size/mtime record stored in `files.json`. */
177
+ type CacheProjectFileRecord = {
178
+ hash: string;
179
+ size: number;
180
+ mtimeMs: number;
181
+ updatedAt: string;
182
+ };
183
+
184
+ /** Why the cache was disabled for this run (or `'default'` when enabled normally). */
185
+ type CacheDisableReason = 'default' | 'cli_no_cache' | 'config_disabled' | 'project_root_missing' | 'cache_dir_unavailable' | 'cache_io_error' | 'cache_oversize' | 'cache_malformed' | 'cache_read_only';
186
+ /** Resolved cache paths and flags for the current run, produced by `initializeCacheState`. */
187
+ type CacheState = {
188
+ enabled: boolean;
189
+ reason: CacheDisableReason;
190
+ rootDir: string;
191
+ metaPath: string;
192
+ projectId: string;
193
+ projectRoot: string;
194
+ projectDir: string;
195
+ filesPath: string;
196
+ /** Project scan payload (`analysis.json`). */
197
+ analysisPath: string;
198
+ /** Per-target translation cache directory (`translations/`). */
199
+ translationsDir: string;
200
+ /** When true, cache reads are allowed but project cache files are not written. */
201
+ readOnly: boolean;
202
+ };
203
+ /** Non-fatal diagnostic emitted when a cache file is corrupt, oversized, or inaccessible. */
204
+ type CacheWarning = {
205
+ code: CacheDisableReason;
206
+ message: string;
207
+ path?: string;
208
+ };
209
+ type CacheProjectsIndex = {
210
+ version: number;
211
+ updatedAt: string;
212
+ projects: Record<string, string>;
213
+ maintenance: {
214
+ runCount: number;
215
+ healEveryRuns: number;
216
+ lastHealAt?: string;
217
+ };
218
+ };
219
+ type CacheProjectFilesState = {
220
+ version: number;
221
+ updatedAt: string;
222
+ files: Record<string, CacheProjectFileRecord>;
223
+ /** Bundle-relative locale segment paths allowed by `localesLayout`. */
224
+ localeSegments?: Record<string, CacheProjectFileRecord>;
225
+ localesLayout?: CachedLocalesLayout;
226
+ };
227
+ type CacheProjectRunState = {
228
+ version: number;
229
+ updatedAt: string;
230
+ projectId: string;
231
+ data: unknown;
232
+ /**
233
+ * Digest of the tracked `files.json` map when `data` was produced. Compared on cache hit so an
234
+ * older `analysis.json` cannot serve after `files.json` was refreshed.
235
+ */
236
+ inputFilesEpoch?: string;
237
+ };
238
+ type CacheDispatchStatus = 'hit' | 'miss' | 'bypass' | 'disabled';
239
+ type CacheDispatchReason = 'cache_hit' | 'no_cache' | 'cache_unavailable' | 'run_missing' | 'files_changed' | 'files_index_recovered' | 'run_binding_stale' | 'producer_succeeded' | 'run_invalid';
240
+ type CacheHashText = (text: string) => string;
241
+ /** Host-injected IO adapters and utilities used by all cache operations. */
242
+ type CacheRuntime = {
243
+ fs: RuntimeFsPort;
244
+ path: RuntimePathPort;
245
+ system: RuntimeSystemPort;
246
+ hashText?: CacheHashText;
247
+ byteLength?: (text: string) => number;
248
+ fileSize?: (filePath: string) => number | undefined;
249
+ writeTextAtomic?: (filePath: string, content: string) => void;
250
+ deleteDir?: (dirPath: string) => void;
251
+ };
252
+ type CacheStateInput = {
253
+ projectRoot: string;
254
+ cacheRootDir: string;
255
+ noCache?: boolean;
256
+ disabledReason?: CacheDisableReason;
257
+ runtime: CacheRuntime;
258
+ /** When true, treat cache as read-through: no writes to project cache files. */
259
+ cacheReadOnly?: boolean;
260
+ };
261
+ type CacheDispatchPaths = {
262
+ meta: string;
263
+ files: string;
264
+ analysis: string;
265
+ projectDir: string;
266
+ };
267
+ /** When a miss is due to `run_binding_stale`, surfaces what `--debug-cache` should compare. */
268
+ type CacheInputFilesEpochDebug = {
269
+ cached?: string;
270
+ current: string;
271
+ };
272
+ /** Result metadata from a single cache dispatch (hit/miss, reason, delta, warnings). */
273
+ type CacheDispatchInfo = {
274
+ status: CacheDispatchStatus;
275
+ reason: CacheDispatchReason;
276
+ warnings: CacheWarning[];
277
+ delta?: CacheFileDelta;
278
+ paths?: CacheDispatchPaths;
279
+ inputFilesEpochDebug?: CacheInputFilesEpochDebug;
280
+ /** Set when analysis was rebuilt on miss (`--debug-cache` surfaces strategy). */
281
+ analysisRebuild?: AnalysisRebuildDecision;
282
+ /** Set when `files.json` was missing, malformed, or empty on load. */
283
+ filesIndexStatus?: FilesIndexStatus;
284
+ };
285
+ type CacheDispatchResult<T> = {
286
+ data: T;
287
+ cache: CacheDispatchInfo;
288
+ };
289
+ /** Input bag for `getOrBuildCachedProjectData` — describes what to cache and how to validate it. */
290
+ type CachedProjectInput<T> = {
291
+ state: CacheState;
292
+ runtime: CacheRuntime;
293
+ sourceLocalePath: string;
294
+ srcRoot: string;
295
+ localesDir: string;
296
+ locales: LocalesFilesystemConfig;
297
+ exclude?: ScanExcludeConfig;
298
+ producer: (ctx?: CacheProducerContext<T>) => T;
299
+ parseCachedData?: (data: unknown) => {
300
+ ok: true;
301
+ data: T;
302
+ } | {
303
+ ok: false;
304
+ };
305
+ rebuildConfig?: CacheRebuildConfig;
306
+ /**
307
+ * Pre-loaded `files.json` baseline from before any dispatch in this run. When provided, the
308
+ * delta is computed against these records so writes during the run do not mask real file changes.
309
+ */
310
+ baselineFiles?: Record<string, CacheProjectFileRecord>;
311
+ };
312
+
313
+ /** Severity for {@link LocaleReadDiagnostic} (hosts map to log level / UI). */
314
+ type LocaleReadDiagnosticLevel = 'info' | 'warn' | 'error';
315
+ /**
316
+ * Structured locale I/O signal from the shared locale reader layer (no `console.*` in core).
317
+ *
318
+ * @remarks Hosts (CLI, extension) subscribe via `onDiagnostic` or inspect `diagnostics[]` on results.
319
+ */
320
+ type LocaleReadDiagnostic = {
321
+ level: LocaleReadDiagnosticLevel;
322
+ /** Stable machine id for filtering (not a CLI `--json` issue code unless wired explicitly). */
323
+ code: string;
324
+ message: string;
325
+ path?: string;
326
+ };
327
+
328
+ /** Cached read result for one on-disk locale segment file (absolute path key). */
329
+ type LocaleSegmentReadSnapshot = {
330
+ ok: true;
331
+ absolutePath: string;
332
+ document: unknown;
333
+ leaves: TranslationSurfaceLeaf[];
334
+ text: string;
335
+ } | {
336
+ ok: false;
337
+ absolutePath: string;
338
+ diagnostics: LocaleReadDiagnostic[];
339
+ };
340
+ /** Merged translation-surface leaves for one locale code (all segments when multi-file). */
341
+ type LocaleCodeReadSnapshot = {
342
+ localeCode: string;
343
+ document: unknown;
344
+ leaves: TranslationSurfaceLeaf[];
345
+ };
346
+ /**
347
+ * In-memory locale read store for one command / {@link CoreContext} lifetime.
348
+ * Segment entries hold reader output with full {@link TranslationSurfaceLeaf} identity;
349
+ * locale-code entries hold merged leaves for multi-segment layouts.
350
+ */
351
+ type LocaleReadCache = {
352
+ readonly segments: Map<string, LocaleSegmentReadSnapshot>;
353
+ readonly localeCodes: Map<string, LocaleCodeReadSnapshot>;
354
+ };
355
+
356
+ /** Resolved project paths (absolute); hosts compute once (CLI: `resolveContext`). */
357
+ type CoreResolvedPaths = {
358
+ readonly sourceLocale: string;
359
+ readonly localesDir: string;
360
+ readonly srcRoot: string;
361
+ };
362
+ /**
363
+ * L2 bundle for project ops (`runValidate`, `runSync`, `runGenerate`, …). Same adapters/env rules as
364
+ * {@link TranslateContext}: required, no runtime defaults inside core.
365
+ */
366
+ type CoreContext = {
367
+ readonly config: I18nPruneConfig;
368
+ readonly adapters: RuntimeAdapters;
369
+ readonly env: TranslatorEnv;
370
+ readonly paths: CoreResolvedPaths;
371
+ /**
372
+ * When **`false`**, no **`i18nprune.config.*`** was found on disk (CLI: **`configExists()`**).
373
+ * Hosts omit this field when unknown; **`runProjectReadiness`** only enforces **`configFilePresent`**
374
+ * when **`configFileLoaded === false`**.
375
+ */
376
+ readonly configFileLoaded?: boolean;
377
+ readonly run?: RunOptions;
378
+ readonly cache?: {
379
+ readonly state: CacheState;
380
+ readonly runtime: CacheRuntime;
381
+ /** Pre-loaded `files.json` baseline; shared across sibling dispatches for accurate delta. */
382
+ readonly baselineFiles?: Record<string, CacheProjectFileRecord>;
383
+ };
384
+ /** Per-run in-memory locale JSON reads (segment + merged locale-code views). */
385
+ readonly localeRead: LocaleReadCache;
386
+ };
387
+
388
+ export { ENV_TRANSLATE_PROVIDER as $, type AnalysisRebuildDecision as A, type CachedProjectInput as B, type CoreContext as C, type ClassifiedCacheFileDelta as D, type ClassifiedSrcDelta as E, type FilesIndexStatus as F, type LocaleCodeReadSnapshot as G, type LocaleReadCache as H, type LocaleReadDiagnosticLevel as I, type LocaleSegmentReadSnapshot as J, type LocalesLayoutMode as K, type LocaleReadDiagnostic as L, type LocalesLayoutStructure as M, type RunOptions as N, type ScanDebugSkipDirectoryEvent as O, type ScanDebugSkipFileEvent as P, type TranslationSurfaceShape as Q, type ResolvedLocalesLayout as R, type ScanDebugEvent as S, type TranslationSurfaceLeaf as T, filesIndexIsUsable as U, ENV_TRANSLATE_DEEPL_API_KEY as V, ENV_TRANSLATE_LIBRE_URL as W, ENV_TRANSLATE_LLM_API_KEY as X, ENV_TRANSLATE_LLM_BASE_URL as Y, ENV_TRANSLATE_LLM_MODEL as Z, ENV_TRANSLATE_MAX_WORKERS as _, type TranslatorEnv as a, TRANSLATE_WORKERS_CAP as a0, type CacheWarning as b, type CoreResolvedPaths as c, type CacheRebuildMode as d, type CacheProjectFileRecord as e, type CachedLocalesLayout as f, type CacheRebuildConfig as g, type ListSourceFilesOptions as h, type CacheDispatchInfo as i, type CacheDispatchStatus as j, type AnalysisRebuildReason as k, type AnalysisRebuildStrategy as l, type CacheDisableReason as m, type CacheDispatchPaths as n, type CacheDispatchReason as o, type CacheDispatchResult as p, type CacheFileDelta as q, type CacheHashText as r, type CacheInputFilesEpochDebug as s, type CacheProducerContext as t, type CacheProjectFilesState as u, type CacheProjectRunState as v, type CacheProjectsIndex as w, type CacheRuntime as x, type CacheState as y, type CacheStateInput as z };
@@ -0,0 +1,20 @@
1
+ type RuntimeDirEntry = {
2
+ name: string;
3
+ kind: 'file' | 'directory' | 'other';
4
+ };
5
+ type RuntimeFsPathKind = RuntimeDirEntry['kind'] | 'missing';
6
+ type RuntimeReadFsPort = {
7
+ exists: (filePath: string) => boolean | Promise<boolean>;
8
+ readText: (filePath: string) => string | Promise<string>;
9
+ };
10
+ type RuntimeFsPort = RuntimeReadFsPort & {
11
+ statKind: (filePath: string) => RuntimeFsPathKind | Promise<RuntimeFsPathKind>;
12
+ listDir: (dirPath: string) => RuntimeDirEntry[] | Promise<RuntimeDirEntry[]>;
13
+ writeText: (filePath: string, content: string) => void | Promise<void>;
14
+ deleteFile: (filePath: string) => void | Promise<void>;
15
+ mkdirp: (dirPath: string) => void | Promise<void>;
16
+ /** When set, returns the canonical path for cycle-safe directory walks (Node: `fs.realpathSync`). */
17
+ realpath?: (filePath: string) => string;
18
+ };
19
+
20
+ export type { RuntimeFsPort as R, RuntimeDirEntry as a, RuntimeReadFsPort as b, RuntimeFsPathKind as c };