Add opt-in browser tools for desktop tabs
* Add opt-in browser tools for desktop tabs Adds the daemon opt-in, desktop tab routing, MCP tools, and real browser automation surfaces for Paseo desktop browser tabs. * Fix browser tools CI expectations * Address browser tools review findings * Restrict browser file automation paths * Fix browser upload test on Windows * Harden browser navigation inputs * Make browser tools create usable tabs * Update browser MCP empty-state test * Fail browser tab creation when registration times out * Fix browser screenshots for agents * Hide disabled browser tools from agents * Address browser tools architecture review * Replace browser tools review tests * Wrap browser tab registration errors * Mock Expo Router in app unit tests * Handle invalid browser automation requests * Return browser failure on desktop disconnect * Update browser disconnect websocket test * Relax browser timeout polling test * Handle invalid browser responses * Return browser failure when send fails * Remove local diagnostics and fixture paths * Fix dev service home fallback * Use worktree home for dev services * Use managed daemon in desktop dev * fix(browser): keep agent tabs addressable Track agent-active browser targets separately from human-focused tabs and keep resident webviews alive for automation. Browser tool visibility now comes from registration while the broker reports disabled execution. * refactor(browser): register tools through catalog Move browser tool registration onto the shared Paseo tool catalog so the MCP server remains only the transport adapter. * fix(settings): translate browser tools host error
This commit is contained in:
@@ -25,7 +25,7 @@ describe("assistant image metadata", () => {
|
||||
setAssistantImageMetadata(
|
||||
{
|
||||
source: "/tmp/paseo-codex-screenshot.png",
|
||||
workspaceRoot: "/Users/moboudra/dev/paseo",
|
||||
workspaceRoot: "/workspaces/paseo",
|
||||
serverId: "server-1",
|
||||
},
|
||||
{ width: 1200, height: 800 },
|
||||
|
||||
@@ -5,28 +5,28 @@ describe("buildAbsoluteExplorerPath", () => {
|
||||
it("builds a POSIX absolute path from a relative explorer path", () => {
|
||||
expect(
|
||||
buildAbsoluteExplorerPath({
|
||||
workspaceRoot: "/Users/moboudra/dev/paseo",
|
||||
workspaceRoot: "/workspaces/paseo",
|
||||
entryPath: "packages/app/src/components/file-explorer-pane.tsx",
|
||||
}),
|
||||
).toBe("/Users/moboudra/dev/paseo/packages/app/src/components/file-explorer-pane.tsx");
|
||||
).toBe("/workspaces/paseo/packages/app/src/components/file-explorer-pane.tsx");
|
||||
});
|
||||
|
||||
it("returns workspace root when entry path points to explorer root", () => {
|
||||
expect(
|
||||
buildAbsoluteExplorerPath({
|
||||
workspaceRoot: "/Users/moboudra/dev/paseo",
|
||||
workspaceRoot: "/workspaces/paseo",
|
||||
entryPath: ".",
|
||||
}),
|
||||
).toBe("/Users/moboudra/dev/paseo");
|
||||
).toBe("/workspaces/paseo");
|
||||
});
|
||||
|
||||
it("trims trailing separators from workspace root before joining", () => {
|
||||
expect(
|
||||
buildAbsoluteExplorerPath({
|
||||
workspaceRoot: "/Users/moboudra/dev/paseo/",
|
||||
workspaceRoot: "/workspaces/paseo/",
|
||||
entryPath: "README.md",
|
||||
}),
|
||||
).toBe("/Users/moboudra/dev/paseo/README.md");
|
||||
).toBe("/workspaces/paseo/README.md");
|
||||
});
|
||||
|
||||
it("builds a Windows absolute path with backslash separators", () => {
|
||||
@@ -41,7 +41,7 @@ describe("buildAbsoluteExplorerPath", () => {
|
||||
it("passes through an already-absolute entry path", () => {
|
||||
expect(
|
||||
buildAbsoluteExplorerPath({
|
||||
workspaceRoot: "/Users/moboudra/dev/paseo",
|
||||
workspaceRoot: "/workspaces/paseo",
|
||||
entryPath: "/tmp/another/location.txt",
|
||||
}),
|
||||
).toBe("/tmp/another/location.txt");
|
||||
|
||||
@@ -45,8 +45,8 @@ describe("workspace route parsing", () => {
|
||||
});
|
||||
|
||||
it("decodes non-canonical base64url workspace IDs used by older links", () => {
|
||||
expect(decodeWorkspaceIdFromPathSegment("L1VzZXJzL21vYm91ZHJhL2Rldi9wYXNlby")).toBe(
|
||||
"/Users/moboudra/dev/paseo",
|
||||
expect(decodeWorkspaceIdFromPathSegment("L2hvbWUvdXNlci9kZXYvcGFzZW8")).toBe(
|
||||
"/home/user/dev/paseo",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ export class DaemonConnectionTestError extends Error {
|
||||
export async function buildClientConfig(
|
||||
connection: HostConnection,
|
||||
serverId?: string,
|
||||
options?: { capabilities?: DaemonClientConfig["capabilities"] },
|
||||
deps: Pick<
|
||||
DaemonConnectionDependencies<DaemonProbeClient>,
|
||||
"getClientId" | "resolveAppVersion" | "createLocalTransportFactory" | "buildLocalTransportUrl"
|
||||
@@ -110,6 +111,7 @@ export async function buildClientConfig(
|
||||
appVersion: deps.resolveAppVersion() ?? undefined,
|
||||
suppressSendErrors: true,
|
||||
reconnect: { enabled: false },
|
||||
...(options?.capabilities ? { capabilities: options.capabilities } : {}),
|
||||
...((connection.type === "directSocket" || connection.type === "directPipe") &&
|
||||
localTransportFactory
|
||||
? { transportFactory: localTransportFactory }
|
||||
@@ -221,6 +223,7 @@ export function connectAndProbe(
|
||||
interface ProbeOptions {
|
||||
serverId?: string;
|
||||
timeoutMs?: number;
|
||||
capabilities?: DaemonClientConfig["capabilities"];
|
||||
}
|
||||
|
||||
function resolveTimeout(connection: HostConnection, options?: ProbeOptions): number {
|
||||
@@ -242,6 +245,6 @@ export async function connectToDaemon(
|
||||
options?: ProbeOptions,
|
||||
deps: DaemonConnectionDependencies<DaemonProbeClient> = defaultDaemonConnectionDependencies,
|
||||
): Promise<{ client: DaemonProbeClient; serverId: string; hostname: string | null }> {
|
||||
const config = await buildClientConfig(connection, options?.serverId, deps);
|
||||
const config = await buildClientConfig(connection, options?.serverId, options, deps);
|
||||
return connectAndProbe(config, resolveTimeout(connection, options), deps);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user