# Package surfaces

Which entrypoint has what you need, and where it's explained. Anything you can't import from one of these is internal.

| Entrypoint      | Purpose                                             | Start here                                                                 |
| --------------- | --------------------------------------------------- | -------------------------------------------------------------------------- |
| `june`          | the workflow runtime                                | [React as the workflow](https://june.dev/docs/workflows.md)                                      |
| `june/chat`     | persistent conversations and feedback               | [Chat](https://june.dev/docs/chat.md)                                                          |
| `june/copy`     | corpora, voices, writing and copy evaluation        | [Copy and voice](https://june.dev/docs/copy.md)                                                |
| `june/train`    | datasets, evals, jobs and fine-tuning               | [Evals and training](https://june.dev/docs/training.md)                                          |
| `june/trainers` | the trainer adapters `fineTune()` runs: TRL, Vertex | [Local](https://june.dev/docs/training/local.md) and [managed](https://june.dev/docs/training/managed.md) training |
| `june/tools`    | first-party tools for agents: Bash                  | [Tools](https://june.dev/docs/workflows/tools.md)                                                        |
| `june/test`     | scripted models for tests without a key or network  | [Testing](https://june.dev/docs/workflows.md#testing)                                            |
| `june/sdk/*`    | models from OpenAI, Anthropic, Google and xAI       | [Providers](#junesdk)                                                      |

**The root doesn't re-export the subpaths.** Import chat from `june/chat`, training from `june/train`, and so on. Every entrypoint is an ES module with its own type declarations.

**The CLI isn't an entrypoint.** The `june` command runs workflows and chats; see the [CLI reference](https://june.dev/docs/cli.md).

For supported versions and what each export promises, see [Compatibility](https://june.dev/docs/reference/compatibility.md). For what June stores and sends, see [Security and privacy](https://june.dev/docs/reference/security.md).

## `june`

Workflows as React components, run by June's reconciler on top of the AI SDK.

- **Components:** `Agent`, `Step`, `Parallel`, `Catch`, `Tool`, `Bash`, `Inherit`, `RequireApproval`, `Namespace`
- **Capabilities:** `Tool` declares an AI SDK tool, or a tool implemented by a workflow, in an agent's children; `defineAgent` makes an agent that other agents can call as one tool; `defineCapabilities` makes a reusable group of them, `Inherit` passes named tools from an agent to one nested in it, and `RequireApproval` and `Namespace` wrap the capabilities inside them. See [Capabilities](https://june.dev/docs/workflows/capabilities.md)
- **Running:** `run` resolves with a `RunResult`; `start` returns a `RunHandle` to approve or deny tools, snapshot the run and abort it
- **Hooks:** `useStep` runs any async function as a step; `useResource` owns a live value for the run and disposes it when the run ends; `useAgent` returns the closest agent's `ToolLoopAgent`
- **Types:** `AgentProps`, `AgentSettings`, `ToolProps`, `NativeToolProps`, `CompositeToolProps`, `BashProps`, `DefinedAgentOptions`, `InheritProps`, `RequireApprovalProps`, `NamespaceProps`, `StepProps`, `StepResult`, `ParallelProps`, `CatchProps`, `RunOptions`, `RunResult`, `RunHandle`, `RunStatus`, `RunSnapshot`, `SnapshotStep`, `StepState`, `TraceNode`, `TraceError`, `ToolCallTrace`, `ModelCall`, `Usage`, `ApprovalRequest`, `UseStepContext`, `UseStepOptions`

Read: [Workflows](https://june.dev/docs/workflows.md) for the overview, then [Agent and Step](https://june.dev/docs/workflows/agent-and-step.md), [Capabilities](https://june.dev/docs/workflows/capabilities.md), [Running workflows](https://june.dev/docs/workflows/running.md), [Approvals](https://june.dev/docs/workflows/approvals.md), [Snapshots and resume](https://june.dev/docs/workflows/resume.md) and [Traces and usage](https://june.dev/docs/workflows/traces.md).

Stable: the values above, `RunSnapshot`'s `version: 1` format, and `june run --json`'s object. See [Compatibility](https://june.dev/docs/reference/compatibility.md#stable).

## `june/chat`

Conversations: a chat holds sessions, each session holds turns, and a responder answers each turn. With a persistent store such as `fileStore()`, sessions outlive the process.

- **Chats:** `createChat` returns a `Chat`
- **Responders:** `modelResponder` answers with a model; `agentResponder` answers with a June workflow
- **Stores:** `memoryStore` for one process; `fileStore` for a JSONL journal per session on disk
- **Context:** `fullContext` sends the whole session; `summaryContext` summarizes older turns
- **Traces:** `projectChatTrace` turns a `run-update` tree into plain rows for a UI
- **Types:** `Chat`, `Session`, `Turn`, `TurnResult`, `Responder`, `ResponseExecution`, `ChatStore`, `ContextBuilder`, the `ChatEvent` union and its events, and the `ChatJournalEntry` union and its entries

Read: [Chat](https://june.dev/docs/chat.md), then [Learning from chat](https://june.dev/docs/chat/learning.md) to turn sessions into training data with `june/train`.

Stable: the values above, the chat contracts, journal entries at `version: 1`, and `fileStore()`'s layout. See [Compatibility](https://june.dev/docs/reference/compatibility.md#stable).

## `june/tools`

First-party tools for `<Agent tools>`. Each is a plain AI SDK tool, not a June-specific type.

- **Tools:** `bashTool` is the AI SDK tool behind `<Bash />`: it runs a command with Bash on the local machine, and requires approval by default
- **Types:** `BashToolOptions`, `BashToolResult`

`bashTool()` is local process execution with the permissions of the June process. It is not a sandbox.

Read: [Tools](https://june.dev/docs/workflows/tools.md).

Stable: the values above. See [Compatibility](https://june.dev/docs/reference/compatibility.md#stable).

## `june/copy`

Teaching a model to write like a particular person, built on `june/train`.

- **Corpora:** `copyCorpus` loads writing samples from an array or a JSONL file
- **Preparation:** `prepareVoice` reconstructs the brief behind each sample with a teacher model, and throws `PrepareVoiceError`
- **Voices:** `voice` creates a `Voice` that writes, edits and trains; `loadVoice` restores one from its `VoiceManifest`
- **Retrieval and scoring:** `metadataRetriever` picks exemplars; `stylometry` and `judge` are evaluators
- **Workflows:** `Write` runs `voice.write()` as a workflow step
- **Types:** `CopyCorpus`, `WritingSample`, `PreparedVoice`, `PrepareVoiceOptions`, `Voice`, `VoiceOptions`, `VoiceManifest`, `WriteResult`, `VoiceEdit`, `Retriever`, `VoiceEvaluator`, `VoiceScore`, `WriteProps`, `OnCall`

Read: [Copy and voice](https://june.dev/docs/copy.md).

Stable: the values above and `VoiceManifest` at `version: 1`. The teacher, writer and judge prompts and the scoring defaults are less stable. See [Compatibility](https://june.dev/docs/reference/compatibility.md#less-stable).

## `june/train`

Datasets, evals, fine-tuning and long-running jobs. June orchestrates the training; a trainer runs it.

- **Datasets:** `dataset`, and `datasetFromSessions` and `preferenceDatasetFromSessions` for chat sessions
- **Evals:** `evalSuite`, `grader`, `evaluate`, `compareEvaluations`, `casesFrom`, and `evalCasesFromSessions` for chat sessions
- **Fine-tuning:** `fineTune` waits for the result; `startFineTune` starts a job and returns at once, and `fineTuneJob` rebuilds one from its saved ref
- **Jobs:** `job` wraps any long-running backend; a failed job's `result()` rejects with `JobFailedError`
- **Workflows:** `FineTune` and `Evaluate` run as workflow steps
- **Types:** `Dataset`, `TrainingExample` (`CompletionExample`, `ConversationExample`, `PreferenceExample`), `EvalSuite`, `EvalRun`, `EvalComparison`, `Grader`, `FineTuneOptions`, `FineTuneResult`, `TrainingManifest`, `ModelArtifact`, `Job`, `JobRef`, `JobSnapshot`, and the `Trainer` contract: `Trainer`, `TrainerCapabilities`, `TrainingRequest`, `TrainingJob`, `TrainingStatus`, `TrainingOutput`

Read: [Evals and training](https://june.dev/docs/training.md), then [Datasets](https://june.dev/docs/training/datasets.md), [Evals](https://june.dev/docs/training/evals.md), [Fine-tuning](https://june.dev/docs/training/fine-tuning.md), [Jobs](https://june.dev/docs/training/jobs.md), [Training in workflows](https://june.dev/docs/training/workflows.md) and [Custom trainers](https://june.dev/docs/training/custom-trainers.md).

Stable: the values above, the example formats, fingerprints and splits, the `Trainer` contract, job states and the training manifest at `version: 1`. See [Compatibility](https://june.dev/docs/reference/compatibility.md#stable).

## `june/trainers`

The two trainers that ship with June. Each returns a `Trainer` that `fineTune()` accepts.

- **`trl`:** local full (`sft`), LoRA and QLoRA fine-tuning with Hugging Face TRL and PEFT, in a Python process run by uv. Options: `TrlOptions`
- **`vertex`:** managed Gemini tuning on Vertex AI. Options: `VertexOptions` and `VertexProviderOptions`

Read: [Local training](https://june.dev/docs/training/local.md) and [Managed training](https://june.dev/docs/training/managed.md). To write your own trainer, implement the `Trainer` type from `june/train`; see [Custom trainers](https://june.dev/docs/training/custom-trainers.md).

Stable: the values above and the TRL runner's file contract. Provider-namespaced options and metadata follow their providers. See [Compatibility](https://june.dev/docs/reference/compatibility.md#less-stable).

## `june/test`

Test helpers for June apps. A scripted model stands in for a provider's model, so workflow tests need no API key or network.

- **Models:** `scriptedModel` answers every call with a function's reply: text, JSON for an object, or tool calls. It's an AI SDK `MockLanguageModelV4`, and records what June sent in `doGenerateCalls` and `doStreamCalls`
- **Tool calls:** `callTools` makes a reply that calls tools; the agent runs them and calls the model again with their results
- **Types:** `ScriptedCall`, `ScriptedReply`, `ScriptedToolCall`, `ScriptedModelOptions`, `ToolCallsReply`

`june/test` imports `ai/test`, which ships with `ai`, so it needs no other dependency. Import it from tests only.

Read: [Testing](https://june.dev/docs/workflows.md#testing).

Stable: the values above. See [Compatibility](https://june.dev/docs/reference/compatibility.md#stable).

## `june/sdk/*`

Provider wrappers: `june/sdk/openai`, `june/sdk/anthropic`, `june/sdk/google` and `june/sdk/xai`. A model from a provider without importing the AI SDK's provider package yourself. Each wrapper exports one function, the provider's default model factory: `openai`, `anthropic`, `google` and `xai`.

```sh
bun add june react ai @ai-sdk/openai
```

```ts
import { openai } from "june/sdk/openai";

const model = openai("gpt-5-mini");
```

- **Optional peers:** each wrapper loads its `@ai-sdk/*` package, and only that one. Install the providers you use; `june` and its other entrypoints never load them.
- **Missing providers:** running a wrapper with Bun without its package throws an error that names both, with an install command and `code: "JUNE_MISSING_PROVIDER_DEPENDENCY"`. A bundler resolves imports when it builds, so it reports the missing package itself.
- **Model ids are strings:** a wrapper's declarations can't depend on a package you might not have installed, so it takes any `string` and your editor won't suggest the provider's model ids. A typo fails when the model is called.
- **Async modules:** each wrapper loads its provider with top-level `await`. Import it; `require()`, and tools that compile ES modules to CommonJS, can't load it.
- **The escape hatch:** for anything else a provider offers, such as `openai.chat()`, `createAnthropic()`, provider options or typed model ids, import its `@ai-sdk/*` package directly. Models from either work anywhere June takes a model.

Stable: the values above, and the error's `code` and fields. See [Compatibility](https://june.dev/docs/reference/compatibility.md#stable).
