@capxul/mcp 4.2.0-rc.13 → 4.2.0-rc.15

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": "b2dff9052ea3f3a55dfca98530c02b4ac3bcfa96",
4
+ "tree": "9fc0a21bc2cb477c62dd9f5c44c4977d74548d94",
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/mcp",
10
- "version": "4.2.0-rc.13"
10
+ "version": "4.2.0-rc.15"
11
11
  }
package/dist/main.mjs CHANGED
@@ -6947,6 +6947,8 @@ const CAPXUL_OPERATIONS = {
6947
6947
  cancelRequest: "financialOps.cancelRequest",
6948
6948
  createPayee: "financialOps.createPayee",
6949
6949
  declineRequest: "financialOps.declineRequest",
6950
+ emitInvoiceIssued: "financialOps.emitInvoiceIssued",
6951
+ emitInvoiceRequestTransitioned: "financialOps.emitInvoiceRequestTransitioned",
6950
6952
  emitPaymentWriterTelemetry: "financialOps.emitPaymentWriterTelemetry",
6951
6953
  issueRequest: "financialOps.issueRequest",
6952
6954
  recoverSettlementVerification: "financialOps.recoverSettlementVerification",
@@ -6957,6 +6959,7 @@ const CAPXUL_OPERATIONS = {
6957
6959
  current: "holdings.current",
6958
6960
  primary: "holdings.primary"
6959
6961
  },
6962
+ indexer: { reconcile: "indexer.reconcile" },
6960
6963
  identity: {
6961
6964
  accountAt: "identity.AccountAt",
6962
6965
  accountClaimed: "identity.AccountClaimed",
@@ -7046,6 +7049,7 @@ const CAPXUL_OPERATIONS = {
7046
7049
  createOrg: "org.createOrg",
7047
7050
  create: "org.create",
7048
7051
  detectAndAcceptPendingInvitations: "org.detectAndAcceptPendingInvitations",
7052
+ emitInviteProgressed: "org.emitInviteProgressed",
7049
7053
  expireInvitations: "org.expireInvitations",
7050
7054
  getLifecycle: "org.getLifecycle",
7051
7055
  getProofReceipt: "org.getProofReceipt",
@@ -7282,6 +7286,10 @@ const OptionalAccountId = Schema.optional(AccountIdSchema$1);
7282
7286
  const OptionalWeiAmount = Schema.optional(WeiAmountSchema$1);
7283
7287
  const OptionalCurrencyCode = Schema.optional(CurrencyCodeSchema$1);
7284
7288
  const OptionalBalanceBucket = Schema.optional(BalanceBucketSchema);
7289
+ /** Which Safe a money record is about. Declared here so the money-domain
7290
+ * props below can name it as well as the UI-step props further down. */
7291
+ const AccountKindSchema = Schema.Literals(["personalSafe", "orgTreasury"]);
7292
+ const OptionalAccountKind = Schema.optional(AccountKindSchema);
7285
7293
  const OptionalAddress = Schema.optional(AddressSchema$1);
7286
7294
  const OptionalAppId = Schema.optional(AppIdSchema$1);
7287
7295
  const OptionalBlockNumber = Schema.optional(BlockNumberSchema$1);
@@ -7434,9 +7442,22 @@ const BootstrapFailedProps = Schema.Struct({
7434
7442
  reason: OptionalString,
7435
7443
  target_host: OptionalString
7436
7444
  });
7445
+ /**
7446
+ * R08 (#1966): which Safe was read, on which chain, of which token. `currency`
7447
+ * is the DISPLAY code the surface shows ("USD"); it never says which ERC-20 the
7448
+ * `balanceOf` actually hit, so a reader could not tell a treasury read from a
7449
+ * personal one, nor USDX from any other dollar-labelled token. The producer
7450
+ * takes each of these from the authority that already decided it — the verified
7451
+ * Organization row's chain, the configured token address — never from a label.
7452
+ * The verified `organization_id` and its group arrive from the backend
7453
+ * attribution, so they are not repeated here.
7454
+ */
7437
7455
  const AccountBalanceReadProps = Schema.Struct({
7438
7456
  ...TelemetryEnvelopeProps,
7439
7457
  account_id: OptionalAccountId,
7458
+ account_kind: OptionalAccountKind,
7459
+ chain_id: OptionalChainId,
7460
+ token_address: OptionalAddress,
7440
7461
  currency: OptionalCurrencyCode,
7441
7462
  balance_bucket: OptionalBalanceBucket,
7442
7463
  durationMs: OptionalDurationMs
@@ -7850,6 +7871,26 @@ const MovementScanIncidentProps = Schema.Struct({
7850
7871
  incident_kind: Schema.String,
7851
7872
  anchor_block_number: Schema.Number
7852
7873
  });
7874
+ /**
7875
+ * One durable row the reconciliation job corrected against Ponder (SPEC D9).
7876
+ *
7877
+ * Both block fields are optional and for the same reason: a correction INTO
7878
+ * drift (a Payment settled in Convex whose Ponder fact a reorg removed) has no
7879
+ * current block, and a correction that confirms a later fact has one.
7880
+ *
7881
+ * `projection_kind` is closed. A later ticket that reconciles a deploy, a
7882
+ * bootstrap or a grant outcome adds its kind here in the same change; an
7883
+ * unknown kind must not decode.
7884
+ */
7885
+ const IndexerDriftCorrectedProps = Schema.Struct({
7886
+ ...TelemetryEnvelopeProps,
7887
+ projection_kind: Schema.Literals(["member_authority", "payment_settlement"]),
7888
+ previous_state: Schema.String,
7889
+ current_state: Schema.String,
7890
+ previous_block: Schema.optional(Schema.Number),
7891
+ current_block: Schema.optional(Schema.Number),
7892
+ logical_event_id: Schema.optional(Schema.String)
7893
+ });
7853
7894
  Schema.Struct({
7854
7895
  name: Schema.Literal("auth_otp_requested"),
7855
7896
  props: AuthOtpRequestedProps
@@ -8054,9 +8095,12 @@ Schema.Struct({
8054
8095
  name: Schema.Literal("movement_scan_incident"),
8055
8096
  props: MovementScanIncidentProps
8056
8097
  });
8098
+ Schema.Struct({
8099
+ name: Schema.Literal("indexer_drift_corrected"),
8100
+ props: IndexerDriftCorrectedProps
8101
+ });
8057
8102
  /** The one spelling of "whose scope did this happen in" across every surface. */
8058
8103
  const ScopeKindSchema = Schema.Literals(["account", "organization"]);
8059
- const AccountKindSchema = Schema.Literals(["personalSafe", "orgTreasury"]);
8060
8104
  const OptionalReasonCode = Schema.optional(Schema.Literals(CAPXUL_ERROR_CODES));
8061
8105
  const ActivityReferenceProps = {
8062
8106
  reference_kind: Schema.Literals(["payment", "movement"]),
@@ -11901,31 +11945,31 @@ function makeActorRelationshipMethods(deps) {
11901
11945
  reference: input.reference,
11902
11946
  ...input.memo === void 0 ? {} : { memo: input.memo },
11903
11947
  ...input.expiresAt === void 0 ? {} : { expiresAt: input.expiresAt }
11904
- }))), (request) => mapActorRequest(request, input.payer)), controls, CAPXUL_OPERATIONS.requests.issue, deps.runPromise);
11948
+ }))), (request) => mapActorRequest(request, input.payer)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.issue, deps.runPromise);
11905
11949
  },
