@pionex/pionex-ai-kit 0.2.36 → 0.2.37

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.js CHANGED
@@ -3,6 +3,7 @@
3
3
  // src/index.ts
4
4
  import { createInterface } from "readline";
5
5
  import { basename } from "path";
6
+ import { createRequire } from "module";
6
7
 
7
8
  // ../core/dist/index.js
8
9
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
@@ -2373,6 +2374,8 @@ function createToolRunner(client, config) {
2373
2374
  }
2374
2375
 
2375
2376
  // src/index.ts
2377
+ var _require = createRequire(import.meta.url);
2378
+ var { version } = _require("../package.json");
2376
2379
  var DEFAULT_PROFILE_NAME = "pionx-prod";
2377
2380
  var DEFAULT_BASE_URL = "https://api.pionex.com";
2378
2381
  function ask(rl, question, defaultValue = "") {
@@ -2381,7 +2384,9 @@ function ask(rl, question, defaultValue = "") {
2381
2384
  }
2382
2385
  async function cmdOnboard() {
2383
2386
  const rl = createInterface({ input: process.stdin, output: process.stdout });
2384
- process.stdout.write("\n pionex-ai-kit v0.2.x\n");
2387
+ process.stdout.write(`
2388
+ pionex-ai-kit v${version}
2389
+ `);
2385
2390
  process.stdout.write(" \u26A0\uFE0F Security Tips: NEVER send API keys in agent chat. Create a dedicated API Key for your agent. Please test thoroughly before connecting to large real-money accounts.\n");
2386
2391
  process.stdout.write(" \u26A0\uFE0F \u5B89\u5168\u63D0\u793A\uFF1A\u5207\u52FF\u5728 Agent \u5BF9\u8BDD\u4E2D\u53D1\u9001 API Key\u3002\u8BF7\u4E3A Agent \u521B\u5EFA\u4E13\u7528API Key\u63A5\u5165\uFF0C\u5148\u7528\u5C0F\u91D1\u989D\u5145\u5206\u9A8C\u8BC1\u540E\u518D\u63A5\u5165\u5B9E\u76D8\u3002\n\n");
2387
2392
  process.stdout.write("Pionex CLI \u2014 Configuration Wizard\n\n");
@@ -2580,6 +2585,11 @@ function parseJsonFlag(raw, flagName) {
2580
2585
  }
2581
2586
  }
2582
2587
  async function runPionexCommand(argv) {
2588
+ const firstArg = argv[0];
2589
+ if (firstArg === "-v" || firstArg === "--version") {
2590
+ process.stdout.write(version + "\n");
2591
+ return;
2592
+ }
2583
2593
  const { positionals, flags } = parseFlags(argv);
2584
2594
  const group = positionals[0];
2585
2595
  const command = group === "bot" || group === "earn" ? positionals[2] : positionals[1];
@@ -2980,6 +2990,10 @@ function main() {
2980
2990
  const invokedAs = basename(process.argv[1] || "");
2981
2991
  const cmd = process.argv[2];
2982
2992
  if (invokedAs.includes("pionex-ai-kit")) {
2993
+ if (cmd === "-v" || cmd === "--version") {
2994
+ process.stdout.write(version + "\n");
2995
+ return;
2996
+ }
2983
2997
  if (cmd === "onboard") {
2984
2998
  cmdOnboard().catch((e) => {
2985
2999
  process.stderr.write(String(e) + "\n");