@abstract-foundation/agw-mcp 0.1.0-beta.5 → 0.1.0-beta.6
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/index.mjs +11 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
2
3
|
import { Command } from "commander";
|
|
3
4
|
import open from "open";
|
|
4
5
|
import { randomBytes } from "node:crypto";
|
|
5
6
|
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
|
|
6
|
-
import fs from "node:fs";
|
|
7
7
|
import os from "node:os";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { sessionKeyValidatorAddress } from "@abstract-foundation/agw-client/constants";
|
|
@@ -3358,8 +3358,17 @@ var AgwMcpServer = class {
|
|
|
3358
3358
|
//#endregion
|
|
3359
3359
|
//#region src/index.ts
|
|
3360
3360
|
const logger = new Logger("agw-mcp");
|
|
3361
|
+
function resolveCliVersion() {
|
|
3362
|
+
try {
|
|
3363
|
+
const packageJsonUrl = new URL("../package.json", import.meta.url);
|
|
3364
|
+
const packageJsonRaw = fs.readFileSync(packageJsonUrl, "utf8");
|
|
3365
|
+
const parsed = JSON.parse(packageJsonRaw);
|
|
3366
|
+
if (typeof parsed.version === "string" && parsed.version.trim().length > 0) return parsed.version.trim();
|
|
3367
|
+
} catch {}
|
|
3368
|
+
return "0.1.0";
|
|
3369
|
+
}
|
|
3361
3370
|
const program = new Command();
|
|
3362
|
-
program.name("agw-mcp").description("Local MCP server for AGW session-key workflows").version(
|
|
3371
|
+
program.name("agw-mcp").description("Local MCP server for AGW session-key workflows").version(resolveCliVersion());
|
|
3363
3372
|
program.command("init").description("Bootstrap local AGW MCP session storage").option("--chain-id <chainId>", "EVM chain id (env: AGW_MCP_CHAIN_ID)").option("--rpc-url <rpcUrl>", "RPC URL override (env: AGW_MCP_RPC_URL)").option("--app-url <url>", "Hosted session onboarding URL (defaults to https://mcp.abs.xyz; env: AGW_MCP_APP_URL)").option("--storage-dir <dir>", "Session storage directory").action(async (options) => {
|
|
3364
3373
|
const networkConfig = resolveNetworkConfig({
|
|
3365
3374
|
chainId: options.chainId,
|