feat: refactor model selection to use developer tiers
- Replaced raw model aliases with developer tiers (junior, medior, senior, qa) in dispatch and model selection logic. - Updated `dispatchTask` to resolve models based on tiers and plugin configuration. - Modified `selectModel` to return tier names instead of model aliases based on task description. - Implemented migration logic for transitioning from old model aliases to new tier names in worker state. - Added setup logic for agent creation and model configuration in `setup.ts`. - Created shared templates for workspace files and instructions for DEV/QA workers. - Enhanced project registration to scaffold role files based on developer tiers. - Updated task management tools to reflect changes in model selection and tier assignment. - Introduced a new `devclaw_setup` tool for agent-driven setup and configuration. - Updated plugin configuration schema to support model mapping per developer tier.
This commit is contained in:
41
index.ts
41
index.ts
@@ -5,13 +5,37 @@ import { createQueueStatusTool } from "./lib/tools/queue-status.js";
|
||||
import { createSessionHealthTool } from "./lib/tools/session-health.js";
|
||||
import { createProjectRegisterTool } from "./lib/tools/project-register.js";
|
||||
import { createTaskCreateTool } from "./lib/tools/task-create.js";
|
||||
import { createSetupTool } from "./lib/tools/devclaw-setup.js";
|
||||
import { runCli } from "./lib/cli.js";
|
||||
|
||||
const plugin = {
|
||||
id: "devclaw",
|
||||
name: "DevClaw",
|
||||
description:
|
||||
"Multi-project dev/qa pipeline orchestration with GitHub/GitLab integration, model selection, and audit logging.",
|
||||
configSchema: {},
|
||||
"Multi-project dev/qa pipeline orchestration with GitHub/GitLab integration, developer tiers, and audit logging.",
|
||||
configSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
models: {
|
||||
type: "object",
|
||||
description: "Model mapping per developer tier",
|
||||
properties: {
|
||||
junior: { type: "string", description: "Junior dev model" },
|
||||
medior: { type: "string", description: "Medior dev model" },
|
||||
senior: { type: "string", description: "Senior dev model" },
|
||||
qa: { type: "string", description: "QA engineer model" },
|
||||
},
|
||||
},
|
||||
glabPath: {
|
||||
type: "string",
|
||||
description: "Path to glab CLI binary. Defaults to 'glab' on PATH.",
|
||||
},
|
||||
ghPath: {
|
||||
type: "string",
|
||||
description: "Path to gh CLI binary. Defaults to 'gh' on PATH.",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
register(api: OpenClawPluginApi) {
|
||||
// Agent tools (primary interface — agent calls these directly)
|
||||
@@ -33,8 +57,19 @@ const plugin = {
|
||||
api.registerTool(createTaskCreateTool(api), {
|
||||
names: ["task_create"],
|
||||
});
|
||||
api.registerTool(createSetupTool(api), {
|
||||
names: ["devclaw_setup"],
|
||||
});
|
||||
|
||||
api.logger.info("DevClaw plugin registered (6 tools)");
|
||||
// CLI commands
|
||||
api.registerCli("setup", {
|
||||
description: "Set up DevClaw: create agent, configure models, write workspace files",
|
||||
run: async (argv: string[]) => {
|
||||
await runCli(argv);
|
||||
},
|
||||
});
|
||||
|
||||
api.logger.info("DevClaw plugin registered (7 tools, 1 CLI command)");
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user