Open Companion Protocol

Grounded AI conversations over any connected workspace — with an optional phone companion for voice, paired by QR under mandatory human approval. Four roles, Hub-brokered trust, additive-only evolution.

rendering diagram…

Surfaces and Companions never talk directly — the Hub brokers every message and re-checks authorization on every call.

Core spec

The normative wire contract (RFC-2119).

Build a Companion

Pair a phone and talk to a workspace.

Implement a Hub

Broker pairing, turns, tools, confirms.

Message reference

Every message, with field tables + schemas.

@schwaizer/ocp-protocol

OCP — Open Companion Protocol. An open standard for hosting a grounded AI conversation over any connected data, on any surface, with an optional phone companion for voice — paired by QR.

This package is the standard:

  • src/ — the authoritative message contracts (Zod): envelope, errors, sessions, context, turns, tools, confirms, pairing, .well-known discovery.
  • SPEC/ — normative prose (RFC-2119): core.md, companion.md, embed.md, provider.md.
  • vectors/ — golden conformance vectors. An implementation that rejects a "valid" vector (or accepts a "reject" one) is non-conformant; changing that boundary is a major-version protocol change.

Design pillars: four strictly-separated roles (Surface / Hub / Companion / Provider), Hub-brokered trust, delegated QR pairing with proof-of-possession tokens and mandatory human approval, additive-only evolution with ignore-unknown semantics. See docs/COMPANION_PROTOCOL_PLAN.md (rev 3.1) for the full design rationale and build plan.

Companion contracts include silent token refresh (session.refresh / session.refreshed); the Embed profile adds the host↔iframe postMessage contract (embed.ts, consumed by @schwaizer/ocp-embed).

Status: v1.0-draft (Core + Companion shipped; Embed backbone shipped). License: Apache-2.0 (code) / CC-BY (spec).