@ait-co/devtools 0.1.128 → 0.1.129

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 (66) hide show
  1. package/dist/{attach-orchestrator-CpE0dMew.js → attach-orchestrator-Bdt5Zdo9.js} +3 -94
  2. package/dist/attach-orchestrator-Bdt5Zdo9.js.map +1 -0
  3. package/dist/{attach-orchestrator-CPMQWkGV.js → attach-orchestrator-DvrgUIx7.js} +4 -95
  4. package/dist/attach-orchestrator-DvrgUIx7.js.map +1 -0
  5. package/dist/{bundle-Cb3GFuw6.d.ts → bundle-BKqyhEK9.d.ts} +1 -1
  6. package/dist/{bundle-Cb3GFuw6.d.ts.map → bundle-BKqyhEK9.d.ts.map} +1 -1
  7. package/dist/{capture-B1zfGyTo.d.ts → capture-ltuV0gZa.d.ts} +1 -1
  8. package/dist/{capture-B1zfGyTo.d.ts.map → capture-ltuV0gZa.d.ts.map} +1 -1
  9. package/dist/{cdp-connection-Dxw_EY8s.d.ts → cdp-connection-D7AYQck2.d.ts} +1 -1
  10. package/dist/{cdp-connection-Dxw_EY8s.d.ts.map → cdp-connection-D7AYQck2.d.ts.map} +1 -1
  11. package/dist/{cell-D0dJSGHi.js → cell-DA_lcpDI.js} +2 -2
  12. package/dist/{cell-D0dJSGHi.js.map → cell-DA_lcpDI.js.map} +1 -1
  13. package/dist/{cell-CX92lDI0.js → cell-DLRv4iG6.js} +2 -2
  14. package/dist/{cell-CX92lDI0.js.map → cell-DLRv4iG6.js.map} +1 -1
  15. package/dist/{debug-server-Dctc9GAh.js → debug-server--Y0QZVJS.js} +57 -58
  16. package/dist/debug-server--Y0QZVJS.js.map +1 -0
  17. package/dist/debug-server-Bu3pCG9c.js +436 -0
  18. package/dist/debug-server-Bu3pCG9c.js.map +1 -0
  19. package/dist/debug-server-e1qPe0ZB.js +379 -0
  20. package/dist/{debug-server-BzzNkETg.js.map → debug-server-e1qPe0ZB.js.map} +1 -1
  21. package/dist/log-CUik_tHp.js +95 -0
  22. package/dist/log-CUik_tHp.js.map +1 -0
  23. package/dist/mcp/cli.js +1152 -1099
  24. package/dist/mcp/cli.js.map +1 -1
  25. package/dist/mcp/server.js +1 -1
  26. package/dist/panel/index.js +1 -1
  27. package/dist/{pool-DBLKNeRC.d.ts → pool-C0pc7T2p.d.ts} +4 -4
  28. package/dist/{pool-DBLKNeRC.d.ts.map → pool-C0pc7T2p.d.ts.map} +1 -1
  29. package/dist/{qr-http-server-Bo8LMOJQ.js → qr-http-server-HANhOFwI.js} +1 -1
  30. package/dist/{qr-http-server-Bo8LMOJQ.js.map → qr-http-server-HANhOFwI.js.map} +1 -1
  31. package/dist/{relay-factory-Dug7W6Ao.js → relay-factory-Ck3vBonr.js} +6 -6
  32. package/dist/{relay-factory-Dug7W6Ao.js.map → relay-factory-Ck3vBonr.js.map} +1 -1
  33. package/dist/{relay-secret-store-DKxs7zwq.js → relay-secret-store-DzxDsK6S.js} +1 -1
  34. package/dist/{relay-secret-store-DKxs7zwq.js.map → relay-secret-store-DzxDsK6S.js.map} +1 -1
  35. package/dist/{relay-url-store-xmUuTjXA.js → relay-url-store-D3rY-GJJ.js} +2 -2
  36. package/dist/{relay-url-store-xmUuTjXA.js.map → relay-url-store-D3rY-GJJ.js.map} +1 -1
  37. package/dist/{debug-server-BzzNkETg.js → relay-worker-Bt0QYKQH.js} +212 -346
  38. package/dist/relay-worker-Bt0QYKQH.js.map +1 -0
  39. package/dist/{relay-worker-TReZtzGl.d.ts → relay-worker-o0M2ndyJ.d.ts} +7 -7
  40. package/dist/relay-worker-o0M2ndyJ.d.ts.map +1 -0
  41. package/dist/{runtime-ozyPnRbU.d.ts → runtime-9xhN9pr8.d.ts} +1 -1
  42. package/dist/{runtime-ozyPnRbU.d.ts.map → runtime-9xhN9pr8.d.ts.map} +1 -1
  43. package/dist/test-runner/bin.js +706 -13
  44. package/dist/test-runner/bin.js.map +1 -1
  45. package/dist/test-runner/bundle.d.ts +1 -1
  46. package/dist/test-runner/capture.d.ts +1 -1
  47. package/dist/test-runner/config.d.ts +1 -1
  48. package/dist/test-runner/config.js +1 -1
  49. package/dist/test-runner/pool.d.ts +1 -1
  50. package/dist/test-runner/pool.js +1 -1
  51. package/dist/test-runner/relay-factory.d.ts +1 -1
  52. package/dist/test-runner/relay-factory.js +1 -1
  53. package/dist/test-runner/relay-worker.d.ts +1 -1
  54. package/dist/test-runner/relay-worker.js +1 -187
  55. package/dist/test-runner/report.d.ts +3 -3
  56. package/dist/test-runner/rpc.d.ts +2 -2
  57. package/dist/test-runner/runtime.d.ts +1 -1
  58. package/dist/test-runner/task-graph.d.ts +1 -1
  59. package/package.json +1 -1
  60. package/dist/attach-orchestrator-CPMQWkGV.js.map +0 -1
  61. package/dist/attach-orchestrator-CpE0dMew.js.map +0 -1
  62. package/dist/debug-server-1dhDA3aw.js +0 -980
  63. package/dist/debug-server-1dhDA3aw.js.map +0 -1
  64. package/dist/debug-server-Dctc9GAh.js.map +0 -1
  65. package/dist/relay-worker-TReZtzGl.d.ts.map +0 -1
  66. package/dist/test-runner/relay-worker.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import { n as BundleResult, r as bundleTestFile, t as BundleOptions } from "../bundle-Cb3GFuw6.js";
