@mutineerjs/mutineer 0.2.3 → 0.3.2

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 (162) hide show
  1. package/README.md +48 -42
  2. package/dist/bin/mutineer.js +0 -0
  3. package/dist/core/__tests__/module.spec.js +66 -3
  4. package/dist/core/__tests__/sfc.spec.js +76 -0
  5. package/dist/core/__tests__/variant-utils.spec.js +93 -0
  6. package/dist/mutators/__tests__/operator.spec.js +169 -0
  7. package/dist/mutators/__tests__/registry.spec.js +6 -0
  8. package/dist/mutators/__tests__/return-value.spec.js +239 -0
  9. package/dist/mutators/__tests__/utils.spec.js +68 -1
  10. package/dist/mutators/operator.d.ts +25 -0
  11. package/dist/mutators/operator.js +50 -0
  12. package/dist/mutators/registry.d.ts +6 -28
  13. package/dist/mutators/registry.js +14 -66
  14. package/dist/mutators/return-value.d.ts +39 -0
  15. package/dist/mutators/return-value.js +104 -0
  16. package/dist/mutators/utils.d.ts +21 -0
  17. package/dist/mutators/utils.js +44 -27
  18. package/dist/runner/__tests__/args.spec.js +225 -0
  19. package/dist/runner/__tests__/cache.spec.js +180 -0
  20. package/dist/runner/__tests__/changed.spec.js +227 -0
  21. package/dist/runner/__tests__/cleanup.spec.js +41 -0
  22. package/dist/runner/__tests__/config.spec.js +71 -0
  23. package/dist/runner/__tests__/coverage-resolver.spec.js +171 -0
  24. package/dist/runner/__tests__/pool-executor.spec.js +211 -0
  25. package/dist/runner/__tests__/tasks.spec.js +95 -0
  26. package/dist/runner/__tests__/variants.spec.js +261 -0
  27. package/dist/runner/args.d.ts +5 -0
  28. package/dist/runner/args.js +7 -0
  29. package/dist/runner/config.js +2 -2
  30. package/dist/runner/coverage-resolver.d.ts +21 -0
  31. package/dist/runner/coverage-resolver.js +96 -0
  32. package/dist/runner/discover.js +2 -1
  33. package/dist/runner/jest/__tests__/adapter.spec.js +1 -1
  34. package/dist/runner/jest/__tests__/pool.spec.d.ts +1 -0
  35. package/dist/runner/jest/__tests__/pool.spec.js +211 -0
  36. package/dist/runner/jest/__tests__/worker-runtime.spec.d.ts +1 -0
  37. package/dist/runner/jest/__tests__/worker-runtime.spec.js +148 -0
  38. package/dist/runner/jest/adapter.js +1 -1
  39. package/dist/runner/jest/pool.d.ts +1 -1
  40. package/dist/runner/jest/pool.js +6 -6
  41. package/dist/runner/jest/worker.mjs +1 -1
  42. package/dist/runner/orchestrator.js +43 -295
  43. package/dist/runner/pool-executor.d.ts +17 -0
  44. package/dist/runner/pool-executor.js +143 -0
  45. package/dist/runner/shared/__tests__/mutant-paths.spec.d.ts +1 -0
  46. package/dist/runner/shared/__tests__/mutant-paths.spec.js +66 -0
  47. package/dist/runner/shared/__tests__/redirect-state.spec.d.ts +1 -0
  48. package/dist/runner/shared/__tests__/redirect-state.spec.js +56 -0
  49. package/dist/runner/shared/index.d.ts +1 -1
  50. package/dist/runner/shared/index.js +1 -1
  51. package/dist/runner/shared/redirect-state.d.ts +2 -2
  52. package/dist/runner/shared/redirect-state.js +4 -4
  53. package/dist/runner/tasks.d.ts +12 -0
  54. package/dist/runner/tasks.js +25 -0
  55. package/dist/runner/types.d.ts +1 -1
  56. package/dist/runner/variants.d.ts +17 -2
  57. package/dist/runner/variants.js +33 -0
  58. package/dist/runner/vitest/__tests__/adapter.spec.js +1 -1
  59. package/dist/runner/vitest/__tests__/pool.spec.js +1 -1
  60. package/dist/runner/vitest/__tests__/redirect-loader.spec.js +87 -1
  61. package/dist/runner/vitest/__tests__/worker-runtime.spec.js +84 -0
  62. package/dist/runner/vitest/adapter.js +1 -1
  63. package/dist/runner/vitest/index.d.ts +0 -1
  64. package/dist/runner/vitest/index.js +0 -1
  65. package/dist/runner/vitest/pool.d.ts +1 -1
  66. package/dist/runner/vitest/pool.js +7 -7
  67. package/dist/runner/vitest/redirect-loader.d.ts +1 -1
  68. package/dist/runner/vitest/redirect-loader.js +1 -1
  69. package/dist/runner/vitest/worker-runtime.js +3 -3
  70. package/dist/runner/vitest/worker.mjs +1 -1
  71. package/dist/utils/__tests__/coverage.spec.js +167 -0
  72. package/dist/utils/__tests__/logger.spec.d.ts +1 -0
  73. package/dist/utils/__tests__/logger.spec.js +61 -0
  74. package/dist/utils/__tests__/normalizePath.spec.d.ts +1 -0
  75. package/dist/utils/__tests__/normalizePath.spec.js +22 -0
  76. package/dist/utils/__tests__/progress.spec.js +96 -0
  77. package/package.json +71 -22
  78. package/dist/admin/assets/index-B7nXq-e7.js +0 -32
  79. package/dist/admin/assets/index-B7nXq-e7.js.map +0 -1
  80. package/dist/admin/assets/index-BDQLkBUE.js +0 -32
  81. package/dist/admin/assets/index-BDQLkBUE.js.map +0 -1
  82. package/dist/admin/assets/index-DVkP-Tc7.css +0 -1
  83. package/dist/admin/index.html +0 -13
  84. package/dist/admin/server/admin.d.ts +0 -6
  85. package/dist/admin/server/admin.js +0 -234
  86. package/dist/bin/mutate-vitest.d.ts +0 -2
  87. package/dist/bin/mutate-vitest.js +0 -90
  88. package/dist/plugin/viteMutate.d.ts +0 -15
  89. package/dist/plugin/viteMutate.js +0 -52
  90. package/dist/plugin/vitest.setup.d.ts +0 -47
  91. package/dist/plugin/vitest.setup.js +0 -118
  92. package/dist/plugin/withVitest.d.ts +0 -13
  93. package/dist/plugin/withVitest.js +0 -30
  94. package/dist/runner/__tests__/orchestrator.spec.js +0 -55
  95. package/dist/runner/adapters/__tests__/jest.spec.js +0 -88
  96. package/dist/runner/adapters/__tests__/vitest-worker-runtime.spec.js +0 -59
  97. package/dist/runner/adapters/__tests__/vitest.spec.js +0 -118
  98. package/dist/runner/adapters/index.d.ts +0 -10
  99. package/dist/runner/adapters/index.js +0 -9
  100. package/dist/runner/adapters/jest/__tests__/index.spec.js +0 -88
  101. package/dist/runner/adapters/jest/index.d.ts +0 -24
  102. package/dist/runner/adapters/jest/index.js +0 -216
  103. package/dist/runner/adapters/jest/worker-runtime.d.ts +0 -37
  104. package/dist/runner/adapters/jest/worker-runtime.js +0 -171
  105. package/dist/runner/adapters/jest-worker-runtime.d.ts +0 -37
  106. package/dist/runner/adapters/jest-worker-runtime.js +0 -171
  107. package/dist/runner/adapters/jest.d.ts +0 -24
  108. package/dist/runner/adapters/jest.js +0 -216
  109. package/dist/runner/adapters/types.d.ts +0 -89
  110. package/dist/runner/adapters/types.js +0 -8
  111. package/dist/runner/adapters/vitest/__tests__/index.spec.js +0 -118
  112. package/dist/runner/adapters/vitest/__tests__/worker-runtime.spec.js +0 -59
  113. package/dist/runner/adapters/vitest/index.d.ts +0 -33
  114. package/dist/runner/adapters/vitest/index.js +0 -267
  115. package/dist/runner/adapters/vitest/worker-runtime.d.ts +0 -25
  116. package/dist/runner/adapters/vitest/worker-runtime.js +0 -118
  117. package/dist/runner/adapters/vitest-worker-runtime.d.ts +0 -25
  118. package/dist/runner/adapters/vitest-worker-runtime.js +0 -118
  119. package/dist/runner/adapters/vitest.d.ts +0 -33
  120. package/dist/runner/adapters/vitest.js +0 -267
  121. package/dist/runner/pool/__tests__/index.spec.js +0 -83
  122. package/dist/runner/pool/__tests__/pool-plugin.spec.js +0 -59
  123. package/dist/runner/pool/__tests__/pool-redirect-loader.spec.js +0 -78
  124. package/dist/runner/pool/index.d.ts +0 -8
  125. package/dist/runner/pool/index.js +0 -9
  126. package/dist/runner/pool/jest/pool.d.ts +0 -52
  127. package/dist/runner/pool/jest/pool.js +0 -309
  128. package/dist/runner/pool/jest/worker.mjs +0 -60
  129. package/dist/runner/pool/jest-pool.d.ts +0 -52
  130. package/dist/runner/pool/jest-pool.js +0 -309
  131. package/dist/runner/pool/jest-worker.mjs +0 -60
  132. package/dist/runner/pool/plugin.d.ts +0 -18
  133. package/dist/runner/pool/plugin.js +0 -60
  134. package/dist/runner/pool/pool-plugin.d.ts +0 -18
  135. package/dist/runner/pool/pool-plugin.js +0 -60
  136. package/dist/runner/pool/pool-redirect-loader.d.ts +0 -19
  137. package/dist/runner/pool/pool-redirect-loader.js +0 -116
  138. package/dist/runner/pool/pool-redirect-loader.mjs +0 -146
  139. package/dist/runner/pool/redirect-loader.d.ts +0 -19
  140. package/dist/runner/pool/redirect-loader.js +0 -116
  141. package/dist/runner/pool/vitest/pool.d.ts +0 -70
  142. package/dist/runner/pool/vitest/pool.js +0 -376
  143. package/dist/runner/pool/vitest/worker.d.mts +0 -15
  144. package/dist/runner/pool/vitest/worker.mjs +0 -96
  145. package/dist/runner/pool/vitest-worker.d.mts +0 -15
  146. package/dist/runner/pool/vitest-worker.mjs +0 -96
  147. package/dist/runner/shared-module-redirect.d.ts +0 -56
  148. package/dist/runner/shared-module-redirect.js +0 -84
  149. package/dist/types/api.d.ts +0 -20
  150. /package/dist/{runner/__tests__/orchestrator.spec.d.ts → core/__tests__/sfc.spec.d.ts} +0 -0
  151. /package/dist/{runner/adapters/__tests__/jest.spec.d.ts → core/__tests__/variant-utils.spec.d.ts} +0 -0
  152. /package/dist/{runner/adapters/__tests__/vitest-worker-runtime.spec.d.ts → mutators/__tests__/operator.spec.d.ts} +0 -0
  153. /package/dist/{runner/adapters/__tests__/vitest.spec.d.ts → mutators/__tests__/return-value.spec.d.ts} +0 -0
  154. /package/dist/runner/{adapters/jest/__tests__/index.spec.d.ts → __tests__/args.spec.d.ts} +0 -0
  155. /package/dist/runner/{adapters/vitest/__tests__/index.spec.d.ts → __tests__/cache.spec.d.ts} +0 -0
  156. /package/dist/runner/{adapters/vitest/__tests__/worker-runtime.spec.d.ts → __tests__/changed.spec.d.ts} +0 -0
  157. /package/dist/runner/{pool/__tests__/index.spec.d.ts → __tests__/cleanup.spec.d.ts} +0 -0
  158. /package/dist/runner/{pool/__tests__/pool-plugin.spec.d.ts → __tests__/config.spec.d.ts} +0 -0
  159. /package/dist/runner/{pool/__tests__/pool-redirect-loader.spec.d.ts → __tests__/coverage-resolver.spec.d.ts} +0 -0
  160. /package/dist/runner/{pool/jest-worker.d.mts → __tests__/pool-executor.spec.d.ts} +0 -0
  161. /package/dist/runner/{pool/jest/worker.d.mts → __tests__/tasks.spec.d.ts} +0 -0
  162. /package/dist/{types/api.js → runner/__tests__/variants.spec.d.ts} +0 -0
