@tinycloud/mcp 0.10.0-beta.31 → 0.10.0-beta.33

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.cjs CHANGED
@@ -555,7 +555,7 @@ function outcomeCode(result) {
555
555
  // package.json
556
556
  var package_default = {
557
557
  name: "@tinycloud/mcp",
558
- version: "0.10.0-beta.31",
558
+ version: "0.10.0-beta.33",
559
559
  description: "TinyCloud delegated operations MCP server",
560
560
  keywords: [
561
561
  "tinycloud",
@@ -626,9 +626,10 @@ var package_default = {
626
626
  dependencies: {
627
627
  "@modelcontextprotocol/node": "2.0.0-beta.5",
628
628
  "@modelcontextprotocol/server": "2.0.0-beta.5",
629
- "@tinycloud/node-sdk": "3.12.0-beta.23",
629
+ "@tinycloud/node-sdk": "3.12.0-beta.24",
630
+ "@tinycloud/sdk-core": "3.12.0-beta.24",
630
631
  "@tinycloud/node-sdk-wasm": "1.7.9-beta.0",
631
- "@tinycloud/operations": "0.9.0-beta.27",
632
+ "@tinycloud/operations": "0.9.0-beta.29",
632
633
  jose: "6.2.4"
633
634
  },
634
635
  devDependencies: {
@@ -1006,6 +1007,7 @@ function claims(token) {
1006
1007
  }
1007
1008
 
1008
1009
  // src/remote-store.ts
1010
+ var import_sdk_core = require("@tinycloud/sdk-core");
1009
1011
  var import_node_crypto3 = require("crypto");
1010
1012
  var import_promises = require("fs/promises");
1011
1013
  var import_node_path3 = require("path");
@@ -1085,7 +1087,7 @@ var NATIVE_GRANT_IMPORT_REJECTION_CODES = /* @__PURE__ */ new Set([
1085
1087
  "DELEGATION_HOST_MISMATCH",
1086
1088
  "DELEGATION_REJECTED"
1087
1089
  ]);
1088
- var LEGACY_DEFAULT_NODE_HOST = "https://node.tinycloud.xyz";
1090
+ var PRODUCTION_NODE_HOSTS = /* @__PURE__ */ new Set(["https://node.tinycloud.xyz", "https://tee.node.tinycloud.xyz"]);
1089
1091
  var BOOTSTRAP_PERMISSIONS = [
1090
1092
  {
1091
1093
  service: "tinycloud.kv",
@@ -1508,6 +1510,7 @@ var RemoteTenantStore = class {
1508
1510
  did: tenant.sessionDid,
1509
1511
  callback: callback.toString(),
1510
1512
  host: this.#config.nodeHost,
1513
+ requesterOrigin: this.#config.publicUrl.origin,
1511
1514
  jwk: Buffer.from(JSON.stringify((0, import_node_sdk2.publicJwk)(tenant.jwk))).toString("base64url"),
1512
1515
  permissions: Buffer.from(JSON.stringify({
1513
1516
  permissions: pending.permissions,
@@ -1815,10 +1818,10 @@ var RemoteTenantStore = class {
1815
1818
  authMethod: "openkey",
1816
1819
  openkeyHost: this.#config.openkeyHost
1817
1820
  });
1818
- } else if (typeof profile.host === "string" && profile.host.replace(/\/+$/, "") === LEGACY_DEFAULT_NODE_HOST && this.#config.nodeHost.replace(/\/+$/, "") !== LEGACY_DEFAULT_NODE_HOST) {
1821
+ } else if (typeof profile.host === "string" && PRODUCTION_NODE_HOSTS.has(profile.host.replace(/\/+$/, "")) && PRODUCTION_NODE_HOSTS.has(this.#config.nodeHost.replace(/\/+$/, "")) && profile.host.replace(/\/+$/, "") !== this.#config.nodeHost.replace(/\/+$/, "")) {
1819
1822
  await secureWrite(profilePath, { ...profile, host: this.#config.nodeHost });
1820
1823
  process.stderr.write(
1821
- `[tinycloud-mcp-http] tenant node host migrated: from=${LEGACY_DEFAULT_NODE_HOST} to=${new URL(this.#config.nodeHost).origin}
1824
+ `[tinycloud-mcp-http] tenant node host migrated: from=${profile.host.replace(/\/+$/, "")} to=${new URL(this.#config.nodeHost).origin}
1822
1825
  `
1823
1826
  );
1824
1827
  }
@@ -2136,6 +2139,7 @@ function normalizeDid(value) {
2136
2139
  return value.split("#", 1)[0];
2137
2140
  }
2138
2141
  function sameNodeHost(left, right) {
2142
+ if (PRODUCTION_NODE_HOSTS.has(left) && (0, import_sdk_core.sameTinyCloudNode)(left, right)) return true;
2139
2143
  try {
2140
2144
  const normalize = (value) => {
2141
2145
  const url = new URL(value);