plugins: add capability to show real time updates to the cli#28
plugins: add capability to show real time updates to the cli#28
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a plugin status callback mechanism that enables real-time UI updates from plugins during execution. The Claude Runner plugin uses this to display live tool call activity, streaming text, elapsed time, and tool call counters in the CLI. The new setStatusCallback optional method on the Plugin interface receives a callback that plugins invoke with structured PluginStatusData (log lines and stats), which the PluginManager relays as PluginStatusUpdateEvent pipeline events for the Ink-based CLI to render.
Changes:
- Added
PluginStatusDatatype and optionalsetStatusCallbackmethod to thePlugininterface, plus a newPluginStatusUpdateEventpipeline event type. - Implemented live status emission in
ClaudeRunnerPluginwith tool call tracking, text streaming, and elapsed time display, using a 1-second interval timer alongside per-message updates. - Wired the status callback in
PluginManagerand rendered the status data (stats bar + log lines) in therun.tsxInk UI component.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/shared/types.ts |
Added PluginStatusData interface and optional setStatusCallback to Plugin interface |
src/shared/pipeline-events.ts |
Added PluginStatusUpdateEvent to the pipeline event union |
src/plugins/claude-runner/claude-runner-plugin.ts |
Implemented status emission with timer, tool/text tracking, and formatted stats |
src/plugins/claude-runner/claude-runner-plugin.spec.ts |
Added tests verifying status callback emits structured data with tool/text indicators |
src/plugin-manager.ts |
Wired setStatusCallback before plugin execution and clears status on completion/error |
src/commands/run.tsx |
Extended PluginStatus with logLines/stats, handled new event, rendered status in UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
1dbadf4 to
a7a06b6
Compare
Add the new optional method
setStatusCallbackfor thePugininterface.It's used to display on the CLI a few lines with the real time status for the plugin.
For now, only the Claude Runner plugin uses it.