@agentshouse/mdruntime
The headless core of MD App: local Rooms of typed Markdown Documents with query, search, observation, Room Drafts, and queued saves that synchronize with a Provider through an Adapter.
Install
npm install @agentshouse/mdruntime
Entries
| Entry | For |
|---|---|
@agentshouse/mdruntime/client | The host's client: connectMdRuntime(port) |
@agentshouse/mdruntime/host | The host that serves a Runtime: serveMdRuntime |
@agentshouse/mdruntime | Shared types |
@agentshouse/mdruntime/memory | Tests: createMemoryAdapter, an in-memory Adapter |
@agentshouse/mdruntime/tables | The host's database: the Authored store's and opened files' tables, answerRuntime |
@agentshouse/mdruntime/react | React over the client: useObserve, useSave; useExpected, a reader of an expectation store; useLane, a reader of an act lane |
Usage
App code takes the client its host hands it; in House the App bridge hands it:
import { houseBridge } from '@agentshouse/app-bridge';
const runtime = await houseBridge().runtime;
const rooms = await runtime.rooms();
const notes = await runtime.query({ types: ['note'], select: 'all', limit: 20 });
observe('storage-loss') reports null, the stable code storage-loss when
unsynchronized Room Drafts and Pending Changes were lost, or visit while the host holds
the database in memory, which ends with the visit; the readiness persistence answer is then
memory. The host supplies the user-facing wording.
In House the bridge object the page holds as window.houseBridge places the Chat, which
House serves with the page: install and bundle nothing for it. Mount it in an element it
fills, where it lays out the User's chats by the element's width, themed by CSS custom
properties on that element, or as the Chat button, House's dot that opens it in a sheet:
const chat = await window.houseBridge.chat.mount(element, { conversation });
element.style.setProperty('--chat-accent', '#2a6cf0');
chat.update({ conversation: null, agent });
const button = await window.houseBridge.chat.mountButton({});
button.open({ agent });
The rules an App's agent follows, including Local Query, search, Room Draft, Save and the
Chat, are the apps/ pages of House's Guide, which House's guide/open opens.
License
MIT