style: format browser tool wiring
This commit is contained in:
@@ -626,9 +626,7 @@ export function createClawdbotCodingTools(options?: {
|
||||
createWhatsAppLoginTool(),
|
||||
...createClawdbotTools({
|
||||
browserControlUrl: sandbox?.browser?.controlUrl,
|
||||
allowHostBrowserControl: sandbox
|
||||
? sandbox.browserAllowHostControl
|
||||
: true,
|
||||
allowHostBrowserControl: sandbox ? sandbox.browserAllowHostControl : true,
|
||||
agentSessionKey: options?.sessionKey,
|
||||
agentProvider: resolveGatewayMessageProvider(options?.messageProvider),
|
||||
agentAccountId: options?.agentAccountId,
|
||||
|
||||
@@ -143,21 +143,15 @@ function resolveBrowserBaseUrl(params: {
|
||||
const normalizedDefault = params.defaultControlUrl?.trim() ?? "";
|
||||
const target =
|
||||
params.target ??
|
||||
(normalizedControlUrl
|
||||
? "custom"
|
||||
: normalizedDefault
|
||||
? "sandbox"
|
||||
: "host");
|
||||
(normalizedControlUrl ? "custom" : normalizedDefault ? "sandbox" : "host");
|
||||
|
||||
if (target !== "custom" && params.target && normalizedControlUrl) {
|
||||
throw new Error(
|
||||
'controlUrl is only supported with target="custom".',
|
||||
);
|
||||
throw new Error('controlUrl is only supported with target="custom".');
|
||||
}
|
||||
|
||||
if (target === "custom") {
|
||||
if (!normalizedControlUrl) {
|
||||
throw new Error('Custom browser target requires controlUrl.');
|
||||
throw new Error("Custom browser target requires controlUrl.");
|
||||
}
|
||||
return normalizedControlUrl.replace(/\/$/, "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user