dotfiles
bugabingas dorkfiles
owned by bugabinga
fix(agent): show progress widget in devil tool
ddf7242a954d3bc554bb1856bac0802f4fbac89e
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Use setWidget instead of notify for visible feedback.
Show debate progress in widget above editor.
Changed files (1)
pi/agent/extensions/devil/index.ts
Modified237 237 ? `\n\n**Focus:** Challenge specifically from ${stakeholder} perspective.` 242 - content: [{ type:
"text", text:
`## 🗡️ Devil's Advocate Debate\n\n**Idea:** ${idea}\n\n**Context:**\n${contextText}\n\n**Config:** maxRounds=${maxRounds}, stopping=${stoppingConditions}, blocking=${onBlocking}\n**Model:** ${model.provider}/${model.id}\n\n---\n\n` }],
241 + ctx.ui?.
setWidget(
"devil", [
242 + "🗡️ Devil's Advocate",
243 + `Idea: ${idea.slice(0, 50)}${idea.length > 50 ? "..." : ""}`,
244 + `Rounds: ${maxRounds} | Model: ${model.id}`,
245 + "Status: Starting...",
247 249 const rounds_data
: string[]
= [];
275 277 rounds_data.
push(
`### Round ${i}\n\n**Challenge:**\n${devilOutput}\n\n**Your Response:**\n${proposerOutput}`);
279 - content: [{ type:
"text", text:
`### Round ${i}/${maxRounds}\n\n**Challenge identified.** Respond above.\n\n` }],
280 - details: { round: i, blockingCount: roundBlockingCount },
280 + ctx.ui?.
setWidget(
"devil", [
281 + "🗡️ Devil's Advocate",
282 + `Round ${i}/${maxRounds}: Challenge raised`,
283 + `Blocking issues: ${roundBlockingCount}`,
284 + "Awaiting synthesis...",
284 288 const resolvedCount
= (proposerOutput.
match(
/\*\*status\*\*:\s*resolved|status:\s*resolved/gi)
|| []).
length;
331 335 ? `## Full Debate\n\n${rounds_data.join("\n\n---\n\n")}\n\n---\n\n## Summary\n\n${synthesisOutput}${blockingNote}\n\n**Debate:** ${rounds_data.length} rounds | **Blocking issues:** ${blockingIssuesFound}` 332 336 : `${synthesisOutput}${blockingNote}\n\n*Debate: ${rounds_data.length} rounds | Blocking: ${blockingIssuesFound}*`;
339 + ctx.ui?.
setWidget(
"devil",
undefined);
335 342 content: [{ type:
"text", text: outputText }],
336 343 details: { recommendation, rounds: rounds_data.
length, blockingIssues: blockingIssuesFound },
338 345 }
catch (error) {
339 346 const message
= error
instanceof Error ? error.message
: String(error);
348 + ctx.ui?.
setWidget(
"devil",
undefined);
341 350 content: [{ type:
"text", text:
`## Debate Failed\n\nError: ${message}` }],
342 351 details: { error: message },