@animus-ui/extract 0.1.9 → 0.1.12

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 (158) hide show
  1. package/README.md +48 -1
  2. package/crates/extract-v2/animus-extract-v2.darwin-arm64.node +0 -0
  3. package/crates/extract-v2/animus-extract-v2.linux-arm64-gnu.node +0 -0
  4. package/crates/extract-v2/animus-extract-v2.linux-x64-gnu.node +0 -0
  5. package/crates/extract-v2/index.d.ts +17 -98
  6. package/dist/index.cjs +78 -2101
  7. package/dist/index.mjs +2 -2026
  8. package/dist/{analyze-project-args.d.ts → pipeline/analyze-project-args.d.ts} +0 -12
  9. package/dist/pipeline/analyze-project-args.d.ts.map +1 -0
  10. package/dist/pipeline/assemble-stylesheet.d.ts +23 -0
  11. package/dist/pipeline/assemble-stylesheet.d.ts.map +1 -0
  12. package/dist/pipeline/asset-placeholders.d.ts +4 -0
  13. package/dist/pipeline/asset-placeholders.d.ts.map +1 -0
  14. package/dist/pipeline/content-hash.d.ts +2 -0
  15. package/dist/pipeline/content-hash.d.ts.map +1 -0
  16. package/dist/pipeline/core-options.d.ts +96 -0
  17. package/dist/pipeline/core-options.d.ts.map +1 -0
  18. package/dist/pipeline/correlate-external-tokens.d.ts +38 -0
  19. package/dist/pipeline/correlate-external-tokens.d.ts.map +1 -0
  20. package/dist/pipeline/discover-files.d.ts +4 -0
  21. package/dist/pipeline/discover-files.d.ts.map +1 -0
  22. package/dist/pipeline/discover-packages.d.ts +55 -0
  23. package/dist/pipeline/discover-packages.d.ts.map +1 -0
  24. package/dist/pipeline/dynamic-prop-config.d.ts +22 -0
  25. package/dist/pipeline/dynamic-prop-config.d.ts.map +1 -0
  26. package/dist/pipeline/engine-adapter.d.ts +63 -0
  27. package/dist/pipeline/engine-adapter.d.ts.map +1 -0
  28. package/dist/pipeline/engine-retirement.d.ts +3 -0
  29. package/dist/pipeline/engine-retirement.d.ts.map +1 -0
  30. package/dist/pipeline/error-diagnostics.d.ts +8 -0
  31. package/dist/pipeline/error-diagnostics.d.ts.map +1 -0
  32. package/dist/{index.d.ts → pipeline/index.d.ts} +16 -6
  33. package/dist/pipeline/index.d.ts.map +1 -0
  34. package/dist/pipeline/internal-wire.d.ts +2 -0
  35. package/dist/pipeline/internal-wire.d.ts.map +1 -0
  36. package/dist/pipeline/manifest-diagnostics.d.ts +57 -0
  37. package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -0
  38. package/dist/pipeline/manifest-schema.d.ts +117 -0
  39. package/dist/pipeline/manifest-schema.d.ts.map +1 -0
  40. package/dist/pipeline/mdx-preprocessor.d.ts +25 -0
  41. package/dist/pipeline/mdx-preprocessor.d.ts.map +1 -0
  42. package/dist/pipeline/path-aliases.d.ts +15 -0
  43. package/dist/pipeline/path-aliases.d.ts.map +1 -0
  44. package/dist/{post-process-css.d.ts → pipeline/post-process-css.d.ts} +0 -8
  45. package/dist/pipeline/post-process-css.d.ts.map +1 -0
  46. package/dist/pipeline/prefix.d.ts +8 -0
  47. package/dist/pipeline/prefix.d.ts.map +1 -0
  48. package/dist/pipeline/replacement-plans.d.ts +22 -0
  49. package/dist/pipeline/replacement-plans.d.ts.map +1 -0
  50. package/dist/pipeline/resolve-asset.d.ts +11 -0
  51. package/dist/pipeline/resolve-asset.d.ts.map +1 -0
  52. package/dist/pipeline/run-analysis.d.ts +62 -0
  53. package/dist/pipeline/run-analysis.d.ts.map +1 -0
  54. package/dist/pipeline/source-corpus.d.ts +25 -0
  55. package/dist/pipeline/source-corpus.d.ts.map +1 -0
  56. package/dist/pipeline/source-identity.d.ts +63 -0
  57. package/dist/pipeline/source-identity.d.ts.map +1 -0
  58. package/dist/pipeline/source-ingestion.d.ts +168 -0
  59. package/dist/pipeline/source-ingestion.d.ts.map +1 -0
  60. package/dist/pipeline/static-css.d.ts +16 -0
  61. package/dist/pipeline/static-css.d.ts.map +1 -0
  62. package/dist/pipeline/structural-self-check.d.ts +12 -0
  63. package/dist/pipeline/structural-self-check.d.ts.map +1 -0
  64. package/dist/pipeline/svelte-source-adapter.d.ts +81 -0
  65. package/dist/pipeline/svelte-source-adapter.d.ts.map +1 -0
  66. package/dist/pipeline/system-config.d.ts +40 -0
  67. package/dist/pipeline/system-config.d.ts.map +1 -0
  68. package/dist/pipeline/system-props-module.d.ts +8 -0
  69. package/dist/pipeline/system-props-module.d.ts.map +1 -0
  70. package/dist/pipeline/timing-waterfall.d.ts +6 -0
  71. package/dist/pipeline/timing-waterfall.d.ts.map +1 -0
  72. package/dist/pipeline/tsconfig-paths.d.ts +7 -0
  73. package/dist/pipeline/tsconfig-paths.d.ts.map +1 -0
  74. package/dist/pipeline/unit-fallback.d.ts +2 -0
  75. package/dist/pipeline/unit-fallback.d.ts.map +1 -0
  76. package/dist/pipeline/utils.d.ts +3 -0
  77. package/dist/pipeline/utils.d.ts.map +1 -0
  78. package/dist/pipeline/watch-keys.d.ts +2 -0
  79. package/dist/pipeline/watch-keys.d.ts.map +1 -0
  80. package/dist/pipeline-DeEENy5C.mjs +2905 -0
  81. package/dist/pipeline-x1yBZ2UP.cjs +3386 -0
  82. package/dist/session/extraction-session.d.ts +240 -0
  83. package/dist/session/extraction-session.d.ts.map +1 -0
  84. package/dist/session/index.d.ts +10 -0
  85. package/dist/session/index.d.ts.map +1 -0
  86. package/dist/session/published-set.d.ts +52 -0
  87. package/dist/session/published-set.d.ts.map +1 -0
  88. package/dist/session/resolve-packages.d.ts +7 -0
  89. package/dist/session/resolve-packages.d.ts.map +1 -0
  90. package/dist/session/session-paths.d.ts +97 -0
  91. package/dist/session/session-paths.d.ts.map +1 -0
  92. package/dist/session/singleton.d.ts +85 -0
  93. package/dist/session/singleton.d.ts.map +1 -0
  94. package/dist/session/timing.d.ts +2 -0
  95. package/dist/session/timing.d.ts.map +1 -0
  96. package/dist/session/turbopack-orchestrator.d.ts +27 -0
  97. package/dist/session/turbopack-orchestrator.d.ts.map +1 -0
  98. package/dist/session.cjs +1999 -0
  99. package/dist/session.mjs +1955 -0
  100. package/index-v2.js +0 -9
  101. package/package.json +22 -9
  102. package/dist/analyze-project-args.d.ts.map +0 -1
  103. package/dist/assemble-stylesheet.d.ts +0 -58
  104. package/dist/assemble-stylesheet.d.ts.map +0 -1
  105. package/dist/asset-placeholders.d.ts +0 -29
  106. package/dist/asset-placeholders.d.ts.map +0 -1
  107. package/dist/content-hash.d.ts +0 -9
  108. package/dist/content-hash.d.ts.map +0 -1
  109. package/dist/correlate-external-tokens.d.ts +0 -46
  110. package/dist/correlate-external-tokens.d.ts.map +0 -1
  111. package/dist/discover-files.d.ts +0 -10
  112. package/dist/discover-files.d.ts.map +0 -1
  113. package/dist/discover-packages.d.ts +0 -192
  114. package/dist/discover-packages.d.ts.map +0 -1
  115. package/dist/dynamic-prop-config.d.ts +0 -37
  116. package/dist/dynamic-prop-config.d.ts.map +0 -1
  117. package/dist/engine-adapter.d.ts +0 -97
  118. package/dist/engine-adapter.d.ts.map +0 -1
  119. package/dist/engine-retirement.d.ts +0 -22
  120. package/dist/engine-retirement.d.ts.map +0 -1
  121. package/dist/error-diagnostics.d.ts +0 -32
  122. package/dist/error-diagnostics.d.ts.map +0 -1
  123. package/dist/external-keyframes.d.ts +0 -23
  124. package/dist/external-keyframes.d.ts.map +0 -1
  125. package/dist/index.d.ts.map +0 -1
  126. package/dist/manifest-diagnostics.d.ts +0 -62
  127. package/dist/manifest-diagnostics.d.ts.map +0 -1
  128. package/dist/mdx-preprocessor.d.ts +0 -39
  129. package/dist/mdx-preprocessor.d.ts.map +0 -1
  130. package/dist/path-aliases.d.ts +0 -34
  131. package/dist/path-aliases.d.ts.map +0 -1
  132. package/dist/post-process-css.d.ts.map +0 -1
  133. package/dist/prefix.d.ts +0 -15
  134. package/dist/prefix.d.ts.map +0 -1
  135. package/dist/replacement-plans.d.ts +0 -46
  136. package/dist/replacement-plans.d.ts.map +0 -1
  137. package/dist/resolve-asset.d.ts +0 -14
  138. package/dist/resolve-asset.d.ts.map +0 -1
  139. package/dist/run-analysis.d.ts +0 -74
  140. package/dist/run-analysis.d.ts.map +0 -1
  141. package/dist/source-identity.d.ts +0 -93
  142. package/dist/source-identity.d.ts.map +0 -1
  143. package/dist/static-css.d.ts +0 -25
  144. package/dist/static-css.d.ts.map +0 -1
  145. package/dist/system-config.d.ts +0 -57
  146. package/dist/system-config.d.ts.map +0 -1
  147. package/dist/system-props-module.d.ts +0 -22
  148. package/dist/system-props-module.d.ts.map +0 -1
  149. package/dist/timing-waterfall.d.ts +0 -17
  150. package/dist/timing-waterfall.d.ts.map +0 -1
  151. package/dist/tsconfig-paths.d.ts +0 -8
  152. package/dist/tsconfig-paths.d.ts.map +0 -1
  153. package/dist/unit-fallback.d.ts +0 -7
  154. package/dist/unit-fallback.d.ts.map +0 -1
  155. package/dist/utils.d.ts +0 -3
  156. package/dist/utils.d.ts.map +0 -1
  157. package/dist/watch-keys.d.ts +0 -12
  158. package/dist/watch-keys.d.ts.map +0 -1
