[taskboard] add direct host dispatch targets
This commit is contained in:
@@ -289,13 +289,54 @@ async function buildZeroClawAgents() {
|
||||
);
|
||||
}
|
||||
|
||||
async function buildDirectAgents() {
|
||||
return Promise.all(
|
||||
FLEET_CONFIG.directAgents.map(async (configuredAgent) => {
|
||||
const taskBuckets = await fetchTaskBuckets(configuredAgent.aliases);
|
||||
const eventSummary = await fetchAgentEventSummary(configuredAgent.aliases);
|
||||
const heartbeatAt = eventSummary.lastEvent?.created_at || null;
|
||||
const heartbeatAgeMinutes = deriveHeartbeatAgeMinutes(heartbeatAt);
|
||||
|
||||
return {
|
||||
slug: configuredAgent.slug,
|
||||
assignmentKey: configuredAgent.assignmentKey,
|
||||
aliases: configuredAgent.aliases,
|
||||
family: "direct" as const,
|
||||
name: configuredAgent.name,
|
||||
host: configuredAgent.host,
|
||||
role: configuredAgent.role,
|
||||
runtimePath: configuredAgent.runtimePath,
|
||||
configPath: configuredAgent.configPath,
|
||||
defaultDispatchMethod: configuredAgent.dispatch.method,
|
||||
model: null,
|
||||
emoji: configuredAgent.emoji,
|
||||
channels: configuredAgent.channels,
|
||||
tools: configuredAgent.tools,
|
||||
capabilities: configuredAgent.capabilities,
|
||||
files: configuredAgent.files,
|
||||
status: deriveStatus(taskBuckets.activeTasks.length, heartbeatAt),
|
||||
workload: taskBuckets.activeTasks.length,
|
||||
activeTasks: taskBuckets.activeTasks,
|
||||
completedTasks: taskBuckets.completedTasks,
|
||||
currentTask: taskBuckets.activeTasks[0]?.title || null,
|
||||
heartbeatAt,
|
||||
heartbeatAgeMinutes,
|
||||
lastEvent: eventSummary.lastEvent,
|
||||
failureStreak: eventSummary.failureStreak,
|
||||
notes: configuredAgent.notes,
|
||||
} satisfies FleetAgent;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export async function listFleetAgents() {
|
||||
const [openclawAgents, zeroclawAgents] = await Promise.all([
|
||||
const [openclawAgents, zeroclawAgents, directAgents] = await Promise.all([
|
||||
buildOpenClawAgents(),
|
||||
buildZeroClawAgents(),
|
||||
buildDirectAgents(),
|
||||
]);
|
||||
|
||||
return [...openclawAgents, ...zeroclawAgents];
|
||||
return [...openclawAgents, ...zeroclawAgents, ...directAgents];
|
||||
}
|
||||
|
||||
export async function findAgentByAssignmentKey(assignmentKey: string) {
|
||||
|
||||
Reference in New Issue
Block a user