1
+ import { n as BundleResult, r as bundleTestFile, t as BundleOptions } from "../bundle-BKqyhEK9.js";
2
2
  export { BundleOptions, BundleResult, bundleTestFile };
@@ -1,2 +1,2 @@
1
- import { n as parseCaptureLines, t as AitCaptureLine } from "../capture-B1zfGyTo.js";
1
+ import { n as parseCaptureLines, t as AitCaptureLine } from "../capture-ltuV0gZa.js";
2
2
  export { AitCaptureLine, parseCaptureLines };
@@ -1,4 +1,4 @@
1
- import { i as createRelayPool, n as RelayConnectionFactory, t as RELAY_POOL_NAME } from "../pool-DBLKNeRC.js";
1
+ import { i as createRelayPool, n as RelayConnectionFactory, t as RELAY_POOL_NAME } from "../pool-C0pc7T2p.js";
2
2
 
3
3
  //#region src/test-runner/relay-factory.d.ts
4
4
  /** Options for {@link createRelayConnectionFactory}. */
@@ -1,5 +1,5 @@
1
1
  import { RELAY_POOL_NAME, createRelayPool } from "./pool.js";
2
- import { t as createRelayConnectionFactory } from "../relay-factory-Dug7W6Ao.js";
2
+ import { t as createRelayConnectionFactory } from "../relay-factory-Ck3vBonr.js";
3
3
  //#region src/test-runner/config.ts
