Skip to content

feat: add external ask_user responder bridge#21

Open
Maverobot wants to merge 3 commits into
edlsh:mainfrom
Maverobot:external-responder-bridge
Open

feat: add external ask_user responder bridge#21
Maverobot wants to merge 3 commits into
edlsh:mainfrom
Maverobot:external-responder-bridge

Conversation

@Maverobot

@Maverobot Maverobot commented Jun 11, 2026

Copy link
Copy Markdown

Summary

  • Emit a normalized ask:prompt event when ask_user opens, with an in-process respond(result | null) callback for external UIs.
  • Race the local TUI/RPC prompt with the external responder so the first answer wins and the tool still returns the normal ask_user result shape.
  • Emit ask:answered / ask:cancelled after settlement so mirrored prompt cards can close or mark themselves resolved.
  • Harden settlement paths after review: direct custom() returns now settle the bridge, empty-option RPC fallback uses direct input again, external responses are normalized/validated, and timeout/abort cleanup is explicit.
  • Document the event contract and RPC-dialog cancellation limitation in the README.

Motivation

This is intended for same-process integrations that mirror ask_user prompts outside the local terminal (mobile app, chat bridge, web UI, etc.) while preserving the existing local TUI. Normal CLI/TUI usage remains unchanged.

Test plan

  • bun test index.test.ts single-select-layout.test.ts → 66 pass / 0 fail
  • npm run checknpm pack --dry-run succeeds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant