jinzd-ai-cli 0.4.195 → 0.4.196
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-GRWWEG6A.js} +2 -2
- package/dist/{chunk-4ZRGTTO4.js → chunk-DXUS6OZH.js} +1 -1
- package/dist/{chunk-6WUIOZGL.js → chunk-DXWNQA7R.js} +1 -1
- package/dist/{chunk-XTL6I7J3.js → chunk-GCQCR6GS.js} +2 -2
- package/dist/{chunk-7YZXAPHE.js → chunk-I5GST3DL.js} +1 -1
- package/dist/{chunk-KT6PA3NH.js → chunk-MJAQ7GYG.js} +1 -1
- package/dist/{chunk-6RWXUT74.js → chunk-PK7MMIKC.js} +1 -1
- package/dist/{chunk-A2P7LQEX.js → chunk-PREP4QF5.js} +3 -3
- package/dist/{chunk-VWZMVWA4.js → chunk-UA43JQPP.js} +21 -0
- package/dist/{chunk-KRP2XBJ3.js → chunk-WM2WVHKT.js} +1 -1
- package/dist/{ci-FBTIW7YY.js → ci-PATHTNOQ.js} +3 -3
- package/dist/{constants-5LJTWBPU.js → constants-K6Z3CTGO.js} +1 -1
- package/dist/{doctor-cli-2JM5LE3J.js → doctor-cli-OPFDP5XS.js} +5 -5
- package/dist/electron-server.js +34 -2
- package/dist/{hub-ZIYP65L7.js → hub-4GYSHUUZ.js} +1 -1
- package/dist/index.js +33 -17
- package/dist/{run-tests-2H2G7VPL.js → run-tests-JI4KLFJ5.js} +2 -2
- package/dist/{run-tests-RY4GBMDM.js → run-tests-SRAVIQHP.js} +1 -1
- package/dist/{server-VJYNMQOR.js → server-JNHAYMDO.js} +19 -8
- package/dist/{server-6ZDQTDLT.js → server-ZBM2UVWA.js} +4 -4
- package/dist/{task-orchestrator-PA5PWQFE.js → task-orchestrator-4IPPR3RK.js} +4 -4
- package/dist/{usage-CF37QUOV.js → usage-EEQI544N.js} +2 -2
- 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-WM2WVHKT.js";
|
|
5
5
|
import "./chunk-TZQHYZKT.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-PK7MMIKC.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFileSync
|
|
9
9
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PREP4QF5.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-PK7MMIKC.js";
|
|
15
15
|
|
|
16
16
|
// src/mcp/client.ts
|
|
17
17
|
import { spawn } from "child_process";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DXWNQA7R.js";
|
|
9
9
|
import {
|
|
10
10
|
runTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MJAQ7GYG.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-PK7MMIKC.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",
|
|
@@ -1580,6 +1598,9 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
|
|
|
1580
1598
|
defaultBaseUrl = "https://api.moonshot.ai/v1";
|
|
1581
1599
|
// 禁用流式工具调用:Kimi 的 XML 伪调用检测(方案 A)需要完整响应
|
|
1582
1600
|
enableStreamingToolCalls = false;
|
|
1601
|
+
// content-only tee 不可靠(同 DeepSeek):agentic 惯性下重生成会复发伪工具调用,
|
|
1602
|
+
// 剥不出文档正文。host 据此跳过 tee、直接走 deferred 赛道(v0.4.196)。
|
|
1603
|
+
reliableContentOnlyTee = false;
|
|
1583
1604
|
/**
|
|
1584
1605
|
* Kimi K2.x 系列(非 moonshot-v1)只允许 temperature=1。
|
|
1585
1606
|
* 其他值会收到 400 "invalid temperature: only 1 is allowed for this model"。
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-HLWUDRBO.js";
|
|
7
7
|
import {
|
|
8
8
|
ProviderRegistry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UA43JQPP.js";
|
|
10
10
|
import "./chunk-YZH2QQXJ.js";
|
|
11
11
|
import {
|
|
12
12
|
ConfigManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WM2WVHKT.js";
|
|
14
14
|
import "./chunk-TZQHYZKT.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PK7MMIKC.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-DXUS6OZH.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UA43JQPP.js";
|
|
9
9
|
import {
|
|
10
10
|
getStatsSnapshot,
|
|
11
11
|
getTopFailingTools,
|
|
12
12
|
getTopUsedTools,
|
|
13
13
|
resetStats
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MJAQ7GYG.js";
|
|
15
15
|
import "./chunk-YZH2QQXJ.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WM2WVHKT.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-PK7MMIKC.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-I5GST3DL.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",
|
|
@@ -3214,6 +3232,9 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
|
|
|
3214
3232
|
defaultBaseUrl = "https://api.moonshot.ai/v1";
|
|
3215
3233
|
// 禁用流式工具调用:Kimi 的 XML 伪调用检测(方案 A)需要完整响应
|
|
3216
3234
|
enableStreamingToolCalls = false;
|
|
3235
|
+
// content-only tee 不可靠(同 DeepSeek):agentic 惯性下重生成会复发伪工具调用,
|
|
3236
|
+
// 剥不出文档正文。host 据此跳过 tee、直接走 deferred 赛道(v0.4.196)。
|
|
3237
|
+
reliableContentOnlyTee = false;
|
|
3217
3238
|
/**
|
|
3218
3239
|
* Kimi K2.x 系列(非 moonshot-v1)只允许 temperature=1。
|
|
3219
3240
|
* 其他值会收到 400 "invalid temperature: only 1 is allowed for this model"。
|
|
@@ -12995,6 +13016,17 @@ ${summaryContent}`,
|
|
|
12995
13016
|
return "continue";
|
|
12996
13017
|
}
|
|
12997
13018
|
const freshPrior = freshPriorContent(lastAssistantText(apiMessages), lastAssistantAtTurnStart);
|
|
13019
|
+
if (provider.supportsContentOnlyTee === false && !freshPrior) {
|
|
13020
|
+
pendingTeeSave = saveToFile;
|
|
13021
|
+
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}` });
|
|
13022
|
+
const results = toolCalls.map((tc) => ({
|
|
13023
|
+
callId: tc.id,
|
|
13024
|
+
content: tc.id === call.id ? buildDeferredSaveInstruction(saveToFile) : "[skipped: write the document as plain text, not via tools]",
|
|
13025
|
+
isError: tc.id === call.id
|
|
13026
|
+
}));
|
|
13027
|
+
extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
|
|
13028
|
+
return "continue";
|
|
13029
|
+
}
|
|
12998
13030
|
const teeResult = await this.runSaveLastResponseTee(
|
|
12999
13031
|
provider,
|
|
13000
13032
|
call,
|
|
@@ -14188,7 +14220,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
14188
14220
|
case "test": {
|
|
14189
14221
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
14190
14222
|
try {
|
|
14191
|
-
const { executeTests } = await import("./run-tests-
|
|
14223
|
+
const { executeTests } = await import("./run-tests-SRAVIQHP.js");
|
|
14192
14224
|
const argStr = args.join(" ").trim();
|
|
14193
14225
|
let testArgs = {};
|
|
14194
14226
|
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-4IPPR3RK.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-GCQCR6GS.js";
|
|
19
19
|
import {
|
|
20
20
|
ToolExecutor,
|
|
21
21
|
ToolRegistry,
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
spawnAgentContext,
|
|
36
36
|
theme,
|
|
37
37
|
undoStack
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-PREP4QF5.js";
|
|
39
39
|
import "./chunk-T2NL5ZIA.js";
|
|
40
40
|
import "./chunk-BXP6YZ2P.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-DXWNQA7R.js";
|
|
42
42
|
import {
|
|
43
43
|
SessionManager,
|
|
44
44
|
getContentText
|
|
@@ -55,16 +55,16 @@ import {
|
|
|
55
55
|
getConfigDirUsage,
|
|
56
56
|
listRecentCrashes,
|
|
57
57
|
writeCrashLog
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-DXUS6OZH.js";
|
|
59
59
|
import {
|
|
60
60
|
ProviderRegistry
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-UA43JQPP.js";
|
|
62
62
|
import {
|
|
63
63
|
getStatsSnapshot,
|
|
64
64
|
getTopFailingTools,
|
|
65
65
|
getTopUsedTools,
|
|
66
66
|
installFlushOnExit
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-MJAQ7GYG.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-WM2WVHKT.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-PK7MMIKC.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-K6Z3CTGO.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-JI4KLFJ5.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-JNHAYMDO.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-EEQI544N.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-OPFDP5XS.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-GRWWEG6A.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-ZBM2UVWA.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-PATHTNOQ.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-4GYSHUUZ.js");
|
|
7628
7644
|
await startHub(
|
|
7629
7645
|
{
|
|
7630
7646
|
topic: topic ?? "",
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
loadDevState,
|
|
20
20
|
persistToolRound,
|
|
21
21
|
setupProxy
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GCQCR6GS.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-PREP4QF5.js";
|
|
42
42
|
import "./chunk-T2NL5ZIA.js";
|
|
43
43
|
import "./chunk-BXP6YZ2P.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-DXWNQA7R.js";
|
|
45
45
|
import {
|
|
46
46
|
SessionManager,
|
|
47
47
|
getContentText
|
|
@@ -52,10 +52,10 @@ import {
|
|
|
52
52
|
} from "./chunk-V37XOYOE.js";
|
|
53
53
|
import {
|
|
54
54
|
ProviderRegistry
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-UA43JQPP.js";
|
|
56
56
|
import {
|
|
57
57
|
runTool
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-MJAQ7GYG.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-WM2WVHKT.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-PK7MMIKC.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-JI4KLFJ5.js");
|
|
2447
2458
|
const argStr = args.join(" ").trim();
|
|
2448
2459
|
let testArgs = {};
|
|
2449
2460
|
if (argStr) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PREP4QF5.js";
|
|
5
5
|
import "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import "./chunk-BXP6YZ2P.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-DXWNQA7R.js";
|
|
8
8
|
import {
|
|
9
9
|
runTool
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MJAQ7GYG.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-PK7MMIKC.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
20
|
import "./chunk-TB4W4Y4T.js";
|
|
21
21
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PREP4QF5.js";
|
|
7
7
|
import "./chunk-T2NL5ZIA.js";
|
|
8
8
|
import "./chunk-BXP6YZ2P.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DXWNQA7R.js";
|
|
10
10
|
import {
|
|
11
11
|
runTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MJAQ7GYG.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-PK7MMIKC.js";
|
|
21
21
|
import "./chunk-4BKXL7SM.js";
|
|
22
22
|
import "./chunk-TB4W4Y4T.js";
|
|
23
23
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./chunk-V37XOYOE.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WM2WVHKT.js";
|
|
12
12
|
import "./chunk-TZQHYZKT.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-PK7MMIKC.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|