Files
devclaw-gitea/index.ts
Lauren ten Hoor aa8e8dbd1b 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.
2026-02-09 13:41:22 +08:00

77 lines
2.5 KiB
TypeScript

import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { createTaskPickupTool } from "./lib/tools/task-pickup.js";
import { createTaskCompleteTool } from "./lib/tools/task-complete.js";
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, 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)
api.registerTool(createTaskPickupTool(api), {
names: ["task_pickup"],
});
api.registerTool(createTaskCompleteTool(api), {
names: ["task_complete"],
});
api.registerTool(createQueueStatusTool(api), {
names: ["queue_status"],
});
api.registerTool(createSessionHealthTool(api), {
names: ["session_health"],
});
api.registerTool(createProjectRegisterTool(api), {
names: ["project_register"],
});
api.registerTool(createTaskCreateTool(api), {
names: ["task_create"],
});
api.registerTool(createSetupTool(api), {
names: ["devclaw_setup"],
});
// 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)");
},
};
export default plugin;