@curless/sinocare-demo 0.62.1 → 0.62.3

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/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  // src/index.ts
4
4
  import { createHash } from "crypto";
5
5
  import { readFileSync, renameSync, rmSync, writeFileSync } from "fs";
6
+ import { createRequire } from "module";
6
7
  import { homedir } from "os";
7
8
  import { join } from "path";
8
9
 
@@ -280,6 +281,7 @@ var CHECKOUT_CARD_HTML = Buffer.from(
280
281
 
281
282
  // src/index.ts
282
283
  var API_BASE = (process.env.AGENTBANK_API_URL ?? "https://mcp.curless.ai").replace(/\/$/, "");
284
+ var WALLET_BASE = (process.env.BUYER_WALLET_PUBLIC_URL ?? API_BASE).replace(/\/$/, "");
283
285
  var SINOCARE = `${API_BASE}/sinocare`;
284
286
  var acp = (merchantId) => {
285
287
  if (!TOKEN) throw new Error("AGENTBANK_AGENT_TOKEN is not set");
@@ -884,8 +886,9 @@ var INSTRUCTIONS = buildInstructions({
884
886
  "Call the buy_sinocare_product_* tools directly only when the card is unavailable or the user explicitly asked for a specific rail in a plain-text flow."
885
887
  ]
886
888
  });
889
+ var VERSION = createRequire(import.meta.url)("../package.json").version;
887
890
  var server = new Server(
888
- { name: "sinocare", version: "0.5.0" },
891
+ { name: "sinocare", version: VERSION },
889
892
  { capabilities: { tools: {}, resources: {} }, instructions: INSTRUCTIONS }
890
893
  );
891
894
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
@@ -1245,7 +1248,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
1245
1248
  ordered: false,
1246
1249
  awaitingPayment: true,
1247
1250
  message: "\u5728\u6D4F\u89C8\u5668\u91CC\u6253\u5F00\u8FD9\u4E2A\u94FE\u63A5,\u770B\u6E05\u91D1\u989D\u518D\u6279\u51C6\u3002\u8FD9\u91CC\u8FD8\u6CA1\u6709\u6263\u4EFB\u4F55\u6B3E\u3002",
1248
- payUrl: `${API_BASE}/buyer/pay?session=${encodeURIComponent(session.sessionId)}`,
1251
+ payUrl: `${WALLET_BASE}/buyer/pay?session=${encodeURIComponent(session.sessionId)}`,
1249
1252
  sessionId: session.sessionId,
1250
1253
  product: session.name,
1251
1254
  total: session.amountDisplay,