From b466aa2803f0c3503fdecfe03d0c97f762221636 Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 15 Nov 2026 12:08:48 +0800 Subject: [PATCH] update: a Daily channel, one release a day that passed its tests, for the app and Docker (fishmagic80 on X) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fishmagic80 on X: Stable is too slow (community plugins need a newer magpie than it has), every release is too fast, and Docker users have nothing in between. Daily sits between them. What it is: - site/worker.js keepDaily: at the daily cut (20:00 UTC, the quarter-hour cron) the newest tag whose commit has a successful Test run and whose release has all 17 assets is picked and kept in LEDGER "daily". A day with none keeps the day before's; a failed GitHub read writes nothing. /api/latest?channel=daily (503 until a pick exists), /download/daily/

, and an urgent release overlays it as on Stable. - .github/workflows/docker-daily.yml reads that feed and points ghcr.io/yetone/magpie:daily at the picked version's image. - App: settings.UpdateDaily ("daily"); update.Channel()/Picked() (Stable() kept); the feed is asked channel=daily, never falls back to GitHub's latest, What's new lists every change since yours. Settings > About > Update channel has Every version / Daily / Stable; the version row says "Up to date on Daily (· {v} is out on Every version)". CLI: magpie update channel [stable|daily|every]. - Words in en, zh, zh-TW, ja, de, on top of 7f832b2f2's 尝鲜版/搶先版/先行版 for Every version (kept as it landed). - The channel row wraps its switch under its name when narrow (ja at 420px was 18px past the window with three segments). - app.js budget +338: the segment, its line and the two Up to date on Daily words, packed to one t() per choice; Settings and renderUpdate draw on every window, nothing lazy to move them to. - Docs: docs/reference.md, site docs (docker, privacy in en/zh/ja), llms-full.txt, search indexes. Red on the old code (a daily-old worktree, then only settings allowing "daily"): the feed was not asked channel=daily, 40 notes instead of all, Picked false, notesKey "zh" not "zh|daily", the Daily row showed "available"; the GUI tests had no Daily segment. Run on mote at this commit's tree (on origin/main ec1a1a7a5; the Daily pick itself is live on the deployed worker: /api/latest?channel=daily answers 0.1.4171, /download/daily 302s to its dmg): - go test -count=1 ./internal/settings ./internal/settingsapi ./internal/update ./internal/cli ./internal/gui: all ok (TestCoreScriptBudget included). - GUI, chromium and webkit, every language: update-*.test.cjs (22 files), i18n-*.test.cjs, settings-search.test.cjs: 554 of 554 pass. - site: node --test site/*.test.mjs, 132 of 132 (130 before the rebuild). - gofmt -l clean; go vet darwin, windows (gui/update/cli) and GOOS=linux -tags nogui. Also: site/public/search/*.json and llms-full.txt rebuilt (search-index.mjs, llms-full.mjs); they still listed Antigravity's old sign-in after 9cd5f3652, so the two site freshness tests were red. Filed: #6730, engines.magpie is never read, so a plugin needing a newer magpie installs on Stable (0.1.3078) and fails without saying why (page-amp-usage >=0.1.3681, middleware-company-guard >=0.1.3841, page-day-card >=0.1.3427). Not tried: a real self-update on Daily, a real docker-daily workflow run, the whole GUI suite, the worker's unauthenticated GitHub reads under a rate limit. --- .github/workflows/docker-daily.yml | 44 ++- docs/reference.md | 37 ++- internal/cli/main.go | 5 +- internal/cli/update_channel_cli_test.go | 5 +- internal/cli/update_cli.go | 29 +- internal/gui/assets/app.css | 4 + internal/gui/assets/app.js | 23 +- internal/gui/assets/i18n.js | 16 ++ internal/gui/core_budget_test.go | 4 +- internal/gui/tests/update-channel.test.cjs | 24 +- .../gui/tests/update-stable-newest.test.cjs | 29 +- internal/gui/update.go | 39 +-- internal/gui/update_channel_test.go | 27 +- internal/gui/whatsnew.go | 4 +- internal/settings/settings.go | 15 +- internal/settingsapi/settingsapi.go | 2 +- internal/update/channel_test.go | 54 +++- internal/update/fallback.go | 10 +- internal/update/notes.go | 46 +++- site/daily.test.mjs | 252 ++++++++++++++++++ site/docker-tags.test.mjs | 19 +- site/public/docs/docker.html | 2 +- site/public/docs/ja/docker.html | 2 +- site/public/docs/ja/privacy.html | 2 +- site/public/docs/privacy.html | 2 +- site/public/docs/zh/docker.html | 2 +- site/public/docs/zh/privacy.html | 2 +- site/public/llms-full.txt | 7 +- site/public/search/en.json | 2 +- site/public/search/ja.json | 2 +- site/public/search/zh.json | 2 +- site/worker.js | 224 ++++++++++++++-- 32 files changed, 791 insertions(+), 146 deletions(-) create mode 100644 site/daily.test.mjs diff --git a/.github/workflows/docker-daily.yml b/.github/workflows/docker-daily.yml index aaa98438a..386b5e399 100644 --- a/.github/workflows/docker-daily.yml +++ b/.github/workflows/docker-daily.yml @@ -1,15 +1,23 @@ name: Docker daily -# ghcr.io/yetone/magpie:daily is the newest release's image, moved once a -# day: magpie releases many times a day, and Renovate opened a PR for each -# one (YaoFur on X, "改成每天凌晨更新一次"). At 20:00 UTC (04:00 in -# China) it points :daily at whatever :latest is then, by digest; it never -# builds, and never touches latest, stable, edge or a version's tags. -# Releases themselves go out as fast as ever. +# ghcr.io/yetone/magpie:daily is the image of the Daily channel's release +# (Settings › Update channel › Daily; fishmagic80 on X, YaoFur's Renovate +# before that): once a day, the newest release out by 20:00 UTC (04:00 in +# China) whose own CI run passed and that has all its files, or an urgent +# one at once. Which release that is, is decided in one place only, +# site/worker.js's keepDaily, and served at /api/latest?channel=daily. This +# only reads that answer and points :daily at the image already built for +# that version (docker.yml); it never builds, and never touches latest, +# stable, edge or a version's tags. While the feed can't be read the tag +# stays where it was. Releases themselves go out as fast as ever. on: schedule: - - cron: '0 20 * * *' + - cron: '53 * * * *' + # a release's image is pushed: an urgent one is Daily at once + workflow_run: + workflows: [Docker] + types: [completed] workflow_dispatch: concurrency: @@ -18,10 +26,11 @@ concurrency: env: IMAGE: ghcr.io/${{ github.repository_owner }}/magpie + FEED: https://usemagpie.ai/api/latest?channel=daily jobs: daily: - if: github.repository == 'yetone/magpie' + if: github.repository == 'yetone/magpie' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') runs-on: ubuntu-24.04 permissions: contents: read @@ -35,19 +44,28 @@ jobs: username: ${{ github.actor }} password: ${{ github.token }} - - name: Point daily at the newest release's image + - name: Point daily at the Daily release's image run: | set -euo pipefail + if ! BODY=$(curl -fsS --retry 3 --max-time 30 "$FEED"); then + echo "::warning::the Daily feed couldn't be read; $IMAGE:daily stays where it was" + exit 0 + fi + V=$(jq -r '.version // empty' <<<"$BODY") + if [[ ! "$V" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::warning::the Daily feed named no release ($V); $IMAGE:daily stays where it was" + exit 0 + fi # an image is the platforms' manifests in it, however its index # is written digest() { docker buildx imagetools inspect "$1" --format '{{json .}}' | jq -er '[.manifest.manifests[]?.digest] | sort | join(",") | select(. != "")'; } - WANT=$(digest "$IMAGE:latest") # no latest image is a red run + WANT=$(digest "$IMAGE:$V") # no image for the Daily release is a red run HAVE=$(digest "$IMAGE:daily" 2>/dev/null || true) if [[ "$HAVE" == "$WANT" ]]; then - echo "$IMAGE:daily is latest already ($WANT)" + echo "$IMAGE:daily is $V already ($WANT)" exit 0 fi - docker buildx imagetools create -t "$IMAGE:daily" "$IMAGE:latest" + docker buildx imagetools create -t "$IMAGE:daily" "$IMAGE:$V" GOT=$(digest "$IMAGE:daily") - echo "$IMAGE:daily is now latest ($GOT, was ${HAVE:-none})" + echo "$IMAGE:daily is now $V ($GOT, was ${HAVE:-none})" test "$GOT" == "$WANT" diff --git a/docs/reference.md b/docs/reference.md index d993f744a..5174c99c6 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -3415,7 +3415,8 @@ release page's redirect when the API is rate-limited), with its check as the feed's: the ed25519 signature against the key built into the binary, the version in the signed message, each file's hash from the signed list. A release read this way must be signed whatever its version. The -Stable channel and a `MAGPIE_UPDATE_FEED` of your own don't fall back. +Stable and Daily channels and a `MAGPIE_UPDATE_FEED` of your own don't +fall back. Settings → Network → *Update source* (`"updateSource"` in settings.json, `magpie settings set updateSource github`, this computer's own) chooses where an @@ -3424,9 +3425,9 @@ usemagpie.ai, then GitHub. `site` (usemagpie.ai only) never goes to GitHub, for the release or for a file. `github` (GitHub only) reads the release from `yetone/magpie-releases` without asking the feed, and downloads files from github.com (through a `--mirror` when one is given, then GitHub's API route); -usemagpie.ai is not asked. On the Stable channel the list of releases is only -the site's, so `github` still reads it from the feed and downloads from -GitHub. A `MAGPIE_UPDATE_FEED` of your own is never overridden. Every source +usemagpie.ai is not asked. On the Stable and Daily channels the release is +only the site's pick, so `github` still reads it from the feed and downloads +from GitHub. A `MAGPIE_UPDATE_FEED` of your own is never overridden. Every source is held to the same signature and hashes (`Release.verify`). Release files are downloaded from usemagpie.ai's copy on Cloudflare R2 @@ -3531,11 +3532,23 @@ trusted to the site over HTTPS and the SHA-256 the site gives. ### Update channel -magpie takes every version as it comes out unless you choose Stable, in -*Settings → About → Update channel* or with `magpie update channel stable` +magpie takes every version as it comes out unless you choose Daily or +Stable, in *Settings → About → Update channel* or with +`magpie update channel daily` or `magpie update channel stable` (`magpie update channel every` goes back; `magpie update channel` prints -the one in use). It is saved as `"updateChannel": "stable"` in -settings.json, and the app and `magpie update` both follow it. +the one in use). It is saved as `"updateChannel": "daily"` or `"stable"` +in settings.json, and the app and `magpie update` both follow it. + +Daily is one version a day. Each day at 20:00 UTC it becomes the newest +release out by then whose Test run on `main` passed (the run on the +release's own commit) and that has all of its 17 files; a day with no +such release keeps the day before's. A release marked urgent goes to Daily +at once. What's new lists every version since yours as one list, and the +Version row names the newest out on Every version as it does on Stable. +The site works it out every quarter hour +(`https://usemagpie.ai/api/latest?channel=daily`, +`usemagpie.ai/download/daily/`); the Docker image's `daily` tag +follows it. Stable is one version a week. Each Monday at 00:00 UTC it becomes the newest release that had been out for three days by then (Friday 00:00 @@ -3834,9 +3847,11 @@ VPN such as Tailscale or WireGuard; a reverse proxy or tunnel forwarding to Magpie over loopback needs a gateway key from its clients, as the network does. The image's tags: `latest` is the newest release, and magpie releases -several times a day. `daily` is the newest release as of 20:00 UTC, moved -once a day (`.github/workflows/docker-daily.yml`), for Renovate or -Watchtower to update at most daily (with Renovate, pin its digest); +several times a day. `daily` is the desktop app's Daily channel: once a +day at 20:00 UTC, the newest release whose CI run passed, or an urgent one +at once (`.github/workflows/docker-daily.yml` follows +`usemagpie.ai/api/latest?channel=daily`), for Renovate or Watchtower to +update at most daily (with Renovate, pin its digest); `stable` is the desktop app's Stable channel, one a week. `0.1.N` is one release, `0.1` the newest of its line, and `edge` every change on `main`. diff --git a/internal/cli/main.go b/internal/cli/main.go index ce490c751..6c263b6bb 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -191,8 +191,9 @@ const usage = `magpie — one place to pick every agent's model http(s):// or socks5:// proxy for it; --mirror: a GitHub download mirror put before the github.com URL (none unless given; still checked against usemagpie.ai's SHA-256) magpie update mirror [|off] the mirror every update, the app's own too, is downloaded through - magpie update channel [stable|every] which versions updates offer: stable (one a week, an urgent one at - once) or every version as it comes out (the default) + magpie update channel [stable|daily|every] which versions updates offer: stable (one a week), daily (one + a day that passed its tests), an urgent one at once on both, or every + version as it comes out (the default) magpie update auto [on|off] [download|notify] [30m|1h|6h|24h] whether the app looks for updates by itself, how often (6h), and whether it downloads one at once or only says it is out (notify: for metered networks) diff --git a/internal/cli/update_channel_cli_test.go b/internal/cli/update_channel_cli_test.go index 296e819a9..248ee562c 100644 --- a/internal/cli/update_channel_cli_test.go +++ b/internal/cli/update_channel_cli_test.go @@ -8,7 +8,7 @@ import ( "github.com/yetone/magpie/internal/settings" ) -// magpie update channel stable|every saves Settings' Update channel +// magpie update channel stable|daily|every saves Settings' Update channel // (ssharpcc on X); with nothing after it, it only says which; anything // else is refused and nothing is saved. func TestUpdateChannelCmd(t *testing.T) { @@ -26,6 +26,9 @@ func TestUpdateChannelCmd(t *testing.T) { {[]string{"update", "channel", "every"}, "", false}, {[]string{"update", "channel", "Stable"}, "stable", false}, {[]string{"update", "channel", "all"}, "", false}, + {[]string{"update", "channel", "daily"}, "daily", false}, + {[]string{"update", "channel", "Daily"}, "daily", false}, + {[]string{"update", "channel", "weekly"}, "daily", true}, } { err := updateCmd(c.args) if (err != nil) != c.bad { diff --git a/internal/cli/update_cli.go b/internal/cli/update_cli.go index abfd72735..70860ffe6 100644 --- a/internal/cli/update_cli.go +++ b/internal/cli/update_cli.go @@ -107,33 +107,40 @@ func updateMirrorCmd(args []string) error { return nil } -// updateChannelCmd is `magpie update channel [stable|every]`: which -// versions an update is offered (settings.UpdateChannel, ssharpcc on X): -// Stable, one a week and an urgent one at once, or every version as it -// comes out. With none, it says which. +// updateChannelCmd is `magpie update channel [stable|daily|every]`: which +// versions an update is offered (settings.UpdateChannel, ssharpcc and +// fishmagic80 on X): Stable, one a week and an urgent one at once; Daily, +// one a day that passed its tests and an urgent one at once; or every +// version as it comes out. With none, it says which. func updateChannelCmd(args []string) error { s := settings.Load() if len(args) > 1 { - return fmt.Errorf("magpie update channel takes stable or every") + return fmt.Errorf("magpie update channel takes stable, daily or every") } if len(args) == 1 { switch strings.ToLower(strings.TrimSpace(args[0])) { case "stable": s.UpdateChannel = settings.UpdateStable + case "daily": + s.UpdateChannel = settings.UpdateDaily case "every", "all": s.UpdateChannel = "" default: - return fmt.Errorf("magpie update channel takes stable or every, not %q", args[0]) + return fmt.Errorf("magpie update channel takes stable, daily or every, not %q", args[0]) } if err := settings.Save(s); err != nil { return err } } - if s.UpdateChannel == settings.UpdateStable { - fmt.Println("update channel: stable", muted.Render("· a version a week, the newest out three days as the week began, and an urgent one at once · magpie update channel every: each one as it comes out")) + switch s.UpdateChannel { + case settings.UpdateStable: + fmt.Println("update channel: stable", muted.Render("· a version a week, the newest out three days as the week began, and an urgent one at once · magpie update channel daily: one a day · every: each one as it comes out")) + return nil + case settings.UpdateDaily: + fmt.Println("update channel: daily", muted.Render("· a version a day, the newest that passed its tests, and an urgent one at once · magpie update channel stable: one a week · every: each one as it comes out")) return nil } - fmt.Println("update channel: every version", muted.Render("· each one as it comes out · magpie update channel stable: one a week, an urgent one at once")) + fmt.Println("update channel: every version", muted.Render("· each one as it comes out · magpie update channel daily: one a day · stable: one a week; an urgent one at once on both")) return nil } @@ -220,8 +227,8 @@ func updateCmd(args []string) error { } if !update.Newer(rel.Version, version) { if update.Released(version) { - if update.Stable() { - fmt.Println(green.Render("✓"), "magpie", version, muted.Render("is up to date on the stable channel (stable is "+rel.Version+")")) + if ch := update.Channel(); ch != "" { + fmt.Println(green.Render("✓"), "magpie", version, muted.Render("is up to date on the "+ch+" channel ("+ch+" is "+rel.Version+")")) } else { fmt.Println(green.Render("✓"), "magpie", version, muted.Render("is the latest")) } diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 32195d9cb..2b6ac5ecc 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -4275,6 +4275,10 @@ input.words.window-in { width: 96px; font-variant-numeric: tabular-nums; } /* the masking rules' add row: its words in full, then on a line of their own a name, prefix or regex, the match taking the room left, Add */ .row.pref.rule-row { flex-wrap: wrap; row-gap: 8px; } +/* three channels: the switch goes under its name when the row is narrow */ +.row.pref.update-channel-row { flex-wrap: wrap; row-gap: 8px; } +.row.pref.update-channel-row .who { flex: 1 1 14em; min-width: 0; } +.prefs .row.pref.update-channel-row .val { max-width: 100%; } .row.pref.rule-row .who { flex: 1 1 100%; } .row.pref.rule-row .sub { white-space: normal; } /* Busy models last: six choices don't fit beside their words in a phone-wide diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 66b61aa31..c5560d46e 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -20252,14 +20252,15 @@ function renderSettings() { segs(UPDATE_EVERY.map((m) => [m, m < 60 ? t("{n} min", { n: m }) : t("{n} h", { n: m / 60 })]), s.updateEvery || 360, (updateEvery) => savePrefs({ ...keep, updateEvery }))).classList.add("update-every-row", ...(s.noAutoUpdate ? ["off"] : [])); // which versions an update offers (ssharpcc on X): every one as it comes - // out, or Stable, one a week and an urgent one at once, chosen by the - // update feed. It holds for the version row's Check too, so it stays lit - // with automatic updates off. - row(t("Update channel"), s.updateChannel === "stable" - ? t("One version a week, out for three days first, and urgent fixes at once. What's new lists every change since yours") - : t("Every version as soon as it is out"), "", - segs([["every", t("Every version")], ["stable", t("Stable")]], s.updateChannel === "stable" ? "stable" : "every", - (v) => savePrefs({ ...keep, updateChannel: v === "stable" ? "stable" : "" }))).classList.add("update-channel-row"); + // out; Daily, one a day that passed its tests (fishmagic80 on X); or + // Stable, one a week; urgent ones at once on both, chosen by the update + // feed. It holds for the version row's Check too, so it stays lit with + // automatic updates off. + const uc = ["stable", "daily"].includes(s.updateChannel) ? s.updateChannel : "every"; + row(t("Update channel"), t(uc === "stable" ? "One version a week, out for three days first, and urgent fixes at once. What's new lists every change since yours" + : uc === "daily" ? "One version a day, the newest that passed its tests, and urgent fixes at once. What's new lists every change since yours" : "Every version as soon as it is out"), "", + segs([["every", t("Every version")], ["daily", t("Daily")], ["stable", t("Stable")]], uc, + (v) => savePrefs({ ...keep, updateChannel: v === "every" ? "" : v }))).classList.add("update-channel-row"); // whether a newer version found is downloaded at once, or only said to // be out and downloaded on a click (#2296): a metered network or a // proxy billed by traffic. It holds for the version row's Check too. @@ -22705,8 +22706,10 @@ async function renderUpdate(r, u) { again(1000); break; case "latest": - // Stable's says the newest out (ylspcm on X) - sub.textContent = u.newest ? t("Up to date on Stable · {v} is out on Every version", { v: u.newest }) : t(u.channel ? "Up to date on Stable" : "Up to date"); + // Stable's and Daily's say the newest out (ylspcm on X) + sub.textContent = u.channel === "daily" + ? t(u.newest ? "Up to date on Daily · {v} is out on Every version" : "Up to date on Daily", { v: u.newest }) + : u.newest ? t("Up to date on Stable · {v} is out on Every version", { v: u.newest }) : t(u.channel ? "Up to date on Stable" : "Up to date"); if (u.newest) btn(t("Switch to Every version"), () => savePrefs({ ...prefsKeep(prefs), updateChannel: "" })); btn(t("Check"), check); break; diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 20918fa7e..4ea79b36f 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -4107,6 +4107,10 @@ const I18N = { "Up to date": "已是最新", "Up to date on Stable": "稳定版已是最新", "Up to date on Stable · {v} is out on Every version": "稳定版已是最新 · 尝鲜版已有 {v}", + "Daily": "每日版", + "Up to date on Daily": "每日版已是最新", + "Up to date on Daily · {v} is out on Every version": "每日版已是最新 · 尝鲜版已有 {v}", + "One version a day, the newest that passed its tests, and urgent fixes at once. What's new lists every change since yours": "每天一个版本,选通过测试的最新版;紧急修复立即推送。「更新内容」会列出你当前版本以来的全部改动", "Switch to Every version": "改用尝鲜版", "What's new": "更新内容", "The release notes since the last update": "上次更新以来的更新说明", @@ -9400,6 +9404,10 @@ const I18N = { "Up to date": "已是最新", "Up to date on Stable": "穩定版已是最新", "Up to date on Stable · {v} is out on Every version": "穩定版已是最新 · 搶先版已有 {v}", + "Daily": "每日版", + "Up to date on Daily": "每日版已是最新", + "Up to date on Daily · {v} is out on Every version": "每日版已是最新 · 搶先版已有 {v}", + "One version a day, the newest that passed its tests, and urgent fixes at once. What's new lists every change since yours": "每天一個版本,選通過測試的最新版;緊急修正立即推送。「更新內容」會列出你目前版本以來的全部變更", "Switch to Every version": "改用搶先版", "What's new": "更新內容", "The release notes since the last update": "上次更新以來的更新說明", @@ -14708,6 +14716,10 @@ const I18N = { "Up to date": "最新です", "Up to date on Stable": "安定版では最新です", "Up to date on Stable · {v} is out on Every version": "安定版では最新です · 先行版では {v} が出ています", + "Daily": "デイリー版", + "Up to date on Daily": "デイリー版では最新です", + "Up to date on Daily · {v} is out on Every version": "デイリー版では最新です · 先行版では {v} が出ています", + "One version a day, the newest that passed its tests, and urgent fixes at once. What's new lists every change since yours": "テストに通った最新のバージョンを 1 日 1 回、緊急の修正はすぐに届けます。新機能には今のバージョン以降のすべての変更がまとめて表示されます", "Switch to Every version": "先行版に切り替える", "What's new": "新機能", "The release notes since the last update": "前回のアップデート以降のリリースノート", @@ -20025,6 +20037,10 @@ const I18N = { "Up to date": "Aktuell", "Up to date on Stable": "Aktuell auf Stabil", "Up to date on Stable · {v} is out on Every version": "Aktuell auf Stabil · Unter Jede Version ist {v} erschienen", + "Daily": "Täglich", + "Up to date on Daily": "Aktuell auf Täglich", + "Up to date on Daily · {v} is out on Every version": "Aktuell auf Täglich · Unter Jede Version ist {v} erschienen", + "One version a day, the newest that passed its tests, and urgent fixes at once. What's new lists every change since yours": "Eine Version pro Tag, die neueste mit bestandenen Tests, dringende Korrekturen sofort. Neuigkeiten listet alle Änderungen seit Ihrer Version", "Switch to Every version": "Zu Jede Version wechseln", "What's new": "Neuigkeiten", "The release notes since the last update": "Die Versionshinweise seit dem letzten Update", diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.go index dc751438f..d717a3aa7 100644 --- a/internal/gui/core_budget_test.go +++ b/internal/gui/core_budget_test.go @@ -17,8 +17,8 @@ import ( // never what pays for a change (#5918); the history of each number is in // `git log -L` of this file. const ( - appScriptBudget = 1_086_464 // app.js: 1,080,614 at 8016205e3, with the 5,653 of room it had; +123 for a sidebar list folded from its page's row (hkwok06 on X), its chevron and fold in navicons.js, imported with the first list; +57 for each account of a provider's Usage card in a card of its own (normalcoder_ on X), past the 24 of room left; +17 for an allowance card's wallet line under its rings (apple_test_src on X), the one filter shared with its text line - coreScriptBudget = 1_270_554 // every core script at 8016205e3, the old measure 682 over its cap there (#5918); +367 for the model test on a chosen account (tmr11235), no page left to move it to; +151 for the provider menu's "Only on this device" item and its four translations; +458 for Settings › About's Report a problem row and its translations; +113 for withScheme, the one rule every typed address goes through (eachg0 on X), cut to the shortest form that keeps it whole; +10 for the kept whole's tooltip (Musikrv77852 on X), the past-cycle line reused for it, no page left to move it to; +1,112 for Codex's Open button and its Open Codex with menu (Yink88564391 on X), packed to the shortest form, no page left to move them to; +168 for Discover's long lists drawn in part (the owner, 11-13), after the rest of its hook moved into plugingrid.js, imported when Plugins first draws; +296 for the cap toggle and Smart sentences that say what they do and the Sign in on another computer row (Wing8Aqua on X), packed to the shortest form, no page left to move them to; +333 for In turn's figure in a provider's editor and its words naming the message that goes round (Wing8Aqua on X), the figure itself in rotfig.js, imported when In turn is first shown, the hook packed to the shortest form; +236 for a lone capped Codex account's row saying its turns go to the fallbacks when Codex is connected (not_4O4 on X), the two helpers inlined, no page left to move it to; +717 for omp's advisor (Awad_Yoo on X, #6408): its three rows moved into ompadvisor.js, imported when an omp's settings show, and what is left is the import, the role's " · off" and the Settings line's name, packed to the shortest form; +468 for a plugin's own file import (auth.import) in the import sheet, in the plugin's words (marchen_cc on X), packed to one statement; importSay is read as the Providers rows draw, so it has no lazy page to go to, and nothing else was moved out; +180 for Claude Magpie's own Claude Code folder (xMopf7RF on X, #6459): its Advanced fold in claudemagpie.js, imported when it first shows, and what is left is the import and the fold's place in the Separate app line, 216 bytes packed to the shortest form, less the 36 of room there was; +81 for the Use Claude Magpie button on Claude Desktop's row (xMopf7RF on X), drawn by claudemagpie.js too, what is left the one line that places it (#2710); +225 for the Hermes row's Other profiles lines (Norethcy on X), which 1d60b165c took out while each profile had a row and c96f33d65 left with no place at all, packed to the shortest form; the dead hermes# Default note went with it, and the Agents rows draw it, so there is no page to move it to; +397 for a key's own price rate (tnt12231 on X): its lines, check and placeholder in keyrates.js, imported when a provider with two or more keys opens, and what is left is the import, the draft's copy, Advanced opening for it, the save's one line and proxyLines drawing another kind of line; +316 for an image or video model's chip saying what it makes from its right-click (iceloon on X): the chat chip's Makes… now shared with it, and the media chip's Copy model ID left out, packed to the shortest form; the provider's editor draws it, so there is no page to move it to; +67 for the Claude Code · Claude Magpie row saying it is on magpie through Claude Magpie (xMopf7RF on X), one line in connectLine with the shortest words that say it; the Agents rows draw it, so there is no page to move it to; +12 for AIGoCode's logo in pngIcons (MindfulReturn on X), the list every drawn icon is looked up in; +491 for each cost in the tray panel's and Requests' chart and ranking in its own provider's currency (onkashiko on X): ledProv and the provider passed through, packed to the shortest form; drawLedColumns and drawLedRank are shared by the panel, so there is no page to move it to; +326 for the Qwen AI platform's Token Plan sign-in (imthe99galaxy on X): its field, sign-in and wait in qianwenplan.js, imported when such a provider's editor opens, and what is left is the import and one quotaError line for its two refusals, packed to the shortest form; quotaError reads every card's error, so there is no page to move it to; +72 for Copy all keys (emilochen on X): its row in keyrates.js, imported when a provider with two or more keys opens through keyRateField, now told which of its parts to draw, and what is left is the one line that places it; +83 for the page saying it has gone from view, so what its Sessions and Usage pages keep goes in 30 s and not 7 minutes (P0 memory): folded into the visibilitychange listener every window has, packed to the shortest form, so there is no page to move it to; +270 for Providers' Select, to remove several at once (eiyuuzaki2333 on X): its rows, bar, removal and keys in pvpick.js, imported when Select is first clicked, and what is left is pvSel, the button's click and two lines in renderProviders, which draws the list, so there is no page to move it to; +81 for each account of a provider's Usage card in a card of its own (normalcoder_ on X): one line that makes the box, its brief look left to CSS, and renderQuotas, which draws every card, so there is no page to move it to; +17 for Kimi Code's booster balance under an allowance card's rings in the tray panel (apple_test_src on X): the card's text line and the wallet line share one filter, packed to the shortest form; panelQuotaCard draws every card, so there is no page to move it to; +51 for what a failed plugin install left in plugins/, listed under Installed with a Remove (CHENGJIAHEGOXIS on X): its section in plugininstalled.js as pmLeftovers, imported when Plugins first draws, and what is left is the one call after drawInstalled; draw is what draws the page, so there is no page to move it to; +123 for a sidebar list folded from its page's row (hkwok06 on X): the chevron, its click and the fold kept per page in navicons.js, imported with the first list, and what is left is the folded list read beside the hidden pages' (navList, which navMine now shares) and the two rows' clicks asking navFold first; navSubs draws every list, so there is no page to move it to + appScriptBudget = 1_086_802 // app.js: 1,080,614 at 8016205e3, with the 5,653 of room it had; +123 for a sidebar list folded from its page's row (hkwok06 on X), its chevron and fold in navicons.js, imported with the first list; +57 for each account of a provider's Usage card in a card of its own (normalcoder_ on X), past the 24 of room left; +17 for an allowance card's wallet line under its rings (apple_test_src on X), the one filter shared with its text line; +338 for the Daily update channel (fishmagic80 on X): its segment, its line under Update channel and the version row's two Up to date on Daily words, packed to the shortest form (one t() per choice); Settings › About and renderUpdate draw them on every window, so there is no page to move them to + coreScriptBudget = 1_270_892 // every core script at 8016205e3, the old measure 682 over its cap there (#5918); +367 for the model test on a chosen account (tmr11235), no page left to move it to; +151 for the provider menu's "Only on this device" item and its four translations; +458 for Settings › About's Report a problem row and its translations; +113 for withScheme, the one rule every typed address goes through (eachg0 on X), cut to the shortest form that keeps it whole; +10 for the kept whole's tooltip (Musikrv77852 on X), the past-cycle line reused for it, no page left to move it to; +1,112 for Codex's Open button and its Open Codex with menu (Yink88564391 on X), packed to the shortest form, no page left to move them to; +168 for Discover's long lists drawn in part (the owner, 11-13), after the rest of its hook moved into plugingrid.js, imported when Plugins first draws; +296 for the cap toggle and Smart sentences that say what they do and the Sign in on another computer row (Wing8Aqua on X), packed to the shortest form, no page left to move them to; +333 for In turn's figure in a provider's editor and its words naming the message that goes round (Wing8Aqua on X), the figure itself in rotfig.js, imported when In turn is first shown, the hook packed to the shortest form; +236 for a lone capped Codex account's row saying its turns go to the fallbacks when Codex is connected (not_4O4 on X), the two helpers inlined, no page left to move it to; +717 for omp's advisor (Awad_Yoo on X, #6408): its three rows moved into ompadvisor.js, imported when an omp's settings show, and what is left is the import, the role's " · off" and the Settings line's name, packed to the shortest form; +468 for a plugin's own file import (auth.import) in the import sheet, in the plugin's words (marchen_cc on X), packed to one statement; importSay is read as the Providers rows draw, so it has no lazy page to go to, and nothing else was moved out; +180 for Claude Magpie's own Claude Code folder (xMopf7RF on X, #6459): its Advanced fold in claudemagpie.js, imported when it first shows, and what is left is the import and the fold's place in the Separate app line, 216 bytes packed to the shortest form, less the 36 of room there was; +81 for the Use Claude Magpie button on Claude Desktop's row (xMopf7RF on X), drawn by claudemagpie.js too, what is left the one line that places it (#2710); +225 for the Hermes row's Other profiles lines (Norethcy on X), which 1d60b165c took out while each profile had a row and c96f33d65 left with no place at all, packed to the shortest form; the dead hermes# Default note went with it, and the Agents rows draw it, so there is no page to move it to; +397 for a key's own price rate (tnt12231 on X): its lines, check and placeholder in keyrates.js, imported when a provider with two or more keys opens, and what is left is the import, the draft's copy, Advanced opening for it, the save's one line and proxyLines drawing another kind of line; +316 for an image or video model's chip saying what it makes from its right-click (iceloon on X): the chat chip's Makes… now shared with it, and the media chip's Copy model ID left out, packed to the shortest form; the provider's editor draws it, so there is no page to move it to; +67 for the Claude Code · Claude Magpie row saying it is on magpie through Claude Magpie (xMopf7RF on X), one line in connectLine with the shortest words that say it; the Agents rows draw it, so there is no page to move it to; +12 for AIGoCode's logo in pngIcons (MindfulReturn on X), the list every drawn icon is looked up in; +491 for each cost in the tray panel's and Requests' chart and ranking in its own provider's currency (onkashiko on X): ledProv and the provider passed through, packed to the shortest form; drawLedColumns and drawLedRank are shared by the panel, so there is no page to move it to; +326 for the Qwen AI platform's Token Plan sign-in (imthe99galaxy on X): its field, sign-in and wait in qianwenplan.js, imported when such a provider's editor opens, and what is left is the import and one quotaError line for its two refusals, packed to the shortest form; quotaError reads every card's error, so there is no page to move it to; +72 for Copy all keys (emilochen on X): its row in keyrates.js, imported when a provider with two or more keys opens through keyRateField, now told which of its parts to draw, and what is left is the one line that places it; +83 for the page saying it has gone from view, so what its Sessions and Usage pages keep goes in 30 s and not 7 minutes (P0 memory): folded into the visibilitychange listener every window has, packed to the shortest form, so there is no page to move it to; +270 for Providers' Select, to remove several at once (eiyuuzaki2333 on X): its rows, bar, removal and keys in pvpick.js, imported when Select is first clicked, and what is left is pvSel, the button's click and two lines in renderProviders, which draws the list, so there is no page to move it to; +81 for each account of a provider's Usage card in a card of its own (normalcoder_ on X): one line that makes the box, its brief look left to CSS, and renderQuotas, which draws every card, so there is no page to move it to; +17 for Kimi Code's booster balance under an allowance card's rings in the tray panel (apple_test_src on X): the card's text line and the wallet line share one filter, packed to the shortest form; panelQuotaCard draws every card, so there is no page to move it to; +51 for what a failed plugin install left in plugins/, listed under Installed with a Remove (CHENGJIAHEGOXIS on X): its section in plugininstalled.js as pmLeftovers, imported when Plugins first draws, and what is left is the one call after drawInstalled; draw is what draws the page, so there is no page to move it to; +123 for a sidebar list folded from its page's row (hkwok06 on X): the chevron, its click and the fold kept per page in navicons.js, imported with the first list, and what is left is the folded list read beside the hidden pages' (navList, which navMine now shares) and the two rows' clicks asking navFold first; navSubs draws every list, so there is no page to move it to; +338 for the Daily update channel (fishmagic80 on X): its segment, its line under Update channel and the version row's two Up to date on Daily words, packed to the shortest form (one t() per choice); Settings › About and renderUpdate draw them on every window, so there is no page to move them to ) // codeBytes is how many bytes of b are code: its blank lines, its lines diff --git a/internal/gui/tests/update-channel.test.cjs b/internal/gui/tests/update-channel.test.cjs index 5587487e2..39b64c201 100644 --- a/internal/gui/tests/update-channel.test.cjs +++ b/internal/gui/tests/update-channel.test.cjs @@ -24,6 +24,15 @@ const words = { de: { name: "Update-Kanal", every: "Jede Version", stable: "Stabil", auto: "Automatische Updates", off: "Aus", everySub: "Jede Version, sobald sie erscheint", stableSub: "Eine Version pro Woche" }, }; +// Daily (fishmagic80 on X): one a day, between the two +const dailyWords = { + en: { daily: "Daily", dailySub: "One version a day" }, + zh: { daily: "每日版", dailySub: "每天一个版本" }, + "zh-TW": { daily: "每日版", dailySub: "每天一個版本" }, + ja: { daily: "デイリー版", dailySub: "1 日 1 回" }, + de: { daily: "Täglich", dailySub: "Eine Version pro Tag" }, +}; + function settingsPayload(lang, ctl) { const s = { theme: "light", lang, tray: "panel", quotaLeft: false, currency: "usd", @@ -108,7 +117,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", const rowOf = (name) => page.locator("#about .row.pref", { has: page.locator(".name", { hasText: new RegExp("^" + name + "$") }) }); const channel = rowOf(w.name), auto = rowOf(w.auto); await channel.waitFor(); - assert.deepEqual((await channel.locator(".opt").allInnerTexts()).map((s) => s.trim()), [w.every, w.stable]); + assert.deepEqual((await channel.locator(".opt").allInnerTexts()).map((s) => s.trim()), [w.every, dailyWords[lang].daily, w.stable]); assert.equal((await channel.locator(".opt.on").innerText()).trim(), w.every); await channel.locator(".sub", { hasText: w.everySub }).waitFor(); @@ -143,6 +152,19 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await channel.waitFor(); assert.equal((await channel.locator(".opt.on").innerText()).trim(), w.stable); + // Daily + await showRow(page, channel); + before = await scrolls(page); + await channel.locator(".opt", { hasText: dailyWords[lang].daily }).click(); + await channel.locator(".sub", { hasText: dailyWords[lang].dailySub }).waitFor(); + assert.equal((await channel.locator(".opt.on").innerText()).trim(), dailyWords[lang].daily); + assert.equal(ctl.saves.at(-1).updateChannel, "daily"); + assert.equal(await scrolls(page), before, "the click must not scroll the page"); + await page.reload(); + await aboutTab(); + await channel.waitFor(); + assert.equal((await channel.locator(".opt.on").innerText()).trim(), dailyWords[lang].daily); + // back to every version await showRow(page, channel); before = await scrolls(page); diff --git a/internal/gui/tests/update-stable-newest.test.cjs b/internal/gui/tests/update-stable-newest.test.cjs index b8e769c7c..38fc278cb 100644 --- a/internal/gui/tests/update-stable-newest.test.cjs +++ b/internal/gui/tests/update-stable-newest.test.cjs @@ -25,6 +25,15 @@ const words = { de: { newest: "Aktuell auf Stabil · Unter Jede Version ist 0.1.410 erschienen", stable: "Aktuell auf Stabil", every: "Aktuell", go: "Zu Jede Version wechseln" }, }; +// Daily's (fishmagic80 on X): the same, under its own name +const dailyWords = { + en: { newest: "Up to date on Daily · 0.1.410 is out on Every version", daily: "Up to date on Daily" }, + zh: { newest: "每日版已是最新 · 尝鲜版已有 0.1.410", daily: "每日版已是最新" }, + "zh-TW": { newest: "每日版已是最新 · 搶先版已有 0.1.410", daily: "每日版已是最新" }, + ja: { newest: "デイリー版では最新です · 先行版では 0.1.410 が出ています", daily: "デイリー版では最新です" }, + de: { newest: "Aktuell auf Täglich · Unter Jede Version ist 0.1.410 erschienen", daily: "Aktuell auf Täglich" }, +}; + function settingsPayload(lang, ctl) { const s = { theme: "light", lang, tray: "panel", quotaLeft: false, currency: "usd", @@ -59,8 +68,8 @@ function server(lang, ctl) { return json(settingsPayload(lang, ctl)); } if (url.pathname === "/api/update") { - if (ctl.channel !== "stable") return json({ state: "latest", current: "0.1.400", latest: "0.1.410" }); - return json({ state: "latest", current: "0.1.400", latest: "0.1.390", channel: "stable", ...(ctl.newest ? { newest: ctl.newest } : {}) }); + if (ctl.channel !== "stable" && ctl.channel !== "daily") return json({ state: "latest", current: "0.1.400", latest: "0.1.410" }); + return json({ state: "latest", current: "0.1.400", latest: "0.1.390", channel: ctl.channel, ...(ctl.newest ? { newest: ctl.newest } : {}) }); } if (url.pathname === "/api/plugins") return json({ plugins: [] }); if (url.pathname === "/api/usage/quotas") return json([]); @@ -134,6 +143,22 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await openPart(page, "about"); await page.waitForFunction((s) => document.querySelector("#about .row.pref .sub.say")?.textContent === s, w.stable); assert.equal(await row.locator("button", { hasText: w.go }).count(), 0); + + // Daily, the newest out on every version: named, and the switch + ctl.channel = "daily"; + ctl.newest = "0.1.410"; + await page.reload(); + await settingsDrawn(page); + await openPart(page, "about"); + await page.waitForFunction((s) => document.querySelector("#about .row.pref .sub.say")?.textContent === s, dailyWords[lang].newest); + await row.locator("button", { hasText: w.go }).waitFor(); + // Daily with nothing newer + ctl.newest = ""; + await page.reload(); + await settingsDrawn(page); + await openPart(page, "about"); + await page.waitForFunction((s) => document.querySelector("#about .row.pref .sub.say")?.textContent === s, dailyWords[lang].daily); + assert.equal(await row.locator("button", { hasText: w.go }).count(), 0); assert.deepEqual(errors, []); }); } diff --git a/internal/gui/update.go b/internal/gui/update.go index aa8302127..0b864b873 100644 --- a/internal/gui/update.go +++ b/internal/gui/update.go @@ -49,12 +49,13 @@ type updater struct { mirror string // error: the mirror the failed download came through (#893) network bool // error: the network broke the download off (update.Network) staged string - // stable: latest was found on Settings' Stable channel; newest, the - // newest release on every version when that is newer than this one - // and Stable has nothing newer (ylspcm on X) - stable bool - newest string - aside string // Windows: where install moved the running exe, to put back + // channel: the channel latest was found on, Settings' Stable or Daily + // ("" every version); newest, the newest release on every version when + // that is newer than this one and the channel has nothing newer + // (ylspcm on X) + channel string + newest string + aside string // Windows: where install moved the running exe, to put back // in a .app: its binary, where this process started from bundleExe string // a version this computer wouldn't start (Smart App Control, #894), @@ -134,9 +135,10 @@ type updateJSON struct { // row says so in the app's language instead of the raw error Network bool `json:"network,omitempty"` Error string `json:"error,omitempty"` - // Channel: "stable" when the answer is Settings' Stable channel's; - // latest on it, Newest is the newest version out on every version, - // when newer than this one: Stable's "up to date" isn't the newest + // Channel: "stable" or "daily" when the answer is Settings' Stable or + // Daily channel's; latest on it, Newest is the newest version out on + // every version, when newer than this one: the channel's "up to date" + // isn't the newest Channel string `json:"channel,omitempty"` Newest string `json:"newest,omitempty"` Done int64 `json:"done,omitempty"` // downloading: bytes so far @@ -529,15 +531,18 @@ func (u *updater) run() { if lang == "" { lang = notesLang(trayLang(s.Lang, systemLang)) } - stable := s.UpdateChannel == settings.UpdateStable + channel := s.UpdateChannel + if channel != settings.UpdateStable && channel != settings.UpdateDaily { + channel = "" + } rel, err := update.LatestIn(cctx, lang) - // Stable has nothing newer than this one: the newest on every version + // Stable or Daily has nothing newer than this one: the newest on every version // is asked too, which the version row names. A bare "Up to date" on // Stable, with newer releases out, read as the check being wrong, and // the app was installed again by hand each time (ylspcm on X). Asked // before u.mu, which the pages' reads need. newest := "" - if stable && err == nil && !update.Newer(rel.Version, Version) { + if channel != "" && err == nil && !update.Newer(rel.Version, Version) { if every, e := update.LatestEvery(cctx, lang); e == nil && update.Newer(every.Version, Version) { newest = every.Version } @@ -546,9 +551,9 @@ func (u *updater) run() { defer u.mu.Unlock() u.newest = newest if err == nil && u.latest != nil && update.Newer(u.latest.Version, rel.Version) { - if stable != u.stable { + if channel != u.channel { // an older version than the one found before, on another - // channel: Settings' Update channel went to Stable since + // channel: Settings' Update channel went to Stable or Daily since // (ssharpcc on X). What was downloaded from every version // isn't put in, and the version found is the feed's again, as // if never found. @@ -597,7 +602,7 @@ func (u *updater) run() { u.state, u.err = "error", err.Error() return } - u.latest, u.notesIn, u.stable = rel, lang, stable + u.latest, u.notesIn, u.channel = rel, lang, channel if update.Released(Version) && update.Newer(rel.Version, Version) { u.behind = update.NoteBehind(Version, rel.Version, update.UrgentIn(rel.Notes)) if u.behind.Urgent == "" { @@ -772,8 +777,8 @@ func (u *updater) jsonIn(lang string) updateJSON { } } j := updateJSON{State: u.state, Current: Version, Error: u.err, Retry: u.retry} - if u.stable && u.latest != nil { - j.Channel = settings.UpdateStable + if u.channel != "" && u.latest != nil { + j.Channel = u.channel if u.state == "latest" { j.Newest = u.newest } diff --git a/internal/gui/update_channel_test.go b/internal/gui/update_channel_test.go index 9db8e5115..15a60ae76 100644 --- a/internal/gui/update_channel_test.go +++ b/internal/gui/update_channel_test.go @@ -138,6 +138,17 @@ func TestWhatsNewKeyedByChannel(t *testing.T) { if got := notesKey("zh"); got != "zh|stable" { t.Fatalf("stable: %q", got) } + s.UpdateChannel = settings.UpdateDaily + if err := settings.Save(s); err != nil { + t.Fatal(err) + } + if got := notesKey("zh"); got != "zh|daily" { + t.Fatalf("daily: %q", got) + } + s.UpdateChannel = settings.UpdateStable + if err := settings.Save(s); err != nil { + t.Fatal(err) + } t.Setenv("MAGPIE_NOTES_FEED", "http://127.0.0.1:1/") // never the real one oldV := Version Version = "0.1.100" @@ -241,8 +252,11 @@ func TestStableUpToDateNamesNewest(t *testing.T) { srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { asked.Add(1) v := "0.1.13" - if r.URL.Query().Get("channel") == "stable" { + switch r.URL.Query().Get("channel") { + case "stable": v = "0.1.11" + case "daily": + v = "0.1.12" } json.NewEncoder(w).Encode(update.Release{Version: v}) })) @@ -283,6 +297,17 @@ func TestStableUpToDateNamesNewest(t *testing.T) { if j := row(); j["state"] != "latest" || j["channel"] != "stable" || j["newest"] != nil { t.Fatalf("stable, the newest installed: %v", j) } + // Daily (fishmagic80 on X): the same, under its own name + channel(settings.UpdateDaily) + Version = "0.1.12" + if j := row(); j["state"] != "latest" || j["channel"] != "daily" || j["newest"] != "0.1.13" { + t.Fatalf("daily, 0.1.13 out: %v", j) + } + Version = "0.1.11" + if j := row(); j["state"] != "available" || j["latest"] != "0.1.12" || j["channel"] != "daily" { + t.Fatalf("daily, behind it: %v", j) + } + Version = "0.1.13" channel("") before := asked.Load() if j := row(); j["state"] != "latest" || j["channel"] != nil || j["newest"] != nil || asked.Load()-before != 1 { diff --git a/internal/gui/whatsnew.go b/internal/gui/whatsnew.go index 2347466b7..88e3ce551 100644 --- a/internal/gui/whatsnew.go +++ b/internal/gui/whatsnew.go @@ -269,8 +269,8 @@ func (n *whatsNew) get(ctx context.Context, all bool, lang string) whatsNewJSON // language, and the channel, whose cap on how many are shown (MostNotes) // differs. func notesKey(lang string) string { - if update.Stable() { - return lang + "|" + settings.UpdateStable + if ch := update.Channel(); ch != "" { + return lang + "|" + ch } return lang } diff --git a/internal/settings/settings.go b/internal/settings/settings.go index dc14ff0aa..411d5e09e 100644 --- a/internal/settings/settings.go +++ b/internal/settings/settings.go @@ -598,7 +598,9 @@ type Settings struct { // version as it comes out, the default; UpdateStable ("stable") one a // week, the newest that had been out three days as the week began, or // an urgent one (a security hole, a ban risk, lost data) at once, from - // the update feed's ?channel=stable (ssharpcc on X). Settings' Update + // the update feed's ?channel=stable (ssharpcc on X); UpdateDaily + // ("daily") one a day, the newest that passed its tests, or an urgent + // one at once, from ?channel=daily (fishmagic80 on X). Settings' Update // channel and magpie update channel set it. UpdateChannel string `json:"updateChannel,omitempty"` // Vision is the model that describes an image to a model that can't see @@ -1374,6 +1376,10 @@ const AnyProvider = "*/" // at once. const UpdateStable = "stable" +// UpdateDaily is UpdateChannel's Daily: a version a day, the newest that +// passed its tests and has all its files, an urgent one at once. +const UpdateDaily = "daily" + // The values of Settings.UpdateSource; "" is automatic. const ( UpdateSourceSite = "site" @@ -1575,8 +1581,9 @@ var ( Warmups = []string{"", "week", "all"} // TrayEvery are TrayUsageEvery's values, in minutes. TrayEvery = []int{1, 3, 5, 10, 30} - // UpdateChannels are UpdateChannel's values: every version, Stable. - UpdateChannels = []string{"", UpdateStable} + // UpdateChannels are UpdateChannel's values: every version, Daily, + // Stable. + UpdateChannels = []string{"", UpdateDaily, UpdateStable} // UpdateEveries are UpdateEvery's values, in minutes. UpdateEveries = []int{30, 60, 360, 1440} // TextSizes are TextSize's values, in percent. None is under 100: the @@ -2603,7 +2610,7 @@ func saveOwn(s Settings, recording, reads bool) error { return fmt.Errorf("magpie checks for updates every %v minutes, not %d", UpdateEveries, s.UpdateEvery) } if !slices.Contains(UpdateChannels, s.UpdateChannel) { - return fmt.Errorf("the update channel is %q (stable) or empty (every version), not %q", UpdateStable, s.UpdateChannel) + return fmt.Errorf("the update channel is %q, %q or empty (every version), not %q", UpdateStable, UpdateDaily, s.UpdateChannel) } if m := s.UpdateMirror; m != "" { if u, err := url.Parse(m); err != nil || (u.Scheme != "https" && u.Scheme != "http") || u.Host == "" { diff --git a/internal/settingsapi/settingsapi.go b/internal/settingsapi/settingsapi.go index 5e93556f9..49f8db921 100644 --- a/internal/settingsapi/settingsapi.go +++ b/internal/settingsapi/settingsapi.go @@ -69,7 +69,7 @@ var Choices = map[string][]string{ "claudeWarmup": {"off", "week", "all"}, "trayUsageEvery": ints(settings.TrayEvery), "dayStart": {"0", "1", "2", "3", "4", "5", "6"}, - "updateChannel": {settings.UpdateStable}, + "updateChannel": {settings.UpdateStable, settings.UpdateDaily}, "updateSource": {settings.UpdateSourceSite, settings.UpdateSourceGitHub}, "updateEvery": ints(settings.UpdateEveries), "searchFirst": {settings.SearchFirstModel, settings.SearchFirstAPI}, diff --git a/internal/update/channel_test.go b/internal/update/channel_test.go index 494e1aeef..46d0b1ec1 100644 --- a/internal/update/channel_test.go +++ b/internal/update/channel_test.go @@ -25,8 +25,8 @@ func stableFor(t *testing.T, channel string) { t.Cleanup(func() { settings.Save(before) }) } -// The Stable channel (ssharpcc on X): the feed is asked with -// channel=stable, and only then; every version asks it as before. The +// The Stable channel (ssharpcc on X) and Daily (fishmagic80 on X): the +// feed is asked with channel=stable or channel=daily, and only then; every version asks it as before. The // language goes with it either way. func TestLatestAsksTheChannel(t *testing.T) { var ( @@ -38,8 +38,11 @@ func TestLatestAsksTheChannel(t *testing.T) { asked = append(asked, r.URL.RawQuery) mu.Unlock() v := "0.1.1600" - if r.URL.Query().Get("channel") == "stable" { + switch r.URL.Query().Get("channel") { + case "stable": v = "0.1.1550" + case "daily": + v = "0.1.1590" } json.NewEncoder(w).Encode(Release{Version: v}) })) @@ -52,6 +55,8 @@ func TestLatestAsksTheChannel(t *testing.T) { {"", "", "", "0.1.1600"}, {settings.UpdateStable, "zh", "channel=stable&lang=zh", "0.1.1550"}, {settings.UpdateStable, "", "channel=stable", "0.1.1550"}, + {settings.UpdateDaily, "ja", "channel=daily&lang=ja", "0.1.1590"}, + {settings.UpdateDaily, "", "channel=daily", "0.1.1590"}, } { t.Run(fmt.Sprintf("%q %q", c.channel, c.lang), func(t *testing.T) { stableFor(t, c.channel) @@ -93,16 +98,55 @@ func TestStableNotesAreAll(t *testing.T) { if MostNotes() != StableMaxNotes { t.Fatalf("MostNotes on stable: %d", MostNotes()) } + // Daily's update is a day of releases, read as one list too + stableFor(t, settings.UpdateDaily) + if got := Between(notes, "0.1.1000", "0.1.1120"); len(got) != 120 || MostNotes() != StableMaxNotes { + t.Fatalf("daily: %d notes, MostNotes %d", len(got), MostNotes()) + } } -// Settings take "stable" or nothing; anything else is refused, and the +// Daily's release, like Stable's, is one only the site knows: a failed +// feed doesn't go on to GitHub's newest, and GitHub only doesn't skip the +// feed, either of which would hand the newest release to someone who chose +// one a day. +func TestDailyStaysOnTheFeed(t *testing.T) { + t.Setenv("MAGPIE_UPDATE_FEED", "") + for _, c := range []struct { + channel string + picked bool + }{{"", false}, {settings.UpdateDaily, true}, {settings.UpdateStable, true}} { + stableFor(t, c.channel) + if Picked() != c.picked || Channel() != c.channel { + t.Fatalf("%q: Picked %v, Channel %q", c.channel, Picked(), Channel()) + } + if fallsBack(context.Background()) == c.picked { + t.Errorf("%q: fallsBack %v", c.channel, !c.picked) + } + } + stableFor(t, settings.UpdateDaily) + s := settings.Load() + s.UpdateSource = settings.UpdateSourceGitHub + if err := settings.Save(s); err != nil { + t.Fatal(err) + } + if githubOnly() { + t.Error("GitHub only skipped Daily's feed") + } +} + +// Settings take "stable", "daily" or nothing; anything else is refused, and the // value is kept as saved. func TestUpdateChannelSaved(t *testing.T) { stableFor(t, settings.UpdateStable) if got := settings.Load().UpdateChannel; got != "stable" || !Stable() { t.Fatalf("saved stable, read %q", got) } - for _, bad := range []string{"Stable", "beta", "every", " stable"} { + stableFor(t, settings.UpdateDaily) + if got := settings.Load().UpdateChannel; got != "daily" || Stable() || Channel() != "daily" { + t.Fatalf("saved daily, read %q", got) + } + stableFor(t, settings.UpdateStable) + for _, bad := range []string{"Stable", "beta", "every", " stable", "Daily", "weekly"} { s := settings.Load() s.UpdateChannel = bad if err := settings.Save(s); err == nil { diff --git a/internal/update/fallback.go b/internal/update/fallback.go index 1ddfa7e61..441fe36e5 100644 --- a/internal/update/fallback.go +++ b/internal/update/fallback.go @@ -44,17 +44,17 @@ var siteFeed = Site + "/api/latest" const maxSmall = 1 << 20 // fallsBack says whether a failed feed goes on to GitHub: the default -// feed, not the Stable channel, and not an ask already cancelled. +// feed, not the Stable or Daily channel, and not an ask already cancelled. func fallsBack(ctx context.Context) bool { - return ctx.Err() == nil && Feed() == siteFeed && !Stable() && Source() == "" + return ctx.Err() == nil && Feed() == siteFeed && !Picked() && Source() == "" } // githubOnly says whether the release is read from GitHub alone, with no // try at the feed: Settings' GitHub only, on the default feed and not on -// Stable (whose release only the site knows; its files still come from -// GitHub). +// Stable or Daily (whose release only the site knows; its files still come +// from GitHub). func githubOnly() bool { - return Feed() == siteFeed && !Stable() && Source() == settings.UpdateSourceGitHub + return Feed() == siteFeed && !Picked() && Source() == settings.UpdateSourceGitHub } // githubLatest is the newest release as GitHub gives it, verified. diff --git a/internal/update/notes.go b/internal/update/notes.go index 7ca4f6dd3..93b9e3d48 100644 --- a/internal/update/notes.go +++ b/internal/update/notes.go @@ -149,32 +149,50 @@ func withLang(feed, lang string) string { // often, and a long-unopened one would have pages of them. const MaxNotes = 40 -// StableMaxNotes is MaxNotes on the Stable channel, where an update is a -// week of releases and its notes are read as one list (ssharpcc on X): -// every one of them, as far as the site keeps them. +// StableMaxNotes is MaxNotes on the Stable and Daily channels, where an +// update is a week or a day of releases and its notes are read as one list +// (ssharpcc on X): every one of them, as far as the site keeps them. const StableMaxNotes = 1500 // MostNotes is how many releases' notes are shown at most on the channel // Settings name. func MostNotes() int { - if Stable() { + if Picked() { return StableMaxNotes } return MaxNotes } -// Stable is whether Settings' Update channel is Stable: the update feed is -// asked for a version a week, the newest that had been out three days as -// the week began (Monday 00:00 UTC), or an urgent one (a security hole, a -// ban risk, lost data) as soon as it is out. usemagpie.ai chooses it from -// the release list (site/worker.js, "The Stable channel"); a release is -// urgent when a line of its notes starts with "**Urgent release:**". -func Stable() bool { return settings.Shared().UpdateChannel == settings.UpdateStable } +// Channel is Settings' Update channel: settings.UpdateStable, the update +// feed asked for a version a week, the newest that had been out three days +// as the week began (Monday 00:00 UTC); settings.UpdateDaily, a version a +// day, the newest out by 20:00 UTC that passed its tests (the Test run on +// its commit) and has every file; either one with an urgent release (a +// security hole, a ban risk, lost data) as soon as it is out. "" is every +// version, and so is a value magpie doesn't know. usemagpie.ai chooses +// both from the release list (site/worker.js, "The Stable channel" and +// "The Daily channel"); a release is urgent when a line of its notes +// starts with "**Urgent release:**". +func Channel() string { + switch c := settings.Shared().UpdateChannel; c { + case settings.UpdateStable, settings.UpdateDaily: + return c + } + return "" +} -// withChannel is feed asking for Stable's release on the Stable channel, +// Picked is whether the update feed picks the version (Stable or Daily) +// rather than offering every one: only the site knows a picked release. +func Picked() bool { return Channel() != "" } + +// Stable is whether Settings' Update channel is Stable. +func Stable() bool { return Channel() == settings.UpdateStable } + +// withChannel is feed asking for the channel's release on Stable or Daily, // and feed as it is on every version. func withChannel(feed string) string { - if !Stable() { + ch := Channel() + if ch == "" { return feed } u, err := url.Parse(feed) @@ -182,7 +200,7 @@ func withChannel(feed string) string { return feed } q := u.Query() - q.Set("channel", settings.UpdateStable) + q.Set("channel", ch) u.RawQuery = q.Encode() return u.String() } diff --git a/site/daily.test.mjs b/site/daily.test.mjs new file mode 100644 index 000000000..9f854545e --- /dev/null +++ b/site/daily.test.mjs @@ -0,0 +1,252 @@ +// node --test site/: the Daily update channel (fishmagic80 on X) is picked +// once a day from the release ledger: the newest release out by 20:00 UTC +// with all its files and a green CI run of its own. GitHub, the edge cache +// and KV are stood in for; every clock is held. +import { test, beforeEach } from "node:test"; +import assert from "node:assert/strict"; +import worker, { dayCut, dailyOf, keepDaily, keepLedger, RELEASE_FILES, URGENT_MARK } from "./worker.js"; + +const DAY = 86400e3; +const HOUR = 3600e3; +const at = (iso) => Date.parse(iso); +const iso = (ms) => new Date(ms).toISOString(); + +test("dayCut: the 20:00 UTC on or before", () => { + assert.equal(iso(dayCut(at("2026-11-15T21:00:00Z"))), "2026-11-15T20:00:00.000Z"); + assert.equal(iso(dayCut(at("2026-11-15T20:00:00Z"))), "2026-11-15T20:00:00.000Z"); + assert.equal(iso(dayCut(at("2026-11-15T19:59:59Z"))), "2026-11-14T20:00:00.000Z"); + assert.equal(iso(dayCut(at("2027-01-01T03:00:00Z"))), "2026-12-31T20:00:00.000Z"); +}); + +test("dailyOf: the newest out by the cut with every file and a green run", () => { + const cut = at("2026-11-15T20:00:00Z"); + const r = (version, published, files, green) => ({ version, published, files, green }); + const list = [ + r("0.1.9", "2026-11-15T20:00:01Z", 17, true), // after the cut + r("0.1.8", "2026-11-15T19:00:00Z", 17, false), // red or no run + r("0.1.7", "2026-11-15T18:00:00Z", 16, true), // a file short + r("0.1.6", "2026-11-15T17:00:00Z", 17, true), + r("0.1.5", "2026-11-15T16:00:00Z", 17, true), + ]; + assert.equal(RELEASE_FILES, 17); + assert.equal(dailyOf(list, cut).version, "0.1.6"); + assert.equal(dailyOf([...list].reverse(), cut).version, "0.1.6"); + assert.equal(dailyOf(list.slice(0, 3), cut), null); + assert.equal(dailyOf([r("0.1.10", null, 17, true)], cut), null); +}); + +// --- the cron and the feed --- + +function kv() { + const m = new Map(); + const ns = { + m, + broken: false, + async get(key, opts = {}) { + if (ns.broken) throw new Error("kv down"); + const v = m.has(key) ? m.get(key) : null; + return v !== null && (opts.type === "json" || opts === "json") ? JSON.parse(v) : v; + }, + async put(key, v) { + m.set(key, String(v)); + }, + }; + return ns; +} + +// GITHUB is magpie-releases' list, newest first: {version, published, +// notes, files}. SHAS is each tag's commit in yetone/magpie, GREEN the +// commits the Test workflow passed. srcDown makes yetone/magpie's API fail. +let GITHUB = [], SHAS = {}, GREEN = [], srcDown = false, srcAsks = []; +const store = new Map(); +globalThis.caches = { + default: { + match: async (req) => (store.has(req.url) ? new Response(store.get(req.url)) : undefined), + put: async (req, res) => void store.set(req.url, await res.text()), + }, +}; +const names = Array.from({ length: RELEASE_FILES }, (_, i) => (i ? `magpie-file-${i}` : "magpie-linux-amd64")); +const gh = (r) => ({ + tag_name: "v" + r.version, + body: r.notes || "", + html_url: "https://github.com/r/v" + r.version, + published_at: r.published, + draft: false, + prerelease: false, + assets: names.slice(0, r.files ?? RELEASE_FILES).map((name) => ({ name, size: 7, browser_download_url: `https://dl/${r.version}/${name}` })), +}); +globalThis.fetch = async (u) => { + u = String(u); + if (u.startsWith("https://api.github.com/repos/yetone/magpie-releases/")) { + const path = u.split("/repos/yetone/magpie-releases/")[1]; + const tag = path.match(/^releases\/tags\/v(.+)$/); + if (tag) { + const r = GITHUB.find((r) => r.version === tag[1]); + return r ? Response.json(gh(r)) : new Response("{}", { status: 404 }); + } + if (path === "releases/latest") return Response.json(gh(GITHUB[0])); + const page = path.match(/^releases\?per_page=100(?:&page=(\d+))?$/); + if (page) { + const n = +(page[1] || 1); + return Response.json(GITHUB.slice((n - 1) * 100, n * 100).map(gh)); + } + } + if (u.startsWith("https://api.github.com/repos/yetone/magpie/")) { + const path = u.split("/repos/yetone/magpie/")[1]; + srcAsks.push(path); + if (srcDown) return new Response('{"message":"API rate limit exceeded"}', { status: 403 }); + if (path.startsWith("actions/workflows/test.yml/runs?")) { + assert.match(path, /branch=main/); + assert.match(path, /status=success/); + return Response.json({ workflow_runs: GREEN.map((head_sha) => ({ head_sha, conclusion: "success" })) }); + } + const refs = path.match(/^git\/matching-refs\/tags\/v(.+)$/); + if (refs) + return Response.json( + Object.entries(SHAS) + .filter(([v]) => v.startsWith(refs[1])) + .map(([v, sha]) => ({ ref: "refs/tags/v" + v, object: { sha, type: "commit" } })), + ); + } + const sums = u.match(/\/releases\/download\/v([^/]+)\/SHA256SUMS$/); + if (sums && GITHUB.some((r) => r.version === sums[1])) return new Response(`sum${sums[1]} magpie-linux-amd64\n`); + return new Response("not found", { status: 404 }); +}; + +beforeEach(() => { + store.clear(); + srcDown = false; + srcAsks = []; +}); + +// a day of releases, one an hour up to now: 0.1.(n) newest +function day(n, newest) { + GITHUB = Array.from({ length: n }, (_, i) => ({ version: `0.1.${n - i}`, published: iso(newest - i * HOUR), notes: `- change 0.1.${n - i}` })); + SHAS = Object.fromEntries(GITHUB.map((r) => [r.version, "sha" + r.version])); +} + +test("keepDaily: once a cut, the newest out by it with all files and its own green run", async () => { + const NOW = at("2026-11-15T20:05:00Z"); // just past the cut + day(30, NOW); // 0.1.30 out at 20:05, 0.1.29 at 19:05, ... + GITHUB.find((r) => r.version === "0.1.28").files = 16; // a file short + GREEN = ["sha0.1.28", "sha0.1.26", "sha0.1.25", "sha0.1.30"]; // 0.1.30 is after the cut + const env = { LEDGER: kv() }; + await keepLedger(env, NOW); + await keepDaily(env, NOW); + let d = JSON.parse(env.LEDGER.m.get("daily")); + assert.equal(d.v, "0.1.26"); + assert.equal(d.cut, "2026-11-15T20:00:00.000Z"); + + // later the same day: nothing asked, nothing moves, however green + srcAsks = []; + GREEN = [...GREEN, "sha0.1.29"]; + await keepDaily(env, NOW + 3 * HOUR); + assert.deepEqual(srcAsks, []); + assert.equal(JSON.parse(env.LEDGER.m.get("daily")).v, "0.1.26"); + + // the next cut: the newest by then + day(54, NOW + 24 * HOUR - 5 * 60e3); // 0.1.54 out at 19:00 the next day + GREEN = ["sha0.1.29", "sha0.1.52"]; + await keepLedger(env, NOW + DAY); + await keepDaily(env, NOW + DAY); + d = JSON.parse(env.LEDGER.m.get("daily")); + assert.equal(d.v, "0.1.52"); + assert.equal(d.cut, "2026-11-16T20:00:00.000Z"); +}); + +test("keepDaily: nothing green in reach keeps the last pick; GitHub failing writes nothing", async () => { + const NOW = at("2026-11-15T20:05:00Z"); + day(30, NOW); + GREEN = ["sha0.1.20"]; + const env = { LEDGER: kv() }; + await keepLedger(env, NOW); + await keepDaily(env, NOW); + assert.equal(JSON.parse(env.LEDGER.m.get("daily")).v, "0.1.20"); + + // a day with no green run: Daily stays, never goes back + day(54, NOW + DAY); + GREEN = ["sha0.1.10"]; + await keepLedger(env, NOW + DAY); + await keepDaily(env, NOW + DAY); + let d = JSON.parse(env.LEDGER.m.get("daily")); + assert.equal(d.v, "0.1.20"); + assert.equal(d.cut, "2026-11-16T20:00:00.000Z"); + + // GitHub says no: nothing written, the next run tries again + srcDown = true; + await keepDaily(env, NOW + 2 * DAY); + assert.equal(JSON.parse(env.LEDGER.m.get("daily")).cut, "2026-11-16T20:00:00.000Z"); + srcDown = false; + GREEN = ["sha0.1.40"]; + await keepDaily(env, NOW + 2 * DAY); + d = JSON.parse(env.LEDGER.m.get("daily")); + assert.equal(d.v, "0.1.40"); + assert.equal(d.cut, "2026-11-17T20:00:00.000Z"); + + // a ledger that can't be read: nothing written + env.LEDGER.broken = true; + await keepDaily(env, NOW + 3 * DAY); + env.LEDGER.broken = false; + assert.equal(JSON.parse(env.LEDGER.m.get("daily")).v, "0.1.40"); +}); + +test("keepDaily: tags are asked ten at a time, a bounded number of asks", async () => { + const NOW = at("2026-11-15T20:05:00Z"); + day(200, NOW); + GREEN = []; // nothing green: it looks as far as it may + const env = { LEDGER: kv() }; + await keepLedger(env, NOW); + await keepDaily(env, NOW); + const tagAsks = srcAsks.filter((p) => p.startsWith("git/")); + assert.ok(tagAsks.length <= 6, tagAsks.join(" ")); + assert.equal(env.LEDGER.m.get("daily"), undefined); // never known: no pick +}); + +const ctx = { waitUntil: (p) => p }; +const ask = async (path, env) => { + const res = await worker.fetch(new Request("https://usemagpie.ai" + path), env, ctx); + return { status: res.status, body: await res.json(), cache: res.headers.get("Cache-Control") }; +}; + +test("latest?channel=daily: the day's pick, an urgent release at once; 503 until a pick", async () => { + const now = Date.now(); + GITHUB = [ + { version: "0.1.4", published: iso(now), notes: "- newest" }, + { version: "0.1.3", published: iso(now - 2 * DAY), notes: "- daily one\n\n\n\n- 每日的" }, + { version: "0.1.2", published: iso(now - 3 * DAY), notes: "- old" }, + ]; + SHAS = { "0.1.4": "a4", "0.1.3": "a3", "0.1.2": "a2" }; + GREEN = ["a3", "a2"]; // 0.1.4's run hasn't finished + const env = { LEDGER: kv() }; + await keepLedger(env, now); + // before the cron has picked: unknown, never kept + let got = await ask("/api/latest?channel=daily", env); + assert.equal(got.status, 503); + assert.equal(got.cache, "no-store"); + assert.equal((await ask("/api/latest?channel=daily", {})).status, 503); + + await keepDaily(env, now); + got = await ask("/api/latest?channel=daily", env); + assert.equal(got.status, 200); + assert.equal(got.body.version, "0.1.3"); + assert.equal(got.body.channel, "daily"); + assert.equal(got.body.urgent, false); + assert.equal(got.body.notes, "- daily one"); + assert.equal((await ask("/api/latest?channel=daily&lang=zh", env)).body.notes, "- 每日的"); + // every version is as it was + assert.equal((await ask("/api/latest", env)).body.version, "0.1.4"); + + // an urgent release is Daily at once + GITHUB = [{ version: "0.1.5", published: iso(now), notes: `${URGENT_MARK} a ban risk\n\n- fix` }, ...GITHUB]; + await keepLedger(env, now); + store.clear(); + got = await ask("/api/latest?channel=daily", env); + assert.equal(got.body.version, "0.1.5"); + assert.equal(got.body.urgent, true); + + // /download/daily follows it; /download stays the newest + store.clear(); + const res = await worker.fetch(new Request("https://usemagpie.ai/download/daily/linux"), env, ctx); + assert.equal(res.status, 302); + assert.match(res.headers.get("Location"), /0\.1\.5/); +}); diff --git a/site/docker-tags.test.mjs b/site/docker-tags.test.mjs index 73cc846b6..79ed7ac26 100644 --- a/site/docker-tags.test.mjs +++ b/site/docker-tags.test.mjs @@ -1,7 +1,8 @@ // node --test site/: the Docker image's tags the docs name are tags a // workflow writes. magpie releases many times a day, and a Renovate user -// had a PR for each one (YaoFur on X): daily moves once a day, by -// .github/workflows/docker-daily.yml, and is in the docs in every language. +// had a PR for each one (YaoFur on X): daily is the Daily channel's +// release, moved once a day by .github/workflows/docker-daily.yml, and is +// in the docs in every language. import { test } from "node:test"; import assert from "node:assert/strict"; import { readFileSync, readdirSync } from "node:fs"; @@ -34,13 +35,13 @@ test("every tag the docs name is one a workflow writes", () => { } }); -test("daily moves once a day, to latest's image, without a build", () => { +test("daily follows the Daily channel's feed, without a build", () => { const y = read("../.github/workflows/docker-daily.yml"); - const crons = [...y.matchAll(/cron:\s*'([^']+)'/g)].map((m) => m[1]); - assert.equal(crons.length, 1, "one schedule"); - const [min, hour, dom, mon, dow] = crons[0].split(/\s+/); - assert.ok(/^\d+$/.test(min) && /^\d+$/.test(hour) && dom === "*" && mon === "*" && dow === "*", "once a day: " + crons[0]); - assert.match(y, /imagetools create -t "\$IMAGE:daily" "\$IMAGE:latest"/); + // the feed moves once a day (site/worker.js's keepDaily); the workflow + // only copies the image it names, by version + assert.match(y, /FEED: https:\/\/usemagpie\.ai\/api\/latest\?channel=daily/); + assert.match(y, /imagetools create -t "\$IMAGE:daily" "\$IMAGE:\$V"/); + assert.doesNotMatch(y, /\$IMAGE:latest/); assert.doesNotMatch(y, /build-push-action|docker (buildx )?build\s/); - assert.doesNotMatch(y, /workflow_run|push:|tags:/, "only the clock (and a click) moves it"); + assert.doesNotMatch(y, /push:|tags:/, "never a push of its own"); }); diff --git a/site/public/docs/docker.html b/site/public/docs/docker.html index a74b001be..dfe7168ae 100644 --- a/site/public/docs/docker.html +++ b/site/public/docs/docker.html @@ -150,7 +150,7 @@

