@capxul/sdk 4.2.0-rc.4 → 4.2.0-rc.6

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.
@@ -1947,6 +1947,12 @@ const USDX_BASE_SEPOLIA_TOKEN = {
1947
1947
  USDX_BASE_SEPOLIA_TOKEN.chainId;
1948
1948
  USDX_BASE_SEPOLIA_TOKEN.chainId;
1949
1949
  10n ** BigInt(6);
1950
+ /**
1951
+ * The bootstrap manage role. It administers people and roles, cannot spend,
1952
+ * and is not a signer of the Organization Safe; "Owner" implied the latter,
1953
+ * so the label is Admin (ruled 2026-09-06).
1954
+ */
1955
+ const ADMIN_ROLE_LABEL = "Admin";
1950
1956
  function normalizeOrgRoleLabel(label) {
1951
1957
  const normalized = label.trim().replace(/\s+/g, " ");
1952
1958
  if (normalized.length === 0) throw Errors.invalidInput("role.label", "must be a non-empty role label");
@@ -2363,4 +2369,4 @@ function readExchange(body) {
2363
2369
  };
2364
2370
  }
2365
2371
  //#endregion
2366
- export { toTesterKind as $, toAccountId as A, toEmail as B, BYTES32_RE as C, ZERO_BYTES32 as D, WEI_RE as E, toBudgetId as F, toKycTier as G, toEpochSeconds as H, toChainId as I, toPayrollGroupId as J, toOrgId as K, toCountryCode as L, toAllowedOrigin as M, toAppId as N, assetIdFor as O, toAuthUserId as P, toSessionToken as Q, toCurrencyCode as R, ASSET_ID_RE as S, SUPPORTED_CURRENCY_CODES as T, toHandle as U, toEpochMs as V, toJwtToken as W, toPublishableKey as X, toPayrollRunId as Y, toRoleKey as Z, BASE_SEPOLIA_CHAIN_ID as _, revertSummaryText as _t, parseAuthSession as a, EXPECTED_OPERATION_OUTCOMES as at, ACCOUNT_ID_RE as b, redactSecrets as bt, AuthCachePortTag as c, CHAIN_UPSTREAMS as ct, authClientPortFromPromiseAdapter as d, chainCauseProperties as dt, validateHandle as et, AuthClientError as f, chainEvidenceLabel as ft, normalizeBindingEmail as g, isFailureMode as gt, CAPXUL_PAYMENTS_V2_ADDRESS as h, isChainUpstream as ht, BrowserAuthCacheAdapter as i, CapxulError as it, toAddress as j, currencySymbolFor as k, SystemClockLayer as l, FAILURE_MODES as lt, orgRoleKeyForLabel as m, failureFingerprint as mt, readClockNow as n, decodeConvexError as nt, parseCachedJwt as o, Errors as ot, AuthClientPortTag as p, decodeChainCause as pt, toPartyId as q, InMemoryAuthCacheAdapter as r, CAPXUL_ERROR_CODES as rt, AuthCacheError as s, isCapxulError as st, oauthBearerAuthClient as t, HANDLE_RE as tt, ClockPortTag as u, boundedResponseHeaders as ut, deriveCapxulSafeAddress as v, containsSensitiveMaterial as vt, EVM_ADDRESS_RE as w, APP_ID_RE as x, redactUrlSecrets as xt, configuredMoneyAssetById as y, isCredentialField as yt, toDurationMs as z };
2372
+ export { toSessionToken as $, currencySymbolFor as A, toDurationMs as B, ASSET_ID_RE as C, WEI_RE as D, SUPPORTED_CURRENCY_CODES as E, toAuthUserId as F, toJwtToken as G, toEpochMs as H, toBudgetId as I, toPartyId as J, toKycTier as K, toChainId as L, toAddress as M, toAllowedOrigin as N, ZERO_BYTES32 as O, toAppId as P, toRoleKey as Q, toCountryCode as R, APP_ID_RE as S, redactUrlSecrets as St, EVM_ADDRESS_RE as T, toEpochSeconds as U, toEmail as V, toHandle as W, toPayrollRunId as X, toPayrollGroupId as Y, toPublishableKey as Z, normalizeBindingEmail as _, isFailureMode as _t, parseAuthSession as a, CapxulError as at, configuredMoneyAssetById as b, isCredentialField as bt, AuthCachePortTag as c, isCapxulError as ct, authClientPortFromPromiseAdapter as d, boundedResponseHeaders as dt, toTesterKind as et, AuthClientError as f, chainCauseProperties as ft, CAPXUL_PAYMENTS_V2_ADDRESS as g, isChainUpstream as gt, orgRoleKeyForLabel as h, failureFingerprint as ht, BrowserAuthCacheAdapter as i, CAPXUL_ERROR_CODES as it, toAccountId as j, assetIdFor as k, SystemClockLayer as l, CHAIN_UPSTREAMS as lt, ADMIN_ROLE_LABEL as m, decodeChainCause as mt, readClockNow as n, HANDLE_RE as nt, parseCachedJwt as o, EXPECTED_OPERATION_OUTCOMES as ot, AuthClientPortTag as p, chainEvidenceLabel as pt, toOrgId as q, InMemoryAuthCacheAdapter as r, decodeConvexError as rt, AuthCacheError as s, Errors as st, oauthBearerAuthClient as t, validateHandle as tt, ClockPortTag as u, FAILURE_MODES as ut, BASE_SEPOLIA_CHAIN_ID as v, revertSummaryText as vt, BYTES32_RE as w, ACCOUNT_ID_RE as x, redactSecrets as xt, deriveCapxulSafeAddress as y, containsSensitiveMaterial as yt, toCurrencyCode as z };
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "source": {
3
- "commit": "400e4b861e8c10091ad2d9e71fc0502fe222a801",
4
- "tree": "c3afb8bb5f3ce69ee8aa1e8fbe811fe213627887",
3
+ "commit": "8e8ae6c3c56c5d5260c469cf8e4e7bbe172a098f",
4
+ "tree": "6fcb3062a577d0af2b426b2e50ef92c0d9027701",
5
5
  "branch": "codex/programme-rc",
6
6
  "repository": "https://github.com/Xelmar-tech/infrastructure",
7
7
  "lockfileSha256": "5870f53b72706d103220c1bcf733cb4fb71196aea32a9cfbdc277d73cc959264"
8
8
  },
9
9
  "name": "@capxul/sdk",
10
- "version": "4.2.0-rc.4"
10
+ "version": "4.2.0-rc.6"
11
11
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as PayrollGroupId, B as ChainId, Ct as ChainCause, D as Account, Dt as RevertSummary, E as CAPXUL_PAYMENTS_V2_ADDRESS, Et as FailureMode, F as AssetId, G as EVM_ADDRESS_RE, H as CurrencyCode, I as AuthSession, J as Handle, L as AuthUserId, O as AccountId, P as AssetAmount, St as CHAIN_UPSTREAMS, Tt as FAILURE_MODES, V as CountryCode, X as OrgId, Y as Money, Z as PartyId, _ as Session, _t as CapxulErrorCode, a as Eip1193RequestProvider, at as RoleKey, c as injectedWalletSigner, ct as TesterKind, d as AccountRequirement, dt as toAddress, et as PayrollRunId, f as Eip1193Provider, ft as toCountryCode, g as Profile, gt as CapxulError, h as CapxulResult, ht as CAPXUL_ERROR_CODES, i as CapxulSigner, k as Address, l as AccountProvider, m as localPrivateKeyAccountProvider, mt as toPartyId, o as SignerStatus, p as eip1193AccountProvider, pt as toHandle, r as CapxulDigestSigner, s as SignerStatusStore, u as AccountProviderSource, v as SmartAccount, vt as CapxulErrorDetails, wt as ChainUpstream, xt as isCapxulError, yt as Errors, z as BudgetId } from "./OAuthBearerAuthClient-C-ip-z8M.mjs";
2
- import { $ as OrganizationPaymentBatchInput, $n as RequestStatus, $t as Destination, A as OrgScopedMethods, An as Ref, At as AddressBookAddInput, B as AuthorizeRunOptions, Bn as SmartAccountMethods, Bt as ActivityFilter, C as CurrentUserMethods, Cn as PaymentMoney, Ct as AccountMethods, D as MemberStatus, Dn as PaymentsMethods, Dt as ActorRequest, E as InviteMemberInput, En as PaymentType, Et as ActorRelationshipMethods, F as ResendInviteTokenInput, Fn as AccountLifecycle, Ft as InboxItem, G as PayrollGroupsMethods, Gn as ActorRef, Gt as ActivityPage, H as PayrollGroup, Hn as OrgLifecycle, Ht as ActivityKind, I as RoleDefinition, In as AccountSetupStep, It as InboxMethods, J as PayrollRun, Jn as SubmittedPermissionExecution, Jt as ActivitySummary, K as PayrollMethods, Kn as CurrentHoldings, Kt as ActivityRange, L as RoleSpendCap, Ln as isSettingUpLifecycle, Lt as ActivityAnnotation, M as OrgView, Mn as TargetReference, Mt as AddressBookLabelInput, N as OrganizationAccount, Nn as TargetsMethods, Nt as AddressBookMethods, O as MemberView, On as PaymentsPayInput, Ot as ActorRequestIssueInput, P as OrganizationAuditLogItem, Pn as fingerprintPaymentIntent, Pt as InboxApproveInput, Q as PayrollTermsUnit, Qn as PaymentStatus$1, Qt as DepositInstructions, R as RoleView, Rn as CompleteProfileInput, Rt as ActivityAnnotationInput, S as CurrentUserContext, Sn as PaymentDocumentsMethods, St as ReadyAccountLifecycle, T as DetectPendingOrgInvitationsResult, Tn as PaymentTiming, Tt as ActorProfileMethods, U as PayrollGroupInput, Un as OrgSetupStep, Ut as ActivityListParams, V as PayrollEngagementTerms, Vn as AuthMethods, Vt as ActivityItem, W as PayrollGroupMember, Wn as PayoutAddress, Wt as ActivityMethods, X as PayrollRunStatus, Xn as PAYMENT_DIRECTIONS, Xt as ActivitySummaryTotal, Y as PayrollRunItemInput, Yn as InboxStatus, Yt as ActivitySummaryParams, Z as PayrollRuns, Zn as PAYMENT_STATUSES, Zt as ActorReference, _ as HoldingsMethods, _n as PaymentDirection, _t as OnboardingMethods, a as ObservationContext, an as DestinationRemoveInput, ar as IdentityEvent, at as PermissionCreateInput, b as SystemHealth, bn as PaymentDocumentRender, bt as PersonOnboarding, c as HostObservability, cn as MeMethods, cr as Readiness, ct as PermissionReplaceInput, d as postHogObservability, dn as OfframpMethods, dr as isClaimed, dt as Budget, en as DestinationAddInput, et as OrganizationPaymentInput, f as CapxulClient, fn as OfframpQuote, fr as isRestoring, ft as OrgMe, g as IdentityRuntimeSendResult, gn as PaymentActivityEvidence, gt as CompletedPersonProfile, h as IdentityRuntime, hn as Payment, ht as AccountsMethods, i as ObservationAdapter, in as DestinationRail, ir as Destination$1, it as PermissionChangeInput, j as OrgTemplate, jn as ResolvedTarget, jt as AddressBookEntry, k as OrgMethods, kn as RecipientResolution, kt as ActorRequestsMethods, l as PostHogObservabilityClient, ln as MeProfile, lr as StateLabel, lt as PermissionRevokeInput, m as IdentityProfileDetails, mn as OfframpStatus, mr as InvocationControls, mt as OrgMeOptions, nn as DestinationListInput, nt as OrganizationPaymentsMethods, o as ObservationDelivery, on as DestinationsMethods, or as IdentityState, ot as PermissionMethods, p as CreateCapxulClientInput, pn as OfframpQuoteInput, pr as IdentityTransition, pt as OrgMeMethod, q as PayrollOptions, qn as Permission, qt as ActivityReference, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, rn as DestinationPayload, rr as TelemetryPort, rt as PermissionAssignInput, s as SdkFailureObservation, sn as FinancialOpsMethods, sr as OrgLane, st as PermissionOptions, t as CapxulClientInput, tn as DestinationKind, tt as OrganizationPaymentItemInput, u as PostHogObservabilityOptions, un as MovementActivityEvidence, ur as destination, ut as PermissionReadResult, v as Holding, vn as PaymentDocumentKind, vt as OrganizationOnboarding, w as CreateOrgInput, wn as PaymentStatus, wt as ActorProfile, x as MediaMethods, xn as PaymentDocumentVerification, xt as PersonOnboardingInput, y as SystemMethods, yn as PaymentDocumentRef, yt as OrganizationOnboardingInput, z as AuthorizeRunInput, zn as IdentityMethods, zt as ActivityDetail } from "./production-B8BQj9l0.mjs";
2
+ import { $ as OrganizationPaymentBatchInput, $n as RequestStatus, $t as Destination, A as OrgScopedMethods, An as Ref, At as AddressBookAddInput, B as AuthorizeRunOptions, Bn as SmartAccountMethods, Bt as ActivityFilter, C as CurrentUserMethods, Cn as PaymentMoney, Ct as AccountMethods, D as MemberStatus, Dn as PaymentsMethods, Dt as ActorRequest, E as InviteMemberInput, En as PaymentType, Et as ActorRelationshipMethods, F as ResendInviteTokenInput, Fn as AccountLifecycle, Ft as InboxItem, G as PayrollGroupsMethods, Gn as ActorRef, Gt as ActivityPage, H as PayrollGroup, Hn as OrgLifecycle, Ht as ActivityKind, I as RoleDefinition, In as AccountSetupStep, It as InboxMethods, J as PayrollRun, Jn as SubmittedPermissionExecution, Jt as ActivitySummary, K as PayrollMethods, Kn as CurrentHoldings, Kt as ActivityRange, L as RoleSpendCap, Ln as isSettingUpLifecycle, Lt as ActivityAnnotation, M as OrgView, Mn as TargetReference, Mt as AddressBookLabelInput, N as OrganizationAccount, Nn as TargetsMethods, Nt as AddressBookMethods, O as MemberView, On as PaymentsPayInput, Ot as ActorRequestIssueInput, P as OrganizationAuditLogItem, Pn as fingerprintPaymentIntent, Pt as InboxApproveInput, Q as PayrollTermsUnit, Qn as PaymentStatus$1, Qt as DepositInstructions, R as RoleView, Rn as CompleteProfileInput, Rt as ActivityAnnotationInput, S as CurrentUserContext, Sn as PaymentDocumentsMethods, St as ReadyAccountLifecycle, T as DetectPendingOrgInvitationsResult, Tn as PaymentTiming, Tt as ActorProfileMethods, U as PayrollGroupInput, Un as OrgSetupStep, Ut as ActivityListParams, V as PayrollEngagementTerms, Vn as AuthMethods, Vt as ActivityItem, W as PayrollGroupMember, Wn as PayoutAddress, Wt as ActivityMethods, X as PayrollRunStatus, Xn as PAYMENT_DIRECTIONS, Xt as ActivitySummaryTotal, Y as PayrollRunItemInput, Yn as InboxStatus, Yt as ActivitySummaryParams, Z as PayrollRuns, Zn as PAYMENT_STATUSES, Zt as ActorReference, _ as HoldingsMethods, _n as PaymentDirection, _t as OnboardingMethods, a as ObservationContext, an as DestinationRemoveInput, ar as IdentityEvent, at as PermissionCreateInput, b as SystemHealth, bn as PaymentDocumentRender, bt as PersonOnboarding, c as HostObservability, cn as MeMethods, cr as Readiness, ct as PermissionReplaceInput, d as postHogObservability, dn as OfframpMethods, dr as isClaimed, dt as Budget, en as DestinationAddInput, et as OrganizationPaymentInput, f as CapxulClient, fn as OfframpQuote, fr as isRestoring, ft as OrgMe, g as IdentityRuntimeSendResult, gn as PaymentActivityEvidence, gt as CompletedPersonProfile, h as IdentityRuntime, hn as Payment, ht as AccountsMethods, i as ObservationAdapter, in as DestinationRail, ir as Destination$1, it as PermissionChangeInput, j as OrgTemplate, jn as ResolvedTarget, jt as AddressBookEntry, k as OrgMethods, kn as RecipientResolution, kt as ActorRequestsMethods, l as PostHogObservabilityClient, ln as MeProfile, lr as StateLabel, lt as PermissionRevokeInput, m as IdentityProfileDetails, mn as OfframpStatus, mr as InvocationControls, mt as OrgMeOptions, nn as DestinationListInput, nt as OrganizationPaymentsMethods, o as ObservationDelivery, on as DestinationsMethods, or as IdentityState, ot as PermissionMethods, p as CreateCapxulClientInput, pn as OfframpQuoteInput, pr as IdentityTransition, pt as OrgMeMethod, q as PayrollOptions, qn as Permission, qt as ActivityReference, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, rn as DestinationPayload, rr as TelemetryPort, rt as PermissionAssignInput, s as SdkFailureObservation, sn as FinancialOpsMethods, sr as OrgLane, st as PermissionOptions, t as CapxulClientInput, tn as DestinationKind, tt as OrganizationPaymentItemInput, u as PostHogObservabilityOptions, un as MovementActivityEvidence, ur as destination, ut as PermissionReadResult, v as Holding, vn as PaymentDocumentKind, vt as OrganizationOnboarding, w as CreateOrgInput, wn as PaymentStatus, wt as ActorProfile, x as MediaMethods, xn as PaymentDocumentVerification, xt as PersonOnboardingInput, y as SystemMethods, yn as PaymentDocumentRef, yt as OrganizationOnboardingInput, z as AuthorizeRunInput, zn as IdentityMethods, zt as ActivityDetail } from "./production-Dkp_cJ5N.mjs";
3
3
  import { Hex } from "viem";
