@capxul/sdk 4.2.0-rc.13 → 4.2.0-rc.14

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,11 +1,11 @@
1
1
  {
2
2
  "source": {
3
- "commit": "887920e1ba54e17bd8465975fcbc6e1537dfb6b8",
4
- "tree": "deed16dc942ed9d6b587ceead4dbf8b0b4174e2c",
3
+ "commit": "ad9386dd8d539fea17964d05292fc0ca16495d2f",
4
+ "tree": "87b1723ed13d7be72487cbcbbfded24b0ac850e5",
5
5
  "branch": "codex/programme-rc",
6
6
  "repository": "https://github.com/Xelmar-tech/infrastructure",
7
7
  "lockfileSha256": "5870f53b72706d103220c1bcf733cb4fb71196aea32a9cfbdc277d73cc959264"
8
8
  },
9
9
  "name": "@capxul/sdk",
10
- "version": "4.2.0-rc.13"
10
+ "version": "4.2.0-rc.14"
11
11
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as PayrollGroupId, B as ChainId, Ct as ChainCause, D as Account, Dt as RevertSummary, E as CAPXUL_PAYMENTS_V2_ADDRESS, Et as FailureMode, F as AssetId, G as EVM_ADDRESS_RE, H as CurrencyCode, I as AuthSession, J as Handle, L as AuthUserId, O as AccountId, P as AssetAmount, St as CHAIN_UPSTREAMS, Tt as FAILURE_MODES, V as CountryCode, X as OrgId, Y as Money, Z as PartyId, _ as Session, _t as CapxulErrorCode, a as Eip1193RequestProvider, at as RoleKey, c as injectedWalletSigner, ct as TesterKind, d as AccountRequirement, dt as toAddress, et as PayrollRunId, f as Eip1193Provider, ft as toCountryCode, g as Profile, gt as CapxulError, h as CapxulResult, ht as CAPXUL_ERROR_CODES, i as CapxulSigner, k as Address, l as AccountProvider, m as localPrivateKeyAccountProvider, mt as toPartyId, o as SignerStatus, p as eip1193AccountProvider, pt as toHandle, r as CapxulDigestSigner, s as SignerStatusStore, u as AccountProviderSource, v as SmartAccount, vt as CapxulErrorDetails, wt as ChainUpstream, xt as isCapxulError, yt as Errors, z as BudgetId } from "./OAuthBearerAuthClient-C-ip-z8M.mjs";
2
- import { $ as OrganizationPaymentBatchInput, $n as RequestStatus, $t as Destination, A as OrgScopedMethods, An as Ref, At as AddressBookAddInput, B as AuthorizeRunOptions, Bn as SmartAccountMethods, Bt as ActivityFilter, C as CurrentUserMethods, Cn as PaymentMoney, Ct as AccountMethods, D as MemberStatus, Dn as PaymentsMethods, Dt as ActorRequest, E as InviteMemberInput, En as PaymentType, Et as ActorRelationshipMethods, F as ResendInviteTokenInput, Fn as AccountLifecycle, Ft as InboxItem, G as PayrollGroupsMethods, Gn as ActorRef, Gt as ActivityPage, H as PayrollGroup, Hn as OrgLifecycle, Ht as ActivityKind, I as RoleDefinition, In as AccountSetupStep, It as InboxMethods, J as PayrollRun, Jn as SubmittedPermissionExecution, Jt as ActivitySummary, K as PayrollMethods, Kn as CurrentHoldings, Kt as ActivityRange, L as RoleSpendCap, Ln as isSettingUpLifecycle, Lt as ActivityAnnotation, M as OrgView, Mn as TargetReference, Mt as AddressBookLabelInput, N as OrganizationAccount, Nn as TargetsMethods, Nt as AddressBookMethods, O as MemberView, On as PaymentsPayInput, Ot as ActorRequestIssueInput, P as OrganizationAuditLogItem, Pn as fingerprintPaymentIntent, Pt as InboxApproveInput, Q as PayrollTermsUnit, Qn as PaymentStatus$1, Qt as DepositInstructions, R as RoleView, Rn as CompleteProfileInput, Rt as ActivityAnnotationInput, S as CurrentUserContext, Sn as PaymentDocumentsMethods, St as ReadyAccountLifecycle, T as DetectPendingOrgInvitationsResult, Tn as PaymentTiming, Tt as ActorProfileMethods, U as PayrollGroupInput, Un as OrgSetupStep, Ut as ActivityListParams, V as PayrollEngagementTerms, Vn as AuthMethods, Vt as ActivityItem, W as PayrollGroupMember, Wn as PayoutAddress, Wt as ActivityMethods, X as PayrollRunStatus, Xn as PAYMENT_DIRECTIONS, Xt as ActivitySummaryTotal, Y as PayrollRunItemInput, Yn as InboxStatus, Yt as ActivitySummaryParams, Z as PayrollRuns, Zn as PAYMENT_STATUSES, Zt as ActorReference, _ as HoldingsMethods, _n as PaymentDirection, _t as OnboardingMethods, a as ObservationContext, an as DestinationRemoveInput, ar as IdentityEvent, at as PermissionCreateInput, b as SystemHealth, bn as PaymentDocumentRender, bt as PersonOnboarding, c as HostObservability, cn as MeMethods, cr as Readiness, ct as PermissionReplaceInput, d as postHogObservability, dn as OfframpMethods, dr as isClaimed, dt as Budget, en as DestinationAddInput, et as OrganizationPaymentInput, f as CapxulClient, fn as OfframpQuote, fr as isRestoring, ft as OrgMe, g as IdentityRuntimeSendResult, gn as PaymentActivityEvidence, gt as CompletedPersonProfile, h as IdentityRuntime, hn as Payment, ht as AccountsMethods, i as ObservationAdapter, in as DestinationRail, ir as Destination$1, it as PermissionChangeInput, j as OrgTemplate, jn as ResolvedTarget, jt as AddressBookEntry, k as OrgMethods, kn as RecipientResolution, kt as ActorRequestsMethods, l as PostHogObservabilityClient, ln as MeProfile, lr as StateLabel, lt as PermissionRevokeInput, m as IdentityProfileDetails, mn as OfframpStatus, mr as InvocationControls, mt as OrgMeOptions, nn as DestinationListInput, nt as OrganizationPaymentsMethods, o as ObservationDelivery, on as DestinationsMethods, or as IdentityState, ot as PermissionMethods, p as CreateCapxulClientInput, pn as OfframpQuoteInput, pr as IdentityTransition, pt as OrgMeMethod, q as PayrollOptions, qn as Permission, qt as ActivityReference, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, rn as DestinationPayload, rr as TelemetryPort, rt as PermissionAssignInput, s as SdkFailureObservation, sn as FinancialOpsMethods, sr as OrgLane, st as PermissionOptions, t as CapxulClientInput, tn as DestinationKind, tt as OrganizationPaymentItemInput, u as PostHogObservabilityOptions, un as MovementActivityEvidence, ur as destination, ut as PermissionReadResult, v as Holding, vn as PaymentDocumentKind, vt as OrganizationOnboarding, w as CreateOrgInput, wn as PaymentStatus, wt as ActorProfile, x as MediaMethods, xn as PaymentDocumentVerification, xt as PersonOnboardingInput, y as SystemMethods, yn as PaymentDocumentRef, yt as OrganizationOnboardingInput, z as AuthorizeRunInput, zn as IdentityMethods, zt as ActivityDetail } from "./production-Db4fBqSk.mjs";
2
+ import { $ as OrganizationPaymentBatchInput, $n as RequestStatus, $t as Destination, A as OrgScopedMethods, An as Ref, At as AddressBookAddInput, B as AuthorizeRunOptions, Bn as SmartAccountMethods, Bt as ActivityFilter, C as CurrentUserMethods, Cn as PaymentMoney, Ct as AccountMethods, D as MemberStatus, Dn as PaymentsMethods, Dt as ActorRequest, E as InviteMemberInput, En as PaymentType, Et as ActorRelationshipMethods, F as ResendInviteTokenInput, Fn as AccountLifecycle, Ft as InboxItem, G as PayrollGroupsMethods, Gn as ActorRef, Gt as ActivityPage, H as PayrollGroup, Hn as OrgLifecycle, Ht as ActivityKind, I as RoleDefinition, In as AccountSetupStep, It as InboxMethods, J as PayrollRun, Jn as SubmittedPermissionExecution, Jt as ActivitySummary, K as PayrollMethods, Kn as CurrentHoldings, Kt as ActivityRange, L as RoleSpendCap, Ln as isSettingUpLifecycle, Lt as ActivityAnnotation, M as OrgView, Mn as TargetReference, Mt as AddressBookLabelInput, N as OrganizationAccount, Nn as TargetsMethods, Nt as AddressBookMethods, O as MemberView, On as PaymentsPayInput, Ot as ActorRequestIssueInput, P as OrganizationAuditLogItem, Pn as fingerprintPaymentIntent, Pt as InboxApproveInput, Q as PayrollTermsUnit, Qn as PaymentStatus$1, Qt as DepositInstructions, R as RoleView, Rn as CompleteProfileInput, Rt as ActivityAnnotationInput, S as CurrentUserContext, Sn as PaymentDocumentsMethods, St as ReadyAccountLifecycle, T as DetectPendingOrgInvitationsResult, Tn as PaymentTiming, Tt as ActorProfileMethods, U as PayrollGroupInput, Un as OrgSetupStep, Ut as ActivityListParams, V as PayrollEngagementTerms, Vn as AuthMethods, Vt as ActivityItem, W as PayrollGroupMember, Wn as PayoutAddress, Wt as ActivityMethods, X as PayrollRunStatus, Xn as PAYMENT_DIRECTIONS, Xt as ActivitySummaryTotal, Y as PayrollRunItemInput, Yn as InboxStatus, Yt as ActivitySummaryParams, Z as PayrollRuns, Zn as PAYMENT_STATUSES, Zt as ActorReference, _ as HoldingsMethods, _n as PaymentDirection, _t as OnboardingMethods, a as ObservationContext, an as DestinationRemoveInput, ar as IdentityEvent, at as PermissionCreateInput, b as SystemHealth, bn as PaymentDocumentRender, bt as PersonOnboarding, c as HostObservability, cn as MeMethods, cr as Readiness, ct as PermissionReplaceInput, d as postHogObservability, dn as OfframpMethods, dr as isClaimed, dt as Budget, en as DestinationAddInput, et as OrganizationPaymentInput, f as CapxulClient, fn as OfframpQuote, fr as isRestoring, ft as OrgMe, g as IdentityRuntimeSendResult, gn as PaymentActivityEvidence, gt as CompletedPersonProfile, h as IdentityRuntime, hn as Payment, ht as AccountsMethods, i as ObservationAdapter, in as DestinationRail, ir as Destination$1, it as PermissionChangeInput, j as OrgTemplate, jn as ResolvedTarget, jt as AddressBookEntry, k as OrgMethods, kn as RecipientResolution, kt as ActorRequestsMethods, l as PostHogObservabilityClient, ln as MeProfile, lr as StateLabel, lt as PermissionRevokeInput, m as IdentityProfileDetails, mn as OfframpStatus, mr as InvocationControls, mt as OrgMeOptions, nn as DestinationListInput, nt as OrganizationPaymentsMethods, o as ObservationDelivery, on as DestinationsMethods, or as IdentityState, ot as PermissionMethods, p as CreateCapxulClientInput, pn as OfframpQuoteInput, pr as IdentityTransition, pt as OrgMeMethod, q as PayrollOptions, qn as Permission, qt as ActivityReference, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, rn as DestinationPayload, rr as TelemetryPort, rt as PermissionAssignInput, s as SdkFailureObservation, sn as FinancialOpsMethods, sr as OrgLane, st as PermissionOptions, t as CapxulClientInput, tn as DestinationKind, tt as OrganizationPaymentItemInput, u as PostHogObservabilityOptions, un as MovementActivityEvidence, ur as destination, ut as PermissionReadResult, v as Holding, vn as PaymentDocumentKind, vt as OrganizationOnboarding, w as CreateOrgInput, wn as PaymentStatus, wt as ActorProfile, x as MediaMethods, xn as PaymentDocumentVerification, xt as PersonOnboardingInput, y as SystemMethods, yn as PaymentDocumentRef, yt as OrganizationOnboardingInput, z as AuthorizeRunInput, zn as IdentityMethods, zt as ActivityDetail } from "./production-DuSjYRk4.mjs";
3
3
  import { Hex } from "viem";
