refactor: reorganize task management imports and update task handling tools
- Updated import paths for task management providers in task-comment, task-create, and task-update tools. - Removed deprecated task-complete and task-pickup tools, replacing them with work-finish and work-start tools for improved task handling. - Enhanced work-finish and work-start tools to streamline task completion and pickup processes, including context-aware detection and auto-scheduling features. - Updated package.json to include build scripts and main entry point. - Modified tsconfig.json to enable output directory, declaration files, and source maps for better TypeScript support.
This commit is contained in:
110
index.ts
110
index.ts
@@ -1,17 +1,14 @@
|
||||
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
||||
import { createTaskPickupTool } from "./lib/tools/task-pickup.js";
|
||||
import { createTaskCompleteTool } from "./lib/tools/task-complete.js";
|
||||
import { createWorkStartTool } from "./lib/tools/work-start.js";
|
||||
import { createWorkFinishTool } from "./lib/tools/work-finish.js";
|
||||
import { createTaskCreateTool } from "./lib/tools/task-create.js";
|
||||
import { createTaskUpdateTool } from "./lib/tools/task-update.js";
|
||||
import { createTaskCommentTool } from "./lib/tools/task-comment.js";
|
||||
import { createQueueStatusTool } from "./lib/tools/queue-status.js";
|
||||
import { createSessionHealthTool } from "./lib/tools/session-health.js";
|
||||
import { createStatusTool } from "./lib/tools/status.js";
|
||||
import { createAutoPickupTool } from "./lib/tools/auto-pickup.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 { createOnboardTool } from "./lib/tools/devclaw-onboard.js";
|
||||
import { createAnalyzeChannelBindingsTool } from "./lib/tools/analyze-channel-bindings.js";
|
||||
import { createContextTestTool } from "./lib/tools/context-test.js";
|
||||
import { createHeartbeatTickTool } from "./lib/tools/heartbeat-tick.js";
|
||||
import { createSetupTool } from "./lib/tools/setup.js";
|
||||
import { createOnboardTool } from "./lib/tools/onboard.js";
|
||||
import { registerCli } from "./lib/cli.js";
|
||||
|
||||
const plugin = {
|
||||
@@ -26,92 +23,55 @@ const plugin = {
|
||||
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" },
|
||||
junior: { type: "string" },
|
||||
medior: { type: "string" },
|
||||
senior: { type: "string" },
|
||||
qa: { type: "string" },
|
||||
},
|
||||
},
|
||||
projectExecution: {
|
||||
type: "string",
|
||||
enum: ["parallel", "sequential"],
|
||||
description: "Plugin-level project execution: parallel (each project independent) or sequential (only one project active at a time)",
|
||||
description: "Plugin-level: parallel (each project independent) or sequential (one project at a time)",
|
||||
default: "parallel",
|
||||
},
|
||||
notifications: {
|
||||
type: "object",
|
||||
description: "Notification settings for worker lifecycle events",
|
||||
description: "Notification settings",
|
||||
properties: {
|
||||
heartbeatDm: {
|
||||
type: "boolean",
|
||||
description: "Send heartbeat summaries to orchestrator DM. Default: true",
|
||||
default: true,
|
||||
},
|
||||
workerStart: {
|
||||
type: "boolean",
|
||||
description: "Post when worker starts a task. Default: true",
|
||||
default: true,
|
||||
},
|
||||
workerComplete: {
|
||||
type: "boolean",
|
||||
description: "Post when worker completes a task. Default: true",
|
||||
default: true,
|
||||
},
|
||||
heartbeatDm: { type: "boolean", default: true },
|
||||
workerStart: { type: "boolean", default: true },
|
||||
workerComplete: { type: "boolean", default: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
register(api: OpenClawPluginApi) {
|
||||
// Agent tools (primary interface — agent calls these directly)
|
||||
api.registerTool(createTaskPickupTool(api), {
|
||||
names: ["task_pickup", "work_start"],
|
||||
});
|
||||
api.registerTool(createTaskCompleteTool(api), {
|
||||
names: ["task_complete", "work_finish"],
|
||||
});
|
||||
api.registerTool(createTaskUpdateTool(api), {
|
||||
names: ["task_update"],
|
||||
});
|
||||
api.registerTool(createTaskCommentTool(api), {
|
||||
names: ["task_comment"],
|
||||
});
|
||||
api.registerTool(createQueueStatusTool(api), {
|
||||
names: ["queue_status", "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"],
|
||||
});
|
||||
api.registerTool(createOnboardTool(api), {
|
||||
names: ["devclaw_onboard"],
|
||||
});
|
||||
api.registerTool(createAnalyzeChannelBindingsTool(api), {
|
||||
names: ["analyze_channel_bindings"],
|
||||
});
|
||||
api.registerTool(createContextTestTool(api), {
|
||||
names: ["context_test"],
|
||||
});
|
||||
api.registerTool(createHeartbeatTickTool(api), {
|
||||
names: ["heartbeat_tick"],
|
||||
});
|
||||
// Worker lifecycle
|
||||
api.registerTool(createWorkStartTool(api), { names: ["work_start"] });
|
||||
api.registerTool(createWorkFinishTool(api), { names: ["work_finish"] });
|
||||
|
||||
// CLI: `openclaw devclaw setup`
|
||||
// Task management
|
||||
api.registerTool(createTaskCreateTool(api), { names: ["task_create"] });
|
||||
api.registerTool(createTaskUpdateTool(api), { names: ["task_update"] });
|
||||
api.registerTool(createTaskCommentTool(api), { names: ["task_comment"] });
|
||||
|
||||
// Operations
|
||||
api.registerTool(createStatusTool(api), { names: ["status"] });
|
||||
api.registerTool(createAutoPickupTool(api), { names: ["auto_pickup"] });
|
||||
|
||||
// Setup & config
|
||||
api.registerTool(createProjectRegisterTool(api), { names: ["project_register"] });
|
||||
api.registerTool(createSetupTool(api), { names: ["setup"] });
|
||||
api.registerTool(createOnboardTool(api), { names: ["onboard"] });
|
||||
|
||||
// CLI
|
||||
api.registerCli(({ program }: { program: any }) => registerCli(program), {
|
||||
commands: ["devclaw"],
|
||||
});
|
||||
|
||||
api.logger.info(
|
||||
"DevClaw plugin registered (13 tools, 1 CLI command)",
|
||||
);
|
||||
api.logger.info("DevClaw plugin registered (10 tools, 1 CLI command)");
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user