@x402scan/mcp 0.0.7-beta.4 → 0.0.8-beta.0
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/cjs/run-server.cjs +184 -148
- package/dist/esm/{chunk-RZYTNVC6.js → chunk-5LYTFZ22.js} +2 -2
- package/dist/esm/{chunk-JXXC6FYE.js → chunk-7BI7Y3ZF.js} +64 -71
- package/dist/esm/chunk-7BI7Y3ZF.js.map +1 -0
- package/dist/esm/{chunk-Q2QVXJFE.js → chunk-KPEJO3KV.js} +2 -2
- package/dist/esm/chunk-KPEJO3KV.js.map +1 -0
- package/dist/esm/{chunk-2UP5W5MC.js → chunk-KT473PSW.js} +8 -3
- package/dist/esm/chunk-KT473PSW.js.map +1 -0
- package/dist/esm/{fund-ANZCZU5C.js → fund-DD27Z7JW.js} +3 -3
- package/dist/esm/index.js +4 -4
- package/dist/esm/{install-BBOI4D6I.js → install-EHBSKOIZ.js} +5 -5
- package/dist/esm/{server-IOVNYPTB.js → server-3JKXWW6W.js} +65 -27
- package/dist/esm/server-3JKXWW6W.js.map +1 -0
- package/package.json +5 -3
- package/dist/esm/chunk-2UP5W5MC.js.map +0 -1
- package/dist/esm/chunk-JXXC6FYE.js.map +0 -1
- package/dist/esm/chunk-Q2QVXJFE.js.map +0 -1
- package/dist/esm/server-IOVNYPTB.js.map +0 -1
- /package/dist/esm/{chunk-RZYTNVC6.js.map → chunk-5LYTFZ22.js.map} +0 -0
- /package/dist/esm/{fund-ANZCZU5C.js.map → fund-DD27Z7JW.js.map} +0 -0
- /package/dist/esm/{install-BBOI4D6I.js.map → install-EHBSKOIZ.js.map} +0 -0
package/dist/cjs/run-server.cjs
CHANGED
|
@@ -34,10 +34,10 @@ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__
|
|
|
34
34
|
));
|
|
35
35
|
var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
|
|
36
36
|
|
|
37
|
-
// ../../../node_modules/.pnpm/tsup@8.5.
|
|
37
|
+
// ../../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.10_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
|
|
38
38
|
var getImportMetaUrl, importMetaUrl;
|
|
39
39
|
var init_cjs_shims = __esm({
|
|
40
|
-
"../../../node_modules/.pnpm/tsup@8.5.
|
|
40
|
+
"../../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.10_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js"() {
|
|
41
41
|
"use strict";
|
|
42
42
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
43
43
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -6860,12 +6860,12 @@ var require_dist = __commonJS({
|
|
|
6860
6860
|
throw new Error(`Unknown format "${name}"`);
|
|
6861
6861
|
return f;
|
|
6862
6862
|
};
|
|
6863
|
-
function addFormats(ajv, list,
|
|
6863
|
+
function addFormats(ajv, list, fs9, exportName) {
|
|
6864
6864
|
var _a2;
|
|
6865
6865
|
var _b;
|
|
6866
6866
|
(_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
6867
6867
|
for (const f of list)
|
|
6868
|
-
ajv.addFormat(f,
|
|
6868
|
+
ajv.addFormat(f, fs9[f]);
|
|
6869
6869
|
}
|
|
6870
6870
|
module2.exports = exports2 = formatsPlugin;
|
|
6871
6871
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -9516,7 +9516,7 @@ function weierstrass(curveDef) {
|
|
|
9516
9516
|
function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
|
|
9517
9517
|
if (["recovered", "canonical"].some((k) => k in opts))
|
|
9518
9518
|
throw new Error("sign() legacy options not supported");
|
|
9519
|
-
const { hash: hash2, randomBytes:
|
|
9519
|
+
const { hash: hash2, randomBytes: randomBytes3 } = CURVE;
|
|
9520
9520
|
let { lowS, prehash, extraEntropy: ent } = opts;
|
|
9521
9521
|
if (lowS == null)
|
|
9522
9522
|
lowS = true;
|
|
@@ -9528,7 +9528,7 @@ function weierstrass(curveDef) {
|
|
|
9528
9528
|
const d = normPrivateKeyToScalar(privateKey);
|
|
9529
9529
|
const seedArgs = [int2octets(d), int2octets(h1int)];
|
|
9530
9530
|
if (ent != null && ent !== false) {
|
|
9531
|
-
const e = ent === true ?
|
|
9531
|
+
const e = ent === true ? randomBytes3(Fp.BYTES) : ent;
|
|
9532
9532
|
seedArgs.push(ensureBytes("extraEntropy", e));
|
|
9533
9533
|
}
|
|
9534
9534
|
const seed = concatBytes2(...seedArgs);
|
|
@@ -19688,7 +19688,7 @@ var require_utils2 = __commonJS({
|
|
|
19688
19688
|
exports2.createHasher = createHasher2;
|
|
19689
19689
|
exports2.createOptHasher = createOptHasher;
|
|
19690
19690
|
exports2.createXOFer = createXOFer2;
|
|
19691
|
-
exports2.randomBytes =
|
|
19691
|
+
exports2.randomBytes = randomBytes3;
|
|
19692
19692
|
var crypto_1 = require_cryptoNode();
|
|
19693
19693
|
function isBytes4(a) {
|
|
19694
19694
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
@@ -19886,7 +19886,7 @@ var require_utils2 = __commonJS({
|
|
|
19886
19886
|
exports2.wrapConstructor = createHasher2;
|
|
19887
19887
|
exports2.wrapConstructorWithOpts = createOptHasher;
|
|
19888
19888
|
exports2.wrapXOFConstructorWithOpts = createXOFer2;
|
|
19889
|
-
function
|
|
19889
|
+
function randomBytes3(bytesLength = 32) {
|
|
19890
19890
|
if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
|
|
19891
19891
|
return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
|
|
19892
19892
|
}
|
|
@@ -23680,8 +23680,8 @@ var require_uuid = __commonJS({
|
|
|
23680
23680
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
23681
23681
|
exports2.uuidV4 = void 0;
|
|
23682
23682
|
var data_js_1 = require_data2();
|
|
23683
|
-
function uuidV4(
|
|
23684
|
-
const bytes = (0, data_js_1.getBytes)(
|
|
23683
|
+
function uuidV4(randomBytes3) {
|
|
23684
|
+
const bytes = (0, data_js_1.getBytes)(randomBytes3, "randomBytes");
|
|
23685
23685
|
bytes[6] = bytes[6] & 15 | 64;
|
|
23686
23686
|
bytes[8] = bytes[8] & 63 | 128;
|
|
23687
23687
|
const value = (0, data_js_1.hexlify)(bytes);
|
|
@@ -24663,13 +24663,13 @@ var require_utils5 = __commonJS({
|
|
|
24663
24663
|
return hashC;
|
|
24664
24664
|
}
|
|
24665
24665
|
exports2.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
|
|
24666
|
-
function
|
|
24666
|
+
function randomBytes3(bytesLength = 32) {
|
|
24667
24667
|
if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
|
|
24668
24668
|
return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
|
|
24669
24669
|
}
|
|
24670
24670
|
throw new Error("crypto.getRandomValues must be defined");
|
|
24671
24671
|
}
|
|
24672
|
-
exports2.randomBytes =
|
|
24672
|
+
exports2.randomBytes = randomBytes3;
|
|
24673
24673
|
}
|
|
24674
24674
|
});
|
|
24675
24675
|
|
|
@@ -25198,21 +25198,21 @@ var require_random = __commonJS({
|
|
|
25198
25198
|
return new Uint8Array((0, crypto_js_1.randomBytes)(length));
|
|
25199
25199
|
};
|
|
25200
25200
|
var __randomBytes = _randomBytes;
|
|
25201
|
-
function
|
|
25201
|
+
function randomBytes3(length) {
|
|
25202
25202
|
return __randomBytes(length);
|
|
25203
25203
|
}
|
|
25204
|
-
exports2.randomBytes =
|
|
25205
|
-
|
|
25206
|
-
|
|
25204
|
+
exports2.randomBytes = randomBytes3;
|
|
25205
|
+
randomBytes3._ = _randomBytes;
|
|
25206
|
+
randomBytes3.lock = function() {
|
|
25207
25207
|
locked = true;
|
|
25208
25208
|
};
|
|
25209
|
-
|
|
25209
|
+
randomBytes3.register = function(func) {
|
|
25210
25210
|
if (locked) {
|
|
25211
25211
|
throw new Error("randomBytes is locked");
|
|
25212
25212
|
}
|
|
25213
25213
|
__randomBytes = func;
|
|
25214
25214
|
};
|
|
25215
|
-
Object.freeze(
|
|
25215
|
+
Object.freeze(randomBytes3);
|
|
25216
25216
|
}
|
|
25217
25217
|
});
|
|
25218
25218
|
|
|
@@ -27223,7 +27223,7 @@ var require_weierstrass = __commonJS({
|
|
|
27223
27223
|
function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
|
|
27224
27224
|
if (["recovered", "canonical"].some((k) => k in opts))
|
|
27225
27225
|
throw new Error("sign() legacy options not supported");
|
|
27226
|
-
const { hash: hash2, randomBytes:
|
|
27226
|
+
const { hash: hash2, randomBytes: randomBytes3 } = CURVE;
|
|
27227
27227
|
let { lowS, prehash, extraEntropy: ent } = opts;
|
|
27228
27228
|
if (lowS == null)
|
|
27229
27229
|
lowS = true;
|
|
@@ -27234,7 +27234,7 @@ var require_weierstrass = __commonJS({
|
|
|
27234
27234
|
const d = normPrivateKeyToScalar(privateKey);
|
|
27235
27235
|
const seedArgs = [int2octets(d), int2octets(h1int)];
|
|
27236
27236
|
if (ent != null) {
|
|
27237
|
-
const e = ent === true ?
|
|
27237
|
+
const e = ent === true ? randomBytes3(Fp.BYTES) : ent;
|
|
27238
27238
|
seedArgs.push((0, utils_js_1.ensureBytes)("extraEntropy", e));
|
|
27239
27239
|
}
|
|
27240
27240
|
const seed = ut.concatBytes(...seedArgs);
|
|
@@ -43087,7 +43087,7 @@ var require_node_gyp_build = __commonJS({
|
|
|
43087
43087
|
"../../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js"(exports2, module2) {
|
|
43088
43088
|
"use strict";
|
|
43089
43089
|
init_cjs_shims();
|
|
43090
|
-
var
|
|
43090
|
+
var fs9 = require("fs");
|
|
43091
43091
|
var path2 = require("path");
|
|
43092
43092
|
var os2 = require("os");
|
|
43093
43093
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
|
|
@@ -43148,7 +43148,7 @@ var require_node_gyp_build = __commonJS({
|
|
|
43148
43148
|
};
|
|
43149
43149
|
function readdirSync(dir) {
|
|
43150
43150
|
try {
|
|
43151
|
-
return
|
|
43151
|
+
return fs9.readdirSync(dir);
|
|
43152
43152
|
} catch (err3) {
|
|
43153
43153
|
return [];
|
|
43154
43154
|
}
|
|
@@ -43242,7 +43242,7 @@ var require_node_gyp_build = __commonJS({
|
|
|
43242
43242
|
return typeof window !== "undefined" && window.process && window.process.type === "renderer";
|
|
43243
43243
|
}
|
|
43244
43244
|
function isAlpine(platform3) {
|
|
43245
|
-
return platform3 === "linux" &&
|
|
43245
|
+
return platform3 === "linux" && fs9.existsSync("/etc/alpine-release");
|
|
43246
43246
|
}
|
|
43247
43247
|
load.parseTags = parseTags;
|
|
43248
43248
|
load.matchTags = matchTags;
|
|
@@ -45459,7 +45459,7 @@ var require_websocket = __commonJS({
|
|
|
45459
45459
|
var http = require("http");
|
|
45460
45460
|
var net = require("net");
|
|
45461
45461
|
var tls = require("tls");
|
|
45462
|
-
var { randomBytes:
|
|
45462
|
+
var { randomBytes: randomBytes3, createHash } = require("crypto");
|
|
45463
45463
|
var { Duplex, Readable } = require("stream");
|
|
45464
45464
|
var { URL: URL2 } = require("url");
|
|
45465
45465
|
var PerMessageDeflate = require_permessage_deflate();
|
|
@@ -45985,7 +45985,7 @@ var require_websocket = __commonJS({
|
|
|
45985
45985
|
}
|
|
45986
45986
|
}
|
|
45987
45987
|
const defaultPort = isSecure ? 443 : 80;
|
|
45988
|
-
const key =
|
|
45988
|
+
const key = randomBytes3(16).toString("base64");
|
|
45989
45989
|
const request = isSecure ? https.request : http.request;
|
|
45990
45990
|
const protocolSet = /* @__PURE__ */ new Set();
|
|
45991
45991
|
let perMessageDeflate;
|
|
@@ -52917,12 +52917,12 @@ var require_random2 = __commonJS({
|
|
|
52917
52917
|
var binary_1 = require_binary();
|
|
52918
52918
|
var wipe_1 = require_wipe();
|
|
52919
52919
|
exports2.defaultRandomSource = new system_1.SystemRandomSource();
|
|
52920
|
-
function
|
|
52920
|
+
function randomBytes3(length, prng = exports2.defaultRandomSource) {
|
|
52921
52921
|
return prng.randomBytes(length);
|
|
52922
52922
|
}
|
|
52923
|
-
exports2.randomBytes =
|
|
52923
|
+
exports2.randomBytes = randomBytes3;
|
|
52924
52924
|
function randomUint32(prng = exports2.defaultRandomSource) {
|
|
52925
|
-
const buf =
|
|
52925
|
+
const buf = randomBytes3(4, prng);
|
|
52926
52926
|
const result = (0, binary_1.readUint32LE)(buf);
|
|
52927
52927
|
(0, wipe_1.wipe)(buf);
|
|
52928
52928
|
return result;
|
|
@@ -52940,7 +52940,7 @@ var require_random2 = __commonJS({
|
|
|
52940
52940
|
const charsLen = charset.length;
|
|
52941
52941
|
const maxByte = 256 - 256 % charsLen;
|
|
52942
52942
|
while (length > 0) {
|
|
52943
|
-
const buf =
|
|
52943
|
+
const buf = randomBytes3(Math.ceil(length * 256 / maxByte), prng);
|
|
52944
52944
|
for (let i = 0; i < buf.length && length > 0; i++) {
|
|
52945
52945
|
const randomByte = buf[i];
|
|
52946
52946
|
if (randomByte < maxByte) {
|
|
@@ -53311,8 +53311,7 @@ init_cjs_shims();
|
|
|
53311
53311
|
|
|
53312
53312
|
// src/shared/neverthrow/fs/index.ts
|
|
53313
53313
|
init_cjs_shims();
|
|
53314
|
-
var
|
|
53315
|
-
var import_fs = require("fs");
|
|
53314
|
+
var import_promises = require("fs/promises");
|
|
53316
53315
|
|
|
53317
53316
|
// ../../internal/neverthrow/dist/index.js
|
|
53318
53317
|
init_cjs_shims();
|
|
@@ -53824,49 +53823,39 @@ function err2(type3, surface2, error48) {
|
|
|
53824
53823
|
var errorType = "fs";
|
|
53825
53824
|
var fsErr = (surface2, error48) => err2(errorType, surface2, error48);
|
|
53826
53825
|
var fsResultFromPromise = (surface2, promise2, error48) => resultFromPromise(errorType, surface2, promise2, error48);
|
|
53827
|
-
var safeReadFile = (surface2, path2) => fsResultFromPromise(surface2,
|
|
53826
|
+
var safeReadFile = (surface2, path2) => fsResultFromPromise(surface2, (0, import_promises.readFile)(path2, "utf-8"), () => ({
|
|
53828
53827
|
cause: "file_not_readable",
|
|
53829
53828
|
message: "Failed to read file"
|
|
53830
53829
|
}));
|
|
53831
|
-
var safeWriteFile = (surface2, path2, data) => fsResultFromPromise(surface2,
|
|
53830
|
+
var safeWriteFile = (surface2, path2, data) => fsResultFromPromise(surface2, (0, import_promises.writeFile)(path2, data), () => ({
|
|
53832
53831
|
cause: "file_not_writable",
|
|
53833
53832
|
message: "Failed to write file"
|
|
53834
53833
|
}));
|
|
53835
|
-
var safeAppendFile = (surface2, path2, data) => fsResultFromPromise(surface2,
|
|
53834
|
+
var safeAppendFile = (surface2, path2, data) => fsResultFromPromise(surface2, (0, import_promises.appendFile)(path2, data), () => ({
|
|
53836
53835
|
cause: "file_not_writable",
|
|
53837
53836
|
message: "Failed to append file"
|
|
53838
53837
|
}));
|
|
53839
|
-
var safeChmod = (surface2, path2, mode) => fsResultFromPromise(surface2,
|
|
53838
|
+
var safeChmod = (surface2, path2, mode) => fsResultFromPromise(surface2, (0, import_promises.chmod)(path2, mode), () => ({
|
|
53840
53839
|
cause: "file_not_chmodable",
|
|
53841
53840
|
message: "Failed to chmod file"
|
|
53842
53841
|
}));
|
|
53843
|
-
var safeFileExists = (surface2, path2) => {
|
|
53844
|
-
const fileExists = (0, import_fs.existsSync)(path2);
|
|
53845
|
-
if (fileExists) {
|
|
53846
|
-
return ok2(true);
|
|
53847
|
-
}
|
|
53848
|
-
return err2(errorType, surface2, {
|
|
53849
|
-
cause: "file_not_found",
|
|
53850
|
-
message: "File not found"
|
|
53851
|
-
});
|
|
53852
|
-
};
|
|
53853
53842
|
|
|
53854
53843
|
// src/shared/fs.ts
|
|
53855
53844
|
init_cjs_shims();
|
|
53856
53845
|
var import_path = require("path");
|
|
53857
53846
|
var import_os = require("os");
|
|
53858
|
-
var
|
|
53847
|
+
var fs = __toESM(require("fs"), 1);
|
|
53859
53848
|
var BASE_DIRECTORY = (0, import_path.join)((0, import_os.homedir)(), ".x402scan-mcp");
|
|
53860
|
-
if (!
|
|
53861
|
-
|
|
53849
|
+
if (!fs.existsSync(BASE_DIRECTORY)) {
|
|
53850
|
+
fs.mkdirSync(BASE_DIRECTORY, { recursive: true });
|
|
53862
53851
|
}
|
|
53863
53852
|
var configFile = (name, defaultValue) => {
|
|
53864
|
-
if (!
|
|
53865
|
-
|
|
53853
|
+
if (!fs.existsSync(BASE_DIRECTORY)) {
|
|
53854
|
+
fs.mkdirSync(BASE_DIRECTORY, { recursive: true });
|
|
53866
53855
|
}
|
|
53867
53856
|
const filePath = (0, import_path.join)(BASE_DIRECTORY, name);
|
|
53868
|
-
if (!
|
|
53869
|
-
|
|
53857
|
+
if (!fs.existsSync(filePath)) {
|
|
53858
|
+
fs.writeFileSync(filePath, defaultValue);
|
|
53870
53859
|
}
|
|
53871
53860
|
return filePath;
|
|
53872
53861
|
};
|
|
@@ -53898,16 +53887,16 @@ var log = {
|
|
|
53898
53887
|
// src/server/index.ts
|
|
53899
53888
|
init_cjs_shims();
|
|
53900
53889
|
|
|
53901
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
53890
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
53902
53891
|
init_cjs_shims();
|
|
53903
53892
|
|
|
53904
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
53893
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
53905
53894
|
init_cjs_shims();
|
|
53906
53895
|
|
|
53907
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
53896
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
53908
53897
|
init_cjs_shims();
|
|
53909
53898
|
|
|
53910
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
53899
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
53911
53900
|
init_cjs_shims();
|
|
53912
53901
|
|
|
53913
53902
|
// ../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v3/index.js
|
|
@@ -69577,7 +69566,7 @@ init_cjs_shims();
|
|
|
69577
69566
|
// ../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/coerce.js
|
|
69578
69567
|
init_cjs_shims();
|
|
69579
69568
|
|
|
69580
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
69569
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
69581
69570
|
function isZ4Schema(s) {
|
|
69582
69571
|
const schema = s;
|
|
69583
69572
|
return !!schema._zod;
|
|
@@ -69721,7 +69710,7 @@ function getLiteralValue(schema) {
|
|
|
69721
69710
|
return void 0;
|
|
69722
69711
|
}
|
|
69723
69712
|
|
|
69724
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
69713
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
69725
69714
|
init_cjs_shims();
|
|
69726
69715
|
|
|
69727
69716
|
// ../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/index.js
|
|
@@ -71887,7 +71876,7 @@ function date4(params) {
|
|
|
71887
71876
|
// ../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/external.js
|
|
71888
71877
|
config(en_default2());
|
|
71889
71878
|
|
|
71890
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
71879
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
71891
71880
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
71892
71881
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
71893
71882
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -73405,13 +73394,13 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
73405
73394
|
}
|
|
73406
73395
|
};
|
|
73407
73396
|
|
|
73408
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
73397
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
73409
73398
|
init_cjs_shims();
|
|
73410
73399
|
function isTerminal(status) {
|
|
73411
73400
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
73412
73401
|
}
|
|
73413
73402
|
|
|
73414
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
73403
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
73415
73404
|
init_cjs_shims();
|
|
73416
73405
|
|
|
73417
73406
|
// ../../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@4.3.5/node_modules/zod-to-json-schema/dist/esm/index.js
|
|
@@ -74751,7 +74740,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
74751
74740
|
return combined;
|
|
74752
74741
|
};
|
|
74753
74742
|
|
|
74754
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
74743
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
74755
74744
|
function mapMiniTarget(t) {
|
|
74756
74745
|
if (!t)
|
|
74757
74746
|
return "draft-7";
|
|
@@ -74793,7 +74782,7 @@ function parseWithCompat(schema, data) {
|
|
|
74793
74782
|
return result.data;
|
|
74794
74783
|
}
|
|
74795
74784
|
|
|
74796
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
74785
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
74797
74786
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
74798
74787
|
var Protocol = class {
|
|
74799
74788
|
constructor(_options) {
|
|
@@ -75729,7 +75718,7 @@ function mergeCapabilities(base2, additional) {
|
|
|
75729
75718
|
return result;
|
|
75730
75719
|
}
|
|
75731
75720
|
|
|
75732
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
75721
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
75733
75722
|
init_cjs_shims();
|
|
75734
75723
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
75735
75724
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
@@ -75798,7 +75787,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
75798
75787
|
}
|
|
75799
75788
|
};
|
|
75800
75789
|
|
|
75801
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
75790
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
75802
75791
|
init_cjs_shims();
|
|
75803
75792
|
var ExperimentalServerTasks = class {
|
|
75804
75793
|
constructor(_server) {
|
|
@@ -75871,7 +75860,7 @@ var ExperimentalServerTasks = class {
|
|
|
75871
75860
|
}
|
|
75872
75861
|
};
|
|
75873
75862
|
|
|
75874
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
75863
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
75875
75864
|
init_cjs_shims();
|
|
75876
75865
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
75877
75866
|
if (!requests) {
|
|
@@ -75907,7 +75896,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
75907
75896
|
}
|
|
75908
75897
|
}
|
|
75909
75898
|
|
|
75910
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
75899
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
75911
75900
|
var Server = class extends Protocol {
|
|
75912
75901
|
/**
|
|
75913
75902
|
* Initializes this server with the given name and version information.
|
|
@@ -76287,7 +76276,7 @@ var Server = class extends Protocol {
|
|
|
76287
76276
|
}
|
|
76288
76277
|
};
|
|
76289
76278
|
|
|
76290
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
76279
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
76291
76280
|
init_cjs_shims();
|
|
76292
76281
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
76293
76282
|
function isCompletable(schema) {
|
|
@@ -76302,10 +76291,10 @@ var McpZodTypeKind;
|
|
|
76302
76291
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
76303
76292
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
76304
76293
|
|
|
76305
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
76294
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js
|
|
76306
76295
|
init_cjs_shims();
|
|
76307
76296
|
|
|
76308
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
76297
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
76309
76298
|
init_cjs_shims();
|
|
76310
76299
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
76311
76300
|
function validateToolName(name) {
|
|
@@ -76364,7 +76353,7 @@ function validateAndWarnToolName(name) {
|
|
|
76364
76353
|
return result.isValid;
|
|
76365
76354
|
}
|
|
76366
76355
|
|
|
76367
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
76356
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
76368
76357
|
init_cjs_shims();
|
|
76369
76358
|
var ExperimentalMcpServerTasks = class {
|
|
76370
76359
|
constructor(_mcpServer) {
|
|
@@ -76384,7 +76373,7 @@ var ExperimentalMcpServerTasks = class {
|
|
|
76384
76373
|
init_cjs_shims();
|
|
76385
76374
|
var zod_default = external_exports3;
|
|
76386
76375
|
|
|
76387
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
76376
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
76388
76377
|
var McpServer = class {
|
|
76389
76378
|
constructor(serverInfo, options) {
|
|
76390
76379
|
this._registeredResources = {};
|
|
@@ -77170,11 +77159,11 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
77170
77159
|
}
|
|
77171
77160
|
};
|
|
77172
77161
|
|
|
77173
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
77162
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
77174
77163
|
init_cjs_shims();
|
|
77175
77164
|
var import_node_process = __toESM(require("process"), 1);
|
|
77176
77165
|
|
|
77177
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
77166
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
77178
77167
|
init_cjs_shims();
|
|
77179
77168
|
var ReadBuffer = class {
|
|
77180
77169
|
append(chunk) {
|
|
@@ -77203,7 +77192,7 @@ function serializeMessage(message) {
|
|
|
77203
77192
|
return JSON.stringify(message) + "\n";
|
|
77204
77193
|
}
|
|
77205
77194
|
|
|
77206
|
-
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.
|
|
77195
|
+
// ../../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.5_zod@4.3.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
77207
77196
|
var StdioServerTransport = class {
|
|
77208
77197
|
constructor(_stdin = import_node_process.default.stdin, _stdout = import_node_process.default.stdout) {
|
|
77209
77198
|
this._stdin = _stdin;
|
|
@@ -77264,11 +77253,32 @@ var StdioServerTransport = class {
|
|
|
77264
77253
|
}
|
|
77265
77254
|
};
|
|
77266
77255
|
|
|
77256
|
+
// src/server/index.ts
|
|
77257
|
+
var import_crypto2 = require("crypto");
|
|
77258
|
+
|
|
77267
77259
|
// src/server/tools/x402-fetch.ts
|
|
77268
77260
|
init_cjs_shims();
|
|
77269
77261
|
|
|
77270
77262
|
// src/shared/neverthrow/fetch/index.ts
|
|
77271
77263
|
init_cjs_shims();
|
|
77264
|
+
|
|
77265
|
+
// src/shared/neverthrow/parse/index.ts
|
|
77266
|
+
init_cjs_shims();
|
|
77267
|
+
var type = "json";
|
|
77268
|
+
var parseErr = (surface2, error48) => err2(type, surface2, error48);
|
|
77269
|
+
var safeParse4 = (surface2, schema, value) => {
|
|
77270
|
+
const parseResult = schema.safeParse(value);
|
|
77271
|
+
if (!parseResult.success) {
|
|
77272
|
+
return parseErr(surface2, {
|
|
77273
|
+
cause: "invalid_data",
|
|
77274
|
+
message: JSON.stringify(zod_default.treeifyError(parseResult.error), null, 2),
|
|
77275
|
+
error: parseResult.error
|
|
77276
|
+
});
|
|
77277
|
+
}
|
|
77278
|
+
return ok2(parseResult.data);
|
|
77279
|
+
};
|
|
77280
|
+
|
|
77281
|
+
// src/shared/neverthrow/fetch/index.ts
|
|
77272
77282
|
var errorType2 = "fetch";
|
|
77273
77283
|
var fetchErr = (surface2, error48) => err2(errorType2, surface2, error48);
|
|
77274
77284
|
var fetchHttpErr = (surface2, response) => fetchErr(surface2, {
|
|
@@ -77288,23 +77298,18 @@ var safeFetch = (surface2, request) => {
|
|
|
77288
77298
|
})
|
|
77289
77299
|
);
|
|
77290
77300
|
};
|
|
77291
|
-
var safeFetchJson = (surface2, request) => {
|
|
77301
|
+
var safeFetchJson = (surface2, request, schema) => {
|
|
77292
77302
|
return safeFetch(surface2, request).andThen((response) => {
|
|
77293
77303
|
if (!response.ok) {
|
|
77294
77304
|
return fetchHttpErr(surface2, response);
|
|
77295
77305
|
}
|
|
77296
|
-
return resultFromPromise(
|
|
77297
|
-
|
|
77298
|
-
|
|
77299
|
-
response.
|
|
77300
|
-
()
|
|
77301
|
-
|
|
77302
|
-
|
|
77303
|
-
statusCode: response.status,
|
|
77304
|
-
contentType: response.headers.get("content-type") ?? "Not specified"
|
|
77305
|
-
})
|
|
77306
|
-
);
|
|
77307
|
-
});
|
|
77306
|
+
return resultFromPromise(errorType2, surface2, response.json(), () => ({
|
|
77307
|
+
cause: "parse",
|
|
77308
|
+
message: "Could not parse JSON from response",
|
|
77309
|
+
statusCode: response.status,
|
|
77310
|
+
contentType: response.headers.get("content-type") ?? "Not specified"
|
|
77311
|
+
}));
|
|
77312
|
+
}).andThen((data) => safeParse4(surface2, schema, data));
|
|
77308
77313
|
};
|
|
77309
77314
|
var safeParseResponse = (surface2, response) => {
|
|
77310
77315
|
return resultFromPromise(
|
|
@@ -77903,15 +77908,15 @@ init_cjs_shims();
|
|
|
77903
77908
|
|
|
77904
77909
|
// src/shared/neverthrow/json/index.ts
|
|
77905
77910
|
init_cjs_shims();
|
|
77906
|
-
var
|
|
77911
|
+
var type2 = "json";
|
|
77907
77912
|
var jsonErr = (surface2, error48) => {
|
|
77908
|
-
return err2(
|
|
77913
|
+
return err2(type2, surface2, error48);
|
|
77909
77914
|
};
|
|
77910
77915
|
var safeStringifyJson = (surface2, value) => {
|
|
77911
77916
|
return resultFromThrowable(
|
|
77912
|
-
|
|
77917
|
+
type2,
|
|
77913
77918
|
surface2,
|
|
77914
|
-
() => JSON.stringify(value),
|
|
77919
|
+
() => JSON.stringify(value, null, 2),
|
|
77915
77920
|
() => ({
|
|
77916
77921
|
cause: "stringify",
|
|
77917
77922
|
message: "Could not stringify JSON"
|
|
@@ -77920,7 +77925,7 @@ var safeStringifyJson = (surface2, value) => {
|
|
|
77920
77925
|
};
|
|
77921
77926
|
var safeParseJson = (surface2, value) => {
|
|
77922
77927
|
return resultFromThrowable(
|
|
77923
|
-
|
|
77928
|
+
type2,
|
|
77924
77929
|
surface2,
|
|
77925
77930
|
() => JSON.parse(value),
|
|
77926
77931
|
(e) => ({
|
|
@@ -78038,13 +78043,19 @@ var requestSchema = zod_default.object({
|
|
|
78038
78043
|
body: zod_default.unknown().optional().describe("Request body for POST/PUT/PATCH methods"),
|
|
78039
78044
|
headers: zod_default.record(zod_default.string(), zod_default.string()).optional().describe("Additional headers to include").default({})
|
|
78040
78045
|
});
|
|
78041
|
-
var buildRequest = (
|
|
78046
|
+
var buildRequest = ({
|
|
78047
|
+
input,
|
|
78048
|
+
address,
|
|
78049
|
+
sessionId
|
|
78050
|
+
}) => {
|
|
78042
78051
|
return new Request(input.url, {
|
|
78043
78052
|
method: input.method,
|
|
78044
78053
|
body: input.body ? typeof input.body === "string" ? input.body : JSON.stringify(input.body) : void 0,
|
|
78045
78054
|
headers: {
|
|
78046
78055
|
...input.body ? { "Content-Type": "application/json" } : {},
|
|
78047
|
-
...input.headers
|
|
78056
|
+
...input.headers,
|
|
78057
|
+
...address ? { "X-Wallet-Address": address, "X-Client-ID": address } : {},
|
|
78058
|
+
...sessionId ? { "X-Session-ID": sessionId } : {}
|
|
78048
78059
|
}
|
|
78049
78060
|
});
|
|
78050
78061
|
};
|
|
@@ -78064,13 +78075,13 @@ var import_node_process8 = __toESM(require("process"), 1);
|
|
|
78064
78075
|
var import_node_path = __toESM(require("path"), 1);
|
|
78065
78076
|
var import_node_url = require("url");
|
|
78066
78077
|
var import_node_child_process7 = __toESM(require("child_process"), 1);
|
|
78067
|
-
var
|
|
78078
|
+
var import_promises4 = __toESM(require("fs/promises"), 1);
|
|
78068
78079
|
|
|
78069
78080
|
// ../../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
|
|
78070
78081
|
init_cjs_shims();
|
|
78071
78082
|
var import_node_util2 = require("util");
|
|
78072
78083
|
var import_node_child_process2 = __toESM(require("child_process"), 1);
|
|
78073
|
-
var
|
|
78084
|
+
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
78074
78085
|
|
|
78075
78086
|
// ../../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
|
|
78076
78087
|
init_cjs_shims();
|
|
@@ -78150,7 +78161,7 @@ var import_node_process3 = __toESM(require("process"), 1);
|
|
|
78150
78161
|
var import_node_buffer = require("buffer");
|
|
78151
78162
|
var import_node_util = require("util");
|
|
78152
78163
|
var import_node_child_process = __toESM(require("child_process"), 1);
|
|
78153
|
-
var
|
|
78164
|
+
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
78154
78165
|
var execFile = (0, import_node_util.promisify)(import_node_child_process.default.execFile);
|
|
78155
78166
|
var powerShellPath = () => `${import_node_process3.default.env.SYSTEMROOT || import_node_process3.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
78156
78167
|
var executePowerShell = async (command, options = {}) => {
|
|
@@ -78208,14 +78219,14 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
|
78208
78219
|
const configFilePath = "/etc/wsl.conf";
|
|
78209
78220
|
let isConfigFileExists = false;
|
|
78210
78221
|
try {
|
|
78211
|
-
await
|
|
78222
|
+
await import_promises3.default.access(configFilePath, import_promises3.constants.F_OK);
|
|
78212
78223
|
isConfigFileExists = true;
|
|
78213
78224
|
} catch {
|
|
78214
78225
|
}
|
|
78215
78226
|
if (!isConfigFileExists) {
|
|
78216
78227
|
return defaultMountPoint;
|
|
78217
78228
|
}
|
|
78218
|
-
const configContent = await
|
|
78229
|
+
const configContent = await import_promises3.default.readFile(configFilePath, { encoding: "utf8" });
|
|
78219
78230
|
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
78220
78231
|
if (parsedMountPoint === void 0) {
|
|
78221
78232
|
return defaultMountPoint;
|
|
@@ -78235,7 +78246,7 @@ var canAccessPowerShell = async () => {
|
|
|
78235
78246
|
canAccessPowerShellPromise ??= (async () => {
|
|
78236
78247
|
try {
|
|
78237
78248
|
const psPath = await powerShellPath2();
|
|
78238
|
-
await
|
|
78249
|
+
await import_promises3.default.access(psPath, import_promises3.constants.X_OK);
|
|
78239
78250
|
return true;
|
|
78240
78251
|
} catch {
|
|
78241
78252
|
return false;
|
|
@@ -78553,7 +78564,7 @@ var baseOpen = async (options) => {
|
|
|
78553
78564
|
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
78554
78565
|
let exeLocalXdgOpen = false;
|
|
78555
78566
|
try {
|
|
78556
|
-
await
|
|
78567
|
+
await import_promises4.default.access(localXdgOpenPath, import_promises4.constants.X_OK);
|
|
78557
78568
|
exeLocalXdgOpen = true;
|
|
78558
78569
|
} catch {
|
|
78559
78570
|
}
|
|
@@ -78710,6 +78721,10 @@ var getBalance = async ({
|
|
|
78710
78721
|
headers: {
|
|
78711
78722
|
accept: "application/json"
|
|
78712
78723
|
}
|
|
78724
|
+
}),
|
|
78725
|
+
zod_default.object({
|
|
78726
|
+
chain: zod_default.number(),
|
|
78727
|
+
balance: zod_default.number()
|
|
78713
78728
|
})
|
|
78714
78729
|
);
|
|
78715
78730
|
return res;
|
|
@@ -80735,7 +80750,8 @@ var toolName = "fetch";
|
|
|
80735
80750
|
var registerFetchX402ResourceTool = ({
|
|
80736
80751
|
server,
|
|
80737
80752
|
account,
|
|
80738
|
-
flags
|
|
80753
|
+
flags,
|
|
80754
|
+
sessionId
|
|
80739
80755
|
}) => {
|
|
80740
80756
|
server.registerTool(
|
|
80741
80757
|
toolName,
|
|
@@ -80762,7 +80778,9 @@ var registerFetchX402ResourceTool = ({
|
|
|
80762
80778
|
});
|
|
80763
80779
|
const client = new x402HTTPClient(coreClient);
|
|
80764
80780
|
const fetchWithPay = safeWrapFetchWithPayment(client);
|
|
80765
|
-
const fetchResult = await fetchWithPay(
|
|
80781
|
+
const fetchResult = await fetchWithPay(
|
|
80782
|
+
buildRequest({ input, address: account.address, sessionId })
|
|
80783
|
+
);
|
|
80766
80784
|
if (fetchResult.isErr()) {
|
|
80767
80785
|
return mcpError(fetchResult);
|
|
80768
80786
|
}
|
|
@@ -80787,8 +80805,7 @@ var registerFetchX402ResourceTool = ({
|
|
|
80787
80805
|
);
|
|
80788
80806
|
};
|
|
80789
80807
|
function safeWrapFetchWithPayment(client) {
|
|
80790
|
-
return async (
|
|
80791
|
-
const request = new Request(input, init);
|
|
80808
|
+
return async (request) => {
|
|
80792
80809
|
const clonedRequest = request.clone();
|
|
80793
80810
|
const probeResult = await safeFetch(toolName, request);
|
|
80794
80811
|
if (probeResult.isErr()) {
|
|
@@ -80857,7 +80874,11 @@ var getSiwxExtension = (extensions) => {
|
|
|
80857
80874
|
|
|
80858
80875
|
// src/server/tools/auth-fetch.ts
|
|
80859
80876
|
var toolName2 = "fetchWithAuth";
|
|
80860
|
-
var registerAuthTools = ({
|
|
80877
|
+
var registerAuthTools = ({
|
|
80878
|
+
server,
|
|
80879
|
+
account,
|
|
80880
|
+
sessionId
|
|
80881
|
+
}) => {
|
|
80861
80882
|
server.registerTool(
|
|
80862
80883
|
toolName2,
|
|
80863
80884
|
{
|
|
@@ -80866,7 +80887,10 @@ var registerAuthTools = ({ server, account }) => {
|
|
|
80866
80887
|
},
|
|
80867
80888
|
async (input) => {
|
|
80868
80889
|
const httpClient = new x402HTTPClient(new x402Client());
|
|
80869
|
-
const firstResult = await safeFetch(
|
|
80890
|
+
const firstResult = await safeFetch(
|
|
80891
|
+
toolName2,
|
|
80892
|
+
buildRequest({ input, address: account.address, sessionId })
|
|
80893
|
+
);
|
|
80870
80894
|
if (firstResult.isErr()) {
|
|
80871
80895
|
return mcpError(firstResult);
|
|
80872
80896
|
}
|
|
@@ -80937,7 +80961,11 @@ var registerAuthTools = ({ server, account }) => {
|
|
|
80937
80961
|
return mcpError(payloadResult);
|
|
80938
80962
|
}
|
|
80939
80963
|
const siwxHeader = encodeSIWxHeader(payloadResult.value);
|
|
80940
|
-
const authedRequest = buildRequest(
|
|
80964
|
+
const authedRequest = buildRequest({
|
|
80965
|
+
input,
|
|
80966
|
+
address: account.address,
|
|
80967
|
+
sessionId
|
|
80968
|
+
});
|
|
80941
80969
|
authedRequest.headers.set("SIGN-IN-WITH-X", siwxHeader);
|
|
80942
80970
|
const authedResult = await safeFetch(toolName2, authedRequest);
|
|
80943
80971
|
if (authedResult.isErr()) {
|
|
@@ -81006,7 +81034,11 @@ var registerWalletTools = ({
|
|
|
81006
81034
|
// src/server/tools/check-endpoint.ts
|
|
81007
81035
|
init_cjs_shims();
|
|
81008
81036
|
var toolName4 = "checkEndpointSchema";
|
|
81009
|
-
var registerCheckX402EndpointTool = ({
|
|
81037
|
+
var registerCheckX402EndpointTool = ({
|
|
81038
|
+
server,
|
|
81039
|
+
account,
|
|
81040
|
+
sessionId
|
|
81041
|
+
}) => {
|
|
81010
81042
|
server.registerTool(
|
|
81011
81043
|
toolName4,
|
|
81012
81044
|
{
|
|
@@ -81015,7 +81047,10 @@ var registerCheckX402EndpointTool = ({ server }) => {
|
|
|
81015
81047
|
},
|
|
81016
81048
|
async (input) => {
|
|
81017
81049
|
log.info("Querying endpoint", input);
|
|
81018
|
-
const responseResult = await safeFetch(
|
|
81050
|
+
const responseResult = await safeFetch(
|
|
81051
|
+
toolName4,
|
|
81052
|
+
buildRequest({ input, address: account.address, sessionId })
|
|
81053
|
+
);
|
|
81019
81054
|
if (responseResult.isErr()) {
|
|
81020
81055
|
return mcpError(responseResult);
|
|
81021
81056
|
}
|
|
@@ -81067,14 +81102,14 @@ init_cjs_shims();
|
|
|
81067
81102
|
|
|
81068
81103
|
// src/shared/state.ts
|
|
81069
81104
|
init_cjs_shims();
|
|
81070
|
-
var
|
|
81105
|
+
var import_fs3 = __toESM(require("fs"), 1);
|
|
81071
81106
|
var STATE_FILE = configFile("state.json", "{}");
|
|
81072
81107
|
var stateSchema = zod_default.looseObject({
|
|
81073
81108
|
redeemedCodes: zod_default.array(zod_default.string())
|
|
81074
81109
|
}).partial();
|
|
81075
81110
|
var getState = () => {
|
|
81076
81111
|
const result = stateSchema.safeParse(
|
|
81077
|
-
JSON.parse(
|
|
81112
|
+
JSON.parse(import_fs3.default.readFileSync(STATE_FILE, "utf-8"))
|
|
81078
81113
|
);
|
|
81079
81114
|
if (!result.success) {
|
|
81080
81115
|
log.error("Failed to parse state", { error: result.error });
|
|
@@ -81085,7 +81120,7 @@ var getState = () => {
|
|
|
81085
81120
|
var setState = (state) => {
|
|
81086
81121
|
const existing = getState();
|
|
81087
81122
|
const newState = stateSchema.parse({ ...existing, ...state });
|
|
81088
|
-
|
|
81123
|
+
import_fs3.default.writeFileSync(STATE_FILE, JSON.stringify(newState, null, 2));
|
|
81089
81124
|
};
|
|
81090
81125
|
|
|
81091
81126
|
// src/shared/redeem-invite.ts
|
|
@@ -81113,6 +81148,11 @@ var redeemInviteCode = async ({
|
|
|
81113
81148
|
code,
|
|
81114
81149
|
recipientAddr: address
|
|
81115
81150
|
})
|
|
81151
|
+
}),
|
|
81152
|
+
zod_default.object({
|
|
81153
|
+
redemptionId: zod_default.string(),
|
|
81154
|
+
txHash: zod_default.string(),
|
|
81155
|
+
amount: zod_default.coerce.number()
|
|
81116
81156
|
})
|
|
81117
81157
|
);
|
|
81118
81158
|
if (result.isOk()) {
|
|
@@ -81163,16 +81203,16 @@ init_cjs_shims();
|
|
|
81163
81203
|
|
|
81164
81204
|
// src/server/lib/version.ts
|
|
81165
81205
|
init_cjs_shims();
|
|
81166
|
-
var
|
|
81206
|
+
var import_fs5 = require("fs");
|
|
81167
81207
|
var import_path2 = require("path");
|
|
81168
81208
|
var import_url = require("url");
|
|
81169
81209
|
function getVersion() {
|
|
81170
81210
|
if (true) {
|
|
81171
|
-
return "0.0.
|
|
81211
|
+
return "0.0.8-beta.0";
|
|
81172
81212
|
}
|
|
81173
81213
|
const __dirname3 = (0, import_path2.dirname)((0, import_url.fileURLToPath)(importMetaUrl));
|
|
81174
81214
|
const pkg = JSON.parse(
|
|
81175
|
-
(0,
|
|
81215
|
+
(0, import_fs5.readFileSync)((0, import_path2.join)(__dirname3, "../../../package.json"), "utf-8")
|
|
81176
81216
|
);
|
|
81177
81217
|
return pkg.version;
|
|
81178
81218
|
}
|
|
@@ -81218,6 +81258,9 @@ var registerTelemetryTools = ({
|
|
|
81218
81258
|
mcpVersion: MCP_VERSION,
|
|
81219
81259
|
reportedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
81220
81260
|
})
|
|
81261
|
+
}),
|
|
81262
|
+
zod_default.object({
|
|
81263
|
+
reportId: zod_default.string()
|
|
81221
81264
|
})
|
|
81222
81265
|
);
|
|
81223
81266
|
if (telemetryResult.isErr()) {
|
|
@@ -81277,18 +81320,16 @@ function registerDiscoveryTools(server) {
|
|
|
81277
81320
|
log.debug(`Fetching discovery document from: ${wellKnownUrl}`);
|
|
81278
81321
|
const wellKnownResult = await safeFetchJson(
|
|
81279
81322
|
toolName7,
|
|
81280
|
-
new Request(wellKnownUrl, { headers: { Accept: "application/json" } })
|
|
81323
|
+
new Request(wellKnownUrl, { headers: { Accept: "application/json" } }),
|
|
81324
|
+
discoveryDocumentSchema
|
|
81281
81325
|
);
|
|
81282
81326
|
if (wellKnownResult.isOk()) {
|
|
81283
|
-
|
|
81284
|
-
|
|
81285
|
-
|
|
81286
|
-
|
|
81287
|
-
|
|
81288
|
-
|
|
81289
|
-
data: parsed.data
|
|
81290
|
-
});
|
|
81291
|
-
}
|
|
81327
|
+
return mcpSuccessJson({
|
|
81328
|
+
found: true,
|
|
81329
|
+
origin,
|
|
81330
|
+
source: "well-known",
|
|
81331
|
+
data: wellKnownResult.value
|
|
81332
|
+
});
|
|
81292
81333
|
} else {
|
|
81293
81334
|
log.info(
|
|
81294
81335
|
`No well-known x402 discovery document found at ${wellKnownUrl}`
|
|
@@ -81301,14 +81342,22 @@ function registerDiscoveryTools(server) {
|
|
|
81301
81342
|
new Request(
|
|
81302
81343
|
`https://cloudflare-dns.com/dns-query?name=${encodeURIComponent(dnsQuery)}&type=TXT`,
|
|
81303
81344
|
{ headers: { Accept: "application/dns-json" } }
|
|
81304
|
-
)
|
|
81345
|
+
),
|
|
81346
|
+
external_exports3.object({
|
|
81347
|
+
Answer: external_exports3.array(
|
|
81348
|
+
external_exports3.object({
|
|
81349
|
+
data: external_exports3.string()
|
|
81350
|
+
})
|
|
81351
|
+
).optional()
|
|
81352
|
+
})
|
|
81305
81353
|
);
|
|
81306
81354
|
if (dnsResult.isOk() && dnsResult.value.Answer && dnsResult.value.Answer.length > 0) {
|
|
81307
81355
|
const dnsUrl = dnsResult.value.Answer[0].data.replace(/^"|"$/g, "");
|
|
81308
81356
|
if (URL.canParse(dnsUrl)) {
|
|
81309
81357
|
const dnsDocResult = await safeFetchJson(
|
|
81310
81358
|
toolName7,
|
|
81311
|
-
new Request(dnsUrl, { headers: { Accept: "application/json" } })
|
|
81359
|
+
new Request(dnsUrl, { headers: { Accept: "application/json" } }),
|
|
81360
|
+
discoveryDocumentSchema
|
|
81312
81361
|
);
|
|
81313
81362
|
if (dnsDocResult.isOk()) {
|
|
81314
81363
|
const parsed = discoveryDocumentSchema.safeParse(
|
|
@@ -81483,6 +81532,7 @@ var getResourceResponse = async (resource, response) => {
|
|
|
81483
81532
|
|
|
81484
81533
|
// src/shared/wallet.ts
|
|
81485
81534
|
init_cjs_shims();
|
|
81535
|
+
var import_fs6 = require("fs");
|
|
81486
81536
|
|
|
81487
81537
|
// ../../../node_modules/.pnpm/viem@2.44.1_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.5/node_modules/viem/_esm/accounts/index.js
|
|
81488
81538
|
init_cjs_shims();
|
|
@@ -81641,22 +81691,6 @@ function privateKeyToAccount(privateKey, options = {}) {
|
|
|
81641
81691
|
};
|
|
81642
81692
|
}
|
|
81643
81693
|
|
|
81644
|
-
// src/shared/neverthrow/parse/index.ts
|
|
81645
|
-
init_cjs_shims();
|
|
81646
|
-
var type2 = "json";
|
|
81647
|
-
var parseErr = (surface2, error48) => err2(type2, surface2, error48);
|
|
81648
|
-
var safeParse4 = (surface2, schema, value) => {
|
|
81649
|
-
const parseResult = schema.safeParse(value);
|
|
81650
|
-
if (!parseResult.success) {
|
|
81651
|
-
return parseErr(surface2, {
|
|
81652
|
-
cause: "invalid_data",
|
|
81653
|
-
message: JSON.stringify(zod_default.treeifyError(parseResult.error), null, 2),
|
|
81654
|
-
error: parseResult.error
|
|
81655
|
-
});
|
|
81656
|
-
}
|
|
81657
|
-
return ok2(parseResult.data);
|
|
81658
|
-
};
|
|
81659
|
-
|
|
81660
81694
|
// src/shared/wallet.ts
|
|
81661
81695
|
var WALLET_FILE = configFile("wallet.json", "");
|
|
81662
81696
|
var storedWalletSchema = zod_default.object({
|
|
@@ -81673,8 +81707,8 @@ async function getWallet() {
|
|
|
81673
81707
|
}
|
|
81674
81708
|
const readFileResult = await safeReadFile(walletSurface, WALLET_FILE);
|
|
81675
81709
|
if (!readFileResult.isOk()) {
|
|
81676
|
-
const fileExistsResult =
|
|
81677
|
-
if (fileExistsResult
|
|
81710
|
+
const fileExistsResult = (0, import_fs6.existsSync)(WALLET_FILE);
|
|
81711
|
+
if (fileExistsResult) {
|
|
81678
81712
|
return fsErr(walletSurface, {
|
|
81679
81713
|
cause: "file_not_readable",
|
|
81680
81714
|
message: `The file exists but is not readable. Fix corrupted state file: ${WALLET_FILE}`
|
|
@@ -81734,6 +81768,7 @@ var startServer = async (flags) => {
|
|
|
81734
81768
|
}
|
|
81735
81769
|
const { account } = walletResult.value;
|
|
81736
81770
|
const code = invite ?? process.env.INVITE_CODE;
|
|
81771
|
+
const sessionId = (0, import_crypto2.randomBytes)(16).toString("hex");
|
|
81737
81772
|
if (code) {
|
|
81738
81773
|
await redeemInviteCode({
|
|
81739
81774
|
code,
|
|
@@ -81761,7 +81796,8 @@ var startServer = async (flags) => {
|
|
|
81761
81796
|
const props = {
|
|
81762
81797
|
server,
|
|
81763
81798
|
account,
|
|
81764
|
-
flags
|
|
81799
|
+
flags,
|
|
81800
|
+
sessionId
|
|
81765
81801
|
};
|
|
81766
81802
|
registerFetchX402ResourceTool(props);
|
|
81767
81803
|
registerAuthTools(props);
|