@ait-co/devtools 0.1.118 → 0.1.120

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 (41) hide show
  1. package/dist/{attach-orchestrator-BZsqoFjB.js → attach-orchestrator-BJr41GN8.js} +2 -2
  2. package/dist/{attach-orchestrator-BZsqoFjB.js.map → attach-orchestrator-BJr41GN8.js.map} +1 -1
  3. package/dist/{attach-orchestrator-BEMGBeWm.js → attach-orchestrator-BbCfcfT0.js} +1 -1
  4. package/dist/bundle-CA1TCXED.d.ts.map +1 -1
  5. package/dist/{cell-Dp_pDs_j.js → cell-BCNQJ_cS.js} +2 -2
  6. package/dist/{cell-Dp_pDs_j.js.map → cell-BCNQJ_cS.js.map} +1 -1
  7. package/dist/{cell-BDFMsPXV.js → cell-CJcDstzr.js} +1 -1
  8. package/dist/{cli-BA1ynNNx.js → cli-RhzASQef.js} +45 -27
  9. package/dist/cli-RhzASQef.js.map +1 -0
  10. package/dist/{debug-server-krAOy6cl.js → debug-server-Buc8yoa7.js} +44 -26
  11. package/dist/debug-server-Buc8yoa7.js.map +1 -0
  12. package/dist/{debug-server-T8i9_iCc.js → debug-server-C_5ag9jj.js} +2 -2
  13. package/dist/{debug-server-T8i9_iCc.js.map → debug-server-C_5ag9jj.js.map} +1 -1
  14. package/dist/{debug-server-wo18jR4T.js → debug-server-DNqP-T9V.js} +49 -31
  15. package/dist/debug-server-DNqP-T9V.js.map +1 -0
  16. package/dist/mcp/cli.js +3 -3
  17. package/dist/mcp/server.js +1 -1
  18. package/dist/panel/index.js +1 -1
  19. package/dist/{pool-U9FrxEuR.d.ts → pool-D5QH6Ydv.d.ts} +2 -2
  20. package/dist/{pool-U9FrxEuR.d.ts.map → pool-D5QH6Ydv.d.ts.map} +1 -1
  21. package/dist/{relay-worker-D-3aAyDO.d.ts → relay-worker-BBu1oEqC.d.ts} +2 -2
  22. package/dist/{relay-worker-D-3aAyDO.d.ts.map → relay-worker-BBu1oEqC.d.ts.map} +1 -1
  23. package/dist/{runtime-D57Rtnsd.d.ts → runtime-Bm_sT1C9.d.ts} +2 -2
  24. package/dist/{runtime-D57Rtnsd.d.ts.map → runtime-Bm_sT1C9.d.ts.map} +1 -1
  25. package/dist/test-runner/bundle.js +41 -23
  26. package/dist/test-runner/bundle.js.map +1 -1
  27. package/dist/test-runner/cli.js +1 -1
  28. package/dist/test-runner/config.d.ts +1 -1
  29. package/dist/test-runner/pool.d.ts +1 -1
  30. package/dist/test-runner/relay-factory.js +1 -1
  31. package/dist/test-runner/relay-worker.d.ts +1 -1
  32. package/dist/test-runner/report.d.ts +2 -2
  33. package/dist/test-runner/rpc.d.ts +1 -1
  34. package/dist/test-runner/runtime.d.ts +1 -1
  35. package/dist/test-runner/runtime.js +5 -1
  36. package/dist/test-runner/runtime.js.map +1 -1
  37. package/dist/test-runner/task-graph.d.ts +1 -1
  38. package/package.json +1 -1
  39. package/dist/cli-BA1ynNNx.js.map +0 -1
  40. package/dist/debug-server-krAOy6cl.js.map +0 -1
  41. package/dist/debug-server-wo18jR4T.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as buildDeepLinkAttachUrl, A as isDebugToolName, B as readServerLock, C as getDiagnostics, D as getSdkCallHistory, E as getOperationalEnvironment, F as listPages, G as logWarn, H as isRelayEnv, I as measureSafeArea, J as pageCrashError, K as classifyToolError, L as takeScreenshot, M as listConsoleMessages, N as listExceptions, O as getToolAvailability, P as listNetworkRequests, Q as tierRejectionError, R as takeSnapshot, S as filterToolsByEnvironment, T as getMockState, U as logError, V as deriveEnvironment, W as logInfo, X as relayDisconnectError, Y as pageMissingError, Z as sdkAbsentError, _ as BOOTSTRAP_TOOL_NAMES, b as callSdk, et as buildLauncherAttachUrl, f as generateAttachToken, g as startTunnelHealthProbe, h as startQuickTunnel, j as isToolAvailableIn, k as isAitToolName, l as prepareAttach, m as printAttachBanner, nt as startParentWatcher, p as makeTunnelStatus, q as mcpError, s as isSandboxPageFresh, t as RELAY_SANDBOX_STALE_PAGE_MS, tt as startMaxAgeWatchdog, u as renderAndMaybeWait, v as DEBUG_TOOL_DEFINITIONS, w as getDomDocument, x as evaluate, y as InMemoryDiagnosticsCollector, z as acquireLock } from "./attach-orchestrator-BZsqoFjB.js";
