@capxul/sdk 2.0.1 → 2.1.0

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.
@@ -31,6 +31,7 @@ interface Failure {
31
31
  readonly code: CapxulErrorCode;
32
32
  readonly message: string;
33
33
  readonly mode?: FailureMode;
34
+ readonly error?: CapxulError;
34
35
  }
35
36
  type CapxulErrorDetails = Record<string, unknown>;
36
37
  type CapxulErrorOptions = {
@@ -154,26 +155,24 @@ declare function toCountryCode(raw: unknown): CountryCode;
154
155
  //#endregion
155
156
  //#region src/ports/auth-cache.d.ts
156
157
  /**
157
- * AuthCachePort (TA4) replaces `SessionStoragePort` in the rebuild slice's
158
- * consumer-facing wiring. Stores the user-snapshot Session AND the cached
159
- * Convex JWT (W7 bridge endpoint). The two slots are independent so a session
160
- * refresh doesn't invalidate the JWT and vice versa.
158
+ * AuthCachePort stores the user session and the cached
159
+ * Convex JWT. The two slots are independent. A session refresh does not
160
+ * invalidate the JWT.
161
161
  *
162
- * Three adapters (TA7):
162
+ * Three adapters implement this port:
163
163
  * - `BrowserAuthCacheAdapter` — backed by `localStorage`
164
164
  * - `FileSystemAuthCacheAdapter` — mode-0600 JSON file in `~/.config/capxul/`
165
165
  * - `InMemoryAuthCacheAdapter` — for tests
166
166
  *
167
- * `SessionStoragePort` was retired by the Stage 4 rebuild; session and JWT
168
- * persistence now share this cache boundary.
167
+ * Session and JWT persistence share this cache boundary.
169
168
  */
170
169
  interface AuthCachePort {
171
170
  readonly getSession: Effect.Effect<AuthSession | null, AuthCacheError>;
172
171
  readonly setSession: (session: AuthSession) => Effect.Effect<void, AuthCacheError>;
173
172
  readonly clearSession: Effect.Effect<void, AuthCacheError>;
174
173
  /**
175
- * JWT cache for the `/api/auth/convex/token` bridge endpoint (W7).
176
- * Stored separately from the session so a session refresh doesn't
174
+ * JWT cache for the `/api/auth/convex/token` bridge endpoint.
175
+ * Stored separately from the session so a session refresh does not
177
176
  * invalidate cached JWT.
178
177
  */
179
178
  readonly getJwt: Effect.Effect<CachedJwt | null, AuthCacheError>;
@@ -181,9 +180,9 @@ interface AuthCachePort {
181
180
  readonly clearJwt: Effect.Effect<void, AuthCacheError>;
182
181
  }
183
182
  /**
184
- * Cached Convex JWT shape (TA4). `expEpochSeconds` is decoded from the JWT's
183
+ * Cached Convex JWT shape. `expEpochSeconds` is decoded from the JWT's
185
184
  * `exp` claim at fetch time so the `tokenProvider` cache eviction logic can
186
- * proactively refresh at `exp - 30s` per TA3.
185
+ * refresh at `exp - 30s`.
187
186
  */
188
187
  interface CachedJwt {
189
188
  readonly token: JwtToken;
@@ -1,4 +1,4 @@
1
- import { _n as IdentityTransition, an as TelemetryEvent, on as TelemetryGroupInput, sn as TelemetryIdentifyInput, t as CapxulClient } from "../create-capxul-client-BklYjuYQ.mjs";
1
+ import { cn as TelemetryGroupInput, ln as TelemetryIdentifyInput, sn as TelemetryEvent, t as CapxulClient, yn as IdentityTransition } from "../create-capxul-client-DmV6qEq4.mjs";
2
2
  import { Effect, Layer } from "effect";
3
3
 
4
4
  //#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
@@ -1,4 +1,4 @@
1
- import { O as fromWei, T as authClientPortFromPromiseAdapter, W as deriveCapxulSafeAddress, b as convexCallErrorFromCapxul, f as smartAccountErrorFromCapxul, g as wireChainId, h as toWei, m as accountReadErrorFromCapxul, t as assembleCapxulClient, u as redactTelemetryEvent, v as identityErrorFromCapxul, w as bootstrapErrorFromCapxul } from "../create-capxul-client-oqLlUkzI.mjs";
1
+ import { C as bootstrapErrorFromCapxul, G as deriveCapxulSafeAddress, O as toWei, _ as identityErrorFromCapxul, f as smartAccountErrorFromCapxul, h as wireChainId, k as fromWei, m as accountReadErrorFromCapxul, t as assembleCapxulClient, u as redactTelemetryEvent, w as authClientPortFromPromiseAdapter, y as convexCallErrorFromCapxul } from "../create-capxul-client-CMUq5w10.mjs";
2
2
  import { A as toSessionToken, C as toEpochMs, E as toKycTier, M as CapxulError, O as toPublishableKey, P as Errors, S as toEmail, T as toJwtToken, _ as toAuthUserId, g as toAppId, h as toAllowedOrigin, m as toAddress, p as toAccountId, t as InMemoryAuthCacheAdapter, v as toChainId, w as toEpochSeconds, x as toDurationMs, y as toCountryCode } from "../InMemoryAuthCacheAdapter-Rc8tCtml.mjs";
3
3
  import { keccak256 } from "viem";
4
4
  import { Effect, Result, Semaphore } from "effect";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Xelmar-tech/infrastructure.git",
@@ -42,16 +42,16 @@
42
42
  "@vitest/coverage-v8": "4.1.7",
43
43
  "fast-check": "^3.23.2",
44
44
  "permissionless": "0.3.4",
45
- "posthog-js": "^1.399.2",
45
+ "posthog-js": "^1.418.10",
46
46
  "typescript": "npm:@typescript/typescript6@6.0.2",
47
47
  "vite-plus": "0.1.23",
48
48
  "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.23",
49
49
  "@capxul/config": "0.1.1",
50
50
  "@capxul/errors": "0.0.1",
51
51
  "@capxul/typescript-config": "0.0.0",
52
- "@capxul/observability": "2.0.1",
53
- "@capxul/wire": "0.1.0",
54
- "@capxul/types": "0.1.0"
52
+ "@capxul/types": "0.1.0",
53
+ "@capxul/wire": "0.2.0",
54
+ "@capxul/observability": "2.1.0"
55
55
  },
56
56
  "_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.",
57
57
  "scripts": {