@topolo/mcp 0.11.6 → 0.11.8

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -323,7 +323,7 @@ function originMatchesEnvironment(url, environment) {
323
323
  }
324
324
  if (url.protocol !== "https:") return false;
325
325
  if (environment === "production") {
326
- return hostnameHasSuffix(hostname, "topolo.app") || hostnameHasSuffix(hostname, "topolo.io") || workersDevAccountMatches(hostname, "topolo");
326
+ return hostnameHasSuffix(hostname, "topolo.app") || hostnameHasSuffix(hostname, "topolo.io") || hostname === "api.ol0.me" || workersDevAccountMatches(hostname, "topolo");
327
327
  }
328
328
  if (environment === "staging") {
329
329
  return hostnameHasSuffix(hostname, "stg.topolo.us") || workersDevAccountMatches(hostname, "topolo-staging");
@@ -724,7 +724,7 @@ function prepareTopoloActionUploadInput(contractValue, content, input, options)
724
724
  if (bytes.byteLength > contract.maxBytes) {
725
725
  throw new TopoloSdkError("upload_too_large", `Upload content exceeds the ${contract.maxBytes}-byte action limit.`);
726
726
  }
727
- return mapUploadInput(contract, bytesToBase64(bytes), input, options);
727
+ return mapUploadInput(contract, encodeTopoloActionBase64(bytes), input, options);
728
728
  }
729
729
  function prepareTopoloActionBase64UploadInput(contractValue, contentBase64, input, options) {
730
730
  const contract = parseTopoloActionUploadContract(contractValue);
@@ -860,7 +860,7 @@ function requiredField(value, name) {
860
860
  function matchesContentType(contentType, accepted) {
861
861
  return accepted.some((candidate) => candidate === "*/*" || candidate === contentType || candidate.endsWith("/*") && contentType.startsWith(candidate.slice(0, -1)));
862
862
  }
863
- function bytesToBase64(bytes) {
863
+ function encodeTopoloActionBase64(bytes) {
864
864
  let binary = "";
865
865
  const chunkSize = 32768;
866
866
  for (let offset = 0; offset < bytes.length; offset += chunkSize) {
@@ -1037,7 +1037,20 @@ var TopoloClient = class _TopoloClient {
1037
1037
  throw err;
1038
1038
  }
1039
1039
  const contentType = res.headers.get("Content-Type") ?? "";
1040
- const parsed = contentType.includes("application/json") ? await res.json().catch(() => null) : await res.text().catch(() => null);
1040
+ const normalizedContentType = contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
1041
+ let parsed;
1042
+ if (normalizedContentType === "application/json" || normalizedContentType.endsWith("+json")) {
1043
+ parsed = await res.json().catch(() => null);
1044
+ } else if (!res.ok || !normalizedContentType || normalizedContentType.startsWith("text/")) {
1045
+ parsed = await res.text().catch(() => null);
1046
+ } else {
1047
+ const bytes = new Uint8Array(await res.arrayBuffer());
1048
+ parsed = {
1049
+ contentType: normalizedContentType,
1050
+ contentLength: bytes.byteLength,
1051
+ contentBase64: encodeTopoloActionBase64(bytes)
1052
+ };
1053
+ }
1041
1054
  if (!res.ok) {
1042
1055
  const durationMs = Date.now() - startedAt;
1043
1056
  const message = describeError(parsed, `HTTP ${res.status}`);
@@ -2633,7 +2646,7 @@ function originMatchesEnvironment2(url, environment) {
2633
2646
  }
2634
2647
  if (url.protocol !== "https:") return false;
2635
2648
  if (environment === "production") {
2636
- return hostnameHasSuffix2(hostname, "topolo.app") || hostnameHasSuffix2(hostname, "topolo.io") || workersDevAccountMatches2(hostname, "topolo");
2649
+ return hostnameHasSuffix2(hostname, "topolo.app") || hostnameHasSuffix2(hostname, "topolo.io") || hostname === "api.ol0.me" || workersDevAccountMatches2(hostname, "topolo");
2637
2650
  }
2638
2651
  if (environment === "staging") {
2639
2652
  return hostnameHasSuffix2(hostname, "stg.topolo.us") || workersDevAccountMatches2(hostname, "topolo-staging");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topolo/mcp",
3
- "version": "0.11.6",
4
- "topoloPublishedVersion": "0.11.6",
3
+ "version": "0.11.8",
4
+ "topoloPublishedVersion": "0.11.8",
5
5
  "description": "Model Context Protocol server for the Topolo platform. Exposes scope-gated tools that third-party agents (Claude, Codex, etc.) can call natively.",
6
6
  "license": "UNLICENSED",
7
7
  "author": "Topolo",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@modelcontextprotocol/sdk": "^1.0.0",
38
- "@topolo/sdk": "0.11.6"
38
+ "@topolo/sdk": "0.11.8"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.12.0",