Implement hrpc with streaming and wire into setup

- Add spec/hyperschema and spec/hrpc codegen (scripts/build-hrpc.js)
  with unary, request/response-stream, duplex, and send-only commands
- Run build:hrpc and build:protomux from install.sh so setup is one-step
- Native host: add attachHrpc (Protomux channel + generated HRPC),
  handlers for ping, streamSum, fetchStream, duplex, notify
- Load HRPC lazily so missing spec does not crash host; use bare-stream
  for Duplex under Bare; add bare-stream, compact-encoding deps
This commit is contained in:
Raven Scott
2026-02-12 04:51:03 -05:00
parent a7f86f3af5
commit bb47954b9f
14 changed files with 1531 additions and 11 deletions
+152
View File
@@ -0,0 +1,152 @@
{
"version": 1,
"schema": [
{
"name": "ping-request",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "value",
"type": "string",
"version": 1
}
]
},
{
"name": "ping-response",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "pong",
"type": "string",
"version": 1
}
]
},
{
"name": "stream-request-chunk",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "n",
"type": "uint",
"version": 1
},
{
"name": "label",
"type": "string",
"version": 1
}
]
},
{
"name": "stream-sum-response",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "sum",
"type": "uint",
"version": 1
},
{
"name": "count",
"type": "uint",
"version": 1
}
]
},
{
"name": "fetch-request",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "count",
"type": "uint",
"version": 1
}
]
},
{
"name": "fetch-chunk",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "i",
"type": "uint",
"version": 1
},
{
"name": "data",
"type": "string",
"version": 1
}
]
},
{
"name": "duplex-in",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "x",
"type": "uint",
"version": 1
},
{
"name": "y",
"type": "string",
"version": 1
}
]
},
{
"name": "duplex-out",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "result",
"type": "string",
"version": 1
},
{
"name": "n",
"type": "uint",
"version": 1
}
]
},
{
"name": "notify-request",
"namespace": "bridgeswarm",
"compact": false,
"flagsPosition": 0,
"fields": [
{
"name": "event",
"type": "string",
"version": 1
},
{
"name": "payload",
"type": "uint",
"version": 1
}
]
}
]
}