@capxul/mcp 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/mcp",
10
- "version": "4.2.0-rc.13"
10
+ "version": "4.2.0-rc.14"
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",
@@ -7850,6 +7854,26 @@ const MovementScanIncidentProps = Schema.Struct({
7850
7854
  incident_kind: Schema.String,
7851
7855
  anchor_block_number: Schema.Number
7852
7856
  });
7857
+ /**
7858
+ * One durable row the reconciliation job corrected against Ponder (SPEC D9).
7859
+ *
7860
+ * Both block fields are optional and for the same reason: a correction INTO
7861
+ * drift (a Payment settled in Convex whose Ponder fact a reorg removed) has no
7862
+ * current block, and a correction that confirms a later fact has one.
7863
+ *
7864
+ * `projection_kind` is closed. A later ticket that reconciles a deploy, a
7865
+ * bootstrap or a grant outcome adds its kind here in the same change; an
7866
+ * unknown kind must not decode.
7867
+ */
7868
+ const IndexerDriftCorrectedProps = Schema.Struct({
7869
+ ...TelemetryEnvelopeProps,
7870
+ projection_kind: Schema.Literals(["member_authority", "payment_settlement"]),
7871
+ previous_state: Schema.String,
7872
+ current_state: Schema.String,
7873
+ previous_block: Schema.optional(Schema.Number),
7874
+ current_block: Schema.optional(Schema.Number),
7875
+ logical_event_id: Schema.optional(Schema.String)
7876
+ });
7853
7877
  Schema.Struct({
7854
7878
  name: Schema.Literal("auth_otp_requested"),
7855
7879
  props: AuthOtpRequestedProps
@@ -8054,6 +8078,10 @@ Schema.Struct({
8054
8078
  name: Schema.Literal("movement_scan_incident"),
8055
8079
  props: MovementScanIncidentProps
8056
8080
  });
8081
+ Schema.Struct({
8082
+ name: Schema.Literal("indexer_drift_corrected"),
8083
+ props: IndexerDriftCorrectedProps
8084
+ });
8057
8085
  /** The one spelling of "whose scope did this happen in" across every surface. */
8058
8086
  const ScopeKindSchema = Schema.Literals(["account", "organization"]);
8059
8087
  const AccountKindSchema = Schema.Literals(["personalSafe", "orgTreasury"]);
@@ -11901,31 +11929,31 @@ function makeActorRelationshipMethods(deps) {
11901
11929
  reference: input.reference,
11902
11930
  ...input.memo === void 0 ? {} : { memo: input.memo },
11903
11931
  ...input.expiresAt === void 0 ? {} : { expiresAt: input.expiresAt }
11904
- }))), (request) => mapActorRequest(request, input.payer)), controls, CAPXUL_OPERATIONS.requests.issue, deps.runPromise);
11932
+ }))), (request) => mapActorRequest(request, input.payer)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.issue, deps.runPromise);
11905
11933
  },
11906
11934
  list: (options) => {
11907
11935
  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);
11936
+ 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
11937
  },
11910
11938
  get: (requestId, options) => {
11911
11939
  const controls = deps.invocationControls?.(options) ?? options;
11912
11940
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.get, Effect.suspend(() => convexCall.query(fns.requestsGet, copyInvocationObservation(controls, {
11913
11941
  actor,
11914
11942
  paymentRequestId: requestId
11915
- }))), (request) => request === null ? null : mapActorRequest(request)), controls, CAPXUL_OPERATIONS.requests.get, deps.runPromise);
11943
+ }))), (request) => request === null ? null : mapActorRequest(request)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.get, deps.runPromise);
11916
11944
  },
11917
11945
  cancel: (requestId, options) => {
11918
11946
  const controls = deps.invocationControls?.(options) ?? options;
11919
11947
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.requests.cancel, Effect.suspend(() => convexCall.mutation(fns.requestsCancel, copyInvocationObservation(controls, {
11920
11948
  actor,
11921
11949
  paymentRequestId: requestId
11922
- }))), (request) => mapActorRequest(request)), controls, CAPXUL_OPERATIONS.requests.cancel, deps.runPromise);
11950
+ }))), (request) => mapActorRequest(request)).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.requests.cancel, deps.runPromise);
11923
11951
  }
11924
11952
  },
11925
11953
  inbox: {
11926
11954
  list: (options) => {
11927
11955
  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);
11956
+ 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
11957
  },
11930
11958
  approve: (input, options) => {
11931
11959
  const controls = deps.invocationControls?.(options) ?? options;
@@ -11937,14 +11965,14 @@ function makeActorRelationshipMethods(deps) {
11937
11965
  }))).pipe(Effect.flatMap((prepared) => {
11938
11966
  const result = mapApprovedInboxPayment(prepared, input);
11939
11967
  return result.ok ? Effect.succeed(result.value) : Effect.fail({ publicError: result.error });
11940
- })), controls, CAPXUL_OPERATIONS.inbox.approve, deps.runPromise);
11968
+ }), Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.approve, deps.runPromise);
11941
11969
  },
11942
11970
  decline: (requestId, options) => {
11943
11971
  const controls = deps.invocationControls?.(options) ?? options;
11944
11972
  return runPortEffect(mapReply(CAPXUL_OPERATIONS.inbox.decline, Effect.suspend(() => convexCall.mutation(fns.inboxDecline, copyInvocationObservation(controls, {
11945
11973
  actor,
11946
11974
  paymentRequestId: requestId
11947
- }))), mapInboxItem), controls, CAPXUL_OPERATIONS.inbox.decline, deps.runPromise);
11975
+ }))), mapInboxItem).pipe(Effect.tap(() => observeContactScope)), controls, CAPXUL_OPERATIONS.inbox.decline, deps.runPromise);
11948
11976
  }
