Skip to content

Provider Protocol

The ProviderStream is a bidirectional streaming RPC that connects a Provider (Edge Clip or Runtime) to a Hub. It handles Clip registration, invocation forwarding, and health monitoring.

Provider Hub
│ │
│──── ProviderStream (bidi) ────────►│
│ │
│◄─── ProviderHello ─────────────────│ Connection accepted
│ │
│──── RegisterClips ────────────────►│ Register available Clips
│ │
│◄─── InvokeRequest ────────────────│ Hub forwards invocations
│──── InvokeResponse ──────────────►│ Clip returns results
│ │
│◄─── Heartbeat ────────────────────│ Keep-alive (every 30s)
│──── Heartbeat ───────────────────►│
│ │
MessagePurpose
RegisterClipsRegister one or more Clips with the Hub
UnregisterClipsRemove Clips from the Hub
InvokeResponseReturn the result of an invocation
InvokeStreamChunkSend a streaming response chunk
InvokeStreamEndEnd a streaming response
HeartbeatResponse to Hub heartbeat
LogForward Clip log output
MessagePurpose
ProviderHelloConnection accepted, includes session ID
InvokeRequestForward an invocation to a Clip
HeartbeatKeep-alive ping
RuntimeInstall(Runtime only) Install a Clip package
RuntimeUninstall(Runtime only) Remove a Clip package

When a Provider connects, it registers its Clips:

{
"type": "RegisterClips",
"clips": [
{
"package": "bb-browser",
"alias": "browser",
"commands": [
{
"name": "navigate",
"description": "Navigate to a URL",
"input": { "url": { "type": "string", "required": true } }
}
]
}
]
}

The Hub assigns aliases (or uses the suggested ones if available) and adds the Clips to its routing table.

When a client invokes a Clip, the Hub:

  1. Looks up the alias in the routing table
  2. Finds the Provider that registered it
  3. Sends an InvokeRequest through the ProviderStream
  4. The Provider delivers it to the Clip
  5. The response flows back through the same stream
// Hub → Provider
{
"type": "InvokeRequest",
"requestId": "req-abc123",
"alias": "browser",
"command": "navigate",
"input": { "url": "https://example.com" }
}
// Provider → Hub
{
"type": "InvokeResponse",
"requestId": "req-abc123",
"output": { "title": "Example Domain", "url": "https://example.com" }
}

The Hub sends periodic heartbeat messages (default: every 30 seconds). The Provider must respond within the timeout window. If a Provider misses heartbeats, the Hub marks its Clips as offline and removes them from the routing table.

The ProviderStream requires a Hub Token for authentication. The token is obtained through pinix login and determines the Provider’s scope.

For local connections (same machine), a Super Token can be used for development.