@capxul/mcp 1.0.0-alpha.1 → 1.0.0-alpha.11

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.
@@ -747,6 +747,43 @@ function buildCapxulPaymentsSendCalls(input) {
747
747
  value: 0n
748
748
  }];
749
749
  }
750
+ function buildCapxulCreateCommitmentCalls(input) {
751
+ const tokenAddress = normalizeAddress(input.tokenAddress, "tokenAddress");
752
+ const recipientAddress = normalizeAddress(input.recipientAddress, "recipientAddress");
753
+ const totalAmount = normalizePositiveAmount(input.totalAmount, "totalAmount");
754
+ const startTime = normalizeUint48(input.startTime, "startTime");
755
+ const cliffTime = normalizeUint48(input.cliffTime, "cliffTime");
756
+ const endTime = normalizeUint48(input.endTime, "endTime");
757
+ if (startTime > endTime || cliffTime < startTime || cliffTime > endTime) throw new RangeError("commitment times must satisfy start <= cliff <= end");
758
+ const documentHash = normalizeBytes32(input.documentHash ?? `0x${"0".repeat(64)}`, "documentHash");
759
+ const paymentType = normalizeUint8(input.paymentType ?? 0, "paymentType");
760
+ return [{
761
+ to: tokenAddress,
762
+ data: encodeFunctionData({
763
+ abi: ERC20_APPROVE_ABI,
764
+ functionName: "approve",
765
+ args: [CAPXUL_PAYMENTS_ADDRESS, totalAmount]
766
+ }),
767
+ value: 0n
768
+ }, {
769
+ to: CAPXUL_PAYMENTS_ADDRESS,
770
+ data: encodeFunctionData({
771
+ abi: CAPXUL_PAYMENTS_COMMITMENT_ABI,
772
+ functionName: "createCommitment",
773
+ args: [
774
+ tokenAddress,
775
+ recipientAddress,
776
+ totalAmount,
777
+ startTime,
778
+ cliffTime,
779
+ endTime,
780
+ documentHash,
781
+ paymentType
782
+ ]
783
+ }),
784
+ value: 0n
785
+ }];
786
+ }
750
787
  /**
751
788
  * Wrap an org Roles `execTransactionWithRole` call (from `*RoleSpendCall` /
752
789
  * `*RoleBatchSpendCall`) into the member Safe's `executeUserOpWithErrorString`
@@ -793,10 +830,12 @@ function buildOrgPersonalMultiCallData(calls) {
793
830
  }
794
831
  /**
795
832
  * Encode an org PAYROLL BATCH (G4 · #547): one `execTransactionWithRole`
796
- * (the member's role key) → MultiSendCallOnly → N × (approve + CapxulPayments.send),
797
- * one send per employee. Each send keeps its own recipient + amount, so each is
798
- * bounded independently by the role's on-chain Zodiac conditions (per-tx cap,
799
- * per-day allowance, allowed recipient). One sponsored UserOp settles the batch.
833
+ * (the member's role key) → MultiSendCallOnly → N × (approve + CapxulPayments
834
+ * settlement call), one call per employee. Instant lines use `send`; scheduled
835
+ * and stream salary lines use `createCommitment`. Each line keeps its own
836
+ * recipient + amount, so each is bounded independently by the role's on-chain
837
+ * Zodiac conditions (per-tx cap, per-day allowance, allowed recipient). One
838
+ * sponsored UserOp settles the batch.
800
839
  */