11906
11950
  list: (options) => {
11907
11951
  const controls = deps.invocationControls?.(options) ?? options;
11908
- 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);
11952
+ 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);
11909
11953
  },
11910
11954
  get: (requestId, options) => {
11911
11955
  const controls = deps.invocationControls?.(options) ?? options;
11912
11956
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.get, Effect.suspend(() => convexCall.query(fns.requestsGet, copyInvocationObservation(controls, {
11913
11957
  actor,
11914
11958
  paymentRequestId: requestId
11915
- }))), (request) => request === null ? null : mapActorRequest(request)), controls, CAPXUL_OPERATIONS.requests.get, deps.runPromise);
11959
+ }))), (request) => request === null ? null : mapActorRequest(request)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.get, deps.runPromise);
11916
11960
  },
11917
11961
  cancel: (requestId, options) => {
11918
11962
  const controls = deps.invocationControls?.(options) ?? options;
11919
11963
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.cancel, Effect.suspend(() => convexCall.mutation(fns.requestsCancel, copyInvocationObservation(controls, {
11920
11964
  actor,
11921
11965
  paymentRequestId: requestId
11922
- }))), (request) => mapActorRequest(request)), controls, CAPXUL_OPERATIONS.requests.cancel, deps.runPromise);
11966
+ }))), (request) => mapActorRequest(request)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.cancel, deps.runPromise);
11923
11967
  }
