Subpath exports
Every named import path under @pleach/core, what ships from it, and whether it's load-bearing.
@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 and is watched
by audit:package-export-validation upstream, and mirrored on this
site by audit:docs-vs-contract's export-map check, which fails any
specifier below that would throw ERR_PACKAGE_PATH_NOT_EXPORTED.
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.
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), useChat (Pleach-native React hook), <ChatBox /> (unstyled, accessible), defaultPlugin, createBenchmarkPlugin, providerDetection (detectProvider, detectAvailableProviders, DEFAULT_PROVIDER_ENV_VARS, DEFAULT_PROVIDER_PRIORITY). What npx pleach init scaffolds against. See The quickstart subpath. | stable |
Type subpaths
Narrowed deep-path type entries landed via the pa3prep cluster 15 sweep — type-only deep paths were promoted from wildcard reach to 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
| 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. MemoryStore is the ship-a-default binding when config.store is unset. | 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 |
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. | 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
| 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. | stable |
@pleach/core/crypto | Crypto-shred (GDPR Article 17) primitives — createPayloadCipher (AES-256-GCM over named audit-payload fields), SubjectKeyRegistry (per-subject DEK lifecycle, fail-closed after shred), createAesGcmKekProvider. Phase 1 only: cipher + DEK lifecycle, no write path, read path, or erasure orchestration. Verify wrapped_dek and iv are nullable before minting the first DEK — on a NOT NULL schema shred() raises SQLSTATE 23502 while getOrCreateDek still succeeds, which mints ciphertext that can never be erased. | experimental |
@pleach/core/scrubbers | C8 redaction surface — SCRUBBABLE_FIELDS allowlist + scrubber registry | stable |
Prompts + prompt-builder
| Import | Ships | Stability |
|---|---|---|
@pleach/core/prompts | C12 prompt-contribution contract — PromptContributionRegistry, PromptContribution, 41 Phase H universal templates | stable |
@pleach/core/prompts/examples | Reference prompt contributors | stable |
@pleach/core/prompt-builder | Phase F 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
| Import | Ships | Stability |
|---|---|---|
@pleach/core/hooks | Pre/post-model hooks — PreModelHook, PostModelHook, ModelProfile + four shipped hooks (historyTrimmerHook, lazyModelDefaultsHook, toolCallValidatorHook, repetitionDetectorHook). See Model hooks. | stable |
@pleach/core/middleware | Orchestrator middleware — OrchestratorMiddleware, MiddlewareStack, ResultEvictionMiddleware, SummarizationMiddleware, the AI-SDK-compatible LanguageModelMiddleware, CHARS_PER_TOKEN. See Orchestrator 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. | 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
| Import | Ships | Stability |
|---|---|---|
@pleach/core/safety | SafetyPolicyRegistry, composeSafetyContent, contribution registry | stable |
@pleach/core/safety/examples | Reference safety contributors | stable |
Access control + export
| Import | Ships | Stability |
|---|---|---|
@pleach/core/rbac | createRbacApprovalFlow — adapts a host-supplied RbacRuntime (from @pleach/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
| 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. | stable |
@pleach/core/instrumentation | UX-parity probes + observer-vs-legacy divergence telemetry | stable, internal-leaning |
Strategies + streaming
| Import | Ships | Stability |
|---|---|---|
@pleach/core/strategies | Strategy barrel — fabrication detector + named detectors + guard types | stable |
@pleach/core/strategies/schemaCondensation | condenseSchemas + the budget-decision types (SchemaCondensationBudgetDecisions, SchemaCondensationDecline, SchemaCondensationDeclineGate, SchemaCondensationDeclinePass, CondensableTool, SchemaCondensationConfig). The decisions also land durably on tool_offer.snapshot.condensation_budget — see Audit ledger. | 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
| 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. | stable |
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/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 minting a literal lint:callclass-literals would reject. See Call classes. | 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. | 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
| 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. | stable |
@pleach/core/query | Read-side query helpers | stable |
@pleach/core/skills | Skill substrate — loader + frontmatter parsing. @pleach/core/skills/loader (SkillLoader, invalidateSkillLoaderMemo, SKILL_LOADER_MEMO_TTL_MS) and @pleach/core/skills/types (Skill, SkillFrontmatter) are the narrower named entries. See 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. | experimental |
@pleach/core/testing | Headless turn driver — runScriptedTurn, collectTurn, createScriptedAdapter, createScriptedClient, runProviderTurn, benchmarkProviders, captureProbes. See Testing. | stable |
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. | 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
| 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
| 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 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.
@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:
- 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/planningare all named; the bare@pleach/core/graphis not. - It's reachable from the root barrel.
StateGraph,Annotation,AnnotationRoot,CompiledGraph,Send, andisSendre-export from@pleach/coreitself. - It has no published home yet.
START,END,buildDefaultAgentGraph, andDEFAULT_TURN_FLAGSare declared in the package but reachable through noexportsentry today. Compose aStateGraphdirectly, or open an issue against pleachhq/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
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 not stable — they can move or
change shape between releases with no deprecation cycle. Don't build
against them; use the public alternatives below.
| 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. | 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
Each named subpath ships three artifacts:
{
"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
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 — diverging from the contract breaks the audit gates upstream that enforce it.
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.
Where to go next
Environment variables
Single-page reference for every environment variable @pleach/core reads — runtime flags, storage adapters, provider credentials, and observability.
Audit gates
The CI-time invariant checks that protect the `@pleach/*` substrate — package shape, plugin contracts, tool coverage, event-log integrity, multi-tenant scoping, and graph lattice.