@animus-ui/extract 0.1.11 → 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 (103) hide show
  1. package/README.md +47 -0
  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 +11 -6
  7. package/dist/index.mjs +2 -2
  8. package/dist/pipeline/analyze-project-args.d.ts +0 -12
  9. package/dist/pipeline/analyze-project-args.d.ts.map +1 -1
  10. package/dist/pipeline/assemble-stylesheet.d.ts +0 -35
  11. package/dist/pipeline/assemble-stylesheet.d.ts.map +1 -1
  12. package/dist/pipeline/asset-placeholders.d.ts +0 -25
  13. package/dist/pipeline/asset-placeholders.d.ts.map +1 -1
  14. package/dist/pipeline/content-hash.d.ts +0 -7
  15. package/dist/pipeline/content-hash.d.ts.map +1 -1
  16. package/dist/pipeline/core-options.d.ts +27 -93
  17. package/dist/pipeline/core-options.d.ts.map +1 -1
  18. package/dist/pipeline/correlate-external-tokens.d.ts +10 -18
  19. package/dist/pipeline/correlate-external-tokens.d.ts.map +1 -1
  20. package/dist/pipeline/discover-files.d.ts +1 -9
  21. package/dist/pipeline/discover-files.d.ts.map +1 -1
  22. package/dist/pipeline/discover-packages.d.ts +18 -154
  23. package/dist/pipeline/discover-packages.d.ts.map +1 -1
  24. package/dist/pipeline/dynamic-prop-config.d.ts +4 -19
  25. package/dist/pipeline/dynamic-prop-config.d.ts.map +1 -1
  26. package/dist/pipeline/engine-adapter.d.ts +16 -52
  27. package/dist/pipeline/engine-adapter.d.ts.map +1 -1
  28. package/dist/pipeline/engine-retirement.d.ts +0 -19
  29. package/dist/pipeline/engine-retirement.d.ts.map +1 -1
  30. package/dist/pipeline/error-diagnostics.d.ts +0 -24
  31. package/dist/pipeline/error-diagnostics.d.ts.map +1 -1
  32. package/dist/pipeline/index.d.ts +9 -8
  33. package/dist/pipeline/index.d.ts.map +1 -1
  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 +32 -37
  37. package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -1
  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 +9 -33
  41. package/dist/pipeline/mdx-preprocessor.d.ts.map +1 -1
  42. package/dist/pipeline/path-aliases.d.ts +0 -19
  43. package/dist/pipeline/path-aliases.d.ts.map +1 -1
  44. package/dist/pipeline/post-process-css.d.ts +0 -8
  45. package/dist/pipeline/post-process-css.d.ts.map +1 -1
  46. package/dist/pipeline/prefix.d.ts +3 -10
  47. package/dist/pipeline/prefix.d.ts.map +1 -1
  48. package/dist/pipeline/replacement-plans.d.ts +10 -34
  49. package/dist/pipeline/replacement-plans.d.ts.map +1 -1
  50. package/dist/pipeline/resolve-asset.d.ts +4 -7
  51. package/dist/pipeline/resolve-asset.d.ts.map +1 -1
  52. package/dist/pipeline/run-analysis.d.ts +15 -27
  53. package/dist/pipeline/run-analysis.d.ts.map +1 -1
  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 +23 -53
  57. package/dist/pipeline/source-identity.d.ts.map +1 -1
  58. package/dist/pipeline/source-ingestion.d.ts +48 -53
  59. package/dist/pipeline/source-ingestion.d.ts.map +1 -1
  60. package/dist/pipeline/static-css.d.ts +4 -13
  61. package/dist/pipeline/static-css.d.ts.map +1 -1
  62. package/dist/pipeline/structural-self-check.d.ts +0 -20
  63. package/dist/pipeline/structural-self-check.d.ts.map +1 -1
  64. package/dist/pipeline/svelte-source-adapter.d.ts +5 -12
  65. package/dist/pipeline/svelte-source-adapter.d.ts.map +1 -1
  66. package/dist/pipeline/system-config.d.ts +15 -32
  67. package/dist/pipeline/system-config.d.ts.map +1 -1
  68. package/dist/pipeline/system-props-module.d.ts +0 -15
  69. package/dist/pipeline/system-props-module.d.ts.map +1 -1
  70. package/dist/pipeline/timing-waterfall.d.ts +0 -11
  71. package/dist/pipeline/timing-waterfall.d.ts.map +1 -1
  72. package/dist/pipeline/tsconfig-paths.d.ts +2 -3
  73. package/dist/pipeline/tsconfig-paths.d.ts.map +1 -1
  74. package/dist/pipeline/unit-fallback.d.ts +0 -5
  75. package/dist/pipeline/unit-fallback.d.ts.map +1 -1
  76. package/dist/pipeline/utils.d.ts +1 -1
  77. package/dist/pipeline/utils.d.ts.map +1 -1
  78. package/dist/pipeline/watch-keys.d.ts +0 -10
  79. package/dist/pipeline/watch-keys.d.ts.map +1 -1
  80. package/dist/{pipeline-lkbOoyAr.mjs → pipeline-DeEENy5C.mjs} +1940 -2263
  81. package/dist/{pipeline-ojNeABi0.cjs → pipeline-x1yBZ2UP.cjs} +1970 -2269
  82. package/dist/session/extraction-session.d.ts +110 -316
  83. package/dist/session/extraction-session.d.ts.map +1 -1
  84. package/dist/session/index.d.ts +6 -20
  85. package/dist/session/index.d.ts.map +1 -1
  86. package/dist/session/published-set.d.ts +45 -25
  87. package/dist/session/published-set.d.ts.map +1 -1
  88. package/dist/session/resolve-packages.d.ts +6 -7
  89. package/dist/session/resolve-packages.d.ts.map +1 -1
  90. package/dist/session/session-paths.d.ts +38 -72
  91. package/dist/session/session-paths.d.ts.map +1 -1
  92. package/dist/session/singleton.d.ts +32 -71
  93. package/dist/session/singleton.d.ts.map +1 -1
  94. package/dist/session/timing.d.ts +0 -5
  95. package/dist/session/timing.d.ts.map +1 -1
  96. package/dist/session/turbopack-orchestrator.d.ts +17 -33
  97. package/dist/session/turbopack-orchestrator.d.ts.map +1 -1
  98. package/dist/session.cjs +530 -677
  99. package/dist/session.mjs +517 -672
  100. package/index-v2.js +0 -9
  101. package/package.json +9 -8
  102. package/dist/pipeline/external-keyframes.d.ts +0 -23
  103. package/dist/pipeline/external-keyframes.d.ts.map +0 -1
