Add errand.requestChanges procedure that re-spawns an agent in the existing worktree with user feedback. Replace raw <pre> diff blocks with syntax-highlighted ErrandDiffView using FileCard components. Add Output/Changes tabs to the active errand view.
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
export function buildErrandPrompt(description: string): string {
|
|
return `You are working on a small, focused change in an isolated worktree.
|
|
|
|
Description: ${description}
|
|
|
|
Work interactively with the user. Make only the changes needed to fulfill the description.
|
|
When you are done, write .cw/output/signal.json:
|
|
|
|
{ "status": "done", "result": { "message": "<one-sentence summary of what you changed>" } }
|
|
|
|
If you cannot complete the change:
|
|
|
|
{ "status": "error", "error": "<explanation>" }
|
|
|
|
Do not create any other output files.`;
|
|
}
|
|
|
|
export function buildErrandRevisionPrompt(description: string, feedback: string): string {
|
|
return `You are revising a previous change in an isolated worktree. The worktree already contains your prior work.
|
|
|
|
Original description: ${description}
|
|
|
|
The user reviewed your changes and requested revisions:
|
|
|
|
${feedback}
|
|
|
|
Make only the changes needed to address the feedback. Do not undo prior work unless the feedback specifically asks for it.
|
|
When you are done, write .cw/output/signal.json:
|
|
|
|
{ "status": "done", "result": { "message": "<one-sentence summary of what you changed>" } }
|
|
|
|
If you cannot complete the change:
|
|
|
|
{ "status": "error", "error": "<explanation>" }
|
|
|
|
Do not create any other output files.`;
|
|
}
|