# Packages (/docs/packages)



Every sibling package plugs into `@pleach/core`'s `HarnessPlugin`
contract. `@pleach/core` is the lattice; the siblings are
branches grafted onto it through one shared contract — none of
them rewrite the substrate. Each one adds a specific capability (compliance scrub,
hash-chain verification, OTel destinations, recipe factories)
without altering the four-stage shape or the row keyed by
`turnId`.

Every package is versioned `0.1.0` in source under
FSL-1.1-Apache-2.0 — uniform version, uniform license, one row per
package. The version column is that source version, not what
`npm install` returns today. The reader signal that used to live in the version number now lives in
the **Notes** column: which packages are substrate-complete, which
expose a typed contract with one method still throwing a sentinel.
`@pleach/trust-pack` is a reserved placeholder with no contract.

> **Not on npm yet.** The `@pleach/*` packages aren't on npm yet. Some names are reserved with `0.0.1` placeholders. Each package's first real release ships under FSL-1.1-Apache-2.0. The versions below are the source versions, not what npm returns today.

Pin exact versions. The `0.0.x → 0.1.0` jump and the
`0.1.x → 1.0.0` jump are both non-caretable, and a caret range on a
`0.x` version won't pick up later minors either. Use
`"@pleach/<name>": "<exact version>"` in your `dependencies`, not a
caret range.

Each sibling fills a specific subset of the slots documented
in [Plugin contract](/docs/plugin-contract): `@pleach/compliance`
ships scrubbers, a hash-chain verifier, GDPR erasure, and a
`ComplianceRuntime` (`attestRun`, `verifyChain`, `produceAuditReport`).
Attestation signing is beta: the file-backed key-store signs on its
own, and the AWS KMS and Vault Transit adapters sign through a client
you inject (see [Attestation](/docs/attestation)). `@pleach/eval` reads the `AuditableCall` ledger
via the split lifecycle hooks (`onToolCompleted` / `onMessageAdded`)
and consumes `@pleach/replay`'s `ReplayClient` via DI.
`@pleach/gateway` wraps `@pleach/core`'s model-family substrate
through a typed `GatewayClient`. None of them can add an
out-of-lattice edge or bypass the singleton synthesize seam.

