@topolo/mcp 0.11.4 → 0.11.5

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 (3) hide show
  1. package/dist/http.js +667 -220
  2. package/dist/index.js +19 -5
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // src/index.ts
4
4
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
5
 
6
- // ../../node_modules/.pnpm/@topolo+sdk@0.11.4/node_modules/@topolo/sdk/dist/index.js
6
+ // node_modules/@topolo/sdk/dist/index.js
7
7
  function applyAuthHeaders(headers, credential) {
8
8
  if (credential.kind === "api_key") {
9
9
  headers.set("X-Api-Key", credential.apiKey);
@@ -66,6 +66,7 @@ var PUBLIC_ERROR_CODES = /* @__PURE__ */ new Set([
66
66
  "permission_denied",
67
67
  "rate_limited",
68
68
  "request_failed",
69
+ "request_timeout",
69
70
  "service_catalog_unavailable",
70
71
  "service_path_origin_mismatch",
71
72
  "service_required",
@@ -914,7 +915,7 @@ var TopoloClient = class _TopoloClient {
914
915
  this.serviceUrls = options.environment ? topoloServiceOrigins(options.serviceUrls, options.environment) : options.serviceUrls;
915
916
  this.appIds = options.appIds;
916
917
  this.requireConfirmForWrites = options.requireConfirmForWrites !== false;
917
- this.timeoutMs = options.timeoutMs ?? 3e4;
918
+ this.timeoutMs = options.timeoutMs ?? 12e4;
918
919
  this.fetchImpl = options.fetch ?? fetch;
919
920
  this.credentialProvider = options.credentialProvider;
920
921
  this.refreshCredential = options.refreshCredential;
@@ -985,7 +986,11 @@ var TopoloClient = class _TopoloClient {
985
986
  this.emit({ phase: "request", method, service: resolvedService.serviceKey, path: opts.path, url: urlStr, requestId });
986
987
  const fetchOnce = async () => {
987
988
  const controller = new AbortController();
988
- const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);
989
+ let timedOut = false;
990
+ const timeoutId = setTimeout(() => {
991
+ timedOut = true;
992
+ controller.abort();
993
+ }, this.timeoutMs);
989
994
  const signal = opts.signal ? mergeSignals(opts.signal, controller.signal) : controller.signal;
990
995
  try {
991
996
  return await this.fetchImpl(urlStr, {
@@ -994,6 +999,14 @@ var TopoloClient = class _TopoloClient {
994
999
  body: opts.rawBody ?? (opts.body !== void 0 ? JSON.stringify(opts.body) : null),
995
1000
  signal
996
1001
  });
1002
+ } catch (error) {
1003
+ if (timedOut) {
1004
+ throw new TopoloSdkError(
1005
+ "request_timeout",
1006
+ `Topolo request timed out after ${this.timeoutMs}ms. Verify current state before retrying a mutation.`
1007
+ );
1008
+ }
1009
+ throw error;
997
1010
  } finally {
998
1011
  clearTimeout(timeoutId);
999
1012
  }
@@ -1019,7 +1032,7 @@ var TopoloClient = class _TopoloClient {
1019
1032
  url: urlStr,
1020
1033
  requestId,
1021
1034
  durationMs: Date.now() - startedAt,
1022
- error: "network_error"
1035
+ error: err instanceof TopoloSdkError ? err.code : "network_error"
1023
1036
  });
1024
1037
  throw err;
1025
1038
  }
@@ -2274,7 +2287,7 @@ function createTopolo(options) {
2274
2287
  };
2275
2288
  }
2276
2289
 
2277
- // ../../node_modules/.pnpm/@topolo+sdk@0.11.4/node_modules/@topolo/sdk/dist/node/credential-store.js
2290
+ // node_modules/@topolo/sdk/dist/node/credential-store.js
2278
2291
  import { mkdir, readFile, writeFile, chmod, rm, stat } from "fs/promises";
2279
2292
  import { existsSync } from "fs";
2280
2293
  import { homedir, platform } from "os";
@@ -2323,6 +2336,7 @@ var PUBLIC_ERROR_CODES2 = /* @__PURE__ */ new Set([
2323
2336
  "permission_denied",
2324
2337
  "rate_limited",
2325
2338
  "request_failed",
2339
+ "request_timeout",
2326
2340
  "service_catalog_unavailable",
2327
2341
  "service_path_origin_mismatch",
2328
2342
  "service_required",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topolo/mcp",
3
- "version": "0.11.4",
4
- "topoloPublishedVersion": "0.11.4",
3
+ "version": "0.11.5",
4
+ "topoloPublishedVersion": "0.11.5",
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.4"
38
+ "@topolo/sdk": "0.11.5"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.12.0",