@productbrain/mcp 0.0.1-beta.15199 → 0.0.1-beta.15203

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.
@@ -668,6 +668,18 @@ var ROUTE_TYPE_BY_NAME = Object.assign(
668
668
  /* @__PURE__ */ Object.create(null),
669
669
  ROUTE_TYPE_ENTRIES
670
670
  );
671
+ var ROUTES_SAVING_NOTHING_SENT = /* @__PURE__ */ new Set([
672
+ "chain.normalizeEntryDataPreview",
673
+ "chain.deepChainWalk",
674
+ "chain.compoundQuery",
675
+ "chain.getOrientView",
676
+ "chain.getGovernanceWithRelations",
677
+ "scoreboard.get"
678
+ ]);
679
+ function routeMaySaveSent(routeName) {
680
+ const type = ROUTE_TYPE_BY_NAME[routeName];
681
+ return type === void 0 || type !== "query" && !ROUTES_SAVING_NOTHING_SENT.has(routeName);
682
+ }
671
683
  function latencyBudgetMsForRouteType(type) {
672
684
  return ROUTE_LATENCY_BUDGET_MS[type];
673
685
  }
@@ -917,9 +929,9 @@ var GatewayTimeoutError = class extends Error {
917
929
  elapsedMs;
918
930
  /**
919
931
  * True when the aborted call could have landed a write server-side despite this client
920
- * giving up. Derived by `mayHaveLandedOnTimeout` from the route contract's own function
921
- * type (`mutation`/`action` mutate; `query` does not) AND the call's own arguments (a
922
- * `preview: true` dry run writes nothing) — never guessed from the name.
932
+ * giving up. Derived by `mayHaveLandedOnTimeout` from the route contract's save fact
933
+ * (`routeMaySaveSent`: a query, or an action marked savesNothingSent, saves nothing sent) AND
934
+ * the call's own arguments (a `preview: true` dry run writes nothing) — never guessed from the name.
923
935
  */
924
936
  mayHaveLanded;
925
937
  constructor(fn, budgetMs, elapsedMs, mayHaveLanded) {
@@ -941,7 +953,7 @@ function isDryRunCall(args) {
941
953
  return args?.preview === true;
942
954
  }
943
955
  function mayHaveLandedOnTimeout(fn, args) {
944
- return routeMayMutate(fn) && !isDryRunCall(args);
956
+ return routeMaySaveSent(fn) && !isDryRunCall(args);
945
957
  }
946
958
  function throwClassifiedGatewayFailure(err, fn, args, budgetMs, elapsedMs, phase, record) {
947
959
  if (err?.name === "TimeoutError" || err?.name === "AbortError") {
@@ -1243,7 +1255,7 @@ function classifyError(err) {
1243
1255
  const { code: convexCode, fn, cleanMessage, missingRequiredFields, fieldErrors } = mcpErr;
1244
1256
  if (convexCode === "BACKEND_UNAVAILABLE") {
1245
1257
  const maySaved = err.mayHaveLanded === true;
1246
- const next2 = !routeMayMutate(fn) ? UNAVAILABLE.tryLater : maySaved ? UNAVAILABLE.maySaved : UNAVAILABLE.nothingSaved;
1258
+ const next2 = !routeMaySaveSent(fn) ? UNAVAILABLE.tryLater : maySaved ? UNAVAILABLE.maySaved : UNAVAILABLE.nothingSaved;
1247
1259
  return { code: "BACKEND_UNAVAILABLE", fn, message: UNAVAILABLE.line, recovery: next2 };
1248
1260
  }
1249
1261
  if (convexCode === "VALIDATION_FAILED") {
@@ -2001,4 +2013,4 @@ export {
2001
2013
  appUrl,
2002
2014
  apiKeysUrl
2003
2015
  };
2004
- //# sourceMappingURL=chunk-A5B64CDC.js.map
2016
+ //# sourceMappingURL=chunk-6V5ZOAJH.js.map