@continuumdao/ctm-mpc-defi 0.2.10 → 0.2.12
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/agent/catalog.cjs +98 -46
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +900 -339
- package/dist/agent/catalog.js +98 -46
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/morpho/SKILL.md +26 -3
- package/dist/chains/evm/index.cjs +1 -1
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.js +1 -1
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js +1 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.js +1 -1
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +1 -1
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.js +1 -1
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +1 -1
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +1 -1
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.js +1 -1
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.js +1 -1
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +1 -1
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.js +1 -1
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +1 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js +1 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +1 -1
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.js +1 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +1 -1
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js +1 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +1 -1
package/dist/agent/catalog.js
CHANGED
|
@@ -413,6 +413,14 @@ var MULTISIGN_SUBMIT_OUTPUT_DOC = {
|
|
|
413
413
|
requestId: {
|
|
414
414
|
type: "string",
|
|
415
415
|
description: "Sign request id from POST /multiSignRequest."
|
|
416
|
+
},
|
|
417
|
+
status: {
|
|
418
|
+
type: "string",
|
|
419
|
+
description: "submitted when POST succeeded \u2014 do not call the same build tool again."
|
|
420
|
+
},
|
|
421
|
+
followUp: {
|
|
422
|
+
type: "string",
|
|
423
|
+
description: "Lifecycle next steps (wait_for_sign_request_ready \u2192 agree \u2192 trigger \u2192 broadcast)."
|
|
416
424
|
}
|
|
417
425
|
}
|
|
418
426
|
};
|
|
@@ -481,6 +489,22 @@ function withMultisignSubmitMcpMeta(description, followUp = MCP_MULTISIGN_SUBMIT
|
|
|
481
489
|
followUp: [...followUp]
|
|
482
490
|
};
|
|
483
491
|
}
|
|
492
|
+
var MULTISIGN_SERVER_RESOLVED_KEYS = /* @__PURE__ */ new Set([
|
|
493
|
+
"keyGen",
|
|
494
|
+
"rpcUrl",
|
|
495
|
+
"executorAddress",
|
|
496
|
+
"chainDetail",
|
|
497
|
+
"customGasChainDetails"
|
|
498
|
+
]);
|
|
499
|
+
function agentFacingMultisignJsonSchema(schema) {
|
|
500
|
+
const raw = zodSchemaToMcpJsonSchema(schema);
|
|
501
|
+
const prevRequired = Array.isArray(raw.required) ? [...raw.required] : [];
|
|
502
|
+
const agentRequired = prevRequired.filter((k) => !MULTISIGN_SERVER_RESOLVED_KEYS.has(k));
|
|
503
|
+
if (!agentRequired.includes("keyGenId")) {
|
|
504
|
+
agentRequired.unshift("keyGenId");
|
|
505
|
+
}
|
|
506
|
+
return { ...raw, required: agentRequired };
|
|
507
|
+
}
|
|
484
508
|
function zodSchemaToMcpJsonSchema(schema) {
|
|
485
509
|
const raw = zodToJsonSchema(schema, {
|
|
486
510
|
target: "openApi3",
|
|
@@ -520,21 +544,31 @@ var chainDetailSchema = z.object({
|
|
|
520
544
|
"Optional gas config: { legacy?, gasLimit?, gasMultiplier?, gasPrice?, baseFee?, priorityFee?, baseFeeMultiplier? }."
|
|
521
545
|
);
|
|
522
546
|
var evmMultisignCommonInputSchema = z.object({
|
|
523
|
-
|
|
547
|
+
keyGenId: z.string().min(1).optional().describe(
|
|
548
|
+
"KeyGen request id from get_preferred_key_gen / conversation context. MCP server resolves keyGen, executorAddress, rpcUrl, and chainDetail \u2014 agents must pass keyGenId only."
|
|
549
|
+
),
|
|
550
|
+
keyGen: keyGenSchema.optional().describe("Server-filled from keyGenId. Agents must not pass keyGen."),
|
|
524
551
|
purposeText: z.string().min(1).describe(
|
|
525
552
|
"Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
|
|
526
553
|
),
|
|
527
|
-
useCustomGas: z.boolean().describe(
|
|
554
|
+
useCustomGas: z.boolean().default(false).describe(
|
|
528
555
|
"When true, apply Custom Gas Config from chainDetail / customGasChainDetails. Omitted baseFee/priorityFee is valid \u2014 builder uses live RPC fees; configured values are optional floors/multipliers. When false, use live RPC estimates only."
|
|
529
556
|
),
|
|
530
557
|
chainId: z.number().int().positive().describe("EVM chain id (decimal). Becomes destinationChainID on the sign request."),
|
|
531
|
-
rpcUrl: z.string().min(1).describe("
|
|
532
|
-
executorAddress: evmAddressSchema.describe(
|
|
533
|
-
|
|
534
|
-
),
|
|
535
|
-
chainDetail: chainDetailSchema,
|
|
558
|
+
rpcUrl: z.string().min(1).optional().describe("Server-filled from chain registry when keyGenId is set. Agents must not pass rpcUrl."),
|
|
559
|
+
executorAddress: evmAddressSchema.optional().describe("Server-filled MPC wallet from keyGenId. Agents must not pass executorAddress."),
|
|
560
|
+
chainDetail: chainDetailSchema.optional().describe("Server-filled gas row from chain registry when keyGenId is set."),
|
|
536
561
|
customGasChainDetails: z.record(z.unknown()).optional().describe("Snapshot written to extraJSON.customGasChainDetails when useCustomGas is true.")
|
|
537
562
|
});
|
|
563
|
+
function withMultisignKeySourceRefine(schema) {
|
|
564
|
+
return schema.refine(
|
|
565
|
+
(d) => Boolean(d.keyGenId?.trim()) || Boolean(d.keyGen?.pubkeyhex?.trim() && d.executorAddress?.trim() && d.rpcUrl?.trim()),
|
|
566
|
+
{
|
|
567
|
+
message: "keyGenId is required for MCP agents (or pass keyGen + executorAddress + rpcUrl for manual calls).",
|
|
568
|
+
path: ["keyGenId"]
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
}
|
|
538
572
|
var multisignOutputSchema = z.object({
|
|
539
573
|
bodyForSign: z.record(z.unknown()).describe(
|
|
540
574
|
"POST body fields without clientSig: keyList, pubKey, msgHash, msgRaw, destinationChainID, purpose, extraJSON, proposalTxParams (batch), messageHashes/messageRawBatch when N>1 txs."
|
|
@@ -582,18 +616,20 @@ var mcpUniswapV4CreateSwapOutputSchema = z.object({
|
|
|
582
616
|
gasFee: z.string().optional()
|
|
583
617
|
}).passthrough().describe("{ swap: TransactionRequest, requestId?, gasFee? }");
|
|
584
618
|
var swapTxRequestSchema = jsonObjectSchema.describe("swap field from create_swap response (to, data, value)");
|
|
585
|
-
var mcpUniswapV4BuildSwapMultisignInputSchema =
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
createSwapResponse: z.object({
|
|
619
|
+
var mcpUniswapV4BuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
620
|
+
evmMultisignCommonInputSchema.extend({
|
|
621
|
+
tokenIn: evmAddressSchema.describe("Token in; 0x0 for native ETH"),
|
|
589
622
|
swap: swapTxRequestSchema,
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
623
|
+
createSwapResponse: z.object({
|
|
624
|
+
swap: swapTxRequestSchema,
|
|
625
|
+
requestId: z.string().optional(),
|
|
626
|
+
gasFee: z.string().optional()
|
|
627
|
+
}).passthrough().describe("Full create_swap response"),
|
|
628
|
+
fullQuoteSnapshot: jsonObjectSchema.describe("Quote JSON used for the swap"),
|
|
629
|
+
swapDeadlineUnix: z.number().describe("Same deadline passed to create_swap"),
|
|
630
|
+
slippagePercent: z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
|
|
631
|
+
})
|
|
632
|
+
);
|
|
597
633
|
var lpExistingPoolSchema = z.object({
|
|
598
634
|
token0Address: evmAddressSchema,
|
|
599
635
|
token1Address: evmAddressSchema,
|
|
@@ -733,21 +769,27 @@ var lpBuildCommonSchema = {
|
|
|
733
769
|
nativeWrapped: evmAddressSchema.optional(),
|
|
734
770
|
poolReference: z.string().optional()
|
|
735
771
|
};
|
|
736
|
-
var mcpUniswapV4BuildMintLiquidityMultisignInputSchema =
|
|
737
|
-
lpBuildCommonSchema
|
|
772
|
+
var mcpUniswapV4BuildMintLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
773
|
+
evmMultisignCommonInputSchema.extend(lpBuildCommonSchema)
|
|
774
|
+
);
|
|
775
|
+
var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
776
|
+
evmMultisignCommonInputSchema.extend({
|
|
777
|
+
...lpBuildCommonSchema,
|
|
778
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
779
|
+
})
|
|
780
|
+
);
|
|
781
|
+
var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = withMultisignKeySourceRefine(
|
|
782
|
+
evmMultisignCommonInputSchema.extend({
|
|
783
|
+
...lpBuildCommonSchema,
|
|
784
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
785
|
+
})
|
|
786
|
+
);
|
|
787
|
+
var mcpUniswapV4BuildCollectFeesMultisignInputSchema = withMultisignKeySourceRefine(
|
|
788
|
+
evmMultisignCommonInputSchema.extend({
|
|
789
|
+
...lpBuildCommonSchema,
|
|
790
|
+
nftTokenId: z.union([z.string(), z.number()])
|
|
791
|
+
})
|
|
738
792
|
);
|
|
739
|
-
var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
740
|
-
...lpBuildCommonSchema,
|
|
741
|
-
nftTokenId: z.union([z.string(), z.number()])
|
|
742
|
-
});
|
|
743
|
-
var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
744
|
-
...lpBuildCommonSchema,
|
|
745
|
-
nftTokenId: z.union([z.string(), z.number()])
|
|
746
|
-
});
|
|
747
|
-
var mcpUniswapV4BuildCollectFeesMultisignInputSchema = evmMultisignCommonInputSchema.extend({
|
|
748
|
-
...lpBuildCommonSchema,
|
|
749
|
-
nftTokenId: z.union([z.string(), z.number()])
|
|
750
|
-
});
|
|
751
793
|
var mcpCurveDaoQuoteInputSchema = z.object({
|
|
752
794
|
chainId: z.number().int().positive().describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
|
|
753
795
|
rpcUrl: z.string().min(1).optional().describe("JSON-RPC URL; continuum-mcp-server injects from chain registry \u2014 do not pass a public RPC URL"),
|
|
@@ -759,12 +801,14 @@ var mcpCurveDaoQuoteInputSchema = z.object({
|
|
|
759
801
|
var mcpCurveDaoQuoteOutputSchema = jsonObjectSchema.describe(
|
|
760
802
|
"Curve router quote: { inputAmount, output, route, priceImpactPercent?, tokenInRouterId, tokenOutRouterId }"
|
|
761
803
|
);
|
|
762
|
-
var mcpCurveDaoBuildSwapMultisignInputSchema =
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
804
|
+
var mcpCurveDaoBuildSwapMultisignInputSchema = withMultisignKeySourceRefine(
|
|
805
|
+
evmMultisignCommonInputSchema.extend({
|
|
806
|
+
tokenIn: evmAddressSchema.describe("ERC-20 sold (native in uses WETH path in UI)"),
|
|
807
|
+
tokenOut: z.string().min(1).describe("Output token or 0xeeee\u2026 native placeholder"),
|
|
808
|
+
amountHuman: z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
809
|
+
slippagePercent: z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive")
|
|
810
|
+
})
|
|
811
|
+
);
|
|
768
812
|
var mcpServerCommonInputSchema = z.object({
|
|
769
813
|
keyGenId: z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
770
814
|
chainId: z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
@@ -775,7 +819,11 @@ function mcpServerMultisignInput(fields) {
|
|
|
775
819
|
return mcpServerCommonInputSchema.extend(fields);
|
|
776
820
|
}
|
|
777
821
|
var mcpServerSubmitOutputSchema = z.object({
|
|
778
|
-
requestId: z.string().min(1).describe("Sign request id from POST /multiSignRequest \u2014 success; do not retry the same build tool.")
|
|
822
|
+
requestId: z.string().min(1).describe("Sign request id from POST /multiSignRequest \u2014 success; do not retry the same build tool."),
|
|
823
|
+
status: z.literal("submitted").optional().describe("Present when POST /multiSignRequest succeeded. Confirms the request exists on the node."),
|
|
824
|
+
followUp: z.string().optional().describe(
|
|
825
|
+
"Next MCP lifecycle steps. Do not call the same build_*_multisign tool again unless the user explicitly wants a duplicate order."
|
|
826
|
+
)
|
|
779
827
|
}).describe(
|
|
780
828
|
"Submitted mpc-auth multiSignRequest. Continue with wait_for_sign_request_ready \u2192 sign_request_agree \u2192 trigger_sign_result \u2192 broadcast_sign_result."
|
|
781
829
|
);
|
|
@@ -786,7 +834,7 @@ var MCP_NON_SUBMIT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
786
834
|
|
|
787
835
|
// src/agent/schemas/protocols.ts
|
|
788
836
|
function mcpMultisignInput(fields) {
|
|
789
|
-
return evmMultisignCommonInputSchema.extend(fields);
|
|
837
|
+
return withMultisignKeySourceRefine(evmMultisignCommonInputSchema.extend(fields));
|
|
790
838
|
}
|
|
791
839
|
var mcpLidoSubmitInputSchema = mcpMultisignInput({
|
|
792
840
|
valueWei: z.string().min(1).describe("ETH to stake (wei decimal string)"),
|
|
@@ -993,7 +1041,7 @@ var mcpMorphoFetchEarnVaultsOutputSchema = z.object({
|
|
|
993
1041
|
)
|
|
994
1042
|
});
|
|
995
1043
|
function mcpGmxMultisignInput(fields) {
|
|
996
|
-
return evmMultisignCommonInputSchema.extend(fields);
|
|
1044
|
+
return withMultisignKeySourceRefine(evmMultisignCommonInputSchema.extend(fields));
|
|
997
1045
|
}
|
|
998
1046
|
var gmxDirectionSchema = z.enum(["long", "short"]);
|
|
999
1047
|
var gmxOrderTypeSchema = z.enum(["market", "limit"]);
|
|
@@ -1141,7 +1189,7 @@ var mcpGmxFetchOhlcvOutputSchema = z.object({
|
|
|
1141
1189
|
candles: z.array(gmxOhlcvCandleSchema)
|
|
1142
1190
|
});
|
|
1143
1191
|
function mcpHyperliquidMultisignInput(fields) {
|
|
1144
|
-
return evmMultisignCommonInputSchema.extend(fields);
|
|
1192
|
+
return withMultisignKeySourceRefine(evmMultisignCommonInputSchema.extend(fields));
|
|
1145
1193
|
}
|
|
1146
1194
|
var hyperliquidTifSchema = z.enum(["alo", "gtc", "ioc"]);
|
|
1147
1195
|
var hyperliquidOhlcvIntervalSchema = z.enum([
|
|
@@ -1454,7 +1502,7 @@ function defineProtocolMcpTool(def) {
|
|
|
1454
1502
|
description: meta.description,
|
|
1455
1503
|
followUp: meta.followUp,
|
|
1456
1504
|
outputZod: mcpServerSubmitOutputSchema,
|
|
1457
|
-
inputSchema:
|
|
1505
|
+
inputSchema: agentFacingMultisignJsonSchema(def.inputZod),
|
|
1458
1506
|
outputSchema: zodSchemaToMcpJsonSchema(mcpServerSubmitOutputSchema),
|
|
1459
1507
|
parseInput: (data) => def.inputZod.parse(data),
|
|
1460
1508
|
parseOutput: (data) => mcpServerSubmitOutputSchema.parse(data)
|
|
@@ -2015,12 +2063,16 @@ function defineMcpTool(def) {
|
|
|
2015
2063
|
}
|
|
2016
2064
|
function defineMultisignSubmitMcpTool(def) {
|
|
2017
2065
|
const meta = withMultisignSubmitMcpMeta(def.description, def.followUp ?? MCP_MULTISIGN_SUBMIT_FOLLOW_UP);
|
|
2018
|
-
return
|
|
2066
|
+
return {
|
|
2019
2067
|
...def,
|
|
2020
2068
|
description: meta.description,
|
|
2021
2069
|
followUp: meta.followUp,
|
|
2022
|
-
outputZod: mcpServerSubmitOutputSchema
|
|
2023
|
-
|
|
2070
|
+
outputZod: mcpServerSubmitOutputSchema,
|
|
2071
|
+
inputSchema: agentFacingMultisignJsonSchema(def.inputZod),
|
|
2072
|
+
outputSchema: zodSchemaToMcpJsonSchema(mcpServerSubmitOutputSchema),
|
|
2073
|
+
parseInput: (data) => def.inputZod.parse(data),
|
|
2074
|
+
parseOutput: (data) => mcpServerSubmitOutputSchema.parse(data)
|
|
2075
|
+
};
|
|
2024
2076
|
}
|
|
2025
2077
|
var CORE_MCP_TOOL_DEFINITIONS = [
|
|
2026
2078
|
defineMcpTool({
|