cyberdyne-mcp 0.5.2 → 0.5.4
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/evm-signer.js +8 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/evm-signer.ts +8 -1
- package/src/server.ts +1 -1
package/dist/evm-signer.js
CHANGED
|
@@ -45,13 +45,20 @@ const ERC20_TRANSFER_ABI = [
|
|
|
45
45
|
*/
|
|
46
46
|
export async function payDeployFee(params) {
|
|
47
47
|
const wallet = createWalletClient({ account: account(), chain: chain(), transport: http(process.env.CYBERDYNE_RPC_URL) });
|
|
48
|
-
|
|
48
|
+
const hash = await wallet.writeContract({
|
|
49
49
|
address: params.token,
|
|
50
50
|
abi: ERC20_TRANSFER_ABI,
|
|
51
51
|
functionName: "transfer",
|
|
52
52
|
args: [params.recipient, parseUnits(params.amountUsd.toFixed(6), 6)],
|
|
53
53
|
chain: chain(),
|
|
54
54
|
});
|
|
55
|
+
// Wait until the fee tx is ≥1 block deep BEFORE returning, so the platform's
|
|
56
|
+
// verifyFeePayment (which requires 1 confirmation, anti-reorg) accepts it on the
|
|
57
|
+
// authorize call that immediately follows. Without this the agent pays the fee
|
|
58
|
+
// then gets a 402 fee_unverified because the tx isn't mined/deep enough yet.
|
|
59
|
+
const pub = createPublicClient({ chain: chain(), transport: http(process.env.CYBERDYNE_RPC_URL) });
|
|
60
|
+
await pub.waitForTransactionReceipt({ hash, confirmations: 2 });
|
|
61
|
+
return hash;
|
|
55
62
|
}
|
|
56
63
|
export function hasEvmKey() {
|
|
57
64
|
return !!process.env.CYBERDYNE_EVM_PRIVATE_KEY;
|
package/dist/server.js
CHANGED
|
@@ -114,7 +114,7 @@ async function guard(fn) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
// ---- Server ---------------------------------------------------------------
|
|
117
|
-
const server = new McpServer({ name: "cyberdyne", version: "0.
|
|
117
|
+
const server = new McpServer({ name: "cyberdyne", version: "0.5.4" });
|
|
118
118
|
server.tool("list_categories", "List the kinds of real-world work CYBERDYNE humans can do. Static (no network). Use this to learn the valid `category` values before posting a task.", {}, async () => json(Object.entries(CATEGORIES).map(([id, blurb]) => ({ id, blurb }))));
|
|
119
119
|
server.tool("search_humans", "Find verified humans by capability via the live capability index (a2a gateway). Filters are optional and combine (AND). Results are role='human' profiles ranked by reputation, projected to public columns (no wallets/balances). Note: `skills` is an array.", {
|
|
120
120
|
skills: z
|
package/package.json
CHANGED
package/src/evm-signer.ts
CHANGED
|
@@ -51,13 +51,20 @@ export async function payDeployFee(params: {
|
|
|
51
51
|
token: string;
|
|
52
52
|
}): Promise<string> {
|
|
53
53
|
const wallet = createWalletClient({ account: account(), chain: chain(), transport: http(process.env.CYBERDYNE_RPC_URL) });
|
|
54
|
-
|
|
54
|
+
const hash = await wallet.writeContract({
|
|
55
55
|
address: params.token as `0x${string}`,
|
|
56
56
|
abi: ERC20_TRANSFER_ABI,
|
|
57
57
|
functionName: "transfer",
|
|
58
58
|
args: [params.recipient as `0x${string}`, parseUnits(params.amountUsd.toFixed(6), 6)],
|
|
59
59
|
chain: chain(),
|
|
60
60
|
});
|
|
61
|
+
// Wait until the fee tx is ≥1 block deep BEFORE returning, so the platform's
|
|
62
|
+
// verifyFeePayment (which requires 1 confirmation, anti-reorg) accepts it on the
|
|
63
|
+
// authorize call that immediately follows. Without this the agent pays the fee
|
|
64
|
+
// then gets a 402 fee_unverified because the tx isn't mined/deep enough yet.
|
|
65
|
+
const pub = createPublicClient({ chain: chain(), transport: http(process.env.CYBERDYNE_RPC_URL) });
|
|
66
|
+
await pub.waitForTransactionReceipt({ hash, confirmations: 2 });
|
|
67
|
+
return hash;
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
export function hasEvmKey(): boolean {
|
package/src/server.ts
CHANGED
|
@@ -123,7 +123,7 @@ async function guard<T>(fn: () => Promise<T>) {
|
|
|
123
123
|
|
|
124
124
|
// ---- Server ---------------------------------------------------------------
|
|
125
125
|
|
|
126
|
-
const server = new McpServer({ name: "cyberdyne", version: "0.
|
|
126
|
+
const server = new McpServer({ name: "cyberdyne", version: "0.5.4" });
|
|
127
127
|
|
|
128
128
|
server.tool(
|
|
129
129
|
"list_categories",
|