style: fix lint

This commit is contained in:
Peter Steinberger
2026-01-04 03:37:00 +00:00
parent c2f3b653c2
commit 7d95f43a75
4 changed files with 118 additions and 79 deletions

View File

@@ -98,12 +98,16 @@ export function registerBrowserActionInputCommands(
return;
}
try {
const result = await browserAct(baseUrl, {
kind: "resize",
width,
height,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "resize",
width,
height,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -140,14 +144,18 @@ export function registerBrowserActionInputCommands(
.filter(Boolean)
: undefined;
try {
const result = await browserAct(baseUrl, {
kind: "click",
ref: refValue,
targetId: opts.targetId?.trim() || undefined,
doubleClick: Boolean(opts.double),
button: opts.button?.trim() || undefined,
modifiers,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "click",
ref: refValue,
targetId: opts.targetId?.trim() || undefined,
doubleClick: Boolean(opts.double),
button: opts.button?.trim() || undefined,
modifiers,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -179,14 +187,18 @@ export function registerBrowserActionInputCommands(
return;
}
try {
const result = await browserAct(baseUrl, {
kind: "type",
ref: refValue,
text,
submit: Boolean(opts.submit),
slowly: Boolean(opts.slowly),
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "type",
ref: refValue,
text,
submit: Boolean(opts.submit),
slowly: Boolean(opts.slowly),
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -208,11 +220,15 @@ export function registerBrowserActionInputCommands(
const baseUrl = resolveBrowserControlUrl(parent?.url);
const profile = parent?.profile;
try {
const result = await browserAct(baseUrl, {
kind: "press",
key,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "press",
key,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -234,11 +250,15 @@ export function registerBrowserActionInputCommands(
const baseUrl = resolveBrowserControlUrl(parent?.url);
const profile = parent?.profile;
try {
const result = await browserAct(baseUrl, {
kind: "hover",
ref,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "hover",
ref,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -261,12 +281,16 @@ export function registerBrowserActionInputCommands(
const baseUrl = resolveBrowserControlUrl(parent?.url);
const profile = parent?.profile;
try {
const result = await browserAct(baseUrl, {
kind: "drag",
startRef,
endRef,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "drag",
startRef,
endRef,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -289,12 +313,16 @@ export function registerBrowserActionInputCommands(
const baseUrl = resolveBrowserControlUrl(parent?.url);
const profile = parent?.profile;
try {
const result = await browserAct(baseUrl, {
kind: "select",
ref,
values,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "select",
ref,
values,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -361,11 +389,15 @@ export function registerBrowserActionInputCommands(
fields: opts.fields,
fieldsFile: opts.fieldsFile,
});
const result = await browserAct(baseUrl, {
kind: "fill",
fields,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "fill",
fields,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -432,13 +464,17 @@ export function registerBrowserActionInputCommands(
const baseUrl = resolveBrowserControlUrl(parent?.url);
const profile = parent?.profile;
try {
const result = await browserAct(baseUrl, {
kind: "wait",
timeMs: Number.isFinite(opts.time) ? opts.time : undefined,
text: opts.text?.trim() || undefined,
textGone: opts.textGone?.trim() || undefined,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "wait",
timeMs: Number.isFinite(opts.time) ? opts.time : undefined,
text: opts.text?.trim() || undefined,
textGone: opts.textGone?.trim() || undefined,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
@@ -466,12 +502,16 @@ export function registerBrowserActionInputCommands(
return;
}
try {
const result = await browserAct(baseUrl, {
kind: "evaluate",
fn: opts.fn,
ref: opts.ref?.trim() || undefined,
targetId: opts.targetId?.trim() || undefined,
}, { profile });
const result = await browserAct(
baseUrl,
{
kind: "evaluate",
fn: opts.fn,
ref: opts.ref?.trim() || undefined,
targetId: opts.targetId?.trim() || undefined,
},
{ profile },
);
if (parent?.json) {
defaultRuntime.log(JSON.stringify(result, null, 2));
return;

View File

@@ -1 +1,5 @@
export type BrowserParentOpts = { url?: string; json?: boolean; profile?: string };
export type BrowserParentOpts = {
url?: string;
json?: boolean;
profile?: string;
};