@@ -1 +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"}
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"}
@@ -1,32 +1,52 @@
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
- */
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. */
19
10
  export declare function verifyCommitRecord(dir: string): string[];
20
- /** One published asset file: its session-relative name and raw bytes. */
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;
21
45
  export interface SessionAsset {
22
46
  name: string;
23
47
  bytes: Buffer;
24
48
  }
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
- */
49
+ /** Snapshot the session's copied asset() files, sorted, BEFORE the session
50
+ * tree is disposed. Drivers publish them beside the emitted stylesheet. */
31
51
  export declare function collectSessionAssets(sessionDir: string | null): SessionAsset[];
32
52
  //# sourceMappingURL=published-set.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"published-set.d.ts","sourceRoot":"","sources":["../../session/published-set.ts"],"names":[],"mappings":"AA2CA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAiBrE;AAED;gFACgF;AAChF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAA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YAAY,EAAE,CAOhB"}
@@ -1,8 +1,7 @@
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>;
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;
8
7
  //# sourceMappingURL=resolve-packages.d.ts.map
@@ -1 +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"}
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"}
@@ -1,30 +1,19 @@
1
1
  /**
2
- * Session-scoped artifact names, path derivations, and the analysis-status
3
- * shape (openspec: next-turbopack-served-transform-coherence, design D1–D3)
4
- * — shared by the session writer (extraction-session), the webpack
5
- * plugin/loader, and the Turbopack loader.
6
- *
7
- * Deliberately free of singleton/session imports: the Turbopack loader
8
- * executes in isolated worker processes and its module graph must stay
9
- * worker-local (guardrail G1) — this module is pure path/shape vocabulary.
2
+ * Session artifact names, path derivations, and artifact shapes. Imports no
3
+ * session or singleton module: the Turbopack loader graph stays worker-local.
10
4
  */
