Skip to content

Package surfaces

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

EntrypointPurposeStart here
junethe workflow runtimeReact as the workflow
june/chatpersistent conversations and feedbackChat
june/copycorpora, voices, writing and copy evaluationCopy and voice
june/traindatasets, evals, jobs and fine-tuningEvals and training
june/trainersthe trainer adapters fineTune() runs: TRL, VertexLocal and managed training
june/toolsfirst-party tools for agents: BashTools
june/testscripted models for tests without a key or networkTesting
june/sdk/*models from OpenAI, Anthropic, Google and xAIProviders

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.

For supported versions and what each export promises, see Compatibility. For what June stores and sends, see Security and privacy.

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
  • 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 for the overview, then Agent and Step, Capabilities, Running workflows, Approvals, Snapshots and resume and Traces and usage.

Stable: the values above, RunSnapshot's version: 1 format, and june run --json's object. See Compatibility.

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, then Learning from chat 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.

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.

Stable: the values above. See Compatibility.

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.

Stable: the values above and VoiceManifest at version: 1. The teacher, writer and judge prompts and the scoring defaults are less stable. See Compatibility.

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, then Datasets, Evals, Fine-tuning, Jobs, Training in workflows and Custom trainers.

Stable: the values above, the example formats, fingerprints and splits, the Trainer contract, job states and the training manifest at version: 1. See Compatibility.

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 and Managed training. To write your own trainer, implement the Trainer type from june/train; see Custom trainers.

Stable: the values above and the TRL runner's file contract. Provider-namespaced options and metadata follow their providers. See Compatibility.

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.

Stable: the values above. See Compatibility.

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.

bun add june react ai @ai-sdk/openai
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.