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:
parent
83de980d6c
commit
8a244cd9af
@ -1,4 +1,5 @@
|
|||||||
import type { Command } from "commander";
|
import type { Command } from "commander";
|
||||||
|
import type { BrowserActResponse } from "../../browser/client-actions-core.js";
|
||||||
import { danger } from "../../globals.js";
|
import { danger } from "../../globals.js";
|
||||||
import { defaultRuntime } from "../../runtime.js";
|
import { defaultRuntime } from "../../runtime.js";
|
||||||
import type { BrowserParentOpts } from "../browser-cli-shared.js";
|
import type { BrowserParentOpts } from "../browser-cli-shared.js";
|
||||||
@ -27,7 +28,7 @@ export function registerBrowserElementCommands(
|
|||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
: undefined;
|
: undefined;
|
||||||
try {
|
try {
|
||||||
const result = await callBrowserAct({
|
const result = await callBrowserAct<BrowserActResponse>({
|
||||||
parent,
|
parent,
|
||||||
profile,
|
profile,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
import type { Command } from "commander";
|
import type { Command } from "commander";
|
||||||
|
import type { BrowserDownloadPayload } from "../../browser/client-actions-core.js";
|
||||||
import { danger } from "../../globals.js";
|
import { danger } from "../../globals.js";
|
||||||
import { defaultRuntime } from "../../runtime.js";
|
import { defaultRuntime } from "../../runtime.js";
|
||||||
import { callBrowserRequest, type BrowserParentOpts } from "../browser-cli-shared.js";
|
import { callBrowserRequest, type BrowserParentOpts } from "../browser-cli-shared.js";
|
||||||
import { resolveBrowserActionContext } from "./shared.js";
|
import { resolveBrowserActionContext } from "./shared.js";
|
||||||
import { shortenHomePath } from "../../utils.js";
|
import { shortenHomePath } from "../../utils.js";
|
||||||
|
|
||||||
|
type BrowserDownloadResponse = { ok: true; targetId: string; download: BrowserDownloadPayload };
|
||||||
|
|
||||||
export function registerBrowserFilesAndDownloadsCommands(
|
export function registerBrowserFilesAndDownloadsCommands(
|
||||||
browser: Command,
|
browser: Command,
|
||||||
parentOpts: (cmd: Command) => BrowserParentOpts,
|
parentOpts: (cmd: Command) => BrowserParentOpts,
|
||||||
@ -68,7 +71,7 @@ export function registerBrowserFilesAndDownloadsCommands(
|
|||||||
const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
|
const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
|
||||||
try {
|
try {
|
||||||
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : undefined;
|
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : undefined;
|
||||||
const result = await callBrowserRequest(
|
const result = await callBrowserRequest<BrowserDownloadResponse>(
|
||||||
parent,
|
parent,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@ -108,7 +111,7 @@ export function registerBrowserFilesAndDownloadsCommands(
|
|||||||
const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
|
const { parent, profile } = resolveBrowserActionContext(cmd, parentOpts);
|
||||||
try {
|
try {
|
||||||
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : undefined;
|
const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : undefined;
|
||||||
const result = await callBrowserRequest(
|
const result = await callBrowserRequest<BrowserDownloadResponse>(
|
||||||
parent,
|
parent,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import type { Command } from "commander";
|
import type { Command } from "commander";
|
||||||
|
import type { BrowserActResponse } from "../../browser/client-actions-core.js";
|
||||||
import { danger } from "../../globals.js";
|
import { danger } from "../../globals.js";
|
||||||
import { defaultRuntime } from "../../runtime.js";
|
import { defaultRuntime } from "../../runtime.js";
|
||||||
import type { BrowserParentOpts } from "../browser-cli-shared.js";
|
import type { BrowserParentOpts } from "../browser-cli-shared.js";
|
||||||
@ -108,7 +109,7 @@ export function registerBrowserFormWaitEvalCommands(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const result = await callBrowserAct({
|
const result = await callBrowserAct<BrowserActResponse>({
|
||||||
parent,
|
parent,
|
||||||
profile,
|
profile,
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { listChannelPlugins } from "../channels/plugins/index.js";
|
|||||||
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
||||||
import type { ChannelId } from "../channels/plugins/types.js";
|
import type { ChannelId } from "../channels/plugins/types.js";
|
||||||
import type { ClawdbotConfig } from "../config/config.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 { resolveConfigPath, resolveStateDir } from "../config/paths.js";
|
||||||
import { resolveGatewayAuth } from "../gateway/auth.js";
|
import { resolveGatewayAuth } from "../gateway/auth.js";
|
||||||
import { formatCliCommand } from "../cli/command-format.js";
|
import { formatCliCommand } from "../cli/command-format.js";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user