@capxul/mcp 2.6.0 → 2.6.1

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/main.mjs +38 -14
  2. package/package.json +3 -3
package/dist/main.mjs CHANGED
@@ -240,7 +240,7 @@ function normalizeEmail(email) {
240
240
  }
241
241
  //#endregion
242
242
  //#region package.json
243
- var version$2 = "2.6.0";
243
+ var version$2 = "2.6.1";
244
244
  //#endregion
245
245
  //#region ../../packages/errors/src/chain-cause.ts
246
246
  /**
@@ -8541,7 +8541,7 @@ const moneyExecutionContract = {
8541
8541
  };
8542
8542
  //#endregion
8543
8543
  //#region ../../packages/sdk/package.json
8544
- var version = "2.6.0";
8544
+ var version = "2.6.1";
8545
8545
  //#endregion
8546
8546
  //#region ../../packages/sdk/src/telemetry/capture-exception.ts
8547
8547
  /** Fixed, leak-safe message — the raw error message may carry PII and never ships. */
@@ -44453,10 +44453,12 @@ async function fetchWithTimeout(url, init, timeoutMs) {
44453
44453
  const controller = new AbortController();
44454
44454
  let timeout;
44455
44455
  const timeoutPromise = new Promise((_resolve, reject) => {
44456
- timeout = setTimeout(() => {
44457
- controller.abort();
44458
- reject(/* @__PURE__ */ new Error(`PostHog capture timed out after ${timeoutMs}ms`));
44459
- }, timeoutMs);
44456
+ try {
44457
+ timeout = setTimeout(() => {
44458
+ controller.abort();
44459
+ reject(/* @__PURE__ */ new Error(`PostHog capture timed out after ${timeoutMs}ms`));
44460
+ }, timeoutMs);
44461
+ } catch {}
44460
44462
  });
44461
44463
  try {
44462
44464
  return await Promise.race([fetch(url, {
@@ -44486,6 +44488,7 @@ var init_exports = /* @__PURE__ */ __exportAll({
44486
44488
  CAPXUL_BACKEND_EXPECTED_OUTCOME_EVENT: () => CAPXUL_BACKEND_EXPECTED_OUTCOME_EVENT,
44487
44489
  captureBackendDiagnostic: () => captureBackendDiagnostic,
44488
44490
  captureBrowserSdkFailure: () => captureBrowserSdkFailure,
44491
+ issueName: () => issueName,
44489
44492
  reportError: () => reportError,
44490
44493
  setReporter: () => setReporter
44491
44494
  });
@@ -44643,6 +44646,8 @@ async function postServerException(error, errorKind, operation, properties, cont
44643
44646
  const evidence = errorEvidence(error);
44644
44647
  const message = String(evidence.error_message);
44645
44648
  const stack = safeStack(error);
44649
+ const mode = isCapxulError(error) ? error.mode : void 0;
44650
+ const chain = isCapxulError(error) ? error.chain : void 0;
44646
44651
  const { attribution: _attribution, delivery: _delivery, operation: _op, ...rest } = context ?? {};
44647
44652
  await postPostHogEvent("$exception", {
44648
44653
  ...properties,
@@ -44654,7 +44659,10 @@ async function postServerException(error, errorKind, operation, properties, cont
44654
44659
  producer: "server",
44655
44660
  $exception_type: errorKind,
44656
44661
  $exception_message: message,
44657
- $exception_fingerprint: failureFingerprint(errorKind, isCapxulError(error) ? error.mode : void 0, operation),
44662
+ $exception_level: "error",
44663
+ $exception_fingerprint: failureFingerprint(errorKind, mode, operation),
44664
+ $issue_name: issueName(errorKind, mode, chain, operation),
44665
+ $issue_description: safeText(chain?.providerMessage ?? message),
44658
44666
  $exception_list: [{
44659
44667
  type: errorKind,
44660
44668
  value: message,
@@ -44663,13 +44671,17 @@ async function postServerException(error, errorKind, operation, properties, cont
44663
44671
  type: "capxul_backend_boundary"
44664
44672
  },
44665
44673
  ...stack === void 0 ? {} : { stack },
44666
- stacktrace: { frames: [{
44667
- filename: "capxul-backend-observation://boundary",
44668
- function: operation,
44669
- lineno: 1,
44670
- colno: 1,
44671
- in_app: true
44672
- }] }
44674
+ stacktrace: {
44675
+ type: "raw",
44676
+ frames: [{
44677
+ platform: "javascript",
44678
+ filename: "capxul-backend-observation://boundary",
44679
+ function: operation,
44680
+ lineno: 1,
44681
+ colno: 1,
44682
+ in_app: true
44683
+ }]
44684
+ }
44673
44685
  }]
44674
44686
  }, { timeoutMs: POSTHOG_ERROR_TIMEOUT_MS });
44675
44687
  }
@@ -44783,6 +44795,18 @@ function readExplicitAttribution(value) {
44783
44795
  if (candidate.kind === "anonymous" && typeof candidate.anonymousId === "string") return candidate;
44784
44796
  if (candidate.kind === "system" && typeof candidate.systemJob === "string") return candidate;
44785
44797
  }
44798
+ /** PostHog truncates `$issue_name` at 255 characters; cut on our side so the operation survives. */
44799
+ const ISSUE_NAME_MAX_LENGTH = 255;
44800
+ /** `normalizeOperation` allows 256 characters; the name keeps this much of it. */
44801
+ const ISSUE_NAME_OPERATION_MAX_LENGTH = 120;
44802
+ /** "PROVIDER_ERROR: revert on alto during eth_estimateUserOperationGas (smartAccount.claim)". */
44803
+ function issueName(errorKind, mode, chain, operation) {
44804
+ const cause = mode === void 0 ? "" : `: ${safeText(mode)}`;
44805
+ const where = chain?.upstream === void 0 ? "" : ` on ${safeText(chain.upstream)}${chain.method === void 0 ? "" : ` during ${safeText(chain.method)}`}`;
44806
+ const suffix = ` (${operation.slice(0, ISSUE_NAME_OPERATION_MAX_LENGTH)})`;
44807
+ const budget = Math.max(errorKind.length, ISSUE_NAME_MAX_LENGTH - suffix.length);
44808
+ return `${`${errorKind}${cause}${where}`.slice(0, budget)}${suffix}`;
44809
+ }
44786
44810
  function normalizeOperation(value) {
44787
44811
  return typeof value === "string" && /^[A-Za-z0-9_][A-Za-z0-9_.:/-]{0,255}$/u.test(value) ? value : "unknown";
44788
44812
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/mcp",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "private": false,
5
5
  "description": "Capxul MCP server for auth, Account readiness, identity, Organizations, relationships, requests, destinations, and testnet funding over Streamable HTTP.",
6
6
  "keywords": [
@@ -47,9 +47,9 @@
47
47
  "typescript": "npm:@typescript/typescript6@6.0.2",
48
48
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.23",
49
49
  "vite-plus": "0.1.23",
50
- "@capxul/backend": "0.2.13",
50
+ "@capxul/backend": "0.2.14",
51
51
  "@capxul/config": "0.2.1",
52
- "@capxul/sdk": "2.6.0",
52
+ "@capxul/sdk": "2.6.1",
53
53
  "@capxul/types": "0.2.1",
54
54
  "@capxul/typescript-config": "0.0.0",
55
55
  "@capxul/wire": "0.5.1"