supercov 0.0.11 → 0.0.13

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 (175) hide show
  1. package/README.md +28 -23
  2. package/bin/supercov.js +8 -19
  3. package/package.json +31 -43
  4. package/{dist → runtime/javascript}/atomic.js +0 -1
  5. package/{dist → runtime/javascript}/launchSupervisor.js +45 -2
  6. package/{dist → runtime/javascript}/nodeAssert.js +0 -1
  7. package/{dist → runtime/javascript}/nodeAssertAdapter.js +0 -1
  8. package/{dist → runtime/javascript}/nodeAssertStrict.js +0 -1
  9. package/{dist → runtime/javascript}/nodeTest.js +0 -1
  10. package/{dist → runtime/javascript}/playwright.js +0 -1
  11. package/{dist → runtime/javascript}/playwrightReporter.js +0 -1
  12. package/{dist → runtime/javascript}/provenance.js +0 -1
  13. package/{dist → runtime/javascript}/register.mjs +3 -2
  14. package/{dist → runtime/javascript}/resolve-loader.mjs +0 -42
  15. package/{dist → runtime/javascript}/runnerEvidence.js +0 -1
  16. package/{dist → runtime/javascript}/transport.js +0 -1
  17. package/{dist → runtime/javascript}/vitest.js +0 -1
  18. package/{dist → runtime/javascript}/vitestReporter.js +0 -1
  19. package/dist/agentJson.d.ts +0 -45
  20. package/dist/agentJson.d.ts.map +0 -1
  21. package/dist/agentJson.js +0 -102
  22. package/dist/agentJson.js.map +0 -1
  23. package/dist/analyze.d.ts +0 -12
  24. package/dist/analyze.d.ts.map +0 -1
  25. package/dist/analyze.js +0 -704
  26. package/dist/analyze.js.map +0 -1
  27. package/dist/atomic.d.ts +0 -6
  28. package/dist/atomic.d.ts.map +0 -1
  29. package/dist/atomic.js.map +0 -1
  30. package/dist/buildCache.d.ts +0 -14
  31. package/dist/buildCache.d.ts.map +0 -1
  32. package/dist/buildCache.js +0 -84
  33. package/dist/buildCache.js.map +0 -1
  34. package/dist/cli.d.ts +0 -2
  35. package/dist/cli.d.ts.map +0 -1
  36. package/dist/cli.js +0 -797
  37. package/dist/cli.js.map +0 -1
  38. package/dist/directInstrumenter.d.ts +0 -8
  39. package/dist/directInstrumenter.d.ts.map +0 -1
  40. package/dist/directInstrumenter.js +0 -112
  41. package/dist/directInstrumenter.js.map +0 -1
  42. package/dist/engineEvidence.d.ts +0 -9
  43. package/dist/engineEvidence.d.ts.map +0 -1
  44. package/dist/engineEvidence.js +0 -31
  45. package/dist/engineEvidence.js.map +0 -1
  46. package/dist/engineInstrumenter.d.ts +0 -16
  47. package/dist/engineInstrumenter.d.ts.map +0 -1
  48. package/dist/engineInstrumenter.js +0 -50
  49. package/dist/engineInstrumenter.js.map +0 -1
  50. package/dist/engineProcess.d.ts +0 -11
  51. package/dist/engineProcess.d.ts.map +0 -1
  52. package/dist/engineProcess.js +0 -59
  53. package/dist/engineProcess.js.map +0 -1
  54. package/dist/esmInterceptor.d.ts +0 -6
  55. package/dist/esmInterceptor.d.ts.map +0 -1
  56. package/dist/esmInterceptor.js +0 -63
  57. package/dist/esmInterceptor.js.map +0 -1
  58. package/dist/evidenceArchive.d.ts +0 -38
  59. package/dist/evidenceArchive.d.ts.map +0 -1
  60. package/dist/evidenceArchive.js +0 -156
  61. package/dist/evidenceArchive.js.map +0 -1
  62. package/dist/instrumenter.d.ts +0 -18
  63. package/dist/instrumenter.d.ts.map +0 -1
  64. package/dist/instrumenter.js +0 -1644
  65. package/dist/instrumenter.js.map +0 -1
  66. package/dist/integrity.d.ts +0 -10
  67. package/dist/integrity.d.ts.map +0 -1
  68. package/dist/integrity.js +0 -213
  69. package/dist/integrity.js.map +0 -1
  70. package/dist/launchSupervisor.d.ts +0 -38
  71. package/dist/launchSupervisor.d.ts.map +0 -1
  72. package/dist/launchSupervisor.js.map +0 -1
  73. package/dist/merge.d.ts +0 -2
  74. package/dist/merge.d.ts.map +0 -1
  75. package/dist/merge.js +0 -119
  76. package/dist/merge.js.map +0 -1
  77. package/dist/nodeAssert.d.ts +0 -31
  78. package/dist/nodeAssert.d.ts.map +0 -1
  79. package/dist/nodeAssert.js.map +0 -1
  80. package/dist/nodeAssertAdapter.d.ts +0 -6
  81. package/dist/nodeAssertAdapter.d.ts.map +0 -1
  82. package/dist/nodeAssertAdapter.js.map +0 -1
  83. package/dist/nodeAssertStrict.d.ts +0 -31
  84. package/dist/nodeAssertStrict.d.ts.map +0 -1
  85. package/dist/nodeAssertStrict.js.map +0 -1
  86. package/dist/nodeAssertionInstrumenter.d.ts +0 -8
  87. package/dist/nodeAssertionInstrumenter.d.ts.map +0 -1
  88. package/dist/nodeAssertionInstrumenter.js +0 -271
  89. package/dist/nodeAssertionInstrumenter.js.map +0 -1
  90. package/dist/nodeTest.d.ts +0 -15
  91. package/dist/nodeTest.d.ts.map +0 -1
  92. package/dist/nodeTest.js.map +0 -1
  93. package/dist/playwright.d.ts +0 -9
  94. package/dist/playwright.d.ts.map +0 -1
  95. package/dist/playwright.js.map +0 -1
  96. package/dist/playwrightReporter.d.ts +0 -6
  97. package/dist/playwrightReporter.d.ts.map +0 -1
  98. package/dist/playwrightReporter.js.map +0 -1
  99. package/dist/processDiagnostics.d.ts +0 -34
  100. package/dist/processDiagnostics.d.ts.map +0 -1
  101. package/dist/processDiagnostics.js +0 -155
  102. package/dist/processDiagnostics.js.map +0 -1
  103. package/dist/project.d.ts +0 -21
  104. package/dist/project.d.ts.map +0 -1
  105. package/dist/project.js +0 -331
  106. package/dist/project.js.map +0 -1
  107. package/dist/provenance.d.ts +0 -9
  108. package/dist/provenance.d.ts.map +0 -1
  109. package/dist/provenance.js.map +0 -1
  110. package/dist/query.d.ts +0 -81
  111. package/dist/query.d.ts.map +0 -1
  112. package/dist/query.js +0 -1656
  113. package/dist/query.js.map +0 -1
  114. package/dist/queryCache.d.ts +0 -15
  115. package/dist/queryCache.d.ts.map +0 -1
  116. package/dist/queryCache.js +0 -95
  117. package/dist/queryCache.js.map +0 -1
  118. package/dist/queueAdapters.d.ts +0 -15
  119. package/dist/queueAdapters.d.ts.map +0 -1
  120. package/dist/queueAdapters.js +0 -55
  121. package/dist/queueAdapters.js.map +0 -1
  122. package/dist/register.d.mts +0 -2
  123. package/dist/register.d.mts.map +0 -1
  124. package/dist/register.mjs.map +0 -1
  125. package/dist/reporter.d.ts +0 -13
  126. package/dist/reporter.d.ts.map +0 -1
  127. package/dist/reporter.js +0 -252
  128. package/dist/reporter.js.map +0 -1
  129. package/dist/resolve-loader.d.mts +0 -3
  130. package/dist/resolve-loader.d.mts.map +0 -1
  131. package/dist/resolve-loader.mjs.map +0 -1
  132. package/dist/runAnalysis.d.ts +0 -19
  133. package/dist/runAnalysis.d.ts.map +0 -1
  134. package/dist/runAnalysis.js +0 -171
  135. package/dist/runAnalysis.js.map +0 -1
  136. package/dist/runnerEvidence.d.ts +0 -19
  137. package/dist/runnerEvidence.d.ts.map +0 -1
  138. package/dist/runnerEvidence.js.map +0 -1
  139. package/dist/runtime.d.ts +0 -140
  140. package/dist/runtime.d.ts.map +0 -1
  141. package/dist/runtime.js.map +0 -1
  142. package/dist/runtimeIsolation.d.ts +0 -3
  143. package/dist/runtimeIsolation.d.ts.map +0 -1
  144. package/dist/runtimeIsolation.js +0 -9
  145. package/dist/runtimeIsolation.js.map +0 -1
  146. package/dist/sourceDiscovery.d.ts +0 -9
  147. package/dist/sourceDiscovery.d.ts.map +0 -1
  148. package/dist/sourceDiscovery.js +0 -242
  149. package/dist/sourceDiscovery.js.map +0 -1
  150. package/dist/transport.d.ts +0 -17
  151. package/dist/transport.d.ts.map +0 -1
  152. package/dist/transport.js.map +0 -1
  153. package/dist/types.d.ts +0 -378
  154. package/dist/types.d.ts.map +0 -1
  155. package/dist/types.js +0 -2
  156. package/dist/types.js.map +0 -1
  157. package/dist/vitePlugin.d.ts +0 -13
  158. package/dist/vitePlugin.d.ts.map +0 -1
  159. package/dist/vitePlugin.js +0 -139
  160. package/dist/vitePlugin.js.map +0 -1
  161. package/dist/vitest.d.ts +0 -2
  162. package/dist/vitest.d.ts.map +0 -1
  163. package/dist/vitest.js.map +0 -1
  164. package/dist/vitestReporter.d.ts +0 -43
  165. package/dist/vitestReporter.d.ts.map +0 -1
  166. package/dist/vitestReporter.js.map +0 -1
  167. package/dist/waivers.d.ts +0 -52
  168. package/dist/waivers.d.ts.map +0 -1
  169. package/dist/waivers.js +0 -121
  170. package/dist/waivers.js.map +0 -1
  171. package/dist/workspace.d.ts +0 -117
  172. package/dist/workspace.d.ts.map +0 -1
  173. package/dist/workspace.js +0 -680
  174. package/dist/workspace.js.map +0 -1
  175. /package/{dist → runtime/javascript}/runtime.js +0 -0
