fix: add missing import and type params after browser refactor

- Add `resolveProfile` import to security/audit.ts
- Add `BrowserActResponse` type param to callBrowserAct calls
- Add `BrowserDownloadResponse` type param to callBrowserRequest calls

Fixes #2560
This commit is contained in:
Wes 2026-01-26 19:53:26 -08:00
parent 83de980d6c
commit 8a244cd9af
4 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import type { Command } from "commander";
import type { BrowserActResponse } from "../../browser/client-actions-core.js";
import { danger } from "../../globals.js";
import { defaultRuntime } from "../../runtime.js";
import type { BrowserParentOpts } from "../browser-cli-shared.js";
@ -27,7 +28,7 @@ export function registerBrowserElementCommands(
.filter(Boolean)
: undefined;
try {
const result = await callBrowserAct({
const result = await callBrowserAct<BrowserActResponse>({
parent,
profile,
body: {

View File

@ -1,10 +1,13 @@
import type { Command } from "commander";
import type { BrowserDownloadPayload } from "../../browser/client-actions-core.js";
import { danger } from "../../globals.js";
import { defaultRuntime } from "../../runtime.js";
import { callBrowserRequest, type BrowserParentOpts } from "../browser-cli-shared.js";
import { resolveBrowserActionContext } from "./shared.js";
import { shortenHomePath } from "../../utils.js";
type BrowserDownloadResponse = { ok: true; targetId: string; download: BrowserDownloadPayload };
export function registerBrowserFilesAndDownloadsCommands(
browser: Command,
parentOpts: (cmd: Command) => BrowserParentOpts,
@ -68,7 +71,7 @@ export function registerBrowserFilesAndDownloadsCommands(
const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
try {
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : undefined;
const result = await callBrowserRequest(
const result = await callBrowserRequest<BrowserDownloadResponse>(
parent,
{
method: "POST",
@ -108,7 +111,7 @@ export function registerBrowserFilesAndDownloadsCommands(
const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
try {
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : undefined;
const result = await callBrowserRequest(
const result = await callBrowserRequest<BrowserDownloadResponse>(
parent,
{
method: "POST",

View File

@ -1,4 +1,5 @@
import type { Command } from "commander";
import type { BrowserActResponse } from "../../browser/client-actions-core.js";
import { danger } from "../../globals.js";
import { defaultRuntime } from "../../runtime.js";
import type { BrowserParentOpts } from "../browser-cli-shared.js";
@ -108,7 +109,7 @@ export function registerBrowserFormWaitEvalCommands(
return;
}
try {
const result = await callBrowserAct({
const result = await callBrowserAct<BrowserActResponse>({
parent,
profile,
body: {

View File

@ -2,7 +2,7 @@ import { listChannelPlugins } from "../channels/plugins/index.js";
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
import type { ChannelId } from "../channels/plugins/types.js";
import type { ClawdbotConfig } from "../config/config.js";
import { resolveBrowserConfig } from "../browser/config.js";
import { resolveBrowserConfig, resolveProfile } from "../browser/config.js";
import { resolveConfigPath, resolveStateDir } from "../config/paths.js";
import { resolveGatewayAuth } from "../gateway/auth.js";
import { formatCliCommand } from "../cli/command-format.js";