chore: format sources and update protocol outputs

This commit is contained in:
Peter Steinberger
2026-01-15 05:17:03 +00:00
parent 2d066b8715
commit 139f80a291
33 changed files with 186 additions and 223 deletions

View File

@@ -17,4 +17,3 @@ describe("browser extension install", () => {
expect(result.path.includes("node_modules")).toBe(false);
});
});

View File

@@ -75,20 +75,20 @@ export function registerBrowserExtensionCommands(
defaultRuntime.log(JSON.stringify({ ok: true, path: installed.path }, null, 2));
return;
}
defaultRuntime.log(installed.path);
defaultRuntime.error(
info(
[
"Next:",
`- Chrome → chrome://extensions → enable “Developer mode”`,
`- “Load unpacked” → select: ${installed.path}`,
`- Pin “Clawdbot Browser Relay”, then click it on the tab (badge shows ON)`,
"",
`${theme.muted("Docs:")} ${formatDocsLink("/tools/chrome-extension", "docs.clawd.bot/tools/chrome-extension")}`,
].join("\n"),
),
);
});
defaultRuntime.log(installed.path);
defaultRuntime.error(
info(
[
"Next:",
`- Chrome → chrome://extensions → enable “Developer mode”`,
`- “Load unpacked” → select: ${installed.path}`,
`- Pin “Clawdbot Browser Relay”, then click it on the tab (badge shows ON)`,
"",
`${theme.muted("Docs:")} ${formatDocsLink("/tools/chrome-extension", "docs.clawd.bot/tools/chrome-extension")}`,
].join("\n"),
),
);
});
ext
.command("path")

View File

@@ -384,10 +384,7 @@ export function registerBrowserManageCommands(
.option("--cdp-url <url>", "CDP URL for remote Chrome (http/https)")
.option("--driver <driver>", "Profile driver (clawd|extension). Default: clawd")
.action(
async (
opts: { name: string; color?: string; cdpUrl?: string; driver?: string },
cmd,
) => {
async (opts: { name: string; color?: string; cdpUrl?: string; driver?: string }, cmd) => {
const parent = parentOpts(cmd);
const baseUrl = resolveBrowserControlUrl(parent?.url);
try {
@@ -401,9 +398,7 @@ export function registerBrowserManageCommands(
defaultRuntime.log(JSON.stringify(result, null, 2));
return;
}
const loc = result.isRemote
? ` cdpUrl: ${result.cdpUrl}`
: ` port: ${result.cdpPort}`;
const loc = result.isRemote ? ` cdpUrl: ${result.cdpUrl}` : ` port: ${result.cdpPort}`;
defaultRuntime.log(
info(
`🦞 Created profile "${result.profile}"\n${loc}\n color: ${result.color}${

View File

@@ -80,8 +80,10 @@ export function registerSecurityCli(program: Command) {
for (const action of fixResult.actions) {
const mode = action.mode.toString(8).padStart(3, "0");
if (action.ok) lines.push(muted(` chmod ${mode} ${action.path}`));
else if (action.skipped) lines.push(muted(` skip chmod ${mode} ${action.path} (${action.skipped})`));
else if (action.error) lines.push(muted(` chmod ${mode} ${action.path} failed: ${action.error}`));
else if (action.skipped)
lines.push(muted(` skip chmod ${mode} ${action.path} (${action.skipped})`));
else if (action.error)
lines.push(muted(` chmod ${mode} ${action.path} failed: ${action.error}`));
}
if (fixResult.errors.length > 0) {
for (const err of fixResult.errors) lines.push(muted(` error: ${err}`));