@capxul/sdk 4.20.0-beta.4 → 4.20.0-beta.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.
@@ -1,4 +1,4 @@
1
- import { $ as PayrollGroupId, A as AllowanceKey, B as ChainId, C as AuthCachePort, D as Account$1, Et as FailureMode, F as AssetId, H as CurrencyCode, I as AuthSession, K as Email, L as AuthUserId, M as AnonymousDistinctId, N as AppId, Q as PaymentCommandId, R as BlockNumber, U as DocumentHash, V as CountryCode, W as DurationMs, X as OrgId, Y as Money, Z as PartyId, _ as Session$1, _t as CapxulErrorCode, at as RoleKey, b as AuthClientPort, bt as Failure, ct as TesterKind, d as AccountRequirement, et as PayrollRunId, g as Profile$1, gt as CapxulError, h as CapxulResult, i as CapxulSigner, it as PublishableKey, j as AllowedOrigin, k as Address$1, lt as TxHash, nt as PermissionId, ot as SessionToken, q as EpochMs, rt as Profile, s as SignerStatusStore, st as SmartAccount, tt as PermissionAssignmentId, u as AccountProviderSource, ut as WeiAmount, v as SmartAccount$1, vt as CapxulErrorDetails, x as CanSendOtpStatus, y as ClockPort, z as BudgetId } from "./OAuthBearerAuthClient-C-ip-z8M.mjs";
1
+ import { $ as OrgId, A as Address$1, B as BudgetId, C as AuthCachePort, Ct as CapxulErrorDetails, D as Account$1, F as AssetAmount, G as CurrencyCode, H as ClientGrantId, I as AssetId, K as DocumentHash, L as AuthSession, M as AllowedOrigin, N as AnonymousDistinctId, O as AccountId, P as AppId, R as AuthUserId, St as CapxulErrorCode, Tt as Failure, U as ClientRequestId, V as ChainId, W as CountryCode, X as EpochMs, Y as Email, Z as Handle, _ as Session$1, at as PermissionId, b as AuthClientPort, ct as RoleKey, d as AccountRequirement, dt as TesterKind, et as PartyId, ft as TxHash, g as Profile$1, h as CapxulResult, i as CapxulSigner, it as PermissionAssignmentId, j as AllowanceKey, jt as FailureMode, k as AccountPosition, lt as SessionToken, nt as PayrollGroupId, ot as Profile, pt as WeiAmount, q as DurationMs, rt as PayrollRunId, s as SignerStatusStore, st as PublishableKey, tt as PaymentCommandId, u as AccountProviderSource, ut as SmartAccount, v as SmartAccount$1, x as CanSendOtpStatus, xt as CapxulError, y as ClockPort, z as BlockNumber } from "./OAuthBearerAuthClient-B7Nbepmu.mjs";
2
2
  import { Hex } from "viem";
3
3
  import { Context, Duration, Effect, Layer, Logger, Metric, References, Schema, Scope, Tracer } from "effect";
4
4
  import { FunctionReference } from "convex/server";