11924
11968
  },
11925
11969
  inbox: {
11926
11970
  list: (options) => {
11927
11971
  const controls = deps.invocationControls?.(options) ?? options;
11928
- 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);
11972
+ 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);
11929
11973
  },
11930
11974
  approve: (input, options) => {
11931
11975
  const controls = deps.invocationControls?.(options) ?? options;
@@ -11937,14 +11981,14 @@ function makeActorRelationshipMethods(deps) {
11937
11981
  }))).pipe(Effect.flatMap((prepared) => {
11938
11982
  const result = mapApprovedInboxPayment(prepared, input);
11939
11983
  return result.ok ? Effect.succeed(result.value) : Effect.fail({ publicError: result.error });
11940
- })), controls, CAPXUL_OPERATIONS.inbox.approve, deps.runPromise);
11984
+ }), Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.approve, deps.runPromise);
11941
11985
  },
11942
11986
  decline: (requestId, options) => {
11943
11987
  const controls = deps.invocationControls?.(options) ?? options;
11944
11988
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.inbox.decline, Effect.suspend(() => convexCall.mutation(fns.inboxDecline, copyInvocationObservation(controls, {
11945
11989
  actor,
11946
11990
  paymentRequestId: requestId
11947
- }))), mapInboxItem), controls, CAPXUL_OPERATIONS.inbox.decline, deps.runPromise);
11991
+ }))), mapInboxItem).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.decline, deps.runPromise);
11948
11992
  }
11949
11993
  },
11950
11994
  profile: {
@@ -12800,7 +12844,7 @@ function subscribeActivity(deps, actor, controls, onChange) {
12800
12844
  }
12801
12845
  //#endregion
12802
12846
  //#region ../../packages/sdk/package.json
12803
- var version$1 = "4.2.0-rc.13";
12847
+ var version$1 = "4.2.0-rc.15";
12804
12848
  //#endregion
12805
12849
  //#region ../../packages/sdk/src/telemetry/exception-projection.ts
12806
12850
  /** Fixed fallback for failures that have no safe message. */
@@ -19888,11 +19932,11 @@ var ConvexOrganizationAdapter = class {
19888
19932
  return this.listMembers(input).pipe(Effect.map((members) => members.filter((member) => member.status === "pending" || member.status === "pending_safe" || member.status === "pending_grant")));
19889
19933
  }
19890
19934
  inviteMember(input) {
19891
- return this.#convex.action(this.#fns.inviteMember, {
19935
+ return this.#convex.action(this.#fns.inviteMember, copyInvocationObservation(input, {
19892
19936
  orgId: input.orgId,
19893
19937
  email: input.input.email,
19894
19938
  role: input.input.role
19895
- }).pipe(Effect.mapError((error) => orgErrorFromCapxul("inviteMember", error.publicError, error)), Effect.map(brandOrgMember), Effect.catchDefect((cause) => Effect.fail(toOrgError("inviteMember", cause))));
19939
+ })).pipe(Effect.mapError((error) => orgErrorFromCapxul("inviteMember", error.publicError, error)), Effect.map(brandOrgMember), Effect.catchDefect((cause) => Effect.fail(toOrgError("inviteMember", cause))));
19896
19940
  }
