@healthcloudai/hc-sdk 0.9.1 → 0.10.0
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/README.md +178 -13
- package/dist/index.cjs +81 -18
- package/dist/index.d.cts +73 -16
- package/dist/index.d.ts +73 -16
- package/dist/index.js +80 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -98,9 +98,10 @@ var HttpClient = class {
|
|
|
98
98
|
return headers;
|
|
99
99
|
}
|
|
100
100
|
buildUrl(service, path, options) {
|
|
101
|
-
var _a;
|
|
101
|
+
var _a, _b, _c;
|
|
102
102
|
const normalizedPath = this.resolvePath(path, (_a = options.pathParams) != null ? _a : {});
|
|
103
|
-
const
|
|
103
|
+
const base = (_c = (_b = this.state.baseUrlOverrides) == null ? void 0 : _b[service]) != null ? _c : resolveBaseUrl(this.state.environment, service);
|
|
104
|
+
const url = new URL(`${base}${normalizedPath}`);
|
|
104
105
|
if (options.query) {
|
|
105
106
|
for (const [key, value] of Object.entries(options.query)) {
|
|
106
107
|
this.appendQuery(url, key, value);
|
|
@@ -335,6 +336,12 @@ var AuthClient = class extends BaseServiceClient {
|
|
|
335
336
|
auth: false
|
|
336
337
|
});
|
|
337
338
|
}
|
|
339
|
+
async resendEmailVerification(request) {
|
|
340
|
+
return this.send("POST", "/auth/resend-verification-code", {
|
|
341
|
+
body: withTenantId(request, this.getTenantId()),
|
|
342
|
+
auth: false
|
|
343
|
+
});
|
|
344
|
+
}
|
|
338
345
|
};
|
|
339
346
|
|
|
340
347
|
// src/clients/DiagnosticsClient.ts
|
|
@@ -514,6 +521,7 @@ var FieldAgentClient = class extends BaseServiceClient {
|
|
|
514
521
|
};
|
|
515
522
|
|
|
516
523
|
// src/clients/MCPClient.ts
|
|
524
|
+
var nextRequestId = 1;
|
|
517
525
|
var MCPClient = class extends BaseServiceClient {
|
|
518
526
|
constructor(http) {
|
|
519
527
|
super(http, "mcp");
|
|
@@ -521,28 +529,75 @@ var MCPClient = class extends BaseServiceClient {
|
|
|
521
529
|
connect() {
|
|
522
530
|
return this.connectService();
|
|
523
531
|
}
|
|
524
|
-
|
|
532
|
+
/**
|
|
533
|
+
* Low-level JSON-RPC 2.0 transport: send any request to one audience.
|
|
534
|
+
* Named `rpc` (not `request`) because `BaseServiceClient.request` is
|
|
535
|
+
* already the generic per-path REST escape hatch with an incompatible
|
|
536
|
+
* signature; this also matches the Python SDK's `MCPClient.rpc(...)`.
|
|
537
|
+
* Prefer `initialize`/`listTools`/`callTool` for the three standard MCP
|
|
538
|
+
* methods — this exists so a newly deployed tool or method can be reached
|
|
539
|
+
* before a generated convenience method catches up.
|
|
540
|
+
*/
|
|
541
|
+
rpc(audience, request) {
|
|
525
542
|
return this.send("POST", `/${audience}`, { body: request });
|
|
526
543
|
}
|
|
527
|
-
/**
|
|
528
|
-
|
|
529
|
-
return this.
|
|
544
|
+
/** `initialize` — negotiates the MCP protocol version and capabilities. */
|
|
545
|
+
initialize(audience) {
|
|
546
|
+
return this.rpc(audience, {
|
|
547
|
+
jsonrpc: "2.0",
|
|
548
|
+
id: nextRequestId++,
|
|
549
|
+
method: "initialize",
|
|
550
|
+
params: {}
|
|
551
|
+
});
|
|
530
552
|
}
|
|
531
|
-
/**
|
|
532
|
-
|
|
533
|
-
|
|
553
|
+
/**
|
|
554
|
+
* `notifications/initialized` — the gateway replies with HTTP 204 (no
|
|
555
|
+
* body) per the JSON-RPC notification convention; `HttpClient` already
|
|
556
|
+
* surfaces a 204 as `undefined`, so this resolves with `void`.
|
|
557
|
+
*/
|
|
558
|
+
async notifyInitialized(audience) {
|
|
559
|
+
await this.send("POST", `/${audience}`, {
|
|
560
|
+
body: { jsonrpc: "2.0", method: "notifications/initialized", params: {} }
|
|
561
|
+
});
|
|
534
562
|
}
|
|
535
|
-
/**
|
|
536
|
-
|
|
537
|
-
return this.
|
|
563
|
+
/** `tools/list` — every tool the gateway serves for this audience. */
|
|
564
|
+
listTools(audience) {
|
|
565
|
+
return this.rpc(audience, {
|
|
566
|
+
jsonrpc: "2.0",
|
|
567
|
+
id: nextRequestId++,
|
|
568
|
+
method: "tools/list",
|
|
569
|
+
params: {}
|
|
570
|
+
});
|
|
538
571
|
}
|
|
539
|
-
/**
|
|
540
|
-
|
|
541
|
-
return this.
|
|
572
|
+
/** `tools/call` — invoke one tool by its exact MCP tool name. */
|
|
573
|
+
callTool(audience, name, args = {}, id = nextRequestId++) {
|
|
574
|
+
return this.rpc(audience, {
|
|
575
|
+
jsonrpc: "2.0",
|
|
576
|
+
id,
|
|
577
|
+
method: "tools/call",
|
|
578
|
+
params: { name, arguments: args }
|
|
579
|
+
});
|
|
542
580
|
}
|
|
543
|
-
/**
|
|
581
|
+
/**
|
|
582
|
+
* @deprecated Prefer `rpc("patient", ...)` or `callTool("patient", ...)`.
|
|
583
|
+
* Kept for backward compatibility; delegates to the generic transport.
|
|
584
|
+
*/
|
|
585
|
+
patient(request) {
|
|
586
|
+
return this.rpc("patient", request);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* @deprecated Prefer `rpc("fieldagent", ...)` or `callTool("fieldagent", ...)`.
|
|
590
|
+
* Kept for backward compatibility; delegates to the generic transport.
|
|
591
|
+
*/
|
|
592
|
+
fieldAgent(request) {
|
|
593
|
+
return this.rpc("fieldagent", request);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* @deprecated Prefer `rpc("person", ...)` or `callTool("person", ...)`.
|
|
597
|
+
* Kept for backward compatibility; delegates to the generic transport.
|
|
598
|
+
*/
|
|
544
599
|
person(request) {
|
|
545
|
-
return this.
|
|
600
|
+
return this.rpc("person", request);
|
|
546
601
|
}
|
|
547
602
|
};
|
|
548
603
|
|
|
@@ -4219,7 +4274,8 @@ var HCSDK = class {
|
|
|
4219
4274
|
this.state = {
|
|
4220
4275
|
environment: config.environment,
|
|
4221
4276
|
tenantId: config.tenantId,
|
|
4222
|
-
accessToken: config.accessToken
|
|
4277
|
+
accessToken: config.accessToken,
|
|
4278
|
+
baseUrlOverrides: config.baseUrlOverrides
|
|
4223
4279
|
};
|
|
4224
4280
|
this.http = new HttpClient(this.state);
|
|
4225
4281
|
this.auth = new AuthClient(
|
|
@@ -4254,6 +4310,11 @@ var HCSDK = class {
|
|
|
4254
4310
|
}
|
|
4255
4311
|
};
|
|
4256
4312
|
|
|
4313
|
+
// src/models/generated/mcp.ts
|
|
4314
|
+
function isJsonRpcError(response) {
|
|
4315
|
+
return "error" in response && response.error !== void 0;
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4257
4318
|
// src/models/generated/operations.ts
|
|
4258
4319
|
var HCSDK_OPERATION_SUMMARY = [
|
|
4259
4320
|
{ service: "patient", method: "GET", path: "/connect", sdkMethod: "patient.connect", summary: "Lambda warm-up / connectivity check" },
|
|
@@ -4381,6 +4442,7 @@ export {
|
|
|
4381
4442
|
ZocdocClient,
|
|
4382
4443
|
ZusClient,
|
|
4383
4444
|
assertEnvironment,
|
|
4445
|
+
isJsonRpcError,
|
|
4384
4446
|
isServiceName,
|
|
4385
4447
|
resolveBaseUrl,
|
|
4386
4448
|
withTenantId
|
package/package.json
CHANGED