an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
feat(update): log the manual download, so the next release can count it
Chaitanya Giri84772813d1f4
diff --git a/src/main/updater.ts b/src/main/updater.tsindex 3aa245e2..7504c207 100644--- a/src/main/updater.ts+++ b/src/main/updater.ts@@ -427,6 +427,14 @@ export function initAutoUpdater(getWebContents: () => WebContents | null): voidconst href = typeof url === 'string' ? url : `https://github.com/${REPO}/releases/latest`;// Only ever open the project's releases page — this is not a generic opener.if (!href.startsWith(`https://github.com/${REPO}/`)) return { ok: false };+ // An asset URL means the badge's download click, not the notes link. It is+ // the only positive trace the manual path leaves, and it has to be written+ // by the build being REPLACED, so the version that reads it is the next one+ // — analytics.ts (update_applied.via) picks it up from 0.4.6, and until then+ // this line is here purely so there is something to pick up. Nothing else+ // depends on it and openExternal has already been decided above.+ const asset = /\/releases\/download\/v([0-9][^/]*)\//.exec(href);+ if (asset) logLine(`manual download opened: ${asset[1]}`);void shell.openExternal(href);return { ok: true };});diff --git a/test/update-applied.test.cjs b/test/update-applied.test.cjsindex d14322a4..708b58c1 100644--- a/test/update-applied.test.cjs+++ b/test/update-applied.test.cjs@@ -413,6 +413,35 @@ test('updater.ts still emits the exact lines via reads', () => {);});+test('the manual-download breadcrumb matches the URL the badge actually opens', () => {+ // Nothing reads this line yet — analytics.ts picks it up in 0.4.6, because a+ // trace of the manual path has to be written by the build being REPLACED. So+ // this is the only thing standing between it and a silent reword, and the+ // only place the two halves are checked against each other: the pattern in+ // updater.ts must match what installerUrl() hands the badge, or the one+ // release we spend waiting for it buys nothing.+ const { installerUrl, REPO } = loadTs('src/shared/updateState.ts');+ const src = fs.readFileSync(path.join(__dirname, '..', 'src/main/updater.ts'), 'utf8');+ assert.ok(+ src.includes('logLine(`manual download opened: ${asset[1]}`)'),+ 'updater.ts no longer logs the manual download — 0.4.6 via loses the manual path'+ );+ const pattern = /const asset = (\/.+\/)\.exec\(href\);/.exec(src);+ assert.ok(pattern, 'the breadcrumb no longer derives the version from the href');+ const re = new RegExp(pattern[1].slice(1, -1));++ for (const [platform, arch] of [['darwin', 'arm64'], ['darwin', 'x64'], ['win32', 'x64'], ['linux', 'x64']]) {+ const hit = re.exec(installerUrl('0.4.6', platform, arch));+ assert.ok(hit, `${platform}/${arch} installer URL does not match the breadcrumb pattern`);+ assert.equal(hit[1], '0.4.6');+ }+ assert.equal(re.exec(installerUrl('0.5.0-beta.1', 'darwin', 'arm64'))[1], '0.5.0-beta.1');+ // and the notes link is NOT a download — reading the release page is not+ // choosing the manual path, and counting it as one would inflate manual.+ assert.equal(re.test(`https://github.com/${REPO}/releases/tag/v0.4.6`), false);+ assert.equal(re.test(`https://github.com/${REPO}/releases/latest`), false);+});+// ── via, end to end ─────────────────────────────────────────────────────────test('e2e: a real 0.4.4 install that auto-updated reports via auto', () => {