@ait-co/devtools 0.1.131 → 0.1.132

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 (62) hide show
  1. package/dist/{debug-server-CD4zYBq4.js → debug-server-BBUzxZSf.js} +2 -2
  2. package/dist/{debug-server-CD4zYBq4.js.map → debug-server-BBUzxZSf.js.map} +1 -1
  3. package/dist/{debug-server-qRSRG7YZ.js → debug-server-Ch5p0ryv.js} +20 -2
  4. package/dist/debug-server-Ch5p0ryv.js.map +1 -0
  5. package/dist/{debug-server-BSbfnFR5.js → debug-server-DoWAtTNj.js} +22 -4
  6. package/dist/debug-server-DoWAtTNj.js.map +1 -0
  7. package/dist/mcp/cli.js +72 -7
  8. package/dist/mcp/cli.js.map +1 -1
  9. package/dist/mcp/server.js +1 -1
  10. package/dist/panel/index.js +1 -1
  11. package/dist/{pool-BaSCZALv.d.ts → pool-BtLh7U1y.d.ts} +16 -2
  12. package/dist/{pool-BaSCZALv.d.ts.map → pool-BtLh7U1y.d.ts.map} +1 -1
  13. package/dist/{qr-http-server-BxoRp2w7.cjs → qr-http-server-DX_9UA-p.cjs} +3 -2
  14. package/dist/qr-http-server-DX_9UA-p.cjs.map +1 -0
  15. package/dist/{qr-http-server-BdNGPRoL.js → qr-http-server-DeRrKp_R.js} +3 -2
  16. package/dist/{qr-http-server-cKbciY5k.js.map → qr-http-server-DeRrKp_R.js.map} +1 -1
  17. package/dist/{qr-http-server-DCbjORFa.js → qr-http-server-FVn61xAq.js} +3 -3
  18. package/dist/{qr-http-server-BdNGPRoL.js.map → qr-http-server-FVn61xAq.js.map} +1 -1
  19. package/dist/{qr-http-server-cKbciY5k.js → qr-http-server-KB147M-S.js} +4 -2
  20. package/dist/{qr-http-server-DCbjORFa.js.map → qr-http-server-KB147M-S.js.map} +1 -1
  21. package/dist/{qr-http-server-Bq9zR7-z.js → qr-http-server-V0xuU5TJ.js} +3 -2
  22. package/dist/{qr-http-server-Bq9zR7-z.js.map → qr-http-server-V0xuU5TJ.js.map} +1 -1
  23. package/dist/{qr-http-server-CV6TA9ZN.cjs → qr-http-server-iH_Hh_si.cjs} +3 -2
  24. package/dist/qr-http-server-iH_Hh_si.cjs.map +1 -0
  25. package/dist/{relay-factory-Cloog1jb.js → relay-factory-cNgPfrWg.js} +10 -4
  26. package/dist/relay-factory-cNgPfrWg.js.map +1 -0
  27. package/dist/{relay-worker-o0M2ndyJ.d.ts → relay-worker-BMSnlyls.d.ts} +39 -2
  28. package/dist/relay-worker-BMSnlyls.d.ts.map +1 -0
  29. package/dist/{relay-worker-CCAHLC4a.js → relay-worker-l34xNuci.js} +20 -3
  30. package/dist/{relay-worker-CCAHLC4a.js.map → relay-worker-l34xNuci.js.map} +1 -1
  31. package/dist/test-runner/bin.js +160 -20
  32. package/dist/test-runner/bin.js.map +1 -1
  33. package/dist/test-runner/config.d.ts +1 -1
  34. package/dist/test-runner/config.js +1 -1
  35. package/dist/test-runner/pool.d.ts +1 -1
  36. package/dist/test-runner/pool.js +1 -1
  37. package/dist/test-runner/pool.js.map +1 -1
  38. package/dist/test-runner/relay-factory.d.ts +14 -0
  39. package/dist/test-runner/relay-factory.d.ts.map +1 -1
  40. package/dist/test-runner/relay-factory.js +9 -3
  41. package/dist/test-runner/relay-factory.js.map +1 -1
  42. package/dist/test-runner/relay-worker.d.ts +2 -2
  43. package/dist/test-runner/relay-worker.js +2 -2
  44. package/dist/test-runner/report.d.ts +26 -4
  45. package/dist/test-runner/report.d.ts.map +1 -1
  46. package/dist/test-runner/report.js +41 -7
  47. package/dist/test-runner/report.js.map +1 -1
  48. package/dist/{tunnel-B2UCKAc7.cjs → tunnel-DP453L4e.cjs} +2 -2
  49. package/dist/{tunnel-B2UCKAc7.cjs.map → tunnel-DP453L4e.cjs.map} +1 -1
  50. package/dist/{tunnel-C-rQ34dM.js → tunnel-Djf-zmjJ.js} +2 -2
  51. package/dist/{tunnel-C-rQ34dM.js.map → tunnel-Djf-zmjJ.js.map} +1 -1
  52. package/dist/unplugin/index.cjs +1 -1
  53. package/dist/unplugin/index.js +1 -1
  54. package/dist/unplugin/tunnel.cjs +1 -1
  55. package/dist/unplugin/tunnel.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/debug-server-BSbfnFR5.js.map +0 -1
  58. package/dist/debug-server-qRSRG7YZ.js.map +0 -1
  59. package/dist/qr-http-server-BxoRp2w7.cjs.map +0 -1
  60. package/dist/qr-http-server-CV6TA9ZN.cjs.map +0 -1
  61. package/dist/relay-factory-Cloog1jb.js.map +0 -1
  62. package/dist/relay-worker-o0M2ndyJ.d.ts.map +0 -1
