@ait-co/devtools 0.1.133 → 0.1.134
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/{cdp-connection-D7AYQck2.d.ts → cdp-connection-BYE9meXe.d.ts} +12 -2
- package/dist/{cdp-connection-D7AYQck2.d.ts.map → cdp-connection-BYE9meXe.d.ts.map} +1 -1
- package/dist/{debug-server-CS1BS2BX.js → debug-server-BcSBrajf.js} +18 -8
- package/dist/debug-server-BcSBrajf.js.map +1 -0
- package/dist/{debug-server-DmzuK2c6.js → debug-server-D9SmprUI.js} +3 -3
- package/dist/{debug-server-DmzuK2c6.js.map → debug-server-D9SmprUI.js.map} +1 -1
- package/dist/mcp/cli.js +41 -15
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/panel/index.js +1 -1
- package/dist/{pool-x28Wv1ty.d.ts → pool-C6TgrcyW.d.ts} +3 -3
- package/dist/{pool-x28Wv1ty.d.ts.map → pool-C6TgrcyW.d.ts.map} +1 -1
- package/dist/{relay-factory-BQfmK7RP.js → relay-factory-CsVO9o25.js} +2 -2
- package/dist/{relay-factory-BQfmK7RP.js.map → relay-factory-CsVO9o25.js.map} +1 -1
- package/dist/{relay-worker-DtX_eszH.d.ts → relay-worker-Dw3aIzIK.d.ts} +3 -3
- package/dist/{relay-worker-DtX_eszH.d.ts.map → relay-worker-Dw3aIzIK.d.ts.map} +1 -1
- package/dist/{relay-worker-MZq4fLv8.js → relay-worker-UK0nBfDX.js} +18 -8
- package/dist/relay-worker-UK0nBfDX.js.map +1 -0
- package/dist/{runtime-9xhN9pr8.d.ts → runtime-DfHHZms2.d.ts} +34 -5
- package/dist/runtime-DfHHZms2.d.ts.map +1 -0
- package/dist/test-runner/bin.js +32 -11
- package/dist/test-runner/bin.js.map +1 -1
- package/dist/test-runner/config.d.ts +1 -1
- package/dist/test-runner/config.js +1 -1
- package/dist/test-runner/pool.d.ts +1 -1
- package/dist/test-runner/pool.js +1 -1
- package/dist/test-runner/relay-factory.d.ts +12 -2
- package/dist/test-runner/relay-factory.d.ts.map +1 -1
- package/dist/test-runner/relay-factory.js +1 -1
- package/dist/test-runner/relay-worker.d.ts +1 -1
- package/dist/test-runner/relay-worker.js +1 -1
- package/dist/test-runner/report.d.ts +2 -2
- package/dist/test-runner/rpc.d.ts +8 -5
- package/dist/test-runner/rpc.d.ts.map +1 -1
- package/dist/test-runner/rpc.js +15 -4
- package/dist/test-runner/rpc.js.map +1 -1
- package/dist/test-runner/runtime.d.ts +2 -2
- package/dist/test-runner/runtime.js +30 -4
- package/dist/test-runner/runtime.js.map +1 -1
- package/dist/test-runner/task-graph.d.ts +1 -1
- package/package.json +1 -1
- package/dist/debug-server-CS1BS2BX.js.map +0 -1
- package/dist/relay-worker-MZq4fLv8.js.map +0 -1
- package/dist/runtime-9xhN9pr8.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.
|
|
2027
|
+
return "0.1.134";
|
|
2028
2028
|
}
|
|
2029
2029
|
/**
|
|
2030
2030
|
* Derives the next recommended action from a completed diagnostics snapshot.
|
|
@@ -3513,9 +3513,13 @@ var ChiiCdpConnection = class {
|
|
|
3513
3513
|
/**
|
|
3514
3514
|
* Issue a CDP command and resolve with its result (Phase 2). Rejects on a CDP
|
|
3515
3515
|
* error frame or when no websocket is open (no page attached yet).
|
|
3516
|
+
*
|
|
3517
|
+
* @param opts.timeoutMs - Per-call override for this connection's command
|
|
3518
|
+
* watchdog (devtools#747) — see the `CdpConnection.send` docblock for the
|
|
3519
|
+
* contract callers racing their own longer timeout must follow.
|
|
3516
3520
|
*/
|
|
3517
|
-
send(method, params) {
|
|
3518
|
-
return this.sendCommand(method, params ?? {});
|
|
3521
|
+
send(method, params, opts) {
|
|
3522
|
+
return this.sendCommand(method, params ?? {}, opts);
|
|
3519
3523
|
}
|
|
3520
3524
|
/**
|
|
3521
3525
|
* Issue an arbitrary request→response command over the relay and resolve with
|
|
@@ -3526,16 +3530,22 @@ var ChiiCdpConnection = class {
|
|
|
3526
3530
|
* auto-reconnect). Caller should re-run `list_pages` or `enableDomains` to
|
|
3527
3531
|
* reattach.
|
|
3528
3532
|
*
|
|
3529
|
-
* Times out after `
|
|
3530
|
-
* `AIT_CDP_COMMAND_TIMEOUT_MS`)
|
|
3531
|
-
*
|
|
3533
|
+
* Times out after `opts.timeoutMs` when given, else `commandTimeoutMs`
|
|
3534
|
+
* (default 30s, env `AIT_CDP_COMMAND_TIMEOUT_MS`) — see devtools#747: the
|
|
3535
|
+
* default 30s watchdog used to undercut the test-runner's own longer
|
|
3536
|
+
* file-evaluate race no matter what `--timeout` the caller asked for. On
|
|
3537
|
+
* timeout the pending entry is cleaned up and the promise rejects with a
|
|
3538
|
+
* descriptive Korean error. `Number.isFinite` guards against a non-finite
|
|
3539
|
+
* override (e.g. `Infinity`, mirroring `waitForFirstTarget`'s convention)
|
|
3540
|
+
* so an intentional "no watchdog" override doesn't get clamped by
|
|
3541
|
+
* `setTimeout`.
|
|
3532
3542
|
*/
|
|
3533
|
-
sendCommand(method, params = {}) {
|
|
3543
|
+
sendCommand(method, params = {}, opts) {
|
|
3534
3544
|
if (this.connectionState === "disconnected") return Promise.reject(/* @__PURE__ */ new Error(`relay에 연결되어 있지 않습니다 (${method}). list_pages로 attach 상태를 확인하고 enableDomains()로 재연결하세요.`));
|
|
3535
3545
|
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) return Promise.reject(/* @__PURE__ */ new Error("No mini-app page attached to the Chii relay yet. Call enableDomains() first."));
|
|
3536
3546
|
const id = this.nextCommandId++;
|
|
3537
3547
|
const ws = this.ws;
|
|
3538
|
-
const timeoutMs = this.commandTimeoutMs;
|
|
3548
|
+
const timeoutMs = opts?.timeoutMs !== void 0 && Number.isFinite(opts.timeoutMs) && opts.timeoutMs > 0 ? opts.timeoutMs : this.commandTimeoutMs;
|
|
3539
3549
|
return new Promise((resolve, reject) => {
|
|
3540
3550
|
const handle = setTimeout(() => {
|
|
3541
3551
|
this.pending.delete(id);
|
|
@@ -4120,6 +4130,14 @@ function parseCaptureLines(raw) {
|
|
|
4120
4130
|
/** Maximum milliseconds to wait for a single evaluate round-trip. */
|
|
4121
4131
|
const DEFAULT_TIMEOUT_MS = 6e4;
|
|
4122
4132
|
/**
|
|
4133
|
+
* Extra headroom (ms) added on top of the rpc-level `timeoutMs` when telling
|
|
4134
|
+
* the underlying `CdpConnection` its per-command watchdog budget (devtools#747).
|
|
4135
|
+
* The rpc-level race above is the authoritative file timeout — this margin
|
|
4136
|
+
* only ensures the connection's own (shorter-by-default) watchdog never fires
|
|
4137
|
+
* first and masks the rpc-level timeout error with a connection-level one.
|
|
4138
|
+
*/
|
|
4139
|
+
const CONNECTION_TIMEOUT_MARGIN_MS = 5e3;
|
|
4140
|
+
/**
|
|
4123
4141
|
* Wraps bundle code in a self-executing IIFE that:
|
|
4124
4142
|
* 1. Evaluates the bundle (registering describe/it/test).
|
|
4125
4143
|
* 2. Calls `__testBundle.runTestModule(...)` — the entry the runtime exports.
|
|
@@ -4166,12 +4184,15 @@ function parseRunTestsResult(rawValue) {
|
|
|
4166
4184
|
* Injects `bundleCode` into the attached page and awaits test execution.
|
|
4167
4185
|
*
|
|
4168
4186
|
* Uses `Runtime.evaluate` with `awaitPromise: true` to wait for the
|
|
4169
|
-
* async IIFE to settle.
|
|
4170
|
-
*
|
|
4187
|
+
* async IIFE to settle. `timeoutMs` (default 60s) is the authoritative file
|
|
4188
|
+
* timeout — this function races it against the evaluate call AND (devtools#747)
|
|
4189
|
+
* threads it down to the underlying `CdpConnection`'s own per-command watchdog
|
|
4190
|
+
* (plus a small margin) so that watchdog can never undercut this race. Split
|
|
4191
|
+
* into smaller files if you hit the timeout.
|
|
4171
4192
|
*
|
|
4172
4193
|
* @param connection - Active CDP connection (relay or local).
|
|
4173
4194
|
* @param bundleCode - IIFE bundle string from `bundleTestFile`.
|
|
4174
|
-
* @param timeoutMs - Override the default
|
|
4195
|
+
* @param timeoutMs - Override the default 60 s timeout.
|
|
4175
4196
|
*
|
|
4176
4197
|
* SECRET-HANDLING: `bundleCode` and the raw CDP result value are never logged.
|
|
4177
4198
|
*/
|
|
@@ -4183,7 +4204,7 @@ async function injectAndRunBundle(connection, bundleCode, timeoutMs = DEFAULT_TI
|
|
|
4183
4204
|
expression,
|
|
4184
4205
|
returnByValue: true,
|
|
4185
4206
|
awaitPromise: true
|
|
4186
|
-
});
|
|
4207
|
+
}, { timeoutMs: timeoutMs + CONNECTION_TIMEOUT_MARGIN_MS });
|
|
4187
4208
|
const raceResult = await Promise.race([evalPromise.then((v) => ({
|
|
4188
4209
|
tag: "eval",
|
|
4189
4210
|
v
|
|
@@ -5244,8 +5265,13 @@ var LocalCdpConnection = class {
|
|
|
5244
5265
|
/**
|
|
5245
5266
|
* Issue a CDP command and resolve with its typed result. Rejects on a CDP
|
|
5246
5267
|
* error frame or when no websocket is open.
|
|
5268
|
+
*
|
|
5269
|
+
* `opts.timeoutMs` is accepted for `CdpConnection` interface parity but
|
|
5270
|
+
* ignored — this connection has no per-command watchdog of its own
|
|
5271
|
+
* (devtools#747 only affects `ChiiCdpConnection`, which layers a
|
|
5272
|
+
* relay-command watchdog on top of the caller's own race).
|
|
5247
5273
|
*/
|
|
5248
|
-
send(method, params) {
|
|
5274
|
+
send(method, params, _opts) {
|
|
5249
5275
|
return this.sendCommand(method, params ?? {});
|
|
5250
5276
|
}
|
|
5251
5277
|
/**
|
|
@@ -7119,7 +7145,7 @@ function createDebugServer(deps) {
|
|
|
7119
7145
|
};
|
|
7120
7146
|
const server = new Server({
|
|
7121
7147
|
name: "ait-debug",
|
|
7122
|
-
version: "0.1.
|
|
7148
|
+
version: "0.1.134"
|
|
7123
7149
|
}, { capabilities: { tools: { listChanged: true } } });
|
|
7124
7150
|
server.setRequestHandler(ListToolsRequestSchema, () => {
|
|
7125
7151
|
const conn = router.active;
|
|
@@ -9103,7 +9129,7 @@ function createDevServer(deps = {}) {
|
|
|
9103
9129
|
const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
|
|
9104
9130
|
const server = new Server({
|
|
9105
9131
|
name: "ait-devtools",
|
|
9106
|
-
version: "0.1.
|
|
9132
|
+
version: "0.1.134"
|
|
9107
9133
|
}, { capabilities: { tools: {} } });
|
|
9108
9134
|
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
|
|
9109
9135
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|