---
title: WorktreeOutput
description: The output of a `worktree()`.
---

# `WorktreeOutput`

Type, in `@jr2/orchestrator/src/worktree.ts`. It is an export of `@jr2/orchestrator`, in the [Effects](group-effects.md) group of the [Authoring surface](../authoring-surface.md) page.

```ts
type WorktreeOutput<S extends string = string> = WorktreeReady<S> | WorktreeRefused | Unknown | LaterOutcome;
```

The output of a `worktree()`. `unknown`: its state exited while it ran, the cut did not end, its answer did not
agree with its request, or the files of a Handoff were not carried (a Harness did not answer, or the carry passed
its time, [ADR-0080](../decisions/0080-a-nested-workspace-takes-a-handoff-at-its-cut.md)).

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

- Form 1: `outcome`, `reason`

  - `outcome`: `"unknown"`
  - `reason`: `string`
- Form 2: `outcome`, `slot`, `path`, `branch`, `head`, `found`, `stale`

  - `outcome`: `"ready"`
  - `slot`: `S`
  - `path`: `WorktreePath<S>`
  - `branch`: `string | null`

    The branch of the cut, from git and the cut's record, never from the folder or HEAD. `null`
    when the Worktree is detached.
  - `head`: `string`

    The tip of `branch` (of the commit, when detached). Never HEAD.
  - `found`: [`WorktreeFound`](type-worktreefound.md)
  - `stale` (optional): `string`

    [ADR-0053](../decisions/0053-a-fetch-inside-the-pod-asks-the-node-cache-and-the-cache-asks-the-remote.md)'s words when the remote did not answer. The cut used what the clone holds.
- Form 3: `outcome`, `reason`

  - `outcome`: `"refused"`
  - `reason`: `string`
- Form 4: `outcome`, `reason`

  - `outcome`: `"(a later outcome)"`
  - `reason` (optional): `string`
