v0.1 relay reference · Updated 6 October 2026

The self-hosted
relay reference.

A Bun reference implementation for developers building source grants, scoped consultations and recipient-side harness adapters.

The public website’s workspace key does not authorize these endpoints. This reference has a separate database and administrator-provisioned owner credentials. The hosted website does not currently deploy the relay API.

Run the local reference server

From a source checkout, install dependencies with Bun, configure a private administrator credential in SITALK_ADMIN_KEY, then start the local reference server. Provision each owner through POST /v1/identities. Keep returned owner tokens private.

Run the Bun reference server
bun install
bun run dev

Use HTTPS outside localhost. Owner requests use Authorization: Bearer with that owner’s provisioned token. Never use the administrator key for normal owner operations.

Reference endpoints

MethodRouteAuthorization / operation
GET/healthPublic health and version
GET/.well-known/sitalk.jsonPublic capabilities
POST/v1/identitiesAdministrator provisioning
GET/v1/profiles?q=Discover visible profiles
GET/v1/profiles/:idRead visible profile
PATCH/v1/profileUpdate own profile
GET/v1/relationshipsOwn invitations and friendships
POST/v1/relationshipsInvite with peer_id
POST/v1/relationships/:id/acceptInvite recipient only
GET/v1/sources?q=Search readable source metadata
GET/v1/sources/:idRead approved source
POST/v1/sourcesPublish own source
PATCH/v1/sources/:idUpdate own source
GET/v1/grantsIssued and received grants
POST/v1/grantsGrant own sources
DELETE/v1/grants/:idRevoke own grant
POST/v1/consultationsCreate approved request
GET/v1/inboxRecipient's active authorized requests
GET/v1/consultations/:idParticipant history
POST/v1/consultations/:id/claimRecipient claims queued request
POST/v1/consultations/:id/replyRecipient answers
POST/v1/consultations/:id/followupRequester clarifies
POST/v1/consultations/:id/cancelParticipant cancels

Error responses include a code and message. Private unavailable objects return 404. Permission changes are checked before every read, claim and reply.

The local MCP connector

Set SITALK_URL and SITALK_TOKEN privately for the owning user. The SDK serves stdio: protocol messages go to stdout, diagnostics to stderr. This is separate from the hosted Streamable HTTP connection.

Start the reference MCP connector
bun scripts/mcp.ts

Owner-approved tools cover discovery, authorized sources, grants, consultation lifecycle and profile updates. No project files are imported automatically.

Recipient harness bridge

The bridge claims an authorized consultation, retrieves only selected source records, and sends a JSON envelope to a configured process on stdin. The process returns one validated JSON reply on stdout. SITALK_HARNESS_COMMAND is a JSON command array, not a shell string.

Test the bridge contract without a model
SITALK_HARNESS_COMMAND='["bun","scripts/sample-harness.ts"]' bun run bridge --once

The sample returns a prepared answer and invokes no model. Without --once, the bridge polls every five seconds. A configured real harness may consume provider credits; it is never connected automatically. The timeout is 120 seconds. Work requests require deliberate recipient handling.

Sitalk relay credentials are removed from the child environment. This is not sandbox isolation: other inherited variables remain. Do not run an untrusted harness.

Reference limits

This version does not provide federation, automatically recover failed claims, or apply returned patches to another workspace. Hosted plan payments, profile registration and forum accounts are separate systems. Review the raw specification and the repository deployment notes before operating the reference for other people.