@capxul/sdk 2.7.0 → 2.8.2

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.
@@ -1,4 +1,4 @@
1
- import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-BMRxwX13.mjs";
1
+ import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-BdDgF200.mjs";
2
2
  import { Hex } from "viem";
3
3
  import { Effect, FileSystem, Layer, Path } from "effect";
4
4
  //#region src/adapters/auth-cache/FileSystemAuthCacheAdapter.d.ts
@@ -1,4 +1,4 @@
1
- import { a as AuthCacheError, h as toAddress, i as parseCachedJwt, n as BrowserAuthCacheAdapter, o as AuthCachePortTag, r as parseAuthSession, t as InMemoryAuthCacheAdapter } from "../InMemoryAuthCacheAdapter-B6PHyzCN.mjs";
1
+ import { a as AuthCacheError, h as toAddress, i as parseCachedJwt, n as BrowserAuthCacheAdapter, o as AuthCachePortTag, r as parseAuthSession, t as InMemoryAuthCacheAdapter } from "../InMemoryAuthCacheAdapter-BrEN-men.mjs";
2
2
  import { Effect, FileSystem, Layer, Path } from "effect";
3
3
  import { privateKeyToAccount } from "viem/accounts";
4
4
  import * as os from "node:os";
@@ -1,4 +1,4 @@
1
- import { $ as WeiAmount, A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionAssignmentId, H as PaymentCommandId, I as DurationMs, J as PublishableKey, K as PermissionId, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as TxHash, R as EpochMs, T as AllowedOrigin, U as PayrollGroupId, V as PartyId, W as PayrollRunId, X as SessionToken, Y as RoleKey, Z as SmartAccount, a as SignerStatusStore, at as CapxulErrorDetails, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, it as CapxulErrorCode, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, p as CapxulResult, pt as FailureMode, q as Profile, rt as CapxulError, st as Failure, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-BMRxwX13.mjs";
1
+ import { $ as WeiAmount, A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionAssignmentId, H as PaymentCommandId, I as DurationMs, J as PublishableKey, K as PermissionId, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as TxHash, R as EpochMs, T as AllowedOrigin, U as PayrollGroupId, V as PartyId, W as PayrollRunId, X as SessionToken, Y as RoleKey, Z as SmartAccount, a as SignerStatusStore, at as CapxulErrorDetails, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, it as CapxulErrorCode, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, p as CapxulResult, pt as FailureMode, q as Profile, rt as CapxulError, st as Failure, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-BdDgF200.mjs";
2
2
  import { Address, Hex } from "viem";
3
3
  import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
4
4
  import { FunctionReference } from "convex/server";
@@ -719,6 +719,20 @@ type Snapshot<T, E = CapxulError> = {
719
719
  readonly status: "error";
720
720
  readonly error: E;
721
721
  };
722
+ type ConvexTransportFailure = {
723
+ readonly kind: "connection-lost-in-flight";
724
+ readonly connection_id: string;
725
+ readonly start_connection_count: number;
726
+ readonly connection_count: number;
727
+ readonly connection_retries?: number;
728
+ readonly close_code?: number;
729
+ readonly close_was_clean?: boolean;
730
+ readonly close_reason_present?: boolean;
731
+ readonly document_visibility?: string;
732
+ readonly navigator_online?: boolean;
733
+ readonly last_browser_event?: "visibility-visible" | "visibility-hidden" | "pagehide" | "pageshow" | "online" | "offline";
734
+ readonly ms_since_browser_event?: number;
735
+ };
722
736
  declare const ConvexCallError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
723
737
  readonly _tag: "ConvexCallError";
724
738
  } & Readonly<A>;
@@ -728,6 +742,7 @@ declare class ConvexCallError extends ConvexCallError_base<{
728
742
  readonly publicError: CapxulError;
729
743
  readonly cause: unknown;
730
744
  readonly details?: CapxulErrorDetails;
745
+ readonly transport?: ConvexTransportFailure;
731
746
  }> {}
732
747
  interface ConvexCallPort {
733
748
  query<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"query", "public", TArgs, TOutput>, args: TArgs): Effect.Effect<TOutput, ConvexCallError>;
@@ -2776,16 +2791,30 @@ interface SdkFailureObservation {
2776
2791
  /**
2777
2792
  * The PII-safe subset of `CapxulError.details`, already in PostHog property
2778
2793
  * shape. `provider` + `provider_operation` name the failing dependency
2779
- * (`convex bootstrap`, `openfort configure`), `failure_mode` / `reason` are
2780
- * enumerated codes, `http_status` is the upstream status. Anything else on
2794
+ * (`convex bootstrap`, `openfort configure`). `provider_error_source` names
2795
+ * the owner of an allow-listed `provider_error_code`. `failure_mode` / `reason`
2796
+ * are enumerated codes. `http_status` is the upstream status. Anything else on
2781
2797
  * `details` (ids, field names, free text) is dropped at the boundary.
2782
2798
  */
2783
2799
  interface SdkFailureDetail {
2784
2800
  readonly provider?: string;
2785
2801
  readonly provider_operation?: string;
2802
+ readonly provider_error_source?: string;
2803
+ readonly provider_error_code?: string;
2804
+ readonly target_host?: string;
2786
2805
  readonly failure_mode?: string;
2787
2806
  readonly reason?: string;
2788
2807
  readonly http_status?: number;
2808
+ readonly connection_id?: string;
2809
+ readonly connection_count?: number;
2810
+ readonly connection_retries?: number;
2811
+ readonly close_code?: number;
2812
+ readonly close_was_clean?: boolean;
2813
+ readonly close_reason_present?: boolean;
2814
+ readonly document_visibility?: string;
2815
+ readonly navigator_online?: boolean;
2816
+ readonly last_browser_event?: string;
2817
+ readonly ms_since_browser_event?: number;
2789
2818
  /** ADR-0023 R7: the chain cause, flat, same keys as every other producer. */
2790
2819
  readonly chain_upstream?: string;
2791
2820
  readonly chain_method?: string;
@@ -17,6 +17,8 @@ declare const FAILURE_MODES: readonly [
17
17
  "app-env-allowlist",
18
18
  /** Sandboxed/headless browser with no Web Crypto. */
19
19
  "no-secure-context",
20
+ /** The embedded wallet lost its configured signer state. */
21
+ "signer-not-ready",
20
22
  /** One upstream answered HTTP 429 or JSON-RPC -32005. Retryable. */
21
23
  "rate-limited",
22
24
  /** No answer inside the budget. Retryable. */
@@ -63,7 +65,7 @@ type ChainCause = {
63
65
  };
64
66
  //#endregion
65
67
  //#region ../errors/src/errors.d.ts
66
- declare const CAPXUL_ERROR_CODES: readonly ["NOT_AUTHENTICATED", "EMAIL_DELIVERY_FAILED", "PROFILE_NOT_FOUND", "SMART_ACCOUNT_MISSING", "PLAYER_NOT_FOUND", "ACCOUNT_NOT_FOUND", "PROVIDER_ERROR", "CAPABILITY_UNAVAILABLE", "INVALID_INPUT", "ENV_MISSING", "NOT_IMPLEMENTED", "VERIFICATION_REQUIRED", "INSUFFICIENT_BALANCE", "INVALID_RECIPIENT", "ROLE_PERMISSION_DENIED", "TRANSACTION_FAILED", "RATE_LIMITED", "NETWORK_ERROR", "UNKNOWN", "OTP_EXPIRED", "SIGNER_REJECTED", "CANCELLED", "WRONG_STATE", "STALE_EPOCH", "SUPERSEDED", "WORK_DIED", "ACTOR_STOPPED"];
68
+ declare const CAPXUL_ERROR_CODES: readonly ["NOT_AUTHENTICATED", "EMAIL_DELIVERY_FAILED", "PROFILE_NOT_FOUND", "SMART_ACCOUNT_MISSING", "PLAYER_NOT_FOUND", "ACCOUNT_NOT_FOUND", "ACCOUNT_CLAIMED_BY_OTHER_SIGNER", "PROVIDER_ERROR", "CAPABILITY_UNAVAILABLE", "INVALID_INPUT", "ENV_MISSING", "NOT_IMPLEMENTED", "VERIFICATION_REQUIRED", "INSUFFICIENT_BALANCE", "INVALID_RECIPIENT", "ROLE_PERMISSION_DENIED", "TRANSACTION_FAILED", "RATE_LIMITED", "NETWORK_ERROR", "UNKNOWN", "OTP_EXPIRED", "SIGNER_REJECTED", "CANCELLED", "WRONG_STATE", "STALE_EPOCH", "SUPERSEDED", "WORK_DIED", "ACTOR_STOPPED"];
67
69
  type CapxulErrorCode = (typeof CAPXUL_ERROR_CODES)[number];
68
70
  /**
69
71
  * The one failure representation carried by domain state, actor work, and
@@ -104,6 +106,22 @@ declare class CapxulError extends Error {
104
106
  constructor(code: CapxulErrorCode, message: string, options?: CapxulErrorOptions);
105
107
  }
106
108
  declare function isCapxulError(value: unknown): value is CapxulError;
109
+ type NetworkErrorOptions = {
110
+ readonly provider?: string;
111
+ readonly target_host?: string;
112
+ readonly failure_mode?: FailureMode;
113
+ readonly reason?: "connection-lost-in-flight";
114
+ readonly connection_id?: string;
115
+ readonly connection_count?: number;
116
+ readonly connection_retries?: number;
117
+ readonly close_code?: number;
118
+ readonly close_was_clean?: boolean;
119
+ readonly close_reason_present?: boolean;
120
+ readonly document_visibility?: string;
121
+ readonly navigator_online?: boolean;
122
+ readonly last_browser_event?: string;
123
+ readonly ms_since_browser_event?: number;
124
+ };
107
125
  declare const Errors: {
108
126
  readonly notAuthenticated: (message?: string, opts?: {
109
127
  readonly failure_mode?: FailureMode;
@@ -113,6 +131,23 @@ declare const Errors: {
113
131
  readonly smartAccountMissing: (authUserId: string) => CapxulError;
114
132
  readonly playerNotFound: (playerId?: string) => CapxulError;
115
133
  readonly accountNotFound: (accountId?: string) => CapxulError;
134
+ /**
135
+ * The Safe at this email's address is deployed and its owner is neither the
136
+ * Capxul bootstrap owner nor the caller's signer. The claim
137
+ * `swapOwner(bootstrap → signer)` cannot succeed: only the on-chain owner
138
+ * can hand the account over. Read from `getOwners()` before any
139
+ * UserOperation is built (2026-09-02), so no simulation and no retry.
140
+ */
141
+ readonly accountClaimedByOtherSigner: (details: {
142
+ readonly safeAddress: string;
143
+ readonly onChainOwner: string;
144
+ /** A bounded sample of the `getOwners()` answer, for a Safe that is not single-owner. */
145
+ readonly owners?: readonly string[];
146
+ /** The full size of that answer, when the sample is shorter. */
147
+ readonly ownerCount?: number;
148
+ readonly expectedOwner: string;
149
+ readonly signerAddress: string;
150
+ }) => CapxulError;
116
151
  readonly providerError: (provider: string, operation: string, cause: unknown, opts?: {
117
152
  readonly failure_mode?: FailureMode;
118
153
  readonly httpStatus?: number;
@@ -165,7 +200,7 @@ declare const Errors: {
165
200
  readonly retryAfterMs?: number;
166
201
  readonly resource?: string;
167
202
  }) => CapxulError;
168
- readonly networkError: (operation: string, cause?: unknown) => CapxulError;
203
+ readonly networkError: (operation: string, cause?: unknown, opts?: NetworkErrorOptions) => CapxulError;
169
204
  readonly unknown: (cause?: unknown) => CapxulError;
170
205
  readonly otpExpired: (details?: {
171
206
  readonly email?: string;
@@ -176,6 +211,11 @@ declare const Errors: {
176
211
  readonly reason?: string;
177
212
  readonly cause?: unknown;
178
213
  }) => CapxulError;
214
+ readonly superseded: (details: {
215
+ readonly operation: string;
216
+ readonly reason: string;
217
+ readonly executionId?: string;
218
+ }) => CapxulError;
179
219
  readonly cancelled: (details?: {
180
220
  readonly operation?: string;
181
221
  readonly reason?: string;
@@ -1,4 +1,4 @@
1
- import { Jn as TelemetryGroupInput, Yn as TelemetryIdentifyInput, n as ObservationAdapter, or as IdentityTransition, qn as TelemetryEvent, u as CapxulClient } from "../observation-BMW_idMZ.mjs";
1
+ import { Jn as TelemetryGroupInput, Yn as TelemetryIdentifyInput, n as ObservationAdapter, or as IdentityTransition, qn as TelemetryEvent, u as CapxulClient } from "../observation-D-oCDlMS.mjs";
2
2
  import { Effect, Layer } from "effect";
3
3
  //#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
4
4
  type RecordingTelemetryOperation = {
@@ -1,5 +1,5 @@
1
- import { $ as deriveCapxulSafeAddress, P as fromWei, b as authClientPortFromPromiseAdapter, c as smartAccountErrorFromCapxul, d as wireChainId, h as convexCallErrorFromCapxul, o as redactTelemetryEvent, p as identityErrorFromCapxul, t as assembleCapxulClient, u as accountReadErrorFromCapxul, w as toWei, y as bootstrapErrorFromCapxul } from "../create-capxul-client-DNYuHQGS.mjs";
2
- import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, N as toPublishableKey, O as toKycTier, R as CapxulError, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-B6PHyzCN.mjs";
1
+ import { B as fromWei, E as toWei, S as authClientPortFromPromiseAdapter, _ as convexCallErrorFromCapxul, c as redactTelemetryEvent, ct as deriveCapxulSafeAddress, h as identityErrorFromCapxul, i as smartAccountErrorFromCapxul, o as accountReadErrorFromCapxul, p as wireChainId, t as assembleCapxulClient, x as bootstrapErrorFromCapxul } from "../create-capxul-client-BKJHefmA.mjs";
2
+ import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, N as toPublishableKey, O as toKycTier, R as CapxulError, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-BrEN-men.mjs";
3
3
  import { keccak256 } from "viem";
4
4
  import { Effect, Result, Semaphore } from "effect";
5
5
  import { getFunctionName } from "convex/server";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "2.7.0",
3
+ "version": "2.8.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Xelmar-tech/infrastructure.git",
@@ -47,12 +47,12 @@
47
47
  "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
48
48
  "vite-plus": "0.3.0",
49
49
  "vitest": "4.1.11",
50
- "@capxul/config": "0.2.1",
51
- "@capxul/wire": "0.5.1",
52
50
  "@capxul/errors": "0.0.2",
53
- "@capxul/typescript-config": "0.0.0",
51
+ "@capxul/observability": "2.8.2",
54
52
  "@capxul/types": "0.2.1",
55
- "@capxul/observability": "2.7.0"
53
+ "@capxul/config": "0.2.1",
54
+ "@capxul/wire": "0.5.1",
55
+ "@capxul/typescript-config": "0.0.0"
56
56
  },
57
57
  "_permissionlessPinReason": "permissionless.toSafeSmartAccount is pinned to 0.3.4 for live Safe deployment E2E. Counterfactual address fixtures captured 2026-05-17 in packages/backend/convex/_shared/__tests__/counterfactual.test.ts and packages/config/tests/safe.test.ts must be re-verified before upgrading.",
58
58
  "scripts": {