4
4
  import { Effect, Layer } from "effect";
5
5
  //#region ../errors/src/index.d.ts
@@ -125,6 +125,8 @@ declare const CAPXUL_OPERATIONS: {
125
125
  readonly cancelRequest: "financialOps.cancelRequest";
126
126
  readonly createPayee: "financialOps.createPayee";
127
127
  readonly declineRequest: "financialOps.declineRequest";
128
+ readonly emitInvoiceIssued: "financialOps.emitInvoiceIssued";
129
+ readonly emitInvoiceRequestTransitioned: "financialOps.emitInvoiceRequestTransitioned";
128
130
  readonly emitPaymentWriterTelemetry: "financialOps.emitPaymentWriterTelemetry";
129
131
  readonly issueRequest: "financialOps.issueRequest";
130
132
  readonly recoverSettlementVerification: "financialOps.recoverSettlementVerification";
@@ -135,6 +137,9 @@ declare const CAPXUL_OPERATIONS: {
135
137
  readonly current: "holdings.current";
136
138
  readonly primary: "holdings.primary";
137
139
  };
140
+ readonly indexer: {
141
+ readonly reconcile: "indexer.reconcile";
142
+ };
138
143
  readonly identity: {
139
144
  readonly accountAt: "identity.AccountAt";
140
145
  readonly accountClaimed: "identity.AccountClaimed";
@@ -226,6 +231,7 @@ declare const CAPXUL_OPERATIONS: {
226
231
  readonly createOrg: "org.createOrg";
227
232
  readonly create: "org.create";
228
233
  readonly detectAndAcceptPendingInvitations: "org.detectAndAcceptPendingInvitations";
234
+ readonly emitInviteProgressed: "org.emitInviteProgressed";
229
235
  readonly expireInvitations: "org.expireInvitations";
230
236
  readonly getLifecycle: "org.getLifecycle";
231
237
  readonly getProofReceipt: "org.getProofReceipt";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as signerFailure, B as isRestoring, C as normalizeExceptionErrorKind, E as safeExceptionLabel, F as CAPXUL_OPERATIONS, I as isCapxulOperation, L as normalizeCapxulOperation, M as PAYMENT_DIRECTIONS, N as PAYMENT_STATUSES, O as isSettingUpLifecycle, R as destination, S as SDK_VERSION, T as projectSdkException, _ as fingerprintPaymentIntent, b as failureDetail, d as embeddedSigner, f as openfortEmbeddedSigner, g as devPrivateKeySigner, h as deriveDevPrivateKey, j as resolveFailureMode, k as injectedWalletSigner, m as openfortEmbeddedWalletPort, p as openfortEmbeddedSignerFromWallet, r as postHogObservability, t as createCapxulClient$1, w as normalizeExceptionOperation, x as EXCEPTION_MESSAGE, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as isClaimed } from "./production-CrW_sxwv.mjs";
1
+ import { A as signerFailure, B as isRestoring, C as normalizeExceptionErrorKind, E as safeExceptionLabel, F as CAPXUL_OPERATIONS, I as isCapxulOperation, L as normalizeCapxulOperation, M as PAYMENT_DIRECTIONS, N as PAYMENT_STATUSES, O as isSettingUpLifecycle, R as destination, S as SDK_VERSION, T as projectSdkException, _ as fingerprintPaymentIntent, b as failureDetail, d as embeddedSigner, f as openfortEmbeddedSigner, g as devPrivateKeySigner, h as deriveDevPrivateKey, j as resolveFailureMode, k as injectedWalletSigner, m as openfortEmbeddedWalletPort, p as openfortEmbeddedSignerFromWallet, r as postHogObservability, t as createCapxulClient$1, w as normalizeExceptionOperation, x as EXCEPTION_MESSAGE, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as isClaimed } from "./production-C2EwEcoX.mjs";
2
2
  import { A as currencySymbolFor, B as toCurrencyCode, G as toHandle, M as toAddress, T as EVM_ADDRESS_RE, Y as toPartyId, at as HANDLE_RE, b as configuredMoneyAssetById, ct as CapxulError, dt as isCapxulError, ft as CHAIN_UPSTREAMS, g as CAPXUL_PAYMENTS_V2_ADDRESS, k as assetIdFor, pt as FAILURE_MODES, st as CAPXUL_ERROR_CODES, ut as Errors, z as toCountryCode } from "./OAuthBearerAuthClient-CbU_W9Sp.mjs";
3
3
  import { formatUnits } from "viem";
4
4
  import { Effect } from "effect";
@@ -493,6 +493,8 @@ const CAPXUL_OPERATIONS = {
493
493
  cancelRequest: "financialOps.cancelRequest",
494
494
  createPayee: "financialOps.createPayee",
495
495
  declineRequest: "financialOps.declineRequest",
496
+ emitInvoiceIssued: "financialOps.emitInvoiceIssued",
497
+ emitInvoiceRequestTransitioned: "financialOps.emitInvoiceRequestTransitioned",
496
498
  emitPaymentWriterTelemetry: "financialOps.emitPaymentWriterTelemetry",
497
499
  issueRequest: "financialOps.issueRequest",
498
500
  recoverSettlementVerification: "financialOps.recoverSettlementVerification",
@@ -503,6 +505,7 @@ const CAPXUL_OPERATIONS = {
503
505
  current: "holdings.current",
504
506
  primary: "holdings.primary"
505
507
  },
508
+ indexer: { reconcile: "indexer.reconcile" },
506
509
  identity: {
507
510
  accountAt: "identity.AccountAt",
508
511
  accountClaimed: "identity.AccountClaimed",
@@ -592,6 +595,7 @@ const CAPXUL_OPERATIONS = {
592
595
  createOrg: "org.createOrg",
593
596
  create: "org.create",
594
597
  detectAndAcceptPendingInvitations: "org.detectAndAcceptPendingInvitations",
598
+ emitInviteProgressed: "org.emitInviteProgressed",
595
599
  expireInvitations: "org.expireInvitations",
596
600
  getLifecycle: "org.getLifecycle",
597
601
  getProofReceipt: "org.getProofReceipt",
@@ -1411,6 +1415,26 @@ const MovementScanIncidentProps = Schema.Struct({
1411
1415
  incident_kind: Schema.String,
1412
1416
  anchor_block_number: Schema.Number
1413
1417
  });
1418
+ /**
1419
+ * One durable row the reconciliation job corrected against Ponder (SPEC D9).
1420
+ *
1421
+ * Both block fields are optional and for the same reason: a correction INTO
1422
+ * drift (a Payment settled in Convex whose Ponder fact a reorg removed) has no
1423
+ * current block, and a correction that confirms a later fact has one.
1424
+ *
1425
+ * `projection_kind` is closed. A later ticket that reconciles a deploy, a
1426
+ * bootstrap or a grant outcome adds its kind here in the same change; an
1427
+ * unknown kind must not decode.
1428
+ */
1429
+ const IndexerDriftCorrectedProps = Schema.Struct({
1430
+ ...TelemetryEnvelopeProps,
1431
+ projection_kind: Schema.Literals(["member_authority", "payment_settlement"]),
1432
+ previous_state: Schema.String,
1433
+ current_state: Schema.String,
1434
+ previous_block: Schema.optional(Schema.Number),
1435
+ current_block: Schema.optional(Schema.Number),
1436
+ logical_event_id: Schema.optional(Schema.String)
1437
+ });
1414
1438
  Schema.Struct({
1415
1439
  name: Schema.Literal("auth_otp_requested"),
1416
1440
  props: AuthOtpRequestedProps
@@ -1615,6 +1639,10 @@ Schema.Struct({
1615
1639
  name: Schema.Literal("movement_scan_incident"),
1616
1640
  props: MovementScanIncidentProps
1617
1641
  });
1642
+ Schema.Struct({
1643
+ name: Schema.Literal("indexer_drift_corrected"),
1644
+ props: IndexerDriftCorrectedProps
1645
+ });
1618
1646
  /** The one spelling of "whose scope did this happen in" across every surface. */
1619
1647
  const ScopeKindSchema = Schema.Literals(["account", "organization"]);
1620
1648
  const AccountKindSchema = Schema.Literals(["personalSafe", "orgTreasury"]);
@@ -5192,31 +5220,31 @@ function makeActorRelationshipMethods(deps) {
5192
5220
  reference: input.reference,
5193
5221
  ...input.memo === void 0 ? {} : { memo: input.memo },
5194
5222
  ...input.expiresAt === void 0 ? {} : { expiresAt: input.expiresAt }
5195
- }))), (request) => mapActorRequest(request, input.payer)), controls, CAPXUL_OPERATIONS.requests.issue, deps.runPromise);
5223
+ }))), (request) => mapActorRequest(request, input.payer)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.issue, deps.runPromise);
5196
5224
  },