@@ -191,6 +191,11 @@ type IdentityEvent = {
191
191
  readonly _tag: "RestoreSession";
192
192
  readonly session: Session;
193
193
  readonly profileComplete: boolean;
194
+ } | {
195
+ readonly _tag: "RestoreOtpEntry";
196
+ readonly email: string;
197
+ readonly requestedAt: number;
198
+ readonly now: number;
194
199
  } | {
195
200
  readonly _tag: "ResumeOtpEntry";
196
201
  readonly now: number;
@@ -286,7 +291,7 @@ interface TelemetryPort {
286
291
  }
287
292
  //#endregion
288
293
  //#region ../observability/src/index.d.ts
289
- declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "identity_refused", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "payment_lifecycle_transition", "quick_pay_external_address_acknowledged", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident", "indexer_drift_corrected", "activity_annotation_saved", "ui_activity_action_completed", "contact_relationship_changed", "ui_contact_action_completed", "access_recovery_completed", "ui_access_step_completed", "org_invite_progressed", "invoice_issued", "invoice_request_transitioned", "ui_invoice_step_completed", "ui_treasury_step_completed", "ui_receive_step_completed", "payroll_group_changed", "payroll_run_transitioned", "ui_payroll_action_completed", "cli_diagnostic_completed", "cli_first_used", "cli_command_started", "cli_command_completed"];
294
+ declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "identity_refused", "auth_signed_out", "native_authorization_started", "native_authorization_reviewed", "native_authorization_accepted", "native_authorization_denied", "native_authorization_connected", "native_authorization_failed", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "payment_lifecycle_transition", "quick_pay_external_address_acknowledged", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident", "indexer_drift_corrected", "activity_annotation_saved", "ui_activity_action_completed", "contact_relationship_changed", "ui_contact_action_completed", "access_recovery_completed", "ui_access_step_completed", "org_invite_progressed", "invoice_issued", "invoice_request_transitioned", "ui_invoice_step_completed", "ui_treasury_step_completed", "ui_receive_step_completed", "payroll_group_changed", "payroll_run_transitioned", "ui_payroll_action_completed", "cli_diagnostic_completed", "cli_first_used", "cli_command_started", "cli_command_completed"];
290
295
  type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
291
296
  type TelemetryProps = Record<string, unknown>;
292
297
  type TelemetryEvent = {
@@ -347,9 +352,6 @@ type PaymentDirection$1 = (typeof PAYMENT_DIRECTIONS)[number];
347
352
  /** What a payment is FOR. Pairs with `PAYMENT_DOCUMENT_KINDS`. */
348
353
  declare const PAYMENT_TYPES: readonly ["unspecified", "invoice", "payroll", "reimbursement"];
349
354
  type PaymentType$1 = (typeof PAYMENT_TYPES)[number];
350
- /** Attachable document kinds; each maps to exactly one `PaymentType`. */
351
- declare const PAYMENT_DOCUMENT_KINDS: readonly ["memo", "invoice", "payslip", "receipt", "withdrawal"];
352
- type PaymentDocumentKind$1 = (typeof PAYMENT_DOCUMENT_KINDS)[number];
353
355
  /** Lifecycle of a payment REQUEST as its issuer sees it. */
354
356
  declare const REQUEST_STATUSES: readonly ["draft", "sent", "viewed", "pending_settlement", "paid", "declined", "cancelled", "expired"];
355
357
  type RequestStatus = (typeof REQUEST_STATUSES)[number];
@@ -469,7 +471,9 @@ declare const PermissionSchema: Schema.Struct<{
469
471
  readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
470
472
  readonly revision: Schema.refine<number, Schema.Number>;
471
473
  readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
474
+ readonly assetId: Schema.optional<Schema.refine<AssetId, Schema.String>>;
472
475
  readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
476
+ readonly decimals: Schema.optional<Schema.refine<number, Schema.Number>>;
473
477
  readonly limitRaw: Schema.optional<Schema.Codec<WeiAmount, string, never, never>>;
474
478
  readonly allowanceKey: Schema.optional<Schema.Codec<AllowanceKey, string, never, never>>;
475
479
  }>;
@@ -520,14 +524,25 @@ declare const PaymentCommandLineageSchema: Schema.Union<readonly [Schema.Struct<
520
524
  readonly requestId: Schema.refine<string, Schema.String>;
521
525
  }>]>;
522
526
  type PaymentCommandLineage = Schema.Schema.Type<typeof PaymentCommandLineageSchema>;
523
- declare const PermissionIntentSchema: Schema.Union<readonly [Schema.Struct<{
527
+ declare const PermissionIntentSchema: Schema.Union<readonly [Schema.refine<{
528
+ readonly type: "budget";
529
+ readonly asset: AssetId;
530
+ readonly limit: {
531
+ readonly asset: AssetId;
532
+ readonly value: string;
533
+ readonly currency?: undefined;
534
+ readonly decimals?: undefined;
535
+ } | null;
536
+ }, Schema.Struct<{
524
537
  readonly type: Schema.Literal<"budget">;
525
- readonly limit: Schema.Struct<{
526
- readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
538
+ readonly asset: Schema.refine<AssetId, Schema.String>;
539
+ readonly limit: Schema.NullOr<Schema.Struct<{
540
+ readonly asset: Schema.refine<AssetId, Schema.String>;
527
541
  readonly value: Schema.String;
528
- readonly decimals: Schema.Number;
529
- }>;
530
- }>, Schema.Struct<{
542
+ readonly currency: Schema.optional<Schema.Never>;
543
+ readonly decimals: Schema.optional<Schema.Never>;
544
+ }>>;
545
+ }>>, Schema.Struct<{
531
546
  readonly type: Schema.Literal<"managePeople">;
532
547
  }>]>;
533
548
  type PermissionIntent = Schema.Schema.Type<typeof PermissionIntentSchema>;
@@ -543,7 +558,9 @@ declare const SubmittedPermissionExecutionSchema: Schema.Struct<{
543
558
  readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
544
559
  readonly revision: Schema.refine<number, Schema.Number>;
545
560
  readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
561
+ readonly assetId: Schema.optional<Schema.refine<AssetId, Schema.String>>;
546
562
  readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
563
+ readonly decimals: Schema.optional<Schema.refine<number, Schema.Number>>;
547
564
  readonly limitRaw: Schema.optional<Schema.Codec<WeiAmount, string, never, never>>;
548
565
  readonly allowanceKey: Schema.optional<Schema.Codec<AllowanceKey, string, never, never>>;
549
566
  }>, Schema.Struct<{
@@ -564,7 +581,9 @@ declare const SubmittedPermissionExecutionSchema: Schema.Struct<{
564
581
  readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
565
582
  readonly revision: Schema.refine<number, Schema.Number>;
566
583
  readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
584
+ readonly assetId: Schema.optional<Schema.refine<AssetId, Schema.String>>;
567
585
  readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
586
+ readonly decimals: Schema.optional<Schema.refine<number, Schema.Number>>;
568
587
  readonly limitRaw: Schema.optional<Schema.Codec<WeiAmount, string, never, never>>;
569
588
  readonly allowanceKey: Schema.optional<Schema.Codec<AllowanceKey, string, never, never>>;
570
589
  }>>]>;
@@ -575,6 +594,50 @@ type PayrollRunStatus$1 = Schema.Schema.Type<typeof PayrollRunStatusSchema>;
575
594
  declare const PayrollTermsUnitSchema: Schema.Literals<readonly ["hour", "week", "month", "year", "paycheck"]>;
576
595
  type PayrollTermsUnit$1 = Schema.Schema.Type<typeof PayrollTermsUnitSchema>;
577
596
  //#endregion
597
+ //#region ../wire/src/payment-document.d.ts
598
+ declare const DocumentRefV3Schema: Schema.Struct<{
599
+ readonly documentHash: Schema.String;
600
+ readonly contentHash: Schema.String;
601
+ readonly kind: Schema.Literals<readonly ["memo", "invoice", "payslip", "receipt"]>;
602
+ readonly format: Schema.Literals<readonly ["envelope-v3", "artifact"]>;
603
+ readonly role: Schema.Literals<readonly ["instruction", "movement", "supporting"]>;
604
+ readonly issuedAt: Schema.NullOr<Schema.Number>;
605
+ }>;
606
+ type DocumentRefV3 = typeof DocumentRefV3Schema.Type;
607
+ declare const PaymentDocumentReadRefSchema: Schema.Struct<{
608
+ readonly documentHash: Schema.String;
609
+ readonly contentHash: Schema.String;
610
+ }>;
611
+ type PaymentDocumentReadRef = typeof PaymentDocumentReadRefSchema.Type;
612
+ declare const PaymentDocumentDownloadSchema: Schema.Struct<{
613
+ readonly ref: Schema.Struct<{
614
+ readonly documentHash: Schema.String;
615
+ readonly contentHash: Schema.String;
616
+ readonly kind: Schema.Literals<readonly ["memo", "invoice", "payslip", "receipt"]>;
617
+ readonly format: Schema.Literals<readonly ["envelope-v3", "artifact"]>;
618
+ readonly issuedAt: Schema.NullOr<Schema.Number>;
619
+ }>;
620
+ readonly bytesBase64: Schema.String;
621
+ readonly mediaType: Schema.Literals<readonly ["application/pdf", "image/png", "image/jpeg", "application/json"]>;
622
+ readonly signatureStatus: Schema.Literals<readonly ["absent", "verified", "opaque"]>;
623
+ }>;
624
+ type PaymentDocumentDownload = typeof PaymentDocumentDownloadSchema.Type;
625
+ declare const PaymentDocumentVerificationSchema: Schema.Struct<{
626
+ readonly documentHash: Schema.String;
627
+ readonly contentHash: Schema.String;
628
+ readonly ok: Schema.Boolean;
629
+ readonly signatureStatus: Schema.Literals<readonly ["absent", "verified", "opaque"]>;
630
+ }>;
631
+ type PaymentDocumentVerification = typeof PaymentDocumentVerificationSchema.Type;
632
+ declare const PaymentDocumentRenderSchema: Schema.Struct<{
633
+ readonly documentHash: Schema.String;
634
+ readonly contentHash: Schema.String;
635
+ readonly kind: Schema.Literals<readonly ["memo", "invoice", "payslip", "receipt"]>;
636
+ readonly ok: Schema.Literal<true>;
637
+ readonly html: Schema.String;
638
+ }>;
639
+ type PaymentDocumentRender = typeof PaymentDocumentRenderSchema.Type;
640
+ //#endregion
578
641
  //#region ../wire/src/observation-context.d.ts
579
642
  /**
580
643
  * Bounded, non-authoritative observation metadata carried by selected SDK
@@ -594,6 +657,104 @@ interface WireObservationContext {
594
657
  readonly traceparent?: string;
595
658
  }
596
659
  //#endregion
660
+ //#region ../wire/src/client-authorization.d.ts
661
+ declare const ClientRequestViewSchema: Schema.Union<readonly [Schema.Struct<{
662
+ readonly requestId: Schema.refine<ClientRequestId, Schema.String>;
663
+ readonly revision: Schema.Number;
664
+ readonly expiresAt: Schema.Codec<EpochMs, number, never, never>;
665
+ readonly phase: Schema.Literal<"otp_required">;
666
+ readonly email: Schema.refine<Email, Schema.decodeTo<Schema.String, Schema.String, never, never>>;
667
+ readonly resendAt: Schema.Codec<EpochMs, number, never, never>;
668
+ }>, Schema.Struct<{
669
+ readonly requestId: Schema.refine<ClientRequestId, Schema.String>;
670
+ readonly revision: Schema.Number;
671
+ readonly expiresAt: Schema.Codec<EpochMs, number, never, never>;
672
+ readonly authUserId: Schema.refine<AuthUserId, Schema.String>;
673
+ readonly email: Schema.refine<Email, Schema.decodeTo<Schema.String, Schema.String, never, never>>;
674
+ readonly phase: Schema.Literal<"review">;
675
+ readonly clientLabel: Schema.Literal<"Capxul CLI">;
676
+ readonly scopes: Schema.Tuple<readonly [Schema.Literal<"account:read">]>;
677
+ readonly intent: Schema.Union<readonly [Schema.Struct<{
678
+ readonly mode: Schema.Literal<"login">;
679
+ }>, Schema.Struct<{
680
+ readonly mode: Schema.Literal<"signup">;
681
+ readonly profile: Schema.Struct<{
682
+ readonly displayName: Schema.decodeTo<Schema.String, Schema.String, never, never>;
683
+ readonly country: Schema.refine<CountryCode, Schema.decodeTo<Schema.String, Schema.String, never, never>>;
684
+ readonly handle: Schema.refine<Handle, Schema.String>;
685
+ readonly payoutAddresses: Schema.optional<Schema.$Array<Schema.Struct<{
686
+ readonly chain: Schema.Literals<readonly ["evm", "solana", "starknet"]>;
687
+ readonly address: Schema.String;
688
+ }>>>;
689
+ readonly image: Schema.optional<Schema.Struct<{
690
+ readonly mediaType: Schema.Literals<readonly ["image/jpeg", "image/png", "image/webp"]>;
691
+ readonly byteLength: Schema.Number;
692
+ readonly sha256: Schema.String;
693
+ }>>;
694
+ }>;
695
+ }>]>;
696
+ readonly setupState: Schema.Literals<readonly ["not_required", "new", "resumable"]>;
697
+ }>, Schema.Struct<{
698
+ readonly requestId: Schema.refine<ClientRequestId, Schema.String>;
699
+ readonly revision: Schema.Number;
700
+ readonly expiresAt: Schema.Codec<EpochMs, number, never, never>;
701
+ readonly authUserId: Schema.refine<AuthUserId, Schema.String>;
702
+ readonly email: Schema.refine<Email, Schema.decodeTo<Schema.String, Schema.String, never, never>>;
703
+ readonly phase: Schema.Literal<"processing">;
704
+ readonly purpose: Schema.Literals<readonly ["login", "signup"]>;
705
+ readonly step: Schema.Literals<readonly ["profile", "wallet", "account", "delivery"]>;
706
+ }>, Schema.Struct<{
707
+ readonly requestId: Schema.refine<ClientRequestId, Schema.String>;
708
+ readonly revision: Schema.Number;
709
+ readonly expiresAt: Schema.Codec<EpochMs, number, never, never>;
710
+ readonly authUserId: Schema.refine<AuthUserId, Schema.String>;
711
+ readonly email: Schema.refine<Email, Schema.decodeTo<Schema.String, Schema.String, never, never>>;
712
+ readonly displayName: Schema.String;
713
+ readonly handle: Schema.refine<Handle, Schema.String>;
714
+ readonly country: Schema.refine<CountryCode, Schema.decodeTo<Schema.String, Schema.String, never, never>>;
715
+ readonly phase: Schema.Literal<"connected">;
716
+ readonly accountId: Schema.refine<AccountId, Schema.String>;
717
+ readonly grantId: Schema.refine<ClientGrantId, Schema.String>;
718
+ }>, Schema.Struct<{
719
+ readonly requestId: Schema.refine<ClientRequestId, Schema.String>;
720
+ readonly revision: Schema.Number;
721
+ readonly expiresAt: Schema.Codec<EpochMs, number, never, never>;
722
+ readonly phase: Schema.Literal<"refused">;
723
+ readonly reason: Schema.Literals<readonly ["signup_required", "setup_required", "already_signed_up", "identity_mismatch", "invalid_request", "request_expired", "request_denied", "cancelled", "grant_revoked", "grant_expired", "refresh_reused", "revoke_unconfirmed"]>;
724
+ readonly code: Schema.Literals<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"]>;
725
+ readonly field: Schema.optional<Schema.Literals<readonly ["email", "displayName", "country", "handle", "image", "payoutAddresses"]>>;
726
+ readonly retryable: Schema.Boolean;
727
+ }>]>;
728
+ type ClientRequestView = typeof ClientRequestViewSchema.Type;
729
+ //#endregion
730
+ //#region ../wire/src/org.d.ts
731
+ /** The public authority named by one Organization assignment. */
732
+ type AuthorityRef = {
733
+ readonly type: "budget";
734
+ readonly budgetId: BudgetId;
735
+ } | {
736
+ readonly type: "managePeople";
737
+ readonly permissionId: PermissionId;
738
+ };
739
+ /** The accepted product policy stored with one Permission revision. */
740
+ declare const CurrentPolicySchema: Schema.Union<readonly [Schema.Struct<{
741
+ readonly type: Schema.Literal<"budget">;
742
+ readonly asset: Schema.refine<AssetId, Schema.String>;
743
+ readonly limit: Schema.NullOr<Schema.String>;
744
+ readonly scope: Schema.Struct<{
745
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
746
+ readonly type: Schema.Literal<"anyone">;
747
+ }>, Schema.Struct<{
748
+ readonly type: Schema.Literal<"allowlist">;
749
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
750
+ }>]>;
751
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
752
+ }>;
753
+ }>, Schema.Struct<{
754
+ readonly type: Schema.Literal<"managePeople">;
755
+ }>]>;
756
+ type CurrentPolicy = typeof CurrentPolicySchema.Type;
757
+ //#endregion
597
758
  //#region src/ports/bootstrap.d.ts
598
759
  type BootstrapInput = {
599
760
  readonly publishableKey: PublishableKey;
@@ -893,7 +1054,7 @@ type ReadAccountBalanceInput = {
893
1054
  };
894
1055
  type FundFromFaucetInput = {
895
1056
  readonly chainId: ChainId;
896
- readonly amount: Money;
1057
+ readonly amount: AssetAmount;
897
1058
  };
898
1059
  type FundFromFaucetResult = {
899
1060
  readonly txHash: string;
@@ -1160,10 +1321,38 @@ interface IdentityActor extends Actor<IdentityState, IdentityEvent, RefusalReaso
1160
1321
  readonly restoreAuthSession: (session: AuthSession, controls?: InvocationControls) => Effect.Effect<IdentityState, ActorFailure<RefusalReason | CapxulErrorCode>>;
1161
1322
  }
1162
1323
  //#endregion
1324
+ //#region src/surface/client-requests.d.ts
1325
+ type AccountSetupPolicy = "automatic" | "explicit";
1326
+ interface ClientRequests {
1327
+ read(input: {
1328
+ readonly requestId: string;
1329
+ }, options?: AuthMethodOptions): Promise<CapxulResult<ClientRequestView>>;
1330
+ sendOtp(input: {
1331
+ readonly requestId: string;
1332
+ }, options?: AuthMethodOptions): Promise<CapxulResult<void>>;
1333
+ verifyOtp(input: {
1334
+ readonly requestId: string;
1335
+ readonly code: string;
1336
+ }, options?: AuthMethodOptions): Promise<CapxulResult<void>>;
1337
+ accept(input: {
1338
+ readonly requestId: string;
1339
+ readonly revision: number;
1340
+ }, options?: AuthMethodOptions): Promise<CapxulResult<ClientRequestView>>;
1341
+ cancel(input: {
1342
+ readonly requestId: string;
1343
+ readonly revision: number;
1344
+ }, options?: AuthMethodOptions): Promise<CapxulResult<ClientRequestView>>;
1345
+ }
1346
+ //#endregion
1163
1347
  //#region src/surface/auth.d.ts
1164
1348
  type AuthMethodOptions = InvocationControls;
1165
1349
  type SignInOptions = AuthMethodOptions;
1166
1350
  interface AuthMethods {
1351
+ /** Resume pending OTP input after process restart; grants no authentication. */
1352
+ resumeOtp(input: {
1353
+ readonly email: string;
1354
+ readonly requestedAt: number;
1355
+ }, options?: AuthMethodOptions): Promise<CapxulResult<void>>;
1167
1356
  canSendOtp(input: {
1168
1357
  readonly email: string;
1169
1358
  }, options?: AuthMethodOptions): Promise<CapxulResult<CanSendOtpStatus>>;
@@ -1180,6 +1369,7 @@ interface AuthMethods {
1180
1369
  }, options?: AuthMethodOptions): Promise<CapxulResult<Session$1>>;
1181
1370
  signOut(options?: AuthMethodOptions): Promise<CapxulResult<void>>;
1182
1371
  getSession(options?: AuthMethodOptions): Promise<CapxulResult<Session$1 | null>>;
1372
+ readonly clientRequests: ClientRequests;
1183
1373
  }
1184
1374
  //#endregion
1185
1375
  //#region src/surface/smart-account.d.ts
@@ -1363,22 +1553,12 @@ interface MeMethods {
1363
1553
  /** R08 (#1966): accepts a captured attempt, exactly as the treasury read does. */
1364
1554
  depositInstructions(options?: InvocationControls): Promise<CapxulResult<DepositInstructions>>;
1365
1555
  }
1366
- interface PaymentMoney {
1367
- readonly currency: string;
1368
- readonly value: string;
1369
- readonly decimals: number;
1370
- }
1556
+ type PaymentMoney = AssetAmount;
1371
1557
  type PaymentStatus = PaymentStatus$1;
1372
1558
  type PaymentDirection = PaymentDirection$1;
1373
1559
  type PaymentType = PaymentType$1;
1374
- type PaymentDocumentKind = PaymentDocumentKind$1;
1375
- interface PaymentDocumentRef {
1376
- readonly documentHash: string;
1377
- readonly kind: PaymentDocumentKind;
1378
- readonly title?: string;
1379
- readonly uri?: string;
1380
- readonly issuedAt?: number;
1381
- }
1560
+ type PaymentDocumentKind = DocumentRefV3["kind"];
1561
+ type PaymentDocumentRef = DocumentRefV3;
1382
1562
  type PaymentTiming = {
1383
1563
  readonly kind: "instant";
1384
1564
  } | {
@@ -1410,6 +1590,7 @@ interface Payment {
1410
1590
  readonly label: string;
1411
1591
  };
1412
1592
  readonly documents: readonly PaymentDocumentRef[];
1593
+ readonly documentState?: "ready" | "pending" | "unavailable";
1413
1594
  readonly timing: PaymentTiming;
1414
1595
  readonly released: PaymentMoney;
1415
1596
  readonly availableToClaim: PaymentMoney;
@@ -1607,8 +1788,7 @@ interface ActivitySummaryParams {
1607
1788
  readonly window?: ActivityRange;
1608
1789
  }
1609
1790
  interface ActivitySummaryTotal {
1610
- readonly currency: string;
1611
- readonly decimals: number;
1791
+ readonly asset: AssetAmount["asset"];
1612
1792
  /** Integer raw-unit strings. `net` is `in - out` and may be negative. */
1613
1793
  readonly in: string;
1614
1794
  readonly out: string;
@@ -1622,7 +1802,7 @@ interface ActivitySummary {
1622
1802
  readonly from: number | null;
1623
1803
  readonly to: number | null;
1624
1804
  };
1625
- /** One bucket per currency, and EMPTY when the window holds no activity. */
1805
+ /** One bucket per exact asset, and EMPTY when the window holds no activity. */
1626
1806
  readonly totals: readonly ActivitySummaryTotal[];
1627
1807
  /**
1628
1808
  * Every activity row in the window, whatever its direction or status. It
@@ -1697,6 +1877,8 @@ type ActivityDetail = {
1697
1877
  } | {
1698
1878
  readonly kind: "movement";
1699
1879
  readonly movementId: string;
1880
+ readonly documents: readonly PaymentDocumentRef[];
1881
+ readonly documentState: "ready" | "pending" | "unavailable";
1700
1882
  readonly annotation: ActivityAnnotation | null;
1701
1883
  readonly evidence: MovementActivityEvidence;
1702
1884
  };
@@ -1760,24 +1942,6 @@ interface OfframpMethods {
1760
1942
  readonly signal?: AbortSignal;
1761
1943
  }): Promise<CapxulResult<OfframpStatus>>;
1762
1944
  }
1763
- interface PaymentDocumentVerification {
1764
- readonly documentHash: string;
1765
- readonly ok: boolean;
1766
- readonly derivedHash: string;
1767
- readonly kind: PaymentDocumentKind;
1768
- }
1769
- /**
1770
- * #577 render-on-demand result. `html` is self-contained user-visible document
1771
- * HTML (stylesheet + rendered document). The MCP `paymentDocuments.render` tool
1772
- * exposes only `{documentHash, kind, ok}` to the model and returns `html` in an
1773
- * audience:["user"] content block (#506 redaction matrix).
1774
- */
1775
- interface PaymentDocumentRender {
1776
- readonly documentHash: string;
1777
- readonly ok: boolean;
1778
- readonly kind: PaymentDocumentKind;
1779
- readonly html: string;
1780
- }
1781
1945
  /**
1782
1946
  * The public Payments surface uses product-level methods. A settled receipt can
1783
1947
  * include `chainId` and `transactionHash`. Internal custody fields stay private.
@@ -1812,15 +1976,15 @@ interface PaymentsMethods {
1812
1976
  }): Promise<CapxulResult<Payment>>;
1813
1977
  }
1814
1978
  interface PaymentDocumentsMethods {
1815
- verify(documentHash: string, options?: {
1979
+ /** Return exact original bytes for a deliberate download. */
1980
+ get(ref: PaymentDocumentReadRef, options?: {
1981
+ readonly signal?: AbortSignal;
1982
+ }): Promise<CapxulResult<PaymentDocumentDownload>>;
1983
+ verify(ref: PaymentDocumentReadRef, options?: {
1816
1984
  readonly signal?: AbortSignal;
1817
1985
  }): Promise<CapxulResult<PaymentDocumentVerification>>;
1818
- /**
1819
- * #577: render-on-demand. Loads the owner's stored document by `documentHash`,
1820
- * re-verifies its EIP-712 hash, and renders it to self-contained HTML using the
1821
- * verified stored line items. Returns `{documentHash, kind, ok, html}`.
1822
- */
1823
- render(documentHash: string, options?: {
1986
+ /** Render an authorized document after checking its bytes and preimages. */
1987
+ render(ref: PaymentDocumentReadRef, options?: {
1824
1988
  readonly signal?: AbortSignal;
1825
1989
  }): Promise<CapxulResult<PaymentDocumentRender>>;
1826
1990
  }
@@ -2064,13 +2228,20 @@ interface OrganizationOnboardingInput {
2064
2228
  interface OrganizationOnboarding {
2065
2229
  readonly organizationId: string;
2066
2230
  }
2231
+ interface OrganizationOnboardingOptions {
2232
+ readonly signal?: AbortSignal;
2233
+ readonly intent?: "create";
2234
+ }
2235
+ interface OrganizationOnboardingState {
2236
+ readonly organizationId: OrgId | null;
2237
+ readonly lifecycle: OrgLifecycle | null;
2238
+ }
2067
2239
  interface OnboardingMethods {
2068
2240
  completePerson(input: PersonOnboardingInput, options?: {
2069
2241
  readonly signal?: AbortSignal;
2070
2242
  }): Promise<CapxulResult<PersonOnboarding>>;
2071
- completeOrganization(input: OrganizationOnboardingInput, options?: {
2072
- readonly signal?: AbortSignal;
2073
- }): Promise<CapxulResult<OrganizationOnboarding>>;
2243
+ completeOrganization(input: OrganizationOnboardingInput, options?: OrganizationOnboardingOptions): Promise<CapxulResult<OrganizationOnboarding>>;
2244
+ subscribeOrganization(observer: (state: OrganizationOnboardingState) => void): () => void;
2074
2245
  }
2075
2246
  //#endregion
2076
2247
  //#region src/surface/accounts.d.ts
@@ -2085,7 +2256,7 @@ interface AccountsMethods {
2085
2256
  * The reference CLI uses it only in the test environment. Consumers do not see `fund`.
2086
2257
  */
2087
2258
  interface AccountsFaucetMethods {
2088
- fund(amount: Money, options?: {
2259
+ fund(amount: AssetAmount, options?: {
2089
2260
  readonly signal?: AbortSignal;
2090
2261
  }): Promise<CapxulResult<{
2091
2262
  readonly txHash: string;
@@ -2138,7 +2309,7 @@ declare class OrgError extends OrgError_base<{
2138
2309
  interface OrgPort {
2139
2310
  createOrg(input: CreateOrgPortInput): Effect.Effect<OrgView, OrgError, never>;
2140
2311
  readTreasury(input: ReadOrgTreasuryInput): Effect.Effect<Account$1, OrgError, never>;
2141
- listOrgs(input: ListOrgsInput): Effect.Effect<readonly OrgView[], OrgError, never>;
2312
+ listOrgs(input: ListOrgsInput): Effect.Effect<readonly OrganizationAccess[], OrgError, never>;
2142
2313
  listRoles(input: ListOrgRolesInput): Effect.Effect<readonly RoleView[], OrgError, never>;
2143
2314
  listMembers(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
2144
2315
  pendingMembers?(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
@@ -2158,7 +2329,12 @@ interface Budget {
2158
2329
  readonly id: BudgetId;
2159
2330
  /** Display name, taken from the Role the grant was motivated by. */
2160
2331
  readonly label: string;
2161
- readonly limit: Money | null;
2332
+ readonly asset: {
2333
+ readonly assetId: AssetId;
2334
+ readonly symbol: string;
2335
+ readonly decimals: number;
2336
+ };
2337
+ readonly limit: AssetAmount | null;
2162
2338
  }
2163
2339
  /**
2164
2340
  * The caller's own standing in one Organization.
@@ -2172,6 +2348,7 @@ interface Budget {
2172
2348
  * spending, so both read `canSpend`.
2173
2349
  */
2174
2350
  interface OrgMe {
2351
+ readonly member: MemberIdentityProjection;
2175
2352
  readonly role: {
2176
2353
  readonly label: string;
2177
2354
  } | null;
@@ -2268,7 +2445,7 @@ interface PayrollRun {
2268
2445
  /** Epoch milliseconds. An instant run has `periodStart === periodEnd`. */
2269
2446
  readonly periodStart: number;
2270
2447
  readonly periodEnd: number;
2271
- readonly total: Money;
2448
+ readonly total: AssetAmount;
2272
2449
  readonly recipientCount: number;
2273
2450
  }
2274
2451
  /**
@@ -2281,7 +2458,7 @@ interface PayrollRun {
2281
2458
  interface PayrollRuns {
2282
2459
  readonly runs: readonly PayrollRun[];
2283
2460
  /** Σ net of the runs that SETTLED this calendar month — the "Paid This Month" fact. */
2284
- readonly settledThisMonth: Money;
2461
+ readonly settledThisMonth: readonly AssetAmount[];
2285
2462
  }
2286
2463
  /**
2287
2464
  * One saved recipient on a group. `amount` is the employer's TYPED text, not
@@ -2350,8 +2527,12 @@ interface PayrollRunItemInput {
2350
2527
  * three different people.
2351
2528
  */
2352
2529
  readonly partyId: string;
2530
+ /** The exact settlement quantity. Fiat compensation remains in gross and net. */
2531
+ readonly amount: AssetAmount;
2353
2532
  readonly gross: string;
2354
2533
  readonly net: string;
2534
+ readonly currency: CurrencyCode;
2535
+ readonly decimals: number;
2355
2536
  readonly adjustments: readonly {
2356
2537
  readonly label: string;
2357
2538
  readonly amount: string;
@@ -2360,6 +2541,8 @@ interface PayrollRunItemInput {
2360
2541
  interface AuthorizeRunInput {
2361
2542
  /** The Budget the run spends from. The caller selects it; nothing is picked for them. */
2362
2543
  readonly permissionId: string;
2544
+ /** The one asset used by every payment in this run. */
2545
+ readonly asset: AssetAmount["asset"];
2363
2546
  /** Epoch milliseconds. An instant run passes `start === end` — the payslip renders the date. */
2364
2547
  readonly period: {
2365
2548
  readonly start: number;
@@ -2404,28 +2587,69 @@ interface PayrollMethods {
2404
2587
  //#region src/surface/org.d.ts
2405
2588
  /** The membership state for one Organization member. */
2406
2589
  type MemberStatus = "pending" | "pending_safe" | "pending_grant" | "active" | "revoked" | "expired";
2407
- /** One Organization that the current user can access. */
2408
- type OrgView = {
2590
+ /** The current state and policy of one exact authority assignment. */
2591
+ type AssignmentProjection = {
2592
+ readonly id: PermissionAssignmentId;
2593
+ readonly authority: AuthorityRef;
2594
+ readonly state: "pending" | "active" | "suspended" | "revoked";
2595
+ readonly policy: CurrentPolicy;
2596
+ readonly revision: number;
2597
+ readonly observedAt: number;
2598
+ };
2599
+ /** The current user's identity and authority inside one Organization. */
2600
+ type MemberIdentityProjection = {
2601
+ readonly orgId: OrgId;
2602
+ readonly partyId: PartyId;
2603
+ readonly accountId: AccountId | null;
2604
+ readonly safeAddress: Address$1;
2605
+ readonly accountReady: boolean | null;
2606
+ readonly assignments: readonly AssignmentProjection[];
2607
+ };
2608
+ /** The legacy creation result. List reads return OrganizationAccess. */
2609
+ type OrgView = OrganizationAccess & {
2409
2610
  readonly creationSource?: TesterKind;
2410
- readonly id: OrgId;
2411
- readonly name: string;
2412
- readonly handle: string;
2413
2611
  readonly safeAddress: Address$1;
2414
2612
  /** The viewing member's own role label within this org. */
2415
- readonly role: string;
2416
- /** The Organization treasury Account. */
2417
- readonly treasury: Account$1;
2613
+ readonly role: string | null;
2614
+ /**
2615
+ * The Organization treasury Account when this view came from an authorized
2616
+ * treasury read. The own-access list returns `null` because list inclusion
2617
+ * does not grant a protected treasury read.
2618
+ */
2619
+ readonly treasury: Account$1 | null;
2418
2620
  /** #1064: onboarding-collected description + size bucket; null when unset. */
2419
2621
  readonly bio: string | null;
2420
2622
  readonly size: string | null;
2421
2623
  /** #1061 / ADR-0014: logo serving URL resolved at read time; null when unset. */
2422
2624
  readonly logoUrl: string | null;
2423
2625
  };
2626
+ /** One Organization that the current user can access. */
2627
+ type OrganizationAccess = {
2628
+ readonly id: OrgId;
2629
+ readonly name: string;
2630
+ readonly handle: string;
2631
+ /** Canonical Organization account identity. */
2632
+ readonly account: {
2633
+ readonly id: AccountId | null;
2634
+ readonly address: Address$1;
2635
+ readonly ready: boolean | null;
2636
+ };
2637
+ readonly setup: OrgLifecycle;
2638
+ readonly member: MemberIdentityProjection | null;
2639
+ readonly capabilities: {
2640
+ readonly canManagePeople: boolean;
2641
+ readonly canSpend: boolean;
2642
+ };
2643
+ readonly custody: {
2644
+ readonly status: "unknown";
2645
+ };
2646
+ readonly observedAt: number;
2647
+ };
2424
2648
  interface OrganizationAccount {
2425
2649
  readonly id: string;
2426
2650
  readonly address: string | null;
2427
- readonly balance: Money;
2428
- readonly available: Money;
2651
+ /** One position per settlement asset; never a single fiat `Money`. */
2652
+ readonly balances: readonly AccountPosition[];
2429
2653
  }
2430
2654
  interface OrganizationAuditLogItem {
2431
2655
  readonly id: string;
@@ -2437,15 +2661,15 @@ interface OrganizationAuditLogItem {
2437
2661
  readonly metadata?: Record<string, unknown>;
2438
2662
  }
2439
2663
  /**
2440
- * One Organization member. `personalSafeAddress` is the member identity key. It
2441
- * is `null` while the member is still `pending` (emailed into existence but not
2442
- * yet provisioned a personal Safe). `email` is the universal entry point.
2664
+ * One Organization member. `accountId` identifies the attached Account.
2665
+ * It is `null` before Account attachment. A Safe address is not an AccountId.
2443
2666
  */
2444
2667
  type MemberView = {
2445
2668
  readonly orgId: OrgId;
2669
+ readonly accountId: AccountId | null;
2446
2670
  readonly email: Email;
2447
2671
  readonly name: string | null;
2448
- /** Member identity key. `null` until the invitee provisions a Safe. */
2672
+ /** Custody Safe. `null` until the invitee provisions a Safe. */
2449
2673
  readonly personalSafeAddress: Address$1 | null;
2450
2674
  /** The member role label maps to the on-chain `roleKey`. */
2451
2675
  readonly role: string;
@@ -2454,16 +2678,9 @@ type MemberView = {
2454
2678
  readonly grantTxHash: string | null;
2455
2679
  readonly revokeTxHash: string | null;
2456
2680
  };
2457
- /** A role spend cap that Zodiac Roles and Allowance enforce on-chain. */
2458
- type RoleSpendCap = {
2459
- readonly perTx?: Money;
2460
- readonly perDay?: Money;
2461
- readonly toRecipients?: "anyone" | readonly Address$1[];
2462
- };
2463
2681
  /** A Capxul Role definition. */
2464
2682
  type RoleDefinition = {
2465
2683
  readonly label: string;
2466
- readonly spend?: RoleSpendCap;
2467
2684
  readonly canSpend?: boolean;
2468
2685
  readonly canManageMembers?: boolean;
2469
2686
  readonly canManageRoles?: boolean;
@@ -2577,7 +2794,7 @@ interface OrgScopedMethods extends ActorRelationshipMethods {
2577
2794
  type OrgsMethod = {
2578
2795
  (options?: {
2579
2796
  readonly signal?: AbortSignal;
2580
- }): Promise<CapxulResult<readonly OrgView[]>>;
2797
+ }): Promise<CapxulResult<readonly OrganizationAccess[]>>;
2581
2798
  detectAndAcceptPendingInvitations(options?: {
2582
2799
  readonly signal?: AbortSignal;
2583
2800
  }): Promise<CapxulResult<DetectPendingOrgInvitationsResult>>;
@@ -2611,16 +2828,7 @@ interface CurrentUserContext {
2611
2828
  readonly id: string;
2612
2829
  readonly address: string | null;
2613
2830
  } | null;
2614
- readonly organizations: readonly {
2615
- readonly id: string;
2616
- readonly name: string;
2617
- readonly handle: string;
2618
- readonly role: string;
2619
- readonly account: {
2620
- readonly id: string;
2621
- readonly address: string | null;
2622
- } | null;
2623
- }[];
2831
+ readonly organizations: readonly OrganizationAccess[];
2624
2832
  }
2625
2833
  interface CurrentUserMethods {
2626
2834
  get(options?: {
@@ -2670,19 +2878,6 @@ interface SystemMethods {
2670
2878
  }): Promise<CapxulResult<SystemHealth>>;
2671
2879
  }
2672
2880
  //#endregion
2673
- //#region src/domain/money/primary-holding.d.ts
2674
- /**
2675
- * The one asset a screen shows when it can show only one. `symbol` is the
2676
- * TOKEN symbol the chain reported (`"USDX"`); `available.currency` is the
2677
- * consumer `CurrencyCode` that token stands for (`"USD"`). They are separate
2678
- * fields because they are separate facts.
2679
- */
2680
- interface Holding {
2681
- readonly id: string;
2682
- readonly symbol: string;
2683
- readonly available: Money;
2684
- }
2685
- //#endregion
2686
2881
  //#region src/surface/holdings.d.ts
2687
2882
  interface HoldingsMethods {
2688
2883
  current(input?: {
@@ -2690,17 +2885,6 @@ interface HoldingsMethods {
2690
2885
  }, options?: {
2691
2886
  readonly signal?: AbortSignal;
2692
2887
  }): Promise<CapxulResult<CurrentHoldings>>;
2693
- /**
2694
- * The designated display asset — the payable row holding the most money, or
2695
- * `null` when the snapshot carries no renderable row. Reads the same
2696
- * snapshot as `current` and picks from it; an empty answer is a value, not
2697
- * an error.
2698
- */
2699
- primary(input?: {
2700
- readonly actor?: ActorReference;
2701
- }, options?: {
2702
- readonly signal?: AbortSignal;
2703
- }): Promise<CapxulResult<Holding | null>>;
2704
2888
  }
2705
2889
  //#endregion
2706
2890
  //#region src/surface/_shared/effect-actor-bridge.d.ts
@@ -2858,6 +3042,11 @@ interface CapxulClient {
2858
3042
  readonly telemetry?: TelemetryPort;
2859
3043
  readonly captureExternalAddressAcknowledged: (address: string, organizationId?: string) => void;
2860
3044
  readonly close?: () => Promise<void>;
3045
+ /**
3046
+ * AUTH A3: `explicit` on `/connect` suppresses automatic profile/account/
3047
+ * invitation writes on restore and after OTP. Default `automatic`.
3048
+ */
3049
+ readonly accountSetup: AccountSetupPolicy;
2861
3050
  };
2862
3051
  }
2863
3052
  interface CreateCapxulClientInput {
@@ -2890,6 +3079,11 @@ interface CreateCapxulClientInput {
2890
3079
  * Optional per-call timeout for invoked auth requests.
2891
3080
  */
2892
3081
  readonly invokeTimeoutMs?: number;
3082
+ /**
3083
+ * AUTH A3 setup policy. `explicit` is the `/connect` construction: login
3084
+ * makes no automatic Profile/Account/invitation writes. Default `automatic`.
3085
+ */
3086
+ readonly accountSetup?: AccountSetupPolicy | undefined;
2893
3087
  /**
2894
3088
  * Init-time account readiness target (issue #159 · AC4). The factory
2895
3089
  * closes over this so `client.account.{getStatus,ensureReady}` don't
@@ -2931,6 +3125,47 @@ interface CreateCapxulClientInput {
2931
3125
  };
2932
3126
  }
2933
3127
  //#endregion
3128
+ //#region src/ports/diagnostic.d.ts
3129
+ type DiagnosticDetail = Readonly<Record<string, unknown>>;
3130
+ interface DiagnosticPort {
3131
+ readonly trace: (scope: string, detail: DiagnosticDetail) => void;
3132
+ }
3133
+ //#endregion
3134
+ //#region src/openfort/create-openfort-browser-signer.d.ts
3135
+ interface OpenfortBrowserSigner extends CapxulSigner {
3136
+ readonly resetSession: () => void;
3137
+ /** Required here — this signer is the one that runs a readiness cycle. */
3138
+ readonly statusStore: SignerStatusStore;
3139
+ /**
3140
+ * Start the readiness cycle, or join the one already running, without
3141
+ * signing anything (#1667). The embedded-wallet port calls the same routine
3142
+ * lazily from `getAddress` / `signRawDigest`; the client assembly calls it
3143
+ * once the identity is claimed, so the status converges on `ready` or
3144
+ * `unavailable` without a signature. Idempotent: a second call inside a live
3145
+ * cycle joins that cycle.
3146
+ */
3147
+ readonly ensureWalletReady: () => Promise<void>;
3148
+ }
3149
+ /** Public Openfort values a host-owned browser signer needs after SDK bootstrap. */
3150
+ type OpenfortBrowserSignerBootstrap = Pick<BootstrapResolution, "authBaseUrl" | "openfortPublishableKey" | "shieldPublishableKey" | "openfortAuthProvider">;
3151
+ /** Authenticated callbacks for a browser that must not own the person's login flow. */
3152
+ interface OpenfortBrowserAuth {
3153
+ readonly getAccessToken: () => Promise<string | null>;
3154
+ readonly createEncryptionSession: (accessToken: string) => Promise<string>;
3155
+ }
3156
+ interface OpenfortBrowserSignerOptions {
3157
+ readonly diagnostic?: DiagnosticPort;
3158
+ readonly auth?: OpenfortBrowserAuth;
3159
+ /** Testing seam below the existing one-retry recovery owner. */
3160
+ readonly signUserOpHash?: ((hash: Parameters<CapxulSigner["signUserOpHash"]>[0], delegate: CapxulSigner["signUserOpHash"]) => ReturnType<CapxulSigner["signUserOpHash"]>) | undefined;
3161
+ }
3162
+ /** Build the existing browser signer around host-owned authenticated callbacks. */
3163
+ declare function createOpenfortBrowserSigner(input: {
3164
+ readonly bootstrap: OpenfortBrowserSignerBootstrap;
3165
+ readonly auth: OpenfortBrowserAuth;
3166
+ readonly diagnostic?: DiagnosticPort;
3167
+ }): OpenfortBrowserSigner;
3168
+ //#endregion
2934
3169
  //#region ../observability/src/engineering-delivery.d.ts
2935
3170
  type MetricEntry = Metric.Metric.Metadata<unknown, unknown>;
2936
3171
  interface CliEngineeringStats {
@@ -3083,17 +3318,11 @@ interface ObservationAdapter {
3083
3318
  /** Stable PostHog event used for typed failures that are expected product outcomes. */
3084
3319
  declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
3085
3320
  //#endregion
3086
- //#region src/ports/diagnostic.d.ts
3087
- type DiagnosticDetail = Readonly<Record<string, unknown>>;
3088
- interface DiagnosticPort {
3089
- readonly trace: (scope: string, detail: DiagnosticDetail) => void;
3090
- }
3091
- //#endregion
3092
- //#region src/openfort/create-openfort-browser-signer.d.ts
3093
- interface OpenfortBrowserSignerOptions {
3094
- readonly diagnostic?: DiagnosticPort;
3095
- /** Testing seam below the existing one-retry recovery owner. */
3096
- readonly signUserOpHash?: ((hash: Parameters<CapxulSigner["signUserOpHash"]>[0], delegate: CapxulSigner["signUserOpHash"]) => ReturnType<CapxulSigner["signUserOpHash"]>) | undefined;
3321
+ //#region src/adapters/auth-client/BetterAuthNodeAdapter.d.ts
3322
+ /** Host-owned protected storage for an opaque BetterAuth bearer credential. */
3323
+ interface NodeSessionStorage {
3324
+ load(): Promise<string | null>;
3325
+ save(token: string | null): Promise<void>;
3097
3326
  }
3098
3327
  //#endregion
3099
3328
  //#region src/production.d.ts
@@ -3103,6 +3332,8 @@ interface OpenfortBrowserSignerOptions {
3103
3332
  * runtime detection, and auth-cache selection are SDK-owned defaults.
3104
3333
  */
3105
3334
  interface CapxulClientInput {
3335
+ /** Optional Node-only durable BetterAuth credential storage; sessions are verified by the backend. */
3336
+ readonly nodeSessionStorage?: NodeSessionStorage;
3106
3337
  readonly publishableKey: string;
3107
3338
  /** Public Capxul bootstrap origin; defaults remain unchanged when omitted. */
3108
3339
  readonly bootstrapBaseUrl?: string;
@@ -3119,6 +3350,11 @@ interface CapxulClientInput {
3119
3350
  * with no account lane.
3120
3351
  */
3121
3352
  readonly requirement?: AccountRequirement;
3353
+ /**
3354
+ * AUTH A3. `explicit` is the `/connect` construction: restore and OTP do
3355
+ * not write Profile, Account, or invitations. Default `automatic`.
3356
+ */
3357
+ readonly accountSetup?: "automatic" | "explicit";
3122
3358
  /**
3123
3359
  * Consumer-held signer (backend-orchestrated-deploy.md). Required for
3124
3360
  * `requirement: "deployed"` flows: `provision` reads `getAddress()` and the
@@ -3127,6 +3363,8 @@ interface CapxulClientInput {
3127
3363
  * holds an RPC URL, a gas-sponsorship policy, or a bundler.
3128
3364
  */
3129
3365
  readonly signer?: CapxulSigner;
3366
+ /** Build a host-owned Openfort signer from the SDK's validated bootstrap. */
3367
+ readonly openfortSignerFactory?: (bootstrap: OpenfortBrowserSignerBootstrap) => CapxulSigner;
3130
3368
  }
3131
3369
  /** Per-client signing controls; only the testing entry exposes these to consumers. */
3132
3370
  interface ProductionSignerControls {
@@ -3138,4 +3376,4 @@ interface ProductionSignerControls {
3138
3376
  readonly signEmbeddedUserOpHash?: OpenfortBrowserSignerOptions["signUserOpHash"];
3139
3377
  }
3140
3378
  //#endregion
3141
- export { OrganizationPaymentBatchInput as $, RequestStatus as $n, Destination as $t, OrgScopedMethods as A, Ref$1 as An, AddressBookAddInput as At, AuthorizeRunOptions as B, SmartAccountMethods as Bn, ActivityFilter as Bt, CurrentUserMethods as C, PaymentMoney as Cn, AccountMethods as Ct, MemberStatus as D, PaymentsMethods as Dn, ActorRequest as Dt, InviteMemberInput as E, PaymentType as En, ActorRelationshipMethods as Et, ResendInviteTokenInput as F, AccountLifecycle as Fn, InboxItem as Ft, PayrollGroupsMethods as G, ActorRef as Gn, ActivityPage as Gt, PayrollGroup as H, OrgLifecycle as Hn, ActivityKind as Ht, RoleDefinition as I, AccountSetupStep as In, InboxMethods as It, PayrollRun as J, SubmittedPermissionExecution as Jn, ActivitySummary as Jt, PayrollMethods as K, CurrentHoldings as Kn, ActivityRange as Kt, RoleSpendCap as L, isSettingUpLifecycle as Ln, ActivityAnnotation as Lt, OrgView as M, TargetReference as Mn, AddressBookLabelInput as Mt, OrganizationAccount as N, TargetsMethods as Nn, AddressBookMethods as Nt, MemberView as O, PaymentsPayInput as On, ActorRequestIssueInput as Ot, OrganizationAuditLogItem as P, fingerprintPaymentIntent as Pn, InboxApproveInput as Pt, PayrollTermsUnit as Q, PaymentStatus$1 as Qn, DepositInstructions as Qt, RoleView as R, CompleteProfileInput as Rn, ActivityAnnotationInput as Rt, CurrentUserContext as S, PaymentDocumentsMethods as Sn, ReadyAccountLifecycle as St, DetectPendingOrgInvitationsResult as T, PaymentTiming as Tn, ActorProfileMethods as Tt, PayrollGroupInput as U, OrgSetupStep as Un, ActivityListParams as Ut, PayrollEngagementTerms as V, AuthMethods as Vn, ActivityItem as Vt, PayrollGroupMember as W, PayoutAddress as Wn, ActivityMethods as Wt, PayrollRunStatus as X, PAYMENT_DIRECTIONS as Xn, ActivitySummaryTotal as Xt, PayrollRunItemInput as Y, InboxStatus as Yn, ActivitySummaryParams as Yt, PayrollRuns as Z, PAYMENT_STATUSES as Zn, ActorReference as Zt, HoldingsMethods as _, PaymentDirection as _n, OnboardingMethods as _t, ObservationContext as a, DestinationRemoveInput as an, IdentityEvent as ar, PermissionCreateInput as at, SystemHealth as b, PaymentDocumentRender as bn, PersonOnboarding as bt, HostObservability as c, MeMethods as cn, Readiness as cr, PermissionReplaceInput as ct, postHogObservability as d, OfframpMethods as dn, isClaimed as dr, Budget as dt, DestinationAddInput as en, TelemetryEvent as er, OrganizationPaymentInput as et, CapxulClient as f, OfframpQuote as fn, isRestoring as fr, OrgMe as ft, IdentityRuntimeSendResult as g, PaymentActivityEvidence as gn, CompletedPersonProfile as gt, IdentityRuntime as h, Payment as hn, AccountsMethods as ht, ObservationAdapter as i, DestinationRail as in, Destination$1 as ir, PermissionChangeInput as it, OrgTemplate as j, ResolvedTarget as jn, AddressBookEntry as jt, OrgMethods as k, RecipientResolution as kn, ActorRequestsMethods as kt, PostHogObservabilityClient as l, MeProfile as ln, StateLabel as lr, PermissionRevokeInput as lt, IdentityProfileDetails as m, OfframpStatus as mn, InvocationControls as mr, OrgMeOptions as mt, ProductionSignerControls as n, DestinationListInput as nn, TelemetryIdentifyInput as nr, OrganizationPaymentsMethods as nt, ObservationDelivery as o, DestinationsMethods as on, IdentityState as or, PermissionMethods as ot, CreateCapxulClientInput as p, OfframpQuoteInput as pn, IdentityTransition as pr, OrgMeMethod as pt, PayrollOptions as q, Permission as qn, ActivityReference as qt, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as r, DestinationPayload as rn, TelemetryPort as rr, PermissionAssignInput as rt, SdkFailureObservation as s, FinancialOpsMethods as sn, OrgLane as sr, PermissionOptions as st, CapxulClientInput as t, DestinationKind as tn, TelemetryGroupInput as tr, OrganizationPaymentItemInput as tt, PostHogObservabilityOptions as u, MovementActivityEvidence as un, destination as ur, PermissionReadResult as ut, Holding as v, PaymentDocumentKind as vn, OrganizationOnboarding as vt, CreateOrgInput as w, PaymentStatus as wn, ActorProfile as wt, MediaMethods as x, PaymentDocumentVerification as xn, PersonOnboardingInput as xt, SystemMethods as y, PaymentDocumentRef as yn, OrganizationOnboardingInput as yt, AuthorizeRunInput as z, IdentityMethods as zn, ActivityDetail as zt };
3379
+ export { PayrollRun as $, CurrentPolicy as $n, ActivityRange as $t, InviteMemberInput as A, PaymentTiming as An, AccountMethods as At, OrganizationAuditLogItem as B, AccountLifecycle as Bn, AddressBookMethods as Bt, SystemHealth as C, PaymentActivityEvidence as Cn, StateLabel as Cr, OrganizationOnboarding as Ct, AssignmentProjection as D, PaymentDocumentsMethods as Dn, IdentityTransition as Dr, PersonOnboarding as Dt, CurrentUserMethods as E, PaymentDocumentRef as En, isRestoring as Er, OrganizationOnboardingState as Et, OrgScopedMethods as F, Ref$1 as Fn, ActorRequestIssueInput as Ft, AuthorizeRunOptions as G, SmartAccountMethods as Gn, ActivityAnnotationInput as Gt, RoleDefinition as H, isSettingUpLifecycle as Hn, InboxItem as Ht, OrgTemplate as I, ResolvedTarget as In, ActorRequestsMethods as It, PayrollGroupInput as J, ClientRequests as Jn, ActivityItem as Jt, PayrollEngagementTerms as K, AuthMethods as Kn, ActivityDetail as Kt, OrgView as L, TargetReference as Ln, AddressBookAddInput as Lt, MemberStatus as M, PaymentsMethods as Mn, ActorProfileMethods as Mt, MemberView as N, PaymentsPayInput as Nn, ActorRelationshipMethods as Nt, CreateOrgInput as O, PaymentMoney as On, InvocationControls as Or, PersonOnboardingInput as Ot, OrgMethods as P, RecipientResolution as Pn, ActorRequest as Pt, PayrollOptions as Q, AuthorityRef as Qn, ActivityPage as Qt, OrganizationAccess as R, TargetsMethods as Rn, AddressBookEntry as Rt, SystemMethods as S, Payment as Sn, Readiness as Sr, OnboardingMethods as St, CurrentUserContext as T, PaymentDocumentKind as Tn, isClaimed as Tr, OrganizationOnboardingOptions as Tt, RoleView as U, CompleteProfileInput as Un, InboxMethods as Ut, ResendInviteTokenInput as V, AccountSetupStep as Vn, InboxApproveInput as Vt, AuthorizeRunInput as W, IdentityMethods as Wn, ActivityAnnotation as Wt, PayrollGroupsMethods as X, OrgSetupStep as Xn, ActivityListParams as Xt, PayrollGroupMember as Y, OrgLifecycle as Yn, ActivityKind as Yt, PayrollMethods as Z, PayoutAddress as Zn, ActivityMethods as Zt, CreateCapxulClientInput as _, MovementActivityEvidence as _n, TelemetryPort as _r, OrgMe as _t, ObservationContext as a, DepositInstructions as an, ActorRef as ar, OrganizationPaymentInput as at, IdentityRuntimeSendResult as b, OfframpQuoteInput as bn, IdentityState as br, AccountsMethods as bt, HostObservability as c, DestinationKind as cn, SubmittedPermissionExecution as cr, PermissionAssignInput as ct, postHogObservability as d, DestinationRail as dn, PAYMENT_STATUSES as dr, PermissionMethods as dt, ActivityReference as en, ClientRequestView as er, PayrollRunItemInput as et, OpenfortBrowserAuth as f, DestinationRemoveInput as fn, PaymentStatus$1 as fr, PermissionOptions as ft, CapxulClient as g, MeProfile as gn, TelemetryIdentifyInput as gr, Budget as gt, createOpenfortBrowserSigner as h, MeMethods as hn, TelemetryGroupInput as hr, PermissionReadResult as ht, ObservationAdapter as i, ActorReference as in, PaymentDocumentVerification as ir, OrganizationPaymentBatchInput as it, MemberIdentityProjection as j, PaymentType as jn, ActorProfile as jt, DetectPendingOrgInvitationsResult as k, PaymentStatus as kn, ReadyAccountLifecycle as kt, PostHogObservabilityClient as l, DestinationListInput as ln, InboxStatus as lr, PermissionChangeInput as lt, OpenfortBrowserSignerBootstrap as m, FinancialOpsMethods as mn, TelemetryEvent as mr, PermissionRevokeInput as mt, ProductionSignerControls as n, ActivitySummaryParams as nn, PaymentDocumentReadRef as nr, PayrollRuns as nt, ObservationDelivery as o, Destination as on, CurrentHoldings as or, OrganizationPaymentItemInput as ot, OpenfortBrowserSigner as p, DestinationsMethods as pn, RequestStatus as pr, PermissionReplaceInput as pt, PayrollGroup as q, AccountSetupPolicy as qn, ActivityFilter as qt, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as r, ActivitySummaryTotal as rn, PaymentDocumentRender as rr, PayrollTermsUnit as rt, SdkFailureObservation as s, DestinationAddInput as sn, Permission as sr, OrganizationPaymentsMethods as st, CapxulClientInput as t, ActivitySummary as tn, PaymentDocumentDownload as tr, PayrollRunStatus as tt, PostHogObservabilityOptions as u, DestinationPayload as un, PAYMENT_DIRECTIONS as ur, PermissionCreateInput as ut, IdentityProfileDetails as v, OfframpMethods as vn, Destination$1 as vr, OrgMeMethod as vt, MediaMethods as w, PaymentDirection as wn, destination as wr, OrganizationOnboardingInput as wt, HoldingsMethods as x, OfframpStatus as xn, OrgLane as xr, CompletedPersonProfile as xt, IdentityRuntime as y, OfframpQuote as yn, IdentityEvent as yr, OrgMeOptions as yt, OrganizationAccount as z, fingerprintPaymentIntent as zn, AddressBookLabelInput as zt };