@marprotocol/marp
v0.9.0
Published
MARP 0.9 Minimal Assistant Room Protocol SDK
Maintainers
Readme
@marprotocol/marp — Minimal Assistant Room Protocol
@marprotocol/marp is the synchronous, runtime-neutral TypeScript SDK for MARP 0.9, the
Minimal Assistant Room Protocol. It is unrelated to Marp Markdown and the
Marp Markdown-presentation ecosystem.
It supports MARP Core, Direct JSON, Function Calling, and Pipelined
Presentation with the first, all, and nonblocking multi-reply profiles.
It has no runtime dependencies and uses named ESM exports only.
npm install @marprotocol/marpThe canonical protocol specification is at https://github.com/marprotocol/marp/blob/main/PROTOCOL.md.
Conforms to MARP 0.9 Core, Direct JSON Profile, Function Calling Profile, and
Pipelined Presentation Profile. Multi-reply profile: first by default;
select all or nonblocking when creating a room.
import { RoomState } from "@marprotocol/marp";
const room = new RoomState({ profile: "first" });
room.join("u1");
const turn = room.acceptDirect({
messages: [{ to: ["u1"], text: "Hello." }],
reply_from: ["u1"],
});
room.presentNext();
room.completePresentation();
room.captureMessage("u1", "Hi", turn.turn);Function-calling and strict direct-output requests are generated without network access:
import { openAIRequest } from "@marprotocol/marp";
const request = openAIRequest([], "direct");
// request.response_format is strict MARP JSON Schema output.import { RoomState } from "@marprotocol/marp";
const room = new RoomState({ profile: "all" });
room.join("u1");
room.join("u2");
room.acceptCalls("provider-conversation", [
{
id: "call_1",
name: "create_room_turn",
arguments: { messages: [{ to: ["*"], text: "Reply." }], reply_from: ["*"] },
},
]);All IDs, including reply_to and generated turns, are positive safe integers
(1..Number.MAX_SAFE_INTEGER).
Private delivery controls client routing only; the room server and model provider can access delivery content. Provider support is adapter-specific: some OpenAI-compatible providers cannot reliably emit multiple strict function calls, in which case use Direct JSON or one call per response.
Version 0.9.0 is published only from the repository's gated GitHub Actions release workflow.
