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:
Lukas May
2026-03-06 22:22:49 +01:00
parent 6482960c6f
commit e199188670
5 changed files with 101 additions and 1 deletions

View File

@@ -282,6 +282,17 @@ export async function writeInputFiles(options: WriteInputFilesOptions): Promise<
});
}
// Replace agent placeholders in all content before writing
const placeholders: Record<string, string> = {
'{AGENT_ID}': options.agentId ?? '',
'{AGENT_NAME}': options.agentName ?? '',
};
for (const w of writes) {
for (const [token, value] of Object.entries(placeholders)) {
w.content = w.content.replaceAll(token, value);
}
}
// Flush all file writes in parallel — yields the event loop between I/O ops
await Promise.all(writes.map(w => writeFile(w.path, w.content, 'utf-8')));