refactor: migrate role handling from tiers to roles module
- Removed the deprecated tiers.ts file and migrated all related functionality to roles/index.js. - Updated tests and tools to reflect the new role structure, replacing references to "dev", "qa", and "architect" with "developer", "tester", and "architect". - Adjusted workflow configurations and state management to accommodate the new role naming conventions. - Enhanced project registration and health check tools to support dynamic role handling. - Updated task creation, update, and completion processes to align with the new role definitions. - Improved documentation and comments to clarify role responsibilities and usage.
This commit is contained in:
@@ -11,7 +11,7 @@ import { readProjects, getProject } from "../projects.js";
|
||||
import { log as auditLog } from "../audit.js";
|
||||
import { fetchProjectQueues, getTotalQueuedCount, getQueueLabelsWithPriority } from "../services/queue.js";
|
||||
import { requireWorkspaceDir, getPluginConfig } from "../tool-helpers.js";
|
||||
import { DEFAULT_WORKFLOW } from "../workflow.js";
|
||||
import { loadWorkflow } from "../workflow.js";
|
||||
|
||||
export function createStatusTool(api: OpenClawPluginApi) {
|
||||
return (ctx: ToolContext) => ({
|
||||
@@ -32,8 +32,8 @@ export function createStatusTool(api: OpenClawPluginApi) {
|
||||
const pluginConfig = getPluginConfig(api);
|
||||
const projectExecution = (pluginConfig?.projectExecution as string) ?? "parallel";
|
||||
|
||||
// TODO: Load per-project workflow when supported
|
||||
const workflow = DEFAULT_WORKFLOW;
|
||||
// Load workspace-level workflow (per-project loaded inside map)
|
||||
const workflow = await loadWorkflow(workspaceDir);
|
||||
|
||||
const data = await readProjects(workspaceDir);
|
||||
const projectIds = groupId ? [groupId] : Object.keys(data.projects);
|
||||
@@ -52,28 +52,22 @@ export function createStatusTool(api: OpenClawPluginApi) {
|
||||
queueCounts[label] = issues.length;
|
||||
}
|
||||
|
||||
// Build dynamic workers summary
|
||||
const workers: Record<string, { active: boolean; issueId: string | null; level: string | null; startTime: string | null }> = {};
|
||||
for (const [role, worker] of Object.entries(project.workers)) {
|
||||
workers[role] = {
|
||||
active: worker.active,
|
||||
issueId: worker.issueId,
|
||||
level: worker.level,
|
||||
startTime: worker.startTime,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: project.name,
|
||||
groupId: pid,
|
||||
roleExecution: project.roleExecution ?? "parallel",
|
||||
dev: {
|
||||
active: project.dev.active,
|
||||
issueId: project.dev.issueId,
|
||||
level: project.dev.level,
|
||||
startTime: project.dev.startTime,
|
||||
},
|
||||
qa: {
|
||||
active: project.qa.active,
|
||||
issueId: project.qa.issueId,
|
||||
level: project.qa.level,
|
||||
startTime: project.qa.startTime,
|
||||
},
|
||||
architect: {
|
||||
active: project.architect.active,
|
||||
issueId: project.architect.issueId,
|
||||
level: project.architect.level,
|
||||
startTime: project.architect.startTime,
|
||||
},
|
||||
workers,
|
||||
queue: queueCounts,
|
||||
};
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user