jinzd-ai-cli 0.4.226 → 0.4.228

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 (31) hide show
  1. package/dist/{batch-IJ6X3SWP.js → batch-K6IRL6TU.js} +2 -2
  2. package/dist/{chunk-KDJEFBOS.js → chunk-32LTIQQN.js} +4 -4
  3. package/dist/{chunk-HZC6JFPM.js → chunk-4GF47FW3.js} +4 -4
  4. package/dist/{chunk-D5A2K4AO.js → chunk-ACO2RJY3.js} +1 -1
  5. package/dist/{chunk-PUBCJF7E.js → chunk-EEQHP4GK.js} +19 -5
  6. package/dist/{chunk-NQYNIK4C.js → chunk-JGQ3TULW.js} +31 -31
  7. package/dist/{chunk-55NPPWBW.js → chunk-JO2CAKHA.js} +1 -1
  8. package/dist/{chunk-QNIFXUKV.js → chunk-JZNKM3RV.js} +1 -1
  9. package/dist/{chunk-SHJL3ZEA.js → chunk-LDWTVCE5.js} +1 -1
  10. package/dist/{chunk-GOMPGWWO.js → chunk-MQVC7FJH.js} +9 -9
  11. package/dist/{chunk-PEUYYZQU.js → chunk-NI34BUBR.js} +1 -1
  12. package/dist/{chunk-2X2DOHA6.js → chunk-NR5U6LVG.js} +21 -3
  13. package/dist/{chunk-XPBEJB27.js → chunk-ODYTXQ26.js} +37 -0
  14. package/dist/{chunk-XN24Y4OZ.js → chunk-VSEXYCEE.js} +2 -2
  15. package/dist/{chunk-CITDVXXM.js → chunk-YVMACMXW.js} +30 -1
  16. package/dist/{ci-7SRQSN7E.js → ci-D35MUGEH.js} +6 -6
  17. package/dist/{ci-format-FM52GDQG.js → ci-format-EQ4HGHXR.js} +2 -2
  18. package/dist/{constants-LX5P32PH.js → constants-F2LRIWV2.js} +1 -1
  19. package/dist/{doctor-cli-6KSSI65N.js → doctor-cli-R3AH5CLF.js} +6 -6
  20. package/dist/electron-server.js +92 -41
  21. package/dist/{hub-AWY3NZUF.js → hub-AAYGBUDA.js} +3 -3
  22. package/dist/{hub-server-XX36DX7O.js → hub-server-XA7HTVLD.js} +1 -1
  23. package/dist/index.js +27 -26
  24. package/dist/{pr-IO56XB47.js → pr-HX6V63FO.js} +6 -6
  25. package/dist/{run-tests-FKBEUFKX.js → run-tests-5QHWA4MF.js} +2 -2
  26. package/dist/{run-tests-NQWCJSZX.js → run-tests-7SGHDDHL.js} +1 -1
  27. package/dist/{server-I2RRWW7W.js → server-E5XTQG7W.js} +5 -5
  28. package/dist/{server-Y7YXAYF3.js → server-O2YK3VWK.js} +10 -10
  29. package/dist/{task-orchestrator-CODR7HC6.js → task-orchestrator-T2LUS5ZQ.js} +7 -6
  30. package/dist/{usage-6H5AIUZM.js → usage-AIHU5PIY.js} +3 -3
  31. package/package.json +1 -1
