jinzd-ai-cli 0.4.312 → 0.4.313
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-6EYPEQ3O.js → batch-UKRW5TVU.js} +2 -2
- package/dist/{chunk-2S7J2KQE.js → chunk-CYCAVYC6.js} +1 -1
- package/dist/{chunk-BAOF72JJ.js → chunk-FJ6W5XF3.js} +4 -4
- package/dist/{chunk-3L3PKTSK.js → chunk-G7WI7ZT6.js} +1 -1
- package/dist/{chunk-EBCAL563.js → chunk-HESWJPTY.js} +1 -1
- package/dist/{chunk-N7X4UTYU.js → chunk-IJQPDFOE.js} +9 -5
- package/dist/{chunk-BZJP6CPB.js → chunk-JX3A43W4.js} +1 -1
- package/dist/{chunk-7N7UR2EO.js → chunk-MZEEY5JK.js} +1 -1
- package/dist/{chunk-GGRKAWTD.js → chunk-MZJQE2XL.js} +8 -8
- package/dist/{chunk-N2TUSN4P.js → chunk-O2XAJUWR.js} +4 -4
- package/dist/{chunk-VWJTQXTK.js → chunk-OPNL72PF.js} +1 -1
- package/dist/{chunk-RMEJR3AW.js → chunk-OTFPUZ6W.js} +62 -0
- package/dist/{chunk-OMYTMDDZ.js → chunk-Q2U6KM3P.js} +1 -1
- package/dist/{chunk-5IVLHPRY.js → chunk-RMC47NWH.js} +1 -1
- package/dist/{chunk-6TXYRSRR.js → chunk-SFP7IDC7.js} +1 -1
- package/dist/{chunk-KGZPUXTT.js → chunk-WIZ4PSUF.js} +1 -1
- package/dist/{ci-ABVJXOFE.js → ci-MWXUVEIK.js} +6 -6
- package/dist/{ci-format-RIMJGEXL.js → ci-format-GW2U5N4O.js} +2 -2
- package/dist/{constants-MSGZ6VYX.js → constants-5FJN335X.js} +1 -1
- package/dist/{constants-SQVY334W.js → constants-CDIYLDFD.js} +1 -1
- package/dist/{doctor-cli-ER2QKRYN.js → doctor-cli-GWMRIUNC.js} +6 -6
- package/dist/electron-server.js +79 -10
- package/dist/{hub-LTAASYAT.js → hub-7FOXQT4J.js} +1 -1
- package/dist/index.js +27 -19
- package/dist/{persistent-memory-GMWJWOEA.js → persistent-memory-NBVPKMKO.js} +2 -2
- package/dist/{persistent-memory-JC5GLEZN.js → persistent-memory-WVNOXI7A.js} +2 -2
- package/dist/{pr-UQTBLDJ7.js → pr-Y2R6GOLU.js} +6 -6
- package/dist/{run-tests-LV4ORBHY.js → run-tests-MWM5AMGM.js} +2 -2
- package/dist/{run-tests-4L7DYT2H.js → run-tests-YOM4IWUG.js} +2 -2
- package/dist/{server-J3G3ZRHG.js → server-4B6LZIPC.js} +6 -6
- package/dist/{server-XWYBD4UC.js → server-D3QLDWN3.js} +18 -15
- package/dist/{task-orchestrator-HEACDAY2.js → task-orchestrator-64OZCQ5Q.js} +6 -6
- package/dist/{usage-FUBC5267.js → usage-LKQO36LR.js} +2 -2
- package/package.json +1 -1
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-RS7SKYTS.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HESWJPTY.js";
|
|
8
8
|
import "./chunk-TU3L3PW7.js";
|
|
9
9
|
import {
|
|
10
10
|
atomicWriteFileSync
|
|
11
11
|
} from "./chunk-BMLQPSHP.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-CYCAVYC6.js";
|
|
13
13
|
|
|
14
14
|
// src/cli/batch.ts
|
|
15
15
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q2U6KM3P.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
} from "./chunk-6YZEZFX5.js";
|
|
14
14
|
import {
|
|
15
15
|
ProviderRegistry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-G7WI7ZT6.js";
|
|
17
17
|
import {
|
|
18
18
|
ConfigManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HESWJPTY.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CYCAVYC6.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/ci.ts
|
|
25
25
|
import { execFileSync } from "child_process";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchPersistentMemories,
|
|
12
12
|
touchMemoryReferences,
|
|
13
13
|
updateMemoryEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JX3A43W4.js";
|
|
15
15
|
import {
|
|
16
16
|
indexProject
|
|
17
17
|
} from "./chunk-RWRZVQCB.js";
|
|
@@ -30,13 +30,13 @@ import {
|
|
|
30
30
|
runHook,
|
|
31
31
|
runLifecycleHooks,
|
|
32
32
|
runTool
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-MZEEY5JK.js";
|
|
34
34
|
import {
|
|
35
35
|
buildTruncatedArgumentsError,
|
|
36
36
|
getDangerLevel,
|
|
37
37
|
isFileWriteTool,
|
|
38
38
|
runLeanAgentLoop
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-OTFPUZ6W.js";
|
|
40
40
|
import {
|
|
41
41
|
EnvLoader,
|
|
42
42
|
NetworkError,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
recoverGbkMojibake,
|
|
64
64
|
runTestsTool,
|
|
65
65
|
shellInvocation
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-WIZ4PSUF.js";
|
|
67
67
|
import {
|
|
68
68
|
CONFIG_DIR_NAME,
|
|
69
69
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
SUBAGENT_ALLOWED_TOOLS,
|
|
73
73
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
74
74
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-CYCAVYC6.js";
|
|
76
76
|
import {
|
|
77
77
|
getCurrentSessionKey,
|
|
78
78
|
getExecutionConfigDir,
|
|
@@ -5736,6 +5736,10 @@ async function runSubAgent(task, maxRounds, agentIndex, ctx, agent) {
|
|
|
5736
5736
|
}
|
|
5737
5737
|
},
|
|
5738
5738
|
onRoundsExhausted: () => `(Sub-agent reached maximum rounds (${maxRounds}) without producing a final response)`,
|
|
5739
|
+
onStalledIntent: (clause) => {
|
|
5740
|
+
process.stderr.write(`[spawn_agent] \u26A0 sub-agent announced an action but made no tool call ("${clause}") \u2014 asking it to actually do it...
|
|
5741
|
+
`);
|
|
5742
|
+
},
|
|
5739
5743
|
onError: (errMsg) => {
|
|
5740
5744
|
process.stderr.write(`
|
|
5741
5745
|
[spawn_agent] Error in sub-agent loop: ${errMsg}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
MEMORY_FILE_NAME,
|
|
14
14
|
MEMORY_MAX_CHARS,
|
|
15
15
|
MEMORY_STORE_FILE_NAME
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CYCAVYC6.js";
|
|
17
17
|
|
|
18
18
|
// src/memory/persistent-memory.ts
|
|
19
19
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
setPreferredAgentName,
|
|
17
17
|
truncateForPersist,
|
|
18
18
|
undoStack
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IJQPDFOE.js";
|
|
20
20
|
import {
|
|
21
21
|
buildReviewPrompt,
|
|
22
22
|
buildSecurityReviewPrompt
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
touchMemoryReferences,
|
|
52
52
|
updateMemoryApproval,
|
|
53
53
|
updateMemoryEntry
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-JX3A43W4.js";
|
|
55
55
|
import {
|
|
56
56
|
theme
|
|
57
57
|
} from "./chunk-5C76XDDF.js";
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
import {
|
|
66
66
|
buildDoctorReport,
|
|
67
67
|
formatDoctorReport
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-O2XAJUWR.js";
|
|
69
69
|
import {
|
|
70
70
|
describePlugin,
|
|
71
71
|
getActivePluginAssets,
|
|
@@ -80,11 +80,11 @@ import {
|
|
|
80
80
|
trustHook,
|
|
81
81
|
trustPlugin,
|
|
82
82
|
untrustHook
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-MZEEY5JK.js";
|
|
84
84
|
import {
|
|
85
85
|
isCleanDocumentBody,
|
|
86
86
|
stripOuterCodeFence
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-OTFPUZ6W.js";
|
|
88
88
|
import {
|
|
89
89
|
formatGitContextForPrompt,
|
|
90
90
|
getGitContext
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
MCP_TOOL_PREFIX,
|
|
110
110
|
REPO_URL,
|
|
111
111
|
VERSION
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-CYCAVYC6.js";
|
|
113
113
|
|
|
114
114
|
// src/skills/manager.ts
|
|
115
115
|
import { existsSync, readdirSync, mkdirSync, statSync } from "fs";
|
|
@@ -2426,7 +2426,7 @@ No tools match "${filter}".
|
|
|
2426
2426
|
const { join: join6 } = await import("path");
|
|
2427
2427
|
const { existsSync: existsSync6 } = await import("fs");
|
|
2428
2428
|
const { getGitRoot } = await import("./git-context-EXOEHQSF.js");
|
|
2429
|
-
const { MCP_PROJECT_CONFIG_NAME } = await import("./constants-
|
|
2429
|
+
const { MCP_PROJECT_CONFIG_NAME } = await import("./constants-5FJN335X.js");
|
|
2430
2430
|
const { approveProject, hashMcpFile } = await import("./project-trust-KGG2BWKC.js");
|
|
2431
2431
|
const cwd = process.cwd();
|
|
2432
2432
|
const projectRoot = getGitRoot(cwd) ?? cwd;
|
|
@@ -3534,7 +3534,7 @@ function createReviewCommands() {
|
|
|
3534
3534
|
usage: "/test [command|filter]",
|
|
3535
3535
|
async execute(args, ctx) {
|
|
3536
3536
|
try {
|
|
3537
|
-
const { executeTests } = await import("./run-tests-
|
|
3537
|
+
const { executeTests } = await import("./run-tests-MWM5AMGM.js");
|
|
3538
3538
|
const argStr = args.join(" ").trim();
|
|
3539
3539
|
let testArgs = {};
|
|
3540
3540
|
if (argStr) {
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listHooks,
|
|
9
9
|
listInstalledPlugins,
|
|
10
10
|
resetStats
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MZEEY5JK.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-G7WI7ZT6.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-HESWJPTY.js";
|
|
18
18
|
import {
|
|
19
19
|
getGitRoot
|
|
20
20
|
} from "./chunk-HOSJZMQS.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
MCP_PROJECT_CONFIG_NAME,
|
|
27
27
|
MEMORY_FILE_NAME,
|
|
28
28
|
VERSION
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-CYCAVYC6.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -610,6 +610,45 @@ function teeStreamErrorSummary(saveToFile, errMsg) {
|
|
|
610
610
|
return `[save_last_response failed] streaming was interrupted: ${errMsg}. ${saveToFile} (partial) was deleted. Retry \u2014 and consider producing a more compact output (split very large reports across multiple save_last_response calls if the previous attempt timed out).`;
|
|
611
611
|
}
|
|
612
612
|
|
|
613
|
+
// src/core/stalled-intent.ts
|
|
614
|
+
var WAITING_FOR_USER_RE = /[??]\s*$|是否|要不要|需不需要|需要我|要我|可以吗|好吗|行吗|您看|你看看|请确认|确认后|同意后|如果(?:你|您)|若(?:你|您)|如(?:你|您)需要|等你|等待(?:你|您)|待(?:你|您)|我可以|我也可以|还可以|(?:你|您)可以|告诉我|或者(?:让我|我)|可以为(?:你|您)|可以帮|随时|\bwould you\b|\bshall i\b|\bshould i\b|\bdo you want\b|\blet me know\b|\bif you(?:'d| would)? like\b|\bonce you confirm\b|\byour (?:approval|confirmation)\b|\bif you want\b|\bi can also\b/i;
|
|
615
|
+
var COMPLETED_RE = /已|完成|好了|完毕|写好|搞定|\b(?:done|finished|completed|have (?:written|created|generated))\b/i;
|
|
616
|
+
var CN_VERBS = "\u5F00\u5199|\u52A8\u624B|\u7F16\u5199|\u5199\u5165|\u5199|\u751F\u6210|\u521B\u5EFA|\u5236\u4F5C|\u6267\u884C|\u8FD0\u884C|\u5B89\u88C5|\u4FEE\u6539|\u66F4\u65B0|\u4FEE\u590D|\u5B9E\u73B0|\u6784\u5EFA|\u8F93\u51FA|\u4FDD\u5B58|\u8BFB\u53D6|\u67E5\u770B|\u68C0\u67E5|\u8C03\u7528|\u5904\u7406|\u6574\u7406|\u8865\u5145|\u5B8C\u5584|\u91CD\u5199|\u6539\u5199|\u843D\u76D8";
|
|
617
|
+
var CN_FIRST_PERSON_INTENT_RE = new RegExp(
|
|
618
|
+
`(?:\u6211|\u54B1\u4EEC|\u6211\u4EEC|\u8BA9\u6211)(?:\u73B0\u5728|\u8FD9\u5C31|\u9A6C\u4E0A|\u7ACB\u5373|\u7ACB\u523B|\u76F4\u63A5|\u63A5\u4E0B\u6765|\u4E0B\u9762|\u5148|\u518D|\u968F\u540E|\u7136\u540E|\u5C31)*(?:\u5C06|\u4F1A|\u8981|\u6765|\u53BB|\u5F00\u59CB|\u7740\u624B|\u51C6\u5907)?(?:[^\uFF0C,\u3002\uFF01!\uFF1B;\uFF1A:\\n]{0,4})?(?:${CN_VERBS})`
|
|
619
|
+
);
|
|
620
|
+
var CN_BARE_INTENT_RE = new RegExp(
|
|
621
|
+
`^(?:\u597D[\u7684\uFF0C,]?\\s*)?(?:\u73B0\u5728|\u63A5\u4E0B\u6765|\u4E0B\u9762|\u9A6C\u4E0A|\u8FD9\u5C31|\u968F\u540E|\u90A3\u4E48)(?:\u5C31|\u5C06|\u5F00\u59CB|\u6765|\u7740\u624B|\u76F4\u63A5)*(?:[^\uFF0C,\u3002\uFF01!\uFF1B;\uFF1A:\\n]{0,4})?(?:${CN_VERBS})`
|
|
622
|
+
);
|
|
623
|
+
var EN_INTENT_RE = /\b(?:i'll|i will|i'm going to|i am going to|let me|let's|now i'll|next,? i'll|i'll now|going to|i'm now going to)\b[^.!?\n]{0,60}?\b(?:write|create|generate|build|run|execute|install|update|edit|fix|implement|add|start|proceed|read|check|make|produce|save)\b/i;
|
|
624
|
+
function lastParagraph(content) {
|
|
625
|
+
const withoutTrailingFence = content.replace(/```[\s\S]*?```\s*$/, "").trimEnd();
|
|
626
|
+
const paras = withoutTrailingFence.split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean);
|
|
627
|
+
const last = paras[paras.length - 1] ?? "";
|
|
628
|
+
return last.length > 300 ? last.slice(-300) : last;
|
|
629
|
+
}
|
|
630
|
+
function detectStalledIntent(content) {
|
|
631
|
+
if (!content || !content.trim()) return null;
|
|
632
|
+
const tail = lastParagraph(content);
|
|
633
|
+
if (!tail) return null;
|
|
634
|
+
if (WAITING_FOR_USER_RE.test(tail)) return null;
|
|
635
|
+
const clauses = tail.split(/[,,;;。!!::\n]/).map((c) => c.trim()).filter(Boolean);
|
|
636
|
+
for (const clause of clauses) {
|
|
637
|
+
if (COMPLETED_RE.test(clause)) continue;
|
|
638
|
+
if (CN_FIRST_PERSON_INTENT_RE.test(clause) || CN_BARE_INTENT_RE.test(clause)) return clause;
|
|
639
|
+
}
|
|
640
|
+
for (const sentence of tail.split(/(?<=[.!])\s+|\n/)) {
|
|
641
|
+
if (COMPLETED_RE.test(sentence)) continue;
|
|
642
|
+
const m = EN_INTENT_RE.exec(sentence);
|
|
643
|
+
if (m) return sentence.trim();
|
|
644
|
+
}
|
|
645
|
+
return null;
|
|
646
|
+
}
|
|
647
|
+
function buildStalledIntentNudge(clause) {
|
|
648
|
+
return `Your previous reply announced an action ("${clause}") but contained NO tool call, so nothing was executed \u2014 the task would silently end here with the work undone. If you intend to do it, call the tool NOW in this response; do not restate the plan. If the output is long, write it in several smaller write_file calls (append=true for later parts) instead of one huge call. If you actually meant to stop and wait for the user, reply with one short sentence saying what remains and why you stopped.`;
|
|
649
|
+
}
|
|
650
|
+
var MAX_STALLED_INTENT_NUDGES = 2;
|
|
651
|
+
|
|
613
652
|
// src/core/agent-loop.ts
|
|
614
653
|
function partialTagTail(s, tag) {
|
|
615
654
|
const max = Math.min(s.length, tag.length - 1);
|
|
@@ -947,6 +986,7 @@ async function runAgentLoop(host) {
|
|
|
947
986
|
const hasWriteTools = host.toolDefs.some((t) => t.name === "write_file" || t.name === "edit_file");
|
|
948
987
|
let hallucinationRetries = 0;
|
|
949
988
|
const MAX_HALLUCINATION_RETRIES = 2;
|
|
989
|
+
let stalledIntentNudges = 0;
|
|
950
990
|
for (let round = 0; round < maxToolRounds; round++) {
|
|
951
991
|
if (host.signal?.aborted) return { reason: "aborted", usage };
|
|
952
992
|
host.onRoundStart?.(round, maxToolRounds);
|
|
@@ -995,6 +1035,17 @@ async function runAgentLoop(host) {
|
|
|
995
1035
|
);
|
|
996
1036
|
continue;
|
|
997
1037
|
}
|
|
1038
|
+
const stalledClause = !host.planMode && host.toolDefs.length > 0 && content && round < maxToolRounds - 1 && stalledIntentNudges < MAX_STALLED_INTENT_NUDGES ? detectStalledIntent(content) : null;
|
|
1039
|
+
if (stalledClause) {
|
|
1040
|
+
stalledIntentNudges++;
|
|
1041
|
+
host.onStalledIntent?.({ clause: stalledClause, round, alreadyRendered });
|
|
1042
|
+
const reasoningField = outcome.reasoningContent ? { reasoning_content: outcome.reasoningContent } : host.providerId === "deepseek" ? { reasoning_content: "" } : {};
|
|
1043
|
+
extraMessages.push(
|
|
1044
|
+
{ role: "assistant", content, ...reasoningField },
|
|
1045
|
+
{ role: "user", content: buildStalledIntentNudge(stalledClause) }
|
|
1046
|
+
);
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
998
1049
|
if (!content || content.trim() === "") {
|
|
999
1050
|
const decision = emptyGuard.onEmpty(round < maxToolRounds - 1, outcome.finishReason);
|
|
1000
1051
|
host.onEmptyResponse?.(decision, { alreadyRendered, round });
|
|
@@ -1089,6 +1140,7 @@ async function runLeanAgentLoop(opts) {
|
|
|
1089
1140
|
let content = "";
|
|
1090
1141
|
let roundsUsed = 0;
|
|
1091
1142
|
let toolCallCount = 0;
|
|
1143
|
+
let stalledIntentNudges = 0;
|
|
1092
1144
|
try {
|
|
1093
1145
|
for (let round = 0; round < opts.maxRounds; round++) {
|
|
1094
1146
|
roundsUsed = round + 1;
|
|
@@ -1113,6 +1165,16 @@ async function runLeanAgentLoop(opts) {
|
|
|
1113
1165
|
usage.outputTokens += result.usage.outputTokens;
|
|
1114
1166
|
}
|
|
1115
1167
|
if ("content" in result) {
|
|
1168
|
+
const stalledClause = round < opts.maxRounds - 1 && stalledIntentNudges < MAX_STALLED_INTENT_NUDGES && opts.toolDefsForRound(round + 1).length > 0 ? detectStalledIntent(result.content) : null;
|
|
1169
|
+
if (stalledClause) {
|
|
1170
|
+
stalledIntentNudges++;
|
|
1171
|
+
opts.onStalledIntent?.(stalledClause, round);
|
|
1172
|
+
extraMessages.push(
|
|
1173
|
+
{ role: "assistant", content: result.content },
|
|
1174
|
+
{ role: "user", content: buildStalledIntentNudge(stalledClause) }
|
|
1175
|
+
);
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1116
1178
|
content = result.content;
|
|
1117
1179
|
break;
|
|
1118
1180
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
MEMORY_FILE_NAME,
|
|
13
13
|
MEMORY_MAX_CHARS,
|
|
14
14
|
MEMORY_STORE_FILE_NAME
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SFP7IDC7.js";
|
|
16
16
|
|
|
17
17
|
// src/memory/persistent-memory.ts
|
|
18
18
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-FJ6W5XF3.js";
|
|
7
|
+
import "./chunk-Q2U6KM3P.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-G7WI7ZT6.js";
|
|
11
|
+
import "./chunk-HESWJPTY.js";
|
|
12
|
+
import "./chunk-OTFPUZ6W.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-BMLQPSHP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-CYCAVYC6.js";
|
|
16
16
|
export {
|
|
17
17
|
CI_COMMENT_MARKER,
|
|
18
18
|
countSeverity,
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-O2XAJUWR.js";
|
|
6
|
+
import "./chunk-MZEEY5JK.js";
|
|
7
7
|
import "./chunk-RS7SKYTS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-G7WI7ZT6.js";
|
|
9
|
+
import "./chunk-HESWJPTY.js";
|
|
10
|
+
import "./chunk-OTFPUZ6W.js";
|
|
11
11
|
import "./chunk-TU3L3PW7.js";
|
|
12
12
|
import "./chunk-HOSJZMQS.js";
|
|
13
13
|
import "./chunk-BMLQPSHP.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-CYCAVYC6.js";
|
|
15
15
|
export {
|
|
16
16
|
formatDoctorReport,
|
|
17
17
|
runDoctorCli
|
package/dist/electron-server.js
CHANGED
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
touchMemoryReferences,
|
|
56
56
|
updateMemoryApproval,
|
|
57
57
|
updateMemoryEntry
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-RMC47NWH.js";
|
|
59
59
|
import {
|
|
60
60
|
DEFAULT_PATTERNS,
|
|
61
61
|
redactJson,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
recoverGbkMojibake,
|
|
81
81
|
runTestsTool,
|
|
82
82
|
shellInvocation
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-OPNL72PF.js";
|
|
84
84
|
import {
|
|
85
85
|
getCurrentSessionKey,
|
|
86
86
|
getExecutionConfigDir,
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
123
123
|
VERSION,
|
|
124
124
|
buildUserIdentityPrompt
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-SFP7IDC7.js";
|
|
126
126
|
|
|
127
127
|
// src/web/access.ts
|
|
128
128
|
import { randomBytes, timingSafeEqual } from "crypto";
|
|
@@ -3023,6 +3023,45 @@ function teeStreamErrorSummary(saveToFile, errMsg) {
|
|
|
3023
3023
|
return `[save_last_response failed] streaming was interrupted: ${errMsg}. ${saveToFile} (partial) was deleted. Retry \u2014 and consider producing a more compact output (split very large reports across multiple save_last_response calls if the previous attempt timed out).`;
|
|
3024
3024
|
}
|
|
3025
3025
|
|
|
3026
|
+
// src/core/stalled-intent.ts
|
|
3027
|
+
var WAITING_FOR_USER_RE = /[??]\s*$|是否|要不要|需不需要|需要我|要我|可以吗|好吗|行吗|您看|你看看|请确认|确认后|同意后|如果(?:你|您)|若(?:你|您)|如(?:你|您)需要|等你|等待(?:你|您)|待(?:你|您)|我可以|我也可以|还可以|(?:你|您)可以|告诉我|或者(?:让我|我)|可以为(?:你|您)|可以帮|随时|\bwould you\b|\bshall i\b|\bshould i\b|\bdo you want\b|\blet me know\b|\bif you(?:'d| would)? like\b|\bonce you confirm\b|\byour (?:approval|confirmation)\b|\bif you want\b|\bi can also\b/i;
|
|
3028
|
+
var COMPLETED_RE = /已|完成|好了|完毕|写好|搞定|\b(?:done|finished|completed|have (?:written|created|generated))\b/i;
|
|
3029
|
+
var CN_VERBS = "\u5F00\u5199|\u52A8\u624B|\u7F16\u5199|\u5199\u5165|\u5199|\u751F\u6210|\u521B\u5EFA|\u5236\u4F5C|\u6267\u884C|\u8FD0\u884C|\u5B89\u88C5|\u4FEE\u6539|\u66F4\u65B0|\u4FEE\u590D|\u5B9E\u73B0|\u6784\u5EFA|\u8F93\u51FA|\u4FDD\u5B58|\u8BFB\u53D6|\u67E5\u770B|\u68C0\u67E5|\u8C03\u7528|\u5904\u7406|\u6574\u7406|\u8865\u5145|\u5B8C\u5584|\u91CD\u5199|\u6539\u5199|\u843D\u76D8";
|
|
3030
|
+
var CN_FIRST_PERSON_INTENT_RE = new RegExp(
|
|
3031
|
+
`(?:\u6211|\u54B1\u4EEC|\u6211\u4EEC|\u8BA9\u6211)(?:\u73B0\u5728|\u8FD9\u5C31|\u9A6C\u4E0A|\u7ACB\u5373|\u7ACB\u523B|\u76F4\u63A5|\u63A5\u4E0B\u6765|\u4E0B\u9762|\u5148|\u518D|\u968F\u540E|\u7136\u540E|\u5C31)*(?:\u5C06|\u4F1A|\u8981|\u6765|\u53BB|\u5F00\u59CB|\u7740\u624B|\u51C6\u5907)?(?:[^\uFF0C,\u3002\uFF01!\uFF1B;\uFF1A:\\n]{0,4})?(?:${CN_VERBS})`
|
|
3032
|
+
);
|
|
3033
|
+
var CN_BARE_INTENT_RE = new RegExp(
|
|
3034
|
+
`^(?:\u597D[\u7684\uFF0C,]?\\s*)?(?:\u73B0\u5728|\u63A5\u4E0B\u6765|\u4E0B\u9762|\u9A6C\u4E0A|\u8FD9\u5C31|\u968F\u540E|\u90A3\u4E48)(?:\u5C31|\u5C06|\u5F00\u59CB|\u6765|\u7740\u624B|\u76F4\u63A5)*(?:[^\uFF0C,\u3002\uFF01!\uFF1B;\uFF1A:\\n]{0,4})?(?:${CN_VERBS})`
|
|
3035
|
+
);
|
|
3036
|
+
var EN_INTENT_RE = /\b(?:i'll|i will|i'm going to|i am going to|let me|let's|now i'll|next,? i'll|i'll now|going to|i'm now going to)\b[^.!?\n]{0,60}?\b(?:write|create|generate|build|run|execute|install|update|edit|fix|implement|add|start|proceed|read|check|make|produce|save)\b/i;
|
|
3037
|
+
function lastParagraph(content) {
|
|
3038
|
+
const withoutTrailingFence = content.replace(/```[\s\S]*?```\s*$/, "").trimEnd();
|
|
3039
|
+
const paras = withoutTrailingFence.split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean);
|
|
3040
|
+
const last = paras[paras.length - 1] ?? "";
|
|
3041
|
+
return last.length > 300 ? last.slice(-300) : last;
|
|
3042
|
+
}
|
|
3043
|
+
function detectStalledIntent(content) {
|
|
3044
|
+
if (!content || !content.trim()) return null;
|
|
3045
|
+
const tail = lastParagraph(content);
|
|
3046
|
+
if (!tail) return null;
|
|
3047
|
+
if (WAITING_FOR_USER_RE.test(tail)) return null;
|
|
3048
|
+
const clauses = tail.split(/[,,;;。!!::\n]/).map((c) => c.trim()).filter(Boolean);
|
|
3049
|
+
for (const clause of clauses) {
|
|
3050
|
+
if (COMPLETED_RE.test(clause)) continue;
|
|
3051
|
+
if (CN_FIRST_PERSON_INTENT_RE.test(clause) || CN_BARE_INTENT_RE.test(clause)) return clause;
|
|
3052
|
+
}
|
|
3053
|
+
for (const sentence of tail.split(/(?<=[.!])\s+|\n/)) {
|
|
3054
|
+
if (COMPLETED_RE.test(sentence)) continue;
|
|
3055
|
+
const m = EN_INTENT_RE.exec(sentence);
|
|
3056
|
+
if (m) return sentence.trim();
|
|
3057
|
+
}
|
|
3058
|
+
return null;
|
|
3059
|
+
}
|
|
3060
|
+
function buildStalledIntentNudge(clause) {
|
|
3061
|
+
return `Your previous reply announced an action ("${clause}") but contained NO tool call, so nothing was executed \u2014 the task would silently end here with the work undone. If you intend to do it, call the tool NOW in this response; do not restate the plan. If the output is long, write it in several smaller write_file calls (append=true for later parts) instead of one huge call. If you actually meant to stop and wait for the user, reply with one short sentence saying what remains and why you stopped.`;
|
|
3062
|
+
}
|
|
3063
|
+
var MAX_STALLED_INTENT_NUDGES = 2;
|
|
3064
|
+
|
|
3026
3065
|
// src/core/agent-loop.ts
|
|
3027
3066
|
function partialTagTail(s, tag) {
|
|
3028
3067
|
const max = Math.min(s.length, tag.length - 1);
|
|
@@ -3360,6 +3399,7 @@ async function runAgentLoop(host) {
|
|
|
3360
3399
|
const hasWriteTools = host.toolDefs.some((t) => t.name === "write_file" || t.name === "edit_file");
|
|
3361
3400
|
let hallucinationRetries = 0;
|
|
3362
3401
|
const MAX_HALLUCINATION_RETRIES = 2;
|
|
3402
|
+
let stalledIntentNudges = 0;
|
|
3363
3403
|
for (let round = 0; round < maxToolRounds; round++) {
|
|
3364
3404
|
if (host.signal?.aborted) return { reason: "aborted", usage };
|
|
3365
3405
|
host.onRoundStart?.(round, maxToolRounds);
|
|
@@ -3408,6 +3448,17 @@ async function runAgentLoop(host) {
|
|
|
3408
3448
|
);
|
|
3409
3449
|
continue;
|
|
3410
3450
|
}
|
|
3451
|
+
const stalledClause = !host.planMode && host.toolDefs.length > 0 && content && round < maxToolRounds - 1 && stalledIntentNudges < MAX_STALLED_INTENT_NUDGES ? detectStalledIntent(content) : null;
|
|
3452
|
+
if (stalledClause) {
|
|
3453
|
+
stalledIntentNudges++;
|
|
3454
|
+
host.onStalledIntent?.({ clause: stalledClause, round, alreadyRendered });
|
|
3455
|
+
const reasoningField = outcome.reasoningContent ? { reasoning_content: outcome.reasoningContent } : host.providerId === "deepseek" ? { reasoning_content: "" } : {};
|
|
3456
|
+
extraMessages.push(
|
|
3457
|
+
{ role: "assistant", content, ...reasoningField },
|
|
3458
|
+
{ role: "user", content: buildStalledIntentNudge(stalledClause) }
|
|
3459
|
+
);
|
|
3460
|
+
continue;
|
|
3461
|
+
}
|
|
3411
3462
|
if (!content || content.trim() === "") {
|
|
3412
3463
|
const decision = emptyGuard.onEmpty(round < maxToolRounds - 1, outcome.finishReason);
|
|
3413
3464
|
host.onEmptyResponse?.(decision, { alreadyRendered, round });
|
|
@@ -3502,6 +3553,7 @@ async function runLeanAgentLoop(opts) {
|
|
|
3502
3553
|
let content = "";
|
|
3503
3554
|
let roundsUsed = 0;
|
|
3504
3555
|
let toolCallCount = 0;
|
|
3556
|
+
let stalledIntentNudges = 0;
|
|
3505
3557
|
try {
|
|
3506
3558
|
for (let round = 0; round < opts.maxRounds; round++) {
|
|
3507
3559
|
roundsUsed = round + 1;
|
|
@@ -3526,6 +3578,16 @@ async function runLeanAgentLoop(opts) {
|
|
|
3526
3578
|
usage.outputTokens += result.usage.outputTokens;
|
|
3527
3579
|
}
|
|
3528
3580
|
if ("content" in result) {
|
|
3581
|
+
const stalledClause = round < opts.maxRounds - 1 && stalledIntentNudges < MAX_STALLED_INTENT_NUDGES && opts.toolDefsForRound(round + 1).length > 0 ? detectStalledIntent(result.content) : null;
|
|
3582
|
+
if (stalledClause) {
|
|
3583
|
+
stalledIntentNudges++;
|
|
3584
|
+
opts.onStalledIntent?.(stalledClause, round);
|
|
3585
|
+
extraMessages.push(
|
|
3586
|
+
{ role: "assistant", content: result.content },
|
|
3587
|
+
{ role: "user", content: buildStalledIntentNudge(stalledClause) }
|
|
3588
|
+
);
|
|
3589
|
+
continue;
|
|
3590
|
+
}
|
|
3529
3591
|
content = result.content;
|
|
3530
3592
|
break;
|
|
3531
3593
|
}
|
|
@@ -12178,6 +12240,10 @@ async function runSubAgent(task, maxRounds, agentIndex, ctx, agent) {
|
|
|
12178
12240
|
}
|
|
12179
12241
|
},
|
|
12180
12242
|
onRoundsExhausted: () => `(Sub-agent reached maximum rounds (${maxRounds}) without producing a final response)`,
|
|
12243
|
+
onStalledIntent: (clause) => {
|
|
12244
|
+
process.stderr.write(`[spawn_agent] \u26A0 sub-agent announced an action but made no tool call ("${clause}") \u2014 asking it to actually do it...
|
|
12245
|
+
`);
|
|
12246
|
+
},
|
|
12181
12247
|
onError: (errMsg) => {
|
|
12182
12248
|
process.stderr.write(`
|
|
12183
12249
|
[spawn_agent] Error in sub-agent loop: ${errMsg}
|
|
@@ -17379,7 +17445,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
17379
17445
|
Cost: ${formatCost(cost)}` : "";
|
|
17380
17446
|
let memoryLine = "";
|
|
17381
17447
|
try {
|
|
17382
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
17448
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-WVNOXI7A.js");
|
|
17383
17449
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
17384
17450
|
if (pending > 0) memoryLine = `
|
|
17385
17451
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -18367,7 +18433,7 @@ async function handleTest(args, ctx) {
|
|
|
18367
18433
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
18368
18434
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
18369
18435
|
}
|
|
18370
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
18436
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-YOM4IWUG.js")).executeTests;
|
|
18371
18437
|
const report = await runTests(testArgs);
|
|
18372
18438
|
ctx.send({ type: "info", message: report });
|
|
18373
18439
|
} catch (err) {
|
|
@@ -18758,7 +18824,7 @@ async function handleMemory(args, ctx) {
|
|
|
18758
18824
|
}
|
|
18759
18825
|
if (intent.kind === "status") {
|
|
18760
18826
|
const { getChatIndexStatus: getChatIndexStatus2 } = await import("./chat-index-RLVLQRRC.js");
|
|
18761
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
18827
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-WVNOXI7A.js");
|
|
18762
18828
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
18763
18829
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
18764
18830
|
const view = buildMemoryStatusView({
|
|
@@ -18781,7 +18847,7 @@ async function handleMemory(args, ctx) {
|
|
|
18781
18847
|
return;
|
|
18782
18848
|
}
|
|
18783
18849
|
if (intent.kind === "recall") {
|
|
18784
|
-
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-
|
|
18850
|
+
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-WVNOXI7A.js");
|
|
18785
18851
|
const { searchChatMemory: searchChatMemory2 } = await import("./chat-index-RLVLQRRC.js");
|
|
18786
18852
|
const persistentHits = searchPersistentMemories2(configDir, intent.query, process.cwd(), 3);
|
|
18787
18853
|
if (persistentHits.length > 0) {
|
|
@@ -18902,7 +18968,7 @@ async function handleMemory(args, ctx) {
|
|
|
18902
18968
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
18903
18969
|
} else if (intent.kind === "export") {
|
|
18904
18970
|
if (args[1] === "md") {
|
|
18905
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
18971
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-WVNOXI7A.js");
|
|
18906
18972
|
ctx.send({
|
|
18907
18973
|
type: "export_data",
|
|
18908
18974
|
format: "md",
|
|
@@ -19907,7 +19973,7 @@ No tools match "${filter}".
|
|
|
19907
19973
|
const { join: join26 } = await import("path");
|
|
19908
19974
|
const { existsSync: existsSync32 } = await import("fs");
|
|
19909
19975
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-VNCA2GU7.js");
|
|
19910
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
19976
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-CDIYLDFD.js");
|
|
19911
19977
|
const { approveProject, hashMcpFile } = await import("./project-trust-6CJB5ZMX.js");
|
|
19912
19978
|
const cwd = process.cwd();
|
|
19913
19979
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -20826,7 +20892,7 @@ function createReviewCommands() {
|
|
|
20826
20892
|
usage: "/test [command|filter]",
|
|
20827
20893
|
async execute(args, ctx) {
|
|
20828
20894
|
try {
|
|
20829
|
-
const { executeTests } = await import("./run-tests-
|
|
20895
|
+
const { executeTests } = await import("./run-tests-YOM4IWUG.js");
|
|
20830
20896
|
const argStr = args.join(" ").trim();
|
|
20831
20897
|
let testArgs = {};
|
|
20832
20898
|
if (argStr) {
|
|
@@ -23549,6 +23615,9 @@ Too much tool output accumulated this turn. Your work so far is preserved.
|
|
|
23549
23615
|
const detail = phantomPaths.length > 0 ? ` (phantom files: ${phantomPaths.join(", ")})` : "";
|
|
23550
23616
|
this.send({ type: "info", message: `\u26A0 Hallucinated completion detected, forcing retry...${detail}` });
|
|
23551
23617
|
},
|
|
23618
|
+
onStalledIntent: ({ clause }) => {
|
|
23619
|
+
this.send({ type: "info", message: `\u26A0 AI announced an action but made no tool call ("${clause}") \u2014 asking it to actually do it...` });
|
|
23620
|
+
},
|
|
23552
23621
|
onEmptyResponse: (decision) => {
|
|
23553
23622
|
if (decision.action === "nudge") {
|
|
23554
23623
|
this.send({ type: "info", message: decision.displayMessage });
|
|
@@ -158,7 +158,7 @@ ${content}`);
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
161
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
161
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-64OZCQ5Q.js");
|
|
162
162
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
163
163
|
let interrupted = false;
|
|
164
164
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
setupProxy,
|
|
25
25
|
snapshotFile,
|
|
26
26
|
stripRoutingTags
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-MZJQE2XL.js";
|
|
28
28
|
import {
|
|
29
29
|
CostTracker,
|
|
30
30
|
getPricing,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
setMaxOutputCap,
|
|
48
48
|
spawnAgentContext,
|
|
49
49
|
undoStack
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-IJQPDFOE.js";
|
|
51
51
|
import "./chunk-HLWUDRBO.js";
|
|
52
52
|
import {
|
|
53
53
|
NO_THINKING,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
countPendingMemories,
|
|
61
61
|
detectStaleLegacyMarkdownEdit,
|
|
62
62
|
formatMemoryForPrompt
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-JX3A43W4.js";
|
|
64
64
|
import "./chunk-RWRZVQCB.js";
|
|
65
65
|
import "./chunk-B3MPYI4E.js";
|
|
66
66
|
import "./chunk-M6HLYG33.js";
|
|
@@ -81,22 +81,22 @@ import {
|
|
|
81
81
|
import {
|
|
82
82
|
loadContextFiles,
|
|
83
83
|
writeCrashLog
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-O2XAJUWR.js";
|
|
85
85
|
import {
|
|
86
86
|
getActivePluginAssets,
|
|
87
87
|
getPendingHookTrust,
|
|
88
88
|
installFlushOnExit,
|
|
89
89
|
mergePluginHooks,
|
|
90
90
|
runLifecycleHooks
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-MZEEY5JK.js";
|
|
92
92
|
import "./chunk-RS7SKYTS.js";
|
|
93
93
|
import {
|
|
94
94
|
ProviderRegistry,
|
|
95
95
|
listBuiltInProviderMetadata
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-G7WI7ZT6.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-HESWJPTY.js";
|
|
100
100
|
import {
|
|
101
101
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
102
102
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -114,7 +114,7 @@ import {
|
|
|
114
114
|
runAgentLoop,
|
|
115
115
|
stripToolCallReminder,
|
|
116
116
|
teeStreamErrorSummary
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-OTFPUZ6W.js";
|
|
118
118
|
import {
|
|
119
119
|
AuthError,
|
|
120
120
|
ProviderError,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
isInterrupted,
|
|
135
135
|
requestInterrupt,
|
|
136
136
|
resetInterrupt
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-WIZ4PSUF.js";
|
|
138
138
|
import {
|
|
139
139
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
140
140
|
AUTHOR,
|
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
SKILLS_DIR_NAME,
|
|
153
153
|
VERSION,
|
|
154
154
|
buildUserIdentityPrompt
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-CYCAVYC6.js";
|
|
156
156
|
import "./chunk-SXIJLSVF.js";
|
|
157
157
|
|
|
158
158
|
// src/index.ts
|
|
@@ -3381,6 +3381,14 @@ ${systemPromptVolatile}` : systemPrompt;
|
|
|
3381
3381
|
}
|
|
3382
3382
|
spinner.start(`Retrying... (round ${round + 2}/${maxToolRounds})`);
|
|
3383
3383
|
},
|
|
3384
|
+
onStalledIntent: ({ clause, round, alreadyRendered }) => {
|
|
3385
|
+
if (alreadyRendered) process.stdout.write("\n");
|
|
3386
|
+
process.stderr.write(
|
|
3387
|
+
`[${this.currentProvider}] \u26A0 AI announced an action but made no tool call ("${clause}") \u2014 asking it to actually do it...
|
|
3388
|
+
`
|
|
3389
|
+
);
|
|
3390
|
+
spinner.start(`Retrying... (round ${round + 2}/${maxToolRounds})`);
|
|
3391
|
+
},
|
|
3384
3392
|
onEmptyResponse: (decision, { alreadyRendered, round }) => {
|
|
3385
3393
|
spinner.stop();
|
|
3386
3394
|
if (alreadyRendered) process.stdout.write("\n");
|
|
@@ -4090,7 +4098,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
4090
4098
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
4091
4099
|
process.exit(1);
|
|
4092
4100
|
}
|
|
4093
|
-
const { startWebServer } = await import("./server-
|
|
4101
|
+
const { startWebServer } = await import("./server-D3QLDWN3.js");
|
|
4094
4102
|
await startWebServer({ port, host: options.host, externalOrigin: options.externalOrigin });
|
|
4095
4103
|
});
|
|
4096
4104
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -4257,11 +4265,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
4257
4265
|
console.log(footer + "\n");
|
|
4258
4266
|
});
|
|
4259
4267
|
program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
|
|
4260
|
-
const { runUsageCli } = await import("./usage-
|
|
4268
|
+
const { runUsageCli } = await import("./usage-LKQO36LR.js");
|
|
4261
4269
|
await runUsageCli(options);
|
|
4262
4270
|
});
|
|
4263
4271
|
program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
|
|
4264
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
4272
|
+
const { runDoctorCli } = await import("./doctor-cli-GWMRIUNC.js");
|
|
4265
4273
|
const argv = process.argv.slice(2);
|
|
4266
4274
|
await runDoctorCli({
|
|
4267
4275
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -4270,7 +4278,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
4270
4278
|
});
|
|
4271
4279
|
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) => {
|
|
4272
4280
|
try {
|
|
4273
|
-
const batch = await import("./batch-
|
|
4281
|
+
const batch = await import("./batch-UKRW5TVU.js");
|
|
4274
4282
|
switch (action) {
|
|
4275
4283
|
case "submit":
|
|
4276
4284
|
if (!arg) {
|
|
@@ -4313,7 +4321,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
4313
4321
|
}
|
|
4314
4322
|
});
|
|
4315
4323
|
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) => {
|
|
4316
|
-
const { startMcpServer } = await import("./server-
|
|
4324
|
+
const { startMcpServer } = await import("./server-4B6LZIPC.js");
|
|
4317
4325
|
await startMcpServer({
|
|
4318
4326
|
allowDestructive: !!options.allowDestructive,
|
|
4319
4327
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -4326,7 +4334,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
4326
4334
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
4327
4335
|
process.exit(1);
|
|
4328
4336
|
}
|
|
4329
|
-
const { runPrCli } = await import("./pr-
|
|
4337
|
+
const { runPrCli } = await import("./pr-Y2R6GOLU.js");
|
|
4330
4338
|
const result = await runPrCli({
|
|
4331
4339
|
action,
|
|
4332
4340
|
target,
|
|
@@ -4346,8 +4354,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
4346
4354
|
process.exit(result.exitCode);
|
|
4347
4355
|
});
|
|
4348
4356
|
program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
|
|
4349
|
-
const { runCi } = await import("./ci-
|
|
4350
|
-
const { formatCiResult } = await import("./ci-format-
|
|
4357
|
+
const { runCi } = await import("./ci-MWXUVEIK.js");
|
|
4358
|
+
const { formatCiResult } = await import("./ci-format-GW2U5N4O.js");
|
|
4351
4359
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
4352
4360
|
if (formats > 1) {
|
|
4353
4361
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -4506,7 +4514,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
4506
4514
|
config.get("customProviders"),
|
|
4507
4515
|
config.getConfigDir()
|
|
4508
4516
|
);
|
|
4509
|
-
const { startHub } = await import("./hub-
|
|
4517
|
+
const { startHub } = await import("./hub-7FOXQT4J.js");
|
|
4510
4518
|
await startHub(
|
|
4511
4519
|
{
|
|
4512
4520
|
topic: topic ?? "",
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JX3A43W4.js";
|
|
32
32
|
import "./chunk-3FEZSLGI.js";
|
|
33
33
|
import "./chunk-HOSJZMQS.js";
|
|
34
34
|
import "./chunk-BMLQPSHP.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-CYCAVYC6.js";
|
|
36
36
|
export {
|
|
37
37
|
addMemoryEntry,
|
|
38
38
|
backupMemoryStore,
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-RMC47NWH.js";
|
|
31
31
|
import "./chunk-FSC6KEWU.js";
|
|
32
32
|
import "./chunk-2XMUCC42.js";
|
|
33
33
|
import "./chunk-CGLYJRFA.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-SFP7IDC7.js";
|
|
35
35
|
export {
|
|
36
36
|
addMemoryEntry,
|
|
37
37
|
backupMemoryStore,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-FJ6W5XF3.js";
|
|
6
|
+
import "./chunk-Q2U6KM3P.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
} from "./chunk-6YZEZFX5.js";
|
|
15
15
|
import {
|
|
16
16
|
ProviderRegistry
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-G7WI7ZT6.js";
|
|
18
18
|
import {
|
|
19
19
|
ConfigManager
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-HESWJPTY.js";
|
|
21
|
+
import "./chunk-OTFPUZ6W.js";
|
|
22
22
|
import "./chunk-TU3L3PW7.js";
|
|
23
23
|
import "./chunk-BMLQPSHP.js";
|
|
24
24
|
import {
|
|
25
25
|
VERSION
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CYCAVYC6.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/pr.ts
|
|
29
29
|
import { execFileSync } from "child_process";
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
executeTests,
|
|
3
3
|
runTestProcess,
|
|
4
4
|
runTestsTool
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OPNL72PF.js";
|
|
6
6
|
import "./chunk-QMFMST2T.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-SFP7IDC7.js";
|
|
8
8
|
export {
|
|
9
9
|
executeTests,
|
|
10
10
|
runTestProcess,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IJQPDFOE.js";
|
|
5
5
|
import "./chunk-6JHACXB3.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-JX3A43W4.js";
|
|
7
7
|
import "./chunk-RWRZVQCB.js";
|
|
8
8
|
import "./chunk-B3MPYI4E.js";
|
|
9
9
|
import "./chunk-M6HLYG33.js";
|
|
@@ -14,20 +14,20 @@ import "./chunk-JL44HGZC.js";
|
|
|
14
14
|
import "./chunk-3FEZSLGI.js";
|
|
15
15
|
import {
|
|
16
16
|
runTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MZEEY5JK.js";
|
|
18
18
|
import "./chunk-RS7SKYTS.js";
|
|
19
19
|
import {
|
|
20
20
|
getDangerLevel,
|
|
21
21
|
schemaToJsonSchema
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OTFPUZ6W.js";
|
|
23
23
|
import "./chunk-TU3L3PW7.js";
|
|
24
24
|
import "./chunk-HOSJZMQS.js";
|
|
25
25
|
import "./chunk-BMLQPSHP.js";
|
|
26
26
|
import "./chunk-JJFJWD35.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-WIZ4PSUF.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CYCAVYC6.js";
|
|
31
31
|
import "./chunk-SXIJLSVF.js";
|
|
32
32
|
|
|
33
33
|
// src/mcp/server.ts
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
skillHistoryNote,
|
|
87
87
|
snapshotFile,
|
|
88
88
|
stripRoutingTags
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-MZJQE2XL.js";
|
|
90
90
|
import {
|
|
91
91
|
CNY_PER_USD,
|
|
92
92
|
CostTracker,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
spawnAgentContext,
|
|
131
131
|
truncateOutput,
|
|
132
132
|
undoStack
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-IJQPDFOE.js";
|
|
134
134
|
import {
|
|
135
135
|
buildReviewPrompt,
|
|
136
136
|
buildSecurityReviewPrompt
|
|
@@ -157,7 +157,7 @@ import {
|
|
|
157
157
|
restoreMemoryEntries,
|
|
158
158
|
updateMemoryApproval,
|
|
159
159
|
updateMemoryEntry
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-JX3A43W4.js";
|
|
161
161
|
import "./chunk-RWRZVQCB.js";
|
|
162
162
|
import "./chunk-B3MPYI4E.js";
|
|
163
163
|
import "./chunk-M6HLYG33.js";
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
buildDoctorReport,
|
|
177
177
|
formatDoctorReport,
|
|
178
178
|
loadContextFiles
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-O2XAJUWR.js";
|
|
180
180
|
import {
|
|
181
181
|
describePlugin,
|
|
182
182
|
getActivePluginAssets,
|
|
@@ -191,14 +191,14 @@ import {
|
|
|
191
191
|
runTool,
|
|
192
192
|
setPluginEnabled,
|
|
193
193
|
trustPlugin
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-MZEEY5JK.js";
|
|
195
195
|
import "./chunk-RS7SKYTS.js";
|
|
196
196
|
import {
|
|
197
197
|
ProviderRegistry
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-G7WI7ZT6.js";
|
|
199
199
|
import {
|
|
200
200
|
ConfigManager
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-HESWJPTY.js";
|
|
202
202
|
import {
|
|
203
203
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
204
204
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -214,7 +214,7 @@ import {
|
|
|
214
214
|
runAgentLoop,
|
|
215
215
|
stripToolCallReminder,
|
|
216
216
|
teeStreamErrorSummary
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-OTFPUZ6W.js";
|
|
218
218
|
import "./chunk-TU3L3PW7.js";
|
|
219
219
|
import {
|
|
220
220
|
formatGitContextForPrompt,
|
|
@@ -231,7 +231,7 @@ import {
|
|
|
231
231
|
import {
|
|
232
232
|
assertReadablePath
|
|
233
233
|
} from "./chunk-JJFJWD35.js";
|
|
234
|
-
import "./chunk-
|
|
234
|
+
import "./chunk-WIZ4PSUF.js";
|
|
235
235
|
import {
|
|
236
236
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
237
237
|
AUTHOR,
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
SKILLS_DIR_NAME,
|
|
248
248
|
VERSION,
|
|
249
249
|
buildUserIdentityPrompt
|
|
250
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-CYCAVYC6.js";
|
|
251
251
|
import {
|
|
252
252
|
runWithExecutionContext,
|
|
253
253
|
runWithSessionKey
|
|
@@ -978,7 +978,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
978
978
|
Cost: ${formatCost(cost)}` : "";
|
|
979
979
|
let memoryLine = "";
|
|
980
980
|
try {
|
|
981
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
981
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-NBVPKMKO.js");
|
|
982
982
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
983
983
|
if (pending > 0) memoryLine = `
|
|
984
984
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -1907,7 +1907,7 @@ async function handleTest(args, ctx) {
|
|
|
1907
1907
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
1908
1908
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
1909
1909
|
}
|
|
1910
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
1910
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-MWM5AMGM.js")).executeTests;
|
|
1911
1911
|
const report = await runTests(testArgs);
|
|
1912
1912
|
ctx.send({ type: "info", message: report });
|
|
1913
1913
|
} catch (err) {
|
|
@@ -2183,7 +2183,7 @@ async function handleMemory(args, ctx) {
|
|
|
2183
2183
|
}
|
|
2184
2184
|
if (intent.kind === "status") {
|
|
2185
2185
|
const { getChatIndexStatus } = await import("./chat-index-7CLR4CBG.js");
|
|
2186
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
2186
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-NBVPKMKO.js");
|
|
2187
2187
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
2188
2188
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
2189
2189
|
const view = buildMemoryStatusView({
|
|
@@ -2206,7 +2206,7 @@ async function handleMemory(args, ctx) {
|
|
|
2206
2206
|
return;
|
|
2207
2207
|
}
|
|
2208
2208
|
if (intent.kind === "recall") {
|
|
2209
|
-
const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-
|
|
2209
|
+
const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-NBVPKMKO.js");
|
|
2210
2210
|
const { searchChatMemory } = await import("./chat-index-7CLR4CBG.js");
|
|
2211
2211
|
const persistentHits = searchPersistentMemories(configDir, intent.query, process.cwd(), 3);
|
|
2212
2212
|
if (persistentHits.length > 0) {
|
|
@@ -2327,7 +2327,7 @@ async function handleMemory(args, ctx) {
|
|
|
2327
2327
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
2328
2328
|
} else if (intent.kind === "export") {
|
|
2329
2329
|
if (args[1] === "md") {
|
|
2330
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
2330
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-NBVPKMKO.js");
|
|
2331
2331
|
ctx.send({
|
|
2332
2332
|
type: "export_data",
|
|
2333
2333
|
format: "md",
|
|
@@ -3557,6 +3557,9 @@ Too much tool output accumulated this turn. Your work so far is preserved.
|
|
|
3557
3557
|
const detail = phantomPaths.length > 0 ? ` (phantom files: ${phantomPaths.join(", ")})` : "";
|
|
3558
3558
|
this.send({ type: "info", message: `\u26A0 Hallucinated completion detected, forcing retry...${detail}` });
|
|
3559
3559
|
},
|
|
3560
|
+
onStalledIntent: ({ clause }) => {
|
|
3561
|
+
this.send({ type: "info", message: `\u26A0 AI announced an action but made no tool call ("${clause}") \u2014 asking it to actually do it...` });
|
|
3562
|
+
},
|
|
3560
3563
|
onEmptyResponse: (decision) => {
|
|
3561
3564
|
if (decision.action === "nudge") {
|
|
3562
3565
|
this.send({ type: "info", message: decision.displayMessage });
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
isToolCapableProvider,
|
|
6
6
|
truncateOutput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IJQPDFOE.js";
|
|
8
8
|
import "./chunk-6JHACXB3.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-JX3A43W4.js";
|
|
10
10
|
import "./chunk-RWRZVQCB.js";
|
|
11
11
|
import "./chunk-B3MPYI4E.js";
|
|
12
12
|
import "./chunk-M6HLYG33.js";
|
|
@@ -17,22 +17,22 @@ import "./chunk-JL44HGZC.js";
|
|
|
17
17
|
import "./chunk-3FEZSLGI.js";
|
|
18
18
|
import {
|
|
19
19
|
runTool
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MZEEY5JK.js";
|
|
21
21
|
import "./chunk-RS7SKYTS.js";
|
|
22
22
|
import {
|
|
23
23
|
getDangerLevel,
|
|
24
24
|
runLeanAgentLoop
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-OTFPUZ6W.js";
|
|
26
26
|
import "./chunk-TU3L3PW7.js";
|
|
27
27
|
import "./chunk-HOSJZMQS.js";
|
|
28
28
|
import {
|
|
29
29
|
atomicWriteFileSync
|
|
30
30
|
} from "./chunk-BMLQPSHP.js";
|
|
31
31
|
import "./chunk-JJFJWD35.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-WIZ4PSUF.js";
|
|
33
33
|
import {
|
|
34
34
|
SUBAGENT_ALLOWED_TOOLS
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CYCAVYC6.js";
|
|
36
36
|
import "./chunk-SXIJLSVF.js";
|
|
37
37
|
|
|
38
38
|
// src/hub/task-orchestrator.ts
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import "./chunk-RS7SKYTS.js";
|
|
10
10
|
import {
|
|
11
11
|
ConfigManager
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HESWJPTY.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-BMLQPSHP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-CYCAVYC6.js";
|
|
16
16
|
|
|
17
17
|
// src/cli/usage.ts
|
|
18
18
|
function classifyRowCost(row) {
|