@capxul/mcp 4.20.0-beta.7 → 4.20.0-beta.9

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 +39 -7
  2. package/package.json +2 -2
package/dist/main.mjs CHANGED
@@ -12429,6 +12429,18 @@ function withInvocationParentSpan(effect, controls) {
12429
12429
  const parent = controls?.[INVOCATION_PARENT_SPAN];
12430
12430
  return parent === void 0 ? effect : effect.pipe(Effect.withParentSpan(parent));
12431
12431
  }
12432
+ /**
12433
+ * The input field a refused request named.
12434
+ *
12435
+ * The surfaces that call the port directly already carry `details.field` for an
12436
+ * `INVALID_INPUT` refusal. The actor keeps that one allowlisted detail instead of
12437
+ * dropping it, so a caller sees the same refusal either way.
12438
+ */
12439
+ const refusedInputField = (failure) => {
12440
+ if (failure.code !== "INVALID_INPUT") return void 0;
12441
+ const field = failure.error?.details?.field;
12442
+ return typeof field === "string" && field.length > 0 ? { field } : void 0;
12443
+ };
12432
12444
  var ActorFailure = class extends Error {
12433
12445
  reason;
12434
12446
  machine;
@@ -12594,7 +12606,7 @@ const boot = (spec, options = {}) => Effect.gen(function* () {
12594
12606
  const event = { _tag: env.origin.event };
12595
12607
  const failedState = exit.failure === timeoutFailure || exit.failure === cancelledFailure ? yield* recoverFailure(state, env.origin, exit.failure) : state;
12596
12608
  yield* emit(nonApplied(failedState, event, exit.failure.code, outcome, env, exit.failure));
12597
- const details = exit.failure === timeoutFailure ? { reason: "timeout" } : void 0;
12609
+ const details = exit.failure === timeoutFailure ? { reason: "timeout" } : refusedInputField(exit.failure);
12598
12610
  yield* failReply(held.reply, makeFailure(failedState, event, exit.failure.code, details, exit.failure.error ?? exit.failure));
12599
12611
  return;
12600
12612
  }
@@ -14653,7 +14665,7 @@ function subscribeActivity(deps, actor, controls, onChange) {
14653
14665
  }
14654
14666
  //#endregion
14655
14667
  //#region ../../packages/sdk/package.json
14656
- var version$1 = "4.20.0-beta.7";
14668
+ var version$1 = "4.20.0-beta.9";
14657
14669
  //#endregion
14658
14670
  //#region ../../packages/sdk/src/telemetry/exception-projection.ts
14659
14671
  /** Fixed fallback for failures that have no safe message. */
@@ -41172,6 +41184,7 @@ function mapBetterAuthError(operation, body) {
41172
41184
  const code = typeof errBody.code === "string" ? errBody.code : "";
41173
41185
  if (code === "OTP_EXPIRED") return Errors.otpExpired();
41174
41186
  if (code === "INVALID_OTP") return Errors.invalidInput("otp", errBody.message ?? "invalid OTP");
41187
+ if (code === "TOO_MANY_ATTEMPTS") return Errors.rateLimited({ resource: "better-auth/verifyOtp" });
41175
41188
  if (code === "VALIDATION_ERROR" || code === "INVALID_EMAIL") return Errors.invalidInput("email", errBody.message ?? "invalid email");
41176
41189
  }
41177
41190
  return Errors.providerError("better-auth", operation, new Error(String(body)));
@@ -41789,6 +41802,10 @@ var BetterAuthNodeAdapter = class {
41789
41802
  ok: false,
41790
41803
  error: Errors.invalidInput("otp", errBody.message ?? "invalid OTP")
41791
41804
  };
41805
+ if (errBody.code === "TOO_MANY_ATTEMPTS") return {
41806
+ ok: false,
41807
+ error: Errors.rateLimited({ resource: "better-auth/verifyOtp" })
41808
+ };
41792
41809
  }
41793
41810
  }
