Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions front_end/core/root/Runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ interface DevToolsStartingStyleDebugging {
* @see hostConfig
*/
export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
browserOperatorUpdates: {enabled: boolean},
aidaAvailability: AidaAvailability,
channel: Channel,
devToolsConsoleInsights: HostConfigConsoleInsights,
Expand Down
3 changes: 3 additions & 0 deletions front_end/panels/ai_chat/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ devtools_module("ai_chat") {
deps = [
":css_files",
"../../core/common:bundle",
"../../core/host:bundle",
"../../core/platform:bundle",
"../../core/root:bundle",
"../../core/i18n:bundle",
"../../core/sdk:bundle",
"../../generated:protocol",
Expand Down
4 changes: 2 additions & 2 deletions front_end/panels/ai_chat/core/Version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// found in the LICENSE file.

export const VERSION_INFO = {
version: '0.5.0',
buildDate: '2025-10-05',
version: '0.7.0',
buildDate: '2026-11-10',
channel: 'stable'
} as const;

Expand Down
6 changes: 3 additions & 3 deletions front_end/panels/ai_chat/core/VersionChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export interface VersionInfo {

export class VersionChecker {
private static instance: VersionChecker;
private readonly GITHUB_API_URL = 'https://api.github.com/repos/tysonthomas9/browser-operator-devtools-frontend/releases/latest';
private readonly RELEASE_URL = 'https://github.com/tysonthomas9/browser-operator-devtools-frontend/releases';
private readonly GITHUB_API_URL = 'https://api.github.com/repos/BrowserOperator/browser-operator-core/releases/latest';
private readonly RELEASE_URL = 'https://github.com/BrowserOperator/browser-operator-core/releases';
private readonly CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours
private readonly STORAGE_KEY = 'devtools-version-check';
private currentVersion: string;
Expand Down Expand Up @@ -183,4 +183,4 @@ export class VersionChecker {
logger.error('Failed to clear cache:', error);
}
}
}
}
20 changes: 20 additions & 0 deletions front_end/panels/ai_chat/ui/ChatView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
import * as Lit from '../../../ui/lit/lit.js';
import * as SDK from '../../../core/sdk/sdk.js';
import * as Host from '../../../core/host/host.js';
import type * as Platform from '../../../core/platform/platform.js';
import type * as Root from '../../../core/root/root.js';
import * as BaseOrchestratorAgent from '../core/BaseOrchestratorAgent.js';
import { TIMING_CONSTANTS } from '../core/Constants.js';
import { PromptEditDialog } from './PromptEditDialog.js';
Expand Down Expand Up @@ -233,6 +236,7 @@ export class ChatView extends HTMLElement {
// Add version info state
#versionInfo: VersionInfo | null = null;
#isVersionBannerDismissed = false;
#nativeUpdaterEnabled = false;

connectedCallback(): void {
const sheet = new CSSStyleSheet();
Expand Down Expand Up @@ -1251,6 +1255,16 @@ export class ChatView extends HTMLElement {
// Method to check for updates
async #checkForUpdates(): Promise<void> {
try {
const hostConfig = await new Promise<Root.Runtime.HostConfig>(resolve => {
Host.InspectorFrontendHost.InspectorFrontendHostInstance.getHostConfig(resolve);
});
if (hostConfig.browserOperatorUpdates?.enabled) {
this.#nativeUpdaterEnabled = true;
this.#versionInfo = null;
VersionChecker.getInstance().clearCache();
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
return;
}
const versionChecker = VersionChecker.getInstance();
// Version is now automatically loaded from Version.ts

Expand Down Expand Up @@ -1293,6 +1307,12 @@ export class ChatView extends HTMLElement {

// Method to render version banner (delegates to component)
#renderVersionBanner(): Lit.TemplateResult {
if (this.#nativeUpdaterEnabled) {
return html`<ai-version-banner .nativeUpdater=${true}
@check-native-updates=${() => Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(
'chrome://help/' as Platform.DevToolsPath.UrlString)}
></ai-version-banner>`;
}
if (!this.#versionInfo || !this.#versionInfo.isUpdateAvailable || this.#isVersionBannerDismissed || this.#messages.length > 1) {
return html``;
}
Expand Down
21 changes: 21 additions & 0 deletions front_end/panels/ai_chat/ui/version/VersionBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

import * as Lit from '../../../../ui/lit/lit.js';
import { CURRENT_VERSION } from '../../core/Version.js';

const {html, Decorators} = Lit;
const {customElement} = Decorators as any;
Expand All @@ -17,17 +18,37 @@ export class VersionBanner extends HTMLElement {
// Manual properties
#info: VersionInfo | null = null;
#dismissed = false;
#nativeUpdater = false;

get info(): VersionInfo | null { return this.#info; }
set info(value: VersionInfo | null) { this.#info = value; this.#render(); }
get dismissed(): boolean { return this.#dismissed; }
set dismissed(value: boolean) { this.#dismissed = value; this.#render(); }
get nativeUpdater(): boolean { return this.#nativeUpdater; }
set nativeUpdater(value: boolean) { this.#nativeUpdater = value; this.#render(); }

connectedCallback(): void { this.#render(); }

#dismiss = () => { this.dispatchEvent(new CustomEvent('dismiss', {bubbles: true})); };

#render(): void {
if (this.#nativeUpdater) {
Lit.render(html`
<style>
.native-updates { display: flex; align-items: center; justify-content: space-between;
gap: 12px; padding: 8px 12px; margin: 8px 0; border-radius: 6px;
background: var(--sys-color-surface-variant); color: var(--sys-color-on-surface); }
button { border: none; background: transparent; color: var(--sys-color-primary);
cursor: pointer; font: inherit; }
</style>
<div class="native-updates"><span>Browser Operator ${CURRENT_VERSION}</span>
<button @click=${() => this.dispatchEvent(new CustomEvent('check-native-updates', {bubbles: true}))}>
Check for updates
</button>
</div>
`, this.#shadow, {host: this});
return;
}
if (!this.#info || !this.#info.isUpdateAvailable || this.#dismissed) { this.#shadow.innerHTML = ''; return; }
const info = this.#info;
Lit.render(html`
Expand Down
56 changes: 56 additions & 0 deletions patches/chromium/158.0.8127.18/09-native-ai-updates.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index 7ab3e80be5..47a835dff5 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -40,6 +40,7 @@
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/buildflags.h"
#include "chrome/browser/devtools/aida_service_handler.h"
#include "chrome/browser/devtools/devtools_file_watcher.h"
#include "chrome/browser/devtools/devtools_http_service_registry.h"
@@ -1429,6 +1430,21 @@ void DevToolsUIBindings::LoadNetworkResource(DispatchCallback callback,

void DevToolsUIBindings::OpenInNewTab(const std::string& url) {
GURL gurl(url);
+#if BUILDFLAG(IS_MAC) && BUILDFLAG(ENABLE_UPDATER)
+ // The shipped Browser Operator panel may open only the fixed native update
+ // page. Remote/custom frontends and all other chrome:// URLs retain the
+ // standard request policy below.
+ if (is_local_frontend_ && web_contents_ &&
+ gurl == GURL(chrome::kChromeUIHelpURL)) {
+ const GURL& frontend = web_contents_->GetLastCommittedURL();
+ if (frontend.SchemeIs(content::kChromeDevToolsScheme) &&
+ frontend.host() == "devtools" &&
+ base::StartsWith(frontend.path(), "/bundled/")) {
+ delegate_->OpenInNewTab(gurl.spec());
+ return;
+ }
+ }
+#endif
// Hardening: Verify that the frontend renderer is allowed to request this URL.
content::ChildProcessSecurityPolicy* policy =
content::ChildProcessSecurityPolicy::GetInstance();
@@ -2359,7 +2375,20 @@ base::DictValue DevToolsUIBindings::GetHostConfigDictionary(Profile* profile) {
}

void DevToolsUIBindings::GetHostConfig(DispatchCallback callback) {
- base::Value response(GetHostConfigDictionary(profile_));
+ base::DictValue config = GetHostConfigDictionary(profile_);
+#if BUILDFLAG(IS_MAC) && BUILDFLAG(ENABLE_UPDATER)
+ if (is_local_frontend_ && web_contents_) {
+ const GURL& frontend = web_contents_->GetLastCommittedURL();
+ if (frontend.SchemeIs(content::kChromeDevToolsScheme) &&
+ frontend.host() == "devtools" &&
+ base::StartsWith(frontend.path(), "/bundled/")) {
+ base::DictValue browser_operator_updates;
+ browser_operator_updates.Set("enabled", true);
+ config.Set("browserOperatorUpdates", std::move(browser_operator_updates));
+ }
+ }
+#endif
+ base::Value response(std::move(config));
std::move(callback).Run(&response);
}

8 changes: 7 additions & 1 deletion scripts/freeze_chromium_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
from pathlib import Path
import plistlib
import re
import subprocess

from chromium_build_input import inventory, load, release_targets, require_current_build, source_state, updater_trust
Expand Down Expand Up @@ -44,14 +45,19 @@ def freeze(source, build, destination):
subprocess.run(['cp', '-cR', str(build / name), str(destination / name)], check=True)
subprocess.run(['cp', '-c', str(build / crypto), str(destination / 'crx3_build_action')], check=True)
info = plistlib.loads((destination / 'Browser Operator.app/Contents/Info.plist').read_bytes())
frontend_root = (source / 'third_party/devtools-frontend/src').resolve()
product_version = re.search(r"version: ['\"]([0-9]+\.[0-9]+\.[0-9]+)['\"]", (frontend_root / 'front_end/panels/ai_chat/core/Version.ts').read_text())
if not product_version:
raise RuntimeError('Expected an explicit Browser Operator product version')
patch = subprocess.check_output(['git', 'diff', '--binary', 'HEAD'], cwd=source)
metadata = {
'schema': 1, 'version': info['CFBundleShortVersionString'],
'browser_operator_version': product_version.group(1),
'source_base_revision': subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=source, text=True).strip(),
'source_has_local_changes': bool(patch), 'source_patch_sha256': hashlib.sha256(patch).hexdigest(),
'build_settings': settings, 'updater_product': product, 'mach_o_architectures': binaries,
'native_source_state': source_state(source),
'frontend_source_state': source_state((source / 'third_party/devtools-frontend/src').resolve()),
'frontend_source_state': source_state(frontend_root),
'updater_trust': updater_trust(source, settings),
'input_files': inventory(destination),
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/merge_chromium_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def merge(source, arm, intel, output):
if output.exists():
raise RuntimeError('Universal output must not exist')
a, b = load(arm), load(intel)
for key in ('version', 'source_base_revision', 'source_patch_sha256', 'updater_product',
for key in ('version', 'browser_operator_version', 'source_base_revision', 'source_patch_sha256', 'updater_product',
'native_source_state', 'frontend_source_state', 'updater_trust'):
if a.get(key) != b.get(key) or not a.get(key):
raise RuntimeError(f'Architecture inputs differ in {key}')
Expand Down
35 changes: 26 additions & 9 deletions scripts/package_chromium_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def validate_mounted_app(app, team, evidence):
return details


def smoke_test(app, artifacts, node, updater_enabled=False, cpu=None):
def smoke_test(app, artifacts, node, updater_enabled=False, cpu=None, frontend_checks=True, product_version=None):
with socket.socket() as server:
server.bind(('127.0.0.1', 0))
port = server.getsockname()[1]
Expand Down Expand Up @@ -164,8 +164,10 @@ def smoke_test(app, artifacts, node, updater_enabled=False, cpu=None):
raise RuntimeError('Release test app did not expose its local test endpoint')
time.sleep(0.25)
version = plistlib.loads((app / 'Contents/Info.plist').read_bytes())['CFBundleShortVersionString']
run([node, scripts / 'verify_chromium_release.mjs', endpoint, version, artifacts])
if cpu:
if frontend_checks:
run([node, scripts / 'verify_chromium_release.mjs', endpoint, version, artifacts,
*([product_version] if product_version else [])])
if cpu and frontend_checks:
from chromium_macos_arch import process_architecture
report = json.loads((artifacts / 'report.json').read_text())
owned = [entry for entry in report['processInfo'] if entry['type'] in ('browser', 'renderer')]
Expand All @@ -190,7 +192,7 @@ def smoke_test(app, artifacts, node, updater_enabled=False, cpu=None):
process.wait()


def verify_release(source, output, app_name, version, team, settings, node, provenance=None):
def verify_release(source, output, app_name, version, team, settings, node, provenance=None, baseline_app=None):
verification = output / 'verification'
verification.mkdir(exist_ok=True)
tests = Path(tempfile.mkdtemp(prefix='attempt-', dir=verification))
Expand Down Expand Up @@ -228,7 +230,12 @@ def verify_release(source, output, app_name, version, team, settings, node, prov
validate_mounted_app(updater_apps[0], team, tests / 'gatekeeper-updater.txt')
tested_architectures = ['arm64', 'x86_64'] if architecture == 'universal' else ['arm64']
from updater.macos_smoke_scope import UpdaterSmokeScope
scope = UpdaterSmokeScope(settings, team, tests) if updater_enabled else contextlib.nullcontext()
def restore_baseline():
restore = tests / 'restore-installed-baseline'
restore.mkdir()
smoke_test(baseline_app, restore, node, updater_enabled=True, frontend_checks=False)
scope = UpdaterSmokeScope(settings, team, tests, baseline_app=baseline_app,
restore_baseline=restore_baseline) if updater_enabled else contextlib.nullcontext()
# Native Chromium correctly refuses registration on a read-only DMG.
# Exercise the actual installation path using this exact verified app,
# leaving the user's /Applications and browser profile untouched.
Expand All @@ -241,7 +248,8 @@ def verify_release(source, output, app_name, version, team, settings, node, prov
for cpu in tested_architectures:
cpu_tests = tests / cpu
cpu_tests.mkdir(exist_ok=True)
smoke_test(installed_app, cpu_tests, node, updater_enabled=updater_enabled, cpu=cpu)
smoke_test(installed_app, cpu_tests, node, updater_enabled=updater_enabled, cpu=cpu,
product_version=provenance.get('browser_operator_version') if provenance else None)
# This is an owned disposable installation, not the mounted app or a
# user's browser. Keep failed attempts for diagnosis; retire successes.
shutil.rmtree(installed)
Expand All @@ -263,6 +271,8 @@ def verify_release(source, output, app_name, version, team, settings, node, prov
'mounted_app_validation': 'passed',
'installed_dmg_copy_functional_tests': 'passed'}
manifest['mach_o_architectures'] = binaries
if provenance.get('browser_operator_version'):
manifest['browser_operator_version'] = provenance['browser_operator_version']
manifest['verification_evidence'] = str(tests.relative_to(output))
manifest['functional_test_architectures'] = {cpu: 'passed' for cpu in tested_architectures}
if architecture == 'universal':
Expand Down Expand Up @@ -304,6 +314,8 @@ def main():
help='Explicitly package a historical/manual-update build')
parser.add_argument('--frozen-input', type=Path,
help='Use hash-verified signing inputs captured from a completed native build')
parser.add_argument('--installed-updater-baseline', type=Path,
help='Explicit same-version installed app to preserve and restore through its native updater API')
parser.add_argument('--verify-existing', action='store_true',
help='Resume final verification of an existing signed/stapled DMG without signing or uploading again')
args = parser.parse_args()
Expand Down Expand Up @@ -352,17 +364,22 @@ def main():
from chromium_macos_arch import verify_architectures
verify_architectures(app, args.architecture)
identity, team = find_identity(args.identity)
if args.installed_updater_baseline:
args.installed_updater_baseline = args.installed_updater_baseline.resolve()
baseline_version = plistlib.loads((args.installed_updater_baseline / 'Contents/Info.plist').read_bytes())['CFBundleShortVersionString']
if baseline_version != plistlib.loads((app / 'Contents/Info.plist').read_bytes())['CFBundleShortVersionString']:
raise RuntimeError('Baseline reuse requires exactly the same browser/updater version; use a dedicated clean user for version upgrades')
if args.updater_enabled:
from updater.macos_smoke_scope import UpdaterSmokeScope
UpdaterSmokeScope(settings, team, output).require_clean()
UpdaterSmokeScope(settings, team, output, baseline_app=args.installed_updater_baseline).require_clean()
packaging = build / 'Browser Operator Packaging'
if not (packaging / 'sign_chrome.py').is_file():
raise RuntimeError('Build chrome/installer/mac to generate the packaging pipeline first')
version = plistlib.loads((app / 'Contents/Info.plist').read_bytes())['CFBundleShortVersionString']
if provenance and provenance['version'] != version:
raise RuntimeError('Frozen input version differs from its captured build metadata')
if args.verify_existing:
verify_release(source, output, app.name, version, team, settings, args.node, provenance)
verify_release(source, output, app.name, version, team, settings, args.node, provenance, args.installed_updater_baseline)
return
# Read-only authentication preflight; no password or private key is logged.
subprocess.run([
Expand Down Expand Up @@ -442,7 +459,7 @@ def main():
raise
print('Apple timestamp service failed transiently; retrying in 10 seconds', flush=True)
time.sleep(10)
verify_release(source, output, app.name, version, team, settings, args.node, provenance)
verify_release(source, output, app.name, version, team, settings, args.node, provenance, args.installed_updater_baseline)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_merge_chromium_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def inputs(self, root):
(directory / 'Browser Operator Packaging' / name).write_bytes(binary)
for name in ('BrowserOperatorUpdaterUtil', 'crx3_build_action', 'browser_operator_update_verify'):
(directory / name).write_bytes(binary)
metadata = {'schema': 1, 'version': '158.0.8127.18', 'source_base_revision': 'a' * 40,
metadata = {'schema': 1, 'version': '158.0.8127.18', 'browser_operator_version': '0.7.0', 'source_base_revision': 'a' * 40,
'source_patch_sha256': 'b' * 64, 'updater_product': 'BrowserOperatorUpdater',
'native_source_state': {'revision': 'a' * 40},
'frontend_source_state': {'revision': 'd' * 40, 'untracked_source_files': {}},
Expand Down
Loading
Loading