4
4
  import { Effect, Layer } from "effect";
5
5
  //#region ../errors/src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { A as signerFailure, B as isRestoring, C as normalizeExceptionErrorKind, E as safeExceptionLabel, F as CAPXUL_OPERATIONS, I as isCapxulOperation, L as normalizeCapxulOperation, M as PAYMENT_DIRECTIONS, N as PAYMENT_STATUSES, O as isSettingUpLifecycle, R as destination, S as SDK_VERSION, T as projectSdkException, _ as fingerprintPaymentIntent, b as failureDetail, d as embeddedSigner, f as openfortEmbeddedSigner, g as devPrivateKeySigner, h as deriveDevPrivateKey, j as resolveFailureMode, k as injectedWalletSigner, m as openfortEmbeddedWalletPort, p as openfortEmbeddedSignerFromWallet, r as postHogObservability, t as createCapxulClient$1, w as normalizeExceptionOperation, x as EXCEPTION_MESSAGE, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as isClaimed } from "./production-Mcv2kEAX.mjs";
2
- import { L as toCountryCode, O as assetIdFor, R as toCurrencyCode, U as toHandle, ct as CHAIN_UPSTREAMS, h as CAPXUL_PAYMENTS_V2_ADDRESS, it as CapxulError, j as toAddress, k as currencySymbolFor, lt as FAILURE_MODES, ot as Errors, q as toPartyId, rt as CAPXUL_ERROR_CODES, st as isCapxulError, tt as HANDLE_RE, w as EVM_ADDRESS_RE, y as configuredMoneyAssetById } from "./OAuthBearerAuthClient-BrbXrndM.mjs";
1
+ import { A as signerFailure, B as isRestoring, C as normalizeExceptionErrorKind, E as safeExceptionLabel, F as CAPXUL_OPERATIONS, I as isCapxulOperation, L as normalizeCapxulOperation, M as PAYMENT_DIRECTIONS, N as PAYMENT_STATUSES, O as isSettingUpLifecycle, R as destination, S as SDK_VERSION, T as projectSdkException, _ as fingerprintPaymentIntent, b as failureDetail, d as embeddedSigner, f as openfortEmbeddedSigner, g as devPrivateKeySigner, h as deriveDevPrivateKey, j as resolveFailureMode, k as injectedWalletSigner, m as openfortEmbeddedWalletPort, p as openfortEmbeddedSignerFromWallet, r as postHogObservability, t as createCapxulClient$1, w as normalizeExceptionOperation, x as EXCEPTION_MESSAGE, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as isClaimed } from "./production-XxSdhlsI.mjs";
2
+ import { A as currencySymbolFor, J as toPartyId, M as toAddress, R as toCountryCode, T as EVM_ADDRESS_RE, W as toHandle, at as CapxulError, b as configuredMoneyAssetById, ct as isCapxulError, g as CAPXUL_PAYMENTS_V2_ADDRESS, it as CAPXUL_ERROR_CODES, k as assetIdFor, lt as CHAIN_UPSTREAMS, nt as HANDLE_RE, st as Errors, ut as FAILURE_MODES, z as toCurrencyCode } from "./OAuthBearerAuthClient-hPwtSpEf.mjs";
3
3
  import { formatUnits } from "viem";
