@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/http.js CHANGED
@@ -260,6 +260,7 @@ function logToolCall(tool, code, startedAt, replayedGrants) {
260
260
  }
261
261
 
262
262
  // src/remote-store.ts
263
+ import { sameTinyCloudNode } from "@tinycloud/sdk-core";
263
264
  import { createHmac, randomBytes, timingSafeEqual as timingSafeEqual2 } from "crypto";
264
265
  import { chmod, mkdir, readFile, readdir, rename, rm, writeFile } from "fs/promises";
265
266
  import { dirname, join } from "path";
@@ -352,7 +353,7 @@ var NATIVE_GRANT_IMPORT_REJECTION_CODES = /* @__PURE__ */ new Set([
352
353
  "DELEGATION_HOST_MISMATCH",
353
354
  "DELEGATION_REJECTED"
354
355
  ]);
355
- var LEGACY_DEFAULT_NODE_HOST = "https://node.tinycloud.xyz";
356
+ var PRODUCTION_NODE_HOSTS = /* @__PURE__ */ new Set(["https://node.tinycloud.xyz", "https://tee.node.tinycloud.xyz"]);
356
357
  var BOOTSTRAP_PERMISSIONS = [
357
358
  {
358
359
  service: "tinycloud.kv",
@@ -775,6 +776,7 @@ var RemoteTenantStore = class {
775
776
  did: tenant.sessionDid,
776
777
  callback: callback.toString(),
777
778
  host: this.#config.nodeHost,
779
+ requesterOrigin: this.#config.publicUrl.origin,
778
780
  jwk: Buffer.from(JSON.stringify(publicJwk(tenant.jwk))).toString("base64url"),
779
781
  permissions: Buffer.from(JSON.stringify({
780
782
  permissions: pending.permissions,
@@ -1082,10 +1084,10 @@ var RemoteTenantStore = class {
1082
1084
  authMethod: "openkey",
1083
1085
  openkeyHost: this.#config.openkeyHost
1084
1086
  });
1085
- } else if (typeof profile.host === "string" && profile.host.replace(/\/+$/, "") === LEGACY_DEFAULT_NODE_HOST && this.#config.nodeHost.replace(/\/+$/, "") !== LEGACY_DEFAULT_NODE_HOST) {
1087
+ } 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(/\/+$/, "")) {
1086
1088
  await secureWrite(profilePath, { ...profile, host: this.#config.nodeHost });
1087
1089
  process.stderr.write(
1088
- `[tinycloud-mcp-http] tenant node host migrated: from=${LEGACY_DEFAULT_NODE_HOST} to=${new URL(this.#config.nodeHost).origin}
1090
+ `[tinycloud-mcp-http] tenant node host migrated: from=${profile.host.replace(/\/+$/, "")} to=${new URL(this.#config.nodeHost).origin}
1089
1091
  `
1090
1092
  );
1091
1093
  }
@@ -1403,6 +1405,7 @@ function normalizeDid(value) {
1403
1405
  return value.split("#", 1)[0];
1404
1406
  }
1405
1407
  function sameNodeHost(left, right) {
1408
+ if (PRODUCTION_NODE_HOSTS.has(left) && sameTinyCloudNode(left, right)) return true;
1406
1409
  try {
1407
1410
  const normalize = (value) => {
1408
1411
  const url = new URL(value);
@@ -1969,7 +1972,7 @@ function outcomeCode(result) {
1969
1972
  // package.json
1970
1973
  var package_default = {
1971
1974
  name: "@tinycloud/mcp",
1972
- version: "0.10.0-beta.31",
1975
+ version: "0.10.0-beta.33",
1973
1976
  description: "TinyCloud delegated operations MCP server",
1974
1977
  keywords: [
1975
1978
  "tinycloud",
@@ -2040,9 +2043,10 @@ var package_default = {
2040
2043
  dependencies: {
2041
2044
  "@modelcontextprotocol/node": "2.0.0-beta.5",
2042
2045
  "@modelcontextprotocol/server": "2.0.0-beta.5",
2043
- "@tinycloud/node-sdk": "3.12.0-beta.23",
2046
+ "@tinycloud/node-sdk": "3.12.0-beta.24",
2047
+ "@tinycloud/sdk-core": "3.12.0-beta.24",
2044
2048
  "@tinycloud/node-sdk-wasm": "1.7.9-beta.0",
2045
- "@tinycloud/operations": "0.9.0-beta.27",
2049
+ "@tinycloud/operations": "0.9.0-beta.29",
2046
2050
  jose: "6.2.4"
2047
2051
  },
2048
2052
  devDependencies: {