@ait-co/devtools 0.1.111 → 0.1.113
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.
- package/dist/bundle-KFs4t-wc.d.ts.map +1 -1
- package/dist/mcp/cli.js +58 -22
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.js +2 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/{pool-Bf6rQci4.d.ts → pool-mZlgCmNQ.d.ts} +2 -2
- package/dist/{pool-Bf6rQci4.d.ts.map → pool-mZlgCmNQ.d.ts.map} +1 -1
- package/dist/{relay-worker-xxanNQGs.d.ts → relay-worker-Dppp2yZj.d.ts} +2 -2
- package/dist/{relay-worker-xxanNQGs.d.ts.map → relay-worker-Dppp2yZj.d.ts.map} +1 -1
- package/dist/{runtime-Wi5d6Ywz.d.ts → runtime-C7uxh3Mf.d.ts} +14 -2
- package/dist/runtime-C7uxh3Mf.d.ts.map +1 -0
- package/dist/test-runner/bundle.js +52 -16
- package/dist/test-runner/bundle.js.map +1 -1
- package/dist/test-runner/cli.js +55 -19
- package/dist/test-runner/cli.js.map +1 -1
- package/dist/test-runner/config.d.ts +2 -2
- package/dist/test-runner/config.js +1 -1
- package/dist/test-runner/config.js.map +1 -1
- package/dist/test-runner/pool.d.ts +1 -1
- package/dist/test-runner/relay-worker.d.ts +1 -1
- package/dist/test-runner/rpc.d.ts +1 -1
- package/dist/test-runner/runtime.d.ts +2 -0
- package/dist/test-runner/runtime.js +162 -0
- package/dist/test-runner/runtime.js.map +1 -0
- package/dist/test-runner/task-graph.d.ts +1 -1
- package/package.json +2 -1
- package/dist/runtime-Wi5d6Ywz.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-KFs4t-wc.d.ts","names":[],"sources":["../src/test-runner/bundle.ts"],"mappings":";;AAqEA;;;;;AAmBA;;;;;
|
|
1
|
+
{"version":3,"file":"bundle-KFs4t-wc.d.ts","names":[],"sources":["../src/test-runner/bundle.ts"],"mappings":";;AAqEA;;;;;AAmBA;;;;;AAuPA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA1QiB,aAAA;;;;;;;EAOf,cAAA;;;;;EAKA,UAAA;AAAA;;;;;UAOe,YAAA;EACf,IAAA;EACA,QAAA;AAAA;;;;;;;;;;;;;;;iBAqPoB,cAAA,CAAe,OAAA,UAAiB,IAAA,GAAO,aAAA,GAAgB,OAAA,CAAQ,YAAA"}
|
package/dist/mcp/cli.js
CHANGED
|
@@ -233,7 +233,7 @@ function startMaxAgeWatchdog(onExpired, opts = {}) {
|
|
|
233
233
|
* resolved against `cwd`. `bundleTestFile` requires an absolute path, so the
|
|
234
234
|
* absolute output feeds it directly.
|
|
235
235
|
*
|
|
236
|
-
* @param patterns Glob patterns or file paths (e.g. `['src/**\/*.
|
|
236
|
+
* @param patterns Glob patterns or file paths (e.g. `['src/**\/*.ait.test.ts']`).
|
|
237
237
|
* @param cwd Base directory for relative patterns/results.
|
|
238
238
|
* @returns Sorted, de-duplicated absolute file paths. Empty when nothing matches.
|
|
239
239
|
*/
|
|
@@ -351,8 +351,19 @@ module.exports = __proxy;
|
|
|
351
351
|
* installed describe/it/test/expect as globals.
|
|
352
352
|
*
|
|
353
353
|
* Algorithm:
|
|
354
|
-
* -
|
|
355
|
-
*
|
|
354
|
+
* - Import declarations and re-export statements are kept at module top-level
|
|
355
|
+
* (the only valid ESM position for static `import`). A statement that spans
|
|
356
|
+
* multiple lines — e.g. a named import with one member per line:
|
|
357
|
+
* import {
|
|
358
|
+
* appLogin,
|
|
359
|
+
* getAnonymousKey,
|
|
360
|
+
* } from '@apps-in-toss/web-framework';
|
|
361
|
+
* is tracked as a single block: every line from the opening `import {` /
|
|
362
|
+
* `export {` through the closing `from '…'` (or side-effect `'…'`) line is
|
|
363
|
+
* kept together at top-level. This prevents the member lines and the
|
|
364
|
+
* closing `} from '…'` line from leaking into the factory body, which would
|
|
365
|
+
* leave an unterminated `import {` at module scope (the #678 env3 failure:
|
|
366
|
+
* esbuild threw `Expected "as" but found "{"` on multi-line SDK imports).
|
|
356
367
|
* - All other lines (describe/it/test calls, local declarations, etc.) are
|
|
357
368
|
* moved into the body of the exported async factory function.
|
|
358
369
|
*
|
|
@@ -376,12 +387,25 @@ function userFactoryPlugin(absPath) {
|
|
|
376
387
|
const topLevelLines = [];
|
|
377
388
|
const bodyLines = [];
|
|
378
389
|
const EXPORT_DECLARATION_RE = /^(export\s+)(default\s+|async\s+function\s+|function\s+|class\s+|const\s+|let\s+|var\s+)/;
|
|
390
|
+
const isImportStart = (trimmed) => trimmed.startsWith("import ") || trimmed.startsWith("import{") || trimmed.startsWith("import'") || trimmed.startsWith("import\"");
|
|
391
|
+
const endsStatement = (trimmed) => /['"]\s*;?\s*$/.test(trimmed.replace(/\/\/.*$/, "").trimEnd());
|
|
392
|
+
let inImportBlock = false;
|
|
379
393
|
for (const line of lines) {
|
|
380
394
|
const trimmed = line.trimStart();
|
|
381
395
|
const indent = line.slice(0, line.length - trimmed.length);
|
|
382
|
-
if (
|
|
383
|
-
|
|
384
|
-
|
|
396
|
+
if (inImportBlock) {
|
|
397
|
+
topLevelLines.push(line);
|
|
398
|
+
if (endsStatement(trimmed)) inImportBlock = false;
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
if (isImportStart(trimmed)) {
|
|
402
|
+
topLevelLines.push(line);
|
|
403
|
+
if (!endsStatement(trimmed)) inImportBlock = true;
|
|
404
|
+
} else if (trimmed.startsWith("export ")) if (trimmed.match(EXPORT_DECLARATION_RE)) bodyLines.push(indent + trimmed.slice(7));
|
|
405
|
+
else {
|
|
406
|
+
topLevelLines.push(line);
|
|
407
|
+
if (/\bfrom\b/.test(trimmed) ? !endsStatement(trimmed) : trimmed.endsWith("{")) inImportBlock = true;
|
|
408
|
+
}
|
|
385
409
|
else bodyLines.push(line);
|
|
386
410
|
}
|
|
387
411
|
return {
|
|
@@ -401,21 +425,33 @@ function userFactoryPlugin(absPath) {
|
|
|
401
425
|
};
|
|
402
426
|
}
|
|
403
427
|
/**
|
|
404
|
-
* Returns the absolute path to the
|
|
428
|
+
* Returns the absolute path to the test-runner runtime module.
|
|
405
429
|
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
430
|
+
* Searches candidates in priority order:
|
|
431
|
+
* 1. Co-located `runtime.ts` / `runtime.js` — covers the source tree
|
|
432
|
+
* (tsx / ts-node) and the `dist/test-runner/` entry.
|
|
433
|
+
* 2. `../test-runner/runtime.js` — covers the `dist/mcp/cli.js` entry,
|
|
434
|
+
* where `import.meta.url` resolves to `dist/mcp/` (a sibling directory
|
|
435
|
+
* of `dist/test-runner/`). Without this second candidate the MCP entry
|
|
436
|
+
* point would look for `dist/mcp/runtime.js`, which does not exist, and
|
|
437
|
+
* every `run_tests` call would fail with an esbuild "Could not resolve"
|
|
438
|
+
* error (#678).
|
|
439
|
+
*
|
|
440
|
+
* Returns the first candidate that exists on disk. Falls back to the
|
|
441
|
+
* co-located `runtime.js` path so esbuild produces a clear "file not found"
|
|
442
|
+
* error rather than a cryptic failure.
|
|
409
443
|
*/
|
|
410
444
|
function getRuntimePath() {
|
|
411
445
|
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
446
|
+
const candidates = [
|
|
447
|
+
path.join(dir, "runtime.ts"),
|
|
448
|
+
path.join(dir, "runtime.js"),
|
|
449
|
+
path.join(dir, "..", "test-runner", "runtime.js")
|
|
450
|
+
];
|
|
451
|
+
for (const candidate of candidates) try {
|
|
452
|
+
accessSync(candidate);
|
|
453
|
+
return candidate;
|
|
454
|
+
} catch {}
|
|
419
455
|
return path.join(dir, "runtime.js");
|
|
420
456
|
}
|
|
421
457
|
/**
|
|
@@ -652,7 +688,7 @@ DESCRIPTION
|
|
|
652
688
|
yet (it currently resolves the matched files and defers to that tool).
|
|
653
689
|
|
|
654
690
|
EXAMPLE
|
|
655
|
-
devtools-test 'src/**/*.
|
|
691
|
+
devtools-test 'src/**/*.ait.test.ts' --timeout 60000
|
|
656
692
|
|
|
657
693
|
`.trimStart();
|
|
658
694
|
/**
|
|
@@ -4581,7 +4617,7 @@ const DEBUG_TOOL_DEFINITIONS = [
|
|
|
4581
4617
|
files: {
|
|
4582
4618
|
type: "array",
|
|
4583
4619
|
items: { type: "string" },
|
|
4584
|
-
description: "Glob patterns or file paths to run (e.g. [\"src/**/*.
|
|
4620
|
+
description: "Glob patterns or file paths to run (e.g. [\"src/**/*.ait.test.ts\"]). Resolved relative to projectRoot when given, else the daemon cwd. Required, non-empty."
|
|
4585
4621
|
},
|
|
4586
4622
|
projectRoot: {
|
|
4587
4623
|
type: "string",
|
|
@@ -5375,7 +5411,7 @@ async function readMcpSdkVersion() {
|
|
|
5375
5411
|
* some test environments that skip the build step).
|
|
5376
5412
|
*/
|
|
5377
5413
|
function readDevtoolsVersion() {
|
|
5378
|
-
return "0.1.
|
|
5414
|
+
return "0.1.113";
|
|
5379
5415
|
}
|
|
5380
5416
|
/**
|
|
5381
5417
|
* Derives the next recommended action from a completed diagnostics snapshot.
|
|
@@ -6295,7 +6331,7 @@ function createDebugServer(deps) {
|
|
|
6295
6331
|
}
|
|
6296
6332
|
const server = new Server({
|
|
6297
6333
|
name: "ait-debug",
|
|
6298
|
-
version: "0.1.
|
|
6334
|
+
version: "0.1.113"
|
|
6299
6335
|
}, { capabilities: { tools: { listChanged: true } } });
|
|
6300
6336
|
server.setRequestHandler(ListToolsRequestSchema, () => {
|
|
6301
6337
|
const conn = router.active;
|
|
@@ -8195,7 +8231,7 @@ function createDevServer(deps = {}) {
|
|
|
8195
8231
|
const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
|
|
8196
8232
|
const server = new Server({
|
|
8197
8233
|
name: "ait-devtools",
|
|
8198
|
-
version: "0.1.
|
|
8234
|
+
version: "0.1.113"
|
|
8199
8235
|
}, { capabilities: { tools: {} } });
|
|
8200
8236
|
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
|
|
8201
8237
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|