package/README.md CHANGED
@@ -18,26 +18,30 @@ npm link
18
18
 
19
19
  ## Verifying the instrumenter
20
20
 
21
- The coverage engine has seven independent release gates:
22
-
23
- - semantic differential fixtures execute original and instrumented programs
24
- in isolated scopes and compare return values, thrown errors, and observable
25
- side-effect order;
26
- - a deterministic generated corpus exercises 160 nested combinations of
27
- short-circuiting, ternaries, coercion, and thrown expressions on every run;
28
- - seeded `fast-check` properties exercise another 500 generated nested
29
- expressions and 300 generated control-flow executions, with shrinking and a
30
- reproducible seed on failure;
31
- - coverage oracles assert exact decision vectors, MC/DC witnesses, and branch
21
+ Supercov has one coverage engine, implemented in Rust. JavaScript files under
22
+ `runtime/javascript/` are target-runtime shims for Node, browsers and test
23
+ runners; they do not contain a second analyzer or instrumenter.
24
+
25
+ The coverage engine has independent correctness gates:
26
+
27
+ - Rust unit and golden tests cover transformation semantics, complete
28
+ obligation manifests, evidence validation, attribution, MC/DC witnesses,
29
+ storage, lifecycle recovery and agent JSON contracts;
30
+ - syntax and behavior matrices execute original and instrumented modern
31
+ JavaScript, JSX, TypeScript and TSX under Node, Chromium, Firefox and WebKit;
32
+ - coverage oracles assert exact decision vectors, MC/DC witnesses and branch
32
33
  alternatives independently of program behavior;
