ctx.dialog shows a blocking modal and waits for the pilot’s response. Unlike ctx.notify (fire-and-forget toasts/sounds), these calls block until answered. The shell renders the modal; your plugin only describes it. To ask the pilot for a value (text, number, or choice), use ctx.prompt instead.
alert()
Show a message and wait for the pilot to acknowledge it.
confirm()
Ask a yes/no question. Resolves to true only if the pilot confirms.
Return values & cancellation
| Method | Returns |
|---|---|
ctx.dialog.alert | Promise<void> |
ctx.dialog.confirm | Promise<boolean> |
timeoutMs, or the plugin being unloaded all resolve the no-answer path (alert resolves, confirm returns false). These calls never throw on cancellation, so you don’t need try/catch.
Both accept an optional timeoutMs (absent by default — waits until answered or dismissed). Dialogs are shown one at a time. Awaiting a dialog inside onStop will not resolve (the app is shutting down).
When to use it: to interrupt the pilot with something that needs acknowledgement or a yes/no decision. For a passive heads-up, use ctx.notify; to collect a value, use ctx.prompt.