@vforsh/argus 0.5.1 → 0.5.2
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/.tsbuildinfo +1 -1
- package/dist/argus.js +186 -39
- package/dist/cli/register/recordCommands.d.ts.map +1 -1
- package/dist/cli/register/recordCommands.js +6 -3
- package/dist/cli/register/recordCommands.js.map +1 -1
- package/dist/cli/register/snapshotCommands.js +1 -1
- package/dist/cli/register/snapshotCommands.js.map +1 -1
- package/dist/cli/register/traceCommands.d.ts.map +1 -1
- package/dist/cli/register/traceCommands.js +6 -3
- package/dist/cli/register/traceCommands.js.map +1 -1
- package/dist/commands/domKeydown.d.ts.map +1 -1
- package/dist/commands/domKeydown.js +7 -2
- package/dist/commands/domKeydown.js.map +1 -1
- package/dist/commands/page.js +2 -2
- package/dist/commands/page.js.map +1 -1
- package/dist/commands/record.d.ts.map +1 -1
- package/dist/commands/record.js +3 -2
- package/dist/commands/record.js.map +1 -1
- package/dist/commands/screenshot.d.ts.map +1 -1
- package/dist/commands/screenshot.js +2 -1
- package/dist/commands/screenshot.js.map +1 -1
- package/dist/commands/trace.d.ts.map +1 -1
- package/dist/commands/trace.js +3 -2
- package/dist/commands/trace.js.map +1 -1
- package/dist/eval/evalClient.d.ts +9 -1
- package/dist/eval/evalClient.d.ts.map +1 -1
- package/dist/eval/evalClient.js +31 -8
- package/dist/eval/evalClient.js.map +1 -1
- package/dist/skill/argus/SKILL.md +6 -0
- package/dist/skill/argus/reference/CAPTURE.md +6 -0
- package/dist/skill/argus/reference/EVAL.md +2 -0
- package/dist/skill/argus/reference/INSPECT.md +6 -0
- package/dist/utils/paths.d.ts +12 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +15 -0
- package/dist/utils/paths.js.map +1 -1
- package/package.json +1 -1
package/dist/argus.js
CHANGED
|
@@ -2130,7 +2130,7 @@ var {
|
|
|
2130
2130
|
// package.json
|
|
2131
2131
|
var package_default = {
|
|
2132
2132
|
name: "@vforsh/argus",
|
|
2133
|
-
version: "0.5.
|
|
2133
|
+
version: "0.5.2",
|
|
2134
2134
|
repository: {
|
|
2135
2135
|
type: "git",
|
|
2136
2136
|
url: "git+https://github.com/vforsh/argus.git",
|
|
@@ -3551,6 +3551,11 @@ var ARGUS_ERROR_CODES = [
|
|
|
3551
3551
|
"argus_executable_not_found",
|
|
3552
3552
|
"body_not_available",
|
|
3553
3553
|
"cdp_not_attached",
|
|
3554
|
+
"cdp_renderer_unresponsive",
|
|
3555
|
+
"cdp_target_replaced",
|
|
3556
|
+
"cdp_timeout",
|
|
3557
|
+
"chrome_unreachable",
|
|
3558
|
+
"dialog_blocking",
|
|
3554
3559
|
"dialog_not_prompt",
|
|
3555
3560
|
"extension_action_failed",
|
|
3556
3561
|
"extension_frame_not_ready",
|
|
@@ -3580,6 +3585,7 @@ var ARGUS_ERROR_CODES = [
|
|
|
3580
3585
|
"session_invalid_request",
|
|
3581
3586
|
"session_request_timeout",
|
|
3582
3587
|
"session_unknown_command",
|
|
3588
|
+
"target_not_focused",
|
|
3583
3589
|
"unexpected_matches",
|
|
3584
3590
|
"unsupported_platform"
|
|
3585
3591
|
];
|
|
@@ -4451,7 +4457,7 @@ var buildWatcherUrl = (watcher, path4, query2) => {
|
|
|
4451
4457
|
const qs = query2?.toString();
|
|
4452
4458
|
return `http://${watcher.host}:${watcher.port}${path4}${qs ? `?${qs}` : ""}`;
|
|
4453
4459
|
};
|
|
4454
|
-
var formatWatcherTransportError = (watcher, error) => `${watcher.id}: failed to reach watcher (${formatError(error)})`;
|
|
4460
|
+
var formatWatcherTransportError = (watcher, error) => classifyWatcherFailure(error) === "api-rejection" ? `${watcher.id}: watcher rejected the request (${formatError(error)})` : `${watcher.id}: failed to reach watcher (${formatError(error)})`;
|
|
4455
4461
|
var classifyWatcherFailure = (error) => {
|
|
4456
4462
|
if (isHttpResponseError(error)) {
|
|
4457
4463
|
return "api-rejection";
|
|
@@ -6104,6 +6110,10 @@ var resolvePath = (input) => {
|
|
|
6104
6110
|
const expanded = input.startsWith("~/") || input === "~" ? path4.join(homedir(), input.slice(1)) : input;
|
|
6105
6111
|
return path4.resolve(expanded);
|
|
6106
6112
|
};
|
|
6113
|
+
var resolveArtifactOutFile = (out) => {
|
|
6114
|
+
const trimmed = out?.trim();
|
|
6115
|
+
return trimmed ? resolvePath(trimmed) : undefined;
|
|
6116
|
+
};
|
|
6107
6117
|
|
|
6108
6118
|
// dist/commands/startShared.js
|
|
6109
6119
|
var resolveInjectScript = async (inject, output) => {
|
|
@@ -7105,6 +7115,63 @@ var getErrorCode = (error) => {
|
|
|
7105
7115
|
var hasErrorCode = (error, code2) => getErrorCode(error) === code2;
|
|
7106
7116
|
var createNotAttachedError = (message = "No tab attached via extension") => codedError("cdp_not_attached", message);
|
|
7107
7117
|
|
|
7118
|
+
// ../argus-watcher/dist/cdp/health.js
|
|
7119
|
+
var CDP_HEALTH_PROBE_TIMEOUT_MS = 2000;
|
|
7120
|
+
var diagnoseCdpHealth = async (probe) => {
|
|
7121
|
+
const id = probe.watcherId ?? "<id>";
|
|
7122
|
+
if (!probe.isAttached()) {
|
|
7123
|
+
return {
|
|
7124
|
+
code: "cdp_not_attached",
|
|
7125
|
+
message: `The watcher is not attached to a target. Check \`argus watcher status ${id}\` and \`argus doctor\`.`
|
|
7126
|
+
};
|
|
7127
|
+
}
|
|
7128
|
+
const transport = await probe.checkTransport?.() ?? { state: "ok" };
|
|
7129
|
+
if (transport.state === "unreachable") {
|
|
7130
|
+
return {
|
|
7131
|
+
code: "chrome_unreachable",
|
|
7132
|
+
message: `Chrome's CDP endpoint did not answer (${transport.detail}). Restart the browser, then \`argus doctor\`.`
|
|
7133
|
+
};
|
|
7134
|
+
}
|
|
7135
|
+
if (transport.state === "target_gone") {
|
|
7136
|
+
probe.onTargetGone?.();
|
|
7137
|
+
return {
|
|
7138
|
+
code: "cdp_target_replaced",
|
|
7139
|
+
message: `The attached page target is gone (${transport.detail}) — a navigation replaced it. ` + `Argus is reattaching; retry the command, or check \`argus watcher status ${id}\`.`
|
|
7140
|
+
};
|
|
7141
|
+
}
|
|
7142
|
+
const dialog2 = probe.getBlockingDialog?.();
|
|
7143
|
+
if (dialog2) {
|
|
7144
|
+
return {
|
|
7145
|
+
code: "dialog_blocking",
|
|
7146
|
+
message: `A ${dialog2.type} dialog is open and blocking the page. ` + `Dismiss it with \`argus dialog accept ${id}\` or \`argus dialog dismiss ${id}\`, then retry.`
|
|
7147
|
+
};
|
|
7148
|
+
}
|
|
7149
|
+
if (!await probe.probeRenderer()) {
|
|
7150
|
+
return {
|
|
7151
|
+
code: "cdp_renderer_unresponsive",
|
|
7152
|
+
message: `The page's renderer did not answer a trivial evaluation within ${CDP_HEALTH_PROBE_TIMEOUT_MS}ms — its main thread is ` + `blocked, or a cross-origin navigation stranded it. A longer timeout will not help: reload with \`argus reload ${id}\`, ` + "or restart Chrome."
|
|
7153
|
+
};
|
|
7154
|
+
}
|
|
7155
|
+
return {
|
|
7156
|
+
code: "cdp_timeout",
|
|
7157
|
+
message: "The watcher, target, and renderer all answered, so the expression itself exceeded its deadline. Pass a longer timeout."
|
|
7158
|
+
};
|
|
7159
|
+
};
|
|
7160
|
+
var toDiagnosedError = (diagnosis, original) => {
|
|
7161
|
+
const detail = original instanceof Error ? original.message : String(original);
|
|
7162
|
+
return codedError(diagnosis.code, `${detail}. ${diagnosis.message}`);
|
|
7163
|
+
};
|
|
7164
|
+
var isCdpTimeoutError = (error) => error instanceof Error && /\b(?:CDP|Bridge|Control) request timed out\b/i.test(error.message);
|
|
7165
|
+
var createSessionRendererProbe = (session2) => async () => {
|
|
7166
|
+
try {
|
|
7167
|
+
const params = { expression: "1", returnByValue: true, silent: true };
|
|
7168
|
+
await session2.sendAndWait("Runtime.evaluate", params, { timeoutMs: CDP_HEALTH_PROBE_TIMEOUT_MS });
|
|
7169
|
+
return true;
|
|
7170
|
+
} catch {
|
|
7171
|
+
return false;
|
|
7172
|
+
}
|
|
7173
|
+
};
|
|
7174
|
+
|
|
7108
7175
|
// ../argus-watcher/dist/http/httpUtils.js
|
|
7109
7176
|
var respondJson = (res, body, status2 = 200) => {
|
|
7110
7177
|
const payload = JSON.stringify(body);
|
|
@@ -7133,6 +7200,17 @@ var respondPayloadTooLarge = (res) => {
|
|
|
7133
7200
|
var respondError = (res, error) => {
|
|
7134
7201
|
respondApiError(res, 500, getErrorCode(error), formatError(error));
|
|
7135
7202
|
};
|
|
7203
|
+
var respondCdpError = async (res, error, diagnose) => {
|
|
7204
|
+
if (!diagnose || !isCdpTimeoutError(error)) {
|
|
7205
|
+
respondError(res, error);
|
|
7206
|
+
return;
|
|
7207
|
+
}
|
|
7208
|
+
try {
|
|
7209
|
+
respondError(res, toDiagnosedError(await diagnose(), error));
|
|
7210
|
+
} catch {
|
|
7211
|
+
respondError(res, error);
|
|
7212
|
+
}
|
|
7213
|
+
};
|
|
7136
7214
|
var readJsonBody = async (req, res) => {
|
|
7137
7215
|
const chunks = [];
|
|
7138
7216
|
let size = 0;
|
|
@@ -7274,7 +7352,7 @@ var normalizeTimeout = (value) => {
|
|
|
7274
7352
|
// ../argus-watcher/package.json
|
|
7275
7353
|
var package_default2 = {
|
|
7276
7354
|
name: "@vforsh/argus-watcher",
|
|
7277
|
-
version: "0.5.
|
|
7355
|
+
version: "0.5.2",
|
|
7278
7356
|
repository: {
|
|
7279
7357
|
type: "git",
|
|
7280
7358
|
url: "git+https://github.com/vforsh/argus.git",
|
|
@@ -7351,7 +7429,7 @@ var defineJsonRoute = (input) => ({
|
|
|
7351
7429
|
if (input.handleError?.(res, error)) {
|
|
7352
7430
|
return;
|
|
7353
7431
|
}
|
|
7354
|
-
|
|
7432
|
+
await respondCdpError(res, error, ctx.diagnoseCdp);
|
|
7355
7433
|
}
|
|
7356
7434
|
}
|
|
7357
7435
|
});
|
|
@@ -9470,6 +9548,7 @@ var shouldMaterializeByValue = (record2) => {
|
|
|
9470
9548
|
};
|
|
9471
9549
|
|
|
9472
9550
|
// ../argus-watcher/dist/http/routes/postEval.js
|
|
9551
|
+
var DEFAULT_EVAL_CDP_TIMEOUT_MS = 30000;
|
|
9473
9552
|
var route18 = defineJsonRoute({
|
|
9474
9553
|
method: "POST",
|
|
9475
9554
|
path: "/eval",
|
|
@@ -9482,7 +9561,7 @@ var route18 = defineJsonRoute({
|
|
|
9482
9561
|
replMode: normalizeBoolean(payload.replMode, true),
|
|
9483
9562
|
returnByValue: normalizeBoolean(payload.returnByValue, true),
|
|
9484
9563
|
jsonValue: normalizeBoolean(payload.jsonValue, false),
|
|
9485
|
-
timeoutMs: normalizeTimeout(payload.timeoutMs),
|
|
9564
|
+
timeoutMs: normalizeTimeout(payload.timeoutMs) ?? DEFAULT_EVAL_CDP_TIMEOUT_MS,
|
|
9486
9565
|
scenario: normalizeBoolean(payload.scenario, false),
|
|
9487
9566
|
scenarioServices: {
|
|
9488
9567
|
buffer: ctx.buffer,
|
|
@@ -11071,25 +11150,44 @@ var dispatchKeydown = async (session2, options) => {
|
|
|
11071
11150
|
await session2.sendAndWait("DOM.focus", { nodeId });
|
|
11072
11151
|
focused = true;
|
|
11073
11152
|
}
|
|
11074
|
-
const
|
|
11153
|
+
const carriesText = event.text != null;
|
|
11075
11154
|
const baseParams = {
|
|
11076
11155
|
code: event.code,
|
|
11077
11156
|
key: event.key,
|
|
11078
11157
|
windowsVirtualKeyCode: event.keyCode,
|
|
11079
|
-
nativeVirtualKeyCode: event.keyCode,
|
|
11080
11158
|
modifiers: event.modifiers
|
|
11081
11159
|
};
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
await session2.sendAndWait("Input.dispatchKeyEvent", { ...baseParams, type: "keyUp" });
|
|
11086
|
-
} else {
|
|
11087
|
-
await session2.sendAndWait("Input.dispatchKeyEvent", { ...baseParams, type: "rawKeyDown", text: event.text });
|
|
11088
|
-
await session2.sendAndWait("Input.dispatchKeyEvent", { ...baseParams, type: "keyUp" });
|
|
11089
|
-
}
|
|
11160
|
+
const keyDownParams = carriesText ? { ...baseParams, type: "keyDown", text: event.text, unmodifiedText: event.text } : { ...baseParams, type: "rawKeyDown" };
|
|
11161
|
+
await session2.sendAndWait("Input.dispatchKeyEvent", keyDownParams);
|
|
11162
|
+
await session2.sendAndWait("Input.dispatchKeyEvent", { ...baseParams, type: "keyUp" });
|
|
11090
11163
|
return { key: event.key, code: event.code, modifiers: event.modifiers, focused, event };
|
|
11091
11164
|
};
|
|
11092
11165
|
|
|
11166
|
+
// ../argus-watcher/dist/cdp/pageFocus.js
|
|
11167
|
+
var FOCUS_PROBE_TIMEOUT_MS = 3000;
|
|
11168
|
+
var ensurePageInputFocus = async (pageSession, visibility2) => {
|
|
11169
|
+
if (!pageSession.isAttached()) {
|
|
11170
|
+
return { activated: false };
|
|
11171
|
+
}
|
|
11172
|
+
if (await hasPageFocus(pageSession)) {
|
|
11173
|
+
return { activated: false };
|
|
11174
|
+
}
|
|
11175
|
+
try {
|
|
11176
|
+
await visibility2.setLock(pageSession, "shown");
|
|
11177
|
+
} catch (error) {
|
|
11178
|
+
throw notFocusedError(`activating it failed: ${formatError(error)}`);
|
|
11179
|
+
}
|
|
11180
|
+
if (!await hasPageFocus(pageSession)) {
|
|
11181
|
+
throw notFocusedError("activating it did not give it focus");
|
|
11182
|
+
}
|
|
11183
|
+
return { activated: true };
|
|
11184
|
+
};
|
|
11185
|
+
var hasPageFocus = async (pageSession) => {
|
|
11186
|
+
const focused = await tryEvaluateInPage(pageSession, "document.hasFocus()", { timeoutMs: FOCUS_PROBE_TIMEOUT_MS });
|
|
11187
|
+
return focused !== false;
|
|
11188
|
+
};
|
|
11189
|
+
var notFocusedError = (reason) => codedError("target_not_focused", `The page is not focused, so Chrome would drop the keyboard event — ${reason}. ` + "Run `argus page show <id>` and retry, or start the watcher against a visible page.");
|
|
11190
|
+
|
|
11093
11191
|
// ../argus-watcher/dist/http/routes/postDomKeydown.js
|
|
11094
11192
|
var route32 = defineJsonRoute({
|
|
11095
11193
|
method: "POST",
|
|
@@ -11097,6 +11195,7 @@ var route32 = defineJsonRoute({
|
|
|
11097
11195
|
bodySchema: domKeydownRequestSchema,
|
|
11098
11196
|
endpoint: "dom/keydown",
|
|
11099
11197
|
handle: async ({ ctx, body: payload }) => {
|
|
11198
|
+
const activation = await ensurePageInputFocus(ctx.pageCdpSession, ctx.visibilityController);
|
|
11100
11199
|
const result = await dispatchKeydown(ctx.cdpSession, {
|
|
11101
11200
|
key: payload.key,
|
|
11102
11201
|
code: payload.code,
|
|
@@ -11109,6 +11208,7 @@ var route32 = defineJsonRoute({
|
|
|
11109
11208
|
code: result.code,
|
|
11110
11209
|
modifiers: result.modifiers,
|
|
11111
11210
|
focused: result.focused,
|
|
11211
|
+
activated: activation.activated,
|
|
11112
11212
|
event: result.event
|
|
11113
11213
|
};
|
|
11114
11214
|
}
|
|
@@ -16211,7 +16311,7 @@ var formatArgs = (args) => {
|
|
|
16211
16311
|
|
|
16212
16312
|
// ../argus-watcher/dist/cdp/watcherTargets.js
|
|
16213
16313
|
var findTarget = async (chrome, match) => {
|
|
16214
|
-
const targets = await
|
|
16314
|
+
const targets = await fetchCdpTargets(chrome);
|
|
16215
16315
|
if (targets.length === 0) {
|
|
16216
16316
|
throw new Error("No CDP targets available");
|
|
16217
16317
|
}
|
|
@@ -16268,8 +16368,9 @@ var matchesTarget = (target, match, targetById, urlRegex2, titleRegex) => {
|
|
|
16268
16368
|
}
|
|
16269
16369
|
return true;
|
|
16270
16370
|
};
|
|
16271
|
-
var
|
|
16272
|
-
|
|
16371
|
+
var TARGET_LIST_TIMEOUT_MS = 5000;
|
|
16372
|
+
var fetchCdpTargets = async (chrome, timeoutMs = TARGET_LIST_TIMEOUT_MS) => {
|
|
16373
|
+
const response = await fetch(`http://${chrome.host}:${chrome.port}/json`, { signal: AbortSignal.timeout(timeoutMs) });
|
|
16273
16374
|
if (!response.ok) {
|
|
16274
16375
|
throw new Error(`Failed to fetch CDP targets (status ${response.status})`);
|
|
16275
16376
|
}
|
|
@@ -16313,6 +16414,12 @@ var startCdpWatcher = (options) => {
|
|
|
16313
16414
|
socket.close();
|
|
16314
16415
|
}
|
|
16315
16416
|
};
|
|
16417
|
+
const reconnect = () => {
|
|
16418
|
+
if (stopped) {
|
|
16419
|
+
return;
|
|
16420
|
+
}
|
|
16421
|
+
socket?.close();
|
|
16422
|
+
};
|
|
16316
16423
|
runLoop();
|
|
16317
16424
|
session2.onEvent("Runtime.consoleAPICalled", (params) => {
|
|
16318
16425
|
if (!currentTarget) {
|
|
@@ -16345,6 +16452,7 @@ var startCdpWatcher = (options) => {
|
|
|
16345
16452
|
});
|
|
16346
16453
|
return {
|
|
16347
16454
|
stop,
|
|
16455
|
+
reconnect,
|
|
16348
16456
|
session: session2,
|
|
16349
16457
|
getTarget: () => currentTarget ? { ...currentTarget } : null
|
|
16350
16458
|
};
|
|
@@ -16534,9 +16642,29 @@ var createCdpSource = (options) => {
|
|
|
16534
16642
|
pageUrl: target?.url ?? null
|
|
16535
16643
|
};
|
|
16536
16644
|
},
|
|
16645
|
+
healthChecks: {
|
|
16646
|
+
checkTransport: () => checkCdpTransport(chrome, watcher2),
|
|
16647
|
+
onTargetGone: watcher2.reconnect
|
|
16648
|
+
},
|
|
16537
16649
|
stop: watcher2.stop
|
|
16538
16650
|
};
|
|
16539
16651
|
};
|
|
16652
|
+
var checkCdpTransport = async (chrome, watcher2) => {
|
|
16653
|
+
let targets;
|
|
16654
|
+
try {
|
|
16655
|
+
targets = await fetchCdpTargets(chrome, CDP_HEALTH_PROBE_TIMEOUT_MS);
|
|
16656
|
+
} catch (error) {
|
|
16657
|
+
return { state: "unreachable", detail: `${chrome.host}:${chrome.port}: ${formatError(error)}` };
|
|
16658
|
+
}
|
|
16659
|
+
const target = watcher2.getTarget();
|
|
16660
|
+
if (!target) {
|
|
16661
|
+
return { state: "target_gone", detail: "the watcher holds no target" };
|
|
16662
|
+
}
|
|
16663
|
+
if (!targets.some((candidate) => candidate.id === target.id)) {
|
|
16664
|
+
return { state: "target_gone", detail: `Chrome no longer lists target ${target.id} (${target.url})` };
|
|
16665
|
+
}
|
|
16666
|
+
return { state: "ok" };
|
|
16667
|
+
};
|
|
16540
16668
|
|
|
16541
16669
|
// ../argus-watcher/dist/native-messaging/messaging.js
|
|
16542
16670
|
var createNativeMessaging = () => {
|
|
@@ -18231,6 +18359,13 @@ var createWatcherHandle = async (options, watcherId) => {
|
|
|
18231
18359
|
};
|
|
18232
18360
|
}
|
|
18233
18361
|
});
|
|
18362
|
+
const diagnoseCdp = () => diagnoseCdpHealth({
|
|
18363
|
+
watcherId,
|
|
18364
|
+
isAttached: () => sourceHandle.session.isAttached(),
|
|
18365
|
+
probeRenderer: createSessionRendererProbe(sourceHandle.session),
|
|
18366
|
+
getBlockingDialog: () => dialogTracker.getActive(),
|
|
18367
|
+
...sourceHandle.healthChecks
|
|
18368
|
+
});
|
|
18234
18369
|
const dialogSession = getPageSession();
|
|
18235
18370
|
dialogSession.onEvent("Page.javascriptDialogOpening", (params) => {
|
|
18236
18371
|
const dialog2 = parseDialogStatus(params);
|
|
@@ -18263,6 +18398,7 @@ var createWatcherHandle = async (options, watcherId) => {
|
|
|
18263
18398
|
throttleController,
|
|
18264
18399
|
visibilityController,
|
|
18265
18400
|
netMockController,
|
|
18401
|
+
diagnoseCdp,
|
|
18266
18402
|
getNetFilterContext: sourceHandle.getNetFilterContext,
|
|
18267
18403
|
readBrowserCookies: sourceHandle.readBrowserCookies,
|
|
18268
18404
|
sourceHandle: sourceMode === "extension" ? sourceHandle : undefined,
|
|
@@ -19973,7 +20109,7 @@ var resolveAttachedTarget = async (options, output) => {
|
|
|
19973
20109
|
try {
|
|
19974
20110
|
status2 = await fetchJson(statusUrl, { timeoutMs: 2000 });
|
|
19975
20111
|
} catch (error) {
|
|
19976
|
-
output.writeWarn(
|
|
20112
|
+
output.writeWarn(formatWatcherTransportError(resolved.watcher, error));
|
|
19977
20113
|
process.exitCode = 1;
|
|
19978
20114
|
return null;
|
|
19979
20115
|
}
|
|
@@ -20898,19 +21034,21 @@ import fs10 from "node:fs/promises";
|
|
|
20898
21034
|
import path14 from "node:path";
|
|
20899
21035
|
|
|
20900
21036
|
// dist/eval/evalClient.js
|
|
20901
|
-
var
|
|
21037
|
+
var DEFAULT_EVAL_TIMEOUT_MS = 1e4;
|
|
21038
|
+
var REQUEST_TIMEOUT_GRACE_MS = 8000;
|
|
20902
21039
|
var MIN_SUGGESTED_TIMEOUT_MS = 60000;
|
|
20903
21040
|
var evalOnce = async (input) => {
|
|
21041
|
+
const evalTimeoutMs = input.timeoutMs ?? DEFAULT_EVAL_TIMEOUT_MS;
|
|
20904
21042
|
const body = {
|
|
20905
21043
|
expression: input.expression,
|
|
20906
21044
|
args: input.args,
|
|
20907
21045
|
awaitPromise: input.awaitPromise,
|
|
20908
21046
|
replMode: input.replMode,
|
|
20909
21047
|
returnByValue: input.returnByValue,
|
|
20910
|
-
timeoutMs:
|
|
21048
|
+
timeoutMs: evalTimeoutMs,
|
|
20911
21049
|
scenario: input.scenario
|
|
20912
21050
|
};
|
|
20913
|
-
const requestTimeoutMs =
|
|
21051
|
+
const requestTimeoutMs = evalTimeoutMs + REQUEST_TIMEOUT_GRACE_MS;
|
|
20914
21052
|
let response;
|
|
20915
21053
|
try {
|
|
20916
21054
|
response = await fetchWatcherJson(input.watcher, {
|
|
@@ -20938,11 +21076,11 @@ var evalOnce = async (input) => {
|
|
|
20938
21076
|
};
|
|
20939
21077
|
var formatEvalTransportError = (watcher2, error, timeoutMs) => {
|
|
20940
21078
|
const baseMessage = formatWatcherTransportError(watcher2, error);
|
|
20941
|
-
if (!isTimeoutError(error)) {
|
|
21079
|
+
if (classifyWatcherFailure(error) === "api-rejection" || !isTimeoutError(error)) {
|
|
20942
21080
|
return baseMessage;
|
|
20943
21081
|
}
|
|
20944
|
-
const suggestedTimeoutMs = Math.max(MIN_SUGGESTED_TIMEOUT_MS, (timeoutMs ??
|
|
20945
|
-
return `${baseMessage}. ` + `
|
|
21082
|
+
const suggestedTimeoutMs = Math.max(MIN_SUGGESTED_TIMEOUT_MS, (timeoutMs ?? DEFAULT_EVAL_TIMEOUT_MS) * 2);
|
|
21083
|
+
return `${baseMessage}. ` + `The watcher did not answer at all, so it may be unresponsive rather than slow: check \`argus watcher status ${watcher2.id}\` ` + `and \`argus doctor\`. If the watcher is healthy, the expression needs more time; pass a longer timeout as milliseconds or a ` + `duration, for example: \`argus eval ${watcher2.id} --timeout ${formatSuggestedDuration(suggestedTimeoutMs)} ...\``;
|
|
20946
21084
|
};
|
|
20947
21085
|
var isTimeoutError = (error) => {
|
|
20948
21086
|
const message = formatError(error);
|
|
@@ -48313,9 +48451,12 @@ var runDomKeydown = defineWatcherCommand({
|
|
|
48313
48451
|
formatHuman: (response, { options, output }) => {
|
|
48314
48452
|
if (options.printEvent) {
|
|
48315
48453
|
output.writeHuman(`Dispatched keydown event: ${JSON.stringify(response.event)}`);
|
|
48316
|
-
|
|
48454
|
+
} else {
|
|
48455
|
+
output.writeHuman(`Dispatched keydown: ${response.key} (code=${response.code})`);
|
|
48456
|
+
}
|
|
48457
|
+
if (response.activated) {
|
|
48458
|
+
output.writeHuman("Page was hidden and has been activated (as `argus page show`); release it with `argus page hide`.");
|
|
48317
48459
|
}
|
|
48318
|
-
output.writeHuman(`Dispatched keydown: ${response.key} (code=${response.code})`);
|
|
48319
48460
|
}
|
|
48320
48461
|
});
|
|
48321
48462
|
|
|
@@ -48678,7 +48819,7 @@ var buildScreenshotPlan = (options, output) => {
|
|
|
48678
48819
|
path: "/screenshot",
|
|
48679
48820
|
method: "POST",
|
|
48680
48821
|
body: {
|
|
48681
|
-
outFile: options.out,
|
|
48822
|
+
outFile: resolveArtifactOutFile(options.out),
|
|
48682
48823
|
selector,
|
|
48683
48824
|
clip,
|
|
48684
48825
|
format: "png"
|
|
@@ -48800,7 +48941,7 @@ var snapshotCommands = [
|
|
|
48800
48941
|
description: "Capture a screenshot to disk on the watcher",
|
|
48801
48942
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
48802
48943
|
options: [
|
|
48803
|
-
{ flags: "--out <file>", description: "Output file path (absolute or relative to
|
|
48944
|
+
{ flags: "--out <file>", description: "Output file path (absolute, or relative to the current working directory)" },
|
|
48804
48945
|
{ flags: "--selector <selector>", description: "Optional CSS selector for element-only capture" },
|
|
48805
48946
|
{ flags: "--clip <x,y,width,height>", description: "Viewport-relative rectangle crop in CSS pixels" },
|
|
48806
48947
|
{ flags: "--testid <id>", description: `Shorthand for --selector "[data-testid='<id>']"` },
|
|
@@ -48915,7 +49056,7 @@ var buildRecordStopPlan = (options, output) => {
|
|
|
48915
49056
|
method: "POST",
|
|
48916
49057
|
body: {
|
|
48917
49058
|
recordId: normalizeString2(options.recordId),
|
|
48918
|
-
outFile: options.out
|
|
49059
|
+
outFile: resolveArtifactOutFile(options.out)
|
|
48919
49060
|
},
|
|
48920
49061
|
timeoutMs: RECORD_STOP_TIMEOUT_MS
|
|
48921
49062
|
};
|
|
@@ -48939,7 +49080,7 @@ var buildRecordBody = (options, output) => {
|
|
|
48939
49080
|
return null;
|
|
48940
49081
|
}
|
|
48941
49082
|
return {
|
|
48942
|
-
outFile: options.out,
|
|
49083
|
+
outFile: resolveArtifactOutFile(options.out),
|
|
48943
49084
|
selector,
|
|
48944
49085
|
clip,
|
|
48945
49086
|
fps,
|
|
@@ -49064,7 +49205,7 @@ var recordCommands = [
|
|
|
49064
49205
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
49065
49206
|
options: [
|
|
49066
49207
|
{ flags: "--duration <duration>", description: "Capture for duration (e.g. 3s, 500ms)" },
|
|
49067
|
-
{ flags: "--out <file>", description: "Output .mp4 or .webm path (absolute or relative to
|
|
49208
|
+
{ flags: "--out <file>", description: "Output .mp4 or .webm path (absolute, or relative to the current working directory)" },
|
|
49068
49209
|
{ flags: "--selector <selector>", description: "Optional CSS selector for element-only recording" },
|
|
49069
49210
|
{ flags: "--clip <x,y,width,height>", description: "Viewport-relative rectangle crop in CSS pixels" },
|
|
49070
49211
|
{ flags: "--testid <id>", description: `Shorthand for --selector "[data-testid='<id>']"` },
|
|
@@ -49089,7 +49230,7 @@ var recordCommands = [
|
|
|
49089
49230
|
description: "Start a silent video recording",
|
|
49090
49231
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
49091
49232
|
options: [
|
|
49092
|
-
{ flags: "--out <file>", description: "Output .mp4 or .webm path (absolute or relative to
|
|
49233
|
+
{ flags: "--out <file>", description: "Output .mp4 or .webm path (absolute, or relative to the current working directory)" },
|
|
49093
49234
|
{ flags: "--selector <selector>", description: "Optional CSS selector for element-only recording" },
|
|
49094
49235
|
{ flags: "--clip <x,y,width,height>", description: "Viewport-relative rectangle crop in CSS pixels" },
|
|
49095
49236
|
{ flags: "--testid <id>", description: `Shorthand for --selector "[data-testid='<id>']"` },
|
|
@@ -49110,7 +49251,10 @@ var recordCommands = [
|
|
|
49110
49251
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
49111
49252
|
options: [
|
|
49112
49253
|
{ flags: "--record-id <id>", description: "Record id returned from start" },
|
|
49113
|
-
{
|
|
49254
|
+
{
|
|
49255
|
+
flags: "--out <file>",
|
|
49256
|
+
description: "Move the saved recording to this .mp4 or .webm path (absolute, or relative to the current working directory)"
|
|
49257
|
+
},
|
|
49114
49258
|
jsonOption
|
|
49115
49259
|
],
|
|
49116
49260
|
examples: ["argus record stop app", "argus record stop app --out demo.mp4 --json"],
|
|
@@ -49193,7 +49337,7 @@ var runTraceStartInternal = async (watcher2, options, output) => {
|
|
|
49193
49337
|
path: "/trace/start",
|
|
49194
49338
|
method: "POST",
|
|
49195
49339
|
body: {
|
|
49196
|
-
outFile: options.out,
|
|
49340
|
+
outFile: resolveArtifactOutFile(options.out),
|
|
49197
49341
|
categories: options.categories,
|
|
49198
49342
|
options: options.options
|
|
49199
49343
|
},
|
|
@@ -49211,7 +49355,7 @@ var runTraceStopInternal = async (watcher2, options, output) => {
|
|
|
49211
49355
|
const response = await fetchWatcherJson(watcher2, {
|
|
49212
49356
|
path: "/trace/stop",
|
|
49213
49357
|
method: "POST",
|
|
49214
|
-
body: { traceId: options.traceId, outFile: options.outFile },
|
|
49358
|
+
body: { traceId: options.traceId, outFile: resolveArtifactOutFile(options.outFile) },
|
|
49215
49359
|
timeoutMs: 20000
|
|
49216
49360
|
});
|
|
49217
49361
|
return response;
|
|
@@ -49231,7 +49375,7 @@ var traceCommands = [
|
|
|
49231
49375
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
49232
49376
|
options: [
|
|
49233
49377
|
{ flags: "--duration <duration>", description: "Capture for duration (e.g. 3s, 500ms)" },
|
|
49234
|
-
{ flags: "--out <file>", description: "Output trace file path (relative to
|
|
49378
|
+
{ flags: "--out <file>", description: "Output trace file path (absolute, or relative to the current working directory)" },
|
|
49235
49379
|
{ flags: "--categories <categories>", description: "Comma-separated tracing categories" },
|
|
49236
49380
|
{ flags: "--options <options>", description: "Tracing options string" },
|
|
49237
49381
|
jsonOption
|
|
@@ -49246,7 +49390,7 @@ var traceCommands = [
|
|
|
49246
49390
|
description: "Start Chrome tracing",
|
|
49247
49391
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
49248
49392
|
options: [
|
|
49249
|
-
{ flags: "--out <file>", description: "Output trace file path (relative to
|
|
49393
|
+
{ flags: "--out <file>", description: "Output trace file path (absolute, or relative to the current working directory)" },
|
|
49250
49394
|
{ flags: "--categories <categories>", description: "Comma-separated tracing categories" },
|
|
49251
49395
|
{ flags: "--options <options>", description: "Tracing options string" },
|
|
49252
49396
|
jsonOption
|
|
@@ -49262,7 +49406,10 @@ var traceCommands = [
|
|
|
49262
49406
|
arguments: [{ flags: "[id]", description: "Watcher id to query" }],
|
|
49263
49407
|
options: [
|
|
49264
49408
|
{ flags: "--trace-id <id>", description: "Trace id returned from start" },
|
|
49265
|
-
{
|
|
49409
|
+
{
|
|
49410
|
+
flags: "--out <file>",
|
|
49411
|
+
description: "Move the saved trace file to this path (absolute, or relative to the current working directory)"
|
|
49412
|
+
},
|
|
49266
49413
|
jsonOption
|
|
49267
49414
|
],
|
|
49268
49415
|
examples: ["argus trace stop app", "argus trace stop app --out trace.json --json"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordCommands.d.ts","sourceRoot":"","sources":["../../../src/cli/register/recordCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAKjE,eAAO,MAAM,cAAc,EAAE,SAAS,sBAAsB,
|
|
1
|
+
{"version":3,"file":"recordCommands.d.ts","sourceRoot":"","sources":["../../../src/cli/register/recordCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAKjE,eAAO,MAAM,cAAc,EAAE,SAAS,sBAAsB,EAgE3D,CAAA"}
|
|
@@ -8,7 +8,7 @@ export const recordCommands = [
|
|
|
8
8
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
9
9
|
options: [
|
|
10
10
|
{ flags: '--duration <duration>', description: 'Capture for duration (e.g. 3s, 500ms)' },
|
|
11
|
-
{ flags: '--out <file>', description: 'Output .mp4 or .webm path (absolute or relative to
|
|
11
|
+
{ flags: '--out <file>', description: 'Output .mp4 or .webm path (absolute, or relative to the current working directory)' },
|
|
12
12
|
{ flags: '--selector <selector>', description: 'Optional CSS selector for element-only recording' },
|
|
13
13
|
{ flags: '--clip <x,y,width,height>', description: 'Viewport-relative rectangle crop in CSS pixels' },
|
|
14
14
|
{ flags: '--testid <id>', description: 'Shorthand for --selector "[data-testid=\'<id>\']"' },
|
|
@@ -33,7 +33,7 @@ export const recordCommands = [
|
|
|
33
33
|
description: 'Start a silent video recording',
|
|
34
34
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
35
35
|
options: [
|
|
36
|
-
{ flags: '--out <file>', description: 'Output .mp4 or .webm path (absolute or relative to
|
|
36
|
+
{ flags: '--out <file>', description: 'Output .mp4 or .webm path (absolute, or relative to the current working directory)' },
|
|
37
37
|
{ flags: '--selector <selector>', description: 'Optional CSS selector for element-only recording' },
|
|
38
38
|
{ flags: '--clip <x,y,width,height>', description: 'Viewport-relative rectangle crop in CSS pixels' },
|
|
39
39
|
{ flags: '--testid <id>', description: 'Shorthand for --selector "[data-testid=\'<id>\']"' },
|
|
@@ -54,7 +54,10 @@ export const recordCommands = [
|
|
|
54
54
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
55
55
|
options: [
|
|
56
56
|
{ flags: '--record-id <id>', description: 'Record id returned from start' },
|
|
57
|
-
{
|
|
57
|
+
{
|
|
58
|
+
flags: '--out <file>',
|
|
59
|
+
description: 'Move the saved recording to this .mp4 or .webm path (absolute, or relative to the current working directory)',
|
|
60
|
+
},
|
|
58
61
|
jsonOption,
|
|
59
62
|
],
|
|
60
63
|
examples: ['argus record stop app', 'argus record stop app --out demo.mp4 --json'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordCommands.js","sourceRoot":"","sources":["../../../src/cli/register/recordCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAsC;IAChE;QACC,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,yDAAyD;QACtE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;QAClE,OAAO,EAAE;YACR,EAAE,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,uCAAuC,EAAE;YACxF,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"recordC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CAAC,CAAA;gBACjC,CAAC;aACD;SACD;KACD;CACD,CAAA"}
|
|
@@ -8,7 +8,7 @@ export const snapshotCommands = [
|
|
|
8
8
|
description: 'Capture a screenshot to disk on the watcher',
|
|
9
9
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
10
10
|
options: [
|
|
11
|
-
{ flags: '--out <file>', description: 'Output file path (absolute or relative to
|
|
11
|
+
{ flags: '--out <file>', description: 'Output file path (absolute, or relative to the current working directory)' },
|
|
12
12
|
{ flags: '--selector <selector>', description: 'Optional CSS selector for element-only capture' },
|
|
13
13
|
{ flags: '--clip <x,y,width,height>', description: 'Viewport-relative rectangle crop in CSS pixels' },
|
|
14
14
|
{ flags: '--testid <id>', description: 'Shorthand for --selector "[data-testid=\'<id>\']"' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotCommands.js","sourceRoot":"","sources":["../../../src/cli/register/snapshotCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IAClE;QACC,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,6CAA6C;QAC1D,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;QAClE,OAAO,EAAE;YACR,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"snapshotCommands.js","sourceRoot":"","sources":["../../../src/cli/register/snapshotCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM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Aa,EAAE,WAAW,EAAE,gBAAgB,EAAE;YACvD,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,+DAA+D,EAAE;YAC5G,UAAU;SACV;QACD,QAAQ,EAAE;YACT,oBAAoB;YACpB,kCAAkC;YAClC,sCAAsC;YACtC,0CAA0C;YAC1C,8BAA8B;YAC9B,mBAAmB;YACnB,cAAc;SACd;QACD,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;YAC7B,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;gBAAE,OAAM;YACnC,MAAM,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;QAC/B,CAAC;KACD;CACD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceCommands.d.ts","sourceRoot":"","sources":["../../../src/cli/register/traceCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAIjE,eAAO,MAAM,aAAa,EAAE,SAAS,sBAAsB,
|
|
1
|
+
{"version":3,"file":"traceCommands.d.ts","sourceRoot":"","sources":["../../../src/cli/register/traceCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAIjE,eAAO,MAAM,aAAa,EAAE,SAAS,sBAAsB,EAmD1D,CAAA"}
|
|
@@ -7,7 +7,7 @@ export const traceCommands = [
|
|
|
7
7
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
8
8
|
options: [
|
|
9
9
|
{ flags: '--duration <duration>', description: 'Capture for duration (e.g. 3s, 500ms)' },
|
|
10
|
-
{ flags: '--out <file>', description: 'Output trace file path (relative to
|
|
10
|
+
{ flags: '--out <file>', description: 'Output trace file path (absolute, or relative to the current working directory)' },
|
|
11
11
|
{ flags: '--categories <categories>', description: 'Comma-separated tracing categories' },
|
|
12
12
|
{ flags: '--options <options>', description: 'Tracing options string' },
|
|
13
13
|
jsonOption,
|
|
@@ -22,7 +22,7 @@ export const traceCommands = [
|
|
|
22
22
|
description: 'Start Chrome tracing',
|
|
23
23
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
24
24
|
options: [
|
|
25
|
-
{ flags: '--out <file>', description: 'Output trace file path (relative to
|
|
25
|
+
{ flags: '--out <file>', description: 'Output trace file path (absolute, or relative to the current working directory)' },
|
|
26
26
|
{ flags: '--categories <categories>', description: 'Comma-separated tracing categories' },
|
|
27
27
|
{ flags: '--options <options>', description: 'Tracing options string' },
|
|
28
28
|
jsonOption,
|
|
@@ -38,7 +38,10 @@ export const traceCommands = [
|
|
|
38
38
|
arguments: [{ flags: '[id]', description: 'Watcher id to query' }],
|
|
39
39
|
options: [
|
|
40
40
|
{ flags: '--trace-id <id>', description: 'Trace id returned from start' },
|
|
41
|
-
{
|
|
41
|
+
{
|
|
42
|
+
flags: '--out <file>',
|
|
43
|
+
description: 'Move the saved trace file to this path (absolute, or relative to the current working directory)',
|
|
44
|
+
},
|
|
42
45
|
jsonOption,
|
|
43
46
|
],
|
|
44
47
|
examples: ['argus trace stop app', 'argus trace stop app --out trace.json --json'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceCommands.js","sourceRoot":"","sources":["../../../src/cli/register/traceCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC/D;QACC,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,+CAA+C;QAC5D,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;QAClE,OAAO,EAAE;YACR,EAAE,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,uCAAuC,EAAE;YAC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OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;CACd,CAAA;AAyBD,wDAAwD;AACxD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"domKeydown.d.ts","sourceRoot":"","sources":["../../src/commands/domKeydown.ts"],"names":[],"mappings":"AAGA,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;CACd,CAAA;AAyBD,wDAAwD;AACxD,eAAO,MAAM,aAAa,qFAkCxB,CAAA"}
|
|
@@ -46,9 +46,14 @@ export const runDomKeydown = defineWatcherCommand({
|
|
|
46
46
|
formatHuman: (response, { options, output }) => {
|
|
47
47
|
if (options.printEvent) {
|
|
48
48
|
output.writeHuman(`Dispatched keydown event: ${JSON.stringify(response.event)}`);
|
|
49
|
-
return;
|
|
50
49
|
}
|
|
51
|
-
|
|
50
|
+
else {
|
|
51
|
+
output.writeHuman(`Dispatched keydown: ${response.key} (code=${response.code})`);
|
|
52
|
+
}
|
|
53
|
+
if (response.activated) {
|
|
54
|
+
// Sticky, exactly like `argus page show` — say so rather than leaving the page silently locked shown.
|
|
55
|
+
output.writeHuman('Page was hidden and has been activated (as `argus page show`); release it with `argus page hide`.');
|
|
56
|
+
}
|
|
52
57
|
},
|
|
53
58
|
});
|
|
54
59
|
//# sourceMappingURL=domKeydown.js.map
|