# Subpath exports (/docs/subpath-exports)



`@pleach/core` ships an ESM-first export map with both `import`
and `require` entries (the package is `type: module`; CommonJS
consumers get `.cjs` builds). Below: the named subpaths consumers
should rely on, plus the one remaining wildcard and what it costs
you.

Snapshot is for `@pleach/core@0.1.0` — 180 named entries as of
2026-09-06. The
canonical list lives in the package's `package.json`. This site checks
every specifier below against that export map, so an entry here won't
throw `ERR_PACKAGE_PATH_NOT_EXPORTED`.

## Named subpaths [#named-subpaths]

`stable` means the path is named in the published `exports` map and
watched by the upstream package-export audit. Removal or rename goes
through a deprecation cycle. Each subpath ships ESM (`.js`), CJS
(`.cjs`), and types (`.d.ts`) — see [Dual-format builds](#dual-format-builds).

### Substrate runtime [#substrate-runtime]

| Import                                     | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Stability |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `@pleach/core`                             | Root barrel — `SessionRuntime`, factories, runtime types                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | stable    |
| `@pleach/core/SessionRuntime`              | `SessionRuntime` class, direct entry (barrel sidesteps tree-shaking)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | stable    |
| `@pleach/core/runtime`                     | Process-scoped registries + module-loader indirection                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | stable    |
| `@pleach/core/runtime/createPleachRuntime` | `createPleachRuntime`, `TurnOrchestrator`, host-injection types                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | stable    |
| `@pleach/core/quickstart`                  | Zero-config starter surface — `createPleachRoute` (fetch-handler factory; its `wrapTurn` hook uses `PleachAdmittedTurn`, `WrapTurnHook`, `WrapTurnRerunError`, `WRAP_TURN_RERUN_CODE`, `WRAP_TURN_NOT_RUN_CODE` and `ROUTE_WRAP_TURN_CAPABILITY`), `defaultPlugin`, `createBenchmarkPlugin`, `providerDetection` (`detectProvider`, `detectAvailableProviders`, `DEFAULT_PROVIDER_ENV_VARS`, `DEFAULT_PROVIDER_PRIORITY`). What `npx @pleach/core init` scaffolds against. See [Quickstart](/docs/quickstart). Loads on a server with no `react` installed; `useChat` and `ChatBox` remain here only as deprecated names that load `@pleach/core/quickstart/react` on first call (Node and SSR only). | stable    |
| `@pleach/core/quickstart/react`            | React half of the quickstart — `useChat` (Pleach-native hook), `<ChatBox />` (unstyled, accessible), their option, return and status types (`UseChatOptions`, `UseChatReturn`, `UseChatMessage`, `UseChatStatus`, `ChatBoxProps`, `ChatBoxClassNames`), `UseChatDuplicateMessageError`, `PLEACH_REQUEST_ID_HEADER`, `TOOL_OUTPUT_MAX_CHARS` and `appendCappedToolOutput`. Imports `react`, an optional peer.                                                                                                                                                                                                                                                                                          | stable    |

### Type subpaths [#type-subpaths]

Type-only deep paths have named entries, so consumers don't pay the
wildcard's instability cost on contracts.

| Import                                 | Ships                                | Stability |
| -------------------------------------- | ------------------------------------ | --------- |
| `@pleach/core/types`                   | Public type definitions (re-exports) | stable    |
| `@pleach/core/types/command`           | `Command` + `isCommand` brand        | stable    |
| `@pleach/core/types/dynamicAppModules` | Dynamic-app-module type registry     | stable    |
| `@pleach/core/types/generic`           | Generic runtime types                | stable    |
| `@pleach/core/types/singleTurn`        | Single-turn body contract types      | stable    |
| `@pleach/core/types/strategies`        | Strategy registration types          | stable    |

### Persistence + state [#persistence--state]

| Import                               | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Stability |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `@pleach/core/sessions`              | Session-state adapters — `MemoryAdapter`, `IndexedDBAdapter`, `SupabaseAdapter`                                                                                                                                                                                                                                                                                                                                                                                                                                        | stable    |
| `@pleach/core/checkpointing`         | Checkpoint savers — `MemorySaver`, `IndexedDBSaver`, `SupabaseSaver`                                                                                                                                                                                                                                                                                                                                                                                                                                                   | stable    |
| `@pleach/core/sync`                  | Version-vector sync utilities                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | stable    |
| `@pleach/core/store`                 | Namespaced KV store — `BaseStore` (abstract: get / put / delete / search over hierarchical namespaces), `MemoryStore`, `SupabaseStore`, `MemoryNamespaces`, `validateNamespace` / `NAMESPACE_COMPONENT_RE`. `MemoryStore` is the ship-a-default binding when `config.store` is unset. Also the unified `DurableStore` binding: `createMemoryDurableStore`, `createSqliteDurableStore` (on-disk; built-in `node:sqlite` on Node ≥ 22.5, else optional `better-sqlite3`), `composeDurableStore`, `createMemoryBlobStore` | stable    |
| `@pleach/core/cache`                 | In-memory cache backend (`createMemoryCacheBackend`) + content-hash deriver (`deriveContentHashKey`, `canonicalizeKeyInput`, `ContentHashKeyInput` — re-exported by `@pleach/replay/cache`)                                                                                                                                                                                                                                                                                                                            | stable    |
| `@pleach/core/schema`                | Generated row-shape types + SQL bundle                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | stable    |
| `@pleach/core/schema/postgres/*.sql` | Raw SQL migrations (asset import)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | stable    |
| `@pleach/core/schema/sqlite/*.sql`   | Raw SQL for the SQLite store (`base/`, `extensions/fts/`, `extensions/permissions/`; asset import). `createSqliteDurableStore` applies them on open. See [Schema § SQLite schema files](/docs/schema#sqlite-schema-files)                                                                                                                                                                                                                                                                                              | stable    |

### Event log + projections [#event-log--projections]

| Import                               | Ships                                                                                                                                                                                                                                                                                     | Stability    |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `@pleach/core/eventLog`              | `EventLogWriter`, `EventLogClient`, `hydrateFromEvents`, `GraphProjection<T>`                                                                                                                                                                                                             | stable       |
| `@pleach/core/eventLog/durableFlush` | The serverless durability seam — `setWaitUntilImpl`, `deferFlush`, `awaitPendingFlushes`. Register your platform's `waitUntil` so the event log survives a function returning. See [Deployment](/docs/deployment).                                                                        | stable       |
| `@pleach/core/manifest`              | Chat-manifest — `createDefaultChatManifestProvider` (the `[Session Manifest]` ledger + section render), checkpoint/reload persistence (`stampManifestIntoState`, `restoreManifestFromState`), and `chatManifestProjection` / `foldChatManifest` (the manifest as an event-log projection) | experimental |

### Audit, attestation, scrub [#audit-attestation-scrub]

| Import                                 | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Stability    |
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `@pleach/core/audit`                   | `AuditableCall` ledger primitives + no-op plug-points                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | stable       |
| `@pleach/core/attestation`             | Attestation module — signer, verifier, canonical envelope                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | stable       |
| `@pleach/core/attestation/keyStores`   | Pluggable key-store backends (memory, env, KMS adapters)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | stable       |
| `@pleach/core/attestation/testing`     | Test fixtures + harness for attestation flows                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | stable       |
| `@pleach/core/attestation/cms`         | Detached CMS (RFC 5652) `SignedData` over an attestation's canonical bytes — `buildAttestationDetachedCms`, `buildDetachedCmsSignedData`, `extractSignedAttributesFromArtifact`, `CmsAttestationError`. Additive: a CMS artifact is emitted **alongside** the bespoke `AttestationV1.signature`, never instead of it. The ASN.1 encoders are optional peers loaded by dynamic import — see [Attestation § The CMS envelope](/docs/attestation#the-cms-envelope).                                                                                                                          | stable       |
| `@pleach/core/crypto`                  | Crypto-shred (GDPR erasure) primitives — `createPayloadCipher` (AES-256-GCM over named audit-payload fields), `SubjectKeyRegistry` (per-subject DEK lifecycle, fail-closed after `shred`), `createAesGcmKekProvider`. Cipher and DEK lifecycle only; you supply the write path, read path, and erasure orchestration. Declare the wrapped-key and `iv` columns **nullable**: on a `NOT NULL` schema a shred can't erase, so the registry's preflight makes `getOrCreateDek` throw `SubjectKeyDdlShapeError` before any key is stored ([Erasure limits](/docs/compliance/erasure-limits)). | experimental |
| `@pleach/core/audit/permission-ledger` | Read side of the permission ledger — `createPermissionLedger`, `createSqlitePermissionLedgerClient`, `createPgPermissionLedgerClient`, approver references and `eraseApprover`. The library behind `pleach audit`. See [Audit ledger § Permission ledger](/docs/audit-ledger#permission-ledger)                                                                                                                                                                                                                                                                                           | experimental |
| `@pleach/core/scrubbers`               | Redaction surface — `SCRUBBABLE_FIELDS` allowlist + scrubber registry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | stable       |

The ready-made `AuditStoreLike` stores ship from `@pleach/compliance`, not core: `@pleach/compliance/audit/stores` exports `createSqliteAuditStore` and `createPgAuditStore`. See [Compliance § Ready-made stores](/docs/compliance#ready-made-stores-sqlite-and-postgres).

### Prompts + prompt-builder [#prompts--prompt-builder]

| Import                                 | Ships                                                                                                     | Stability |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------- |
| `@pleach/core/prompts`                 | Prompt-contribution contract — `PromptContributionRegistry`, `PromptContribution`, 41 universal templates | stable    |
| `@pleach/core/prompts/examples`        | Reference prompt contributors                                                                             | stable    |
| `@pleach/core/prompt-builder`          | Generic composition — `composeBudgetedPrompt` + diagnostics                                               | stable    |
| `@pleach/core/prompt-builder/sections` | Section primitives                                                                                        | stable    |
| `@pleach/core/prompt-builder/examples` | Reference section assemblies                                                                              | stable    |

\| `@pleach/core/context` | Context-window budget — `computeContextBudget`, `resolveCompactionThreshold`, `estimateMessageTokens`, and the `DEFAULT_COMPACTION_TRIGGER_TOKENS` / `DEFAULT_COMPACTION_RATIO` / `DEFAULT_CONTEXT_WINDOW_TOKENS` defaults. One shared token budget across prompt + history, which is what the context gauge reads. | stable |

### Model pipeline [#model-pipeline]

| Import                      | Ships                                                                                                                                                                                                                                                                                                       | Stability |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `@pleach/core/hooks`        | Pre/post-model hooks — `PreModelHook`, `PostModelHook`, `ModelProfile` + four shipped hooks (`historyTrimmerHook`, `lazyModelDefaultsHook`, `toolCallValidatorHook`, `repetitionDetectorHook`). See [Model hooks](/docs/hooks).                                                                             | stable    |
| `@pleach/core/middleware`   | Orchestrator middleware — `OrchestratorMiddleware`, `MiddlewareStack`, `ResultEvictionMiddleware`, `SummarizationMiddleware`, the AI-SDK-compatible `LanguageModelMiddleware`, `CHARS_PER_TOKEN`. See [Orchestrator middleware](/docs/middleware).                                                          | stable    |
| `@pleach/core/synthesis`    | Synthesis stream surface — `SynthesisEmitter` (emits the synthesize-stage stream events) + `enrichOffloadedToolPreviews` (folds offloaded tool summaries back into previews).                                                                                                                               | stable    |
| `@pleach/core/pricing`      | Cost math — `computeTurnCost`, `DEFAULT_PRICING_MATRIX`, `createPricingResolver`, `fetchOpenRouterPricing` / `applyToMatrix`, `resolveCostEventUsd`, `parseModelSlug`. See [Pricing math](/docs/pricing).                                                                                                   | stable    |
| `@pleach/core/model-family` | The `RoutingDecision` audit contract — `buildBaseRoutingDecision`, `appendFallbackStep`, `markUserInitiatedUpgrade` — plus the model-family matrix, cascade logic, and the `Transport` union. Previously internal; now the published surface `@pleach/gateway` routes through instead of a host-path alias. | stable    |

### Safety [#safety]

| Import                         | Ships                                                                 | Stability |
| ------------------------------ | --------------------------------------------------------------------- | --------- |
| `@pleach/core/safety`          | `SafetyPolicyRegistry`, `composeSafetyContent`, contribution registry | stable    |
| `@pleach/core/safety/examples` | Reference safety contributors                                         | stable    |

### Access control + export [#access-control--export]

| Import                | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                         | Stability    |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `@pleach/core/rbac`   | `createRbacApprovalFlow` — adapts a host-supplied `RbacRuntime` (from [`@pleach/rbac-contract`](/docs/rbac-contract)) into the `ApprovalFlowContribution` plugin-hook shape. No new hook: this reuses the existing pre-execution `checkApprovalNeeded` gate. That hook has no shipped consumer in the reference host today — read it as advisory pre-wiring, not an enforcement boundary, until you wire `contributeApprovalFlow()` yourself. | experimental |
| `@pleach/core/export` | `exportRows(rows, columns, format)` — a pure, zero-dependency row exporter to JSON, CSV, or Markdown from a typed row array + column mapping. Guards CSV formula injection (a cell starting with `=`, `+`, `-`, or `@` is quote-prefixed before it can execute as a formula in Excel or Sheets).                                                                                                                                              | stable       |

### Lineage + fingerprint + observability [#lineage--fingerprint--observability]

| Import                         | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Stability                |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `@pleach/core/lineage`         | `LineageTracker` + 6 lineage types (Layer-4 lineage primitives)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | stable                   |
| `@pleach/core/fingerprint`     | `computeFingerprint` — platform-uniform pure hash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | stable                   |
| `@pleach/core/otel`            | OpenTelemetry no-op + adapter seams                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | stable                   |
| `@pleach/core/inspector`       | `inspectRuntime`, `InspectionReport`, `CapabilityReport`, `PluginReport`, `CapabilityDescriptor`, the 35 known-capability list (31 modern + 4 deprecated)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | stable                   |
| `@pleach/core/harness`         | Turn-report folding for the headless self-observation loop (the `harness` chatinit flag + `pleach dev` plugin-test harness) — `foldTurnReport`, `foldTurnReportFromEvents`, `createHarnessCapture`, `projectInspector`, `diffReports`, `evaluateAssertions`, `buildReportMarkdown` (`{ verbose }` for the audit-ledger/runtime-log/tool-card sections), `TurnReport`. Also the answer-quality battery `detectEdgeCases` (+ `EdgeCaseFinding`, `hasSubstantiveAnswerBody`, `PLAN_NARRATION_PATTERNS`), the default `defaultAnswerSufficiencyBackstop`, and the headless-diagnostics pub/sub (`getDiagnosticsBus`, `DiagnosticsBus`). See [Playground & DevTools](/docs/playground-and-devtools). | stable                   |
| `@pleach/core/instrumentation` | UX-parity probes + observer-vs-legacy divergence telemetry, `stageIdForModelCall` (the stage an audit row names for a model call), the console-text formatter (`setConsoleTextFormatter`) and the unredacted error sink (`setUnredactedErrorSink`)                                                                                                                                                                                                                                                                                                                                                                                                                                              | stable, internal-leaning |

### Strategies + streaming [#strategies--streaming]

| Import                                                | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Stability                                             |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `@pleach/core/strategies`                             | Strategy barrel — fabrication detector + named detectors + guard types                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | stable                                                |
| `@pleach/core/strategies/schemaCondensation`          | `condenseSchemas` (**deprecated**: supply your own per-request tool budget through the context-aware `getTools(ctx)` hook instead. See [Tools § Budgeting the offer yourself](/docs/tools#budgeting-the-offer-yourself-gettoolsctx). It stays the `condenseTools` default until you migrate) + the budget-decision types (`SchemaCondensationBudgetDecisions`, `SchemaCondensationDecline`, `SchemaCondensationDeclineGate`, `SchemaCondensationDeclinePass`, `CondensableTool`, `SchemaCondensationConfig`), plus the floor types (`FloorToolsContribution`, `FloorFamily`, `FloorFamilyMode`) and `resolveFloorFamilies`. See [Plugin contract § `contributeFloorTools`](/docs/plugin-contract#contributefloortools). The decisions also land durably on `tool_offer.snapshot.condensation_budget` — see [Audit ledger](/docs/audit-ledger). | deprecated (`condenseSchemas`); the types stay stable |
| `@pleach/core/strategies/fabricationDetector`         | Direct fabrication detector entry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | stable                                                |
| `@pleach/core/strategies/fabricationDetectors`        | Named fabrication detector cohort                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | stable                                                |
| `@pleach/core/strategies/fabricationGuardTypes`       | Guard type contracts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | stable                                                |
| `@pleach/core/strategies/hallucinationDetector`       | Hallucinated tool-call detector                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | stable                                                |
| `@pleach/core/strategies/toolResultState`             | Tool-result state reducer strategy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | stable                                                |
| `@pleach/core/strategies/continuationStreamGate`      | Continuation stream-gate strategy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | stable                                                |
| `@pleach/core/strategies/continuationSignals`         | Continuation signal primitives                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | stable                                                |
| `@pleach/core/strategies/contextInitializerGeneric`   | Generic context initializer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | stable                                                |
| `@pleach/core/strategies/planCoverageReview`          | Plan-coverage review strategy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | stable                                                |
| `@pleach/core/strategies/hedgePolicy`                 | Hedge-policy strategy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | stable                                                |
| `@pleach/core/streaming`                              | Producer side — `StreamManager`, `asyncEventChannel`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | stable                                                |
| `@pleach/core/streaming/dsmlSanitizer`                | DSML sanitizer (chunk-time amend observer)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | stable                                                |
| `@pleach/core/streaming/bracketNarratedToolExtractor` | Bracket-narrated tool-call extractor                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | stable                                                |
| `@pleach/core/streaming/hallucinatedToolDetector`     | Hallucinated tool-call detector entry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | stable                                                |
| `@pleach/core/streaming/streamDegenerationGuards`     | Stream degeneration guard primitives                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | stable                                                |
| `@pleach/core/finalization`                           | Finalization barrel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | stable                                                |
| `@pleach/core/finalization/finalizeContent`           | `finalizeContent` direct entry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | stable                                                |

### Providers [#providers]

| Import                          | Ships                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Stability |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `@pleach/core/providers`        | Provider-failure taxonomy + reasoning-only recovery precondition — `FailureCategory`, `FailureClassification`, `BillingDisposition`, `ModelUnavailableReason`, `classifyEmptyStream`. The seam recovery arm keys on these; the reasoning-model set + provider string→category matchers stay host-injected (`SessionRuntimeConfig.reasoningRecovery`). See [Providers § Reasoning-only completion recovery](/docs/providers#reasoning-only-completion-recovery).                         | stable    |
| `@pleach/core/providers/stream` | Provider stream helpers with no imports and no module state — `createTimeoutIterator` / `StreamIteratorWithTimeout` (first-byte and idle timeouts over any async stream), the OpenRouter error normalizers (`normalizeOpenRouterError`, `normalizeStreamChunk`, `normalizeErrorStream`, …) and `parseToolCallArguments`. Not re-exported from the root or from `@pleach/core/providers`.                                                                                                | stable    |
| `@pleach/core/ai-sdk`           | Vercel AI SDK adapter — `loadAiSdk`, `normalizeStreamPart`, `normalizeUsage` / `normalizeResultUsage` and the `ModelStreamEvent` / `ModelUsage` types, plus the `useChat` encoder (`toUIMessageStreamResponse`, `settleToolApprovals`; see [Serving `useChat`](/docs/providers#serving-usechat-from-a-pleach-turn)). Not re-exported from the root because its types reference `ai`; install `ai` to use it. See [Providers § `@pleach/core/ai-sdk`](/docs/providers#pleachcoreai-sdk). | stable    |

### Graph + planning + execution [#graph--planning--execution]

| Import                                        | Ships                                                                                                                                                                                                                                                                                                                                                                                                       | Stability    |
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `@pleach/core/graph/planning`                 | Planning substrate — plan-channel utilities                                                                                                                                                                                                                                                                                                                                                                 | stable       |
| `@pleach/core/graph/seams`                    | Seam constructors + holders — `createSeam`, `createSynthesizeSeam`, `createReasoningSeam`, `createConverseSeam`, `SynthesizeSeamHolder` / `ReasoningSeamHolder` / `ConverseSeamHolder`, `UnknownShapeRegistry`, `createTrivialSynthesizeCounter`                                                                                                                                                            | stable       |
| `@pleach/core/graph/seams/types`              | Seam type contracts                                                                                                                                                                                                                                                                                                                                                                                         | stable       |
| `@pleach/core/graph/recovery`                 | Recovery graph nodes — `createRecoveryGraphNode`, `createRefusalHintNode`, `createRetryNarrationNode`, `recoveryDispatch`, `dispatchArmToRecoveryKind`                                                                                                                                                                                                                                                      | stable       |
| `@pleach/core/graph/predicates/accessRefusal` | `ACCESS_REFUSED_KEY` (`"_access_refused"`) and `isAccessRefused(result)`: the result marker for a refusal that a retry of the same tool can't clear. See [Tools § Per-session allow rule](/docs/tools#per-session-allow-rule-sessiontoolallowed).                                                                                                                                                           | stable       |
| `@pleach/core/graph/defaultAgentState`        | The default agent-state channel shape                                                                                                                                                                                                                                                                                                                                                                       | stable       |
| `@pleach/core/graph/topology`                 | `NODE_STAGE_MAP` + stage lookup (`getStageForNode`) and the plugin-node stage overlay                                                                                                                                                                                                                                                                                                                       | stable       |
| `@pleach/core/graph/defaultAgentGraph`        | `buildDefaultAgentGraph` + its `DefaultAgentGraphConfig` and the executor/contributor types it takes. The canonical builder, and the only published home for it — the bare `@pleach/core/graph` is not an export.                                                                                                                                                                                           | stable       |
| `@pleach/core/graph/seams/callClassConstants` | `UTILITY_CALL_CLASS`, `REASONING_CALL_CLASS`, `CONVERSE_CALL_CLASS`, `SYNTHESIZE_CALL_CLASS` — name a call class without writing a literal. See [Call classes](/docs/call-classes#where-callclass-literals-belong).                                                                                                                                                                                         | stable       |
| `@pleach/core/graph/tuning`                   | Shadow-tuning barrel — `TuningKnobId`, `KnobDerivationPolicy`, `buildTuningShadowSnapshot`, the snapshot holder (`installTuningShadowSnapshot` / `readTuningShadowSnapshot`) + env installer, `emitTuningShadowDelta`. For scripts, tests, and hosts — graph read sites import the holder and emit modules directly, never the barrel. See [Graph § Tuning shadow](/docs/graph#tuning-shadow-experimental). | experimental |
| `@pleach/core/engine`                         | `RetryPolicy`, `AbortComposer`, `SuperstepRunner`, `createPromiseBarrier`, `shouldTriggerNode`                                                                                                                                                                                                                                                                                                              | stable       |
| `@pleach/core/channels`                       | Typed state containers — `LastValue`, `BinaryOperatorAggregate`, `Topic`, `EphemeralValue`, `NamedBarrier`                                                                                                                                                                                                                                                                                                  | stable       |
| `@pleach/core/detectors`                      | Detector primitives — `syntheticExpansionDetector`                                                                                                                                                                                                                                                                                                                                                          | stable       |

### Tools + plugins + meta [#tools--plugins--meta]

| Import                                                      | Ships                                                                                                                                                                                                                                                                                                                                                                               | Stability    |
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `@pleach/core/tools`                                        | `ToolRegistryWrapper`, `ToolBatchExecutor`, catalog re-exports                                                                                                                                                                                                                                                                                                                      | stable       |
| `@pleach/core/tools/execution`                              | Tool-execution pipeline stages + resolved-tools registry (`recordRegistryResolvedTool`, `getRegistryResolvedToolNames`, `hasRegistryResolvedTool`, `resetRegistryResolvedTools`)                                                                                                                                                                                                    | stable       |
| `@pleach/core/plugins`                                      | `PluginManager` + `HarnessPlugin` interface                                                                                                                                                                                                                                                                                                                                         | stable       |
| `@pleach/core/async`                                        | Long-running task orchestration — `AsyncTaskManager`, executor contract, task reducer                                                                                                                                                                                                                                                                                               | stable       |
| `@pleach/core/plans`                                        | Plan substrate — `PlanManager`, plan/step/revision types                                                                                                                                                                                                                                                                                                                            | stable       |
| `@pleach/core/subagents`                                    | Concurrent subagent execution — `SubagentManager`, `LightweightRuntime`                                                                                                                                                                                                                                                                                                             | stable       |
| `@pleach/core/memory`                                       | Auto-extracted user facts + per-agent memory scoping                                                                                                                                                                                                                                                                                                                                | stable       |
| `@pleach/core/feedback`                                     | Human-feedback write API — `recordFeedback` (rating / correction / preference into a durable `domain.<ns>.feedback.recorded` row + a meta-namespace memory write), `feedbackEventType`, the `FEEDBACK_TEXT_MAX_CHARS` / `FEEDBACK_METADATA_JSON_MAX_CHARS` caps, and the `FeedbackKind` / `RecordFeedbackResult` types. See [Memory § Human feedback](/docs/memory#human-feedback). | stable       |
| `@pleach/core/query`                                        | Read-side query helpers                                                                                                                                                                                                                                                                                                                                                             | stable       |
| `@pleach/core/skills`                                       | Skill substrate — loader + frontmatter parsing. `@pleach/core/skills/loader` (`SkillLoader`, `invalidateSkillLoaderMemo`) and `@pleach/core/skills/types` (`Skill`, `SkillFrontmatter`) are the narrower named entries. See [Skills](/docs/skills).                                                                                                                                 | stable       |
| `@pleach/core/runtime/facets/{context,model,prompts,tools}` | The client-facet surface a host implements to supply context, model resolution, prompt building, and tool resolution — `createClientContextFacet`, `createClientModelFacet`, `createClientPromptsFacet`, `createClientToolsFacet` and their `*FacetHost` contracts. See [Facets](/docs/facets).                                                                                     | experimental |
| `@pleach/core/testing`                                      | Headless turn driver — `runScriptedTurn`, `collectTurn`, `createScriptedAdapter`, `createScriptedClient`, `runProviderTurn`, `benchmarkProviders`, `captureProbes`. See [Testing](/docs/testing).                                                                                                                                                                                   | stable       |

### Re-exports [#re-exports]

| Import                    | Ships                                                                                                                                                                                                                                                                                                                            | Stability |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `@pleach/core/react`      | Re-export of `@pleach/react` — hooks + `HarnessProvider` + DevTools                                                                                                                                                                                                                                                              | stable    |
| `@pleach/core/react/lab`  | Canonical home for the lab component kit — `PleachLab` + panels + `useLatticeState` (`@pleach/react/lab` aliases it). See [React § The composable kit](/docs/react#the-composable-kit).                                                                                                                                          | stable    |
| `@pleach/core/react/pure` | Browser-pure component variants — `SessionSwitcherView`, `SessionCheckpointTimelineView`, `RecallPanelView` — with zero `useHarnessContext` dependency, for fetch-split apps where the runtime lives server-side and the client only fetches. Mirrors the existing pure/wired split already shipped for `InterruptApprovalCard`. | stable    |
| `@pleach/core/adapters`   | Storage + streaming adapters                                                                                                                                                                                                                                                                                                     | stable    |

### Runtime registries + auth + utils [#runtime-registries--auth--utils]

| Import                                | Ships                                                            | Stability |
| ------------------------------------- | ---------------------------------------------------------------- | --------- |
| `@pleach/core/runtimeRegistry`        | Process-scoped runtime registry                                  | stable    |
| `@pleach/core/guestInterruptBus`      | Guest interrupt bus (registry seam)                              | stable    |
| `@pleach/core/guestInterruptCallback` | Guest interrupt callback (registry seam)                         | stable    |
| `@pleach/core/auth`                   | Auth providers — `ApiKeyAuth`, `BearerTokenAuth`, `AuthProvider` | stable    |
| `@pleach/core/utils`                  | UUIDv7, typed `EventEmitter`, SHA-256 integrity helpers          | stable    |

### Wildcard [#wildcard]

| Import                    | Ships                                                                   | Stability    |
| ------------------------- | ----------------------------------------------------------------------- | ------------ |
| `@pleach/core/internal/*` | Scoped hatch over `dist/` — implementation detail, no deprecation cycle | **unstable** |

`stable` means: the path is named in the published `exports` map
and watched by the upstream package-export audit. Removal or rename
goes through a deprecation cycle.

## The wildcard surface [#the-wildcard-surface]

<Callout type="warn" title="The bare `@pleach/core/*` wildcard is gone">
  It was replaced by the scoped `@pleach/core/internal/*`. A deep
  import that used to resolve through `@pleach/core/*` — say
  `@pleach/core/graph` or `@pleach/core/replay/types` — now throws
  `ERR_PACKAGE_PATH_NOT_EXPORTED`. Node's `exports` map is a closed
  surface: the file existing in `dist/` does not make it importable.
</Callout>

`@pleach/core` shipped a bare `./*` wildcard during the
named-barrel narrowing project, so the published surface wouldn't
lag the source tree. That hatch is closed. Every path a consumer
should reach for is now a named entry in the table above, and the
only wildcard left is `./internal/*` — deliberately scoped, so the
`internal/` segment in the specifier tells you what you're doing.

If a deep import stopped resolving, one of three things is true:

1. **It was promoted to a named barrel.** Check the table above
   first — this is the common case. `@pleach/core/graph/topology`,
   `@pleach/core/graph/seams`, and `@pleach/core/graph/planning`
   are all named; the bare `@pleach/core/graph` is not.
2. **It's reachable from the root barrel.** `StateGraph`,
   `Annotation`, `AnnotationRoot`, `CompiledGraph`, `Send`, and
   `isSend` re-export from `@pleach/core` itself.
3. **It has no published home yet.** `START`, `END`,
   `buildDefaultAgentGraph`, and `DEFAULT_TURN_FLAGS` are declared
   in the package but reachable through no `exports` entry today.
   Compose a `StateGraph` directly, or open an issue against
   [pleachhq/core](https://www.getpleach.com/docs/core) asking
   for the barrel. The named-barrel pipeline takes requests.

`graph/*` stays deliberately un-barrelled beyond the four named
entries. The internal graph topology is not a public API — don't
build one on top of it.

## Internal surfaces [#internal-surfaces]

<Callout type="warn" title="Not a public import surface">
  Paths under `@pleach/core/internal/…` are implementation details,
  not a supported public API. The `internal/` segment is the signal:
  they resolve today, but they are &#x2A;*not `stable`** — they can move or
  change shape between releases with no deprecation cycle. Don't build
  against them; use the public alternatives below.
</Callout>

| Path                                                                                                                                                                                       | What it is                                                                                                                                                                                                                                                                                                       | Public alternative                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@pleach/core/internal/strategies/streamSingleTurn/helpers` (+ its `safeStringifyArgs`, `parseToolArgs`, `forceSynthesisEchoDispatch`, `imperativeProviderAttemptCallback` direct entries) | The `streamSingleTurn` body's own helper barrel — typed contracts (`TurnAccumulator`, `OrchestratorMessage`, `ProviderFallbackConfig`, `ToolDefinition`) plus runtime utilities the default body uses inline. See [streamSingleTurn § The helpers barrel](/docs/stream-single-turn#the-helpers-barrel-internal). | Public types via the named type subpaths — e.g. `ToolDefinition` from `@pleach/core/types/generic`. A custom body registers through the module-loader seam, not by importing these helpers. |
| `@pleach/core/internal/tools/execution/registryResolvedTools`                                                                                                                              | Resolved-tools registry surface.                                                                                                                                                                                                                                                                                 | `@pleach/core/tools/execution` re-exports the supported functions (`recordRegistryResolvedTool`, `getRegistryResolvedToolNames`, `hasRegistryResolvedTool`, `resetRegistryResolvedTools`).  |

## Dual-format builds [#dual-format-builds]

Each named subpath ships three artifacts:

```json
{
  "import":  "./dist/sessions/index.js",
  "require": "./dist/sessions/index.cjs",
  "types":   "./dist/sessions/index.d.ts"
}
```

ESM consumers resolve `.js`; CommonJS consumers resolve `.cjs`;
TypeScript reads the `.d.ts`. Bundlers respect `sideEffects: false`
on the package — tree-shaking the runtime is supported and gives
roughly a 30% bundle reduction in apps that only import a handful
of named subpaths.

## First-publish packaging contract [#first-publish-packaging-contract]

Every `@pleach/*` package adopts the same baseline at its first 1.x
publish. Dual ESM/CJS emit, types-first `exports` ordering per the
Node resolution spec, dir-style tsup entries, and DTS produced by
`tsc --build` against the public surface.

Tarballs ship without sourcemaps. Peer-dep ranges tighten at the 1.x
cut. Each package carries a `NOTICE`, a `CHANGELOG.md`, npm
provenance attestation, and a `sideEffects` declaration that matches
what its modules actually do.

Consumers benefit from knowing the shape: install or import failures
debug faster when the resolution order is predictable. Forkers and
vendored installs need to hold the line — a fork that diverges from
the contract can stop installing or importing cleanly.

For the full write-up — field-by-field `package.json` requirements,
the audit job names, and the migration recipe for pre-1.x packages —
see [Publishing contract](/docs/publishing-contract).

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

<Cards>
  <Card title="Getting started" href="/docs/getting-started" description="Install @pleach/core and wire your first SessionRuntime." />

  <Card title="@pleach/core" href="/docs/core" description="Substrate overview — what ships and how it composes." />

  <Card title="CLI" href="/docs/cli" description="The pleach binary — schema scaffolding and project bootstrap." />

  <Card title="Publishing contract" href="/docs/publishing-contract" description="First-publish packaging baseline every @pleach/* package shares." />
</Cards>