2
+ import { $ as buildDeepLinkAttachUrl, A as isDebugToolName, B as readServerLock, C as getDiagnostics, D as getSdkCallHistory, E as getOperationalEnvironment, F as listPages, G as logWarn, H as isRelayEnv, I as measureSafeArea, J as pageCrashError, K as classifyToolError, L as takeScreenshot, M as listConsoleMessages, N as listExceptions, O as getToolAvailability, P as listNetworkRequests, Q as tierRejectionError, R as takeSnapshot, S as filterToolsByEnvironment, T as getMockState, U as logError, V as deriveEnvironment, W as logInfo, X as relayDisconnectError, Y as pageMissingError, Z as sdkAbsentError, _ as BOOTSTRAP_TOOL_NAMES, b as callSdk, et as buildLauncherAttachUrl, f as generateAttachToken, g as startTunnelHealthProbe, h as startQuickTunnel, j as isToolAvailableIn, k as isAitToolName, l as prepareAttach, m as printAttachBanner, nt as startParentWatcher, p as makeTunnelStatus, q as mcpError, s as isSandboxPageFresh, t as RELAY_SANDBOX_STALE_PAGE_MS, tt as startMaxAgeWatchdog, u as renderAndMaybeWait, v as DEBUG_TOOL_DEFINITIONS, w as getDomDocument, x as evaluate, y as InMemoryDiagnosticsCollector, z as acquireLock } from "./attach-orchestrator-BJr41GN8.js";
3
3
  import { i as generateTotp, n as assertRelayAuthConfigured, r as buildRelayVerifyAuth } from "./totp-0bvlo9Yb.js";
4
- import { n as injectGlobals, t as injectDebugIndicator } from "./cell-Dp_pDs_j.js";
4
+ import { n as injectGlobals, t as injectDebugIndicator } from "./cell-BCNQJ_cS.js";
5
5
  import { n as loadRelaySecretReadOnly } from "./relay-secret-store-CmDDfZMh.js";
6
6
  import { createRequire } from "node:module";
7
7
  import { accessSync, existsSync } from "node:fs";