19897
19941
  resendInviteToken(input) {
19898
19942
  return this.#convex.mutation(this.#fns.resendInvite, {
@@ -45851,18 +45895,6 @@ function emitOrgCreateFailed(telemetry, error) {
45851
45895
  }
45852
45896
  });
45853
45897
  }
45854
- function emitOrgInviteSent(telemetry, input) {
45855
- const domain = emailDomain$1(input.email);
45856
- return emitOrgTelemetry(telemetry, {
45857
- name: "org_invite_sent",
45858
- props: {
45859
- org_id: input.orgId,
45860
- ...domain === void 0 ? {} : { email_domain: domain },
45861
- role: input.role,
45862
- status: input.status
45863
- }
45864
- });
45865
- }
45866
45898
  function reportOrgTelemetryFailure(kind, name, cause) {
45867
45899
  if (!isOrgTelemetryDebugEnabled()) return;
45868
45900
  globalThis.console?.warn?.("[capxul] org telemetry dropped", {
@@ -46038,25 +46070,26 @@ function listMembersProgram(orgId) {
46038
46070
  return [];
46039
46071
  });
46040
46072
  }
46073
+ /**
46074
+ * R06 (#1964): the SDK no longer emits `org_invite_sent`. The backend action
46075
+ * that writes the invitation is its ONE producer, so a hermetic call — which
46076
+ * writes nothing — can no longer report an invitation that never happened, and
46077
+ * a live call is counted once instead of twice. The captured attempt rides the
46078
+ * port input, so the durable event carries the correlation this call ran under.
46079
+ */
46041
46080
  function inviteMemberProgram(orgId, input) {
46042
46081
  return Effect.gen(function* () {
46043
46082
  const deps = yield* OrgDepsTag;
46044
- const member = deps.orgPort !== void 0 ? yield* deps.orgPort.inviteMember({
46045
- orgId,
46046
- input
46047
- }).pipe(Effect.mapError((error) => error.publicError)) : hermeticMember({
46083
+ if (deps.orgPort === void 0) return hermeticMember({
46048
46084
  orgId,
46049
46085
  email: input.email,
46050
46086
  role: input.role,
46051
46087
  status: "pending"
46052
46088
  });
46053
- yield* Effect.promise(() => emitOrgInviteSent(deps.telemetry, {
46089
+ return yield* deps.orgPort.inviteMember(copyInvocationObservation(deps.invocationSource, {
46054
46090
  orgId,
46055
- email: input.email,
46056
- role: member.role,
46057
- status: member.status
46058
- }));
46059
- return member;
46091
+ input
46092
+ })).pipe(Effect.mapError((error) => error.publicError));
46060
46093
  });
46061
46094
  }
46062
46095
  function detectAndAcceptPendingInvitationsProgram() {
@@ -46281,32 +46314,27 @@ function makeOrgMethods(deps) {
46281
46314
  });
46282
46315
  return treasury(orgId, deps.invocationControls?.(options) ?? options);
46283
46316
  },
46284
- account: { async get(options) {
46285
- if (options?.signal?.aborted) return {
46286
- ok: false,
46287
- error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.org.account.get })
46288
- };
46317
+ account: { get(options) {
46289
46318
  const controls = deps.invocationControls?.(options) ?? options;
46290
- const treasuryResult = await treasury(orgId, controls);
46291
- if (!treasuryResult.ok) return {
46292
- ok: false,
46293
- error: treasuryResult.error
46294
- };
46295
- const orgList = await listOrganizations(controls);
46296
- if (!orgList.ok) return {
46319
+ if (controls?.signal?.aborted) return Promise.resolve({
46297
46320
  ok: false,
46298
- error: orgList.error
46299
- };
46300
- const org = orgList.value.find((candidate) => candidate.id === orgId);
46301
- return {
46302
- ok: true,
46303
- value: {
46321
+ error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.org.account.get })
46322
+ });
46323
+ return runCapxulEffect(Effect.gen(function* () {
46324
+ const parent = yield* Effect.currentSpan.pipe(Effect.orDie);
46325
+ const captured = carryInvocationParentSpan(controls, parent);
46326
+ const treasuryResult = yield* Effect.promise(() => treasury(orgId, captured));
46327
+ if (!treasuryResult.ok) return yield* Effect.fail(treasuryResult.error);
46328
+ const orgList = yield* Effect.promise(() => listOrganizations(captured));
46329
+ if (!orgList.ok) return yield* Effect.fail(orgList.error);
46330
+ const org = orgList.value.find((candidate) => candidate.id === orgId);
46331
+ return {
46304
46332
  id: treasuryResult.value.id,
46305
46333
  address: org?.safeAddress ?? null,
46306
46334
  balance: treasuryResult.value.balance,
46307
46335
  available: treasuryResult.value.available
46308
- }
46309
- };
46336
+ };
46337
+ }), observationOnlyControls(controls), CAPXUL_OPERATIONS.org.account.get, deps.runPromise);
46310
46338
  } },
