@pionex/pionex-ai-kit 0.2.53 → 0.2.54

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
@@ -5,10 +5,10 @@ import { basename } from "path";
5
5
  async function main() {
6
6
  const invokedAs = basename(process.argv[1] || "");
7
7
  if (invokedAs.includes("pionex-ai-kit")) {
8
- const { buildKitProgram } = await import("./kit-DBQGQY64.js");
8
+ const { buildKitProgram } = await import("./kit-CR5ACHEN.js");
9
9
  await buildKitProgram().parseAsync(process.argv);
10
10
  } else {
11
- const { buildTradeProgram } = await import("./trade-4DUOU56K.js");
11
+ const { buildTradeProgram } = await import("./trade-PUFF7IDV.js");
12
12
  await buildTradeProgram().parseAsync(process.argv);
13
13
  }
14
14
  }
@@ -5,7 +5,7 @@ import {
5
5
  runSetup,
6
6
  version,
7
7
  writeFullConfig
8
- } from "./chunk-I6Z3QX5T.js";
8
+ } from "./chunk-P3F7NIBO.js";
9
9
 
10
10
  // src/kit.ts
11
11
  import { createInterface } from "readline";
@@ -64,7 +64,7 @@ async function cmdOnboard() {
64
64
  process.stdout.write(" Default profile: " + profileName + "\n");
65
65
  process.stdout.write(" Usage: pionex-ai-kit onboard\n");
66
66
  process.stdout.write(
67
- " Next: run 'pionex-ai-kit setup --mcp=pionex-trade-mcp --client cursor' or 'pionex-trade-mcp setup --client cursor' to register the MCP server.\n You can replace 'cursor' with 'claude-desktop', 'windsurf', 'vscode', 'claude-code', 'claude' or 'openclaw' depending on which agent you want to configure.\n\n"
67
+ " Next: run 'pionex-ai-kit setup --mcp=pionex-trade-mcp --client cursor' or 'pionex-trade-mcp setup --client cursor' to register the MCP server.\n You can replace 'cursor' with 'claude-desktop', 'windsurf', 'vscode', 'claude-code', 'claude', 'openclaw' or 'codex' depending on which agent you want to configure.\n\n"
68
68
  );
69
69
  }
