Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

companion: align release links and preserve cached state

Barack Sokulluc715bd3f39d1
diff --git a/webbrain-systray/internal/app/app.go b/webbrain-systray/internal/app/app.go
index 8c77a418e..5f0c34ef3 100644
--- a/webbrain-systray/internal/app/app.go
+++ b/webbrain-systray/internal/app/app.go
@@ -209,7 +209,7 @@ func (a *App) refreshAccounts() {
ctx, cancel := context.WithTimeout(a.ctx, 15*time.Second)
defer cancel()
creds, err := m.Credentials(ctx)
- models, _ := m.Models(ctx)
+ models, modelErr := m.Models(ctx)
a.mu.Lock()
if err != nil {
a.credsErr = err.Error()
@@ -227,8 +227,10 @@ func (a *App) refreshAccounts() {
}
}
}
- sort.Strings(models)
- a.models = models
+ if modelErr == nil {
+ sort.Strings(models)
+ a.models = models
+ }
a.mu.Unlock()
a.changed()
}
diff --git a/webbrain-systray/internal/localmodel/manager.go b/webbrain-systray/internal/localmodel/manager.go
index 1dccef756..c558b2067 100644
--- a/webbrain-systray/internal/localmodel/manager.go
+++ b/webbrain-systray/internal/localmodel/manager.go
@@ -164,6 +164,14 @@ func uvInstalled(arch string) bool {
return err == nil && string(data) == asset+" "+pinned.SHA256+"\n"
}
+func mlxEnvironmentInstalled() bool {
+ if !fileOK(filepath.Join(mlxVenv(), "bin", "python"), 0) {
+ return false
+ }
+ data, err := os.ReadFile(filepath.Join(mlxVenv(), ".installed"))
+ return err == nil && string(data) == strings.Join(mlxRequirements, "\n")+"\n"
+}
+
func (m *Manager) ggufInstalled(p Plan) bool {
return m.verified.Valid(filepath.Join(ggufDir(), gguf.Model.Name), gguf.Model.Size, gguf.Model.SHA256) &&
m.verified.Valid(filepath.Join(ggufDir(), gguf.Proj.Name), gguf.Proj.Size, gguf.Proj.SHA256) &&
@@ -176,7 +184,7 @@ func (m *Manager) mlxInstalled() bool {
return false
}
}
- return fileOK(filepath.Join(mlxVenv(), ".installed"), 0)
+ return mlxEnvironmentInstalled()
}
func dirSize(dir string) int64 {
@@ -465,7 +473,7 @@ func (m *Manager) installMLX(ctx context.Context, info sysinfo.Info) error {
}
_ = os.Remove(src)
}
- if fileOK(filepath.Join(mlxVenv(), ".installed"), 0) {
+ if mlxEnvironmentInstalled() {
return nil
}
env := append(os.Environ(),
diff --git a/webbrain-systray/internal/localmodel/manager_test.go b/webbrain-systray/internal/localmodel/manager_test.go
index 48cb7eeb5..2e4781332 100644
--- a/webbrain-systray/internal/localmodel/manager_test.go
+++ b/webbrain-systray/internal/localmodel/manager_test.go
@@ -141,6 +141,30 @@ func TestUVRejectsUnverifiedInstall(t *testing.T) {
}
}
+func TestMLXEnvironmentRejectsStaleDependencies(t *testing.T) {
+ t.Setenv("WBC_HOME", t.TempDir())
+ bin := filepath.Join(mlxVenv(), "bin")
+ if err := os.MkdirAll(bin, 0o700); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(filepath.Join(bin, "python"), []byte("python"), 0o700); err != nil {
+ t.Fatal(err)
+ }
+ marker := filepath.Join(mlxVenv(), ".installed")
+ if err := os.WriteFile(marker, []byte("old packages\n"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if mlxEnvironmentInstalled() {
+ t.Fatal("stale MLX dependency marker was accepted")
+ }
+ if err := os.WriteFile(marker, []byte(strings.Join(mlxRequirements, "\n")+"\n"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if !mlxEnvironmentInstalled() {
+ t.Fatal("current MLX dependency marker was rejected")
+ }
+}
+
func TestGGUFInstalledRejectsSameSizeCorruption(t *testing.T) {
t.Setenv("WBC_HOME", t.TempDir())
previous := gguf
diff --git a/webbrain-systray/web/README.md b/webbrain-systray/web/README.md
index 9e89c34e4..243365602 100644
--- a/webbrain-systray/web/README.md
+++ b/webbrain-systray/web/README.md
@@ -29,8 +29,8 @@ The site never shows a real desktop.
- `SITE` in `build.py` is the public address used for canonical and social
links (`https://webbrain.one/companion` by default).
-- Download links point at the GitHub release `v0.1.2` of
- `esokullu/webbrain-systray`; the CI workflow drafts that release when the tag
- is pushed. While the repository is private those links only work for people
+- Download links point at the GitHub release `systray-v0.1.2` of
+ `esokullu/webbrain`; the CI workflow drafts that release when the tag is
+ pushed. While the repository is private those links only work for people
with access. Update `VERSION` and the file sizes in `build.py` for new
releases.
diff --git a/webbrain-systray/web/build.py b/webbrain-systray/web/build.py
index 59246ac5c..7baee925f 100644
--- a/webbrain-systray/web/build.py
+++ b/webbrain-systray/web/build.py
@@ -13,9 +13,9 @@ import re
SITE = "https://webbrain.one/companion" # where the pages are published
VERSION = "0.1.2"
-RELEASES = "https://github.com/esokullu/webbrain-systray/releases"
-SOURCE = "https://github.com/esokullu/webbrain-systray"
-DL = f"{RELEASES}/download/v{VERSION}/WebBrain-Companion-{VERSION}-"
+RELEASES = "https://github.com/esokullu/webbrain/releases"
+SOURCE = "https://github.com/esokullu/webbrain/tree/main/webbrain-systray"
+DL = f"{RELEASES}/download/systray-v{VERSION}/WebBrain-Companion-{VERSION}-"
FILES = {
"mac": DL + "macos-universal.zip",
"win": DL + "windows-setup.exe",
diff --git a/webbrain-systray/web/index.html b/webbrain-systray/web/index.html
index 788c0fd75..fc396c63b 100644
--- a/webbrain-systray/web/index.html
+++ b/webbrain-systray/web/index.html
@@ -46,7 +46,7 @@
<h1>The AI plans you already pay for, ready for WebBrain</h1>
<p class="lede">WebBrain Companion lives in your menu bar or system tray. Sign in to Claude, ChatGPT, Google, Grok or Kimi once, and WebBrain reaches all of them at one address on your computer. The tray shows how much of each plan is left and when it resets.</p>
<div class="cta">
- <a class="button primary" id="get" href="#download" data-mac="Download for macOS" data-win="Download for Windows" data-linux="Download for Linux" data-mac-href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip" data-win-href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe" data-linux-href="#download">Download</a>
+ <a class="button primary" id="get" href="#download" data-mac="Download for macOS" data-win="Download for Windows" data-linux="Download for Linux" data-mac-href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip" data-win-href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe" data-linux-href="#download">Download</a>
<span class="cta-note">Version 0.1.2 for macOS, Windows and Linux. Free and open source.</span>
</div>
</div>
@@ -168,21 +168,21 @@
<div class="downloads">
<div class="dl" data-os="mac">
<div><h3>macOS</h3><p class="req">macOS 12 or later, Apple Silicon and Intel (d1 requires Apple Silicon)</p><span class="yours">Your system</span></div>
- <ul class="files"><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip">Universal app <small>zip, 36 MB</small></a></li></ul>
+ <ul class="files"><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip">Universal app <small>zip, 36 MB</small></a></li></ul>
<p class="how">Move WebBrain Companion to Applications. The build is not notarized by Apple: the first time, allow it in System Settings, Privacy &amp; Security (Open Anyway). On macOS 14 and earlier, Control-click it and choose Open.</p>
</div>
<div class="dl" data-os="win">
<div><h3>Windows</h3><p class="req">Windows 10 and 11, x64 and Arm64</p><span class="yours">Your system</span></div>
- <ul class="files"><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe">Installer <small>setup.exe, 23 MB</small></a></li></ul>
+ <ul class="files"><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe">Installer <small>setup.exe, 23 MB</small></a></li></ul>
<p class="how">Run the installer: it installs for your account, without an administrator prompt, and adds WebBrain Companion to the Start menu. Until the installer is code-signed, SmartScreen may say &quot;Windows protected your PC&quot;: choose More info, then Run anyway.</p>
</div>
<div class="dl" data-os="linux">
<div><h3>Linux</h3><p class="req">x64 and Arm64</p><span class="yours">Your system</span></div>
- <ul class="files"><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-linux-x64.tar.gz">x64 <small>tar.gz, 20 MB</small></a></li><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-linux-arm64.tar.gz">Arm64 <small>tar.gz, 18 MB</small></a></li></ul>
+ <ul class="files"><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-linux-x64.tar.gz">x64 <small>tar.gz, 20 MB</small></a></li><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-linux-arm64.tar.gz">Arm64 <small>tar.gz, 18 MB</small></a></li></ul>
<p class="how">Unpack and run webbrain-companion. The icon needs a StatusNotifierItem tray: KDE, XFCE, or GNOME with the AppIndicator extension.</p>
</div>
</div>
- <p class="more-links"><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-SHA256SUMS.txt">SHA-256 checksums</a><a href="https://github.com/esokullu/webbrain-systray">Source code</a><a href="https://github.com/esokullu/webbrain-systray/releases">All releases</a></p>
+ <p class="more-links"><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-SHA256SUMS.txt">SHA-256 checksums</a><a href="https://github.com/esokullu/webbrain/tree/main/webbrain-systray">Source code</a><a href="https://github.com/esokullu/webbrain/releases">All releases</a></p>
</div>
</section>
@@ -217,7 +217,7 @@
<footer class="site-foot">
<div class="wrap">
<p>WebBrain Companion is free software under the GPL-3.0-or-later license and embeds CLIProxyAPI. It is not affiliated with Anthropic, OpenAI, Google, xAI, Moonshot AI, Meta or Cognition.</p>
- <nav aria-label="More"><a href="https://webbrain.one/">WebBrain</a><a href="https://github.com/esokullu/webbrain-systray">Source code</a><a href="tr/" hreflang="tr" lang="tr">Türkçe</a></nav>
+ <nav aria-label="More"><a href="https://webbrain.one/">WebBrain</a><a href="https://github.com/esokullu/webbrain/tree/main/webbrain-systray">Source code</a><a href="tr/" hreflang="tr" lang="tr">Türkçe</a></nav>
</div>
</footer>
</body>
diff --git a/webbrain-systray/web/tr/index.html b/webbrain-systray/web/tr/index.html
index 73760505d..085953627 100644
--- a/webbrain-systray/web/tr/index.html
+++ b/webbrain-systray/web/tr/index.html
@@ -46,7 +46,7 @@
<h1>Zaten ödediğin yapay zekâ aboneliklerini WebBrain&#x27;de kullan</h1>
<p class="lede">WebBrain Companion menü çubuğunda ya da sistem tepsisinde durur. Claude, ChatGPT, Google, Grok veya Kimi hesabına bir kez giriş yap; WebBrain hepsine bilgisayarındaki tek bir adresten ulaşsın. Tepsi, her planda ne kadar hakkın kaldığını ve ne zaman sıfırlanacağını gösterir.</p>
<div class="cta">
- <a class="button primary" id="get" href="#download" data-mac="macOS için indir" data-win="Windows için indir" data-linux="Linux için indir" data-mac-href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip" data-win-href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe" data-linux-href="#download">İndir</a>
+ <a class="button primary" id="get" href="#download" data-mac="macOS için indir" data-win="Windows için indir" data-linux="Linux için indir" data-mac-href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip" data-win-href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe" data-linux-href="#download">İndir</a>
<span class="cta-note">Sürüm 0.1.2; macOS, Windows ve Linux için. Ücretsiz ve açık kaynak.</span>
</div>
</div>
@@ -168,21 +168,21 @@
<div class="downloads">
<div class="dl" data-os="mac">
<div><h3>macOS</h3><p class="req">macOS 12 ve sonrası, Apple Silicon ve Intel (d1 için Apple Silicon gerekli)</p><span class="yours">Senin sistemin</span></div>
- <ul class="files"><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip">Universal uygulama <small>zip, 36 MB</small></a></li></ul>
+ <ul class="files"><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-macos-universal.zip">Universal uygulama <small>zip, 36 MB</small></a></li></ul>
<p class="how">WebBrain Companion&#x27;ı Uygulamalar klasörüne taşı. Sürüm Apple onayından (notarization) geçmedi: ilk açılışta Sistem Ayarları, Gizlilik ve Güvenlik bölümünden izin ver (Yine de Aç). macOS 14 ve öncesinde Control tuşuyla tıklayıp Aç&#x27;ı seçmen yeterli.</p>
</div>
<div class="dl" data-os="win">
<div><h3>Windows</h3><p class="req">Windows 10 ve 11, x64 ve Arm64</p><span class="yours">Senin sistemin</span></div>
- <ul class="files"><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe">Kurulum dosyası <small>setup.exe, 23 MB</small></a></li></ul>
+ <ul class="files"><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-windows-setup.exe">Kurulum dosyası <small>setup.exe, 23 MB</small></a></li></ul>
<p class="how">Kurulum dosyasını çalıştır: yönetici izni istemeden senin hesabına kurar ve WebBrain Companion&#x27;ı Başlat menüsüne ekler. Kurulum dosyası kod imzalı olana kadar SmartScreen &quot;Windows bilgisayarınızı korudu&quot; diyebilir: Ek bilgi&#x27;yi, ardından Yine de çalıştır&#x27;ı seç.</p>
</div>
<div class="dl" data-os="linux">
<div><h3>Linux</h3><p class="req">x64 ve Arm64</p><span class="yours">Senin sistemin</span></div>
- <ul class="files"><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-linux-x64.tar.gz">x64 <small>tar.gz, 20 MB</small></a></li><li><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-linux-arm64.tar.gz">Arm64 <small>tar.gz, 18 MB</small></a></li></ul>
+ <ul class="files"><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-linux-x64.tar.gz">x64 <small>tar.gz, 20 MB</small></a></li><li><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-linux-arm64.tar.gz">Arm64 <small>tar.gz, 18 MB</small></a></li></ul>
<p class="how">Arşivi aç ve webbrain-companion&#x27;ı çalıştır. Simge için StatusNotifierItem destekli bir tepsi gerekir: KDE, XFCE ya da AppIndicator eklentili GNOME.</p>
</div>
</div>
- <p class="more-links"><a href="https://github.com/esokullu/webbrain-systray/releases/download/v0.1.2/WebBrain-Companion-0.1.2-SHA256SUMS.txt">SHA-256 özetleri</a><a href="https://github.com/esokullu/webbrain-systray">Kaynak kodu</a><a href="https://github.com/esokullu/webbrain-systray/releases">Tüm sürümler</a></p>
+ <p class="more-links"><a href="https://github.com/esokullu/webbrain/releases/download/systray-v0.1.2/WebBrain-Companion-0.1.2-SHA256SUMS.txt">SHA-256 özetleri</a><a href="https://github.com/esokullu/webbrain/tree/main/webbrain-systray">Kaynak kodu</a><a href="https://github.com/esokullu/webbrain/releases">Tüm sürümler</a></p>
</div>
</section>
@@ -217,7 +217,7 @@
<footer class="site-foot">
<div class="wrap">
<p>WebBrain Companion, GPL-3.0-or-later lisanslı özgür bir yazılımdır ve CLIProxyAPI&#x27;yi içinde barındırır. Anthropic, OpenAI, Google, xAI, Moonshot AI, Meta ya da Cognition ile bağlantılı değildir.</p>
- <nav aria-label="Bağlantılar"><a href="https://webbrain.one/">WebBrain</a><a href="https://github.com/esokullu/webbrain-systray">Kaynak kodu</a><a href="../" hreflang="en" lang="en">English</a></nav>
+ <nav aria-label="Bağlantılar"><a href="https://webbrain.one/">WebBrain</a><a href="https://github.com/esokullu/webbrain/tree/main/webbrain-systray">Kaynak kodu</a><a href="../" hreflang="en" lang="en">English</a></nav>
</div>
</footer>
</body>