801
840
  function buildCapxulPaymentsRoleBatchSpendCall(input) {
802
841
  if (input.runs.length === 0) throw new RangeError("payroll batch must include at least one run");
@@ -805,13 +844,25 @@ function buildCapxulPaymentsRoleBatchSpendCall(input) {
805
844
  const multiSendData = encodeFunctionData({
806
845
  abi: MULTI_SEND_CALL_ONLY_ABI,
807
846
  functionName: "multiSend",
808
- args: [concat(input.runs.flatMap((run) => [...buildCapxulPaymentsSendCalls({
809
- tokenAddress: input.tokenAddress,
810
- recipientAddress: run.recipientAddress,
811
- amount: run.amount,
812
- paymentType,
813
- ...run.documentHash === void 0 ? {} : { documentHash: run.documentHash }
814
- })]).map(encodeMultiSendCallTransaction))]
847
+ args: [concat(input.runs.flatMap((run) => {
848
+ if (run.timing !== void 0) return [...buildCapxulCreateCommitmentCalls({
849
+ tokenAddress: input.tokenAddress,
850
+ recipientAddress: run.recipientAddress,
851
+ totalAmount: run.amount,
852
+ startTime: run.timing.startTime,
853
+ cliffTime: run.timing.cliffTime,
854
+ endTime: run.timing.endTime,
855
+ paymentType,
856
+ ...run.documentHash === void 0 ? {} : { documentHash: run.documentHash }
857
+ })];
858
+ return [...buildCapxulPaymentsSendCalls({
859
+ tokenAddress: input.tokenAddress,
860
+ recipientAddress: run.recipientAddress,
861
+ amount: run.amount,
862
+ paymentType,
863
+ ...run.documentHash === void 0 ? {} : { documentHash: run.documentHash }
864
+ })];
865
+ }).map(encodeMultiSendCallTransaction))]
815
866
  });
816
867
  return {
817
868
  to: normalizeAddress(input.rolesModuleAddress, "rolesModuleAddress"),
@@ -0,0 +1,2 @@
1
+ import { b as CAPXUL_PAYMENTS_ADDRESS } from "./src-BDIKpZXn.mjs";
2
+ export { CAPXUL_PAYMENTS_ADDRESS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/mcp",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.11",
4
4
  "private": false,
5
5
  "description": "Capxul MCP server — agent-facing financial-ops tools (auth, account readiness, balances, testnet faucet, payments) exposed over Streamable HTTP with OAuth bearer auth and a dev-mode custody gate.",
6
6
  "keywords": [
@@ -30,25 +30,12 @@
30
30
  "README.md"
31
31
  ],
32
32
  "bin": {
33
- "capxul-mcp": "./bin/capxul-mcp"
33
+ "capxul-mcp": "./dist/main.mjs"
34
34
  },
35
35
  "type": "module",
36
36
  "publishConfig": {
37
- "bin": {
38
- "capxul-mcp": "./dist/main.mjs"
39
- },
40
37
  "access": "public"
41
38
  },
42
- "scripts": {
43
- "dev": "vp exec tsx src/main.ts serve",
44
- "check-types": "vp exec tsc -p tsconfig.json --noEmit",
45
- "lint": "vp exec oxlint -- -c ../../.oxlintrc.json . --deny-warnings",
46
- "build": "NODE_OPTIONS=--max-old-space-size=12288 vp pack",
47
- "prepublishOnly": "NODE_OPTIONS=--max-old-space-size=12288 vp pack",
48
- "proofs:live": "vp exec tsx scripts/proof-live.ts",
49
- "_vp-tasks-allowed": "vp-allowed: `test` + `test:coverage` are defined as cache-augmented tasks in vite.config.ts so vitest's self-writes don't bust input fingerprinting (#205).",
50
- "grade": "vp exec tsx scripts/grade-run.ts"
51
- },
52
39
  "dependencies": {
53
40
  "@effect/experimental": "^0.60.0",
54
41
  "@effect/schema": "^0.75.5",
@@ -56,21 +43,30 @@
56
43
  "@openfort/openfort-js": "^1.3.6",
57
44
  "convex": "^1.39.1",
58
45
  "effect": "^3.21.2",
59
- "viem": "^2.21.49",
46
+ "viem": "^2.53.1",
60
47
  "zod": "^3.25.0"
61
48
  },
62
49
  "devDependencies": {
63
- "@capxul/backend": "workspace:*",
64
- "@capxul/config": "workspace:*",
65
- "@capxul/sdk": "workspace:*",
66
- "@capxul/types": "workspace:*",
67
- "@capxul/wire": "workspace:*",
68
- "@capxul/errors": "workspace:*",
69
- "@capxul/observability": "workspace:*",
70
50
  "@types/node": "^22.15.3",
71
51
  "tsx": "^4.19.0",
72
- "typescript": "catalog:",
73
- "vite": "catalog:",
74
- "vite-plus": "catalog:"
52
+ "typescript": "5.9.2",
53
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.23",
54
+ "vite-plus": "0.1.23",
55
+ "@capxul/backend": "0.1.0-alpha.1",
56
+ "@capxul/config": "0.1.0-alpha.1",
57
+ "@capxul/sdk": "1.0.0-alpha.11",
58
+ "@capxul/types": "0.1.0-alpha.0",
59
+ "@capxul/wire": "0.1.0-alpha.1",
60
+ "@capxul/errors": "0.0.0",
61
+ "@capxul/observability": "0.1.0-alpha.0"
62
+ },
63
+ "scripts": {
64
+ "dev": "vp exec tsx src/main.ts serve",
65
+ "check-types": "vp exec tsc -p tsconfig.json --noEmit",
66
+ "lint": "vp lint --deny-warnings",
67
+ "build": "NODE_OPTIONS=--max-old-space-size=12288 vp pack",
68
+ "proofs:live": "vp exec tsx scripts/proof-live.ts",
69
+ "_vp-tasks-allowed": "vp-allowed: `test` + `test:coverage` are defined as cache-augmented tasks in vite.config.ts so vitest's self-writes don't bust input fingerprinting (#205).",
70
+ "grade": "vp exec tsx scripts/grade-run.ts"
75
71
  }
76
- }
72
+ }
package/bin/capxul-mcp DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- cd "$(dirname "$0")/.."
5
- if [[ "${1:-}" == "serve" ]]; then
6
- exec vp exec tsx src/main.ts "$@"
7
- fi
8
- exec vp exec tsx src/main.ts serve "$@"
@@ -1,2 +0,0 @@
1
- import { r as fetchCommitmentCreatedLog } from "./alchemy-rpc-DEpqt2Jx.mjs";
2
- export { fetchCommitmentCreatedLog };
@@ -1,2 +0,0 @@
1
- import { b as CAPXUL_PAYMENTS_ADDRESS } from "./src-CJVATdCb.mjs";
2
- export { CAPXUL_PAYMENTS_ADDRESS };