jinzd-ai-cli 0.4.180 → 0.4.181
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-OJJI6TKB.js → batch-DG5STMLZ.js} +2 -2
- package/dist/{chunk-WY2DDJTH.js → chunk-4VB6UP4W.js} +1 -1
- package/dist/{chunk-2TWARH5X.js → chunk-5LK7H45B.js} +331 -22
- package/dist/{chunk-FQHEXIYP.js → chunk-6SY45V62.js} +2 -2
- package/dist/{chunk-KRU4DFRH.js → chunk-CPZ7KG3Y.js} +1 -1
- package/dist/{chunk-H7TXZO6D.js → chunk-D4ZTYYBU.js} +1 -1
- package/dist/{chunk-YDI22R3P.js → chunk-D774AWKW.js} +1 -1
- package/dist/{chunk-7WFMYFHC.js → chunk-ORXPLVM7.js} +3 -3
- package/dist/{chunk-2UGK2RXK.js → chunk-P2VFMUR5.js} +1 -1
- package/dist/{chunk-ZUUXMR6Z.js → chunk-ZWQ36YFI.js} +1 -1
- package/dist/{ci-EBN6VQ2Z.js → ci-UXVUG3LC.js} +3 -3
- package/dist/{constants-FGPUBYCX.js → constants-5DFFSPWI.js} +1 -1
- package/dist/{doctor-cli-C54OKMG2.js → doctor-cli-GQBR6RI6.js} +5 -5
- package/dist/electron-server.js +380 -182
- package/dist/{hub-YVNTGDKW.js → hub-N75OQVNY.js} +1 -1
- package/dist/index.js +100 -317
- package/dist/{run-tests-QFTKAWW6.js → run-tests-673ABQQE.js} +2 -2
- package/dist/{run-tests-BUII3HBU.js → run-tests-HZVKHQ33.js} +1 -1
- package/dist/{server-I6Y5TP2Z.js → server-RCUIX4R5.js} +4 -4
- package/dist/{server-KT6GRCM7.js → server-SLDE3AML.js} +77 -167
- package/dist/{task-orchestrator-6RLY5JAL.js → task-orchestrator-42D5LBAX.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-P2VFMUR5.js";
|
|
5
5
|
import "./chunk-TZQHYZKT.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-CPZ7KG3Y.js";
|
|
7
7
|
import "./chunk-PDX44BCA.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/batch.ts
|
|
@@ -902,6 +902,321 @@ Node.js does not automatically use system proxies. Try one of the following:
|
|
|
902
902
|
|
|
903
903
|
// src/providers/openai-compatible.ts
|
|
904
904
|
import OpenAI from "openai";
|
|
905
|
+
|
|
906
|
+
// src/core/agent-loop.ts
|
|
907
|
+
function partialTagTail(s, tag) {
|
|
908
|
+
const max = Math.min(s.length, tag.length - 1);
|
|
909
|
+
for (let len = max; len > 0; len--) {
|
|
910
|
+
if (s.endsWith(tag.slice(0, len))) return len;
|
|
911
|
+
}
|
|
912
|
+
return 0;
|
|
913
|
+
}
|
|
914
|
+
var ThinkTagFilter = class {
|
|
915
|
+
inThink = false;
|
|
916
|
+
buf = "";
|
|
917
|
+
push(raw) {
|
|
918
|
+
this.buf += raw;
|
|
919
|
+
let out = "";
|
|
920
|
+
while (this.buf.length > 0) {
|
|
921
|
+
if (!this.inThink) {
|
|
922
|
+
const open = this.buf.indexOf("<think>");
|
|
923
|
+
if (open === -1) {
|
|
924
|
+
const keep = partialTagTail(this.buf, "<think>");
|
|
925
|
+
out += this.buf.slice(0, this.buf.length - keep);
|
|
926
|
+
this.buf = this.buf.slice(this.buf.length - keep);
|
|
927
|
+
break;
|
|
928
|
+
}
|
|
929
|
+
out += this.buf.slice(0, open);
|
|
930
|
+
this.buf = this.buf.slice(open + "<think>".length);
|
|
931
|
+
this.inThink = true;
|
|
932
|
+
} else {
|
|
933
|
+
const close = this.buf.indexOf("</think>");
|
|
934
|
+
if (close === -1) {
|
|
935
|
+
const keep = partialTagTail(this.buf, "</think>");
|
|
936
|
+
this.buf = this.buf.slice(this.buf.length - keep);
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
this.buf = this.buf.slice(close + "</think>".length);
|
|
940
|
+
this.inThink = false;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
return out;
|
|
944
|
+
}
|
|
945
|
+
/** 流结束:若仍持留可能的半截 '<think>' 前缀且并未进入 think 块,它是真实文本。 */
|
|
946
|
+
flush() {
|
|
947
|
+
if (!this.inThink && this.buf) {
|
|
948
|
+
const tail = this.buf;
|
|
949
|
+
this.buf = "";
|
|
950
|
+
return tail;
|
|
951
|
+
}
|
|
952
|
+
this.buf = "";
|
|
953
|
+
return "";
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
function repairToolCallArguments(raw, onWarn) {
|
|
957
|
+
const argStr = raw || "{}";
|
|
958
|
+
try {
|
|
959
|
+
return JSON.parse(argStr);
|
|
960
|
+
} catch {
|
|
961
|
+
const truncated = argStr.trimEnd();
|
|
962
|
+
const lastComma = truncated.lastIndexOf(",");
|
|
963
|
+
const fixed = lastComma > 0 ? truncated.slice(0, lastComma) + "}" : truncated.slice(0, truncated.indexOf("{") + 1) + "}";
|
|
964
|
+
try {
|
|
965
|
+
const repaired = JSON.parse(fixed);
|
|
966
|
+
onWarn?.("Tool call JSON was truncated and auto-repaired. Some parameters may be missing.");
|
|
967
|
+
return repaired;
|
|
968
|
+
} catch {
|
|
969
|
+
onWarn?.("Tool call JSON could not be parsed, using empty arguments.");
|
|
970
|
+
return {};
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
async function consumeToolCallStream(stream, hooks = {}) {
|
|
975
|
+
const textParts = [];
|
|
976
|
+
const accumulators = /* @__PURE__ */ new Map();
|
|
977
|
+
let usage;
|
|
978
|
+
let rawContent;
|
|
979
|
+
let reasoningContent;
|
|
980
|
+
let finishReason;
|
|
981
|
+
let aborted = false;
|
|
982
|
+
const thinkFilter = new ThinkTagFilter();
|
|
983
|
+
const emitText = (raw) => {
|
|
984
|
+
const visible = thinkFilter.push(raw);
|
|
985
|
+
if (visible) {
|
|
986
|
+
textParts.push(visible);
|
|
987
|
+
hooks.onText?.(visible);
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
try {
|
|
991
|
+
for await (const event of stream) {
|
|
992
|
+
if (hooks.signal?.aborted) {
|
|
993
|
+
aborted = true;
|
|
994
|
+
break;
|
|
995
|
+
}
|
|
996
|
+
switch (event.type) {
|
|
997
|
+
case "text_delta":
|
|
998
|
+
emitText(event.delta);
|
|
999
|
+
break;
|
|
1000
|
+
case "thinking_start":
|
|
1001
|
+
hooks.onThinkingStart?.();
|
|
1002
|
+
break;
|
|
1003
|
+
case "thinking_delta":
|
|
1004
|
+
hooks.onThinkingDelta?.(event.delta);
|
|
1005
|
+
break;
|
|
1006
|
+
case "thinking_end":
|
|
1007
|
+
hooks.onThinkingEnd?.();
|
|
1008
|
+
break;
|
|
1009
|
+
case "tool_call_start":
|
|
1010
|
+
accumulators.set(event.index, { id: event.id, name: event.name, arguments: "" });
|
|
1011
|
+
hooks.onToolCallStart?.(event.index, event.id, event.name);
|
|
1012
|
+
break;
|
|
1013
|
+
case "tool_call_delta": {
|
|
1014
|
+
const acc = accumulators.get(event.index);
|
|
1015
|
+
if (acc) acc.arguments += event.argumentsDelta;
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
case "tool_call_end":
|
|
1019
|
+
break;
|
|
1020
|
+
case "done":
|
|
1021
|
+
if (event.usage) usage = event.usage;
|
|
1022
|
+
if (event.rawContent) rawContent = event.rawContent;
|
|
1023
|
+
if (event.reasoningContent) reasoningContent = event.reasoningContent;
|
|
1024
|
+
if (event.finishReason) finishReason = event.finishReason;
|
|
1025
|
+
break;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
} catch (err) {
|
|
1029
|
+
if (err instanceof Error && (err.name === "AbortError" || err.message.includes("aborted"))) {
|
|
1030
|
+
aborted = true;
|
|
1031
|
+
} else {
|
|
1032
|
+
throw err;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
const tail = thinkFilter.flush();
|
|
1036
|
+
if (tail && !aborted) {
|
|
1037
|
+
textParts.push(tail);
|
|
1038
|
+
hooks.onText?.(tail);
|
|
1039
|
+
}
|
|
1040
|
+
const textContent = textParts.join("");
|
|
1041
|
+
if (aborted) {
|
|
1042
|
+
return { textContent, toolCalls: [], usage, rawContent, reasoningContent, finishReason, aborted };
|
|
1043
|
+
}
|
|
1044
|
+
const toolCalls = [];
|
|
1045
|
+
for (const [, acc] of accumulators) {
|
|
1046
|
+
toolCalls.push({
|
|
1047
|
+
id: acc.id,
|
|
1048
|
+
name: acc.name,
|
|
1049
|
+
arguments: repairToolCallArguments(acc.arguments, hooks.onWarn)
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
if (toolCalls.length > 0) {
|
|
1053
|
+
if (rawContent) {
|
|
1054
|
+
toolCalls._rawContent = rawContent;
|
|
1055
|
+
}
|
|
1056
|
+
if (textContent) {
|
|
1057
|
+
toolCalls._streamedText = textContent;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return { textContent, toolCalls, usage, rawContent, reasoningContent, finishReason, aborted };
|
|
1061
|
+
}
|
|
1062
|
+
var FREE_ROUND_TOOLS = /* @__PURE__ */ new Set(["write_todos"]);
|
|
1063
|
+
var MAX_CONSECUTIVE_FREE_ROUNDS = 3;
|
|
1064
|
+
var FreeRoundTracker = class {
|
|
1065
|
+
consecutive = 0;
|
|
1066
|
+
/** 返回 true 表示本轮不消耗有效轮次(调用方执行 round--)。 */
|
|
1067
|
+
apply(toolNames) {
|
|
1068
|
+
const allFree = toolNames.length > 0 && toolNames.every((n) => FREE_ROUND_TOOLS.has(n));
|
|
1069
|
+
if (!allFree) {
|
|
1070
|
+
this.consecutive = 0;
|
|
1071
|
+
return false;
|
|
1072
|
+
}
|
|
1073
|
+
this.consecutive++;
|
|
1074
|
+
return this.consecutive <= MAX_CONSECUTIVE_FREE_ROUNDS;
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
var BudgetWarner = class {
|
|
1078
|
+
constructor(maxToolRounds) {
|
|
1079
|
+
this.maxToolRounds = maxToolRounds;
|
|
1080
|
+
this.noteAt = Math.max(10, Math.floor(maxToolRounds * 0.2));
|
|
1081
|
+
const lowRaw = Math.max(5, Math.floor(maxToolRounds * 0.1));
|
|
1082
|
+
const criticalRaw = Math.max(3, Math.floor(maxToolRounds * 0.05));
|
|
1083
|
+
this.lowAt = Math.min(lowRaw, this.noteAt - 1);
|
|
1084
|
+
this.criticalAt = Math.min(criticalRaw, this.lowAt - 1);
|
|
1085
|
+
}
|
|
1086
|
+
noteAt;
|
|
1087
|
+
lowAt;
|
|
1088
|
+
criticalAt;
|
|
1089
|
+
warnedNote = false;
|
|
1090
|
+
warnedLow = false;
|
|
1091
|
+
warnedCritical = false;
|
|
1092
|
+
check(roundsLeft) {
|
|
1093
|
+
if (!this.warnedCritical && roundsLeft <= this.criticalAt) {
|
|
1094
|
+
this.warnedCritical = true;
|
|
1095
|
+
return {
|
|
1096
|
+
level: "critical",
|
|
1097
|
+
injectMessage: `\u{1F6A8} Critical budget: Only ${roundsLeft} rounds left! Wrap up NOW \u2014 complete the current operation and give a final summary. Do NOT start new tasks.`,
|
|
1098
|
+
displayMessage: `\u{1F6A8} Critical: ${roundsLeft} rounds remaining`
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
if (!this.warnedLow && roundsLeft <= this.lowAt) {
|
|
1102
|
+
this.warnedLow = true;
|
|
1103
|
+
return {
|
|
1104
|
+
level: "low",
|
|
1105
|
+
injectMessage: `\u26A0\uFE0F Budget warning: Only ${roundsLeft} tool rounds remaining. Prioritize completing the most critical task. Use efficient approaches (batch edits, fewer reads). If you cannot finish everything, summarize what's done and what remains.`,
|
|
1106
|
+
displayMessage: `\u26A0\uFE0F Low budget: ${roundsLeft} rounds remaining`
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
if (!this.warnedNote && roundsLeft <= this.noteAt) {
|
|
1110
|
+
this.warnedNote = true;
|
|
1111
|
+
return {
|
|
1112
|
+
level: "note",
|
|
1113
|
+
injectMessage: `\u{1F4CA} Budget note: ${roundsLeft} tool rounds remaining out of ${this.maxToolRounds}. Plan your remaining work efficiently \u2014 use batch operations (e.g., replaceAll) when possible.`
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
return null;
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
var EMPTY_RESPONSE_NUDGE = "Your previous response was empty \u2014 no text and no tool calls. This usually means the context window is nearly full. Please either: (1) continue the task by calling the next tool you need, or (2) give a concise final text summary of what has been accomplished so far and what remains. Do NOT repeat earlier long outputs.";
|
|
1120
|
+
function describeFinishReason(fr) {
|
|
1121
|
+
if (fr === "length") return "output limit reached (finish_reason=length)";
|
|
1122
|
+
if (fr === "content_filter") return "content blocked (finish_reason=content_filter)";
|
|
1123
|
+
if (fr) return `empty response (finish_reason=${fr})`;
|
|
1124
|
+
return "empty response";
|
|
1125
|
+
}
|
|
1126
|
+
function emptyResponseHint(fr) {
|
|
1127
|
+
if (fr === "length") return "Output token limit hit \u2014 try /compact to reduce context, raise maxTokens, or /model to switch.";
|
|
1128
|
+
if (fr === "content_filter") return "Content was blocked by the provider filter.";
|
|
1129
|
+
return "Context window may be exhausted or max_tokens too low.";
|
|
1130
|
+
}
|
|
1131
|
+
var EmptyResponseGuard = class {
|
|
1132
|
+
retries = 0;
|
|
1133
|
+
onEmpty(canRetry, finishReason) {
|
|
1134
|
+
if (this.retries === 0 && canRetry) {
|
|
1135
|
+
this.retries++;
|
|
1136
|
+
return {
|
|
1137
|
+
action: "nudge",
|
|
1138
|
+
injectMessage: EMPTY_RESPONSE_NUDGE,
|
|
1139
|
+
displayMessage: `\u26A0 ${describeFinishReason(finishReason)} \u2014 nudging AI to continue...`
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
return {
|
|
1143
|
+
action: "stop",
|
|
1144
|
+
displayMessage: "\u26A0 AI returned empty responses twice in a row. Stopping agentic loop.",
|
|
1145
|
+
hint: emptyResponseHint(finishReason)
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
/** 非空响应到达 → 重置计数(下次空响应仍可 nudge 一次)。 */
|
|
1149
|
+
onNonEmpty() {
|
|
1150
|
+
this.retries = 0;
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
var ContextPressureMonitor = class {
|
|
1154
|
+
warned80 = false;
|
|
1155
|
+
check(requestTokens, contextWindow) {
|
|
1156
|
+
if (contextWindow <= 0) return { action: "ok", ratio: 0 };
|
|
1157
|
+
const ratio = requestTokens / contextWindow;
|
|
1158
|
+
if (ratio >= 0.95) return { action: "abort", ratio };
|
|
1159
|
+
if (ratio >= 0.8 && !this.warned80) {
|
|
1160
|
+
this.warned80 = true;
|
|
1161
|
+
return {
|
|
1162
|
+
action: "warn",
|
|
1163
|
+
ratio,
|
|
1164
|
+
injectMessage: `\u26A0\uFE0F Context pressure: ~${Math.round(ratio * 100)}% of the ${contextWindow.toLocaleString()}-token context window is used. Avoid reading more files or running broad scans. Finish the current critical step, then produce a final summary. Every unnecessary tool call now risks breaking the conversation.`
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
return { action: "ok", ratio };
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
function accumulateUsage(total, delta) {
|
|
1171
|
+
if (!delta) return;
|
|
1172
|
+
total.inputTokens += delta.inputTokens;
|
|
1173
|
+
total.outputTokens += delta.outputTokens;
|
|
1174
|
+
total.cacheCreationTokens += delta.cacheCreationTokens ?? 0;
|
|
1175
|
+
total.cacheReadTokens += delta.cacheReadTokens ?? 0;
|
|
1176
|
+
}
|
|
1177
|
+
function buildRoundBudgetHint(opts) {
|
|
1178
|
+
const pauseHint = opts.autoPauseInterval > 0 ? `
|
|
1179
|
+
- Every ${opts.autoPauseInterval} rounds the user will be asked whether to continue \u2014 use this as a natural checkpoint to report progress.` : "";
|
|
1180
|
+
if (opts.planMode) {
|
|
1181
|
+
return `
|
|
1182
|
+
|
|
1183
|
+
[Tool Round Budget \u2014 Plan Mode]
|
|
1184
|
+
You have a maximum of ${opts.maxToolRounds} tool call rounds. You are in READ-ONLY Plan Mode:
|
|
1185
|
+
- Only use: read_file, list_dir, grep_files, glob_files, ask_user, write_todos
|
|
1186
|
+
- Do NOT attempt to call bash, write_file, edit_file \u2014 they are disabled
|
|
1187
|
+
- Do NOT write shell commands or code blocks as a substitute for tool calls
|
|
1188
|
+
- Do NOT read the same file more than once
|
|
1189
|
+
- Call write_todos ONCE to present your plan, then give a text summary
|
|
1190
|
+
- If the user asks you to execute anything, respond: "Please type /plan execute to switch to execute mode."${pauseHint}`;
|
|
1191
|
+
}
|
|
1192
|
+
return `
|
|
1193
|
+
|
|
1194
|
+
[Tool Round Budget]
|
|
1195
|
+
You have a maximum of ${opts.maxToolRounds} tool call rounds for this task. Plan efficiently:
|
|
1196
|
+
- Prefer batch operations (e.g. global find-and-replace) over repetitive single edits.
|
|
1197
|
+
- Do NOT read the same file more than once \u2014 use the content from previous reads.
|
|
1198
|
+
- Prioritize the most critical tasks first in case rounds run out.
|
|
1199
|
+
- When remaining rounds are low, focus on completing the current task and summarizing.${pauseHint}`;
|
|
1200
|
+
}
|
|
1201
|
+
function buildRoundsExhaustedPrompt(maxToolRounds) {
|
|
1202
|
+
return `You have used all ${maxToolRounds} tool call rounds. Do not call any more tools. Summarize in text:
|
|
1203
|
+
1. What work has been completed so far
|
|
1204
|
+
2. What tasks remain unfinished
|
|
1205
|
+
3. What the user can do next (e.g. send another request to continue)`;
|
|
1206
|
+
}
|
|
1207
|
+
function buildUserStopMessage(effectiveRound, maxToolRounds) {
|
|
1208
|
+
return `The user has stopped the task at round ${effectiveRound}/${maxToolRounds}. Do not call any more tools. Summarize what has been completed and what remains.`;
|
|
1209
|
+
}
|
|
1210
|
+
function summarizeRecentTools(history, interval) {
|
|
1211
|
+
const recent = history.slice(-interval);
|
|
1212
|
+
const counts = /* @__PURE__ */ new Map();
|
|
1213
|
+
for (const rh of recent) {
|
|
1214
|
+
for (const t of rh.tools) counts.set(t, (counts.get(t) || 0) + 1);
|
|
1215
|
+
}
|
|
1216
|
+
return [...counts.entries()].sort((a, b) => b[1] - a[1]).map(([name, count]) => count > 1 ? `${name}\xD7${count}` : name).join(", ");
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
// src/providers/openai-compatible.ts
|
|
905
1220
|
function toUsage(u) {
|
|
906
1221
|
if (!u) return void 0;
|
|
907
1222
|
const cached = u.prompt_tokens_details?.cached_tokens ?? 0;
|
|
@@ -1124,28 +1439,11 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1124
1439
|
const reasoningContent = message.reasoning_content;
|
|
1125
1440
|
if (message.tool_calls && message.tool_calls.length > 0) {
|
|
1126
1441
|
const toolCalls = message.tool_calls.map((tc) => {
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
const truncated = rawArgs.trimEnd();
|
|
1133
|
-
const lastComma = truncated.lastIndexOf(",");
|
|
1134
|
-
const fixed = lastComma > 0 ? truncated.slice(0, lastComma) + "}" : truncated.slice(0, truncated.indexOf("{") + 1) + "}";
|
|
1135
|
-
try {
|
|
1136
|
-
parsedArgs = JSON.parse(fixed);
|
|
1137
|
-
process.stderr.write(
|
|
1138
|
-
`[warn] Tool call JSON was truncated and auto-repaired. Some parameters may be missing.
|
|
1139
|
-
`
|
|
1140
|
-
);
|
|
1141
|
-
} catch {
|
|
1142
|
-
process.stderr.write(
|
|
1143
|
-
`[warn] Tool call JSON could not be parsed, using empty arguments.
|
|
1144
|
-
`
|
|
1145
|
-
);
|
|
1146
|
-
parsedArgs = {};
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1442
|
+
const parsedArgs = repairToolCallArguments(
|
|
1443
|
+
tc.function.arguments || "{}",
|
|
1444
|
+
(m) => process.stderr.write(`[warn] ${m}
|
|
1445
|
+
`)
|
|
1446
|
+
);
|
|
1149
1447
|
return {
|
|
1150
1448
|
id: tc.id,
|
|
1151
1449
|
name: tc.function.name,
|
|
@@ -2683,6 +2981,17 @@ var ProviderRegistry = class {
|
|
|
2683
2981
|
};
|
|
2684
2982
|
|
|
2685
2983
|
export {
|
|
2984
|
+
ThinkTagFilter,
|
|
2985
|
+
consumeToolCallStream,
|
|
2986
|
+
FreeRoundTracker,
|
|
2987
|
+
BudgetWarner,
|
|
2988
|
+
EmptyResponseGuard,
|
|
2989
|
+
ContextPressureMonitor,
|
|
2990
|
+
accumulateUsage,
|
|
2991
|
+
buildRoundBudgetHint,
|
|
2992
|
+
buildRoundsExhaustedPrompt,
|
|
2993
|
+
buildUserStopMessage,
|
|
2994
|
+
summarizeRecentTools,
|
|
2686
2995
|
detectsHallucinatedFileOp,
|
|
2687
2996
|
hadPreviousWriteToolCalls,
|
|
2688
2997
|
TOOL_CALL_REMINDER,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ORXPLVM7.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-CPZ7KG3Y.js";
|
|
15
15
|
|
|
16
16
|
// src/mcp/client.ts
|
|
17
17
|
import { spawn } from "child_process";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-HDSKW7Q3.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-D4ZTYYBU.js";
|
|
9
9
|
import {
|
|
10
10
|
runTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4VB6UP4W.js";
|
|
12
12
|
import {
|
|
13
13
|
getDangerLevel,
|
|
14
14
|
isFileWriteTool
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
SUBAGENT_ALLOWED_TOOLS,
|
|
26
26
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
27
27
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-CPZ7KG3Y.js";
|
|
29
29
|
import {
|
|
30
30
|
fileCheckpoints
|
|
31
31
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-HLWUDRBO.js";
|
|
7
7
|
import {
|
|
8
8
|
ProviderRegistry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5LK7H45B.js";
|
|
10
10
|
import "./chunk-HIU2SH4V.js";
|
|
11
11
|
import {
|
|
12
12
|
ConfigManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-P2VFMUR5.js";
|
|
14
14
|
import "./chunk-TZQHYZKT.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CPZ7KG3Y.js";
|
|
18
18
|
import "./chunk-PDX44BCA.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/ci.ts
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getConfigDirUsage,
|
|
4
4
|
listRecentCrashes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZWQ36YFI.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5LK7H45B.js";
|
|
9
9
|
import {
|
|
10
10
|
getStatsSnapshot,
|
|
11
11
|
getTopFailingTools,
|
|
12
12
|
getTopUsedTools,
|
|
13
13
|
resetStats
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4VB6UP4W.js";
|
|
15
15
|
import "./chunk-HIU2SH4V.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-P2VFMUR5.js";
|
|
19
19
|
import "./chunk-TZQHYZKT.js";
|
|
20
20
|
import {
|
|
21
21
|
DEV_STATE_FILE_NAME,
|
|
22
22
|
MEMORY_FILE_NAME,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CPZ7KG3Y.js";
|
|
25
25
|
import "./chunk-PDX44BCA.js";
|
|
26
26
|
|
|
27
27
|
// src/diagnostics/doctor-cli.ts
|