46311
46339
  members(_options) {
46312
46340
  if (_options?.signal?.aborted) return Promise.resolve({
@@ -46323,11 +46351,15 @@ function makeOrgMethods(deps) {
46323
46351
  return toCapxulResult(listRolesProgram(orgId), layer);
46324
46352
  },
46325
46353
  invite(_input, _options) {
46326
- if (_options?.signal?.aborted) return Promise.resolve({
46354
+ const controls = deps.invocationControls?.(_options) ?? _options;
46355
+ if (controls?.signal?.aborted) return Promise.resolve({
46327
46356
  ok: false,
46328
46357
  error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.org.invite })
46329
46358
  });
46330
- return toCapxulResult(inviteMemberProgram(orgId, _input), layer);
46359
+ return runCapxulEffect(inviteMemberProgram(orgId, _input).pipe(Effect.provide(orgDepsLayer({
46360
+ ...orgDeps,
46361
+ ...controls === void 0 ? {} : { invocationSource: controls }
46362
+ }))), controls, CAPXUL_OPERATIONS.org.invite, deps.runPromise);
46331
46363
  },
46332
46364
  auditLog(_options) {
46333
46365
  if (_options?.signal?.aborted) return Promise.resolve({
@@ -48993,7 +49025,7 @@ function stdioIdentity(env = process.env, options = {}) {
48993
49025
  }
48994
49026
  //#endregion
48995
49027
  //#region package.json
48996
- var version = "4.2.0-rc.13";
49028
+ var version = "4.2.0-rc.15";
48997
49029
  //#endregion
48998
49030
  //#region src/deps.ts
48999
49031
  const NO_IDENTITY = async () => void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/mcp",
3
- "version": "4.2.0-rc.13",
3
+ "version": "4.2.0-rc.15",
4
4
  "private": false,
5
5
  "description": "Capxul MCP server for auth, Account readiness, identity, Organizations, relationships, requests, destinations, and testnet funding over Streamable HTTP.",
6
6
  "keywords": [
@@ -51,7 +51,7 @@
51
51
  "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
52
52
  "vite-plus": "0.3.0",
53
53
  "@capxul/config": "0.3.0",
54
- "@capxul/sdk": "4.2.0-rc.13",
54
+ "@capxul/sdk": "4.2.0-rc.15",
55
55
  "@capxul/typescript-config": "0.0.0"
56
56
  },
57
57
  "scripts": {