33
34
  - the same three-condition masking-MC/DC golden cases must report 100% for a
34
35
  complete witness set and 33.33% for an incomplete one under both Supercov
35
36
  and Clang/LLVM source-based MC/DC;
36
- - release CI shards the pinned TC39 Test262 corpus across 16 workers, runs the
37
- official Test262 harness on original and instrumented sources, and rejects
38
- any scenario that passes originally but fails after transformation; and
39
- - checked performance budgets cover transform latency, transactional workspace
40
- preparation, output expansion, and runtime probe overhead.
37
+ - the pinned TC39 Test262 corpus runs through the official harness before and
38
+ after instrumentation and rejects any originally passing scenario that
39
+ changes behavior;
40
+ - black-box fixtures exercise node:test, Vitest, Playwright, opaque remote
41
+ execution, Vite, Next, Webpack, esbuild, SWC and TypeScript compilation; and
42
+ - checked performance and filesystem gates cover transform latency,
43
+ transactional workspace preparation, output expansion, signal handling,
44
+ crash recovery and runtime probe overhead.
41
45
 
42
46
  ```sh
43
47
  npm test
@@ -62,7 +66,7 @@ default with `TEST262_DIR=/path/to/test262` or `--test262 <path>`.
62
66
  The differential suite includes getters, proxies, optional calls and `this`,
63
67
  computed logical assignments, defaults, `try`/`catch`/`finally`, iterator
64
68
  closing, switch fallthrough, labeled loops, async functions, and generators.
65
- The compatibility workflow additionally runs Node 22/24/25, Playwright
69
+ The manually dispatched compatibility workflow additionally runs Node 22/24/25, Playwright
66
70
  1.55/current, Vite 5/current, Vitest 2/current, Chromium, Firefox, WebKit, and
67
71
  modern JavaScript/JSX/TypeScript/TSX syntax fixtures. Filesystem publication,
68
72
  symlink, copy fallback, ENOSPC, failed rename, and forced-termination recovery
@@ -191,7 +195,7 @@ producing a plausible but invalid aggregate.
191
195
  For a JavaScript or TypeScript project, the CLI:
192
196
 
193
197
  1. refreshes a stable isolated source namespace under
194
- `.supercov/cache/instrumented-workspace/<project>/`, links the existing
198
+ `.supercov/cache/workspace/<project>/`, links the existing
195
199
  dependency tree, and creates generated runner configuration and build output
196
200
  only there; file data uses copy-on-write reflinks where the filesystem
197
201
  supports them, and falls back to copying where it does not; the stable path
@@ -210,7 +214,7 @@ For a JavaScript or TypeScript project, the CLI:
210
214
  and CommonJS projects use the same disposable direct path;
211
215
  4. runs the exact command following `--`, propagating coverage through every
212
216
  Node child process it launches. Generated adapters provide exact test,
213
- worker, retry, and outcome scopes for Playwright, Vitest, Jest, and
217
+ worker, retry, and outcome scopes for Playwright, Vitest, and
214
218
  `node:test` without changing test imports or configs;
215
219
  5. attributes source hits and decision vectors to individual tests where an
216
220
  exact adapter is active,
@@ -223,8 +227,10 @@ For a JavaScript or TypeScript project, the CLI:
223
227
  ordinary application build is never read as an input, overwritten, or
224
228
  rebuilt afterward.
225
229
 
226
- Only `.supercov/` is modified in the user's checkout. A per-project lock
227
- rejects overlapping runs before either can build. Run state is durably written
230
+ Only the Supercov-owned `.supercov/` run store and marker-protected
231
+ `.supercov/cache/workspace/` cache are modified in the user's checkout. A user-created
232
+ `supercov/` directory without Supercov's ownership marker is never treated as
233
+ storage. A per-project lock rejects overlapping runs before either can build. Run state is durably written
228
234
  through preparing/building/testing/publishing phases; SIGINT, SIGTERM,
229
235
  and SIGHUP are forwarded to the entire child process group. If the process is
230
236
  killed without a cleanup opportunity, the next invocation marks the dead PID's
@@ -268,8 +274,7 @@ strategy trade-offs, and a measured real-suite reference.
268
274
 
269
275
  The automatic exact-attribution adapters support standard Playwright suites
270
276
  (ESM and CommonJS specs in arbitrary project directories), project-owned
271
- Playwright fixture packages, Vitest, Jest—including concurrent and
272
- parameterized tests—and `node:test`. A single command can collect several
277
+ Playwright fixture packages, Vitest and `node:test`. A single command can collect several
273
278
  runners into one run. Unsupported runners such as AVA or Mocha still receive
274
279
  aggregate first-party structural coverage through inherited process
275
280
  instrumentation, but their hits remain background/unattributed rather than
package/bin/supercov.js CHANGED
@@ -1,32 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawn } from "node:child_process";
4
- import { fileURLToPath } from "node:url";
5
4
  import { resolveNativeBinary } from "./native.js";
6
5
 
7
- const cli = fileURLToPath(new URL("../dist/cli.js", import.meta.url));
8
- const runtime = fileURLToPath(new URL("../dist", import.meta.url));
9
- const useRust = process.env["SUPERCOV_ENGINE"] === "rust";
10
6
  let rustBinary;
11
- if (useRust) {
12
- try {
13
- rustBinary = resolveNativeBinary();
14
- } catch (error) {
15
- console.error(`[supercov] ${error instanceof Error ? error.message : String(error)}`);
16
- process.exit(1);
17
- }
7
+ try {
8
+ rustBinary = resolveNativeBinary();
9
+ } catch (error) {
10
+ console.error(`[supercov] ${error instanceof Error ? error.message : String(error)}`);
11
+ process.exit(1);
18
12
  }
19
13
  const child = spawn(
20
- useRust ? rustBinary : process.execPath,
21
- [...(useRust ? [] : [cli]), ...process.argv.slice(2)],
14
+ rustBinary,
15
+ process.argv.slice(2),
22
16
  {
23
17
  stdio: "inherit",
24
- env: {
25
- ...process.env,
26
- ...(useRust && !process.env["SUPERCOV_RUNTIME_ROOT"]
27
- ? { SUPERCOV_RUNTIME_ROOT: runtime }
28
- : {}),
29
- },
18
+ env: process.env,
30
19
  },
31
20
  );
32
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supercov",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Zero-edit, runner-aware coverage completeness for JavaScript test suites",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "type": "module",
15
15
  "files": [
16
16
  "bin",
17
- "dist",
17
+ "runtime/javascript",
18
18
  "docs",
19
19
  "README.md"
20
20
  ],
@@ -28,58 +28,47 @@
28
28
  "access": "public"
29
29
  },
30
30
  "exports": {
31
- "./playwright": "./dist/playwright.js",
32
- "./register": "./dist/register.mjs",
33
- "./vite": "./dist/vitePlugin.js",
34
- "./vitest": "./dist/vitest.js"
31
+ "./playwright": "./runtime/javascript/playwright.js",
32
+ "./register": "./runtime/javascript/register.mjs",
33
+ "./vitest": "./runtime/javascript/vitest.js"
35
34
  },
36
35
  "scripts": {
37
- "build": "tsc -p tsconfig.build.json && node scripts/build-runtime.mjs",
38
- "sync:runtime": "npm run build && node scripts/sync-embedded-runtime.mjs",
36
+ "build": "cargo build -p supercov",
39
37
  "sync:rust-assets": "node scripts/sync-rust-package-assets.mjs",
40
- "test:embedded-runtime": "node scripts/sync-embedded-runtime.mjs --check",
41
38
  "test:rust-assets": "node scripts/sync-rust-package-assets.mjs --check",
42
- "test": "node --test --test-concurrency=4 tests/unit/*.test.ts",
43
- "test:types": "tsc --noEmit",
44
- "test:fixture": "npm run build && npm --prefix tests/fixtures/generic-playwright run test:coverage && node scripts/opaque-runner-integration.mjs && node scripts/opaque-esm-integration.mjs && node scripts/node-test-integration.mjs && node scripts/jest-integration.mjs && node scripts/generic-build-integration.mjs && node scripts/next-integration.mjs && node scripts/distributed-merge-integration.mjs && node scripts/agent-query-eval.mjs",
45
- "test:packed-npx": "node scripts/packed-npx-integration.mjs",
46
- "test:isolation": "npm run build && node scripts/isolation-integration.mjs",
47
- "test:filesystem": "npm run build && node --test --test-concurrency=1 tests/unit/atomic.test.ts tests/unit/evidenceArchive.test.ts tests/unit/workspace.test.ts && node scripts/workspace-crash-integration.mjs",
48
- "test:watchdog": "npm run build && node scripts/watchdog-integration.mjs",
49
- "test:engine-contract": "npm run build && node scripts/engine-contract.mjs",
50
- "test:rust": "cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace && cargo build -p supercov && npm run build && npm run test:embedded-runtime && npm run test:rust-assets && node scripts/rust-js-differential.mjs && node scripts/rust-analysis-differential.mjs && node scripts/rust-report-differential.mjs && node scripts/rust-archive-differential.mjs && node scripts/rust-minimize-differential.mjs && node scripts/rust-source-discovery-differential.mjs && node scripts/rust-project-discovery-differential.mjs && node scripts/rust-lifecycle-differential.mjs && node scripts/rust-query-differential.mjs && node scripts/rust-workspace-differential.mjs && node scripts/rust-process-supervision.mjs && node scripts/rust-direct-node-integration.mjs && node scripts/rust-public-run-integration.mjs && node scripts/rust-embedded-runtime-integration.mjs && node scripts/rust-direct-vitest-integration.mjs && node scripts/rust-direct-playwright-integration.mjs && node scripts/rust-generic-esbuild-integration.mjs && node scripts/rust-generic-tsc-integration.mjs && node scripts/rust-generic-build-matrix.mjs",
51
- "test:rust-engine": "npm run build && cargo build -p supercov && node scripts/rust-engine-parity.mjs",
52
- "test:rust-platform": "cargo test --workspace && cargo build -p supercov && node scripts/rust-process-supervision.mjs && node scripts/workspace-crash-integration.mjs --engine rust",
53
- "test:native-package": "npm run build && cargo build --release -p supercov && node scripts/native-package-integration.mjs && node scripts/native-release-set-integration.mjs",
39
+ "test": "cargo test --workspace",
40
+ "test:runtime": "node --test tests/runtime/*.test.mjs",
41
+ "test:fixture": "cargo build -p supercov && node scripts/rust-fixture-matrix.mjs",
42
+ "test:packed-npx": "cargo build --release -p supercov && node scripts/packed-npx-integration.mjs",
43
+ "test:isolation": "cargo build -p supercov && node scripts/isolation-integration.mjs",
44
+ "test:filesystem": "cargo test --workspace && cargo build -p supercov && node scripts/workspace-crash-integration.mjs",
45
+ "test:watchdog": "cargo build -p supercov && node scripts/watchdog-integration.mjs",
46
+ "test:engine-contract": "cargo build -p supercov && node scripts/engine-contract.mjs",
47
+ "test:agent": "cargo build -p supercov && node scripts/agent-query-eval.mjs",
48
+ "test:engine": "cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace && cargo build -p supercov && npm run test:runtime && npm run test:rust-assets && node scripts/rust-process-supervision.mjs && node scripts/rust-direct-node-integration.mjs && node scripts/rust-public-run-integration.mjs && node scripts/rust-embedded-runtime-integration.mjs && node scripts/rust-direct-vitest-integration.mjs && node scripts/rust-direct-playwright-integration.mjs && node scripts/rust-generic-esbuild-integration.mjs && node scripts/rust-generic-tsc-integration.mjs && node scripts/rust-generic-build-matrix.mjs && node scripts/rust-vite-playwright-integration.mjs",
49
+ "test:platform": "cargo test --workspace && cargo build -p supercov && node scripts/rust-process-supervision.mjs && node scripts/workspace-crash-integration.mjs",
50
+ "test:native-package": "cargo build --release -p supercov && node scripts/native-package-integration.mjs && node scripts/native-release-set-integration.mjs",
54
51
  "test:pypi-wheel": "node scripts/pypi-wheel-integration.mjs",
55
52
  "test:pypi-registry": "node scripts/pypi-registry-integration.mjs",
56
53
  "build:rubygem": "cargo build --release -p supercov && node scripts/build-rubygem.mjs",
57
54
  "test:rubygem": "node scripts/rubygem-integration.mjs",
58
55
  "test:rubygem-registry": "node scripts/rubygem-registry-integration.mjs",
59
- "test:rust-syntax": "npm run build && cargo build -p supercov && node scripts/rust-syntax-matrix.mjs",
60
- "test:rust-fixture": "npm run build && cargo build -p supercov && node scripts/rust-vite-playwright-integration.mjs && node scripts/rust-fixture-matrix.mjs",
56
+ "test:syntax": "cargo build -p supercov && node scripts/rust-syntax-matrix.mjs",
61
57
  "test:clang-mcdc": "node scripts/clang-mcdc-oracle.mjs",
62
- "test:test262": "npm run build && cargo build --release -p supercov && node scripts/test262-equivalence.mjs --engine rust",
63
- "benchmark:check": "npm run build && node scripts/benchmark.mjs",
64
- "benchmark:rust-transform": "npm run build && cargo build --release -p supercov && node scripts/rust-transform-benchmark.mjs",
65
- "check": "npm run test && npm run test:types",
66
- "release:check": "npm run check && npm run test:rust && npm run test:watchdog && npm run test:engine-contract && npm run test:packed-npx && npm run test:clang-mcdc && node scripts/benchmark.mjs && npm run benchmark:rust-transform",
67
- "prepack": "npm run build",
58
+ "test:test262": "cargo build --release -p supercov && node scripts/test262-equivalence.mjs",
59
+ "benchmark:check": "cargo build --release -p supercov && node scripts/rust-transform-benchmark.mjs",
60
+ "check": "cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warnings && npm run test && npm run test:runtime && npm run test:rust-assets && node scripts/package-preflight.mjs",
61
+ "release:check": "npm run check && npm run test:engine && npm run test:fixture && npm run test:watchdog && npm run test:engine-contract && npm run test:agent && npm run test:packed-npx && npm run test:clang-mcdc && npm run benchmark:check",
62
+ "prepack": "node scripts/package-preflight.mjs",
68
63
  "prepublishOnly": "npm run release:check"
69
64
  },
70
- "dependencies": {
71
- "@babel/generator": "^8.0.0",
72
- "@babel/parser": "^8.0.4",
73
- "@babel/traverse": "^8.0.4",
74
- "@babel/types": "^8.0.4"
75
- },
76
65
  "optionalDependencies": {
77
- "@supercov/cli-darwin-arm64": "0.0.11",
78
- "@supercov/cli-darwin-x64": "0.0.11",
79
- "@supercov/cli-linux-arm64-gnu": "0.0.11",
80
- "@supercov/cli-linux-arm64-musl": "0.0.11",
81
- "@supercov/cli-linux-x64-gnu": "0.0.11",
82
- "@supercov/cli-linux-x64-musl": "0.0.11"
66
+ "@supercov/cli-darwin-arm64": "0.0.13",
67
+ "@supercov/cli-darwin-x64": "0.0.13",
68
+ "@supercov/cli-linux-arm64-gnu": "0.0.13",
69
+ "@supercov/cli-linux-arm64-musl": "0.0.13",
70
+ "@supercov/cli-linux-x64-gnu": "0.0.13",
71
+ "@supercov/cli-linux-x64-musl": "0.0.13"
83
72
  },
84
73
  "peerDependencies": {
85
74
  "@playwright/test": ">=1.55.0",
@@ -102,8 +91,7 @@
102
91
  "@swc/core": "^1.16.1",
103
92
  "@types/node": "^24.0.0",
104
93
  "esbuild": "^0.28.2",
105
- "fast-check": "^4.9.0",
106
- "jest": "^30.4.2",
94
+ "expect": "30.4.1",
107
95
  "next": "^16.3.2",
108
96
  "react": "^19.2.4",
109
97
  "react-dom": "^19.2.4",
@@ -44,4 +44,3 @@ export function atomicRenameSync(source, destination) {
44
44
  renameSync(source, destination);
45
45
  fsyncDirectory(dirname(destination));
46
46
  }
47
- //# sourceMappingURL=atomic.js.map
@@ -16,6 +16,7 @@ const patchedBuilders = new WeakSet();
16
16
  const exportedValues = new WeakSet();
17
17
  const capabilityProxies = new WeakMap();
18
18
  const importedCapabilityProxies = new WeakMap();
19
+ const importedMemberProxies = new WeakMap();
19
20
  let installed = false;
20
21
  let remoteLaunchSequence = 0;
21
22
  function executionLogPath(path) {
@@ -227,6 +228,43 @@ function wrapResult(value, mapping) {
227
228
  return value.then((result) => wrapCapabilityObject(result, mapping));
228
229
  return wrapCapabilityObject(value, mapping);
229
230
  }
231
+
232
+ // A Proxy `get` trap must return the exact value of a non-configurable,
233
+ // non-writable own data property (and `undefined` for a non-configurable
234
+ // accessor without a getter). Constructors commonly expose `prototype` this
235
+ // way. Returning another capability proxy is a TypeError before user code can
236
+ // run, as seen with PrismaSessionStorage during an Essential Apps VM bake.
237
+ function fixedProxyValue(target, property) {
238
+ const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
239
+ if (!descriptor || descriptor.configurable)
240
+ return { fixed: false };
241
+ if ("value" in descriptor && !descriptor.writable)
242
+ return { fixed: true, value: descriptor.value };
243
+ if (!("value" in descriptor) && descriptor.get === undefined)
244
+ return { fixed: true, value: undefined };
245
+ return { fixed: false };
246
+ }
247
+
248
+ function wrapImportedMember(member, receiver, invoke) {
249
+ let members = importedMemberProxies.get(receiver);
250
+ if (!members) {
251
+ members = new WeakMap();
252
+ importedMemberProxies.set(receiver, members);
253
+ }
254
+ const cached = members.get(member);
255
+ if (cached)
256
+ return cached;
257
+ const proxy = new Proxy(member, {
258
+ apply(target, _thisArgument, args) {
259
+ return invoke(target, receiver, args);
260
+ },
261
+ construct(target, args, newTarget) {
262
+ return wrapImportedCapability(Reflect.construct(target, args, newTarget));
263
+ },
264
+ });
265
+ members.set(member, proxy);
266
+ return proxy;
267
+ }
230
268
  /**
231
269
  * A remote SDK can hide its first executable launch inside a configuration
232
270
  * callback (for example an image warmup hook). Decorate callbacks in ordinary
@@ -287,6 +325,9 @@ export function wrapCapabilityObject(value, mapping) {
287
325
  return cached;
288
326
  const proxy = new Proxy(object, {
289
327
  get(target, property) {
328
+ const fixed = fixedProxyValue(target, property);
329
+ if (fixed.fixed)
330
+ return fixed.value;
290
331
  // Use the real target as the receiver so SDK getters backed by private
291
332
  // fields keep their brand check. Method calls are likewise bound below.
292
333
  const member = Reflect.get(target, property, target);
@@ -362,10 +403,13 @@ export function wrapImportedCapability(value) {
362
403
  };
363
404
  const proxy = new Proxy(object, {
364
405
  get(target, property) {
406
+ const fixed = fixedProxyValue(target, property);
407
+ if (fixed.fixed)
408
+ return fixed.value;
365
409
  const member = Reflect.get(target, property, target);
366
410
  if (typeof member !== "function")
367
411
  return wrapImportedCapability(member);
368
- return (...args) => invoke(member, target, args);
412
+ return wrapImportedMember(member, target, invoke);
369
413
  },
370
414
  ...(typeof value === "function"
371
415
  ? {
@@ -522,4 +566,3 @@ export function installLaunchSupervisor() {
522
566
  entrypoint: process.argv[1],
523
567
  });
524
568
  }
525
- //# sourceMappingURL=launchSupervisor.js.map
@@ -27,4 +27,3 @@ export const rejects = adapter.rejects;
27
27
  export const strict = strictAdapter;
28
28
  export const strictEqual = adapter.strictEqual;
29
29
  export const throws = adapter.throws;
30
- //# sourceMappingURL=nodeAssert.js.map
@@ -91,4 +91,3 @@ export function setStrictAssertAdapter(adapter, strict) {
91
91
  writable: true,
92
92
  });
93
93
  }
94
- //# sourceMappingURL=nodeAssertAdapter.js.map
@@ -25,4 +25,3 @@ export const rejects = adapter.rejects;
25
25
  export const strict = adapter;
26
26
  export const strictEqual = adapter.strictEqual;
27
27
  export const throws = adapter.throws;
28
- //# sourceMappingURL=nodeAssertStrict.js.map
@@ -133,4 +133,3 @@ export const snapshot = native.snapshot;
133
133
  export const run = native.run;
134
134
  export const assert = native.assert;
135
135
  export default test;
136
- //# sourceMappingURL=nodeTest.js.map
@@ -885,4 +885,3 @@ const instrumentedTest = base.extend({
885
885
  });
886
886
  export const test = instrumentedTest;
887
887
  /*__SUPERCOV_ADAPTER_EXPORTS__*/
888
- //# sourceMappingURL=playwright.js.map
@@ -38,4 +38,3 @@ export default class SupercovPlaywrightReporter {
38
38
  atomicWriteFileSync(resolve(directory, "mcdc.json"), `${JSON.stringify(payload)}\n`);
39
39
  }
40
40
  }
41
- //# sourceMappingURL=playwrightReporter.js.map
@@ -48,4 +48,3 @@ export function inferTestProvenance({ runner, file, project, explicitKind, }) {
48
48
  source: defaultKind === "unknown" ? "unknown" : "runner-default",
49
49
  };
50
50
  }
51
- //# sourceMappingURL=provenance.js.map
@@ -16,7 +16,9 @@ installLaunchSupervisor();
16
16
  // run and periodically reports public active-resource types. This deliberately
17
17
  // uses no Unix signal: a launch tree may contain uninstrumented Node children,
18
18
  // and signalling one would terminate a healthy command by default.
19
- if (!process.__SUPERCOV_DIAGNOSTIC_REPORTER__) {
19
+ const verboseDiagnostics = [process.env.SUPERCOV_VERBOSE, process.env.SUPERCOV_DEBUG]
20
+ .some(value => value === "1" || value === "true" || value === "yes");
21
+ if (verboseDiagnostics && !process.__SUPERCOV_DIAGNOSTIC_REPORTER__) {
20
22
  process.__SUPERCOV_DIAGNOSTIC_REPORTER__ = true;
21
23
  const ownerFile = process.env.SUPERCOV_DIAGNOSTIC_OWNER_FILE;
22
24
  let ownerDescriptor;
@@ -247,4 +249,3 @@ if (process.env.SUPERCOV_CJS_INTERCEPT === "1") {
247
249
  return originalLoad.call(this, request, parent, isMain);
248
250
  };
249
251
  }
250
- //# sourceMappingURL=register.mjs.map
@@ -1,11 +1,3 @@
1
- var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
- });
6
- }
7
- return path;
8
- };
9
1
  import { resolve as resolvePath } from "node:path";
10
2
  import { pathToFileURL } from "node:url";
11
3
  const GENERATED_TARGET = "__SUPERCOV_PLAYWRIGHT_MODULE__";
@@ -81,37 +73,3 @@ export async function resolve(specifier, context, nextResolve) {
81
73
  }
82
74
  return nextResolve(specifier, context);
83
75
  }
84
- export async function load(url, context, nextLoad) {
85
- const loaded = await nextLoad(url, context);
86
- const transformer = process.env.SUPERCOV_ESM_TRANSFORMER;
87
- const wrapper = process.env.SUPERCOV_ESM_CAPABILITY_WRAPPER;
88
- if (!transformer ||
89
- !wrapper ||
90
- loaded.format !== "module" ||
91
- !belongsToProject(url) ||
92
- loaded.source === undefined ||
93
- loaded.source === null)
94
- return loaded;
95
- const source = typeof loaded.source === "string"
96
- ? loaded.source
97
- : Buffer.from(loaded.source).toString("utf8");
98
- try {
99
- const transformerUrl = transformer.startsWith("file:")
100
- ? transformer
101
- : pathToFileURL(resolvePath(transformer)).href;
102
- const wrapperUrl = wrapper.startsWith("file:")
103
- ? wrapper
104
- : pathToFileURL(resolvePath(wrapper)).href;
105
- const { transformCapabilityImports } = await import(__rewriteRelativeImportExtension(transformerUrl));
106
- const transformed = transformCapabilityImports(source, url, wrapperUrl);
107
- return transformed.transformed
108
- ? { ...loaded, source: transformed.code }
109
- : loaded;
110
- }
111
- catch (error) {
112
- if (process.env.SUPERCOV_DEBUG === "1")
113
- console.error("[supercov] ESM capability transform skipped", { url, error });
114
- return loaded;
115
- }
116
- }
117
- //# sourceMappingURL=resolve-loader.mjs.map
@@ -93,4 +93,3 @@ export function writeRunnerEvidence(identity, status, scope, evidenceDirectoryOv
93
93
  mkdirSync(directory, { recursive: true });
94
94
  atomicWriteFileSync(resolve(directory, "mcdc.json"), `${JSON.stringify(payload)}\n`);
95
95
  }
96
- //# sourceMappingURL=runnerEvidence.js.map
@@ -105,4 +105,3 @@ export function backgroundEvidenceDirectory(runId, root = configuredServerEviden
105
105
  export function backgroundEvidencePath(runId, processId = typeof process === "undefined" ? "unknown" : String(process.pid), root = configuredServerEvidenceRoot()) {
106
106
  return `${backgroundEvidenceDirectory(runId, root)}/${pathComponent(processId)}.jsonl`;
107
107
  }
108
- //# sourceMappingURL=transport.js.map
@@ -122,4 +122,3 @@ afterEach((context) => {
122
122
  activeScopes.delete(task.id);
123
123
  runtime.activateCoverageScope();
124
124
  });
125
- //# sourceMappingURL=vitest.js.map
@@ -94,4 +94,3 @@ export default class SupercovVitestReporter {
94
94
  visit(file, file);
95
95
  }
96
96
  }
97
- //# sourceMappingURL=vitestReporter.js.map
@@ -1,45 +0,0 @@
1
- export declare const AGENT_JSON_SCHEMA_VERSION: 1;
2
- export declare const AGENT_JSON_MAX_BYTES: number;
3
- export declare const SUPERCOV_ERROR_CODES: readonly ["AMBIGUOUS_SELECTOR", "DECISION_NOT_FOUND", "FILTER_UNAVAILABLE", "INTERNAL_ERROR", "INVALID_ARGUMENT", "MINIMIZATION_COMPLEXITY_LIMIT", "NO_RUNS", "RESPONSE_TOO_LARGE", "RUN_NOT_FOUND", "SCOPE_UNAVAILABLE", "SOURCE_NOT_FOUND", "TARGET_UNREACHABLE", "TEST_FILTER_EMPTY", "TEST_NOT_FOUND", "UNATTRIBUTED_EVIDENCE", "UNKNOWN_COMMAND"];
4
- export type SupercovErrorCode = (typeof SUPERCOV_ERROR_CODES)[number];
5
- export interface AgentJsonPagination {
6
- offset: number;
7
- limit: number;
8
- returned: number;
9
- total: number;
10
- hasMore: boolean;
11
- nextOffset: number | null;
12
- }
13
- export interface AgentJsonSuccess {
14
- schemaVersion: typeof AGENT_JSON_SCHEMA_VERSION;
15
- ok: true;
16
- command: string;
17
- data: unknown;
18
- pagination?: AgentJsonPagination;
19
- }
20
- export interface AgentJsonFailure {
21
- schemaVersion: typeof AGENT_JSON_SCHEMA_VERSION;
22
- ok: false;
23
- command?: string;
24
- error: {
25
- code: SupercovErrorCode;
26
- message: string;
27
- retryable: boolean;
28
- details?: Record<string, unknown>;
29
- };
30
- }
31
- export declare class SupercovError extends Error {
32
- readonly code: SupercovErrorCode;
33
- readonly retryable: boolean;
34
- readonly details?: Record<string, unknown>;
35
- constructor(code: SupercovErrorCode, message: string, options?: {
36
- retryable?: boolean;
37
- details?: Record<string, unknown>;
38
- cause?: unknown;
39
- });
40
- }
41
- export declare function agentPagination(offset: number, limit: number, returned: number, total: number): AgentJsonPagination;
42
- export declare function agentSuccessJson(command: string, data: unknown, pagination?: AgentJsonPagination): string;
43
- export declare function asSupercovError(error: unknown): SupercovError;
44
- export declare function agentFailureJson(error: unknown, command?: string): string;
45
- //# sourceMappingURL=agentJson.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agentJson.d.ts","sourceRoot":"","sources":["../src/agentJson.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,EAAG,CAAU,CAAC;AACpD,eAAO,MAAM,oBAAoB,QAAY,CAAC;AAE9C,eAAO,MAAM,oBAAoB,YAC/B,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,+BAA+B,EAC/B,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,CACT,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,yBAAyB,CAAC;IAChD,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,yBAAyB,CAAC;IAChD,EAAE,EAAE,KAAK,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QACL,IAAI,EAAE,iBAAiB,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC;CACH;AAED,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE3C,YACE,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,KAAK,CAAC,EAAE,OAAO,CAAC;KACZ,EAOP;CACF;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAWrB;AAMD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,EACb,UAAU,CAAC,EAAE,mBAAmB,GAC/B,MAAM,CAwBR;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAO7D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAyBR"}
package/dist/agentJson.js DELETED
@@ -1,102 +0,0 @@
1
- import { Buffer } from "node:buffer";
2
- export const AGENT_JSON_SCHEMA_VERSION = 1;
3
- export const AGENT_JSON_MAX_BYTES = 64 * 1024;
4
- export const SUPERCOV_ERROR_CODES = [
5
- "AMBIGUOUS_SELECTOR",
6
- "DECISION_NOT_FOUND",
7
- "FILTER_UNAVAILABLE",
8
- "INTERNAL_ERROR",
9
- "INVALID_ARGUMENT",
10
- "MINIMIZATION_COMPLEXITY_LIMIT",
11
- "NO_RUNS",
12
- "RESPONSE_TOO_LARGE",
13
- "RUN_NOT_FOUND",
14
- "SCOPE_UNAVAILABLE",
15
- "SOURCE_NOT_FOUND",
16
- "TARGET_UNREACHABLE",
17
- "TEST_FILTER_EMPTY",
18
- "TEST_NOT_FOUND",
19
- "UNATTRIBUTED_EVIDENCE",
20
- "UNKNOWN_COMMAND",
21
- ];
22
- export class SupercovError extends Error {
23
- code;
24
- retryable;
25
- details;
26
- constructor(code, message, options = {}) {
27
- super(message, options.cause === undefined ? undefined : { cause: options.cause });
28
- this.name = "SupercovError";
29
- this.code = code;
30
- this.retryable = options.retryable ?? false;
31
- this.details = options.details;
32
- }
33
- }
34
- export function agentPagination(offset, limit, returned, total) {
35
- const nextOffset = offset + returned;
36
- const hasMore = returned > 0 && nextOffset < total;
37
- return {
38
- offset,
39
- limit,
40
- returned,
41
- total,
42
- hasMore,
43
- nextOffset: hasMore ? nextOffset : null,
44
- };
45
- }
46
- function serialized(value) {
47
- return `${JSON.stringify(value)}\n`;
48
- }
49
- export function agentSuccessJson(command, data, pagination) {
50
- const envelope = {
51
- schemaVersion: AGENT_JSON_SCHEMA_VERSION,
52
- ok: true,
53
- command,
54
- data,
55
- ...(pagination ? { pagination } : {}),
56
- };
57
- const json = serialized(envelope);
58
- const bytes = Buffer.byteLength(json);
59
- if (bytes > AGENT_JSON_MAX_BYTES) {
60
- throw new SupercovError("RESPONSE_TOO_LARGE", `JSON response is ${bytes} bytes; the maximum is ${AGENT_JSON_MAX_BYTES} bytes`, {
61
- details: {
62
- actualBytes: bytes,
63
- maxBytes: AGENT_JSON_MAX_BYTES,
64
- hint: "Use --offset/--limit or a narrower coverage query.",
65
- },
66
- });
67
- }
68
- return json;
69
- }
70
- export function asSupercovError(error) {
71
- if (error instanceof SupercovError)
72
- return error;
73
- return new SupercovError("INTERNAL_ERROR", error instanceof Error ? error.message : String(error), { cause: error });
74
- }
75
- export function agentFailureJson(error, command) {
76
- const failure = asSupercovError(error);
77
- const envelope = {
78
- schemaVersion: AGENT_JSON_SCHEMA_VERSION,
79
- ok: false,
80
- ...(command ? { command } : {}),
81
- error: {
82
- code: failure.code,
83
- message: failure.message,
84
- retryable: failure.retryable,
85
- ...(failure.details ? { details: failure.details } : {}),
86
- },
87
- };
88
- const json = serialized(envelope);
89
- if (Buffer.byteLength(json) <= AGENT_JSON_MAX_BYTES)
90
- return json;
91
- return serialized({
92
- schemaVersion: AGENT_JSON_SCHEMA_VERSION,
93
- ok: false,
94
- ...(command ? { command } : {}),
95
- error: {
96
- code: failure.code,
97
- message: failure.message.slice(0, 1_000),
98
- retryable: failure.retryable,
99
- },
100
- });
101
- }
102
- //# sourceMappingURL=agentJson.js.map