@ait-co/devtools 0.1.127 → 0.1.128

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.
@@ -1022,7 +1022,7 @@ function createDevServer(deps = {}) {
1022
1022
  const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
1023
1023
  const server = new Server({
1024
1024
  name: "ait-devtools",
1025
- version: "0.1.127"
1025
+ version: "0.1.128"
1026
1026
  }, { capabilities: { tools: {} } });
1027
1027
  server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
1028
1028
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
@@ -30136,7 +30136,7 @@ function Panel() {
30136
30136
  color: "#666",
30137
30137
  fontWeight: 400
30138
30138
  },
30139
- children: ["v", "0.1.127"]
30139
+ children: ["v", "0.1.128"]
30140
30140
  }),
30141
30141
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
30142
30142
  type: "button",
@@ -1 +1 @@
1
- {"version":3,"file":"relay-worker-TReZtzGl.d.ts","names":[],"sources":["../src/test-runner/relay-worker.ts"],"mappings":";;;;;;;UAwBiB,UAAA;EAcf;EAZA,IAAA;EAcA;EAZA,MAAA,EAAQ,SAAA;IAAc,KAAA;EAAA;AAAA;;UAIP,cAAA;EAwBS;EAtBxB,SAAA;EA0Be;EAxBf,QAAA;;EAEA,KAAA,EAAO,UAAA;EA0BP;EAxBA,MAAA;IACE,MAAA;IACA,MAAA;IACA,OAAA;IACA,KAAA;EAAA;EA+CgC;;;;AAuBpC;;;;;;EA1DE,QAAA,EAAU,cAAA;AAAA;;UAIK,eAAA;EAuDf;;;EAnDA,aAAA,GAAgB,aAAA;EAsDf;;;;EAjDD,SAAA;EAoP4B;;;;;;;;;;;EAxO5B,eAAA;AAAA;;;;;;;;cAUW,uBAAA;;;;;;;;;;;;;;;;;;;;;;iBAuBS,qBAAA,CACpB,UAAA,EAAY,aAAA,EACZ,KAAA,YACA,IAAA,GAAO,eAAA,GACN,OAAA,CAAQ,cAAA;;;;;iBAmMK,cAAA,CAAe,MAAA,EAAQ,cAAA,GAAiB,KAAA,CAAM,UAAA;EAAe,IAAA;AAAA"}
1
+ {"version":3,"file":"relay-worker-TReZtzGl.d.ts","names":[],"sources":["../src/test-runner/relay-worker.ts"],"mappings":";;;;;;;UAwBiB,UAAA;EAcf;EAZA,IAAA;EAcA;EAZA,MAAA,EAAQ,SAAA;IAAc,KAAA;EAAA;AAAA;;UAIP,cAAA;EAwBS;EAtBxB,SAAA;EA0Be;EAxBf,QAAA;;EAEA,KAAA,EAAO,UAAA;EA0BP;EAxBA,MAAA;IACE,MAAA;IACA,MAAA;IACA,OAAA;IACA,KAAA;EAAA;EA+CgC;;;;AAuBpC;;;;;;EA1DE,QAAA,EAAU,cAAA;AAAA;;UAIK,eAAA;EAuDf;;;EAnDA,aAAA,GAAgB,aAAA;EAsDf;;;;EAjDD,SAAA;EAwP4B;;;;;;;;;;;EA5O5B,eAAA;AAAA;;;;;;;;cAUW,uBAAA;;;;;;;;;;;;;;;;;;;;;;iBAuBS,qBAAA,CACpB,UAAA,EAAY,aAAA,EACZ,KAAA,YACA,IAAA,GAAO,eAAA,GACN,OAAA,CAAQ,cAAA;;;;;iBAuMK,cAAA,CAAe,MAAA,EAAQ,cAAA,GAAiB,KAAA,CAAM,UAAA;EAAe,IAAA;AAAA"}
@@ -549,7 +549,7 @@ function parseCaptureLines(raw) {
549
549
  //#endregion
550
550
  //#region src/test-runner/rpc.ts
551
551
  /** Maximum milliseconds to wait for a single evaluate round-trip. */
552
- const DEFAULT_TIMEOUT_MS = 3e4;
552
+ const DEFAULT_TIMEOUT_MS = 6e4;
553
553
  /**
554
554
  * Wraps bundle code in a self-executing IIFE that:
555
555
  * 1. Evaluates the bundle (registering describe/it/test).
@@ -608,13 +608,22 @@ function parseRunTestsResult(rawValue) {
608
608
  */
609
609
  async function injectAndRunBundle(connection, bundleCode, timeoutMs = DEFAULT_TIMEOUT_MS) {
610
610
  const expression = buildRunTestsExpression(bundleCode);
611
- const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error(`rpc: evaluate timed out after ${timeoutMs}ms`)), timeoutMs));
611
+ const TIMEOUT_SENTINEL = Symbol("timeout");
612
+ const timeoutPromise = new Promise((resolve) => setTimeout(() => resolve(TIMEOUT_SENTINEL), timeoutMs));
612
613
  const evalPromise = connection.send("Runtime.evaluate", {
613
614
  expression,
614
615
  returnByValue: true,
615
616
  awaitPromise: true
616
617
  });
617
- const cdpResult = await Promise.race([evalPromise, timeoutPromise]);
618
+ const raceResult = await Promise.race([evalPromise.then((v) => ({
619
+ tag: "eval",
620
+ v
621
+ })), timeoutPromise.then(() => ({ tag: "timeout" }))]);
622
+ if (raceResult.tag === "timeout") return {
623
+ ok: false,
624
+ error: `rpc: evaluate timed out after ${timeoutMs}ms`
625
+ };
626
+ const cdpResult = raceResult.v;
618
627
  if (cdpResult.exceptionDetails) {
619
628
  const msg = cdpResult.exceptionDetails.exception?.description ?? cdpResult.exceptionDetails.text ?? "Runtime.evaluate threw an exception";
620
629
  throw new Error(`rpc.injectAndRunBundle: ${msg}`);
@@ -679,12 +688,16 @@ async function runTestFilesOverRelay(connection, files, opts) {
679
688
  * result is a genuine timeout and the caller should retry.
680
689
  *
681
690
  * We need to distinguish:
682
- * - `rpcResult.ok = false` + timeout error → retry candidate
691
+ * - `rpcResult.ok = false` + timeout error → retry candidate (`return null`)
683
692
  * - `rpcResult.ok = false` + other error → final error, no retry
684
- * - `injectAndRunBundle` throws → treated like a final error
685
- * (throws happen on CDP exceptionDetails, not on the Promise.race
686
- * timeout — the timeout produces `rpcResult.ok=false` with the
687
- * EVALUATE_TIMEOUT_MARKER message)
693
+ * - `injectAndRunBundle` throws → CDP exceptionDetails (page
694
+ * engine threw); treated as a final (non-retryable) error.
695
+ *
696
+ * The Promise.race timeout in rpc.ts RETURNS `{ok:false, error: '…'}` (it
697
+ * does NOT throw/reject). Only genuine CDP `exceptionDetails` cause a throw.
698
+ * This distinction is what makes the EVALUATE_TIMEOUT_MARKER gate below
699
+ * reachable — the timeout result surfaces as `rpcResult.ok=false` with the
700
+ * marker string, not as a caught exception.
688
701
  */
689
702
  const attempt = async () => {
690
703
  let rpcResult;