feat(task): refactor to Claude Code style individual tools

- Split unified Task tool into individual tools (TaskCreate, TaskGet, TaskList, TaskUpdate)
- Update schema to Claude Code field names (subject, blockedBy, blocks, activeForm, owner, metadata)
- Add OpenCode Todo API sync layer (todo-sync.ts)
- Implement Todo sync on task create/update for continuation enforcement
- Add comprehensive tests for all tools (96 tests total)
- Update AGENTS.md documentation

Breaking Changes:
- Field names changed: title→subject, dependsOn→blockedBy, open→pending
- Tool names changed: task→task_create, task_get, task_list, task_update

Closes: todo-continuation-enforcer now sees Task-created items
This commit is contained in:
YeonGyu-Kim
2026-02-02 12:01:43 +09:00
parent b16f1b7488
commit 0541c58cb3
16 changed files with 2224 additions and 64 deletions
+12 -4
View File
@@ -1,4 +1,4 @@
import type { Plugin } from "@opencode-ai/plugin";
import type { Plugin, ToolDefinition } from "@opencode-ai/plugin";
import {
createTodoContinuationEnforcer,
createContextWindowMonitorHook,
@@ -73,7 +73,10 @@ import {
interactive_bash,
startTmuxCheck,
lspManager,
createTask,
createTaskCreateTool,
createTaskGetTool,
createTaskList,
createTaskUpdateTool,
} from "./tools";
import { BackgroundManager } from "./features/background-agent";
import { SkillMcpManager } from "./features/skill-mcp-manager";
@@ -421,7 +424,12 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
});
const newTaskSystemEnabled = pluginConfig.new_task_system_enabled ?? false;
const taskTool = newTaskSystemEnabled ? createTask(pluginConfig) : null;
const taskToolsRecord: Record<string, ToolDefinition> = newTaskSystemEnabled ? {
task_create: createTaskCreateTool(pluginConfig),
task_get: createTaskGetTool(pluginConfig),
task_list: createTaskList(pluginConfig),
task_update: createTaskUpdateTool(pluginConfig),
} : {};
return {
tool: {
@@ -434,7 +442,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
skill_mcp: skillMcpTool,
slashcommand: slashcommandTool,
interactive_bash,
...(taskTool ? { task: taskTool } : {}),
...taskToolsRecord,
},
"chat.message": async (input, output) => {