11
- /** Session-dir-relative name of the replacement-epoch disk witness
12
- * (openspec: next-webpack-served-transform-coherence, design D2;
13
- * session-scoped by next-turbopack-served-transform-coherence D2). */
5
+ /** Session-dir-relative name of the replacement-epoch disk witness. */
14
6
  export declare const REPLACEMENT_EPOCH_ARTIFACT = "replacements-epoch";
15
- /** Virtual module id of the emitted system-props module — session
16
- * vocabulary shared by the orchestrator and the Turbopack config
17
- * assembly (hoisted here so the session home stays framework-free). */
7
+ /** Virtual module id of the emitted system-props module. */
18
8
  export declare const TURBOPACK_SYSTEM_PROPS_ID = "virtual:animus/system-props";
19
- /** Session-dir-relative name of the analysis-commit transaction artifact
20
- * (design D1). */
9
+ /** Session-dir-relative name of the analysis-commit transaction artifact. */
21
10
  export declare const ANALYSIS_COMMIT_ARTIFACT = "analysis-commit";
22
- /** Session-dir-relative name of the analysis-status artifact (design D3). */
11
+ /** Session-dir-relative name of the analysis-status artifact. */
23
12
  export declare const ANALYSIS_STATUS_ARTIFACT = "analysis-status.json";
24
13
  /** Session-dir-relative name of the manifest payload artifact. */
25
14
  export declare const MANIFEST_ARTIFACT = "manifest.json";
26
- /** Session-dir-relative name of the analysis-inputs payload artifact
27
- * (Turbopack loader-worker hydration corpus). */
15
+ /** Session-dir-relative name of the analysis-inputs payload artifact — the
16
+ * Turbopack loader-worker hydration corpus. */
28
17
  export declare const ANALYSIS_INPUTS_ARTIFACT = "analysis-inputs.json";
29
18
  /** Session-dir-relative name of the emitted stylesheet artifact. */
30
19
  export declare const STYLES_ARTIFACT = "styles.css";
@@ -32,46 +21,31 @@ export declare const STYLES_ARTIFACT = "styles.css";
32
21
  export declare const SYSTEM_PROPS_ARTIFACT = "system-props.js";
33
22
  /** Session-dir-relative directory holding copied asset() files. */
34
23
  export declare const SESSION_ASSETS_DIR = "assets";
35
- /** The standalone CLI's published-set commit record, written into the flat
36
- * `.animus/` tree (openspec: standalone-extraction-cli D3). Shared here so
37
- * the CLI writer and the session's start hygiene agree on ONE name — the
38
- * hygiene confinement gate keys on this record, and a renamed literal on
39
- * either side would silently re-arm deletion of the CLI's published output. */
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. */
40
26
  export declare const CLI_COMMIT_ARTIFACT = "commit.json";
41
- /** The standalone CLI's single-writer advisory lock in the flat `.animus/`
42
- * tree. A live holder means a CLI invocation owns that tree right now. */
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. */
43
29
  export declare const CLI_LOCK_ARTIFACT = "lock.json";
44
- /** Root of every session-scoped artifact tree for a project. */
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";
45
38
  export declare function sessionsRootDir(rootDir: string): string;
46
- /** One session's artifact directory (design D2: session-scoped trees,
47
- * no global pointer). */
48
39
  export declare function sessionArtifactDir(rootDir: string, sessionId: string): string;
49
- /** Absolute path of a session's replacement-epoch artifact — the single
50
- * derivation shared by the session writer, the webpack plugin's
51
- * watch-ignore entry, and both loaders' file dependencies. Takes the
52
- * SESSION directory (not the project root) since the artifact was
53
- * relocated into the session tree. */
54
40
  export declare function replacementEpochPath(sessionDir: string): string;
55
- /** Absolute path of a session's analysis-commit artifact. */
56
41
  export declare function analysisCommitPath(sessionDir: string): string;
57
- /** Absolute path of a session's analysis-status artifact. */
58
42
  export declare function analysisStatusPath(sessionDir: string): string;
59
- /** Absolute path of a session's manifest artifact. */
60
43
  export declare function manifestPath(sessionDir: string): string;
61
- /** Absolute path of a session's analysis-inputs artifact. */
62
44
  export declare function analysisInputsPath(sessionDir: string): string;
