@capxul/sdk 4.20.0-beta.5 → 4.20.0-beta.7

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 OrgId, A as Address$1, B as BudgetId, C as AuthCachePort, Ct as Failure, D as Account$1, 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, Q as Money, R as AuthUserId, 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, bt as CapxulErrorCode, 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, k as AccountPosition, kt as FailureMode, 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 CapxulErrorDetails, y as ClockPort, yt as CapxulError, z as BlockNumber } from "./OAuthBearerAuthClient-BAxoi3SD.mjs";
1
+ import { $ as OrgId, A as Address$1, B as BudgetId, C as AuthCachePort, Ct as CapxulError, D as Account$1, Dt as Failure, F as AssetAmount, G as CurrencyCode, H as ClientGrantId, I as AssetId, K as DocumentHash, L as AuthSession, M as AllowedOrigin, N as AnonymousDistinctId, Nt as FailureMode, O as AccountId, P as AppId, R as AuthUserId, Tt as CapxulErrorDetails, 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, 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, wt as CapxulErrorCode, x as CanSendOtpStatus, y as ClockPort, z as BlockNumber } from "./OAuthBearerAuthClient-DOPDDSPs.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;
@@ -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
@@ -664,6 +727,461 @@ declare const ClientRequestViewSchema: Schema.Union<readonly [Schema.Struct<{
664
727
  }>]>;
665
728
  type ClientRequestView = typeof ClientRequestViewSchema.Type;
