jinzd-ai-cli 0.4.263 → 0.4.265
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 +59 -37
- package/README.zh-CN.md +63 -41
- package/dist/{batch-AN47AYCZ.js → batch-C7SHXRQ2.js} +2 -2
- package/dist/{chunk-VT6NRDD2.js → chunk-23SJVOQD.js} +6 -2
- package/dist/{chunk-QMB7QYZC.js → chunk-2MR7EP24.js} +1 -1
- package/dist/chunk-5C76XDDF.js +78 -0
- package/dist/chunk-6YZEZFX5.js +40 -0
- package/dist/{chunk-TL5MD5XU.js → chunk-AUEX6RNY.js} +17 -1
- package/dist/{chunk-MTZ6XHJD.js → chunk-CVI3LSGR.js} +2 -2
- package/dist/{chunk-B27MLWFJ.js → chunk-E3JRGJCJ.js} +4 -4
- package/dist/{chunk-MJICIIBW.js → chunk-IFTUBTDA.js} +1 -1
- package/dist/{chunk-VUZAKIZ5.js → chunk-LZBD2VGJ.js} +1 -1
- package/dist/{chunk-3RHY2HF7.js → chunk-M2RKBTVZ.js} +1 -1
- package/dist/{chunk-7YCA2BD3.js → chunk-NJLPA6S4.js} +1 -1
- package/dist/{chunk-GMZTY7DA.js → chunk-NOS3QV7G.js} +13 -8
- package/dist/{chunk-GKI7B4BD.js → chunk-TJBG4F2R.js} +24 -95
- package/dist/{chunk-QG4NG7KJ.js → chunk-V4D7YD24.js} +9 -2
- package/dist/{chunk-3ARPAVNV.js → chunk-VOIOUJXI.js} +11 -3
- package/dist/{chunk-WM4VTGAF.js → chunk-X6NWK2YK.js} +1 -1
- package/dist/{chunk-VKBGOFEO.js → chunk-Y7KJPNQI.js} +1 -1
- package/dist/{chunk-XST4N2JM.js → chunk-YDTYBUAB.js} +1 -1
- package/dist/{chunk-5K2LFD7D.js → chunk-YXYOLPDB.js} +1 -1
- package/dist/{ci-JTO7LN5S.js → ci-TDXLI3OM.js} +6 -5
- package/dist/{ci-format-2VGHOLBA.js → ci-format-AFX2LP4Y.js} +2 -2
- package/dist/{constants-HLSJL5HQ.js → constants-66TQEDGO.js} +1 -1
- package/dist/{doctor-cli-JML4FGH4.js → doctor-cli-GMCOGCDR.js} +5 -5
- package/dist/electron-server.js +57 -12
- package/dist/{hub-6EYFGJRT.js → hub-2YXETHPY.js} +8 -4
- package/dist/{hub-server-QGUSMN22.js → hub-server-RF6LURXY.js} +3 -1
- package/dist/index.js +123 -546
- package/dist/{persistent-memory-MPBPSZDN.js → persistent-memory-2DKCETB7.js} +2 -2
- package/dist/{persistent-memory-ANIMO5CF.js → persistent-memory-WTZO5CQ7.js} +2 -2
- package/dist/{pr-XE7NGT6U.js → pr-Y2LDG3R7.js} +15 -10
- package/dist/{run-tests-TF7UPUWW.js → run-tests-FIUGDIDL.js} +2 -2
- package/dist/{run-tests-ME5KED57.js → run-tests-PWTNSUVP.js} +2 -2
- package/dist/{server-VKA4FR2Z.js → server-OZ4RFDFH.js} +25 -15
- package/dist/{server-BIYJEJK3.js → server-ZCG5QD6P.js} +6 -5
- package/dist/setup-wizard-S55ICNHH.js +483 -0
- package/dist/{task-orchestrator-2RAKLFWN.js → task-orchestrator-Q2L6JEUX.js} +10 -7
- package/dist/{usage-5F5Q3GGR.js → usage-SDL5Z4CS.js} +3 -3
- package/package.json +1 -1
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IFTUBTDA.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
9
9
|
truncateDiff
|
|
10
10
|
} from "./chunk-HLWUDRBO.js";
|
|
11
|
+
import {
|
|
12
|
+
thinkingParamsFor
|
|
13
|
+
} from "./chunk-6YZEZFX5.js";
|
|
11
14
|
import {
|
|
12
15
|
ProviderRegistry
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AUEX6RNY.js";
|
|
14
17
|
import {
|
|
15
18
|
ConfigManager
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-X6NWK2YK.js";
|
|
17
20
|
import {
|
|
18
21
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Y7KJPNQI.js";
|
|
20
23
|
|
|
21
24
|
// src/cli/ci.ts
|
|
22
25
|
import { execFileSync } from "child_process";
|
|
@@ -87,14 +90,15 @@ function countSeverity(md) {
|
|
|
87
90
|
info: count(/🔵\s*(?:INFO|Info|info|LOW|Low|low)/g)
|
|
88
91
|
};
|
|
89
92
|
}
|
|
90
|
-
async function runOnePrompt(registry, providerId, modelId, prompt) {
|
|
93
|
+
async function runOnePrompt(registry, providerId, modelId, prompt, thinking = {}) {
|
|
91
94
|
const provider = registry.get(providerId);
|
|
92
95
|
const resp = await provider.chat({
|
|
93
96
|
messages: [{ role: "user", content: prompt, timestamp: /* @__PURE__ */ new Date() }],
|
|
94
97
|
model: modelId,
|
|
95
98
|
stream: false,
|
|
96
99
|
temperature: 0.3,
|
|
97
|
-
maxTokens: 8192
|
|
100
|
+
maxTokens: 8192,
|
|
101
|
+
...thinking
|
|
98
102
|
});
|
|
99
103
|
return resp.content?.trim() ?? "";
|
|
100
104
|
}
|
|
@@ -169,6 +173,7 @@ async function runCi(opts) {
|
|
|
169
173
|
const providerInfo = registry.get(providerId).info;
|
|
170
174
|
const modelId = opts.model ?? config.get("defaultModels")[providerId] ?? providerInfo.defaultModel;
|
|
171
175
|
const meta = { provider: providerId, model: modelId, mode: "read-only", thresholds };
|
|
176
|
+
const thinking = thinkingParamsFor(config.get("modelParams"), modelId);
|
|
172
177
|
const sections = [];
|
|
173
178
|
sections.push("## \u{1F916} aicli code review");
|
|
174
179
|
sections.push(`*Provider: \`${providerId}\` \xB7 Model: \`${modelId}\` \xB7 Mode: \`read-only CI review\` \xB7 aicli v${VERSION}*`);
|
|
@@ -176,14 +181,14 @@ async function runCi(opts) {
|
|
|
176
181
|
try {
|
|
177
182
|
if (!opts.skipCode) {
|
|
178
183
|
const prompt = buildReviewPrompt(trimmedDiff, gitCtx, !!opts.detailed);
|
|
179
|
-
const review = await runOnePrompt(registry, providerId, modelId, prompt);
|
|
184
|
+
const review = await runOnePrompt(registry, providerId, modelId, prompt, thinking);
|
|
180
185
|
sections.push("### Code Review");
|
|
181
186
|
sections.push(review);
|
|
182
187
|
sections.push("");
|
|
183
188
|
}
|
|
184
189
|
if (!opts.skipSecurity) {
|
|
185
190
|
const prompt = buildSecurityReviewPrompt(trimmedDiff, gitCtx);
|
|
186
|
-
const review = await runOnePrompt(registry, providerId, modelId, prompt);
|
|
191
|
+
const review = await runOnePrompt(registry, providerId, modelId, prompt, thinking);
|
|
187
192
|
sections.push("### Security Review");
|
|
188
193
|
sections.push(review);
|
|
189
194
|
sections.push("");
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
searchPersistentMemories,
|
|
8
8
|
touchMemoryReferences,
|
|
9
9
|
updateMemoryEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LZBD2VGJ.js";
|
|
11
11
|
import {
|
|
12
12
|
indexProject
|
|
13
13
|
} from "./chunk-GLSR2NR3.js";
|
|
@@ -18,12 +18,15 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
loadIndex
|
|
20
20
|
} from "./chunk-CKH4KQ4E.js";
|
|
21
|
+
import {
|
|
22
|
+
theme
|
|
23
|
+
} from "./chunk-5C76XDDF.js";
|
|
21
24
|
import {
|
|
22
25
|
getActivePluginAssets,
|
|
23
26
|
runHook,
|
|
24
27
|
runLifecycleHooks,
|
|
25
28
|
runTool
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2MR7EP24.js";
|
|
27
30
|
import {
|
|
28
31
|
buildTruncatedArgumentsError,
|
|
29
32
|
getDangerLevel,
|
|
@@ -40,14 +43,14 @@ import {
|
|
|
40
43
|
} from "./chunk-4BKXL7SM.js";
|
|
41
44
|
import {
|
|
42
45
|
runTestsTool
|
|
43
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-YDTYBUAB.js";
|
|
44
47
|
import {
|
|
45
48
|
CONFIG_DIR_NAME,
|
|
46
49
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
47
50
|
SUBAGENT_ALLOWED_TOOLS,
|
|
48
51
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
49
52
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
50
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-Y7KJPNQI.js";
|
|
51
54
|
import {
|
|
52
55
|
loadChatIndex,
|
|
53
56
|
searchChatMemory
|
|
@@ -1380,7 +1383,7 @@ import { appendFileSync, mkdirSync, readFileSync as readFileSync5, statSync as s
|
|
|
1380
1383
|
import { dirname as dirname3 } from "path";
|
|
1381
1384
|
|
|
1382
1385
|
// src/tools/executor.ts
|
|
1383
|
-
import
|
|
1386
|
+
import chalk2 from "chalk";
|
|
1384
1387
|
import { existsSync as existsSync6, readFileSync as readFileSync4 } from "fs";
|
|
1385
1388
|
import { tmpdir } from "os";
|
|
1386
1389
|
|
|
@@ -1999,78 +2002,6 @@ function truncateOutput(content, toolName, maxChars) {
|
|
|
1999
2002
|
` + tail;
|
|
2000
2003
|
}
|
|
2001
2004
|
|
|
2002
|
-
// src/repl/theme.ts
|
|
2003
|
-
import chalk2 from "chalk";
|
|
2004
|
-
var DARK_THEME = {
|
|
2005
|
-
prompt: chalk2.green,
|
|
2006
|
-
info: chalk2.cyan,
|
|
2007
|
-
warning: chalk2.yellow,
|
|
2008
|
-
error: chalk2.red,
|
|
2009
|
-
success: chalk2.green,
|
|
2010
|
-
dim: chalk2.dim,
|
|
2011
|
-
accent: chalk2.cyan,
|
|
2012
|
-
toolCall: chalk2.yellow,
|
|
2013
|
-
toolResult: chalk2.green,
|
|
2014
|
-
heading: chalk2.bold.cyan
|
|
2015
|
-
};
|
|
2016
|
-
var LIGHT_THEME = {
|
|
2017
|
-
prompt: chalk2.blue,
|
|
2018
|
-
info: chalk2.blueBright,
|
|
2019
|
-
warning: chalk2.yellow,
|
|
2020
|
-
error: chalk2.red,
|
|
2021
|
-
success: chalk2.green,
|
|
2022
|
-
dim: chalk2.gray,
|
|
2023
|
-
accent: chalk2.blueBright,
|
|
2024
|
-
toolCall: chalk2.magenta,
|
|
2025
|
-
toolResult: chalk2.green,
|
|
2026
|
-
heading: chalk2.bold.blue
|
|
2027
|
-
};
|
|
2028
|
-
function resolveColor(name) {
|
|
2029
|
-
if (name.startsWith("#")) return chalk2.hex(name);
|
|
2030
|
-
const parts = name.split(".");
|
|
2031
|
-
let result = chalk2;
|
|
2032
|
-
for (const part of parts) {
|
|
2033
|
-
const obj = result;
|
|
2034
|
-
if (obj && typeof obj[part] !== "undefined") {
|
|
2035
|
-
result = obj[part];
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
if (typeof result !== "function") {
|
|
2039
|
-
process.stderr.write(`[theme] Warning: unrecognized color "${name}", using default.
|
|
2040
|
-
`);
|
|
2041
|
-
return chalk2;
|
|
2042
|
-
}
|
|
2043
|
-
return result;
|
|
2044
|
-
}
|
|
2045
|
-
function buildCustomTheme(base, overrides) {
|
|
2046
|
-
if (!overrides) return base;
|
|
2047
|
-
const result = { ...base };
|
|
2048
|
-
for (const [key, colorName] of Object.entries(overrides)) {
|
|
2049
|
-
if (key in result && colorName) {
|
|
2050
|
-
result[key] = resolveColor(colorName);
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
return result;
|
|
2054
|
-
}
|
|
2055
|
-
var _currentTheme = DARK_THEME;
|
|
2056
|
-
function initTheme(themeId = "dark", customColors) {
|
|
2057
|
-
switch (themeId) {
|
|
2058
|
-
case "light":
|
|
2059
|
-
_currentTheme = LIGHT_THEME;
|
|
2060
|
-
break;
|
|
2061
|
-
case "custom":
|
|
2062
|
-
_currentTheme = buildCustomTheme(DARK_THEME, customColors);
|
|
2063
|
-
break;
|
|
2064
|
-
default:
|
|
2065
|
-
_currentTheme = DARK_THEME;
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
var theme = new Proxy(DARK_THEME, {
|
|
2069
|
-
get(_target, prop) {
|
|
2070
|
-
return _currentTheme[prop];
|
|
2071
|
-
}
|
|
2072
|
-
});
|
|
2073
|
-
|
|
2074
2005
|
// src/tools/action-classifier.ts
|
|
2075
2006
|
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
|
|
2076
2007
|
import { isAbsolute as isAbsolute2, join, resolve as resolve4 } from "path";
|
|
@@ -2567,7 +2498,7 @@ var ToolExecutor = class {
|
|
|
2567
2498
|
for (let i = 0; i < calls.length; i++) {
|
|
2568
2499
|
const call = calls[i];
|
|
2569
2500
|
const filePath = String(call.arguments["path"] ?? "");
|
|
2570
|
-
console.log(theme.warning(` [${i + 1}] `) +
|
|
2501
|
+
console.log(theme.warning(` [${i + 1}] `) + chalk2.white(call.name) + theme.dim(": ") + theme.accent(filePath));
|
|
2571
2502
|
this.printDiffPreview(call);
|
|
2572
2503
|
}
|
|
2573
2504
|
console.log(theme.dim("\u2500".repeat(50)));
|
|
@@ -2686,7 +2617,7 @@ var ToolExecutor = class {
|
|
|
2686
2617
|
console.log();
|
|
2687
2618
|
const icon = dangerLevel === "write" ? theme.toolCall("\u270E Tool: ") : theme.heading(theme.accent("\u2699 Tool: "));
|
|
2688
2619
|
const roundBadge = this.totalRounds > 0 ? theme.dim(` [${this.round}/${this.totalRounds}]`) : "";
|
|
2689
|
-
console.log(icon +
|
|
2620
|
+
console.log(icon + chalk2.white(call.name) + roundBadge);
|
|
2690
2621
|
for (const [key, val] of Object.entries(call.arguments)) {
|
|
2691
2622
|
let valStr;
|
|
2692
2623
|
if (Array.isArray(val)) {
|
|
@@ -2697,7 +2628,7 @@ var ToolExecutor = class {
|
|
|
2697
2628
|
} else {
|
|
2698
2629
|
valStr = String(val);
|
|
2699
2630
|
}
|
|
2700
|
-
console.log(theme.dim(` ${key}: `) +
|
|
2631
|
+
console.log(theme.dim(` ${key}: `) + chalk2.white(valStr));
|
|
2701
2632
|
}
|
|
2702
2633
|
}
|
|
2703
2634
|
/**
|
|
@@ -4942,7 +4873,7 @@ var saveMemoryTool = {
|
|
|
4942
4873
|
};
|
|
4943
4874
|
|
|
4944
4875
|
// src/tools/builtin/ask-user.ts
|
|
4945
|
-
import
|
|
4876
|
+
import chalk3 from "chalk";
|
|
4946
4877
|
var askUserContext = {
|
|
4947
4878
|
prompting: false
|
|
4948
4879
|
};
|
|
@@ -4979,8 +4910,8 @@ function promptUser(rl, question) {
|
|
|
4979
4910
|
rl.resume();
|
|
4980
4911
|
askUserContext.prompting = true;
|
|
4981
4912
|
console.log();
|
|
4982
|
-
console.log(
|
|
4983
|
-
process.stdout.write(
|
|
4913
|
+
console.log(chalk3.cyan("\u2753 ") + chalk3.bold(question));
|
|
4914
|
+
process.stdout.write(chalk3.cyan("> "));
|
|
4984
4915
|
return new Promise((resolve7) => {
|
|
4985
4916
|
let completed = false;
|
|
4986
4917
|
const cleanup = (answer) => {
|
|
@@ -4997,7 +4928,7 @@ function promptUser(rl, question) {
|
|
|
4997
4928
|
cleanup(line);
|
|
4998
4929
|
};
|
|
4999
4930
|
askUserContext.cancelFn = () => {
|
|
5000
|
-
process.stdout.write(
|
|
4931
|
+
process.stdout.write(chalk3.gray("\n(cancelled)\n"));
|
|
5001
4932
|
cleanup(null);
|
|
5002
4933
|
};
|
|
5003
4934
|
rl.once("line", onLine);
|
|
@@ -5005,7 +4936,7 @@ function promptUser(rl, question) {
|
|
|
5005
4936
|
}
|
|
5006
4937
|
|
|
5007
4938
|
// src/tools/builtin/write-todos.ts
|
|
5008
|
-
import
|
|
4939
|
+
import chalk4 from "chalk";
|
|
5009
4940
|
var VALID_STATUSES = /* @__PURE__ */ new Set(["pending", "in_progress", "completed"]);
|
|
5010
4941
|
var currentTodos = [];
|
|
5011
4942
|
var writeTodosTool = {
|
|
@@ -5068,25 +4999,25 @@ function renderTodoList(todos) {
|
|
|
5068
4999
|
const total = todos.length;
|
|
5069
5000
|
console.log();
|
|
5070
5001
|
console.log(
|
|
5071
|
-
|
|
5002
|
+
chalk4.bold.cyan("\u{1F4CB} Todo List") + chalk4.dim(` (${completed}/${total} completed)`)
|
|
5072
5003
|
);
|
|
5073
|
-
console.log(
|
|
5004
|
+
console.log(chalk4.dim(" " + "\u2500".repeat(40)));
|
|
5074
5005
|
for (const todo of todos) {
|
|
5075
5006
|
let icon;
|
|
5076
5007
|
let text;
|
|
5077
5008
|
switch (todo.status) {
|
|
5078
5009
|
case "completed":
|
|
5079
|
-
icon =
|
|
5080
|
-
text =
|
|
5010
|
+
icon = chalk4.green(" \u2713 ");
|
|
5011
|
+
text = chalk4.strikethrough.gray(todo.title);
|
|
5081
5012
|
break;
|
|
5082
5013
|
case "in_progress":
|
|
5083
|
-
icon =
|
|
5084
|
-
text =
|
|
5014
|
+
icon = chalk4.yellow(" \u2192 ");
|
|
5015
|
+
text = chalk4.white(todo.title);
|
|
5085
5016
|
break;
|
|
5086
5017
|
case "pending":
|
|
5087
5018
|
default:
|
|
5088
|
-
icon =
|
|
5089
|
-
text =
|
|
5019
|
+
icon = chalk4.gray(" \u25CB ");
|
|
5020
|
+
text = chalk4.gray(todo.title);
|
|
5090
5021
|
break;
|
|
5091
5022
|
}
|
|
5092
5023
|
console.log(icon + text);
|
|
@@ -7037,8 +6968,6 @@ var ToolRegistry = class {
|
|
|
7037
6968
|
|
|
7038
6969
|
export {
|
|
7039
6970
|
cleanupAllSessions,
|
|
7040
|
-
initTheme,
|
|
7041
|
-
theme,
|
|
7042
6971
|
undoStack,
|
|
7043
6972
|
renderDiff,
|
|
7044
6973
|
recordRecentlyDeniedAutoAction,
|
|
@@ -64,12 +64,18 @@ var CostTracker = class _CostTracker {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Record cost from a completed session/interaction.
|
|
67
|
+
*
|
|
68
|
+
* 返回本次记账的美元金额(定价未知时返回 null)。调用方据此累计**按调用时刻**
|
|
69
|
+
* 算出的会话成本——2026-08-14 审计 P3-01:DeepSeek V4 自 8/17 起峰谷计价,
|
|
70
|
+
* 展示层若拿聚合用量在「查看时刻」现算,闲时跑的会话在峰时看会被按峰价显示,
|
|
71
|
+
* 跨时段会话更是整段按一个费率算。记账时刻的值才是真实花费。
|
|
67
72
|
*/
|
|
68
73
|
addCost(provider, model, usage) {
|
|
69
|
-
const
|
|
74
|
+
const priced = computeCost(provider, model, usage);
|
|
75
|
+
const cost = priced ?? 0;
|
|
70
76
|
const inTok = usage.inputTokens || 0;
|
|
71
77
|
const outTok = usage.outputTokens || 0;
|
|
72
|
-
if (cost === 0 && inTok === 0 && outTok === 0) return;
|
|
78
|
+
if (cost === 0 && inTok === 0 && outTok === 0) return priced;
|
|
73
79
|
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
74
80
|
let record = this.records.find((r) => r.date === today);
|
|
75
81
|
if (!record) {
|
|
@@ -101,6 +107,7 @@ var CostTracker = class _CostTracker {
|
|
|
101
107
|
if (this.records.length > 90) {
|
|
102
108
|
this.records = this.records.slice(-90);
|
|
103
109
|
}
|
|
110
|
+
return priced;
|
|
104
111
|
}
|
|
105
112
|
/** Get total cost for a given month ("2026-04"). */
|
|
106
113
|
getMonthlyCost(yearMonth) {
|
|
@@ -35,6 +35,11 @@ var HubAgent = class {
|
|
|
35
35
|
defaultModel;
|
|
36
36
|
/** External context documents injected into system prompt */
|
|
37
37
|
context;
|
|
38
|
+
/**
|
|
39
|
+
* 该 agent 模型的思考参数(审计 P0-01)。HubAgent 自己拿不到 ConfigManager,
|
|
40
|
+
* 由构造方(hub-server / discuss)按 modelId 解析后注入;不注入则沿用产品默认(不思考)。
|
|
41
|
+
*/
|
|
42
|
+
thinking;
|
|
38
43
|
constructor(role, providers, defaultProvider, defaultModel, context) {
|
|
39
44
|
this.role = role;
|
|
40
45
|
this.providers = providers;
|
|
@@ -66,7 +71,8 @@ var HubAgent = class {
|
|
|
66
71
|
systemPrompt,
|
|
67
72
|
stream: false,
|
|
68
73
|
temperature: 0.7,
|
|
69
|
-
maxTokens: 4096
|
|
74
|
+
maxTokens: 4096,
|
|
75
|
+
...this.thinking ?? {}
|
|
70
76
|
});
|
|
71
77
|
const { content, passed, converged } = parseTurn(response.content);
|
|
72
78
|
return {
|
|
@@ -99,7 +105,8 @@ var HubAgent = class {
|
|
|
99
105
|
systemPrompt,
|
|
100
106
|
stream: true,
|
|
101
107
|
temperature: 0.7,
|
|
102
|
-
maxTokens: 4096
|
|
108
|
+
maxTokens: 4096,
|
|
109
|
+
...this.thinking ?? {}
|
|
103
110
|
});
|
|
104
111
|
for await (const chunk of stream) {
|
|
105
112
|
if (chunk.delta) {
|
|
@@ -137,7 +144,8 @@ var HubAgent = class {
|
|
|
137
144
|
model: this.modelId,
|
|
138
145
|
stream: false,
|
|
139
146
|
temperature: 0.3,
|
|
140
|
-
maxTokens: 4096
|
|
147
|
+
maxTokens: 4096,
|
|
148
|
+
...this.thinking ?? {}
|
|
141
149
|
});
|
|
142
150
|
return response.content.trim();
|
|
143
151
|
}
|
|
@@ -3,14 +3,15 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-NOS3QV7G.js";
|
|
7
|
+
import "./chunk-IFTUBTDA.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-6YZEZFX5.js";
|
|
10
|
+
import "./chunk-AUEX6RNY.js";
|
|
11
|
+
import "./chunk-X6NWK2YK.js";
|
|
11
12
|
import "./chunk-3OBY7WSS.js";
|
|
12
13
|
import "./chunk-TU3L3PW7.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-Y7KJPNQI.js";
|
|
14
15
|
import "./chunk-IW3Q7AE5.js";
|
|
15
16
|
export {
|
|
16
17
|
CI_COMMENT_MARKER,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-E3JRGJCJ.js";
|
|
6
|
+
import "./chunk-AUEX6RNY.js";
|
|
7
|
+
import "./chunk-X6NWK2YK.js";
|
|
8
|
+
import "./chunk-2MR7EP24.js";
|
|
9
9
|
import "./chunk-3OBY7WSS.js";
|
|
10
10
|
import "./chunk-TU3L3PW7.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-Y7KJPNQI.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|
package/dist/electron-server.js
CHANGED
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
touchMemoryReferences,
|
|
35
35
|
updateMemoryApproval,
|
|
36
36
|
updateMemoryEntry
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-YXYOLPDB.js";
|
|
38
38
|
import {
|
|
39
39
|
redactJson,
|
|
40
40
|
scanString
|
|
41
41
|
} from "./chunk-YVTASHS5.js";
|
|
42
42
|
import {
|
|
43
43
|
runTestsTool
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-NJLPA6S4.js";
|
|
45
45
|
import {
|
|
46
46
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
47
47
|
APP_NAME,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
74
74
|
VERSION,
|
|
75
75
|
buildUserIdentityPrompt
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-M2RKBTVZ.js";
|
|
77
77
|
import {
|
|
78
78
|
hasSemanticIndex,
|
|
79
79
|
semanticSearch
|
|
@@ -725,6 +725,16 @@ var BaseProvider = class {
|
|
|
725
725
|
get supportsContentOnlyTee() {
|
|
726
726
|
return this.reliableContentOnlyTee;
|
|
727
727
|
}
|
|
728
|
+
/**
|
|
729
|
+
* 该 provider 是否支持 `reasoning_effort` 档位(low/high/max)。目前只有 DeepSeek V4。
|
|
730
|
+
*
|
|
731
|
+
* 2026-08-14 审计 P2-03:提示符标签此前无条件渲染成 `[THINK:high]`,于是 Claude
|
|
732
|
+
* (用 thinkingBudget 计 token 预算)和 GLM(根本没有 effort 概念)也显示一个
|
|
733
|
+
* 既不生效、也无从设置的档位——屏幕上的假信息比没有信息更坏。
|
|
734
|
+
*/
|
|
735
|
+
get supportsReasoningEffort() {
|
|
736
|
+
return false;
|
|
737
|
+
}
|
|
728
738
|
/**
|
|
729
739
|
* 将 Message[] 转换为 OpenAI API 格式的消息数组。
|
|
730
740
|
* content 为 string 时直接传递;为 MessageContentPart[] 时保留数组格式(vision 请求)。
|
|
@@ -2991,10 +3001,12 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
2991
3001
|
if (!firstChoice) {
|
|
2992
3002
|
return { content: "", model: response.model, usage: void 0 };
|
|
2993
3003
|
}
|
|
3004
|
+
const reasoningContent = firstChoice.message.reasoning_content;
|
|
2994
3005
|
return {
|
|
2995
3006
|
content: firstChoice.message.content ?? "",
|
|
2996
3007
|
model: response.model,
|
|
2997
|
-
usage: toUsage(response.usage)
|
|
3008
|
+
usage: toUsage(response.usage),
|
|
3009
|
+
...reasoningContent ? { reasoningContent } : {}
|
|
2998
3010
|
};
|
|
2999
3011
|
} catch (err) {
|
|
3000
3012
|
throw this.wrapError(err);
|
|
@@ -3391,6 +3403,10 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
|
|
|
3391
3403
|
...thinkingEnabled ? { reasoning_effort: request.thinkingEffort ?? "high" } : {}
|
|
3392
3404
|
};
|
|
3393
3405
|
}
|
|
3406
|
+
/** V4 支持 low/high/max 三档 reasoning_effort(官方 2026-08 更新公告)。 */
|
|
3407
|
+
get supportsReasoningEffort() {
|
|
3408
|
+
return true;
|
|
3409
|
+
}
|
|
3394
3410
|
/** 禁用流式工具调用,确保 chatWithTools 覆写(代码块检测)生效 */
|
|
3395
3411
|
enableStreamingToolCalls = false;
|
|
3396
3412
|
/**
|
|
@@ -13792,6 +13808,17 @@ function formatCost(amount) {
|
|
|
13792
13808
|
return `$${amount.toFixed(2)}`;
|
|
13793
13809
|
}
|
|
13794
13810
|
|
|
13811
|
+
// src/core/chat-params.ts
|
|
13812
|
+
function thinkingParamsFor(allModelParams, model) {
|
|
13813
|
+
const params = allModelParams?.[model];
|
|
13814
|
+
if (!params) return {};
|
|
13815
|
+
const out = {};
|
|
13816
|
+
if (params.thinking !== void 0) out.thinking = params.thinking;
|
|
13817
|
+
if (params.thinkingEffort !== void 0) out.thinkingEffort = params.thinkingEffort;
|
|
13818
|
+
if (params.thinkingBudget !== void 0) out.thinkingBudget = params.thinkingBudget;
|
|
13819
|
+
return out;
|
|
13820
|
+
}
|
|
13821
|
+
|
|
13795
13822
|
// src/session/tool-history.ts
|
|
13796
13823
|
var SESSION_SIZE_LIMIT = 2 * 1024 * 1024;
|
|
13797
13824
|
function persistToolRound(session, toolCalls, toolResults, opts) {
|
|
@@ -14264,6 +14291,11 @@ var HubAgent = class {
|
|
|
14264
14291
|
defaultModel;
|
|
14265
14292
|
/** External context documents injected into system prompt */
|
|
14266
14293
|
context;
|
|
14294
|
+
/**
|
|
14295
|
+
* 该 agent 模型的思考参数(审计 P0-01)。HubAgent 自己拿不到 ConfigManager,
|
|
14296
|
+
* 由构造方(hub-server / discuss)按 modelId 解析后注入;不注入则沿用产品默认(不思考)。
|
|
14297
|
+
*/
|
|
14298
|
+
thinking;
|
|
14267
14299
|
constructor(role, providers, defaultProvider, defaultModel, context) {
|
|
14268
14300
|
this.role = role;
|
|
14269
14301
|
this.providers = providers;
|
|
@@ -14295,7 +14327,8 @@ var HubAgent = class {
|
|
|
14295
14327
|
systemPrompt,
|
|
14296
14328
|
stream: false,
|
|
14297
14329
|
temperature: 0.7,
|
|
14298
|
-
maxTokens: 4096
|
|
14330
|
+
maxTokens: 4096,
|
|
14331
|
+
...this.thinking ?? {}
|
|
14299
14332
|
});
|
|
14300
14333
|
const { content, passed, converged } = parseTurn(response.content);
|
|
14301
14334
|
return {
|
|
@@ -14328,7 +14361,8 @@ var HubAgent = class {
|
|
|
14328
14361
|
systemPrompt,
|
|
14329
14362
|
stream: true,
|
|
14330
14363
|
temperature: 0.7,
|
|
14331
|
-
maxTokens: 4096
|
|
14364
|
+
maxTokens: 4096,
|
|
14365
|
+
...this.thinking ?? {}
|
|
14332
14366
|
});
|
|
14333
14367
|
for await (const chunk of stream) {
|
|
14334
14368
|
if (chunk.delta) {
|
|
@@ -14366,7 +14400,8 @@ var HubAgent = class {
|
|
|
14366
14400
|
model: this.modelId,
|
|
14367
14401
|
stream: false,
|
|
14368
14402
|
temperature: 0.3,
|
|
14369
|
-
maxTokens: 4096
|
|
14403
|
+
maxTokens: 4096,
|
|
14404
|
+
...this.thinking ?? {}
|
|
14370
14405
|
});
|
|
14371
14406
|
return response.content.trim();
|
|
14372
14407
|
}
|
|
@@ -14470,7 +14505,11 @@ var DiscussionOrchestrator = class {
|
|
|
14470
14505
|
onRoundReview;
|
|
14471
14506
|
constructor(config, providers) {
|
|
14472
14507
|
this.agents = config.roles.map(
|
|
14473
|
-
(role) =>
|
|
14508
|
+
(role) => {
|
|
14509
|
+
const agent = new HubAgent(role, providers, config.defaultProvider, config.defaultModel, config.context);
|
|
14510
|
+
agent.thinking = config.thinking;
|
|
14511
|
+
return agent;
|
|
14512
|
+
}
|
|
14474
14513
|
);
|
|
14475
14514
|
this.humanSteer = config.humanSteer ?? false;
|
|
14476
14515
|
this.voteConverge = config.voteConverge ?? false;
|
|
@@ -14906,9 +14945,14 @@ async function handleModel(args, ctx) {
|
|
|
14906
14945
|
async function handleThink(args, ctx) {
|
|
14907
14946
|
const sub = args[0]?.toLowerCase() ?? "toggle";
|
|
14908
14947
|
if (sub === "status") {
|
|
14948
|
+
const configured = ctx.config.get("modelParams")[ctx.currentModel]?.thinking;
|
|
14949
|
+
const effective = ctx.runtimeThinking ?? configured ?? false;
|
|
14950
|
+
const origin = ctx.runtimeThinking !== null ? "runtime" : configured !== void 0 ? "config" : "default";
|
|
14951
|
+
const supportsEffort = ctx.providers.get(ctx.currentProvider)?.supportsReasoningEffort ?? false;
|
|
14952
|
+
const effortPart = !effective ? "" : supportsEffort ? `; effort: ${ctx.runtimeThinkingEffort ?? ctx.config.get("modelParams")[ctx.currentModel]?.thinkingEffort ?? "high (provider default)"}` : `; effort: n/a for ${ctx.currentProvider}`;
|
|
14909
14953
|
ctx.send({
|
|
14910
14954
|
type: "info",
|
|
14911
|
-
message: `Thinking mode: ${
|
|
14955
|
+
message: `Thinking mode: ${effective ? "ON" : "OFF"} (${origin})${effortPart}`
|
|
14912
14956
|
});
|
|
14913
14957
|
return;
|
|
14914
14958
|
}
|
|
@@ -15434,7 +15478,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
15434
15478
|
Cost: ${formatCost(cost)}` : "";
|
|
15435
15479
|
let memoryLine = "";
|
|
15436
15480
|
try {
|
|
15437
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
15481
|
+
const { countPendingMemories } = await import("./persistent-memory-WTZO5CQ7.js");
|
|
15438
15482
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
15439
15483
|
if (pending > 0) memoryLine = `
|
|
15440
15484
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -16249,7 +16293,7 @@ async function handleTest(args, ctx) {
|
|
|
16249
16293
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
16250
16294
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
16251
16295
|
}
|
|
16252
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
16296
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-FIUGDIDL.js")).executeTests;
|
|
16253
16297
|
const report = await runTests(testArgs);
|
|
16254
16298
|
ctx.send({ type: "info", message: report });
|
|
16255
16299
|
} catch (err) {
|
|
@@ -16507,7 +16551,7 @@ async function handleMemory(args, ctx) {
|
|
|
16507
16551
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
16508
16552
|
} else if (sub === "export") {
|
|
16509
16553
|
if (args[1] === "md") {
|
|
16510
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
16554
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-WTZO5CQ7.js");
|
|
16511
16555
|
ctx.send({
|
|
16512
16556
|
type: "export_data",
|
|
16513
16557
|
format: "md",
|
|
@@ -17290,6 +17334,7 @@ var SessionHandler = class {
|
|
|
17290
17334
|
const roles = resolution.roles;
|
|
17291
17335
|
for (const w of resolution.warnings) this.send({ type: "info", message: w });
|
|
17292
17336
|
const config = {
|
|
17337
|
+
thinking: thinkingParamsFor(this.config.get("modelParams"), this.currentModel),
|
|
17293
17338
|
mode: "discuss",
|
|
17294
17339
|
roles,
|
|
17295
17340
|
defaultProvider,
|