Add automatic agent updates with verified rollback

This commit is contained in:
2026-10-04 10:40:45 -04:00
parent 020894b816
commit 8d1331c67d
26 changed files with 2568 additions and 110 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ import { readFile } from 'node:fs/promises';
import { resolve } from 'node:path';
/** adapter-node copies public assets to build/client; Vite serves static in development. */
export async function agentReleaseAsset(file: 'install.sh' | 'ec-agent.py' | 'manifest.json'): Promise<string> {
export async function agentReleaseAsset(file: 'install.sh' | 'ec-agent.py' | 'ec-agent-update.py' | 'manifest.json'): Promise<string> {
// A prior production build must never shadow a freshly packaged development release.
if (process.env.NODE_ENV === 'development') return readFile(resolve('static/agent', file), 'utf8');
try { return await readFile(resolve('build/client/agent', file), 'utf8'); }
catch (cause) {
if ((cause as NodeJS.ErrnoException).code !== 'ENOENT') throw cause;