Feat : Control streamer
Some checks failed
release / build (push) Successful in 27s
release / verify-windows (push) Failing after 56s

This commit is contained in:
jeanotx32
2026-08-11 21:11:04 +02:00
parent 6916ff4be3
commit 37e0c73ab5
10 changed files with 386 additions and 11 deletions

View File

@@ -103,6 +103,7 @@ class Hub {
agentId: string,
action: AgentAction,
params?: Record<string, unknown>,
timeoutMs = config.commandTimeoutMs,
): Promise<unknown> {
const connection = this.connections.get(agentId);
if (!connection) throw new Error('Agent hors-ligne');
@@ -114,7 +115,7 @@ class Hub {
const timer = setTimeout(() => {
connection.pending.delete(requestId);
reject(new Error(`Timeout : l'agent n'a pas répondu à « ${action} »`));
}, config.commandTimeoutMs);
}, timeoutMs);
connection.pending.set(requestId, { resolve, reject, timer });
@@ -137,6 +138,7 @@ class Hub {
obs: record.obs,
autoConnectObs: record.autoConnectObs,
watch: record.watch,
browser: record.browser,
};
connection.socket.send(JSON.stringify(message));
}
@@ -174,6 +176,7 @@ class Hub {
obs: { ...record.obs, password: record.obs.password ? '********' : '' },
autoConnectObs: record.autoConnectObs,
watch: record.watch,
browser: record.browser,
notes: record.notes,
status: this.statusOf(record.id),
};