5197
5225
  list: (options) => {
5198
5226
  const controls = deps.invocationControls?.(options) ?? options;
5199
- return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.list, Effect.suspend(() => convexCall.query(fns.requestsList, copyInvocationObservation(controls, { actor }))), (requests) => requests.map((request) => mapActorRequest(request))), controls, CAPXUL_OPERATIONS.requests.list, deps.runPromise);
5227
+ return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.list, Effect.suspend(() => convexCall.query(fns.requestsList, copyInvocationObservation(controls, { actor }))), (requests) => requests.map((request) => mapActorRequest(request))).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.list, deps.runPromise);
5200
5228
  },
5201
5229
  get: (requestId, options) => {
5202
5230
  const controls = deps.invocationControls?.(options) ?? options;
5203
5231
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.get, Effect.suspend(() => convexCall.query(fns.requestsGet, copyInvocationObservation(controls, {
5204
5232
  actor,
5205
5233
  paymentRequestId: requestId
5206
- }))), (request) => request === null ? null : mapActorRequest(request)), controls, CAPXUL_OPERATIONS.requests.get, deps.runPromise);
5234
+ }))), (request) => request === null ? null : mapActorRequest(request)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.get, deps.runPromise);
5207
5235
  },
5208
5236
  cancel: (requestId, options) => {
5209
5237
  const controls = deps.invocationControls?.(options) ?? options;
5210
5238
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.cancel, Effect.suspend(() => convexCall.mutation(fns.requestsCancel, copyInvocationObservation(controls, {
5211
5239
  actor,
5212
5240
  paymentRequestId: requestId
5213
- }))), (request) => mapActorRequest(request)), controls, CAPXUL_OPERATIONS.requests.cancel, deps.runPromise);
5241
+ }))), (request) => mapActorRequest(request)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.cancel, deps.runPromise);
5214
5242
  }