4
4
  const DEFAULT_CONFIG = {
5
5
  include: ["**/*.ait.test.ts"],
@@ -1,2 +1,2 @@
1
- import { i as createRelayPool, n as RelayConnectionFactory, r as RelayPoolOptions, t as RELAY_POOL_NAME } from "../pool-DBLKNeRC.js";
1
+ import { i as createRelayPool, n as RelayConnectionFactory, r as RelayPoolOptions, t as RELAY_POOL_NAME } from "../pool-C0pc7T2p.js";
2
2
  export { RELAY_POOL_NAME, RelayConnectionFactory, RelayPoolOptions, createRelayPool };
@@ -1,4 +1,4 @@
1
- import { runTestFilesOverRelay } from "./relay-worker.js";
1
+ import { r as runTestFilesOverRelay } from "../relay-worker-Bt0QYKQH.js";
2
2
  import { synthesizeFileTask, toTaskEventPacks, toTaskResultPacks } from "./task-graph.js";
3
3
  //#region src/test-runner/pool.ts
4
4
  /** The pool name Vitest matches against `getFilePoolName(project)`. */
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import * as fs from "node:fs";
3
- import { URL as URL$1 } from "node:url";
4
3
  import { EventEmitter } from "node:events";
4
+ import { URL as URL$1 } from "node:url";
5
5
  import * as http from "node:http";
6
6
  import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders } from "node:http";
7
7
  import * as net from "node:net";