| Package                                                                         | Role                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Status / notes                                                            |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `@pleach/core`                                                                  | Runtime substrate — sessions, graph, channels, audit ledger, checkpointing, sync, storage adapters. Native providers `AnthropicSdkProvider` and `OpenAINativeProvider` (Chat Completions) ship from the root and `@pleach/core/providers`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `0.1.0` · [source](https://www.getpleach.com/docs/core) · substrate complete |
| [`@pleach/tools`](/docs/tools)                                                  | Substrate tool-calling primitives — `UnifiedToolDefinition` contract, queryable registry, Zod schema helpers, form-config + hints surfaces. Now ships &#x2A;*inside `@pleach/core`** at the opt-in subpaths `@pleach/core/tools` and `@pleach/core/tools/unified`; the standalone SKU is a thin re-export shim.                                                                                                                                                                                                                                                                                                                                                                                                       | `0.1.0` in source · not on npm yet · deprecated, ships in `@pleach/core`  |
| `@pleach/react`                                                                 | React-binding primitives — runtime acquisition, message stream, event-log facade, interrupt UI, correction dedup, plus a Vercel AI SDK migration adapter. The lower-level surface that `@pleach/core/react` composes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | `0.1.0` in source · not on npm yet · substrate complete                   |
| [`@pleach/base-tools`](/docs/base-tools)                                        | Domain-agnostic tool primitives: math, datetime, scratchpad, unit\_convert, text\_search, opt-in url\_fetch, plus a markdown citation extractor. Now ships &#x2A;*inside `@pleach/core`** at the opt-in subpath `@pleach/core/base-tools`; the standalone SKU is a thin re-export shim.                                                                                                                                                                                                                                                                                                                                                                                                                               | `0.1.0` in source · not on npm yet · deprecated, ships in `@pleach/core`  |
| `@pleach/replay`                                                                | `ReplayClient` walks the canonical event log via `runtime.events.iterate`/`fold`. `createReplayRuntime` factory ships `replayTurn`, `fromSnapshot`, `fork`, and `aggregateMultiTenant` bodies. The original first-slice not-implemented message stays exported for back-compat detection only.                                                                                                                                                                                                                                                                                                                                                                                                                        | `0.1.0` in source · not on npm yet                                        |
| `@pleach/sandbox`                                                               | Vendor-neutral `SandboxProvider` contract for `@pleach/core` runtimes. Ships the contract, an in-memory fixture, and adapters for an HTTP stream wire shape, HTTP polling, a local child process, and AWS ECS Fargate ([subpaths](/docs/sandbox) `@pleach/sandbox/adapters/httpStream`, `/httpPoll`, `/childProcess`, and `/awsFargate`); and `createSandboxedCodeRunner` at `/adapters/codeRunner`, which runs code in a container, macOS seatbelt, or Linux bwrap sandbox and refuses when none is available; canonical name `SandboxProvider` with the legacy `SandboxAdapter` retained as a `@deprecated` alias. Per-vendor packages aren't shipped; vendor coupling lives in your own gateway or adapter config. | `0.1.0` in source · not on npm yet · contract                             |
| [`@pleach/langchain`](/docs/langchain)                                          | Bidirectional LangChain / LangGraph adapter — a LangGraph checkpointer adapter, tool converters, a store adapter, and a `LangChainProvider`, plus reverse `HarnessCheckpointSaver` and `HarnessEventLogCallback`. Surface still moving — pin tight.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `0.1.0` in source · not on npm yet                                        |
| [`@pleach/compliance`](/docs/compliance)                                        | PII / PHI scrubbers (`SsnUsScrubber`, `CreditCardScrubber` (Luhn-validated), `UsDriverLicenseScrubber`, `KeyedRegexScrubber`), event-chain attestation, and verification utilities for HIPAA / GDPR / PCI-DSS / SOC 2 deployments. Implements the `Scrubber` contract from `@pleach/core/scrubbers`. Re-exports the `ComplianceRuntime` + `ComplianceProfile` types from `@pleach/compliance-contract`.                                                                                                                                                                                                                                                                                                               | `0.1.0` in source · not on npm yet                                        |
| `@pleach/compliance-contract`                                                   | Zero-dependency contract sub-SKU carving out the `ComplianceRuntime` interface + `ComplianceProfile` literal union + structural `Scrubber` mirror. Breaks the `@pleach/core` ↔ `@pleach/compliance` type-graph cycle: both packages depend one-way on this contract; neither needs the other at the type layer. No runtime code.                                                                                                                                                                                                                                                                                                                                                                                      | `0.1.0` in source · not on npm yet · type-only contract                   |
| [`@pleach/rbac-contract`](/docs/rbac-contract)                                  | Zero-dependency contract for role-based access control — a 2-method `RbacRuntime` interface (`checkPermission`, `getRolesForActor`) plus `CheckPermissionInput` / `PermissionDecision` shapes. Same cycle-break pattern as `@pleach/compliance-contract`, but authored fresh with no shipped implementer yet — deliberately not `ga`. `@pleach/core/rbac` adapts it into the existing approval-flow plugin hook.                                                                                                                                                                                                                                                                                                      | `0.1.0` in source · not on npm yet · type-only contract                   |
| `@pleach/eval`                                                                  | `EvalSuite` + `EvalCase` discriminated union + `EvalReport`. Subpaths under `./scorers`, `./replay`, `./report` for built-ins, replay coupling, and report formatters. Deterministic fixture grading, custom scorers, LLM-as-judge ensembles, event-log replay.                                                                                                                                                                                                                                                                                                                                                                                                                                                       | `0.1.0` in source · not on npm yet                                        |
| `@pleach/gateway`                                                               | `GatewayClient` — thin SKU wrapper over `@pleach/core`'s model-family substrate. Per-tenant BYOK key routing, family-strict cascade pivot, per-call cost emission (`domain.gateway.cost.recorded`), OTel `llm.invocation` span emission. Routing math, family matrix, and BYOK resolution stay in core. Concrete native transports aren't bundled: the host supplies a `transports` map, and `createOpenAiCompatibleTransport` ships from `@pleach/gateway/transport`. `routeEmbedding`, `getProviderHealth`, and `getTrafficStats` aren't implemented yet.                                                                                                                                                           | `0.1.0` in source · not on npm yet                                        |
| `@pleach/mcp`                                                                   | Concrete `MCPServer` class wrapping `SessionRuntime` — tools (projected from `runtime.tools.list()`; native execution opt-in and approval-gated), resources (`pleach://artifact/*`, `pleach://sandbox/*`), and prompts surfaced over MCP. Transports: stdio, HTTP+SSE with optional Streamable HTTP, and WebSocket (optional `ws` peer), with loopback-default `Host` / `Origin` allowlists and connection, in-flight, and timeout limits. Fail-closed per-connection multi-tenant routing via `tenantIdExtractor`, `registerSession({ tenantId })`, or a `resolveRuntime` hook.                                                                                                                                      | `0.1.0` in source · not on npm yet                                        |
| [`@pleach/coding-agent`](/docs/coding-agent#pleachcoding-agentruntime-contract) | SWE-bench-shaped coding-agent runtime opt-in for `@pleach/core`. All three async methods have real bodies: `start()` composes the underlying `SessionRuntime`, `stop()` drains it, `executeStep()` drives one turn through `SessionRuntime.executeMessage`. The body throws a not-started error only when called before `start()` — no auto-start, by design. LRU `CodingContextManager` for file-context budget management.                                                                                                                                                                                                                                                                                          | `0.1.0` in source · not on npm yet                                        |
| [`@pleach/observe`](/docs/observe)                                              | Destination-flexible observability SDK — a thin facade (`init` + per-turn recorder + destination plug) that hooks into existing AI SDK / LangChain / custom loops and writes a chained `AuditableCall` row to the runtime's table and chain for each call you hand it when pointed at Postgres (or any ledger you pass); OTel and in-memory destinations get telemetry. Destinations: Postgres, Supabase, OTel, memory (a Pleach Hosted destination isn't available yet). The `@pleach/observe/resource-meter` subpath adds `measureResources`, a per-scope CPU, memory, event-loop, and fetch meter.                                                                                                                 | `0.1.0` · scoped, not yet on npm                                          |
| [`@pleach/recipes`](/docs/recipes-pleach-recipes)                               | Composable one-line factories over `@pleach/core` — `simpleChatbot`, `ragChatbot`, `observableChatbot`, `compliantChatbot`, `instrumentedCodingAgent`. Each subpath pulls only the `@pleach/*` peers its recipe needs; peer deps for `observe`, `compliance`, `coding-agent`, and `sandbox` are optional.                                                                                                                                                                                                                                                                                                                                                                                                             | `0.1.0` in source · not on npm yet                                        |
| [`@pleach/transport-bedrock`](/docs/transport-bedrock)                          | AWS Bedrock transport implementing the `AgentProvider` contract — Anthropic, Llama, Mistral, and Cohere models on Bedrock. `@aws-sdk/client-bedrock-runtime` is an optional peer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | `0.1.0` · source-complete, not on npm (`private`)                         |
| [`@pleach/transport-azure-openai`](/docs/transport-azure-openai)                | Azure OpenAI transport implementing the `AgentProvider` contract — API-key, Azure AD, and managed-identity auth.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `0.1.0` · source-complete, not on npm (`private`)                         |
| [`@pleach/transport-vertex`](/docs/transport-vertex)                            | GCP Vertex AI transport implementing the `AgentProvider` contract — Gemini, Claude on Vertex, and Llama, with ADC or service-account auth.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `0.1.0` · source-complete, not on npm (`private`)                         |
| `@pleach/trust-pack`                                                            | Reserved name. No contract or code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `0.0.1` · placeholder · UNLICENSED                                        |

## Subpath exports per package [#subpath-exports-per-package]

Every `@pleach/*` package uses a dir-style entry convention: the
root export is the public API, with named subpaths under it for
narrower surfaces (`/react`, `/server`, `/testing`, and similar).
Each `exports` map orders conditions types-first per Node's
resolution spec, so TypeScript sees the `.d.ts` before the
runtime entry.

The per-subpath inventory lives in
[Subpath exports](/docs/subpath-exports) — one table per package,
listing every documented entry and what it's for.

The full packaging conventions — `exports` ordering rules,
`sideEffects` discipline, and `engines` floors — live in
[Publishing contract](/docs/publishing-contract).

## Language-agnostic contract [#language-agnostic-contract]

The runtime contract — sessions, checkpoints, storage, tools, sync,
SSE wire — is language-agnostic by design. The TypeScript
distribution is the reference implementation, in production today.
A Go implementation is planned; the wire contract already works in
a Go reference consumer, which reads the SSE frames and checkpoint
envelopes.
The five contract shapes a non-TS consumer implements (HTTP+SSE
wire, `StreamEvent` union, `AuditableCall` row, `Checkpoint`
envelope, version vector) are enumerated on the [Language-agnostic contract](/docs/language-agnostic-contract#whats-in-the-contract) page.

If a claim in these docs only holds in JavaScript, that's a
documentation bug. Issues welcome on the relevant package's repo.

## Licensing [#licensing]

Every `@pleach/*` package — substrate, adapter, and SDK
alike — is licensed under **FSL-1.1-Apache-2.0** (Functional Source
License with Apache 2.0 as the future license). Source-available,
usable in production, free of charge during the FSL window; the
only restriction is on competing offerings. Each release auto-
transitions to permissive Apache 2.0 two years after it ships. The single exception is `@pleach/trust-pack`: a reserved
npm name with no shipping code, kept at `0.0.1 · UNLICENSED` until
a future cut. See [Pricing](/pricing) for commercial-use guidance.

## Where to go next [#where-to-go-next]

<Cards>
  <Card title="Architecture" href="/docs/architecture" description="The six pieces of the substrate and how the planned siblings plug into them." />

  <Card title="Plugin contract" href="/docs/plugin-contract" description="The HarnessPlugin extension surface every sibling SKU will use." />

  <Card title="Language-agnostic contract" href="/docs/language-agnostic-contract" description="The five wire shapes that define the substrate. A Go implementation is planned; a Go reference consumer already reads the SSE frames and checkpoint envelopes." />

  <Card title="Versioning policy" href="/docs/versioning" description="Semver, deprecation, and per-SKU release cadence." />
</Cards>