41794
41811
  return {
@@ -45301,6 +45318,12 @@ const stderrConvexLogger = {
45301
45318
  error: writeConvexDiagnostic,
45302
45319
  logVerbose: () => void 0
45303
45320
  };
45321
+ const silentConvexLogger = {
45322
+ log: () => void 0,
45323
+ warn: () => void 0,
45324
+ error: () => void 0,
45325
+ logVerbose: () => void 0
45326
+ };
45304
45327
  /** Exact floor-first allowlist; every additional handler must migrate its validator first. */
45305
45328
  const OBSERVED_CONVEX_ACTIONS = /* @__PURE__ */ new Set([
45306
45329
  "system:healthObserved",
@@ -45389,7 +45412,7 @@ var ConvexCallAdapter = class {
45389
45412
  const webSocketConstructor = this.#connectionMonitor.observedWebSocketConstructor();
45390
45413
  this.#client = deps.client ?? new ConvexClient(deps.convexUrl, {
45391
45414
  ...webSocketConstructor === void 0 ? {} : { webSocketConstructor },
45392
- ...deps.logToStderr === true ? { logger: stderrConvexLogger } : {}
45415
+ logger: deps.localDiagnostics === true ? stderrConvexLogger : silentConvexLogger
45393
45416
  });
45394
45417
  this.#tokenProvider = deps.tokenProvider;
45395
45418
  this.#applicationId = deps.applicationId;
@@ -51264,7 +51287,7 @@ function productionAuthCacheLayer(input) {
51264
51287
  function productionConvexCallLayer(input, refreshConvexAuthRef) {
51265
51288
  return Layer.unwrap(Effect.map(AuthClientPortTag, (authClient) => ConvexCallLayer({
51266
51289
  convexUrl: input.runtimeUrls.convexUrl,
51267
- logToStderr: input.runtime === "node",
51290
+ localDiagnostics: input.localDiagnostics,
51268
51291
  ...input.applicationId === void 0 ? {} : { applicationId: input.applicationId },
51269
51292
  ...input.observation === void 0 ? {} : { observation: input.observation },
51270
51293
  ...input.convexClient === void 0 ? {} : { client: input.convexClient },
@@ -51303,6 +51326,7 @@ function resolveProductionObservability(input) {
51303
51326
  };
51304
51327
  }
51305
51328
  async function createProductionAdapters(input) {
51329
+ const localDiagnostics = productionLocalDiagnostics(input);
51306
51330
  const { observation, telemetry, invocationObservation, invocationTelemetry } = resolveProductionObservability(input);
51307
51331
  const resolvedInput = resolveInput(input);
51308
51332
  if (!resolvedInput.ok) return resolvedInput;
@@ -51373,6 +51397,7 @@ async function createProductionAdapters(input) {
51373
51397
  const portsLayer = mergeProductionAdapterLayers(makeProductionAdapterLayerEntries({
51374
51398
  bootstrap,
51375
51399
  runtime: resolvedInput.value.runtime,
51400
+ localDiagnostics,
51376
51401
  ...resolvedInput.value.origin === void 0 ? {} : { origin: resolvedInput.value.origin },
51377
51402
  runtimeUrls: runtimeUrls.value,
51378
51403
  chainId: bootstrapResult.value.chainId,
@@ -51387,7 +51412,7 @@ async function createProductionAdapters(input) {
51387
51412
  ...input.signal === void 0 ? {} : { signal: input.signal },
51388
51413
  ...input.resetSignerSession === void 0 ? {} : { resetSignerSession: input.resetSignerSession }
51389
51414
  }));
51390
- const applicationLayer = Layer.merge(portsLayer, optionalEngineeringTelemetryLayer(bootstrapResult.value.engineeringTelemetry, resolvedInput.value.runtime, hostEngineeringPolicy(input.observability))).pipe(Layer.provideMerge(resolvedInput.value.runtime === "node" ? Layer.succeed(Logger.LogToStderr, true) : Layer.empty));
51415
+ const applicationLayer = Layer.merge(portsLayer, optionalEngineeringTelemetryLayer(bootstrapResult.value.engineeringTelemetry, resolvedInput.value.runtime, hostEngineeringPolicy(input.observability))).pipe(Layer.provideMerge(localDiagnosticsLayer(localDiagnostics, resolvedInput.value.runtime)));
51391
51416
  const context = await Effect.runPromise(Layer.buildWithScope(applicationLayer, scope));
51392
51417
  const collected = await Effect.runPromise(collectProductionFlowPorts.pipe(Effect.provide(context)));
51393
51418
  const indexerUrl = input.indexerUrl ?? bootstrapResult.value.indexerUrl;
@@ -51451,6 +51476,13 @@ function optionalEngineeringTelemetryLayer(policy, runtime, hostPolicy) {
51451
51476
  return Layer.empty;
51452
51477
  }
51453
51478
  }
51479
+ function localDiagnosticsLayer(enabled, runtime) {
51480
+ if (!enabled) return Logger.layer([]);
51481
+ return runtime === "node" ? Layer.succeed(Logger.LogToStderr, true) : Layer.empty;
51482
+ }
51483
+ function productionLocalDiagnostics(input) {
51484
+ return input.localDiagnostics !== false;
51485
+ }
51454
51486
  function refreshConvexAuthOnSession(authClient, refresh) {
51455
51487
  return {
51456
51488
  ...authClient,
@@ -51515,7 +51547,7 @@ async function createCapxulClientWithSignerControls(input, controls) {
51515
51547
  runtime,
51516
51548
  authBaseUrl: resolvedAuthBaseUrl,
51517
51549
  createBrowserSigner: createOpenfortBrowserSignerFromBootstrap,
51518
- diagnostic: new EffectLogDiagnosticAdapter(adapters.value.context, new ConsoleDiagnosticAdapter()),
51550
+ diagnostic: new EffectLogDiagnosticAdapter(adapters.value.context, productionLocalDiagnostics(input) ? new ConsoleDiagnosticAdapter() : void 0),
51519
51551
  signer: input.signer,
51520
51552
  factory: input.openfortSignerFactory,
51521
51553
  finalSign: controls.signUserOpHash,
@@ -52294,7 +52326,7 @@ function stdioIdentity(env = process.env, options = {}) {
52294
52326
  }
52295
52327
  //#endregion
52296
52328
  //#region package.json
52297
- var version = "4.20.0-beta.7";
52329
+ var version = "4.20.0-beta.9";
52298
52330
  //#endregion
52299
52331
  //#region src/deps.ts
52300
52332
  const NO_IDENTITY = async () => void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/mcp",
3
- "version": "4.20.0-beta.7",
3
+ "version": "4.20.0-beta.9",
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": [
@@ -51,7 +51,7 @@
51
51
  "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
52
52
  "vite-plus": "0.3.0",
53
53
  "@capxul/config": "0.4.0-beta.0",
54
- "@capxul/sdk": "4.20.0-beta.7",
54
+ "@capxul/sdk": "4.20.0-beta.9",
55
55
  "@capxul/typescript-config": "0.0.0"
56
56
  },
57
57
  "scripts": {