jinzd-ai-cli 0.1.44 → 0.1.45

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.
@@ -8,7 +8,7 @@ import { platform } from "os";
8
8
  import chalk from "chalk";
9
9
 
10
10
  // src/core/constants.ts
11
- var VERSION = "0.1.44";
11
+ var VERSION = "0.1.45";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  SUBAGENT_MAX_ROUNDS_LIMIT,
30
30
  VERSION,
31
31
  runTestsTool
32
- } from "./chunk-SRI4AVIJ.js";
32
+ } from "./chunk-ZF62G7VO.js";
33
33
 
34
34
  // src/index.ts
35
35
  import { program } from "commander";
@@ -942,11 +942,21 @@ var OpenAICompatibleProvider = class extends BaseProvider {
942
942
  if (options?.timeout !== void 0) {
943
943
  this.defaultTimeout = options.timeout;
944
944
  }
945
- this.client = new OpenAI({
945
+ const clientOptions = {
946
946
  apiKey,
947
947
  baseURL: options?.baseUrl ?? this.defaultBaseUrl,
948
948
  timeout: this.defaultTimeout
949
- });
949
+ };
950
+ const proxyUrl = options?.proxy;
951
+ if (proxyUrl) {
952
+ try {
953
+ const { ProxyAgent, fetch: undiciFetch } = await import("undici");
954
+ const agent = new ProxyAgent({ uri: proxyUrl });
955
+ clientOptions.fetch = ((url, init) => undiciFetch(url, { ...init, dispatcher: agent }));
956
+ } catch {
957
+ }
958
+ }
959
+ this.client = new OpenAI(clientOptions);
950
960
  }
951
961
  /** 将 systemPrompt + messages 合并为 OpenAI messages 数组(system 消息放首位)。 */
952
962
  buildMessages(request) {
@@ -3888,7 +3898,7 @@ ${hint}` : "")
3888
3898
  description: "Run project tests and show structured report",
3889
3899
  usage: "/test [command|filter]",
3890
3900
  async execute(args, _ctx) {
3891
- const { executeTests } = await import("./run-tests-JGXZ7PGK.js");
3901
+ const { executeTests } = await import("./run-tests-XB4TDIP3.js");
3892
3902
  const argStr = args.join(" ").trim();
3893
3903
  let testArgs = {};
3894
3904
  if (argStr) {
@@ -9892,7 +9902,8 @@ async function runHeadless(options) {
9892
9902
  (id) => config.getApiKey(id),
9893
9903
  (id) => ({
9894
9904
  baseUrl: config.get("customBaseUrls")[id],
9895
- timeout: config.get("timeouts")[id]
9905
+ timeout: config.get("timeouts")[id],
9906
+ proxy: config.get("proxy")
9896
9907
  }),
9897
9908
  config.get("customProviders")
9898
9909
  );
@@ -10030,7 +10041,8 @@ async function startRepl(options) {
10030
10041
  (id) => config.getApiKey(id),
10031
10042
  (id) => ({
10032
10043
  baseUrl: config.get("customBaseUrls")[id],
10033
- timeout: config.get("timeouts")[id]
10044
+ timeout: config.get("timeouts")[id],
10045
+ proxy: config.get("proxy")
10034
10046
  }),
10035
10047
  config.get("customProviders")
10036
10048
  );
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-SRI4AVIJ.js";
5
+ } from "./chunk-ZF62G7VO.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",