666
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
+ declare const BudgetIntentSchema: Schema.refine<{
758
+ readonly type: "budget";
759
+ readonly asset: AssetId;
760
+ readonly limit: string | null;
761
+ readonly scope: {
762
+ readonly recipients: {
763
+ readonly type: "anyone";
764
+ } | {
765
+ readonly type: "allowlist";
766
+ readonly accounts: readonly AccountId[];
767
+ };
768
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
769
+ };
770
+ }, Schema.Union<readonly [Schema.Struct<{
771
+ readonly type: Schema.Literal<"budget">;
772
+ readonly asset: Schema.refine<AssetId, Schema.String>;
773
+ readonly limit: Schema.NullOr<Schema.String>;
774
+ readonly scope: Schema.Struct<{
775
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
776
+ readonly type: Schema.Literal<"anyone">;
777
+ }>, Schema.Struct<{
778
+ readonly type: Schema.Literal<"allowlist">;
779
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
780
+ }>]>;
781
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
782
+ }>;
783
+ }>, Schema.Struct<{
784
+ readonly type: Schema.Literal<"managePeople">;
785
+ }>]>>;
786
+ type BudgetIntent = typeof BudgetIntentSchema.Type;
787
+ declare const InvitationIdSchema: Schema.NonEmptyString;
788
+ type InvitationId = typeof InvitationIdSchema.Type;
789
+ declare const InvitationTargetSchema: Schema.Struct<{
790
+ readonly invitationId: Schema.NonEmptyString;
791
+ }>;
792
+ type InvitationTarget = typeof InvitationTargetSchema.Type;
793
+ declare const InvitationAcceptInputSchema: Schema.Struct<{
794
+ readonly invitationId: Schema.NonEmptyString;
795
+ readonly expectedOfferDigest: Schema.Codec<string, string, never, never>;
796
+ }>;
797
+ /** The consent input: one invitation and the digest the grantee read for it. */
798
+ type InvitationAcceptInput = typeof InvitationAcceptInputSchema.Type;
799
+ /** The requested grantee of one invitation. */
800
+ declare const GranteeRefSchema: Schema.Union<readonly [Schema.Struct<{
801
+ readonly type: Schema.Literal<"email">;
802
+ readonly email: Schema.NonEmptyString;
803
+ }>, Schema.Struct<{
804
+ readonly type: Schema.Literal<"account">;
805
+ readonly accountId: Schema.refine<AccountId, Schema.String>;
806
+ }>]>;
807
+ type GranteeRef = typeof GranteeRefSchema.Type;
808
+ declare const InviteInputSchema: Schema.refine<{
809
+ readonly requestKey: string;
810
+ readonly to: {
811
+ readonly type: "email";
812
+ readonly email: string;
813
+ } | {
814
+ readonly type: "account";
815
+ readonly accountId: AccountId;
816
+ };
817
+ readonly grants: readonly ({
818
+ readonly type: "budget";
819
+ readonly budgetId: PermissionId;
820
+ } | {
821
+ readonly type: "managePeople";
822
+ readonly permissionId: PermissionId;
823
+ } | {
824
+ readonly type: "new_budget";
825
+ readonly label: string;
826
+ readonly intent: {
827
+ readonly type: "budget";
828
+ readonly asset: AssetId;
829
+ readonly limit: string | null;
830
+ readonly scope: {
831
+ readonly recipients: {
832
+ readonly type: "anyone";
833
+ } | {
834
+ readonly type: "allowlist";
835
+ readonly accounts: readonly AccountId[];
836
+ };
837
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
838
+ };
839
+ };
840
+ })[];
841
+ }, Schema.Struct<{
842
+ readonly requestKey: Schema.refine<string, Schema.String>;
843
+ readonly to: Schema.Union<readonly [Schema.Struct<{
844
+ readonly type: Schema.Literal<"email">;
845
+ readonly email: Schema.NonEmptyString;
846
+ }>, Schema.Struct<{
847
+ readonly type: Schema.Literal<"account">;
848
+ readonly accountId: Schema.refine<AccountId, Schema.String>;
849
+ }>]>;
850
+ readonly grants: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
851
+ readonly type: Schema.Literal<"budget">;
852
+ readonly budgetId: Schema.Codec<PermissionId, string, never, never>;
853
+ }>, Schema.Struct<{
854
+ readonly type: Schema.Literal<"managePeople">;
855
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
856
+ }>, Schema.Struct<{
857
+ readonly type: Schema.Literal<"new_budget">;
858
+ readonly label: Schema.refine<string, Schema.String>;
859
+ readonly intent: Schema.refine<{
860
+ readonly type: "budget";
861
+ readonly asset: AssetId;
862
+ readonly limit: string | null;
863
+ readonly scope: {
864
+ readonly recipients: {
865
+ readonly type: "anyone";
866
+ } | {
867
+ readonly type: "allowlist";
868
+ readonly accounts: readonly AccountId[];
869
+ };
870
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
871
+ };
872
+ }, Schema.Union<readonly [Schema.Struct<{
873
+ readonly type: Schema.Literal<"budget">;
874
+ readonly asset: Schema.refine<AssetId, Schema.String>;
875
+ readonly limit: Schema.NullOr<Schema.String>;
876
+ readonly scope: Schema.Struct<{
877
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
878
+ readonly type: Schema.Literal<"anyone">;
879
+ }>, Schema.Struct<{
880
+ readonly type: Schema.Literal<"allowlist">;
881
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
882
+ }>]>;
883
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
884
+ }>;
885
+ }>, Schema.Struct<{
886
+ readonly type: Schema.Literal<"managePeople">;
887
+ }>]>>;
888
+ }>]>>;
889
+ }>>;
890
+ type InviteInput = typeof InviteInputSchema.Type;
891
+ /** One offered authority, before the invitation resolves it to a live identity. */
892
+ type InviteGrant = InviteInput["grants"][number];
893
+ /** The recipient and action bounds carried by one Budget intent. */
894
+ type SpendingScope = Extract<BudgetIntent, {
895
+ readonly type: "budget";
896
+ }>["scope"];
897
+ declare const InvitationPhaseSchema: Schema.Literals<readonly ["authorizing", "pending", "pending_grant", "active", "revoking", "declined", "cancelled", "expired", "revoked"]>;
898
+ type InvitationPhase = typeof InvitationPhaseSchema.Type;
899
+ declare const EndingReasonSchema: Schema.Literals<readonly ["declined", "cancelled", "expired", "revoked"]>;
900
+ type EndingReason = typeof EndingReasonSchema.Type;
901
+ declare const OfferedAuthoritySchema: Schema.Union<readonly [Schema.Struct<{
902
+ readonly type: Schema.Literal<"budget">;
903
+ readonly budgetId: Schema.refine<BudgetId, Schema.NonEmptyString>;
904
+ readonly label: Schema.String;
905
+ readonly policy: Schema.refine<{
906
+ readonly type: "budget";
907
+ readonly asset: AssetId;
908
+ readonly limit: string | null;
909
+ readonly scope: {
910
+ readonly recipients: {
911
+ readonly type: "anyone";
912
+ } | {
913
+ readonly type: "allowlist";
914
+ readonly accounts: readonly AccountId[];
915
+ };
916
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
917
+ };
918
+ }, Schema.Union<readonly [Schema.Struct<{
919
+ readonly type: Schema.Literal<"budget">;
920
+ readonly asset: Schema.refine<AssetId, Schema.String>;
921
+ readonly limit: Schema.NullOr<Schema.String>;
922
+ readonly scope: Schema.Struct<{
923
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
924
+ readonly type: Schema.Literal<"anyone">;
925
+ }>, Schema.Struct<{
926
+ readonly type: Schema.Literal<"allowlist">;
927
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
928
+ }>]>;
929
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
930
+ }>;
931
+ }>, Schema.Struct<{
932
+ readonly type: Schema.Literal<"managePeople">;
933
+ }>]>>;
934
+ readonly policyDigest: Schema.Codec<string, string, never, never>;
935
+ }>, Schema.Struct<{
936
+ readonly type: Schema.Literal<"managePeople">;
937
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
938
+ readonly label: Schema.String;
939
+ }>]>;
940
+ type OfferedAuthority = typeof OfferedAuthoritySchema.Type;
941
+ declare const InvitePreviewSchema: Schema.Struct<{
942
+ readonly orgId: Schema.refine<OrgId, Schema.NonEmptyString>;
943
+ readonly grantee: Schema.Struct<{
944
+ readonly partyId: Schema.NullOr<Schema.String>;
945
+ readonly accountId: Schema.NullOr<Schema.refine<AccountId, Schema.String>>;
946
+ readonly safeAddress: Schema.Codec<Address$1, string, never, never>;
947
+ readonly accountReady: Schema.NullOr<Schema.Boolean>;
948
+ }>;
949
+ readonly grants: Schema.$Array<Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
950
+ readonly type: Schema.Literal<"budget">;
951
+ readonly budgetId: Schema.refine<BudgetId, Schema.NonEmptyString>;
952
+ readonly label: Schema.String;
953
+ readonly policy: Schema.refine<{
954
+ readonly type: "budget";
955
+ readonly asset: AssetId;
956
+ readonly limit: string | null;
957
+ readonly scope: {
958
+ readonly recipients: {
959
+ readonly type: "anyone";
960
+ } | {
961
+ readonly type: "allowlist";
962
+ readonly accounts: readonly AccountId[];
963
+ };
964
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
965
+ };
966
+ }, Schema.Union<readonly [Schema.Struct<{
967
+ readonly type: Schema.Literal<"budget">;
968
+ readonly asset: Schema.refine<AssetId, Schema.String>;
969
+ readonly limit: Schema.NullOr<Schema.String>;
970
+ readonly scope: Schema.Struct<{
971
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
972
+ readonly type: Schema.Literal<"anyone">;
973
+ }>, Schema.Struct<{
974
+ readonly type: Schema.Literal<"allowlist">;
975
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
976
+ }>]>;
977
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
978
+ }>;
979
+ }>, Schema.Struct<{
980
+ readonly type: Schema.Literal<"managePeople">;
981
+ }>]>>;
982
+ readonly policyDigest: Schema.Codec<string, string, never, never>;
983
+ }>, Schema.Struct<{
984
+ readonly type: Schema.Literal<"managePeople">;
985
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
986
+ readonly label: Schema.String;
987
+ }>]>, Schema.Struct<{
988
+ readonly type: Schema.Literal<"new_budget">;
989
+ readonly label: Schema.String;
990
+ readonly policy: Schema.refine<{
991
+ readonly type: "budget";
992
+ readonly asset: AssetId;
993
+ readonly limit: string | null;
994
+ readonly scope: {
995
+ readonly recipients: {
996
+ readonly type: "anyone";
997
+ } | {
998
+ readonly type: "allowlist";
999
+ readonly accounts: readonly AccountId[];
1000
+ };
1001
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
1002
+ };
1003
+ }, Schema.Union<readonly [Schema.Struct<{
1004
+ readonly type: Schema.Literal<"budget">;
1005
+ readonly asset: Schema.refine<AssetId, Schema.String>;
1006
+ readonly limit: Schema.NullOr<Schema.String>;
1007
+ readonly scope: Schema.Struct<{
1008
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
1009
+ readonly type: Schema.Literal<"anyone">;
1010
+ }>, Schema.Struct<{
1011
+ readonly type: Schema.Literal<"allowlist">;
1012
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
1013
+ }>]>;
1014
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
1015
+ }>;
1016
+ }>, Schema.Struct<{
1017
+ readonly type: Schema.Literal<"managePeople">;
1018
+ }>]>>;
1019
+ readonly policyDigest: Schema.Codec<string, string, never, never>;
1020
+ }>]>>;
1021
+ readonly existingAssignments: Schema.$Array<Schema.Codec<PermissionAssignmentId, string, never, never>>;
1022
+ readonly includesManagement: Schema.Boolean;
1023
+ readonly observedAt: Schema.Codec<EpochMs, number, never, never>;
1024
+ }>;
1025
+ type InvitePreview = typeof InvitePreviewSchema.Type;
1026
+ declare const InvitationPageInputSchema: Schema.Struct<{
1027
+ readonly cursor: Schema.optional<Schema.NonEmptyString>;
1028
+ readonly limit: Schema.optional<Schema.refine<number, Schema.Number>>;
1029
+ readonly phases: Schema.optional<Schema.refine<readonly ("active" | "authorizing" | "cancelled" | "declined" | "expired" | "pending" | "pending_grant" | "revoked" | "revoking")[], Schema.$Array<Schema.Literals<readonly ["authorizing", "pending", "pending_grant", "active", "revoking", "declined", "cancelled", "expired", "revoked"]>>>>;
1030
+ }>;
1031
+ type InvitationPageInput = typeof InvitationPageInputSchema.Type;
1032
+ declare const InvitationRecoverySchema: Schema.Struct<{
1033
+ readonly actor: Schema.Literals<readonly ["system", "invitee", "admin"]>;
1034
+ readonly action: Schema.Literals<readonly ["wait", "retry", "review_offer", "reauthorize"]>;
1035
+ readonly reason: Schema.Literals<readonly ["configuration_pending", "grant_pending", "provider_unavailable", "policy_changed", "cleanup_pending", "signer_unavailable"]>;
1036
+ }>;
1037
+ type InvitationRecovery = typeof InvitationRecoverySchema.Type;
1038
+ declare const InvitationViewSchema: Schema.Struct<{
1039
+ readonly id: Schema.NonEmptyString;
1040
+ readonly orgId: Schema.refine<OrgId, Schema.NonEmptyString>;
1041
+ readonly organizationName: Schema.String;
1042
+ readonly grantee: Schema.Struct<{
1043
+ readonly partyId: Schema.String;
1044
+ readonly accountId: Schema.NullOr<Schema.refine<AccountId, Schema.String>>;
1045
+ readonly safeAddress: Schema.Codec<Address$1, string, never, never>;
1046
+ readonly accountReady: Schema.NullOr<Schema.Boolean>;
1047
+ }>;
1048
+ readonly phase: Schema.Literals<readonly ["authorizing", "pending", "pending_grant", "active", "revoking", "declined", "cancelled", "expired", "revoked"]>;
1049
+ readonly grants: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1050
+ readonly type: Schema.Literal<"budget">;
1051
+ readonly budgetId: Schema.refine<BudgetId, Schema.NonEmptyString>;
1052
+ }>, Schema.Struct<{
1053
+ readonly type: Schema.Literal<"managePeople">;
1054
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
1055
+ }>]>>;
1056
+ readonly offers: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1057
+ readonly type: Schema.Literal<"budget">;
1058
+ readonly budgetId: Schema.refine<BudgetId, Schema.NonEmptyString>;
1059
+ readonly label: Schema.String;
1060
+ readonly policy: Schema.refine<{
1061
+ readonly type: "budget";
1062
+ readonly asset: AssetId;
1063
+ readonly limit: string | null;
1064
+ readonly scope: {
1065
+ readonly recipients: {
1066
+ readonly type: "anyone";
1067
+ } | {
1068
+ readonly type: "allowlist";
1069
+ readonly accounts: readonly AccountId[];
1070
+ };
1071
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
1072
+ };
1073
+ }, Schema.Union<readonly [Schema.Struct<{
1074
+ readonly type: Schema.Literal<"budget">;
1075
+ readonly asset: Schema.refine<AssetId, Schema.String>;
1076
+ readonly limit: Schema.NullOr<Schema.String>;
1077
+ readonly scope: Schema.Struct<{
1078
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
1079
+ readonly type: Schema.Literal<"anyone">;
1080
+ }>, Schema.Struct<{
1081
+ readonly type: Schema.Literal<"allowlist">;
1082
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
1083
+ }>]>;
1084
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
1085
+ }>;
1086
+ }>, Schema.Struct<{
1087
+ readonly type: Schema.Literal<"managePeople">;
1088
+ }>]>>;
1089
+ readonly policyDigest: Schema.Codec<string, string, never, never>;
1090
+ }>, Schema.Struct<{
1091
+ readonly type: Schema.Literal<"managePeople">;
1092
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
1093
+ readonly label: Schema.String;
1094
+ }>]>>;
1095
+ readonly recovery: Schema.NullOr<Schema.Struct<{
1096
+ readonly actor: Schema.Literals<readonly ["system", "invitee", "admin"]>;
1097
+ readonly action: Schema.Literals<readonly ["wait", "retry", "review_offer", "reauthorize"]>;
1098
+ readonly reason: Schema.Literals<readonly ["configuration_pending", "grant_pending", "provider_unavailable", "policy_changed", "cleanup_pending", "signer_unavailable"]>;
1099
+ }>>;
1100
+ readonly offerDigest: Schema.Codec<string, string, never, never>;
1101
+ readonly authorizedAt: Schema.NullOr<Schema.Codec<EpochMs, number, never, never>>;
1102
+ readonly acceptedAt: Schema.NullOr<Schema.Codec<EpochMs, number, never, never>>;
1103
+ readonly expiresAt: Schema.NullOr<Schema.Codec<EpochMs, number, never, never>>;
1104
+ readonly commandId: Schema.NullOr<Schema.Codec<PaymentCommandId, string, never, never>>;
1105
+ readonly endingReason: Schema.NullOr<Schema.Literals<readonly ["declined", "cancelled", "expired", "revoked"]>>;
1106
+ readonly delivery: Schema.Literals<readonly ["not_confirmed", "sent", "failed"]>;
1107
+ }>;
1108
+ type InvitationView = typeof InvitationViewSchema.Type;
1109
+ declare const InvitationPageSchema: Schema.Struct<{
1110
+ readonly items: Schema.$Array<Schema.Struct<{
1111
+ readonly id: Schema.NonEmptyString;
1112
+ readonly orgId: Schema.refine<OrgId, Schema.NonEmptyString>;
1113
+ readonly organizationName: Schema.String;
1114
+ readonly grantee: Schema.Struct<{
1115
+ readonly partyId: Schema.String;
1116
+ readonly accountId: Schema.NullOr<Schema.refine<AccountId, Schema.String>>;
1117
+ readonly safeAddress: Schema.Codec<Address$1, string, never, never>;
1118
+ readonly accountReady: Schema.NullOr<Schema.Boolean>;
1119
+ }>;
1120
+ readonly phase: Schema.Literals<readonly ["authorizing", "pending", "pending_grant", "active", "revoking", "declined", "cancelled", "expired", "revoked"]>;
1121
+ readonly grants: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1122
+ readonly type: Schema.Literal<"budget">;
1123
+ readonly budgetId: Schema.refine<BudgetId, Schema.NonEmptyString>;
1124
+ }>, Schema.Struct<{
1125
+ readonly type: Schema.Literal<"managePeople">;
1126
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
1127
+ }>]>>;
1128
+ readonly offers: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1129
+ readonly type: Schema.Literal<"budget">;
1130
+ readonly budgetId: Schema.refine<BudgetId, Schema.NonEmptyString>;
1131
+ readonly label: Schema.String;
1132
+ readonly policy: Schema.refine<{
1133
+ readonly type: "budget";
1134
+ readonly asset: AssetId;
1135
+ readonly limit: string | null;
1136
+ readonly scope: {
1137
+ readonly recipients: {
1138
+ readonly type: "anyone";
1139
+ } | {
1140
+ readonly type: "allowlist";
1141
+ readonly accounts: readonly AccountId[];
1142
+ };
1143
+ readonly actions: readonly ["commitments" | "pay", ...("commitments" | "pay")[]];
1144
+ };
1145
+ }, Schema.Union<readonly [Schema.Struct<{
1146
+ readonly type: Schema.Literal<"budget">;
1147
+ readonly asset: Schema.refine<AssetId, Schema.String>;
1148
+ readonly limit: Schema.NullOr<Schema.String>;
1149
+ readonly scope: Schema.Struct<{
1150
+ readonly recipients: Schema.Union<readonly [Schema.Struct<{
1151
+ readonly type: Schema.Literal<"anyone">;
1152
+ }>, Schema.Struct<{
1153
+ readonly type: Schema.Literal<"allowlist">;
1154
+ readonly accounts: Schema.$Array<Schema.refine<AccountId, Schema.String>>;
1155
+ }>]>;
1156
+ readonly actions: Schema.NonEmptyArray<Schema.Literals<readonly ["pay", "commitments"]>>;
1157
+ }>;
1158
+ }>, Schema.Struct<{
1159
+ readonly type: Schema.Literal<"managePeople">;
1160
+ }>]>>;
1161
+ readonly policyDigest: Schema.Codec<string, string, never, never>;
1162
+ }>, Schema.Struct<{
1163
+ readonly type: Schema.Literal<"managePeople">;
1164
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
1165
+ readonly label: Schema.String;
1166
+ }>]>>;
1167
+ readonly recovery: Schema.NullOr<Schema.Struct<{
1168
+ readonly actor: Schema.Literals<readonly ["system", "invitee", "admin"]>;
1169
+ readonly action: Schema.Literals<readonly ["wait", "retry", "review_offer", "reauthorize"]>;
1170
+ readonly reason: Schema.Literals<readonly ["configuration_pending", "grant_pending", "provider_unavailable", "policy_changed", "cleanup_pending", "signer_unavailable"]>;
1171
+ }>>;
1172
+ readonly offerDigest: Schema.Codec<string, string, never, never>;
1173
+ readonly authorizedAt: Schema.NullOr<Schema.Codec<EpochMs, number, never, never>>;
1174
+ readonly acceptedAt: Schema.NullOr<Schema.Codec<EpochMs, number, never, never>>;
1175
+ readonly expiresAt: Schema.NullOr<Schema.Codec<EpochMs, number, never, never>>;
1176
+ readonly commandId: Schema.NullOr<Schema.Codec<PaymentCommandId, string, never, never>>;
1177
+ readonly endingReason: Schema.NullOr<Schema.Literals<readonly ["declined", "cancelled", "expired", "revoked"]>>;
1178
+ readonly delivery: Schema.Literals<readonly ["not_confirmed", "sent", "failed"]>;
1179
+ }>>;
1180
+ readonly nextCursor: Schema.NullOr<Schema.NonEmptyString>;
1181
+ readonly observedAt: Schema.Codec<EpochMs, number, never, never>;
1182
+ }>;
1183
+ type InvitationPage = typeof InvitationPageSchema.Type;
1184
+ //#endregion
667
1185
  //#region src/ports/bootstrap.d.ts
