From 718dae421c56ceb8f3522ba89f43adc6d9fcdfc1 Mon Sep 17 00:00:00 2001 From: Volodymyr Vreshch Date: Mon, 20 Apr 2026 00:51:25 +0200 Subject: [PATCH] feat(hub-sync): send agentsDefault + projectsDefault in heartbeat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Daemon now reports its configured install target (agents.default) and discovery root (projects.default) to the hub each heartbeat. Hub writes these to agents_default / projects_default columns on machines; the dashboard machine detail page renders them. - hub-client.ts: widen the inline heartbeat body type with two optional string fields. No dep bump — cli carries its own heartbeat shape, doesn't import @agentage/platform.Heartbeat. - hub-sync.ts: loadConfig() already available near the heartbeat path, added agentsDefault + projectsDefault to the payload. - hub-sync.test: fixture assertion updated with the new fields. Pairs with: - agentage/web#148 — Supabase columns + ingest + UI - agentage/agentkit#107 — Heartbeat type (informational; cli doesn't import the platform Heartbeat so this is a follow-up for other consumers) --- src/hub/hub-client.ts | 2 ++ src/hub/hub-sync.test.ts | 2 ++ src/hub/hub-sync.ts | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/src/hub/hub-client.ts b/src/hub/hub-client.ts index 920e7c9..c02a212 100644 --- a/src/hub/hub-client.ts +++ b/src/hub/hub-client.ts @@ -23,6 +23,8 @@ export interface HubClient { projects?: Array<{ name: string; path: string; discovered?: boolean; remote?: string }>; activeRunIds: string[]; daemonVersion: string; + agentsDefault?: string; + projectsDefault?: string; } ) => Promise<{ pendingCommands: unknown[]; diff --git a/src/hub/hub-sync.test.ts b/src/hub/hub-sync.test.ts index 76b2c63..054c45a 100644 --- a/src/hub/hub-sync.test.ts +++ b/src/hub/hub-sync.test.ts @@ -227,6 +227,8 @@ describe('hub-sync', () => { ], activeRunIds: ['run-1'], daemonVersion: '0.7.1', + agentsDefault: '/tmp/agents', + projectsDefault: '/tmp/projects', }); }); diff --git a/src/hub/hub-sync.ts b/src/hub/hub-sync.ts index a32787f..032cb51 100644 --- a/src/hub/hub-sync.ts +++ b/src/hub/hub-sync.ts @@ -76,6 +76,8 @@ export const createHubSync = (): HubSync => { const sendHeartbeat = async (auth: AuthState): Promise => { if (!hubClient) return; + const config = loadConfig(); + const agents = getAgents().map((a) => ({ name: a.manifest.name, description: a.manifest.description, @@ -103,6 +105,8 @@ export const createHubSync = (): HubSync => { projects, activeRunIds, daemonVersion: VERSION, + agentsDefault: config.agents.default, + projectsDefault: config.projects.default, }); // Reconcile local cron registry against the authoritative bindings