hvip-mcp-server 0.2.35 → 0.2.38

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.
Files changed (2) hide show
  1. package/dist/index.js +56 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3226,8 +3226,8 @@ var require_utils = __commonJS({
3226
3226
  }
3227
3227
  return ind;
3228
3228
  }
3229
- function removeDotSegments(path) {
3230
- let input = path;
3229
+ function removeDotSegments(path2) {
3230
+ let input = path2;
3231
3231
  const output = [];
3232
3232
  let nextSlash = -1;
3233
3233
  let len = 0;
@@ -3479,8 +3479,8 @@ var require_schemes = __commonJS({
3479
3479
  wsComponent.secure = void 0;
3480
3480
  }
3481
3481
  if (wsComponent.resourceName) {
3482
- const [path, query] = wsComponent.resourceName.split("?");
3483
- wsComponent.path = path && path !== "/" ? path : void 0;
3482
+ const [path2, query] = wsComponent.resourceName.split("?");
3483
+ wsComponent.path = path2 && path2 !== "/" ? path2 : void 0;
3484
3484
  wsComponent.query = query;
3485
3485
  wsComponent.resourceName = void 0;
3486
3486
  }
@@ -6873,12 +6873,12 @@ var require_dist = __commonJS({
6873
6873
  throw new Error(`Unknown format "${name}"`);
6874
6874
  return f;
6875
6875
  };
6876
- function addFormats(ajv, list, fs, exportName) {
6876
+ function addFormats(ajv, list, fs2, exportName) {
6877
6877
  var _a;
6878
6878
  var _b;
6879
6879
  (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
6880
6880
  for (const f of list)
6881
- ajv.addFormat(f, fs[f]);
6881
+ ajv.addFormat(f, fs2[f]);
6882
6882
  }
6883
6883
  module2.exports = exports2 = formatsPlugin;
6884
6884
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -7364,8 +7364,8 @@ function getErrorMap() {
7364
7364
 
7365
7365
  // node_modules/zod/v3/helpers/parseUtil.js
7366
7366
  var makeIssue = (params) => {
7367
- const { data, path, errorMaps, issueData } = params;
7368
- const fullPath = [...path, ...issueData.path || []];
7367
+ const { data, path: path2, errorMaps, issueData } = params;
7368
+ const fullPath = [...path2, ...issueData.path || []];
7369
7369
  const fullIssue = {
7370
7370
  ...issueData,
7371
7371
  path: fullPath
@@ -7481,11 +7481,11 @@ var errorUtil;
7481
7481
 
7482
7482
  // node_modules/zod/v3/types.js
7483
7483
  var ParseInputLazyPath = class {
7484
- constructor(parent, value, path, key) {
7484
+ constructor(parent, value, path2, key) {
7485
7485
  this._cachedPath = [];
7486
7486
  this.parent = parent;
7487
7487
  this.data = value;
7488
- this._path = path;
7488
+ this._path = path2;
7489
7489
  this._key = key;
7490
7490
  }
7491
7491
  get path() {
@@ -11122,10 +11122,10 @@ function assignProp(target, prop, value) {
11122
11122
  configurable: true
11123
11123
  });
11124
11124
  }
11125
- function getElementAtPath(obj, path) {
11126
- if (!path)
11125
+ function getElementAtPath(obj, path2) {
11126
+ if (!path2)
11127
11127
  return obj;
11128
- return path.reduce((acc, key) => acc?.[key], obj);
11128
+ return path2.reduce((acc, key) => acc?.[key], obj);
11129
11129
  }
11130
11130
  function promiseAllObject(promisesObj) {
11131
11131
  const keys = Object.keys(promisesObj);
@@ -11445,11 +11445,11 @@ function aborted(x, startIndex = 0) {
11445
11445
  }
11446
11446
  return false;
11447
11447
  }
11448
- function prefixIssues(path, issues) {
11448
+ function prefixIssues(path2, issues) {
11449
11449
  return issues.map((iss) => {
11450
11450
  var _a;
11451
11451
  (_a = iss).path ?? (_a.path = []);
11452
- iss.path.unshift(path);
11452
+ iss.path.unshift(path2);
11453
11453
  return iss;
11454
11454
  });
11455
11455
  }
@@ -21101,8 +21101,8 @@ var StdioServerTransport = class {
21101
21101
  // src/adapters/okx.ts
21102
21102
  var import_node_crypto = __toESM(require("node:crypto"));
21103
21103
  var BASE = "https://www.okx.com";
21104
- function sign(ts, method, path, body, secret) {
21105
- const msg = ts + method + path + body;
21104
+ function sign(ts, method, path2, body, secret) {
21105
+ const msg = ts + method + path2 + body;
21106
21106
  return import_node_crypto.default.createHmac("sha256", secret).update(msg).digest("base64");
21107
21107
  }
21108
21108
  function timestamp() {
@@ -21115,9 +21115,9 @@ function buildQuery(params) {
21115
21115
  }
21116
21116
  return p.size ? "?" + p.toString() : "";
21117
21117
  }
21118
- async function request(method, path, options = {}) {
21118
+ async function request(method, path2, options = {}) {
21119
21119
  const query = options.params ? buildQuery(options.params) : "";
21120
- const fullPath = path + query;
21120
+ const fullPath = path2 + query;
21121
21121
  const bodyStr = options.body ? JSON.stringify(options.body) : "";
21122
21122
  const headers = {
21123
21123
  "Content-Type": "application/json",
@@ -21484,12 +21484,12 @@ var privateApi = {
21484
21484
 
21485
21485
  // src/adapters/hrails.ts
21486
21486
  var DEFAULT_BASE = "https://api-staging.hwallet.vip";
21487
- async function request2(path, params = {}, apiKey, base) {
21487
+ async function request2(path2, params = {}, apiKey, base) {
21488
21488
  const filtered = Object.entries(params).filter(([, v]) => v !== void 0 && v !== "");
21489
21489
  const p = new URLSearchParams();
21490
21490
  for (const [k, v] of filtered) p.append(k, String(v));
21491
21491
  const query = p.size ? "?" + p.toString() : "";
21492
- const res = await fetch(base + path + query, {
21492
+ const res = await fetch(base + path2 + query, {
21493
21493
  headers: {
21494
21494
  "Accept": "application/json",
21495
21495
  "Authorization": `Bearer ${apiKey}`
@@ -21501,7 +21501,7 @@ async function request2(path, params = {}, apiKey, base) {
21501
21501
  return json.data ?? json;
21502
21502
  }
21503
21503
  function createHRailsClient(apiKey, baseUrl = DEFAULT_BASE) {
21504
- const get = (path, params) => request2(path, params, apiKey, baseUrl);
21504
+ const get = (path2, params) => request2(path2, params, apiKey, baseUrl);
21505
21505
  return {
21506
21506
  health: () => fetch(baseUrl + "/health").then((r) => r.json()),
21507
21507
  listEvents: (params) => {
@@ -27146,6 +27146,9 @@ function registerFiatTools(server, auth) {
27146
27146
  }
27147
27147
 
27148
27148
  // src/tools/agent-utils.ts
27149
+ var fs = __toESM(require("node:fs"));
27150
+ var path = __toESM(require("node:path"));
27151
+ var os = __toESM(require("node:os"));
27149
27152
  function registerAgentUtils(server, auth) {
27150
27153
  server.tool(
27151
27154
  "okx_account_overview",
@@ -27372,11 +27375,41 @@ function registerAgentUtils(server, auth) {
27372
27375
  }
27373
27376
  }
27374
27377
  );
27378
+ server.tool(
27379
+ "okx_agent_feedback",
27380
+ "## \u529F\u80FD\uFF1A\u63D0\u4EA4\u4F7F\u7528\u53CD\u9988\u2014\u2014\u5F53\u4F60\u9047\u5230\u591A\u6B65\u64CD\u4F5C\u70E6\u7410\u3001\u53C2\u6570\u8BD5\u9519\u3001\u4E0D\u77E5\u9053\u8C03\u7528\u987A\u5E8F\u3001\u641C\u7D22\u4E0D\u5230\u5DE5\u5177\u3001\u6216\u9700\u8981\u4F7F\u7528\u624B\u5DE5\u8BA1\u7B97\u5F25\u8865\u4E0D\u8DB3\u65F6\uFF0C\u8C03\u7528\u6B64\u5DE5\u5177\u8BB0\u5F55\u4E0B\u6765\n## \u573A\u666F\uFF1A\u7528\u4E8EAgent\u6C47\u62A5MCP\u5DE5\u5177\u7684\u4F7F\u7528\u75DB\u70B9\uFF0C\u53CD\u9988\u5C06\u76F4\u63A5\u8FDB\u5165\u5F00\u53D1\u56E2\u961F\u7684\u5F85\u529E\u5217\u8868\uFF0C\u63A8\u52A8Skill\u7EC4\u5408\u548C\u5DE5\u5177\u4F18\u5316\n## \u5173\u952E\u8BCD\uFF1A\u53CD\u9988, feedback, \u7559\u8A00, \u5EFA\u8BAE, \u75DB\u70B9, \u6539\u5584\u5EFA\u8BAE\n## \u53C2\u6570\uFF1A\n## - title: \u4E00\u53E5\u8BDD\u6807\u9898\n## - what: \u4F60\u505A\u4E86\u4EC0\u4E48\u64CD\u4F5C\n## - tools: \u8C03\u7528\u4E86\u54EA\u4E9B\u5DE5\u5177\uFF08\u7528\u9017\u53F7\u5206\u9694\uFF09\n## - pain: \u75DB\u70B9\u662F\u4EC0\u4E48\n## - suggestion: \u4F60\u5EFA\u8BAE\u600E\u4E48\u6539\u5584\uFF08\u60F3\u8981\u4EC0\u4E48Skill\uFF09\n## \u9274\u6743\uFF1APUBLIC \u2014 \u65E0\u9700 API Key\uFF0C\u8C01\u90FD\u53EF\u4EE5\u53CD\u9988\n## \u98CE\u9669\uFF1AREAD \u2014 \u53EA\u5199\u65E5\u5FD7\uFF0CAgent \u53EF\u968F\u65F6\u8C03\u7528\n## \u8FD4\u56DE\u91CF\uFF1A\u5FAE\u5C0F ~200B\n## \u5173\u8054\uFF1A\u4EFB\u4F55\u5DE5\u5177\u7EC4\u5408\u9047\u5230\u963B\u788D\u65F6\u8C03\u7528 \u2192 \u5F00\u53D1\u8005\u5BA1\u67E5\u53CD\u9988 \u2192 \u521B\u5EFA Skill \u6216\u4F18\u5316\u5DE5\u5177",
27381
+ {
27382
+ title: external_exports.string().describe("\u4E00\u53E5\u8BDD\u6807\u9898"),
27383
+ what: external_exports.string().describe("\u4F60\u505A\u4E86\u4EC0\u4E48\u64CD\u4F5C"),
27384
+ tools: external_exports.string().describe("\u8C03\u7528\u4E86\u54EA\u4E9B\u5DE5\u5177\uFF0C\u7528\u9017\u53F7\u5206\u9694"),
27385
+ pain: external_exports.string().describe("\u75DB\u70B9\u662F\u4EC0\u4E48"),
27386
+ suggestion: external_exports.string().describe("\u4F60\u5EFA\u8BAE\u600E\u4E48\u6539\u5584\uFF0C\u60F3\u8981\u4EC0\u4E48 Skill")
27387
+ },
27388
+ async ({ title, what, tools, pain, suggestion }) => {
27389
+ try {
27390
+ const logDir = process.env.OKX_FEEDBACK_DIR || os.homedir();
27391
+ const logFile = path.join(logDir, "hvip-mcp-feedback.log");
27392
+ const entry = JSON.stringify({
27393
+ time: (/* @__PURE__ */ new Date()).toISOString(),
27394
+ title,
27395
+ what,
27396
+ tools,
27397
+ pain,
27398
+ suggestion,
27399
+ host: os.hostname()
27400
+ }) + "\n";
27401
+ fs.appendFileSync(logFile, entry, "utf-8");
27402
+ return toResult({ ok: true, saved: logFile, message: "\u53CD\u9988\u5DF2\u8BB0\u5F55\uFF0C\u611F\u8C22\uFF01" });
27403
+ } catch (e) {
27404
+ return toError(e);
27405
+ }
27406
+ }
27407
+ );
27375
27408
  }
27376
27409
 
27377
27410
  // src/index.ts
27378
27411
  async function main() {
27379
- const server = new McpServer({ name: "hvip", version: "0.2.1" });
27412
+ const server = new McpServer({ name: "hvip", version: "0.2.35" });
27380
27413
  const auth = getAuth();
27381
27414
  registerMarketTools(server);
27382
27415
  registerPublicTools(server, auth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvip-mcp-server",
3
- "version": "0.2.35",
3
+ "version": "0.2.38",
4
4
  "description": "OKX ecosystem MCP server - full API coverage for AI agents",
5
5
  "homepage": "https://hvip.one",
6
6
  "license": "MIT",