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

# Questions to people

> The ask performer: how an agent asks a person a question, and who answers it.

An agent whose settings entry says `ask: true` is offered the built-in
`ask_person` tool. Each question is a task to the `ask` performer you pass
to `agents({ ask })`, with the settings' `questionDeadline`. The turn is
`awaiting` while it is pending. An expired or declined question is a result
the model reads.

The performer takes a `Question` and returns an `Answer`, both exported by
`@bijectionhq/app-agents`:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { t, type ValueOf } from "@bijectionhq/bijection";

type InputRequest =
  | { kind: "confirm" }
  | { kind: "text"; maxLength: number }
  | { kind: "choice"; options: readonly string[]; multiple: boolean };
type Question = { subject: string; summary: string; request: InputRequest; agent: string };
type Answer = { approved: boolean; value: ValueOf<typeof t.json>; by: readonly string[] };
```

`subject` names the asking turn. `summary` is the question and `request` the
answer it wants.

## Nobody answers

`askNobody(transcript)` from `@bijectionhq/app-agents/install` settles every
question at once as unanswered. Place it in your tree and pass it as `ask`.

## People holding a role answer

A target whose performer is a list of roles waits for a principal holding
one of them to answer the task:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { mutation, role, t, target } from "@bijectionhq/bijection";
import { answer, question, type Answer } from "@bijectionhq/app-agents";

export const reviewer = role({ clear: [desk] });

export const questions = target({ label: desk, via: [reviewer], args: question, returns: answer, within: { hours: 24 } });

export const reply = mutation(
  { under: desk, allow: [reviewer], args: { task: t.task(questions), approved: t.boolean, value: t.json } },
  async (ctx, { task, approved, value }) => {
    const given: Answer = { approved, value, by: [ctx.frame.as.id] };
    await ctx.answer(task, { ok: true, value: given });
    return null;
  },
);

export const support = agents({ transcript: desk, tool: belt.dispatch, ask: questions, settings });
```

List the pending questions for reviewers by reading `sys.tasks` for the
target. `ctx.withdraw(task, { message })` settles a question `Withdrawn`, and the model
reads why it went unanswered.

## Through the Approvals app

An adapter mutation of your own can be the `ask` performer. It forwards a
confirmation to the Approvals app's `ask(ctx, review, …)` and, from that
task's continuation, answers the agents app's question with
`ctx.answer(task, { ok: true, value: { approved, value: null, by: [] } })`.
Text and choice answers need a performer that collects them, such as the
role target above. See [Operation review](https://docs.bijection.com/operations/review.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.