@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-cli.js CHANGED
@@ -277,6 +277,7 @@ function logToolCall(tool, code, startedAt, replayedGrants) {
277
277
  }
278
278
 
279
279
  // src/remote-store.ts
280
+ import { sameTinyCloudNode } from "@tinycloud/sdk-core";
280
281
  import { createHmac, randomBytes, timingSafeEqual as timingSafeEqual2 } from "crypto";
281
282
  import { chmod, mkdir, readFile, readdir, rename, rm, writeFile } from "fs/promises";
282
283
  import { dirname, join } from "path";
@@ -369,7 +370,7 @@ var NATIVE_GRANT_IMPORT_REJECTION_CODES = /* @__PURE__ */ new Set([
369
370
  "DELEGATION_HOST_MISMATCH",
370
371
  "DELEGATION_REJECTED"
371
372
  ]);
372
- var LEGACY_DEFAULT_NODE_HOST = "https://node.tinycloud.xyz";
373
+ var PRODUCTION_NODE_HOSTS = /* @__PURE__ */ new Set(["https://node.tinycloud.xyz", "https://tee.node.tinycloud.xyz"]);
373
374
  var BOOTSTRAP_PERMISSIONS = [
374
375
  {
375
376
  service: "tinycloud.kv",
@@ -792,6 +793,7 @@ var RemoteTenantStore = class {
792
793
  did: tenant.sessionDid,
793
794
  callback: callback.toString(),
794
795
  host: this.#config.nodeHost,
796
+ requesterOrigin: this.#config.publicUrl.origin,
795
797
  jwk: Buffer.from(JSON.stringify(publicJwk(tenant.jwk))).toString("base64url"),
796
798
  permissions: Buffer.from(JSON.stringify({
797
799
  permissions: pending.permissions,
@@ -1099,10 +1101,10 @@ var RemoteTenantStore = class {
1099
1101
  authMethod: "openkey",
1100
1102
  openkeyHost: this.#config.openkeyHost
1101
1103
  });
1102
- } else if (typeof profile.host === "string" && profile.host.replace(/\/+$/, "") === LEGACY_DEFAULT_NODE_HOST && this.#config.nodeHost.replace(/\/+$/, "") !== LEGACY_DEFAULT_NODE_HOST) {
1104
+ } 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(/\/+$/, "")) {
1103
1105
  await secureWrite(profilePath, { ...profile, host: this.#config.nodeHost });
1104
1106
  process.stderr.write(
1105
- `[tinycloud-mcp-http] tenant node host migrated: from=${LEGACY_DEFAULT_NODE_HOST} to=${new URL(this.#config.nodeHost).origin}
1107
+ `[tinycloud-mcp-http] tenant node host migrated: from=${profile.host.replace(/\/+$/, "")} to=${new URL(this.#config.nodeHost).origin}
1106
1108
  `
1107
1109
  );
1108
1110
  }
@@ -1420,6 +1422,7 @@ function normalizeDid(value) {
1420
1422
  return value.split("#", 1)[0];
1421
1423
  }
1422
1424
  function sameNodeHost(left, right) {
1425
+ if (PRODUCTION_NODE_HOSTS.has(left) && sameTinyCloudNode(left, right)) return true;
1423
1426
  try {
1424
1427
  const normalize = (value) => {
1425
1428
  const url = new URL(value);
@@ -1986,7 +1989,7 @@ function outcomeCode(result) {
1986
1989
  // package.json
1987
1990
  var package_default = {
1988
1991
  name: "@tinycloud/mcp",
1989
- version: "0.10.0-beta.31",
1992
+ version: "0.10.0-beta.33",
1990
1993
  description: "TinyCloud delegated operations MCP server",
1991
1994
  keywords: [
1992
1995
  "tinycloud",
@@ -2057,9 +2060,10 @@ var package_default = {
2057
2060
  dependencies: {
2058
2061
  "@modelcontextprotocol/node": "2.0.0-beta.5",
2059
2062
  "@modelcontextprotocol/server": "2.0.0-beta.5",
2060
- "@tinycloud/node-sdk": "3.12.0-beta.23",
2063
+ "@tinycloud/node-sdk": "3.12.0-beta.24",
2064
+ "@tinycloud/sdk-core": "3.12.0-beta.24",
2061
2065
  "@tinycloud/node-sdk-wasm": "1.7.9-beta.0",
2062
- "@tinycloud/operations": "0.9.0-beta.27",
2066
+ "@tinycloud/operations": "0.9.0-beta.29",
2063
2067
  jose: "6.2.4"
2064
2068
  },
2065
2069
  devDependencies: {