Skip to content

Core subpath exports

@open-matrix/core/package.json declares an exports map (package.json:23-324) that gates which paths consumers can import from. The map allows the root barrel and a precise list of deep subpaths. This page is the table of every subpath, what it provides, and the import idiom to use.

How to read the table

Each row gives:

  • Subpath — the string after @open-matrix/core/....
  • Headline export — the most-used named export, for orientation. Subpaths often re-export several names; consult the source file or index.ts for the full list.
  • When to use — which audiences and contexts the subpath is for.

The root barrel

SubpathImports
@open-matrix/coreThe root barrel. Re-exports everything in src/index.ts. Default import path for application code.
ts
import {
  MatrixActor, MatrixRuntime, MatrixActorHtmlElement,
  InMemoryTransport, InMemoryBroker, NatsTransport, createTransport,
  RequestReply, requestReply,
  resolveConfiguredPackageConfig, deepMergeConfig,
  ActivityFrame, isTerminalPhase,
  TopicRouter, MxEnvelope,
} from '@open-matrix/core';

If you don't have a specific reason to use a deep subpath, use the root barrel.

Core actor surface

SubpathHeadline export
core/MatrixActorMatrixActor (the actor base class)
core/IRecordStoreProviderIRecordStoreProvider, RECORD_STORE_PROVIDER_KEY
core/security/ICapabilityTokenICapabilityToken
core/security/ISecurityRealmISecurityRealm
core/security/ITopicClaimITopicClaim
core/security/SecurityRealmSecurityRealm, DEFAULT_SECURITY_POLICY
core/security/TopicClaimRegistryTopicClaimRegistry
core/security/defaultsDefault security policy values

Use the deep subpath when you only need a single class and want bundlers to tree-shake aggressively (for browser webapps that target small bundles).

Engine layer

SubpathHeadline export
engine/core/IMatrixContextIMatrixContext (interface)
engine/core/MatrixContextMatrixContext (class)
engine/messaging/TopicRouterTopicRouter (subject computation)
engine/remoting/ComponentProxyComponentProxy
engine/remoting/IIntrospectResultIIntrospectResult
engine/remoting/ITransportAdapterITransportAdapter, TransportAdapter (alias)
engine/remoting/RequestReplyRequestReply, requestReply
engine/utils/NameUtilsNameUtils, toHandlerCase

engine/* is the messaging plumbing. Use these subpaths when implementing transports or middleware. Application actors usually import everything from the root barrel.

Framework layer (browser-side)

SubpathHeadline export
framework/MatrixActorHtmlElementMatrixActorHtmlElement (the browser actor base)
framework/ActivityFrameActivityFrame, ActivityPhase, isTerminalPhase
framework/IStateStoreIStateStore, STATE_STORE_KEY
framework/PageManifestPageManifest, PageManifestEntry, buildCodeRef, createEmptyManifest, addManifestEntry, removeManifestEntry
framework/components/MxSplitMxSplit (split-pane primitive)
framework/components/MxThemeMxTheme (theme propagation)
framework/components/MxTopicTagMxTopicTag (topic display)
framework/components/indexAll shell primitives via a barrel

UI packages typically import the elements they need directly:

ts
import { MxSplit } from '@open-matrix/core/framework/components/MxSplit';

Runtime layer

SubpathHeadline export
runtime/MatrixRuntimeMatrixRuntime
runtime/ComponentFactorycreateFromSchema, ICreateResult, ICreateOptions
runtime/InstanceBootstrapContextInstanceBootstrapContext
runtime/InstanceBootstrapRefsInstanceBootstrapRefs
runtime/MountedInstanceMetadataMountedInstanceMetadata
runtime/PackageConfigResolverresolveConfiguredPackageConfig, deepMergeConfig, IPackageConfigContract, IPackageConfigProviderDeclaration

Use these when building a runner (a custom Host Service equivalent) or testing runtime-level behaviour.

Transports

SubpathHeadline export
transport/InMemoryBrokerInMemoryBroker
transport/InMemoryTransportInMemoryTransport, InMemoryTransportOptions
transport/NatsTransportNatsTransport, INatsTransportOptions, INatsLikeConnection, INatsLikeMsg, INatsLikeSubscription
transport/TransportProxyTransportProxy

Use when constructing transports yourself (tests, bespoke runners). Application code uses the transport the runtime provides.

Browser bootstrap

SubpathHeadline export
browser/AppReadySignalAppReadySignal
browser/BrowserProfileTraceBrowserProfileTrace
browser/HostedRuntimeRecoveryHostedRuntimeRecovery
browser/HostedRuntimeTargetHostedRuntimeTarget
browser/MatrixDSLHostMatrixDSLHost (the bootstrap host element)

Flow / orchestration

SubpathHeadline export
flow/FlowBuilderFlowBuilder
flow/FlowEngineFlowEngine
flow/FlowPlanIFlowPlan, cloneFlowPlan
flow/FlowTypesFlow stage type unions
flow/viewersFlow viewer barrel
flow/viewers/ViewTypeRegistryViewTypeRegistry

LISP

SubpathHeadline export
lispThe LISP-on-protocol runtime barrel
lisp/vlmThe VLM submodule

Note: LISP and membrane subpaths are exported but treated as experimental. Surface may move; APIs may change without a full deprecation cycle.

Serialization

SubpathHeadline export
serializationTop-level serialization helpers
serialization/IComponentSchemaIComponentSchema

Compatibility shims

SubpathNote
_node-compatDOM stubs for Node imports. Imported automatically by the root barrel.
core/MatrixActor.js.js alias of core/MatrixActor. Compatibility for tools that produce .js import specifiers.
runtime/MatrixRuntime.jsSame — .js alias.
runtime/InstanceBootstrapContext.jsSame.
runtime/InstanceBootstrapRefs.jsSame.
runtime/MountedInstanceMetadata.jsSame.
engine/remoting/RequestReply.jsSame.
transport/InMemoryBroker.jsSame.
transport/InMemoryTransport.jsSame.
transport/NatsTransport.jsSame.

The .js aliases exist because some downstream toolchains (notably TypeScript projects with moduleResolution: "node" plus relative .js imports) write the literal .js extension into the import specifier. The aliases keep them resolving.

Picking root barrel vs deep subpath

SituationPattern
Application actor or webappRoot barrel. import { MatrixActor, ... } from '@open-matrix/core'.
Bundler-sensitive browser libraryDeep subpath. Smaller dependency graph for tree-shaking.
Test that builds a runtime by handEither. Deep subpath is fine for transport modules; root barrel is fine for everything else.
Building a transport or runnerDeep subpath into engine/, runtime/, transport/.

See also

Source: projects/matrix-3/packages/core/package.json:23-324 (exports map, full).