Skip to main content
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.
await ctx.dialog.alert({ title: "Heads up", message: "Cruise checklist due." });

confirm()

Ask a yes/no question. Resolves to true only if the pilot confirms.
const proceed = await ctx.dialog.confirm({
  title: "Start descent?",
  message: "Begin the descent checklist now?",
});
if (!proceed) return;

Return values & cancellation

MethodReturns
ctx.dialog.alertPromise<void>
ctx.dialog.confirmPromise<boolean>
An explicit valid submit returns the value; Cancel, dismiss, 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.