Feat : Log recorder
Some checks failed
release / build (push) Successful in 29s
release / verify-windows (push) Failing after 1m0s

This commit is contained in:
jeanotx32
2026-08-11 22:34:45 +02:00
parent 03b1963150
commit 1dd3959f29
16 changed files with 631 additions and 53 deletions

View File

@@ -3,6 +3,7 @@ import { createHash } from 'node:crypto';
import fs from 'node:fs';
import path from 'node:path';
import { promisify } from 'node:util';
import type { AgentEvent } from '@stream-control/shared';
const run = promisify(execFile);
@@ -40,7 +41,7 @@ export function currentBuildId(): string | undefined {
export interface UpdateDeps {
/** État d'enregistrement : on ne coupe jamais une capture en cours. */
recordState(): Promise<{ active: boolean; paused: boolean }>;
log(level: 'info' | 'warn' | 'error', message: string): void;
log(level: 'info' | 'warn' | 'error', message: string, event?: AgentEvent): void;
}
/**
@@ -127,6 +128,7 @@ export async function selfUpdate(
deps.log(
'info',
`Binaire remplacé : ${previousBuildId}${newBuildId}. Redémarrage par le superviseur…`,
'agent.updated',
);
// 6. Sortie différée : laisse le temps au résultat de partir vers le serveur.