> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skyvexsoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ctx.dialog

> Blocking acknowledgement and confirmation dialogs that return the pilot's response, from a background module.

`ctx.dialog` shows a blocking modal and waits for the pilot's response. Unlike [`ctx.notify`](/sdk/background/context/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`](/sdk/background/context/prompt) instead.

## `alert()`

Show a message and wait for the pilot to acknowledge it.

```ts theme={null}
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.

```ts theme={null}
const proceed = await ctx.dialog.confirm({
  title: "Start descent?",
  message: "Begin the descent checklist now?",
});
if (!proceed) return;
```

## Return values & cancellation

| Method               | Returns            |
| -------------------- | ------------------ |
| `ctx.dialog.alert`   | `Promise<void>`    |
| `ctx.dialog.confirm` | `Promise<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`](/sdk/background/context/notify); to collect a value, use [`ctx.prompt`](/sdk/background/context/prompt).
