@animus-ui/extract 0.1.9 → 0.1.11

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 (126) hide show
  1. package/README.md +1 -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/dist/index.cjs +73 -2101
  6. package/dist/index.mjs +2 -2026
  7. package/dist/pipeline/analyze-project-args.d.ts.map +1 -0
  8. package/dist/pipeline/assemble-stylesheet.d.ts.map +1 -0
  9. package/dist/pipeline/asset-placeholders.d.ts.map +1 -0
  10. package/dist/pipeline/content-hash.d.ts.map +1 -0
  11. package/dist/pipeline/core-options.d.ts +162 -0
  12. package/dist/pipeline/core-options.d.ts.map +1 -0
  13. package/dist/pipeline/correlate-external-tokens.d.ts.map +1 -0
  14. package/dist/pipeline/discover-files.d.ts +12 -0
  15. package/dist/pipeline/discover-files.d.ts.map +1 -0
  16. package/dist/{discover-packages.d.ts → pipeline/discover-packages.d.ts} +7 -8
  17. package/dist/pipeline/discover-packages.d.ts.map +1 -0
  18. package/dist/pipeline/dynamic-prop-config.d.ts.map +1 -0
  19. package/dist/{engine-adapter.d.ts → pipeline/engine-adapter.d.ts} +2 -0
  20. package/dist/pipeline/engine-adapter.d.ts.map +1 -0
  21. package/dist/pipeline/engine-retirement.d.ts.map +1 -0
  22. package/dist/pipeline/error-diagnostics.d.ts.map +1 -0
  23. package/dist/pipeline/external-keyframes.d.ts.map +1 -0
  24. package/dist/{index.d.ts → pipeline/index.d.ts} +10 -1
  25. package/dist/pipeline/index.d.ts.map +1 -0
  26. package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -0
  27. package/dist/{mdx-preprocessor.d.ts → pipeline/mdx-preprocessor.d.ts} +10 -0
  28. package/dist/pipeline/mdx-preprocessor.d.ts.map +1 -0
  29. package/dist/pipeline/path-aliases.d.ts.map +1 -0
  30. package/dist/pipeline/post-process-css.d.ts.map +1 -0
  31. package/dist/pipeline/prefix.d.ts.map +1 -0
  32. package/dist/pipeline/replacement-plans.d.ts.map +1 -0
  33. package/dist/pipeline/resolve-asset.d.ts.map +1 -0
  34. package/dist/pipeline/run-analysis.d.ts.map +1 -0
  35. package/dist/pipeline/source-identity.d.ts.map +1 -0
  36. package/dist/pipeline/source-ingestion.d.ts +173 -0
  37. package/dist/pipeline/source-ingestion.d.ts.map +1 -0
  38. package/dist/pipeline/static-css.d.ts.map +1 -0
  39. package/dist/pipeline/structural-self-check.d.ts +32 -0
  40. package/dist/pipeline/structural-self-check.d.ts.map +1 -0
  41. package/dist/pipeline/svelte-source-adapter.d.ts +88 -0
  42. package/dist/pipeline/svelte-source-adapter.d.ts.map +1 -0
  43. package/dist/pipeline/system-config.d.ts.map +1 -0
  44. package/dist/{system-props-module.d.ts → pipeline/system-props-module.d.ts} +4 -3
  45. package/dist/pipeline/system-props-module.d.ts.map +1 -0
  46. package/dist/pipeline/timing-waterfall.d.ts.map +1 -0
  47. package/dist/pipeline/tsconfig-paths.d.ts.map +1 -0
  48. package/dist/pipeline/unit-fallback.d.ts.map +1 -0
  49. package/dist/pipeline/utils.d.ts.map +1 -0
  50. package/dist/pipeline/watch-keys.d.ts.map +1 -0
  51. package/dist/pipeline-lkbOoyAr.mjs +3228 -0
  52. package/dist/pipeline-ojNeABi0.cjs +3685 -0
  53. package/dist/session/extraction-session.d.ts +446 -0
  54. package/dist/session/extraction-session.d.ts.map +1 -0
  55. package/dist/session/index.d.ts +24 -0
  56. package/dist/session/index.d.ts.map +1 -0
  57. package/dist/session/published-set.d.ts +32 -0
  58. package/dist/session/published-set.d.ts.map +1 -0
  59. package/dist/session/resolve-packages.d.ts +8 -0
  60. package/dist/session/resolve-packages.d.ts.map +1 -0
  61. package/dist/session/session-paths.d.ts +131 -0
  62. package/dist/session/session-paths.d.ts.map +1 -0
  63. package/dist/session/singleton.d.ts +124 -0
  64. package/dist/session/singleton.d.ts.map +1 -0
  65. package/dist/session/timing.d.ts +7 -0
  66. package/dist/session/timing.d.ts.map +1 -0
  67. package/dist/session/turbopack-orchestrator.d.ts +43 -0
  68. package/dist/session/turbopack-orchestrator.d.ts.map +1 -0
  69. package/dist/session.cjs +2146 -0
  70. package/dist/session.mjs +2110 -0
  71. package/package.json +18 -6
  72. package/dist/analyze-project-args.d.ts.map +0 -1
  73. package/dist/assemble-stylesheet.d.ts.map +0 -1
  74. package/dist/asset-placeholders.d.ts.map +0 -1
  75. package/dist/content-hash.d.ts.map +0 -1
  76. package/dist/correlate-external-tokens.d.ts.map +0 -1
  77. package/dist/discover-files.d.ts +0 -10
  78. package/dist/discover-files.d.ts.map +0 -1
  79. package/dist/discover-packages.d.ts.map +0 -1
  80. package/dist/dynamic-prop-config.d.ts.map +0 -1
  81. package/dist/engine-adapter.d.ts.map +0 -1
  82. package/dist/engine-retirement.d.ts.map +0 -1
  83. package/dist/error-diagnostics.d.ts.map +0 -1
  84. package/dist/external-keyframes.d.ts.map +0 -1
  85. package/dist/index.d.ts.map +0 -1
  86. package/dist/manifest-diagnostics.d.ts.map +0 -1
  87. package/dist/mdx-preprocessor.d.ts.map +0 -1
  88. package/dist/path-aliases.d.ts.map +0 -1
  89. package/dist/post-process-css.d.ts.map +0 -1
  90. package/dist/prefix.d.ts.map +0 -1
  91. package/dist/replacement-plans.d.ts.map +0 -1
  92. package/dist/resolve-asset.d.ts.map +0 -1
  93. package/dist/run-analysis.d.ts.map +0 -1
  94. package/dist/source-identity.d.ts.map +0 -1
  95. package/dist/static-css.d.ts.map +0 -1
  96. package/dist/system-config.d.ts.map +0 -1
  97. package/dist/system-props-module.d.ts.map +0 -1
  98. package/dist/timing-waterfall.d.ts.map +0 -1
  99. package/dist/tsconfig-paths.d.ts.map +0 -1
  100. package/dist/unit-fallback.d.ts.map +0 -1
  101. package/dist/utils.d.ts.map +0 -1
  102. package/dist/watch-keys.d.ts.map +0 -1
  103. /package/dist/{analyze-project-args.d.ts → pipeline/analyze-project-args.d.ts} +0 -0
  104. /package/dist/{assemble-stylesheet.d.ts → pipeline/assemble-stylesheet.d.ts} +0 -0
  105. /package/dist/{asset-placeholders.d.ts → pipeline/asset-placeholders.d.ts} +0 -0
  106. /package/dist/{content-hash.d.ts → pipeline/content-hash.d.ts} +0 -0
  107. /package/dist/{correlate-external-tokens.d.ts → pipeline/correlate-external-tokens.d.ts} +0 -0
  108. /package/dist/{dynamic-prop-config.d.ts → pipeline/dynamic-prop-config.d.ts} +0 -0
  109. /package/dist/{engine-retirement.d.ts → pipeline/engine-retirement.d.ts} +0 -0
  110. /package/dist/{error-diagnostics.d.ts → pipeline/error-diagnostics.d.ts} +0 -0
  111. /package/dist/{external-keyframes.d.ts → pipeline/external-keyframes.d.ts} +0 -0
  112. /package/dist/{manifest-diagnostics.d.ts → pipeline/manifest-diagnostics.d.ts} +0 -0
  113. /package/dist/{path-aliases.d.ts → pipeline/path-aliases.d.ts} +0 -0
  114. /package/dist/{post-process-css.d.ts → pipeline/post-process-css.d.ts} +0 -0
  115. /package/dist/{prefix.d.ts → pipeline/prefix.d.ts} +0 -0
  116. /package/dist/{replacement-plans.d.ts → pipeline/replacement-plans.d.ts} +0 -0
  117. /package/dist/{resolve-asset.d.ts → pipeline/resolve-asset.d.ts} +0 -0
  118. /package/dist/{run-analysis.d.ts → pipeline/run-analysis.d.ts} +0 -0
  119. /package/dist/{source-identity.d.ts → pipeline/source-identity.d.ts} +0 -0
  120. /package/dist/{static-css.d.ts → pipeline/static-css.d.ts} +0 -0
  121. /package/dist/{system-config.d.ts → pipeline/system-config.d.ts} +0 -0
  122. /package/dist/{timing-waterfall.d.ts → pipeline/timing-waterfall.d.ts} +0 -0
  123. /package/dist/{tsconfig-paths.d.ts → pipeline/tsconfig-paths.d.ts} +0 -0
  124. /package/dist/{unit-fallback.d.ts → pipeline/unit-fallback.d.ts} +0 -0
  125. /package/dist/{utils.d.ts → pipeline/utils.d.ts} +0 -0
  126. /package/dist/{watch-keys.d.ts → pipeline/watch-keys.d.ts} +0 -0
