hypha-rpc 0.21.16 → 0.21.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/html/index.html +1 -1
- package/dist/hypha-rpc-websocket.js +24 -16
- package/dist/hypha-rpc-websocket.js.map +1 -1
- package/dist/hypha-rpc-websocket.min.js +1 -1
- package/dist/hypha-rpc-websocket.min.js.map +1 -1
- package/dist/hypha-rpc-websocket.min.mjs +1 -1
- package/dist/hypha-rpc-websocket.min.mjs.map +1 -1
- package/dist/hypha-rpc-websocket.mjs +24 -16
- package/dist/hypha-rpc-websocket.mjs.map +1 -1
- package/package.json +1 -1
- package/src/http-client.js +22 -16
- package/src/webrtc-client.js +1 -0
- package/src/websocket-client.js +1 -0
package/coverage/html/index.html
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
87
87
|
Code coverage generated by
|
|
88
88
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
89
|
-
at 2026-02-
|
|
89
|
+
at 2026-02-24T15:55:24.179Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|
|
@@ -2747,12 +2747,13 @@ class HTTPStreamingRPCConnection {
|
|
|
2747
2747
|
async open() {
|
|
2748
2748
|
console.info(`Opening HTTP streaming connection to ${this._server_url}`);
|
|
2749
2749
|
|
|
2750
|
-
// Build stream URL
|
|
2751
|
-
//
|
|
2752
|
-
//
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2750
|
+
// Build stream URL using the workspace-less /rpc endpoint.
|
|
2751
|
+
// Workspace is passed as a query parameter when available.
|
|
2752
|
+
// On first connection, workspace may be null (server assigns one via connection_info).
|
|
2753
|
+
let stream_url = `${this._server_url}/rpc?client_id=${this._client_id}`;
|
|
2754
|
+
if (this._workspace) {
|
|
2755
|
+
stream_url += `&workspace=${encodeURIComponent(this._workspace)}`;
|
|
2756
|
+
}
|
|
2756
2757
|
|
|
2757
2758
|
// Start streaming in background
|
|
2758
2759
|
this._startStreamLoop(stream_url);
|
|
@@ -2838,9 +2839,10 @@ class HTTPStreamingRPCConnection {
|
|
|
2838
2839
|
if (this._closed) return;
|
|
2839
2840
|
try {
|
|
2840
2841
|
// After open(), _workspace is always set from connection_info
|
|
2841
|
-
|
|
2842
|
-
if (
|
|
2843
|
-
|
|
2842
|
+
let url = `${this._server_url}/rpc?client_id=${this._client_id}`;
|
|
2843
|
+
if (this._workspace) {
|
|
2844
|
+
url += `&workspace=${encodeURIComponent(this._workspace)}`;
|
|
2845
|
+
}
|
|
2844
2846
|
const body = (0,_msgpack_msgpack__WEBPACK_IMPORTED_MODULE_3__.encode)({ type: "refresh_token" });
|
|
2845
2847
|
const response = await fetch(url, {
|
|
2846
2848
|
method: "POST",
|
|
@@ -2874,9 +2876,12 @@ class HTTPStreamingRPCConnection {
|
|
|
2874
2876
|
|
|
2875
2877
|
while (!this._closed && retry < MAX_RETRY) {
|
|
2876
2878
|
try {
|
|
2877
|
-
// Update URL with current workspace (set from connection_info after initial open)
|
|
2878
|
-
|
|
2879
|
-
let stream_url = `${this._server_url}
|
|
2879
|
+
// Update URL with current workspace (set from connection_info after initial open).
|
|
2880
|
+
// Workspace is passed as a query parameter when available.
|
|
2881
|
+
let stream_url = `${this._server_url}/rpc?client_id=${this._client_id}`;
|
|
2882
|
+
if (this._workspace) {
|
|
2883
|
+
stream_url += `&workspace=${encodeURIComponent(this._workspace)}`;
|
|
2884
|
+
}
|
|
2880
2885
|
if (this._reconnection_token) {
|
|
2881
2886
|
stream_url += `&reconnection_token=${encodeURIComponent(this._reconnection_token)}`;
|
|
2882
2887
|
}
|
|
@@ -3111,12 +3116,12 @@ class HTTPStreamingRPCConnection {
|
|
|
3111
3116
|
throw new Error("Connection is closed");
|
|
3112
3117
|
}
|
|
3113
3118
|
|
|
3114
|
-
// Build POST URL
|
|
3115
|
-
|
|
3116
|
-
if (!
|
|
3119
|
+
// Build POST URL using the workspace-less /rpc endpoint.
|
|
3120
|
+
// Workspace is passed as a query parameter when available.
|
|
3121
|
+
if (!this._workspace) {
|
|
3117
3122
|
throw new Error("Workspace not set - connection not established");
|
|
3118
3123
|
}
|
|
3119
|
-
let post_url = `${this._server_url}
|
|
3124
|
+
let post_url = `${this._server_url}/rpc?client_id=${this._client_id}&workspace=${encodeURIComponent(this._workspace)}`;
|
|
3120
3125
|
|
|
3121
3126
|
// Ensure data is Uint8Array
|
|
3122
3127
|
const body = data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
@@ -3255,6 +3260,7 @@ async function _connectToServerHTTP(config) {
|
|
|
3255
3260
|
client_id: clientId,
|
|
3256
3261
|
workspace,
|
|
3257
3262
|
default_context: { connection_type: "http_streaming" },
|
|
3263
|
+
silent: config.silent || false,
|
|
3258
3264
|
name: config.name,
|
|
3259
3265
|
method_timeout: config.method_timeout,
|
|
3260
3266
|
app_id: config.app_id,
|
|
@@ -7615,6 +7621,7 @@ async function _setupRPC(config) {
|
|
|
7615
7621
|
workspace: config.workspace,
|
|
7616
7622
|
app_id: config.app_id,
|
|
7617
7623
|
long_message_chunk_size: config.long_message_chunk_size,
|
|
7624
|
+
silent: config.silent || false,
|
|
7618
7625
|
});
|
|
7619
7626
|
return rpc;
|
|
7620
7627
|
}
|
|
@@ -10695,6 +10702,7 @@ async function connectToServer(config) {
|
|
|
10695
10702
|
client_id: clientId,
|
|
10696
10703
|
workspace,
|
|
10697
10704
|
default_context: { connection_type: "websocket" },
|
|
10705
|
+
silent: config.silent || false,
|
|
10698
10706
|
name: config.name,
|
|
10699
10707
|
method_timeout: config.method_timeout,
|
|
10700
10708
|
app_id: config.app_id,
|