5215
5243
  },
5216
5244
  inbox: {
5217
5245
  list: (options) => {
5218
5246
  const controls = deps.invocationControls?.(options) ?? options;
5219
- return runPortEffect(mapReply(CAPXUL_OPERATIONS.inbox.list, Effect.suspend(() => convexCall.query(fns.inboxList, copyInvocationObservation(controls, { actor }))), (items) => items.map(mapInboxItem)), controls, CAPXUL_OPERATIONS.inbox.list, deps.runPromise);
5247
+ return runPortEffect(mapReply(CAPXUL_OPERATIONS.inbox.list, Effect.suspend(() => convexCall.query(fns.inboxList, copyInvocationObservation(controls, { actor }))), (items) => items.map(mapInboxItem)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.list, deps.runPromise);
5220
5248
  },
5221
5249
  approve: (input, options) => {
5222
5250
  const controls = deps.invocationControls?.(options) ?? options;
@@ -5228,14 +5256,14 @@ function makeActorRelationshipMethods(deps) {
5228
5256
  }))).pipe(Effect.flatMap((prepared) => {
5229
5257
  const result = mapApprovedInboxPayment(prepared, input);
5230
5258
  return result.ok ? Effect.succeed(result.value) : Effect.fail({ publicError: result.error });
5231
- })), controls, CAPXUL_OPERATIONS.inbox.approve, deps.runPromise);
5259
+ }), Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.approve, deps.runPromise);
5232
5260
  },
