@animus-ui/next-plugin 0.1.8 → 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.
@@ -1,367 +0,0 @@
1
- import type { AnimusNextOptions } from './types';
2
- /**
3
- * Module id the Rust emitter injects for the extracted stylesheet — also the
4
- * exact resolve.alias key with-animus registers for it, which the adapter's
5
- * alias harvesting must skip.
6
- */
7
- export declare const ANIMUS_CSS_MODULE_ID = ".animus/styles.css";
8
- /** Watch-cycle change sets, as reported by the bundler's watcher. */
9
- export interface WatchChanges {
10
- modifiedFiles?: ReadonlySet<string>;
11
- removedFiles?: ReadonlySet<string>;
12
- }
13
- /**
14
- * Bundler-agnostic extraction pipeline: system loading, source discovery
15
- * and ingestion, external-package collection, analysis, stylesheet and
16
- * system-props emission, and watch-cycle diffing.
17
- *
18
- * The webpack adapter (plugin.ts) owns only bundler wiring: hook
19
- * registration, alias harvesting from the compiler config, in-memory asset
20
- * replacement, and translating watch events into `handleWatchUpdate`
21
- * change sets. Keeping this class free of webpack types is deliberate — a
22
- * future Turbopack integration must drive the same session from outside
23
- * the bundler (Turbopack has no compiler-hook surface), reusing everything
24
- * here unchanged.
25
- *
26
- * Outputs are published through the package singleton (shared CSS,
27
- * manifest, system props) and written to `.animus/` on disk.
28
- */
29
- export declare class ExtractionSession {
30
- /** Set by the adapter before any pipeline run. */
31
- rootDir: string | null;
32
- /** Serialized path aliases, harvested by the adapter from bundler config. */
33
- pathAliasesJson: string | null;
34
- private assetCopyCache;
35
- /** Physical asset files registered with the host watcher. */
36
- assetDependencyPaths: Set<string>;
37
- private assetDependencyKeys;
38
- /** Emitter identity override for the system-props module id. Webpack mode
39
- * (null) injects the absolute `.animus/system-props.js` path, resolved by
40
- * NormalModuleReplacement; Turbopack rejects absolute-path imports, so
41
- * its driver sets the virtual id that `resolveAlias` maps to disk. */
42
- systemPropsModuleId: string | null;
43
- /** Whether the analysis-inputs hydration corpus is serialized + written.
44
- * False (webpack mode): the loader shares the pipeline process and reads
45
- * the manifest from memory — the corpus is never persisted. True is set
46
- * by the Turbopack orchestration driver, whose isolated loader workers
47
- * replay it (spec: next-turbopack-integration, "Manifest disk artifact" /
48
- * "Webpack mode skips the hydration corpus"). */
49
- persistAnalysisInputs: boolean;
50
- /** Absolute directory prefixes for external DS packages (loader allowlisting). */
51
- externalPackageDirs: string[];
52
- /** Absolute package dir → owning specifier (cross-source correlation). */
53
- private externalDirOwners;
54
- /** rootDir-relative external file → owning specifier (correlation join). */
55
- private externalFileOwners;
56
- /** External package specifier → absolute source entry path. */
57
- externalSourceEntries: Map<string, string>;
58
- /** SourceId derivation authority for the current generation (openspec:
59
- * external-source-watch-ingestion, design D2) — canonical roots
60
- * realpath'd once per full pipeline; alias→SourceId associations
61
- * recorded while files exist so deletion resolves through the cache. */
62
- private sourceIdentity;
63
- /** Canonical admitted external root → declared specifiers (set-valued
64
- * ownership, design D2; duplicate specifiers resolving to one canonical
65
- * root share it). Engine watch wiring and tests read this. */
66
- externalRootOwners: Map<string, Set<string>>;
67
- /** Canonical admitted external watch roots — the engine-side watch
68
- * surface (webpack contextDependencies / Turbopack watchers). */
69
- externalWatchRoots: string[];
70
- /** Canonical external root → (raw sourceKey → {raw content hash, recorded
71
- * abs spelling}): the previous-generation inventory a dirty-root rewalk
72
- * diffs against (design D3). Raw hashes — MDX preprocessing never skews
73
- * the diff; the recorded abs path is a registered deletion alias, so a
74
- * reconstructed deletion always resolves through cached identity. */
75
- private externalInventory;
76
- /** Sticky diagnostics (design D5/D7): stable key → message, re-surfaced
77
- * on every full pipeline until the underlying condition clears. */
78
- readonly stickyDiagnostics: Map<string, string>;
79
- /** Volume-membership predicate for the cross-volume gate (design D5).
80
- * Injected seam: the shared predicate only discriminates on Windows
81
- * (win32 semantics are unit-tested via path.win32), so runtime tests
82
- * drive the gate through this. */
83
- sharesProjectVolume: (projectRoot: string, externalRoot: string) => boolean;
84
- /** Orchestrator seams (openspec: external-source-watch-ingestion, design
85
- * D4). `onExternalRootResolved` fires per volume-admitted external root
86
- * DURING collection — after resolution, BEFORE that root's sources are
87
- * walked — so a watching host can open its handle with no blind gap
88
- * between scan and watch. `onExternalRootsCommitted` fires once after a
89
- * successful full-pipeline publication with the complete admitted
90
- * canonical root set (the host's promote/replay/close-old phase; a
91
- * failed pipeline never fires it, so the host rolls back). */
92
- onExternalRootResolved: ((canonicalRoot: string) => void) | null;
93
- onExternalRootsCommitted: ((canonicalRoots: string[]) => void) | null;
94
- private readonly options;
95
- private readonly staticCssJson;
96
- private system;
97
- /** Discovery-time keyframes diagnostics awaiting the shared surfacing pass. */
98
- private externalKeyframesDiagnostics;
99
- /** Full package-resolution map from the last full pipeline — replayed by
100
- * incremental passes (sourceEntries alone omits dist-resolved packages). */
101
- private lastPackageMap;
102
- private fileCache;
103
- private systemDependencyKeys;
104
- /** Loader-reported dependency paths for bundler watch registration. */
105
- systemDependencyPaths: string[];
106
- private systemDependencyHashes;
107
- private lastSystemPropsHash;
108
- /** Per-payload write guards: payloadHash gates rewrites (byte-identical
109
- * payloads leave disk untouched); diskHash is the hash of the CURRENT
110
- * disk bytes (envelope included) recorded in the analysis-commit. null =
111
- * not yet seeded (first publication reads the artifact's envelope so a
112
- * same-session restart never rewrites byte-identical artifacts). */
113
- private artifactRecords;
114
- /** Last written analysis-commit; null = seeded from disk on first use. */
115
- private lastCommit;
116
- /** Session identity — claimed once per PROCESS (one Next invocation),
117
- * adopted by every subsequent session instance so all compilers share
118
- * one artifact tree (design D2: `next dev`/`next build` co-writing are
119
- * separate processes and therefore separate sessions). */
120
- readonly sessionId: string;
121
- /** Epoch value of the last published analysis; null = not yet known
122
- * (seeded from the session dir's artifact on first publication so a
123
- * same-session restart with unchanged plans never rewrites bytes). */
124
- private lastEpochValue;
125
- /** Watcher debounce ceiling feeding status deadlines (design D3). */
126
- debounceCeilingMs: number;
127
- /** Test seam: observes every session-artifact write (name, content)
128
- * post-rename — write ORDER is part of the transaction contract. */
129
- onArtifactWrite: ((name: string, content: string) => void) | null;
130
- /** Status attempt bookkeeping (design D3). */
131
- private statusAttemptId;
132
- private statusAttemptOpen;
133
- /** Debounce-window observations pending analysis (sourceKey → hash). */
134
- private debouncePending;
135
- /** Session-start hygiene (pruning + legacy cleanup) runs once. */
136
- private sessionStartHygieneDone;
137
- private lcssTargets;
138
- constructor(options: AnimusNextOptions);
139
- /** This session's artifact directory. Requires `rootDir` to be set. */
140
- get sessionDir(): string;
141
- get verbose(): boolean;
142
- private log;
143
- private warn;
144
- private now;
145
- private elapsed;
146
- /** Lazily-computed scan config (options are constructor-fixed, so the
147
- * derivation is stable for the session's lifetime). */
148
- private scanConfigMemo;
149
- /** Resolve the scan configuration from options — the single source of the
150
- * exclude/extension policy shared by the full and incremental pipelines. */
151
- private resolveScanConfig;
152
- /**
153
- * Watch entry point: one single-flight analysis transaction per event
154
- * batch (openspec: next-webpack-served-transform-coherence, design D3).
155
- * The first entering session runs the transaction; every concurrent
156
- * entry — same session re-entered, or another compiler's session
157
- * (client/server/RSC each hold their own instance) — joins the in-flight
158
- * promise, so no compiler proceeds against a generation older than the
159
- * one the transaction publishes. A rejected transaction rejects every
160
- * joiner; the gate always clears.
161
- */
162
- handleWatchUpdate(changes: WatchChanges): Promise<void>;
163
- /**
164
- * Incremental watch pass: geological reset when the system file changed,
165
- * otherwise content-hash diffing restricted to the watcher's change sets
166
- * (falling back to a full discovery walk when no sets are provided).
167
- */
168
- private processWatchUpdate;
169
- /**
170
- * Preprocess one `.mdx` entry into scanner-consumable tsx. Returns the
171
- * rewritten source plus the `relPath + '.tsx'` path on success, or null
172
- * when the file must be skipped.
173
- *
174
- * `warn: false` (incremental watch pass) skips silently — the full
175
- * pipeline already surfaced the warning. `warn: true` (full pipeline)
176
- * warns ONCE for a missing @mdx-js/mdx dependency via the shared
177
- * `missingDepFlag` holder, and every time for a preprocessing error.
178
- */
179
- private preprocessMdxEntry;
180
- runFullPipeline(pending?: Array<[string, string]>): Promise<void>;
181
- /**
182
- * Reset analysis state for HMR geological reset. Payload write guards go
183
- * back to null so the next publication reseeds them from the disk
184
- * envelopes — a byte-identical post-reset artifact is still not
185
- * rewritten.
186
- */
187
- resetForHmr(): void;
188
- /**
189
- * The (sourceKey, observedSourceHash) pairs of a watch batch — cheap
190
- * evidence for the status file's pending set on the geological-reset
191
- * path, where the batch's component edits ride along with the system
192
- * edit (design D3: loaders wait only on observed inputs).
193
- */
194
- private pendingFromBatch;
195
- /**
196
- * Root-dirty inventory reconciliation (design D3): partition the
197
- * watcher's change sets into explicit FILE events and external ROOT hits
198
- * (a reported path that IS an admitted root, or a directory inside one),
199
- * rewalk each dirty root through the shared discovery policy, diff the
200
- * SourceId+raw-hash inventory against the previous generation, and merge
201
- * the reconstructed created/edited/deleted deltas with the explicit
202
- * events (identity-level dedup happens downstream at the cache gate).
203
- * Deletion falls out of the inventory diff — webpack may report only the
204
- * directory (probe-proven).
205
- */
206
- private reconcileExternalRoots;
207
- /**
208
- * Route one watcher-reported path (design D1/D2): a project-root member
209
- * (lexical containment — existing local semantics preserved; consumer
210
- * exclude patterns apply) or an admitted external member (identity
211
- * resolution with symlink-escape rejection; package-relative excludes
212
- * mirror the collection walk's filters — guardrail G1, one policy).
213
- * Returns null for dropped paths.
214
- */
215
- private classifyWatchPath;
216
- /**
217
- * Build file entries from cache: every cached file rides with full source.
218
- * The v2 engine has NO Rust-side cache (arch-extract-v2-spine: uncached
219
- * re-analysis beats a cache-hit path), so it must always receive full sources
220
- * (openspec: retire-extract-v1 removed the v1 empty-source cache contract).
221
- */
222
- private buildFileEntriesFromCache;
223
- /**
224
- * Run incremental pipeline with cache-aware file entries.
225
- * Reuses system config from the last full pipeline run.
226
- */
227
- private runIncrementalPipeline;
228
- /**
229
- * Shared analysis + emit core for both pipelines — the single call site
230
- * that routes every manifest through the shared `runProjectAnalysis`,
231
- * reachable from both runFullPipeline (production) and
232
- * runIncrementalPipeline (HMR).
233
- *
234
- * Owns diagnostic surfacing, CSS assembly + styles.css write guard,
235
- * system-props module emit, and the timing log. The `devMode` flag is the
236
- * ONLY behavioral fork:
237
- *
238
- * - `false` (production): computes bt.analysis + logs the extraction
239
- * report, and writes system-props.js UNCONDITIONALLY (no
240
- * lastSystemPropsHash guard).
241
- * - `true` (HMR): skips the report log, and guards the system-props.js
242
- * write by lastSystemPropsHash.
243
- *
244
- * The disk artifacts land under the session directory in transaction
245
- * order (design D1): manifest → analysis-inputs (Turbopack orchestration
246
- * only) → styles.css → system-props → analysis-commit →
247
- * replacements-epoch (last, only when moved). The analysis-status file walks starting → analyzing →
248
- * committing → idle around the attempt, landing in `failed` (with the
249
- * diagnostic) on any throw (design D3).
250
- */
251
- private analyzeAndEmit;
252
- private analyzeAndEmitAttempt;
253
- /** Open a status attempt (attemptId increments once per burst — a
254
- * debouncing pre-write and the analysis that follows share one id). */
255
- private beginStatusAttempt;
256
- /** Write the session's analysis-status artifact (design D3). Terminal
257
- * states (idle/failed) close the attempt. */
258
- private writeAnalysisStatus;
259
- /**
260
- * Orchestrator seam (Turbopack watcher): record watch events observed
261
- * during the debounce window so a loader running ahead of the analysis
262
- * has positive evidence to wait on (design D3 'debouncing'). Paths are
263
- * filtered by the scan config and hashed at observation time.
264
- */
265
- noteDebouncedWatchEvents(absPaths: Iterable<string>): void;
266
- /** One pending microtask flushes a burst of debounce observations. */
267
- private debounceStatusWriteScheduled;
268
- /**
269
- * Write one payload artifact into the session directory, enveloped with
270
- * `{sessionId, generation, replacementEpoch, payloadHash}` and rewritten
271
- * only when the PAYLOAD bytes changed (byte-identical re-analyses leave
272
- * disk untouched — spec: "Unchanged manifest is not rewritten"). The
273
- * recorded diskHash (hash of the enveloped bytes) feeds the
274
- * analysis-commit.
275
- */
276
- private publishPayloadArtifact;
277
- /** Reconstruct a payload write guard from the on-disk artifact's envelope
278
- * (same-session restart: a byte-identical payload must not rewrite). */
279
- private seedPayloadRecord;
280
- /** Last analysis-commit persisted in this session's directory, or null. */
281
- private seedCommitFromDisk;
282
- /**
283
- * Publish the analysis-commit — the transaction identity (design D1).
284
- * Written AFTER every payload and BEFORE the epoch; skipped entirely when
285
- * the payload set (disk hashes) and epoch are unchanged, so a no-op
286
- * re-analysis neither re-keys loader-worker hydration nor burns a
287
- * generation.
288
- */
289
- private publishAnalysisCommit;
290
- /**
291
- * Publish the canonical replacement epoch: maintain the session-scoped
292
- * disk witness `{schema, sessionId, epoch}`, rewritten ONLY when the
293
- * epoch VALUE changes so style-only analyses and same-session restarts
294
- * leave bytes and mtime untouched, then expose the value through the
295
- * singleton for the plugin's needBuild fan-out and the loader's catch-up
296
- * re-check. Every VALUE move also reconciles sibling sessions' epoch
297
- * artifacts (below) — the webpack cold-cache validity witness.
298
- */
299
- private publishReplacementEpoch;
300
- /**
301
- * Sibling epoch reconciliation — the cross-session half of the webpack
302
- * persistent-cache witness (spec: dev-served-transform-coherence,
303
- * "Offline change invalidates restored modules"). Restored-module
304
- * snapshots reference the epoch artifact of the session that BUILT them;
305
- * with session-scoped trees that file would otherwise sit untouched
306
- * forever, keeping stale snapshots valid. Whenever this session's epoch
307
- * value moves, delete every sibling epoch artifact that disagrees (their
308
- * snapshots must invalidate — restore-on-demand then rebuilds from the
309
- * current generation) and leave agreeing siblings byte-untouched (warm
310
- * restores stay valid). Deleting a stale artifact is pruning, not a
311
- * foreign-session write; races with concurrent sessions are tolerated
312
- * (S14).
313
- */
314
- /** Sibling ids already reconciled away (artifact deleted or absent) —
315
- * nothing left to invalidate for them on later moves. */
316
- private reconciledSiblingIds;
317
- /** sessions-root listing memo, keyed by the root dir's mtime — a new or
318
- * pruned sibling DIRECTORY moves it; agreeing siblings stay listed. */
319
- private siblingListing;
320
- private reconcileSiblingEpochs;
321
- /** Epoch value held by this session's on-disk artifact, or null when
322
- * absent, unreadable, or not the expected schema. */
323
- private diskEpochValue;
324
- /** Session-start hygiene (design D2): delete legacy flat artifacts
325
- * (unreachable by session-scoped loaders) and prune sibling session
326
- * directories older than the retention window — never the own dir,
327
- * tolerating races with concurrently-pruning sessions (S14). */
328
- private runSessionStartHygiene;
329
- /** Ensure the session directory exists and write one artifact into it.
330
- * Write-then-rename so cross-process readers (Turbopack loader workers)
331
- * can never observe a torn half-written file. The tmp name carries the
332
- * pid — Next dev evaluates the config in more than one process, and two
333
- * sessions writing the same artifact must not race on one tmp path. */
334
- private writeSessionArtifact;
335
- /**
336
- * asset() placeholder substitution (global-styles-system): resolve each
337
- * referenced specifier through Node resolution, copy the bytes into the
338
- * session directory's `assets/` under a content-hashed name, and
339
- * substitute a RELATIVE url — relative to the session-scoped styles.css,
340
- * which sits beside `assets/`, so the emitted `./assets/<file>` form is
341
- * unchanged. The stylesheet is processed by Next's own CSS pipeline
342
- * (webpack and Turbopack alike), which applies its native asset handling
343
- * — publicPath and output hashing — to relative url() references.
344
- * Unsubstitutable specifiers warn and emit literally in non-strict mode,
345
- * fail the build under `strict: true`.
346
- */
347
- private substituteAssetReferences;
348
- private trackAssetDependency;
349
- /**
350
- * Resolve an asset specifier to an absolute file via the shared pipeline
351
- * resolver (host aliases → Node resolution → package root), with one
352
- * session-local last resort: an already-discovered source entry's package
353
- * root (dist-less workspace kits the shared resolver cannot see).
354
- */
355
- private resolveAssetSpecifier;
356
- }
357
- /**
358
- * Sync `.animus/assets/` to the current build's content-hashed file set:
359
- * anything else in the directory is a superseded revision (the copies are
360
- * content-addressed and never overwritten) or the leftover of an asset()
361
- * reference that no longer exists. Failures are tolerated per entry — Next
362
- * dev evaluates the config in more than one process, and a concurrent
363
- * session may have removed (or be about to rewrite) the same file; every
364
- * pass rewrites whatever of its own set is missing, so races self-heal.
365
- */
366
- export declare function pruneStaleAssets(assetsDir: string, expected: ReadonlySet<string>): void;
367
- //# sourceMappingURL=extraction-session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extraction-session.d.ts","sourceRoot":"","sources":["../src/extraction-session.ts"],"names":[],"mappings":"AA2FA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AASjD;;;;GAIG;AACH,eAAO,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,OAAO,CAAC,oBAAoB,CAAqB;IACjD;4EACwE;IACxE,OAAO,CAAC,cAAc,CAAuD;IAE7E,OAAO,CAAC,sBAAsB;IA8C9B;0DACsD;IACtD,OAAO,CAAC,cAAc;IAatB;;;qEAGiE;IACjE,OAAO,CAAC,sBAAsB;IA+B9B;;;;4EAIwE;IACxE,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,yBAAyB;IA2EjC,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"}
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-packages.d.ts","sourceRoot":"","sources":["../src/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"}
@@ -1,229 +0,0 @@
1
- require("./turbopack-loader.cjs");
2
- let path = require("path");
3
- //#region src/session-paths.ts
4
- /**
5
- * Session-scoped artifact names, path derivations, and the analysis-status
6
- * shape (openspec: next-turbopack-served-transform-coherence, design D1–D3)
7
- * — shared by the session writer (extraction-session), the webpack
8
- * plugin/loader, and the Turbopack loader.
9
- *
10
- * Deliberately free of singleton/session imports: the Turbopack loader
11
- * executes in isolated worker processes and its module graph must stay
12
- * worker-local (guardrail G1) — this module is pure path/shape vocabulary.
13
- */
14
- /** Session-dir-relative name of the replacement-epoch disk witness
15
- * (openspec: next-webpack-served-transform-coherence, design D2;
16
- * session-scoped by next-turbopack-served-transform-coherence D2). */
17
- const REPLACEMENT_EPOCH_ARTIFACT = "replacements-epoch";
18
- /** Session-dir-relative name of the analysis-commit transaction artifact
19
- * (design D1). */
20
- const ANALYSIS_COMMIT_ARTIFACT = "analysis-commit";
21
- /** Session-dir-relative name of the analysis-status artifact (design D3). */
22
- const ANALYSIS_STATUS_ARTIFACT = "analysis-status.json";
23
- /** Session-dir-relative name of the manifest payload artifact. */
24
- const MANIFEST_ARTIFACT = "manifest.json";
25
- /** Session-dir-relative name of the analysis-inputs payload artifact
26
- * (Turbopack loader-worker hydration corpus). */
27
- const ANALYSIS_INPUTS_ARTIFACT = "analysis-inputs.json";
28
- /** Session-dir-relative name of the emitted stylesheet artifact. */
29
- const STYLES_ARTIFACT = "styles.css";
30
- /** Session-dir-relative name of the emitted system-props module. */
31
- const SYSTEM_PROPS_ARTIFACT = "system-props.js";
32
- /** Session-dir-relative directory holding copied asset() files. */
33
- const SESSION_ASSETS_DIR = "assets";
34
- /** Root of every session-scoped artifact tree for a project. */
35
- function sessionsRootDir(rootDir) {
36
- return (0, path.join)(rootDir, ".animus", "sessions");
37
- }
38
- /** One session's artifact directory (design D2: session-scoped trees,
39
- * no global pointer). */
40
- function sessionArtifactDir(rootDir, sessionId) {
41
- return (0, path.join)(sessionsRootDir(rootDir), sessionId);
42
- }
43
- /** Absolute path of a session's replacement-epoch artifact — the single
44
- * derivation shared by the session writer, the webpack plugin's
45
- * watch-ignore entry, and both loaders' file dependencies. Takes the
46
- * SESSION directory (not the project root) since the artifact was
47
- * relocated into the session tree. */
48
- function replacementEpochPath(sessionDir) {
49
- return (0, path.join)(sessionDir, REPLACEMENT_EPOCH_ARTIFACT);
50
- }
51
- /** Absolute path of a session's analysis-commit artifact. */
52
- function analysisCommitPath(sessionDir) {
53
- return (0, path.join)(sessionDir, ANALYSIS_COMMIT_ARTIFACT);
54
- }
55
- /** Absolute path of a session's analysis-status artifact. */
56
- function analysisStatusPath(sessionDir) {
57
- return (0, path.join)(sessionDir, ANALYSIS_STATUS_ARTIFACT);
58
- }
59
- /** Absolute path of a session's manifest artifact. */
60
- function manifestPath(sessionDir) {
61
- return (0, path.join)(sessionDir, MANIFEST_ARTIFACT);
62
- }
63
- /** Absolute path of a session's analysis-inputs artifact. */
64
- function analysisInputsPath(sessionDir) {
65
- return (0, path.join)(sessionDir, ANALYSIS_INPUTS_ARTIFACT);
66
- }
67
- /** Absolute path of a session's stylesheet artifact. */
68
- function stylesPath(sessionDir) {
69
- return (0, path.join)(sessionDir, STYLES_ARTIFACT);
70
- }
71
- /** Absolute path of a session's system-props module artifact. */
72
- function systemPropsPath(sessionDir) {
73
- return (0, path.join)(sessionDir, SYSTEM_PROPS_ARTIFACT);
74
- }
75
- /** Splice the session envelope into a JSON-object payload as a leading
76
- * `__animusSession` field, byte-preserving the payload's own content
77
- * (parse/re-stringify could reformat engine-emitted JSON). */
78
- function envelopeJsonArtifact(payload, envelopeJson) {
79
- const trimmed = payload.trimStart();
80
- if (!trimmed.startsWith("{")) return payload;
81
- if (trimmed.slice(1).trimStart().startsWith("}")) return `{"__animusSession":${envelopeJson}}`;
82
- return `{"__animusSession":${envelopeJson},${trimmed.slice(1)}`;
83
- }
84
- /** Trailing-comment side-band for the CSS artifact (a leading comment
85
- * would displace the @layer declaration consumers pin at offset 0). */
86
- function envelopeCssArtifact(payload, envelopeJson) {
87
- return `${payload}\n/* __animusSession ${envelopeJson} */\n`;
88
- }
89
- /** Matches the CSS artifact's envelope side-band. */
90
- const ENVELOPE_CSS_COMMENT_RE = /\/\* __animusSession (\{.*\}) \*\//;
91
- /** Envelope of a JSON artifact's bytes, or undefined when the artifact
92
- * carries none. THROWS on unparseable bytes — callers decide whether a
93
- * torn artifact fails closed or degrades. */
94
- function readJsonEnvelope(bytes) {
95
- return JSON.parse(bytes).__animusSession;
96
- }
97
- /** Envelope of the CSS artifact's side-band comment, or undefined when the
98
- * side-band is absent. THROWS on an unparseable envelope body. */
99
- function readCssEnvelope(bytes) {
100
- const match = bytes.match(ENVELOPE_CSS_COMMENT_RE);
101
- return match ? JSON.parse(match[1]) : void 0;
102
- }
103
- //#endregion
104
- Object.defineProperty(exports, "ANALYSIS_COMMIT_ARTIFACT", {
105
- enumerable: true,
106
- get: function() {
107
- return ANALYSIS_COMMIT_ARTIFACT;
108
- }
109
- });
110
- Object.defineProperty(exports, "ANALYSIS_INPUTS_ARTIFACT", {
111
- enumerable: true,
112
- get: function() {
113
- return ANALYSIS_INPUTS_ARTIFACT;
114
- }
115
- });
116
- Object.defineProperty(exports, "ANALYSIS_STATUS_ARTIFACT", {
117
- enumerable: true,
118
- get: function() {
119
- return ANALYSIS_STATUS_ARTIFACT;
120
- }
121
- });
122
- Object.defineProperty(exports, "MANIFEST_ARTIFACT", {
123
- enumerable: true,
124
- get: function() {
125
- return MANIFEST_ARTIFACT;
126
- }
127
- });
128
- Object.defineProperty(exports, "REPLACEMENT_EPOCH_ARTIFACT", {
129
- enumerable: true,
130
- get: function() {
131
- return REPLACEMENT_EPOCH_ARTIFACT;
132
- }
133
- });
134
- Object.defineProperty(exports, "SESSION_ASSETS_DIR", {
135
- enumerable: true,
136
- get: function() {
137
- return SESSION_ASSETS_DIR;
138
- }
139
- });
140
- Object.defineProperty(exports, "STYLES_ARTIFACT", {
141
- enumerable: true,
142
- get: function() {
143
- return STYLES_ARTIFACT;
144
- }
145
- });
146
- Object.defineProperty(exports, "SYSTEM_PROPS_ARTIFACT", {
147
- enumerable: true,
148
- get: function() {
149
- return SYSTEM_PROPS_ARTIFACT;
150
- }
151
- });
152
- Object.defineProperty(exports, "analysisCommitPath", {
153
- enumerable: true,
154
- get: function() {
155
- return analysisCommitPath;
156
- }
157
- });
158
- Object.defineProperty(exports, "analysisInputsPath", {
159
- enumerable: true,
160
- get: function() {
161
- return analysisInputsPath;
162
- }
163
- });
164
- Object.defineProperty(exports, "analysisStatusPath", {
165
- enumerable: true,
166
- get: function() {
167
- return analysisStatusPath;
168
- }
169
- });
170
- Object.defineProperty(exports, "envelopeCssArtifact", {
171
- enumerable: true,
172
- get: function() {
173
- return envelopeCssArtifact;
174
- }
175
- });
176
- Object.defineProperty(exports, "envelopeJsonArtifact", {
177
- enumerable: true,
178
- get: function() {
179
- return envelopeJsonArtifact;
180
- }
181
- });
182
- Object.defineProperty(exports, "manifestPath", {
183
- enumerable: true,
184
- get: function() {
185
- return manifestPath;
186
- }
187
- });
188
- Object.defineProperty(exports, "readCssEnvelope", {
189
- enumerable: true,
190
- get: function() {
191
- return readCssEnvelope;
192
- }
193
- });
194
- Object.defineProperty(exports, "readJsonEnvelope", {
195
- enumerable: true,
196
- get: function() {
197
- return readJsonEnvelope;
198
- }
199
- });
200
- Object.defineProperty(exports, "replacementEpochPath", {
201
- enumerable: true,
202
- get: function() {
203
- return replacementEpochPath;
204
- }
205
- });
206
- Object.defineProperty(exports, "sessionArtifactDir", {
207
- enumerable: true,
208
- get: function() {
209
- return sessionArtifactDir;
210
- }
211
- });
212
- Object.defineProperty(exports, "sessionsRootDir", {
213
- enumerable: true,
214
- get: function() {
215
- return sessionsRootDir;
216
- }
217
- });
218
- Object.defineProperty(exports, "stylesPath", {
219
- enumerable: true,
220
- get: function() {
221
- return stylesPath;
222
- }
223
- });
224
- Object.defineProperty(exports, "systemPropsPath", {
225
- enumerable: true,
226
- get: function() {
227
- return systemPropsPath;
228
- }
229
- });