@@ -175,8 +175,8 @@ function createRelayConnectionFactory(opts) {
175
175
  let family;
176
176
  return {
177
177
  async open() {
178
- const { prepareAttach, renderAndMaybeWait } = await import("./attach-orchestrator-BEMGBeWm.js");
179
- const { injectDebugIndicator, injectGlobals } = await import("./cell-BDFMsPXV.js");
178
+ const { prepareAttach, renderAndMaybeWait } = await import("./attach-orchestrator-BbCfcfT0.js");
179
+ const { injectDebugIndicator, injectGlobals } = await import("./cell-CJcDstzr.js");
180
180
  const { loadRelaySecretReadOnly } = await import("./relay-secret-store-BlFEhqwb.js");
181
181
  const { bootRelayFamily, buildRelayVerifyAuth } = await Promise.resolve().then(() => debug_server_exports);
182
182
  await loadRelaySecretReadOnly({ projectRoot });
@@ -467,34 +467,52 @@ function userFactoryPlugin(absPath) {
467
467
  };
468
468
  }
469
469
  /**
470
- * Returns the absolute path to the test-runner runtime module.
471
- *
472
- * Searches candidates in priority order:
473
- * 1. Co-located `runtime.ts` / `runtime.js` covers the source tree
474
- * (tsx / ts-node) and the `dist/test-runner/` entry.
475
- * 2. `../test-runner/runtime.js` covers the `dist/mcp/cli.js` entry,
476
- * where `import.meta.url` resolves to `dist/mcp/` (a sibling directory
477
- * of `dist/test-runner/`). Without this second candidate the MCP entry
478
- * point would look for `dist/mcp/runtime.js`, which does not exist, and
479
- * every `run_tests` call would fail with an esbuild "Could not resolve"
480
- * error (#678).
481
- *
482
- * Returns the first candidate that exists on disk. Falls back to the
483
- * co-located `runtime.js` path so esbuild produces a clear "file not found"
484
- * error rather than a cryptic failure.
470
+ * Returns the absolute filesystem path to the test-runner runtime module
471
+ * (dist/test-runner/runtime.js — a fully self-contained page-side bundle).
472
+ *
473
+ * Rolldown code-splitting duplicates this bundling logic into shared chunks
474
+ * emitted at ARBITRARY dist depths: the `devtools-test` CLI pulls it from
475
+ * dist/test-runner/bundle.js (dir = dist/test-runner/), while the `devtools-mcp`
476
+ * daemon (dist/mcp/cli.js) pulls it through a ROOT chunk
477
+ * (dist/debug-server-<hash>.js, dir = dist/). A fixed `..`-hop candidate list
478
+ * is therefore wrong from at least one chunk — the live #697 regression.
479
+ *
480
+ * This resolves WITHOUT assuming chunk depth: from `import.meta.url`'s dir it
481
+ * probes the co-located `runtime.js` and the nested `test-runner/runtime.js`,
482
+ * then ascends one directory at a time (bounded) repeating both probes. The
483
+ * nested probe catches dist/test-runner/runtime.js from the dist/ root level no
484
+ * matter which depth the chunk was hoisted to (root, dist/mcp/, or a future
485
+ * relocation). The build always emits dist/test-runner/runtime.js (tsdown entry
486
+ * `'test-runner/runtime'`; guarded by scripts/check-test-runner-dist.sh).
487
+ *
488
+ * An ABSOLUTE path is returned deliberately: esbuild loads it as a literal file
489
+ * read, bypassing Node module resolution entirely, so this works identically in
490
+ * the npx-daemon context (its own dist tree) and the consumer-CLI context
491
+ * (the mini-app's installed @ait-co/devtools dist) — neither needs the package
492
+ * to be node-resolvable from the caller.
485
493
  */
486
494
  function getRuntimePath() {
487
- const dir = path$1.dirname(fileURLToPath(import.meta.url));
488
- const candidates = [
489
- path$1.join(dir, "runtime.ts"),
490
- path$1.join(dir, "runtime.js"),
491
- path$1.join(dir, "..", "test-runner", "runtime.js")
495
+ const startDir = path$1.dirname(fileURLToPath(import.meta.url));
496
+ const RELATIVE_PROBES = [
497
+ ["runtime.js"],
498
+ ["test-runner", "runtime.js"],
499
+ ["runtime.ts"],
500
+ ["test-runner", "runtime.ts"]
492
501
  ];
493
- for (const candidate of candidates) try {
494
- accessSync(candidate);
495
- return candidate;
496
- } catch {}
497
- return path$1.join(dir, "runtime.js");
502
+ let dir = startDir;
503
+ for (let i = 0; i < 12; i++) {
504
+ for (const segs of RELATIVE_PROBES) {
505
+ const candidate = path$1.join(dir, ...segs);
506
+ try {
507
+ accessSync(candidate);
508
+ return candidate;
509
+ } catch {}
510
+ }
511
+ const parent = path$1.dirname(dir);
512
+ if (parent === dir) break;
513
+ dir = parent;
514
+ }
515
+ return path$1.join(startDir, "runtime.js");
498
516
  }
499
517
  /**
500
518
  * Bundles `absPath` into a single IIFE string suitable for `Runtime.evaluate`.
@@ -4220,7 +4238,7 @@ function createDebugServer(deps) {
4220
4238
  };
4221
4239
  const server = new Server({
4222
4240
  name: "ait-debug",
4223
- version: "0.1.118"
4241
+ version: "0.1.120"
4224
4242
  }, { capabilities: { tools: { listChanged: true } } });
4225
4243
  server.setRequestHandler(ListToolsRequestSchema, () => {
4226
4244
  const conn = router.active;
@@ -5716,4 +5734,4 @@ async function runMobileDebugServer(options = {}) {
5716
5734
  //#endregion
5717
5735
  export { wrapEnvelope as a, runMobileDebugServer as i, runDebugServer as n, runLocalDebugServer as r, debug_server_exports as t };
5718
5736
 
5719
- //# sourceMappingURL=debug-server-wo18jR4T.js.map
5737
+ //# sourceMappingURL=debug-server-DNqP-T9V.js.map