5233
5261
  decline: (requestId, options) => {
5234
5262
  const controls = deps.invocationControls?.(options) ?? options;
5235
5263
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.inbox.decline, Effect.suspend(() => convexCall.mutation(fns.inboxDecline, copyInvocationObservation(controls, {
5236
5264
  actor,
5237
5265
  paymentRequestId: requestId
5238
- }))), mapInboxItem), controls, CAPXUL_OPERATIONS.inbox.decline, deps.runPromise);
5266
+ }))), mapInboxItem).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.decline, deps.runPromise);
5239
5267
  }
5240
5268
  },
5241
5269
  profile: {
@@ -6091,7 +6119,7 @@ function subscribeActivity(deps, actor, controls, onChange) {
6091
6119
  }
6092
6120
  //#endregion
6093
6121
  //#region package.json
6094
- var version = "4.2.0-rc.13";
6122
+ var version = "4.2.0-rc.14";
6095
6123
  //#endregion
6096
6124
  //#region src/telemetry/exception-projection.ts
6097
6125
  /** Fixed fallback for failures that have no safe message. */
@@ -10228,11 +10256,11 @@ var ConvexOrganizationAdapter = class {
10228
10256
  return this.listMembers(input).pipe(Effect.map((members) => members.filter((member) => member.status === "pending" || member.status === "pending_safe" || member.status === "pending_grant")));
10229
10257
  }
10230
10258
  inviteMember(input) {
10231
- return this.#convex.action(this.#fns.inviteMember, {
10259
+ return this.#convex.action(this.#fns.inviteMember, copyInvocationObservation(input, {
10232
10260
  orgId: input.orgId,
10233
10261
  email: input.input.email,
10234
10262
  role: input.input.role
10235
- }).pipe(Effect.mapError((error) => orgErrorFromCapxul("inviteMember", error.publicError, error)), Effect.map(brandOrgMember), Effect.catchDefect((cause) => Effect.fail(toOrgError("inviteMember", cause))));
10263
+ })).pipe(Effect.mapError((error) => orgErrorFromCapxul("inviteMember", error.publicError, error)), Effect.map(brandOrgMember), Effect.catchDefect((cause) => Effect.fail(toOrgError("inviteMember", cause))));
10236
10264
  }
