hypha-rpc 0.20.12 → 0.20.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypha-rpc",
3
- "version": "0.20.12",
3
+ "version": "0.20.13",
4
4
  "description": "Hypha RPC client for connecting to Hypha server for data management and AI model serving.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/src/rpc.js CHANGED
@@ -685,12 +685,13 @@ export class RPC extends MessageEmitter {
685
685
 
686
686
  _extract_service_info(service) {
687
687
  const config = service.config || {};
688
- config.workspace = config.workspace || self._local_workspace;
688
+ config.workspace =
689
+ config.workspace || this._local_workspace || this._connection.workspace;
689
690
  const skipContext = config.require_context;
690
691
  const serviceSchema = _get_schema(service, null, skipContext);
691
692
  const serviceInfo = {
692
693
  config: config,
693
- id: `${this._client_id}:${service["id"]}`,
694
+ id: `${config.workspace}/${this._client_id}:${service["id"]}`,
694
695
  name: service.name || service["id"],
695
696
  description: service.description || "",
696
697
  type: service.type || "generic",
@@ -173,7 +173,9 @@ describe("RPC", async () => {
173
173
  server_url: SERVER_URL,
174
174
  client_id: "test-plugin-1",
175
175
  });
176
- await server.registerService(plugin_interface);
176
+ const info = await server.registerService(plugin_interface);
177
+ expect(info.id).to.contain("/");
178
+ expect(info.id).to.contain(":");
177
179
  const api = await server.rpc.get_remote_service("default");
178
180
 
179
181
  const msg = "this is an messge.";