- + diff --git a/site/public/docs/ja/docker.html b/site/public/docs/ja/docker.html index 1f0ff1cd5..ec5080e7a 100644 --- a/site/public/docs/ja/docker.html +++ b/site/public/docs/ja/docker.html @@ -150,7 +150,7 @@
Imageghcr.io/yetone/magpie, for linux/amd64 and linux/arm64
Tagslatest (the newest release), daily (the newest release as of 20:00 UTC, moved once a day), stable (the desktop app's Stable channel: a release a week, out three days first, or an urgent one at once), 0.1.1150 (one release), 0.1, edge (every change on main)
Tagslatest (the newest release), daily (the desktop app's Daily channel: once a day at 20:00 UTC, the newest release whose CI run passed, or an urgent one at once), stable (the desktop app's Stable channel: a release a week, out three days first, or an urgent one at once), 0.1.1150 (one release), 0.1, edge (every change on main)
Ports3425 the gateway agents call; 3430 the browser UI, when the container runs magpie web; it answers the gateway’s /v1 routes too, so a reverse proxy needs only this port
Volume/config: providers, keys, sign-ins, plugins and usage
Usernonroot (uid 65532)
- + diff --git a/site/public/docs/ja/privacy.html b/site/public/docs/ja/privacy.html index 4980c0221..882913a4e 100644 --- a/site/public/docs/ja/privacy.html +++ b/site/public/docs/ja/privacy.html @@ -234,7 +234,7 @@

usemagpie.ai に見えるもの

magpie はプライバシー設定にかかわらず、どのアプリも自分の更新サーバーに尋ねるのと同じように、自分のサイトにいくつか尋ねます。どのリクエストにもインストール ID やアカウントは付きません。

イメージghcr.io/yetone/magpie(linux/amd64 と linux/arm64)
タグlatest(最新リリース)、daily(毎日 20:00 UTC にその時点の最新リリースへ移る。1 日 1 回だけ)、stable(デスクトップ版の Stable チャンネルと同じ:公開から 3 日たったリリースが週に 1 つ、緊急リリースはすぐ)、0.1.1150(特定のリリース)、0.1、edge(main の変更ごと)
タグlatest(最新リリース)、daily(デスクトップ版の Daily チャンネルと同じ:毎日 20:00 UTC に、その時点で CI に通った最新リリースへ移る。1 日 1 回だけ、緊急リリースはすぐ)、stable(デスクトップ版の Stable チャンネルと同じ:公開から 3 日たったリリースが週に 1 つ、緊急リリースはすぐ)、0.1.1150(特定のリリース)、0.1、edge(main の変更ごと)
ポート3425 はエージェントが呼ぶゲートウェイ、3430 はコンテナが magpie web を動かすときのブラウザ UI。ゲートウェイの /v1 ルートにも応えるので、リバースプロキシはこのポートだけで足ります
ボリューム/config:プロバイダ、キー、サインイン、プラグイン、使用量
ユーザーnonroot(uid 65532)
- + diff --git a/site/public/docs/zh/privacy.html b/site/public/docs/zh/privacy.html index 76fad7f34..df99ccd17 100644 --- a/site/public/docs/zh/privacy.html +++ b/site/public/docs/zh/privacy.html @@ -234,7 +234,7 @@

usemagpie.ai 能看到什么

magpie 会向自己的网站请求几样东西,不受隐私设置影响,就像任何应用访问自己的更新服务器。这些请求都不带安装 ID 或账号。

镜像ghcr.io/yetone/magpie,支持 linux/amd64 和 linux/arm64
标签latest(最新正式版)、daily(每天北京时间 04:00 指向当时的最新正式版,一天只变一次)、stable(与桌面版的稳定版通道一致:每周一个已发布满三天的版本,紧急修复版立即跟上)、0.1.1150(某个版本)、0.1、edge(main 上的每次改动)
标签latest(最新正式版)、daily(与桌面版的每日版通道一致:每天北京时间 04:00 指向当时 CI 已通过的最新正式版,一天只变一次,紧急修复版立即跟上)、stable(与桌面版的稳定版通道一致:每周一个已发布满三天的版本,紧急修复版立即跟上)、0.1.1150(某个版本)、0.1、edge(main 上的每次改动)
端口3425 是 Agent 调用的网关;3430 是容器运行 magpie web 时的 Web 界面;它也响应网关的 /v1 路由,所以反向代理只需转发这一个端口
数据卷/config:供应商、密钥、登录、插件和用量
用户nonroot(uid 65532)