@@ -0,0 +1,446 @@
1
+ import type { AnimusCoreOptions, ExternalPackageOutcome } from '../pipeline/index';
2
+ /** Options the artifact-publishing session consumes — exactly the shared
3
+ * driver core (shared-driver-config). Driver-specific surfaces
4
+ * (AnimusNextOptions and the CLI's flag layer) are structurally
5
+ * assignable; the session reads only core keys. */
6
+ export type SessionOptions = AnimusCoreOptions;
7
+ import type { SourceEntryOwnership } from '../pipeline/index';
8
+ /**
9
+ * Module id the Rust emitter injects for the extracted stylesheet — also the
10
+ * exact resolve.alias key with-animus registers for it, which the adapter's
11
+ * alias harvesting must skip.
12
+ */
13
+ export declare const ANIMUS_CSS_MODULE_ID = ".animus/styles.css";
14
+ /** Watch-cycle change sets, as reported by the bundler's watcher. */
15
+ export interface WatchChanges {
16
+ modifiedFiles?: ReadonlySet<string>;
17
+ removedFiles?: ReadonlySet<string>;
18
+ }
19
+ /**
20
+ * Bundler-agnostic extraction pipeline: system loading, source discovery
21
+ * and ingestion, external-package collection, analysis, stylesheet and
22
+ * system-props emission, and watch-cycle diffing.
23
+ *
24
+ * The webpack adapter (plugin.ts) owns only bundler wiring: hook
25
+ * registration, alias harvesting from the compiler config, in-memory asset
26
+ * replacement, and translating watch events into `handleWatchUpdate`
27
+ * change sets. Keeping this class free of webpack types is deliberate — a
28
+ * future Turbopack integration must drive the same session from outside
29
+ * the bundler (Turbopack has no compiler-hook surface), reusing everything
30
+ * here unchanged.
31
+ *
32
+ * Outputs are published through the package singleton (shared CSS,
33
+ * manifest, system props) and written to `.animus/` on disk.
34
+ */
35
+ export declare class ExtractionSession {
36
+ /** Set by the adapter before any pipeline run. */
37
+ rootDir: string | null;
38
+ /** Serialized path aliases, harvested by the adapter from bundler config. */
39
+ pathAliasesJson: string | null;
40
+ private assetCopyCache;
41
+ /** Physical asset files registered with the host watcher. */
42
+ assetDependencyPaths: Set<string>;
43
+ private assetDependencyKeys;
44
+ /** Emitter identity override for the system-props module id. Webpack mode
45
+ * (null) injects the absolute `.animus/system-props.js` path, resolved by
46
+ * NormalModuleReplacement; Turbopack rejects absolute-path imports, so
47
+ * its driver sets the virtual id that `resolveAlias` maps to disk. */
48
+ systemPropsModuleId: string | null;
49
+ /** Whether the analysis-inputs hydration corpus is serialized + written.
50
+ * False (webpack mode): the loader shares the pipeline process and reads
51
+ * the manifest from memory — the corpus is never persisted. True is set
52
+ * by the Turbopack orchestration driver, whose isolated loader workers
53
+ * replay it (spec: next-turbopack-integration, "Manifest disk artifact" /
54
+ * "Webpack mode skips the hydration corpus"). */
55
+ persistAnalysisInputs: boolean;
56
+ /** Absolute directory prefixes for external DS packages (loader allowlisting). */
57
+ externalPackageDirs: string[];
58
+ /** Absolute package dir → owning specifier (cross-source correlation). */
59
+ private externalDirOwners;
60
+ /** rootDir-relative external file → owning specifier (correlation join). */
61
+ private externalFileOwners;
62
+ /** External package specifier → absolute source entry path. */
63
+ externalSourceEntries: Map<string, string>;
64
+ /** SourceId derivation authority for the current generation (openspec:
65
+ * external-source-watch-ingestion, design D2) — canonical roots
66
+ * realpath'd once per full pipeline; alias→SourceId associations
67
+ * recorded while files exist so deletion resolves through the cache. */
68
+ private sourceIdentity;
69
+ /** Canonical admitted external root → declared specifiers (set-valued
70
+ * ownership, design D2; duplicate specifiers resolving to one canonical
71
+ * root share it). Engine watch wiring and tests read this. */
72
+ externalRootOwners: Map<string, Set<string>>;
73
+ /** Canonical external root → the extension set its collection walk used
74
+ * (widened for dist-only roots); rewalks and classification share it. */
75
+ private externalRootExtensions;
76
+ /** Canonical admitted external watch roots — the engine-side watch
77
+ * surface (webpack contextDependencies / Turbopack watchers). */
78
+ externalWatchRoots: string[];
79
+ /** Canonical external root → (raw sourceKey → {raw content hash, recorded
80
+ * abs spelling}): the previous-generation inventory a dirty-root rewalk
81
+ * diffs against (design D3). Raw hashes — MDX preprocessing never skews
82
+ * the diff; the recorded abs path is a registered deletion alias, so a
83
+ * reconstructed deletion always resolves through cached identity. */
84
+ private externalInventory;
85
+ /** Sticky diagnostics (design D5/D7): stable key → message, re-surfaced
86
+ * on every full pipeline until the underlying condition clears. */
87
+ readonly stickyDiagnostics: Map<string, string>;
88
+ /** Volume-membership predicate for the cross-volume gate (design D5).
89
+ * Injected seam: the shared predicate only discriminates on Windows
90
+ * (win32 semantics are unit-tested via path.win32), so runtime tests
91
+ * drive the gate through this. */
92
+ sharesProjectVolume: (projectRoot: string, externalRoot: string) => boolean;
93
+ /** Orchestrator seams (openspec: external-source-watch-ingestion, design
94
+ * D4). `onExternalRootResolved` fires per volume-admitted external root
95
+ * DURING collection — after resolution, BEFORE that root's sources are
96
+ * walked — so a watching host can open its handle with no blind gap
97
+ * between scan and watch. `onExternalRootsCommitted` fires once after a
98
+ * successful full-pipeline publication with the complete admitted
99
+ * canonical root set (the host's promote/replay/close-old phase; a
100
+ * failed pipeline never fires it, so the host rolls back). */
101
+ onExternalRootResolved: ((canonicalRoot: string) => void) | null;
102
+ onExternalRootsCommitted: ((canonicalRoots: string[]) => void) | null;
103
+ private readonly options;
104
+ private readonly staticCssJson;
105
+ private system;
106
+ /** Discovery-time keyframes diagnostics awaiting the shared surfacing pass. */
107
+ private externalKeyframesDiagnostics;
108
+ /** Full package-resolution map from the last full pipeline — replayed by
109
+ * incremental passes (sourceEntries alone omits dist-resolved packages). */
110
+ private lastPackageMap;
111
+ private fileCache;
112
+ analysisEntryCache: Map<string, {
113
+ hash: string;
114
+ source: string;
115
+ }>;
116
+ sourceOwnership: Record<string, SourceEntryOwnership>;
117
+ private systemDependencyKeys;
118
+ /** Loader-reported dependency paths for bundler watch registration. */
119
+ systemDependencyPaths: string[];
120
+ private systemDependencyHashes;
121
+ private lastSystemPropsHash;
122
+ /** Per-payload write guards: payloadHash gates rewrites (byte-identical
123
+ * payloads leave disk untouched); diskHash is the hash of the CURRENT
124
+ * disk bytes (envelope included) recorded in the analysis-commit. null =
125
+ * not yet seeded (first publication reads the artifact's envelope so a
126
+ * same-session restart never rewrites byte-identical artifacts). */
127
+ private artifactRecords;
128
+ /** Last written analysis-commit; null = seeded from disk on first use. */
129
+ private lastCommit;
130
+ /** Session identity — claimed once per PROCESS (one Next invocation),
131
+ * adopted by every subsequent session instance so all compilers share
132
+ * one artifact tree (design D2: `next dev`/`next build` co-writing are
133
+ * separate processes and therefore separate sessions). */
134
+ readonly sessionId: string;
135
+ /** Epoch value of the last published analysis; null = not yet known
136
+ * (seeded from the session dir's artifact on first publication so a
137
+ * same-session restart with unchanged plans never rewrites bytes). */
138
+ private lastEpochValue;
139
+ /** Watcher debounce ceiling feeding status deadlines (design D3). */
140
+ debounceCeilingMs: number;
141
+ /** Test seam: observes every session-artifact write (name, content)
142
+ * post-rename — write ORDER is part of the transaction contract. */
143
+ onArtifactWrite: ((name: string, content: string) => void) | null;
144
+ /** Status attempt bookkeeping (design D3). */
145
+ private statusAttemptId;
146
+ private statusAttemptOpen;
147
+ /** Monotonic first-emission witness (openspec: standalone-extraction-cli,
148
+ * watch readiness): flips true once the first complete publication
149
+ * succeeds and never regresses — every later status write (idle AND
150
+ * failed) carries it, so readiness stays observable across attempts. */
151
+ private firstEmissionComplete;
152
+ /** Debounce-window observations pending analysis (sourceKey → hash). */
153
+ private debouncePending;
154
+ /** Session-start hygiene (pruning + legacy cleanup) runs once. */
155
+ private sessionStartHygieneDone;
156
+ private lcssTargets;
157
+ constructor(options: SessionOptions);
158
+ /** This session's artifact directory. Requires `rootDir` to be set. */
159
+ get sessionDir(): string;
160
+ get verbose(): boolean;
161
+ private log;
162
+ private warn;
163
+ private now;
164
+ private elapsed;
165
+ /** Lazily-computed scan config (options are constructor-fixed, so the
166
+ * derivation is stable for the session's lifetime). */
167
+ /** Diagnostic prefix label — drivers set their own so a host's errors
168
+ * never masquerade as another driver's (inc 05 review S1). The default
169
+ * keeps the Next plugin's historical prefix. */
170
+ driverLabel: string;
171
+ /** Per-specifier discovery outcomes from the last full collection —
172
+ * driver-consumed reporting surface (the CLI's summary). */
173
+ lastExternalOutcomes: ExternalPackageOutcome[];
174
+ /** Component count of the last published analysis, or null before the
175
+ * first — the CLI's publish path reads this instead of re-parsing the
176
+ * manifest JSON every cycle. */
177
+ lastComponentCount: number | null;
178
+ /** Driver-owned STRUCTURAL exclusions (a CLI outDir inside the root),
179
+ * joined to the never-replaceable set — never the user `exclude` list,
180
+ * whose presence would flip the replace semantics and silently drop the
181
+ * replaceable defaults. Set before the first pipeline run (the scan
182
+ * config is memoized). */
183
+ structuralExclude: string[];
184
+ private scanConfigMemo;
185
+ /** Per-pattern exclusion hit counts from this session's matcher —
186
+ * driver-consumed reporting surface (dead-pattern visibility). */
187
+ getExcludeStats(): ReadonlyMap<string, number>;
188
+ /** Resolve the scan configuration from options — the single source of the
189
+ * exclude/extension policy shared by the full and incremental pipelines. */
190
+ private resolveScanConfig;
191
+ /**
192
+ * Watch entry point: one single-flight analysis transaction per event
193
+ * batch (openspec: next-webpack-served-transform-coherence, design D3).
194
+ * The first entering session runs the transaction; every concurrent
195
+ * entry — same session re-entered, or another compiler's session
196
+ * (client/server/RSC each hold their own instance) — joins the in-flight
197
+ * promise, so no compiler proceeds against a generation older than the
198
+ * one the transaction publishes. A rejected transaction rejects every
199
+ * joiner; the gate always clears.
200
+ */
201
+ handleWatchUpdate(changes: WatchChanges): Promise<void>;
202
+ /**
203
+ * Owner-side entry for a batch observed by a NON-OWNING compiler's
204
+ * watcher. Serializes behind any in-flight transaction, then runs the
205
+ * forwarded batch as its own transaction — never drops it (a forwarded
206
+ * batch has no other delivery; content-hash diffing makes an
207
+ * already-covered batch a cheap no-op).
208
+ */
209
+ ingestForwardedBatch(changes: WatchChanges): Promise<void>;
210
+ /**
211
+ * Incremental watch pass: geological reset when the system file changed,
212
+ * otherwise content-hash diffing restricted to the watcher's change sets
213
+ * (falling back to a full discovery walk when no sets are provided).
214
+ */
215
+ private processWatchUpdate;
216
+ /** The shared ingestion policy point (vite-plugin parity BY CODE): the
217
+ * capability guard, facts memo, and warn-dedupe lifecycle live in the
218
+ * pipeline; this host holds only its prefix, strict flag, and warn sink. */
219
+ private sourceIngestor;
220
+ /** Prepare one raw-source corpus through the shared adaptation boundary. */
221
+ private ingestRawSources;
222
+ /** Ingest and apply the shared per-file quarantine: one invalid original
223
+ * (an `.mdx` with the optional peer absent, an unsupported `.svelte`
224
+ * shape) warns and drops; the rest of the corpus still analyzes. Strict
225
+ * mode throws from the shared policy — callers route that into their own
226
+ * status/rollback handling. */
227
+ private ingestAccepted;
228
+ /** Surface parser diagnostics under the shared strict/warn policy. */
229
+ private surfaceSourceDiagnostics;
230
+ /**
231
+ * Correlate diagnostics emitted against generated children back to the
232
+ * external package owning their raw original.
233
+ */
234
+ private projectExternalFileOwners;
235
+ /** Publish the raw cache and complete parser projection atomically. */
236
+ private publishSourceIngestion;
237
+ runFullPipeline(pending?: Array<[string, string]>): Promise<void>;
238
+ /** The per-generation source state runFullPipeline mutates, captured as
239
+ * ONE object so the restore below cannot omit a member. The three
240
+ * deep-copied fields are the ones later steps mutate in place rather
241
+ * than reassign; everything else is rebound wholesale on success. */
242
+ private snapshotSourceState;
243
+ private restoreSourceState;
244
+ /**
245
+ * Reset analysis state for HMR geological reset. Payload write guards go
246
+ * back to null so the next publication reseeds them from the disk
247
+ * envelopes — a byte-identical post-reset artifact is still not
248
+ * rewritten.
249
+ */
250
+ resetForHmr(): void;
251
+ /**
252
+ * The (sourceKey, observedSourceHash) pairs of a watch batch — cheap
253
+ * evidence for the status file's pending set on the geological-reset
254
+ * path, where the batch's component edits ride along with the system
255
+ * edit (design D3: loaders wait only on observed inputs).
256
+ */
257
+ private pendingFromBatch;
258
+ /**
259
+ * Root-dirty inventory reconciliation (design D3): partition the
260
+ * watcher's change sets into explicit FILE events and external ROOT hits
261
+ * (a reported path that IS an admitted root, or a directory inside one),
262
+ * rewalk each dirty root through the shared discovery policy, diff the
263
+ * SourceId+raw-hash inventory against the previous generation, and merge
264
+ * the reconstructed created/edited/deleted deltas with the explicit
265
+ * events (identity-level dedup happens downstream at the cache gate).
266
+ * Deletion falls out of the inventory diff — webpack may report only the
267
+ * directory (probe-proven).
268
+ */
269
+ private reconcileExternalRoots;
270
+ /**
271
+ * Route one watcher-reported path (design D1/D2): a project-root member
272
+ * (lexical containment — existing local semantics preserved; consumer
273
+ * exclude patterns apply) or an admitted external member (identity
274
+ * resolution with symlink-escape rejection; package-relative excludes
275
+ * mirror the collection walk's filters — guardrail G1, one policy).
276
+ * Returns null for dropped paths.
277
+ */
278
+ private classifyWatchPath;
279
+ /** Build full raw originals for one shared adaptation attempt. */
280
+ private buildRawEntriesFromCache;
281
+ /**
282
+ * Run incremental pipeline with cache-aware file entries.
283
+ * Reuses system config from the last full pipeline run.
284
+ */
285
+ private runIncrementalPipeline;
286
+ /**
287
+ * Shared analysis + emit core for both pipelines — the single call site
288
+ * that routes every manifest through the shared `runProjectAnalysis`,
289
+ * reachable from both runFullPipeline (production) and
290
+ * runIncrementalPipeline (HMR).
291
+ *
292
+ * Owns diagnostic surfacing, CSS assembly + styles.css write guard,
293
+ * system-props module emit, and the timing log. The engine's own
294
+ * `dev_mode` (reconciliation pruning) is derived separately via
295
+ * `engineDevMode` — an explicit `mode` option overrides the pipeline
296
+ * path there. For everything else the `devMode` flag is the ONLY
297
+ * behavioral fork:
298
+ *
299
+ * - `false` (production): computes bt.analysis + logs the extraction
300
+ * report, and writes system-props.js UNCONDITIONALLY (no
301
+ * lastSystemPropsHash guard).
302
+ * - `true` (HMR): skips the report log, and guards the system-props.js
303
+ * write by lastSystemPropsHash.
304
+ *
305
+ * The disk artifacts land under the session directory in transaction
306
+ * order (design D1): manifest → analysis-inputs (Turbopack orchestration
307
+ * only) → styles.css → system-props → analysis-commit →
308
+ * replacements-epoch (last, only when moved). The analysis-status file walks starting → analyzing →
309
+ * committing → idle around the attempt, landing in `failed` (with the
310
+ * diagnostic) on any throw (design D3).
311
+ */
312
+ private analyzeAndEmit;
313
+ /**
314
+ * The engine's `dev_mode` flag (retain all components vs reconciliation
315
+ * pruning) is an EMISSION decision, so an explicit `mode` option wins over
316
+ * the pipeline path (core-options: `mode` "decides emitted bytes …
317
+ * engine devMode"). Without an explicit mode the historical per-pipeline
318
+ * default applies: full = production pruning, incremental = dev retention.
319
+ * A pinned-production watch must not flip to unpruned CSS on its first
320
+ * incremental republication, and a pinned-development full build must
321
+ * retain all components.
322
+ */
323
+ private engineDevMode;
324
+ private analyzeAndEmitAttempt;
325
+ /** Open a status attempt (attemptId increments once per burst — a
326
+ * debouncing pre-write and the analysis that follows share one id). */
327
+ private beginStatusAttempt;
328
+ /** Write the session's analysis-status artifact (design D3). Terminal
329
+ * states (idle/failed) close the attempt. */
330
+ private writeAnalysisStatus;
331
+ /**
332
+ * Orchestrator seam (Turbopack watcher): record watch events observed
333
+ * during the debounce window so a loader running ahead of the analysis
334
+ * has positive evidence to wait on (design D3 'debouncing'). Paths are
335
+ * filtered by the scan config and hashed at observation time.
336
+ */
337
+ noteDebouncedWatchEvents(absPaths: Iterable<string>): void;
338
+ /** One pending microtask flushes a burst of debounce observations. */
339
+ private debounceStatusWriteScheduled;
340
+ /**
341
+ * Write one payload artifact into the session directory, enveloped with
342
+ * `{sessionId, generation, replacementEpoch, payloadHash}` and rewritten
343
+ * only when the PAYLOAD bytes changed (byte-identical re-analyses leave
344
+ * disk untouched — spec: "Unchanged manifest is not rewritten"). The
345
+ * recorded diskHash (hash of the enveloped bytes) feeds the
346
+ * analysis-commit.
347
+ */
348
+ private publishPayloadArtifact;
349
+ /** Reconstruct a payload write guard from the on-disk artifact's envelope
350
+ * (same-session restart: a byte-identical payload must not rewrite). */
351
+ private seedPayloadRecord;
352
+ /** Last analysis-commit persisted in this session's directory, or null. */
353
+ private seedCommitFromDisk;
354
+ /**
355
+ * Publish the analysis-commit — the transaction identity (design D1).
356
+ * Written AFTER every payload and BEFORE the epoch; skipped entirely when
357
+ * the payload set (disk hashes) and epoch are unchanged, so a no-op
358
+ * re-analysis neither re-keys loader-worker hydration nor burns a
359
+ * generation.
360
+ */
361
+ private publishAnalysisCommit;
362
+ /**
363
+ * Publish the canonical replacement epoch: maintain the session-scoped
364
+ * disk witness `{schema, sessionId, epoch}`, rewritten ONLY when the
365
+ * epoch VALUE changes so style-only analyses and same-session restarts
366
+ * leave bytes and mtime untouched, then expose the value through the
367
+ * singleton for the plugin's needBuild fan-out and the loader's catch-up
368
+ * re-check. Every VALUE move also reconciles sibling sessions' epoch
369
+ * artifacts (below) — the webpack cold-cache validity witness.
370
+ */
371
+ private publishReplacementEpoch;
372
+ /**
373
+ * Sibling epoch reconciliation — the cross-session half of the webpack
374
+ * persistent-cache witness (spec: dev-served-transform-coherence,
375
+ * "Offline change invalidates restored modules"). Restored-module
376
+ * snapshots reference the epoch artifact of the session that BUILT them;
377
+ * with session-scoped trees that file would otherwise sit untouched
378
+ * forever, keeping stale snapshots valid. Whenever this session's epoch
379
+ * value moves, delete every sibling epoch artifact that disagrees (their
380
+ * snapshots must invalidate — restore-on-demand then rebuilds from the
381
+ * current generation) and leave agreeing siblings byte-untouched (warm
382
+ * restores stay valid). Deleting a stale artifact is pruning, not a
383
+ * foreign-session write; races with concurrent sessions are tolerated
384
+ * (S14).
385
+ */
386
+ /** Sibling ids already reconciled away (artifact deleted or absent) —
387
+ * nothing left to invalidate for them on later moves. */
388
+ private reconciledSiblingIds;
389
+ /** sessions-root listing memo, keyed by the root dir's mtime — a new or
390
+ * pruned sibling DIRECTORY moves it; agreeing siblings stay listed. */
391
+ private siblingListing;
392
+ private reconcileSiblingEpochs;
393
+ /** Epoch value held by this session's on-disk artifact, or null when
394
+ * absent, unreadable, or not the expected schema. */
395
+ private diskEpochValue;
396
+ /** True when the flat `.animus/` advisory lock names a live pid — a CLI
397
+ * invocation (build mid-publish, or a whole watch run) owns the flat
398
+ * tree right now, and any instantaneous inconsistency is its in-flight
399
+ * write, not debris. */
400
+ private cliWriterHoldsLock;
401
+ /** Session-start hygiene (design D2): delete legacy flat artifacts
402
+ * (unreachable by session-scoped loaders; the standalone CLI is the one
403
+ * remaining writer of flat payload names, and its live output is
404
+ * fenced off below) and prune sibling session directories older than
405
+ * the retention window — never the own dir, tolerating races with
406
+ * concurrently-pruning sessions (S14). */
407
+ private runSessionStartHygiene;
408
+ /** Ensure the session directory exists and write one artifact into it.
409
+ * Write-then-rename so cross-process readers (Turbopack loader workers)
410
+ * can never observe a torn half-written file. The tmp name carries the
411
+ * pid — Next dev evaluates the config in more than one process, and two
412
+ * sessions writing the same artifact must not race on one tmp path. */
413
+ private writeSessionArtifact;
414
+ /**
415
+ * asset() placeholder substitution (global-styles-system): resolve each
416
+ * referenced specifier through Node resolution, copy the bytes into the
417
+ * session directory's `assets/` under a content-hashed name, and
418
+ * substitute a RELATIVE url — relative to the session-scoped styles.css,
419
+ * which sits beside `assets/`, so the emitted `./assets/<file>` form is
420
+ * unchanged. The stylesheet is processed by Next's own CSS pipeline
421
+ * (webpack and Turbopack alike), which applies its native asset handling
422
+ * — publicPath and output hashing — to relative url() references.
423
+ * Unsubstitutable specifiers warn and emit literally in non-strict mode,
424
+ * fail the build under `strict: true`.
425
+ */
426
+ private substituteAssetReferences;
427
+ private trackAssetDependency;
428
+ /**
429
+ * Resolve an asset specifier to an absolute file via the shared pipeline
430
+ * resolver (host aliases → Node resolution → package root), with one
431
+ * session-local last resort: an already-discovered source entry's package
432
+ * root (dist-less workspace kits the shared resolver cannot see).
433
+ */
434
+ private resolveAssetSpecifier;
435
+ }
436
+ /**
437
+ * Sync `.animus/assets/` to the current build's content-hashed file set:
438
+ * anything else in the directory is a superseded revision (the copies are
439
+ * content-addressed and never overwritten) or the leftover of an asset()
440
+ * reference that no longer exists. Failures are tolerated per entry — Next
441
+ * dev evaluates the config in more than one process, and a concurrent
442
+ * session may have removed (or be about to rewrite) the same file; every
443
+ * pass rewrites whatever of its own set is missing, so races self-heal.
444
+ */
445
+ export declare function pruneStaleAssets(assetsDir: string, expected: ReadonlySet<string>): void;
446
+ //# sourceMappingURL=extraction-session.d.ts.map
@@ -0,0 +1 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AAqB;IACjD;4EACwE;IACxE,OAAO,CAAC,cAAc,CAAuD;IAE7E,OAAO,CAAC,sBAAsB;IA8C9B;0DACsD;IACtD,OAAO,CAAC,cAAc;IAatB;;;6BAGyB;IACzB,OAAO,CAAC,kBAAkB;IAkB1B;;;;;+CAK2C;IAC3C,OAAO,CAAC,sBAAsB;IAgE9B;;;;4EAIwE;IACxE,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,yBAAyB;IA4EjC,OAAO,CAAC,oBAAoB;IAK5B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;CA0B9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B,IAAI,CAgBN"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `@animus-ui/extract/session` — the artifact-publishing extraction
3
+ * session and its watcher orchestration, factored out of the Next plugin
4
+ * (openspec: standalone-extraction-cli, D1). Every driver — the Next
5
+ * plugin, the standalone CLI, the transform host — is a thin shell over
6
+ * this one drive loop; none may fork it.
7
+ *
8
+ * UNSTABLE SURFACE: this subpath exists for Animus's own drivers; its
9
+ * exports are the driver-consumed surface only (deliberately narrower than
10
+ * the session modules — internal state mutators, envelope encoders, and
11
+ * test seams stay off the published API) and may change without semver
12
+ * ceremony until the standalone CLI ships its consumer contract
13
+ * (standalone-extraction-cli inc 03/07).
14
+ */
15
+ export { ANIMUS_CSS_MODULE_ID, ExtractionSession, pruneStaleAssets, } from './extraction-session';
16
+ export type { SessionOptions, WatchChanges } from './extraction-session';
17
+ export { collectSessionAssets, verifyCommitRecord } from './published-set';
18
+ export type { SessionAsset } from './published-set';
19
+ export { analysisCommitPath, analysisInputsPath, analysisStatusPath, 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';
20
+ export type { AnalysisCommit, AnalysisStatus, SessionEnvelope, } from './session-paths';
21
+ export { runSessionPipeline, startTurbopackWatcher, } from './turbopack-orchestrator';
22
+ export type { TurbopackWatcherHandle } from './turbopack-orchestrator';
23
+ export { claimExclusiveSessionOwner, engineApi, getAnalysisPromise, getAnalyzedHashes, getManifestJson, getReplacementEpoch, getSessionArtifactDir, getSharedCss, getSharedExternalDirs, getSharedExternalEntries, getSharedSystemProps, setAnalysisPromise, setSharedEngine, } from './singleton';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,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,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EACL,0BAA0B,EAC1B,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The CLI published-set contract, shared logic (openspec:
3
+ * standalone-extraction-cli D3): ONE implementation of "does this flat
4
+ * artifact set verify against its commit record" and ONE collector for the
5
+ * session's copied asset() files — consumed by the CLI writer
6
+ * (staging/verification) and the session's start hygiene (confinement
7
+ * gate). Two copies of either had already drifted once: the hygiene copy
8
+ * verified payloads as UTF-8 strings while the writer hashed raw bytes, so
9
+ * any asset-carrying set (fonts are not UTF-8) could never verify and a
10
+ * legitimately published set was classified as debris.
11
+ */
12
+ /**
13
+ * Recompute every payload hash recorded in the directory's commit record
14
+ * and compare — raw bytes on both sides, matching the writer's hashing
15
+ * domain. Returns failure lines; empty means the set verifies. An absent
16
+ * or unparsable record is itself a failure (the record is written LAST, so
17
+ * a torn or aborted publish cannot verify).
18
+ */
19
+ export declare function verifyCommitRecord(dir: string): string[];
20
+ /** One published asset file: its session-relative name and raw bytes. */
21
+ export interface SessionAsset {
22
+ name: string;
23
+ bytes: Buffer;
24
+ }
25
+ /**
26
+ * Snapshot the session's copied asset() files (sorted by name) — read
27
+ * BEFORE the session tree is disposed. The emitted stylesheet references
28
+ * them as `./assets/<name>`, so every driver must publish them beside its
29
+ * stylesheet or the urls dangle.
30
+ */
31
+ export declare function collectSessionAssets(sessionDir: string | null): SessionAsset[];
32
+ //# sourceMappingURL=published-set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-set.d.ts","sourceRoot":"","sources":["../../session/published-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CA6BxD;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,YAAY,EAAE,CAOhB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Resolve external DS package specifiers to rootDir-relative entry paths.
3
+ * Node-generic (no webpack APIs): Pass 1 walks the consumer's workspaces for
4
+ * matching package names; Pass 2 falls back to `require.resolve`. Specifiers
5
+ * that resolve nowhere are simply omitted (spec: silent skip).
6
+ */
7
+ export declare function resolvePackagesByName(rootDir: string, names: string[]): Record<string, string>;
8
+ //# 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;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0DxB"}