11949
11977
  },
11950
11978
  profile: {
@@ -12800,7 +12828,7 @@ function subscribeActivity(deps, actor, controls, onChange) {
12800
12828
  }
12801
12829
  //#endregion
12802
12830
  //#region ../../packages/sdk/package.json
12803
- var version$1 = "4.2.0-rc.13";
12831
+ var version$1 = "4.2.0-rc.14";
12804
12832
  //#endregion
12805
12833
  //#region ../../packages/sdk/src/telemetry/exception-projection.ts
12806
12834
  /** Fixed fallback for failures that have no safe message. */
@@ -19888,11 +19916,11 @@ var ConvexOrganizationAdapter = class {
19888
19916
  return this.listMembers(input).pipe(Effect.map((members) => members.filter((member) => member.status === "pending" || member.status === "pending_safe" || member.status === "pending_grant")));
19889
19917
  }
19890
19918
  inviteMember(input) {
19891
- return this.#convex.action(this.#fns.inviteMember, {
19919
+ return this.#convex.action(this.#fns.inviteMember, copyInvocationObservation(input, {
19892
19920
  orgId: input.orgId,
19893
19921
  email: input.input.email,
19894
19922
  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))));
19923
+ })).pipe(Effect.mapError((error) => orgErrorFromCapxul("inviteMember", error.publicError, error)), Effect.map(brandOrgMember), Effect.catchDefect((cause) => Effect.fail(toOrgError("inviteMember", cause))));
19896
19924
  }
19897
19925
  resendInviteToken(input) {
19898
19926
  return this.#convex.mutation(this.#fns.resendInvite, {
@@ -45851,18 +45879,6 @@ function emitOrgCreateFailed(telemetry, error) {
45851
45879
  }
45852
45880
  });
45853
45881
  }
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
45882
  function reportOrgTelemetryFailure(kind, name, cause) {
45867
45883
  if (!isOrgTelemetryDebugEnabled()) return;
45868
45884
  globalThis.console?.warn?.("[capxul] org telemetry dropped", {
@@ -46038,25 +46054,26 @@ function listMembersProgram(orgId) {
46038
46054
  return [];
46039
46055
  });
46040
46056
  }
46057
+ /**
46058
+ * R06 (#1964): the SDK no longer emits `org_invite_sent`. The backend action
46059
+ * that writes the invitation is its ONE producer, so a hermetic call — which
46060
+ * writes nothing — can no longer report an invitation that never happened, and
46061
+ * a live call is counted once instead of twice. The captured attempt rides the
46062
+ * port input, so the durable event carries the correlation this call ran under.
46063
+ */
46041
46064
  function inviteMemberProgram(orgId, input) {
46042
46065
  return Effect.gen(function* () {
46043
46066
  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({
46067
+ if (deps.orgPort === void 0) return hermeticMember({
46048
46068
  orgId,
46049
46069
  email: input.email,
46050
46070
  role: input.role,
46051
46071
  status: "pending"
46052
46072
  });
46053
- yield* Effect.promise(() => emitOrgInviteSent(deps.telemetry, {
46073
+ return yield* deps.orgPort.inviteMember(copyInvocationObservation(deps.invocationSource, {
46054
46074
  orgId,
46055
- email: input.email,
46056
- role: member.role,
46057
- status: member.status
46058
- }));
46059
- return member;
46075
+ input
46076
+ })).pipe(Effect.mapError((error) => error.publicError));
46060
46077
  });
46061
46078
  }
46062
46079
  function detectAndAcceptPendingInvitationsProgram() {
@@ -46323,11 +46340,15 @@ function makeOrgMethods(deps) {
46323
46340
  return toCapxulResult(listRolesProgram(orgId), layer);
46324
46341
  },
46325
46342
  invite(_input, _options) {
46326
- if (_options?.signal?.aborted) return Promise.resolve({
46343
+ const controls = deps.invocationControls?.(_options) ?? _options;
46344
+ if (controls?.signal?.aborted) return Promise.resolve({
46327
46345
  ok: false,
46328
46346
  error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.org.invite })
46329
46347
  });
46330
- return toCapxulResult(inviteMemberProgram(orgId, _input), layer);
46348
+ return runCapxulEffect(inviteMemberProgram(orgId, _input).pipe(Effect.provide(orgDepsLayer({
46349
+ ...orgDeps,
46350
+ ...controls === void 0 ? {} : { invocationSource: controls }
46351
+ }))), controls, CAPXUL_OPERATIONS.org.invite, deps.runPromise);
46331
46352
  },
46332
46353
  auditLog(_options) {
46333
46354
  if (_options?.signal?.aborted) return Promise.resolve({
@@ -48993,7 +49014,7 @@ function stdioIdentity(env = process.env, options = {}) {
48993
49014
  }
48994
49015
  //#endregion
48995
49016
  //#region package.json
48996
- var version = "4.2.0-rc.13";
49017
+ var version = "4.2.0-rc.14";
48997
49018
  //#endregion
48998
49019
  //#region src/deps.ts
48999
49020
  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.14",
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,8 +51,8 @@
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",
55
- "@capxul/typescript-config": "0.0.0"
54
+ "@capxul/typescript-config": "0.0.0",
55
+ "@capxul/sdk": "4.2.0-rc.14"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "vp exec tsx src/main.ts serve",