refactor: trim browser helper exports · openclaw/openclaw@11dc38c
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
File tree
browser-cli-actions-input
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export type ChromeMcpModule = typeof import("./chrome-mcp.js"); |
| 1 | +type ChromeMcpModule = typeof import("./chrome-mcp.js"); |
2 | 2 | |
3 | 3 | export async function getChromeMcpModule(): Promise<ChromeMcpModule> { |
4 | 4 | return await import("./chrome-mcp.js"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,9 +11,9 @@ import {
|
11 | 11 | DEFAULT_BROWSER_SCREENSHOT_TIMEOUT_MS, |
12 | 12 | } from "./constants.js"; |
13 | 13 | |
14 | | -export type { BrowserActRequest, BrowserFormField } from "./client-actions.types.js"; |
| 14 | +export type { BrowserFormField } from "./client-actions.types.js"; |
15 | 15 | |
16 | | -export type BrowserActResponse = { |
| 16 | +type BrowserActResponse = { |
17 | 17 | ok: true; |
18 | 18 | targetId: string; |
19 | 19 | url?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,12 +8,7 @@ import type {
|
8 | 8 | } from "./client.types.js"; |
9 | 9 | import type { BrowserDoctorReport } from "./doctor.js"; |
10 | 10 | |
11 | | -export type { |
12 | | -BrowserStatus, |
13 | | -BrowserTab, |
14 | | -BrowserTransport, |
15 | | -SnapshotAriaNode, |
16 | | -} from "./client.types.js"; |
| 11 | +export type { BrowserStatus, BrowserTab, BrowserTransport } from "./client.types.js"; |
17 | 12 | export type { BrowserDoctorCheck, BrowserDoctorReport } from "./doctor.js"; |
18 | 13 | |
19 | 14 | export type ProfileStatus = { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | export type BrowserTransport = "cdp" | "chrome-mcp"; |
2 | | -export type BrowserHeadlessSource = |
| 2 | +type BrowserHeadlessSource = |
3 | 3 | | "request" |
4 | 4 | | "env" |
5 | 5 | | "profile" |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { BrowserStatus, BrowserTransport } from "./client.types.js"; |
2 | 2 | |
3 | | -export type BrowserDoctorCheckStatus = "pass" | "warn" | "fail" | "info"; |
| 3 | +type BrowserDoctorCheckStatus = "pass" | "warn" | "fail" | "info"; |
4 | 4 | |
5 | 5 | export type BrowserDoctorCheck = { |
6 | 6 | id: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,11 +5,11 @@ export const DEFAULT_FILL_FIELD_TYPE = "text";
|
5 | 5 | |
6 | 6 | type BrowserFormFieldValue = NonNullable<BrowserFormField["value"]>; |
7 | 7 | |
8 | | -export function normalizeBrowserFormFieldRef(value: unknown): string { |
| 8 | +function normalizeBrowserFormFieldRef(value: unknown): string { |
9 | 9 | return normalizeOptionalString(value) ?? ""; |
10 | 10 | } |
11 | 11 | |
12 | | -export function normalizeBrowserFormFieldType(value: unknown): string { |
| 12 | +function normalizeBrowserFormFieldType(value: unknown): string { |
13 | 13 | const type = normalizeOptionalString(value) ?? ""; |
14 | 14 | return type || DEFAULT_FILL_FIELD_TYPE; |
15 | 15 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -22,7 +22,7 @@ function canUseNodeFs(): boolean {
|
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | | -export const DEFAULT_BROWSER_TMP_DIR = canUseNodeFs() |
| 25 | +const DEFAULT_BROWSER_TMP_DIR = canUseNodeFs() |
26 | 26 | ? resolvePreferredOpenClawTmpDir() |
27 | 27 | : DEFAULT_FALLBACK_BROWSER_TMP_DIR; |
28 | 28 | export const DEFAULT_TRACE_DIR = DEFAULT_BROWSER_TMP_DIR; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,7 @@
|
15 | 15 | export const CDP_PORT_RANGE_START = 18800; |
16 | 16 | export const CDP_PORT_RANGE_END = 18899; |
17 | 17 | |
18 | | -export const PROFILE_NAME_REGEX = /^[a-z0-9][a-z0-9-]*$/; |
| 18 | +const PROFILE_NAME_REGEX = /^[a-z0-9][a-z0-9-]*$/; |
19 | 19 | |
20 | 20 | export function isValidProfileName(name: string): boolean { |
21 | 21 | if (!name || name.length > 64) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { saveMediaBuffer } from "../media/store.js"; |
2 | 2 | |
3 | | -export type BrowserProxyFile = { |
| 3 | +type BrowserProxyFile = { |
4 | 4 | path: string; |
5 | 5 | base64: string; |
6 | 6 | mimeType?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; |
2 | 2 | import { CONTENT_ROLES, INTERACTIVE_ROLES, STRUCTURAL_ROLES } from "./snapshot-roles.js"; |
3 | 3 | |
4 | | -export type RoleRef = { |
| 4 | +type RoleRef = { |
5 | 5 | role: string; |
6 | 6 | name?: string; |
7 | 7 | /** Index used only when role+name duplicates exist. */ |
@@ -10,7 +10,7 @@ export type RoleRef = {
|
10 | 10 | |
11 | 11 | export type RoleRefMap = Record<string, RoleRef>; |
12 | 12 | |
13 | | -export type RoleSnapshotStats = { |
| 13 | +type RoleSnapshotStats = { |
14 | 14 | lines: number; |
15 | 15 | chars: number; |
16 | 16 | refs: number; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。