@capxul/sdk-react 4.20.0-beta.23 → 4.20.0-beta.26

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,8 +1,9 @@
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-BMAU2kKH.mjs";
1
+ import { A as TransitionListener, C as CreateOrganizationFailure, D as OrganizationDetails, E as InvocationOptions, O as ProfileDetails, S as CapxulSend, T as Destination, _ as ReadyDestination, a as ActionResult, b as Slot, c as CapxulAuthenticationController, d as NavigationAction, f as OrgFailure, g as ProfileSlotProps, h as PendingAuthState, i as AccountProgress, k as SendResult, l as ControllerAction, m as OtpPendingState, n as OnboardingControllerProps, o as AuthenticatedState, p as OrgProgress, r as AccountFailure, s as AuthenticationSlots, t as CapxulOnboardingController, u as FaultedState, v as RetryAction, w as CreateOrganizationSubmission, x as CapxulAuth, y as SignedOutState } from "./onboarding-controller-DrJiYWfY.mjs";
2
+ import * as React from "react";
2
3
  import { ReactNode, RefCallback } from "react";
3
4
  import { QueryClient, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
4
- import { Account, AccountRequirement, ActivityAnnotation, ActivityAnnotationInput, ActivityDetail, ActivityKind, ActivityListParams, ActivityPage, ActivityPhase, ActivityRange, ActivityReference, ActivitySummaryTotal, ActorReference, AddressBookEntry, AssetAmount, AssetId, BudgetId, CapxulClient, CapxulError, CapxulResult, CapxulSigner, CurrentHoldings, HostObservability, IdentityDestination, IdentityState, MemberView, Money, MoneyParseErrorReason, OrgId, OrganizationAccess, OrganizationOnboarding, OrganizationOnboardingInput, 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
- //#region src/provider.d.ts
5
+ import { Account, AccountRequirement, ActivityAnnotation, ActivityAnnotationInput, ActivityDetail, ActivityItem, ActivityKind, ActivityListParams, ActivityPage, ActivityPhase, ActivityRange, ActivityReference, ActivitySummaryTotal, ActorReference, AddressBookEntry, AssetAmount, AssetId, BudgetId, CapxulClient, CapxulError, CapxulResult, CapxulSigner, CurrentHoldings, HostObservability, IdentityDestination, IdentityState, IdentityTransition, MemberView, Money, MoneyParseErrorReason, OrgId, OrganizationAccess, OrganizationOnboarding, OrganizationOnboardingInput, OrganizationPaymentBatchInput, OrganizationPaymentInput, Page, PartyId, Payment, PaymentDirection, PaymentDocumentDownload, PaymentDocumentReadRef, PaymentDocumentRef, PaymentDocumentRender, PaymentStatus, PaymentTiming, PaymentType, PaymentsPayInput, PayrollGroupId, PayrollGroupInput, PayrollRunId, PayrollRunStatus, Permission, PermissionMethods, PermissionReadResult, Profile, RoleView, StateLabel, SubmittedPermissionExecution, isClaimed, isRestoring } from "@capxul/sdk";
6
+ //#region src/platform/provider.d.ts
6
7
  type CapxulProviderSharedProps = {
7
8
  /** Bring your own QueryClient; otherwise the provider creates one. */
8
9
  readonly queryClient?: QueryClient;
@@ -48,163 +49,151 @@ type CapxulProviderInjectedClientProps = CapxulProviderSharedProps & {
48
49
  readonly bootstrapBaseUrl?: never;
49
50
  };
50
51
  type CapxulProviderProps = CapxulProviderPublishableKeyProps | CapxulProviderInjectedClientProps;
51
- declare function CapxulProvider(props: CapxulProviderProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function CapxulProvider(props: CapxulProviderProps): React.JSX.Element;
52
53
  //#endregion
53
- //#region src/internal/capxul-bootstrap-context.d.ts
54
+ //#region src/platform/bootstrap-context.d.ts
54
55
  type CapxulBootstrapStatus = "bootstrapping" | "ready" | "error";
55
56
  interface CapxulBootstrapState {
56
57
  readonly status: CapxulBootstrapStatus;
57
58
  readonly error: CapxulError | null;
58
59
  readonly retry: () => void;
59
60
  }
60
- declare function useCapxul(): CapxulBootstrapState;
61
+ export declare function useCapxul(): CapxulBootstrapState;
61
62
  //#endregion
62
- //#region src/internal/capxul-client-context.d.ts
63
+ //#region src/platform/client-context.d.ts
63
64
  /**
64
65
  * Returns the client, or `null` while `<CapxulProvider>` is still bootstrapping.
65
66
  * Data hooks use this so they can sit in `isPending` (disabled query) until the
66
67
  * client resolves, rather than throwing during bootstrap.
67
68
  */
68
- declare function useCapxulClientOrNull(): CapxulClient | null;
69
+ export declare function useCapxulClientOrNull(): CapxulClient | null;
69
70
  //#endregion
70
- //#region src/hooks/use-capxul-profile.d.ts
71
- type UseCapxulProfileReturn = UseQueryResult<Profile | null, CapxulError>;
72
- declare function useCapxulProfile(): UseCapxulProfileReturn;
73
- //#endregion
74
- //#region src/hooks/use-capxul-account-balance.d.ts
75
- type UseCapxulAccountBalanceReturn = UseQueryResult<Account, CapxulError>;
76
- type UseCapxulAccountBalanceOptions = {
77
- /** When false, skips the Convex readBalance action until the account ladder is ready. */
78
- readonly enabled?: boolean;
79
- };
80
- declare function useCapxulAccountBalance(options?: UseCapxulAccountBalanceOptions): UseCapxulAccountBalanceReturn;
81
- //#endregion
82
- //#region src/hooks/use-capxul-account-fund.d.ts
83
- type UseCapxulAccountFundReturn = UseMutationResult<{
84
- readonly txHash: string;
85
- }, CapxulError, AssetAmount>;
86
- declare function useCapxulAccountFund(): UseCapxulAccountFundReturn;
87
- //#endregion
88
- //#region src/hooks/use-capxul-money.d.ts
89
- type CapxulPayIntent = PaymentsPayInput;
90
- type UseCapxulPayReturn = UseMutationResult<Payment, CapxulError, CapxulPayIntent>;
91
- declare function useCapxulPay(): UseCapxulPayReturn;
92
- type UseCapxulCreateCommitmentReturn = UseMutationResult<Payment, CapxulError, PaymentsPayInput & {
93
- readonly timing: Exclude<PaymentTiming, {
94
- readonly kind: "instant";
95
- }>;
96
- }>;
97
- declare function useCapxulCreateCommitment(): UseCapxulCreateCommitmentReturn;
98
- declare const useCapxulClaimPayment: () => UseMutationResult<Payment, CapxulError, string>;
99
- declare const useCapxulCancelPayment: () => UseMutationResult<Payment, CapxulError, string>;
100
- type UseCapxulRedirectPaymentReturn = UseMutationResult<Payment, CapxulError, Parameters<import("@capxul/sdk").PaymentsMethods["redirect"]>[0]>;
101
- declare function useCapxulRedirectPayment(): UseCapxulRedirectPaymentReturn;
102
- type UseCapxulPaymentsReturn = UseQueryResult<readonly Payment[], CapxulError>;
103
- declare function useCapxulPayments(options?: {
104
- readonly enabled?: boolean;
105
- }): UseCapxulPaymentsReturn;
106
- type UseCapxulPaymentReturn = UseQueryResult<Payment | null, CapxulError>;
107
- declare function useCapxulPayment(paymentId: string | undefined, options?: {
108
- readonly enabled?: boolean;
109
- }): UseCapxulPaymentReturn;
71
+ //#region src/platform/identity.d.ts
72
+ export declare function useCapxulIdentity(): IdentityState;
73
+ export declare function useCapxulSend(): CapxulSend;
74
+ export declare function useCapxulAuth(): CapxulAuth;
75
+ export declare function useCapxulDestination(): Destination | null;
76
+ export declare function useCapxulTransitions(listener: TransitionListener): void;
77
+ export declare const entered: (record: IdentityTransition, target: StateLabel) => boolean;
110
78
  //#endregion
111
- //#region src/hooks/use-capxul-organization-payments.d.ts
112
- /**
113
- * `orgId` may be absent because a screen has no branded org id until its org
114
- * context loads (`OrgView.id` is the branded one). An absent id refuses the
115
- * mutation the way every other org read refuses one, rather than forcing a
116
- * `as OrgId` cast at the call site.
117
- */
118
- declare function useCapxulOrganizationPay(orgId: OrgId | undefined): UseMutationResult<Payment, CapxulError, OrganizationPaymentInput>;
119
- declare function useCapxulOrganizationPayBatch(orgId: OrgId): UseMutationResult<readonly Payment[], CapxulError, OrganizationPaymentBatchInput>;
120
- //#endregion
121
- //#region src/hooks/use-capxul-permissions.d.ts
122
- type Operation = "create" | "change" | "assign" | "revoke" | "replace";
123
- type Input<K extends Operation> = Parameters<PermissionMethods[K]>[0];
124
- declare const useCapxulPermissionCreate: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"create">>;
125
- declare const useCapxulPermissionChange: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"change">>;
126
- declare const useCapxulPermissionAssign: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"assign">>;
127
- declare const useCapxulPermissionRevoke: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"revoke">>;
128
- declare const useCapxulPermissionReplace: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"replace">>;
129
- declare function useCapxulPermissions(orgId: OrgId, options?: {
130
- readonly enabled?: boolean;
131
- }): UseQueryResult<PermissionReadResult, CapxulError>;
132
- declare function useCapxulPermission(orgId: OrgId, permissionId: string | undefined): UseQueryResult<Permission | null, CapxulError>;
133
- //#endregion
134
- //#region src/hooks/use-capxul-activity.d.ts
135
- declare function useCapxulActivity(params?: ActivityListParams): UseQueryResult<ActivityPage, CapxulError>;
136
- declare function useCapxulActivityDetail(reference: ActivityReference | undefined, actor?: ActorReference): UseQueryResult<ActivityDetail | null, CapxulError>;
137
- declare function useCapxulAnnotateMovement(): UseMutationResult<ActivityAnnotation, CapxulError, ActivityAnnotationInput>;
138
- //#endregion
139
- //#region src/hooks/use-capxul-holdings.d.ts
140
- interface UseCapxulHoldingsParams {
141
- /** Omitted = the signed-in person. SDK core already accepts one. */
142
- readonly actor?: ActorReference;
79
+ //#region src/access/use-client-connection.d.ts
80
+ interface OtpSlice {
81
+ readonly email: string;
82
+ readonly pending: boolean;
83
+ readonly canResend: boolean;
84
+ readonly verifyCode: (code: string) => Promise<void>;
85
+ readonly resend: () => Promise<void>;
86
+ }
87
+ interface ConsentSlice {
88
+ readonly verifiedEmail: string;
89
+ readonly clientLabel: string;
90
+ readonly scopeCodes: readonly string[];
91
+ readonly purpose: "login" | "signup";
92
+ readonly setupState: "not_required" | "new" | "resumable";
93
+ readonly pending: boolean;
94
+ readonly accept: () => Promise<void>;
95
+ readonly cancel: () => Promise<void>;
96
+ }
97
+ interface CompleteSlice {
98
+ readonly outcome: "connected";
99
+ }
100
+ interface FailureSlice {
101
+ readonly code: string;
102
+ readonly field?: string;
103
+ readonly retry: () => Promise<void>;
104
+ readonly cancel: () => Promise<void>;
143
105
  }
144
- declare function useCapxulHoldings(params?: UseCapxulHoldingsParams): UseQueryResult<CurrentHoldings, CapxulError>;
145
106
  //#endregion
146
- //#region src/hooks/use-capxul-orgs.d.ts
147
- /**
148
- * List the Organizations that the current user can access. Binds directly to
149
- * the locked `capxul.orgs()` SDK method.
150
- */
151
- type UseCapxulOrgsReturn = UseQueryResult<readonly OrganizationAccess[], CapxulError>;
152
- type UseCapxulOrgsOptions = {
153
- /**
154
- * Gate the query on auth readiness. `client.orgs()` is a session-scoped
155
- * authenticated read; firing it before the session token settles surfaces a
156
- * spurious `NOT_AUTHENTICATED`. Consumers pass `enabled: <auth-ready>`.
157
- * Defaults to `true` to preserve the bare `useCapxulOrgs()` call shape.
158
- */
159
- readonly enabled?: boolean;
107
+ //#region src/access/client-connection.d.ts
108
+ interface CapxulClientConnectionProps {
109
+ readonly client: CapxulClient;
110
+ readonly requestId: string;
111
+ readonly children: ReactNode;
112
+ }
113
+ declare function Root$7({ client, requestId, children }: CapxulClientConnectionProps): import("react").JSX.Element;
114
+ declare function Checking$1({ children }: {
115
+ readonly children: ReactNode;
116
+ }): import("react").JSX.Element | null;
117
+ declare function Otp({ children }: {
118
+ readonly children: (slice: OtpSlice) => ReactNode;
119
+ }): import("react").JSX.Element | null;
120
+ declare function Consent({ children }: {
121
+ readonly children: (slice: ConsentSlice) => ReactNode;
122
+ }): import("react").JSX.Element | null;
123
+ declare function Complete({ children }: {
124
+ readonly children: (slice: CompleteSlice) => ReactNode;
125
+ }): import("react").JSX.Element | null;
126
+ declare function Failure({ children }: {
127
+ readonly children: (slice: FailureSlice) => ReactNode;
128
+ }): import("react").JSX.Element | null;
129
+ export declare const CapxulClientConnection: typeof Root$7 & {
130
+ Checking: typeof Checking$1;
131
+ Otp: typeof Otp;
132
+ Consent: typeof Consent;
133
+ Complete: typeof Complete;
134
+ Failure: typeof Failure;
160
135
  };
161
- declare function useCapxulOrgs(options?: UseCapxulOrgsOptions): UseCapxulOrgsReturn;
162
136
  //#endregion
163
- //#region src/hooks/use-capxul-org-members.d.ts
164
- type UseCapxulOrgMembersOptions = {
165
- readonly enabled?: boolean;
137
+ //#region src/access/dashboard-access.d.ts
138
+ type DashboardScope = {
139
+ readonly kind: "personal";
140
+ } | {
141
+ readonly kind: "organization";
142
+ readonly orgId?: string;
166
143
  };
144
+ type DashboardAccessPhase = "checking" | "error" | "redirect" | "granted";
167
145
  /**
168
- * List the members of one Organization. Binds directly to
169
- * `capxul.org(orgId).members()`. Gated by
170
- * `orgId !== undefined`; callers may additionally gate on canonical identity
171
- * readiness through `options.enabled`.
146
+ * Which probe produced the error the screen is showing. The
147
+ * error code alone cannot say: a provider failure reads the same whether the
148
+ * session read, the membership list or the lifecycle read raised it, and a
149
+ * consumer that reports a displayed gate error has to keep those apart
150
+ * (#1963 R05-2). It names the SOURCE only; `retry` still re-runs every failed
151
+ * probe, exactly as before.
172
152
  */
173
- type UseCapxulOrgMembersReturn = UseQueryResult<readonly MemberView[], CapxulError>;
174
- declare function useCapxulOrgMembers(orgId: OrgId | undefined, options?: UseCapxulOrgMembersOptions): UseCapxulOrgMembersReturn;
175
- //#endregion
176
- //#region src/hooks/use-capxul-org-roles.d.ts
177
- type UseCapxulOrgRolesOptions = {
178
- readonly enabled?: boolean;
179
- };
153
+ type DashboardAccessProbe = "session" | "membership" | "lifecycle" | "authority";
154
+ interface DashboardAccessErrorSlice {
155
+ readonly error: CapxulError;
156
+ /** The probe the surfaced error came from, in the frozen precedence order. */
157
+ readonly probe: DashboardAccessProbe;
158
+ /** Re-runs each failed probe. */
159
+ readonly retry: () => void;
160
+ }
161
+ interface DashboardAccessRedirectSlice {
162
+ readonly destination: IdentityDestination;
163
+ }
164
+ interface CapxulDashboardAccessProps {
165
+ readonly scope: DashboardScope;
166
+ readonly children: ReactNode;
167
+ }
168
+ declare function Root$6({ scope, children }: CapxulDashboardAccessProps): import("react").JSX.Element;
169
+ /** Hands nothing — today's app renders `null` here, exactly as it does now. */
170
+ declare function Checking({ children }: {
171
+ readonly children?: ReactNode;
172
+ }): import("react").JSX.Element | null;
173
+ declare function DashboardError({ children }: {
174
+ readonly children: (slice: DashboardAccessErrorSlice) => ReactNode;
175
+ }): import("react").JSX.Element | null;
180
176
  /**
181
- * List the roles for one Organization. Binds directly
182
- * to `capxul.org(orgId).roles()`. Gated by `orgId !== undefined`.
177
+ * Hands the destination and draws nothing. Reaching this part is a REQUEST to
178
+ * navigate, never an arrival: the app may cancel or supersede it, so nothing
179
+ * here — and nothing a consumer hangs off it — may claim a completed redirect
180
+ * (#1963 R05-1). The destination page's own normalized pageview proves arrival.
183
181
  */
184
- type UseCapxulOrgRolesReturn = UseQueryResult<readonly RoleView[], CapxulError>;
185
- declare function useCapxulOrgRoles(orgId: OrgId | undefined, options?: UseCapxulOrgRolesOptions): UseCapxulOrgRolesReturn;
186
- //#endregion
187
- //#region src/hooks/use-capxul-org-treasury.d.ts
188
- type UseCapxulOrgTreasuryOptions = {
189
- readonly enabled?: boolean;
182
+ declare function Redirect({ children }: {
183
+ readonly children: (slice: DashboardAccessRedirectSlice) => ReactNode;
184
+ }): import("react").JSX.Element | null;
185
+ declare function Granted({ children }: {
186
+ readonly children?: ReactNode;
187
+ }): import("react").JSX.Element | null;
188
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
189
+ export declare const CapxulDashboardAccess: typeof Root$6 & {
190
+ Checking: typeof Checking;
191
+ Error: typeof DashboardError;
192
+ Redirect: typeof Redirect;
193
+ Granted: typeof Granted;
190
194
  };
191
- /**
192
- * Return the Organization treasury Account.
193
- * NEVER `AccountStatus` (the deploy-readiness ladder, no balance). Binds
194
- * Binds directly to `capxul.org(orgId).treasury()`. Gated by `orgId !== undefined`.
195
- */
196
- type UseCapxulOrgTreasuryReturn = UseQueryResult<Account, CapxulError>;
197
- declare function useCapxulOrgTreasury(orgId: OrgId | undefined, options?: UseCapxulOrgTreasuryOptions): UseCapxulOrgTreasuryReturn;
198
- //#endregion
199
- //#region src/hooks/use-capxul-create-org.d.ts
200
- /**
201
- * Create an Organization. Binds directly to the
202
- * `onboarding.completeOrganization(input)` SDK method. On success, invalidates the org list.
203
- */
204
- type UseCapxulCreateOrgReturn = UseMutationResult<OrganizationOnboarding, CapxulError, OrganizationOnboardingInput>;
205
- declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
206
195
  //#endregion
207
- //#region src/headless/journey/journey-state.d.ts
196
+ //#region src/profiles/journey-state.d.ts
208
197
  type OnboardingIntent = "personal" | "organization";
209
198
  type OnboardingStep = "profile" | "organization" | "provisioning";
210
199
  type PayoutDraftChain = "evm" | "solana" | "starknet";
@@ -262,40 +251,40 @@ type OnboardingJourneyPosition = {
262
251
  readonly organizationId?: string;
263
252
  readonly verification: boolean;
264
253
  };
265
- declare function startOnboardingJourney(input: {
254
+ export declare function startOnboardingJourney(input: {
266
255
  readonly intent: OnboardingIntent;
267
256
  readonly ownerId: string;
268
257
  readonly entryPoint: "signup" | "dashboard";
269
258
  readonly origin?: OnboardingOrigin;
270
259
  readonly step?: OnboardingStep;
271
260
  }): OnboardingJourney;
272
- declare function loadOnboardingJourney(expectedOwnerId?: string): OnboardingJourney | null;
273
- declare function saveOnboardingJourney(journey: OnboardingJourney): void;
274
- declare function currentOnboardingJourneyId(): string | undefined;
261
+ export declare function loadOnboardingJourney(expectedOwnerId?: string): OnboardingJourney | null;
262
+ export declare function saveOnboardingJourney(journey: OnboardingJourney): void;
263
+ export declare function currentOnboardingJourneyId(): string | undefined;
275
264
  /** Stop observation attribution while no authenticated owner is established. */
276
- declare function invalidateOnboardingJourneyObservation(): void;
265
+ export declare function invalidateOnboardingJourneyObservation(): void;
277
266
  /** Where the journey stands — the pure position apps map to their routes. */
278
- declare function onboardingJourneyPosition(journey: OnboardingJourney): OnboardingJourneyPosition;
267
+ export declare function onboardingJourneyPosition(journey: OnboardingJourney): OnboardingJourneyPosition;
279
268
  /**
280
269
  * The interruption-recovery decision (behavior map §4): a journey that does
281
270
  * not match the ready destination the app just rendered must resume; a
282
271
  * matching one needs no recovery. Returns the journey to resume, or null.
283
272
  */
284
- declare function activeOnboardingRecovery(ownerId: string, renderedReadyDestination?: {
273
+ export declare function activeOnboardingRecovery(ownerId: string, renderedReadyDestination?: {
285
274
  readonly kind: "personal";
286
275
  } | {
287
276
  readonly kind: "organization";
288
277
  readonly organizationId: string;
289
278
  }): OnboardingJourney | null;
290
- declare function acknowledgeOnboardingDestination(destination: {
279
+ export declare function acknowledgeOnboardingDestination(destination: {
291
280
  readonly kind: "personal";
292
281
  } | {
293
282
  readonly kind: "organization";
294
283
  readonly organizationId: string;
295
284
  }, ownerId: string): boolean;
296
- declare function clearOnboardingJourney(): void;
285
+ export declare function clearOnboardingJourney(): void;
297
286
  //#endregion
298
- //#region src/headless/onboarding/use-capxul-handle-availability.d.ts
287
+ //#region src/profiles/use-capxul-handle-availability.d.ts
299
288
  type HandleAvailability = {
300
289
  readonly available: boolean;
301
290
  readonly normalized: string;
@@ -308,159 +297,201 @@ type UseCapxulHandleAvailabilityReturn = UseQueryResult<HandleAvailability, Capx
308
297
  * boundary's message), not as `available: false` — only a handle someone
309
298
  * else owns is "taken".
310
299
  */
311
- declare function useCapxulHandleAvailability(handle: string, options?: {
300
+ export declare function useCapxulHandleAvailability(handle: string, options?: {
312
301
  readonly enabled?: boolean;
313
302
  readonly debounceMs?: number;
314
303
  }): UseCapxulHandleAvailabilityReturn;
315
304
  //#endregion
316
- //#region src/headless/media/use-capxul-image-upload.d.ts
317
- type ImageUploadTarget = {
318
- readonly kind: "profile";
319
- } | {
320
- readonly kind: "orgLogo";
321
- readonly orgId: string;
322
- };
323
- type ImageUploadInput = {
324
- readonly blob: Blob;
325
- readonly target: ImageUploadTarget;
305
+ //#region src/profiles/use-capxul-profile.d.ts
306
+ type UseCapxulProfileReturn = UseQueryResult<Profile | null, CapxulError>;
307
+ export declare function useCapxulProfile(): UseCapxulProfileReturn;
308
+ //#endregion
309
+ //#region src/accounts/use-capxul-account-balance.d.ts
310
+ type UseCapxulAccountBalanceReturn = UseQueryResult<Account, CapxulError>;
311
+ type UseCapxulAccountBalanceOptions = {
312
+ /** When false, skips the Convex readBalance action until the account ladder is ready. */
313
+ readonly enabled?: boolean;
326
314
  };
327
- type UseCapxulImageUploadReturn = UseMutationResult<{
328
- readonly url: string | null;
329
- }, CapxulError, ImageUploadInput>;
330
- /**
331
- * #1061 / ADR-0014: the whole upload→record sequence as one mutation —
332
- * upload the blob, then bind the returned storage id to the profile image or
333
- * the org logo. The url is the resolved serving URL (re-read from queries,
334
- * never persisted by consumers).
335
- */
336
- declare function useCapxulImageUpload(): UseCapxulImageUploadReturn;
315
+ export declare function useCapxulAccountBalance(options?: UseCapxulAccountBalanceOptions): UseCapxulAccountBalanceReturn;
337
316
  //#endregion
338
- //#region src/headless/media/use-capxul-upload-image.d.ts
339
- type UseCapxulUploadImageReturn = UseMutationResult<{
340
- readonly storageId: string;
341
- }, CapxulError, Blob>;
342
- /**
343
- * #1955: upload only. Hands back the storage id for a CREATE call to carry
344
- * (`ProfileDetails.imageStorageId`, `OrganizationDetails.logoStorageId`).
345
- *
346
- * `useCapxulImageUpload` is upload+bind and stays as it is for the settings
347
- * pages. It cannot serve onboarding: the row it binds to does not exist yet.
348
- * Nothing is bound here, so nothing is invalidated either — the create call
349
- * that carries the id owns the cache change.
350
- */
351
- declare function useCapxulUploadImage(): UseCapxulUploadImageReturn;
317
+ //#region src/accounts/use-capxul-account-fund.d.ts
318
+ type UseCapxulAccountFundReturn = UseMutationResult<{
319
+ readonly txHash: string;
320
+ }, CapxulError, AssetAmount>;
321
+ export declare function useCapxulAccountFund(): UseCapxulAccountFundReturn;
352
322
  //#endregion
353
- //#region src/headless/contacts/use-contacts.d.ts
354
- type ContactsActor = {
323
+ //#region src/accounts/use-capxul-holdings.d.ts
324
+ interface UseCapxulHoldingsParams {
325
+ /** Omitted = the signed-in person. SDK core already accepts one. */
326
+ readonly actor?: ActorReference;
327
+ }
328
+ export declare function useCapxulHoldings(params?: UseCapxulHoldingsParams): UseQueryResult<CurrentHoldings, CapxulError>;
329
+ //#endregion
330
+ //#region src/payments/use-recipient-resolution.d.ts
331
+ type SendMoneyRecipientStatus = "empty" | "invalid" | "checking" | "known-party" | "new-email" | "external-warning" | "external-ready" | "not-found" | "failed";
332
+ interface SendMoneyRecipientSlice {
333
+ readonly value: string;
334
+ readonly change: (text: string) => void;
335
+ readonly status: SendMoneyRecipientStatus;
336
+ readonly label: string | null;
337
+ readonly kind: "person" | "organization" | "external_address" | "unresolved" | null;
338
+ readonly isCapxulAccount: boolean | null;
339
+ readonly publicValue: string | null;
340
+ readonly requiresAcknowledgement: boolean;
341
+ readonly acknowledgeExternalAddress: () => void;
342
+ }
343
+ //#endregion
344
+ //#region src/payments/send-money-slices.d.ts
345
+ type SendActor = {
355
346
  readonly kind: "personal";
356
347
  } | {
357
348
  readonly kind: "organization";
358
349
  readonly orgId: OrgId | undefined;
359
350
  };
351
+ type SentPayment = {
352
+ /** The backend payment row. */
353
+ readonly payment: Payment;
354
+ /** What we parsed and sent — `.value` is the comma-stripped major-unit string. */
355
+ readonly amount: AssetAmount;
356
+ /** The trimmed text the person typed — the app's success toast interpolates it. */
357
+ readonly recipient: string;
358
+ };
360
359
  /**
361
- * How a contact entered the book. Taken from the shipped surface rather than
362
- * re-declared, so the component can never advertise a provenance the wire
363
- * cannot carry (ADR-0022 R2; #1532 owns the definition site).
364
- */
365
- type ContactRelationship = AddressBookEntry["relationship"][number];
366
- interface Contact {
367
- /**
368
- * The counterparty's `PartyId` — created once and claimed at signup, never
369
- * re-keyed (ADR-0022 R1/R3). No email, no prefix, nothing to parse.
370
- */
371
- readonly id: PartyId;
372
- /** The saved label when there is one, else the party's display name. */
373
- readonly name: string;
374
- readonly relationship: readonly ContactRelationship[];
375
- readonly hidden: boolean;
376
- /** Epoch milliseconds. The seam never formats a date; the app writes the words. */
377
- readonly lastActivityAt: number;
378
- }
379
- interface ContactRow extends Contact {
380
- /** Ours: one initials rule, not one copy per screen. */
381
- readonly initials: string;
382
- readonly rename: (name: string, options?: InvocationOptions) => void;
383
- readonly hide: (options?: InvocationOptions) => void;
384
- readonly unhide: (options?: InvocationOptions) => void;
385
- }
386
- /** ADR-0023 R1: refusal CODES, never sentences — the app owns the words. */
387
- type ContactsRefusal = "loading" | "org-unavailable" | "unavailable";
388
- /**
389
- * The blocked facts, in the fixed order `.Add.blockedReason` names them.
390
- * `"no-permission"` is absent by ruling, not by omission: the org screen places
391
- * `CapxulOrgMember.Can do="managePeople"` around its own Add control.
360
+ * Refusal CODES, never sentences (#1447 ruling 8). The app maps each code to
361
+ * the words it already prints; no English refusal string ships from here.
392
362
  */
393
- type ContactsAddBlockedReason = "org-unavailable" | "empty";
363
+ type CapxulSendMoneyBlockedReason = "signer-not-ready" | "amount-invalid" | "recipient-unresolved" | "no-source" | "no-asset" | "asset-unnamed";
394
364
  /**
395
- * Why an add did not land, as a code. ADR-0023 R1 supersedes the contract's
396
- * field-message carve-out: `"unresolved"` is the backend refusing to resolve
397
- * what was typed (`INVALID_INPUT`), and every other code — offline, signed
398
- * out, refused — is `"failed"`. A person can fix only one of them.
365
+ * One Budget the member can spend from — the id the payment carries, and
366
+ * nothing else.
367
+ *
368
+ * THE CONTRACT (amended 3) reverses amendment 7: the From row keeps the app's
369
+ * frozen `"<Org> Treasury"` string, and no budget label and no limit display
370
+ * cross this seam until the budgets build ships a remaining figure that is
371
+ * actually computable (ADR-0024 R3). The app already holds the org name and
372
+ * already builds that sentence today, so the option carries only what the app
373
+ * cannot know — which Budget the send is drawn from.
399
374
  */
400
- type ContactsAddError = "unresolved" | "failed";
401
- interface ContactsSummarySlice {
402
- readonly total: number | null;
403
- readonly activeCount: number | null;
404
- readonly isLoading: boolean;
405
- readonly reason: ContactsRefusal | null;
375
+ interface SendMoneySourceOption {
376
+ readonly id: BudgetId;
406
377
  }
407
- interface ContactsListSlice {
408
- readonly rows: readonly ContactRow[];
409
- readonly isLoading: boolean;
410
- readonly reason: ContactsRefusal | null;
378
+ /** ADR-0023 R1: a code, never a sentence — the app owns the words. */
379
+ type SendMoneySourceError = "read-failed";
380
+ interface SendMoneySourceSlice {
381
+ readonly options: ReadonlyArray<SendMoneySourceOption>;
382
+ readonly selected: SendMoneySourceOption | null;
383
+ readonly select: (id: string) => void;
384
+ readonly error: SendMoneySourceError | null;
385
+ readonly isPending: boolean;
411
386
  }
412
- interface ContactsListOptions {
413
- readonly limit?: number | undefined;
414
- /** `"all"` forwards `includeHidden` to the backend, which already accepts it. */
415
- readonly show?: "visible" | "all" | undefined;
387
+ interface SendMoneyAssetOption {
388
+ readonly id: AssetId;
389
+ readonly symbol: string;
390
+ readonly availableDisplay: string;
416
391
  }
417
- interface ContactsAddSlice {
392
+ /** ADR-0023 R1: a code, never a sentence — the app owns the words. */
393
+ type SendMoneyAssetError = "read-failed";
394
+ interface SendMoneyAssetSlice {
395
+ readonly options: ReadonlyArray<SendMoneyAssetOption>;
396
+ readonly selected: SendMoneyAssetOption | null;
397
+ readonly select: (id: string) => void;
398
+ readonly error: SendMoneyAssetError | null;
399
+ readonly isPending: boolean;
400
+ }
401
+ interface SendMoneyAmountSlice {
418
402
  readonly value: string;
419
403
  readonly change: (text: string) => 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;
404
+ /** ADR-0023 R1: the parse verdict as a closed code; the app maps it to copy. */
405
+ readonly error: MoneyParseErrorReason | null;
406
+ readonly availableDisplay: string | null;
407
+ }
408
+ interface SendMoneyActionsSlice {
409
+ readonly submit: () => void;
427
410
  readonly isSubmitting: boolean;
428
411
  readonly blocked: boolean;
429
- readonly blockedReason: ContactsAddBlockedReason | null;
430
- readonly error: ContactsAddError | null;
412
+ readonly blockedReason: CapxulSendMoneyBlockedReason | null;
431
413
  }
432
414
  //#endregion
433
- //#region src/headless/contacts/contacts.d.ts
434
- interface CapxulContactsProps {
435
- readonly actor: ContactsActor;
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;
415
+ //#region src/payments/send-money.d.ts
416
+ interface CapxulSendMoneyProps {
417
+ readonly actor: SendActor;
418
+ readonly onSent: (sent: SentPayment) => void;
442
419
  /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
443
- readonly onFailed: (error: CapxulError, options?: InvocationOptions) => void;
420
+ readonly onFailed: (error: CapxulError) => void;
444
421
  readonly children: ReactNode;
445
422
  }
446
- declare function Root$7({ actor, onAdded, onFailed, children }: CapxulContactsProps): import("react/jsx-runtime").JSX.Element;
447
- declare function Summary$3({ children }: {
448
- readonly children: (slice: ContactsSummarySlice) => ReactNode;
449
- }): import("react/jsx-runtime").JSX.Element;
450
- declare function List({ limit, show, children }: ContactsListOptions & {
451
- readonly children: (slice: ContactsListSlice) => ReactNode;
452
- }): import("react/jsx-runtime").JSX.Element;
453
- declare function Add({ children }: {
454
- readonly children: (slice: ContactsAddSlice) => ReactNode;
455
- }): import("react/jsx-runtime").JSX.Element;
423
+ declare function Root$5({ actor, onSent, onFailed, children }: CapxulSendMoneyProps): import("react").JSX.Element;
424
+ declare function Source({ children }: {
425
+ readonly children: (slice: SendMoneySourceSlice) => ReactNode;
426
+ }): import("react").JSX.Element;
427
+ declare function Asset$1({ children }: {
428
+ readonly children: (slice: SendMoneyAssetSlice) => ReactNode;
429
+ }): import("react").JSX.Element;
430
+ declare function Amount({ children }: {
431
+ readonly children: (slice: SendMoneyAmountSlice) => ReactNode;
432
+ }): import("react").JSX.Element;
433
+ declare function Recipient({ children }: {
434
+ readonly children: (slice: SendMoneyRecipientSlice) => ReactNode;
435
+ }): import("react").JSX.Element;
436
+ declare function Actions$1({ children }: {
437
+ readonly children: (slice: SendMoneyActionsSlice) => ReactNode;
438
+ }): import("react").JSX.Element;
456
439
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
457
- declare const CapxulContacts: typeof Root$7 & {
458
- Summary: typeof Summary$3;
459
- List: typeof List;
460
- Add: typeof Add;
440
+ export declare const CapxulSendMoney: typeof Root$5 & {
441
+ Source: typeof Source;
442
+ Asset: typeof Asset$1;
443
+ Amount: typeof Amount;
444
+ Recipient: typeof Recipient;
445
+ Actions: typeof Actions$1;
461
446
  };
462
447
  //#endregion
463
- //#region src/headless/activity/types.d.ts
448
+ //#region src/payments/use-capxul-money.d.ts
449
+ type CapxulPayIntent = PaymentsPayInput;
450
+ type UseCapxulPayReturn = UseMutationResult<Payment, CapxulError, CapxulPayIntent>;
451
+ export declare function useCapxulPay(): UseCapxulPayReturn;
452
+ type UseCapxulCreateCommitmentReturn = UseMutationResult<Payment, CapxulError, PaymentsPayInput & {
453
+ readonly timing: Exclude<PaymentTiming, {
454
+ readonly kind: "instant";
455
+ }>;
456
+ }>;
457
+ export declare function useCapxulCreateCommitment(): UseCapxulCreateCommitmentReturn;
458
+ export declare const useCapxulClaimPayment: () => UseMutationResult<Payment, CapxulError<"ACCOUNT_CLAIMED_BY_OTHER_SIGNER" | "ACCOUNT_NOT_FOUND" | "ACTOR_STOPPED" | "CANCELLED" | "CAPABILITY_UNAVAILABLE" | "EMAIL_DELIVERY_FAILED" | "ENV_MISSING" | "INSUFFICIENT_BALANCE" | "INVALID_INPUT" | "INVALID_RECIPIENT" | "NETWORK_ERROR" | "NOT_AUTHENTICATED" | "NOT_IMPLEMENTED" | "OTP_EXPIRED" | "PLAYER_NOT_FOUND" | "PROFILE_NOT_FOUND" | "PROVIDER_ERROR" | "RATE_LIMITED" | "ROLE_PERMISSION_DENIED" | "SIGNER_REJECTED" | "SMART_ACCOUNT_MISSING" | "STALE_EPOCH" | "SUPERSEDED" | "TRANSACTION_FAILED" | "UNKNOWN" | "VERIFICATION_REQUIRED" | "WORK_DIED" | "WRONG_STATE">, string>;
459
+ export declare const useCapxulCancelPayment: () => UseMutationResult<Payment, CapxulError<"ACCOUNT_CLAIMED_BY_OTHER_SIGNER" | "ACCOUNT_NOT_FOUND" | "ACTOR_STOPPED" | "CANCELLED" | "CAPABILITY_UNAVAILABLE" | "EMAIL_DELIVERY_FAILED" | "ENV_MISSING" | "INSUFFICIENT_BALANCE" | "INVALID_INPUT" | "INVALID_RECIPIENT" | "NETWORK_ERROR" | "NOT_AUTHENTICATED" | "NOT_IMPLEMENTED" | "OTP_EXPIRED" | "PLAYER_NOT_FOUND" | "PROFILE_NOT_FOUND" | "PROVIDER_ERROR" | "RATE_LIMITED" | "ROLE_PERMISSION_DENIED" | "SIGNER_REJECTED" | "SMART_ACCOUNT_MISSING" | "STALE_EPOCH" | "SUPERSEDED" | "TRANSACTION_FAILED" | "UNKNOWN" | "VERIFICATION_REQUIRED" | "WORK_DIED" | "WRONG_STATE">, string>;
460
+ type UseCapxulRedirectPaymentReturn = UseMutationResult<Payment, CapxulError, Parameters<import("@capxul/sdk").PaymentsMethods["redirect"]>[0]>;
461
+ export declare function useCapxulRedirectPayment(): UseCapxulRedirectPaymentReturn;
462
+ type UseCapxulPaymentsReturn = UseQueryResult<Page<Payment>, CapxulError>;
463
+ export declare function useCapxulPayments(options?: {
464
+ readonly enabled?: boolean;
465
+ }): UseCapxulPaymentsReturn;
466
+ type UseCapxulPaymentReturn = UseQueryResult<Payment | null, CapxulError>;
467
+ export declare function useCapxulPayment(paymentId: string | undefined, options?: {
468
+ readonly enabled?: boolean;
469
+ }): UseCapxulPaymentReturn;
470
+ //#endregion
471
+ //#region src/payments/use-capxul-organization-payments.d.ts
472
+ /**
473
+ * `orgId` may be absent because a screen has no branded org id until its org
474
+ * context loads (`OrgView.id` is the branded one). An absent id refuses the
475
+ * mutation the way every other org read refuses one, rather than forcing a
476
+ * `as OrgId` cast at the call site.
477
+ */
478
+ export declare function useCapxulOrganizationPay(orgId: OrgId | undefined): UseMutationResult<Payment, CapxulError, OrganizationPaymentInput>;
479
+ export declare function useCapxulOrganizationPayBatch(orgId: OrgId): UseMutationResult<readonly Payment[], CapxulError, OrganizationPaymentBatchInput>;
480
+ //#endregion
481
+ //#region src/permissions/use-capxul-permissions.d.ts
482
+ type Operation = "create" | "change" | "assign" | "revoke" | "replace";
483
+ type Input<K extends Operation> = Parameters<PermissionMethods[K]>[0];
484
+ export declare const useCapxulPermissionCreate: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"create">>;
485
+ export declare const useCapxulPermissionChange: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"change">>;
486
+ export declare const useCapxulPermissionAssign: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"assign">>;
487
+ export declare const useCapxulPermissionRevoke: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"revoke">>;
488
+ export declare const useCapxulPermissionReplace: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"replace">>;
489
+ export declare function useCapxulPermissions(orgId: OrgId, options?: {
490
+ readonly enabled?: boolean;
491
+ }): UseQueryResult<PermissionReadResult, CapxulError>;
492
+ export declare function useCapxulPermission(orgId: OrgId, permissionId: string | undefined): UseQueryResult<Permission | null, CapxulError>;
493
+ //#endregion
494
+ //#region src/activity/activity-slices.d.ts
464
495
  /** The settled transfer a row was built from. The app builds the explorer URL. */
465
496
  interface ActivityReceipt {
466
497
  readonly chainId: number;
@@ -496,7 +527,9 @@ type ActivityRow = {
496
527
  readonly signedAmountDisplay: string;
497
528
  readonly currency: string;
498
529
  readonly createdAt: number;
499
- readonly classification: "movement_only_outflow";
530
+ readonly classification: Extract<ActivityItem, {
531
+ readonly kind: "movement";
532
+ }>["classification"];
500
533
  readonly phase: ActivityPhase;
501
534
  readonly receipt: ActivityReceipt;
502
535
  };
@@ -616,7 +649,7 @@ interface ActivityExportSlice {
616
649
  readonly isExporting: boolean;
617
650
  }
618
651
  //#endregion
619
- //#region src/headless/activity/activity.d.ts
652
+ //#region src/activity/activity.d.ts
620
653
  interface CapxulActivityProps {
621
654
  /** Omitted = the signed-in person. */
622
655
  readonly actor?: ActorReference;
@@ -628,39 +661,39 @@ interface CapxulActivityProps {
628
661
  readonly pageSize?: number;
629
662
  readonly children: ReactNode;
630
663
  }
631
- declare function Root$6({ actor, pageSize, children }: CapxulActivityProps): import("react/jsx-runtime").JSX.Element;
664
+ declare function Root$4({ actor, pageSize, children }: CapxulActivityProps): import("react").JSX.Element;
632
665
  /**
633
666
  * The one part that holds a query rather than reading the engine's: it takes a
634
667
  * `window` prop, and two placements can ask for different windows, so a single
635
668
  * pre-fetched result cannot serve both. It still holds no logic and draws
636
669
  * nothing.
637
670
  */
638
- declare function Summary$2({ window, children }: {
671
+ declare function Summary$3({ window, children }: {
639
672
  readonly window?: SummaryWindow;
640
673
  readonly children: (slice: ActivitySummarySlice) => ReactNode;
641
- }): import("react/jsx-runtime").JSX.Element;
674
+ }): import("react").JSX.Element;
642
675
  declare function Filters({ children }: {
643
676
  readonly children: (slice: ActivityFiltersSlice) => ReactNode;
644
- }): import("react/jsx-runtime").JSX.Element;
677
+ }): import("react").JSX.Element;
645
678
  declare function Search({ children }: {
646
679
  readonly children: (slice: ActivitySearchSlice) => ReactNode;
647
- }): import("react/jsx-runtime").JSX.Element;
680
+ }): import("react").JSX.Element;
648
681
  declare function Rows({ children }: {
649
682
  readonly children: (slice: ActivityRowsSlice) => ReactNode;
650
- }): import("react/jsx-runtime").JSX.Element;
683
+ }): import("react").JSX.Element;
651
684
  declare function LoadMore({ children }: {
652
685
  readonly children: (slice: ActivityLoadMoreSlice) => ReactNode;
653
- }): import("react/jsx-runtime").JSX.Element;
686
+ }): import("react").JSX.Element;
654
687
  declare function Detail({ reference, children }: {
655
688
  readonly reference?: ActivityReference;
656
689
  readonly children: (slice: ActivityDetailSlice) => ReactNode;
657
- }): import("react/jsx-runtime").JSX.Element;
690
+ }): import("react").JSX.Element;
658
691
  declare function Export({ children }: {
659
692
  readonly children: (slice: ActivityExportSlice) => ReactNode;
660
- }): import("react/jsx-runtime").JSX.Element;
693
+ }): import("react").JSX.Element;
661
694
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
662
- declare const CapxulActivity: typeof Root$6 & {
663
- Summary: typeof Summary$2;
695
+ export declare const CapxulActivity: typeof Root$4 & {
696
+ Summary: typeof Summary$3;
664
697
  Filters: typeof Filters;
665
698
  Search: typeof Search;
666
699
  Rows: typeof Rows;
@@ -669,125 +702,12 @@ declare const CapxulActivity: typeof Root$6 & {
669
702
  Export: typeof Export;
670
703
  };
671
704
  //#endregion
672
- //#region src/headless/send-money/use-recipient-resolution.d.ts
673
- type SendMoneyRecipientStatus = "empty" | "invalid" | "checking" | "known-party" | "new-email" | "external-warning" | "external-ready" | "not-found" | "failed";
674
- interface SendMoneyRecipientSlice {
675
- readonly value: string;
676
- readonly change: (text: string) => void;
677
- readonly status: SendMoneyRecipientStatus;
678
- readonly label: string | null;
679
- readonly kind: "person" | "organization" | "external_address" | "unresolved" | null;
680
- readonly isCapxulAccount: boolean | null;
681
- readonly publicValue: string | null;
682
- readonly requiresAcknowledgement: boolean;
683
- readonly acknowledgeExternalAddress: () => void;
684
- }
685
- //#endregion
686
- //#region src/headless/send-money/use-send-money.d.ts
687
- type SendActor = {
688
- readonly kind: "personal";
689
- } | {
690
- readonly kind: "organization";
691
- readonly orgId: OrgId | undefined;
692
- };
693
- type SentPayment = {
694
- /** The backend payment row. */
695
- readonly payment: Payment;
696
- /** What we parsed and sent — `.value` is the comma-stripped major-unit string. */
697
- readonly amount: AssetAmount;
698
- /** The trimmed text the person typed — the app's success toast interpolates it. */
699
- readonly recipient: string;
700
- };
701
- /**
702
- * Refusal CODES, never sentences (#1447 ruling 8). The app maps each code to
703
- * the words it already prints; no English refusal string ships from here.
704
- */
705
- type CapxulSendMoneyBlockedReason = "signer-not-ready" | "amount-invalid" | "recipient-unresolved" | "no-source" | "no-asset" | "asset-unnamed";
706
- /**
707
- * One Budget the member can spend from — the id the payment carries, and
708
- * nothing else.
709
- *
710
- * THE CONTRACT (amended 3) reverses amendment 7: the From row keeps the app's
711
- * frozen `"<Org> Treasury"` string, and no budget label and no limit display
712
- * cross this seam until the budgets build ships a remaining figure that is
713
- * actually computable (ADR-0024 R3). The app already holds the org name and
714
- * already builds that sentence today, so the option carries only what the app
715
- * cannot know — which Budget the send is drawn from.
716
- */
717
- interface SendMoneySourceOption {
718
- readonly id: BudgetId;
719
- }
720
- /** ADR-0023 R1: a code, never a sentence — the app owns the words. */
721
- type SendMoneySourceError = "read-failed";
722
- interface SendMoneySourceSlice {
723
- readonly options: ReadonlyArray<SendMoneySourceOption>;
724
- readonly selected: SendMoneySourceOption | null;
725
- readonly select: (id: string) => void;
726
- readonly error: SendMoneySourceError | null;
727
- readonly isPending: boolean;
728
- }
729
- interface SendMoneyAssetOption {
730
- readonly id: AssetId;
731
- readonly symbol: string;
732
- readonly availableDisplay: string;
733
- }
734
- /** ADR-0023 R1: a code, never a sentence — the app owns the words. */
735
- type SendMoneyAssetError = "read-failed";
736
- interface SendMoneyAssetSlice {
737
- readonly options: ReadonlyArray<SendMoneyAssetOption>;
738
- readonly selected: SendMoneyAssetOption | null;
739
- readonly select: (id: string) => void;
740
- readonly error: SendMoneyAssetError | null;
741
- readonly isPending: boolean;
742
- }
743
- interface SendMoneyAmountSlice {
744
- readonly value: string;
745
- readonly change: (text: string) => void;
746
- /** ADR-0023 R1: the parse verdict as a closed code; the app maps it to copy. */
747
- readonly error: MoneyParseErrorReason | null;
748
- readonly availableDisplay: string | null;
749
- }
750
- interface SendMoneyActionsSlice {
751
- readonly submit: () => void;
752
- readonly isSubmitting: boolean;
753
- readonly blocked: boolean;
754
- readonly blockedReason: CapxulSendMoneyBlockedReason | null;
755
- }
756
- //#endregion
757
- //#region src/headless/send-money/send-money.d.ts
758
- interface CapxulSendMoneyProps {
759
- readonly actor: SendActor;
760
- readonly onSent: (sent: SentPayment) => void;
761
- /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
762
- readonly onFailed: (error: CapxulError) => void;
763
- readonly children: ReactNode;
764
- }
765
- declare function Root$5({ actor, onSent, onFailed, children }: CapxulSendMoneyProps): import("react/jsx-runtime").JSX.Element;
766
- declare function Source({ children }: {
767
- readonly children: (slice: SendMoneySourceSlice) => ReactNode;
768
- }): import("react/jsx-runtime").JSX.Element;
769
- declare function Asset$1({ children }: {
770
- readonly children: (slice: SendMoneyAssetSlice) => ReactNode;
771
- }): import("react/jsx-runtime").JSX.Element;
772
- declare function Amount({ children }: {
773
- readonly children: (slice: SendMoneyAmountSlice) => ReactNode;
774
- }): import("react/jsx-runtime").JSX.Element;
775
- declare function Recipient({ children }: {
776
- readonly children: (slice: SendMoneyRecipientSlice) => ReactNode;
777
- }): import("react/jsx-runtime").JSX.Element;
778
- declare function Actions$1({ children }: {
779
- readonly children: (slice: SendMoneyActionsSlice) => ReactNode;
780
- }): import("react/jsx-runtime").JSX.Element;
781
- /** The compound shape the app's own design system already uses (`StatusTabs`). */
782
- declare const CapxulSendMoney: typeof Root$5 & {
783
- Source: typeof Source;
784
- Asset: typeof Asset$1;
785
- Amount: typeof Amount;
786
- Recipient: typeof Recipient;
787
- Actions: typeof Actions$1;
788
- };
705
+ //#region src/activity/use-capxul-activity.d.ts
706
+ export declare function useCapxulActivity(params?: ActivityListParams): UseQueryResult<ActivityPage, CapxulError>;
707
+ export declare function useCapxulActivityDetail(reference: ActivityReference | undefined, actor?: ActorReference): UseQueryResult<ActivityDetail | null, CapxulError>;
708
+ export declare function useCapxulAnnotateMovement(): UseMutationResult<ActivityAnnotation, CapxulError, ActivityAnnotationInput>;
789
709
  //#endregion
790
- //#region src/headless/access/org-member.d.ts
710
+ //#region src/organizations/org-member.d.ts
791
711
  /** The two enforcement facts, named the way a screen asks for them. */
792
712
  type OrgMemberAction = "spend" | "managePeople";
793
713
  /**
@@ -811,7 +731,7 @@ interface CapxulOrgMemberProps {
811
731
  readonly orgId: OrgId | string | undefined;
812
732
  readonly children: ReactNode;
813
733
  }
814
- declare function Root$4({ orgId, children }: CapxulOrgMemberProps): import("react/jsx-runtime").JSX.Element;
734
+ declare function Root$3({ orgId, children }: CapxulOrgMemberProps): import("react").JSX.Element;
815
735
  /**
816
736
  * One part serves all four denial idioms the app already uses: disabled with no
817
737
  * explanation, disabled plus a native `title`, a whole-surface swap, and
@@ -821,135 +741,255 @@ declare function Root$4({ orgId, children }: CapxulOrgMemberProps): import("reac
821
741
  declare function Can({ do: action, children }: {
822
742
  readonly do: OrgMemberAction;
823
743
  readonly children: (slice: OrgMemberCanSlice) => ReactNode;
824
- }): import("react/jsx-runtime").JSX.Element;
744
+ }): import("react").JSX.Element;
825
745
  declare function Standing({ children }: {
826
746
  readonly children: (slice: OrgMemberStandingSlice) => ReactNode;
827
- }): import("react/jsx-runtime").JSX.Element;
747
+ }): import("react").JSX.Element;
828
748
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
829
- declare const CapxulOrgMember: typeof Root$4 & {
749
+ export declare const CapxulOrgMember: typeof Root$3 & {
830
750
  Can: typeof Can;
831
751
  Standing: typeof Standing;
832
752
  };
833
753
  //#endregion
834
- //#region src/headless/access/dashboard-access.d.ts
835
- type DashboardScope = {
754
+ //#region src/organizations/use-capxul-create-org.d.ts
755
+ /**
756
+ * Create an Organization. Binds directly to the
757
+ * `onboarding.completeOrganization(input)` SDK method. On success, invalidates the org list.
758
+ */
759
+ type UseCapxulCreateOrgReturn = UseMutationResult<OrganizationOnboarding, CapxulError, OrganizationOnboardingInput>;
760
+ export declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
761
+ //#endregion
762
+ //#region src/organizations/use-capxul-org-members.d.ts
763
+ type UseCapxulOrgMembersOptions = {
764
+ readonly enabled?: boolean;
765
+ };
766
+ /**
767
+ * List the members of one Organization. Binds directly to
768
+ * `capxul.org(orgId).members()`. Gated by
769
+ * `orgId !== undefined`; callers may additionally gate on canonical identity
770
+ * readiness through `options.enabled`.
771
+ */
772
+ type UseCapxulOrgMembersReturn = UseQueryResult<Page<MemberView>, CapxulError>;
773
+ export declare function useCapxulOrgMembers(orgId: OrgId | undefined, options?: UseCapxulOrgMembersOptions): UseCapxulOrgMembersReturn;
774
+ //#endregion
775
+ //#region src/organizations/use-capxul-org-roles.d.ts
776
+ type UseCapxulOrgRolesOptions = {
777
+ readonly enabled?: boolean;
778
+ };
779
+ /**
780
+ * List the roles for one Organization. Binds directly
781
+ * to `capxul.org(orgId).roles()`. Gated by `orgId !== undefined`.
782
+ */
783
+ type UseCapxulOrgRolesReturn = UseQueryResult<Page<RoleView>, CapxulError>;
784
+ export declare function useCapxulOrgRoles(orgId: OrgId | undefined, options?: UseCapxulOrgRolesOptions): UseCapxulOrgRolesReturn;
785
+ //#endregion
786
+ //#region src/organizations/use-capxul-org-treasury.d.ts
787
+ type UseCapxulOrgTreasuryOptions = {
788
+ readonly enabled?: boolean;
789
+ };
790
+ /**
791
+ * Return the Organization treasury Account.
792
+ * NEVER `AccountStatus` (the deploy-readiness ladder, no balance). Binds
793
+ * Binds directly to `capxul.org(orgId).treasury()`. Gated by `orgId !== undefined`.
794
+ */
795
+ type UseCapxulOrgTreasuryReturn = UseQueryResult<Account, CapxulError>;
796
+ export declare function useCapxulOrgTreasury(orgId: OrgId | undefined, options?: UseCapxulOrgTreasuryOptions): UseCapxulOrgTreasuryReturn;
797
+ //#endregion
798
+ //#region src/organizations/use-capxul-orgs.d.ts
799
+ /**
800
+ * List the Organizations that the current user can access. Binds directly to
801
+ * the locked `capxul.orgs()` SDK method.
802
+ */
803
+ type UseCapxulOrgsReturn = UseQueryResult<Page<OrganizationAccess>, CapxulError>;
804
+ type UseCapxulOrgsOptions = {
805
+ /**
806
+ * Gate the query on auth readiness. `client.orgs()` is a session-scoped
807
+ * authenticated read; firing it before the session token settles surfaces a
808
+ * spurious `NOT_AUTHENTICATED`. Consumers pass `enabled: <auth-ready>`.
809
+ * Defaults to `true` to preserve the bare `useCapxulOrgs()` call shape.
810
+ */
811
+ readonly enabled?: boolean;
812
+ };
813
+ export declare function useCapxulOrgs(options?: UseCapxulOrgsOptions): UseCapxulOrgsReturn;
814
+ //#endregion
815
+ //#region src/media/use-capxul-image-upload.d.ts
816
+ type ImageUploadTarget = {
817
+ readonly kind: "profile";
818
+ } | {
819
+ readonly kind: "orgLogo";
820
+ readonly orgId: string;
821
+ };
822
+ type ImageUploadInput = {
823
+ readonly blob: Blob;
824
+ readonly target: ImageUploadTarget;
825
+ };
826
+ type UseCapxulImageUploadReturn = UseMutationResult<{
827
+ readonly url: string | null;
828
+ }, CapxulError, ImageUploadInput>;
829
+ /**
830
+ * #1061 / ADR-0014: the whole upload→record sequence as one mutation —
831
+ * upload the blob, then bind the returned storage id to the profile image or
832
+ * the org logo. The url is the resolved serving URL (re-read from queries,
833
+ * never persisted by consumers).
834
+ */
835
+ export declare function useCapxulImageUpload(): UseCapxulImageUploadReturn;
836
+ //#endregion
837
+ //#region src/media/use-capxul-upload-image.d.ts
838
+ type UseCapxulUploadImageReturn = UseMutationResult<{
839
+ readonly storageId: string;
840
+ }, CapxulError, Blob>;
841
+ /**
842
+ * #1955: upload only. Hands back the storage id for a CREATE call to carry
843
+ * (`ProfileDetails.imageStorageId`, `OrganizationDetails.logoStorageId`).
844
+ *
845
+ * `useCapxulImageUpload` is upload+bind and stays as it is for the settings
846
+ * pages. It cannot serve onboarding: the row it binds to does not exist yet.
847
+ * Nothing is bound here, so nothing is invalidated either — the create call
848
+ * that carries the id owns the cache change.
849
+ */
850
+ export declare function useCapxulUploadImage(): UseCapxulUploadImageReturn;
851
+ //#endregion
852
+ //#region src/parties/contact-slices.d.ts
853
+ type ContactsActor = {
836
854
  readonly kind: "personal";
837
855
  } | {
838
856
  readonly kind: "organization";
839
- readonly orgId?: string;
857
+ readonly orgId: OrgId | undefined;
840
858
  };
841
- type DashboardAccessPhase = "checking" | "error" | "redirect" | "granted";
842
859
  /**
843
- * Which probe 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.
860
+ * How a contact entered the book. Taken from the shipped surface rather than
861
+ * re-declared, so the component can never advertise a provenance the wire
862
+ * cannot carry (ADR-0022 R2; #1532 owns the definition site).
849
863
  */
850
- type DashboardAccessProbe = "session" | "membership" | "lifecycle" | "authority";
851
- interface DashboardAccessErrorSlice {
852
- readonly error: CapxulError;
853
- /** The probe the surfaced error came from, in the frozen precedence order. */
854
- readonly probe: DashboardAccessProbe;
855
- /** Re-runs each failed probe. */
856
- readonly retry: () => void;
857
- }
858
- interface DashboardAccessRedirectSlice {
859
- readonly destination: IdentityDestination;
864
+ type ContactRelationship = AddressBookEntry["relationship"][number];
865
+ interface Contact {
866
+ /**
867
+ * The counterparty's `PartyId` — created once and claimed at signup, never
868
+ * re-keyed (ADR-0022 R1/R3). No email, no prefix, nothing to parse.
869
+ */
870
+ readonly id: PartyId;
871
+ /** The saved label when there is one, else the party's display name. */
872
+ readonly name: string;
873
+ readonly relationship: readonly ContactRelationship[];
874
+ readonly hidden: boolean;
875
+ /** Epoch milliseconds. The seam never formats a date; the app writes the words. */
876
+ readonly lastActivityAt: number;
860
877
  }
861
- interface CapxulDashboardAccessProps {
862
- readonly scope: DashboardScope;
863
- readonly children: ReactNode;
878
+ interface ContactRow extends Contact {
879
+ /** Ours: one initials rule, not one copy per screen. */
880
+ readonly initials: string;
881
+ readonly rename: (name: string, options?: InvocationOptions) => void;
882
+ readonly hide: (options?: InvocationOptions) => void;
883
+ readonly unhide: (options?: InvocationOptions) => void;
864
884
  }
865
- declare function Root$3({ scope, children }: CapxulDashboardAccessProps): import("react/jsx-runtime").JSX.Element;
866
- /** Hands nothing — today's app renders `null` here, exactly as it does now. */
867
- declare function Checking$1({ children }: {
868
- readonly children?: ReactNode;
869
- }): import("react/jsx-runtime").JSX.Element | null;
870
- declare function DashboardError({ children }: {
871
- readonly children: (slice: DashboardAccessErrorSlice) => ReactNode;
872
- }): import("react/jsx-runtime").JSX.Element | null;
885
+ /** ADR-0023 R1: refusal CODES, never sentences — the app owns the words. */
886
+ type ContactsRefusal = "loading" | "org-unavailable" | "unavailable";
873
887
  /**
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.
888
+ * The blocked facts, in the fixed order `.Add.blockedReason` names them.
889
+ * `"no-permission"` is absent by ruling, not by omission: the org screen places
890
+ * `CapxulOrgMember.Can do="managePeople"` around its own Add control.
878
891
  */
879
- declare function Redirect({ children }: {
880
- readonly children: (slice: DashboardAccessRedirectSlice) => ReactNode;
881
- }): import("react/jsx-runtime").JSX.Element | null;
882
- declare function Granted({ children }: {
883
- readonly children?: ReactNode;
884
- }): import("react/jsx-runtime").JSX.Element | null;
885
- /** The compound shape the app's own design system already uses (`StatusTabs`). */
886
- declare const CapxulDashboardAccess: typeof Root$3 & {
887
- Checking: typeof Checking$1;
888
- Error: typeof DashboardError;
889
- Redirect: typeof Redirect;
890
- Granted: typeof Granted;
891
- };
892
- //#endregion
893
- //#region src/headless/payroll/use-payroll.d.ts
894
- interface PayrollGroupRow {
895
- readonly id: PayrollGroupId;
896
- readonly name: string;
897
- /** A stored display preference; the app narrows it to its own DS union. */
898
- readonly tone: string;
899
- readonly memberCount: number;
900
- /** `formatMoney` over the amounts the employer typed on this group. */
901
- readonly totalDisplay: string;
902
- readonly members: readonly {
903
- /** The `partyId` — the stable id (ruling Q1), never an email. */
904
- readonly recipientId: string;
905
- readonly amount: string;
906
- readonly currency: Money["currency"];
907
- }[];
892
+ type ContactsAddBlockedReason = "org-unavailable" | "empty";
893
+ /**
894
+ * Why an add did not land, as a code. ADR-0023 R1 supersedes the contract's
895
+ * field-message carve-out: `"unresolved"` is the backend refusing to resolve
896
+ * what was typed (`INVALID_INPUT`), and every other code — offline, signed
897
+ * out, refused — is `"failed"`. A person can fix only one of them.
898
+ */
899
+ type ContactsAddError = "unresolved" | "failed";
900
+ interface ContactsSummarySlice {
901
+ readonly total: number | null;
902
+ readonly activeCount: number | null;
903
+ readonly isLoading: boolean;
904
+ readonly reason: ContactsRefusal | null;
908
905
  }
909
- interface PayrollSummarySlice {
910
- readonly walletBalanceDisplay: string | null;
911
- readonly paidThisMonthDisplay: string | null;
906
+ interface ContactsListSlice {
907
+ readonly rows: readonly ContactRow[];
912
908
  readonly isLoading: boolean;
913
- readonly error: CapxulError | null;
909
+ readonly reason: ContactsRefusal | null;
914
910
  }
915
- interface PayrollGroupsSlice {
916
- readonly groups: readonly PayrollGroupRow[];
911
+ interface ContactsListOptions {
912
+ readonly limit?: number | undefined;
913
+ /** `"all"` forwards `includeHidden` to the backend, which already accepts it. */
914
+ readonly show?: "visible" | "all" | undefined;
915
+ }
916
+ interface ContactsAddSlice {
917
+ readonly value: string;
918
+ readonly change: (text: string) => void;
917
919
  /**
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.
920
+ * #1960 R02: hand it the options the screen captured BEFORE the click. The
921
+ * same snapshot reaches the SDK add call and comes back on `onAdded`/
922
+ * `onFailed`, so the UI observation and the operation share one identity even
923
+ * when the reply lands after an account switch. Omitted stays omitted.
922
924
  */
923
- readonly save: (input: PayrollGroupInput, options?: InvocationOptions) => Promise<CapxulResult<PayrollGroupRow>>;
924
- readonly remove: (id: PayrollGroupId, options?: InvocationOptions) => Promise<CapxulResult<void>>;
925
- readonly isSaving: boolean;
926
- readonly isLoading: boolean;
927
- readonly error: CapxulError | null;
925
+ readonly submit: (options?: InvocationOptions) => void;
926
+ readonly isSubmitting: boolean;
927
+ readonly blocked: boolean;
928
+ readonly blockedReason: ContactsAddBlockedReason | null;
929
+ readonly error: ContactsAddError | null;
928
930
  }
929
931
  //#endregion
930
- //#region src/headless/payroll/payroll.d.ts
931
- interface CapxulPayrollProps {
932
- readonly orgId: OrgId | undefined;
932
+ //#region src/parties/contacts.d.ts
933
+ interface CapxulContactsProps {
934
+ readonly actor: ContactsActor;
935
+ /**
936
+ * `options` is exactly what the caller handed `.Add.submit` or a row verb, so
937
+ * the screen's own observation of the finished action can reuse the attempt
938
+ * identity the SDK operation ran under (#1960 R02).
939
+ */
940
+ readonly onAdded: (contact: Contact, options?: InvocationOptions) => void;
941
+ /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
942
+ readonly onFailed: (error: CapxulError, options?: InvocationOptions) => void;
933
943
  readonly children: ReactNode;
934
944
  }
935
- declare function Root$2({ orgId, children }: CapxulPayrollProps): import("react/jsx-runtime").JSX.Element;
936
- declare function Summary$1({ children }: {
937
- readonly children: (slice: PayrollSummarySlice) => ReactNode;
938
- }): import("react/jsx-runtime").JSX.Element;
939
- declare function Groups({ children }: {
940
- readonly children: (slice: PayrollGroupsSlice) => ReactNode;
941
- }): import("react/jsx-runtime").JSX.Element;
942
- /**
943
- * The compound shape the app's own design system already uses (`StatusTabs`).
944
- * There is NO `.Runs` part (ruling Q6): no shipped region has the right shape
945
- * for a run list, and a part without a production caller may not ship.
946
- */
947
- declare const CapxulPayroll: typeof Root$2 & {
948
- Summary: typeof Summary$1;
949
- Groups: typeof Groups;
945
+ declare function Root$2({ actor, onAdded, onFailed, children }: CapxulContactsProps): import("react").JSX.Element;
946
+ declare function Summary$2({ children }: {
947
+ readonly children: (slice: ContactsSummarySlice) => ReactNode;
948
+ }): import("react").JSX.Element;
949
+ declare function List({ limit, show, children }: ContactsListOptions & {
950
+ readonly children: (slice: ContactsListSlice) => ReactNode;
951
+ }): import("react").JSX.Element;
952
+ declare function Add({ children }: {
953
+ readonly children: (slice: ContactsAddSlice) => ReactNode;
954
+ }): import("react").JSX.Element;
955
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
956
+ export declare const CapxulContacts: typeof Root$2 & {
957
+ Summary: typeof Summary$2;
958
+ List: typeof List;
959
+ Add: typeof Add;
960
+ };
961
+ //#endregion
962
+ //#region src/platform/query-keys.d.ts
963
+ export declare const capxulKeys: {
964
+ root: readonly ["capxul"];
965
+ profile: readonly ["capxul", "profile"];
966
+ handleAvailability: (handle: string) => readonly ["capxul", "profile", "handle-availability", string];
967
+ account: readonly ["capxul", "account"];
968
+ provisioning: readonly ["capxul", "provisioning"];
969
+ binding: readonly ["capxul", "binding"];
970
+ accountBalance: readonly ["capxul", "accountBalance"];
971
+ orgs: readonly ["capxul", "orgs"];
972
+ org: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId];
973
+ orgMembers: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "members"];
974
+ orgRoles: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "roles"];
975
+ orgTreasury: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "treasury"];
976
+ orgPermissions: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "permissions"];
977
+ orgMe: (orgId: OrgId | undefined, account: string | undefined) => readonly ["capxul", "org", "pending" | OrgId, "me", string];
978
+ orgLifecycle: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "lifecycle"];
979
+ contacts: (scope: string) => readonly ["capxul", "contacts", string];
980
+ contactsList: (scope: string, includeHidden: boolean) => readonly ["capxul", "contacts", string, "all" | "visible"];
981
+ payrollRuns: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "runs"];
982
+ payrollGroups: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "groups"];
983
+ payrollTerms: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "terms"];
984
+ activity: readonly ["capxul", "activity"];
985
+ activityDetail: (reference: ActivityReference | undefined, actor?: ActorReference) => readonly ["capxul", "activity", "self" | ActorReference, "pending" | ActivityReference];
986
+ activitySummary: (actor?: ActorReference, window?: ActivityRange) => readonly ["capxul", "activity", "summary", "self" | ActorReference, "all" | ActivityRange];
987
+ holdings: (actor?: ActorReference) => readonly ["capxul", "holdings", "self" | ActorReference];
988
+ payments: readonly ["capxul", "payments"];
989
+ payment: (paymentId: string | undefined) => readonly ["capxul", "payments", string];
950
990
  };
951
991
  //#endregion
952
- //#region src/headless/payroll/reads.d.ts
992
+ //#region src/payroll/reads.d.ts
953
993
  /**
954
994
  * One payable person, as the run composer and the group sheet see them.
955
995
  *
@@ -963,7 +1003,7 @@ interface PayrollRecipientOption {
963
1003
  readonly email: string | null;
964
1004
  }
965
1005
  //#endregion
966
- //#region src/headless/payroll/use-payroll-run.d.ts
1006
+ //#region src/payroll/payroll-run-slices.d.ts
967
1007
  /**
968
1008
  * Refusal CODES, never sentences (ADR-0023 R1). `blockedReason` names the FIRST
969
1009
  * false fact in the fixed order below, so the same composer state always
@@ -1039,7 +1079,7 @@ interface SentPayrollRun {
1039
1079
  readonly recipientCount: number;
1040
1080
  }
1041
1081
  //#endregion
1042
- //#region src/headless/payroll/payroll-run.d.ts
1082
+ //#region src/payroll/payroll-run.d.ts
1043
1083
  interface CapxulPayrollRunProps {
1044
1084
  readonly orgId: OrgId | undefined;
1045
1085
  /** How a group card opens pay-now pre-filled — today's group-context merge. */
@@ -1049,117 +1089,89 @@ interface CapxulPayrollRunProps {
1049
1089
  readonly onFailed: (error: CapxulError) => void;
1050
1090
  readonly children: ReactNode;
1051
1091
  }
1052
- declare function Root$1({ orgId, prefill, onRun, onFailed, children }: CapxulPayrollRunProps): import("react/jsx-runtime").JSX.Element;
1092
+ declare function Root$1({ orgId, prefill, onRun, onFailed, children }: CapxulPayrollRunProps): import("react").JSX.Element;
1053
1093
  declare function Recipients({ children }: {
1054
1094
  readonly children: (slice: PayrollRunRecipientsSlice) => ReactNode;
1055
- }): import("react/jsx-runtime").JSX.Element;
1095
+ }): import("react").JSX.Element;
1056
1096
  declare function Amounts({ children }: {
1057
1097
  readonly children: (slice: PayrollRunAmountsSlice) => ReactNode;
1058
- }): import("react/jsx-runtime").JSX.Element;
1098
+ }): import("react").JSX.Element;
1059
1099
  declare function Asset({ children }: {
1060
1100
  readonly children: (slice: PayrollRunAssetSlice) => ReactNode;
1061
- }): import("react/jsx-runtime").JSX.Element;
1062
- declare function Summary({ children }: {
1101
+ }): import("react").JSX.Element;
1102
+ declare function Summary$1({ children }: {
1063
1103
  readonly children: (slice: PayrollRunSummarySlice) => ReactNode;
1064
- }): import("react/jsx-runtime").JSX.Element;
1104
+ }): import("react").JSX.Element;
1065
1105
  declare function Actions({ children }: {
1066
1106
  readonly children: (slice: PayrollRunActionsSlice) => ReactNode;
1067
- }): import("react/jsx-runtime").JSX.Element;
1107
+ }): import("react").JSX.Element;
1068
1108
  /** The compound shape the app's own design system already uses (`StatusTabs`). */
1069
- declare const CapxulPayrollRun: typeof Root$1 & {
1109
+ export declare const CapxulPayrollRun: typeof Root$1 & {
1070
1110
  Recipients: typeof Recipients;
1071
1111
  Amounts: typeof Amounts;
1072
1112
  Asset: typeof Asset;
1073
- Summary: typeof Summary;
1113
+ Summary: typeof Summary$1;
1074
1114
  Actions: typeof Actions;
1075
1115
  };
1076
1116
  //#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>;
1117
+ //#region src/payroll/use-payroll.d.ts
1118
+ /** ADR-0022 R9: where a run stands on the shipped command lifecycle. */
1119
+ interface PayrollGroupRow {
1120
+ readonly id: PayrollGroupId;
1121
+ readonly name: string;
1122
+ /** A stored display preference; the app narrows it to its own DS union. */
1123
+ readonly tone: string;
1124
+ readonly memberCount: number;
1125
+ /** `formatMoney` over the amounts the employer typed on this group. */
1126
+ readonly totalDisplay: string;
1127
+ readonly members: readonly {
1128
+ /** The `partyId` — the stable id (ruling Q1), never an email. */
1129
+ readonly recipientId: string;
1130
+ readonly amount: string;
1131
+ readonly currency: Money["currency"];
1132
+ }[];
1094
1133
  }
1095
- interface CompleteSlice {
1096
- readonly outcome: "connected";
1134
+ interface PayrollSummarySlice {
1135
+ readonly walletBalanceDisplay: string | null;
1136
+ readonly paidThisMonthDisplay: string | null;
1137
+ readonly isLoading: boolean;
1138
+ readonly error: CapxulError | null;
1097
1139
  }
1098
- interface FailureSlice {
1099
- readonly code: string;
1100
- readonly field?: string;
1101
- readonly retry: () => Promise<void>;
1102
- readonly cancel: () => Promise<void>;
1140
+ interface PayrollGroupsSlice {
1141
+ readonly groups: readonly PayrollGroupRow[];
1142
+ /**
1143
+ * R13 (#1968): `options` is the browser attempt the caller captured before the
1144
+ * employer pressed the button. It reaches the SDK operation unchanged, so the
1145
+ * group's `ui_payroll_action_completed` and the durable `payroll_group_changed`
1146
+ * share one correlation. Absent, the write keeps its own invocation context.
1147
+ */
1148
+ readonly save: (input: PayrollGroupInput, options?: InvocationOptions) => Promise<CapxulResult<PayrollGroupRow>>;
1149
+ readonly remove: (id: PayrollGroupId, options?: InvocationOptions) => Promise<CapxulResult<void>>;
1150
+ readonly isSaving: boolean;
1151
+ readonly isLoading: boolean;
1152
+ readonly error: CapxulError | null;
1103
1153
  }
1104
1154
  //#endregion
1105
- //#region src/headless/client-connection/client-connection.d.ts
1106
- interface CapxulClientConnectionProps {
1107
- readonly client: CapxulClient;
1108
- readonly requestId: string;
1155
+ //#region src/payroll/payroll.d.ts
1156
+ interface CapxulPayrollProps {
1157
+ readonly orgId: OrgId | undefined;
1109
1158
  readonly children: ReactNode;
1110
1159
  }
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
1135
- //#region src/internal/reactivity-keys.d.ts
1136
- declare const capxulKeys: {
1137
- root: readonly ["capxul"];
1138
- profile: readonly ["capxul", "profile"];
1139
- handleAvailability: (handle: string) => readonly ["capxul", "profile", "handle-availability", string];
1140
- account: readonly ["capxul", "account"];
1141
- provisioning: readonly ["capxul", "provisioning"];
1142
- binding: readonly ["capxul", "binding"];
1143
- accountBalance: readonly ["capxul", "accountBalance"];
1144
- orgs: readonly ["capxul", "orgs"];
1145
- org: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId];
1146
- orgMembers: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "members"];
1147
- orgRoles: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "roles"];
1148
- orgTreasury: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "treasury"];
1149
- orgPermissions: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "permissions"];
1150
- orgMe: (orgId: OrgId | undefined, account: string | undefined) => readonly ["capxul", "org", "pending" | OrgId, "me", string];
1151
- orgLifecycle: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "lifecycle"];
1152
- contacts: (scope: string) => readonly ["capxul", "contacts", string];
1153
- contactsList: (scope: string, includeHidden: boolean) => readonly ["capxul", "contacts", string, "all" | "visible"];
1154
- payrollRuns: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "runs"];
1155
- payrollGroups: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "groups"];
1156
- payrollTerms: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "terms"];
1157
- activity: readonly ["capxul", "activity"];
1158
- activityDetail: (reference: ActivityReference | undefined, actor?: ActorReference | undefined) => readonly ["capxul", "activity", "self" | ActorReference, "pending" | ActivityReference];
1159
- activitySummary: (actor?: ActorReference, window?: ActivityRange) => readonly ["capxul", "activity", "summary", "self" | ActorReference, "all" | ActivityRange];
1160
- holdings: (actor?: ActorReference) => readonly ["capxul", "holdings", "self" | ActorReference];
1161
- payments: readonly ["capxul", "payments"];
1162
- payment: (paymentId: string | undefined) => readonly ["capxul", "payments", string];
1160
+ declare function Root({ orgId, children }: CapxulPayrollProps): import("react").JSX.Element;
1161
+ declare function Summary({ children }: {
1162
+ readonly children: (slice: PayrollSummarySlice) => ReactNode;
1163
+ }): import("react").JSX.Element;
1164
+ declare function Groups({ children }: {
1165
+ readonly children: (slice: PayrollGroupsSlice) => ReactNode;
1166
+ }): import("react").JSX.Element;
1167
+ /**
1168
+ * The compound shape the app's own design system already uses (`StatusTabs`).
1169
+ * There is NO `.Runs` part (ruling Q6): no shipped region has the right shape
1170
+ * for a run list, and a part without a production caller may not ship.
1171
+ */
1172
+ export declare const CapxulPayroll: typeof Root & {
1173
+ Summary: typeof Summary;
1174
+ Groups: typeof Groups;
1163
1175
  };
1164
1176
  //#endregion
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 };
1177
+ 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, type CapxulActivityProps, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, type CapxulClientConnectionProps, type CapxulContactsProps, type CapxulDashboardAccessProps, CapxulOnboardingController, type CapxulOrgMemberProps, type CapxulPayrollProps, type CapxulPayrollRunBlockedReason, type CapxulPayrollRunProps, type CapxulProviderProps, type CapxulSend, 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, isClaimed, isRestoring };