jinzd-ai-cli 0.4.227 → 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.
- package/dist/{batch-W2DJGST7.js → batch-K6IRL6TU.js} +2 -2
- package/dist/{chunk-OMFVR2O7.js → chunk-32LTIQQN.js} +4 -4
- package/dist/{chunk-WJJIP34H.js → chunk-4GF47FW3.js} +4 -4
- package/dist/{chunk-7X5TVGVY.js → chunk-ACO2RJY3.js} +1 -1
- package/dist/{chunk-PUBCJF7E.js → chunk-EEQHP4GK.js} +19 -5
- package/dist/{chunk-6LQ6PUNZ.js → chunk-JGQ3TULW.js} +31 -31
- package/dist/{chunk-NBG2STGM.js → chunk-JO2CAKHA.js} +1 -1
- package/dist/{chunk-CYVVWFFO.js → chunk-JZNKM3RV.js} +1 -1
- package/dist/{chunk-YK5DDJNH.js → chunk-LDWTVCE5.js} +1 -1
- package/dist/{chunk-APBHCIPD.js → chunk-MQVC7FJH.js} +4 -4
- package/dist/{chunk-DKJ5EFKA.js → chunk-NI34BUBR.js} +1 -1
- package/dist/{chunk-2X2DOHA6.js → chunk-NR5U6LVG.js} +21 -3
- package/dist/{chunk-XPBEJB27.js → chunk-ODYTXQ26.js} +37 -0
- package/dist/{chunk-S4AKNVFK.js → chunk-VSEXYCEE.js} +2 -2
- package/dist/{chunk-CITDVXXM.js → chunk-YVMACMXW.js} +30 -1
- package/dist/{ci-PEOV2I3Z.js → ci-D35MUGEH.js} +6 -6
- package/dist/{ci-format-4O7SHP4F.js → ci-format-EQ4HGHXR.js} +2 -2
- package/dist/{constants-HLNS4O5H.js → constants-F2LRIWV2.js} +1 -1
- package/dist/{doctor-cli-LA4AF6DK.js → doctor-cli-R3AH5CLF.js} +6 -6
- package/dist/electron-server.js +87 -36
- package/dist/{hub-MAJE7GB7.js → hub-AAYGBUDA.js} +3 -3
- package/dist/{hub-server-XX36DX7O.js → hub-server-XA7HTVLD.js} +1 -1
- package/dist/index.js +21 -21
- package/dist/{pr-CDJFUPZX.js → pr-HX6V63FO.js} +6 -6
- package/dist/{run-tests-QFYTNPSV.js → run-tests-5QHWA4MF.js} +2 -2
- package/dist/{run-tests-DGV6D4L3.js → run-tests-7SGHDDHL.js} +1 -1
- package/dist/{server-GTIVGJ6S.js → server-E5XTQG7W.js} +5 -5
- package/dist/{server-ZQYQDQMT.js → server-O2YK3VWK.js} +10 -10
- package/dist/{task-orchestrator-YSHHXWNT.js → task-orchestrator-T2LUS5ZQ.js} +7 -6
- package/dist/{usage-QDSXUKN7.js → usage-AIHU5PIY.js} +3 -3
- package/package.json +1 -1
package/dist/electron-server.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
VERSION,
|
|
39
39
|
buildUserIdentityPrompt,
|
|
40
40
|
runTestsTool
|
|
41
|
-
} from "./chunk-
|
|
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
|
-
|
|
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
|
|
4022
|
+
await pInit;
|
|
3976
4023
|
this.providers.set(provider.info.id, provider);
|
|
3977
4024
|
} catch (err) {
|
|
3978
|
-
if (
|
|
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) {
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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 = () => {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
scanProject,
|
|
15
15
|
sessionHasMeaningfulContent,
|
|
16
16
|
setupProxy
|
|
17
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
77
|
+
} from "./chunk-4GF47FW3.js";
|
|
78
78
|
import {
|
|
79
79
|
ProviderRegistry
|
|
80
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
116
|
+
} from "./chunk-ODYTXQ26.js";
|
|
117
117
|
import {
|
|
118
118
|
ConfigManager
|
|
119
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
152
|
+
} from "./chunk-JZNKM3RV.js";
|
|
153
153
|
import {
|
|
154
154
|
buildChatIndex,
|
|
155
155
|
clearChatIndex,
|
|
@@ -1834,7 +1834,7 @@ No tools match "${filter}".
|
|
|
1834
1834
|
const { join: join7 } = await import("path");
|
|
1835
1835
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1836
1836
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1837
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1837
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-F2LRIWV2.js");
|
|
1838
1838
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1839
1839
|
const cwd = process.cwd();
|
|
1840
1840
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2813,7 +2813,7 @@ function createReviewCommands() {
|
|
|
2813
2813
|
usage: "/test [command|filter]",
|
|
2814
2814
|
async execute(args, ctx) {
|
|
2815
2815
|
try {
|
|
2816
|
-
const { executeTests } = await import("./run-tests-
|
|
2816
|
+
const { executeTests } = await import("./run-tests-5QHWA4MF.js");
|
|
2817
2817
|
const argStr = args.join(" ").trim();
|
|
2818
2818
|
let testArgs = {};
|
|
2819
2819
|
if (argStr) {
|
|
@@ -7758,7 +7758,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7758
7758
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7759
7759
|
process.exit(1);
|
|
7760
7760
|
}
|
|
7761
|
-
const { startWebServer } = await import("./server-
|
|
7761
|
+
const { startWebServer } = await import("./server-O2YK3VWK.js");
|
|
7762
7762
|
await startWebServer({ port, host: options.host });
|
|
7763
7763
|
});
|
|
7764
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) => {
|
|
@@ -7925,11 +7925,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7925
7925
|
console.log(footer + "\n");
|
|
7926
7926
|
});
|
|
7927
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) => {
|
|
7928
|
-
const { runUsageCli } = await import("./usage-
|
|
7928
|
+
const { runUsageCli } = await import("./usage-AIHU5PIY.js");
|
|
7929
7929
|
await runUsageCli(options);
|
|
7930
7930
|
});
|
|
7931
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) => {
|
|
7932
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7932
|
+
const { runDoctorCli } = await import("./doctor-cli-R3AH5CLF.js");
|
|
7933
7933
|
const argv = process.argv.slice(2);
|
|
7934
7934
|
await runDoctorCli({
|
|
7935
7935
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -7938,7 +7938,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
7938
7938
|
});
|
|
7939
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) => {
|
|
7940
7940
|
try {
|
|
7941
|
-
const batch = await import("./batch-
|
|
7941
|
+
const batch = await import("./batch-K6IRL6TU.js");
|
|
7942
7942
|
switch (action) {
|
|
7943
7943
|
case "submit":
|
|
7944
7944
|
if (!arg) {
|
|
@@ -7981,7 +7981,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7981
7981
|
}
|
|
7982
7982
|
});
|
|
7983
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) => {
|
|
7984
|
-
const { startMcpServer } = await import("./server-
|
|
7984
|
+
const { startMcpServer } = await import("./server-E5XTQG7W.js");
|
|
7985
7985
|
await startMcpServer({
|
|
7986
7986
|
allowDestructive: !!options.allowDestructive,
|
|
7987
7987
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7994,7 +7994,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7994
7994
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
7995
7995
|
process.exit(1);
|
|
7996
7996
|
}
|
|
7997
|
-
const { runPrCli } = await import("./pr-
|
|
7997
|
+
const { runPrCli } = await import("./pr-HX6V63FO.js");
|
|
7998
7998
|
const result = await runPrCli({
|
|
7999
7999
|
action,
|
|
8000
8000
|
target,
|
|
@@ -8014,8 +8014,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8014
8014
|
process.exit(result.exitCode);
|
|
8015
8015
|
});
|
|
8016
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) => {
|
|
8017
|
-
const { runCi } = await import("./ci-
|
|
8018
|
-
const { formatCiResult } = await import("./ci-format-
|
|
8017
|
+
const { runCi } = await import("./ci-D35MUGEH.js");
|
|
8018
|
+
const { formatCiResult } = await import("./ci-format-EQ4HGHXR.js");
|
|
8019
8019
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
8020
8020
|
if (formats > 1) {
|
|
8021
8021
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -8173,7 +8173,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
8173
8173
|
config.get("customProviders"),
|
|
8174
8174
|
config.getConfigDir()
|
|
8175
8175
|
);
|
|
8176
|
-
const { startHub } = await import("./hub-
|
|
8176
|
+
const { startHub } = await import("./hub-AAYGBUDA.js");
|
|
8177
8177
|
await startHub(
|
|
8178
8178
|
{
|
|
8179
8179
|
topic: topic ?? "",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
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-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-EEQHP4GK.js";
|
|
15
|
+
import "./chunk-ODYTXQ26.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JGQ3TULW.js";
|
|
19
19
|
import "./chunk-5ULLIOVC.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JZNKM3RV.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
11
|
+
} from "./chunk-ACO2RJY3.js";
|
|
12
12
|
import {
|
|
13
13
|
getDangerLevel,
|
|
14
14
|
schemaToJsonSchema
|
|
15
|
-
} from "./chunk-
|
|
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-
|
|
19
|
+
import "./chunk-NI34BUBR.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JZNKM3RV.js";
|
|
23
23
|
import "./chunk-NVUCDUXE.js";
|
|
24
24
|
import "./chunk-KHYD3WXE.js";
|
|
25
25
|
import "./chunk-B5TYJO7V.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
scanDirTree,
|
|
24
24
|
scanProject,
|
|
25
25
|
setupProxy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VSEXYCEE.js";
|
|
27
27
|
import {
|
|
28
28
|
buildReviewPrompt,
|
|
29
29
|
buildSecurityReviewPrompt
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
truncateOutput,
|
|
68
68
|
undoStack,
|
|
69
69
|
updateMemoryApproval
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-MQVC7FJH.js";
|
|
71
71
|
import "./chunk-K3CF65QH.js";
|
|
72
72
|
import "./chunk-UUSRWSSX.js";
|
|
73
73
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -84,10 +84,10 @@ import {
|
|
|
84
84
|
buildDoctorReport,
|
|
85
85
|
formatDoctorReport,
|
|
86
86
|
loadContextFiles
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-4GF47FW3.js";
|
|
88
88
|
import {
|
|
89
89
|
ProviderRegistry
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-EEQHP4GK.js";
|
|
91
91
|
import {
|
|
92
92
|
describePlugin,
|
|
93
93
|
getActivePluginAssets,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
runTool,
|
|
103
103
|
setPluginEnabled,
|
|
104
104
|
trustPlugin
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-ACO2RJY3.js";
|
|
106
106
|
import {
|
|
107
107
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
108
108
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -118,10 +118,10 @@ import {
|
|
|
118
118
|
stripOuterCodeFence,
|
|
119
119
|
stripToolCallReminder,
|
|
120
120
|
teeStreamErrorSummary
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-ODYTXQ26.js";
|
|
122
122
|
import {
|
|
123
123
|
ConfigManager
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-JGQ3TULW.js";
|
|
125
125
|
import "./chunk-5ULLIOVC.js";
|
|
126
126
|
import {
|
|
127
127
|
formatGitContextForPrompt,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
getGitRoot
|
|
130
130
|
} from "./chunk-HOSJZMQS.js";
|
|
131
131
|
import "./chunk-4BKXL7SM.js";
|
|
132
|
-
import "./chunk-
|
|
132
|
+
import "./chunk-NI34BUBR.js";
|
|
133
133
|
import {
|
|
134
134
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
135
135
|
AUTHOR,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
SKILLS_DIR_NAME,
|
|
147
147
|
VERSION,
|
|
148
148
|
buildUserIdentityPrompt
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-JZNKM3RV.js";
|
|
150
150
|
import "./chunk-NVUCDUXE.js";
|
|
151
151
|
import "./chunk-KHYD3WXE.js";
|
|
152
152
|
import {
|
|
@@ -1598,7 +1598,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
1598
1598
|
async function handleTest(args, ctx) {
|
|
1599
1599
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1600
1600
|
try {
|
|
1601
|
-
const { executeTests } = await import("./run-tests-
|
|
1601
|
+
const { executeTests } = await import("./run-tests-5QHWA4MF.js");
|
|
1602
1602
|
const argStr = args.join(" ").trim();
|
|
1603
1603
|
let testArgs = {};
|
|
1604
1604
|
if (argStr) {
|