2026-06-07 23:11:26 +00:00
|
|
|
# @open-matrix/core
|
feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00
|
|
|
|
|
|
|
|
Matrix runtime SDK — actors, Web Components, transports, serialization, and LISP-on-Protocol.
|
|
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-06-07 23:11:26 +00:00
|
|
|
npm install @open-matrix/core
|
feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
### Headless Actor (daemon-side)
|
|
|
|
|
|
|
|
|
|
```typescript
|
2026-06-07 23:11:26 +00:00
|
|
|
import { MatrixActor } from '@open-matrix/core';
|
feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00
|
|
|
|
|
|
|
|
class PingActor extends MatrixActor {
|
|
|
|
|
static accepts = {
|
|
|
|
|
ping: { message: 'string' },
|
|
|
|
|
};
|
|
|
|
|
static emits = {
|
|
|
|
|
pong: { echo: 'string', ts: 'number' },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onPing(payload: { message: string }) {
|
|
|
|
|
this.emit('pong', { echo: payload.message, ts: Date.now() });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Browser Web Component
|
|
|
|
|
|
|
|
|
|
```typescript
|
2026-06-07 23:11:26 +00:00
|
|
|
import { MatrixActorHtmlElement } from '@open-matrix/core';
|
feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00
|
|
|
|
|
|
|
|
class StatusPanel extends MatrixActorHtmlElement {
|
|
|
|
|
static accepts = { showStatus: { text: 'string' } };
|
|
|
|
|
static template = `<div id="status"></div>`;
|
|
|
|
|
static styles = `#status { font-family: monospace; padding: 8px; }`;
|
|
|
|
|
|
|
|
|
|
onShowStatus(payload: { text: string }) {
|
|
|
|
|
this.shadowRoot!.querySelector('#status')!.textContent = payload.text;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
customElements.define('status-panel', StatusPanel);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Programmatic Runtime
|
|
|
|
|
|
|
|
|
|
```typescript
|
2026-06-07 23:11:26 +00:00
|
|
|
import { InMemoryBroker, InMemoryTransport, MatrixRuntime } from '@open-matrix/core';
|
feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00
|
|
|
|
|
|
|
|
const broker = new InMemoryBroker();
|
2026-06-07 23:11:26 +00:00
|
|
|
const transport = new InMemoryTransport(broker, { name: 'demo' });
|
|
|
|
|
const runtime = new MatrixRuntime({ transport });
|
feat: initial Matrix SDK
Full SDK workspace: core, contracts, sdk, cli, browser-host, browser-kit,
federation, omega-core, oracle, self-healing, strategies, tools, emacs.
Clean extraction from the development monorepo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 15:54:15 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## What's Included
|
|
|
|
|
|
|
|
|
|
| Category | Key Exports |
|
|
|
|
|
|----------|------------|
|
|
|
|
|
| **Core** | `MatrixActor`, `Supervisor`, `HeadlessComponentRegistry` |
|
|
|
|
|
| **Framework** | `MatrixActorHtmlElement`, `MxContract`, `MxInterface`, `MxProxy` |
|
|
|
|
|
| **Runtime** | `MatrixRuntime`, `HeadlessHost`, `ConsoleLogger` |
|
|
|
|
|
| **Transports** | `InMemoryBroker`, `NatsTransport`, `FederationTransportAdapter` |
|
|
|
|
|
| **Messaging** | `TopicRouter`, `SubscriptionBag`, `RequestReply` |
|
|
|
|
|
| **LISP** | `Interpreter`, `EvalContext`, `parseSExpr` |
|
|
|
|
|
| **Serialization** | `serialize`, `parse`, 5-format parity |
|
|
|
|
|
| **Flow** | `FlowBuilder`, `FlowEngine`, `FlowContext` |
|
|
|
|
|
|
|
|
|
|
135 named exports total. Full type declarations included.
|
|
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
|
|
- Node.js >= 20
|
|
|
|
|
- TypeScript >= 5.0 (for type checking)
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
MIT
|