229 lines
4.9 KiB
TypeScript
229 lines
4.9 KiB
TypeScript
export type TaskStatus = "Backlog" | "Todo" | "In Progress" | "Review" | "Done";
|
|
export type TaskPriority = "Low" | "Medium" | "High" | "Critical";
|
|
export type AgentFamily = "openclaw" | "zeroclaw" | "direct";
|
|
export type AgentStatus = "active" | "busy" | "idle";
|
|
export type DispatchMethod = "openclaw-swarm" | "zeroclaw-webhook" | "direct-ssh" | "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;
|
|
result_summary: string | null;
|
|
result_detail: string | null;
|
|
completed_by: 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 TaskCallbackPayload = {
|
|
status?: TaskStatus;
|
|
dispatch_state?: DispatchState;
|
|
summary?: string | null;
|
|
detail?: string | null;
|
|
completed_by?: string | null;
|
|
last_error?: string | null;
|
|
last_dispatch_at?: string | null;
|
|
};
|
|
|
|
export type WikiPageSummary = {
|
|
filename: string;
|
|
title: string;
|
|
created: string;
|
|
modified: string;
|
|
tags: string[];
|
|
};
|
|
|
|
export type WikiPage = {
|
|
filename: string;
|
|
content: string;
|
|
metadata: {
|
|
title: string;
|
|
created: string;
|
|
modified: string;
|
|
tags: string[];
|
|
};
|
|
};
|
|
|
|
export type AgentRouteSummary = {
|
|
label: string;
|
|
value: string;
|
|
};
|
|
|
|
export type FleetAgent = {
|
|
slug: string;
|
|
assignmentKey: string;
|
|
aliases: string[];
|
|
family: AgentFamily;
|
|
name: string;
|
|
host: string;
|
|
role: string;
|
|
runtimePath: string;
|
|
configPath: string | null;
|
|
defaultDispatchMethod: DispatchMethod;
|
|
model: string | null;
|
|
emoji: string;
|
|
channels: AgentRouteSummary[];
|
|
tools: string[];
|
|
capabilities: string[];
|
|
files: string[];
|
|
status: AgentStatus;
|
|
workload: number;
|
|
activeTasks: TaskRecord[];
|
|
completedTasks: TaskRecord[];
|
|
currentTask: string | null;
|
|
heartbeatAt: string | null;
|
|
heartbeatAgeMinutes: number | null;
|
|
lastEvent: TaskEvent | null;
|
|
failureStreak: number;
|
|
notes: string[];
|
|
};
|
|
|
|
export type FleetSection = {
|
|
id: AgentFamily;
|
|
title: string;
|
|
summary: string;
|
|
runtime: AgentRouteSummary[];
|
|
channels: AgentRouteSummary[];
|
|
configuredAgents: string[];
|
|
diagram: string;
|
|
notes: string[];
|
|
};
|
|
|
|
export type ArchitectureDocument = {
|
|
generatedAt: string;
|
|
title: string;
|
|
overview: string[];
|
|
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 DirectAgentActionDefinition = {
|
|
key: string;
|
|
title: string;
|
|
description: string;
|
|
command: string;
|
|
successSummary: string;
|
|
};
|
|
|
|
export type DirectAgentDefinition = {
|
|
slug: string;
|
|
assignmentKey: string;
|
|
aliases: string[];
|
|
name: string;
|
|
host: string;
|
|
role: string;
|
|
runtimePath: string;
|
|
configPath: string | null;
|
|
emoji: string;
|
|
channels: AgentRouteSummary[];
|
|
tools: string[];
|
|
capabilities: string[];
|
|
files: string[];
|
|
notes: string[];
|
|
dispatch: {
|
|
method: "direct-ssh";
|
|
hostname: string;
|
|
user: string;
|
|
port: number;
|
|
defaultAction: string;
|
|
actions: DirectAgentActionDefinition[];
|
|
};
|
|
};
|
|
|
|
export type FleetConfig = {
|
|
title: string;
|
|
overview: string[];
|
|
topologyDiagram: string;
|
|
sections: FleetSection[];
|
|
zeroclawAgents: ZeroClawAgentDefinition[];
|
|
directAgents: DirectAgentDefinition[];
|
|
};
|