feat: cw task add CLI command + {AGENT_ID} prompt placeholder
- Add `createTaskForAgent` tRPC mutation: resolves agent → task → phase, creates sibling task
- Add `cw task add <name> --agent-id <id>` CLI command
- Replace `{AGENT_ID}` and `{AGENT_NAME}` placeholders in writeInputFiles() before flushing
- Update docs/agent.md and docs/cli-config.md
This commit is contained in:
@@ -426,6 +426,32 @@ export function createCli(serverHandler?: (port?: number) => Promise<void>): Com
|
||||
}
|
||||
});
|
||||
|
||||
// cw task add <name> --agent-id <agentId>
|
||||
taskCommand
|
||||
.command('add <name>')
|
||||
.description('Create a sibling task in the agent\'s current phase')
|
||||
.requiredOption('--agent-id <agentId>', 'Agent ID creating the task')
|
||||
.option('--description <description>', 'Task description')
|
||||
.option('--category <category>', 'Task category (execute, research, verify, ...)')
|
||||
.action(async (name: string, options: { agentId: string; description?: string; category?: string }) => {
|
||||
try {
|
||||
const client = createDefaultTrpcClient();
|
||||
const task = await client.createTaskForAgent.mutate({
|
||||
agentId: options.agentId,
|
||||
name,
|
||||
description: options.description,
|
||||
category: options.category as 'execute' | undefined,
|
||||
});
|
||||
console.log(`Created task: ${task.name}`);
|
||||
console.log(` ID: ${task.id}`);
|
||||
console.log(` Phase: ${task.phaseId}`);
|
||||
console.log(` Status: ${task.status}`);
|
||||
} catch (error) {
|
||||
console.error('Failed to create task:', (error as Error).message);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
// Message command group
|
||||
const messageCommand = program
|
||||
.command('message')
|
||||
|
||||
Reference in New Issue
Block a user