Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

feat(apps): the Mac and Windows apps add the extension from each browser's store — one row per browser with its store, its version and whether it is connected, a button that opens the store page in that browser and shows the code to enter, the unpacked folder behind "Load it unpacked instead" and asked for ↻ only there; entry no longer waits on an unpacked folder, installing the Bridge registers it with every browser, Firefox is detected, and the apps call the computer half Browsentic Bridge

Shahriarcfb88b6eba6b
diff --git a/src/daemon/browsers.ts b/src/daemon/browsers.ts
index 9ee6014..b33e1b0 100644
--- a/src/daemon/browsers.ts
+++ b/src/daemon/browsers.ts
@@ -8,7 +8,8 @@ import { execFileSync, spawn } from 'node:child_process';
import { existsSync } from 'node:fs';
import { homedir } from 'node:os';
import { posix } from 'node:path';
-import { CHROME_WEB_STORE, EDGE_ADD_ONS, type Source } from '@/lib/stores';
+import { CHROME_WEB_STORE, EDGE_ADD_ONS, SOURCE_LABEL, type Source } from '@/lib/stores';
+import type { SessionSummary } from './control';
import { signedAddonUrl } from './firefox-addon';
export const BROWSER_IDS = ['chrome', 'edge', 'brave', 'arc', 'vivaldi', 'opera', 'chromium', 'firefox'] as const;
@@ -128,6 +129,38 @@ export function storeSteps(id: BrowserId): string[] {
return [`Press “${BROWSERS[id].button}”.`];
}
+/** One browser as setup, `browsentic browsers` and the apps show it. */
+export interface BrowserRow {
+ id: BrowserId;
+ label: string;
+ installed: boolean;
+ source: Source;
+ store: string;
+ storeUrl: string;
+ steps: string[];
+ extensionsPage: string;
+ connected: boolean;
+ sessions: Pick<SessionSummary, 'id' | 'source' | 'extensionVersion' | 'connected'>[];
+}
+
+export function browserRows(sessions: SessionSummary[], located: Located[], version: string): BrowserRow[] {
+ return BROWSER_IDS.map((id) => {
+ const own = sessions.filter((session) => browserOf(session.browser) === id);
+ return {
+ id,
+ label: BROWSERS[id].label,
+ installed: located.some((found) => found.id === id),
+ source: sourceFor(id),
+ store: SOURCE_LABEL[sourceFor(id)],
+ storeUrl: storeUrl(id, version),
+ steps: storeSteps(id),
+ extensionsPage: BROWSERS[id].extensionsPage,
+ connected: own.some((session) => session.connected),
+ sessions: own.map(({ id, source, extensionVersion, connected }) => ({ id, source, extensionVersion, connected })),
+ };
+ });
+}
+
/** Which browser a connected extension is in, from the brand it reported. */
export function browserOf(brand: string | undefined): BrowserId | undefined {
return brand ? BROWSER_IDS.find((id) => BROWSERS[id].brand.test(brand)) : undefined;
diff --git a/src/daemon/cli.ts b/src/daemon/cli.ts
index b1070a4..afbcedf 100644
--- a/src/daemon/cli.ts
+++ b/src/daemon/cli.ts
@@ -3,7 +3,7 @@ import { createInterface } from 'node:readline/promises';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { describeActions } from '@/lib/actions/registry';
import { AGENTS, AGENT_KINDS, AGENT_LIST, isAgentKind, type AgentKind, type AgentState, type ModelList } from '@/lib/agents/catalog';
-import { SOURCE_LABEL, type Source } from '@/lib/stores';
+import { SOURCE_LABEL } from '@/lib/stores';
import { RESERVED_ACTIONS } from '@/lib/actions/reserved';
import { assertToolNamesRoundTrip, toolNameFor } from '@/lib/actions/tool-names';
import { formatWhen } from '@/lib/format-when';
@@ -14,14 +14,12 @@ import {
BROWSER_IDS,
BROWSERS,
browserOf,
+ browserRows,
isBrowserId,
locateBrowsers,
openPage,
- sourceFor,
- storeSteps,
- storeUrl,
type BrowserId,
- type Located,
+ type BrowserRow,
} from './browsers';
import type { SessionSummary } from './control';
import { forgetGrants, listGrants } from './agent/approvals';
@@ -341,7 +339,7 @@ async function showBrowsers(): Promise<void> {
sessions = await bridge.sessions();
await bridge.close();
}
- const rows = browserRows(sessions, locateBrowsers());
+ const rows = browserRows(sessions, locateBrowsers(), pkg.version);
if (wantsJson) {
const dir = extensionDir(readAgentConfig().extensionDir);
console.log(JSON.stringify({ running: !!lock, browsers: rows, unpacked: { dir, version: readStamp(dir)?.version ?? null } }, null, 2));
@@ -419,37 +417,6 @@ function groupCode(code: string): string {
return `${code.slice(0, 4)}-${code.slice(4)}`;
}
-interface BrowserRow {
- id: BrowserId;
- label: string;
- installed: boolean;
- source: Source;
- store: string;
- storeUrl: string;
- steps: string[];
- extensionsPage: string;
- connected: boolean;
- sessions: Pick<SessionSummary, 'id' | 'source' | 'extensionVersion' | 'connected'>[];
-}
-
-function browserRows(sessions: SessionSummary[], located: Located[]): BrowserRow[] {
- return BROWSER_IDS.map((id) => {
- const own = sessions.filter((session) => browserOf(session.browser) === id);
- return {
- id,
- label: BROWSERS[id].label,
- installed: located.some((found) => found.id === id),
- source: sourceFor(id),
- store: SOURCE_LABEL[sourceFor(id)],
- storeUrl: storeUrl(id, pkg.version),
- steps: storeSteps(id),
- extensionsPage: BROWSERS[id].extensionsPage,
- connected: own.some((session) => session.connected),
- sessions: own.map(({ id, source, extensionVersion, connected }) => ({ id, source, extensionVersion, connected })),
- };
- });
-}
-
/** What setup was asked to put where. No browser at all means print the plan and stop. */
interface Choice {
/** Absent for "another browser", which is only ever loaded unpacked. */
@@ -502,7 +469,7 @@ async function setup(argv: string[]): Promise<void> {
const since = new Date().toISOString();
const located = locateBrowsers();
const sessions = await bridge.sessions();
- const rows = browserRows(sessions, located);
+ const rows = browserRows(sessions, located, pkg.version);
if (!json) {
console.log(`\n Browsentic ${pkg.version} — your browser's superpower\n`);
diff --git a/src/mac/Packaging/Info.plist b/src/mac/Packaging/Info.plist
index 14b62a3..e2bd751 100644
--- a/src/mac/Packaging/Info.plist
+++ b/src/mac/Packaging/Info.plist
@@ -33,6 +33,6 @@
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2026 Shahriar. Apache License 2.0.</string>
<key>NSAppleEventsUsageDescription</key>
- <string>Browsentic opens chrome://extensions in your browser so you can load the extension. Browsers refuse that address any other way.</string>
+ <string>Browsentic opens chrome://extensions in your browser when you load the extension unpacked. Browsers refuse that address any other way.</string>
</dict>
</plist>
diff --git a/src/mac/Packaging/dmg-readme.txt b/src/mac/Packaging/dmg-readme.txt
index ab2372d..fef93f2 100644
--- a/src/mac/Packaging/dmg-readme.txt
+++ b/src/mac/Packaging/dmg-readme.txt
@@ -2,14 +2,15 @@ Browsentic for macOS
Drag Browsentic onto the Applications folder, then open it.
-The app checks what your Mac already has, installs what is missing with one click, and
-puts the browsentic command, the daemon and the browser extension where they belong:
+This app is Browsentic Bridge, the half of Browsentic that runs on your Mac. It checks
+what your Mac already has, installs what is missing with one click, and keeps it all in
- ~/.browsentic the command, the daemon, pairing keys, config and logs
- ~/browsentic/extension the unpacked extension your browser loads
+ ~/.browsentic the command, pairing keys, config and logs
-The extension sits outside the dotfolder on purpose. Chrome's "Load unpacked" picker
-hides dotfolders, and a browser's pairing is tied to the extension's path.
+The other half is the extension in your browser. The app's Overview tab opens its store
+page in the browser you pick: the Chrome Web Store for Chrome, Brave, Arc, Vivaldi,
+Opera and Edge, or the signed add-on for Firefox. Click Browsentic in the toolbar and
+enter the pairing code the app shows, once.
If macOS says it "could not verify Browsentic is free of malware", this build was
not notarized by Apple. Press Done, open System Settings > Privacy & Security,
@@ -17,4 +18,4 @@ scroll down to the Browsentic line and press Open Anyway. Or run this once:
xattr -dr com.apple.quarantine /Applications/Browsentic.app
-Free and open source, Apache 2.0. https://browsentic.com
+Free and open source, Apache 2.0. No API key, no account. https://browsentic.com
diff --git a/src/mac/Sources/Browsentic/App/AppModel.swift b/src/mac/Sources/Browsentic/App/AppModel.swift
index ea833bb..c8d35e9 100644
--- a/src/mac/Sources/Browsentic/App/AppModel.swift
+++ b/src/mac/Sources/Browsentic/App/AppModel.swift
@@ -63,6 +63,8 @@ final class AppModel: ObservableObject {
@Published var downloads: DownloadListing?
@Published var stamp: InstallStamp?
@Published var browsers: [Browser] = []
+ /// Every browser `browsentic browsers` knows, where it gets the extension, and the copies it runs.
+ @Published var browserRows: [BrowserRow] = []
@Published var logText = ""
@Published var commandDir: String?
@Published var foreignCommand: String?
@@ -80,9 +82,16 @@ final class AppModel: ObservableObject {
var cli: CLI? { node.map(CLI.init) }
var appVersion: String { Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? Payload.bundledVersion ?? "dev" }
+ /// Only an unpacked copy waits for ↻: a store copy updates when its browser says.
var extensionNeedsReload: Bool {
- guard let stamp, let loaded = status?.extensionVersion, status?.connected == true else { return false }
- return loaded != stamp.version
+ guard let stamp else { return false }
+ return sessions.contains { $0.connected && $0.source == "unpacked" && $0.extensionVersion != stamp.version }
+ }
+
+ /// The browsers worth a row: found on this Mac or already paired, else the usual few to try.
+ var offeredBrowsers: [BrowserRow] {
+ let found = browserRows.filter { $0.installed || !$0.sessions.isEmpty }
+ return found.isEmpty ? browserRows.filter { ["chrome", "edge", "brave", "firefox"].contains($0.id) } : found
}
// MARK: Preflight
@@ -119,7 +128,7 @@ final class AppModel: ObservableObject {
return .passed(About.system)
case .node:
node = await NodeRuntime.locate()
- guard let node else { return .missing("Version \(NodeRuntime.minimumMajor) or newer runs the daemon. A private copy goes in \(Paths.tilde(Paths.runtime)).") }
+ guard let node else { return .missing("Version \(NodeRuntime.minimumMajor) or newer runs Browsentic Bridge. A private copy goes in \(Paths.tilde(Paths.runtime)).") }
return .passed("\(node.version) · \(node.isPrivate ? "private copy" : Paths.tilde(URL(fileURLWithPath: node.path)))")
case .command:
guard let bundled = Payload.bundledVersion else { return .failed(PayloadError.missing.localizedDescription) }
@@ -127,17 +136,11 @@ final class AppModel: ObservableObject {
if let installed = Payload.installedVersion, installed != bundled {
return .missing("v\(installed) is installed; this app carries v\(bundled).")
}
- return .missing("Installs the CLI and daemon into \(Paths.tilde(Paths.cli)).")
- case .extensionFiles:
- stamp = ExtensionFiles.stamp()
- guard let bundled = Payload.bundledVersion else { return .failed(PayloadError.missing.localizedDescription) }
- guard let stamp else { return .missing("Unpacks to \(Paths.tilde(Paths.extensionDir())), where the browser loads it from.") }
- if stamp.version != bundled { return .missing("v\(stamp.version) is unpacked; this app carries v\(bundled).") }
- return .passed("v\(stamp.version) in \(Paths.tilde(Paths.extensionDir()))")
+ return .missing("Installs the command and what runs in the background into \(Paths.tilde(Paths.cli)).")
case .browser:
browsers = Browser.installed()
return browsers.isEmpty
- ? .advisory("None found. Chrome, Brave, Edge, Arc, Vivaldi or Opera all work.")
+ ? .advisory("None found. Chrome, Brave, Edge, Arc, Vivaldi, Opera or Firefox all work.")
: .passed(browsers.map(\.name).joined(separator: ", "))
case .agent:
let found = AgentProbe.installed()
@@ -153,7 +156,7 @@ final class AppModel: ObservableObject {
let defaults = UserDefaults.standard
guard defaults.bool(forKey: AppUpdater.finishKey) else { return false }
defaults.removeObject(forKey: AppUpdater.finishKey)
- return [CheckID.command, .extensionFiles].contains { checks[$0]?.isPassed != true } && checks[.node]?.isPassed == true
+ return checks[.command]?.isPassed != true && checks[.node]?.isPassed == true
}
func setUpEverything() async {
@@ -179,17 +182,15 @@ final class AppModel: ObservableObject {
}
case .command:
guard let node else { throw CLIError.failed("Node.js has to be installed first.") }
- checks[id] = .working(nil, "Copying the CLI into \(Paths.tilde(Paths.cli))")
+ checks[id] = .working(nil, "Copying Browsentic Bridge into \(Paths.tilde(Paths.cli))")
let wasRunning = FileManager.default.fileExists(atPath: Paths.lockfile.path)
try await Task.detached { try Payload.install(node: node) }.value
if wasRunning {
- checks[id] = .working(nil, "Restarting the daemon on the new build")
+ checks[id] = .working(nil, "Restarting Browsentic Bridge on the new build")
try await CLI(node: node).restart()
}
- case .extensionFiles:
- guard let cli else { throw CLIError.failed("Node.js has to be installed first.") }
- checks[id] = .working(nil, "Unpacking the extension")
- _ = try await cli.installExtension()
+ checks[id] = .working(nil, "Letting your browsers start it")
+ _ = try await CLI(node: node).registerBridge()
case .agent:
guard let node else { throw CLIError.failed("Node.js has to be installed first.") }
checks[id] = .working(nil, "npm i -g @anthropic-ai/claude-code")
@@ -216,6 +217,7 @@ final class AppModel: ObservableObject {
Task {
refreshCommandLink()
if UserDefaults.standard.object(forKey: "startDaemonOnLaunch") as? Bool ?? true, daemon == .off { await setDaemon(on: true) }
+ await loadBrowsers()
}
watchForUpdates()
}
@@ -247,6 +249,7 @@ final class AppModel: ObservableObject {
do {
let status = try await control.status()
let sessions = try await control.sessions()
+ let changed = sessions.map { "\($0.id):\($0.connected)" } != self.sessions.map { "\($0.id):\($0.connected)" }
self.lock = lock
self.status = status
self.sessions = sessions
@@ -254,6 +257,7 @@ final class AppModel: ObservableObject {
if pairing != nil, !status.pairingPending || (pairing?.expiry ?? .distantPast) < Date() { pairing = nil }
if agents == nil { await loadAgents() }
stamp = ExtensionFiles.stamp()
+ if changed { Task { await loadBrowsers() } }
} catch {
await control.close()
markOff()
@@ -396,6 +400,30 @@ final class AppModel: ObservableObject {
}
}
+ func loadBrowsers() async {
+ guard let cli, let rows = try? await cli.browsers() else { return }
+ browserRows = rows
+ }
+
+ /// Opens the browser's store page in that browser and hands out the code its popup asks for. The
+ /// command opens it where it found the browser; anywhere else, the app opens it itself.
+ func addExtension(_ row: BrowserRow) async {
+ await perform("add:\(row.id)") { cli, _ in
+ let result = try await cli.addExtension(to: row.id)
+ if result.chosen?.opened != true, let url = URL(string: row.storeUrl) { self.open(url, in: row) }
+ if let code = result.pairingCode, let expiresAt = result.expiresAt { self.pairing = PairingCode(code: code, expiresAt: expiresAt) }
+ self.say("\(row.steps.first ?? "") Then click Browsentic in \(row.label)’s toolbar and enter the code below.")
+ }
+ }
+
+ private func open(_ url: URL, in row: BrowserRow) {
+ if let app = browsers.first(where: { $0.name.localizedCaseInsensitiveContains(row.label) }) {
+ NSWorkspace.shared.open([url], withApplicationAt: app.url, configuration: NSWorkspace.OpenConfiguration())
+ } else {
+ NSWorkspace.shared.open(url)
+ }
+ }
+
func reinstallExtension() async {
await perform("extension") { cli, _ in
let result = try await cli.installExtension(force: true)
diff --git a/src/mac/Sources/Browsentic/App/BrowsenticApp.swift b/src/mac/Sources/Browsentic/App/BrowsenticApp.swift
index a6c59d1..2013e24 100644
--- a/src/mac/Sources/Browsentic/App/BrowsenticApp.swift
+++ b/src/mac/Sources/Browsentic/App/BrowsenticApp.swift
@@ -28,7 +28,7 @@ struct BrowsenticApp: App {
.disabled(model.phase != .main)
}
}
- CommandMenu("Daemon") {
+ CommandMenu("Bridge") {
Button(model.daemon == .on ? "Turn Off" : "Turn On") { Task { await model.setDaemon(on: model.daemon == .off) } }
.keyboardShortcut("d", modifiers: [.command, .shift])
.disabled(model.phase != .main || (model.daemon != .on && model.daemon != .off))
@@ -87,7 +87,7 @@ private struct MenuBarContent: View {
@Environment(\.openWindow) private var openWindow
var body: some View {
- Text("Daemon: \(model.daemon.label)\(model.status.map { " · 127.0.0.1:\($0.port)" } ?? "")")
+ Text("Browsentic Bridge: \(model.daemon.label)\(model.status.map { " · 127.0.0.1:\($0.port)" } ?? "")")
if let status = model.status {
Text(status.connected ? "Extension connected" : "Extension not connected")
}
diff --git a/src/mac/Sources/Browsentic/Core/CLI.swift b/src/mac/Sources/Browsentic/Core/CLI.swift
index 18d2fa1..7b85349 100644
--- a/src/mac/Sources/Browsentic/Core/CLI.swift
+++ b/src/mac/Sources/Browsentic/Core/CLI.swift
@@ -36,10 +36,22 @@ struct CLI {
func stop() async throws { try await run(["stop"]) }
func restart() async throws { try await run(["restart"]) }
+ /// Registers the Bridge with every browser, store copies included, and starts it. Asks nothing.
+ func registerBridge() async throws -> SetupResult {
+ try await json(["setup", "--no-pair", "--no-open", "--no-wait", "--no-self-update"], as: SetupResult.self)
+ }
+
func installExtension(force: Bool = false) async throws -> SetupResult {
- try await json(["setup", "--no-pair", "--no-self-update"] + (force ? ["--force"] : []), as: SetupResult.self)
+ try await json(["setup", "--unpacked", "--no-pair", "--no-open", "--no-wait", "--no-self-update"] + (force ? ["--force"] : []), as: SetupResult.self)
}
+ /// Opens that browser's store page in it, when the command can find it, and mints the code to enter.
+ func addExtension(to browser: String) async throws -> SetupResult {
+ try await json(["setup", "--browser", browser, "--no-wait", "--no-self-update"], as: SetupResult.self, timeout: 120)
+ }
+
+ func browsers() async throws -> [BrowserRow] { try await json(["browsers"], as: BrowserListing.self).browsers }
+
func agents() async throws -> AgentState { try await json(["agent"], as: AgentState.self) }
func setModel(_ model: String?, for kind: String) async throws { try await run(["agent", "model", kind] + (model.map { [$0] } ?? [])) }
func skills() async throws -> SkillListing { try await json(["skills"], as: SkillListing.self) }
diff --git a/src/mac/Sources/Browsentic/Core/ControlClient.swift b/src/mac/Sources/Browsentic/Core/ControlClient.swift
index 6f16295..7b5b69d 100644
--- a/src/mac/Sources/Browsentic/Core/ControlClient.swift
+++ b/src/mac/Sources/Browsentic/Core/ControlClient.swift
@@ -7,9 +7,9 @@ enum ControlError: LocalizedError {
var errorDescription: String? {
switch self {
- case .offline: "The daemon is not running — turn it on from the Overview tab."
- case .timeout: "The daemon did not answer in time — restart it from the Overview tab."
- case .malformed: "The daemon answered with something this app cannot read — update the app."
+ case .offline: "Browsentic Bridge is not running — turn it on from the Overview tab."
+ case .timeout: "Browsentic Bridge did not answer in time — restart it from the Overview tab."
+ case .malformed: "Browsentic Bridge answered with something this app cannot read — update the app."
}
}
}
diff --git a/src/mac/Sources/Browsentic/Core/Models.swift b/src/mac/Sources/Browsentic/Core/Models.swift
index f0412a3..679361a 100644
--- a/src/mac/Sources/Browsentic/Core/Models.swift
+++ b/src/mac/Sources/Browsentic/Core/Models.swift
@@ -23,6 +23,8 @@ struct BrowserSession: Decodable, Identifiable, Equatable {
let sessionId: String?
let browser: String?
let origin: String
+ /// Where its extension came from; absent from a daemon before 0.8, which knew only the unpacked copy.
+ let source: String?
let extensionVersion: String
let pairedAt: String
let lastSeenAt: String
@@ -30,7 +32,7 @@ struct BrowserSession: Decodable, Identifiable, Equatable {
enum CodingKeys: String, CodingKey {
case sessionId = "id"
- case browser, origin, extensionVersion, pairedAt, lastSeenAt, connected
+ case browser, origin, source, extensionVersion, pairedAt, lastSeenAt, connected
}
var id: String { sessionId ?? origin }
@@ -213,11 +215,52 @@ struct DownloadListing: Decodable, Equatable {
struct SetupResult: Decodable {
struct Daemon: Decodable { let port: Int; let pid: Int }
+ struct Chosen: Decodable { let id: String; let opened: Bool; let connected: Bool }
let version: String
- let extensionDir: String
+ /// Set only when the unpacked folder was written or was already there.
+ let extensionDir: String?
let daemon: Daemon
let alreadyPaired: Bool
+ let chosen: Chosen?
let pairingCode: String?
+ let expiresAt: Double?
+}
+
+/// One browser as `browsentic browsers --json` describes it: where it gets the extension, and the copies it runs.
+struct BrowserRow: Decodable, Identifiable, Equatable {
+ struct Copy: Decodable, Equatable {
+ let id: String
+ let source: String?
+ let extensionVersion: String
+ let connected: Bool
+ }
+
+ let id: String
+ let label: String
+ let installed: Bool
+ let source: String
+ let store: String
+ let storeUrl: String
+ let steps: [String]
+ let extensionsPage: String
+ let connected: Bool
+ let sessions: [Copy]
+
+ var copy: Copy? { sessions.first(where: \.connected) ?? sessions.first }
+ var addTitle: String { id == "firefox" ? "Get the Firefox add-on" : "Add to \(label)" }
+}
+
+struct BrowserListing: Decodable { let browsers: [BrowserRow] }
+
+enum SourceLabel {
+ static func of(_ source: String?) -> String {
+ switch source {
+ case "chrome-web-store": "Chrome Web Store"
+ case "edge-add-ons": "Edge Add-ons"
+ case "firefox": "Firefox add-on"
+ default: "unpacked"
+ }
+ }
}
struct InstallStamp: Decodable, Equatable {
diff --git a/src/mac/Sources/Browsentic/Core/Preflight.swift b/src/mac/Sources/Browsentic/Core/Preflight.swift
index 6ebc78c..bbc4311 100644
--- a/src/mac/Sources/Browsentic/Core/Preflight.swift
+++ b/src/mac/Sources/Browsentic/Core/Preflight.swift
@@ -2,7 +2,7 @@ import AppKit
import Foundation
enum CheckID: String, CaseIterable, Identifiable {
- case system, node, command, extensionFiles, browser, agent
+ case system, node, command, browser, agent
var id: String { rawValue }
@@ -10,9 +10,8 @@ enum CheckID: String, CaseIterable, Identifiable {
switch self {
case .system: "This Mac"
case .node: "Node.js runtime"
- case .command: "Browsentic command"
- case .extensionFiles: "Browser extension"
- case .browser: "A Chromium browser"
+ case .command: "Browsentic Bridge"
+ case .browser: "A browser"
case .agent: "An AI agent"
}
}
@@ -22,14 +21,13 @@ enum CheckID: String, CaseIterable, Identifiable {
case .system: "laptopcomputer"
case .node: "hexagon"
case .command: "terminal"
- case .extensionFiles: "puzzlepiece.extension"
case .browser: "globe"
case .agent: "sparkles"
}
}
- /// What "Set up everything" installs on its own. A browser and an agent are the user's pick.
- var installsAutomatically: Bool { self == .node || self == .command || self == .extensionFiles }
+ /// What "Set up everything" installs on its own. A browser, the extension and an agent are the user's pick.
+ var installsAutomatically: Bool { self == .node || self == .command }
var blocksEntry: Bool { installsAutomatically }
}
@@ -66,8 +64,12 @@ struct Browser: Identifiable, Equatable {
("Vivaldi", "com.vivaldi.Vivaldi"),
("Opera", "com.operasoftware.Opera"),
("Chromium", "org.chromium.Chromium"),
+ ("Firefox", "org.mozilla.firefox"),
]
+ /// Firefox has no chrome://extensions page and cannot load an unpacked Chromium build.
+ var isChromium: Bool { bundleId != "org.mozilla.firefox" }
+
static func installed() -> [Browser] {
known.compactMap { name, bundleId in
NSWorkspace.shared.urlForApplication(withBundleIdentifier: bundleId).map { Browser(name: name, bundleId: bundleId, url: $0) }
diff --git a/src/mac/Sources/Browsentic/Views/AboutView.swift b/src/mac/Sources/Browsentic/Views/AboutView.swift
index 750015d..ba56537 100644
--- a/src/mac/Sources/Browsentic/Views/AboutView.swift
+++ b/src/mac/Sources/Browsentic/Views/AboutView.swift
@@ -10,7 +10,7 @@ struct AboutView: View {
let rows: [About.Row?] = [
About.Row(label: "App", value: model.appVersion),
About.Row(label: "Command", value: Payload.installedVersion ?? "not installed"),
- About.Row(label: "Daemon", value: daemonVersion.map { [$0, status.map { "port \($0.port)" }].compactMap { $0 }.joined(separator: " · ") } ?? "off"),
+ About.Row(label: "Bridge", value: daemonVersion.map { [$0, status.map { "port \($0.port)" }].compactMap { $0 }.joined(separator: " · ") } ?? "off"),
status.map { About.Row(label: "Protocol", value: String($0.protocolVersion)) },
About.Row(label: "Extension", value: [model.stamp.map { "\($0.version) unpacked" }, loaded ?? "not connected"].compactMap { $0 }.joined(separator: " · ")),
About.agent(model.agents).map { About.Row(label: "Agent", value: $0) },
diff --git a/src/mac/Sources/Browsentic/Views/ActivityView.swift b/src/mac/Sources/Browsentic/Views/ActivityView.swift
index efc7c26..8f9d981 100644
--- a/src/mac/Sources/Browsentic/Views/ActivityView.swift
+++ b/src/mac/Sources/Browsentic/Views/ActivityView.swift
@@ -43,7 +43,7 @@ struct ActivityView: View {
Card {
VStack(alignment: .leading, spacing: 12) {
HStack {
- SectionTitle(title: "Captured downloads", subtitle: "Files an agent pulled off a page. The daemon sweeps them after two weeks.")
+ SectionTitle(title: "Captured downloads", subtitle: "Files an agent pulled off a page. Browsentic Bridge sweeps them after two weeks.")
Spacer()
if let downloads = model.downloads, !downloads.downloads.isEmpty {
Button("Delete all") { confirmingDownloads = true }.buttonStyle(QuietButtonStyle(tint: Palette.danger))
diff --git a/src/mac/Sources/Browsentic/Views/BrowserSettings.swift b/src/mac/Sources/Browsentic/Views/BrowserSettings.swift
index e47c773..35b8f1a 100644
--- a/src/mac/Sources/Browsentic/Views/BrowserSettings.swift
+++ b/src/mac/Sources/Browsentic/Views/BrowserSettings.swift
@@ -27,7 +27,7 @@ private struct StaleDaemonHint: View {
HStack(spacing: 14) {
Image(systemName: "arrow.clockwise.circle").font(.system(size: 18, weight: .semibold)).foregroundStyle(Palette.amber)
SectionTitle(
- title: "The daemon predates this app",
+ title: "Browsentic Bridge predates this app",
subtitle: "It is still running from before the last update, so it cannot share the browser theme or the guardrails yet."
)
Spacer()
diff --git a/src/mac/Sources/Browsentic/Views/BrowsersView.swift b/src/mac/Sources/Browsentic/Views/BrowsersView.swift
index 1d1c64c..a9a3a5d 100644
--- a/src/mac/Sources/Browsentic/Views/BrowsersView.swift
+++ b/src/mac/Sources/Browsentic/Views/BrowsersView.swift
@@ -20,7 +20,7 @@ struct BrowsersView: View {
}
}
if model.sessions.isEmpty {
- EmptyState(icon: "globe", title: "No browser is paired", detail: "Get a pairing code above and paste it into the Browsentic popup.")
+ EmptyState(icon: "globe", title: "No browser is paired", detail: "Add the extension from the Overview tab, or get a code above and enter it in the Browsentic popup.")
} else {
ForEach(model.sessions) { SessionRow(session: $0) }
}
@@ -46,7 +46,7 @@ private struct SessionRow: View {
Text(browser).font(.system(size: 13, weight: .medium)).foregroundStyle(Palette.ink)
}
Text(session.extensionId).font(.code(12)).foregroundStyle(session.browser == nil ? Palette.ink : Palette.inkDim).textSelection(.enabled)
- Text("Extension v\(session.extensionVersion) · paired \(Timestamp.ago(session.pairedAt)) · seen \(Timestamp.ago(session.lastSeenAt))")
+ Text("\(SourceLabel.of(session.source)) · v\(session.extensionVersion) · paired \(Timestamp.ago(session.pairedAt)) · seen \(Timestamp.ago(session.lastSeenAt))")
.font(.system(size: 11.5))
.foregroundStyle(Palette.inkDim)
}
diff --git a/src/mac/Sources/Browsentic/Views/LogsView.swift b/src/mac/Sources/Browsentic/Views/LogsView.swift
index 2ecdcd5..af31884 100644
--- a/src/mac/Sources/Browsentic/Views/LogsView.swift
+++ b/src/mac/Sources/Browsentic/Views/LogsView.swift
@@ -8,7 +8,7 @@ struct LogsView: View {
Card(padding: 0) {
VStack(spacing: 0) {
HStack(spacing: 8) {
- SectionTitle(title: "Daemon log", subtitle: Paths.tilde(Paths.log))
+ SectionTitle(title: "Browsentic Bridge log", subtitle: Paths.tilde(Paths.log))
Spacer()
Toggle("Follow", isOn: $following).toggleStyle(.switch).controlSize(.small).tint(Palette.brand)
.font(.system(size: 12)).foregroundStyle(Palette.inkDim)
diff --git a/src/mac/Sources/Browsentic/Views/MainView.swift b/src/mac/Sources/Browsentic/Views/MainView.swift
index 5095c7e..8973902 100644
--- a/src/mac/Sources/Browsentic/Views/MainView.swift
+++ b/src/mac/Sources/Browsentic/Views/MainView.swift
@@ -101,8 +101,8 @@ struct OfflineHint: View {
HStack(spacing: 14) {
Image(systemName: "power").font(.system(size: 18, weight: .semibold)).foregroundStyle(Palette.amber)
VStack(alignment: .leading, spacing: 3) {
- Text("The daemon is off").font(.display(14)).foregroundStyle(Palette.ink)
- Text("\(what) come from the running daemon.").font(.system(size: 12)).foregroundStyle(Palette.inkDim)
+ Text("Browsentic Bridge is off").font(.display(14)).foregroundStyle(Palette.ink)
+ Text("\(what) come from Browsentic Bridge while it runs.").font(.system(size: 12)).foregroundStyle(Palette.inkDim)
}
Spacer()
Button("Turn it on") { Task { await model.setDaemon(on: true) } }
diff --git a/src/mac/Sources/Browsentic/Views/OverviewView.swift b/src/mac/Sources/Browsentic/Views/OverviewView.swift
index ec57c58..36e3c89 100644
--- a/src/mac/Sources/Browsentic/Views/OverviewView.swift
+++ b/src/mac/Sources/Browsentic/Views/OverviewView.swift
@@ -37,23 +37,23 @@ struct OverviewView: View {
if let status = model.status, let lock = model.lock {
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: 4), spacing: 12) {
Stat(label: "Address", value: "127.0.0.1:\(status.port)", icon: "network")
- Stat(label: "Daemon", value: "v\(status.daemonVersion)", detail: "pid \(lock.pid)", icon: "cpu")
+ Stat(label: "Bridge", value: "v\(status.daemonVersion)", detail: "pid \(lock.pid)", icon: "cpu")
Stat(
label: "Extension", value: status.connected ? "Connected" : "Not connected",
detail: status.extensionVersion.map { "v\($0)" }, icon: "puzzlepiece.extension",
tint: status.connected ? Palette.lime : Palette.amber
)
Stat(
- label: "Tools", value: status.manifestInSync ? "In sync" : "Drifted",
- detail: status.manifestInSync ? nil : "reload the extension", icon: "wrench.and.screwdriver",
- tint: status.manifestInSync ? Palette.lime : Palette.amber
+ label: "Tools", value: status.manifestInSync ? "In sync" : "The extension’s",
+ detail: status.manifestInSync ? nil : "versions differ, which is fine", icon: "wrench.and.screwdriver",
+ tint: status.manifestInSync ? Palette.lime : Palette.brand
)
}
.transition(.opacity)
}
- if model.daemon == .on, model.status?.pairedBrowsers == 0 || model.pairing != nil { ConnectCard() }
ExtensionCard()
+ if model.daemon == .on, model.status?.pairedBrowsers == 0 || model.pairing != nil { ConnectCard() }
if model.update == nil { UpdateCard() }
}
.animation(.spring(duration: 0.45), value: model.daemon)
@@ -73,7 +73,7 @@ struct OverviewView: View {
switch model.daemon {
case .on: model.status?.connected == true ? "Your browser is in the loop" : "Waiting for your browser"
case .off: "Browsentic is off"
- case .starting: "Bringing the daemon up"
+ case .starting: "Starting Browsentic Bridge"
case .stopping: "Shutting down"
}
}
@@ -82,8 +82,8 @@ struct OverviewView: View {
switch model.daemon {
case .on:
model.status?.connected == true
- ? "Open the side panel in your browser and say what you want. This window can close — the daemon keeps running."
- : "The daemon is listening. Load the extension and pair it, and the side panel comes alive."
+ ? "Open the side panel in your browser and say what you want. This window can close — Browsentic Bridge keeps running."
+ : "Browsentic Bridge is running. Add the extension to your browser below and pair it once, and the side panel comes alive."
case .off: "Turn it on and the side panel in your browser can reach the agent you already run."
case .starting, .stopping: "One moment."
}
@@ -141,8 +141,8 @@ private struct PowerOrb: View {
withAnimation(.linear(duration: 6).repeatForever(autoreverses: false)) { spin = true }
withAnimation(.easeInOut(duration: 2.2).repeatForever(autoreverses: true)) { breathe = true }
}
- .help(on ? "Turn the daemon off" : "Turn the daemon on")
- .accessibilityLabel(on ? "Turn the daemon off" : "Turn the daemon on")
+ .help(on ? "Turn Browsentic Bridge off" : "Turn Browsentic Bridge on")
+ .accessibilityLabel(on ? "Turn Browsentic Bridge off" : "Turn Browsentic Bridge on")
}
}
@@ -177,7 +177,7 @@ struct ConnectCard: View {
VStack(alignment: .leading, spacing: 16) {
SectionTitle(
title: "Pair a browser",
- subtitle: "Open the Browsentic popup in your browser, paste the code, and press Connect. It works once and expires in ten minutes."
+ subtitle: "Click Browsentic in your browser’s toolbar (the puzzle piece lists it), enter the code, and press Connect. It works once and expires in ten minutes."
)
if let pairing = model.pairing {
PairingCodeView(pairing: pairing)
@@ -229,47 +229,105 @@ struct PairingCodeView: View {
struct ExtensionCard: View {
@EnvironmentObject private var model: AppModel
+ @State private var showUnpacked: Bool?
var body: some View {
Card {
VStack(alignment: .leading, spacing: 14) {
- HStack {
- SectionTitle(title: "The extension", subtitle: subtitle)
- Spacer()
- if let stamp = model.stamp { Pill(text: "v\(stamp.version) unpacked", tint: Palette.brand) }
- if model.extensionNeedsReload { Pill(text: "Reload needed", tint: Palette.amber, icon: "arrow.clockwise") }
- }
- PathRow(url: Paths.extensionDir())
- if model.status?.connected != true {
- VStack(alignment: .leading, spacing: 8) {
- Step(number: 1, text: "Open chrome://extensions and turn on Developer mode.")
- Step(number: 2, text: "Press “Load unpacked”, then ⇧⌘G, and paste the path above.")
- Step(number: 3, text: "Open the Browsentic popup and paste a pairing code.")
- }
+ SectionTitle(title: "The extension", subtitle: subtitle)
+ VStack(spacing: 8) {
+ ForEach(model.offeredBrowsers) { BrowserExtensionRow(row: $0) }
}
- HStack(spacing: 8) {
- ForEach(model.browsers.prefix(3)) { browser in
- Button { model.openExtensionsPage(in: browser) } label: {
- Label("Extensions in \(browser.name)", systemImage: "arrow.up.forward.app")
- }
- .buttonStyle(QuietButtonStyle())
- }
- Spacer()
- Button { Task { await model.reinstallExtension() } } label: { Label("Write it again", systemImage: "arrow.down.doc") }
- .buttonStyle(QuietButtonStyle())
- .disabled(model.busy.contains("extension"))
+ Button { showUnpacked = !unpacked } label: {
+ Label("Load it unpacked instead", systemImage: unpacked ? "chevron.down" : "chevron.right")
+ .font(.system(size: 12, weight: .medium))
+ .foregroundStyle(Palette.inkDim)
}
+ .buttonStyle(.plain)
+ if unpacked { UnpackedSteps() }
}
}
}
+ /// Open from the start for someone who already loads the unpacked folder.
+ private var unpacked: Bool { showUnpacked ?? (model.stamp != nil) }
+
private var subtitle: String {
- if model.extensionNeedsReload {
- return "A newer build is unpacked than the one your browser has loaded. Press ↻ on the Browsentic card at chrome://extensions."
+ model.sessions.contains(where: \.connected)
+ ? "In your browser and talking to Browsentic Bridge. Store copies update themselves."
+ : "Add it from your browser’s store, then click Browsentic in the toolbar and enter the pairing code once."
+ }
+}
+
+private struct BrowserExtensionRow: View {
+ @EnvironmentObject private var model: AppModel
+ let row: BrowserRow
+
+ var body: some View {
+ HStack(spacing: 12) {
+ GlowDot(color: row.copy?.connected == true ? Palette.lime : Palette.inkFaint, pulsing: row.copy?.connected == true)
+ VStack(alignment: .leading, spacing: 2) {
+ Text(row.label).font(.system(size: 13, weight: .medium)).foregroundStyle(Palette.ink)
+ Text(detail).font(.system(size: 11.5)).foregroundStyle(Palette.inkDim).lineLimit(1)
+ }
+ Spacer()
+ if stale { Pill(text: "Reload needed", tint: Palette.amber, icon: "arrow.clockwise") }
+ if let copy = row.copy {
+ Pill(text: copy.connected ? "Connected" : "Not connected", tint: copy.connected ? Palette.lime : Palette.inkDim)
+ } else {
+ Button { Task { await model.addExtension(row) } } label: { Label(row.addTitle, systemImage: "puzzlepiece.extension") }
+ .buttonStyle(QuietButtonStyle(tint: Palette.brand))
+ .disabled(model.busy.contains("add:\(row.id)"))
+ }
+ }
+ .padding(.horizontal, 12)
+ .padding(.vertical, 10)
+ .background(Palette.ground2, in: RoundedRectangle(cornerRadius: 12, style: .continuous))
+ }
+
+ private var detail: String {
+ if let copy = row.copy { return "\(SourceLabel.of(copy.source)) · v\(copy.extensionVersion)" }
+ return row.installed ? row.store : "\(row.store) · not found on this Mac"
+ }
+
+ private var stale: Bool {
+ guard let copy = row.copy, copy.source == "unpacked", let stamp = model.stamp else { return false }
+ return copy.extensionVersion != stamp.version
+ }
+}
+
+private struct UnpackedSteps: View {
+ @EnvironmentObject private var model: AppModel
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 10) {
+ Text("For a browser that cannot reach a store, such as ungoogled Chromium or a managed profile, or to try a build the stores do not have yet.")
+ .font(.system(size: 12))
+ .foregroundStyle(Palette.inkDim)
+ .fixedSize(horizontal: false, vertical: true)
+ PathRow(url: Paths.extensionDir())
+ VStack(alignment: .leading, spacing: 8) {
+ Step(number: 1, text: "Open chrome://extensions and turn on Developer mode.")
+ Step(number: 2, text: "Press “Load unpacked”, then ⇧⌘G, and paste the path above.")
+ Step(number: 3, text: "Click Browsentic in the toolbar and enter a pairing code.")
+ }
+ HStack(spacing: 8) {
+ ForEach(model.browsers.filter(\.isChromium).prefix(3)) { browser in
+ Button { model.openExtensionsPage(in: browser) } label: {
+ Label("Extensions in \(browser.name)", systemImage: "arrow.up.forward.app")
+ }
+ .buttonStyle(QuietButtonStyle())
+ }
+ Spacer()
+ Button { Task { await model.reinstallExtension() } } label: {
+ Label(model.stamp == nil ? "Write it" : "Write it again", systemImage: "arrow.down.doc")
+ }
+ .buttonStyle(QuietButtonStyle())
+ .disabled(model.busy.contains("extension"))
+ }
}
- return model.status?.connected == true
- ? "Loaded and talking to the daemon. The folder below has to stay where it is — the browser's pairing is tied to the path."
- : "Browsers only load an unpacked extension by hand, so these three steps are yours."
+ .padding(.leading, 14)
+ .overlay(alignment: .leading) { Rectangle().fill(Palette.line).frame(width: 1) }
}
}
diff --git a/src/mac/Sources/Browsentic/Views/SettingsView.swift b/src/mac/Sources/Browsentic/Views/SettingsView.swift
index f95c7f0..970d8f1 100644
--- a/src/mac/Sources/Browsentic/Views/SettingsView.swift
+++ b/src/mac/Sources/Browsentic/Views/SettingsView.swift
@@ -24,7 +24,7 @@ struct SettingsView: View {
.fixedSize()
Divider().overlay(Palette.line)
SwitchRow(
- title: "Turn the daemon on when the app opens",
+ title: "Turn Browsentic Bridge on when the app opens",
subtitle: "It keeps running after the window closes, so the side panel and MCP clients still work.",
isOn: $startOnLaunch
)
@@ -75,7 +75,7 @@ struct SettingsView: View {
Card {
HStack(spacing: 16) {
- SectionTitle(title: "Uninstall", subtitle: "Stops the daemon, unpairs every browser, and removes the command, the unpacked extension, keys, approvals and logs.")
+ SectionTitle(title: "Uninstall", subtitle: "Stops Browsentic Bridge, unpairs every browser, and removes the command, the unpacked extension, keys, approvals and logs.")
Spacer(minLength: 0)
Button("Uninstall…") { confirmingUninstall = true }.buttonStyle(QuietButtonStyle(tint: Palette.danger))
}
@@ -85,7 +85,7 @@ struct SettingsView: View {
.sheet(isPresented: $confirmingUninstall) {
VStack(alignment: .leading, spacing: 14) {
Text("Uninstall Browsentic?").font(.display(18)).foregroundStyle(Palette.ink)
- Text("This stops the daemon, unpairs every browser, and removes ~/.browsentic and ~/browsentic — the command, the unpacked extension, keys, approvals and logs.\n\nRemove the Browsentic card at chrome://extensions first, then drag this app to the Trash afterwards.")
+ Text("This stops Browsentic Bridge, unpairs every browser, and removes ~/.browsentic and ~/browsentic — the command, the unpacked extension, keys, approvals and logs.\n\nRemove Browsentic from each browser first: right-click its toolbar icon and choose Remove. Then drag this app to the Trash.")
.font(.system(size: 12.5)).foregroundStyle(Palette.inkDim).fixedSize(horizontal: false, vertical: true)
Toggle("Keep my skills and site maps", isOn: $keepSkills).toggleStyle(.checkbox)
HStack {
diff --git a/src/mac/Sources/Browsentic/Views/UpdateCard.swift b/src/mac/Sources/Browsentic/Views/UpdateCard.swift
index 7982152..b3296ae 100644
--- a/src/mac/Sources/Browsentic/Views/UpdateCard.swift
+++ b/src/mac/Sources/Browsentic/Views/UpdateCard.swift
@@ -82,15 +82,15 @@ struct UpdateCard: View {
private var subtitle: String {
switch model.updatePhase {
- case .downloading, .verifying: return "The daemon keeps running while this happens."
- case .relaunching: return "The app closes for a moment, then replaces the command, the daemon and the extension."
+ case .downloading, .verifying: return "Browsentic Bridge keeps running while this happens."
+ case .relaunching: return "The app closes for a moment, then replaces Browsentic Bridge."
case .failed(let reason): return "\(reason) Nothing was changed. The terminal line installs the same release."
case .idle, .checking:
guard let update = model.update else {
return model.lastUpdateCheck.map { "Checked GitHub and npm \(Timestamp.ago($0))." } ?? "Checks GitHub and npm when it opens and every few hours after."
}
return update.hasMacBuild
- ? "You have \(model.appVersion). One press replaces the app, then the command, the daemon and the extension, and reopens it."
+ ? "You have \(model.appVersion). One press replaces the app, then Browsentic Bridge, and reopens it."
: "You have \(model.appVersion). The release is published, but its Mac build is still being attached — usually a few minutes."
}
}
diff --git a/src/mac/Tests/BrowsenticTests/ModelTests.swift b/src/mac/Tests/BrowsenticTests/ModelTests.swift
index ce949ee..3caebe6 100644
--- a/src/mac/Tests/BrowsenticTests/ModelTests.swift
+++ b/src/mac/Tests/BrowsenticTests/ModelTests.swift
@@ -46,6 +46,26 @@ import Testing
#expect(state.catalog?[1].installsWithNpm == false)
}
+ @Test func browserRowsSayWhereEachBrowserGetsTheExtensionAndWhichCopyItRuns() throws {
+ let listing = #"""
+ {"running":true,"browsers":[
+ {"id":"chrome","label":"Chrome","installed":true,"source":"chrome-web-store","store":"Chrome Web Store","storeUrl":"https://chromewebstore.google.com/detail/browsentic/npmocgldfflonjjmdadmdefpnfagnjmp","steps":["Press “Add to Chrome”."],"extensionsPage":"chrome://extensions","connected":true,
+ "sessions":[{"id":"s1","source":"chrome-web-store","extensionVersion":"0.8.0","connected":true}]},
+ {"id":"firefox","label":"Firefox","installed":true,"source":"firefox","store":"Firefox add-on","storeUrl":"https://x/browsentic-0.8.0-firefox.xpi","steps":["Say yes to both."],"extensionsPage":"about:addons","connected":false,"sessions":[]}],
+ "unpacked":{"dir":"/Users/me/browsentic/extension/chrome-mv3","version":null}}
+ """#
+ let rows = try JSONDecoder().decode(BrowserListing.self, from: Data(listing.utf8)).browsers
+ #expect(rows.map { "\($0.label): \($0.copy.map { SourceLabel.of($0.source) } ?? $0.addTitle)" } == ["Chrome: Chrome Web Store", "Firefox: Get the Firefox add-on"])
+ }
+
+ @Test func setupWithNoUnpackedFolderStillDecodes() throws {
+ let result = #"{"version":"0.8.0","daemon":{"port":8765,"pid":1},"extensionDir":null,"alreadyPaired":false,"chosen":{"id":"edge","unpacked":false,"opened":true,"connected":false},"pairingCode":"K7QM3XPT","expiresAt":1790000000000}"#
+ let setup = try JSONDecoder().decode(SetupResult.self, from: Data(result.utf8))
+ #expect(setup.extensionDir == nil)
+ #expect(setup.chosen?.opened == true)
+ #expect(setup.pairingCode == "K7QM3XPT")
+ }
+
@Test func sessionShowsTheExtensionIdAlone() throws {
let row = #"{"origin":"chrome-extension://abcdef","extensionVersion":"0.5.0","pairedAt":"2026-09-01T10:00:00.000Z","lastSeenAt":"2026-09-01T10:00:00.000Z","connected":true}"#
let session = try JSONDecoder().decode(BrowserSession.self, from: Data(row.utf8))
diff --git a/src/windows/src-tauri/src/system.rs b/src/windows/src-tauri/src/system.rs
index 4dd2874..7006f32 100644
--- a/src/windows/src-tauri/src/system.rs
+++ b/src/windows/src-tauri/src/system.rs
@@ -10,15 +10,16 @@ pub struct Browser {
pub path: PathBuf,
}
-/// Chromium browsers on Windows: the name shown, the program App Paths registers, and where each
-/// installs itself when it does not register one, under Program Files or the user's AppData.
-const BROWSERS: [(&str, &str, &str); 6] = [
+/// Browsers on Windows: the name shown, the program App Paths registers, and where each installs
+/// itself when it does not register one, under Program Files or the user's AppData.
+const BROWSERS: [(&str, &str, &str); 7] = [
("Google Chrome", "chrome.exe", r"Google\Chrome\Application\chrome.exe"),
("Microsoft Edge", "msedge.exe", r"Microsoft\Edge\Application\msedge.exe"),
("Brave", "brave.exe", r"BraveSoftware\Brave-Browser\Application\brave.exe"),
("Vivaldi", "vivaldi.exe", r"Vivaldi\Application\vivaldi.exe"),
("Opera", "opera.exe", r"Programs\Opera\opera.exe"),
("Chromium", "chromium.exe", r"Chromium\Application\chrome.exe"),
+ ("Firefox", "firefox.exe", r"Mozilla Firefox\firefox.exe"),
];
pub fn browsers() -> Vec<Browser> {
diff --git a/src/windows/ui/components.tsx b/src/windows/ui/components.tsx
index 157298b..b932684 100644
--- a/src/windows/ui/components.tsx
+++ b/src/windows/ui/components.tsx
@@ -175,8 +175,8 @@ export function OfflineHint({ what, model, daemonOff }: { what: string; model: M
<div className="flex items-center gap-3.5">
<Power className="size-5 shrink-0 text-amber" strokeWidth={2.5} />
<div className="min-w-0 flex-1 space-y-0.75">
- <p className="font-display text-sm font-semibold text-ink">The daemon is off</p>
- <p className="text-xs text-ink-dim">{what} come from the running daemon.</p>
+ <p className="font-display text-sm font-semibold text-ink">Browsentic Bridge is off</p>
+ <p className="text-xs text-ink-dim">{what} come from Browsentic Bridge while it runs.</p>
</div>
<PrimaryButton disabled={!daemonOff} onClick={() => void model.setDaemon(true)}>
Turn it on
diff --git a/src/windows/ui/mock-backend.ts b/src/windows/ui/mock-backend.ts
index a440dc5..75d4191 100644
--- a/src/windows/ui/mock-backend.ts
+++ b/src/windows/ui/mock-backend.ts
@@ -1,3 +1,4 @@
+import type { BrowserRow } from '@/daemon/browsers';
import { AGENT_LIST, AGENTS, type AgentKind } from '@/lib/agents/catalog';
import type { GuardrailSettings } from '@/lib/settings/guardrails';
import type { PreferenceChange } from '@/lib/settings/preferences';
@@ -18,6 +19,7 @@ export function mockBackend({ instant = false, fresh = location.hash === '#fresh
let running = !fresh;
let linked = !fresh;
let socket = false;
+ let codePending = false;
let active: AgentKind = 'claude';
const models: Partial<Record<AgentKind, string>> = {};
const listeners = new Set<(event: string) => void>();
@@ -38,15 +40,10 @@ export function mockBackend({ instant = false, fresh = location.hash === '#fresh
const replies: Record<string, (frame: Record<string, unknown>) => Record<string, unknown>> = {
status: () => ({
- status: { connected: true, daemonVersion: version, protocolVersion: 22, port: 8765, manifestInSync: true, extensionVersion: version, connectedBrowsers: 1, pairedBrowsers: 1, pairingPending: false },
+ status: { connected: true, daemonVersion: version, protocolVersion: 22, port: 8765, manifestInSync: true, extensionVersion: version, connectedBrowsers: 2, pairedBrowsers: 2, pairingPending: codePending },
}),
- sessions: () => ({
- sessions: [
- { id: 's1', browser: 'Google Chrome', origin: 'chrome-extension://pplbfkdfiimmogofmehpibbmldcefgpc/', extensionVersion: version, pairedAt: ago(3 * 86400), lastSeenAt: ago(4), connected: true },
- { id: 's2', browser: 'Microsoft Edge', origin: 'chrome-extension://jmhkmekhafbfbkmpoheoinnbicpbnlpa/', extensionVersion: '0.7.6', pairedAt: ago(9 * 86400), lastSeenAt: ago(2 * 3600), connected: false },
- ],
- }),
- pair: () => ({ code: 'K7Q2M9', expiresAt: Date.now() + 10 * 60 * 1000 }),
+ sessions: () => ({ sessions: SESSIONS.map((session) => ({ ...session, pairedAt: ago(session.pairedAgo), lastSeenAt: ago(4) })) }),
+ pair: () => ((codePending = true), { code: 'K7Q2M9', expiresAt: Date.now() + 10 * 60 * 1000 }),
revoke: () => ({ revoked: 1 }),
preferences: () => ({ result: { ok: true, data: preferences } }),
setPreference: ({ change }) => {
@@ -70,7 +67,16 @@ export function mockBackend({ instant = false, fresh = location.hash === '#fresh
start: () => ((running = true), ok('started')),
stop: () => ((running = false), ok('stopped')),
restart: () => ok('restarted'),
- setup: () => ((stamp = { version, installedAt: new Date().toISOString() }), ok(JSON.stringify({ version, extensionDir: `${home}\\browsentic\\extension\\chrome-mv3`, daemon: { port: 8765, pid: 18115 }, alreadyPaired: true, pairingCode: null }))),
+ setup: (args) => {
+ const browser = args[args.indexOf('--browser') + 1];
+ if (args.includes('--browser')) {
+ codePending = true;
+ return ok(JSON.stringify({ version, extensionDir: null, daemon: { port: 8765, pid: 18115 }, alreadyPaired: true, chosen: { id: browser, unpacked: false, opened: true, connected: false }, pairingCode: 'R4TW7KXE', expiresAt: Date.now() + 10 * 60 * 1000, browsers: rows() }));
+ }
+ if (args.includes('--unpacked')) stamp = { version, installedAt: new Date().toISOString() };
+ return ok(JSON.stringify({ version, extensionDir: stamp && `${home}\\browsentic\\extension\\chrome-mv3`, daemon: { port: 8765, pid: 18115 }, alreadyPaired: true, chosen: null, browsers: rows() }));
+ },
+ browsers: () => ok(JSON.stringify({ running, browsers: rows(), unpacked: { dir: `${home}\\browsentic\\extension\\chrome-mv3`, version: stamp?.version ?? null } })),
agent: (args) => {
if (args[1] === 'model') models[args[2] as AgentKind] = args[3];
return ok(JSON.stringify(agents()));
@@ -112,7 +118,13 @@ export function mockBackend({ instant = false, fresh = location.hash === '#fresh
cli: async (args) => later((commands[args[0]] ?? (() => ok('')))(args)),
npmInstall: (pkg) => later(ok(`added 1 package: ${pkg}`), 1200),
extensionStamp: () => later(stamp, 120),
- browsers: () => later([{ name: 'Google Chrome', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' }, { name: 'Microsoft Edge', path: 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe' }]),
+ browsers: () =>
+ later([
+ { name: 'Google Chrome', path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' },
+ { name: 'Microsoft Edge', path: 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe' },
+ { name: 'Brave', path: 'C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe' },
+ { name: 'Firefox', path: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe' },
+ ]),
openExtensionsPage: () => later(undefined),
agentsOnPath: (bins) => later(fresh ? [] : bins.slice(0, 3)),
readLock: () => later(lock(), 60),
@@ -135,6 +147,45 @@ export function mockBackend({ instant = false, fresh = location.hash === '#fresh
const ago = (seconds: number) => new Date(Date.now() - seconds * 1000).toISOString();
+/** A store copy in Chrome, an unpacked one in Brave a build behind, and Edge and Firefox yet to get it. */
+const SESSIONS = [
+ { id: 's1', browser: 'Google Chrome', origin: 'chrome-extension://npmocgldfflonjjmdadmdefpnfagnjmp/', source: 'chrome-web-store' as const, extensionVersion: '0.8.0', pairedAgo: 3 * 86400, connected: true },
+ { id: 's2', browser: 'Brave', origin: 'chrome-extension://pplbfkdfiimmogofmehpibbmldcefgpc/', source: 'unpacked' as const, extensionVersion: '0.7.15', pairedAgo: 9 * 86400, connected: true },
+];
+
+function rows(): BrowserRow[] {
+ const store = 'https://chromewebstore.google.com/detail/browsentic/npmocgldfflonjjmdadmdefpnfagnjmp';
+ const row = (id: BrowserRow['id'], label: string, brand: string, installed: boolean): BrowserRow => {
+ const sessions = SESSIONS.filter((session) => session.browser === brand).map(({ id, source, extensionVersion, connected }) => ({ id, source, extensionVersion, connected }));
+ const firefox = id === 'firefox';
+ return {
+ id,
+ label,
+ installed,
+ source: firefox ? 'firefox' : 'chrome-web-store',
+ store: firefox ? 'Firefox add-on' : 'Chrome Web Store',
+ storeUrl: firefox ? 'https://github.com/imshaikot/browsentic/releases/download/v0.8.0/browsentic-0.8.0-firefox.xpi' : store,
+ steps: [
+ id === 'edge'
+ ? 'Press “Allow extensions from other stores” in the bar at the top and confirm, then “Add to Chrome”.'
+ : firefox
+ ? 'Firefox asks whether to let github.com install software, then whether to add Browsentic. Say yes to both.'
+ : `Press “Add to ${label === 'Brave' ? 'Brave' : 'Chrome'}”.`,
+ ],
+ extensionsPage: firefox ? 'about:addons' : `${id === 'edge' ? 'edge' : id === 'brave' ? 'brave' : 'chrome'}://extensions`,
+ connected: sessions.some((session) => session.connected),
+ sessions,
+ };
+ };
+ return [
+ row('chrome', 'Chrome', 'Google Chrome', true),
+ row('edge', 'Edge', 'Microsoft Edge', true),
+ row('brave', 'Brave', 'Brave', true),
+ row('firefox', 'Firefox', 'Firefox', true),
+ row('vivaldi', 'Vivaldi', 'Vivaldi', false),
+ ];
+}
+
function guardrails(configPath: string): GuardrailSettings {
return {
rules: [
diff --git a/src/windows/ui/model.test.ts b/src/windows/ui/model.test.ts
index 0d2468a..78bb866 100644
--- a/src/windows/ui/model.test.ts
+++ b/src/windows/ui/model.test.ts
@@ -62,13 +62,7 @@ describe('the preflight', () => {
const model = start(mockBackend({ instant: true, fresh: true }));
await model.runPreflight();
const { checks, phase } = model.snapshot();
- expect([checks.node.kind, checks.command.kind, checks.extensionFiles.kind, checks.browser.kind, checks.agent.kind]).toEqual([
- 'missing',
- 'missing',
- 'missing',
- 'passed',
- 'advisory',
- ]);
+ expect([checks.node.kind, checks.command.kind, checks.browser.kind, checks.agent.kind]).toEqual(['missing', 'missing', 'passed', 'advisory']);
expect(phase).toBe('preflight');
expect(model.needsSetup).toBe(true);
});
@@ -79,7 +73,7 @@ describe('the preflight', () => {
await model.setUpEverything();
await until(model, (state) => state.daemon === 'on');
const { checks, phase, status } = model.snapshot();
- expect([checks.node.kind, checks.command.kind, checks.extensionFiles.kind]).toEqual(['passed', 'passed', 'passed']);
+ expect([checks.node.kind, checks.command.kind]).toEqual(['passed', 'passed']);
expect(phase).toBe('main');
expect(status?.port).toBe(8765);
});
@@ -119,6 +113,32 @@ describe('the running app', () => {
return model;
}
+ it('offers the browsers on this computer, each with the store it gets the extension from', async () => {
+ const model = await running();
+ await until(model, (state) => state.browserRows.length > 0);
+ expect(model.offeredBrowsers.map((row) => [row.id, row.store, row.connected])).toEqual([
+ ['chrome', 'Chrome Web Store', true],
+ ['edge', 'Chrome Web Store', false],
+ ['brave', 'Chrome Web Store', true],
+ ['firefox', 'Firefox add-on', false],
+ ]);
+ });
+
+ it('adds the extension to a browser by opening its store page and handing out the code to enter', async () => {
+ const model = await running();
+ await until(model, (state) => state.browserRows.length > 0);
+ await model.addExtension(model.offeredBrowsers.find((row) => row.id === 'edge')!);
+ expect([model.snapshot().pairing?.code, model.snapshot().notice?.text]).toEqual([
+ 'R4TW7KXE',
+ expect.stringContaining('Allow extensions from other stores'),
+ ]);
+ });
+
+ it('asks for a reload only where an unpacked copy runs an older build', async () => {
+ const model = await running();
+ expect(model.extensionNeedsReload).toBe(true);
+ });
+
it('hands out a pairing code and unpairs a browser, saying how many', async () => {
const model = await running();
await model.newPairingCode();
diff --git a/src/windows/ui/model.ts b/src/windows/ui/model.ts
index ca9c710..47ccac8 100644
--- a/src/windows/ui/model.ts
+++ b/src/windows/ui/model.ts
@@ -4,6 +4,7 @@ import { AGENT_LIST, type AgentDescriptor, type AgentKind } from '@/lib/agents/c
import type { GuardrailValue } from '@/lib/settings/guardrails';
import type { PreferenceChange } from '@/lib/settings/preferences';
import type { ThemeId } from '@/lib/settings/theme';
+import type { BrowserRow } from '@/daemon/browsers';
import type {
AgentListing,
AppInfo,
@@ -29,10 +30,13 @@ export type DaemonPhase = 'off' | 'starting' | 'on' | 'stopping';
export type Tab = 'overview' | 'browsers' | 'agents' | 'skills' | 'activity' | 'logs' | 'settings' | 'about';
export const TABS: Tab[] = ['overview', 'browsers', 'agents', 'skills', 'activity', 'logs', 'settings', 'about'];
-export type CheckId = 'system' | 'node' | 'command' | 'extensionFiles' | 'browser' | 'agent';
-export const CHECKS: CheckId[] = ['system', 'node', 'command', 'extensionFiles', 'browser', 'agent'];
-/** What "Set up everything" installs on its own. A browser and an agent are the user's pick. */
-export const INSTALLS_AUTOMATICALLY: CheckId[] = ['node', 'command', 'extensionFiles'];
+export type CheckId = 'system' | 'node' | 'command' | 'browser' | 'agent';
+export const CHECKS: CheckId[] = ['system', 'node', 'command', 'browser', 'agent'];
+/** What "Set up everything" installs on its own. A browser, the extension and an agent are the user's pick. */
+export const INSTALLS_AUTOMATICALLY: CheckId[] = ['node', 'command'];
+
+/** Asked of the command whenever it has to run setup with nobody to answer it. */
+const QUIET_SETUP = ['setup', '--no-pair', '--no-open', '--no-wait', '--no-self-update', '--json'];
export type CheckState =
| { kind: 'waiting' }
@@ -77,6 +81,8 @@ export interface State {
downloads?: DownloadListing;
stamp?: InstallStamp | null;
browsers: Browser[];
+ /** Every browser `browsentic browsers` knows, where it gets the extension, and the copies it runs. */
+ browserRows: BrowserRow[];
logText: string;
commandLink?: CommandLink;
update?: Release;
@@ -151,6 +157,7 @@ export const initialState = (): State => ({
preferencesUnsupported: false,
grants: [],
browsers: [],
+ browserRows: [],
logText: '',
updatePhase: { kind: 'idle' },
busy: [],
@@ -207,9 +214,17 @@ export class Model {
return INSTALLS_AUTOMATICALLY.some((id) => !isPassed(this.state.checks[id]));
}
+ /** Only an unpacked copy waits for ↻: a store copy updates when its browser says. */
get extensionNeedsReload() {
- const { stamp, status } = this.state;
- return !!stamp && !!status?.connected && !!status.extensionVersion && status.extensionVersion !== stamp.version;
+ const { stamp, sessions } = this.state;
+ return !!stamp && sessions.some((session) => session.connected && session.source === 'unpacked' && session.extensionVersion !== stamp.version);
+ }
+
+ /** The browsers worth a row: found on this computer or already paired, else the usual few to try. */
+ get offeredBrowsers() {
+ const rows = this.state.browserRows;
+ const found = rows.filter((row) => row.installed || row.sessions.length > 0);
+ return found.length ? found : rows.filter((row) => ['chrome', 'edge', 'brave', 'firefox'].includes(row.id));
}
// Preflight
@@ -251,7 +266,7 @@ export class Model {
const node = await this.backend.locateNode();
this.set({ node });
if (!node) {
- return { kind: 'missing', text: `Version ${MINIMUM_NODE} or newer runs the daemon. A private copy goes in ${this.short(`${this.state.info?.paths.state}${this.sep}runtime`)}.` };
+ return { kind: 'missing', text: `Version ${MINIMUM_NODE} or newer runs Browsentic Bridge. A private copy goes in ${this.short(`${this.state.info?.paths.state}${this.sep}runtime`)}.` };
}
return { kind: 'passed', text: `${node.version} · ${node.isPrivate ? 'private copy' : this.short(node.path)}` };
}
@@ -263,24 +278,14 @@ export class Model {
if (!bundled) return { kind: 'failed', text: 'This copy of Browsentic carries no CLI payload. Download a fresh one from browsentic.com.' };
if (current) return { kind: 'passed', text: `v${bundled} in ${cli}` };
if (installed && installed !== bundled) return { kind: 'missing', text: `v${installed} is installed; this app carries v${bundled}.` };
- return { kind: 'missing', text: `Installs the CLI and daemon into ${cli}.` };
- }
- case 'extensionFiles': {
- const stamp = await this.backend.extensionStamp();
- this.set({ stamp });
- const bundled = this.state.info?.payload.bundled;
- const dir = this.short(this.state.info?.paths.extensionDir ?? '');
- if (!bundled) return { kind: 'failed', text: 'This copy of Browsentic carries no CLI payload. Download a fresh one from browsentic.com.' };
- if (!stamp) return { kind: 'missing', text: `Unpacks to ${dir}, where the browser loads it from.` };
- if (stamp.version !== bundled) return { kind: 'missing', text: `v${stamp.version} is unpacked; this app carries v${bundled}.` };
- return { kind: 'passed', text: `v${stamp.version} in ${dir}` };
+ return { kind: 'missing', text: `Installs the command and what runs in the background into ${cli}.` };
}
case 'browser': {
const browsers = await this.backend.browsers();
this.set({ browsers });
return browsers.length
? { kind: 'passed', text: browsers.map((browser) => browser.name).join(', ') }
- : { kind: 'advisory', text: 'None found. Chrome, Edge, Brave, Vivaldi or Opera all work.' };
+ : { kind: 'advisory', text: 'None found. Chrome, Edge, Brave, Vivaldi, Opera or Firefox all work.' };
}
case 'agent': {
const found = await this.backend.agentsOnPath(AGENT_LIST.map((agent) => agent.bin));
@@ -299,7 +304,7 @@ export class Model {
private finishingUpdate() {
const asked = stored(FINISH_UPDATE) === 'true';
store(FINISH_UPDATE, null);
- return asked && (!isPassed(this.state.checks.command) || !isPassed(this.state.checks.extensionFiles)) && isPassed(this.state.checks.node);
+ return asked && !isPassed(this.state.checks.command) && isPassed(this.state.checks.node);
}
async setUpEverything() {
@@ -328,21 +333,19 @@ export class Model {
}
case 'command': {
this.requireNode();
- this.check(id, { kind: 'working', text: `Copying the CLI into ${this.short(`${this.state.info?.paths.state}${this.sep}cli`)}` });
+ this.check(id, { kind: 'working', text: `Copying Browsentic Bridge into ${this.short(`${this.state.info?.paths.state}${this.sep}cli`)}` });
const wasRunning = !!(await this.backend.readLock()) && !!this.state.info?.payload.installed;
if (wasRunning) await this.backend.cli(['stop']);
await this.backend.installPayload();
if (wasRunning) {
- this.check(id, { kind: 'working', text: 'Restarting the daemon on the new build' });
+ this.check(id, { kind: 'working', text: 'Restarting Browsentic Bridge on the new build' });
await this.run(['start']);
}
+ // Registers it with every browser, store copies included, so a browser can start it.
+ this.check(id, { kind: 'working', text: 'Letting your browsers start it' });
+ parseJson(await this.backend.cli(QUIET_SETUP, 120), 'setup');
break;
}
- case 'extensionFiles':
- this.requireNode();
- this.check(id, { kind: 'working', text: 'Unpacking the extension' });
- parseJson(await this.backend.cli(['setup', '--no-pair', '--no-self-update', '--json'], 120), 'setup');
- break;
case 'agent': {
this.requireNode();
this.check(id, { kind: 'working', text: `npm install --global ${CLAUDE_CODE}` });
@@ -369,6 +372,7 @@ export class Model {
this.set({ phase: 'main' });
this.startPolling();
void this.refreshCommandLink();
+ void this.loadBrowsers();
if (this.state.startDaemonOnLaunch && this.state.daemon === 'off') void this.setDaemon(true);
this.watchForUpdates();
}
@@ -415,6 +419,7 @@ export class Model {
const status = (await this.control({ op: 'status' })).status as BridgeStatus;
const sessions = (await this.control({ op: 'sessions' })).sessions as SessionSummary[];
const stamp = await this.backend.extensionStamp();
+ const changed = linkOf(sessions) !== linkOf(this.state.sessions);
this.set((state) => ({
lock,
status,
@@ -424,6 +429,7 @@ export class Model {
pairing: state.pairing && status.pairingPending && state.pairing.expiresAt > Date.now() ? state.pairing : undefined,
}));
if (!this.state.agents) await this.loadAgents();
+ if (changed) void this.loadBrowsers();
} catch {
await this.backend.controlClose();
this.markOff();
@@ -581,9 +587,31 @@ export class Model {
});
}
+ async loadBrowsers() {
+ if (!this.state.node) return;
+ try {
+ this.set({ browserRows: parseJson<{ browsers: BrowserRow[] }>(await this.backend.cli(['browsers', '--json']), 'browsers').browsers });
+ } catch {
+ /* The card falls back to the usual browsers until the command answers. */
+ }
+ }
+
+ /**
+ * Opens the browser's store page in that browser and hands out the code its popup asks for. The
+ * command opens it where it found the browser; anywhere else, the default browser gets the page.
+ */
+ addExtension(row: BrowserRow) {
+ return this.perform(`add:${row.id}`, async () => {
+ const result = parseJson<SetupResult>(await this.backend.cli(['setup', '--browser', row.id, '--no-wait', '--no-self-update', '--json'], 120), 'setup');
+ if (!result.chosen?.opened) await this.backend.openUrl(row.storeUrl);
+ if (result.pairingCode && result.expiresAt) this.set({ pairing: { code: result.pairingCode, expiresAt: result.expiresAt } });
+ this.say(`${row.steps[0]} Then click Browsentic in ${row.label}’s toolbar and enter the code below.`);
+ });
+ }
+
reinstallExtension() {
return this.perform('extension', async () => {
- const result = parseJson<{ version: string }>(await this.backend.cli(['setup', '--no-pair', '--no-self-update', '--force', '--json'], 120), 'setup');
+ const result = parseJson<SetupResult>(await this.backend.cli(['setup', '--unpacked', '--no-pair', '--no-open', '--no-wait', '--no-self-update', '--force', '--json'], 120), 'setup');
this.set({ stamp: await this.backend.extensionStamp() });
this.say(`Extension v${result.version} written. Press ↻ on its card at chrome://extensions.`);
});
@@ -705,7 +733,7 @@ export class Model {
private async control(frame: Record<string, unknown>, timeoutMs?: number) {
const reply = await this.backend.controlRequest(frame, timeoutMs);
- if (typeof reply.error === 'object' && reply.error) throw new Error(String((reply.error as { message?: unknown }).message ?? 'The daemon refused that.'));
+ if (typeof reply.error === 'object' && reply.error) throw new Error(String((reply.error as { message?: unknown }).message ?? 'Browsentic Bridge refused that.'));
return reply;
}
@@ -756,7 +784,7 @@ export class Model {
const link = status ? ` · extension ${status.connected ? 'connected' : 'not connected'}` : '';
await this.backend
.trayStatus({
- summary: `Daemon: ${label}${status ? ` · 127.0.0.1:${status.port}` : ''}${link}`,
+ summary: `Browsentic Bridge: ${label}${status ? ` · 127.0.0.1:${status.port}` : ''}${link}`,
toggle: daemon === 'on' ? 'Turn Off' : 'Turn On',
canToggle: phase === 'main' && (daemon === 'on' || daemon === 'off'),
canRestart: daemon === 'on',
@@ -765,10 +793,21 @@ export class Model {
}
}
+/** What `setup --json` reports that the app acts on. */
+interface SetupResult {
+ version: string;
+ chosen: { id: string; opened: boolean; connected: boolean } | null;
+ pairingCode?: string;
+ expiresAt?: number;
+}
+
+/** Which copies are connected, as one string: a change is what makes the browser rows worth reading again. */
+const linkOf = (sessions: SessionSummary[]) => sessions.map((session) => `${session.id}:${session.connected}`).join(',');
+
export function outcome<T>(result: unknown): T {
const answer = result as { ok?: boolean; data?: T; error?: { message?: string } } | undefined;
if (answer?.ok && answer.data !== undefined) return answer.data;
- throw new Error(answer?.error?.message ?? 'The daemon answered with something this app cannot read. Update the app.');
+ throw new Error(answer?.error?.message ?? 'Browsentic Bridge answered with something this app cannot read. Update the app.');
}
export function messageOf(error: unknown): string {
diff --git a/src/windows/ui/views/about.tsx b/src/windows/ui/views/about.tsx
index 26b26c8..dbf781b 100644
--- a/src/windows/ui/views/about.tsx
+++ b/src/windows/ui/views/about.tsx
@@ -12,7 +12,7 @@ export function versionsOf(state: State): VersionRow[] {
return [
{ label: 'App', value: info?.version ?? 'unknown' },
{ label: 'Command', value: info?.payload.installed ?? 'not installed' },
- { label: 'Daemon', value: daemonVersion ? [daemonVersion, status && `port ${status.port}`].filter(Boolean).join(' · ') : 'off' },
+ { label: 'Bridge', value: daemonVersion ? [daemonVersion, status && `port ${status.port}`].filter(Boolean).join(' · ') : 'off' },
status && { label: 'Protocol', value: String(status.protocolVersion) },
{
label: 'Extension',
diff --git a/src/windows/ui/views/activity.tsx b/src/windows/ui/views/activity.tsx
index 7d83a57..644f1e1 100644
--- a/src/windows/ui/views/activity.tsx
+++ b/src/windows/ui/views/activity.tsx
@@ -54,7 +54,7 @@ export function ActivityView({ model, state }: { model: Model; state: State }) {
<div className="space-y-3">
<div className="flex items-start gap-3">
<div className="min-w-0 flex-1">
- <SectionTitle title="Captured downloads" subtitle="Files an agent pulled off a page. The daemon sweeps them after two weeks." />
+ <SectionTitle title="Captured downloads" subtitle="Files an agent pulled off a page. Browsentic Bridge sweeps them after two weeks." />
</div>
{downloads.length > 0 && (
<QuietButton tint="danger" onClick={() => setConfirming('downloads')}>
diff --git a/src/windows/ui/views/browsers.tsx b/src/windows/ui/views/browsers.tsx
index 4c7f686..161634c 100644
--- a/src/windows/ui/views/browsers.tsx
+++ b/src/windows/ui/views/browsers.tsx
@@ -2,6 +2,7 @@ import { useState } from 'react';
import { Globe } from 'lucide-react';
import { formatWhen } from '@/lib/format-when';
+import { SOURCE_LABEL } from '@/lib/stores';
import { Card, ConfirmDialog, EmptyState, GlowDot, OfflineHint, Pill, QuietButton, SectionTitle } from '../components';
import type { Model, State } from '../model';
import type { SessionSummary } from '../backend';
@@ -30,7 +31,7 @@ export function BrowsersView({ model, state }: { model: Model; state: State }) {
)}
</div>
{state.sessions.length === 0 ? (
- <EmptyState icon={Globe} title="No browser is paired" detail="Get a pairing code above and paste it into the Browsentic popup." />
+ <EmptyState icon={Globe} title="No browser is paired" detail="Add the extension from the Overview tab, or get a code above and enter it in the Browsentic popup." />
) : (
state.sessions.map((session) => <SessionRow key={session.id} session={session} model={model} busy={state.busy.includes('revoke')} />)
)}
@@ -62,7 +63,7 @@ function SessionRow({ session, model, busy }: { session: SessionSummary; model:
{extensionId(session.origin)}
</p>
<p className="text-[11.5px] text-ink-dim">
- Extension v{session.extensionVersion} · paired {ago(session.pairedAt)} · seen {ago(session.lastSeenAt)}
+ {SOURCE_LABEL[session.source ?? 'unpacked']} · v{session.extensionVersion} · paired {ago(session.pairedAt)} · seen {ago(session.lastSeenAt)}
</p>
</div>
<Pill text={session.connected ? 'Connected' : 'Away'} tint={session.connected ? 'lime' : 'dim'} />
diff --git a/src/windows/ui/views/logs.tsx b/src/windows/ui/views/logs.tsx
index 48ac3f7..a03b024 100644
--- a/src/windows/ui/views/logs.tsx
+++ b/src/windows/ui/views/logs.tsx
@@ -42,7 +42,7 @@ export function LogsView({ model, state }: { model: Model; state: State }) {
<Card padded={false}>
<div className="flex items-center gap-2 p-4">
<div className="min-w-0 flex-1">
- <SectionTitle title="Daemon log" subtitle={short(log, state.info)} />
+ <SectionTitle title="Browsentic Bridge log" subtitle={short(log, state.info)} />
</div>
<label className="flex items-center gap-2 text-xs text-ink-dim">
Follow
diff --git a/src/windows/ui/views/overview.tsx b/src/windows/ui/views/overview.tsx
index 2625a70..50ec6d5 100644
--- a/src/windows/ui/views/overview.tsx
+++ b/src/windows/ui/views/overview.tsx
@@ -1,6 +1,8 @@
import { useEffect, useState } from 'react';
-import { Cpu, FileDown, KeyRound, Network, Power, Puzzle, RefreshCw, SquareArrowOutUpRight, Wrench, type LucideIcon } from 'lucide-react';
+import { ChevronRight, Cpu, FileDown, KeyRound, Network, Power, Puzzle, RefreshCw, SquareArrowOutUpRight, Wrench, type LucideIcon } from 'lucide-react';
+import type { BrowserRow } from '@/daemon/browsers';
+import { SOURCE_LABEL } from '@/lib/stores';
import { cn } from '@/lib/utils';
import { Card, CopyButton, GlowDot, PathRow, Pill, PrimaryButton, QuietButton, SectionTitle, Step, type Tint } from '../components';
import type { DaemonPhase, Model, State } from '../model';
@@ -16,13 +18,13 @@ export function OverviewView({ model, state }: { model: Model; state: State }) {
const title = {
on: connected ? 'Your browser is in the loop' : 'Waiting for your browser',
off: 'Browsentic is off',
- starting: 'Bringing the daemon up',
+ starting: 'Starting Browsentic Bridge',
stopping: 'Shutting down',
}[daemon];
const subtitle = {
on: connected
- ? 'Open the side panel in your browser and say what you want. This window can close: the daemon keeps running.'
- : 'The daemon is listening. Load the extension and pair it, and the side panel comes alive.',
+ ? 'Open the side panel in your browser and say what you want. This window can close: Browsentic Bridge keeps running.'
+ : 'Browsentic Bridge is running. Add the extension to your browser below and pair it once, and the side panel comes alive.',
off: 'Turn it on and the side panel in your browser can reach the agent you already run.',
starting: 'One moment.',
stopping: 'One moment.',
@@ -54,7 +56,7 @@ export function OverviewView({ model, state }: { model: Model; state: State }) {
{status && lock && (
<div className="grid grid-cols-4 gap-3">
<Stat label="Address" value={`127.0.0.1:${status.port}`} icon={Network} />
- <Stat label="Daemon" value={`v${status.daemonVersion}`} detail={`pid ${lock.pid}`} icon={Cpu} />
+ <Stat label="Bridge" value={`v${status.daemonVersion}`} detail={`pid ${lock.pid}`} icon={Cpu} />
<Stat
label="Extension"
value={connected ? 'Connected' : 'Not connected'}
@@ -64,16 +66,16 @@ export function OverviewView({ model, state }: { model: Model; state: State }) {
/>
<Stat
label="Tools"
- value={status.manifestInSync ? 'In sync' : 'Drifted'}
- detail={status.manifestInSync ? undefined : 'reload the extension'}
+ value={status.manifestInSync ? 'In sync' : 'The extension’s'}
+ detail={status.manifestInSync ? undefined : 'versions differ, which is fine'}
icon={Wrench}
- tint={status.manifestInSync ? 'lime' : 'amber'}
+ tint={status.manifestInSync ? 'lime' : 'brand'}
/>
</div>
)}
- {daemon === 'on' && (status?.pairedBrowsers === 0 || state.pairing) && <ConnectCard model={model} state={state} />}
<ExtensionCard model={model} state={state} />
+ {daemon === 'on' && (status?.pairedBrowsers === 0 || state.pairing) && <ConnectCard model={model} state={state} />}
{!state.update && <UpdateCard model={model} state={state} />}
</div>
);
@@ -98,8 +100,8 @@ function PowerOrb({ phase, onToggle }: { phase: DaemonPhase; onToggle: () => voi
type="button"
onClick={onToggle}
disabled={moving}
- title={on ? 'Turn the daemon off' : 'Turn the daemon on'}
- aria-label={on ? 'Turn the daemon off' : 'Turn the daemon on'}
+ title={on ? 'Turn Browsentic Bridge off' : 'Turn Browsentic Bridge on'}
+ aria-label={on ? 'Turn Browsentic Bridge off' : 'Turn Browsentic Bridge on'}
className="relative size-[148px] shrink-0 rounded-full transition-transform duration-300 hover:scale-103"
>
{on && <span className="breathe absolute inset-0 rounded-full bg-[radial-gradient(closest-side,color-mix(in_oklch,var(--brand)_calc(var(--glow)*0.55),transparent)_45%,transparent)]" />}
@@ -141,7 +143,7 @@ export function ConnectCard({ model, state }: { model: Model; state: State }) {
<div className="space-y-4">
<SectionTitle
title="Pair a browser"
- subtitle="Open the Browsentic popup in your browser, paste the code, and press Connect. It works once and expires in ten minutes."
+ subtitle="Click Browsentic in your browser’s toolbar (the puzzle piece lists it), enter the code, and press Connect. It works once and expires in ten minutes."
/>
{state.pairing ? (
<PairingCodeView pairing={state.pairing} model={model} />
@@ -196,44 +198,86 @@ function PairingCodeView({ pairing, model }: { pairing: PairingCode; model: Mode
}
function ExtensionCard({ model, state }: { model: Model; state: State }) {
- const connected = state.status?.connected === true;
- const reload = model.extensionNeedsReload;
- const subtitle = reload
- ? 'A newer build is unpacked than the one your browser has loaded. Press ↻ on the Browsentic card at chrome://extensions.'
- : connected
- ? 'Loaded and talking to the daemon. The folder below has to stay where it is: the browser’s pairing is tied to the path.'
- : 'Browsers only load an unpacked extension by hand, so these three steps are yours.';
+ const [shown, setShown] = useState<boolean>();
+ // Open from the start for someone who already loads the unpacked folder.
+ const unpacked = shown ?? !!state.stamp;
+ const subtitle = state.sessions.some((session) => session.connected)
+ ? 'In your browser and talking to Browsentic Bridge. Store copies update themselves.'
+ : 'Add it from your browser’s store, then click Browsentic in the toolbar and enter the pairing code once.';
return (
<Card>
<div className="space-y-3.5">
- <div className="flex items-start gap-3">
- <div className="min-w-0 flex-1">
- <SectionTitle title="The extension" subtitle={subtitle} />
- </div>
- {state.stamp && <Pill text={`v${state.stamp.version} unpacked`} tint="brand" />}
- {reload && <Pill text="Reload needed" tint="amber" icon={RefreshCw} />}
+ <SectionTitle title="The extension" subtitle={subtitle} />
+ <div className="space-y-2">
+ {model.offeredBrowsers.map((row) => (
+ <BrowserExtensionRow key={row.id} row={row} model={model} state={state} />
+ ))}
</div>
- {state.info && <PathRow path={state.info.paths.extensionDir} model={model} info={state.info} />}
- {!connected && (
- <div className="space-y-2">
- <Step number={1}>Open chrome://extensions and turn on Developer mode.</Step>
- <Step number={2}>Press “Load unpacked”, then paste the folder above into the picker’s address bar.</Step>
- <Step number={3}>Open the Browsentic popup and paste a pairing code.</Step>
+ <button
+ type="button"
+ onClick={() => setShown(!unpacked)}
+ className="flex items-center gap-1.5 text-xs font-medium text-ink-dim transition hover:text-ink"
+ >
+ <ChevronRight className={cn('size-3.5 transition-transform', unpacked && 'rotate-90')} />
+ Load it unpacked instead
+ </button>
+ {unpacked && (
+ <div className="space-y-3 border-l border-line pl-4">
+ <p className="text-[12px] text-ink-dim">
+ For a browser that cannot reach a store, such as ungoogled Chromium or a managed profile, or to try a build the stores do not have yet.
+ </p>
+ {state.info && <PathRow path={state.info.paths.extensionDir} model={model} info={state.info} />}
+ <div className="space-y-2">
+ <Step number={1}>Open chrome://extensions and turn on Developer mode.</Step>
+ <Step number={2}>Press “Load unpacked”, then paste the folder above into the picker’s address bar.</Step>
+ <Step number={3}>Click Browsentic in the toolbar and enter a pairing code.</Step>
+ </div>
+ <div className="flex flex-wrap items-center gap-2">
+ {state.browsers
+ .filter((browser) => !/firefox/i.test(browser.name))
+ .slice(0, 3)
+ .map((browser) => (
+ <QuietButton key={browser.path} icon={SquareArrowOutUpRight} onClick={() => void model.openExtensionsPage(browser)}>
+ Extensions in {browser.name}
+ </QuietButton>
+ ))}
+ <div className="flex-1" />
+ <QuietButton icon={FileDown} disabled={state.busy.includes('extension')} onClick={() => void model.reinstallExtension()}>
+ {state.stamp ? 'Write it again' : 'Write it'}
+ </QuietButton>
+ </div>
</div>
)}
- <div className="flex flex-wrap items-center gap-2">
- {state.browsers.slice(0, 3).map((browser) => (
- <QuietButton key={browser.path} icon={SquareArrowOutUpRight} onClick={() => void model.openExtensionsPage(browser)}>
- Extensions in {browser.name}
- </QuietButton>
- ))}
- <div className="flex-1" />
- <QuietButton icon={FileDown} disabled={state.busy.includes('extension')} onClick={() => void model.reinstallExtension()}>
- Write it again
- </QuietButton>
- </div>
</div>
</Card>
);
}
+
+function BrowserExtensionRow({ row, model, state }: { row: BrowserRow; model: Model; state: State }) {
+ const copy = row.sessions.find((session) => session.connected) ?? row.sessions[0];
+ const stale = copy?.source === 'unpacked' && !!state.stamp && copy.extensionVersion !== state.stamp.version;
+ const where = copy
+ ? `${SOURCE_LABEL[copy.source ?? 'unpacked']} · v${copy.extensionVersion}`
+ : row.installed
+ ? row.store
+ : `${row.store} · not found on this computer`;
+
+ return (
+ <div className="flex items-center gap-3 rounded-xl bg-ground-2 px-3 py-2.5">
+ <GlowDot tint={copy?.connected ? 'lime' : 'faint'} pulsing={!!copy?.connected} />
+ <div className="min-w-0 flex-1">
+ <p className="text-[13px] font-medium text-ink">{row.label}</p>
+ <p className="truncate text-[11.5px] text-ink-dim">{where}</p>
+ </div>
+ {stale && <Pill text="Reload needed" tint="amber" icon={RefreshCw} />}
+ {copy ? (
+ <Pill text={copy.connected ? 'Connected' : 'Not connected'} tint={copy.connected ? 'lime' : 'dim'} />
+ ) : (
+ <QuietButton icon={Puzzle} tint="brand" disabled={state.busy.includes(`add:${row.id}`)} onClick={() => void model.addExtension(row)}>
+ {row.id === 'firefox' ? 'Get the Firefox add-on' : `Add to ${row.label}`}
+ </QuietButton>
+ )}
+ </div>
+ );
+}
diff --git a/src/windows/ui/views/preflight.tsx b/src/windows/ui/views/preflight.tsx
index 5a1ec97..bca06f8 100644
--- a/src/windows/ui/views/preflight.tsx
+++ b/src/windows/ui/views/preflight.tsx
@@ -7,7 +7,6 @@ import {
Hexagon,
Monitor,
OctagonX,
- Puzzle,
RefreshCw,
Sparkles,
SquareTerminal,
@@ -23,9 +22,8 @@ import { CHECKS, INSTALLS_AUTOMATICALLY, needsAttention, type CheckId, type Chec
const CHECK: Record<CheckId, { title: string; icon: LucideIcon }> = {
system: { title: 'This computer', icon: Monitor },
node: { title: 'Node.js runtime', icon: Hexagon },
- command: { title: 'Browsentic command', icon: SquareTerminal },
- extensionFiles: { title: 'Browser extension', icon: Puzzle },
- browser: { title: 'A Chromium browser', icon: Globe },
+ command: { title: 'Browsentic Bridge', icon: SquareTerminal },
+ browser: { title: 'A browser', icon: Globe },
agent: { title: 'An AI agent', icon: Sparkles },
};
diff --git a/src/windows/ui/views/settings.tsx b/src/windows/ui/views/settings.tsx
index 94708f4..85b32ea 100644
--- a/src/windows/ui/views/settings.tsx
+++ b/src/windows/ui/views/settings.tsx
@@ -34,7 +34,7 @@ export function SettingsView({ model, state }: { model: Model; state: State }) {
/>
<div className="border-t border-line" />
<SwitchRow
- title="Turn the daemon on when the app opens"
+ title="Turn Browsentic Bridge on when the app opens"
subtitle="It keeps running after the window closes, so the side panel and MCP clients still work."
checked={state.startDaemonOnLaunch}
onChange={(on) => model.setStartDaemonOnLaunch(on)}
@@ -92,7 +92,7 @@ export function SettingsView({ model, state }: { model: Model; state: State }) {
<div className="min-w-0 flex-1">
<SectionTitle
title="Uninstall"
- subtitle="Stops the daemon, unpairs every browser, and removes the command, the unpacked extension, keys, approvals and logs."
+ subtitle="Stops Browsentic Bridge, unpairs every browser, and removes the command, the unpacked extension, keys, approvals and logs."
/>
</div>
<QuietButton tint="danger" onClick={() => setConfirming(true)}>
@@ -105,7 +105,7 @@ export function SettingsView({ model, state }: { model: Model; state: State }) {
<ConfirmDialog
title="Uninstall Browsentic?"
message={
- 'This stops the daemon, unpairs every browser, and removes %USERPROFILE%\\.browsentic and %USERPROFILE%\\browsentic: the command, the unpacked extension, keys, approvals and logs.\n\nRemove the Browsentic card at chrome://extensions first. Afterwards, uninstall the app itself in Settings › Apps › Installed apps.'
+ 'This stops Browsentic Bridge, unpairs every browser, and removes %USERPROFILE%\\.browsentic and %USERPROFILE%\\browsentic: the command, the unpacked extension, keys, approvals and logs.\n\nRemove Browsentic from each browser first: right-click its toolbar icon and choose Remove. Afterwards, uninstall the app itself in Settings › Apps › Installed apps.'
}
action="Uninstall"
onCancel={() => setConfirming(false)}
@@ -145,7 +145,7 @@ function BrowserSettings({ model, state }: { model: Model; state: State }) {
<RefreshCw className="size-5 shrink-0 text-amber" strokeWidth={2.5} />
<div className="min-w-0 flex-1">
<SectionTitle
- title="The daemon predates this app"
+ title="Browsentic Bridge predates this app"
subtitle="It is still running from before the last update, so it cannot share the browser theme or the guardrails yet."
/>
</div>
diff --git a/src/windows/ui/views/update-card.tsx b/src/windows/ui/views/update-card.tsx
index aa4fb17..6583c50 100644
--- a/src/windows/ui/views/update-card.tsx
+++ b/src/windows/ui/views/update-card.tsx
@@ -28,13 +28,13 @@ export function UpdateCard({ model, state }: { model: Model; state: State }) {
const subtitle =
phase.kind === 'downloading'
- ? 'The daemon keeps running while this happens.'
+ ? 'Browsentic Bridge keeps running while this happens.'
: phase.kind === 'relaunching'
- ? 'The app closes for a moment, then replaces the command, the daemon and the extension.'
+ ? 'The app closes for a moment, then replaces Browsentic Bridge.'
: failed
? `${phase.reason} Nothing was changed. The PowerShell line installs the same release.`
: update
- ? `You have ${current}. One press replaces the app, then the command, the daemon and the extension, and reopens it.`
+ ? `You have ${current}. One press replaces the app, then Browsentic Bridge, and reopens it.`
: state.lastUpdateCheck
? `Checked GitHub ${formatWhen(state.lastUpdateCheck)}.`
: 'Checks GitHub when it opens and every few hours after.';