4
4
  import { Effect } from "effect";
5
5
  import { privateKeyToAccount } from "viem/accounts";
@@ -1,4 +1,4 @@
1
- import { a as parseAuthSession, c as AuthCachePortTag, i as BrowserAuthCacheAdapter, j as toAddress, o as parseCachedJwt, r as InMemoryAuthCacheAdapter, s as AuthCacheError, t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-BrbXrndM.mjs";
1
+ import { M as toAddress, a as parseAuthSession, c as AuthCachePortTag, i as BrowserAuthCacheAdapter, o as parseCachedJwt, r as InMemoryAuthCacheAdapter, s as AuthCacheError, t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-hPwtSpEf.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";
@@ -1959,6 +1959,7 @@ type ResendOrgInviteTokenInput = {
1959
1959
  readonly email: string;
1960
1960
  };
1961
1961
  type DetectPendingOrgInvitationsInput = Record<never, never>;
1962
+ type PendingOrgSetupInput = Record<never, never>;
1962
1963
  type DetectPendingOrgInvitationsResult$1 = {
1963
1964
  readonly matched: readonly OrgId[];
1964
1965
  };
@@ -1980,6 +1981,15 @@ interface OrgPort {
1980
1981
  listRoles(input: ListOrgRolesInput): Effect.Effect<readonly RoleView[], OrgError, never>;
1981
1982
  listMembers(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
1982
1983
  pendingMembers?(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
1984
+ /**
1985
+ * The caller's own Organization whose setup has not finished, or `null`.
1986
+ * Optional: only the Convex read adapter answers it. The client's attach
1987
+ * subscriber starts nothing without it, exactly as a signerless client
1988
+ * starts no readiness cycle.
1989
+ */
1990
+ pendingSetup?(input: PendingOrgSetupInput): Effect.Effect<{
1991
+ readonly orgId: OrgId;
1992
+ } | null, OrgError, never>;
1983
1993
  inviteMember(input: InviteOrgMemberInput): Effect.Effect<MemberView, OrgError, never>;
1984
1994
  resendInviteToken?(input: ResendOrgInviteTokenInput): Effect.Effect<MemberView, OrgError, never>;
1985
1995
  detectAndAcceptPendingInvitations(input: DetectPendingOrgInvitationsInput): Effect.Effect<DetectPendingOrgInvitationsResult$1, OrgError, never>;
@@ -1,4 +1,4 @@
1
- import { $ as toTesterKind, A as toAccountId, B as toEmail, C as BYTES32_RE, D as ZERO_BYTES32, E as WEI_RE, F as toBudgetId, G as toKycTier, H as toEpochSeconds, I as toChainId, J as toPayrollGroupId, K as toOrgId, L as toCountryCode, M as toAllowedOrigin, P as toAuthUserId, Q as toSessionToken, R as toCurrencyCode, S as ASSET_ID_RE, T as SUPPORTED_CURRENCY_CODES, U as toHandle, V as toEpochMs, W as toJwtToken, X as toPublishableKey, Y as toPayrollRunId, Z as toRoleKey, _ as BASE_SEPOLIA_CHAIN_ID, _t as revertSummaryText, at as EXPECTED_OPERATION_OUTCOMES, b as ACCOUNT_ID_RE, bt as redactSecrets, c as AuthCachePortTag, ct as CHAIN_UPSTREAMS, d as authClientPortFromPromiseAdapter, dt as chainCauseProperties, et as validateHandle, f as AuthClientError, ft as chainEvidenceLabel, g as normalizeBindingEmail, gt as isFailureMode, ht as isChainUpstream, i as BrowserAuthCacheAdapter, it as CapxulError, j as toAddress, l as SystemClockLayer, lt as FAILURE_MODES$1, m as orgRoleKeyForLabel, mt as failureFingerprint, nt as decodeConvexError, ot as Errors, p as AuthClientPortTag, pt as decodeChainCause, q as toPartyId, r as InMemoryAuthCacheAdapter, rt as CAPXUL_ERROR_CODES, st as isCapxulError, u as ClockPortTag, ut as boundedResponseHeaders, v as deriveCapxulSafeAddress, vt as containsSensitiveMaterial, w as EVM_ADDRESS_RE$1, x as APP_ID_RE, xt as redactUrlSecrets, yt as isCredentialField, z as toDurationMs } from "./OAuthBearerAuthClient-BrbXrndM.mjs";
1
+ import { $ as toSessionToken, B as toDurationMs, C as ASSET_ID_RE, D as WEI_RE, E as SUPPORTED_CURRENCY_CODES, F as toAuthUserId, G as toJwtToken, H as toEpochMs, I as toBudgetId, J as toPartyId, K as toKycTier, L as toChainId, M as toAddress, N as toAllowedOrigin, O as ZERO_BYTES32, Q as toRoleKey, R as toCountryCode, S as APP_ID_RE, St as redactUrlSecrets, T as EVM_ADDRESS_RE$1, U as toEpochSeconds, V as toEmail, W as toHandle, X as toPayrollRunId, Y as toPayrollGroupId, Z as toPublishableKey, _ as normalizeBindingEmail, _t as isFailureMode, at as CapxulError, bt as isCredentialField, c as AuthCachePortTag, ct as isCapxulError, d as authClientPortFromPromiseAdapter, dt as boundedResponseHeaders, et as toTesterKind, f as AuthClientError, ft as chainCauseProperties, gt as isChainUpstream, h as orgRoleKeyForLabel, ht as failureFingerprint, i as BrowserAuthCacheAdapter, it as CAPXUL_ERROR_CODES, j as toAccountId, l as SystemClockLayer, lt as CHAIN_UPSTREAMS, m as ADMIN_ROLE_LABEL, mt as decodeChainCause, ot as EXPECTED_OPERATION_OUTCOMES, p as AuthClientPortTag, pt as chainEvidenceLabel, q as toOrgId, r as InMemoryAuthCacheAdapter, rt as decodeConvexError, st as Errors, tt as validateHandle, u as ClockPortTag, ut as FAILURE_MODES$1, v as BASE_SEPOLIA_CHAIN_ID, vt as revertSummaryText, w as BYTES32_RE, x as ACCOUNT_ID_RE, xt as redactSecrets, y as deriveCapxulSafeAddress, yt as containsSensitiveMaterial, z as toCurrencyCode } from "./OAuthBearerAuthClient-hPwtSpEf.mjs";
2
2
  import { formatUnits, keccak256, parseUnits, recoverAddress, stringToHex, toBytes } from "viem";
3
3
  import { Cause, Clock, Context, Data, Deferred, Duration, Effect, Exit, Fiber, FiberSet, Layer, Option, Queue, Ref, Result, Schedule, Schema, SchemaGetter, SchemaIssue, SchemaParser, Scope, Stream, Tracer } from "effect";
4
4
  import { getFunctionName, makeFunctionReference } from "convex/server";
@@ -2334,7 +2334,8 @@ const CAPXUL_FUNCTIONS = {
2334
2334
  listMine: "org/queries:listMine",
2335
2335
  listRolesByOrgId: "org/queries:listRolesByOrgId",
2336
2336
  loadByOrgId: "org/queries:loadByOrgId",
2337
- me: "org/queries:me"
2337
+ me: "org/queries:me",
2338
+ pendingSetup: "org/queries:pendingSetup"
2338
2339
  },
2339
2340
  "smartAccount/actions": {
2340
2341
  claim: "smartAccount/actions:claim",
@@ -5656,7 +5657,7 @@ const moneyExecutionContract = {
5656
5657
  };
5657
5658
  //#endregion
5658
5659
  //#region package.json
5659
- var version = "4.2.0-rc.4";
5660
+ var version = "4.2.0-rc.6";
5660
5661
  //#endregion
5661
5662
  //#region src/telemetry/exception-projection.ts
5662
5663
  /** Fixed fallback for failures that have no safe message. */
@@ -8085,7 +8086,8 @@ var BetterAuthBrowserAdapter = class {
8085
8086
  try {
8086
8087
  const res = await this.fetchImpl(this.url("/api/auth/get-session"), withSignal$1({
8087
8088
  method: "GET",
8088
- credentials: "include"
8089
+ credentials: "include",
8090
+ cache: "no-store"
8089
8091
  }, options?.signal));
8090
8092
  if (options?.signal?.aborted) return {
8091
8093
  ok: false,
@@ -8157,7 +8159,8 @@ var BetterAuthBrowserAdapter = class {
8157
8159
  try {
8158
8160
  const res = await this.fetchImpl(this.url("/api/auth/convex/token"), withSignal$1({
8159
8161
  method: "GET",
8160
- credentials: "include"
8162
+ credentials: "include",
8163
+ cache: "no-store"
8161
8164
  }, options?.signal));
8162
8165
  if (options?.signal?.aborted) return {
8163
8166
  ok: false,
@@ -9653,6 +9656,7 @@ function orgIdBody(orgId) {
9653
9656
  //#region src/adapters/org/ConvexOrganizationAdapter.ts
9654
9657
  const DEFAULT_FUNCTIONS$1 = {
9655
9658
  listAll: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listAll),
9659
+ pendingSetup: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].pendingSetup),
9656
9660
  listRoles: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listRolesByOrgId),
9657
9661
  listMembers: makeFunctionReference(CAPXUL_FUNCTIONS["org/queries"].listMembersByOrgId),
9658
9662
  readTreasury: makeFunctionReference(CAPXUL_FUNCTIONS["org/actions"].readTreasury),
@@ -9688,6 +9692,9 @@ var ConvexOrganizationAdapter = class {
9688
9692
  return brandOrgView(wire, treasury, viewerRole);
9689
9693
  })))), Effect.catchDefect((cause) => Effect.fail(toOrgError("listOrgs", cause))));
9690
9694
  }
9695
+ pendingSetup(input) {
9696
+ return this.#convex.query(this.#fns.pendingSetup, copyInvocationObservation(input, {})).pipe(Effect.mapError((error) => orgErrorFromCapxul("pendingSetup", error.publicError, error)), Effect.map((wire) => wire === null ? null : { orgId: toOrgId(wire.orgId) }), Effect.catchDefect((cause) => Effect.fail(toOrgError("pendingSetup", cause))));
9697
+ }
9691
9698
  readTreasury(input) {
9692
9699
  return this.#readTreasuryWire(input).pipe(Effect.catchDefect((cause) => Effect.fail(toOrgError("readTreasury", cause))));
9693
9700
  }
@@ -10286,7 +10293,10 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
10286
10293
  tokenCalls += 1;
10287
10294
  const tokenStartedAt = Date.now();
10288
10295
  try {
10289
- const response = await fetch(betterAuthSessionUrl(), { credentials: "include" });
10296
+ const response = await fetch(betterAuthSessionUrl(), {
10297
+ credentials: "include",
10298
+ cache: "no-store"
10299
+ });
10290
10300
  if (!response.ok) {
10291
10301
  diagnostic?.trace("openfort.token", {
10292
10302
  ok: false,
@@ -12722,7 +12732,7 @@ function hermeticOrgView(input) {
12722
12732
  name: input.name,
12723
12733
  handle: input.handle,
12724
12734
  safeAddress: toAddress(placeholder),
12725
- role: "Owner",
12735
+ role: ADMIN_ROLE_LABEL,
12726
12736
  treasury: zeroTreasury(orgId),
12727
12737
  bio: null,
12728
12738
  size: null,
@@ -13410,6 +13420,43 @@ function startSignerReadinessOnClaim(actor, signer) {
13410
13420
  browserSigner.ensureWalletReady?.().catch(() => {});
13411
13421
  });
13412
13422
  }
13423
+ /**
13424
+ * Attach a pending Organization when the identity becomes claimed.
13425
+ *
13426
+ * A reload during Organization setup used to leave the app re-submitting the
13427
+ * stored draft, and that second submission raced the controller's resume on
13428
+ * `ReadSession` — the loser was refused with `SUPERSEDED`. The backend already
13429
+ * knows the truth: `pendingSetup()` reports the owner's Organization whose
13430
+ * setup has not finished. The SDK asks once per authenticated user and sends
13431
+ * `AttachOrganization`, which the identity flow runs as `orgLane(…, attach)`.
13432
+ * The app then re-submits nothing.
13433
+ *
13434
+ * The read is fire-and-forget, as the signer readiness cycle is: a failure is
13435
+ * swallowed and the ask is released, so the next state change retries. The ask
13436
+ * is held to ONE per authUserId, so the claimed transitions that follow (the
13437
+ * org lane's own) start no second read, and a new session asks again.
13438
+ */
13439
+ function attachPendingOrganizationOnClaim(actor, organizationPort) {
13440
+ const pendingSetup = organizationPort?.pendingSetup?.bind(organizationPort);
13441
+ if (pendingSetup === void 0) return () => {};
13442
+ let askedFor = null;
13443
+ return actor.subscribe((state) => {
13444
+ if (state.phase !== "authenticated" || state.account.at !== "claimed") return;
13445
+ if (state.account.org !== null) return;
13446
+ const authUserId = state.session.authUserId;
13447
+ if (askedFor === authUserId) return;
13448
+ askedFor = authUserId;
13449
+ Effect.runPromise(pendingSetup({})).then((pending) => {
13450
+ if (pending === null) return;
13451
+ return Effect.runPromise(actor.ask({
13452
+ _tag: "AttachOrganization",
13453
+ orgId: String(pending.orgId)
13454
+ }));
13455
+ }).catch(() => {
13456
+ askedFor = null;
13457
+ });
13458
+ });
13459
+ }
13413
13460
  function assembleCapxulClient(input) {
13414
13461
  const observation = input;
13415
13462
  const authCache = input.authCache ?? detectAuthCacheAdapter();
@@ -13439,18 +13486,20 @@ function assembleCapxulClient(input) {
13439
13486
  }, failureObservation, normalizeCapxulOperation(`identity.${record.event}`), "machine");
13440
13487
  });
13441
13488
  const unsubscribeSignerReadiness = startSignerReadinessOnClaim(actor, input.signer);
13489
+ const selectedOrgPort = input.orgPort ?? input.orgDeploymentPort;
13490
+ const unsubscribePendingOrganization = attachPendingOrganizationOnClaim(actor, selectedOrgPort);
13442
13491
  let stopPromise = null;
13443
13492
  const stopActor = () => {
13444
13493
  if (stopPromise === null) {
13445
13494
  unsubscribeProductTelemetry();
13446
13495
  unsubscribeFailureObservation();
13447
13496
  unsubscribeSignerReadiness();
13497
+ unsubscribePendingOrganization();
13448
13498
  stopPromise = effectRunner.runPromise(Scope.close(scope, Exit.void));
13449
13499
  }
13450
13500
  return stopPromise;
13451
13501
  };
13452
13502
  if (input.signal !== void 0) input.signal.addEventListener("abort", () => void stopActor(), { once: true });
13453
- const selectedOrgPort = input.orgPort ?? input.orgDeploymentPort;
13454
13503
  let detectPendingOrgInvitations;
13455
13504
  let kickProvisioning;
13456
13505
  const financialOps = makeFinancialOpsMethods({
@@ -1,5 +1,5 @@
1
1
  import { h as CapxulResult } from "../OAuthBearerAuthClient-C-ip-z8M.mjs";
2
- import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-B8BQj9l0.mjs";
2
+ import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-Dkp_cJ5N.mjs";
3
3
  import { Effect, Layer } from "effect";
4
4
  //#region src/testing/production-client.d.ts
5
5
  /** Create the one production client with per-client controls at its signing boundaries. */
@@ -1,5 +1,5 @@
1
- import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-Mcv2kEAX.mjs";
2
- import { A as toAccountId, B as toEmail, G as toKycTier, H as toEpochSeconds, I as toChainId, L as toCountryCode, M as toAllowedOrigin, N as toAppId, P as toAuthUserId, Q as toSessionToken, U as toHandle, V as toEpochMs, W as toJwtToken, X as toPublishableKey, d as authClientPortFromPromiseAdapter, et as validateHandle, it as CapxulError, j as toAddress, n as readClockNow, ot as Errors, r as InMemoryAuthCacheAdapter, v as deriveCapxulSafeAddress, z as toDurationMs } from "../OAuthBearerAuthClient-BrbXrndM.mjs";
1
+ import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-XxSdhlsI.mjs";
2
+ import { $ as toSessionToken, B as toDurationMs, F as toAuthUserId, G as toJwtToken, H as toEpochMs, K as toKycTier, L as toChainId, M as toAddress, N as toAllowedOrigin, P as toAppId, R as toCountryCode, U as toEpochSeconds, V as toEmail, W as toHandle, Z as toPublishableKey, at as CapxulError, d as authClientPortFromPromiseAdapter, j as toAccountId, n as readClockNow, r as InMemoryAuthCacheAdapter, st as Errors, tt as validateHandle, y as deriveCapxulSafeAddress } from "../OAuthBearerAuthClient-hPwtSpEf.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": "4.2.0-rc.4",
3
+ "version": "4.2.0-rc.6",
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/observability": "4.2.0-rc.4",
51
50
  "@capxul/config": "0.3.0",
52
51
  "@capxul/errors": "0.3.0",
52
+ "@capxul/observability": "4.2.0-rc.6",
53
53
  "@capxul/types": "0.3.0",
54
- "@capxul/wire": "0.7.0",
55
- "@capxul/typescript-config": "0.0.0"
54
+ "@capxul/typescript-config": "0.0.0",
55
+ "@capxul/wire": "0.7.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": {