jinzd-ai-cli 0.4.123 → 0.4.124
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-DPMBOGTO.js → batch-CZPE7S25.js} +2 -2
- package/dist/{chunk-TFCJJ5CP.js → chunk-2N6VKUH3.js} +3 -3
- package/dist/{chunk-WTZXHT4E.js → chunk-2Q4TRDUS.js} +2 -2
- package/dist/{chunk-AE6AICKJ.js → chunk-5PMDFNOC.js} +1 -1
- package/dist/{chunk-4EOQ52A4.js → chunk-E56SNFYK.js} +1 -1
- package/dist/{chunk-HEYZ5MOY.js → chunk-HMZHKSGB.js} +20 -24
- package/dist/{chunk-NQRQJYGV.js → chunk-I6U55T3H.js} +1 -1
- package/dist/{chunk-PADJZBKH.js → chunk-JW4O67E3.js} +1 -1
- package/dist/{chunk-W6FXW2VB.js → chunk-MANQVLVX.js} +1 -1
- package/dist/{chunk-VOJUSKA6.js → chunk-NELLBZRA.js} +1 -1
- package/dist/{constants-NXZEOTUT.js → constants-SQ6ER44V.js} +1 -1
- package/dist/{doctor-cli-OG4WKPJV.js → doctor-cli-YTMFJ6QY.js} +5 -5
- package/dist/electron-server.js +21 -25
- package/dist/{hub-LNJ7UIT5.js → hub-KMLZPWBX.js} +1 -1
- package/dist/index.js +33 -31
- package/dist/{run-tests-KK4QP56Y.js → run-tests-47O4Z3BM.js} +1 -1
- package/dist/{run-tests-YDXGZ57P.js → run-tests-V7Q3ZJW2.js} +2 -2
- package/dist/{server-ZPEHPZ5I.js → server-NASNKJZP.js} +8 -8
- package/dist/{server-HQARN5HJ.js → server-QOVMOY2G.js} +4 -4
- package/dist/{task-orchestrator-FBW2AGZJ.js → task-orchestrator-ANBMXQ2E.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-NELLBZRA.js";
|
|
5
5
|
import "./chunk-2ZD3YTVM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-I6U55T3H.js";
|
|
7
7
|
import "./chunk-PDX44BCA.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/batch.ts
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "./chunk-3BICTI5M.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-E56SNFYK.js";
|
|
9
9
|
import {
|
|
10
10
|
getDangerLevel,
|
|
11
11
|
isFileWriteTool,
|
|
12
12
|
runTool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JW4O67E3.js";
|
|
14
14
|
import {
|
|
15
15
|
EnvLoader,
|
|
16
16
|
NetworkError,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
SUBAGENT_ALLOWED_TOOLS,
|
|
24
24
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
25
25
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-I6U55T3H.js";
|
|
27
27
|
import {
|
|
28
28
|
fileCheckpoints
|
|
29
29
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2N6VKUH3.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-I6U55T3H.js";
|
|
15
15
|
import {
|
|
16
16
|
redactJson
|
|
17
17
|
} from "./chunk-7ZJN4KLV.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
schemaToJsonSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JW4O67E3.js";
|
|
5
5
|
import {
|
|
6
6
|
AuthError,
|
|
7
7
|
ProviderError,
|
|
@@ -1121,25 +1121,6 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1121
1121
|
const usage = toUsage(response.usage);
|
|
1122
1122
|
const contentStr = typeof message.content === "string" ? message.content : "";
|
|
1123
1123
|
const hasToolCalls = !!(message.tool_calls && message.tool_calls.length > 0);
|
|
1124
|
-
if (!hasToolCalls && contentStr.trim() === "") {
|
|
1125
|
-
const providerId = this.info.id;
|
|
1126
|
-
if (finishReason === "length") {
|
|
1127
|
-
process.stderr.write(
|
|
1128
|
-
`[${providerId}] \u26A0 Empty response with finish_reason='length' \u2014 output/context limit reached. Try /compact, raise maxTokens, or switch to a larger-context model.
|
|
1129
|
-
`
|
|
1130
|
-
);
|
|
1131
|
-
} else if (finishReason === "content_filter") {
|
|
1132
|
-
process.stderr.write(
|
|
1133
|
-
`[${providerId}] \u26A0 Empty response with finish_reason='content_filter' \u2014 content was blocked.
|
|
1134
|
-
`
|
|
1135
|
-
);
|
|
1136
|
-
} else {
|
|
1137
|
-
process.stderr.write(
|
|
1138
|
-
`[${providerId}] \u26A0 Empty response (finish_reason=${finishReason ?? "unknown"}). Model produced no text and no tool calls. Context window may be exhausted.
|
|
1139
|
-
`
|
|
1140
|
-
);
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
1124
|
const reasoningContent = message.reasoning_content;
|
|
1144
1125
|
if (message.tool_calls && message.tool_calls.length > 0) {
|
|
1145
1126
|
const toolCalls = message.tool_calls.map((tc) => {
|
|
@@ -1173,7 +1154,12 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1173
1154
|
});
|
|
1174
1155
|
return { toolCalls, usage, reasoningContent };
|
|
1175
1156
|
}
|
|
1176
|
-
return {
|
|
1157
|
+
return {
|
|
1158
|
+
content: message.content ?? "",
|
|
1159
|
+
usage,
|
|
1160
|
+
...reasoningContent ? { reasoningContent } : {},
|
|
1161
|
+
...!hasToolCalls && (finishReason ?? "") ? { finishReason } : {}
|
|
1162
|
+
};
|
|
1177
1163
|
} catch (err) {
|
|
1178
1164
|
throw this.wrapError(err);
|
|
1179
1165
|
}
|
|
@@ -1196,7 +1182,13 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1196
1182
|
yield { type: "text_delta", delta: result.content };
|
|
1197
1183
|
}
|
|
1198
1184
|
const rc = "reasoningContent" in result ? result.reasoningContent : void 0;
|
|
1199
|
-
|
|
1185
|
+
const fr = "finishReason" in result ? result.finishReason : void 0;
|
|
1186
|
+
yield {
|
|
1187
|
+
type: "done",
|
|
1188
|
+
usage: result.usage,
|
|
1189
|
+
...rc ? { reasoningContent: rc } : {},
|
|
1190
|
+
...fr ? { finishReason: fr } : {}
|
|
1191
|
+
};
|
|
1200
1192
|
return;
|
|
1201
1193
|
}
|
|
1202
1194
|
const openaiTools = tools.map((t) => ({
|
|
@@ -1238,8 +1230,10 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1238
1230
|
let toolCallsEnded = false;
|
|
1239
1231
|
let thinkingStarted = false;
|
|
1240
1232
|
let reasoningAccumulator = "";
|
|
1233
|
+
let lastFinishReason;
|
|
1241
1234
|
for await (const chunk of stream) {
|
|
1242
1235
|
const choice = chunk.choices[0];
|
|
1236
|
+
if (choice?.finish_reason) lastFinishReason = choice.finish_reason;
|
|
1243
1237
|
if (!choice && chunk.usage) {
|
|
1244
1238
|
if (thinkingStarted) {
|
|
1245
1239
|
yield { type: "thinking_end" };
|
|
@@ -1254,7 +1248,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1254
1248
|
yield {
|
|
1255
1249
|
type: "done",
|
|
1256
1250
|
usage: toUsage(chunk.usage),
|
|
1257
|
-
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1251
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {},
|
|
1252
|
+
...lastFinishReason && lastFinishReason !== "stop" ? { finishReason: lastFinishReason } : {}
|
|
1258
1253
|
};
|
|
1259
1254
|
continue;
|
|
1260
1255
|
}
|
|
@@ -1310,7 +1305,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1310
1305
|
}
|
|
1311
1306
|
yield {
|
|
1312
1307
|
type: "done",
|
|
1313
|
-
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1308
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {},
|
|
1309
|
+
...lastFinishReason && lastFinishReason !== "stop" ? { finishReason: lastFinishReason } : {}
|
|
1314
1310
|
};
|
|
1315
1311
|
} catch (err) {
|
|
1316
1312
|
if (err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) {
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getConfigDirUsage,
|
|
4
4
|
listRecentCrashes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MANQVLVX.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HMZHKSGB.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NELLBZRA.js";
|
|
12
12
|
import {
|
|
13
13
|
getStatsSnapshot,
|
|
14
14
|
getTopFailingTools,
|
|
15
15
|
getTopUsedTools,
|
|
16
16
|
resetStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JW4O67E3.js";
|
|
18
18
|
import "./chunk-2ZD3YTVM.js";
|
|
19
19
|
import {
|
|
20
20
|
DEV_STATE_FILE_NAME,
|
|
21
21
|
MEMORY_FILE_NAME,
|
|
22
22
|
VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-I6U55T3H.js";
|
|
24
24
|
import "./chunk-PDX44BCA.js";
|
|
25
25
|
|
|
26
26
|
// 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-5PMDFNOC.js";
|
|
40
40
|
import {
|
|
41
41
|
hasSemanticIndex,
|
|
42
42
|
semanticSearch
|
|
@@ -1667,25 +1667,6 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1667
1667
|
const usage = toUsage(response.usage);
|
|
1668
1668
|
const contentStr = typeof message.content === "string" ? message.content : "";
|
|
1669
1669
|
const hasToolCalls = !!(message.tool_calls && message.tool_calls.length > 0);
|
|
1670
|
-
if (!hasToolCalls && contentStr.trim() === "") {
|
|
1671
|
-
const providerId = this.info.id;
|
|
1672
|
-
if (finishReason === "length") {
|
|
1673
|
-
process.stderr.write(
|
|
1674
|
-
`[${providerId}] \u26A0 Empty response with finish_reason='length' \u2014 output/context limit reached. Try /compact, raise maxTokens, or switch to a larger-context model.
|
|
1675
|
-
`
|
|
1676
|
-
);
|
|
1677
|
-
} else if (finishReason === "content_filter") {
|
|
1678
|
-
process.stderr.write(
|
|
1679
|
-
`[${providerId}] \u26A0 Empty response with finish_reason='content_filter' \u2014 content was blocked.
|
|
1680
|
-
`
|
|
1681
|
-
);
|
|
1682
|
-
} else {
|
|
1683
|
-
process.stderr.write(
|
|
1684
|
-
`[${providerId}] \u26A0 Empty response (finish_reason=${finishReason ?? "unknown"}). Model produced no text and no tool calls. Context window may be exhausted.
|
|
1685
|
-
`
|
|
1686
|
-
);
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
1670
|
const reasoningContent = message.reasoning_content;
|
|
1690
1671
|
if (message.tool_calls && message.tool_calls.length > 0) {
|
|
1691
1672
|
const toolCalls = message.tool_calls.map((tc) => {
|
|
@@ -1719,7 +1700,12 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1719
1700
|
});
|
|
1720
1701
|
return { toolCalls, usage, reasoningContent };
|
|
1721
1702
|
}
|
|
1722
|
-
return {
|
|
1703
|
+
return {
|
|
1704
|
+
content: message.content ?? "",
|
|
1705
|
+
usage,
|
|
1706
|
+
...reasoningContent ? { reasoningContent } : {},
|
|
1707
|
+
...!hasToolCalls && (finishReason ?? "") ? { finishReason } : {}
|
|
1708
|
+
};
|
|
1723
1709
|
} catch (err) {
|
|
1724
1710
|
throw this.wrapError(err);
|
|
1725
1711
|
}
|
|
@@ -1742,7 +1728,13 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1742
1728
|
yield { type: "text_delta", delta: result.content };
|
|
1743
1729
|
}
|
|
1744
1730
|
const rc = "reasoningContent" in result ? result.reasoningContent : void 0;
|
|
1745
|
-
|
|
1731
|
+
const fr = "finishReason" in result ? result.finishReason : void 0;
|
|
1732
|
+
yield {
|
|
1733
|
+
type: "done",
|
|
1734
|
+
usage: result.usage,
|
|
1735
|
+
...rc ? { reasoningContent: rc } : {},
|
|
1736
|
+
...fr ? { finishReason: fr } : {}
|
|
1737
|
+
};
|
|
1746
1738
|
return;
|
|
1747
1739
|
}
|
|
1748
1740
|
const openaiTools = tools.map((t) => ({
|
|
@@ -1784,8 +1776,10 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1784
1776
|
let toolCallsEnded = false;
|
|
1785
1777
|
let thinkingStarted = false;
|
|
1786
1778
|
let reasoningAccumulator = "";
|
|
1779
|
+
let lastFinishReason;
|
|
1787
1780
|
for await (const chunk of stream) {
|
|
1788
1781
|
const choice = chunk.choices[0];
|
|
1782
|
+
if (choice?.finish_reason) lastFinishReason = choice.finish_reason;
|
|
1789
1783
|
if (!choice && chunk.usage) {
|
|
1790
1784
|
if (thinkingStarted) {
|
|
1791
1785
|
yield { type: "thinking_end" };
|
|
@@ -1800,7 +1794,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1800
1794
|
yield {
|
|
1801
1795
|
type: "done",
|
|
1802
1796
|
usage: toUsage(chunk.usage),
|
|
1803
|
-
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1797
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {},
|
|
1798
|
+
...lastFinishReason && lastFinishReason !== "stop" ? { finishReason: lastFinishReason } : {}
|
|
1804
1799
|
};
|
|
1805
1800
|
continue;
|
|
1806
1801
|
}
|
|
@@ -1856,7 +1851,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1856
1851
|
}
|
|
1857
1852
|
yield {
|
|
1858
1853
|
type: "done",
|
|
1859
|
-
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1854
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {},
|
|
1855
|
+
...lastFinishReason && lastFinishReason !== "stop" ? { finishReason: lastFinishReason } : {}
|
|
1860
1856
|
};
|
|
1861
1857
|
} catch (err) {
|
|
1862
1858
|
if (err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) {
|
|
@@ -12207,7 +12203,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
12207
12203
|
case "test": {
|
|
12208
12204
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
12209
12205
|
try {
|
|
12210
|
-
const { executeTests } = await import("./run-tests-
|
|
12206
|
+
const { executeTests } = await import("./run-tests-47O4Z3BM.js");
|
|
12211
12207
|
const argStr = args.join(" ").trim();
|
|
12212
12208
|
let testArgs = {};
|
|
12213
12209
|
if (argStr) {
|
|
@@ -386,7 +386,7 @@ ${content}`);
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
389
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
389
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-ANBMXQ2E.js");
|
|
390
390
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
391
391
|
let interrupted = false;
|
|
392
392
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
saveDevState,
|
|
17
17
|
sessionHasMeaningfulContent,
|
|
18
18
|
setupProxy
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2Q4TRDUS.js";
|
|
20
20
|
import {
|
|
21
21
|
getConfigDirUsage,
|
|
22
22
|
listRecentCrashes,
|
|
23
23
|
writeCrashLog
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-MANQVLVX.js";
|
|
25
25
|
import {
|
|
26
26
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
27
27
|
HALLUCINATION_CORRECTION_MESSAGE,
|
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
looksLikeDocumentBody,
|
|
40
40
|
stripPseudoToolCalls,
|
|
41
41
|
stripToolCallReminder
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-HMZHKSGB.js";
|
|
43
43
|
import {
|
|
44
44
|
ConfigManager
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-NELLBZRA.js";
|
|
46
46
|
import {
|
|
47
47
|
ToolExecutor,
|
|
48
48
|
ToolRegistry,
|
|
@@ -61,16 +61,16 @@ import {
|
|
|
61
61
|
spawnAgentContext,
|
|
62
62
|
theme,
|
|
63
63
|
undoStack
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-2N6VKUH3.js";
|
|
65
65
|
import "./chunk-3BICTI5M.js";
|
|
66
66
|
import "./chunk-2DXY7UGF.js";
|
|
67
|
-
import "./chunk-
|
|
67
|
+
import "./chunk-E56SNFYK.js";
|
|
68
68
|
import {
|
|
69
69
|
getStatsSnapshot,
|
|
70
70
|
getTopFailingTools,
|
|
71
71
|
getTopUsedTools,
|
|
72
72
|
installFlushOnExit
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-JW4O67E3.js";
|
|
74
74
|
import "./chunk-2ZD3YTVM.js";
|
|
75
75
|
import {
|
|
76
76
|
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-I6U55T3H.js";
|
|
97
97
|
import {
|
|
98
98
|
formatGitContextForPrompt,
|
|
99
99
|
getGitContext,
|
|
@@ -1748,7 +1748,7 @@ No tools match "${filter}".
|
|
|
1748
1748
|
const { join: join6 } = await import("path");
|
|
1749
1749
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1750
1750
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
|
|
1751
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1751
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-SQ6ER44V.js");
|
|
1752
1752
|
const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
|
|
1753
1753
|
const cwd = process.cwd();
|
|
1754
1754
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2809,7 +2809,7 @@ ${hint}` : "")
|
|
|
2809
2809
|
usage: "/test [command|filter]",
|
|
2810
2810
|
async execute(args, ctx) {
|
|
2811
2811
|
try {
|
|
2812
|
-
const { executeTests } = await import("./run-tests-
|
|
2812
|
+
const { executeTests } = await import("./run-tests-V7Q3ZJW2.js");
|
|
2813
2813
|
const argStr = args.join(" ").trim();
|
|
2814
2814
|
let testArgs = {};
|
|
2815
2815
|
if (argStr) {
|
|
@@ -6019,6 +6019,7 @@ Session '${this.resumeSessionId}' not found.
|
|
|
6019
6019
|
let usage;
|
|
6020
6020
|
let rawContent;
|
|
6021
6021
|
let reasoningContent;
|
|
6022
|
+
let finishReason;
|
|
6022
6023
|
let spinnerStopped = false;
|
|
6023
6024
|
const stopSpinner = () => {
|
|
6024
6025
|
if (!spinnerStopped) {
|
|
@@ -6068,6 +6069,7 @@ Session '${this.resumeSessionId}' not found.
|
|
|
6068
6069
|
if (event.usage) usage = event.usage;
|
|
6069
6070
|
if (event.rawContent) rawContent = event.rawContent;
|
|
6070
6071
|
if (event.reasoningContent) reasoningContent = event.reasoningContent;
|
|
6072
|
+
if (event.finishReason) finishReason = event.finishReason;
|
|
6071
6073
|
break;
|
|
6072
6074
|
}
|
|
6073
6075
|
}
|
|
@@ -6080,7 +6082,8 @@ Session '${this.resumeSessionId}' not found.
|
|
|
6080
6082
|
toolCalls: [],
|
|
6081
6083
|
usage,
|
|
6082
6084
|
rawContent,
|
|
6083
|
-
reasoningContent
|
|
6085
|
+
reasoningContent,
|
|
6086
|
+
finishReason
|
|
6084
6087
|
};
|
|
6085
6088
|
}
|
|
6086
6089
|
throw err;
|
|
@@ -6111,7 +6114,8 @@ Session '${this.resumeSessionId}' not found.
|
|
|
6111
6114
|
toolCalls,
|
|
6112
6115
|
usage,
|
|
6113
6116
|
rawContent,
|
|
6114
|
-
reasoningContent
|
|
6117
|
+
reasoningContent,
|
|
6118
|
+
finishReason
|
|
6115
6119
|
};
|
|
6116
6120
|
}
|
|
6117
6121
|
async handleChatWithTools(provider, messages, modelOverride) {
|
|
@@ -6331,7 +6335,8 @@ ${mcpBudgetNote}` : "");
|
|
|
6331
6335
|
result = {
|
|
6332
6336
|
content: streamResult.textContent,
|
|
6333
6337
|
usage: streamResult.usage,
|
|
6334
|
-
...streamResult.reasoningContent ? { reasoningContent: streamResult.reasoningContent } : {}
|
|
6338
|
+
...streamResult.reasoningContent ? { reasoningContent: streamResult.reasoningContent } : {},
|
|
6339
|
+
...streamResult.finishReason ? { finishReason: streamResult.finishReason } : {}
|
|
6335
6340
|
};
|
|
6336
6341
|
alreadyRendered = true;
|
|
6337
6342
|
}
|
|
@@ -6372,15 +6377,15 @@ ${mcpBudgetNote}` : "");
|
|
|
6372
6377
|
continue;
|
|
6373
6378
|
}
|
|
6374
6379
|
if (!result.content || result.content.trim() === "") {
|
|
6380
|
+
const fr = "finishReason" in result ? result.finishReason : void 0;
|
|
6381
|
+
const reasonLabel = fr === "length" ? "output limit reached (finish_reason=length)" : fr === "content_filter" ? "content blocked (finish_reason=content_filter)" : fr ? `empty response (finish_reason=${fr})` : "empty response";
|
|
6375
6382
|
if (emptyResponseRetries === 0 && round < maxToolRounds - 1) {
|
|
6376
6383
|
emptyResponseRetries++;
|
|
6377
6384
|
spinner.stop();
|
|
6378
6385
|
if (alreadyRendered) process.stdout.write("\n");
|
|
6379
6386
|
process.stderr.write(
|
|
6380
|
-
theme.warning(
|
|
6381
|
-
|
|
6382
|
-
`
|
|
6383
|
-
)
|
|
6387
|
+
theme.warning(`\u26A0 ${reasonLabel} \u2014 nudging AI to continue...
|
|
6388
|
+
`)
|
|
6384
6389
|
);
|
|
6385
6390
|
extraMessages.push({
|
|
6386
6391
|
role: "user",
|
|
@@ -6391,20 +6396,17 @@ ${mcpBudgetNote}` : "");
|
|
|
6391
6396
|
}
|
|
6392
6397
|
spinner.stop();
|
|
6393
6398
|
if (alreadyRendered) process.stdout.write("\n");
|
|
6399
|
+
const frHint = fr === "length" ? "Output token limit hit \u2014 try /compact to reduce context, raise maxTokens, or /model to switch." : fr === "content_filter" ? "Content was blocked by the provider filter." : "Context window may be exhausted or max_tokens too low.";
|
|
6394
6400
|
process.stderr.write(
|
|
6395
|
-
theme.error(
|
|
6396
|
-
`
|
|
6401
|
+
theme.error(`
|
|
6397
6402
|
\u26A0 AI returned empty responses twice in a row. Stopping agentic loop.
|
|
6398
|
-
`
|
|
6399
|
-
)
|
|
6403
|
+
`)
|
|
6400
6404
|
);
|
|
6401
6405
|
process.stderr.write(
|
|
6402
|
-
theme.dim(
|
|
6403
|
-
|
|
6404
|
-
Try: /compact to reduce context, /clear to reset, or /model to switch.
|
|
6406
|
+
theme.dim(` ${frHint}
|
|
6407
|
+
Try: /compact, /clear, or /model to switch.
|
|
6405
6408
|
|
|
6406
|
-
`
|
|
6407
|
-
)
|
|
6409
|
+
`)
|
|
6408
6410
|
);
|
|
6409
6411
|
if (roundUsage.inputTokens > 0 || roundUsage.outputTokens > 0) {
|
|
6410
6412
|
this.addSessionUsage(roundUsage, effectiveModel);
|
|
@@ -7167,7 +7169,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7167
7169
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7168
7170
|
process.exit(1);
|
|
7169
7171
|
}
|
|
7170
|
-
const { startWebServer } = await import("./server-
|
|
7172
|
+
const { startWebServer } = await import("./server-NASNKJZP.js");
|
|
7171
7173
|
await startWebServer({ port, host: options.host });
|
|
7172
7174
|
});
|
|
7173
7175
|
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) => {
|
|
@@ -7334,12 +7336,12 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7334
7336
|
console.log(footer + "\n");
|
|
7335
7337
|
});
|
|
7336
7338
|
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) => {
|
|
7337
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7339
|
+
const { runDoctorCli } = await import("./doctor-cli-YTMFJ6QY.js");
|
|
7338
7340
|
await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
|
|
7339
7341
|
});
|
|
7340
7342
|
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) => {
|
|
7341
7343
|
try {
|
|
7342
|
-
const batch = await import("./batch-
|
|
7344
|
+
const batch = await import("./batch-CZPE7S25.js");
|
|
7343
7345
|
switch (action) {
|
|
7344
7346
|
case "submit":
|
|
7345
7347
|
if (!arg) {
|
|
@@ -7382,7 +7384,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7382
7384
|
}
|
|
7383
7385
|
});
|
|
7384
7386
|
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) => {
|
|
7385
|
-
const { startMcpServer } = await import("./server-
|
|
7387
|
+
const { startMcpServer } = await import("./server-QOVMOY2G.js");
|
|
7386
7388
|
await startMcpServer({
|
|
7387
7389
|
allowDestructive: !!options.allowDestructive,
|
|
7388
7390
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7509,7 +7511,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7509
7511
|
}),
|
|
7510
7512
|
config.get("customProviders")
|
|
7511
7513
|
);
|
|
7512
|
-
const { startHub } = await import("./hub-
|
|
7514
|
+
const { startHub } = await import("./hub-KMLZPWBX.js");
|
|
7513
7515
|
await startHub(
|
|
7514
7516
|
{
|
|
7515
7517
|
topic: topic ?? "",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
loadDevState,
|
|
15
15
|
persistToolRound,
|
|
16
16
|
setupProxy
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2Q4TRDUS.js";
|
|
18
18
|
import {
|
|
19
19
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
20
20
|
HALLUCINATION_CORRECTION_MESSAGE,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
looksLikeDocumentBody,
|
|
29
29
|
stripPseudoToolCalls,
|
|
30
30
|
stripToolCallReminder
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-HMZHKSGB.js";
|
|
32
32
|
import {
|
|
33
33
|
ConfigManager
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-NELLBZRA.js";
|
|
35
35
|
import {
|
|
36
36
|
ToolExecutor,
|
|
37
37
|
ToolRegistry,
|
|
@@ -49,14 +49,14 @@ import {
|
|
|
49
49
|
spawnAgentContext,
|
|
50
50
|
truncateOutput,
|
|
51
51
|
undoStack
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-2N6VKUH3.js";
|
|
53
53
|
import "./chunk-3BICTI5M.js";
|
|
54
54
|
import "./chunk-2DXY7UGF.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-E56SNFYK.js";
|
|
56
56
|
import {
|
|
57
57
|
getDangerLevel,
|
|
58
58
|
runTool
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-JW4O67E3.js";
|
|
60
60
|
import "./chunk-2ZD3YTVM.js";
|
|
61
61
|
import {
|
|
62
62
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
SKILLS_DIR_NAME,
|
|
77
77
|
VERSION,
|
|
78
78
|
buildUserIdentityPrompt
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-I6U55T3H.js";
|
|
80
80
|
import {
|
|
81
81
|
formatGitContextForPrompt,
|
|
82
82
|
getGitContext,
|
|
@@ -2460,7 +2460,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2460
2460
|
case "test": {
|
|
2461
2461
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2462
2462
|
try {
|
|
2463
|
-
const { executeTests } = await import("./run-tests-
|
|
2463
|
+
const { executeTests } = await import("./run-tests-V7Q3ZJW2.js");
|
|
2464
2464
|
const argStr = args.join(" ").trim();
|
|
2465
2465
|
let testArgs = {};
|
|
2466
2466
|
if (argStr) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2N6VKUH3.js";
|
|
5
5
|
import "./chunk-3BICTI5M.js";
|
|
6
6
|
import "./chunk-2DXY7UGF.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-E56SNFYK.js";
|
|
8
8
|
import {
|
|
9
9
|
getDangerLevel,
|
|
10
10
|
runTool,
|
|
11
11
|
schemaToJsonSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JW4O67E3.js";
|
|
13
13
|
import "./chunk-2ZD3YTVM.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-I6U55T3H.js";
|
|
17
17
|
import "./chunk-4BKXL7SM.js";
|
|
18
18
|
import "./chunk-7ZJN4KLV.js";
|
|
19
19
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2N6VKUH3.js";
|
|
7
7
|
import "./chunk-3BICTI5M.js";
|
|
8
8
|
import "./chunk-2DXY7UGF.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-E56SNFYK.js";
|
|
10
10
|
import {
|
|
11
11
|
getDangerLevel,
|
|
12
12
|
runTool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JW4O67E3.js";
|
|
14
14
|
import "./chunk-2ZD3YTVM.js";
|
|
15
15
|
import {
|
|
16
16
|
SUBAGENT_ALLOWED_TOOLS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-I6U55T3H.js";
|
|
18
18
|
import "./chunk-4BKXL7SM.js";
|
|
19
19
|
import "./chunk-7ZJN4KLV.js";
|
|
20
20
|
import "./chunk-KHYD3WXE.js";
|