package/dist/mcp/cli.js CHANGED
@@ -2024,7 +2024,7 @@ async function readMcpSdkVersion() {
2024
2024
  * some test environments that skip the build step).
2025
2025
  */
2026
2026
  function readDevtoolsVersion() {
2027
- return "0.1.131";
2027
+ return "0.1.132";
2028
2028
  }
2029
2029
  /**
2030
2030
  * Derives the next recommended action from a completed diagnostics snapshot.
@@ -3007,6 +3007,23 @@ async function injectDebugIndicator(conn, opts) {
3007
3007
  * safe to import from the MCP daemon graph.
3008
3008
  */
3009
3009
  /**
3010
+ * Filename suffix that opts a test file into manual-variant scheduling
3011
+ * (devtools#741). A file named `<name>.manual.ait.test.ts` is EXCLUDED from
3012
+ * `discoverTestFiles`'s default output (so existing unattended runs are
3013
+ * unaffected — the zero-diff-when-off constraint) and is only surfaced when
3014
+ * the caller explicitly asks for manual files via {@link partitionManualTests}
3015
+ * (wired from the CLI's `--manual-blocking` flag).
3016
+ *
3017
+ * This is the entire tagging contract for v1 — no separate manifest/config,
3018
+ * just a filename convention. Documented here + in the CLI `--help` text
3019
+ * (cli.ts USAGE) and the test-runner README.
3020
+ */
3021
+ const MANUAL_TEST_SUFFIX = ".manual.ait.test.ts";
3022
+ /** True when `file`'s basename ends with {@link MANUAL_TEST_SUFFIX}. */
3023
+ function isManualTestFile(file) {
3024
+ return basename(file).endsWith(MANUAL_TEST_SUFFIX);
3025
+ }
3026
+ /**
3010
3027
  * Expands `patterns` (globs or plain paths) into a sorted, de-duplicated list of
3011
3028
  * ABSOLUTE test file paths, resolved relative to `cwd`.
3012
3029
  *
@@ -3015,14 +3032,26 @@ async function injectDebugIndicator(conn, opts) {
3015
3032
  * resolved against `cwd`. `bundleTestFile` requires an absolute path, so the
3016
3033
  * absolute output feeds it directly.
3017
3034
  *
3035
+ * By default, files matching {@link MANUAL_TEST_SUFFIX} are EXCLUDED from the
3036
+ * result (devtools#741) — blocking-UI tests opt in via that filename
3037
+ * convention and must never appear in an unattended run unless the caller
3038
+ * explicitly asks for them via `includeManual: true`. This keeps the
3039
+ * default (flag-off) discovery path byte-for-byte identical to before this
3040
+ * option existed.
3041
+ *
3018
3042
  * @param patterns Glob patterns or file paths (e.g. `['src/**\/*.ait.test.ts']`).
3019
3043
  * @param cwd Base directory for relative patterns/results.
3044
+ * @param opts `{ includeManual }` — when true, manual-tagged files are kept
3045
+ * in the (still-sorted) output instead of being filtered out.
3046
+ * Use {@link partitionManualTests} to separate + reorder them.
3020
3047
  * @returns Sorted, de-duplicated absolute file paths. Empty when nothing matches.
3021
3048
  */
