jinzd-ai-cli 0.4.294 → 0.4.297
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-6YCLYEII.js → batch-YFQ34DHW.js} +2 -2
- package/dist/{chunk-FARHJ42Q.js → chunk-3GIKUDYZ.js} +4 -4
- package/dist/{chunk-MMP6SIB7.js → chunk-56AX43FT.js} +1 -1
- package/dist/{chunk-CUMSLQKQ.js → chunk-6PBWL3XI.js} +1 -1
- package/dist/{chunk-HBFES3RR.js → chunk-CF6RC7OB.js} +4 -4
- package/dist/{chunk-UPJMIP5S.js → chunk-D7GLDXPQ.js} +1 -1
- package/dist/{chunk-AIQMQCVF.js → chunk-DPNKOXJF.js} +48 -11
- package/dist/{chunk-SM7VOJ3B.js → chunk-EFHAMIQF.js} +204 -167
- package/dist/{chunk-QKZUWT3S.js → chunk-FBOVBL7P.js} +12 -1
- package/dist/{chunk-BOG6LVIC.js → chunk-FZUMKY6C.js} +1 -1
- package/dist/{chunk-3H7TVTAE.js → chunk-GNJ3XLS3.js} +1 -1
- package/dist/{chunk-7KYONZUN.js → chunk-J6CYL6RN.js} +1 -1
- package/dist/{chunk-P3BJAJ34.js → chunk-LXORMKZ6.js} +1 -1
- package/dist/{chunk-OMA6DEAR.js → chunk-NB2V7H5C.js} +1 -1
- package/dist/{chunk-ZBHRTOWC.js → chunk-O33BYKAD.js} +1 -1
- package/dist/{chunk-4J6R2VFW.js → chunk-YKJO3SI4.js} +33 -4
- package/dist/{ci-SIS77LEG.js → ci-AR2RLLJD.js} +5 -5
- package/dist/{ci-format-LRMGY4ND.js → ci-format-S7RRDV4A.js} +2 -2
- package/dist/{constants-QRUMNMCK.js → constants-VZBWOKZZ.js} +1 -1
- package/dist/{constants-C7LOS6F4.js → constants-W52VYKDV.js} +1 -1
- package/dist/{doctor-cli-UB5KUBVI.js → doctor-cli-VX36CZND.js} +5 -5
- package/dist/electron-server.js +138 -24
- package/dist/{hub-UWBNCMD4.js → hub-LJL3X7KR.js} +1 -1
- package/dist/index.js +24 -23
- package/dist/{persistent-memory-TUCWY6O3.js → persistent-memory-CMXW4WSP.js} +2 -2
- package/dist/{persistent-memory-GQPXSWDK.js → persistent-memory-WEZMJBIV.js} +2 -2
- package/dist/{pr-MVUT6IOA.js → pr-GTDFMNKY.js} +5 -5
- package/dist/{run-tests-RSIXZR3O.js → run-tests-ILHN2PYU.js} +2 -2
- package/dist/{run-tests-BNKQT42K.js → run-tests-MTWA2NNV.js} +2 -2
- package/dist/{server-ILSFJUK5.js → server-QXP5NHE7.js} +15 -15
- package/dist/{server-YNVHKFGZ.js → server-WFXEEX2E.js} +5 -5
- package/dist/{task-orchestrator-7YEWEKS6.js → task-orchestrator-HZPIN4PT.js} +5 -5
- package/dist/{usage-DXX4VHOQ.js → usage-UEN6LLOG.js} +3 -3
- package/package.json +3 -1
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-RS7SKYTS.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-O33BYKAD.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-6PBWL3XI.js";
|
|
13
13
|
|
|
14
14
|
// src/cli/batch.ts
|
|
15
15
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listHooks,
|
|
9
9
|
listInstalledPlugins,
|
|
10
10
|
resetStats
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FZUMKY6C.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FBOVBL7P.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-O33BYKAD.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-6PBWL3XI.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GNJ3XLS3.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
} from "./chunk-6YZEZFX5.js";
|
|
14
14
|
import {
|
|
15
15
|
ProviderRegistry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FBOVBL7P.js";
|
|
17
17
|
import {
|
|
18
18
|
ConfigManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-O33BYKAD.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6PBWL3XI.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/ci.ts
|
|
25
25
|
import { execFileSync } from "child_process";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchPersistentMemories,
|
|
12
12
|
touchMemoryReferences,
|
|
13
13
|
updateMemoryEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-J6CYL6RN.js";
|
|
15
15
|
import {
|
|
16
16
|
indexProject
|
|
17
17
|
} from "./chunk-4DEMGCK4.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
runHook,
|
|
31
31
|
runLifecycleHooks,
|
|
32
32
|
runTool
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-FZUMKY6C.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-56AX43FT.js";
|
|
54
54
|
import {
|
|
55
55
|
CONFIG_DIR_NAME,
|
|
56
56
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
SUBAGENT_ALLOWED_TOOLS,
|
|
59
59
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
60
60
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-6PBWL3XI.js";
|
|
62
62
|
|
|
63
63
|
// src/tools/shell-pool.ts
|
|
64
64
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -532,7 +532,8 @@ Important rules:
|
|
|
532
532
|
3. Multiple commands can be combined with semicolons in a single call to reduce rounds.
|
|
533
533
|
4. To delete directories, use Remove-Item -Recurse (the system will automatically optimize to a more reliable method).
|
|
534
534
|
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
|
|
535
|
-
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)
|
|
535
|
+
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).
|
|
536
|
+
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").` : `Execute commands in ${SHELL2}.
|
|
536
537
|
Important rules:
|
|
537
538
|
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".
|
|
538
539
|
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.
|
|
@@ -650,7 +651,7 @@ ${combined || formatFailureFallback(status)}
|
|
|
650
651
|
}
|
|
651
652
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
652
653
|
updateCwdFromCommand(command, effectiveCwd);
|
|
653
|
-
return stdout ||
|
|
654
|
+
return stdout || emptyOutputResult(command);
|
|
654
655
|
}
|
|
655
656
|
try {
|
|
656
657
|
const { stdout, stderr, status, signal, timedOut, aborted } = await runShell(
|
|
@@ -687,7 +688,7 @@ ${combined || formatFailureFallback(status)}
|
|
|
687
688
|
updateCwdFromCommand(command, effectiveCwd);
|
|
688
689
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
689
690
|
const result = Buffer.isBuffer(stdout) ? IS_WINDOWS3 ? decodeWindowsBuffer(stdout) : stdout.toString("utf-8") : String(stdout ?? "");
|
|
690
|
-
return result ||
|
|
691
|
+
return result || emptyOutputResult(command);
|
|
691
692
|
} catch (err) {
|
|
692
693
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
693
694
|
if (err && typeof err === "object") {
|
|
@@ -768,6 +769,30 @@ function fixWindowsDeleteCommand(command) {
|
|
|
768
769
|
}
|
|
769
770
|
);
|
|
770
771
|
}
|
|
772
|
+
function detectPowerShellBackslashQuote(command) {
|
|
773
|
+
if (!IS_WINDOWS3) return false;
|
|
774
|
+
let inSingle = false;
|
|
775
|
+
let inDouble = false;
|
|
776
|
+
for (let i = 0; i < command.length; i++) {
|
|
777
|
+
const ch = command[i];
|
|
778
|
+
if (ch === "\\" && command[i + 1] === '"') {
|
|
779
|
+
if (inDouble && !inSingle) return true;
|
|
780
|
+
i++;
|
|
781
|
+
continue;
|
|
782
|
+
}
|
|
783
|
+
if (ch === "'" && !inDouble) inSingle = !inSingle;
|
|
784
|
+
else if (ch === '"' && !inSingle) inDouble = !inDouble;
|
|
785
|
+
}
|
|
786
|
+
return false;
|
|
787
|
+
}
|
|
788
|
+
var BACKSLASH_QUOTE_SILENT_WARNING = `
|
|
789
|
+
|
|
790
|
+
\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.
|
|
791
|
+
Fix: write the payload to a local file with the 'write_file' tool, then 'scp' it over and run 'ssh host "psql -d <db> -f /tmp/x.sql"' (single level of quoting). Inside PowerShell strings, escape a quote with \`" or "" \u2014 never \\".`;
|
|
792
|
+
function emptyOutputResult(command) {
|
|
793
|
+
const base = "(command completed with no output)";
|
|
794
|
+
return detectPowerShellBackslashQuote(command) ? base + BACKSLASH_QUOTE_SILENT_WARNING : base;
|
|
795
|
+
}
|
|
771
796
|
function buildErrorHint(command, stderr) {
|
|
772
797
|
const hints = [];
|
|
773
798
|
if (IS_WINDOWS3 && /\|\|/.test(command) && /(\|\||is not a valid argument|不是此版本中的有效|ParserError|Unexpected token)/i.test(stderr)) {
|
|
@@ -814,6 +839,11 @@ function buildErrorHint(command, stderr) {
|
|
|
814
839
|
`Hint: PostgreSQL says column "${colMissing[1]}" does not exist. Do NOT retry with a guess \u2014 query the actual schema first: \`psql -c "\\d <table>"\` or \`SELECT column_name FROM information_schema.columns WHERE table_name='<table>';\`. Common pitfall: not every table has a 'deleted' soft-delete column.`
|
|
815
840
|
);
|
|
816
841
|
}
|
|
842
|
+
if (detectPowerShellBackslashQuote(command) && !/^\s*ssh\b/.test(command) && /(syntax error|unexpected|ParserError|parser|意外的|语法|所在位置\s+行|EOF)/i.test(stderr)) {
|
|
843
|
+
hints.push(
|
|
844
|
+
`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").`
|
|
845
|
+
);
|
|
846
|
+
}
|
|
817
847
|
return hints.length > 0 ? hints.map((h) => `\u{1F4A1} ${h}`).join("\n\n") : null;
|
|
818
848
|
}
|
|
819
849
|
function detectBlockingCommand(command) {
|
|
@@ -2474,7 +2504,8 @@ var ToolExecutor = class {
|
|
|
2474
2504
|
return Promise.all(calls.map((call) => this.execute(call)));
|
|
2475
2505
|
}
|
|
2476
2506
|
console.log();
|
|
2477
|
-
|
|
2507
|
+
const roundBadge = this.totalRounds > 0 ? theme.dim(` [${this.round}/${this.totalRounds}]`) : "";
|
|
2508
|
+
console.log(theme.heading(`\u270E Batch file writes (${calls.length} files):`) + roundBadge);
|
|
2478
2509
|
console.log(theme.dim("\u2500".repeat(50)));
|
|
2479
2510
|
for (let i = 0; i < calls.length; i++) {
|
|
2480
2511
|
const call = calls[i];
|
|
@@ -2860,9 +2891,15 @@ var subAgentGuard = {
|
|
|
2860
2891
|
active: false
|
|
2861
2892
|
};
|
|
2862
2893
|
|
|
2894
|
+
// src/tools/text-metrics.ts
|
|
2895
|
+
function countTextLines(text) {
|
|
2896
|
+
if (text === "") return 0;
|
|
2897
|
+
return text.replace(/\n$/, "").split("\n").length;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2863
2900
|
// src/tools/builtin/write-file.ts
|
|
2864
2901
|
function countFileLines(filePath) {
|
|
2865
|
-
return readFileSync5(filePath, "utf-8")
|
|
2902
|
+
return countTextLines(readFileSync5(filePath, "utf-8"));
|
|
2866
2903
|
}
|
|
2867
2904
|
var writeFileTool = {
|
|
2868
2905
|
definition: {
|
|
@@ -2921,7 +2958,7 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
|
|
|
2921
2958
|
} else {
|
|
2922
2959
|
atomicWriteFileSync(filePath, encoding === "utf-8" || encoding === "utf8" ? content : Buffer.from(content, encoding));
|
|
2923
2960
|
}
|
|
2924
|
-
const lines = content
|
|
2961
|
+
const lines = countTextLines(content);
|
|
2925
2962
|
const bytes = Buffer.byteLength(content, encoding);
|
|
2926
2963
|
const mode = appendMode ? "appended" : "written";
|
|
2927
2964
|
void (async () => {
|
|
@@ -4777,7 +4814,7 @@ Any of these triggers means use save_last_response, NOT write_file:
|
|
|
4777
4814
|
undoStack.push(filePath, `save_last_response: ${filePath}`);
|
|
4778
4815
|
mkdirSync2(dirname4(filePath), { recursive: true });
|
|
4779
4816
|
atomicWriteFileSync(filePath, content);
|
|
4780
|
-
const lines = content
|
|
4817
|
+
const lines = countTextLines(content);
|
|
4781
4818
|
return `File saved: ${filePath} (${lines} lines, ${Buffer.byteLength(content, "utf-8")} bytes)`;
|
|
4782
4819
|
}
|
|
4783
4820
|
};
|