70
70
  function buildKitProgram() {
@@ -98,4 +98,4 @@ function buildKitProgram() {
98
98
  export {
99
99
  buildKitProgram
100
100
  };
101
- //# sourceMappingURL=kit-DBQGQY64.js.map
101
+ //# sourceMappingURL=kit-CR5ACHEN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kit.ts"],"sourcesContent":["import { createInterface } from \"node:readline\";\nimport { Command } from \"commander\";\nimport {\n readFullConfig,\n writeFullConfig,\n configFilePath,\n runSetup,\n SUPPORTED_CLIENTS,\n type PionexTomlConfig,\n type PionexProfile,\n type ClientId,\n} from \"@pionex-ai/core\";\nimport { version } from \"./helpers.js\";\n\nconst DEFAULT_PROFILE_NAME = \"pionx-prod\";\nconst DEFAULT_BASE_URL = \"https://api.pionex.com\";\n\nfunction ask(rl: ReturnType<typeof createInterface>, question: string, defaultValue = \"\"): Promise<string> {\n const prompt = defaultValue ? `${question} [${defaultValue}]: ` : `${question}: `;\n return new Promise((resolve) => rl.question(prompt, (answer) => resolve((answer ?? \"\").trim() || defaultValue)));\n}\n\nasync function cmdOnboard(): Promise<void> {\n const rl = createInterface({ input: process.stdin, output: process.stdout });\n\n process.stdout.write(`\\n pionex-ai-kit v${version}\\n`);\n process.stdout.write(\" ⚠️ 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\");\n process.stdout.write(\" ⚠️ 安全提示:切勿在 Agent 对话中发送 API Key。请为 Agent 创建专用API Key接入,先用小金额充分验证后再接入实盘。\\n\\n\");\n\n process.stdout.write(\"Pionex CLI — Configuration Wizard\\n\\n\");\n process.stdout.write(\"Go to https://www.pionex.com/my-account/api to create an API Key (trade permission required)\\n\\n\");\n process.stdout.write(\"Credentials will be saved to \" + configFilePath() + \"\\n\\n\");\n\n const apiKey = await ask(rl, \"Pionex API Key\");\n if (!apiKey) {\n process.stderr.write(\" Error: API Key cannot be empty.\\n\");\n rl.close();\n process.exit(1);\n }\n\n const secretKey = await ask(rl, \"Pionex API Secret\");\n if (!secretKey) {\n process.stderr.write(\" Error: API Secret cannot be empty.\\n\");\n rl.close();\n process.exit(1);\n }\n\n rl.close();\n\n let config: PionexTomlConfig = { profiles: {} };\n try {\n config = readFullConfig();\n } catch {\n config = { profiles: {} };\n }\n if (!config.profiles) config.profiles = {};\n\n const profile: PionexProfile = {\n api_key: apiKey,\n secret_key: secretKey,\n base_url: DEFAULT_BASE_URL,\n };\n const profileName = DEFAULT_PROFILE_NAME;\n config.profiles[profileName] = profile;\n config.default_profile = profileName;\n\n try {\n writeFullConfig(config);\n } catch (e) {\n process.stderr.write(\" Failed to write config: \" + (e instanceof Error ? e.message : String(e)) + \"\\n\");\n process.exit(1);\n }\n\n process.stdout.write(\"\\n Config saved to \" + configFilePath() + \"\\n\");\n process.stdout.write(\" Default profile: \" + profileName + \"\\n\");\n process.stdout.write(\" Usage: pionex-ai-kit onboard\\n\");\n process.stdout.write(\n \" Next: run 'pionex-ai-kit setup --mcp=pionex-trade-mcp --client cursor' or \" +\n \"'pionex-trade-mcp setup --client cursor' to register the MCP server.\\n\" +\n \" You can replace 'cursor' with 'claude-desktop', 'windsurf', 'vscode', 'claude-code', 'claude', 'openclaw' or 'codex' depending on which agent you want to configure.\\n\\n\",\n );\n}\n\nexport function buildKitProgram(): Command {\n const program = new Command(\"pionex-ai-kit\")\n .version(version, \"-v, --version\", \"Print version number\")\n .description(\"Pionex CLI: configure credentials and set up MCP client integration\");\n\n program\n .command(\"onboard\")\n .description(\"Interactive wizard to create ~/.pionex/config.toml (API key + secret)\")\n .action(() => {\n cmdOnboard().catch((e) => {\n process.stderr.write(String(e) + \"\\n\");\n process.exit(1);\n });\n });\n\n program\n .command(\"setup\")\n .description(`Write MCP client config to register the Pionex MCP server\\n Supported clients: ${[...SUPPORTED_CLIENTS, \"claude (alias for claude-code)\"].join(\", \")}`)\n .option(\"--mcp <server>\", \"MCP server to register (default: pionex-trade-mcp)\")\n .requiredOption(\"--client <client>\", `AI client to configure (${SUPPORTED_CLIENTS.join(\"|\")})`)\n .action((opts: { mcp?: string; client: string }) => {\n const targetMcp = opts.mcp ?? \"pionex-trade-mcp\";\n if (targetMcp !== \"pionex-trade-mcp\") {\n process.stderr.write(`Unsupported MCP server: ${targetMcp}. Currently only 'pionex-trade-mcp' is supported.\\n`);\n process.exit(1);\n }\n const normalizedClient = opts.client === \"claude\" ? \"claude-code\" : opts.client;\n if (!SUPPORTED_CLIENTS.includes(normalizedClient as ClientId)) {\n process.stderr.write(\n `Unsupported client: ${opts.client}. Supported: ${[...SUPPORTED_CLIENTS, \"claude (alias for claude-code)\"].join(\", \")}\\n`,\n );\n process.exit(1);\n }\n runSetup({ client: normalizedClient as ClientId });\n });\n\n return program;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAaxB,IAAM,uBAAuB;AAC7B,IAAM,mBAAmB;AAEzB,SAAS,IAAI,IAAwC,UAAkB,eAAe,IAAqB;AACzG,QAAM,SAAS,eAAe,GAAG,QAAQ,KAAK,YAAY,QAAQ,GAAG,QAAQ;AAC7E,SAAO,IAAI,QAAQ,CAAC,YAAY,GAAG,SAAS,QAAQ,CAAC,WAAW,SAAS,UAAU,IAAI,KAAK,KAAK,YAAY,CAAC,CAAC;AACjH;AAEA,eAAe,aAA4B;AACzC,QAAM,KAAK,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAE3E,UAAQ,OAAO,MAAM;AAAA,mBAAsB,OAAO;AAAA,CAAI;AACtD,UAAQ,OAAO,MAAM,uLAA6K;AAClM,UAAQ,OAAO,MAAM,6RAAgF;AAErG,UAAQ,OAAO,MAAM,4CAAuC;AAC5D,UAAQ,OAAO,MAAM,kGAAkG;AACvH,UAAQ,OAAO,MAAM,kCAAkC,eAAe,IAAI,MAAM;AAEhF,QAAM,SAAS,MAAM,IAAI,IAAI,gBAAgB;AAC7C,MAAI,CAAC,QAAQ;AACX,YAAQ,OAAO,MAAM,qCAAqC;AAC1D,OAAG,MAAM;AACT,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,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BAAmF,CAAC,GAAG,mBAAmB,gCAAgC,EAAE,KAAK,IAAI,CAAC,EAAE,EACpK,OAAO,kBAAkB,oDAAoD,EAC7E,eAAe,qBAAqB,2BAA2B,kBAAkB,KAAK,GAAG,CAAC,GAAG,EAC7F,OAAO,CAAC,SAA2C;AAClD,UAAM,YAAY,KAAK,OAAO;AAC9B,QAAI,cAAc,oBAAoB;AACpC,cAAQ,OAAO,MAAM,2BAA2B,SAAS;AAAA,CAAqD;AAC9G,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,UAAM,mBAAmB,KAAK,WAAW,WAAW,gBAAgB,KAAK;AACzE,QAAI,CAAC,kBAAkB,SAAS,gBAA4B,GAAG;AAC7D,cAAQ,OAAO;AAAA,QACb,uBAAuB,KAAK,MAAM,gBAAgB,CAAC,GAAG,mBAAmB,gCAAgC,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA,MACvH;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,aAAS,EAAE,QAAQ,iBAA6B,CAAC;AAAA,EACnD,CAAC;AAEH,SAAO;AACT;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  print,
8
8
  toToolErrorPayload,
9
9
  version
10
- } from "./chunk-I6Z3QX5T.js";
10
+ } from "./chunk-P3F7NIBO.js";
11
11
 
12
12
  // src/trade.ts
13
13
  import { Command as Command8 } from "commander";
@@ -937,4 +937,4 @@ function buildTradeProgram() {
937
937
  export {
938
938
  buildTradeProgram
939
939
  };
940
- //# sourceMappingURL=trade-4DUOU56K.js.map
940
+ //# sourceMappingURL=trade-PUFF7IDV.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pionex/pionex-ai-kit",
3
- "version": "0.2.53",
3
+ "version": "0.2.54",
4
4
  "description": "CLI for Pionex MCP: config init and credentials (writes ~/.pionex/config.toml)",
5
5
  "type": "module",
6
6
  "license": "MIT",