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

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": "12a590f10914e8b056ce54732e6f484f36e060f3",
4
- "tree": "90adc6656be3c1fb0a6e18170877d46081fa2538",
3
+ "commit": "887920e1ba54e17bd8465975fcbc6e1537dfb6b8",
4
+ "tree": "deed16dc942ed9d6b587ceead4dbf8b0b4174e2c",
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.11"
10
+ "version": "4.2.0-rc.13"
11
11
  }
package/dist/main.mjs CHANGED
@@ -7149,6 +7149,8 @@ const CAPXUL_OPERATIONS = {
7149
7149
  recipient: { resolve: "recipient.resolve" },
7150
7150
  payroll: {
7151
7151
  authorizeRun: "payroll.authorizeRun",
7152
+ emitGroupChanged: "payroll.emitGroupChanged",
7153
+ emitRunTransitioned: "payroll.emitRunTransitioned",
7152
7154
  groups: {
7153
7155
  access: "payroll.groups",
7154
7156
  list: "payroll.groups.list",
@@ -8368,6 +8370,12 @@ Schema.Struct({
8368
8370
  "settled"
8369
8371
  ]),
8370
8372
  run_id: Schema.String,
8373
+ /**
8374
+ * The `paymentCommands` row at `payrollRuns.batchRef` — the durable owner of
8375
+ * this run's Payment membership. `payment_count` counts THAT command's
8376
+ * `paymentIds`, so an unrelated Payment quoting the run id changes neither.
8377
+ */
8378
+ command_id: OptionalString,
8371
8379
  payment_count: Schema.optional(Schema.Number),
8372
8380
  occurred_at: Schema.Number
8373
8381
  })
@@ -9636,6 +9644,13 @@ Schema.Struct({
9636
9644
  transfers: Schema.Array(TransferEvidenceSchema),
9637
9645
  requestCount: nonNegativeInteger("requestCount")
9638
9646
  });
9647
+ /**
9648
+ * `chainId:txHash:transactionLogOrdinal` — the indexer's own row id. The
9649
+ * ordinal is the position in the transaction's receipt logs, never the
9650
+ * block-global index that `eventLogIndex` carries.
9651
+ */
9652
+ const LOGICAL_EVENT_ID_RE = /^[1-9][0-9]{0,9}:0x[0-9a-f]{64}:(0|[1-9][0-9]{0,5})$/u;
9653
+ const LogicalEventIdSchema = Schema.String.pipe(Schema.refine((value) => LOGICAL_EVENT_ID_RE.test(value), { message: "must be chainId:txHash:transactionLogOrdinal" }));
9639
9654
  const VerifiedMoneyEvidenceCommonSchema = Schema.Struct({
9640
9655
  chainId: BaseSepoliaChainIdSchema,
9641
9656
  contractAddress: AddressSchema,
@@ -9644,7 +9659,17 @@ const VerifiedMoneyEvidenceCommonSchema = Schema.Struct({
9644
9659
  blockNumber: BlockNumberSchema,
9645
9660
  blockHash: Bytes32Schema,
9646
9661
  blockTimestamp: Uint48Schema,
9647
- eventLogIndex: LogIndexSchema
9662
+ /**
9663
+ * The block-global log index of the settled event, as
9664
+ * `eth_getTransactionReceipt` reports it. Both readers key on this value, and
9665
+ * the ledger de-duplicates a settlement on `(txHash, eventLogIndex)`.
9666
+ */
9667
+ eventLogIndex: LogIndexSchema,
9668
+ /**
9669
+ * The indexer row the fact was read from. Present only when the indexer
9670
+ * answered; the receipt-backed reader reads no row and sets nothing.
9671
+ */
9672
+ logicalEventId: Schema.optional(LogicalEventIdSchema)
9648
9673
  });
9649
9674
  const VerifiedPaymentEvidenceSchema = Schema.Struct({
9650
9675
  ...VerifiedMoneyEvidenceCommonSchema.fields,
@@ -12775,7 +12800,7 @@ function subscribeActivity(deps, actor, controls, onChange) {
12775
12800
  }
12776
12801
  //#endregion
12777
12802
  //#region ../../packages/sdk/package.json
12778
- var version$1 = "4.2.0-rc.11";
12803
+ var version$1 = "4.2.0-rc.13";
12779
12804
  //#endregion
12780
12805
  //#region ../../packages/sdk/src/telemetry/exception-projection.ts
12781
12806
  /** Fixed fallback for failures that have no safe message. */
@@ -14028,10 +14053,12 @@ function makeFinancialOpsMethods(deps) {
14028
14053
  return runPortEffect(Effect.suspend(() => deps.convexCall.query(fns.depositInstructions, copyInvocationObservation(controls, {}))).pipe(Effect.tap((instructions) => emitDepositInitiated(deps.telemetry, instructions, controls))), controls, CAPXUL_OPERATIONS.me.depositInstructions, deps.runPromise);
14029
14054
  }
14030
14055
  },
14031
- targets: { resolve: async (reference, options) => {
14032
- const recipient = normalizeTargetForBackend(reference, "reference");
14033
- if (!recipient.ok) return recipient;
14034
- return mapOk(await runIfActive(options?.signal, CAPXUL_OPERATIONS.recipient.resolve, () => deps.convexCall.query(fns.resolveRecipient, { recipient: recipient.value })), resolvedTargetFromResolution);
14056
+ targets: { resolve: (reference, options) => {
14057
+ const controls = deps.invocationControls?.(options) ?? options;
14058
+ return runPortEffect(projectReply(Effect.suspend(() => {
14059
+ const recipient = normalizeTargetForBackend(reference, "reference");
14060
+ return recipient.ok ? deps.convexCall.query(fns.resolveRecipient, copyInvocationObservation(controls, { recipient: recipient.value })) : Effect.fail({ publicError: recipient.error });
14061
+ }), resolvedTargetFromResolution), controls, CAPXUL_OPERATIONS.recipient.resolve, deps.runPromise);
14035
14062
  } },
14036
14063
  destinations: {
14037
14064
  add: (input, options) => {
@@ -14094,8 +14121,14 @@ function makeFinancialOpsMethods(deps) {
14094
14121
  kind: "claim",
14095
14122
  paymentId
14096
14123
  }, deps.invocationControls?.(options) ?? options, CAPXUL_OPERATIONS.payments.claim),
14097
- list: async (options) => mapOk(await runIfActive(options?.signal, CAPXUL_OPERATIONS.payments.list, () => deps.convexCall.query(fns.listPayments, {})), (payments) => payments.map(normalizePaymentTiming)),
14098
- get: async (paymentId, options) => mapOk(await runIfActive(options?.signal, CAPXUL_OPERATIONS.payments.get, () => deps.convexCall.query(fns.getPayment, { paymentId })), (payment) => payment === null ? null : normalizePaymentTiming(payment)),
14124
+ list: (options) => {
14125
+ const controls = deps.invocationControls?.(options) ?? options;
14126
+ return runPortEffect(projectReply(Effect.suspend(() => deps.convexCall.query(fns.listPayments, copyInvocationObservation(controls, {}))), (payments) => payments.map(normalizePaymentTiming)), controls, CAPXUL_OPERATIONS.payments.list, deps.runPromise);
14127
+ },
14128
+ get: (paymentId, options) => {
14129
+ const controls = deps.invocationControls?.(options) ?? options;
14130
+ return runPortEffect(projectReply(Effect.suspend(() => deps.convexCall.query(fns.getPayment, copyInvocationObservation(controls, { paymentId }))), (payment) => payment === null ? null : normalizePaymentTiming(payment)), controls, CAPXUL_OPERATIONS.payments.get, deps.runPromise);
14131
+ },
14099
14132
  cancel: (paymentId, options) => runLifecycle({
14100
14133
  kind: "cancel",
14101
14134
  paymentId
@@ -14463,6 +14496,22 @@ function normalizePaymentTiming(payment) {
14463
14496
  timing: payment.timing ?? payment.release ?? { kind: "instant" }
14464
14497
  };
14465
14498
  }
14499
+ /**
14500
+ * `mapOk`, moved inside the observed Effect (R09 #1967).
14501
+ *
14502
+ * The projection can refuse — `toAddress` and `toPartyId` throw on a malformed
14503
+ * reply — and every verb on this surface returns a `CapxulResult`, so that
14504
+ * throw stays a value here (ADR-0023). The error identity is `mapOk`'s: a
14505
+ * `CapxulError` passes through, anything else becomes `Errors.unknown(cause)`.
14506
+ * Running it inside the runner is what puts the decode failure on the same
14507
+ * operation record as the read that produced the reply.
14508
+ */
14509
+ function projectReply(program, project) {
14510
+ return program.pipe(Effect.flatMap((value) => Effect.try({
14511
+ try: () => project(value),
14512
+ catch: (cause) => ({ publicError: cause instanceof CapxulError ? cause : Errors.unknown(cause) })
14513
+ })));
14514
+ }
14466
14515
  function mapOk(result, f) {
14467
14516
  if (!result.ok) return result;
14468
14517
  try {
@@ -19113,6 +19162,8 @@ const OBSERVED_CONVEX_QUERIES = /* @__PURE__ */ new Set([
19113
19162
  "movement/activity:summary",
19114
19163
  "movement/activity:get",
19115
19164
  "financialOps/queries:depositInstructions",
19165
+ "financialOps/queries:listPayments",
19166
+ "financialOps/queries:getPayment",
19116
19167
  "financialOps/destinations:list",
19117
19168
  "financialOps/queries:verifyPaymentDocument",
19118
19169
  "financialOps/queries:renderStoredDocument",
@@ -47213,6 +47264,7 @@ function identity(row) {
47213
47264
  chainId: toChainId(integer(row, "chain_id")),
47214
47265
  txHash: toTxHash(hex(row, "tx_hash")),
47215
47266
  transactionLogOrdinal: integer(row, "transaction_log_ordinal"),
47267
+ logIndex: integer(row, "log_index"),
47216
47268
  blockNumber: big(row, "block_number"),
47217
47269
  blockHash: hex(row, "block_hash"),
47218
47270
  timestamp: big(row, "timestamp")
@@ -47295,8 +47347,8 @@ function decodeStatus(body) {
47295
47347
  * that allowlist changes, this file changes with it or every read fails 403.
47296
47348
  */
47297
47349
  const HEADS = {
47298
- transfer: "select \"id\", \"chain_id\", \"tx_hash\", \"transaction_log_ordinal\", \"block_number\", \"block_hash\", \"timestamp\", \"asset_id\", \"token\", \"from\", \"to\", \"amount\" from \"transfer\" where (\"transfer\".\"from\" = $1 or \"transfer\".\"to\" = $2) order by \"transfer\".\"block_number\" desc, \"transfer\".\"id\" desc",
47299
- payment: "select \"id\", \"chain_id\", \"tx_hash\", \"transaction_log_ordinal\", \"block_number\", \"block_hash\", \"timestamp\", \"contract\", \"settlement_id\", \"sender\", \"recipient\", \"asset_id\", \"token\", \"amount\", \"kind\", \"document_hash\" from \"payment\" where (\"payment\".\"sender\" = $1 or \"payment\".\"recipient\" = $2) order by \"payment\".\"block_number\" desc, \"payment\".\"id\" desc",
47350
+ transfer: "select \"id\", \"chain_id\", \"tx_hash\", \"transaction_log_ordinal\", \"log_index\", \"block_number\", \"block_hash\", \"timestamp\", \"asset_id\", \"token\", \"from\", \"to\", \"amount\" from \"transfer\" where (\"transfer\".\"from\" = $1 or \"transfer\".\"to\" = $2) order by \"transfer\".\"block_number\" desc, \"transfer\".\"id\" desc",
47351
+ payment: "select \"id\", \"chain_id\", \"tx_hash\", \"transaction_log_ordinal\", \"log_index\", \"block_number\", \"block_hash\", \"timestamp\", \"contract\", \"settlement_id\", \"sender\", \"recipient\", \"asset_id\", \"token\", \"amount\", \"kind\", \"document_hash\" from \"payment\" where (\"payment\".\"sender\" = $1 or \"payment\".\"recipient\" = $2) order by \"payment\".\"block_number\" desc, \"payment\".\"id\" desc",
47300
47352
  balance: "select \"chain_id\", \"asset_id\", \"to\", \"amount\" from \"balance\" where \"balance\".\"to\" = $1"
47301
47353
  };
47302
47354
  /** How many times the statement binds the Safe address. */
@@ -48941,7 +48993,7 @@ function stdioIdentity(env = process.env, options = {}) {
48941
48993
  }
48942
48994
  //#endregion
48943
48995
  //#region package.json
48944
- var version = "4.2.0-rc.11";
48996
+ var version = "4.2.0-rc.13";
48945
48997
  //#endregion
48946
48998
  //#region src/deps.ts
48947
48999
  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.11",
3
+ "version": "4.2.0-rc.13",
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/typescript-config": "0.0.0",
55
- "@capxul/sdk": "4.2.0-rc.11"
54
+ "@capxul/sdk": "4.2.0-rc.13",
55
+ "@capxul/typescript-config": "0.0.0"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "vp exec tsx src/main.ts serve",