Merge pull request #17: Browser view — find every Playwright, set one up in two clicks, bake the runtime libraries
Build App / compute-version (push) Successful in 6s
Build Container / build-container (push) Successful in 1m18s
Build App / build-macos (push) Successful in 2m36s
Build App / build-windows (push) Successful in 5m25s
Build App / build-linux (push) Successful in 5m19s
Build App / create-tag (push) Successful in 4s
Build App / sync-to-github (push) Successful in 10s
Build App / compute-version (push) Successful in 6s
Build Container / build-container (push) Successful in 1m18s
Build App / build-macos (push) Successful in 2m36s
Build App / build-windows (push) Successful in 5m25s
Build App / build-linux (push) Successful in 5m19s
Build App / create-tag (push) Successful in 4s
Build App / sync-to-github (push) Successful in 10s
This commit was merged in pull request #17.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import type { Project, ProjectPath, ContainerInfo, SiblingContainer, AppSettings, UpdateInfo, ImageUpdateInfo, FileEntry, WebTerminalInfo, SttStatus, GatewayStatus, InstallOptions, ClaudeSession, ContainerCapabilities, ScheduledTask, ScheduledTaskInput, SchedulerNotification, AuthBridgeStatus, BrowserViewStatus, PlaywrightDetection, ContainerStaleness, MigrationOptions, MigrationReport, MigrationState, ClearTokenOutcome } from "./types";
|
||||
import type { Project, ProjectPath, ContainerInfo, SiblingContainer, AppSettings, UpdateInfo, ImageUpdateInfo, FileEntry, WebTerminalInfo, SttStatus, GatewayStatus, InstallOptions, ClaudeSession, ContainerCapabilities, ScheduledTask, ScheduledTaskInput, SchedulerNotification, AuthBridgeStatus, BrowserViewStatus, PlaywrightDetection, BrowserSetupOutcome, BrowserInstallTarget, ContainerStaleness, MigrationOptions, MigrationReport, MigrationState, ClearTokenOutcome } from "./types";
|
||||
|
||||
// Docker
|
||||
export const checkDocker = () => invoke<boolean>("check_docker");
|
||||
@@ -178,6 +178,24 @@ export const getBrowserViewStatus = (projectId: string) =>
|
||||
/** Probe for Playwright without starting anything — used to re-check after installing it. */
|
||||
export const checkBrowserViewSupport = (projectId: string) =>
|
||||
invoke<PlaywrightDetection>("check_browser_view_support", { projectId });
|
||||
/**
|
||||
* Install `playwright` + `@playwright/cli` into the container's `/workspace`.
|
||||
*
|
||||
* A container mutation, so it only ever runs from an explicit click. Progress
|
||||
* streams on the existing `container-progress` event; the result carries a
|
||||
* fresh probe. Browsers are a separate action — see below.
|
||||
*/
|
||||
export const installBrowserViewSupport = (projectId: string) =>
|
||||
invoke<BrowserSetupOutcome>("install_browser_view_support", { projectId });
|
||||
/**
|
||||
* Install a browser and the apt libraries it needs, then verify it launches.
|
||||
* `chromium` is Playwright's own build; `chrome` is the channel
|
||||
* `@playwright/mcp` asks for. Hundreds of MB — never call this implicitly.
|
||||
*/
|
||||
export const installBrowserViewBrowser = (
|
||||
projectId: string,
|
||||
browser: BrowserInstallTarget,
|
||||
) => invoke<BrowserSetupOutcome>("install_browser_view_browser", { projectId, browser });
|
||||
|
||||
// Shared Claude Code auth token — one `claude setup-token` run authenticates
|
||||
// every Anthropic-backend project. The token itself is never exposed here: it
|
||||
|
||||
+27
-1
@@ -434,14 +434,40 @@ export interface PlaywrightDetection {
|
||||
node_version: string | null;
|
||||
playwright_version: string | null;
|
||||
playwright_path: string | null;
|
||||
/** Playwright's own `cli.js`, which installs browsers and their apt libraries. */
|
||||
playwright_cli: string | null;
|
||||
/** Whether the resolved Playwright declares the `browser.bind()` live-dashboard API. */
|
||||
has_bind: boolean;
|
||||
cli_version: string | null;
|
||||
cli_entry: string | null;
|
||||
/** Module roots the probe searched, echoed back for the "not found" message. */
|
||||
/** Browser bundles in `~/.cache/ms-playwright`, e.g. `chromium-1200`. Never `ffmpeg-*`. */
|
||||
browsers: string[];
|
||||
/** Path to Google Chrome when the `chrome` channel — what `@playwright/mcp`
|
||||
* asks for — is installed. It is an apt package, so it is never in `browsers`. */
|
||||
chrome_channel: string | null;
|
||||
/** Module roots the probe searched, echoed back for the "not found" message.
|
||||
* Includes the npx cache (`~/.npm/_npx/*/node_modules`), which is where a
|
||||
* Playwright installed through Claude Code's MCP setup actually lives. */
|
||||
searched: string[];
|
||||
}
|
||||
|
||||
/** Result of an install action. Mirrors Rust `BrowserSetupOutcome`. */
|
||||
export interface BrowserSetupOutcome {
|
||||
/** Fresh probe taken after the install, so the pane can update itself. */
|
||||
detection: PlaywrightDetection;
|
||||
/** Tail of the real npm/apt/Playwright output — shown instead of a generic message. */
|
||||
log: string;
|
||||
/** Whether a browser was actually started and closed. `null` when the step
|
||||
* didn't try (the package step doesn't). */
|
||||
browser_launched: boolean | null;
|
||||
/** Something that didn't fail the action but the user still needs to know. */
|
||||
warning: string | null;
|
||||
}
|
||||
|
||||
/** Browsers the pane can install. `chromium` is Playwright's own build;
|
||||
* `chrome` is the Google Chrome channel `@playwright/mcp` asks for. */
|
||||
export type BrowserInstallTarget = "chromium" | "chrome";
|
||||
|
||||
/** Mirrors Rust `BrowserViewState` (serde snake_case). */
|
||||
export type BrowserViewState = "off" | "running" | "unavailable";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user