668
1186
  type BootstrapInput = {
669
1187
  readonly publishableKey: PublishableKey;
@@ -963,7 +1481,7 @@ type ReadAccountBalanceInput = {
963
1481
  };
964
1482
  type FundFromFaucetInput = {
965
1483
  readonly chainId: ChainId;
966
- readonly amount: Money;
1484
+ readonly amount: AssetAmount;
967
1485
  };
968
1486
  type FundFromFaucetResult = {
969
1487
  readonly txHash: string;
@@ -1257,6 +1775,11 @@ interface ClientRequests {
1257
1775
  type AuthMethodOptions = InvocationControls;
1258
1776
  type SignInOptions = AuthMethodOptions;
1259
1777
  interface AuthMethods {
1778
+ /** Resume pending OTP input after process restart; grants no authentication. */
1779
+ resumeOtp(input: {
1780
+ readonly email: string;
1781
+ readonly requestedAt: number;
1782
+ }, options?: AuthMethodOptions): Promise<CapxulResult<void>>;
1260
1783
  canSendOtp(input: {
1261
1784
  readonly email: string;
1262
1785
  }, options?: AuthMethodOptions): Promise<CapxulResult<CanSendOtpStatus>>;
@@ -1457,22 +1980,12 @@ interface MeMethods {
1457
1980
  /** R08 (#1966): accepts a captured attempt, exactly as the treasury read does. */
1458
1981
  depositInstructions(options?: InvocationControls): Promise<CapxulResult<DepositInstructions>>;
1459
1982
  }
1460
- interface PaymentMoney {
1461
- readonly currency: string;
1462
- readonly value: string;
1463
- readonly decimals: number;
1464
- }
1983
+ type PaymentMoney = AssetAmount;
1465
1984
  type PaymentStatus = PaymentStatus$1;
1466
1985
  type PaymentDirection = PaymentDirection$1;
1467
1986
  type PaymentType = PaymentType$1;
1468
- type PaymentDocumentKind = PaymentDocumentKind$1;
1469
- interface PaymentDocumentRef {
1470
- readonly documentHash: string;
1471
- readonly kind: PaymentDocumentKind;
1472
- readonly title?: string;
1473
- readonly uri?: string;
1474
- readonly issuedAt?: number;
1475
- }
1987
+ type PaymentDocumentKind = DocumentRefV3["kind"];
1988
+ type PaymentDocumentRef = DocumentRefV3;
1476
1989
  type PaymentTiming = {
1477
1990
  readonly kind: "instant";
1478
1991
  } | {
@@ -1504,6 +2017,7 @@ interface Payment {
1504
2017
  readonly label: string;
1505
2018
  };
1506
2019
  readonly documents: readonly PaymentDocumentRef[];
2020
+ readonly documentState?: "ready" | "pending" | "unavailable";
1507
2021
  readonly timing: PaymentTiming;
1508
2022
  readonly released: PaymentMoney;
1509
2023
  readonly availableToClaim: PaymentMoney;
@@ -1701,8 +2215,7 @@ interface ActivitySummaryParams {
1701
2215
  readonly window?: ActivityRange;
1702
2216
  }
1703
2217
  interface ActivitySummaryTotal {
1704
- readonly currency: string;
1705
- readonly decimals: number;
2218
+ readonly asset: AssetAmount["asset"];
1706
2219
  /** Integer raw-unit strings. `net` is `in - out` and may be negative. */
1707
2220
  readonly in: string;
1708
2221
  readonly out: string;
@@ -1716,7 +2229,7 @@ interface ActivitySummary {
1716
2229
  readonly from: number | null;
1717
2230
  readonly to: number | null;
1718
2231
  };
1719
- /** One bucket per currency, and EMPTY when the window holds no activity. */
2232
+ /** One bucket per exact asset, and EMPTY when the window holds no activity. */
1720
2233
  readonly totals: readonly ActivitySummaryTotal[];
1721
2234
  /**
1722
2235
  * Every activity row in the window, whatever its direction or status. It
@@ -1791,6 +2304,8 @@ type ActivityDetail = {
1791
2304
  } | {
1792
2305
  readonly kind: "movement";
1793
2306
  readonly movementId: string;
2307
+ readonly documents: readonly PaymentDocumentRef[];
2308
+ readonly documentState: "ready" | "pending" | "unavailable";
1794
2309
  readonly annotation: ActivityAnnotation | null;
1795
2310
  readonly evidence: MovementActivityEvidence;
1796
2311
  };
@@ -1854,24 +2369,6 @@ interface OfframpMethods {
1854
2369
  readonly signal?: AbortSignal;
1855
2370
  }): Promise<CapxulResult<OfframpStatus>>;
1856
2371
  }
1857
- interface PaymentDocumentVerification {
1858
- readonly documentHash: string;
1859
- readonly ok: boolean;
1860
- readonly derivedHash: string;
1861
- readonly kind: PaymentDocumentKind;
1862
- }
1863
- /**
1864
- * #577 render-on-demand result. `html` is self-contained user-visible document
1865
- * HTML (stylesheet + rendered document). The MCP `paymentDocuments.render` tool
1866
- * exposes only `{documentHash, kind, ok}` to the model and returns `html` in an
1867
- * audience:["user"] content block (#506 redaction matrix).
1868
- */
1869
- interface PaymentDocumentRender {
1870
- readonly documentHash: string;
1871
- readonly ok: boolean;
1872
- readonly kind: PaymentDocumentKind;
1873
- readonly html: string;
1874
- }
1875
2372
  /**
1876
2373
  * The public Payments surface uses product-level methods. A settled receipt can
1877
2374
  * include `chainId` and `transactionHash`. Internal custody fields stay private.
@@ -1906,15 +2403,15 @@ interface PaymentsMethods {
1906
2403
  }): Promise<CapxulResult<Payment>>;
1907
2404
  }
1908
2405
  interface PaymentDocumentsMethods {
1909
- verify(documentHash: string, options?: {
2406
+ /** Return exact original bytes for a deliberate download. */
2407
+ get(ref: PaymentDocumentReadRef, options?: {
2408
+ readonly signal?: AbortSignal;
2409
+ }): Promise<CapxulResult<PaymentDocumentDownload>>;
2410
+ verify(ref: PaymentDocumentReadRef, options?: {
1910
2411
  readonly signal?: AbortSignal;
1911
2412
  }): Promise<CapxulResult<PaymentDocumentVerification>>;
1912
- /**
1913
- * #577: render-on-demand. Loads the owner's stored document by `documentHash`,
1914
- * re-verifies its EIP-712 hash, and renders it to self-contained HTML using the
1915
- * verified stored line items. Returns `{documentHash, kind, ok, html}`.
1916
- */
1917
- render(documentHash: string, options?: {
2413
+ /** Render an authorized document after checking its bytes and preimages. */
2414
+ render(ref: PaymentDocumentReadRef, options?: {
1918
2415
  readonly signal?: AbortSignal;
1919
2416
  }): Promise<CapxulResult<PaymentDocumentRender>>;
1920
2417
  }
@@ -2158,13 +2655,20 @@ interface OrganizationOnboardingInput {
2158
2655
  interface OrganizationOnboarding {
2159
2656
  readonly organizationId: string;
2160
2657
  }
2658
+ interface OrganizationOnboardingOptions {
2659
+ readonly signal?: AbortSignal;
2660
+ readonly intent?: "create";
2661
+ }
2662
+ interface OrganizationOnboardingState {
2663
+ readonly organizationId: OrgId | null;
2664
+ readonly lifecycle: OrgLifecycle | null;
2665
+ }
2161
2666
  interface OnboardingMethods {
2162
2667
  completePerson(input: PersonOnboardingInput, options?: {
2163
2668
  readonly signal?: AbortSignal;
2164
2669
  }): Promise<CapxulResult<PersonOnboarding>>;
2165
- completeOrganization(input: OrganizationOnboardingInput, options?: {
2166
- readonly signal?: AbortSignal;
2167
- }): Promise<CapxulResult<OrganizationOnboarding>>;
2670
+ completeOrganization(input: OrganizationOnboardingInput, options?: OrganizationOnboardingOptions): Promise<CapxulResult<OrganizationOnboarding>>;
2671
+ subscribeOrganization(observer: (state: OrganizationOnboardingState) => void): () => void;
2168
2672
  }
2169
2673
  //#endregion
2170
2674
  //#region src/surface/accounts.d.ts
@@ -2179,7 +2683,7 @@ interface AccountsMethods {
2179
2683
  * The reference CLI uses it only in the test environment. Consumers do not see `fund`.
2180
2684
  */
2181
2685
  interface AccountsFaucetMethods {
2182
- fund(amount: Money, options?: {
2686
+ fund(amount: AssetAmount, options?: {
2183
2687
  readonly signal?: AbortSignal;
2184
2688
  }): Promise<CapxulResult<{
2185
2689
  readonly txHash: string;
@@ -2200,24 +2704,6 @@ type ListOrgRolesInput = {
2200
2704
  type ListOrgMembersInput = {
2201
2705
  readonly orgId: OrgId;
2202
2706
  };
2203
- /**
2204
- * R06 (#1964): the program attaches the caller's captured attempt to this
2205
- * record through `copyInvocationObservation`, so the adapter forwards one
2206
- * observation context to the backend action that owns `org_invite_sent`. The
2207
- * carrier is a non-enumerable symbol and never becomes a wire field.
2208
- */
2209
- type InviteOrgMemberInput = {
2210
- readonly orgId: OrgId;
2211
- readonly input: InviteMemberInput;
2212
- };
2213
- type ResendOrgInviteTokenInput = {
2214
- readonly orgId: OrgId;
2215
- readonly email: string;
2216
- };
2217
- type DetectPendingOrgInvitationsInput = Record<never, never>;
2218
- type DetectPendingOrgInvitationsResult$1 = {
2219
- readonly matched: readonly OrgId[];
2220
- };
2221
2707
  declare const OrgError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
2222
2708
  readonly _tag: "OrgError";
2223
2709
  } & Readonly<A>;
@@ -2232,13 +2718,10 @@ declare class OrgError extends OrgError_base<{
2232
2718
  interface OrgPort {
2233
2719
  createOrg(input: CreateOrgPortInput): Effect.Effect<OrgView, OrgError, never>;
2234
2720
  readTreasury(input: ReadOrgTreasuryInput): Effect.Effect<Account$1, OrgError, never>;
2235
- listOrgs(input: ListOrgsInput): Effect.Effect<readonly OrgView[], OrgError, never>;
2721
+ listOrgs(input: ListOrgsInput): Effect.Effect<readonly OrganizationAccess[], OrgError, never>;
2236
2722
  listRoles(input: ListOrgRolesInput): Effect.Effect<readonly RoleView[], OrgError, never>;
2237
2723
  listMembers(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
2238
2724
  pendingMembers?(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
2239
- inviteMember(input: InviteOrgMemberInput): Effect.Effect<MemberView, OrgError, never>;
2240
- resendInviteToken?(input: ResendOrgInviteTokenInput): Effect.Effect<MemberView, OrgError, never>;
2241
- detectAndAcceptPendingInvitations(input: DetectPendingOrgInvitationsInput): Effect.Effect<DetectPendingOrgInvitationsResult$1, OrgError, never>;
2242
2725
  }
2243
2726
  //#endregion
2244
2727
  //#region src/surface/org-me.d.ts
@@ -2252,7 +2735,12 @@ interface Budget {
2252
2735
  readonly id: BudgetId;
2253
2736
  /** Display name, taken from the Role the grant was motivated by. */
2254
2737
  readonly label: string;
2255
- readonly limit: Money | null;
2738
+ readonly asset: {
2739
+ readonly assetId: AssetId;
2740
+ readonly symbol: string;
2741
+ readonly decimals: number;
2742
+ };
2743
+ readonly limit: AssetAmount | null;
2256
2744
  }
2257
2745
  /**
2258
2746
  * The caller's own standing in one Organization.
@@ -2266,6 +2754,7 @@ interface Budget {
2266
2754
  * spending, so both read `canSpend`.
2267
2755
  */
2268
2756
  interface OrgMe {
2757
+ readonly member: MemberIdentityProjection;
2269
2758
  readonly role: {
2270
2759
  readonly label: string;
2271
2760
  } | null;
@@ -2282,6 +2771,117 @@ type OrgMeOptions = {
2282
2771
  };
2283
2772
  type OrgMeMethod = (options?: OrgMeOptions) => Promise<CapxulResult<OrgMe>>;
2284
2773
  //#endregion
2774
+ //#region src/surface/invitations.d.ts
2775
+ /** The preview request: the bounded invitation request without its write key. */
2776
+ type InvitePreviewInput = Omit<InviteInput, "requestKey">;
2777
+ /** The durable identity the authoring write delivers before it signs (§9). */
2778
+ type InvitePrepared = {
2779
+ readonly invitationId: string;
2780
+ readonly commandId: string;
2781
+ };
2782
+ /**
2783
+ * The authoring write's options. `onPrepared` is the D9 §6 authoring callback:
2784
+ * it receives the exact `{invitationId, commandId}` pair after the backend
2785
+ * prepared the configuration execution and before any digest is signed. The
2786
+ * write awaits it, and a failure stops the write before a signature exists.
2787
+ */
2788
+ type InviteOptions = InvocationControls & {
2789
+ readonly onPrepared?: (value: InvitePrepared) => void | Promise<void>;
2790
+ };
2791
+ /**
2792
+ * The invitation methods of one Organization. Every method is scoped to the
2793
+ * Organization the bundle was resolved for; the caller never supplies the scope
2794
+ * again, and a result naming another Organization is refused.
2795
+ */
2796
+ interface OrgInvitations {
2797
+ /** The Admin's read-only preview. It performs no write and invents no Budget. */
2798
+ preview(input: InvitePreviewInput, options?: InvocationControls): Promise<CapxulResult<InvitePreview>>;
2799
+ /**
2800
+ * The authoring write: authorize one exact offer to one exact grantee, and
2801
+ * execute its configuration hop. It persists the invitation and its
2802
+ * configuration command before any signature exists, so the same `requestKey`
2803
+ * replays the same invitation and reuses the same stored execution. It then
2804
+ * drives the existing human configuration owner: prepare the exact configure
2805
+ * command for this Account's Safe, deliver `{invitationId, commandId}` to
2806
+ * `onPrepared`, sign the returned digest, and submit it. This is not
2807
+ * acceptance: an authorized offer is still pending until its grantee consents.
2808
+ *
2809
+ * A client composed without an execution-capable signer refuses before the
2810
+ * write. Data creation success therefore means the offer's configuration
2811
+ * execution was submitted, never a half-authored offer that can never leave
2812
+ * `authorizing` (§8's next action is the human configuration
2813
+ * signing/submission).
2814
+ *
2815
+ * On a fresh request the view it returns is the AUTHORIZATION-TIME view:
2816
+ * `authorizing`, with its `commandId` and its `configuration_pending`
2817
+ * recovery. The offer reaches `pending` with `authorizedAt` and `expiresAt`
2818
+ * only when the configuration verification lands
2819
+ * (`recordInvitationConfigurationVerification`), which happens after this call
2820
+ * returns — so a re-read here would return the same `authorizing` view. Read
2821
+ * the settled state through `get` or `wait`. A settled replay is the
2822
+ * exception: a request key whose invitation has already left `authorizing`
2823
+ * returns that durable current view unchanged, not an authorization-time one,
2824
+ * and composes no signer.
2825
+ *
2826
+ * This bundle is the canonical D8 authoring surface shared with the CLI.
2827
+ * MCP exposes no invitation-authoring tool.
2828
+ */
2829
+ invite(input: InviteInput, options?: InviteOptions): Promise<CapxulResult<InvitationView>>;
2830
+ /**
2831
+ * The exact grantee's consent commit (D8 §8): accept the current offer digest
2832
+ * and start the offer's automatic grant.
2833
+ *
2834
+ * `expectedOfferDigest` is the digest the caller read for this invitation —
2835
+ * `get` or the own-offer list show it, and nothing else may be substituted.
2836
+ * Consent is recorded once: a repeat with the stored digest returns the same
2837
+ * accepted result and writes nothing, and a different digest receives the
2838
+ * backend's closed `WRONG_STATE` `invitation-offer-changed` refusal instead of
2839
+ * overwriting the stored consent. The wrong authenticated grantee, an
2840
+ * unconfigured offer, an expired offer, and an ended offer all refuse before
2841
+ * any consent is written.
2842
+ *
2843
+ * The returned view is the AUTHORIZATION-TIME view of the consent commit:
2844
+ * `pending_grant`, with `acceptedAt`. The stored accepted digest remains a
2845
+ * durable backend consent fact rather than a public `InvitationView` field. The
2846
+ * offer reaches `active` only after the grant receipt verifies on chain, which
2847
+ * happens in the lane this commit starts — so read the settled state through
2848
+ * `get`/`wait`. A repeat on an already-settled offer returns the durable view
2849
+ * unchanged.
2850
+ */
2851
+ accept(input: InvitationAcceptInput, options?: InvocationControls): Promise<CapxulResult<InvitationView>>;
2852
+ /**
2853
+ * The Organization's invitations for a current Admin (D8 §3: the scoped list
2854
+ * is Admin-only). A member without management authority and a caller outside
2855
+ * the Organization receive the backend's existing typed refusal, never a
2856
+ * page.
2857
+ *
2858
+ * Every row is checked against the Organization this bundle was resolved for;
2859
+ * a page that names another Organization is refused rather than handed to a
2860
+ * caller that trusted its scope.
2861
+ */
2862
+ list(input?: InvitationPageInput, options?: InvocationControls): Promise<CapxulResult<InvitationPage>>;
2863
+ get(input: InvitationTarget, options?: InvocationControls): Promise<CapxulResult<InvitationView>>;
2864
+ /** The exact grantee ends the offer; the Admin may not decline on their behalf. */
2865
+ decline(input: InvitationTarget, options?: InvocationControls): Promise<CapxulResult<InvitationView>>;
2866
+ /** The current Admin ends the offer and starts its cleanup. */
2867
+ cancel(input: InvitationTarget, options?: InvocationControls): Promise<CapxulResult<InvitationView>>;
2868
+ /** The current Admin retries delivery of a verified pending offer only. */
2869
+ resend(input: InvitationTarget, options?: InvocationControls): Promise<CapxulResult<InvitationView>>;
2870
+ /** The exact grantee or the current Admin resumes the current offer state. */
2871
+ retry(input: InvitationTarget, options?: InvocationControls): Promise<CapxulResult<InvitationView>>;
2872
+ }
2873
+ /**
2874
+ * The authenticated grantee's own offers, paged with the versioned cursor.
2875
+ *
2876
+ * The page names the authenticated principal and the exact phase filter on the
2877
+ * server; the cursor carries no trusted resource value. A caller's Organization
2878
+ * is never consulted: D8 §3 makes the own-offer list grantee-scoped by the
2879
+ * session, and a saved read default is not an access decision.
2880
+ */
2881
+ type OwnInvitationsMethod = (input?: InvitationPageInput, options?: InvocationControls) => Promise<CapxulResult<InvitationPage>>;
2882
+ /** The authoring write: one bounded request authorizes one exact offer. */
2883
+ type InviteMethod = (input: InviteInput, options?: InviteOptions) => Promise<CapxulResult<InvitationView>>;
2884
+ //#endregion
2285
2885
  //#region src/contract/permission.d.ts
2286
2886
  interface PermissionReadResult {
2287
2887
  readonly permissions: readonly Permission[];
@@ -2362,7 +2962,7 @@ interface PayrollRun {
2362
2962
  /** Epoch milliseconds. An instant run has `periodStart === periodEnd`. */
2363
2963
  readonly periodStart: number;
2364
2964
  readonly periodEnd: number;
2365
- readonly total: Money;
2965
+ readonly total: AssetAmount;
2366
2966
  readonly recipientCount: number;
2367
2967
  }
2368
2968
  /**
@@ -2375,7 +2975,7 @@ interface PayrollRun {
2375
2975
  interface PayrollRuns {
2376
2976
  readonly runs: readonly PayrollRun[];
2377
2977
  /** Σ net of the runs that SETTLED this calendar month — the "Paid This Month" fact. */
2378
- readonly settledThisMonth: Money;
2978
+ readonly settledThisMonth: readonly AssetAmount[];
2379
2979
  }
2380
2980
  /**
2381
2981
  * One saved recipient on a group. `amount` is the employer's TYPED text, not
@@ -2444,8 +3044,12 @@ interface PayrollRunItemInput {
2444
3044
  * three different people.
2445
3045
  */
2446
3046
  readonly partyId: string;
3047
+ /** The exact settlement quantity. Fiat compensation remains in gross and net. */
3048
+ readonly amount: AssetAmount;
2447
3049
  readonly gross: string;
2448
3050
  readonly net: string;
3051
+ readonly currency: CurrencyCode;
3052
+ readonly decimals: number;
2449
3053
  readonly adjustments: readonly {
2450
3054
  readonly label: string;
2451
3055
  readonly amount: string;
@@ -2454,6 +3058,8 @@ interface PayrollRunItemInput {
2454
3058
  interface AuthorizeRunInput {
2455
3059
  /** The Budget the run spends from. The caller selects it; nothing is picked for them. */
2456
3060
  readonly permissionId: string;
3061
+ /** The one asset used by every payment in this run. */
3062
+ readonly asset: AssetAmount["asset"];
2457
3063
  /** Epoch milliseconds. An instant run passes `start === end` — the payslip renders the date. */
2458
3064
  readonly period: {
2459
3065
  readonly start: number;
@@ -2498,23 +3104,64 @@ interface PayrollMethods {
2498
3104
  //#region src/surface/org.d.ts
2499
3105
  /** The membership state for one Organization member. */
2500
3106
  type MemberStatus = "pending" | "pending_safe" | "pending_grant" | "active" | "revoked" | "expired";
2501
- /** One Organization that the current user can access. */
2502
- type OrgView = {
3107
+ /** The current state and policy of one exact authority assignment. */
3108
+ type AssignmentProjection = {
3109
+ readonly id: PermissionAssignmentId;
3110
+ readonly authority: AuthorityRef;
3111
+ readonly state: "pending" | "active" | "suspended" | "revoked";
3112
+ readonly policy: CurrentPolicy;
3113
+ readonly revision: number;
3114
+ readonly observedAt: number;
3115
+ };
3116
+ /** The current user's identity and authority inside one Organization. */
3117
+ type MemberIdentityProjection = {
3118
+ readonly orgId: OrgId;
3119
+ readonly partyId: PartyId;
3120
+ readonly accountId: AccountId | null;
3121
+ readonly safeAddress: Address$1;
3122
+ readonly accountReady: boolean | null;
3123
+ readonly assignments: readonly AssignmentProjection[];
3124
+ };
3125
+ /** The legacy creation result. List reads return OrganizationAccess. */
3126
+ type OrgView = OrganizationAccess & {
2503
3127
  readonly creationSource?: TesterKind;
2504
- readonly id: OrgId;
2505
- readonly name: string;
2506
- readonly handle: string;
2507
3128
  readonly safeAddress: Address$1;
2508
3129
  /** The viewing member's own role label within this org. */
2509
- readonly role: string;
2510
- /** The Organization treasury Account. */
2511
- readonly treasury: Account$1;
3130
+ readonly role: string | null;
3131
+ /**
3132
+ * The Organization treasury Account when this view came from an authorized
3133
+ * treasury read. The own-access list returns `null` because list inclusion
3134
+ * does not grant a protected treasury read.
3135
+ */
3136
+ readonly treasury: Account$1 | null;
2512
3137
  /** #1064: onboarding-collected description + size bucket; null when unset. */
2513
3138
  readonly bio: string | null;
2514
3139
  readonly size: string | null;
2515
3140
  /** #1061 / ADR-0014: logo serving URL resolved at read time; null when unset. */
2516
3141
  readonly logoUrl: string | null;
2517
3142
  };
3143
+ /** One Organization that the current user can access. */
3144
+ type OrganizationAccess = {
3145
+ readonly id: OrgId;
3146
+ readonly name: string;
3147
+ readonly handle: string;
3148
+ /** Canonical Organization account identity. */
3149
+ readonly account: {
3150
+ readonly id: AccountId | null;
3151
+ readonly address: Address$1;
3152
+ readonly ready: boolean | null;
3153
+ };
3154
+ readonly setup: OrgLifecycle;
3155
+ readonly member: MemberIdentityProjection | null;
3156
+ readonly capabilities: {
3157
+ readonly canManagePeople: boolean;
3158
+ readonly canSpend: boolean;
3159
+ };
3160
+ readonly custody: {
3161
+ readonly status: "unknown";
3162
+ };
3163
+ readonly observedAt: number;
3164
+ };
2518
3165
  interface OrganizationAccount {
2519
3166
  readonly id: string;
2520
3167
  readonly address: string | null;
@@ -2531,15 +3178,15 @@ interface OrganizationAuditLogItem {
2531
3178
  readonly metadata?: Record<string, unknown>;
2532
3179
  }
2533
3180
  /**
2534
- * One Organization member. `personalSafeAddress` is the member identity key. It
2535
- * is `null` while the member is still `pending` (emailed into existence but not
2536
- * yet provisioned a personal Safe). `email` is the universal entry point.
3181
+ * One Organization member. `accountId` identifies the attached Account.
3182
+ * It is `null` before Account attachment. A Safe address is not an AccountId.
2537
3183
  */
2538
3184
  type MemberView = {
2539
3185
  readonly orgId: OrgId;
3186
+ readonly accountId: AccountId | null;
2540
3187
  readonly email: Email;
2541
3188
  readonly name: string | null;
2542
- /** Member identity key. `null` until the invitee provisions a Safe. */
3189
+ /** Custody Safe. `null` until the invitee provisions a Safe. */
2543
3190
  readonly personalSafeAddress: Address$1 | null;
2544
3191
  /** The member role label maps to the on-chain `roleKey`. */
2545
3192
  readonly role: string;
@@ -2548,16 +3195,9 @@ type MemberView = {
2548
3195
  readonly grantTxHash: string | null;
2549
3196
  readonly revokeTxHash: string | null;
2550
3197
  };
2551
- /** A role spend cap that Zodiac Roles and Allowance enforce on-chain. */
2552
- type RoleSpendCap = {
2553
- readonly perTx?: Money;
2554
- readonly perDay?: Money;
2555
- readonly toRecipients?: "anyone" | readonly Address$1[];
2556
- };
2557
3198
  /** A Capxul Role definition. */
2558
3199
  type RoleDefinition = {
2559
3200
  readonly label: string;
2560
- readonly spend?: RoleSpendCap;
2561
3201
  readonly canSpend?: boolean;
2562
3202
  readonly canManageMembers?: boolean;
2563
3203
  readonly canManageRoles?: boolean;
@@ -2592,23 +3232,6 @@ type CreateOrgInput = {
2592
3232
  readonly template: OrgTemplate;
2593
3233
  readonly country?: string;
2594
3234
  };
2595
- /**
2596
- * Input to `org(orgId).invite`. Email is the universal entry point.
2597
- * An address that is not yet a Capxul user creates a `pending`
2598
- * membership that resolves on sign-in. `role` is invitation metadata. It does
2599
- * not grant an on-chain Permission.
2600
- */
2601
- type InviteMemberInput = {
2602
- readonly email: string;
2603
- readonly role: string;
2604
- };
2605
- type ResendInviteTokenInput = {
2606
- readonly email: string;
2607
- };
2608
- /** Organization ids whose pending invitations match the current Account. */
2609
- type DetectPendingOrgInvitationsResult = {
2610
- readonly matched: readonly OrgId[];
2611
- };
2612
3235
  /** Organization methods for one `orgId`. */
2613
3236
  interface OrgScopedMethods extends ActorRelationshipMethods {
2614
3237
  /**
@@ -2642,13 +3265,11 @@ interface OrgScopedMethods extends ActorRelationshipMethods {
2642
3265
  readonly signal?: AbortSignal;
2643
3266
  }): Promise<CapxulResult<readonly RoleView[]>>;
2644
3267
  /**
2645
- * Invite a member by email. `options` is the browser attempt the caller
2646
- * captured before the person pressed the button (R06 #1964); it reaches the
2647
- * backend action unchanged, so the durable `org_invite_sent` and the later
2648
- * `org_invite_progressed` share the attempt's correlation. `{ signal }`
2649
- * callers are unaffected.
3268
+ * The D8 invitation surface of this Organization: the Admin's preview, the
3269
+ * authoring write, explicit digest-bound acceptance, the scoped read, and the
3270
+ * four consent-free transitions.
2650
3271
  */
2651
- invite(input: InviteMemberInput, options?: InvocationControls): Promise<CapxulResult<MemberView>>;
3272
+ readonly invitations: OrgInvitations;
2652
3273
  /**
2653
3274
  * Leak-safe Organization payment: execute through the payments engine with
2654
3275
  * the selected receipt-verified Budget Permission
@@ -2671,10 +3292,14 @@ interface OrgScopedMethods extends ActorRelationshipMethods {
2671
3292
  type OrgsMethod = {
2672
3293
  (options?: {
2673
3294
  readonly signal?: AbortSignal;
2674
- }): Promise<CapxulResult<readonly OrgView[]>>;
2675
- detectAndAcceptPendingInvitations(options?: {
2676
- readonly signal?: AbortSignal;
2677
- }): Promise<CapxulResult<DetectPendingOrgInvitationsResult>>;
3295
+ }): Promise<CapxulResult<readonly OrganizationAccess[]>>;
3296
+ /**
3297
+ * The authenticated grantee's own offers, paged with the versioned cursor.
3298
+ * The Admin-scoped Organization list is the scoped
3299
+ * `org(orgId).invitations.list`; this method never consults a saved
3300
+ * Organization.
3301
+ */
3302
+ invitations: OwnInvitationsMethod;
2678
3303
  };
2679
3304
  /**
2680
3305
  * Top-level Org method bundle, exposed at `client.org` / `client.orgs` /
@@ -2705,16 +3330,7 @@ interface CurrentUserContext {
2705
3330
  readonly id: string;
2706
3331
  readonly address: string | null;
2707
3332
  } | null;
2708
- readonly organizations: readonly {
2709
- readonly id: string;
2710
- readonly name: string;
2711
- readonly handle: string;
2712
- readonly role: string;
2713
- readonly account: {
2714
- readonly id: string;
2715
- readonly address: string | null;
2716
- } | null;
2717
- }[];
3333
+ readonly organizations: readonly OrganizationAccess[];
2718
3334
  }
2719
3335
  interface CurrentUserMethods {
2720
3336
  get(options?: {
@@ -2764,22 +3380,6 @@ interface SystemMethods {
2764
3380
  }): Promise<CapxulResult<SystemHealth>>;
2765
3381
  }
2766
3382
  //#endregion
2767
- //#region src/domain/money/primary-holding.d.ts
2768
- /**
2769
- * The one asset a screen shows when it can show only one. `symbol` is the
2770
- * TOKEN symbol the chain reported (`"USDC"`, `"WETH"`); `value` is the quantity
2771
- * in that asset's own grammar. There is no `currency` field: a token is not
2772
- * USD, and its peg is metadata, never identity (ADR-0028 R3, R5).
2773
- */
2774
- interface Holding {
2775
- readonly id: string;
2776
- readonly assetKind: "native" | "erc20";
2777
- readonly symbol: string;
2778
- readonly decimals: number;
2779
- /** Major-unit quantity at `decimals`. */
2780
- readonly value: string;
2781
- }
2782
- //#endregion
2783
3383
  //#region src/surface/holdings.d.ts
2784
3384
  interface HoldingsMethods {
2785
3385
  current(input?: {
@@ -2787,18 +3387,6 @@ interface HoldingsMethods {
2787
3387
  }, options?: {
2788
3388
  readonly signal?: AbortSignal;
2789
3389
  }): Promise<CapxulResult<CurrentHoldings>>;
2790
- /**
2791
- * The designated display asset — the renderable row with the lowest asset
2792
- * id, or `null` when the snapshot carries no renderable row. Reads the same
2793
- * snapshot as `current` and picks from it; an empty answer is a value, not
2794
- * an error. The pick is by identity, never by quantity: two assets are not
2795
- * comparable money without a rate. ADR-0028 R6 retires this export.
2796
- */
2797
- primary(input?: {
2798
- readonly actor?: ActorReference;
2799
- }, options?: {
2800
- readonly signal?: AbortSignal;
2801
- }): Promise<CapxulResult<Holding | null>>;
2802
3390
  }
2803
3391
  //#endregion
2804
3392
  //#region src/surface/_shared/effect-actor-bridge.d.ts
@@ -3039,6 +3627,47 @@ interface CreateCapxulClientInput {
3039
3627
  };
3040
3628
  }
3041
3629
  //#endregion
3630
+ //#region src/ports/diagnostic.d.ts
3631
+ type DiagnosticDetail = Readonly<Record<string, unknown>>;
3632
+ interface DiagnosticPort {
3633
+ readonly trace: (scope: string, detail: DiagnosticDetail) => void;
3634
+ }
3635
+ //#endregion
3636
+ //#region src/openfort/create-openfort-browser-signer.d.ts
3637
+ interface OpenfortBrowserSigner extends CapxulSigner {
3638
+ readonly resetSession: () => void;
3639
+ /** Required here — this signer is the one that runs a readiness cycle. */
3640
+ readonly statusStore: SignerStatusStore;
3641
+ /**
3642
+ * Start the readiness cycle, or join the one already running, without
3643
+ * signing anything (#1667). The embedded-wallet port calls the same routine
3644
+ * lazily from `getAddress` / `signRawDigest`; the client assembly calls it
3645
+ * once the identity is claimed, so the status converges on `ready` or
3646
+ * `unavailable` without a signature. Idempotent: a second call inside a live
3647
+ * cycle joins that cycle.
3648
+ */
3649
+ readonly ensureWalletReady: () => Promise<void>;
3650
+ }
3651
+ /** Public Openfort values a host-owned browser signer needs after SDK bootstrap. */
3652
+ type OpenfortBrowserSignerBootstrap = Pick<BootstrapResolution, "authBaseUrl" | "openfortPublishableKey" | "shieldPublishableKey" | "openfortAuthProvider">;
3653
+ /** Authenticated callbacks for a browser that must not own the person's login flow. */
3654
+ interface OpenfortBrowserAuth {
3655
+ readonly getAccessToken: () => Promise<string | null>;
3656
+ readonly createEncryptionSession: (accessToken: string) => Promise<string>;
3657
+ }
3658
+ interface OpenfortBrowserSignerOptions {
3659
+ readonly diagnostic?: DiagnosticPort;
3660
+ readonly auth?: OpenfortBrowserAuth;
3661
+ /** Testing seam below the existing one-retry recovery owner. */
3662
+ readonly signUserOpHash?: ((hash: Parameters<CapxulSigner["signUserOpHash"]>[0], delegate: CapxulSigner["signUserOpHash"]) => ReturnType<CapxulSigner["signUserOpHash"]>) | undefined;
3663
+ }
3664
+ /** Build the existing browser signer around host-owned authenticated callbacks. */
3665
+ declare function createOpenfortBrowserSigner(input: {
3666
+ readonly bootstrap: OpenfortBrowserSignerBootstrap;
3667
+ readonly auth: OpenfortBrowserAuth;
3668
+ readonly diagnostic?: DiagnosticPort;
3669
+ }): OpenfortBrowserSigner;
3670
+ //#endregion
3042
3671
  //#region ../observability/src/engineering-delivery.d.ts
3043
3672
  type MetricEntry = Metric.Metric.Metadata<unknown, unknown>;
3044
3673
  interface CliEngineeringStats {
@@ -3191,17 +3820,11 @@ interface ObservationAdapter {
3191
3820
  /** Stable PostHog event used for typed failures that are expected product outcomes. */
3192
3821
  declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
3193
3822
  //#endregion
3194
- //#region src/ports/diagnostic.d.ts
3195
- type DiagnosticDetail = Readonly<Record<string, unknown>>;
3196
- interface DiagnosticPort {
3197
- readonly trace: (scope: string, detail: DiagnosticDetail) => void;
3198
- }
3199
- //#endregion
3200
- //#region src/openfort/create-openfort-browser-signer.d.ts
3201
- interface OpenfortBrowserSignerOptions {
3202
- readonly diagnostic?: DiagnosticPort;
3203
- /** Testing seam below the existing one-retry recovery owner. */
3204
- readonly signUserOpHash?: ((hash: Parameters<CapxulSigner["signUserOpHash"]>[0], delegate: CapxulSigner["signUserOpHash"]) => ReturnType<CapxulSigner["signUserOpHash"]>) | undefined;
3823
+ //#region src/adapters/auth-client/BetterAuthNodeAdapter.d.ts
3824
+ /** Host-owned protected storage for an opaque BetterAuth bearer credential. */
3825
+ interface NodeSessionStorage {
3826
+ load(): Promise<string | null>;
3827
+ save(token: string | null): Promise<void>;
3205
3828
  }
3206
3829
  //#endregion
3207
3830
  //#region src/production.d.ts
@@ -3211,6 +3834,8 @@ interface OpenfortBrowserSignerOptions {
3211
3834
  * runtime detection, and auth-cache selection are SDK-owned defaults.
3212
3835
  */
3213
3836
  interface CapxulClientInput {
3837
+ /** Optional Node-only durable BetterAuth credential storage; sessions are verified by the backend. */
3838
+ readonly nodeSessionStorage?: NodeSessionStorage;
3214
3839
  readonly publishableKey: string;
3215
3840
  /** Public Capxul bootstrap origin; defaults remain unchanged when omitted. */
3216
3841
  readonly bootstrapBaseUrl?: string;
@@ -3240,6 +3865,8 @@ interface CapxulClientInput {
3240
3865
  * holds an RPC URL, a gas-sponsorship policy, or a bundler.
3241
3866
  */
3242
3867
  readonly signer?: CapxulSigner;
3868
+ /** Build a host-owned Openfort signer from the SDK's validated bootstrap. */
3869
+ readonly openfortSignerFactory?: (bootstrap: OpenfortBrowserSignerBootstrap) => CapxulSigner;
3243
3870
  }
3244
3871
  /** Per-client signing controls; only the testing entry exposes these to consumers. */
3245
3872
  interface ProductionSignerControls {
@@ -3251,4 +3878,4 @@ interface ProductionSignerControls {
3251
3878
  readonly signEmbeddedUserOpHash?: OpenfortBrowserSignerOptions["signUserOpHash"];
3252
3879
  }
3253
3880
  //#endregion
3254
- export { OrganizationPaymentBatchInput as $, PAYMENT_DIRECTIONS 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, OrgSetupStep as Gn, ActivityPage as Gt, PayrollGroup as H, AccountSetupPolicy as Hn, ActivityKind as Ht, RoleDefinition as I, AccountSetupStep as In, InboxMethods as It, PayrollRun as J, ActorRef as Jn, ActivitySummary as Jt, PayrollMethods as K, PayoutAddress 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, InboxStatus 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, ClientRequests as Un, ActivityListParams as Ut, PayrollEngagementTerms as V, AuthMethods as Vn, ActivityItem as Vt, PayrollGroupMember as W, OrgLifecycle as Wn, ActivityMethods as Wt, PayrollRunStatus as X, Permission as Xn, ActivitySummaryTotal as Xt, PayrollRunItemInput as Y, CurrentHoldings as Yn, ActivitySummaryParams as Yt, PayrollRuns as Z, SubmittedPermissionExecution as Zn, ActorReference as Zt, HoldingsMethods as _, PaymentDirection as _n, InvocationControls as _r, OnboardingMethods as _t, ObservationContext as a, DestinationRemoveInput as an, TelemetryIdentifyInput as ar, PermissionCreateInput as at, SystemHealth as b, PaymentDocumentRender as bn, PersonOnboarding as bt, HostObservability as c, MeMethods as cn, IdentityEvent as cr, PermissionReplaceInput as ct, postHogObservability as d, OfframpMethods as dn, Readiness as dr, Budget as dt, DestinationAddInput as en, PAYMENT_STATUSES as er, OrganizationPaymentInput as et, CapxulClient as f, OfframpQuote as fn, StateLabel as fr, OrgMe as ft, IdentityRuntimeSendResult as g, PaymentActivityEvidence as gn, IdentityTransition as gr, CompletedPersonProfile as gt, IdentityRuntime as h, Payment as hn, isRestoring as hr, AccountsMethods as ht, ObservationAdapter as i, DestinationRail as in, TelemetryGroupInput 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, IdentityState as lr, PermissionRevokeInput as lt, IdentityProfileDetails as m, OfframpStatus as mn, isClaimed as mr, OrgMeOptions as mt, ProductionSignerControls as n, DestinationListInput as nn, RequestStatus as nr, OrganizationPaymentsMethods as nt, ObservationDelivery as o, DestinationsMethods as on, TelemetryPort as or, PermissionMethods as ot, CreateCapxulClientInput as p, OfframpQuoteInput as pn, destination as pr, OrgMeMethod as pt, PayrollOptions as q, ClientRequestView as qn, ActivityReference as qt, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as r, DestinationPayload as rn, TelemetryEvent as rr, PermissionAssignInput as rt, SdkFailureObservation as s, FinancialOpsMethods as sn, Destination$1 as sr, PermissionOptions as st, CapxulClientInput as t, DestinationKind as tn, PaymentStatus$1 as tr, OrganizationPaymentItemInput as tt, PostHogObservabilityOptions as u, MovementActivityEvidence as un, OrgLane 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 };
3881
+ export { PayrollRuns as $, OrgSetupStep as $n, ActivityListParams as $t, MemberStatus as A, PaymentDocumentsMethods as An, PAYMENT_STATUSES as Ar, PersonOnboarding as At, RoleView as B, TargetReference as Bn, OrgLane as Br, AddressBookAddInput as Bt, SystemHealth as C, OfframpQuoteInput as Cn, PaymentDocumentVerification as Cr, AccountsMethods as Ct, AssignmentProjection as D, PaymentDirection as Dn, SubmittedPermissionExecution as Dr, OrganizationOnboardingInput as Dt, CurrentUserMethods as E, PaymentActivityEvidence as En, Permission as Er, OrganizationOnboarding as Et, OrgView as F, PaymentsMethods as Fn, TelemetryIdentifyInput as Fr, ActorProfileMethods as Ft, PayrollGroupInput as G, isSettingUpLifecycle as Gn, isRestoring as Gr, InboxItem as Gt, AuthorizeRunOptions as H, fingerprintPaymentIntent as Hn, StateLabel as Hr, AddressBookLabelInput as Ht, OrganizationAccess as I, PaymentsPayInput as In, TelemetryPort as Ir, ActorRelationshipMethods as It, PayrollMethods as J, SmartAccountMethods as Jn, ActivityAnnotationInput as Jt, PayrollGroupMember as K, CompleteProfileInput as Kn, IdentityTransition as Kr, InboxMethods as Kt, OrganizationAccount as L, RecipientResolution as Ln, Destination$1 as Lr, ActorRequest as Lt, OrgMethods as M, PaymentStatus as Mn, RequestStatus as Mr, ReadyAccountLifecycle as Mt, OrgScopedMethods as N, PaymentTiming as Nn, TelemetryEvent as Nr, AccountMethods as Nt, CreateOrgInput as O, PaymentDocumentKind as On, InboxStatus as Or, OrganizationOnboardingOptions as Ot, OrgTemplate as P, PaymentType as Pn, TelemetryGroupInput as Pr, ActorProfile as Pt, PayrollRunStatus as Q, OrgLifecycle as Qn, ActivityKind as Qt, OrganizationAuditLogItem as R, Ref$1 as Rn, IdentityEvent as Rr, ActorRequestIssueInput as Rt, SystemMethods as S, OfframpQuote as Sn, PaymentDocumentRender as Sr, OrgMeOptions as St, CurrentUserContext as T, Payment as Tn, CurrentHoldings as Tr, OnboardingMethods as Tt, PayrollEngagementTerms as U, AccountLifecycle as Un, destination as Ur, AddressBookMethods as Ut, AuthorizeRunInput as V, TargetsMethods as Vn, Readiness as Vr, AddressBookEntry as Vt, PayrollGroup as W, AccountSetupStep as Wn, isClaimed as Wr, InboxApproveInput as Wt, PayrollRun as X, AccountSetupPolicy as Xn, ActivityFilter as Xt, PayrollOptions as Y, AuthMethods as Yn, ActivityDetail as Yt, PayrollRunItemInput as Z, ClientRequests as Zn, ActivityItem as Zt, CreateCapxulClientInput as _, FinancialOpsMethods as _n, OfferedAuthority as _r, OrgInvitations as _t, ObservationContext as a, ActivitySummaryParams as an, GranteeRef as ar, PermissionAssignInput as at, IdentityRuntimeSendResult as b, MovementActivityEvidence as bn, PaymentDocumentDownload as br, OrgMe as bt, HostObservability as c, DepositInstructions as cn, InvitationPage as cr, PermissionMethods as ct, postHogObservability as d, DestinationKind as dn, InvitationRecovery as dr, PermissionRevokeInput as dt, ActivityMethods as en, PayoutAddress as er, PayrollTermsUnit as et, OpenfortBrowserAuth as f, DestinationListInput as fn, InvitationTarget as fr, PermissionReadResult as ft, CapxulClient as g, DestinationsMethods as gn, InvitePreview as gr, InvitePreviewInput as gt, createOpenfortBrowserSigner as h, DestinationRemoveInput as hn, InviteInput as hr, InvitePrepared as ht, ObservationAdapter as i, ActivitySummary as in, EndingReason as ir, OrganizationPaymentsMethods as it, MemberView as j, PaymentMoney as jn, PaymentStatus$1 as jr, PersonOnboardingInput as jt, MemberIdentityProjection as k, PaymentDocumentRef as kn, PAYMENT_DIRECTIONS as kr, OrganizationOnboardingState as kt, PostHogObservabilityClient as l, Destination as ln, InvitationPageInput as lr, PermissionOptions as lt, OpenfortBrowserSignerBootstrap as m, DestinationRail as mn, InviteGrant as mr, InviteOptions as mt, ProductionSignerControls as n, ActivityRange as nn, BudgetIntent as nr, OrganizationPaymentInput as nt, ObservationDelivery as o, ActivitySummaryTotal as on, InvitationAcceptInput as or, PermissionChangeInput as ot, OpenfortBrowserSigner as p, DestinationPayload as pn, InvitationView as pr, InviteMethod as pt, PayrollGroupsMethods as q, IdentityMethods as qn, InvocationControls as qr, ActivityAnnotation as qt, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as r, ActivityReference as rn, CurrentPolicy as rr, OrganizationPaymentItemInput as rt, SdkFailureObservation as s, ActorReference as sn, InvitationId as sr, PermissionCreateInput as st, CapxulClientInput as t, ActivityPage as tn, AuthorityRef as tr, OrganizationPaymentBatchInput as tt, PostHogObservabilityOptions as u, DestinationAddInput as un, InvitationPhase as ur, PermissionReplaceInput as ut, IdentityProfileDetails as v, MeMethods as vn, SpendingScope as vr, OwnInvitationsMethod as vt, MediaMethods as w, OfframpStatus as wn, ActorRef as wr, CompletedPersonProfile as wt, HoldingsMethods as x, OfframpMethods as xn, PaymentDocumentReadRef as xr, OrgMeMethod as xt, IdentityRuntime as y, MeProfile as yn, ClientRequestView as yr, Budget as yt, RoleDefinition as z, ResolvedTarget as zn, IdentityState as zr, ActorRequestsMethods as zt };