63
- /** Absolute path of a session's stylesheet artifact. */
64
45
  export declare function stylesPath(sessionDir: string): string;
65
- /** Absolute path of a session's system-props module artifact. */
66
46
  export declare function systemPropsPath(sessionDir: string): string;
67
- /** Session-scoped analysis-status shape (design D3). Successful loader
68
- * invocations never depend on it; it exists so a loader observing a
69
- * source/commit mismatch can decide — on evidence — whether to wait.
70
- *
71
- * Schema 2 (openspec: standalone-extraction-cli, watch readiness) adds the
72
- * additive `ready` field; every other field is unchanged, so schema-1
73
- * readers keep working (no reader branches on the schema value — the bump
74
- * records the shape revision for artifact archaeology). */
47
+ /** Advisory: a loader reads it only after observing a source/commit
48
+ * mismatch, to decide whether to wait. No reader branches on `schema`. */
75
49
  export interface AnalysisStatus {
76
50
  schema: 1 | 2;
77
51
  sessionId: string;
@@ -82,50 +56,42 @@ export interface AnalysisStatus {
82
56
  /** Epoch-ms deadline for the active attempt (debounce ceiling + 2s). */
83
57
  deadlineAt: number;
84
58
  diagnostic?: string;
85
- /** Monotonic first-emission witness (additive, schema 2): absent or false
86
- * until the session's FIRST successful complete publication, true on
87
- * every status write after it — including 'failed' writes, which is what
88
- * makes readiness distinct from `state: 'idle'` (idle recurs per attempt;
89
- * ready never regresses within a session). */
59
+ /** False until the session's first complete publication, true on every
60
+ * later write including failures; never regresses within a session. */
90
61
  ready?: boolean;
91
62
  }
92
- /** analysis-commit artifact shape (design D1: the transaction identity —
93
- * hashes are of the DISK payload bytes, envelope included). `inputsHash`
94
- * is present only when the hydration corpus is persisted (Turbopack
95
- * orchestration); webpack-mode commits omit it (spec:
96
- * next-turbopack-integration, "Webpack mode skips the hydration corpus"). */
63
+ /** Transaction identity: every hash is of the DISK payload bytes, envelope
64
+ * included. `inputsHash` is absent when no hydration corpus is persisted. */
97
65
  export interface AnalysisCommit {
98
66
  schema: 1;
99
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. */
100
70
  generation: number;
101
71
  replacementEpoch: string;
102
72
  manifestHash: string;
103
73
  inputsHash?: string;
104
74
  stylesHash: string;
105
75
  }
106
- /** Envelope embedded in every payload artifact (design D2: sessionId in
107
- * every artifact; payloadHash lets a same-session restart seed its write
108
- * guards without byte-reconstructing the payload). */
76
+ /** Embedded in every payload artifact; `payloadHash` lets a same-session
77
+ * restart seed its write guards without rebuilding the payload bytes. */
109
78
  export interface SessionEnvelope {
110
79
  sessionId: string;
111
80
  generation: number;
112
81
  replacementEpoch: string;
113
82
  payloadHash: string;
114
83
  }
115
- /** Splice the session envelope into a JSON-object payload as a leading
116
- * `__animusSession` field, byte-preserving the payload's own content
117
- * (parse/re-stringify could reformat engine-emitted JSON). */
84
+ /** Splices the envelope in as a leading `__animusSession` field without
85
+ * re-serializing: parse/re-stringify would reformat engine-emitted JSON. */
118
86
  export declare function envelopeJsonArtifact(payload: string, envelopeJson: string): string;
119
- /** Trailing-comment side-band for the CSS artifact (a leading comment
120
- * would displace the @layer declaration consumers pin at offset 0). */
87
+ /** Trailing-comment side-band: a leading comment would displace the `@layer`
88
+ * declaration consumers pin at offset 0. */
121
89
  export declare function envelopeCssArtifact(payload: string, envelopeJson: string): string;
122
- /** Matches the CSS artifact's envelope side-band. */
123
90
  export declare const ENVELOPE_CSS_COMMENT_RE: RegExp;
124
- /** Envelope of a JSON artifact's bytes, or undefined when the artifact
125
- * carries none. THROWS on unparseable bytes — callers decide whether a
126
- * torn artifact fails closed or degrades. */
91
+ /** Envelope of a JSON artifact's bytes, or undefined when it carries none.
92
+ * Throws on unparseable bytes; callers decide torn-artifact policy. */
127
93
  export declare function readJsonEnvelope(bytes: string): SessionEnvelope | undefined;
128
- /** Envelope of the CSS artifact's side-band comment, or undefined when the
129
- * side-band is absent. THROWS on an unparseable envelope body. */
94
+ /** Envelope of the CSS side-band comment, or undefined when it is absent.
95
+ * Throws on an unparseable envelope body. */
130
96
  export declare function readCssEnvelope(bytes: string): SessionEnvelope | undefined;
131
97
  //# sourceMappingURL=session-paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-paths.d.ts","sourceRoot":"","sources":["../../session/session-paths.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH;;uEAEuE;AACvE,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D;;wEAEwE;AACxE,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE;mBACmB;AACnB,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAE1D,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;kDACkD;AAClD,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;;;;gFAIgF;AAChF,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD;2EAC2E;AAC3E,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;0BAC0B;AAC1B,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;;uCAIuC;AACvC,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,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E,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;0EAC0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,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"}
@@ -1,8 +1,12 @@
1
1
  export declare function getManifestJson(): string | null;
2
2
  export declare function setManifestJson(json: string): void;
3
- export declare function getAnalysisPromise(): Promise<void> | null;
4
- export declare function setAnalysisPromise(promise: Promise<void>): void;
5
- export declare function resetAnalysisPromise(): 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;
6
10
  export declare function getSharedCss(): string;
7
11
  export declare function setSharedCss(css: string): void;
8
12
  export declare function getSharedSystemProps(): string;
@@ -11,9 +15,8 @@ export declare function getSharedExternalDirs(): string[];
11
15
  export declare function setSharedExternalDirs(dirs: string[]): void;
12
16
  export declare function getSharedExternalEntries(): Map<string, string>;
13
17
  export declare function setSharedExternalEntries(entries: Map<string, string>): void;
14
- /** Structural view of the owning session a forwarded watch batch targets —
15
- * kept minimal (and defined here, not imported) so the singleton never
16
- * depends on the session module it serves. */
18
+ /** Structural view of the target session, declared here rather than imported
19
+ * so the singleton never depends on the session module it serves. */
17
20
  export interface WatchBatchTarget {
18
21
  ingestForwardedBatch(changes: {
19
22
  modifiedFiles?: ReadonlySet<string>;
@@ -21,104 +24,62 @@ export interface WatchBatchTarget {
21
24
  }): Promise<void>;
22
25
  }
23
26
  /**
24
- * The session that completed the full pipeline and holds system state — the
25
- * only instance that can run watch analysis. Each MultiCompiler child holds
26
- * its own session AND its own watcher with its own modified set; a
27
- * non-owning session forwards its batch here instead of dropping it (a file
28
- * only that compiler watches would otherwise never be analyzed).
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
29
  */
30
30
  export declare function getOwningWatchSession(): WatchBatchTarget | null;
31
31
  export declare function setOwningWatchSession(session: WatchBatchTarget | null): void;
32
32
  /**
33
- * Per-file analyzed content hashes of the last published analysis (relPath →
34
- * contentHash of the exact bytes analyzed) — the loader's witness for the
35
- * unconditional catching-up guard (openspec:
36
- * next-webpack-served-transform-coherence, design D4). Includes files
37
- * analyzed with ZERO animus entries: analyzed identity is membership in the
38
- * analysis input set, not manifest entry count.
33
+ * Per-file content hashes of the last published analysis (relPath → hash of
34
+ * the exact bytes analyzed), including files that produced zero entries.
39
35
  */
40
36
  export declare function getAnalyzedHashes(): ReadonlyMap<string, string> | null;
41
37
  export declare function setAnalyzedHashes(hashes: Map<string, string>): void;
42
38
  /**
43
- * Session identity is per Next INVOCATION — one process, however many
44
- * compiler instances it holds (openspec:
45
- * next-turbopack-served-transform-coherence, design D2). The first
46
- * ExtractionSession constructed in a process claims a fresh randomUUID;
47
- * every later instance (client/server/RSC compilers each construct one)
48
- * adopts it, so all compilers alias, watch-ignore, and publish ONE
49
- * session-scoped artifact tree. Separate invocations (`next dev` +
50
- * `next build` co-writing) are separate processes and therefore separate
51
- * sessions by construction.
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.
52
41
  */
53
42
  export declare function claimProcessSessionId(): string;
54
43
  /**
55
- * Exclusive-ownership claim over the process-global session state — the
56
- * hard form of the invariant `claimProcessSessionId` documents softly. The
57
- * shared slots above (manifest, css, artifact dir) plus the one session id
58
- * mean two CONCURRENT drive loops in one process (a webpack MultiCompiler
59
- * array config, parallel rollup array builds, two programmatic CLI runs)
60
- * would share one session directory, overwrite each other's manifests, and
61
- * delete each other's live trees on dispose. Drivers that run the loop
62
- * exclusively (the unplugin host) claim for the build's lifetime and
63
- * release on dispose; SEQUENTIAL claim/release cycles are legal. The Next
64
- * multi-compiler adoption path stays the non-exclusive default. Throws
65
- * naming both hosts and the remediation on overlap. The key lives in
66
- * `SINGLETON_GLOBAL_KEYS`, so per-test global resets clear a leaked claim.
44
+ * Two CONCURRENT drive loops in one process would share one session tree and
45
+ * clobber each other; sequential claim/release cycles are legal.
67
46
  */
68
47
  export declare function claimExclusiveSessionOwner(label: string): () => void;
69
48
  /**
70
- * Absolute session artifact directory of the OWNING session's last
71
- * publication — the webpack loader's source for the session-scoped epoch
72
- * dependency path (the loader shares the process with the pipeline; the
73
- * Turbopack loader instead receives the directory via its options).
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.
74
51
  */
75
52
  export declare function getSessionArtifactDir(): string | null;
76
53
  export declare function setSessionArtifactDir(dir: string): void;
77
54
  /**
78
- * Canonical replacement epoch of the last published analysis
79
- * (`hashReplacementPlans(snapshotFilePlans(manifest), systemPropsContent)`
80
- * — openspec: next-webpack-served-transform-coherence, design D5; the
81
- * served system-props module rides as the served-dependency witness so
82
- * offline system-props changes move the epoch). Published by the
83
- * owning session AFTER the manifest so a reader that observes the epoch
84
- * always observes at least that generation's manifest. (Session
85
- * attribution lives on the DISK epoch artifact — no in-process mirror.)
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.
86
57
  */
87
58
  export declare function getReplacementEpoch(): string | null;
88
59
  export declare function setReplacementEpoch(epoch: string): void;
89
60
  /**
90
- * The one in-flight watch-analysis transaction (design D3): the first
91
- * compiler entering a watch batch runs analysis + publication; every other
92
- * compiler (client/server/RSC — each holds its own session instance) joins
93
- * this promise instead of proceeding against a pre-transaction generation.
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.
94
63
  */
95
64
  export declare function getWatchTransaction(): Promise<void> | null;
96
65
  export declare function setWatchTransaction(transaction: Promise<void> | null): void;
97
66
  export type AnimusEngine = 'v2';
98
- /** Engine selection travels through the singleton so non-owning compiler
99
- * instances and the webpack loader honor the same choice as the owner. */
67
+ /** Engine selection travels through the singleton so non-owning compilers
68
+ * and the webpack loader honor the owner's choice. */
100
69
  export declare function setSharedEngine(engine: AnimusEngine): void;
101
70
  export declare function getSharedEngine(): AnimusEngine;
102
- /** Single engine choke-point for every native extraction call. Return type
103
- * mirrors the untyped `require` the call sites previously used — the NAPI
104
- * module's own .d.ts is the authoritative surface. */
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. */
105
73
  export declare function requireEngine(): any;
106
74
  /**
107
- * Test seam (injected-fn pattern — module mocks cannot reach a bundled
108
- * dist copy of this module): inject a replacement engine API. GlobalThis-
109
- * keyed so every copy of this module — source-imported, dist-imported,
110
- * ESM/CJS dual-load — honors the one override. Deliberately NOT in
111
- * SINGLETON_GLOBAL_KEYS: the override's lifecycle belongs to the test
112
- * file, and per-test global resets must not strip it mid-suite. Pass null
113
- * to restore the native-backed API.
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.
114
77
  */
115
78
  export declare function setEngineApiOverride(api: (() => any) | null): void;
116
79
  export declare function engineApi(): any;
117
80
  /**
118
- * Every globalThis key this module owns EXCEPT the engine-api override
119
- * (whose lifecycle belongs to the test file that set it — see
120
- * setEngineApiOverride) — the single authority test harnesses
121
- * snapshot/clear per test (never re-declare this list).
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.
122
83
  */
123
- export declare const SINGLETON_GLOBAL_KEYS: readonly ["__animus_manifest_json__", "__animus_analysis_promise__", "__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__"];
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__"];
124
85
  //# sourceMappingURL=singleton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../session/singleton.ts"],"names":[],"mappings":"AAoBA,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAIzD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CA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CAM9C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,IAAI,CAiBpE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAErD;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAEnD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEvD;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"}
@@ -1,7 +1,2 @@
1
- /**
2
- * Verbose build-timing waterfall: JS phases, analysis sub-phases, and the
3
- * shared Rust phase table. `ANIMUS_TIMING_JSON=1` additionally dumps a
4
- * machine-readable merged record.
5
- */
6
1
  export declare function logBuildTimings(bt: Record<string, number>, rustTiming: Record<string, number> | undefined, log: (msg: string) => void, verbose: boolean): void;
7
2
  //# sourceMappingURL=timing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../session/timing.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,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,CAqDN"}
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"}
@@ -1,43 +1,27 @@
1
1
  import { watch } from 'fs';
2
2
  import type { ExtractionSession } from './extraction-session';
3
- /**
4
- * Out-of-band pipeline orchestration for Turbopack (spec:
5
- * next-turbopack-integration). Turbopack exposes no compiler hooks, so the
6
- * pipeline runs during next.config resolution and, in dev, from a
7
- * filesystem watcher — the bundler only ever sees the `.animus/` disk
8
- * artifacts.
9
- */
10
- /** Run the full pipeline with the Turbopack emitter identity: the virtual
11
- * system-props id (Turbopack rejects the webpack path's absolute-path
12
- * imports). Turbopack orchestration persists the analysis-inputs
13
- * hydration corpus — its isolated loader workers replay it (spec:
14
- * next-turbopack-integration, "Manifest disk artifact"; webpack mode
15
- * skips the corpus). */
16
3
  export declare function runSessionPipeline(session: ExtractionSession): Promise<void>;
17
- /**
18
- * Start the dev watcher: fs.watch per eligible top-level directory (plus a
19
- * non-recursive watch on the root itself), debounced into
20
- * existence-partitioned modified/removed sets feeding
21
- * `session.handleWatchUpdate` (serialized — updates never overlap).
22
- * Generated and vendored trees (`.animus`, `.next`, node_modules) are never
23
- * registered with the OS — recursive registration of those trees exhausts
24
- * inotify/kqueue descriptors (EMFILE/ENOSPC) on large projects.
25
- * Idempotent per project root; unref'd so it never holds the process open.
26
- * Asynchronous FSWatcher errors degrade to no-watch with a warning instead
27
- * of crashing the dev server. Returns a close handle, or null when this
28
- * root is already watched or the platform lacks recursive fs.watch (Linux
29
- * before Node 20 — degrades to no-watch with a warning).
30
- */
31
- export declare function startTurbopackWatcher(session: ExtractionSession, rootDir: string, debounceMs?: number, watchFn?: typeof watch): TurbopackWatcherHandle | null;
32
- /** The project-watch handle `startTurbopackWatcher` returns. `close()` is
33
- * caller-initiated teardown; `died` flips only on an ASYNC watcher error
34
- * (EMFILE/ENOSPC after registration) with `onDied` invoked once so the
35
- * process owner can surface the degradation; `settle()` resolves when the
36
- * in-flight update chain has drained. */
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
+ };
37
20
  export interface TurbopackWatcherHandle {
38
21
  close(): void;
39
22
  readonly died: boolean;
40
23
  onDied: (() => void) | null;
41
24
  settle(): Promise<void>;
25
+ deliverHeldEvents(): Promise<void>;
42
26
  }
43
27
  //# sourceMappingURL=turbopack-orchestrator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"turbopack-orchestrator.d.ts","sourceRoot":"","sources":["../../session/turbopack-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,MAA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