[taskboard] add dispatch control plane
This commit is contained in:
97
lib/types.ts
97
lib/types.ts
@@ -2,20 +2,82 @@ export type TaskStatus = "Backlog" | "Todo" | "In Progress" | "Review" | "Done";
|
||||
export type TaskPriority = "Low" | "Medium" | "High" | "Critical";
|
||||
export type AgentFamily = "openclaw" | "zeroclaw";
|
||||
export type AgentStatus = "active" | "busy" | "idle";
|
||||
export type DispatchMethod = "openclaw-swarm" | "zeroclaw-webhook" | "manual";
|
||||
export type DispatchState =
|
||||
| "planned"
|
||||
| "assigned"
|
||||
| "dispatched"
|
||||
| "acknowledged"
|
||||
| "completed"
|
||||
| "failed";
|
||||
|
||||
export type TaskRecord = {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
assignee: string;
|
||||
family: AgentFamily | null;
|
||||
target_host: string;
|
||||
target_channel: string;
|
||||
dispatch_method: DispatchMethod;
|
||||
dispatch_state: DispatchState;
|
||||
template_key: string | null;
|
||||
repo_slug: string | null;
|
||||
base_branch: string | null;
|
||||
preferred_agent: string | null;
|
||||
reasoning_effort: string | null;
|
||||
model_hint: string | null;
|
||||
priority: TaskPriority;
|
||||
status: TaskStatus;
|
||||
tags: string[];
|
||||
last_dispatch_at: string | null;
|
||||
acknowledged_at: string | null;
|
||||
last_error: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
completed_at: string | null;
|
||||
};
|
||||
|
||||
export type TaskTemplate = {
|
||||
key: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
family: AgentFamily;
|
||||
tags: string[];
|
||||
defaults: {
|
||||
priority: TaskPriority;
|
||||
dispatchMethod: DispatchMethod;
|
||||
targetHost?: string;
|
||||
targetChannel?: string;
|
||||
repoSlug?: string;
|
||||
baseBranch?: string;
|
||||
preferredAgent?: string;
|
||||
reasoningEffort?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type TaskEventType =
|
||||
| "created"
|
||||
| "updated"
|
||||
| "status_changed"
|
||||
| "dispatch_requested"
|
||||
| "dispatch_succeeded"
|
||||
| "dispatch_failed"
|
||||
| "acknowledged";
|
||||
|
||||
export type TaskEvent = {
|
||||
id: number;
|
||||
task_id: number;
|
||||
assignee: string;
|
||||
family: AgentFamily | null;
|
||||
host: string;
|
||||
event_type: TaskEventType;
|
||||
state: DispatchState | null;
|
||||
summary: string;
|
||||
detail: string;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type WikiPageSummary = {
|
||||
filename: string;
|
||||
title: string;
|
||||
@@ -50,6 +112,7 @@ export type FleetAgent = {
|
||||
role: string;
|
||||
runtimePath: string;
|
||||
configPath: string | null;
|
||||
defaultDispatchMethod: DispatchMethod;
|
||||
model: string | null;
|
||||
emoji: string;
|
||||
channels: AgentRouteSummary[];
|
||||
@@ -61,6 +124,10 @@ export type FleetAgent = {
|
||||
activeTasks: TaskRecord[];
|
||||
completedTasks: TaskRecord[];
|
||||
currentTask: string | null;
|
||||
heartbeatAt: string | null;
|
||||
heartbeatAgeMinutes: number | null;
|
||||
lastEvent: TaskEvent | null;
|
||||
failureStreak: number;
|
||||
notes: string[];
|
||||
};
|
||||
|
||||
@@ -82,3 +149,33 @@ export type ArchitectureDocument = {
|
||||
sections: FleetSection[];
|
||||
topologyDiagram: string;
|
||||
};
|
||||
|
||||
export type ZeroClawAgentDefinition = {
|
||||
slug: string;
|
||||
assignmentKey: string;
|
||||
aliases: string[];
|
||||
name: string;
|
||||
host: string;
|
||||
role: string;
|
||||
runtimePath: string;
|
||||
configPath: string;
|
||||
model: string;
|
||||
emoji: string;
|
||||
channels: AgentRouteSummary[];
|
||||
notes: string[];
|
||||
dispatch: {
|
||||
method: DispatchMethod;
|
||||
urlEnv: string;
|
||||
tokenEnv: string;
|
||||
targetChannel: string;
|
||||
description: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type FleetConfig = {
|
||||
title: string;
|
||||
overview: string[];
|
||||
topologyDiagram: string;
|
||||
sections: FleetSection[];
|
||||
zeroclawAgents: ZeroClawAgentDefinition[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user