@capxul/mcp 2.3.0 → 2.3.2
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.
- package/dist/main.mjs +13 -120
- package/package.json +3 -3
package/dist/main.mjs
CHANGED
|
@@ -240,7 +240,7 @@ function normalizeEmail(email) {
|
|
|
240
240
|
}
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region package.json
|
|
243
|
-
var version$2 = "2.3.
|
|
243
|
+
var version$2 = "2.3.2";
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region ../../packages/errors/src/errors.ts
|
|
246
246
|
const CAPXUL_ERROR_CODES = [
|
|
@@ -3047,8 +3047,8 @@ const nonEmpty = (name) => Schema.String.pipe(Schema.refine((value) => value.len
|
|
|
3047
3047
|
const nonNegativeInteger = (name) => Schema.Number.pipe(Schema.refine((value) => Number.isSafeInteger(value) && value >= 0, { message: `${name} must be a non-negative safe integer` }));
|
|
3048
3048
|
const BaseSepoliaChainIdSchema = ChainIdSchema$1.pipe(Schema.refine((value) => value === 84532, { message: "chainId must be 84532" }));
|
|
3049
3049
|
const Uint16Schema = Schema.Number.pipe(Schema.refine((value) => Number.isSafeInteger(value) && value >= 0 && value <= 65535, { message: "kind must be a uint16 value" }));
|
|
3050
|
-
|
|
3051
|
-
|
|
3050
|
+
Schema.Number.pipe(Schema.refine((value) => Number.isSafeInteger(value) && value >= 0 && value <= 255, { message: "must be a uint8 value" }));
|
|
3051
|
+
Schema.String.pipe(Schema.refine((value) => /^0x[0-9a-fA-F]{8}$/u.test(value), { message: "must be a 0x-prefixed bytes4 value" }));
|
|
3052
3052
|
const HexDataSchema = Schema.String.pipe(Schema.refine((value) => /^0x(?:[0-9a-fA-F]{2})*$/u.test(value), { message: "must be 0x-prefixed byte data" }));
|
|
3053
3053
|
const Uint48Schema = Schema.Number.pipe(Schema.refine((value) => Number.isSafeInteger(value) && value >= 0 && value <= 0xffffffffffff, { message: "must be a uint48 value" }));
|
|
3054
3054
|
const Uint256StringSchema = Schema.String.pipe(Schema.refine((value) => {
|
|
@@ -3191,8 +3191,7 @@ const PermissionStateSchema = Schema.Literals([
|
|
|
3191
3191
|
"active",
|
|
3192
3192
|
"suspended",
|
|
3193
3193
|
"revoked",
|
|
3194
|
-
"superseded"
|
|
3195
|
-
"quarantined"
|
|
3194
|
+
"superseded"
|
|
3196
3195
|
]);
|
|
3197
3196
|
const StoredPermissionCommandSchema = Schema.Struct({
|
|
3198
3197
|
commandId: PaymentCommandIdSchema,
|
|
@@ -3216,8 +3215,7 @@ Schema.Struct({
|
|
|
3216
3215
|
Schema.Union([
|
|
3217
3216
|
Schema.Struct({
|
|
3218
3217
|
status: Schema.Literal("pending"),
|
|
3219
|
-
reason: Schema.
|
|
3220
|
-
receipt: Schema.optional(ReceiptRefSchema)
|
|
3218
|
+
reason: Schema.Literal("receipt_missing")
|
|
3221
3219
|
}),
|
|
3222
3220
|
Schema.Struct({
|
|
3223
3221
|
status: Schema.Literal("verified"),
|
|
@@ -3486,112 +3484,6 @@ Schema.Struct({
|
|
|
3486
3484
|
transfers: Schema.Array(FinalizedTransferEvidenceSchema),
|
|
3487
3485
|
requestCount: nonNegativeInteger("requestCount")
|
|
3488
3486
|
});
|
|
3489
|
-
const FinalizedPermissionFactRangeSchema = Schema.Struct({
|
|
3490
|
-
chainId: BaseSepoliaChainIdSchema,
|
|
3491
|
-
organizationSafe: SafeAddressSchema,
|
|
3492
|
-
rolesModules: Schema.Array(ModuleAddressSchema),
|
|
3493
|
-
fromBlock: BlockNumberSchema$1,
|
|
3494
|
-
toBlock: BlockNumberSchema$1
|
|
3495
|
-
}).pipe(Schema.refine((range) => range.toBlock >= range.fromBlock && range.toBlock - range.fromBlock < 1e4, { message: "toBlock must be at or after fromBlock and the range must contain fewer than 10,000 block intervals" }));
|
|
3496
|
-
const FinalizedPermissionFactCommonSchema = Schema.Struct({
|
|
3497
|
-
chainId: BaseSepoliaChainIdSchema,
|
|
3498
|
-
transactionHash: TxHashSchema$1,
|
|
3499
|
-
blockNumber: BlockNumberSchema$1,
|
|
3500
|
-
blockHash: Bytes32Schema,
|
|
3501
|
-
logIndex: LogIndexSchema,
|
|
3502
|
-
emitter: AddressSchema$1,
|
|
3503
|
-
topic0: Bytes32Schema,
|
|
3504
|
-
dataHash: Bytes32Schema,
|
|
3505
|
-
authorityHash: Bytes32Schema
|
|
3506
|
-
});
|
|
3507
|
-
const FinalizedPermissionModuleFactSchema = Schema.Struct({
|
|
3508
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3509
|
-
kind: Schema.Literals(["module_enabled", "module_disabled"]),
|
|
3510
|
-
organizationSafe: SafeAddressSchema,
|
|
3511
|
-
module: ModuleAddressSchema
|
|
3512
|
-
});
|
|
3513
|
-
const FinalizedPermissionRoleAssignmentFactSchema = Schema.Struct({
|
|
3514
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3515
|
-
kind: Schema.Literal("assignment"),
|
|
3516
|
-
rolesModule: ModuleAddressSchema,
|
|
3517
|
-
memberSafe: SafeAddressSchema,
|
|
3518
|
-
roleKeys: Schema.Array(RoleKeySchema),
|
|
3519
|
-
memberOf: Schema.Array(Schema.Boolean)
|
|
3520
|
-
});
|
|
3521
|
-
const FinalizedPermissionTargetAuthorityFactSchema = Schema.Union([Schema.Struct({
|
|
3522
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3523
|
-
kind: Schema.Literal("allow_target"),
|
|
3524
|
-
rolesModule: ModuleAddressSchema,
|
|
3525
|
-
roleKey: RoleKeySchema,
|
|
3526
|
-
target: AddressSchema$1,
|
|
3527
|
-
options: Uint8Schema
|
|
3528
|
-
}), Schema.Struct({
|
|
3529
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3530
|
-
kind: Schema.Literals(["scope_target", "revoke_target"]),
|
|
3531
|
-
rolesModule: ModuleAddressSchema,
|
|
3532
|
-
roleKey: RoleKeySchema,
|
|
3533
|
-
target: AddressSchema$1
|
|
3534
|
-
})]);
|
|
3535
|
-
const PermissionScopeConditionSchema = Schema.Struct({
|
|
3536
|
-
parent: Uint8Schema,
|
|
3537
|
-
paramType: Uint8Schema,
|
|
3538
|
-
operator: Uint8Schema,
|
|
3539
|
-
compValue: HexDataSchema
|
|
3540
|
-
});
|
|
3541
|
-
const FinalizedPermissionFunctionAuthorityFactSchema = Schema.Union([
|
|
3542
|
-
Schema.Struct({
|
|
3543
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3544
|
-
kind: Schema.Literal("allow_function"),
|
|
3545
|
-
rolesModule: ModuleAddressSchema,
|
|
3546
|
-
roleKey: RoleKeySchema,
|
|
3547
|
-
target: AddressSchema$1,
|
|
3548
|
-
selector: Bytes4Schema,
|
|
3549
|
-
options: Uint8Schema
|
|
3550
|
-
}),
|
|
3551
|
-
Schema.Struct({
|
|
3552
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3553
|
-
kind: Schema.Literal("scope_function"),
|
|
3554
|
-
rolesModule: ModuleAddressSchema,
|
|
3555
|
-
roleKey: RoleKeySchema,
|
|
3556
|
-
target: AddressSchema$1,
|
|
3557
|
-
selector: Bytes4Schema,
|
|
3558
|
-
options: Uint8Schema,
|
|
3559
|
-
conditions: Schema.Array(PermissionScopeConditionSchema)
|
|
3560
|
-
}),
|
|
3561
|
-
Schema.Struct({
|
|
3562
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3563
|
-
kind: Schema.Literal("revoke_function"),
|
|
3564
|
-
rolesModule: ModuleAddressSchema,
|
|
3565
|
-
roleKey: RoleKeySchema,
|
|
3566
|
-
target: AddressSchema$1,
|
|
3567
|
-
selector: Bytes4Schema
|
|
3568
|
-
})
|
|
3569
|
-
]);
|
|
3570
|
-
const FinalizedPermissionAllowanceAuthorityFactSchema = Schema.Struct({
|
|
3571
|
-
...FinalizedPermissionFactCommonSchema.fields,
|
|
3572
|
-
kind: Schema.Literal("allowance"),
|
|
3573
|
-
rolesModule: ModuleAddressSchema,
|
|
3574
|
-
allowanceKey: AllowanceKeySchema,
|
|
3575
|
-
balance: WeiAmountSchema$1,
|
|
3576
|
-
maxRefill: WeiAmountSchema$1,
|
|
3577
|
-
refill: WeiAmountSchema$1,
|
|
3578
|
-
period: Uint256StringSchema,
|
|
3579
|
-
timestamp: Uint256StringSchema
|
|
3580
|
-
});
|
|
3581
|
-
const FinalizedPermissionFactSchema = Schema.Union([
|
|
3582
|
-
FinalizedPermissionModuleFactSchema,
|
|
3583
|
-
FinalizedPermissionRoleAssignmentFactSchema,
|
|
3584
|
-
FinalizedPermissionTargetAuthorityFactSchema,
|
|
3585
|
-
FinalizedPermissionFunctionAuthorityFactSchema,
|
|
3586
|
-
FinalizedPermissionAllowanceAuthorityFactSchema
|
|
3587
|
-
]);
|
|
3588
|
-
Schema.Struct({
|
|
3589
|
-
range: FinalizedPermissionFactRangeSchema,
|
|
3590
|
-
finalizedHead: FinalizedBlockReferenceSchema,
|
|
3591
|
-
anchor: FinalizedBlockReferenceSchema,
|
|
3592
|
-
facts: Schema.Array(FinalizedPermissionFactSchema),
|
|
3593
|
-
requestCount: nonNegativeInteger("requestCount")
|
|
3594
|
-
});
|
|
3595
3487
|
const FinalizedMoneyEvidenceCommonSchema = Schema.Struct({
|
|
3596
3488
|
chainId: BaseSepoliaChainIdSchema,
|
|
3597
3489
|
contractAddress: AddressSchema$1,
|
|
@@ -7824,11 +7716,14 @@ async function executePersonalPayment(deps, payment, signal, requestKey) {
|
|
|
7824
7716
|
function isAborted$1(signal) {
|
|
7825
7717
|
return signal?.aborted === true;
|
|
7826
7718
|
}
|
|
7719
|
+
function canonicalJson(value) {
|
|
7720
|
+
const canonical = JSON.stringify(value, (_key, item) => item !== null && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([left], [right]) => left.localeCompare(right))) : item);
|
|
7721
|
+
if (canonical === void 0) throw new TypeError("Payment intent must be JSON data");
|
|
7722
|
+
return canonical;
|
|
7723
|
+
}
|
|
7827
7724
|
/** Return one stable fingerprint for one JSON payment intent. */
|
|
7828
7725
|
async function fingerprintPaymentIntent(intent) {
|
|
7829
|
-
|
|
7830
|
-
if (canonical === void 0) throw new TypeError("Payment intent must be JSON data");
|
|
7831
|
-
return keccak256(toBytes(canonical));
|
|
7726
|
+
return keccak256(toBytes(canonicalJson(intent)));
|
|
7832
7727
|
}
|
|
7833
7728
|
async function executePrepared(deps, prepare, expectedRequest, signal) {
|
|
7834
7729
|
if (isAborted$1(signal)) return {
|
|
@@ -8853,7 +8748,7 @@ async function recoverRawDigestSigner(input) {
|
|
|
8853
8748
|
}
|
|
8854
8749
|
//#endregion
|
|
8855
8750
|
//#region ../../packages/sdk/package.json
|
|
8856
|
-
var version = "2.3.
|
|
8751
|
+
var version = "2.3.2";
|
|
8857
8752
|
//#endregion
|
|
8858
8753
|
//#region ../../packages/observability/src/engineering.ts
|
|
8859
8754
|
const SAFE_TRACED_HEADER_NAMES = [
|
|
@@ -14007,8 +13902,6 @@ const PermissionMirrorVerificationProps = Schema.Struct({
|
|
|
14007
13902
|
outcome: Schema.String,
|
|
14008
13903
|
reason: Schema.String,
|
|
14009
13904
|
chain_id: Schema.Number,
|
|
14010
|
-
finality: Schema.String,
|
|
14011
|
-
lag_blocks: Schema.Number,
|
|
14012
13905
|
retry_count: Schema.Number
|
|
14013
13906
|
});
|
|
14014
13907
|
const MovementScanWindowProps = Schema.Struct({
|
|
@@ -38446,7 +38339,7 @@ async function execute(deps, orgId, command, signal) {
|
|
|
38446
38339
|
} }));
|
|
38447
38340
|
if (!prepared.ok) return prepared;
|
|
38448
38341
|
const expectedSafe = deriveCapxulSafeAddress({ email: session.email });
|
|
38449
|
-
if (prepared.value.chainId !== deps.chainId || prepared.value.signerAddress.toLowerCase() !== signerAddress.toLowerCase() || prepared.value.userOpSenderSafe.toLowerCase() !== expectedSafe.toLowerCase() || prepared.value.operation !== command.operation || prepared.value.orgId !== orgId ||
|
|
38342
|
+
if (prepared.value.chainId !== deps.chainId || prepared.value.signerAddress.toLowerCase() !== signerAddress.toLowerCase() || prepared.value.userOpSenderSafe.toLowerCase() !== expectedSafe.toLowerCase() || prepared.value.operation !== command.operation || prepared.value.orgId !== orgId || canonicalJson(prepared.value.command) !== canonicalJson(command)) return {
|
|
38450
38343
|
ok: false,
|
|
38451
38344
|
error: Errors.invalidInput("permission", "prepared authority mismatch")
|
|
38452
38345
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/mcp",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
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": [
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
48
48
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.23",
|
|
49
49
|
"vite-plus": "0.1.23",
|
|
50
|
-
"@capxul/backend": "0.2.
|
|
50
|
+
"@capxul/backend": "0.2.5",
|
|
51
51
|
"@capxul/config": "0.2.0",
|
|
52
|
-
"@capxul/sdk": "2.3.
|
|
52
|
+
"@capxul/sdk": "2.3.2",
|
|
53
53
|
"@capxul/types": "0.2.0",
|
|
54
54
|
"@capxul/typescript-config": "0.0.0",
|
|
55
55
|
"@capxul/wire": "0.4.0"
|