Files added by PR #2008 that were not in main were dropped during the merge. Restore all src/, docs/, and scripts/ files from the pre-merge PR head. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
629 B
629 B
Mode Behavior
| Mode | UI Methods | Notes |
|---|---|---|
| Interactive (default) | Full TUI | Normal operation |
RPC (--mode rpc) |
JSON protocol | Host handles UI, dialogs work via sub-protocol |
JSON (--mode json) |
No-op | Event stream to stdout |
Print (-p) |
No-op | Extensions run but can't prompt users |
Always check ctx.hasUI before calling dialog methods in extensions that might run in non-interactive modes:
if (ctx.hasUI) {
const ok = await ctx.ui.confirm("Delete?", "Sure?");
} else {
// Default behavior for non-interactive mode
}