jinzd-ai-cli 0.4.94 → 0.4.96
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/README.md +429 -429
- package/README.zh-CN.md +448 -448
- package/dist/{batch-NB5TANTJ.js → batch-AP2VD7P4.js} +2 -2
- package/dist/{chunk-7SBSBVUB.js → chunk-2YXIZ3GN.js} +2 -2
- package/dist/{chunk-CD6FE5UD.js → chunk-6YHSSX6F.js} +1 -1
- package/dist/{chunk-7UABIQX3.js → chunk-7UE6TPAD.js} +1 -1
- package/dist/{chunk-W7HOEYAA.js → chunk-JFDAONPK.js} +1 -1
- package/dist/{chunk-73IPBBNL.js → chunk-SX7GCTSV.js} +28 -8
- package/dist/{chunk-PH7ICI6O.js → chunk-USRJN2CF.js} +1 -1
- package/dist/electron-server.js +46 -12
- package/dist/{hub-OPIWSRVH.js → hub-RALO5NAA.js} +1 -1
- package/dist/index.js +29 -15
- package/dist/{run-tests-WMM2B3RR.js → run-tests-425P7SXN.js} +1 -1
- package/dist/{run-tests-BOAAXNEG.js → run-tests-P7DC5HZH.js} +2 -2
- package/dist/{server-2TLRJGFI.js → server-47MHFFXI.js} +3 -3
- package/dist/{server-UOK3E2GS.js → server-YGSZM3DP.js} +24 -10
- package/dist/{task-orchestrator-FDV2MB42.js → task-orchestrator-4FISZ6FY.js} +3 -3
- package/dist/web/client/style.css +129 -129
- package/package.json +164 -164
- package/dist/wasm/tree-sitter-javascript.wasm +0 -0
- package/dist/wasm/tree-sitter-python.wasm +0 -0
- package/dist/wasm/tree-sitter-tsx.wasm +0 -0
- package/dist/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/wasm/web-tree-sitter.wasm +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JFDAONPK.js";
|
|
5
5
|
import "./chunk-2ZD3YTVM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-6YHSSX6F.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/batch.ts
|
|
9
9
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-6VRJGH25.js";
|
|
24
24
|
import {
|
|
25
25
|
runTestsTool
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-USRJN2CF.js";
|
|
27
27
|
import {
|
|
28
28
|
CONFIG_DIR_NAME,
|
|
29
29
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
SUBAGENT_ALLOWED_TOOLS,
|
|
32
32
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
33
33
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-6YHSSX6F.js";
|
|
35
35
|
|
|
36
36
|
// src/tools/types.ts
|
|
37
37
|
function isFileWriteTool(name) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
schemaToJsonSchema,
|
|
4
4
|
truncateForPersist
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2YXIZ3GN.js";
|
|
6
6
|
import {
|
|
7
7
|
AuthError,
|
|
8
8
|
ProviderError,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
MCP_PROTOCOL_VERSION,
|
|
22
22
|
MCP_TOOL_PREFIX,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6YHSSX6F.js";
|
|
25
25
|
|
|
26
26
|
// src/providers/claude.ts
|
|
27
27
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -832,7 +832,14 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
832
832
|
}
|
|
833
833
|
/** 将 systemPrompt + messages 合并为 OpenAI messages 数组(system 消息放首位)。 */
|
|
834
834
|
buildMessages(request) {
|
|
835
|
-
const
|
|
835
|
+
const filtered = request.messages.filter((m) => m.role !== "tool" && !m.toolCalls);
|
|
836
|
+
const msgs = filtered.map((m) => {
|
|
837
|
+
const base = { role: m.role, content: m.content };
|
|
838
|
+
if (m.role === "assistant" && m.reasoningContent) {
|
|
839
|
+
base.reasoning_content = m.reasoningContent;
|
|
840
|
+
}
|
|
841
|
+
return base;
|
|
842
|
+
});
|
|
836
843
|
const systemContent = [request.systemPrompt, request.systemPromptVolatile].filter(Boolean).join("\n\n---\n\n");
|
|
837
844
|
if (systemContent) {
|
|
838
845
|
return [{ role: "system", content: systemContent }, ...msgs];
|
|
@@ -880,6 +887,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
880
887
|
signal: request.signal
|
|
881
888
|
});
|
|
882
889
|
let thinkingStarted = false;
|
|
890
|
+
let reasoningAccumulator = "";
|
|
883
891
|
for await (const chunk of stream) {
|
|
884
892
|
const choice = chunk.choices[0];
|
|
885
893
|
const done = choice?.finish_reason != null;
|
|
@@ -887,7 +895,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
887
895
|
yield {
|
|
888
896
|
delta: "",
|
|
889
897
|
done: true,
|
|
890
|
-
usage: toUsage(chunk.usage)
|
|
898
|
+
usage: toUsage(chunk.usage),
|
|
899
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
891
900
|
};
|
|
892
901
|
continue;
|
|
893
902
|
}
|
|
@@ -897,6 +906,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
897
906
|
yield { delta: "<think>", done: false };
|
|
898
907
|
thinkingStarted = true;
|
|
899
908
|
}
|
|
909
|
+
reasoningAccumulator += reasoningDelta;
|
|
900
910
|
yield { delta: reasoningDelta, done: false };
|
|
901
911
|
continue;
|
|
902
912
|
}
|
|
@@ -905,7 +915,11 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
905
915
|
thinkingStarted = false;
|
|
906
916
|
yield { delta: "</think>", done: false };
|
|
907
917
|
}
|
|
908
|
-
|
|
918
|
+
if (done) {
|
|
919
|
+
yield { delta, done, ...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {} };
|
|
920
|
+
} else {
|
|
921
|
+
yield { delta, done };
|
|
922
|
+
}
|
|
909
923
|
}
|
|
910
924
|
} catch (err) {
|
|
911
925
|
throw this.wrapError(err);
|
|
@@ -1011,7 +1025,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1011
1025
|
});
|
|
1012
1026
|
return { toolCalls, usage, reasoningContent };
|
|
1013
1027
|
}
|
|
1014
|
-
return { content: message.content ?? "", usage };
|
|
1028
|
+
return { content: message.content ?? "", usage, ...reasoningContent ? { reasoningContent } : {} };
|
|
1015
1029
|
} catch (err) {
|
|
1016
1030
|
throw this.wrapError(err);
|
|
1017
1031
|
}
|
|
@@ -1075,6 +1089,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1075
1089
|
const toolCallAccumulators = /* @__PURE__ */ new Map();
|
|
1076
1090
|
let toolCallsEnded = false;
|
|
1077
1091
|
let thinkingStarted = false;
|
|
1092
|
+
let reasoningAccumulator = "";
|
|
1078
1093
|
for await (const chunk of stream) {
|
|
1079
1094
|
const choice = chunk.choices[0];
|
|
1080
1095
|
if (!choice && chunk.usage) {
|
|
@@ -1090,7 +1105,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1090
1105
|
}
|
|
1091
1106
|
yield {
|
|
1092
1107
|
type: "done",
|
|
1093
|
-
usage: toUsage(chunk.usage)
|
|
1108
|
+
usage: toUsage(chunk.usage),
|
|
1109
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1094
1110
|
};
|
|
1095
1111
|
continue;
|
|
1096
1112
|
}
|
|
@@ -1102,6 +1118,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1102
1118
|
yield { type: "thinking_start" };
|
|
1103
1119
|
thinkingStarted = true;
|
|
1104
1120
|
}
|
|
1121
|
+
reasoningAccumulator += reasoningDelta;
|
|
1105
1122
|
yield { type: "thinking_delta", delta: reasoningDelta };
|
|
1106
1123
|
continue;
|
|
1107
1124
|
}
|
|
@@ -1143,7 +1160,10 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1143
1160
|
yield { type: "tool_call_end", index: idx };
|
|
1144
1161
|
}
|
|
1145
1162
|
}
|
|
1146
|
-
yield {
|
|
1163
|
+
yield {
|
|
1164
|
+
type: "done",
|
|
1165
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1166
|
+
};
|
|
1147
1167
|
} catch (err) {
|
|
1148
1168
|
if (err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) {
|
|
1149
1169
|
throw err;
|
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-7UE6TPAD.js";
|
|
40
40
|
import {
|
|
41
41
|
hasSemanticIndex,
|
|
42
42
|
semanticSearch
|
|
@@ -1343,7 +1343,14 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
/** 将 systemPrompt + messages 合并为 OpenAI messages 数组(system 消息放首位)。 */
|
|
1345
1345
|
buildMessages(request) {
|
|
1346
|
-
const
|
|
1346
|
+
const filtered = request.messages.filter((m) => m.role !== "tool" && !m.toolCalls);
|
|
1347
|
+
const msgs = filtered.map((m) => {
|
|
1348
|
+
const base = { role: m.role, content: m.content };
|
|
1349
|
+
if (m.role === "assistant" && m.reasoningContent) {
|
|
1350
|
+
base.reasoning_content = m.reasoningContent;
|
|
1351
|
+
}
|
|
1352
|
+
return base;
|
|
1353
|
+
});
|
|
1347
1354
|
const systemContent = [request.systemPrompt, request.systemPromptVolatile].filter(Boolean).join("\n\n---\n\n");
|
|
1348
1355
|
if (systemContent) {
|
|
1349
1356
|
return [{ role: "system", content: systemContent }, ...msgs];
|
|
@@ -1391,6 +1398,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1391
1398
|
signal: request.signal
|
|
1392
1399
|
});
|
|
1393
1400
|
let thinkingStarted = false;
|
|
1401
|
+
let reasoningAccumulator = "";
|
|
1394
1402
|
for await (const chunk of stream) {
|
|
1395
1403
|
const choice = chunk.choices[0];
|
|
1396
1404
|
const done = choice?.finish_reason != null;
|
|
@@ -1398,7 +1406,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1398
1406
|
yield {
|
|
1399
1407
|
delta: "",
|
|
1400
1408
|
done: true,
|
|
1401
|
-
usage: toUsage(chunk.usage)
|
|
1409
|
+
usage: toUsage(chunk.usage),
|
|
1410
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1402
1411
|
};
|
|
1403
1412
|
continue;
|
|
1404
1413
|
}
|
|
@@ -1408,6 +1417,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1408
1417
|
yield { delta: "<think>", done: false };
|
|
1409
1418
|
thinkingStarted = true;
|
|
1410
1419
|
}
|
|
1420
|
+
reasoningAccumulator += reasoningDelta;
|
|
1411
1421
|
yield { delta: reasoningDelta, done: false };
|
|
1412
1422
|
continue;
|
|
1413
1423
|
}
|
|
@@ -1416,7 +1426,11 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1416
1426
|
thinkingStarted = false;
|
|
1417
1427
|
yield { delta: "</think>", done: false };
|
|
1418
1428
|
}
|
|
1419
|
-
|
|
1429
|
+
if (done) {
|
|
1430
|
+
yield { delta, done, ...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {} };
|
|
1431
|
+
} else {
|
|
1432
|
+
yield { delta, done };
|
|
1433
|
+
}
|
|
1420
1434
|
}
|
|
1421
1435
|
} catch (err) {
|
|
1422
1436
|
throw this.wrapError(err);
|
|
@@ -1522,7 +1536,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1522
1536
|
});
|
|
1523
1537
|
return { toolCalls, usage, reasoningContent };
|
|
1524
1538
|
}
|
|
1525
|
-
return { content: message.content ?? "", usage };
|
|
1539
|
+
return { content: message.content ?? "", usage, ...reasoningContent ? { reasoningContent } : {} };
|
|
1526
1540
|
} catch (err) {
|
|
1527
1541
|
throw this.wrapError(err);
|
|
1528
1542
|
}
|
|
@@ -1586,6 +1600,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1586
1600
|
const toolCallAccumulators = /* @__PURE__ */ new Map();
|
|
1587
1601
|
let toolCallsEnded = false;
|
|
1588
1602
|
let thinkingStarted = false;
|
|
1603
|
+
let reasoningAccumulator = "";
|
|
1589
1604
|
for await (const chunk of stream) {
|
|
1590
1605
|
const choice = chunk.choices[0];
|
|
1591
1606
|
if (!choice && chunk.usage) {
|
|
@@ -1601,7 +1616,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1601
1616
|
}
|
|
1602
1617
|
yield {
|
|
1603
1618
|
type: "done",
|
|
1604
|
-
usage: toUsage(chunk.usage)
|
|
1619
|
+
usage: toUsage(chunk.usage),
|
|
1620
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1605
1621
|
};
|
|
1606
1622
|
continue;
|
|
1607
1623
|
}
|
|
@@ -1613,6 +1629,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1613
1629
|
yield { type: "thinking_start" };
|
|
1614
1630
|
thinkingStarted = true;
|
|
1615
1631
|
}
|
|
1632
|
+
reasoningAccumulator += reasoningDelta;
|
|
1616
1633
|
yield { type: "thinking_delta", delta: reasoningDelta };
|
|
1617
1634
|
continue;
|
|
1618
1635
|
}
|
|
@@ -1654,7 +1671,10 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1654
1671
|
yield { type: "tool_call_end", index: idx };
|
|
1655
1672
|
}
|
|
1656
1673
|
}
|
|
1657
|
-
yield {
|
|
1674
|
+
yield {
|
|
1675
|
+
type: "done",
|
|
1676
|
+
...reasoningAccumulator ? { reasoningContent: reasoningAccumulator } : {}
|
|
1677
|
+
};
|
|
1658
1678
|
} catch (err) {
|
|
1659
1679
|
if (err instanceof Error && (err.name === "AbortError" || err.name === "TimeoutError")) {
|
|
1660
1680
|
throw err;
|
|
@@ -9950,6 +9970,7 @@ var SessionHandler = class _SessionHandler {
|
|
|
9950
9970
|
signal: ac.signal
|
|
9951
9971
|
});
|
|
9952
9972
|
let fullContent = "";
|
|
9973
|
+
let simpleReasoning;
|
|
9953
9974
|
for await (const chunk of stream) {
|
|
9954
9975
|
if (ac.signal.aborted) break;
|
|
9955
9976
|
if (chunk.done) {
|
|
@@ -9958,12 +9979,18 @@ var SessionHandler = class _SessionHandler {
|
|
|
9958
9979
|
this.addWebSessionUsage(chunk.usage);
|
|
9959
9980
|
session.addTokenUsage(chunk.usage);
|
|
9960
9981
|
}
|
|
9982
|
+
if (chunk.reasoningContent) simpleReasoning = chunk.reasoningContent;
|
|
9961
9983
|
break;
|
|
9962
9984
|
}
|
|
9963
9985
|
fullContent += chunk.delta;
|
|
9964
9986
|
this.send({ type: "text_delta", delta: chunk.delta });
|
|
9965
9987
|
}
|
|
9966
|
-
session.addMessage({
|
|
9988
|
+
session.addMessage({
|
|
9989
|
+
role: "assistant",
|
|
9990
|
+
content: fullContent,
|
|
9991
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
9992
|
+
...simpleReasoning ? { reasoningContent: simpleReasoning } : {}
|
|
9993
|
+
});
|
|
9967
9994
|
} catch (err) {
|
|
9968
9995
|
if (err.name === "AbortError") {
|
|
9969
9996
|
this.send({ type: "info", message: "[interrupted]" });
|
|
@@ -10166,7 +10193,12 @@ Details: ${errMsg.split("\n")[0]}
|
|
|
10166
10193
|
continue;
|
|
10167
10194
|
}
|
|
10168
10195
|
this.send({ type: "response_done", content: result.content, usage: roundUsage });
|
|
10169
|
-
session.addMessage({
|
|
10196
|
+
session.addMessage({
|
|
10197
|
+
role: "assistant",
|
|
10198
|
+
content: result.content,
|
|
10199
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
10200
|
+
...result.reasoningContent ? { reasoningContent: result.reasoningContent } : {}
|
|
10201
|
+
});
|
|
10170
10202
|
this.addWebSessionUsage(roundUsage);
|
|
10171
10203
|
session.addTokenUsage(roundUsage);
|
|
10172
10204
|
return;
|
|
@@ -10308,6 +10340,7 @@ ${summaryResult.content}`,
|
|
|
10308
10340
|
const toolArgBuffers = /* @__PURE__ */ new Map();
|
|
10309
10341
|
let usage;
|
|
10310
10342
|
let rawContent;
|
|
10343
|
+
let reasoningContent;
|
|
10311
10344
|
for await (const event of streamGen) {
|
|
10312
10345
|
if (ac.signal.aborted) break;
|
|
10313
10346
|
switch (event.type) {
|
|
@@ -10349,6 +10382,7 @@ ${summaryResult.content}`,
|
|
|
10349
10382
|
case "done":
|
|
10350
10383
|
usage = event.usage;
|
|
10351
10384
|
rawContent = event.rawContent;
|
|
10385
|
+
reasoningContent = event.reasoningContent;
|
|
10352
10386
|
break;
|
|
10353
10387
|
}
|
|
10354
10388
|
}
|
|
@@ -10359,9 +10393,9 @@ ${summaryResult.content}`,
|
|
|
10359
10393
|
if (textContent) {
|
|
10360
10394
|
toolCalls._streamedText = textContent;
|
|
10361
10395
|
}
|
|
10362
|
-
return { toolCalls, usage };
|
|
10396
|
+
return { toolCalls, usage, reasoningContent };
|
|
10363
10397
|
}
|
|
10364
|
-
return { content: textContent, usage };
|
|
10398
|
+
return { content: textContent, usage, reasoningContent };
|
|
10365
10399
|
}
|
|
10366
10400
|
// ── Commands ─────────────────────────────────────────────────────
|
|
10367
10401
|
async handleCommand(name, args) {
|
|
@@ -11367,7 +11401,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
11367
11401
|
case "test": {
|
|
11368
11402
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
11369
11403
|
try {
|
|
11370
|
-
const { executeTests } = await import("./run-tests-
|
|
11404
|
+
const { executeTests } = await import("./run-tests-425P7SXN.js");
|
|
11371
11405
|
const argStr = args.join(" ").trim();
|
|
11372
11406
|
let testArgs = {};
|
|
11373
11407
|
if (argStr) {
|
|
@@ -385,7 +385,7 @@ ${content}`);
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
388
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
388
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-4FISZ6FY.js");
|
|
389
389
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
390
390
|
let interrupted = false;
|
|
391
391
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
saveDevState,
|
|
31
31
|
sessionHasMeaningfulContent,
|
|
32
32
|
setupProxy
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-SX7GCTSV.js";
|
|
34
34
|
import {
|
|
35
35
|
ConfigManager
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JFDAONPK.js";
|
|
37
37
|
import {
|
|
38
38
|
ToolExecutor,
|
|
39
39
|
ToolRegistry,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
spawnAgentContext,
|
|
53
53
|
theme,
|
|
54
54
|
undoStack
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-2YXIZ3GN.js";
|
|
56
56
|
import "./chunk-2ZD3YTVM.js";
|
|
57
57
|
import {
|
|
58
58
|
fileCheckpoints
|
|
@@ -70,7 +70,7 @@ import "./chunk-KJLJPUY2.js";
|
|
|
70
70
|
import "./chunk-6VRJGH25.js";
|
|
71
71
|
import "./chunk-2DXY7UGF.js";
|
|
72
72
|
import "./chunk-KHYD3WXE.js";
|
|
73
|
-
import "./chunk-
|
|
73
|
+
import "./chunk-USRJN2CF.js";
|
|
74
74
|
import {
|
|
75
75
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
76
76
|
AUTHOR,
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
SKILLS_DIR_NAME,
|
|
93
93
|
VERSION,
|
|
94
94
|
buildUserIdentityPrompt
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-6YHSSX6F.js";
|
|
96
96
|
|
|
97
97
|
// src/index.ts
|
|
98
98
|
import { program } from "commander";
|
|
@@ -2612,7 +2612,7 @@ ${hint}` : "")
|
|
|
2612
2612
|
usage: "/test [command|filter]",
|
|
2613
2613
|
async execute(args, ctx) {
|
|
2614
2614
|
try {
|
|
2615
|
-
const { executeTests } = await import("./run-tests-
|
|
2615
|
+
const { executeTests } = await import("./run-tests-P7DC5HZH.js");
|
|
2616
2616
|
const argStr = args.join(" ").trim();
|
|
2617
2617
|
let testArgs = {};
|
|
2618
2618
|
if (argStr) {
|
|
@@ -5747,6 +5747,7 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5747
5747
|
const toolCallAccumulators = /* @__PURE__ */ new Map();
|
|
5748
5748
|
let usage;
|
|
5749
5749
|
let rawContent;
|
|
5750
|
+
let reasoningContent;
|
|
5750
5751
|
let spinnerStopped = false;
|
|
5751
5752
|
const stopSpinner = () => {
|
|
5752
5753
|
if (!spinnerStopped) {
|
|
@@ -5795,6 +5796,7 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5795
5796
|
case "done":
|
|
5796
5797
|
if (event.usage) usage = event.usage;
|
|
5797
5798
|
if (event.rawContent) rawContent = event.rawContent;
|
|
5799
|
+
if (event.reasoningContent) reasoningContent = event.reasoningContent;
|
|
5798
5800
|
break;
|
|
5799
5801
|
}
|
|
5800
5802
|
}
|
|
@@ -5806,7 +5808,8 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5806
5808
|
textContent: textParts.join(""),
|
|
5807
5809
|
toolCalls: [],
|
|
5808
5810
|
usage,
|
|
5809
|
-
rawContent
|
|
5811
|
+
rawContent,
|
|
5812
|
+
reasoningContent
|
|
5810
5813
|
};
|
|
5811
5814
|
}
|
|
5812
5815
|
throw err;
|
|
@@ -5836,7 +5839,8 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5836
5839
|
textContent: textParts.join(""),
|
|
5837
5840
|
toolCalls,
|
|
5838
5841
|
usage,
|
|
5839
|
-
rawContent
|
|
5842
|
+
rawContent,
|
|
5843
|
+
reasoningContent
|
|
5840
5844
|
};
|
|
5841
5845
|
}
|
|
5842
5846
|
async handleChatWithTools(provider, messages, modelOverride) {
|
|
@@ -6048,9 +6052,17 @@ ${mcpBudgetNote}` : "");
|
|
|
6048
6052
|
if (streamResult.textContent) {
|
|
6049
6053
|
toolCalls._streamedText = streamResult.textContent;
|
|
6050
6054
|
}
|
|
6051
|
-
result = {
|
|
6055
|
+
result = {
|
|
6056
|
+
toolCalls,
|
|
6057
|
+
usage: streamResult.usage,
|
|
6058
|
+
...streamResult.reasoningContent ? { reasoningContent: streamResult.reasoningContent } : {}
|
|
6059
|
+
};
|
|
6052
6060
|
} else {
|
|
6053
|
-
result = {
|
|
6061
|
+
result = {
|
|
6062
|
+
content: streamResult.textContent,
|
|
6063
|
+
usage: streamResult.usage,
|
|
6064
|
+
...streamResult.reasoningContent ? { reasoningContent: streamResult.reasoningContent } : {}
|
|
6065
|
+
};
|
|
6054
6066
|
alreadyRendered = true;
|
|
6055
6067
|
}
|
|
6056
6068
|
} finally {
|
|
@@ -6152,10 +6164,12 @@ ${mcpBudgetNote}` : "");
|
|
|
6152
6164
|
}
|
|
6153
6165
|
}
|
|
6154
6166
|
lastResponseStore.content = finalContent;
|
|
6167
|
+
const finalReasoning = "reasoningContent" in result ? result.reasoningContent : void 0;
|
|
6155
6168
|
session.addMessage({
|
|
6156
6169
|
role: "assistant",
|
|
6157
6170
|
content: finalContent,
|
|
6158
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
6171
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6172
|
+
...finalReasoning ? { reasoningContent: finalReasoning } : {}
|
|
6159
6173
|
});
|
|
6160
6174
|
this.events.emit("message.after", { content: finalContent });
|
|
6161
6175
|
if (roundUsage.inputTokens > 0 || roundUsage.outputTokens > 0) {
|
|
@@ -6738,7 +6752,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
6738
6752
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
6739
6753
|
process.exit(1);
|
|
6740
6754
|
}
|
|
6741
|
-
const { startWebServer } = await import("./server-
|
|
6755
|
+
const { startWebServer } = await import("./server-YGSZM3DP.js");
|
|
6742
6756
|
await startWebServer({ port, host: options.host });
|
|
6743
6757
|
});
|
|
6744
6758
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -6861,7 +6875,7 @@ program.command("sessions").description("List recent conversation sessions").act
|
|
|
6861
6875
|
});
|
|
6862
6876
|
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) => {
|
|
6863
6877
|
try {
|
|
6864
|
-
const batch = await import("./batch-
|
|
6878
|
+
const batch = await import("./batch-AP2VD7P4.js");
|
|
6865
6879
|
switch (action) {
|
|
6866
6880
|
case "submit":
|
|
6867
6881
|
if (!arg) {
|
|
@@ -6904,7 +6918,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
6904
6918
|
}
|
|
6905
6919
|
});
|
|
6906
6920
|
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) => {
|
|
6907
|
-
const { startMcpServer } = await import("./server-
|
|
6921
|
+
const { startMcpServer } = await import("./server-47MHFFXI.js");
|
|
6908
6922
|
await startMcpServer({
|
|
6909
6923
|
allowDestructive: !!options.allowDestructive,
|
|
6910
6924
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7031,7 +7045,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7031
7045
|
}),
|
|
7032
7046
|
config.get("customProviders")
|
|
7033
7047
|
);
|
|
7034
|
-
const { startHub } = await import("./hub-
|
|
7048
|
+
const { startHub } = await import("./hub-RALO5NAA.js");
|
|
7035
7049
|
await startHub(
|
|
7036
7050
|
{
|
|
7037
7051
|
topic: topic ?? "",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
getDangerLevel,
|
|
5
5
|
schemaToJsonSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2YXIZ3GN.js";
|
|
7
7
|
import "./chunk-2ZD3YTVM.js";
|
|
8
8
|
import "./chunk-4BKXL7SM.js";
|
|
9
9
|
import "./chunk-ANYYM4CF.js";
|
|
@@ -12,10 +12,10 @@ import "./chunk-KJLJPUY2.js";
|
|
|
12
12
|
import "./chunk-6VRJGH25.js";
|
|
13
13
|
import "./chunk-2DXY7UGF.js";
|
|
14
14
|
import "./chunk-KHYD3WXE.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-USRJN2CF.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6YHSSX6F.js";
|
|
19
19
|
|
|
20
20
|
// src/mcp/server.ts
|
|
21
21
|
import { createInterface } from "readline";
|