3022
- async function discoverTestFiles(patterns, cwd) {
3049
+ async function discoverTestFiles(patterns, cwd, opts) {
3023
3050
  const out = /* @__PURE__ */ new Set();
3024
3051
  for await (const match of glob(patterns, { cwd })) out.add(isAbsolute(match) ? match : resolve(cwd, match));
3025
- return [...out].sort();
3052
+ const sorted = [...out].sort();
3053
+ if (opts?.includeManual) return sorted;
3054
+ return sorted.filter((f) => !isManualTestFile(f));
3026
3055
  }
3027
3056
  //#endregion
3028
3057
  //#region src/shared/relay-auth-close.ts
@@ -4069,6 +4098,13 @@ async function injectAndRunBundle(connection, bundleCode, timeoutMs = DEFAULT_TI
4069
4098
  //#endregion
4070
4099
  //#region src/test-runner/relay-worker.ts
4071
4100
  /**
4101
+ * Per-file evaluate timeout (ms) for manual-variant files (devtools#741) — a
4102
+ * human is expected to be tapping through a native sheet, so the timeout must
4103
+ * be far longer than the unattended default (60s, rpc.ts DEFAULT_TIMEOUT_MS).
4104
+ * Fixed constant (not configurable in v1) — documented here + CLI `--help`.
4105
+ */
4106
+ const MANUAL_FILE_TIMEOUT_MS = 5 * 6e4;
4107
+ /**
4072
4108
  * Sentinel string embedded in the error message by `injectAndRunBundle` when
4073
4109
  * the per-file evaluate race hits the timeout. Used by the retry guard so only
4074
4110
  * genuine timeouts get a second attempt — not bundle errors or parse failures.
@@ -4139,12 +4175,21 @@ async function runTestFilesOverRelay(connection, files, opts) {
4139
4175
  process.stderr.write(`relay-worker: reconnect failed (${e instanceof Error ? e.message : String(e)}) — continuing, remaining files may fail\n`);
4140
4176
  }
4141
4177
  };
4178
+ const manualFiles = opts?.manualFiles;
4179
+ const manualTotal = manualFiles?.size ?? 0;
4180
+ let manualIndex = 0;
4142
4181
  try {
4143
4182
  for (const file of files) {
4144
4183
  if (pendingReconnectCheck) {
4145
4184
  await attemptReconnect("next-file");
4146
4185
  pendingReconnectCheck = false;
4147
4186
  }
4187
+ const isManual = manualFiles?.has(file) === true;
4188
+ if (isManual) {
4189
+ manualIndex += 1;
4190
+ opts?.onManualFile?.(file, manualIndex, manualTotal);
4191
+ }
4192
+ const fileTimeoutMs = isManual ? MANUAL_FILE_TIMEOUT_MS : opts?.timeoutMs;
4148
4193
  let fileEntry;
4149
4194
  try {
4150
4195
  const { code } = await bundleTestFile(file, opts?.bundleOptions);
@@ -4170,7 +4215,7 @@ async function runTestFilesOverRelay(connection, files, opts) {
4170
4215
  const attempt = async () => {
4171
4216
  let rpcResult;
4172
4217
  try {
4173
- rpcResult = await injectAndRunBundle(connection, code, opts?.timeoutMs);
4218
+ rpcResult = await injectAndRunBundle(connection, code, fileTimeoutMs);
4174
4219
  } catch (e) {
4175
4220
  return {
4176
4221
  file,
@@ -4206,6 +4251,7 @@ async function runTestFilesOverRelay(connection, files, opts) {
4206
4251
  };
4207
4252
  }
4208
4253
  if ("error" in fileEntry.result && isRelayDisconnectMessage(fileEntry.result.error)) pendingReconnectCheck = true;
4254
+ if (isManual) fileEntry.mode = "manual";
4209
4255
  fileResults.push(fileEntry);
4210
4256
  }
4211
4257
  } finally {
@@ -4293,6 +4339,24 @@ OPTIONS
4293
4339
  --headless Disable browser auto-open (text QR only)
4294
4340
  --project-root <dir> Project root for .ait_relay secret lookup
4295
4341
  (default: current working directory)
4342
+ --manual-blocking Run manual-tagged test files (*.manual.ait.test.ts)
4343
+ LAST, after all regular files, with a human present.
4344
+ Before each manual file, the QR dashboard is pushed
4345
+ a step-by-step Korean prompt naming the file + its
4346
+ progress (k/n), and the same line is printed to
4347
+ stdout. Manual files get a 5-minute per-file evaluate
4348
+ timeout (vs. --timeout for everything else) since a
4349
+ human is expected to tap through a native sheet
4350
+ (photo picker, permission dialog, fullscreen ad).
4351
+ Without this flag (default off), *.manual.ait.test.ts
4352
+ files are EXCLUDED from the glob expansion entirely —
4353
+ existing unattended runs are byte-for-byte unaffected.
4354
+ With --report-dir, a run that included manual files
4355
+ ALSO writes <sdkLine>.<platform>.manual.json
4356
+ alongside (never replacing) the standard report, and
4357
+ each manual file's report entry is stamped
4358
+ mode: 'manual' — never diff a manual run against an
4359
+ unattended baseline as if they were equivalent.
4296
4360
  --help, -h Show this help message
4297
4361
 
4298
4362
  DESCRIPTION
@@ -6638,7 +6702,8 @@ async function startQrHttpServer(getDashboardState, options) {
6638
6702
  pages: state.pages,
6639
6703
  attachUrl: state.attachUrl,
6640
6704
  inspectorUrl: state.inspectorUrl ?? null,
6641
- phase: state.phase ?? "active"
6705
+ phase: state.phase ?? "active",
6706
+ manualPrompt: state.manualPrompt ?? null
6642
6707
  });
6643
6708
  res.write(`data: ${payload}\n\n`);
6644
6709
  }
@@ -6947,7 +7012,7 @@ function createDebugServer(deps) {
6947
7012
  };
6948
7013
  const server = new Server({
6949
7014
  name: "ait-debug",
6950
- version: "0.1.131"
7015
+ version: "0.1.132"
6951
7016
  }, { capabilities: { tools: { listChanged: true } } });
6952
7017
  server.setRequestHandler(ListToolsRequestSchema, () => {
6953
7018
  const conn = router.active;
@@ -8931,7 +8996,7 @@ function createDevServer(deps = {}) {
8931
8996
  const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
8932
8997
  const server = new Server({
8933
8998
  name: "ait-devtools",
8934
- version: "0.1.131"
8999
+ version: "0.1.132"
8935
9000
  }, { capabilities: { tools: {} } });
8936
9001
  server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
8937
9002
  server.setRequestHandler(CallToolRequestSchema, async (request) => {