10237
10265
  resendInviteToken(input) {
10238
10266
  return this.#convex.mutation(this.#fns.resendInvite, {
@@ -13244,18 +13272,6 @@ function emitOrgCreateFailed(telemetry, error) {
13244
13272
  }
13245
13273
  });
13246
13274
  }
13247
- function emitOrgInviteSent(telemetry, input) {
13248
- const domain = emailDomain$1(input.email);
13249
- return emitOrgTelemetry(telemetry, {
13250
- name: "org_invite_sent",
13251
- props: {
13252
- org_id: input.orgId,
13253
- ...domain === void 0 ? {} : { email_domain: domain },
13254
- role: input.role,
13255
- status: input.status
13256
- }
13257
- });
13258
- }
13259
13275
  function reportOrgTelemetryFailure(kind, name, cause) {
13260
13276
  if (!isOrgTelemetryDebugEnabled()) return;
13261
13277
  globalThis.console?.warn?.("[capxul] org telemetry dropped", {
@@ -13431,25 +13447,26 @@ function listMembersProgram(orgId) {
13431
13447
  return [];
13432
13448
  });
13433
13449
  }
13450
+ /**
13451
+ * R06 (#1964): the SDK no longer emits `org_invite_sent`. The backend action
13452
+ * that writes the invitation is its ONE producer, so a hermetic call — which
13453
+ * writes nothing — can no longer report an invitation that never happened, and
13454
+ * a live call is counted once instead of twice. The captured attempt rides the
13455
+ * port input, so the durable event carries the correlation this call ran under.
13456
+ */
13434
13457
  function inviteMemberProgram(orgId, input) {
13435
13458
  return Effect.gen(function* () {
13436
13459
  const deps = yield* OrgDepsTag;
13437
- const member = deps.orgPort !== void 0 ? yield* deps.orgPort.inviteMember({
13438
- orgId,
13439
- input
13440
- }).pipe(Effect.mapError((error) => error.publicError)) : hermeticMember({
13460
+ if (deps.orgPort === void 0) return hermeticMember({
13441
13461
  orgId,
13442
13462
  email: input.email,
13443
13463
  role: input.role,
13444
13464
  status: "pending"
13445
13465
  });
13446
- yield* Effect.promise(() => emitOrgInviteSent(deps.telemetry, {
13466
+ return yield* deps.orgPort.inviteMember(copyInvocationObservation(deps.invocationSource, {
13447
13467
  orgId,
13448
- email: input.email,
13449
- role: member.role,
13450
- status: member.status
13451
- }));
13452
- return member;
13468
+ input
13469
+ })).pipe(Effect.mapError((error) => error.publicError));
13453
13470
  });
13454
13471
  }
13455
13472
  function detectAndAcceptPendingInvitationsProgram() {
@@ -13716,11 +13733,15 @@ function makeOrgMethods(deps) {
13716
13733
  return toCapxulResult(listRolesProgram(orgId), layer);
13717
13734
  },
13718
13735
  invite(_input, _options) {
13719
- if (_options?.signal?.aborted) return Promise.resolve({
13736
+ const controls = deps.invocationControls?.(_options) ?? _options;
13737
+ if (controls?.signal?.aborted) return Promise.resolve({
13720
13738
  ok: false,
13721
13739
  error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.org.invite })
13722
13740
  });
13723
- return toCapxulResult(inviteMemberProgram(orgId, _input), layer);
13741
+ return runCapxulEffect(inviteMemberProgram(orgId, _input).pipe(Effect.provide(orgDepsLayer({
13742
+ ...orgDeps,
13743
+ ...controls === void 0 ? {} : { invocationSource: controls }
13744
+ }))), controls, CAPXUL_OPERATIONS.org.invite, deps.runPromise);
13724
13745
  },
13725
13746
  auditLog(_options) {
13726
13747
  if (_options?.signal?.aborted) return Promise.resolve({
@@ -284,7 +284,7 @@ interface TelemetryPort {
284
284
  }
285
285
  //#endregion
286
286
  //#region ../observability/src/index.d.ts
287
- declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "identity_refused", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "payment_lifecycle_transition", "quick_pay_external_address_acknowledged", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident", "activity_annotation_saved", "ui_activity_action_completed", "contact_relationship_changed", "ui_contact_action_completed", "access_recovery_completed", "ui_access_step_completed", "org_invite_progressed", "invoice_issued", "invoice_request_transitioned", "ui_invoice_step_completed", "ui_treasury_step_completed", "ui_receive_step_completed", "payroll_group_changed", "payroll_run_transitioned", "ui_payroll_action_completed"];
287
+ declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "identity_refused", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "payment_lifecycle_transition", "quick_pay_external_address_acknowledged", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident", "indexer_drift_corrected", "activity_annotation_saved", "ui_activity_action_completed", "contact_relationship_changed", "ui_contact_action_completed", "access_recovery_completed", "ui_access_step_completed", "org_invite_progressed", "invoice_issued", "invoice_request_transitioned", "ui_invoice_step_completed", "ui_treasury_step_completed", "ui_receive_step_completed", "payroll_group_changed", "payroll_run_transitioned", "ui_payroll_action_completed"];
288
288
  type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
289
289
  type TelemetryProps = Record<string, unknown>;
290
290
  type TelemetryEvent = {
@@ -1887,19 +1887,17 @@ interface ActorRequestIssueInput {
1887
1887
  readonly memo?: string;
1888
1888
  readonly expiresAt?: number;
1889
1889
  }
1890
+ /**
1891
+ * The issuer's own requests. The options are the address book's
1892
+ * `InvocationControls` (R07 #1965), so a caller that captured one browser
1893
+ * attempt hands it to the operation that attempt started; `{ signal }` callers
1894
+ * are unaffected.
1895
+ */
1890
1896
  interface ActorRequestsMethods {
1891
- issue(input: ActorRequestIssueInput, options?: {
1892
- readonly signal?: AbortSignal;
1893
- }): Promise<CapxulResult<ActorRequest>>;
1894
- list(options?: {
1895
- readonly signal?: AbortSignal;
1896
- }): Promise<CapxulResult<readonly ActorRequest[]>>;
1897
- get(requestId: string, options?: {
1898
- readonly signal?: AbortSignal;
1899
- }): Promise<CapxulResult<ActorRequest | null>>;
1900
- cancel(requestId: string, options?: {
1901
- readonly signal?: AbortSignal;
1902
- }): Promise<CapxulResult<ActorRequest>>;
1897
+ issue(input: ActorRequestIssueInput, options?: InvocationControls): Promise<CapxulResult<ActorRequest>>;
1898
+ list(options?: InvocationControls): Promise<CapxulResult<readonly ActorRequest[]>>;
1899
+ get(requestId: string, options?: InvocationControls): Promise<CapxulResult<ActorRequest | null>>;
1900
+ cancel(requestId: string, options?: InvocationControls): Promise<CapxulResult<ActorRequest>>;
1903
1901
  }
1904
1902
  interface InboxItem {
1905
1903
  readonly id: string;
@@ -1913,16 +1911,11 @@ interface InboxApproveInput {
1913
1911
  readonly timing?: PaymentTiming;
1914
1912
  readonly permissionId?: string;
1915
1913
  }
1914
+ /** The payer's own inbox. Its scope is the payer's, never the issuer's. */
1916
1915
  interface InboxMethods {
1917
- list(options?: {
1918
- readonly signal?: AbortSignal;
1919
- }): Promise<CapxulResult<readonly InboxItem[]>>;
1920
- approve(input: InboxApproveInput, options?: {
1921
- readonly signal?: AbortSignal;
1922
- }): Promise<CapxulResult<Payment>>;
1923
- decline(requestId: string, options?: {
1924
- readonly signal?: AbortSignal;
1925
- }): Promise<CapxulResult<InboxItem>>;
1916
+ list(options?: InvocationControls): Promise<CapxulResult<readonly InboxItem[]>>;
1917
+ approve(input: InboxApproveInput, options?: InvocationControls): Promise<CapxulResult<Payment>>;
1918
+ decline(requestId: string, options?: InvocationControls): Promise<CapxulResult<InboxItem>>;
1926
1919
  }
1927
1920
  interface ActorProfileMethods {
1928
1921
  get(options?: {
@@ -2091,6 +2084,12 @@ type ListOrgRolesInput = {
2091
2084
  type ListOrgMembersInput = {
2092
2085
  readonly orgId: OrgId;
2093
2086
  };
2087
+ /**
2088
+ * R06 (#1964): the program attaches the caller's captured attempt to this
2089
+ * record through `copyInvocationObservation`, so the adapter forwards one
2090
+ * observation context to the backend action that owns `org_invite_sent`. The
2091
+ * carrier is a non-enumerable symbol and never becomes a wire field.
2092
+ */
2094
2093
  type InviteOrgMemberInput = {
2095
2094
  readonly orgId: OrgId;
2096
2095
  readonly input: InviteMemberInput;
@@ -2525,9 +2524,14 @@ interface OrgScopedMethods extends ActorRelationshipMethods {
2525
2524
  roles(options?: {
2526
2525
  readonly signal?: AbortSignal;
2527
2526
  }): Promise<CapxulResult<readonly RoleView[]>>;
2528
- invite(input: InviteMemberInput, options?: {
2529
- readonly signal?: AbortSignal;
2530
- }): Promise<CapxulResult<MemberView>>;
2527
+ /**
2528
+ * Invite a member by email. `options` is the browser attempt the caller
2529
+ * captured before the person pressed the button (R06 #1964); it reaches the
2530
+ * backend action unchanged, so the durable `org_invite_sent` and the later
2531
+ * `org_invite_progressed` share the attempt's correlation. `{ signal }`
2532
+ * callers are unaffected.
2533
+ */
2534
+ invite(input: InviteMemberInput, options?: InvocationControls): Promise<CapxulResult<MemberView>>;
2531
2535
  /**
2532
2536
  * Leak-safe Organization payment: execute through the payments engine with
2533
2537
  * the selected receipt-verified Budget Permission
@@ -1,5 +1,5 @@
1
1
  import { h as CapxulResult } from "../OAuthBearerAuthClient-C-ip-z8M.mjs";
2
- import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-Db4fBqSk.mjs";
2
+ import { er as TelemetryEvent, f as CapxulClient, i as ObservationAdapter, n as ProductionSignerControls, nr as TelemetryIdentifyInput, pr as IdentityTransition, t as CapxulClientInput, tr as TelemetryGroupInput } from "../production-DuSjYRk4.mjs";
3
3
  import { Effect, Layer } from "effect";
4
4
  //#region src/testing/production-client.d.ts
5
5
  /** Create the one production client with per-client controls at its signing boundaries. */
@@ -1,4 +1,4 @@
1
- import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-CrW_sxwv.mjs";
1
+ import { D as fromWei, P as redactTelemetryEvent, a as smartAccountErrorFromCapxul, c as identityErrorFromCapxul, i as assembleCapxulClient, l as convexCallErrorFromCapxul, n as createCapxulClientWithSignerControls, o as accountReadErrorFromCapxul, s as wireChainId, u as bootstrapErrorFromCapxul, v as toWei } from "../production-C2EwEcoX.mjs";
2
2
  import { G as toHandle, H as toEmail, I as toAuthUserId, K as toJwtToken, M as toAddress, N as toAllowedOrigin, P as toAppId, Q as toPublishableKey, R as toChainId, U as toEpochMs, V as toDurationMs, W as toEpochSeconds, ct as CapxulError, d as authClientPortFromPromiseAdapter, et as toSessionToken, it as validateHandle, j as toAccountId, n as readClockNow, q as toKycTier, r as InMemoryAuthCacheAdapter, ut as Errors, y as deriveCapxulSafeAddress, z as toCountryCode } from "../OAuthBearerAuthClient-CbU_W9Sp.mjs";
3
3
  import { keccak256 } from "viem";
4
4
  import { Effect, Result, Semaphore } from "effect";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "4.2.0-rc.13",
3
+ "version": "4.2.0-rc.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Xelmar-tech/infrastructure.git",
@@ -49,8 +49,8 @@
49
49
  "vitest": "4.1.11",
50
50
  "@capxul/config": "0.3.0",
51
51
  "@capxul/errors": "0.3.0",
52
+ "@capxul/observability": "4.2.0-rc.14",
52
53
  "@capxul/types": "0.3.0",
53
- "@capxul/observability": "4.2.0-rc.13",
54
54
  "@capxul/typescript-config": "0.0.0",
55
55
  "@capxul/wire": "0.7.0"
56
56
  },