@capxul/sdk-react 4.2.0 → 4.20.0-beta.10

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.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { A as entered, C as CreateOrganizationFailure, D as OrganizationDetails, E as InvocationOptions, F as useCapxulTransitions, M as useCapxulDestination, N as useCapxulIdentity, O as ProfileDetails, P as useCapxulSend, S as CapxulSend, T as Destination, _ as ReadyDestination, a as AuthenticationSlots, b as Slot, c as ControllerAction, d as OnboardingControllerProps, f as OrgFailure, g as ProfileSlotProps, h as PendingAuthState, i as AuthenticatedState, j as useCapxulAuth, k as SendResult, l as FaultedState, m as OtpPendingState, n as AccountProgress, o as CapxulAuthenticationController, p as OrgProgress, r as ActionResult, s as CapxulOnboardingController, t as AccountFailure, u as NavigationAction, v as RetryAction, w as CreateOrganizationSubmission, x as CapxulAuth, y as SignedOutState } from "./controllers-BWmKRFy6.mjs";
2
2
  import { ReactNode, RefCallback } from "react";
3
3
  import { QueryClient, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
4
- import { Account, AccountRequirement, ActivityAnnotation, ActivityAnnotationInput, ActivityDetail, ActivityKind, ActivityListParams, ActivityPage, ActivityPhase, ActivityRange, ActivityReference, ActorReference, AddressBookEntry, BudgetId, CapxulClient, CapxulError, CapxulResult, CapxulSigner, CreateOrgInput, CurrentHoldings, HostObservability, IdentityDestination, InviteMemberInput, MemberView, Money, MoneyParseErrorReason, OrgId, OrgView, OrganizationPaymentBatchInput, OrganizationPaymentInput, PartyId, Payment, PaymentDirection, PaymentDocumentRef, PaymentDocumentRender, PaymentStatus, PaymentTiming, PaymentType, PaymentsPayInput, PayrollGroupId, PayrollGroupInput, PayrollRunId, PayrollRunStatus, Permission, PermissionMethods, PermissionReadResult, Profile, RoleView, SubmittedPermissionExecution, isClaimed, isRestoring } from "@capxul/sdk";
4
+ import { Account, AccountRequirement, ActivityAnnotation, ActivityAnnotationInput, ActivityDetail, ActivityKind, ActivityListParams, ActivityPage, ActivityPhase, ActivityRange, ActivityReference, ActivitySummaryTotal, ActorReference, AddressBookEntry, AssetAmount, AssetId, BudgetId, CapxulClient, CapxulError, CapxulResult, CapxulSigner, CreateOrgInput, CurrentHoldings, HostObservability, IdentityDestination, IdentityState, MemberView, Money, MoneyParseErrorReason, OrgId, OrgView, OrganizationAccess, OrganizationPaymentBatchInput, OrganizationPaymentInput, PartyId, Payment, PaymentDirection, PaymentDocumentDownload, PaymentDocumentReadRef, PaymentDocumentRef, PaymentDocumentRender, PaymentStatus, PaymentTiming, PaymentType, PaymentsPayInput, PayrollGroupId, PayrollGroupInput, PayrollRunId, PayrollRunStatus, Permission, PermissionMethods, PermissionReadResult, Profile, RoleView, SubmittedPermissionExecution, isClaimed, isRestoring } from "@capxul/sdk";
5
5
  //#region src/provider.d.ts
6
6
  type CapxulProviderSharedProps = {
7
7
  /** Bring your own QueryClient; otherwise the provider creates one. */
@@ -28,6 +28,11 @@ type CapxulProviderPublishableKeyProps = CapxulProviderSharedProps & {
28
28
  * route cross-origin for the publishable key's allowed origins.
29
29
  */
30
30
  readonly bootstrapBaseUrl?: string;
31
+ /**
32
+ * AUTH A3. Pass `"explicit"` on `/connect` so restore and OTP do not write
33
+ * Profile, Account, or invitations. Default automatic.
34
+ */
35
+ readonly accountSetup?: "automatic" | "explicit";
31
36
  };
32
37
  /**
33
38
  * Node / server / test path — a pre-built client is supplied; lifecycle stays
@@ -77,7 +82,7 @@ declare function useCapxulAccountBalance(options?: UseCapxulAccountBalanceOption
77
82
  //#region src/hooks/use-capxul-account-fund.d.ts
78
83
  type UseCapxulAccountFundReturn = UseMutationResult<{
79
84
  readonly txHash: string;
80
- }, CapxulError, Money>;
85
+ }, CapxulError, AssetAmount>;
81
86
  declare function useCapxulAccountFund(): UseCapxulAccountFundReturn;
82
87
  //#endregion
83
88
  //#region src/hooks/use-capxul-money.d.ts
@@ -143,7 +148,7 @@ declare function useCapxulHoldings(params?: UseCapxulHoldingsParams): UseQueryRe
143
148
  * List the Organizations that the current user can access. Binds directly to
144
149
  * the locked `capxul.orgs()` SDK method.
145
150
  */
146
- type UseCapxulOrgsReturn = UseQueryResult<readonly OrgView[], CapxulError>;
151
+ type UseCapxulOrgsReturn = UseQueryResult<readonly OrganizationAccess[], CapxulError>;
147
152
  type UseCapxulOrgsOptions = {
148
153
  /**
149
154
  * Gate the query on auth readiness. `client.orgs()` is a session-scoped
@@ -199,15 +204,6 @@ declare function useCapxulOrgTreasury(orgId: OrgId | undefined, options?: UseCap
199
204
  type UseCapxulCreateOrgReturn = UseMutationResult<OrgView, CapxulError, CreateOrgInput>;
200
205
  declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
201
206
  //#endregion
202
- //#region src/hooks/use-capxul-invite-member.d.ts
203
- /**
204
- * Invite a member to an Organization by email. The hook uses the closed-over `orgId`.
205
- * It binds directly to
206
- * `capxul.org(orgId).invite(input)`. On success, invalidates the member list.
207
- */
208
- type UseCapxulInviteMemberReturn = UseMutationResult<MemberView, CapxulError, InviteMemberInput>;
209
- declare function useCapxulInviteMember(orgId: OrgId | undefined): UseCapxulInviteMemberReturn;
210
- //#endregion
211
207
  //#region src/headless/journey/journey-state.d.ts
212
208
  type OnboardingIntent = "personal" | "organization";
213
209
  type OnboardingStep = "profile" | "organization" | "provisioning";
@@ -383,9 +379,9 @@ interface Contact {
383
379
  interface ContactRow extends Contact {
384
380
  /** Ours: one initials rule, not one copy per screen. */
385
381
  readonly initials: string;
386
- readonly rename: (name: string) => void;
387
- readonly hide: () => void;
388
- readonly unhide: () => void;
382
+ readonly rename: (name: string, options?: InvocationOptions) => void;
383
+ readonly hide: (options?: InvocationOptions) => void;
384
+ readonly unhide: (options?: InvocationOptions) => void;
389
385
  }
390
386
  /** ADR-0023 R1: refusal CODES, never sentences — the app owns the words. */
391
387
  type ContactsRefusal = "loading" | "org-unavailable" | "unavailable";
@@ -421,7 +417,13 @@ interface ContactsListOptions {
421
417
  interface ContactsAddSlice {
422
418
  readonly value: string;
423
419
  readonly change: (text: string) => void;
424
- readonly submit: () => void;
420
+ /**
421
+ * #1960 R02: hand it the options the screen captured BEFORE the click. The
422
+ * same snapshot reaches the SDK add call and comes back on `onAdded`/
423
+ * `onFailed`, so the UI observation and the operation share one identity even
424
+ * when the reply lands after an account switch. Omitted stays omitted.
425
+ */
426
+ readonly submit: (options?: InvocationOptions) => void;
425
427
  readonly isSubmitting: boolean;
426
428
  readonly blocked: boolean;
427
429
  readonly blockedReason: ContactsAddBlockedReason | null;
@@ -431,12 +433,17 @@ interface ContactsAddSlice {
431
433
  //#region src/headless/contacts/contacts.d.ts
432
434
  interface CapxulContactsProps {
433
435
  readonly actor: ContactsActor;
434
- readonly onAdded: (contact: Contact) => void;
436
+ /**
437
+ * `options` is exactly what the caller handed `.Add.submit` or a row verb, so
438
+ * the screen's own observation of the finished action can reuse the attempt
439
+ * identity the SDK operation ran under (#1960 R02).
440
+ */
441
+ readonly onAdded: (contact: Contact, options?: InvocationOptions) => void;
435
442
  /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
436
- readonly onFailed: (error: CapxulError) => void;
443
+ readonly onFailed: (error: CapxulError, options?: InvocationOptions) => void;
437
444
  readonly children: ReactNode;
438
445
  }
439
- declare function Root$6({ actor, onAdded, onFailed, children }: CapxulContactsProps): import("react/jsx-runtime").JSX.Element;
446
+ declare function Root$7({ actor, onAdded, onFailed, children }: CapxulContactsProps): import("react/jsx-runtime").JSX.Element;
440
447
  declare function Summary$3({ children }: {
441
448
  readonly children: (slice: ContactsSummarySlice) => ReactNode;
442
449
  }): import("react/jsx-runtime").JSX.Element;
@@ -447,7 +454,7 @@ declare function Add({ children }: {
447
454
  readonly children: (slice: ContactsAddSlice) => ReactNode;
448
455
  }): import("react/jsx-runtime").JSX.Element;
449
456
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
450
- declare const CapxulContacts: typeof Root$6 & {
457
+ declare const CapxulContacts: typeof Root$7 & {
451
458
  Summary: typeof Summary$3;
452
459
  List: typeof List;
453
460
  Add: typeof Add;
@@ -467,6 +474,7 @@ interface ActivityReceipt {
467
474
  */
468
475
  type ActivityRow = {
469
476
  readonly kind: "payment";
477
+ readonly execution?: Payment["execution"];
470
478
  readonly reference: ActivityReference;
471
479
  readonly direction: PaymentDirection;
472
480
  readonly counterpartyLabel: string;
@@ -499,17 +507,19 @@ type ActivityRow = {
499
507
  */
500
508
  type SummaryWindow = "all" | "last30days" | ActivityRange;
501
509
  /**
502
- * Finished money strings for ONE currency bucket, so no consumer indexes an
503
- * array of per-currency totals. All four strings are `null` and `count` is `0`
510
+ * Finished valuation strings in the display currency. Unrated assets remain
511
+ * separate. All four strings are `null` and `count` is `0`
504
512
  * when the window holds no activity — we say there is nothing, the app says it
505
513
  * in its own words.
506
514
  */
507
515
  interface ActivitySummarySlice {
516
+ readonly readWarning?: ActivityPage["readWarning"];
508
517
  readonly currency: string | null;
509
518
  readonly moneyIn: string | null;
510
519
  readonly moneyOut: string | null;
511
520
  readonly net: string | null;
512
521
  readonly pending: string | null;
522
+ readonly unrated: readonly ActivitySummaryTotal[];
513
523
  /** A count is not money, so it is not formatted. */
514
524
  readonly count: number;
515
525
  readonly isLoading: boolean;
@@ -541,11 +551,17 @@ interface ActivitySearchSlice {
541
551
  readonly change: (text: string) => void;
542
552
  }
543
553
  interface ActivityRowsSlice {
554
+ readonly readWarning?: ActivityPage["readWarning"];
544
555
  /** Already filtered and already searched. */
545
556
  readonly rows: readonly ActivityRow[];
546
557
  readonly isLoading: boolean;
547
558
  readonly error: CapxulError | null;
548
- readonly retry: () => void;
559
+ /**
560
+ * #1960 R02: pass the options captured before the retry was selected and the
561
+ * re-read runs under the same attempt identity as the UI observation. Omit
562
+ * them and the read keeps its own invocation context.
563
+ */
564
+ readonly retry: (options?: InvocationOptions) => void;
549
565
  /** Server read time of the newest page, so the app can say which read is older. */
550
566
  readonly observedAt: number | null;
551
567
  }
@@ -565,9 +581,14 @@ interface ActivityLoadMoreSlice {
565
581
  readonly sentinelRef: RefCallback<HTMLElement>;
566
582
  }
567
583
  interface ActivityDetailSlice {
568
- /** ONE finished document, never the array, so no consumer writes `documents[0]`. */
569
- readonly receiptDocument: PaymentDocumentRef | null;
570
- readonly openReceiptDocument: () => Promise<PaymentDocumentRender>;
584
+ /** Current Payment state from the existing detail read; absent for Movements. */
585
+ readonly payment?: Pick<Payment, "status" | "execution">;
586
+ readonly documents: readonly PaymentDocumentRef[];
587
+ readonly selectedDocument: PaymentDocumentRef | null;
588
+ readonly selectDocument: (ref: PaymentDocumentReadRef) => void;
589
+ readonly renderDocument: () => Promise<PaymentDocumentRender>;
590
+ /** Return exact bytes on a deliberate action. The host owns the download URL. */
591
+ readonly downloadDocument: () => Promise<PaymentDocumentDownload>;
571
592
  readonly isOpeningDocument: boolean;
572
593
  readonly memo: string;
573
594
  readonly setMemo: (text: string) => void;
@@ -583,13 +604,15 @@ interface ActivityDetailSlice {
583
604
  readonly error: CapxulError | null;
584
605
  }
585
606
  interface CsvExport {
607
+ readonly readWarning?: ActivityPage["readWarning"];
586
608
  readonly text: string;
587
609
  readonly rowCount: number;
588
610
  /** The 5,000-row ceiling was reached and rows were left unread. */
589
611
  readonly truncated: boolean;
590
612
  }
591
613
  interface ActivityExportSlice {
592
- readonly toCsv: () => Promise<CsvExport>;
614
+ /** Same contract as `retry`: the export's pages run under the caller's attempt. */
615
+ readonly toCsv: (options?: InvocationOptions) => Promise<CsvExport>;
593
616
  readonly isExporting: boolean;
594
617
  }
595
618
  //#endregion
@@ -605,7 +628,7 @@ interface CapxulActivityProps {
605
628
  readonly pageSize?: number;
606
629
  readonly children: ReactNode;
607
630
  }
608
- declare function Root$5({ actor, pageSize, children }: CapxulActivityProps): import("react/jsx-runtime").JSX.Element;
631
+ declare function Root$6({ actor, pageSize, children }: CapxulActivityProps): import("react/jsx-runtime").JSX.Element;
609
632
  /**
610
633
  * The one part that holds a query rather than reading the engine's: it takes a
611
634
  * `window` prop, and two placements can ask for different windows, so a single
@@ -636,7 +659,7 @@ declare function Export({ children }: {
636
659
  readonly children: (slice: ActivityExportSlice) => ReactNode;
637
660
  }): import("react/jsx-runtime").JSX.Element;
638
661
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
639
- declare const CapxulActivity: typeof Root$5 & {
662
+ declare const CapxulActivity: typeof Root$6 & {
640
663
  Summary: typeof Summary$2;
641
664
  Filters: typeof Filters;
642
665
  Search: typeof Search;
@@ -671,7 +694,7 @@ type SentPayment = {
671
694
  /** The backend payment row. */
672
695
  readonly payment: Payment;
673
696
  /** What we parsed and sent — `.value` is the comma-stripped major-unit string. */
674
- readonly amount: Money;
697
+ readonly amount: AssetAmount;
675
698
  /** The trimmed text the person typed — the app's success toast interpolates it. */
676
699
  readonly recipient: string;
677
700
  };
@@ -679,7 +702,7 @@ type SentPayment = {
679
702
  * Refusal CODES, never sentences (#1447 ruling 8). The app maps each code to
680
703
  * the words it already prints; no English refusal string ships from here.
681
704
  */
682
- type CapxulSendMoneyBlockedReason = "signer-not-ready" | "amount-invalid" | "recipient-unresolved" | "no-source" | "no-asset";
705
+ type CapxulSendMoneyBlockedReason = "signer-not-ready" | "amount-invalid" | "recipient-unresolved" | "no-source" | "no-asset" | "asset-unnamed";
683
706
  /**
684
707
  * One Budget the member can spend from — the id the payment carries, and
685
708
  * nothing else.
@@ -704,7 +727,7 @@ interface SendMoneySourceSlice {
704
727
  readonly isPending: boolean;
705
728
  }
706
729
  interface SendMoneyAssetOption {
707
- readonly id: string;
730
+ readonly id: AssetId;
708
731
  readonly symbol: string;
709
732
  readonly availableDisplay: string;
710
733
  }
@@ -739,7 +762,7 @@ interface CapxulSendMoneyProps {
739
762
  readonly onFailed: (error: CapxulError) => void;
740
763
  readonly children: ReactNode;
741
764
  }
742
- declare function Root$4({ actor, onSent, onFailed, children }: CapxulSendMoneyProps): import("react/jsx-runtime").JSX.Element;
765
+ declare function Root$5({ actor, onSent, onFailed, children }: CapxulSendMoneyProps): import("react/jsx-runtime").JSX.Element;
743
766
  declare function Source({ children }: {
744
767
  readonly children: (slice: SendMoneySourceSlice) => ReactNode;
745
768
  }): import("react/jsx-runtime").JSX.Element;
@@ -756,7 +779,7 @@ declare function Actions$1({ children }: {
756
779
  readonly children: (slice: SendMoneyActionsSlice) => ReactNode;
757
780
  }): import("react/jsx-runtime").JSX.Element;
758
781
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
759
- declare const CapxulSendMoney: typeof Root$4 & {
782
+ declare const CapxulSendMoney: typeof Root$5 & {
760
783
  Source: typeof Source;
761
784
  Asset: typeof Asset$1;
762
785
  Amount: typeof Amount;
@@ -788,7 +811,7 @@ interface CapxulOrgMemberProps {
788
811
  readonly orgId: OrgId | string | undefined;
789
812
  readonly children: ReactNode;
790
813
  }
791
- declare function Root$3({ orgId, children }: CapxulOrgMemberProps): import("react/jsx-runtime").JSX.Element;
814
+ declare function Root$4({ orgId, children }: CapxulOrgMemberProps): import("react/jsx-runtime").JSX.Element;
792
815
  /**
793
816
  * One part serves all four denial idioms the app already uses: disabled with no
794
817
  * explanation, disabled plus a native `title`, a whole-surface swap, and
@@ -803,7 +826,7 @@ declare function Standing({ children }: {
803
826
  readonly children: (slice: OrgMemberStandingSlice) => ReactNode;
804
827
  }): import("react/jsx-runtime").JSX.Element;
805
828
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
806
- declare const CapxulOrgMember: typeof Root$3 & {
829
+ declare const CapxulOrgMember: typeof Root$4 & {
807
830
  Can: typeof Can;
808
831
  Standing: typeof Standing;
809
832
  };
@@ -816,8 +839,19 @@ type DashboardScope = {
816
839
  readonly orgId?: string;
817
840
  };
818
841
  type DashboardAccessPhase = "checking" | "error" | "redirect" | "granted";
842
+ /**
843
+ * Which of the three probes produced the error the screen is showing. The
844
+ * error code alone cannot say: a provider failure reads the same whether the
845
+ * session read, the membership list or the lifecycle read raised it, and a
846
+ * consumer that reports a displayed gate error has to keep those apart
847
+ * (#1963 R05-2). It names the SOURCE only; `retry` still re-runs every failed
848
+ * probe, exactly as before.
849
+ */
850
+ type DashboardAccessProbe = "session" | "membership" | "lifecycle";
819
851
  interface DashboardAccessErrorSlice {
820
852
  readonly error: CapxulError;
853
+ /** The probe the surfaced error came from, in the frozen precedence order. */
854
+ readonly probe: DashboardAccessProbe;
821
855
  /** Re-runs each failed probe. */
822
856
  readonly retry: () => void;
823
857
  }
@@ -828,14 +862,20 @@ interface CapxulDashboardAccessProps {
828
862
  readonly scope: DashboardScope;
829
863
  readonly children: ReactNode;
830
864
  }
831
- declare function Root$2({ scope, children }: CapxulDashboardAccessProps): import("react/jsx-runtime").JSX.Element;
865
+ declare function Root$3({ scope, children }: CapxulDashboardAccessProps): import("react/jsx-runtime").JSX.Element;
832
866
  /** Hands nothing — today's app renders `null` here, exactly as it does now. */
833
- declare function Checking({ children }: {
867
+ declare function Checking$1({ children }: {
834
868
  readonly children?: ReactNode;
835
869
  }): import("react/jsx-runtime").JSX.Element | null;
836
870
  declare function DashboardError({ children }: {
837
871
  readonly children: (slice: DashboardAccessErrorSlice) => ReactNode;
838
872
  }): import("react/jsx-runtime").JSX.Element | null;
873
+ /**
874
+ * Hands the destination and draws nothing. Reaching this part is a REQUEST to
875
+ * navigate, never an arrival: the app may cancel or supersede it, so nothing
876
+ * here — and nothing a consumer hangs off it — may claim a completed redirect
877
+ * (#1963 R05-1). The destination page's own normalized pageview proves arrival.
878
+ */
839
879
  declare function Redirect({ children }: {
840
880
  readonly children: (slice: DashboardAccessRedirectSlice) => ReactNode;
841
881
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -843,8 +883,8 @@ declare function Granted({ children }: {
843
883
  readonly children?: ReactNode;
844
884
  }): import("react/jsx-runtime").JSX.Element | null;
845
885
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
846
- declare const CapxulDashboardAccess: typeof Root$2 & {
847
- Checking: typeof Checking;
886
+ declare const CapxulDashboardAccess: typeof Root$3 & {
887
+ Checking: typeof Checking$1;
848
888
  Error: typeof DashboardError;
849
889
  Redirect: typeof Redirect;
850
890
  Granted: typeof Granted;
@@ -874,8 +914,14 @@ interface PayrollSummarySlice {
874
914
  }
875
915
  interface PayrollGroupsSlice {
876
916
  readonly groups: readonly PayrollGroupRow[];
877
- readonly save: (input: PayrollGroupInput) => Promise<CapxulResult<PayrollGroupRow>>;
878
- readonly remove: (id: PayrollGroupId) => Promise<CapxulResult<void>>;
917
+ /**
918
+ * R13 (#1968): `options` is the browser attempt the caller captured before the
919
+ * employer pressed the button. It reaches the SDK operation unchanged, so the
920
+ * group's `ui_payroll_action_completed` and the durable `payroll_group_changed`
921
+ * share one correlation. Absent, the write keeps its own invocation context.
922
+ */
923
+ readonly save: (input: PayrollGroupInput, options?: InvocationOptions) => Promise<CapxulResult<PayrollGroupRow>>;
924
+ readonly remove: (id: PayrollGroupId, options?: InvocationOptions) => Promise<CapxulResult<void>>;
879
925
  readonly isSaving: boolean;
880
926
  readonly isLoading: boolean;
881
927
  readonly error: CapxulError | null;
@@ -886,7 +932,7 @@ interface CapxulPayrollProps {
886
932
  readonly orgId: OrgId | undefined;
887
933
  readonly children: ReactNode;
888
934
  }
889
- declare function Root$1({ orgId, children }: CapxulPayrollProps): import("react/jsx-runtime").JSX.Element;
935
+ declare function Root$2({ orgId, children }: CapxulPayrollProps): import("react/jsx-runtime").JSX.Element;
890
936
  declare function Summary$1({ children }: {
891
937
  readonly children: (slice: PayrollSummarySlice) => ReactNode;
892
938
  }): import("react/jsx-runtime").JSX.Element;
@@ -898,7 +944,7 @@ declare function Groups({ children }: {
898
944
  * There is NO `.Runs` part (ruling Q6): no shipped region has the right shape
899
945
  * for a run list, and a part without a production caller may not ship.
900
946
  */
901
- declare const CapxulPayroll: typeof Root$1 & {
947
+ declare const CapxulPayroll: typeof Root$2 & {
902
948
  Summary: typeof Summary$1;
903
949
  Groups: typeof Groups;
904
950
  };
@@ -920,10 +966,10 @@ interface PayrollRecipientOption {
920
966
  //#region src/headless/payroll/use-payroll-run.d.ts
921
967
  /**
922
968
  * Refusal CODES, never sentences (ADR-0023 R1). `blockedReason` names the FIRST
923
- * false fact in the fixed order of the contract's seven-row table, so the same
924
- * composer state always yields the same code.
969
+ * false fact in the fixed order below, so the same composer state always
970
+ * yields the same code.
925
971
  */
926
- type CapxulPayrollRunBlockedReason = "signer-not-ready" | "no-source" | "ambiguous-source" | "no-asset" | "no-recipients" | "amount-invalid" | "insufficient-funds";
972
+ type CapxulPayrollRunBlockedReason = "signer-not-ready" | "no-source" | "ambiguous-source" | "no-asset" | "no-recipients" | "amount-invalid" | "insufficient-funds" | "asset-unnamed";
927
973
  interface PayrollRunGroupOption {
928
974
  readonly id: PayrollGroupId;
929
975
  readonly label: string;
@@ -950,7 +996,7 @@ interface PayrollRunAmountEntry {
950
996
  /** True while the value is one we seeded and the employer has not edited. */
951
997
  readonly prefilled: boolean;
952
998
  /** The treasury asset's currency. Rows stay absent until this value exists. */
953
- readonly currency: Money["currency"];
999
+ readonly currency: string;
954
1000
  }
955
1001
  interface PayrollRunAmountsSlice {
956
1002
  readonly entries: readonly PayrollRunAmountEntry[];
@@ -967,7 +1013,14 @@ interface PayrollRunSummarySlice {
967
1013
  interface PayrollRunActionsSlice {
968
1014
  readonly recovery: "none" | "restoring" | "required" | "unavailable";
969
1015
  readonly recoveryError: CapxulError | null;
970
- readonly submit: () => void;
1016
+ /**
1017
+ * R13 (#1968): `options` is the browser attempt captured before the employer
1018
+ * confirmed. It reaches `authorizeRun` unchanged, so the sheet's own
1019
+ * `ui_payroll_action_completed` and the durable `payroll_run_transitioned`
1020
+ * rows share one correlation. It is NEVER written into the persisted draft —
1021
+ * a restored run keeps its own identity, not a stale attempt's.
1022
+ */
1023
+ readonly submit: (options?: InvocationOptions) => void;
971
1024
  readonly isSubmitting: boolean;
972
1025
  readonly blocked: boolean;
973
1026
  readonly blockedReason: CapxulPayrollRunBlockedReason | null;
@@ -996,7 +1049,7 @@ interface CapxulPayrollRunProps {
996
1049
  readonly onFailed: (error: CapxulError) => void;
997
1050
  readonly children: ReactNode;
998
1051
  }
999
- declare function Root({ orgId, prefill, onRun, onFailed, children }: CapxulPayrollRunProps): import("react/jsx-runtime").JSX.Element;
1052
+ declare function Root$1({ orgId, prefill, onRun, onFailed, children }: CapxulPayrollRunProps): import("react/jsx-runtime").JSX.Element;
1000
1053
  declare function Recipients({ children }: {
1001
1054
  readonly children: (slice: PayrollRunRecipientsSlice) => ReactNode;
1002
1055
  }): import("react/jsx-runtime").JSX.Element;
@@ -1013,7 +1066,7 @@ declare function Actions({ children }: {
1013
1066
  readonly children: (slice: PayrollRunActionsSlice) => ReactNode;
1014
1067
  }): import("react/jsx-runtime").JSX.Element;
1015
1068
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
1016
- declare const CapxulPayrollRun: typeof Root & {
1069
+ declare const CapxulPayrollRun: typeof Root$1 & {
1017
1070
  Recipients: typeof Recipients;
1018
1071
  Amounts: typeof Amounts;
1019
1072
  Asset: typeof Asset;
@@ -1021,6 +1074,64 @@ declare const CapxulPayrollRun: typeof Root & {
1021
1074
  Actions: typeof Actions;
1022
1075
  };
1023
1076
  //#endregion
1077
+ //#region src/headless/client-connection/use-client-connection.d.ts
1078
+ interface OtpSlice {
1079
+ readonly email: string;
1080
+ readonly pending: boolean;
1081
+ readonly canResend: boolean;
1082
+ readonly verifyCode: (code: string) => Promise<void>;
1083
+ readonly resend: () => Promise<void>;
1084
+ }
1085
+ interface ConsentSlice {
1086
+ readonly verifiedEmail: string;
1087
+ readonly clientLabel: string;
1088
+ readonly scopeCodes: readonly string[];
1089
+ readonly purpose: "login" | "signup";
1090
+ readonly setupState: "not_required" | "new" | "resumable";
1091
+ readonly pending: boolean;
1092
+ readonly accept: () => Promise<void>;
1093
+ readonly cancel: () => Promise<void>;
1094
+ }
1095
+ interface CompleteSlice {
1096
+ readonly outcome: "connected";
1097
+ }
1098
+ interface FailureSlice {
1099
+ readonly code: string;
1100
+ readonly field?: string;
1101
+ readonly retry: () => Promise<void>;
1102
+ readonly cancel: () => Promise<void>;
1103
+ }
1104
+ //#endregion
1105
+ //#region src/headless/client-connection/client-connection.d.ts
1106
+ interface CapxulClientConnectionProps {
1107
+ readonly client: CapxulClient;
1108
+ readonly requestId: string;
1109
+ readonly children: ReactNode;
1110
+ }
1111
+ declare function Root({ client, requestId, children }: CapxulClientConnectionProps): import("react/jsx-runtime").JSX.Element;
1112
+ declare function Checking({ children }: {
1113
+ readonly children: ReactNode;
1114
+ }): import("react/jsx-runtime").JSX.Element | null;
1115
+ declare function Otp({ children }: {
1116
+ readonly children: (slice: OtpSlice) => ReactNode;
1117
+ }): import("react/jsx-runtime").JSX.Element | null;
1118
+ declare function Consent({ children }: {
1119
+ readonly children: (slice: ConsentSlice) => ReactNode;
1120
+ }): import("react/jsx-runtime").JSX.Element | null;
1121
+ declare function Complete({ children }: {
1122
+ readonly children: (slice: CompleteSlice) => ReactNode;
1123
+ }): import("react/jsx-runtime").JSX.Element | null;
1124
+ declare function Failure({ children }: {
1125
+ readonly children: (slice: FailureSlice) => ReactNode;
1126
+ }): import("react/jsx-runtime").JSX.Element | null;
1127
+ declare const CapxulClientConnection: typeof Root & {
1128
+ Checking: typeof Checking;
1129
+ Otp: typeof Otp;
1130
+ Consent: typeof Consent;
1131
+ Complete: typeof Complete;
1132
+ Failure: typeof Failure;
1133
+ };
1134
+ //#endregion
1024
1135
  //#region src/internal/reactivity-keys.d.ts
1025
1136
  declare const capxulKeys: {
1026
1137
  root: readonly ["capxul"];
@@ -1036,7 +1147,7 @@ declare const capxulKeys: {
1036
1147
  orgRoles: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "roles"];
1037
1148
  orgTreasury: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "treasury"];
1038
1149
  orgPermissions: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "permissions"];
1039
- orgMe: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "me"];
1150
+ orgMe: (orgId: OrgId | undefined, account: string | undefined) => readonly ["capxul", "org", "pending" | OrgId, "me", string];
1040
1151
  orgLifecycle: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "lifecycle"];
1041
1152
  contacts: (scope: string) => readonly ["capxul", "contacts", string];
1042
1153
  contactsList: (scope: string, includeHidden: boolean) => readonly ["capxul", "contacts", string, "all" | "visible"];
@@ -1051,4 +1162,4 @@ declare const capxulKeys: {
1051
1162
  payment: (paymentId: string | undefined) => readonly ["capxul", "payments", string];
1052
1163
  };
1053
1164
  //#endregion
1054
- export { type AccountFailure, type AccountProgress, type ActionResult, type ActivityDetailSlice, type ActivityExportSlice, type ActivityFilterValues, type ActivityFiltersSlice, type ActivityLoadMoreSlice, type ActivityReceipt, type ActivityRow, type ActivityRowsSlice, type ActivitySearchSlice, type ActivitySummarySlice, type AuthenticatedState, type AuthenticationSlots, type CanReason, CapxulActivity, type CapxulActivityProps, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulContacts, type CapxulContactsProps, CapxulDashboardAccess, type CapxulDashboardAccessProps, CapxulOnboardingController, CapxulOrgMember, type CapxulOrgMemberProps, CapxulPayroll, type CapxulPayrollProps, CapxulPayrollRun, type CapxulPayrollRunBlockedReason, type CapxulPayrollRunProps, CapxulProvider, type CapxulProviderProps, type CapxulSend, CapxulSendMoney, type CapxulSendMoneyBlockedReason, type CapxulSendMoneyProps, type Contact, type ContactRelationship, type ContactRow, type ContactsActor, type ContactsAddBlockedReason, type ContactsAddError, type ContactsAddSlice, type ContactsListOptions, type ContactsListSlice, type ContactsRefusal, type ContactsSummarySlice, type ControllerAction, type CreateOrganizationFailure, type CreateOrganizationSubmission, type CsvExport, type DashboardAccessErrorSlice, type DashboardAccessPhase, type DashboardAccessRedirectSlice, type DashboardScope, type Destination, type FaultedState, type HandleAvailability, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgMemberAction, type OrgMemberCanSlice, type OrgMemberStanding, type OrgMemberStandingSlice, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PayrollGroupRow, type PayrollGroupsSlice, type PayrollRecipientOption, type PayrollRunActionsSlice, type PayrollRunAmountEntry, type PayrollRunAmountsSlice, type PayrollRunAssetSlice, type PayrollRunGroupOption, type PayrollRunPrefill, type PayrollRunRecipientsSlice, type PayrollRunStatus, type PayrollRunSummarySlice, type PayrollSummarySlice, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendActor, type SendMoneyActionsSlice, type SendMoneyAmountSlice, type SendMoneyAssetError, type SendMoneyAssetOption, type SendMoneyAssetSlice, type SendMoneyRecipientSlice, type SendMoneyRecipientStatus, type SendMoneySourceError, type SendMoneySourceOption, type SendMoneySourceSlice, type SendResult, type SentPayment, type SentPayrollRun, type SignedOutState, type Slot, type SummaryWindow, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulCreateCommitmentReturn, type UseCapxulCreateOrgReturn, type UseCapxulHandleAvailabilityReturn, type UseCapxulImageUploadReturn, type UseCapxulInviteMemberReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulProfileReturn, type UseCapxulRedirectPaymentReturn, type UseCapxulUploadImageReturn, acknowledgeOnboardingDestination, activeOnboardingRecovery, capxulKeys, clearOnboardingJourney, currentOnboardingJourneyId, entered, invalidateOnboardingJourneyObservation, isClaimed, isRestoring, loadOnboardingJourney, onboardingJourneyPosition, saveOnboardingJourney, startOnboardingJourney, useCapxul, useCapxulAccountBalance, useCapxulAccountFund, useCapxulActivity, useCapxulActivityDetail, useCapxulAnnotateMovement, useCapxulAuth, useCapxulCancelPayment, useCapxulClaimPayment, useCapxulClientOrNull, useCapxulCreateCommitment, useCapxulCreateOrg, useCapxulDestination, useCapxulHandleAvailability, useCapxulHoldings, useCapxulIdentity, useCapxulImageUpload, useCapxulInviteMember, useCapxulOrgMembers, useCapxulOrgRoles, useCapxulOrgTreasury, useCapxulOrganizationPay, useCapxulOrganizationPayBatch, useCapxulOrgs, useCapxulPay, useCapxulPayment, useCapxulPayments, useCapxulPermission, useCapxulPermissionAssign, useCapxulPermissionChange, useCapxulPermissionCreate, useCapxulPermissionReplace, useCapxulPermissionRevoke, useCapxulPermissions, useCapxulProfile, useCapxulRedirectPayment, useCapxulSend, useCapxulTransitions, useCapxulUploadImage };
1165
+ export { type AccountFailure, type AccountProgress, type ActionResult, type ActivityDetailSlice, type ActivityExportSlice, type ActivityFilterValues, type ActivityFiltersSlice, type ActivityLoadMoreSlice, type ActivityReceipt, type ActivityRow, type ActivityRowsSlice, type ActivitySearchSlice, type ActivitySummarySlice, type AuthenticatedState, type AuthenticationSlots, type CanReason, CapxulActivity, type CapxulActivityProps, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulClientConnection, type CapxulClientConnectionProps, CapxulContacts, type CapxulContactsProps, CapxulDashboardAccess, type CapxulDashboardAccessProps, CapxulOnboardingController, CapxulOrgMember, type CapxulOrgMemberProps, CapxulPayroll, type CapxulPayrollProps, CapxulPayrollRun, type CapxulPayrollRunBlockedReason, type CapxulPayrollRunProps, CapxulProvider, type CapxulProviderProps, type CapxulSend, CapxulSendMoney, type CapxulSendMoneyBlockedReason, type CapxulSendMoneyProps, type CompleteSlice as ClientConnectionCompleteSlice, type ConsentSlice as ClientConnectionConsentSlice, type FailureSlice as ClientConnectionFailureSlice, type OtpSlice as ClientConnectionOtpSlice, type Contact, type ContactRelationship, type ContactRow, type ContactsActor, type ContactsAddBlockedReason, type ContactsAddError, type ContactsAddSlice, type ContactsListOptions, type ContactsListSlice, type ContactsRefusal, type ContactsSummarySlice, type ControllerAction, type CreateOrganizationFailure, type CreateOrganizationSubmission, type CsvExport, type DashboardAccessErrorSlice, type DashboardAccessPhase, type DashboardAccessProbe, type DashboardAccessRedirectSlice, type DashboardScope, type Destination, type FaultedState, type HandleAvailability, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgMemberAction, type OrgMemberCanSlice, type OrgMemberStanding, type OrgMemberStandingSlice, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PayrollGroupRow, type PayrollGroupsSlice, type PayrollRecipientOption, type PayrollRunActionsSlice, type PayrollRunAmountEntry, type PayrollRunAmountsSlice, type PayrollRunAssetSlice, type PayrollRunGroupOption, type PayrollRunPrefill, type PayrollRunRecipientsSlice, type PayrollRunStatus, type PayrollRunSummarySlice, type PayrollSummarySlice, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendActor, type SendMoneyActionsSlice, type SendMoneyAmountSlice, type SendMoneyAssetError, type SendMoneyAssetOption, type SendMoneyAssetSlice, type SendMoneyRecipientSlice, type SendMoneyRecipientStatus, type SendMoneySourceError, type SendMoneySourceOption, type SendMoneySourceSlice, type SendResult, type SentPayment, type SentPayrollRun, type SignedOutState, type Slot, type SummaryWindow, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulCreateCommitmentReturn, type UseCapxulCreateOrgReturn, type UseCapxulHandleAvailabilityReturn, type UseCapxulImageUploadReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulProfileReturn, type UseCapxulRedirectPaymentReturn, type UseCapxulUploadImageReturn, acknowledgeOnboardingDestination, activeOnboardingRecovery, capxulKeys, clearOnboardingJourney, currentOnboardingJourneyId, entered, invalidateOnboardingJourneyObservation, isClaimed, isRestoring, loadOnboardingJourney, onboardingJourneyPosition, saveOnboardingJourney, startOnboardingJourney, useCapxul, useCapxulAccountBalance, useCapxulAccountFund, useCapxulActivity, useCapxulActivityDetail, useCapxulAnnotateMovement, useCapxulAuth, useCapxulCancelPayment, useCapxulClaimPayment, useCapxulClientOrNull, useCapxulCreateCommitment, useCapxulCreateOrg, useCapxulDestination, useCapxulHandleAvailability, useCapxulHoldings, useCapxulIdentity, useCapxulImageUpload, useCapxulOrgMembers, useCapxulOrgRoles, useCapxulOrgTreasury, useCapxulOrganizationPay, useCapxulOrganizationPayBatch, useCapxulOrgs, useCapxulPay, useCapxulPayment, useCapxulPayments, useCapxulPermission, useCapxulPermissionAssign, useCapxulPermissionChange, useCapxulPermissionCreate, useCapxulPermissionReplace, useCapxulPermissionRevoke, useCapxulPermissions, useCapxulProfile, useCapxulRedirectPayment, useCapxulSend, useCapxulTransitions, useCapxulUploadImage };