jinzd-ai-cli 0.4.306 → 0.4.307
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-JLGWQ7HU.js → batch-HMADXNOD.js} +2 -2
- package/dist/{chunk-3RDJEYF7.js → chunk-3CKJOTVM.js} +3 -3
- package/dist/{chunk-K5SDDTN7.js → chunk-3TBXHLSC.js} +1 -1
- package/dist/{chunk-W6PLV3EY.js → chunk-4W6VDVQU.js} +1 -1
- package/dist/{chunk-7SSCSSC6.js → chunk-5GQL4TSZ.js} +1 -1
- package/dist/{chunk-LAP7TPPK.js → chunk-AHL6KOGM.js} +1 -1
- package/dist/{chunk-OC2XHG5L.js → chunk-AQF6IXSR.js} +1 -1
- package/dist/{chunk-WZWRA7R2.js → chunk-CIM2PV2F.js} +1 -1
- package/dist/{chunk-NLB7JZSO.js → chunk-KRCYR46A.js} +1 -1
- package/dist/{chunk-VLDB2SVN.js → chunk-L2RJPVHV.js} +121 -5
- package/dist/{chunk-JFNBJHR6.js → chunk-NQJSPMY2.js} +3 -3
- package/dist/{chunk-JDT6UG6R.js → chunk-SJFZPS65.js} +1 -1
- package/dist/{chunk-T6WQEQI4.js → chunk-VAV2IJ3R.js} +1 -1
- package/dist/{chunk-AYLK4EGA.js → chunk-YFDQIUQ3.js} +7 -7
- package/dist/{ci-6PHEL3C7.js → ci-QD2Q7NWY.js} +4 -4
- package/dist/{ci-format-AZYUP6BL.js → ci-format-42XIZO5P.js} +2 -2
- package/dist/{constants-AXBD2EEB.js → constants-5CMEFZQB.js} +1 -1
- package/dist/{constants-CPNWIUGZ.js → constants-NMASHFDL.js} +1 -1
- package/dist/{doctor-cli-DDHHDMMJ.js → doctor-cli-IOVSHBDI.js} +4 -4
- package/dist/electron-server.js +127 -11
- package/dist/{hub-DDYAWLF2.js → hub-ZLF6GMQD.js} +1 -1
- package/dist/index.js +17 -17
- package/dist/{persistent-memory-XZISXRWT.js → persistent-memory-GJE7HKVK.js} +2 -2
- package/dist/{persistent-memory-6XYYOMSC.js → persistent-memory-MBSBTBGY.js} +2 -2
- package/dist/{pr-UY4ZCZNI.js → pr-SXRW24JG.js} +4 -4
- package/dist/{run-tests-BAMLVLO6.js → run-tests-EQCAMFQE.js} +2 -2
- package/dist/{run-tests-UEE3OMLS.js → run-tests-V3N7YV3P.js} +2 -2
- package/dist/{server-DBHLVQVP.js → server-GGEO7SA2.js} +13 -13
- package/dist/{server-6IC33CJK.js → server-MO3EU2XD.js} +5 -5
- package/dist/{task-orchestrator-RDDETDW2.js → task-orchestrator-JGEEQ2OE.js} +5 -5
- package/dist/{usage-D473ZVIP.js → usage-B7RIAPPT.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-AQF6IXSR.js";
|
|
8
8
|
import "./chunk-TU3L3PW7.js";
|
|
9
9
|
import {
|
|
10
10
|
atomicWriteFileSync
|
|
11
11
|
} from "./chunk-IW3Q7AE5.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-VAV2IJ3R.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-3TBXHLSC.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-VXEF2SWG.js";
|
|
17
17
|
import {
|
|
18
18
|
ConfigManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AQF6IXSR.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/ci.ts
|
|
25
25
|
import { execFileSync } from "child_process";
|
|
@@ -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-VAV2IJ3R.js";
|
|
17
17
|
|
|
18
18
|
// src/memory/persistent-memory.ts
|
|
19
19
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -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-SJFZPS65.js";
|
|
16
16
|
|
|
17
17
|
// src/memory/persistent-memory.ts
|
|
18
18
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchPersistentMemories,
|
|
12
12
|
touchMemoryReferences,
|
|
13
13
|
updateMemoryEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AHL6KOGM.js";
|
|
15
15
|
import {
|
|
16
16
|
indexProject
|
|
17
17
|
} from "./chunk-LF67HWWR.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
runHook,
|
|
31
31
|
runLifecycleHooks,
|
|
32
32
|
runTool
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
34
34
|
import {
|
|
35
35
|
buildTruncatedArgumentsError,
|
|
36
36
|
getDangerLevel,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
} from "./chunk-4BKXL7SM.js";
|
|
51
51
|
import {
|
|
52
52
|
runTestsTool
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4W6VDVQU.js";
|
|
54
54
|
import {
|
|
55
55
|
CONFIG_DIR_NAME,
|
|
56
56
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
SUBAGENT_ALLOWED_TOOLS,
|
|
60
60
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
61
61
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
63
63
|
|
|
64
64
|
// src/tools/shell-pool.ts
|
|
65
65
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -618,7 +618,8 @@ Important rules:
|
|
|
618
618
|
4. To delete directories, use Remove-Item -Recurse (the system will automatically optimize to a more reliable method).
|
|
619
619
|
5. IMPORTANT: On Windows, "curl" is an alias for Invoke-WebRequest and does NOT support curl flags like -s, -X, -H. Use Invoke-RestMethod instead for HTTP requests. Example: Invoke-RestMethod -Uri "http://localhost:3000/api/health" -Method Get
|
|
620
620
|
6. NEVER run long-running / never-exiting commands through bash \u2014 they block until timeout. This includes starting an Android emulator (emulator -avd X), streaming logs (adb logcat), and dev servers (node server.js, npm run dev, metro / react-native start). Use the 'task_create' tool to run these in the background, then poll status with short bash calls (e.g. adb shell getprop sys.boot_completed).
|
|
621
|
-
7. CRITICAL \u2014 this is PowerShell, NOT bash: \\ is NOT an escape character. Writing \\" inside a double-quoted string CLOSES the string and silently splits your command into fragments \u2014 it often still exits 0 with no output, so it looks like it worked when it did not. To escape a quote use \`" or "". For anything with nested quoting (especially ssh + psql -c "SELECT ..."), do NOT try to escape your way out: write the payload to a file with the 'write_file' tool, 'scp' it to the host, and run it with a single level of quoting (e.g. ssh host "psql -d db -f /tmp/x.sql")
|
|
621
|
+
7. CRITICAL \u2014 this is PowerShell, NOT bash: \\ is NOT an escape character. Writing \\" inside a double-quoted string CLOSES the string and silently splits your command into fragments \u2014 it often still exits 0 with no output, so it looks like it worked when it did not. To escape a quote use \`" or "". For anything with nested quoting (especially ssh + psql -c "SELECT ..."), do NOT try to escape your way out: write the payload to a file with the 'write_file' tool, 'scp' it to the host, and run it with a single level of quoting (e.g. ssh host "psql -d db -f /tmp/x.sql").
|
|
622
|
+
8. CRITICAL \u2014 running a program by its full path: a quoted string at the START of a statement is parsed as a string EXPRESSION, not a command. "C:\\path\\python.exe" -c "print(1)" is a SYNTAX ERROR. Put the call operator '&' in front: & "C:\\path\\python.exe" -c "print(1)" \u2014 or $py = "C:\\path\\python.exe"; & $py -c "print(1)". This applies to any quoted path used as a command, anywhere a statement starts (including after ';').` : `Execute commands in ${SHELL2}.
|
|
622
623
|
Important rules:
|
|
623
624
|
1. Each bash call runs in an independent subprocess; cd commands do not persist. To run in a specific directory, use the cwd parameter, or combine commands: e.g. "cd mydir && ls" or "mkdir -p mydir && touch mydir/file.txt".
|
|
624
625
|
2. If a command fails (returns an error or non-zero exit code), stop immediately, report the error to the user, and do not retry the same or similar commands.
|
|
@@ -873,6 +874,116 @@ function detectPowerShellBackslashQuote(command) {
|
|
|
873
874
|
}
|
|
874
875
|
return false;
|
|
875
876
|
}
|
|
877
|
+
var PS_OPERATOR_WORDS = /* @__PURE__ */ new Set([
|
|
878
|
+
"eq",
|
|
879
|
+
"ne",
|
|
880
|
+
"gt",
|
|
881
|
+
"ge",
|
|
882
|
+
"lt",
|
|
883
|
+
"le",
|
|
884
|
+
"ceq",
|
|
885
|
+
"cne",
|
|
886
|
+
"cgt",
|
|
887
|
+
"cge",
|
|
888
|
+
"clt",
|
|
889
|
+
"cle",
|
|
890
|
+
"ieq",
|
|
891
|
+
"ine",
|
|
892
|
+
"igt",
|
|
893
|
+
"ige",
|
|
894
|
+
"ilt",
|
|
895
|
+
"ile",
|
|
896
|
+
"like",
|
|
897
|
+
"notlike",
|
|
898
|
+
"match",
|
|
899
|
+
"notmatch",
|
|
900
|
+
"clike",
|
|
901
|
+
"cnotlike",
|
|
902
|
+
"cmatch",
|
|
903
|
+
"cnotmatch",
|
|
904
|
+
"ilike",
|
|
905
|
+
"inotlike",
|
|
906
|
+
"imatch",
|
|
907
|
+
"inotmatch",
|
|
908
|
+
"contains",
|
|
909
|
+
"notcontains",
|
|
910
|
+
"ccontains",
|
|
911
|
+
"cnotcontains",
|
|
912
|
+
"icontains",
|
|
913
|
+
"inotcontains",
|
|
914
|
+
"in",
|
|
915
|
+
"notin",
|
|
916
|
+
"cin",
|
|
917
|
+
"cnotin",
|
|
918
|
+
"iin",
|
|
919
|
+
"inotin",
|
|
920
|
+
"is",
|
|
921
|
+
"isnot",
|
|
922
|
+
"as",
|
|
923
|
+
"and",
|
|
924
|
+
"or",
|
|
925
|
+
"not",
|
|
926
|
+
"xor",
|
|
927
|
+
"band",
|
|
928
|
+
"bor",
|
|
929
|
+
"bnot",
|
|
930
|
+
"bxor",
|
|
931
|
+
"shl",
|
|
932
|
+
"shr",
|
|
933
|
+
"join",
|
|
934
|
+
"split",
|
|
935
|
+
"replace",
|
|
936
|
+
"csplit",
|
|
937
|
+
"creplace",
|
|
938
|
+
"isplit",
|
|
939
|
+
"ireplace",
|
|
940
|
+
"f"
|
|
941
|
+
]);
|
|
942
|
+
function detectMissingCallOperator(command) {
|
|
943
|
+
if (!IS_WINDOWS3) return false;
|
|
944
|
+
let atStatementStart = true;
|
|
945
|
+
let afterCallOperator = false;
|
|
946
|
+
for (let i = 0; i < command.length; i++) {
|
|
947
|
+
const ch = command[i];
|
|
948
|
+
if (ch === " " || ch === " ") continue;
|
|
949
|
+
if (ch === ";" || ch === "\n" || ch === "{" || ch === "(" || ch === "|" || ch === "&") {
|
|
950
|
+
if (ch === "&") {
|
|
951
|
+
const next = command.slice(i + 1).replace(/^[ \t]+/, "");
|
|
952
|
+
afterCallOperator = !next.startsWith("&");
|
|
953
|
+
} else {
|
|
954
|
+
afterCallOperator = false;
|
|
955
|
+
}
|
|
956
|
+
atStatementStart = true;
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
if (ch === "." && atStatementStart) {
|
|
960
|
+
afterCallOperator = true;
|
|
961
|
+
continue;
|
|
962
|
+
}
|
|
963
|
+
if ((ch === '"' || ch === "'") && atStatementStart && !afterCallOperator) {
|
|
964
|
+
const quote = ch;
|
|
965
|
+
let j = i + 1;
|
|
966
|
+
while (j < command.length && command[j] !== quote) j++;
|
|
967
|
+
if (j >= command.length) return false;
|
|
968
|
+
const rest = command.slice(j + 1);
|
|
969
|
+
const m = /^[ \t]+(\S+)/.exec(rest);
|
|
970
|
+
if (m) {
|
|
971
|
+
const token = m[1];
|
|
972
|
+
if (/^[-]/.test(token)) {
|
|
973
|
+
const word = token.slice(1).toLowerCase();
|
|
974
|
+
if (PS_OPERATOR_WORDS.has(word)) return false;
|
|
975
|
+
return true;
|
|
976
|
+
}
|
|
977
|
+
if (/^[+*%=<>|;)}\]]/.test(token)) return false;
|
|
978
|
+
return true;
|
|
979
|
+
}
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
atStatementStart = false;
|
|
983
|
+
afterCallOperator = false;
|
|
984
|
+
}
|
|
985
|
+
return false;
|
|
986
|
+
}
|
|
876
987
|
var BACKSLASH_QUOTE_SILENT_WARNING = `
|
|
877
988
|
|
|
878
989
|
\u26A0 WARNING: this command contains \\" inside a double-quoted string, but PowerShell does NOT treat \\ as an escape \u2014 that quote CLOSED the string and the command was split into fragments. It exited 0 with no output because the outer program (e.g. ssh) still ran, but it very likely did NOT run what you intended. Do NOT assume this succeeded.
|
|
@@ -953,6 +1064,11 @@ function buildErrorHint(command, stderr) {
|
|
|
953
1064
|
`Hint: PowerShell does NOT treat \\ as an escape character \u2014 the \\" in this command closed the double-quoted string and split the command into fragments. Escape quotes with \`" or "" instead. Better: avoid nested quoting entirely \u2014 write the payload to a file with 'write_file', 'scp' it over, and run it with one level of quoting (e.g. ssh host "psql -d <db> -f /tmp/x.sql").`
|
|
954
1065
|
);
|
|
955
1066
|
}
|
|
1067
|
+
if (detectMissingCallOperator(command) && /(ParserError|UnexpectedToken|Unexpected token|意外的标记|运算符后面提供|必须在)/i.test(stderr)) {
|
|
1068
|
+
hints.push(
|
|
1069
|
+
`Hint: in PowerShell a quoted string at the START of a statement is parsed as a string EXPRESSION, not as a command \u2014 so "C:\\path\\python.exe" -c "..." is a syntax error, not a quoting problem. Do NOT retry by removing the quotes, dropping the argument, or re-quoting it differently; all of those fail the same way. Fix: put the call operator '&' in front \u2014 \`& "C:\\path\\python.exe" -c "..."\` \u2014 or assign the path to a variable first (\`$py = "C:\\path\\python.exe"; & $py -c "..."\`).`
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
956
1072
|
return hints.length > 0 ? hints.map((h) => `\u{1F4A1} ${h}`).join("\n\n") : null;
|
|
957
1073
|
}
|
|
958
1074
|
function detectBlockingCommand(command) {
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listHooks,
|
|
9
9
|
listInstalledPlugins,
|
|
10
10
|
resetStats
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
14
|
} from "./chunk-VXEF2SWG.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AQF6IXSR.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-VAV2IJ3R.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
setPreferredAgentName,
|
|
17
17
|
truncateForPersist,
|
|
18
18
|
undoStack
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-L2RJPVHV.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-AHL6KOGM.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-NQJSPMY2.js";
|
|
69
69
|
import {
|
|
70
70
|
describePlugin,
|
|
71
71
|
getActivePluginAssets,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
trustHook,
|
|
81
81
|
trustPlugin,
|
|
82
82
|
untrustHook
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
84
84
|
import {
|
|
85
85
|
isCleanDocumentBody,
|
|
86
86
|
stripOuterCodeFence
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
MCP_TOOL_PREFIX,
|
|
110
110
|
REPO_URL,
|
|
111
111
|
VERSION
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-VAV2IJ3R.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-NMASHFDL.js");
|
|
2430
2430
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.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-EQCAMFQE.js");
|
|
3538
3538
|
const argStr = args.join(" ").trim();
|
|
3539
3539
|
let testArgs = {};
|
|
3540
3540
|
if (argStr) {
|
|
@@ -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-3CKJOTVM.js";
|
|
7
|
+
import "./chunk-3TBXHLSC.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
10
|
import "./chunk-VXEF2SWG.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-AQF6IXSR.js";
|
|
12
12
|
import "./chunk-MI4SFZGX.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-VAV2IJ3R.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-NQJSPMY2.js";
|
|
6
|
+
import "./chunk-5GQL4TSZ.js";
|
|
7
7
|
import "./chunk-RS7SKYTS.js";
|
|
8
8
|
import "./chunk-VXEF2SWG.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-AQF6IXSR.js";
|
|
10
10
|
import "./chunk-MI4SFZGX.js";
|
|
11
11
|
import "./chunk-TU3L3PW7.js";
|
|
12
12
|
import "./chunk-HOSJZMQS.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-VAV2IJ3R.js";
|
|
15
15
|
export {
|
|
16
16
|
formatDoctorReport,
|
|
17
17
|
runDoctorCli
|
package/dist/electron-server.js
CHANGED
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
touchMemoryReferences,
|
|
51
51
|
updateMemoryApproval,
|
|
52
52
|
updateMemoryEntry
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-CIM2PV2F.js";
|
|
54
54
|
import {
|
|
55
55
|
DEFAULT_PATTERNS,
|
|
56
56
|
redactJson,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
} from "./chunk-CGLYJRFA.js";
|
|
67
67
|
import {
|
|
68
68
|
runTestsTool
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-KRCYR46A.js";
|
|
70
70
|
import {
|
|
71
71
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
72
72
|
APP_NAME,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
102
102
|
VERSION,
|
|
103
103
|
buildUserIdentityPrompt
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-SJFZPS65.js";
|
|
105
105
|
|
|
106
106
|
// src/web/server.ts
|
|
107
107
|
import express from "express";
|
|
@@ -6153,7 +6153,8 @@ Important rules:
|
|
|
6153
6153
|
4. To delete directories, use Remove-Item -Recurse (the system will automatically optimize to a more reliable method).
|
|
6154
6154
|
5. IMPORTANT: On Windows, "curl" is an alias for Invoke-WebRequest and does NOT support curl flags like -s, -X, -H. Use Invoke-RestMethod instead for HTTP requests. Example: Invoke-RestMethod -Uri "http://localhost:3000/api/health" -Method Get
|
|
6155
6155
|
6. NEVER run long-running / never-exiting commands through bash \u2014 they block until timeout. This includes starting an Android emulator (emulator -avd X), streaming logs (adb logcat), and dev servers (node server.js, npm run dev, metro / react-native start). Use the 'task_create' tool to run these in the background, then poll status with short bash calls (e.g. adb shell getprop sys.boot_completed).
|
|
6156
|
-
7. CRITICAL \u2014 this is PowerShell, NOT bash: \\ is NOT an escape character. Writing \\" inside a double-quoted string CLOSES the string and silently splits your command into fragments \u2014 it often still exits 0 with no output, so it looks like it worked when it did not. To escape a quote use \`" or "". For anything with nested quoting (especially ssh + psql -c "SELECT ..."), do NOT try to escape your way out: write the payload to a file with the 'write_file' tool, 'scp' it to the host, and run it with a single level of quoting (e.g. ssh host "psql -d db -f /tmp/x.sql")
|
|
6156
|
+
7. CRITICAL \u2014 this is PowerShell, NOT bash: \\ is NOT an escape character. Writing \\" inside a double-quoted string CLOSES the string and silently splits your command into fragments \u2014 it often still exits 0 with no output, so it looks like it worked when it did not. To escape a quote use \`" or "". For anything with nested quoting (especially ssh + psql -c "SELECT ..."), do NOT try to escape your way out: write the payload to a file with the 'write_file' tool, 'scp' it to the host, and run it with a single level of quoting (e.g. ssh host "psql -d db -f /tmp/x.sql").
|
|
6157
|
+
8. CRITICAL \u2014 running a program by its full path: a quoted string at the START of a statement is parsed as a string EXPRESSION, not a command. "C:\\path\\python.exe" -c "print(1)" is a SYNTAX ERROR. Put the call operator '&' in front: & "C:\\path\\python.exe" -c "print(1)" \u2014 or $py = "C:\\path\\python.exe"; & $py -c "print(1)". This applies to any quoted path used as a command, anywhere a statement starts (including after ';').` : `Execute commands in ${SHELL2}.
|
|
6157
6158
|
Important rules:
|
|
6158
6159
|
1. Each bash call runs in an independent subprocess; cd commands do not persist. To run in a specific directory, use the cwd parameter, or combine commands: e.g. "cd mydir && ls" or "mkdir -p mydir && touch mydir/file.txt".
|
|
6159
6160
|
2. If a command fails (returns an error or non-zero exit code), stop immediately, report the error to the user, and do not retry the same or similar commands.
|
|
@@ -6408,6 +6409,116 @@ function detectPowerShellBackslashQuote(command) {
|
|
|
6408
6409
|
}
|
|
6409
6410
|
return false;
|
|
6410
6411
|
}
|
|
6412
|
+
var PS_OPERATOR_WORDS = /* @__PURE__ */ new Set([
|
|
6413
|
+
"eq",
|
|
6414
|
+
"ne",
|
|
6415
|
+
"gt",
|
|
6416
|
+
"ge",
|
|
6417
|
+
"lt",
|
|
6418
|
+
"le",
|
|
6419
|
+
"ceq",
|
|
6420
|
+
"cne",
|
|
6421
|
+
"cgt",
|
|
6422
|
+
"cge",
|
|
6423
|
+
"clt",
|
|
6424
|
+
"cle",
|
|
6425
|
+
"ieq",
|
|
6426
|
+
"ine",
|
|
6427
|
+
"igt",
|
|
6428
|
+
"ige",
|
|
6429
|
+
"ilt",
|
|
6430
|
+
"ile",
|
|
6431
|
+
"like",
|
|
6432
|
+
"notlike",
|
|
6433
|
+
"match",
|
|
6434
|
+
"notmatch",
|
|
6435
|
+
"clike",
|
|
6436
|
+
"cnotlike",
|
|
6437
|
+
"cmatch",
|
|
6438
|
+
"cnotmatch",
|
|
6439
|
+
"ilike",
|
|
6440
|
+
"inotlike",
|
|
6441
|
+
"imatch",
|
|
6442
|
+
"inotmatch",
|
|
6443
|
+
"contains",
|
|
6444
|
+
"notcontains",
|
|
6445
|
+
"ccontains",
|
|
6446
|
+
"cnotcontains",
|
|
6447
|
+
"icontains",
|
|
6448
|
+
"inotcontains",
|
|
6449
|
+
"in",
|
|
6450
|
+
"notin",
|
|
6451
|
+
"cin",
|
|
6452
|
+
"cnotin",
|
|
6453
|
+
"iin",
|
|
6454
|
+
"inotin",
|
|
6455
|
+
"is",
|
|
6456
|
+
"isnot",
|
|
6457
|
+
"as",
|
|
6458
|
+
"and",
|
|
6459
|
+
"or",
|
|
6460
|
+
"not",
|
|
6461
|
+
"xor",
|
|
6462
|
+
"band",
|
|
6463
|
+
"bor",
|
|
6464
|
+
"bnot",
|
|
6465
|
+
"bxor",
|
|
6466
|
+
"shl",
|
|
6467
|
+
"shr",
|
|
6468
|
+
"join",
|
|
6469
|
+
"split",
|
|
6470
|
+
"replace",
|
|
6471
|
+
"csplit",
|
|
6472
|
+
"creplace",
|
|
6473
|
+
"isplit",
|
|
6474
|
+
"ireplace",
|
|
6475
|
+
"f"
|
|
6476
|
+
]);
|
|
6477
|
+
function detectMissingCallOperator(command) {
|
|
6478
|
+
if (!IS_WINDOWS3) return false;
|
|
6479
|
+
let atStatementStart = true;
|
|
6480
|
+
let afterCallOperator = false;
|
|
6481
|
+
for (let i = 0; i < command.length; i++) {
|
|
6482
|
+
const ch = command[i];
|
|
6483
|
+
if (ch === " " || ch === " ") continue;
|
|
6484
|
+
if (ch === ";" || ch === "\n" || ch === "{" || ch === "(" || ch === "|" || ch === "&") {
|
|
6485
|
+
if (ch === "&") {
|
|
6486
|
+
const next = command.slice(i + 1).replace(/^[ \t]+/, "");
|
|
6487
|
+
afterCallOperator = !next.startsWith("&");
|
|
6488
|
+
} else {
|
|
6489
|
+
afterCallOperator = false;
|
|
6490
|
+
}
|
|
6491
|
+
atStatementStart = true;
|
|
6492
|
+
continue;
|
|
6493
|
+
}
|
|
6494
|
+
if (ch === "." && atStatementStart) {
|
|
6495
|
+
afterCallOperator = true;
|
|
6496
|
+
continue;
|
|
6497
|
+
}
|
|
6498
|
+
if ((ch === '"' || ch === "'") && atStatementStart && !afterCallOperator) {
|
|
6499
|
+
const quote = ch;
|
|
6500
|
+
let j = i + 1;
|
|
6501
|
+
while (j < command.length && command[j] !== quote) j++;
|
|
6502
|
+
if (j >= command.length) return false;
|
|
6503
|
+
const rest = command.slice(j + 1);
|
|
6504
|
+
const m = /^[ \t]+(\S+)/.exec(rest);
|
|
6505
|
+
if (m) {
|
|
6506
|
+
const token = m[1];
|
|
6507
|
+
if (/^[-]/.test(token)) {
|
|
6508
|
+
const word = token.slice(1).toLowerCase();
|
|
6509
|
+
if (PS_OPERATOR_WORDS.has(word)) return false;
|
|
6510
|
+
return true;
|
|
6511
|
+
}
|
|
6512
|
+
if (/^[+*%=<>|;)}\]]/.test(token)) return false;
|
|
6513
|
+
return true;
|
|
6514
|
+
}
|
|
6515
|
+
return false;
|
|
6516
|
+
}
|
|
6517
|
+
atStatementStart = false;
|
|
6518
|
+
afterCallOperator = false;
|
|
6519
|
+
}
|
|
6520
|
+
return false;
|
|
6521
|
+
}
|
|
6411
6522
|
var BACKSLASH_QUOTE_SILENT_WARNING = `
|
|
6412
6523
|
|
|
6413
6524
|
\u26A0 WARNING: this command contains \\" inside a double-quoted string, but PowerShell does NOT treat \\ as an escape \u2014 that quote CLOSED the string and the command was split into fragments. It exited 0 with no output because the outer program (e.g. ssh) still ran, but it very likely did NOT run what you intended. Do NOT assume this succeeded.
|
|
@@ -6488,6 +6599,11 @@ function buildErrorHint(command, stderr) {
|
|
|
6488
6599
|
`Hint: PowerShell does NOT treat \\ as an escape character \u2014 the \\" in this command closed the double-quoted string and split the command into fragments. Escape quotes with \`" or "" instead. Better: avoid nested quoting entirely \u2014 write the payload to a file with 'write_file', 'scp' it over, and run it with one level of quoting (e.g. ssh host "psql -d <db> -f /tmp/x.sql").`
|
|
6489
6600
|
);
|
|
6490
6601
|
}
|
|
6602
|
+
if (detectMissingCallOperator(command) && /(ParserError|UnexpectedToken|Unexpected token|意外的标记|运算符后面提供|必须在)/i.test(stderr)) {
|
|
6603
|
+
hints.push(
|
|
6604
|
+
`Hint: in PowerShell a quoted string at the START of a statement is parsed as a string EXPRESSION, not as a command \u2014 so "C:\\path\\python.exe" -c "..." is a syntax error, not a quoting problem. Do NOT retry by removing the quotes, dropping the argument, or re-quoting it differently; all of those fail the same way. Fix: put the call operator '&' in front \u2014 \`& "C:\\path\\python.exe" -c "..."\` \u2014 or assign the path to a variable first (\`$py = "C:\\path\\python.exe"; & $py -c "..."\`).`
|
|
6605
|
+
);
|
|
6606
|
+
}
|
|
6491
6607
|
return hints.length > 0 ? hints.map((h) => `\u{1F4A1} ${h}`).join("\n\n") : null;
|
|
6492
6608
|
}
|
|
6493
6609
|
function detectBlockingCommand(command) {
|
|
@@ -17276,7 +17392,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
17276
17392
|
Cost: ${formatCost(cost)}` : "";
|
|
17277
17393
|
let memoryLine = "";
|
|
17278
17394
|
try {
|
|
17279
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
17395
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-GJE7HKVK.js");
|
|
17280
17396
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
17281
17397
|
if (pending > 0) memoryLine = `
|
|
17282
17398
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -18264,7 +18380,7 @@ async function handleTest(args, ctx) {
|
|
|
18264
18380
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
18265
18381
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
18266
18382
|
}
|
|
18267
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
18383
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-V3N7YV3P.js")).executeTests;
|
|
18268
18384
|
const report = await runTests(testArgs);
|
|
18269
18385
|
ctx.send({ type: "info", message: report });
|
|
18270
18386
|
} catch (err) {
|
|
@@ -18655,7 +18771,7 @@ async function handleMemory(args, ctx) {
|
|
|
18655
18771
|
}
|
|
18656
18772
|
if (intent.kind === "status") {
|
|
18657
18773
|
const { getChatIndexStatus: getChatIndexStatus2 } = await import("./chat-index-DGUOUUQW.js");
|
|
18658
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
18774
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-GJE7HKVK.js");
|
|
18659
18775
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
18660
18776
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
18661
18777
|
const view = buildMemoryStatusView({
|
|
@@ -18678,7 +18794,7 @@ async function handleMemory(args, ctx) {
|
|
|
18678
18794
|
return;
|
|
18679
18795
|
}
|
|
18680
18796
|
if (intent.kind === "recall") {
|
|
18681
|
-
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-
|
|
18797
|
+
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-GJE7HKVK.js");
|
|
18682
18798
|
const { searchChatMemory: searchChatMemory2 } = await import("./chat-index-DGUOUUQW.js");
|
|
18683
18799
|
const persistentHits = searchPersistentMemories2(configDir, intent.query, process.cwd(), 3);
|
|
18684
18800
|
if (persistentHits.length > 0) {
|
|
@@ -18799,7 +18915,7 @@ async function handleMemory(args, ctx) {
|
|
|
18799
18915
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
18800
18916
|
} else if (intent.kind === "export") {
|
|
18801
18917
|
if (args[1] === "md") {
|
|
18802
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
18918
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-GJE7HKVK.js");
|
|
18803
18919
|
ctx.send({
|
|
18804
18920
|
type: "export_data",
|
|
18805
18921
|
format: "md",
|
|
@@ -19804,7 +19920,7 @@ No tools match "${filter}".
|
|
|
19804
19920
|
const { join: join29 } = await import("path");
|
|
19805
19921
|
const { existsSync: existsSync33 } = await import("fs");
|
|
19806
19922
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-VNCA2GU7.js");
|
|
19807
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
19923
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-5CMEFZQB.js");
|
|
19808
19924
|
const { approveProject, hashMcpFile } = await import("./project-trust-MUG325AW.js");
|
|
19809
19925
|
const cwd = process.cwd();
|
|
19810
19926
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -20723,7 +20839,7 @@ function createReviewCommands() {
|
|
|
20723
20839
|
usage: "/test [command|filter]",
|
|
20724
20840
|
async execute(args, ctx) {
|
|
20725
20841
|
try {
|
|
20726
|
-
const { executeTests } = await import("./run-tests-
|
|
20842
|
+
const { executeTests } = await import("./run-tests-V3N7YV3P.js");
|
|
20727
20843
|
const argStr = args.join(" ").trim();
|
|
20728
20844
|
let testArgs = {};
|
|
20729
20845
|
if (argStr) {
|
|
@@ -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-JGEEQ2OE.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-YFDQIUQ3.js";
|
|
28
28
|
import {
|
|
29
29
|
CostTracker,
|
|
30
30
|
getPricing,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
setMaxOutputCap,
|
|
51
51
|
spawnAgentContext,
|
|
52
52
|
undoStack
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-L2RJPVHV.js";
|
|
54
54
|
import "./chunk-HLWUDRBO.js";
|
|
55
55
|
import {
|
|
56
56
|
NO_THINKING,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
countPendingMemories,
|
|
64
64
|
detectStaleLegacyMarkdownEdit,
|
|
65
65
|
formatMemoryForPrompt
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-AHL6KOGM.js";
|
|
67
67
|
import "./chunk-LF67HWWR.js";
|
|
68
68
|
import "./chunk-XJOK5353.js";
|
|
69
69
|
import "./chunk-WQ3OMEC4.js";
|
|
@@ -84,14 +84,14 @@ import {
|
|
|
84
84
|
import {
|
|
85
85
|
loadContextFiles,
|
|
86
86
|
writeCrashLog
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-NQJSPMY2.js";
|
|
88
88
|
import {
|
|
89
89
|
getActivePluginAssets,
|
|
90
90
|
getPendingHookTrust,
|
|
91
91
|
installFlushOnExit,
|
|
92
92
|
mergePluginHooks,
|
|
93
93
|
runLifecycleHooks
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
95
95
|
import "./chunk-RS7SKYTS.js";
|
|
96
96
|
import {
|
|
97
97
|
ProviderRegistry,
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
} from "./chunk-VXEF2SWG.js";
|
|
100
100
|
import {
|
|
101
101
|
ConfigManager
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-AQF6IXSR.js";
|
|
103
103
|
import {
|
|
104
104
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
105
105
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
} from "./chunk-IW3Q7AE5.js";
|
|
134
134
|
import "./chunk-XNFIYS7G.js";
|
|
135
135
|
import "./chunk-4BKXL7SM.js";
|
|
136
|
-
import "./chunk-
|
|
136
|
+
import "./chunk-4W6VDVQU.js";
|
|
137
137
|
import {
|
|
138
138
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
139
139
|
AUTHOR,
|
|
@@ -151,7 +151,7 @@ import {
|
|
|
151
151
|
SKILLS_DIR_NAME,
|
|
152
152
|
VERSION,
|
|
153
153
|
buildUserIdentityPrompt
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
155
155
|
|
|
156
156
|
// src/index.ts
|
|
157
157
|
import { program } from "commander";
|
|
@@ -4062,7 +4062,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
4062
4062
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
4063
4063
|
process.exit(1);
|
|
4064
4064
|
}
|
|
4065
|
-
const { startWebServer } = await import("./server-
|
|
4065
|
+
const { startWebServer } = await import("./server-GGEO7SA2.js");
|
|
4066
4066
|
await startWebServer({ port, host: options.host });
|
|
4067
4067
|
});
|
|
4068
4068
|
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) => {
|
|
@@ -4229,11 +4229,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
4229
4229
|
console.log(footer + "\n");
|
|
4230
4230
|
});
|
|
4231
4231
|
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) => {
|
|
4232
|
-
const { runUsageCli } = await import("./usage-
|
|
4232
|
+
const { runUsageCli } = await import("./usage-B7RIAPPT.js");
|
|
4233
4233
|
await runUsageCli(options);
|
|
4234
4234
|
});
|
|
4235
4235
|
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) => {
|
|
4236
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
4236
|
+
const { runDoctorCli } = await import("./doctor-cli-IOVSHBDI.js");
|
|
4237
4237
|
const argv = process.argv.slice(2);
|
|
4238
4238
|
await runDoctorCli({
|
|
4239
4239
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -4242,7 +4242,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
4242
4242
|
});
|
|
4243
4243
|
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) => {
|
|
4244
4244
|
try {
|
|
4245
|
-
const batch = await import("./batch-
|
|
4245
|
+
const batch = await import("./batch-HMADXNOD.js");
|
|
4246
4246
|
switch (action) {
|
|
4247
4247
|
case "submit":
|
|
4248
4248
|
if (!arg) {
|
|
@@ -4285,7 +4285,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
4285
4285
|
}
|
|
4286
4286
|
});
|
|
4287
4287
|
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) => {
|
|
4288
|
-
const { startMcpServer } = await import("./server-
|
|
4288
|
+
const { startMcpServer } = await import("./server-MO3EU2XD.js");
|
|
4289
4289
|
await startMcpServer({
|
|
4290
4290
|
allowDestructive: !!options.allowDestructive,
|
|
4291
4291
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -4298,7 +4298,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
4298
4298
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
4299
4299
|
process.exit(1);
|
|
4300
4300
|
}
|
|
4301
|
-
const { runPrCli } = await import("./pr-
|
|
4301
|
+
const { runPrCli } = await import("./pr-SXRW24JG.js");
|
|
4302
4302
|
const result = await runPrCli({
|
|
4303
4303
|
action,
|
|
4304
4304
|
target,
|
|
@@ -4318,8 +4318,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
4318
4318
|
process.exit(result.exitCode);
|
|
4319
4319
|
});
|
|
4320
4320
|
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) => {
|
|
4321
|
-
const { runCi } = await import("./ci-
|
|
4322
|
-
const { formatCiResult } = await import("./ci-format-
|
|
4321
|
+
const { runCi } = await import("./ci-QD2Q7NWY.js");
|
|
4322
|
+
const { formatCiResult } = await import("./ci-format-42XIZO5P.js");
|
|
4323
4323
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
4324
4324
|
if (formats > 1) {
|
|
4325
4325
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -4478,7 +4478,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
4478
4478
|
config.get("customProviders"),
|
|
4479
4479
|
config.getConfigDir()
|
|
4480
4480
|
);
|
|
4481
|
-
const { startHub } = await import("./hub-
|
|
4481
|
+
const { startHub } = await import("./hub-ZLF6GMQD.js");
|
|
4482
4482
|
await startHub(
|
|
4483
4483
|
{
|
|
4484
4484
|
topic: topic ?? "",
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CIM2PV2F.js";
|
|
31
31
|
import "./chunk-FSC6KEWU.js";
|
|
32
32
|
import "./chunk-6BUTA5VW.js";
|
|
33
33
|
import "./chunk-CGLYJRFA.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-SJFZPS65.js";
|
|
35
35
|
export {
|
|
36
36
|
addMemoryEntry,
|
|
37
37
|
backupMemoryStore,
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-AHL6KOGM.js";
|
|
32
32
|
import "./chunk-3FEZSLGI.js";
|
|
33
33
|
import "./chunk-HOSJZMQS.js";
|
|
34
34
|
import "./chunk-IW3Q7AE5.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-VAV2IJ3R.js";
|
|
36
36
|
export {
|
|
37
37
|
addMemoryEntry,
|
|
38
38
|
backupMemoryStore,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-3CKJOTVM.js";
|
|
6
|
+
import "./chunk-3TBXHLSC.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-VXEF2SWG.js";
|
|
18
18
|
import {
|
|
19
19
|
ConfigManager
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AQF6IXSR.js";
|
|
21
21
|
import "./chunk-MI4SFZGX.js";
|
|
22
22
|
import "./chunk-TU3L3PW7.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
import {
|
|
25
25
|
VERSION
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/pr.ts
|
|
29
29
|
import { execFileSync } from "child_process";
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
skillHistoryNote,
|
|
82
82
|
snapshotFile,
|
|
83
83
|
stripRoutingTags
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-YFDQIUQ3.js";
|
|
85
85
|
import {
|
|
86
86
|
CNY_PER_USD,
|
|
87
87
|
CostTracker,
|
|
@@ -126,7 +126,7 @@ import {
|
|
|
126
126
|
spawnAgentContext,
|
|
127
127
|
truncateOutput,
|
|
128
128
|
undoStack
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-L2RJPVHV.js";
|
|
130
130
|
import {
|
|
131
131
|
buildReviewPrompt,
|
|
132
132
|
buildSecurityReviewPrompt
|
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
restoreMemoryEntries,
|
|
154
154
|
updateMemoryApproval,
|
|
155
155
|
updateMemoryEntry
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-AHL6KOGM.js";
|
|
157
157
|
import "./chunk-LF67HWWR.js";
|
|
158
158
|
import "./chunk-XJOK5353.js";
|
|
159
159
|
import "./chunk-WQ3OMEC4.js";
|
|
@@ -172,7 +172,7 @@ import {
|
|
|
172
172
|
buildDoctorReport,
|
|
173
173
|
formatDoctorReport,
|
|
174
174
|
loadContextFiles
|
|
175
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-NQJSPMY2.js";
|
|
176
176
|
import {
|
|
177
177
|
describePlugin,
|
|
178
178
|
getActivePluginAssets,
|
|
@@ -187,14 +187,14 @@ import {
|
|
|
187
187
|
runTool,
|
|
188
188
|
setPluginEnabled,
|
|
189
189
|
trustPlugin
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
191
191
|
import "./chunk-RS7SKYTS.js";
|
|
192
192
|
import {
|
|
193
193
|
ProviderRegistry
|
|
194
194
|
} from "./chunk-VXEF2SWG.js";
|
|
195
195
|
import {
|
|
196
196
|
ConfigManager
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-AQF6IXSR.js";
|
|
198
198
|
import {
|
|
199
199
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
200
200
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -225,7 +225,7 @@ import {
|
|
|
225
225
|
maskConfigSecrets
|
|
226
226
|
} from "./chunk-XNFIYS7G.js";
|
|
227
227
|
import "./chunk-4BKXL7SM.js";
|
|
228
|
-
import "./chunk-
|
|
228
|
+
import "./chunk-4W6VDVQU.js";
|
|
229
229
|
import {
|
|
230
230
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
231
231
|
AUTHOR,
|
|
@@ -241,7 +241,7 @@ import {
|
|
|
241
241
|
SKILLS_DIR_NAME,
|
|
242
242
|
VERSION,
|
|
243
243
|
buildUserIdentityPrompt
|
|
244
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
245
245
|
|
|
246
246
|
// src/web/server.ts
|
|
247
247
|
import express from "express";
|
|
@@ -968,7 +968,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
968
968
|
Cost: ${formatCost(cost)}` : "";
|
|
969
969
|
let memoryLine = "";
|
|
970
970
|
try {
|
|
971
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
971
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-MBSBTBGY.js");
|
|
972
972
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
973
973
|
if (pending > 0) memoryLine = `
|
|
974
974
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -1897,7 +1897,7 @@ async function handleTest(args, ctx) {
|
|
|
1897
1897
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
1898
1898
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
1899
1899
|
}
|
|
1900
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
1900
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-EQCAMFQE.js")).executeTests;
|
|
1901
1901
|
const report = await runTests(testArgs);
|
|
1902
1902
|
ctx.send({ type: "info", message: report });
|
|
1903
1903
|
} catch (err) {
|
|
@@ -2173,7 +2173,7 @@ async function handleMemory(args, ctx) {
|
|
|
2173
2173
|
}
|
|
2174
2174
|
if (intent.kind === "status") {
|
|
2175
2175
|
const { getChatIndexStatus } = await import("./chat-index-2D5GK2DB.js");
|
|
2176
|
-
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-
|
|
2176
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-MBSBTBGY.js");
|
|
2177
2177
|
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
2178
2178
|
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
2179
2179
|
const view = buildMemoryStatusView({
|
|
@@ -2196,7 +2196,7 @@ async function handleMemory(args, ctx) {
|
|
|
2196
2196
|
return;
|
|
2197
2197
|
}
|
|
2198
2198
|
if (intent.kind === "recall") {
|
|
2199
|
-
const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-
|
|
2199
|
+
const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-MBSBTBGY.js");
|
|
2200
2200
|
const { searchChatMemory } = await import("./chat-index-2D5GK2DB.js");
|
|
2201
2201
|
const persistentHits = searchPersistentMemories(configDir, intent.query, process.cwd(), 3);
|
|
2202
2202
|
if (persistentHits.length > 0) {
|
|
@@ -2317,7 +2317,7 @@ async function handleMemory(args, ctx) {
|
|
|
2317
2317
|
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
2318
2318
|
} else if (intent.kind === "export") {
|
|
2319
2319
|
if (args[1] === "md") {
|
|
2320
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
2320
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-MBSBTBGY.js");
|
|
2321
2321
|
ctx.send({
|
|
2322
2322
|
type: "export_data",
|
|
2323
2323
|
format: "md",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L2RJPVHV.js";
|
|
5
5
|
import "./chunk-GHWZVPUV.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-AHL6KOGM.js";
|
|
7
7
|
import "./chunk-LF67HWWR.js";
|
|
8
8
|
import "./chunk-XJOK5353.js";
|
|
9
9
|
import "./chunk-WQ3OMEC4.js";
|
|
@@ -14,7 +14,7 @@ import "./chunk-NYNSYLFY.js";
|
|
|
14
14
|
import "./chunk-3FEZSLGI.js";
|
|
15
15
|
import {
|
|
16
16
|
runTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
18
18
|
import "./chunk-RS7SKYTS.js";
|
|
19
19
|
import {
|
|
20
20
|
getDangerLevel,
|
|
@@ -24,10 +24,10 @@ import "./chunk-TU3L3PW7.js";
|
|
|
24
24
|
import "./chunk-HOSJZMQS.js";
|
|
25
25
|
import "./chunk-IW3Q7AE5.js";
|
|
26
26
|
import "./chunk-4BKXL7SM.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-4W6VDVQU.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
31
31
|
|
|
32
32
|
// src/mcp/server.ts
|
|
33
33
|
import { createInterface } from "readline";
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
isToolCapableProvider,
|
|
6
6
|
truncateOutput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-L2RJPVHV.js";
|
|
8
8
|
import "./chunk-GHWZVPUV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-AHL6KOGM.js";
|
|
10
10
|
import "./chunk-LF67HWWR.js";
|
|
11
11
|
import "./chunk-XJOK5353.js";
|
|
12
12
|
import "./chunk-WQ3OMEC4.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-NYNSYLFY.js";
|
|
|
17
17
|
import "./chunk-3FEZSLGI.js";
|
|
18
18
|
import {
|
|
19
19
|
runTool
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5GQL4TSZ.js";
|
|
21
21
|
import "./chunk-RS7SKYTS.js";
|
|
22
22
|
import {
|
|
23
23
|
getDangerLevel,
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
atomicWriteFileSync
|
|
30
30
|
} from "./chunk-IW3Q7AE5.js";
|
|
31
31
|
import "./chunk-4BKXL7SM.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-4W6VDVQU.js";
|
|
33
33
|
import {
|
|
34
34
|
SUBAGENT_ALLOWED_TOOLS
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-VAV2IJ3R.js";
|
|
36
36
|
|
|
37
37
|
// src/hub/task-orchestrator.ts
|
|
38
38
|
import { createInterface } from "readline";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import "./chunk-RS7SKYTS.js";
|
|
10
10
|
import {
|
|
11
11
|
ConfigManager
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AQF6IXSR.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-VAV2IJ3R.js";
|
|
16
16
|
|
|
17
17
|
// src/cli/usage.ts
|
|
18
18
|
function classifyRowCost(row) {
|