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
+34
View File
@@ -11,11 +11,15 @@
"autobase": "^7.25.0",
"b4a": "^1.6.7",
"bare-process": "^4.1.2",
"bare-stream": "^2.6.5",
"compact-encoding": "^2.18.0",
"corestore": "^7.0.0",
"hrpc": "^4.3.0",
"hyperbee": "^2.27.0",
"hypercore": "^11.0.0",
"hyperdb": "^5.0.0",
"hyperdrive": "^13.0.0",
"hyperschema": "^1.19.0",
"hyperswarm": "^4.10.1",
"protomux": "^3.10.0"
},
@@ -213,6 +217,25 @@
"bare-tty": "^5.0.0"
}
},
"node_modules/bare-rpc": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/bare-rpc/-/bare-rpc-1.1.0.tgz",
"integrity": "sha512-8cDLnat9IROS5cdVmsaTTvtws4drayZksTYYMd6VXqBWOEowOeztZlekO9DepxMf+q4+FBQStqTyso2BXqvYMg==",
"dependencies": {
"b4a": "^1.6.6",
"bare-stream": "^2.1.3",
"compact-encoding": "^2.15.0",
"safety-catch": "^1.0.2"
},
"peerDependencies": {
"bare-buffer": "*"
},
"peerDependenciesMeta": {
"bare-buffer": {
"optional": true
}
}
},
"node_modules/bare-semver": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bare-semver/-/bare-semver-1.0.2.tgz",
@@ -467,6 +490,17 @@
"resolved": "https://registry.npmjs.org/generate-string/-/generate-string-1.0.1.tgz",
"integrity": "sha512-IfTY0dKZM43ACyGvXkbG7De7WY7MxTS5VO6Juhe8oJKpCmrYYXoqp/cJMskkpi0k9H8wuXq0H+eI898/BCqvXg=="
},
"node_modules/hrpc": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/hrpc/-/hrpc-4.3.0.tgz",
"integrity": "sha512-CdZSI8jx7x7Kzrb46Vx/IixFT/dZ4rYPRuT1Z7W6ZuJUSJxlcRFTirjUPmTt9HaFhUM3dxDzvTkqp6LY01jViA==",
"dependencies": {
"b4a": "^1.6.7",
"bare-rpc": "^1.1.0",
"hyperschema": "^1.10.4",
"streamx": "^2.22.0"
}
},
"node_modules/hyperbee": {
"version": "2.27.3",
"resolved": "https://registry.npmjs.org/hyperbee/-/hyperbee-2.27.3.tgz",