jinzd-ai-cli 0.4.264 → 0.4.266
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-Q22M55UP.js → batch-FQU6HK3Z.js} +2 -2
- package/dist/{chunk-VT6NRDD2.js → chunk-23SJVOQD.js} +6 -2
- package/dist/{chunk-K7HQLXXQ.js → chunk-3O4VLKD4.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-IAIUXBB5.js → chunk-CEJUB4YV.js} +1 -1
- package/dist/{chunk-4T4KHPRD.js → chunk-FA3HGXXM.js} +1 -1
- package/dist/{chunk-BMSBFK7J.js → chunk-FIDEG2PG.js} +4 -4
- package/dist/{chunk-UQP2BNQT.js → chunk-GWOZET2E.js} +1 -1
- package/dist/{chunk-JVUYKO4V.js → chunk-LGJ7EX2F.js} +1 -1
- package/dist/{chunk-TANTNIGP.js → chunk-LHY7ST6X.js} +1 -1
- package/dist/{chunk-QCZFHQHY.js → chunk-N2E6GFLZ.js} +1 -1
- package/dist/{chunk-U4XQIP7Z.js → chunk-QW76RX6G.js} +1 -1
- package/dist/{chunk-UGJIRJ4H.js → chunk-TJNBSR3I.js} +1 -1
- package/dist/{chunk-IEYR2BGG.js → chunk-UCHND2K6.js} +65 -2
- package/dist/{chunk-QG4NG7KJ.js → chunk-V4D7YD24.js} +9 -2
- package/dist/{chunk-3ARPAVNV.js → chunk-VOIOUJXI.js} +11 -3
- package/dist/{chunk-DYONT23T.js → chunk-XEVURCAM.js} +13 -8
- package/dist/{chunk-53SOOMYG.js → chunk-Y2X24VYB.js} +24 -95
- package/dist/{ci-RMEIHZJL.js → ci-GZH3QMME.js} +6 -5
- package/dist/{ci-format-UCFSWVG5.js → ci-format-VKP2MGYJ.js} +2 -2
- package/dist/{constants-Z2R2BKUY.js → constants-ICAF6I3J.js} +1 -1
- package/dist/{doctor-cli-64L7BBK7.js → doctor-cli-CO6BJWRW.js} +5 -5
- package/dist/electron-server.js +127 -26
- package/dist/{hub-P7D6VDCK.js → hub-4APIRQ73.js} +8 -4
- package/dist/{hub-server-QGUSMN22.js → hub-server-RF6LURXY.js} +3 -1
- package/dist/index.js +125 -582
- package/dist/{persistent-memory-CELKJM4U.js → persistent-memory-YD3SHSUH.js} +2 -2
- package/dist/{persistent-memory-QX6C2JAR.js → persistent-memory-YPO25MOP.js} +2 -2
- package/dist/{pr-DJP53EZV.js → pr-CDOPCAPK.js} +15 -10
- package/dist/{run-tests-CK44KRY3.js → run-tests-4XRHKHN5.js} +2 -2
- package/dist/{run-tests-A2YM4U2U.js → run-tests-QNNP2HCD.js} +2 -2
- package/dist/{server-XYVL7A33.js → server-53GM3CRH.js} +34 -29
- package/dist/{server-GUV2HZ7N.js → server-B4A7LHZ5.js} +6 -5
- package/dist/setup-wizard-S55ICNHH.js +483 -0
- package/dist/{task-orchestrator-5RT5EH2J.js → task-orchestrator-WNV6PT6Z.js} +10 -7
- package/dist/{usage-LGPJ4UAW.js → usage-E3FEYSBU.js} +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y2X24VYB.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-LGJ7EX2F.js";
|
|
15
15
|
import {
|
|
16
16
|
atomicWriteFileSync
|
|
17
17
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -1065,6 +1065,68 @@ function clearDevState() {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
|
+
// src/core/think-command.ts
|
|
1069
|
+
var EFFORTS = /* @__PURE__ */ new Set(["low", "high", "max"]);
|
|
1070
|
+
function resolveEffective(state) {
|
|
1071
|
+
if (state.runtimeThinking !== null) return { effective: state.runtimeThinking, origin: "runtime override" };
|
|
1072
|
+
if (state.configuredThinking !== void 0) return { effective: state.configuredThinking, origin: "config" };
|
|
1073
|
+
return { effective: false, origin: "default" };
|
|
1074
|
+
}
|
|
1075
|
+
function effortLine(state, effort) {
|
|
1076
|
+
if (!state.supportsEffort) return `Reasoning effort: n/a for ${state.provider}`;
|
|
1077
|
+
const resolved = effort ?? state.runtimeEffort ?? state.configuredEffort;
|
|
1078
|
+
return `Reasoning effort: ${resolved ?? "high (provider default)"}`;
|
|
1079
|
+
}
|
|
1080
|
+
function applyThinkCommand(sub, state) {
|
|
1081
|
+
const key = (sub ?? "toggle").toLowerCase();
|
|
1082
|
+
const current = resolveEffective(state);
|
|
1083
|
+
const stay = (summary, details = []) => ({
|
|
1084
|
+
runtimeThinking: state.runtimeThinking,
|
|
1085
|
+
runtimeEffort: state.runtimeEffort,
|
|
1086
|
+
effective: current.effective,
|
|
1087
|
+
origin: current.origin,
|
|
1088
|
+
summary,
|
|
1089
|
+
details,
|
|
1090
|
+
changed: false
|
|
1091
|
+
});
|
|
1092
|
+
const enable = (effort) => ({
|
|
1093
|
+
runtimeThinking: true,
|
|
1094
|
+
runtimeEffort: effort ?? state.runtimeEffort,
|
|
1095
|
+
effective: true,
|
|
1096
|
+
origin: "runtime override",
|
|
1097
|
+
summary: effort && state.supportsEffort ? `Extended Thinking: ON (effort: ${effort})` : "Extended Thinking: ON",
|
|
1098
|
+
details: effort && !state.supportsEffort ? [`Note: ${state.provider} has no reasoning-effort levels \u2014 the level is ignored.`] : [],
|
|
1099
|
+
changed: true
|
|
1100
|
+
});
|
|
1101
|
+
const disable = () => ({
|
|
1102
|
+
runtimeThinking: false,
|
|
1103
|
+
// 刻意保留档位:重新开启时不该丢掉用户选过的档
|
|
1104
|
+
runtimeEffort: state.runtimeEffort,
|
|
1105
|
+
effective: false,
|
|
1106
|
+
origin: "runtime override",
|
|
1107
|
+
summary: "Extended Thinking: OFF",
|
|
1108
|
+
details: [],
|
|
1109
|
+
changed: true
|
|
1110
|
+
});
|
|
1111
|
+
if (key === "status") {
|
|
1112
|
+
const details = current.effective ? [effortLine(state, null)] : [
|
|
1113
|
+
"Enable with /think on | low | high | max, or set",
|
|
1114
|
+
"modelParams.<model>.thinking in ~/.aicli/config.json"
|
|
1115
|
+
];
|
|
1116
|
+
return stay(
|
|
1117
|
+
`Extended Thinking: ${current.effective ? "ON" : "OFF"} (${current.origin})`,
|
|
1118
|
+
details
|
|
1119
|
+
);
|
|
1120
|
+
}
|
|
1121
|
+
if (key === "on") return enable(null);
|
|
1122
|
+
if (key === "off") return disable();
|
|
1123
|
+
if (EFFORTS.has(key)) return enable(key);
|
|
1124
|
+
if (key === "toggle") {
|
|
1125
|
+
return current.effective ? disable() : enable(null);
|
|
1126
|
+
}
|
|
1127
|
+
return stay(`Unknown /think option "${sub}" \u2014 expected on | off | low | high | max | status`);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1068
1130
|
// src/core/git-diff.ts
|
|
1069
1131
|
import { execFileSync } from "child_process";
|
|
1070
1132
|
function readGitDiff(options = {}) {
|
|
@@ -1077,6 +1139,7 @@ function readGitDiff(options = {}) {
|
|
|
1077
1139
|
}
|
|
1078
1140
|
|
|
1079
1141
|
export {
|
|
1142
|
+
applyThinkCommand,
|
|
1080
1143
|
readGitDiff,
|
|
1081
1144
|
scanDirTree,
|
|
1082
1145
|
scanProject,
|
|
@@ -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
|
}
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TJNBSR3I.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-CEJUB4YV.js";
|
|
17
20
|
import {
|
|
18
21
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LGJ7EX2F.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-3O4VLKD4.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-QW76RX6G.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-N2E6GFLZ.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-LGJ7EX2F.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,
|
|
@@ -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-XEVURCAM.js";
|
|
7
|
+
import "./chunk-TJNBSR3I.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-CEJUB4YV.js";
|
|
11
12
|
import "./chunk-3OBY7WSS.js";
|
|
12
13
|
import "./chunk-TU3L3PW7.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-LGJ7EX2F.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-FIDEG2PG.js";
|
|
6
|
+
import "./chunk-AUEX6RNY.js";
|
|
7
|
+
import "./chunk-CEJUB4YV.js";
|
|
8
|
+
import "./chunk-QW76RX6G.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-LGJ7EX2F.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|