@@ -0,0 +1,240 @@
1
+ import type { AnimusCoreOptions, ExternalPackageOutcome } from '../pipeline/index';
2
+ export type SessionOptions = AnimusCoreOptions;
3
+ import type { SourceCorpus } from '../pipeline/index';
4
+ /** Default watcher debounce and the session's status-deadline ceiling.
5
+ * The watcher entry point defaults its debounce from this — one definition. */
6
+ export declare const DEFAULT_WATCH_DEBOUNCE_MS = 75;
7
+ export interface WatchChanges {
8
+ modifiedFiles?: ReadonlySet<string>;
9
+ removedFiles?: ReadonlySet<string>;
10
+ }
11
+ /** Bundler-agnostic extraction pipeline: system load, source ingestion,
12
+ * analysis, emission, and watch-cycle diffing. Carries no bundler types. */
13
+ export declare class ExtractionSession {
14
+ /** Set by the adapter before any pipeline run. */
15
+ rootDir: string | null;
16
+ /** Serialized path aliases, harvested by the adapter from bundler config. */
17
+ pathAliasesJson: string | null;
18
+ private assetCopyCache;
19
+ /** Physical asset files registered with the host watcher. */
20
+ assetDependencyPaths: Set<string>;
21
+ private assetDependencyKeys;
22
+ /** System-props module id override. Turbopack rejects absolute-path
23
+ * imports, so its driver sets a virtual id; null injects the abs path. */
24
+ systemPropsModuleId: string | null;
25
+ /** Whether the analysis-inputs hydration corpus is written to disk. Only
26
+ * isolated loader workers replay it; an in-process loader reads memory. */
27
+ persistAnalysisInputs: boolean;
28
+ /** Absolute directory prefixes for external packages (loader allowlist). */
29
+ externalPackageDirs: string[];
30
+ /** Absolute package dir → owning specifier (cross-source correlation). */
31
+ private externalDirOwners;
32
+ /** rootDir-relative external file → owning specifier (correlation join). */
33
+ private externalFileOwners;
34
+ /** External package specifier → absolute source entry path. */
35
+ externalSourceEntries: Map<string, string>;
36
+ /** SourceId authority for this generation — roots realpath'd once per
37
+ * pipeline; aliases recorded while files exist so deletions resolve. */
38
+ private sourceIdentity;
39
+ /** Canonical admitted external root → declared specifiers; duplicate
40
+ * specifiers resolving to one canonical root share an entry. */
41
+ externalRootOwners: Map<string, Set<string>>;
42
+ /** Canonical external root → the extension set its collection walk used
43
+ * (widened for dist-only roots); rewalks and classification share it. */
44
+ private externalRootExtensions;
45
+ /** Canonical admitted external watch roots — the engine-side watch
46
+ * surface (webpack contextDependencies / Turbopack watchers). */
47
+ externalWatchRoots: string[];
48
+ /** Canonical external root → sourceKey → {raw content hash, recorded abs}:
49
+ * the inventory a dirty-root rewalk diffs against, hashed before MDX. */
50
+ private externalInventory;
51
+ /** Stable key → message, re-surfaced on every full pipeline until the
52
+ * underlying condition clears. */
53
+ readonly stickyDiagnostics: Map<string, string>;
54
+ /** Volume-membership predicate for the cross-volume gate. Injected seam:
55
+ * the real predicate only discriminates on Windows, so tests replace it. */
56
+ sharesProjectVolume: (projectRoot: string, externalRoot: string) => boolean;
57
+ /** `onExternalRootResolved` fires per admitted root DURING collection,
58
+ * before its walk; `onExternalRootsCommitted` only after publication. */
59
+ onExternalRootResolved: ((canonicalRoot: string) => void) | null;
60
+ onExternalRootsCommitted: ((canonicalRoots: string[]) => void) | null;
61
+ /** Fires exactly once per settled `handleWatchUpdate` — the failure cause,
62
+ * or null when clean. Observation never alters delivery. */
63
+ onCycleSettled: ((cause: unknown) => void) | null;
64
+ private readonly options;
65
+ private readonly staticCssJson;
66
+ private system;
67
+ /** Vocabulary witness diagnostics from the sealed system's registration
68
+ * record, awaiting the shared surfacing pass. */
69
+ private systemVocabularyDiagnostics;
70
+ /** Configured external files that could not be read. Incremental passes
71
+ * re-collect nothing, so they replay these instead of passing strict. */
72
+ private ingestionFailureDiagnostics;
73
+ /** Full package-resolution map from the last full pipeline — replayed by
74
+ * incremental passes (sourceEntries alone omits dist-resolved packages). */
75
+ private lastPackageMap;
76
+ private fileCache;
77
+ readonly corpus: SourceCorpus;
78
+ private systemDependencyKeys;
79
+ /** Loader-reported dependency paths for bundler watch registration. */
80
+ systemDependencyPaths: string[];
81
+ private systemDependencyHashes;
82
+ private lastSystemPropsHash;
83
+ private artifactRecords;
84
+ /** Last written analysis-commit; null seeds from disk on first use. Its
85
+ * generation counter is correct only because one session owns the dir. */
86
+ private lastCommit;
87
+ /** Release handle for the in-process owner slot AND the directory's
88
+ * on-disk owner record, taken and released as one; null when unheld. */
89
+ private releasePublicationClaim;
90
+ /** Session identity, claimed once per PROCESS and adopted by every later
91
+ * session instance so all compilers share one artifact tree. */
92
+ readonly sessionId: string;
93
+ /** Epoch of the last published analysis; null seeds from disk so a
94
+ * same-session restart with unchanged plans rewrites no bytes. */
95
+ private lastEpochValue;
96
+ /** Watcher debounce ceiling feeding status deadlines. */
97
+ debounceCeilingMs: number;
98
+ /** Test seam: observes every session-artifact write (name, content)
99
+ * post-rename — write ORDER is part of the transaction contract. */
100
+ onArtifactWrite: ((name: string, content: string) => void) | null;
101
+ private statusAttemptId;
102
+ private statusAttemptOpen;
103
+ /** Monotonic readiness witness: flips true on the first complete
104
+ * publication and never regresses; every later status write carries it. */
105
+ private firstEmissionComplete;
106
+ /** Debounce-window observations pending analysis (sourceKey → hash). */
107
+ private debouncePending;
108
+ private sessionStartHygieneDone;
109
+ private lcssTargets;
110
+ constructor(options: SessionOptions);
111
+ get sessionDir(): string;
112
+ get verbose(): boolean;
113
+ private log;
114
+ private warn;
115
+ private now;
116
+ private elapsed;
117
+ /** Diagnostic prefix label — drivers set their own so one host's errors
118
+ * never masquerade as another driver's. */
119
+ driverLabel: string;
120
+ /** Per-specifier discovery outcomes from the last full collection —
121
+ * driver-consumed reporting surface (the CLI's summary). */
122
+ lastExternalOutcomes: ExternalPackageOutcome[];
123
+ /** Component count of the last published analysis, null before the first —
124
+ * read by drivers instead of re-parsing the manifest JSON every cycle. */
125
+ lastComponentCount: number | null;
126
+ /** When superseded asset copies leave `assets/`: `'full-pipeline'` suits a
127
+ * driver serving the dir in place, `'every-cycle'` one republishing it. */
128
+ staleAssetPruning: 'full-pipeline' | 'every-cycle';
129
+ /** Driver-owned STRUCTURAL exclusions, joined to the never-replaceable set
130
+ * — never the user list, whose presence flips the replace semantics. */
131
+ structuralExclude: string[];
132
+ private scanConfigMemo;
133
+ /** Per-pattern exclusion hit counts from this session's matcher —
134
+ * driver-consumed reporting surface (dead-pattern visibility). */
135
+ getExcludeStats(): ReadonlyMap<string, number>;
136
+ /** Resolve the scan configuration from options — the single source of the
137
+ * exclude/extension policy shared by the full and incremental pipelines. */
138
+ private resolveScanConfig;
139
+ /** One single-flight analysis transaction per event batch: concurrent
140
+ * entries join the in-flight promise; each settled entry reports outcome. */
141
+ handleWatchUpdate(changes: WatchChanges): Promise<void>;
142
+ private routeWatchUpdate;
143
+ /** Owner-side entry for a batch a non-owning compiler observed. Serializes
144
+ * behind any in-flight transaction — it has no other delivery. */
145
+ ingestForwardedBatch(changes: WatchChanges): Promise<void>;
146
+ private processWatchUpdate;
147
+ private publishSourceIngestion;
148
+ /** Full analysis + publication, registered in the one in-flight
149
+ * transaction slot; a nested reload leaves the enclosing registration. */
150
+ runFullPipeline(pending?: Array<[string, string]>): Promise<void>;
151
+ private runPipelineTransaction;
152
+ /** Per-generation source state captured as ONE object so the restore
153
+ * cannot omit a member; deep-copied fields are mutated in place. */
154
+ private snapshotSourceState;
155
+ private restoreSourceState;
156
+ /** Release this session's publication claim so a successor may publish.
157
+ * Idempotent, and scoped to this session's own claim. */
158
+ close(): void;
159
+ /** Reset analysis state for a system reload: write guards go back to null
160
+ * and reseed from the disk envelopes on the next publication. */
161
+ resetForHmr(): void;
162
+ /** The (sourceKey, observed hash) pairs of a watch batch — the status
163
+ * file's pending set; loaders wait only on observed inputs. */
164
+ private pendingFromBatch;
165
+ /** Rewalk dirty external roots and diff the inventory into created,
166
+ * edited and deleted deltas: a watcher may report only the directory. */
167
+ private reconcileExternalRoots;
168
+ /** Route one watcher path: a project-root member (consumer excludes apply)
169
+ * or an admitted external member (symlink escapes rejected). */
170
+ private classifyWatchPath;
171
+ private runIncrementalPipeline;
172
+ /** Shared analysis + emit core for both pipelines. `devMode` forks only
173
+ * the report log and the system-props write guard. */
174
+ private analyzeAndEmit;
175
+ /** An explicit `mode` wins over the pipeline path: a pinned-production
176
+ * watch must not emit unpruned CSS on its first incremental republish. */
177
+ private engineDevMode;
178
+ private analyzeAndEmitAttempt;
179
+ /** Open a status attempt (attemptId increments once per burst — a
180
+ * debouncing pre-write and the analysis that follows share one id). */
181
+ private beginStatusAttempt;
182
+ /** Write the session's analysis-status artifact. Terminal states
183
+ * (idle/failed) close the attempt. */
184
+ private writeAnalysisStatus;
185
+ /** Record watch events observed during the debounce window so a loader
186
+ * running ahead of the analysis has evidence to wait on. */
187
+ noteDebouncedWatchEvents(absPaths: Iterable<string>): void;
188
+ /** One pending microtask flushes a burst of debounce observations. */
189
+ private debounceStatusWriteScheduled;
190
+ /** Write one enveloped payload artifact, rewritten only when the PAYLOAD
191
+ * bytes changed; the recorded diskHash feeds the analysis-commit. */
192
+ private publishPayloadArtifact;
193
+ /** Reconstruct a payload write guard from the on-disk artifact's envelope
194
+ * (same-session restart: a byte-identical payload must not rewrite). */
195
+ private seedPayloadRecord;
196
+ /** Last analysis-commit persisted in this session's directory, or null. */
197
+ private seedCommitFromDisk;
198
+ /** Publish the analysis-commit: written after every payload and before the
199
+ * epoch, skipped when the payload hashes and epoch are unchanged. */
200
+ private publishAnalysisCommit;
201
+ /** Maintain the session's epoch witness, rewritten ONLY when the value
202
+ * changes, then expose it through the singleton. */
203
+ private publishReplacementEpoch;
204
+ /** sessions-root listing memo, keyed by the root dir's mtime — a new or
205
+ * pruned sibling DIRECTORY moves it; agreeing siblings stay listed. */
206
+ private siblingListing;
207
+ /** Restored-module snapshots point at the epoch artifact of the session
208
+ * that built them, so a moved epoch deletes every DISAGREEING sibling
209
+ * artifact to invalidate them. Agreeing siblings stay byte-untouched so
210
+ * warm restores keep working; a sibling with a live owner is exempt. */
211
+ private reconcileSiblingEpochs;
212
+ /** The pid of `siblingDir`'s live owner, or null when nothing proves one.
213
+ * Our own pid is never one — publication is process-exclusive. A missing,
214
+ * undecodable or unreadable claim all mean no owner: the opposite default
215
+ * from the CLI lock check on purpose, so do not unify the two. */
216
+ private liveSiblingOwnerPid;
217
+ /** Epoch value held by this session's on-disk artifact, or null when
218
+ * absent, unreadable, or not the expected schema. */
219
+ private diskEpochValue;
220
+ /** True when the flat `.animus/` advisory lock claims the tree. A lock that
221
+ * exists but cannot be decoded claims it too — unknown is never absent. */
222
+ private cliWriterHoldsLock;
223
+ /** Delete legacy flat artifacts and prune sibling session directories past
224
+ * the retention window — never this session's own dir. */
225
+ private runSessionStartHygiene;
226
+ /** Write one artifact write-then-rename, so a cross-process reader never
227
+ * sees a torn file; the tmp name carries the pid to keep writers apart. */
228
+ private writeSessionArtifact;
229
+ /** Copy each asset() specifier's bytes into `assets/` under a
230
+ * content-hashed name and substitute a url relative to styles.css. */
231
+ private substituteAssetReferences;
232
+ private trackAssetDependency;
233
+ /** Resolve an asset specifier through the shared resolver, with one
234
+ * last resort: a discovered source entry's package root. */
235
+ private resolveAssetSpecifier;
236
+ }
237
+ /** Sync `assets/` to the current build's file set; per-entry failures are
238
+ * tolerated — a concurrent session may have removed the same file. */
239
+ export declare function pruneStaleAssets(assetsDir: string, expected: ReadonlySet<string>): void;
240
+ //# sourceMappingURL=extraction-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction-session.d.ts","sourceRoot":"","sources":["../../session/extraction-session.ts"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAG/C,OAAO,KAAK,EAGV,YAAY,EAIb,MAAM,mBAAmB,CAAC;AAW3B;gFACgF;AAChF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAc5C,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpC;AA+BD;6EAC6E;AAC7E,qBAAa,iBAAiB;IAC5B,kDAAkD;IAClD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,6EAA6E;IAC7E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IAItC,OAAO,CAAC,cAAc,CASlB;IACJ,6DAA6D;IAC7D,oBAAoB,cAAqB;IACzC,OAAO,CAAC,mBAAmB,CAAqB;IAChD;+EAC2E;IAC3E,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC1C;gFAC4E;IAC5E,qBAAqB,UAAS;IAE9B,4EAA4E;IAC5E,mBAAmB,EAAE,MAAM,EAAE,CAAM;IACnC,0EAA0E;IAC1E,OAAO,CAAC,iBAAiB,CAA8B;IACvD,4EAA4E;IAC5E,OAAO,CAAC,kBAAkB,CAA8B;IACxD,+DAA+D;IAC/D,qBAAqB,sBAA6B;IAClD;6EACyE;IACzE,OAAO,CAAC,cAAc,CAA+B;IACrD;qEACiE;IACjE,kBAAkB,2BAAkC;IACpD;8EAC0E;IAC1E,OAAO,CAAC,sBAAsB,CAA0C;IACxE;sEACkE;IAClE,kBAAkB,EAAE,MAAM,EAAE,CAAM;I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AAO,CAAC,sBAAsB;IAqD9B;gFAC4E;IAC5E,OAAO,CAAC,oBAAoB;IAU5B;2EACuE;IACvE,OAAO,CAAC,yBAAyB;IAwEjC,OAAO,CAAC,oBAAoB;IAK5B;iEAC6D;IAC7D,OAAO,CAAC,qBAAqB;CA0B9B;AAED;uEACuE;AACvE,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B,IAAI,CAgBN"}
@@ -0,0 +1,10 @@
1
+ export { ExtractionSession, pruneStaleAssets } from './extraction-session';
2
+ export type { SessionOptions, WatchChanges } from './extraction-session';
3
+ export { checkLockLiveness, CLI_LOCK_HEARTBEAT_INTERVAL_MS, CLI_LOCK_STALE_AFTER_MS, collectSessionAssets, decodeCommitRecord, holdDirectoryClaim, isLockHolderAlive, lockRecordBytes, readCliLockRecord, verifyCommitRecord, } from './published-set';
4
+ export type { CliLockLiveness, CliLockRecord, CommitRecord, SessionAsset, } from './published-set';
5
+ export { analysisCommitPath, analysisInputsPath, analysisStatusPath, ANIMUS_ARTIFACT_DIR, ANIMUS_CSS_MODULE_ID, CLI_COMMIT_ARTIFACT, CLI_LOCK_ARTIFACT, MANIFEST_ARTIFACT, manifestPath, readJsonEnvelope, replacementEpochPath, SESSION_ASSETS_DIR, sessionArtifactDir, STYLES_ARTIFACT, stylesPath, SYSTEM_PROPS_ARTIFACT, systemPropsPath, TURBOPACK_SYSTEM_PROPS_ID, } from './session-paths';
6
+ export type { AnalysisCommit, AnalysisStatus, SessionEnvelope, } from './session-paths';
7
+ export { runSessionPipeline, startTurbopackWatcher, } from './turbopack-orchestrator';
8
+ export type { TurbopackWatcherHandle, TurbopackWatchOutcome, } from './turbopack-orchestrator';
9
+ export { engineApi, getAnalysisStartedPromise, getAnalyzedHashes, getManifestJson, getReplacementEpoch, getSessionArtifactDir, getSharedCss, getSharedExternalDirs, getSharedExternalEntries, getSharedSystemProps, setAnalysisStartedPromise, setSharedEngine, } from './singleton';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,eAAe,GAChB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,52 @@
1
+ export interface CommitRecord {
2
+ schema: 1;
3
+ payloads: Record<string, {
4
+ hash: string;
5
+ }>;
6
+ }
7
+ export declare function decodeCommitRecord(bytes: string): CommitRecord | null;
8
+ /** Recompute every recorded payload hash over raw bytes — the writer's own
9
+ * hashing domain — and return the mismatches; empty means the set verifies. */
10
+ export declare function verifyCommitRecord(dir: string): string[];
11
+ export interface CliLockRecord {
12
+ pid: number;
13
+ startedAt?: string;
14
+ heartbeatAt?: string;
15
+ }
16
+ export declare const CLI_LOCK_HEARTBEAT_INTERVAL_MS = 60000;
17
+ /** A claim whose heartbeat is older than this has no live holder. Five missed
18
+ * refreshes: synchronous extraction can block the holder's refresh timer. */
19
+ export declare const CLI_LOCK_STALE_AFTER_MS: number;
20
+ export type CliLockLiveness = {
21
+ live: true;
22
+ } | {
23
+ live: false;
24
+ reason: string;
25
+ };
26
+ export type CliLockRead = {
27
+ kind: 'none';
28
+ } | {
29
+ kind: 'held';
30
+ record: CliLockRecord;
31
+ } | {
32
+ kind: 'indeterminate';
33
+ };
34
+ export declare function readCliLockRecord(dir: string): CliLockRead;
35
+ export declare function isLockHolderAlive(pid: number): boolean;
36
+ export declare function checkLockLiveness(record: CliLockRecord): CliLockLiveness;
37
+ export declare function lockRecordBytes(startedAt: string): string;
38
+ export interface DirectoryClaimOptions {
39
+ /** `in-place` (default) keeps a watched directory's mtime still — renaming
40
+ * every interval starts phantom rebuilds; `rename` avoids torn reads. */
41
+ write?: 'in-place' | 'rename';
42
+ startedAt?: string;
43
+ }
44
+ export declare function holdDirectoryClaim(dir: string, options?: DirectoryClaimOptions): () => void;
45
+ export interface SessionAsset {
46
+ name: string;
47
+ bytes: Buffer;
48
+ }
49
+ /** Snapshot the session's copied asset() files, sorted, BEFORE the session
50
+ * tree is disposed. Drivers publish them beside the emitted stylesheet. */
51
+ export declare function collectSessionAssets(sessionDir: string | null): SessionAsset[];
52
+ //# sourceMappingURL=published-set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-set.d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1E,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,qBAA0B,GAClC,MAAM,IAAI,CAwCZ;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;4EAC4E;AAC5E,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,YAAY,EAAE,CAOhB"}
@@ -0,0 +1,7 @@
1
+ /** Package specifier → rootDir-relative entry path. An unresolved specifier
2
+ * has no key at all, never a key with an empty target. */
3
+ export interface ResolvedPackageMap {
4
+ [specifier: string]: string;
5
+ }
6
+ export declare function resolvePackagesByName(rootDir: string, names: string[]): ResolvedPackageMap;
7
+ //# sourceMappingURL=resolve-packages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-packages.d.ts","sourceRoot":"","sources":["../../session/resolve-packages.ts"],"names":[],"mappings":"AAGA;2DAC2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,GACd,kBAAkB,CA8CpB"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Session artifact names, path derivations, and artifact shapes. Imports no
3
+ * session or singleton module: the Turbopack loader graph stays worker-local.
4
+ */
5
+ /** Session-dir-relative name of the replacement-epoch disk witness. */
6
+ export declare const REPLACEMENT_EPOCH_ARTIFACT = "replacements-epoch";
7
+ /** Virtual module id of the emitted system-props module. */
8
+ export declare const TURBOPACK_SYSTEM_PROPS_ID = "virtual:animus/system-props";
9
+ /** Session-dir-relative name of the analysis-commit transaction artifact. */
10
+ export declare const ANALYSIS_COMMIT_ARTIFACT = "analysis-commit";
11
+ /** Session-dir-relative name of the analysis-status artifact. */
12
+ export declare const ANALYSIS_STATUS_ARTIFACT = "analysis-status.json";
13
+ /** Session-dir-relative name of the manifest payload artifact. */
14
+ export declare const MANIFEST_ARTIFACT = "manifest.json";
15
+ /** Session-dir-relative name of the analysis-inputs payload artifact — the
16
+ * Turbopack loader-worker hydration corpus. */
17
+ export declare const ANALYSIS_INPUTS_ARTIFACT = "analysis-inputs.json";
18
+ /** Session-dir-relative name of the emitted stylesheet artifact. */
19
+ export declare const STYLES_ARTIFACT = "styles.css";
20
+ /** Session-dir-relative name of the emitted system-props module. */
21
+ export declare const SYSTEM_PROPS_ARTIFACT = "system-props.js";
22
+ /** Session-dir-relative directory holding copied asset() files. */
23
+ export declare const SESSION_ASSETS_DIR = "assets";
24
+ /** The standalone CLI's published-set commit record in the flat `.animus/`
25
+ * tree; the session's start hygiene keys on this name before deleting. */
26
+ export declare const CLI_COMMIT_ARTIFACT = "commit.json";
27
+ /** Advisory claim record (pid plus heartbeat) of whichever directory holds
28
+ * it; sessions write it into their own tree too, despite the `CLI_` name. */
29
+ export declare const CLI_LOCK_ARTIFACT = "lock.json";
30
+ /** Project-relative artifact directory: the CLI's default output tree and
31
+ * the parent of every session tree. One spelling, or the tree splits. */
32
+ export declare const ANIMUS_ARTIFACT_DIR = ".animus";
33
+ /** Module id the Rust emitter injects, and the alias key both bundlers
34
+ * register. A literal on purpose: a rename breaks built consumer packages.
35
+ * The Next plugin's webpack alias harvest skips this exact key, so a change
36
+ * here is a change in the emitter, both bundler arms and that harvest. */
37
+ export declare const ANIMUS_CSS_MODULE_ID = ".animus/styles.css";
38
+ export declare function sessionsRootDir(rootDir: string): string;
39
+ export declare function sessionArtifactDir(rootDir: string, sessionId: string): string;
40
+ export declare function replacementEpochPath(sessionDir: string): string;
41
+ export declare function analysisCommitPath(sessionDir: string): string;
42
+ export declare function analysisStatusPath(sessionDir: string): string;
43
+ export declare function manifestPath(sessionDir: string): string;
44
+ export declare function analysisInputsPath(sessionDir: string): string;
45
+ export declare function stylesPath(sessionDir: string): string;
46
+ export declare function systemPropsPath(sessionDir: string): string;
47
+ /** Advisory: a loader reads it only after observing a source/commit
48
+ * mismatch, to decide whether to wait. No reader branches on `schema`. */
49
+ export interface AnalysisStatus {
50
+ schema: 1 | 2;
51
+ sessionId: string;
52
+ attemptId: number;
53
+ state: 'starting' | 'debouncing' | 'analyzing' | 'committing' | 'idle' | 'failed';
54
+ /** [(rootDir-relative sourceKey, observed content hash)] of the batch. */
55
+ pending: Array<[string, string]>;
56
+ /** Epoch-ms deadline for the active attempt (debounce ceiling + 2s). */
57
+ deadlineAt: number;
58
+ diagnostic?: string;
59
+ /** False until the session's first complete publication, true on every
60
+ * later write including failures; never regresses within a session. */
61
+ ready?: boolean;
62
+ }
63
+ /** Transaction identity: every hash is of the DISK payload bytes, envelope
64
+ * included. `inputsHash` is absent when no hydration corpus is persisted. */
65
+ export interface AnalysisCommit {
66
+ schema: 1;
67
+ sessionId: string;
68
+ /** Forensic ordinal only: no reader decides anything from it, and it is
69
+ * monotonic per session directory only because publication is exclusive. */
70
+ generation: number;
71
+ replacementEpoch: string;
72
+ manifestHash: string;
73
+ inputsHash?: string;
74
+ stylesHash: string;
75
+ }
76
+ /** Embedded in every payload artifact; `payloadHash` lets a same-session
77
+ * restart seed its write guards without rebuilding the payload bytes. */
78
+ export interface SessionEnvelope {
79
+ sessionId: string;
80
+ generation: number;
81
+ replacementEpoch: string;
82
+ payloadHash: string;
83
+ }
84
+ /** Splices the envelope in as a leading `__animusSession` field without
85
+ * re-serializing: parse/re-stringify would reformat engine-emitted JSON. */
86
+ export declare function envelopeJsonArtifact(payload: string, envelopeJson: string): string;
87
+ /** Trailing-comment side-band: a leading comment would displace the `@layer`
88
+ * declaration consumers pin at offset 0. */
89
+ export declare function envelopeCssArtifact(payload: string, envelopeJson: string): string;
90
+ export declare const ENVELOPE_CSS_COMMENT_RE: RegExp;
91
+ /** Envelope of a JSON artifact's bytes, or undefined when it carries none.
92
+ * Throws on unparseable bytes; callers decide torn-artifact policy. */
93
+ export declare function readJsonEnvelope(bytes: string): SessionEnvelope | undefined;
94
+ /** Envelope of the CSS side-band comment, or undefined when it is absent.
95
+ * Throws on an unparseable envelope body. */
96
+ export declare function readCssEnvelope(bytes: string): SessionEnvelope | undefined;
97
+ //# sourceMappingURL=session-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-paths.d.ts","sourceRoot":"","sources":["../../session/session-paths.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAE1D,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;gDACgD;AAChD,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D,oEAAoE;AACpE,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAE3C;2EAC2E;AAC3E,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD;8EAC8E;AAC9E,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C;0EAC0E;AAC1E,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C;;;2EAG2E;AAC3E,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAEzD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AA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AAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;6EAC6E;AAC7E,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,MAAM,CAQR;AAED;6CAC6C;AAC7C,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED,eAAO,MAAM,uBAAuB,QAAuC,CAAC;AAE5E;wEACwE;AACxE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAK3E;AAED;8CAC8C;AAC9C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAK1E"}
@@ -0,0 +1,85 @@
1
+ export declare function getManifestJson(): string | null;
2
+ export declare function setManifestJson(json: string): void;
3
+ /**
4
+ * A latch over the most recently STARTED analysis, never cleared on settle:
5
+ * non-null means one was scheduled. In-flight lives in getWatchTransaction.
6
+ */
7
+ export declare function getAnalysisStartedPromise(): Promise<void> | null;
8
+ export declare function setAnalysisStartedPromise(promise: Promise<void>): void;
9
+ export declare function resetAnalysisStartedPromise(): void;
10
+ export declare function getSharedCss(): string;
11
+ export declare function setSharedCss(css: string): void;
12
+ export declare function getSharedSystemProps(): string;
13
+ export declare function setSharedSystemProps(content: string): void;
14
+ export declare function getSharedExternalDirs(): string[];
15
+ export declare function setSharedExternalDirs(dirs: string[]): void;
16
+ export declare function getSharedExternalEntries(): Map<string, string>;
17
+ export declare function setSharedExternalEntries(entries: Map<string, string>): void;
18
+ /** Structural view of the target session, declared here rather than imported
19
+ * so the singleton never depends on the session module it serves. */
20
+ export interface WatchBatchTarget {
21
+ ingestForwardedBatch(changes: {
22
+ modifiedFiles?: ReadonlySet<string>;
23
+ removedFiles?: ReadonlySet<string>;
24
+ }): Promise<void>;
25
+ }
26
+ /**
27
+ * The only session that can run watch analysis. A non-owning session forwards
28
+ * its batch here; dropping it loses files only that watcher sees.
29
+ */
30
+ export declare function getOwningWatchSession(): WatchBatchTarget | null;
31
+ export declare function setOwningWatchSession(session: WatchBatchTarget | null): void;
32
+ /**
33
+ * Per-file content hashes of the last published analysis (relPath → hash of
34
+ * the exact bytes analyzed), including files that produced zero entries.
35
+ */
36
+ export declare function getAnalyzedHashes(): ReadonlyMap<string, string> | null;
37
+ export declare function setAnalyzedHashes(hashes: Map<string, string>): void;
38
+ /**
39
+ * Session identity is per process: the first caller claims a fresh id and
40
+ * every later one adopts it, so all compilers share one artifact tree.
41
+ */
42
+ export declare function claimProcessSessionId(): string;
43
+ /**
44
+ * Two CONCURRENT drive loops in one process would share one session tree and
45
+ * clobber each other; sequential claim/release cycles are legal.
46
+ */
47
+ export declare function claimExclusiveSessionOwner(label: string): () => void;
48
+ /**
49
+ * Absolute artifact directory of the OWNING session's last publication. The
50
+ * Turbopack loader runs out of process and receives it via options instead.
51
+ */
52
+ export declare function getSessionArtifactDir(): string | null;
53
+ export declare function setSessionArtifactDir(dir: string): void;
54
+ /**
55
+ * Replacement epoch of the last published analysis, written AFTER the
56
+ * manifest so an epoch reader always sees at least that generation's manifest.
57
+ */
58
+ export declare function getReplacementEpoch(): string | null;
59
+ export declare function setReplacementEpoch(epoch: string): void;
60
+ /**
61
+ * The one in-flight watch-analysis transaction: a compiler that did not start
62
+ * it joins this promise rather than read a pre-transaction generation.
63
+ */
64
+ export declare function getWatchTransaction(): Promise<void> | null;
65
+ export declare function setWatchTransaction(transaction: Promise<void> | null): void;
66
+ export type AnimusEngine = 'v2';
67
+ /** Engine selection travels through the singleton so non-owning compilers
68
+ * and the webpack loader honor the owner's choice. */
69
+ export declare function setSharedEngine(engine: AnimusEngine): void;
70
+ export declare function getSharedEngine(): AnimusEngine;
71
+ /** Single choke-point for every native extraction call; the NAPI module's
72
+ * own `.d.ts` is the authoritative surface for what it returns. */
73
+ export declare function requireEngine(): any;
74
+ /**
75
+ * Test seam, set once at module top level: this key stays OUT of
76
+ * SINGLETON_GLOBAL_KEYS so a per-test reset cannot strip the override.
77
+ */
78
+ export declare function setEngineApiOverride(api: (() => any) | null): void;
79
+ export declare function engineApi(): any;
80
+ /**
81
+ * Every globalThis key this module owns except the engine-api override, which
82
+ * a per-test reset must not clear. Test harnesses clear exactly this list.
83
+ */
84
+ export declare const SINGLETON_GLOBAL_KEYS: readonly ["__animus_manifest_json__", "__animus_analysis_started__", "__animus_shared_css__", "__animus_shared_system_props__", "__animus_external_pkg_dirs__", "__animus_external_source_entries__", "__animus_analyzed_hashes__", "__animus_replacement_epoch__", "__animus_watch_transaction__", "__animus_process_session_id__", "__animus_session_artifact_dir__", "__animus_owning_watch_session__", "__animus_exclusive_session_owner__", "__animus_engine__", "__animus_v2_engine__", "__animus_v2_sent_sources__", "__animus_v2_drift_warned__"];
85
+ //# sourceMappingURL=singleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../session/singleton.ts"],"names":[],"mappings":"AAkEA,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAElD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAEhE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAEtE;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,qBAAqB,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D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAE1D;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAE3E;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC;AAEhC;uDACuD;AACvD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED,wBAAgB,eAAe,IAAI,YAAY,CAI9C;AAED;oEACoE;AAEpE,wBAAgB,aAAa,IAAI,GAAG,CAGnC;AA6BD;;;GAGG;AAEH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAElE;AAGD,wBAAgB,SAAS,IAAI,GAAG,CAG/B;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,2hBAkBxB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function logBuildTimings(bt: Record<string, number>, rustTiming: Record<string, number> | undefined, log: (msg: string) => void, verbose: boolean): void;
2
+ //# sourceMappingURL=timing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../session/timing.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAC7B,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAC9C,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,EAC1B,OAAO,EAAE,OAAO,GACf,IAAI,CAkDN"}
@@ -0,0 +1,27 @@
1
+ import { watch } from 'fs';
2
+ import type { ExtractionSession } from './extraction-session';
3
+ export declare function runSessionPipeline(session: ExtractionSession): Promise<void>;
4
+ export interface TurbopackWatcherOptions {
5
+ debounceMs?: number;
6
+ watchFn?: typeof watch;
7
+ /** Accumulate observed paths until `deliverHeldEvents()`: a cycle scheduled
8
+ * before the first analysis joins the running pipeline and does nothing. */
9
+ holdEvents?: boolean;
10
+ }
11
+ export declare function startTurbopackWatcher(session: ExtractionSession, rootDir: string, options?: TurbopackWatcherOptions): TurbopackWatchOutcome;
12
+ export type TurbopackWatchOutcome = {
13
+ kind: 'started';
14
+ handle: TurbopackWatcherHandle;
15
+ } | {
16
+ kind: 'already-watched';
17
+ } | {
18
+ kind: 'unavailable';
19
+ };
20
+ export interface TurbopackWatcherHandle {
21
+ close(): void;
22
+ readonly died: boolean;
23
+ onDied: (() => void) | null;
24
+ settle(): Promise<void>;
25
+ deliverHeldEvents(): Promise<void>;
26
+ }
27
+ //# sourceMappingURL=turbopack-orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turbopack-orchestrator.d.ts","sourceRoot":"","sources":["../../session/turbopack-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,MAAM,IAAI,CAAC;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAIf;AAkCD,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB;iFAC6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,qBAAqB,CAqQvB;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,sBAAsB,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE5B,MAAM,WAAW,sBAAsB;IACrC,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC"}