@@ -24,7 +24,7 @@ function createRelayConnectionFactory(opts) {
24
24
  const { prepareAttach, renderAndMaybeWait, mintAttachUrl } = await import("../attach-orchestrator-RhOdO3DS.js");
25
25
  const { injectDebugIndicator, injectGlobals } = await import("../cell-Ba9lCI3B.js");
26
26
  const { loadRelaySecretReadOnly } = await import("../relay-secret-store-BcVrWwTq.js");
27
- const { bootRelayFamily, buildRelayVerifyAuth } = await import("../debug-server-Dctc9GAh.js");
27
+ const { bootRelayFamily, buildRelayVerifyAuth } = await import("../debug-server--Y0QZVJS.js");
28
28
  await loadRelaySecretReadOnly({ projectRoot });
29
29
  let resolveTunnelUp;
30
30
  const tunnelReady = new Promise((resolve) => {
@@ -1,2 +1,2 @@
1
- import { a as flattenResults, i as RelayRunReport, n as FileResult, o as runTestFilesOverRelay, r as RelayRunOptions, t as EVALUATE_TIMEOUT_MARKER } from "../relay-worker-TReZtzGl.js";
1
+ import { a as flattenResults, i as RelayRunReport, n as FileResult, o as runTestFilesOverRelay, r as RelayRunOptions, t as EVALUATE_TIMEOUT_MARKER } from "../relay-worker-o0M2ndyJ.js";
2
2
  export { EVALUATE_TIMEOUT_MARKER, FileResult, RelayRunOptions, RelayRunReport, flattenResults, runTestFilesOverRelay };
@@ -1,188 +1,2 @@
1
- import { bundleTestFile } from "./bundle.js";
2
- import { parseCaptureLines } from "./capture.js";
3
- import { injectAndRunBundle } from "./rpc.js";
4
- //#region src/test-runner/relay-worker.ts
5
- /**
6
- * Sentinel string embedded in the error message by `injectAndRunBundle` when
7
- * the per-file evaluate race hits the timeout. Used by the retry guard so only
8
- * genuine timeouts get a second attempt — not bundle errors or parse failures.
9
- *
10
- * Exported for unit tests that assert the retry path is taken.
11
- */
12
- const EVALUATE_TIMEOUT_MARKER = "rpc: evaluate timed out after";
13
- /**
14
- * Runs all `files` sequentially over the given CDP `connection`.
15
- *
16
- * For each file:
17
- * 1. Bundle with esbuild (includes SDK shim + runtime).
18
- * 2. Inject into the attached page via `Runtime.evaluate`.
19
- * 3. Await the `RunReport` JSON response.
20
- * 4. Accumulate results.
21
- *
22
- * Returns a `RelayRunReport` with per-file results and flattened totals.
23
- *
24
- * This function does NOT open or manage the relay connection — the caller
25
- * is responsible for attaching and closing it.
26
- *
27
- * TODO (#645): implement the Vitest `PoolRunnerInitializer` interface here
28
- * so that `runTestFilesOverRelay` can be used as a Vitest pool entry.
29
- *
30
- * @param connection - Active CDP connection (relay or local kind).
31
- * @param files - Absolute paths to test files, run in order.
32
- * @param opts - Optional per-run overrides.
33
- */
34
- async function runTestFilesOverRelay(connection, files, opts) {
35
- const wallStart = Date.now();
36
- const startedAt = new Date(wallStart).toISOString();
37
- const fileResults = [];
38
- let domainsEnabled = false;
39
- try {
40
- await connection.enableDomains();
41
- domainsEnabled = true;
42
- } catch (e) {
43
- process.stderr.write(`relay-worker: enableDomains() failed before run — console capture may be empty (${e instanceof Error ? e.message : String(e)})\n`);
44
- }
45
- const collectCaptures = opts?.collectCaptures === true;
46
- const liveConsole = [];
47
- let unsubscribeConsole;
48
- if (collectCaptures && domainsEnabled) unsubscribeConsole = connection.on("Runtime.consoleAPICalled", (event) => {
49
- liveConsole.push(event);
50
- });
51
- try {
52
- for (const file of files) {
53
- let fileEntry;
54
- try {
55
- const { code } = await bundleTestFile(file, opts?.bundleOptions);
56
- /**
57
- * Runs one evaluate attempt and returns a FileResult, or `null` when the
58
- * result is a genuine timeout and the caller should retry.
59
- *
60
- * We need to distinguish:
61
- * - `rpcResult.ok = false` + timeout error → retry candidate (`return null`)
62
- * - `rpcResult.ok = false` + other error → final error, no retry
63
- * - `injectAndRunBundle` throws → CDP exceptionDetails (page
64
- * engine threw); treated as a final (non-retryable) error.
65
- *
66
- * The Promise.race timeout in rpc.ts RETURNS `{ok:false, error: '…'}` (it
67
- * does NOT throw/reject). Only genuine CDP `exceptionDetails` cause a throw.
68
- * This distinction is what makes the EVALUATE_TIMEOUT_MARKER gate below
69
- * reachable — the timeout result surfaces as `rpcResult.ok=false` with the
70
- * marker string, not as a caught exception.
71
- */
72
- const attempt = async () => {
73
- let rpcResult;
74
- try {
75
- rpcResult = await injectAndRunBundle(connection, code, opts?.timeoutMs);
76
- } catch (e) {
77
- return {
78
- file,
79
- result: { error: e instanceof Error ? e.message : String(e) }
80
- };
81
- }
82
- if (rpcResult.ok) return {
83
- file,
84
- result: rpcResult.report
85
- };
86
- if (rpcResult.error.includes("rpc: evaluate timed out after")) return null;
87
- return {
88
- file,
89
- result: { error: rpcResult.error }
90
- };
91
- };
92
- const firstResult = await attempt();
93
- if (firstResult !== null) fileEntry = firstResult;
94
- else {
95
- process.stderr.write(`relay-worker: evaluate timed out for ${file} — retrying once\n`);
96
- const retryResult = await attempt();
97
- if (retryResult !== null) fileEntry = retryResult;
98
- else fileEntry = {
99
- file,
100
- result: { error: `${EVALUATE_TIMEOUT_MARKER} ${opts?.timeoutMs ?? 3e4}ms (after retry)` }
101
- };
102
- }
103
- } catch (e) {
104
- fileEntry = {
105
- file,
106
- result: { error: e instanceof Error ? e.message : String(e) }
107
- };
108
- }
109
- fileResults.push(fileEntry);
110
- }
111
- } finally {
112
- unsubscribeConsole?.();
113
- }
114
- const captures = collectCaptures ? parseCaptureLines(liveConsole.map((e) => ({ text: renderConsoleLineText(e) }))) : [];
115
- const totals = fileResults.reduce((acc, { result }) => {
116
- if ("error" in result) {
117
- acc.failed += 1;
118
- acc.total += 1;
119
- } else {
120
- acc.passed += result.passed;
121
- acc.failed += result.failed;
122
- acc.skipped += result.skipped;
123
- acc.total += result.passed + result.failed + result.skipped;
124
- }
125
- return acc;
126
- }, {
127
- passed: 0,
128
- failed: 0,
129
- skipped: 0,
130
- total: 0
131
- });
132
- return {
133
- startedAt,
134
- duration: Date.now() - wallStart,
135
- files: fileResults,
136
- totals,
137
- captures
138
- };
139
- }
140
- /**
141
- * Renders one `Runtime.consoleAPICalled` event to a single line of text, the
142
- * same way `tools.ts#normalizeConsoleMessage` does (args rendered + space-
143
- * joined). Inlined here (≈8 lines) so this module avoids importing `tools.ts`,
144
- * which would drag the heavy MCP/Node graph (server-lock, parent-watcher, …)
145
- * onto the test-runner entry.
146
- *
147
- * SECRET-HANDLING: this only stringifies console args; the caller's
148
- * allowlist-prefix parser then discards everything that is not a genuine
149
- * `__AIT_CAPTURE__` line.
150
- */
151
- function renderConsoleLineText(event) {
152
- return event.args.map((arg) => {
153
- if (arg.value !== void 0) {
154
- if (typeof arg.value === "string") return arg.value;
155
- try {
156
- return JSON.stringify(arg.value);
157
- } catch {
158
- return String(arg.value);
159
- }
160
- }
161
- if (arg.description !== void 0) return arg.description;
162
- if (arg.className !== void 0) return arg.className;
163
- return arg.subtype ?? arg.type;
164
- }).join(" ");
165
- }
166
- /**
167
- * Flattens all test results from a `RelayRunReport` into a single array.
168
- * Files that errored during bundle/inject produce a synthetic failed entry.
169
- */
170
- function flattenResults(report) {
171
- const out = [];
172
- for (const { file, result } of report.files) if ("error" in result) out.push({
173
- file,
174
- name: `<bundle/inject error>`,
175
- status: "fail",
176
- duration: 0,
177
- error: result.error
178
- });
179
- else for (const t of result.tests) out.push({
180
- ...t,
181
- file
182
- });
183
- return out;
184
- }
185
- //#endregion
1
+ import { n as flattenResults, r as runTestFilesOverRelay, t as EVALUATE_TIMEOUT_MARKER } from "../relay-worker-Bt0QYKQH.js";
186
2
  export { EVALUATE_TIMEOUT_MARKER, flattenResults, runTestFilesOverRelay };
187
-
188
- //# sourceMappingURL=relay-worker.js.map
@@ -1,6 +1,6 @@
1
- import { t as AitCaptureLine } from "../capture-B1zfGyTo.js";
2
- import { n as TestResult } from "../runtime-ozyPnRbU.js";
3
- import { i as RelayRunReport } from "../relay-worker-TReZtzGl.js";
1
+ import { t as AitCaptureLine } from "../capture-ltuV0gZa.js";
2
+ import { n as TestResult } from "../runtime-9xhN9pr8.js";
3
+ import { i as RelayRunReport } from "../relay-worker-o0M2ndyJ.js";
4
4
 
5
5
  //#region src/test-runner/report.d.ts
6
6
  /** The cell axes a report is stamped with — the test-matrix coordinates. */
@@ -1,5 +1,5 @@
1
- import { t as CdpConnection } from "../cdp-connection-Dxw_EY8s.js";
2
- import { t as RunReport } from "../runtime-ozyPnRbU.js";
1
+ import { t as CdpConnection } from "../cdp-connection-D7AYQck2.js";
2
+ import { t as RunReport } from "../runtime-9xhN9pr8.js";
3
3
 
4
4
  //#region src/test-runner/rpc.d.ts
5
5
  /**
@@ -1,2 +1,2 @@
1
- import { i as runtimeGlobals, n as TestResult, r as runTestModule, t as RunReport } from "../runtime-ozyPnRbU.js";
1
+ import { i as runtimeGlobals, n as TestResult, r as runTestModule, t as RunReport } from "../runtime-9xhN9pr8.js";
2
2
  export { RunReport, TestResult, runTestModule, runtimeGlobals };
@@ -1,4 +1,4 @@
1
- import { t as RunReport } from "../runtime-ozyPnRbU.js";
1
+ import { t as RunReport } from "../runtime-9xhN9pr8.js";
2
2
  import { File, TaskEventPack, TaskResultPack } from "@vitest/runner";
3
3
 
4
4
  //#region src/test-runner/task-graph.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ait-co/devtools",
3
- "version": "0.1.128",
3
+ "version": "0.1.129",
4
4
  "description": "Development tools for Apps in Toss mini-apps — mock SDK, floating devtools panel, and universal bundler plugin",
5
5
  "type": "module",
6
6
  "engines": {