jinzd-ai-cli 0.4.244 → 0.4.245
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-GLB7ES6K.js → batch-MRP2KUFC.js} +2 -2
- package/dist/{chunk-BKTCOL5D.js → chunk-4UIVLJAP.js} +1 -1
- package/dist/{chunk-WF7FD7WS.js → chunk-A4MLBB4H.js} +59 -48
- package/dist/{chunk-BO5UU3TY.js → chunk-H3PEWUFY.js} +1 -1
- package/dist/{chunk-6IAVHU3I.js → chunk-JM2DX7OY.js} +1 -1
- package/dist/{chunk-B7KTFHK2.js → chunk-KEAUVMKS.js} +1 -1
- package/dist/{chunk-P6AUULT2.js → chunk-M7BQVFMF.js} +3 -3
- package/dist/{chunk-M7XY5AK5.js → chunk-O357YW7E.js} +1 -1
- package/dist/{chunk-ZQGCX4QD.js → chunk-UM2OVVLP.js} +1 -1
- package/dist/{chunk-HN4FU37T.js → chunk-WKXADWWK.js} +3 -3
- package/dist/{chunk-MCC5BEZG.js → chunk-WWHTQHIN.js} +1 -1
- package/dist/{chunk-ACU6T7B3.js → chunk-XH4JPEIZ.js} +1 -1
- package/dist/{chunk-OYFDGRYD.js → chunk-XYXVTHOB.js} +2 -2
- package/dist/{chunk-XZI4ULXF.js → chunk-Y6KDBGY7.js} +1 -1
- package/dist/{ci-V7RGDIER.js → ci-Q3LQQT7K.js} +4 -4
- package/dist/{ci-format-HSUEHAM2.js → ci-format-L2WPVFFC.js} +2 -2
- package/dist/{constants-OQ6FVQ23.js → constants-DTPJHB6W.js} +1 -1
- package/dist/{doctor-cli-LABZF3XG.js → doctor-cli-AEVPW6VY.js} +4 -4
- package/dist/electron-server.js +67 -56
- package/dist/{hub-RTFICY6M.js → hub-PPNKIMPG.js} +1 -1
- package/dist/index.js +19 -19
- package/dist/{persistent-memory-OWXDBSZY.js → persistent-memory-YLB2ZSB2.js} +2 -2
- package/dist/{persistent-memory-P6LU5KDG.js → persistent-memory-ZIC4UA2W.js} +2 -2
- package/dist/{pr-HXJ6ML6M.js → pr-Z3NX3SG5.js} +4 -4
- package/dist/{run-tests-EFWAH43I.js → run-tests-42DWRQAR.js} +2 -2
- package/dist/{run-tests-XJ44FWIK.js → run-tests-WW6VCT23.js} +2 -2
- package/dist/{server-B6WJWV3T.js → server-KX6WKW6V.js} +5 -5
- package/dist/{server-6OPGWJ7S.js → server-NNDBF3SH.js} +11 -11
- package/dist/{task-orchestrator-KHJYQXWU.js → task-orchestrator-DEDL6YAZ.js} +5 -5
- package/dist/{usage-NW2ZXN6N.js → usage-QAMWSX52.js} +2 -2
- 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-XH4JPEIZ.js";
|
|
5
5
|
import "./chunk-5ULLIOVC.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-KEAUVMKS.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFileSync
|
|
9
9
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
searchPersistentMemories,
|
|
8
8
|
touchMemoryReferences,
|
|
9
9
|
updateMemoryEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4UIVLJAP.js";
|
|
11
11
|
import {
|
|
12
12
|
indexProject
|
|
13
13
|
} from "./chunk-K3CF65QH.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
runHook,
|
|
24
24
|
runLifecycleHooks,
|
|
25
25
|
runTool
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-H3PEWUFY.js";
|
|
27
27
|
import {
|
|
28
28
|
getDangerLevel,
|
|
29
29
|
isFileWriteTool,
|
|
@@ -39,14 +39,14 @@ import {
|
|
|
39
39
|
} from "./chunk-4BKXL7SM.js";
|
|
40
40
|
import {
|
|
41
41
|
runTestsTool
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-JM2DX7OY.js";
|
|
43
43
|
import {
|
|
44
44
|
CONFIG_DIR_NAME,
|
|
45
45
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
46
46
|
SUBAGENT_ALLOWED_TOOLS,
|
|
47
47
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
48
48
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-KEAUVMKS.js";
|
|
50
50
|
import {
|
|
51
51
|
loadChatIndex,
|
|
52
52
|
searchChatMemory
|
|
@@ -56,11 +56,12 @@ import {
|
|
|
56
56
|
} from "./chunk-IW3Q7AE5.js";
|
|
57
57
|
|
|
58
58
|
// src/tools/shell-pool.ts
|
|
59
|
-
import { spawn } from "child_process";
|
|
59
|
+
import { spawn as spawn2 } from "child_process";
|
|
60
60
|
import { platform as platform2 } from "os";
|
|
61
61
|
|
|
62
62
|
// src/tools/win-shell.ts
|
|
63
63
|
import { platform } from "os";
|
|
64
|
+
import { spawn } from "child_process";
|
|
64
65
|
var IS_WINDOWS = platform() === "win32";
|
|
65
66
|
var WIN_UTF8_PREAMBLE = "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = [System.Text.Encoding]::UTF8; ";
|
|
66
67
|
function shellInvocation(command) {
|
|
@@ -81,6 +82,47 @@ function decodeWindowsBuffer(buf) {
|
|
|
81
82
|
return utf8;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
85
|
+
function killProcessTree(proc) {
|
|
86
|
+
if (proc.killed || proc.exitCode !== null) return;
|
|
87
|
+
if (IS_WINDOWS && proc.pid) {
|
|
88
|
+
try {
|
|
89
|
+
const tk = spawn("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
|
|
90
|
+
windowsHide: true,
|
|
91
|
+
stdio: "ignore"
|
|
92
|
+
});
|
|
93
|
+
tk.on("exit", () => {
|
|
94
|
+
try {
|
|
95
|
+
proc.kill();
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
tk.on("error", () => {
|
|
100
|
+
try {
|
|
101
|
+
proc.kill();
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
} catch {
|
|
106
|
+
try {
|
|
107
|
+
proc.kill();
|
|
108
|
+
} catch {
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
proc.kill("SIGTERM");
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
if (!proc.killed && proc.exitCode === null) {
|
|
119
|
+
try {
|
|
120
|
+
proc.kill("SIGKILL");
|
|
121
|
+
} catch {
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, 500).unref();
|
|
125
|
+
}
|
|
84
126
|
|
|
85
127
|
// src/tools/shell-pool.ts
|
|
86
128
|
var IS_WINDOWS2 = platform2() === "win32";
|
|
@@ -90,7 +132,7 @@ var IDLE_EVICT_MS = 5 * 6e4;
|
|
|
90
132
|
var evictionTimer = null;
|
|
91
133
|
function spawnShell(cwd) {
|
|
92
134
|
const shellArgs = IS_WINDOWS2 ? ["-NoProfile", "-NonInteractive", "-Command", "-"] : ["-s"];
|
|
93
|
-
const proc =
|
|
135
|
+
const proc = spawn2(SHELL, shellArgs, {
|
|
94
136
|
cwd,
|
|
95
137
|
windowsHide: true,
|
|
96
138
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -171,10 +213,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
171
213
|
stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
|
|
172
214
|
cleanup();
|
|
173
215
|
resolve7({ stdout, stderr, exitCode: null, timedOut, aborted });
|
|
174
|
-
|
|
175
|
-
proc.kill();
|
|
176
|
-
} catch {
|
|
177
|
-
}
|
|
216
|
+
killProcessTree(proc);
|
|
178
217
|
pool.delete(sessionKey);
|
|
179
218
|
}, timeout);
|
|
180
219
|
const onAbort = () => {
|
|
@@ -184,10 +223,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
184
223
|
cleanup();
|
|
185
224
|
stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
|
|
186
225
|
resolve7({ stdout, stderr, exitCode: null, timedOut, aborted });
|
|
187
|
-
|
|
188
|
-
proc.kill();
|
|
189
|
-
} catch {
|
|
190
|
-
}
|
|
226
|
+
killProcessTree(proc);
|
|
191
227
|
pool.delete(sessionKey);
|
|
192
228
|
};
|
|
193
229
|
if (abortSignal?.aborted) {
|
|
@@ -277,7 +313,7 @@ function cleanupAllSessions() {
|
|
|
277
313
|
}
|
|
278
314
|
|
|
279
315
|
// src/tools/builtin/bash.ts
|
|
280
|
-
import { spawn as
|
|
316
|
+
import { spawn as spawn3 } from "child_process";
|
|
281
317
|
import { existsSync as existsSync2, readdirSync, statSync } from "fs";
|
|
282
318
|
import { platform as platform3 } from "os";
|
|
283
319
|
import { resolve } from "path";
|
|
@@ -660,6 +696,7 @@ function formatTimeoutMessage(timeout, maxTimeout) {
|
|
|
660
696
|
" 2. Use a non-recursive / narrower alternative (e.g. 'Get-ChildItem -File' without -Recurse, or limit depth with -Depth 1)",
|
|
661
697
|
" 3. Split the work into smaller batches (process subdirectories one at a time)",
|
|
662
698
|
" 4. For size/count queries, use '(Get-ChildItem X).Count' per directory instead of one giant pipeline",
|
|
699
|
+
" 5. If this was 'git add'/'git commit' in a fresh project: a huge directory (node_modules, build output) is likely being staged \u2014 write a .gitignore excluding it FIRST, then retry. Also check for a stale '.git/index.lock' left behind by the killed git process and delete it if present.",
|
|
663
700
|
"",
|
|
664
701
|
"[Do NOT retry the identical command \u2014 it will time out again.]"
|
|
665
702
|
].join(String.fromCharCode(10));
|
|
@@ -831,7 +868,7 @@ function pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, cwd) {
|
|
|
831
868
|
function runShell(command, opts) {
|
|
832
869
|
return new Promise((resolvePromise) => {
|
|
833
870
|
const shellArgs = IS_WINDOWS3 ? ["-NoProfile", "-NonInteractive", "-Command", WIN_UTF8_PREAMBLE + command] : ["-c", command];
|
|
834
|
-
const child =
|
|
871
|
+
const child = spawn3(SHELL2, shellArgs, {
|
|
835
872
|
cwd: opts.cwd,
|
|
836
873
|
env: opts.env,
|
|
837
874
|
windowsHide: true,
|
|
@@ -892,33 +929,7 @@ function runShell(command, opts) {
|
|
|
892
929
|
});
|
|
893
930
|
}
|
|
894
931
|
function killChild(child) {
|
|
895
|
-
|
|
896
|
-
if (IS_WINDOWS3 && child.pid) {
|
|
897
|
-
try {
|
|
898
|
-
spawn2("taskkill", ["/PID", String(child.pid), "/T", "/F"], {
|
|
899
|
-
windowsHide: true,
|
|
900
|
-
stdio: "ignore"
|
|
901
|
-
});
|
|
902
|
-
} catch {
|
|
903
|
-
}
|
|
904
|
-
try {
|
|
905
|
-
child.kill();
|
|
906
|
-
} catch {
|
|
907
|
-
}
|
|
908
|
-
return;
|
|
909
|
-
}
|
|
910
|
-
try {
|
|
911
|
-
child.kill("SIGTERM");
|
|
912
|
-
} catch {
|
|
913
|
-
}
|
|
914
|
-
setTimeout(() => {
|
|
915
|
-
if (!child.killed && child.exitCode === null) {
|
|
916
|
-
try {
|
|
917
|
-
child.kill("SIGKILL");
|
|
918
|
-
} catch {
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
}, 500).unref();
|
|
932
|
+
killProcessTree(child);
|
|
922
933
|
}
|
|
923
934
|
function updateCwdFromCommand(command, baseCwd) {
|
|
924
935
|
const cdMatches = [...command.matchAll(/(?:^|[;&|])\s*cd\s+(['"]?)([^\s;&|'"]+)\1/g)];
|
|
@@ -3925,7 +3936,7 @@ function collectMatchingFiles(dirPath, rootPath, regex, results, maxResults) {
|
|
|
3925
3936
|
}
|
|
3926
3937
|
|
|
3927
3938
|
// src/tools/builtin/run-interactive.ts
|
|
3928
|
-
import { spawn as
|
|
3939
|
+
import { spawn as spawn4 } from "child_process";
|
|
3929
3940
|
import { platform as platform4 } from "os";
|
|
3930
3941
|
var IS_WINDOWS4 = platform4() === "win32";
|
|
3931
3942
|
var runInteractiveTool = {
|
|
@@ -3989,7 +4000,7 @@ var runInteractiveTool = {
|
|
|
3989
4000
|
};
|
|
3990
4001
|
const prefixWarnings = [argsTypeWarning, stdinTypeWarning].filter(Boolean).join("");
|
|
3991
4002
|
return new Promise((resolve7) => {
|
|
3992
|
-
const child =
|
|
4003
|
+
const child = spawn4(executable, cmdArgs.map(String), {
|
|
3993
4004
|
cwd: process.cwd(),
|
|
3994
4005
|
env,
|
|
3995
4006
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -5712,7 +5723,7 @@ var spawnAgentTool = {
|
|
|
5712
5723
|
};
|
|
5713
5724
|
|
|
5714
5725
|
// src/tools/builtin/task-manager.ts
|
|
5715
|
-
import { spawn as
|
|
5726
|
+
import { spawn as spawn5 } from "child_process";
|
|
5716
5727
|
import { randomUUID } from "crypto";
|
|
5717
5728
|
import { platform as platform5 } from "os";
|
|
5718
5729
|
var MAX_OUTPUT_CHARS = 1e4;
|
|
@@ -5748,7 +5759,7 @@ function createTask(command, description) {
|
|
|
5748
5759
|
}
|
|
5749
5760
|
const id = randomUUID().slice(0, 8);
|
|
5750
5761
|
const { shell, args } = shellInvocation(command);
|
|
5751
|
-
const proc =
|
|
5762
|
+
const proc = spawn5(shell, args, {
|
|
5752
5763
|
stdio: ["ignore", "pipe", "pipe"],
|
|
5753
5764
|
detached: false,
|
|
5754
5765
|
env: { ...process.env, PYTHONUTF8: "1", PYTHONIOENCODING: "utf-8" }
|
|
@@ -5800,7 +5811,7 @@ function stopTask(id) {
|
|
|
5800
5811
|
const proc = task.process;
|
|
5801
5812
|
if (platform5() === "win32" && proc.pid) {
|
|
5802
5813
|
try {
|
|
5803
|
-
|
|
5814
|
+
spawn5("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
|
|
5804
5815
|
windowsHide: true,
|
|
5805
5816
|
stdio: "ignore"
|
|
5806
5817
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y6KDBGY7.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
} from "./chunk-QYQI7ZWK.js";
|
|
14
14
|
import {
|
|
15
15
|
ConfigManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XH4JPEIZ.js";
|
|
17
17
|
import {
|
|
18
18
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KEAUVMKS.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/ci.ts
|
|
22
22
|
import { execFileSync } from "child_process";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-QYQI7ZWK.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XH4JPEIZ.js";
|
|
8
8
|
import {
|
|
9
9
|
getActivePluginAssets,
|
|
10
10
|
getPendingHookTrust,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
listHooks,
|
|
15
15
|
listInstalledPlugins,
|
|
16
16
|
resetStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-H3PEWUFY.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-KEAUVMKS.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A4MLBB4H.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-KEAUVMKS.js";
|
|
15
15
|
import {
|
|
16
16
|
atomicWriteFileSync
|
|
17
17
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-M7BQVFMF.js";
|
|
7
|
+
import "./chunk-Y6KDBGY7.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-QYQI7ZWK.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-XH4JPEIZ.js";
|
|
11
11
|
import "./chunk-O3XSFPYH.js";
|
|
12
12
|
import "./chunk-5ULLIOVC.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-KEAUVMKS.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
export {
|
|
16
16
|
CI_COMMENT_MARKER,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WKXADWWK.js";
|
|
6
6
|
import "./chunk-QYQI7ZWK.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-XH4JPEIZ.js";
|
|
8
|
+
import "./chunk-H3PEWUFY.js";
|
|
9
9
|
import "./chunk-O3XSFPYH.js";
|
|
10
10
|
import "./chunk-5ULLIOVC.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-KEAUVMKS.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|
package/dist/electron-server.js
CHANGED
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
touchMemoryReferences,
|
|
35
35
|
updateMemoryApproval,
|
|
36
36
|
updateMemoryEntry
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-O357YW7E.js";
|
|
38
38
|
import {
|
|
39
39
|
redactJson,
|
|
40
40
|
scanString
|
|
41
41
|
} from "./chunk-YVTASHS5.js";
|
|
42
42
|
import {
|
|
43
43
|
runTestsTool
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-WWHTQHIN.js";
|
|
45
45
|
import {
|
|
46
46
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
47
47
|
APP_NAME,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
74
74
|
VERSION,
|
|
75
75
|
buildUserIdentityPrompt
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-UM2OVVLP.js";
|
|
77
77
|
import {
|
|
78
78
|
hasSemanticIndex,
|
|
79
79
|
semanticSearch
|
|
@@ -4732,7 +4732,7 @@ var SessionManager = class {
|
|
|
4732
4732
|
};
|
|
4733
4733
|
|
|
4734
4734
|
// src/tools/builtin/bash.ts
|
|
4735
|
-
import { spawn as
|
|
4735
|
+
import { spawn as spawn3 } from "child_process";
|
|
4736
4736
|
import { existsSync as existsSync5, readdirSync as readdirSync2, statSync as statSync2 } from "fs";
|
|
4737
4737
|
import { platform as platform3 } from "os";
|
|
4738
4738
|
import { resolve } from "path";
|
|
@@ -4874,6 +4874,7 @@ function runWithSessionKey(sessionKey, fn) {
|
|
|
4874
4874
|
|
|
4875
4875
|
// src/tools/win-shell.ts
|
|
4876
4876
|
import { platform } from "os";
|
|
4877
|
+
import { spawn } from "child_process";
|
|
4877
4878
|
var IS_WINDOWS = platform() === "win32";
|
|
4878
4879
|
var WIN_UTF8_PREAMBLE = "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = [System.Text.Encoding]::UTF8; ";
|
|
4879
4880
|
function shellInvocation(command) {
|
|
@@ -4894,9 +4895,50 @@ function decodeWindowsBuffer(buf) {
|
|
|
4894
4895
|
return utf8;
|
|
4895
4896
|
}
|
|
4896
4897
|
}
|
|
4898
|
+
function killProcessTree(proc) {
|
|
4899
|
+
if (proc.killed || proc.exitCode !== null) return;
|
|
4900
|
+
if (IS_WINDOWS && proc.pid) {
|
|
4901
|
+
try {
|
|
4902
|
+
const tk = spawn("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
|
|
4903
|
+
windowsHide: true,
|
|
4904
|
+
stdio: "ignore"
|
|
4905
|
+
});
|
|
4906
|
+
tk.on("exit", () => {
|
|
4907
|
+
try {
|
|
4908
|
+
proc.kill();
|
|
4909
|
+
} catch {
|
|
4910
|
+
}
|
|
4911
|
+
});
|
|
4912
|
+
tk.on("error", () => {
|
|
4913
|
+
try {
|
|
4914
|
+
proc.kill();
|
|
4915
|
+
} catch {
|
|
4916
|
+
}
|
|
4917
|
+
});
|
|
4918
|
+
} catch {
|
|
4919
|
+
try {
|
|
4920
|
+
proc.kill();
|
|
4921
|
+
} catch {
|
|
4922
|
+
}
|
|
4923
|
+
}
|
|
4924
|
+
return;
|
|
4925
|
+
}
|
|
4926
|
+
try {
|
|
4927
|
+
proc.kill("SIGTERM");
|
|
4928
|
+
} catch {
|
|
4929
|
+
}
|
|
4930
|
+
setTimeout(() => {
|
|
4931
|
+
if (!proc.killed && proc.exitCode === null) {
|
|
4932
|
+
try {
|
|
4933
|
+
proc.kill("SIGKILL");
|
|
4934
|
+
} catch {
|
|
4935
|
+
}
|
|
4936
|
+
}
|
|
4937
|
+
}, 500).unref();
|
|
4938
|
+
}
|
|
4897
4939
|
|
|
4898
4940
|
// src/tools/shell-pool.ts
|
|
4899
|
-
import { spawn } from "child_process";
|
|
4941
|
+
import { spawn as spawn2 } from "child_process";
|
|
4900
4942
|
import { platform as platform2 } from "os";
|
|
4901
4943
|
var IS_WINDOWS2 = platform2() === "win32";
|
|
4902
4944
|
var SHELL = IS_WINDOWS2 ? "powershell.exe" : process.env["SHELL"] ?? "/bin/bash";
|
|
@@ -4905,7 +4947,7 @@ var IDLE_EVICT_MS = 5 * 6e4;
|
|
|
4905
4947
|
var evictionTimer = null;
|
|
4906
4948
|
function spawnShell(cwd) {
|
|
4907
4949
|
const shellArgs = IS_WINDOWS2 ? ["-NoProfile", "-NonInteractive", "-Command", "-"] : ["-s"];
|
|
4908
|
-
const proc =
|
|
4950
|
+
const proc = spawn2(SHELL, shellArgs, {
|
|
4909
4951
|
cwd,
|
|
4910
4952
|
windowsHide: true,
|
|
4911
4953
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -4986,10 +5028,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
4986
5028
|
stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
|
|
4987
5029
|
cleanup();
|
|
4988
5030
|
resolve13({ stdout, stderr, exitCode: null, timedOut, aborted });
|
|
4989
|
-
|
|
4990
|
-
proc.kill();
|
|
4991
|
-
} catch {
|
|
4992
|
-
}
|
|
5031
|
+
killProcessTree(proc);
|
|
4993
5032
|
pool.delete(sessionKey);
|
|
4994
5033
|
}, timeout);
|
|
4995
5034
|
const onAbort = () => {
|
|
@@ -4999,10 +5038,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
4999
5038
|
cleanup();
|
|
5000
5039
|
stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
|
|
5001
5040
|
resolve13({ stdout, stderr, exitCode: null, timedOut, aborted });
|
|
5002
|
-
|
|
5003
|
-
proc.kill();
|
|
5004
|
-
} catch {
|
|
5005
|
-
}
|
|
5041
|
+
killProcessTree(proc);
|
|
5006
5042
|
pool.delete(sessionKey);
|
|
5007
5043
|
};
|
|
5008
5044
|
if (abortSignal?.aborted) {
|
|
@@ -5307,6 +5343,7 @@ function formatTimeoutMessage(timeout, maxTimeout) {
|
|
|
5307
5343
|
" 2. Use a non-recursive / narrower alternative (e.g. 'Get-ChildItem -File' without -Recurse, or limit depth with -Depth 1)",
|
|
5308
5344
|
" 3. Split the work into smaller batches (process subdirectories one at a time)",
|
|
5309
5345
|
" 4. For size/count queries, use '(Get-ChildItem X).Count' per directory instead of one giant pipeline",
|
|
5346
|
+
" 5. If this was 'git add'/'git commit' in a fresh project: a huge directory (node_modules, build output) is likely being staged \u2014 write a .gitignore excluding it FIRST, then retry. Also check for a stale '.git/index.lock' left behind by the killed git process and delete it if present.",
|
|
5310
5347
|
"",
|
|
5311
5348
|
"[Do NOT retry the identical command \u2014 it will time out again.]"
|
|
5312
5349
|
].join(String.fromCharCode(10));
|
|
@@ -5478,7 +5515,7 @@ function pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, cwd) {
|
|
|
5478
5515
|
function runShell(command, opts) {
|
|
5479
5516
|
return new Promise((resolvePromise) => {
|
|
5480
5517
|
const shellArgs = IS_WINDOWS3 ? ["-NoProfile", "-NonInteractive", "-Command", WIN_UTF8_PREAMBLE + command] : ["-c", command];
|
|
5481
|
-
const child =
|
|
5518
|
+
const child = spawn3(SHELL2, shellArgs, {
|
|
5482
5519
|
cwd: opts.cwd,
|
|
5483
5520
|
env: opts.env,
|
|
5484
5521
|
windowsHide: true,
|
|
@@ -5539,33 +5576,7 @@ function runShell(command, opts) {
|
|
|
5539
5576
|
});
|
|
5540
5577
|
}
|
|
5541
5578
|
function killChild(child) {
|
|
5542
|
-
|
|
5543
|
-
if (IS_WINDOWS3 && child.pid) {
|
|
5544
|
-
try {
|
|
5545
|
-
spawn2("taskkill", ["/PID", String(child.pid), "/T", "/F"], {
|
|
5546
|
-
windowsHide: true,
|
|
5547
|
-
stdio: "ignore"
|
|
5548
|
-
});
|
|
5549
|
-
} catch {
|
|
5550
|
-
}
|
|
5551
|
-
try {
|
|
5552
|
-
child.kill();
|
|
5553
|
-
} catch {
|
|
5554
|
-
}
|
|
5555
|
-
return;
|
|
5556
|
-
}
|
|
5557
|
-
try {
|
|
5558
|
-
child.kill("SIGTERM");
|
|
5559
|
-
} catch {
|
|
5560
|
-
}
|
|
5561
|
-
setTimeout(() => {
|
|
5562
|
-
if (!child.killed && child.exitCode === null) {
|
|
5563
|
-
try {
|
|
5564
|
-
child.kill("SIGKILL");
|
|
5565
|
-
} catch {
|
|
5566
|
-
}
|
|
5567
|
-
}
|
|
5568
|
-
}, 500).unref();
|
|
5579
|
+
killProcessTree(child);
|
|
5569
5580
|
}
|
|
5570
5581
|
function updateCwdFromCommand(command, baseCwd) {
|
|
5571
5582
|
const cdMatches = [...command.matchAll(/(?:^|[;&|])\s*cd\s+(['"]?)([^\s;&|'"]+)\1/g)];
|
|
@@ -8797,7 +8808,7 @@ function collectMatchingFiles(dirPath, rootPath, regex, results, maxResults) {
|
|
|
8797
8808
|
}
|
|
8798
8809
|
|
|
8799
8810
|
// src/tools/builtin/run-interactive.ts
|
|
8800
|
-
import { spawn as
|
|
8811
|
+
import { spawn as spawn4 } from "child_process";
|
|
8801
8812
|
import { platform as platform4 } from "os";
|
|
8802
8813
|
var IS_WINDOWS4 = platform4() === "win32";
|
|
8803
8814
|
var runInteractiveTool = {
|
|
@@ -8861,7 +8872,7 @@ var runInteractiveTool = {
|
|
|
8861
8872
|
};
|
|
8862
8873
|
const prefixWarnings = [argsTypeWarning, stdinTypeWarning].filter(Boolean).join("");
|
|
8863
8874
|
return new Promise((resolve13) => {
|
|
8864
|
-
const child =
|
|
8875
|
+
const child = spawn4(executable, cmdArgs.map(String), {
|
|
8865
8876
|
cwd: process.cwd(),
|
|
8866
8877
|
env,
|
|
8867
8878
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -10964,7 +10975,7 @@ var spawnAgentTool = {
|
|
|
10964
10975
|
};
|
|
10965
10976
|
|
|
10966
10977
|
// src/tools/builtin/task-manager.ts
|
|
10967
|
-
import { spawn as
|
|
10978
|
+
import { spawn as spawn5 } from "child_process";
|
|
10968
10979
|
import { randomUUID } from "crypto";
|
|
10969
10980
|
import { platform as platform5 } from "os";
|
|
10970
10981
|
var MAX_OUTPUT_CHARS = 1e4;
|
|
@@ -11000,7 +11011,7 @@ function createTask(command, description) {
|
|
|
11000
11011
|
}
|
|
11001
11012
|
const id = randomUUID().slice(0, 8);
|
|
11002
11013
|
const { shell, args } = shellInvocation(command);
|
|
11003
|
-
const proc =
|
|
11014
|
+
const proc = spawn5(shell, args, {
|
|
11004
11015
|
stdio: ["ignore", "pipe", "pipe"],
|
|
11005
11016
|
detached: false,
|
|
11006
11017
|
env: { ...process.env, PYTHONUTF8: "1", PYTHONIOENCODING: "utf-8" }
|
|
@@ -11052,7 +11063,7 @@ function stopTask(id) {
|
|
|
11052
11063
|
const proc = task.process;
|
|
11053
11064
|
if (platform5() === "win32" && proc.pid) {
|
|
11054
11065
|
try {
|
|
11055
|
-
|
|
11066
|
+
spawn5("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
|
|
11056
11067
|
windowsHide: true,
|
|
11057
11068
|
stdio: "ignore"
|
|
11058
11069
|
});
|
|
@@ -12162,7 +12173,7 @@ var ToolRegistry = class {
|
|
|
12162
12173
|
};
|
|
12163
12174
|
|
|
12164
12175
|
// src/mcp/client.ts
|
|
12165
|
-
import { spawn as
|
|
12176
|
+
import { spawn as spawn6 } from "child_process";
|
|
12166
12177
|
var McpClient = class {
|
|
12167
12178
|
serverId;
|
|
12168
12179
|
config;
|
|
@@ -12200,7 +12211,7 @@ var McpClient = class {
|
|
|
12200
12211
|
async connect() {
|
|
12201
12212
|
const timeout = this.config.timeout ?? MCP_CONNECT_TIMEOUT;
|
|
12202
12213
|
try {
|
|
12203
|
-
this.process =
|
|
12214
|
+
this.process = spawn6(this.config.command, this.config.args ?? [], {
|
|
12204
12215
|
stdio: ["pipe", "pipe", "pipe"],
|
|
12205
12216
|
env: { ...process.env, ...this.config.env },
|
|
12206
12217
|
// Windows 上 npx 等是 .cmd 脚本,需要 shell 模式
|
|
@@ -15089,7 +15100,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
15089
15100
|
Cost: ${formatCost(cost)}` : "";
|
|
15090
15101
|
let memoryLine = "";
|
|
15091
15102
|
try {
|
|
15092
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
15103
|
+
const { countPendingMemories } = await import("./persistent-memory-YLB2ZSB2.js");
|
|
15093
15104
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
15094
15105
|
if (pending > 0) memoryLine = `
|
|
15095
15106
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -15898,7 +15909,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
15898
15909
|
async function handleTest(args, ctx) {
|
|
15899
15910
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
15900
15911
|
try {
|
|
15901
|
-
const { executeTests } = await import("./run-tests-
|
|
15912
|
+
const { executeTests } = await import("./run-tests-42DWRQAR.js");
|
|
15902
15913
|
const argStr = args.join(" ").trim();
|
|
15903
15914
|
let testArgs = {};
|
|
15904
15915
|
if (argStr) {
|
|
@@ -16162,7 +16173,7 @@ async function handleMemory(args, ctx) {
|
|
|
16162
16173
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
16163
16174
|
} else if (sub === "export") {
|
|
16164
16175
|
if (args[1] === "md") {
|
|
16165
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
16176
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-YLB2ZSB2.js");
|
|
16166
16177
|
ctx.send({
|
|
16167
16178
|
type: "export_data",
|
|
16168
16179
|
format: "md",
|
|
@@ -18999,13 +19010,13 @@ function parseCookie(cookie) {
|
|
|
18999
19010
|
}
|
|
19000
19011
|
async function openBrowser(url) {
|
|
19001
19012
|
try {
|
|
19002
|
-
const { spawn:
|
|
19013
|
+
const { spawn: spawn7 } = await import("child_process");
|
|
19003
19014
|
if (process.platform === "win32") {
|
|
19004
|
-
|
|
19015
|
+
spawn7("cmd", ["/c", "start", '""', url], { detached: true, stdio: "ignore" }).unref();
|
|
19005
19016
|
} else if (process.platform === "darwin") {
|
|
19006
|
-
|
|
19017
|
+
spawn7("open", [url], { detached: true, stdio: "ignore" }).unref();
|
|
19007
19018
|
} else {
|
|
19008
|
-
|
|
19019
|
+
spawn7("xdg-open", [url], { detached: true, stdio: "ignore" }).unref();
|
|
19009
19020
|
}
|
|
19010
19021
|
} catch {
|
|
19011
19022
|
}
|
|
@@ -154,7 +154,7 @@ ${content}`);
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
157
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
157
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-DEDL6YAZ.js");
|
|
158
158
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
159
159
|
let interrupted = false;
|
|
160
160
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
scanProject,
|
|
18
18
|
sessionHasMeaningfulContent,
|
|
19
19
|
setupProxy
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XYXVTHOB.js";
|
|
21
21
|
import {
|
|
22
22
|
computeCost,
|
|
23
23
|
formatCost,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
spawnAgentContext,
|
|
51
51
|
theme,
|
|
52
52
|
undoStack
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-A4MLBB4H.js";
|
|
54
54
|
import {
|
|
55
55
|
addMemoryEntry,
|
|
56
56
|
backupMemoryStore,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
touchMemoryReferences,
|
|
77
77
|
updateMemoryApproval,
|
|
78
78
|
updateMemoryEntry
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-4UIVLJAP.js";
|
|
80
80
|
import "./chunk-K3CF65QH.js";
|
|
81
81
|
import "./chunk-UUSRWSSX.js";
|
|
82
82
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -90,13 +90,13 @@ import {
|
|
|
90
90
|
formatDoctorReport,
|
|
91
91
|
loadContextFiles,
|
|
92
92
|
writeCrashLog
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-WKXADWWK.js";
|
|
94
94
|
import {
|
|
95
95
|
ProviderRegistry
|
|
96
96
|
} from "./chunk-QYQI7ZWK.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-XH4JPEIZ.js";
|
|
100
100
|
import {
|
|
101
101
|
describePlugin,
|
|
102
102
|
getActivePluginAssets,
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
trustHook,
|
|
114
114
|
trustPlugin,
|
|
115
115
|
untrustHook
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-H3PEWUFY.js";
|
|
117
117
|
import {
|
|
118
118
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
119
119
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
import {
|
|
147
147
|
fileCheckpoints
|
|
148
148
|
} from "./chunk-4BKXL7SM.js";
|
|
149
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-JM2DX7OY.js";
|
|
150
150
|
import {
|
|
151
151
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
152
152
|
AUTHOR,
|
|
@@ -165,7 +165,7 @@ import {
|
|
|
165
165
|
SKILLS_DIR_NAME,
|
|
166
166
|
VERSION,
|
|
167
167
|
buildUserIdentityPrompt
|
|
168
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-KEAUVMKS.js";
|
|
169
169
|
import {
|
|
170
170
|
buildChatIndex,
|
|
171
171
|
clearChatIndex,
|
|
@@ -1387,7 +1387,7 @@ No tools match "${filter}".
|
|
|
1387
1387
|
const { join: join6 } = await import("path");
|
|
1388
1388
|
const { existsSync: existsSync5 } = await import("fs");
|
|
1389
1389
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1390
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1390
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-DTPJHB6W.js");
|
|
1391
1391
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1392
1392
|
const cwd = process.cwd();
|
|
1393
1393
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2366,7 +2366,7 @@ function createReviewCommands() {
|
|
|
2366
2366
|
usage: "/test [command|filter]",
|
|
2367
2367
|
async execute(args, ctx) {
|
|
2368
2368
|
try {
|
|
2369
|
-
const { executeTests } = await import("./run-tests-
|
|
2369
|
+
const { executeTests } = await import("./run-tests-WW6VCT23.js");
|
|
2370
2370
|
const argStr = args.join(" ").trim();
|
|
2371
2371
|
let testArgs = {};
|
|
2372
2372
|
if (argStr) {
|
|
@@ -8014,7 +8014,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
8014
8014
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
8015
8015
|
process.exit(1);
|
|
8016
8016
|
}
|
|
8017
|
-
const { startWebServer } = await import("./server-
|
|
8017
|
+
const { startWebServer } = await import("./server-NNDBF3SH.js");
|
|
8018
8018
|
await startWebServer({ port, host: options.host });
|
|
8019
8019
|
});
|
|
8020
8020
|
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) => {
|
|
@@ -8181,11 +8181,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
8181
8181
|
console.log(footer + "\n");
|
|
8182
8182
|
});
|
|
8183
8183
|
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) => {
|
|
8184
|
-
const { runUsageCli } = await import("./usage-
|
|
8184
|
+
const { runUsageCli } = await import("./usage-QAMWSX52.js");
|
|
8185
8185
|
await runUsageCli(options);
|
|
8186
8186
|
});
|
|
8187
8187
|
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) => {
|
|
8188
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
8188
|
+
const { runDoctorCli } = await import("./doctor-cli-AEVPW6VY.js");
|
|
8189
8189
|
const argv = process.argv.slice(2);
|
|
8190
8190
|
await runDoctorCli({
|
|
8191
8191
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -8194,7 +8194,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
8194
8194
|
});
|
|
8195
8195
|
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) => {
|
|
8196
8196
|
try {
|
|
8197
|
-
const batch = await import("./batch-
|
|
8197
|
+
const batch = await import("./batch-MRP2KUFC.js");
|
|
8198
8198
|
switch (action) {
|
|
8199
8199
|
case "submit":
|
|
8200
8200
|
if (!arg) {
|
|
@@ -8237,7 +8237,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
8237
8237
|
}
|
|
8238
8238
|
});
|
|
8239
8239
|
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) => {
|
|
8240
|
-
const { startMcpServer } = await import("./server-
|
|
8240
|
+
const { startMcpServer } = await import("./server-KX6WKW6V.js");
|
|
8241
8241
|
await startMcpServer({
|
|
8242
8242
|
allowDestructive: !!options.allowDestructive,
|
|
8243
8243
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -8250,7 +8250,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8250
8250
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
8251
8251
|
process.exit(1);
|
|
8252
8252
|
}
|
|
8253
|
-
const { runPrCli } = await import("./pr-
|
|
8253
|
+
const { runPrCli } = await import("./pr-Z3NX3SG5.js");
|
|
8254
8254
|
const result = await runPrCli({
|
|
8255
8255
|
action,
|
|
8256
8256
|
target,
|
|
@@ -8270,8 +8270,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8270
8270
|
process.exit(result.exitCode);
|
|
8271
8271
|
});
|
|
8272
8272
|
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) => {
|
|
8273
|
-
const { runCi } = await import("./ci-
|
|
8274
|
-
const { formatCiResult } = await import("./ci-format-
|
|
8273
|
+
const { runCi } = await import("./ci-Q3LQQT7K.js");
|
|
8274
|
+
const { formatCiResult } = await import("./ci-format-L2WPVFFC.js");
|
|
8275
8275
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
8276
8276
|
if (formats > 1) {
|
|
8277
8277
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -8429,7 +8429,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
8429
8429
|
config.get("customProviders"),
|
|
8430
8430
|
config.getConfigDir()
|
|
8431
8431
|
);
|
|
8432
|
-
const { startHub } = await import("./hub-
|
|
8432
|
+
const { startHub } = await import("./hub-PPNKIMPG.js");
|
|
8433
8433
|
await startHub(
|
|
8434
8434
|
{
|
|
8435
8435
|
topic: topic ?? "",
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-O357YW7E.js";
|
|
31
31
|
import "./chunk-YVTASHS5.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-UM2OVVLP.js";
|
|
33
33
|
import "./chunk-6BUTA5VW.js";
|
|
34
34
|
export {
|
|
35
35
|
addMemoryEntry,
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-4UIVLJAP.js";
|
|
32
32
|
import "./chunk-HOSJZMQS.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-KEAUVMKS.js";
|
|
34
34
|
import "./chunk-B5TYJO7V.js";
|
|
35
35
|
import "./chunk-IW3Q7AE5.js";
|
|
36
36
|
export {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-M7BQVFMF.js";
|
|
6
|
+
import "./chunk-Y6KDBGY7.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
} from "./chunk-QYQI7ZWK.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XH4JPEIZ.js";
|
|
18
18
|
import "./chunk-O3XSFPYH.js";
|
|
19
19
|
import "./chunk-5ULLIOVC.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-KEAUVMKS.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-A4MLBB4H.js";
|
|
5
|
+
import "./chunk-4UIVLJAP.js";
|
|
6
6
|
import "./chunk-K3CF65QH.js";
|
|
7
7
|
import "./chunk-UUSRWSSX.js";
|
|
8
8
|
import "./chunk-CKH4KQ4E.js";
|
|
9
9
|
import "./chunk-BXP6YZ2P.js";
|
|
10
10
|
import {
|
|
11
11
|
runTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-H3PEWUFY.js";
|
|
13
13
|
import {
|
|
14
14
|
getDangerLevel,
|
|
15
15
|
schemaToJsonSchema
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
import "./chunk-5ULLIOVC.js";
|
|
18
18
|
import "./chunk-HOSJZMQS.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-JM2DX7OY.js";
|
|
21
21
|
import {
|
|
22
22
|
VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KEAUVMKS.js";
|
|
24
24
|
import "./chunk-IGPFYNZA.js";
|
|
25
25
|
import "./chunk-KHYD3WXE.js";
|
|
26
26
|
import "./chunk-PJ3ONBWZ.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
scanDirTree,
|
|
24
24
|
scanProject,
|
|
25
25
|
setupProxy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XYXVTHOB.js";
|
|
27
27
|
import {
|
|
28
28
|
computeCost,
|
|
29
29
|
formatCost,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
spawnAgentContext,
|
|
64
64
|
truncateOutput,
|
|
65
65
|
undoStack
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-A4MLBB4H.js";
|
|
67
67
|
import {
|
|
68
68
|
addMemoryEntry,
|
|
69
69
|
clearMemoryEntries,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
parseWritableScope,
|
|
78
78
|
updateMemoryApproval,
|
|
79
79
|
updateMemoryEntry
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-4UIVLJAP.js";
|
|
81
81
|
import "./chunk-K3CF65QH.js";
|
|
82
82
|
import "./chunk-UUSRWSSX.js";
|
|
83
83
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -90,13 +90,13 @@ import {
|
|
|
90
90
|
buildDoctorReport,
|
|
91
91
|
formatDoctorReport,
|
|
92
92
|
loadContextFiles
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-WKXADWWK.js";
|
|
94
94
|
import {
|
|
95
95
|
ProviderRegistry
|
|
96
96
|
} from "./chunk-QYQI7ZWK.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-XH4JPEIZ.js";
|
|
100
100
|
import {
|
|
101
101
|
describePlugin,
|
|
102
102
|
getActivePluginAssets,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
runTool,
|
|
112
112
|
setPluginEnabled,
|
|
113
113
|
trustPlugin
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-H3PEWUFY.js";
|
|
115
115
|
import {
|
|
116
116
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
117
117
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -135,7 +135,7 @@ import {
|
|
|
135
135
|
getGitRoot
|
|
136
136
|
} from "./chunk-HOSJZMQS.js";
|
|
137
137
|
import "./chunk-4BKXL7SM.js";
|
|
138
|
-
import "./chunk-
|
|
138
|
+
import "./chunk-JM2DX7OY.js";
|
|
139
139
|
import {
|
|
140
140
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
141
141
|
AUTHOR,
|
|
@@ -151,7 +151,7 @@ import {
|
|
|
151
151
|
SKILLS_DIR_NAME,
|
|
152
152
|
VERSION,
|
|
153
153
|
buildUserIdentityPrompt
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-KEAUVMKS.js";
|
|
155
155
|
import "./chunk-IGPFYNZA.js";
|
|
156
156
|
import "./chunk-KHYD3WXE.js";
|
|
157
157
|
import "./chunk-PJ3ONBWZ.js";
|
|
@@ -803,7 +803,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
803
803
|
Cost: ${formatCost(cost)}` : "";
|
|
804
804
|
let memoryLine = "";
|
|
805
805
|
try {
|
|
806
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
806
|
+
const { countPendingMemories } = await import("./persistent-memory-ZIC4UA2W.js");
|
|
807
807
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
808
808
|
if (pending > 0) memoryLine = `
|
|
809
809
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -1612,7 +1612,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
1612
1612
|
async function handleTest(args, ctx) {
|
|
1613
1613
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1614
1614
|
try {
|
|
1615
|
-
const { executeTests } = await import("./run-tests-
|
|
1615
|
+
const { executeTests } = await import("./run-tests-WW6VCT23.js");
|
|
1616
1616
|
const argStr = args.join(" ").trim();
|
|
1617
1617
|
let testArgs = {};
|
|
1618
1618
|
if (argStr) {
|
|
@@ -1876,7 +1876,7 @@ async function handleMemory(args, ctx) {
|
|
|
1876
1876
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
1877
1877
|
} else if (sub === "export") {
|
|
1878
1878
|
if (args[1] === "md") {
|
|
1879
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
1879
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-ZIC4UA2W.js");
|
|
1880
1880
|
ctx.send({
|
|
1881
1881
|
type: "export_data",
|
|
1882
1882
|
format: "md",
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-A4MLBB4H.js";
|
|
7
|
+
import "./chunk-4UIVLJAP.js";
|
|
8
8
|
import "./chunk-K3CF65QH.js";
|
|
9
9
|
import "./chunk-UUSRWSSX.js";
|
|
10
10
|
import "./chunk-CKH4KQ4E.js";
|
|
11
11
|
import "./chunk-BXP6YZ2P.js";
|
|
12
12
|
import {
|
|
13
13
|
runTool
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H3PEWUFY.js";
|
|
15
15
|
import {
|
|
16
16
|
getDangerLevel,
|
|
17
17
|
runLeanAgentLoop
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
import "./chunk-5ULLIOVC.js";
|
|
20
20
|
import "./chunk-HOSJZMQS.js";
|
|
21
21
|
import "./chunk-4BKXL7SM.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-JM2DX7OY.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBAGENT_ALLOWED_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KEAUVMKS.js";
|
|
26
26
|
import "./chunk-IGPFYNZA.js";
|
|
27
27
|
import "./chunk-KHYD3WXE.js";
|
|
28
28
|
import "./chunk-PJ3ONBWZ.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./chunk-E44DTERW.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XH4JPEIZ.js";
|
|
12
12
|
import "./chunk-5ULLIOVC.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-KEAUVMKS.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|