---
title: OpenBodyOutput
description: The output of an Open body.
---

# `OpenBodyOutput`

Type, in `@jr2/orchestrator/src/open-body.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Charts.

```ts
type OpenBodyOutput =
  | { outcome: "done"; output: unknown }
  | { outcome: "refused"; report: string[] }
  | { outcome: "ceiling"; ceiling: keyof Ceilings; detail: string };
```

The output of an Open body. Route on `outcome` in the `onDone` of the state that invokes it:

- `done`: the Chart got to a final state. `output` is the output of the Chart.
- `refused`: the door refused the Chart. `report` has one line for each problem. Give it to the
  Agent that wrote the Chart, so that it can send a corrected one.
- `ceiling`: the Chart got to a ceiling, and the Open body stopped it. `ceiling` names it.

**Forms**: it is one of these objects.

- Form 1: `outcome`, `output`

  - `outcome`: `"done"`
  - `output`: `unknown`
- Form 2: `outcome`, `report`

  - `outcome`: `"refused"`
  - `report`: `string[]`
- Form 3: `outcome`, `ceiling`, `detail`

  - `outcome`: `"ceiling"`
  - `ceiling`: `keyof Ceilings`
  - `detail`: `string`

**See also**

- [Charts](../../concepts/charts.md)
