jinzd-ai-cli 0.4.195 → 0.4.197
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-46RLXVR7.js → batch-J7VUH3KF.js} +2 -2
- package/dist/{chunk-4ZRGTTO4.js → chunk-3RZPN7JQ.js} +1 -1
- package/dist/{chunk-KT6PA3NH.js → chunk-6CKRV2FS.js} +1 -1
- package/dist/{chunk-KRP2XBJ3.js → chunk-7DHEXP75.js} +1 -1
- package/dist/{chunk-6WUIOZGL.js → chunk-7HOD25LM.js} +1 -1
- package/dist/{chunk-YUBD7T2R.js → chunk-HJIO4757.js} +1 -1
- package/dist/{chunk-6RWXUT74.js → chunk-LDAYU4HS.js} +1 -1
- package/dist/{chunk-A2P7LQEX.js → chunk-LG24ALXZ.js} +3 -3
- package/dist/{chunk-VWZMVWA4.js → chunk-UE7OWTR4.js} +38 -0
- package/dist/{chunk-V37XOYOE.js → chunk-USZ74WGI.js} +3 -0
- package/dist/{chunk-7YZXAPHE.js → chunk-VO2KLECL.js} +1 -1
- package/dist/{chunk-XTL6I7J3.js → chunk-ZVBVRELH.js} +2 -2
- package/dist/{ci-FBTIW7YY.js → ci-WFZCKBQJ.js} +3 -3
- package/dist/{constants-5LJTWBPU.js → constants-WKQJDLWM.js} +1 -1
- package/dist/{doctor-cli-2JM5LE3J.js → doctor-cli-M5SBETFW.js} +5 -5
- package/dist/electron-server.js +54 -2
- package/dist/{hub-ZIYP65L7.js → hub-P5I2UR5Q.js} +1 -1
- package/dist/index.js +35 -19
- package/dist/{run-tests-2H2G7VPL.js → run-tests-5KH5JTSN.js} +2 -2
- package/dist/{run-tests-RY4GBMDM.js → run-tests-FB3FMYYM.js} +1 -1
- package/dist/{server-6ZDQTDLT.js → server-6K737MMC.js} +4 -4
- package/dist/{server-VJYNMQOR.js → server-XVVP6ALG.js} +20 -9
- package/dist/{task-orchestrator-PA5PWQFE.js → task-orchestrator-CFXNT77I.js} +4 -4
- package/dist/{usage-CF37QUOV.js → usage-ZOVDK7UC.js} +4 -4
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7DHEXP75.js";
|
|
5
5
|
import "./chunk-TZQHYZKT.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-LDAYU4HS.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFileSync
|
|
9
9
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7HOD25LM.js";
|
|
9
9
|
import {
|
|
10
10
|
runTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6CKRV2FS.js";
|
|
12
12
|
import {
|
|
13
13
|
getDangerLevel,
|
|
14
14
|
isFileWriteTool,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
SUBAGENT_ALLOWED_TOOLS,
|
|
27
27
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
28
28
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-LDAYU4HS.js";
|
|
30
30
|
import {
|
|
31
31
|
fileCheckpoints
|
|
32
32
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -16,6 +16,17 @@ import Anthropic from "@anthropic-ai/sdk";
|
|
|
16
16
|
|
|
17
17
|
// src/providers/base.ts
|
|
18
18
|
var BaseProvider = class {
|
|
19
|
+
/**
|
|
20
|
+
* 该 provider 在「无工具的 content-only 流」里能否可靠产出文档正文(save_last_response
|
|
21
|
+
* tee 模式依赖此能力)。默认 true。DeepSeek/Kimi 覆写为 false:它们带着 agentic 循环的
|
|
22
|
+
* 工具调用惯性,在 content-only 重生成里会复发伪工具调用(DSML / `<tool_call>`),tee
|
|
23
|
+
* 怎么重试都剥不出正文(同 `enableStreamingToolCalls=false` 的同源怪癖)。
|
|
24
|
+
*/
|
|
25
|
+
reliableContentOnlyTee = true;
|
|
26
|
+
/** 公开读能力位:host(REPL/Web)据此决定是否跳过注定失败的 tee、直接走 deferred 赛道。 */
|
|
27
|
+
get supportsContentOnlyTee() {
|
|
28
|
+
return this.reliableContentOnlyTee;
|
|
29
|
+
}
|
|
19
30
|
/**
|
|
20
31
|
* 将 Message[] 转换为 OpenAI API 格式的消息数组。
|
|
21
32
|
* content 为 string 时直接传递;为 MessageContentPart[] 时保留数组格式(vision 请求)。
|
|
@@ -1384,6 +1395,13 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
|
|
|
1384
1395
|
defaultBaseUrl = "https://api.deepseek.com/v1";
|
|
1385
1396
|
/** 禁用流式工具调用,确保 chatWithTools 覆写(代码块检测)生效 */
|
|
1386
1397
|
enableStreamingToolCalls = false;
|
|
1398
|
+
/**
|
|
1399
|
+
* content-only tee 不可靠:DeepSeek(尤以 V4 Pro)带着 agentic 循环的工具调用惯性,
|
|
1400
|
+
* 在无工具的重生成流里会复发伪工具调用(DSML / `<tool_call>`),剥不出文档正文。
|
|
1401
|
+
* host 据此跳过注定失败的 tee、直接走 deferred 赛道(普通文本写报告 + 自动落盘),
|
|
1402
|
+
* 省掉一次满上下文往返(v0.4.196)。
|
|
1403
|
+
*/
|
|
1404
|
+
reliableContentOnlyTee = false;
|
|
1387
1405
|
info = {
|
|
1388
1406
|
id: "deepseek",
|
|
1389
1407
|
displayName: "DeepSeek",
|
|
@@ -1471,6 +1489,23 @@ var ZhipuProvider = class extends OpenAICompatibleProvider {
|
|
|
1471
1489
|
requiresApiKey: true,
|
|
1472
1490
|
baseUrl: this.defaultBaseUrl,
|
|
1473
1491
|
models: [
|
|
1492
|
+
// ── GLM-5.2 系列(2026-06 最新旗舰,主打代码工程 + 百万上下文) ──
|
|
1493
|
+
// 744B MoE / 40B active,与 5.1 同底座,后训练强化超长上下文代码任务。
|
|
1494
|
+
// 思考模式 High/Max 由请求参数控制,不另列 model id。
|
|
1495
|
+
{
|
|
1496
|
+
id: "glm-5.2",
|
|
1497
|
+
displayName: "GLM-5.2 (2026-06 Flagship, 200K, Coding)",
|
|
1498
|
+
contextWindow: 204800,
|
|
1499
|
+
supportsStreaming: true,
|
|
1500
|
+
supportsThinking: true
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
id: "glm-5.2[1m]",
|
|
1504
|
+
displayName: "GLM-5.2 [1M] (\u767E\u4E07\u4E0A\u4E0B\u6587\uFF0C\u6574\u5E93\u5206\u6790/\u5168\u5C40\u91CD\u6784)",
|
|
1505
|
+
contextWindow: 1e6,
|
|
1506
|
+
supportsStreaming: true,
|
|
1507
|
+
supportsThinking: true
|
|
1508
|
+
},
|
|
1474
1509
|
// ── GLM-5.1 系列(2026-04 旗舰,主打长程 Agent + 代码工程) ──
|
|
1475
1510
|
{
|
|
1476
1511
|
id: "glm-5.1",
|
|
@@ -1580,6 +1615,9 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
|
|
|
1580
1615
|
defaultBaseUrl = "https://api.moonshot.ai/v1";
|
|
1581
1616
|
// 禁用流式工具调用:Kimi 的 XML 伪调用检测(方案 A)需要完整响应
|
|
1582
1617
|
enableStreamingToolCalls = false;
|
|
1618
|
+
// content-only tee 不可靠(同 DeepSeek):agentic 惯性下重生成会复发伪工具调用,
|
|
1619
|
+
// 剥不出文档正文。host 据此跳过 tee、直接走 deferred 赛道(v0.4.196)。
|
|
1620
|
+
reliableContentOnlyTee = false;
|
|
1583
1621
|
/**
|
|
1584
1622
|
* Kimi K2.x 系列(非 moonshot-v1)只允许 temperature=1。
|
|
1585
1623
|
* 其他值会收到 400 "invalid temperature: only 1 is allowed for this model"。
|
|
@@ -59,6 +59,9 @@ var PRICING_TABLE = {
|
|
|
59
59
|
"glm-4.6": { input: 0.6, output: 2.2 },
|
|
60
60
|
"glm-4.6v": { input: 0.6, output: 2.2 },
|
|
61
61
|
"glm-5": { input: 0.85, output: 2.85 },
|
|
62
|
+
// GLM-5.2(2026-06)官方直连 API 定价 $1.40 / $4.40。
|
|
63
|
+
// 'glm-5.2[1m]' 走最长前缀匹配命中 'glm-5.2'(暂按同价,1M 变体若另计费再拆)。
|
|
64
|
+
"glm-5.2": { input: 1.4, output: 4.4 },
|
|
62
65
|
"glm-5.1": { input: 0.95, output: 3.15 },
|
|
63
66
|
"glm-5.1-reasoning": { input: 1.4, output: 4.4 },
|
|
64
67
|
"glm-5.1-air": { input: 0.4, output: 1.2 },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LG24ALXZ.js";
|
|
5
5
|
import {
|
|
6
6
|
APP_NAME,
|
|
7
7
|
CONFIG_DIR_NAME,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
MCP_PROTOCOL_VERSION,
|
|
12
12
|
MCP_TOOL_PREFIX,
|
|
13
13
|
VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LDAYU4HS.js";
|
|
15
15
|
|
|
16
16
|
// src/mcp/client.ts
|
|
17
17
|
import { spawn } from "child_process";
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-HLWUDRBO.js";
|
|
7
7
|
import {
|
|
8
8
|
ProviderRegistry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UE7OWTR4.js";
|
|
10
10
|
import "./chunk-YZH2QQXJ.js";
|
|
11
11
|
import {
|
|
12
12
|
ConfigManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7DHEXP75.js";
|
|
14
14
|
import "./chunk-TZQHYZKT.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LDAYU4HS.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/ci.ts
|
|
20
20
|
import { execFileSync, execSync } from "child_process";
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getConfigDirUsage,
|
|
4
4
|
listRecentCrashes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3RZPN7JQ.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UE7OWTR4.js";
|
|
9
9
|
import {
|
|
10
10
|
getStatsSnapshot,
|
|
11
11
|
getTopFailingTools,
|
|
12
12
|
getTopUsedTools,
|
|
13
13
|
resetStats
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6CKRV2FS.js";
|
|
15
15
|
import "./chunk-YZH2QQXJ.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7DHEXP75.js";
|
|
19
19
|
import "./chunk-TZQHYZKT.js";
|
|
20
20
|
import {
|
|
21
21
|
DEV_STATE_FILE_NAME,
|
|
22
22
|
MEMORY_FILE_NAME,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LDAYU4HS.js";
|
|
25
25
|
import "./chunk-IW3Q7AE5.js";
|
|
26
26
|
|
|
27
27
|
// src/diagnostics/doctor-cli.ts
|
package/dist/electron-server.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
VERSION,
|
|
37
37
|
buildUserIdentityPrompt,
|
|
38
38
|
runTestsTool
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-VO2KLECL.js";
|
|
40
40
|
import {
|
|
41
41
|
hasSemanticIndex,
|
|
42
42
|
semanticSearch
|
|
@@ -608,6 +608,17 @@ import Anthropic from "@anthropic-ai/sdk";
|
|
|
608
608
|
|
|
609
609
|
// src/providers/base.ts
|
|
610
610
|
var BaseProvider = class {
|
|
611
|
+
/**
|
|
612
|
+
* 该 provider 在「无工具的 content-only 流」里能否可靠产出文档正文(save_last_response
|
|
613
|
+
* tee 模式依赖此能力)。默认 true。DeepSeek/Kimi 覆写为 false:它们带着 agentic 循环的
|
|
614
|
+
* 工具调用惯性,在 content-only 重生成里会复发伪工具调用(DSML / `<tool_call>`),tee
|
|
615
|
+
* 怎么重试都剥不出正文(同 `enableStreamingToolCalls=false` 的同源怪癖)。
|
|
616
|
+
*/
|
|
617
|
+
reliableContentOnlyTee = true;
|
|
618
|
+
/** 公开读能力位:host(REPL/Web)据此决定是否跳过注定失败的 tee、直接走 deferred 赛道。 */
|
|
619
|
+
get supportsContentOnlyTee() {
|
|
620
|
+
return this.reliableContentOnlyTee;
|
|
621
|
+
}
|
|
611
622
|
/**
|
|
612
623
|
* 将 Message[] 转换为 OpenAI API 格式的消息数组。
|
|
613
624
|
* content 为 string 时直接传递;为 MessageContentPart[] 时保留数组格式(vision 请求)。
|
|
@@ -3018,6 +3029,13 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
|
|
|
3018
3029
|
defaultBaseUrl = "https://api.deepseek.com/v1";
|
|
3019
3030
|
/** 禁用流式工具调用,确保 chatWithTools 覆写(代码块检测)生效 */
|
|
3020
3031
|
enableStreamingToolCalls = false;
|
|
3032
|
+
/**
|
|
3033
|
+
* content-only tee 不可靠:DeepSeek(尤以 V4 Pro)带着 agentic 循环的工具调用惯性,
|
|
3034
|
+
* 在无工具的重生成流里会复发伪工具调用(DSML / `<tool_call>`),剥不出文档正文。
|
|
3035
|
+
* host 据此跳过注定失败的 tee、直接走 deferred 赛道(普通文本写报告 + 自动落盘),
|
|
3036
|
+
* 省掉一次满上下文往返(v0.4.196)。
|
|
3037
|
+
*/
|
|
3038
|
+
reliableContentOnlyTee = false;
|
|
3021
3039
|
info = {
|
|
3022
3040
|
id: "deepseek",
|
|
3023
3041
|
displayName: "DeepSeek",
|
|
@@ -3105,6 +3123,23 @@ var ZhipuProvider = class extends OpenAICompatibleProvider {
|
|
|
3105
3123
|
requiresApiKey: true,
|
|
3106
3124
|
baseUrl: this.defaultBaseUrl,
|
|
3107
3125
|
models: [
|
|
3126
|
+
// ── GLM-5.2 系列(2026-06 最新旗舰,主打代码工程 + 百万上下文) ──
|
|
3127
|
+
// 744B MoE / 40B active,与 5.1 同底座,后训练强化超长上下文代码任务。
|
|
3128
|
+
// 思考模式 High/Max 由请求参数控制,不另列 model id。
|
|
3129
|
+
{
|
|
3130
|
+
id: "glm-5.2",
|
|
3131
|
+
displayName: "GLM-5.2 (2026-06 Flagship, 200K, Coding)",
|
|
3132
|
+
contextWindow: 204800,
|
|
3133
|
+
supportsStreaming: true,
|
|
3134
|
+
supportsThinking: true
|
|
3135
|
+
},
|
|
3136
|
+
{
|
|
3137
|
+
id: "glm-5.2[1m]",
|
|
3138
|
+
displayName: "GLM-5.2 [1M] (\u767E\u4E07\u4E0A\u4E0B\u6587\uFF0C\u6574\u5E93\u5206\u6790/\u5168\u5C40\u91CD\u6784)",
|
|
3139
|
+
contextWindow: 1e6,
|
|
3140
|
+
supportsStreaming: true,
|
|
3141
|
+
supportsThinking: true
|
|
3142
|
+
},
|
|
3108
3143
|
// ── GLM-5.1 系列(2026-04 旗舰,主打长程 Agent + 代码工程) ──
|
|
3109
3144
|
{
|
|
3110
3145
|
id: "glm-5.1",
|
|
@@ -3214,6 +3249,9 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
|
|
|
3214
3249
|
defaultBaseUrl = "https://api.moonshot.ai/v1";
|
|
3215
3250
|
// 禁用流式工具调用:Kimi 的 XML 伪调用检测(方案 A)需要完整响应
|
|
3216
3251
|
enableStreamingToolCalls = false;
|
|
3252
|
+
// content-only tee 不可靠(同 DeepSeek):agentic 惯性下重生成会复发伪工具调用,
|
|
3253
|
+
// 剥不出文档正文。host 据此跳过 tee、直接走 deferred 赛道(v0.4.196)。
|
|
3254
|
+
reliableContentOnlyTee = false;
|
|
3217
3255
|
/**
|
|
3218
3256
|
* Kimi K2.x 系列(非 moonshot-v1)只允许 temperature=1。
|
|
3219
3257
|
* 其他值会收到 400 "invalid temperature: only 1 is allowed for this model"。
|
|
@@ -11423,6 +11461,9 @@ var PRICING_TABLE = {
|
|
|
11423
11461
|
"glm-4.6": { input: 0.6, output: 2.2 },
|
|
11424
11462
|
"glm-4.6v": { input: 0.6, output: 2.2 },
|
|
11425
11463
|
"glm-5": { input: 0.85, output: 2.85 },
|
|
11464
|
+
// GLM-5.2(2026-06)官方直连 API 定价 $1.40 / $4.40。
|
|
11465
|
+
// 'glm-5.2[1m]' 走最长前缀匹配命中 'glm-5.2'(暂按同价,1M 变体若另计费再拆)。
|
|
11466
|
+
"glm-5.2": { input: 1.4, output: 4.4 },
|
|
11426
11467
|
"glm-5.1": { input: 0.95, output: 3.15 },
|
|
11427
11468
|
"glm-5.1-reasoning": { input: 1.4, output: 4.4 },
|
|
11428
11469
|
"glm-5.1-air": { input: 0.4, output: 1.2 },
|
|
@@ -12995,6 +13036,17 @@ ${summaryContent}`,
|
|
|
12995
13036
|
return "continue";
|
|
12996
13037
|
}
|
|
12997
13038
|
const freshPrior = freshPriorContent(lastAssistantText(apiMessages), lastAssistantAtTurnStart);
|
|
13039
|
+
if (provider.supportsContentOnlyTee === false && !freshPrior) {
|
|
13040
|
+
pendingTeeSave = saveToFile;
|
|
13041
|
+
this.send({ type: "info", message: `\u21AA \u8DF3\u8FC7 tee\uFF08${this.currentProvider} \u4E0D\u64C5\u957F content-only \u751F\u6210\uFF09\uFF0C\u6539\u7528\u666E\u901A\u6587\u672C\u5199\u62A5\u544A\uFF0C\u5C06\u81EA\u52A8\u4FDD\u5B58\u5230 ${saveToFile}` });
|
|
13042
|
+
const results = toolCalls.map((tc) => ({
|
|
13043
|
+
callId: tc.id,
|
|
13044
|
+
content: tc.id === call.id ? buildDeferredSaveInstruction(saveToFile) : "[skipped: write the document as plain text, not via tools]",
|
|
13045
|
+
isError: tc.id === call.id
|
|
13046
|
+
}));
|
|
13047
|
+
extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
|
|
13048
|
+
return "continue";
|
|
13049
|
+
}
|
|
12998
13050
|
const teeResult = await this.runSaveLastResponseTee(
|
|
12999
13051
|
provider,
|
|
13000
13052
|
call,
|
|
@@ -14188,7 +14240,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
14188
14240
|
case "test": {
|
|
14189
14241
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
14190
14242
|
try {
|
|
14191
|
-
const { executeTests } = await import("./run-tests-
|
|
14243
|
+
const { executeTests } = await import("./run-tests-FB3FMYYM.js");
|
|
14192
14244
|
const argStr = args.join(" ").trim();
|
|
14193
14245
|
let testArgs = {};
|
|
14194
14246
|
if (argStr) {
|
|
@@ -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-CFXNT77I.js");
|
|
158
158
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
159
159
|
let interrupted = false;
|
|
160
160
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
saveDevState,
|
|
16
16
|
sessionHasMeaningfulContent,
|
|
17
17
|
setupProxy
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZVBVRELH.js";
|
|
19
19
|
import {
|
|
20
20
|
ToolExecutor,
|
|
21
21
|
ToolRegistry,
|
|
@@ -35,36 +35,36 @@ import {
|
|
|
35
35
|
spawnAgentContext,
|
|
36
36
|
theme,
|
|
37
37
|
undoStack
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LG24ALXZ.js";
|
|
39
39
|
import "./chunk-T2NL5ZIA.js";
|
|
40
40
|
import "./chunk-BXP6YZ2P.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-7HOD25LM.js";
|
|
42
42
|
import {
|
|
43
43
|
SessionManager,
|
|
44
44
|
getContentText
|
|
45
45
|
} from "./chunk-MC34ISJU.js";
|
|
46
46
|
import {
|
|
47
47
|
CostTracker
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-HJIO4757.js";
|
|
49
49
|
import {
|
|
50
50
|
computeCost,
|
|
51
51
|
formatCost,
|
|
52
52
|
getPricing
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-USZ74WGI.js";
|
|
54
54
|
import {
|
|
55
55
|
getConfigDirUsage,
|
|
56
56
|
listRecentCrashes,
|
|
57
57
|
writeCrashLog
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-3RZPN7JQ.js";
|
|
59
59
|
import {
|
|
60
60
|
ProviderRegistry
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-UE7OWTR4.js";
|
|
62
62
|
import {
|
|
63
63
|
getStatsSnapshot,
|
|
64
64
|
getTopFailingTools,
|
|
65
65
|
getTopUsedTools,
|
|
66
66
|
installFlushOnExit
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-6CKRV2FS.js";
|
|
68
68
|
import {
|
|
69
69
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
70
70
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
} from "./chunk-YZH2QQXJ.js";
|
|
86
86
|
import {
|
|
87
87
|
ConfigManager
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-7DHEXP75.js";
|
|
89
89
|
import {
|
|
90
90
|
AuthError,
|
|
91
91
|
ProviderError,
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
SKILLS_DIR_NAME,
|
|
113
113
|
VERSION,
|
|
114
114
|
buildUserIdentityPrompt
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-LDAYU4HS.js";
|
|
116
116
|
import {
|
|
117
117
|
formatGitContextForPrompt,
|
|
118
118
|
getGitContext,
|
|
@@ -1827,7 +1827,7 @@ No tools match "${filter}".
|
|
|
1827
1827
|
const { join: join5 } = await import("path");
|
|
1828
1828
|
const { existsSync: existsSync5 } = await import("fs");
|
|
1829
1829
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1830
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1830
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-WKQJDLWM.js");
|
|
1831
1831
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1832
1832
|
const cwd = process.cwd();
|
|
1833
1833
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2888,7 +2888,7 @@ ${hint}` : "")
|
|
|
2888
2888
|
usage: "/test [command|filter]",
|
|
2889
2889
|
async execute(args, ctx) {
|
|
2890
2890
|
try {
|
|
2891
|
-
const { executeTests } = await import("./run-tests-
|
|
2891
|
+
const { executeTests } = await import("./run-tests-5KH5JTSN.js");
|
|
2892
2892
|
const argStr = args.join(" ").trim();
|
|
2893
2893
|
let testArgs = {};
|
|
2894
2894
|
if (argStr) {
|
|
@@ -6818,6 +6818,22 @@ Tip: You can continue the conversation by asking the AI to proceed.`
|
|
|
6818
6818
|
extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
|
|
6819
6819
|
return "continue";
|
|
6820
6820
|
}
|
|
6821
|
+
if (provider.supportsContentOnlyTee === false && !freshPriorContent(lastResponseStore.content, lastResponseAtTurnStart)) {
|
|
6822
|
+
pendingTeeSave = saveToFile;
|
|
6823
|
+
process.stdout.write(theme.dim(
|
|
6824
|
+
`
|
|
6825
|
+
\u21AA ${this.currentProvider} \u4E0D\u64C5\u957F content-only \u751F\u6210\uFF0C\u8DF3\u8FC7 tee\uFF0C\u6539\u7528\u666E\u901A\u6587\u672C\u5199\u62A5\u544A\uFF08\u5C06\u81EA\u52A8\u4FDD\u5B58\u5230 ${saveToFile}\uFF09
|
|
6826
|
+
|
|
6827
|
+
`
|
|
6828
|
+
));
|
|
6829
|
+
const results = toolCalls.map((tc) => ({
|
|
6830
|
+
callId: tc.id,
|
|
6831
|
+
content: tc.name === "save_last_response" ? buildDeferredSaveInstruction(saveToFile) : `[skipped: write the document as plain text, not via tools]`,
|
|
6832
|
+
isError: tc.name === "save_last_response"
|
|
6833
|
+
}));
|
|
6834
|
+
extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
|
|
6835
|
+
return "continue";
|
|
6836
|
+
}
|
|
6821
6837
|
const teeAc = this.setupStreamInterrupt();
|
|
6822
6838
|
try {
|
|
6823
6839
|
const teeSystemPrompt = stripToolCallReminder(systemPrompt ?? "") + CONTENT_ONLY_STREAM_REMINDER;
|
|
@@ -7250,7 +7266,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7250
7266
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7251
7267
|
process.exit(1);
|
|
7252
7268
|
}
|
|
7253
|
-
const { startWebServer } = await import("./server-
|
|
7269
|
+
const { startWebServer } = await import("./server-XVVP6ALG.js");
|
|
7254
7270
|
await startWebServer({ port, host: options.host });
|
|
7255
7271
|
});
|
|
7256
7272
|
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) => {
|
|
@@ -7417,16 +7433,16 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7417
7433
|
console.log(footer + "\n");
|
|
7418
7434
|
});
|
|
7419
7435
|
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) => {
|
|
7420
|
-
const { runUsageCli } = await import("./usage-
|
|
7436
|
+
const { runUsageCli } = await import("./usage-ZOVDK7UC.js");
|
|
7421
7437
|
await runUsageCli(options);
|
|
7422
7438
|
});
|
|
7423
7439
|
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) => {
|
|
7424
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7440
|
+
const { runDoctorCli } = await import("./doctor-cli-M5SBETFW.js");
|
|
7425
7441
|
await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
|
|
7426
7442
|
});
|
|
7427
7443
|
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) => {
|
|
7428
7444
|
try {
|
|
7429
|
-
const batch = await import("./batch-
|
|
7445
|
+
const batch = await import("./batch-J7VUH3KF.js");
|
|
7430
7446
|
switch (action) {
|
|
7431
7447
|
case "submit":
|
|
7432
7448
|
if (!arg) {
|
|
@@ -7469,7 +7485,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7469
7485
|
}
|
|
7470
7486
|
});
|
|
7471
7487
|
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) => {
|
|
7472
|
-
const { startMcpServer } = await import("./server-
|
|
7488
|
+
const { startMcpServer } = await import("./server-6K737MMC.js");
|
|
7473
7489
|
await startMcpServer({
|
|
7474
7490
|
allowDestructive: !!options.allowDestructive,
|
|
7475
7491
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7478,7 +7494,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
|
|
|
7478
7494
|
});
|
|
7479
7495
|
});
|
|
7480
7496
|
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; diff fetched via `gh pr diff <num>`", (v) => parseInt(v, 10)).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)").action(async (options) => {
|
|
7481
|
-
const { runCi } = await import("./ci-
|
|
7497
|
+
const { runCi } = await import("./ci-WFZCKBQJ.js");
|
|
7482
7498
|
const result = await runCi({
|
|
7483
7499
|
pr: options.pr,
|
|
7484
7500
|
base: options.base,
|
|
@@ -7624,7 +7640,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7624
7640
|
}),
|
|
7625
7641
|
config.get("customProviders")
|
|
7626
7642
|
);
|
|
7627
|
-
const { startHub } = await import("./hub-
|
|
7643
|
+
const { startHub } = await import("./hub-P5I2UR5Q.js");
|
|
7628
7644
|
await startHub(
|
|
7629
7645
|
{
|
|
7630
7646
|
topic: topic ?? "",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LG24ALXZ.js";
|
|
5
5
|
import "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import "./chunk-BXP6YZ2P.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-7HOD25LM.js";
|
|
8
8
|
import {
|
|
9
9
|
runTool
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6CKRV2FS.js";
|
|
11
11
|
import {
|
|
12
12
|
getDangerLevel,
|
|
13
13
|
schemaToJsonSchema
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-TZQHYZKT.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LDAYU4HS.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
20
|
import "./chunk-TB4W4Y4T.js";
|
|
21
21
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
loadDevState,
|
|
20
20
|
persistToolRound,
|
|
21
21
|
setupProxy
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZVBVRELH.js";
|
|
23
23
|
import {
|
|
24
24
|
ToolExecutor,
|
|
25
25
|
ToolRegistry,
|
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
spawnAgentContext,
|
|
39
39
|
truncateOutput,
|
|
40
40
|
undoStack
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-LG24ALXZ.js";
|
|
42
42
|
import "./chunk-T2NL5ZIA.js";
|
|
43
43
|
import "./chunk-BXP6YZ2P.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-7HOD25LM.js";
|
|
45
45
|
import {
|
|
46
46
|
SessionManager,
|
|
47
47
|
getContentText
|
|
@@ -49,13 +49,13 @@ import {
|
|
|
49
49
|
import {
|
|
50
50
|
computeCost,
|
|
51
51
|
formatCost
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-USZ74WGI.js";
|
|
53
53
|
import {
|
|
54
54
|
ProviderRegistry
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-UE7OWTR4.js";
|
|
56
56
|
import {
|
|
57
57
|
runTool
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-6CKRV2FS.js";
|
|
59
59
|
import {
|
|
60
60
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
61
61
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
} from "./chunk-YZH2QQXJ.js";
|
|
74
74
|
import {
|
|
75
75
|
ConfigManager
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-7DHEXP75.js";
|
|
77
77
|
import "./chunk-TZQHYZKT.js";
|
|
78
78
|
import {
|
|
79
79
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
SKILLS_DIR_NAME,
|
|
94
94
|
VERSION,
|
|
95
95
|
buildUserIdentityPrompt
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-LDAYU4HS.js";
|
|
97
97
|
import {
|
|
98
98
|
formatGitContextForPrompt,
|
|
99
99
|
getGitContext,
|
|
@@ -1250,6 +1250,17 @@ ${summaryContent}`,
|
|
|
1250
1250
|
return "continue";
|
|
1251
1251
|
}
|
|
1252
1252
|
const freshPrior = freshPriorContent(lastAssistantText(apiMessages), lastAssistantAtTurnStart);
|
|
1253
|
+
if (provider.supportsContentOnlyTee === false && !freshPrior) {
|
|
1254
|
+
pendingTeeSave = saveToFile;
|
|
1255
|
+
this.send({ type: "info", message: `\u21AA \u8DF3\u8FC7 tee\uFF08${this.currentProvider} \u4E0D\u64C5\u957F content-only \u751F\u6210\uFF09\uFF0C\u6539\u7528\u666E\u901A\u6587\u672C\u5199\u62A5\u544A\uFF0C\u5C06\u81EA\u52A8\u4FDD\u5B58\u5230 ${saveToFile}` });
|
|
1256
|
+
const results = toolCalls.map((tc) => ({
|
|
1257
|
+
callId: tc.id,
|
|
1258
|
+
content: tc.id === call.id ? buildDeferredSaveInstruction(saveToFile) : "[skipped: write the document as plain text, not via tools]",
|
|
1259
|
+
isError: tc.id === call.id
|
|
1260
|
+
}));
|
|
1261
|
+
extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
|
|
1262
|
+
return "continue";
|
|
1263
|
+
}
|
|
1253
1264
|
const teeResult = await this.runSaveLastResponseTee(
|
|
1254
1265
|
provider,
|
|
1255
1266
|
call,
|
|
@@ -2443,7 +2454,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2443
2454
|
case "test": {
|
|
2444
2455
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2445
2456
|
try {
|
|
2446
|
-
const { executeTests } = await import("./run-tests-
|
|
2457
|
+
const { executeTests } = await import("./run-tests-5KH5JTSN.js");
|
|
2447
2458
|
const argStr = args.join(" ").trim();
|
|
2448
2459
|
let testArgs = {};
|
|
2449
2460
|
if (argStr) {
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LG24ALXZ.js";
|
|
7
7
|
import "./chunk-T2NL5ZIA.js";
|
|
8
8
|
import "./chunk-BXP6YZ2P.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-7HOD25LM.js";
|
|
10
10
|
import {
|
|
11
11
|
runTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6CKRV2FS.js";
|
|
13
13
|
import {
|
|
14
14
|
getDangerLevel,
|
|
15
15
|
runLeanAgentLoop
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import "./chunk-TZQHYZKT.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBAGENT_ALLOWED_TOOLS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LDAYU4HS.js";
|
|
21
21
|
import "./chunk-4BKXL7SM.js";
|
|
22
22
|
import "./chunk-TB4W4Y4T.js";
|
|
23
23
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CostTracker
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HJIO4757.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCost,
|
|
7
7
|
getPricing
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-USZ74WGI.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7DHEXP75.js";
|
|
12
12
|
import "./chunk-TZQHYZKT.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-LDAYU4HS.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|