@@ -38,7 +38,7 @@ import {
38
38
  VERSION,
39
39
  buildUserIdentityPrompt,
40
40
  runTestsTool
41
- } from "./chunk-SHJL3ZEA.js";
41
+ } from "./chunk-LDWTVCE5.js";
42
42
  import {
43
43
  hasSemanticIndex,
44
44
  semanticSearch
@@ -76,22 +76,22 @@ import { homedir } from "os";
76
76
  // src/config/schema.ts
77
77
  import { z } from "zod";
78
78
  var CustomModelSchema = z.object({
79
- id: z.string(),
80
- displayName: z.string().optional(),
79
+ id: z.string().max(100),
80
+ displayName: z.string().max(200).optional(),
81
81
  contextWindow: z.number().optional()
82
82
  });
83
83
  var CustomProviderConfigSchema = z.object({
84
- id: z.string(),
84
+ id: z.string().max(100),
85
85
  // 唯一 ID,不能与内置 provider 重名
86
- displayName: z.string(),
86
+ displayName: z.string().max(200),
87
87
  // 显示名称
88
- apiKey: z.string().optional(),
88
+ apiKey: z.string().max(4e3).optional(),
89
89
  // 可选:直接在此写 key(也可通过 apiKeys 字段或环境变量提供)
90
- baseUrl: z.string(),
90
+ baseUrl: z.string().max(2e3),
91
91
  // OpenAI 兼容 API 的 base URL(必填)
92
- defaultModel: z.string(),
92
+ defaultModel: z.string().max(200),
93
93
  // 默认使用的模型 ID
94
- models: z.array(CustomModelSchema).default([]),
94
+ models: z.array(CustomModelSchema).max(100).default([]),
95
95
  timeout: z.number().optional()
96
96
  // 请求超时(ms),覆盖全局默认值
97
97
  });
@@ -106,19 +106,19 @@ var ModelParamsSchema = z.object({
106
106
  });
107
107
  var UserProfileSchema = z.object({
108
108
  /** 真实姓名(如 "Jin Zhengdong") */
109
- name: z.string().optional(),
109
+ name: z.string().max(100).optional(),
110
110
  /** 昵称/称呼偏好(如 "东叔"),AI 会以此称呼你 */
111
- nickname: z.string().optional(),
111
+ nickname: z.string().max(100).optional(),
112
112
  /** 职业角色(如 "Full-stack developer"、"Data scientist") */
113
- role: z.string().optional(),
113
+ role: z.string().max(200).optional(),
114
114
  /** 个人简介 / 专长描述(1-3 句话) */
115
- bio: z.string().optional(),
115
+ bio: z.string().max(1e4).optional(),
116
116
  /** 兴趣领域或技术栈(如 ["TypeScript", "Rust", "AI/ML"]) */
117
- interests: z.array(z.string()).default([]),
117
+ interests: z.array(z.string()).max(100).default([]),
118
118
  /** 语言偏好(如 "zh-CN"、"en"),AI 将据此选择交流语言 */
119
- locale: z.string().optional(),
119
+ locale: z.string().max(20).optional(),
120
120
  /** 自定义人设补充(自由格式,直接注入 system prompt) */
121
- extra: z.string().optional()
121
+ extra: z.string().max(5e3).optional()
122
122
  }).default({});
123
123
  var ConfigSchema = z.object({
124
124
  version: z.string().default("1.0.0"),
@@ -140,7 +140,7 @@ var ConfigSchema = z.object({
140
140
  // HTTP/HTTPS 代理地址(Node.js 不自动使用系统代理,需显式配置)
141
141
  // 例:http://127.0.0.1:10809
142
142
  // 也可通过环境变量 HTTPS_PROXY / HTTP_PROXY 覆盖
143
- proxy: z.string().optional(),
143
+ proxy: z.string().max(500).optional(),
144
144
  // 自定义 Provider 列表(OpenAI 兼容接口,无需改代码)
145
145
  customProviders: z.array(CustomProviderConfigSchema).default([]),
146
146
  // 按模型 ID 存储的推理参数(key 为模型 ID,如 "deepseek-chat")
@@ -174,7 +174,7 @@ var ConfigSchema = z.object({
174
174
  session: z.object({
175
175
  autoSave: z.boolean().default(true),
176
176
  maxHistoryDays: z.number().default(30),
177
- systemPrompt: z.string().optional()
177
+ systemPrompt: z.string().max(1e5).optional()
178
178
  }).default({}),
179
179
  // 项目上下文文件配置
180
180
  // 启动时自动读取并注入 system prompt,类似 Claude Code 的 CLAUDE.md / Codex AGENTS.md 机制
@@ -182,14 +182,14 @@ var ConfigSchema = z.object({
182
182
  // 设为 false 可禁用此功能;指定字符串时仅加载 cwd 下的该文件
183
183
  contextFile: z.union([z.string(), z.literal(false)]).default("auto"),
184
184
  context: z.object({
185
- projectDocFallbackFilenames: z.array(z.string()).default([]),
185
+ projectDocFallbackFilenames: z.array(z.string().max(500)).max(20).default([]),
186
186
  projectDocMaxBytes: z.number().int().positive().default(32 * 1024),
187
187
  showLoadedContextSources: z.boolean().default(false)
188
188
  }).default({}),
189
189
  // Google Custom Search API 的 Search Engine ID (cx 参数)
190
190
  // API Key 通过 apiKeys['google-search'] 或 AICLI_API_KEY_GOOGLESEARCH 环境变量配置
191
191
  // CX 也可通过 AICLI_GOOGLE_CX 环境变量覆盖
192
- googleSearchEngineId: z.string().optional(),
192
+ googleSearchEngineId: z.string().max(200).optional(),
193
193
  // google_search 工具的安全开关(v0.4.135+)
194
194
  // 默认 disabled。这个工具调用 Google Custom Search API,没有原生 daily-spend cap——
195
195
  // 业内有多起 key 被盗后产生数万美元账单的真实案例。现在内置 web_search 工具走 Bing/Google
@@ -207,10 +207,10 @@ var ConfigSchema = z.object({
207
207
  // 配置格式兼容 Claude Desktop(command + args + env)
208
208
  // 示例:{ "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"] } }
209
209
  mcpServers: z.record(z.object({
210
- command: z.string(),
211
- args: z.array(z.string()).default([]),
210
+ command: z.string().max(500),
211
+ args: z.array(z.string()).max(100).default([]),
212
212
  env: z.record(z.string()).optional(),
213
- timeout: z.number().default(3e4)
213
+ timeout: z.number().int().min(100).max(3e5).default(3e4)
214
214
  })).default({}),
215
215
  // Hooks 生命周期(v0.4.212+):兼容旧 pre/post 字符串,同时支持 events.<EventName> 结构化 JSON hook。
216
216
  hooks: z.object({
@@ -244,8 +244,8 @@ var ConfigSchema = z.object({
244
244
  networkPolicy: z.object({
245
245
  enabled: z.boolean().default(false),
246
246
  defaultAction: z.enum(["allow", "confirm", "deny"]).default("confirm"),
247
- allowDomains: z.array(z.string()).default([]),
248
- denyDomains: z.array(z.string()).default([]),
247
+ allowDomains: z.array(z.string().max(500)).max(100).default([]),
248
+ denyDomains: z.array(z.string().max(500)).max(100).default([]),
249
249
  allowPorts: z.array(z.number().int().min(1).max(65535)).default([]),
250
250
  denyPorts: z.array(z.number().int().min(1).max(65535)).default([]),
251
251
  allowPrivateNetwork: z.boolean().default(false),
@@ -259,7 +259,7 @@ var ConfigSchema = z.object({
259
259
  }).default({ enabled: false, defaultAction: "confirm", allowDomains: [], denyDomains: [], allowPorts: [], denyPorts: [], allowPrivateNetwork: false, tools: {} }),
260
260
  // 权限 Profile(v0.4.211+):legacy 保持旧行为;其余 profile 提供更清晰的安全边界。
261
261
  defaultPermissionProfile: z.enum(["legacy", "read-only", "workspace-write", "danger-full-access"]).default("legacy"),
262
- allowedPermissionProfiles: z.array(z.string()).default(["legacy", "read-only", "workspace-write", "danger-full-access"]),
262
+ allowedPermissionProfiles: z.array(z.string().max(50)).max(20).default(["legacy", "read-only", "workspace-write", "danger-full-access"]),
263
263
  permissionProfiles: z.record(z.object({
264
264
  extends: z.enum(["legacy", "read-only", "workspace-write", "danger-full-access"]).optional(),
265
265
  defaultAction: z.enum(["auto-approve", "deny", "confirm"]).optional(),
@@ -276,7 +276,7 @@ var ConfigSchema = z.object({
276
276
  })).default({}),
277
277
  // 工具权限规则(按顺序匹配第一个生效;作为当前权限 Profile 内的细粒度规则)
278
278
  permissionRules: z.array(z.object({
279
- tool: z.string(),
279
+ tool: z.string().max(100),
280
280
  action: z.enum(["auto-approve", "deny", "confirm"]),
281
281
  when: z.object({
282
282
  dangerLevel: z.enum(["safe", "write", "destructive"]).optional(),
@@ -334,7 +334,7 @@ var ConfigSchema = z.object({
334
334
  redactOnSave: z.boolean().default(true),
335
335
  redactOnSend: z.boolean().default(false),
336
336
  mode: z.enum(["default", "strict", "off"]).default("default"),
337
- customPatterns: z.array(z.string()).default([])
337
+ customPatterns: z.array(z.string().max(200)).max(50).default([])
338
338
  }).default({}),
339
339
  // 智能模型路由(v0.4.68+)
340
340
  // 按用户每轮输入的内容/标签/长度动态选择模型,在同一 provider 内切换,
@@ -346,13 +346,13 @@ var ConfigSchema = z.object({
346
346
  enabled: z.boolean().default(false),
347
347
  rules: z.array(z.object({
348
348
  match: z.object({
349
- contains: z.array(z.string()).optional(),
349
+ contains: z.array(z.string().max(200)).max(50).optional(),
350
350
  maxLength: z.number().int().positive().optional(),
351
351
  minLength: z.number().int().positive().optional(),
352
352
  tag: z.string().optional()
353
353
  }),
354
354
  model: z.string(),
355
- name: z.string().optional()
355
+ name: z.string().max(100).optional()
356
356
  })).default([]),
357
357
  fallback: z.string().optional()
358
358
  }).default({ enabled: false, rules: [] }),
@@ -372,7 +372,7 @@ var ConfigSchema = z.object({
372
372
  maxBackoffMs: z.number().int().positive().default(8e3),
373
373
  /** 兜底 provider 链,每个 entry 仅尝试 1 次。model 省略则使用 provider 的 defaultModel。 */
374
374
  chain: z.array(z.object({
375
- provider: z.string(),
375
+ provider: z.string().max(100),
376
376
  model: z.string().optional()
377
377
  })).default([])
378
378
  }).default({ enabled: false, retries: 2, initialBackoffMs: 500, maxBackoffMs: 8e3, chain: [] })
@@ -1692,7 +1692,44 @@ var HALLUCINATION_PATTERNS = [
1692
1692
  // “以下是图片的内容:”“以下是修改后的内容:”这类描述/对话。
1693
1693
  /以下是[^\n。.!!??]*?(?:教案|试卷|讲义|课件|课程|文件|文档|脚本|配置|程序|报告|表格|清单)[^\n。.!!??]{0,8}(?:内容)?[::]/
1694
1694
  ];
1695
+ var QUICK_WRITE_KEYWORDS = [
1696
+ // 中文写入动作
1697
+ "\u5DF2\u4FDD\u5B58",
1698
+ "\u5DF2\u5199\u5165",
1699
+ "\u5DF2\u521B\u5EFA",
1700
+ "\u5DF2\u751F\u6210",
1701
+ "\u751F\u6210\u5B8C\u6210",
1702
+ "\u4FDD\u5B58",
1703
+ "\u5199\u5165",
1704
+ "\u521B\u5EFA",
1705
+ "\u751F\u6210",
1706
+ // 中文文档名
1707
+ "\u6587\u4EF6",
1708
+ "\u6559\u6848",
1709
+ "\u8BD5\u5377",
1710
+ "\u8BB2\u4E49",
1711
+ "\u8BFE\u4EF6",
1712
+ "\u6587\u6863",
1713
+ "\u811A\u672C",
1714
+ "\u914D\u7F6E",
1715
+ "\u7A0B\u5E8F",
1716
+ "\u62A5\u544A",
1717
+ "\u8868\u683C",
1718
+ "\u6E05\u5355",
1719
+ "\u7B14\u8BB0",
1720
+ // 英文写入动作
1721
+ "saved",
1722
+ "written",
1723
+ "created",
1724
+ "File",
1725
+ "file",
1726
+ // emoji 勾选标记
1727
+ "\u2705"
1728
+ ];
1695
1729
  function detectsHallucinatedFileOp(content) {
1730
+ if (!QUICK_WRITE_KEYWORDS.some((kw) => content.includes(kw))) {
1731
+ return false;
1732
+ }
1696
1733
  return HALLUCINATION_PATTERNS.some((pattern) => pattern.test(content));
1697
1734
  }
1698
1735
  function hadPreviousWriteToolCalls(extraMessages) {
@@ -3966,18 +4003,32 @@ var ProviderRegistry = class {
3966
4003
  configDir;
3967
4004
  async initialize(getApiKey, getOptions, customProviderConfigs, configDir) {
3968
4005
  this.configDir = configDir;
3969
- for (const ProviderClass of BUILT_IN_PROVIDERS) {
4006
+ const initTasks = BUILT_IN_PROVIDERS.map(async (ProviderClass) => {
3970
4007
  const provider = new ProviderClass();
3971
4008
  const apiKey = getApiKey(provider.info.id);
3972
4009
  if (apiKey || !provider.info.requiresApiKey) {
3973
4010
  const options = getOptions?.(provider.info.id) ?? {};
4011
+ const pInit = provider.initialize(apiKey ?? "", options);
4012
+ return { provider, pInit, requiresApiKey: !!provider.info.requiresApiKey };
4013
+ }
4014
+ return null;
4015
+ });
4016
+ const settled = await Promise.allSettled(
4017
+ initTasks.map(async (task) => {
4018
+ const result = await task;
4019
+ if (!result) return;
4020
+ const { provider, pInit, requiresApiKey } = result;
3974
4021
  try {
3975
- await provider.initialize(apiKey ?? "", options);
4022
+ await pInit;
3976
4023
  this.providers.set(provider.info.id, provider);
3977
4024
  } catch (err) {
3978
- if (provider.info.requiresApiKey) throw err;
4025
+ if (requiresApiKey) throw err;
3979
4026
  }
3980
- }
4027
+ })
4028
+ );
4029
+ const keyErrors = settled.filter((r) => r.status === "rejected").map((r) => r.reason);
4030
+ if (keyErrors.length > 0) {
4031
+ throw keyErrors[0];
3981
4032
  }
3982
4033
  this.customConfigs = customProviderConfigs ?? [];
3983
4034
  for (const cfg of this.customConfigs) {
@@ -5958,7 +6009,7 @@ var readFileTool = {
5958
6009
  dangerous: false
5959
6010
  },
5960
6011
  async execute(args) {
5961
- const filePath = String(args["path"] ?? "");
6012
+ const filePath = String(args["path"] ?? args["file"] ?? "");
5962
6013
  const encoding = args["encoding"] ?? "utf-8";
5963
6014
  const rawOffset = args["offset"];
5964
6015
  const rawLimit = args["limit"];
@@ -7833,7 +7884,7 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
7833
7884
  // executor 会将 write_file 标记为 'write' 级别
7834
7885
  },
7835
7886
  async execute(args) {
7836
- const filePath = String(args["path"] ?? "");
7887
+ const filePath = String(args["path"] ?? args["file"] ?? "");
7837
7888
  const content = String(args["content"] ?? "");
7838
7889
  const encoding = args["encoding"] ?? "utf-8";
7839
7890
  const appendMode = String(args["append"] ?? "false").toLowerCase() === "true";
@@ -8225,7 +8276,7 @@ Note: Path can be absolute or relative to cwd.`,
8225
8276
  // executor 中 edit_file 按 write 级别处理
8226
8277
  },
8227
8278
  async execute(args) {
8228
- const filePath = String(args["path"] ?? "");
8279
+ const filePath = String(args["path"] ?? args["file"] ?? "");
8229
8280
  const encoding = args["encoding"] ?? "utf-8";
8230
8281
  if (!filePath) throw new ToolError("edit_file", "path is required");
8231
8282
  if (!existsSync11(filePath)) throw new ToolError("edit_file", `File not found: ${filePath}`);
@@ -9626,7 +9677,7 @@ Any of these triggers means use save_last_response, NOT write_file:
9626
9677
  // getDangerLevel 中标记为 write
9627
9678
  },
9628
9679
  async execute(args) {
9629
- const filePath = String(args["path"] ?? "");
9680
+ const filePath = String(args["path"] ?? args["file"] ?? "");
9630
9681
  if (!filePath) throw new ToolError("save_last_response", "path is required");
9631
9682
  const content = lastResponseStore.content;
9632
9683
  if (!content) {
@@ -11687,7 +11738,7 @@ var notebookEditTool = {
11687
11738
  dangerous: false
11688
11739
  },
11689
11740
  async execute(args) {
11690
- const filePath = String(args["path"] ?? "");
11741
+ const filePath = String(args["path"] ?? args["file"] ?? "");
11691
11742
  const action = String(args["action"] ?? "");
11692
11743
  const cellIndexRaw = Number(args["cell_index"]);
11693
11744
  const content = args["content"] != null ? String(args["content"]) : "";
@@ -16017,7 +16068,7 @@ async function handleSecurityReview(args, ctx) {
16017
16068
  async function handleTest(args, ctx) {
16018
16069
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
16019
16070
  try {
16020
- const { executeTests } = await import("./run-tests-NQWCJSZX.js");
16071
+ const { executeTests } = await import("./run-tests-7SGHDDHL.js");
16021
16072
  const argStr = args.join(" ").trim();
16022
16073
  let testArgs = {};
16023
16074
  if (argStr) {
@@ -3,7 +3,7 @@ import {
3
3
  assignRoleColors,
4
4
  renderHubBanner,
5
5
  renderHubEvent
6
- } from "./chunk-2X2DOHA6.js";
6
+ } from "./chunk-NR5U6LVG.js";
7
7
  import {
8
8
  DiscussionOrchestrator,
9
9
  getPreset,
@@ -154,7 +154,7 @@ ${content}`);
154
154
  }
155
155
  }
156
156
  async function runTaskMode(config, providers, configManager, topic) {
157
- const { TaskOrchestrator } = await import("./task-orchestrator-CODR7HC6.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-T2LUS5ZQ.js");
158
158
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
159
159
  let interrupted = false;
160
160
  const onSigint = () => {
@@ -190,7 +190,7 @@ async function runTaskMode(config, providers, configManager, topic) {
190
190
  }
191
191
  }
192
192
  async function runDistributedDiscussion(config, providers, topic, port) {
193
- const { HubServer } = await import("./hub-server-XX36DX7O.js");
193
+ const { HubServer } = await import("./hub-server-XA7HTVLD.js");
194
194
  const hub = new HubServer(config, providers, port);
195
195
  let interrupted = false;
196
196
  const onSigint = () => {
@@ -10,7 +10,7 @@ import {
10
10
  renderRoundHeader,
11
11
  renderSummary,
12
12
  renderUserInterrupt
13
- } from "./chunk-2X2DOHA6.js";
13
+ } from "./chunk-NR5U6LVG.js";
14
14
  import {
15
15
  HubAgent
16
16
  } from "./chunk-3ARPAVNV.js";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  scanProject,
15
15
  sessionHasMeaningfulContent,
16
16
  setupProxy
17
- } from "./chunk-XN24Y4OZ.js";
17
+ } from "./chunk-VSEXYCEE.js";
18
18
  import {
19
19
  buildReviewPrompt,
20
20
  buildSecurityReviewPrompt
@@ -52,7 +52,7 @@ import {
52
52
  theme,
53
53
  undoStack,
54
54
  updateMemoryApproval
55
- } from "./chunk-GOMPGWWO.js";
55
+ } from "./chunk-MQVC7FJH.js";
56
56
  import "./chunk-K3CF65QH.js";
57
57
  import "./chunk-UUSRWSSX.js";
58
58
  import "./chunk-CKH4KQ4E.js";
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-QYQCCIBT.js";
64
64
  import {
65
65
  CostTracker
66
- } from "./chunk-CITDVXXM.js";
66
+ } from "./chunk-YVMACMXW.js";
67
67
  import {
68
68
  computeCost,
69
69
  formatCost,
@@ -74,10 +74,10 @@ import {
74
74
  formatDoctorReport,
75
75
  loadContextFiles,
76
76
  writeCrashLog
77
- } from "./chunk-HZC6JFPM.js";
77
+ } from "./chunk-4GF47FW3.js";
78
78
  import {
79
79
  ProviderRegistry
80
- } from "./chunk-PUBCJF7E.js";
80
+ } from "./chunk-EEQHP4GK.js";
81
81
  import {
82
82
  describePlugin,
83
83
  getActivePluginAssets,
@@ -94,7 +94,7 @@ import {
94
94
  trustHook,
95
95
  trustPlugin,
96
96
  untrustHook
97
- } from "./chunk-D5A2K4AO.js";
97
+ } from "./chunk-ACO2RJY3.js";
98
98
  import {
99
99
  CONTENT_ONLY_STREAM_REMINDER,
100
100
  TEE_FINAL_USER_NUDGE,
@@ -113,10 +113,10 @@ import {
113
113
  stripOuterCodeFence,
114
114
  stripToolCallReminder,
115
115
  teeStreamErrorSummary
116
- } from "./chunk-XPBEJB27.js";
116
+ } from "./chunk-ODYTXQ26.js";
117
117
  import {
118
118
  ConfigManager
119
- } from "./chunk-NQYNIK4C.js";
119
+ } from "./chunk-JGQ3TULW.js";
120
120
  import {
121
121
  AuthError,
122
122
  ProviderError,
@@ -130,7 +130,7 @@ import {
130
130
  import {
131
131
  fileCheckpoints
132
132
  } from "./chunk-4BKXL7SM.js";
133
- import "./chunk-PEUYYZQU.js";
133
+ import "./chunk-NI34BUBR.js";
134
134
  import {
135
135
  AGENTIC_BEHAVIOR_GUIDELINE,
136
136
  AUTHOR,
@@ -149,7 +149,7 @@ import {
149
149
  SKILLS_DIR_NAME,
150
150
  VERSION,
151
151
  buildUserIdentityPrompt
152
- } from "./chunk-QNIFXUKV.js";
152
+ } from "./chunk-JZNKM3RV.js";
153
153
  import {
154
154
  buildChatIndex,
155
155
  clearChatIndex,
@@ -279,7 +279,8 @@ var ABOUT_TOOL_DESCRIPTIONS = {
279
279
  get_outline: "Enumerate all top-level declarations in one source file",
280
280
  find_references: "Search indexed files for references to a symbol name",
281
281
  search_code: "Semantic (meaning-based) code search via local embeddings",
282
- recall_memory: 'Semantic recall over past chat sessions ("remember when\u2026")'
282
+ recall_memory: 'Semantic recall over past chat sessions ("remember when\u2026")',
283
+ stream_to_file: "Stream large content (>5KB) directly to disk (avoids output truncation)"
283
284
  };
284
285
  var ABOUT_FEATURES = [
285
286
  "Agentic loop: up to 200 tool-call rounds (configurable), final answer streamed",
@@ -427,15 +428,15 @@ var Renderer = class {
427
428
  const feat = (s) => theme.dim(" \u2726 ") + chalk.white(s);
428
429
  console.log();
429
430
  console.log(
430
- theme.heading(" \u{1F916} ai-cli") + theme.dim(` v${VERSION}`) + theme.dim(" \u2014 Cross-platform agentic AI assistant (REPL \xB7 Web \xB7 Desktop, 9 providers)")
431
+ theme.heading(" \u{1F916} ai-cli") + theme.dim(` v${VERSION}`) + theme.dim(" \u2014 Cross-platform agentic AI assistant (REPL \xB7 Web \xB7 Desktop, 10 providers)")
431
432
  );
432
433
  console.log(HR);
433
434
  console.log(label("Desc") + chalk.white(DESCRIPTION));
434
435
  console.log(label("Author") + theme.warning(AUTHOR) + theme.dim(" <" + AUTHOR_EMAIL + ">"));
435
436
  console.log(HR);
436
- console.log(theme.dim(" Supported Providers (9):"));
437
+ console.log(theme.dim(" Supported Providers (10):"));
437
438
  console.log(theme.dim(" OpenAI \xB7 DeepSeek \xB7 Kimi (Moonshot) \xB7 Claude (Anthropic) \xB7 MiniMax (\u6D77\u87BA)"));
438
- console.log(theme.dim(" Gemini (Google) \xB7 Zhipu (GLM) \xB7 OpenRouter \xB7 Ollama (Local, no API key)"));
439
+ console.log(theme.dim(" Gemini (Google) \xB7 Zhipu (GLM) \xB7 Qwen (\u901A\u4E49\u5343\u95EE) \xB7 OpenRouter \xB7 Ollama (Local, no API key)"));
439
440
  console.log(HR);
440
441
  const mcpToolCount = mcpInfo?.tools ?? 0;
441
442
  const toolTotal = builtinTools.length + pluginCount + mcpToolCount;
@@ -1049,7 +1050,7 @@ function createMiscCommands() {
1049
1050
  ["/tools", "List all AI tools available"],
1050
1051
  ["/plugins", "Show plugin directory and loaded plugins"],
1051
1052
  ["/plugin [list|install|enable|disable|inspect|trust]", "Manage package plugins"],
1052
- ["/mcp [reconnect [id]]", "MCP servers / reconnect disconnected"],
1053
+ ["/mcp [reconnect [serverId]|trust-project]", "Show MCP server connections and tools"],
1053
1054
  ["/skill [name|off|list]", "Manage agent skills (reusable prompt packs)"],
1054
1055
  ["/context", "Show or reload hierarchical context layers"],
1055
1056
  ["/add-dir [path|remove]", "Add/remove a directory from AI context"],
@@ -1833,7 +1834,7 @@ No tools match "${filter}".
1833
1834
  const { join: join7 } = await import("path");
1834
1835
  const { existsSync: existsSync6 } = await import("fs");
1835
1836
  const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
1836
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-LX5P32PH.js");
1837
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-F2LRIWV2.js");
1837
1838
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
1838
1839
  const cwd = process.cwd();
1839
1840
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2812,7 +2813,7 @@ function createReviewCommands() {
2812
2813
  usage: "/test [command|filter]",
2813
2814
  async execute(args, ctx) {
2814
2815
  try {
2815
- const { executeTests } = await import("./run-tests-FKBEUFKX.js");
2816
+ const { executeTests } = await import("./run-tests-5QHWA4MF.js");
2816
2817
  const argStr = args.join(" ").trim();
2817
2818
  let testArgs = {};
2818
2819
  if (argStr) {
@@ -7757,7 +7758,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7757
7758
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7758
7759
  process.exit(1);
7759
7760
  }
7760
- const { startWebServer } = await import("./server-Y7YXAYF3.js");
7761
+ const { startWebServer } = await import("./server-O2YK3VWK.js");
7761
7762
  await startWebServer({ port, host: options.host });
7762
7763
  });
7763
7764
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
@@ -7924,11 +7925,11 @@ program.command("sessions").description("List recent conversation sessions").opt
7924
7925
  console.log(footer + "\n");
7925
7926
  });
7926
7927
  program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
7927
- const { runUsageCli } = await import("./usage-6H5AIUZM.js");
7928
+ const { runUsageCli } = await import("./usage-AIHU5PIY.js");
7928
7929
  await runUsageCli(options);
7929
7930
  });
7930
7931
  program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
7931
- const { runDoctorCli } = await import("./doctor-cli-6KSSI65N.js");
7932
+ const { runDoctorCli } = await import("./doctor-cli-R3AH5CLF.js");
7932
7933
  const argv = process.argv.slice(2);
7933
7934
  await runDoctorCli({
7934
7935
  json: !!options.json || argv.includes("--json"),
@@ -7937,7 +7938,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
7937
7938
  });
7938
7939
  program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
7939
7940
  try {
7940
- const batch = await import("./batch-IJ6X3SWP.js");
7941
+ const batch = await import("./batch-K6IRL6TU.js");
7941
7942
  switch (action) {
7942
7943
  case "submit":
7943
7944
  if (!arg) {
@@ -7980,7 +7981,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7980
7981
  }
7981
7982
  });
7982
7983
  program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
7983
- const { startMcpServer } = await import("./server-I2RRWW7W.js");
7984
+ const { startMcpServer } = await import("./server-E5XTQG7W.js");
7984
7985
  await startMcpServer({
7985
7986
  allowDestructive: !!options.allowDestructive,
7986
7987
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7993,7 +7994,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
7993
7994
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
7994
7995
  process.exit(1);
7995
7996
  }
7996
- const { runPrCli } = await import("./pr-IO56XB47.js");
7997
+ const { runPrCli } = await import("./pr-HX6V63FO.js");
7997
7998
  const result = await runPrCli({
7998
7999
  action,
7999
8000
  target,
@@ -8013,8 +8014,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8013
8014
  process.exit(result.exitCode);
8014
8015
  });
8015
8016
  program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
8016
- const { runCi } = await import("./ci-7SRQSN7E.js");
8017
- const { formatCiResult } = await import("./ci-format-FM52GDQG.js");
8017
+ const { runCi } = await import("./ci-D35MUGEH.js");
8018
+ const { formatCiResult } = await import("./ci-format-EQ4HGHXR.js");
8018
8019
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
8019
8020
  if (formats > 1) {
8020
8021
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -8172,7 +8173,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
8172
8173
  config.get("customProviders"),
8173
8174
  config.getConfigDir()
8174
8175
  );
8175
- const { startHub } = await import("./hub-AWY3NZUF.js");
8176
+ const { startHub } = await import("./hub-AAYGBUDA.js");
8176
8177
  await startHub(
8177
8178
  {
8178
8179
  topic: topic ?? "",
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-KDJEFBOS.js";
6
- import "./chunk-55NPPWBW.js";
5
+ } from "./chunk-32LTIQQN.js";
6
+ import "./chunk-JO2CAKHA.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -11,15 +11,15 @@ import {
11
11
  } from "./chunk-HLWUDRBO.js";
12
12
  import {
13
13
  ProviderRegistry
14
- } from "./chunk-PUBCJF7E.js";
15
- import "./chunk-XPBEJB27.js";
14
+ } from "./chunk-EEQHP4GK.js";
15
+ import "./chunk-ODYTXQ26.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-NQYNIK4C.js";
18
+ } from "./chunk-JGQ3TULW.js";
19
19
  import "./chunk-5ULLIOVC.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-QNIFXUKV.js";
22
+ } from "./chunk-JZNKM3RV.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-PEUYYZQU.js";
6
- import "./chunk-QNIFXUKV.js";
5
+ } from "./chunk-NI34BUBR.js";
6
+ import "./chunk-JZNKM3RV.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-SHJL3ZEA.js";
4
+ } from "./chunk-LDWTVCE5.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-GOMPGWWO.js";
4
+ } from "./chunk-MQVC7FJH.js";
5
5
  import "./chunk-K3CF65QH.js";
6
6
  import "./chunk-UUSRWSSX.js";
7
7
  import "./chunk-CKH4KQ4E.js";
8
8
  import "./chunk-BXP6YZ2P.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-D5A2K4AO.js";
11
+ } from "./chunk-ACO2RJY3.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  schemaToJsonSchema
15
- } from "./chunk-XPBEJB27.js";
15
+ } from "./chunk-ODYTXQ26.js";
16
16
  import "./chunk-5ULLIOVC.js";
17
17
  import "./chunk-HOSJZMQS.js";
18
18
  import "./chunk-4BKXL7SM.js";
19
- import "./chunk-PEUYYZQU.js";
19
+ import "./chunk-NI34BUBR.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-QNIFXUKV.js";
22
+ } from "./chunk-JZNKM3RV.js";
23
23
  import "./chunk-NVUCDUXE.js";
24
24
  import "./chunk-KHYD3WXE.js";
25
25
  import "./chunk-B5TYJO7V.js";