@@ -1,146 +0,0 @@
1
- /**
2
- * Dynamic ESM loader for persistent Vitest workers.
3
- *
4
- * Unlike the fast runner's static loader (which reads env vars at startup),
5
- * this loader reads the redirect target from globalThis.__mutineer_redirect__
6
- * on each resolution, allowing dynamic changes during the worker's lifetime.
7
- *
8
- * This enables the worker to test multiple mutations without restarting.
9
- */
10
-
11
- import { register, builtinModules } from 'node:module'
12
- import { pathToFileURL, fileURLToPath } from 'node:url'
13
- import path from 'node:path'
14
- import fs from 'node:fs'
15
-
16
- // Register this file as the loader hooks module
17
- register(import.meta.url, {
18
- parentURL: import.meta.url,
19
- data: { debug: process.env.MUTINEER_DEBUG === '1' }
20
- })
21
-
22
- let DEBUG = process.env.MUTINEER_DEBUG === '1'
23
-
24
- export function initialize(data) {
25
- if (data?.debug !== undefined) {
26
- DEBUG = data.debug
27
- }
28
- }
29
-
30
- /**
31
- * Try to resolve a .js import to a .ts file (TypeScript ESM convention)
32
- */
33
- function tryResolveTsExtension(specifier, parentURL) {
34
- if (!specifier.endsWith('.js') || !specifier.startsWith('.')) {
35
- return null
36
- }
37
-
38
- let parentPath
39
- try {
40
- parentPath = fileURLToPath(parentURL)
41
- } catch {
42
- return null
43
- }
44
- const parentDir = path.dirname(parentPath)
45
-
46
- // If the parent is in a __mutineer__ directory, also try the parent's parent
47
- const dirsToTry = [parentDir]
48
- if (path.basename(parentDir) === '__mutineer__') {
49
- dirsToTry.push(path.dirname(parentDir))
50
- }
51
-
52
- const tsSpecifier = specifier.slice(0, -3) + '.ts'
53
- const tsxSpecifier = specifier.slice(0, -3) + '.tsx'
54
-
55
- for (const dir of dirsToTry) {
56
- const tsPath = path.resolve(dir, tsSpecifier)
57
- if (fs.existsSync(tsPath)) {
58
- return pathToFileURL(tsPath).href
59
- }
60
-
61
- const tsxPath = path.resolve(dir, tsxSpecifier)
62
- if (fs.existsSync(tsxPath)) {
63
- return pathToFileURL(tsxPath).href
64
- }
65
- }
66
-
67
- return null
68
- }
69
-
70
- /**
71
- * Get the current redirect config from globalThis (set by the worker)
72
- */
73
- function getRedirect() {
74
- const redirect = globalThis.__mutineer_redirect__
75
- if (!redirect?.from || !redirect?.to) {
76
- return null
77
- }
78
- return {
79
- from: path.resolve(redirect.from),
80
- fromUrl: pathToFileURL(path.resolve(redirect.from)).href,
81
- to: redirect.to,
82
- }
83
- }
84
-
85
- export async function resolve(specifier, context, nextResolve) {
86
- const redirect = getRedirect()
87
- const isBuiltin = specifier.startsWith('node:') || builtinModules.includes(specifier)
88
- const isNodeModulesSpec = specifier.includes('node_modules')
89
-
90
- const shouldLog = DEBUG && !isBuiltin && !isNodeModulesSpec
91
-
92
- if (shouldLog) {
93
- console.error(`[pool-loader] resolve: ${specifier}`)
94
- if (redirect) {
95
- console.error(`[pool-loader] active redirect: ${redirect.from} -> ${redirect.to}`)
96
- }
97
- }
98
-
99
- // Try to resolve .js -> .ts for TypeScript ESM imports
100
- const tsResolved = tryResolveTsExtension(specifier, context.parentURL)
101
- if (tsResolved) {
102
- if (DEBUG) console.error(`[pool-loader] .js -> .ts: ${specifier} -> ${tsResolved}`)
103
-
104
- // Check if this is our redirect target
105
- if (redirect && tsResolved === redirect.fromUrl) {
106
- if (DEBUG) console.error(`[pool-loader] REDIRECTING ${tsResolved} -> ${pathToFileURL(redirect.to).href}`)
107
- return {
108
- url: pathToFileURL(redirect.to).href,
109
- shortCircuit: true
110
- }
111
- }
112
-
113
- return {
114
- url: tsResolved,
115
- shortCircuit: true
116
- }
117
- }
118
-
119
- // Let the default resolver handle it
120
- let resolved
121
- try {
122
- resolved = await nextResolve(specifier, context)
123
- } catch (e) {
124
- throw e
125
- }
126
-
127
- const resolvedInNodeModules = resolved?.url?.includes('/node_modules/')
128
- const resolvedBuiltin = resolved?.url?.startsWith('node:')
129
- if (shouldLog && !resolvedInNodeModules && !resolvedBuiltin) console.error(`[pool-loader] resolved ${specifier} to ${resolved.url}`)
130
-
131
- // Check if this resolves to our redirect target
132
- if (redirect && resolved.url === redirect.fromUrl) {
133
- if (DEBUG) console.error(`[pool-loader] REDIRECTING ${resolved.url} -> ${pathToFileURL(redirect.to).href}`)
134
- return {
135
- ...resolved,
136
- url: pathToFileURL(redirect.to).href,
137
- shortCircuit: true
138
- }
139
- }
140
-
141
- return resolved
142
- }
143
-
144
- export async function load(url, context, nextLoad) {
145
- return nextLoad(url, context)
146
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * Dynamic ESM loader for persistent Vitest workers.
3
- *
4
- * Reads redirect targets from globalThis.__mutineer_redirect__ on each resolution
5
- * so workers can swap files without restarting.
6
- */
7
- declare global {
8
- var __mutineer_redirect__: {
9
- from: string | null;
10
- to: string | null;
11
- } | undefined;
12
- }
13
- export declare function initialize(data: {
14
- debug?: boolean;
15
- } | undefined): void;
16
- export declare function resolve(specifier: string, context: {
17
- parentURL?: string;
18
- }, nextResolve: (specifier: string, context: any) => Promise<any>): Promise<any>;
19
- export declare function load(url: string, context: unknown, nextLoad: (u: string, c: unknown) => Promise<unknown>): Promise<unknown>;
@@ -1,116 +0,0 @@
1
- /**
2
- * Dynamic ESM loader for persistent Vitest workers.
3
- *
4
- * Reads redirect targets from globalThis.__mutineer_redirect__ on each resolution
5
- * so workers can swap files without restarting.
6
- */
7
- import { register, builtinModules } from 'node:module';
8
- import { pathToFileURL, fileURLToPath } from 'node:url';
9
- import path from 'node:path';
10
- import fs from 'node:fs';
11
- // Register this file as the loader hooks module
12
- register(import.meta.url, {
13
- parentURL: import.meta.url,
14
- data: { debug: process.env.MUTINEER_DEBUG === '1' }
15
- });
16
- let DEBUG = process.env.MUTINEER_DEBUG === '1';
17
- export function initialize(data) {
18
- if (data?.debug !== undefined) {
19
- DEBUG = data.debug;
20
- }
21
- }
22
- /**
23
- * Try to resolve a .js import to a .ts or .tsx file (TypeScript ESM convention)
24
- */
25
- function tryResolveTsExtension(specifier, parentURL) {
26
- if (!specifier.endsWith('.js') || !specifier.startsWith('.')) {
27
- return null;
28
- }
29
- let parentPath;
30
- try {
31
- parentPath = fileURLToPath(parentURL ?? '');
32
- }
33
- catch {
34
- return null;
35
- }
36
- const parentDir = path.dirname(parentPath);
37
- // If the parent is in a __mutineer__ directory, also try the parent's parent
38
- const dirsToTry = [parentDir];
39
- if (path.basename(parentDir) === '__mutineer__') {
40
- dirsToTry.push(path.dirname(parentDir));
41
- }
42
- const tsSpecifier = specifier.slice(0, -3) + '.ts';
43
- const tsxSpecifier = specifier.slice(0, -3) + '.tsx';
44
- for (const dir of dirsToTry) {
45
- const tsPath = path.resolve(dir, tsSpecifier);
46
- if (fs.existsSync(tsPath)) {
47
- return pathToFileURL(tsPath).href;
48
- }
49
- const tsxPath = path.resolve(dir, tsxSpecifier);
50
- if (fs.existsSync(tsxPath)) {
51
- return pathToFileURL(tsxPath).href;
52
- }
53
- }
54
- return null;
55
- }
56
- function getRedirect() {
57
- const redirect = globalThis.__mutineer_redirect__;
58
- if (!redirect?.from || !redirect?.to) {
59
- return null;
60
- }
61
- return {
62
- from: path.resolve(redirect.from),
63
- fromUrl: pathToFileURL(path.resolve(redirect.from)).href,
64
- to: redirect.to,
65
- };
66
- }
67
- export async function resolve(specifier, context, nextResolve) {
68
- const redirect = getRedirect();
69
- const isBuiltin = specifier.startsWith('node:') || builtinModules.includes(specifier);
70
- const isNodeModulesSpec = specifier.includes('node_modules');
71
- const shouldLog = DEBUG && !isBuiltin && !isNodeModulesSpec;
72
- if (shouldLog) {
73
- console.error(`[pool-loader] resolve: ${specifier}`);
74
- if (redirect) {
75
- console.error(`[pool-loader] active redirect: ${redirect.from} -> ${redirect.to}`);
76
- }
77
- }
78
- // Try to resolve .js -> .ts for TypeScript ESM imports
79
- const tsResolved = tryResolveTsExtension(specifier, context.parentURL);
80
- if (tsResolved) {
81
- if (shouldLog)
82
- console.error(`[pool-loader] .js -> .ts: ${specifier} -> ${tsResolved}`);
83
- // Check if this is our redirect target
84
- if (redirect && tsResolved === redirect.fromUrl) {
85
- if (DEBUG)
86
- console.error(`[pool-loader] REDIRECTING ${tsResolved} -> ${pathToFileURL(redirect.to).href}`);
87
- return {
88
- url: pathToFileURL(redirect.to).href,
89
- shortCircuit: true
90
- };
91
- }
92
- return {
93
- url: tsResolved,
94
- shortCircuit: true
95
- };
96
- }
97
- const resolved = await nextResolve(specifier, context);
98
- const resolvedInNodeModules = resolved?.url?.includes('/node_modules/');
99
- const resolvedBuiltin = resolved?.url?.startsWith('node:');
100
- if (shouldLog && !resolvedInNodeModules && !resolvedBuiltin)
101
- console.error(`[pool-loader] resolved ${specifier} to ${resolved.url}`);
102
- // Check if this resolves to our redirect target
103
- if (redirect && resolved.url === redirect.fromUrl) {
104
- if (DEBUG)
105
- console.error(`[pool-loader] REDIRECTING ${resolved.url} -> ${pathToFileURL(redirect.to).href}`);
106
- return {
107
- ...resolved,
108
- url: pathToFileURL(redirect.to).href,
109
- shortCircuit: true
110
- };
111
- }
112
- return resolved;
113
- }
114
- export async function load(url, context, nextLoad) {
115
- return nextLoad(url, context);
116
- }
@@ -1,70 +0,0 @@
1
- /**
2
- * Vitest Worker Pool
3
- *
4
- * Manages a pool of persistent Vitest worker processes that can run
5
- * multiple mutations without restarting, providing significant speedup
6
- * over the per-spawn approach.
7
- *
8
- * Each worker:
9
- * - Starts Vitest in watch mode via programmatic API
10
- * - Receives mutations via stdin (JSON)
11
- * - Uses dynamic redirect loader to swap module at runtime
12
- * - Returns results via stdout (JSON)
13
- */
14
- import { EventEmitter } from 'node:events';
15
- import type { MutantPayload, MutantRunResult, MutantRunSummary } from '../../../types/mutant.js';
16
- declare class VitestWorker extends EventEmitter {
17
- private readonly cwd;
18
- private readonly vitestConfig?;
19
- private readonly debug;
20
- readonly id: string;
21
- private process;
22
- private rl;
23
- private pendingTask;
24
- private ready;
25
- private shuttingDown;
26
- constructor(id: string, cwd: string, vitestConfig?: string | undefined, debug?: boolean);
27
- start(): Promise<void>;
28
- private handleMessage;
29
- private handleExit;
30
- isReady(): boolean;
31
- isBusy(): boolean;
32
- run(mutant: MutantPayload, tests: string[], timeoutMs?: number): Promise<MutantRunSummary>;
33
- shutdown(): Promise<void>;
34
- kill(): void;
35
- private log;
36
- }
37
- export interface VitestPoolOptions {
38
- cwd: string;
39
- concurrency: number;
40
- vitestConfig?: string;
41
- timeoutMs?: number;
42
- debug?: boolean;
43
- createWorker?: (id: string, opts: {
44
- cwd: string;
45
- vitestConfig?: string;
46
- debug: boolean;
47
- }) => VitestWorker;
48
- }
49
- export declare class VitestPool {
50
- private workers;
51
- private availableWorkers;
52
- private waitingTasks;
53
- private readonly options;
54
- private initialized;
55
- private shuttingDown;
56
- constructor(options: VitestPoolOptions);
57
- init(): Promise<void>;
58
- private handleWorkerExit;
59
- private acquireWorker;
60
- private releaseWorker;
61
- run(mutant: MutantPayload, tests: string[]): Promise<MutantRunSummary>;
62
- shutdown(): Promise<void>;
63
- private log;
64
- }
65
- /**
66
- * Run a single mutation using the pool.
67
- * Convenience function for integration with orchestrator.
68
- */
69
- export declare function runWithPool(pool: VitestPool, mutant: MutantPayload, tests: readonly string[]): Promise<MutantRunResult>;
70
- export type { MutantPayload, MutantRunResult, MutantRunSummary } from '../../../types/mutant.js';