jinzd-ai-cli 0.4.317 → 0.4.319
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-OWVPYMTH.js → batch-CQ542WJF.js} +2 -2
- package/dist/{chunk-K2TKTYEH.js → chunk-2PAQOR2X.js} +9 -9
- package/dist/{chunk-LONB36SP.js → chunk-46OEMKQX.js} +0 -2
- package/dist/{chunk-HDHVWGDA.js → chunk-662ZJPJE.js} +1 -1
- package/dist/{chunk-X4GNEJNN.js → chunk-A7YZLLWN.js} +1 -1
- package/dist/{chunk-WJOINCVO.js → chunk-AC44E4CV.js} +28 -16
- package/dist/{chunk-DPWHBIK2.js → chunk-D6BLSFYD.js} +4 -4
- package/dist/{chunk-DOWBL4OI.js → chunk-DCQDFQDW.js} +1 -1
- package/dist/{chunk-6EM2TRG5.js → chunk-GP24X3KJ.js} +1 -1
- package/dist/{chunk-6VBW3L57.js → chunk-GVAAGBHX.js} +2 -1
- package/dist/{chunk-VZBBSBSN.js → chunk-KEOMNFBH.js} +1 -1
- package/dist/{chunk-2Z7SOAPR.js → chunk-N2MHUA4B.js} +5 -5
- package/dist/{chunk-HD7KVZLR.js → chunk-OQZIP4LU.js} +1 -1
- package/dist/{chunk-S73DO2G5.js → chunk-PGQ5OV3P.js} +1 -1
- package/dist/{chunk-VUZCU6BH.js → chunk-SZBSTSG4.js} +4 -4
- package/dist/{chunk-27RIJK3U.js → chunk-Y3SEC5EC.js} +28 -16
- package/dist/{chunk-LZJHXSR3.js → chunk-YHMQMP2I.js} +99 -62
- package/dist/{ci-ED4EZGRM.js → ci-HAPWBC37.js} +6 -6
- package/dist/{ci-format-2ORFD7KF.js → ci-format-NGWP4GTQ.js} +2 -2
- package/dist/{constants-N3AHLPRZ.js → constants-CPHZLOCQ.js} +1 -1
- package/dist/{constants-QX6K72OV.js → constants-GSUK6ILC.js} +1 -1
- package/dist/{doctor-cli-J6NQF6HS.js → doctor-cli-L6AK2GJ7.js} +6 -6
- package/dist/electron-server.js +110 -74
- package/dist/{hub-B6SI42VX.js → hub-TCZFG2ZG.js} +1 -1
- package/dist/index.js +21 -21
- package/dist/{persistent-memory-5VRVOD76.js → persistent-memory-E3UYP7RJ.js} +2 -2
- package/dist/{persistent-memory-6AEA7G2Q.js → persistent-memory-IPNMYXU4.js} +2 -2
- package/dist/{pr-D3A76PY6.js → pr-J5TSU5P6.js} +6 -6
- package/dist/{run-tests-J3N7IM4M.js → run-tests-FLGSE63O.js} +2 -2
- package/dist/{run-tests-UFL7ZB4U.js → run-tests-PDD4KUQL.js} +2 -2
- package/dist/{server-FBIKTICF.js → server-3C6IK3JE.js} +6 -6
- package/dist/{server-NOU4PXEC.js → server-XQ3IQUZ5.js} +16 -16
- package/dist/{task-orchestrator-KT6G2WSM.js → task-orchestrator-544JETWF.js} +6 -6
- package/dist/{usage-QV3RTJ7B.js → usage-MQTA7HHZ.js} +3 -3
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchPersistentMemories,
|
|
12
12
|
touchMemoryReferences,
|
|
13
13
|
updateMemoryEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PGQ5OV3P.js";
|
|
15
15
|
import {
|
|
16
16
|
indexProject
|
|
17
17
|
} from "./chunk-RWRZVQCB.js";
|
|
@@ -30,13 +30,13 @@ import {
|
|
|
30
30
|
runHook,
|
|
31
31
|
runLifecycleHooks,
|
|
32
32
|
runTool
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-662ZJPJE.js";
|
|
34
34
|
import {
|
|
35
35
|
buildTruncatedArgumentsError,
|
|
36
36
|
getDangerLevel,
|
|
37
37
|
isFileWriteTool,
|
|
38
38
|
runLeanAgentLoop
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-GVAAGBHX.js";
|
|
40
40
|
import {
|
|
41
41
|
EnvLoader,
|
|
42
42
|
NetworkError,
|
|
@@ -60,10 +60,11 @@ import {
|
|
|
60
60
|
decodeWindowsBuffer,
|
|
61
61
|
killProcessTree,
|
|
62
62
|
looksLikeGbkMojibake,
|
|
63
|
+
posixShell,
|
|
63
64
|
recoverGbkMojibake,
|
|
64
65
|
runTestsTool,
|
|
65
66
|
shellInvocation
|
|
66
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-Y3SEC5EC.js";
|
|
67
68
|
import {
|
|
68
69
|
CONFIG_DIR_NAME,
|
|
69
70
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -72,7 +73,7 @@ import {
|
|
|
72
73
|
SUBAGENT_ALLOWED_TOOLS,
|
|
73
74
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
74
75
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
75
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-A7YZLLWN.js";
|
|
76
77
|
import {
|
|
77
78
|
getCurrentSessionKey,
|
|
78
79
|
getExecutionConfigDir,
|
|
@@ -84,7 +85,7 @@ import {
|
|
|
84
85
|
import { spawn } from "child_process";
|
|
85
86
|
import { platform } from "os";
|
|
86
87
|
var IS_WINDOWS2 = platform() === "win32";
|
|
87
|
-
var SHELL = IS_WINDOWS2 ? "powershell.exe" :
|
|
88
|
+
var SHELL = IS_WINDOWS2 ? "powershell.exe" : posixShell();
|
|
88
89
|
var pool = /* @__PURE__ */ new Map();
|
|
89
90
|
var IDLE_EVICT_MS = 5 * 6e4;
|
|
90
91
|
var evictionTimer = null;
|
|
@@ -93,7 +94,11 @@ function spawnShell(cwd) {
|
|
|
93
94
|
const proc = spawn(SHELL, shellArgs, {
|
|
94
95
|
cwd,
|
|
95
96
|
windowsHide: true,
|
|
96
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
97
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
98
|
+
// POSIX: own process group, so a timeout / Ctrl+C can kill the whole tree
|
|
99
|
+
// (killProcessTree with processGroup=true). Without it only the shell host
|
|
100
|
+
// died and grandchildren were orphaned (2026-10-07 audit A-01).
|
|
101
|
+
detached: !IS_WINDOWS2
|
|
97
102
|
});
|
|
98
103
|
proc.on("exit", () => {
|
|
99
104
|
for (const [key, entry] of pool) {
|
|
@@ -120,13 +125,17 @@ function startEvictionTimer() {
|
|
|
120
125
|
}
|
|
121
126
|
}, 6e4).unref();
|
|
122
127
|
}
|
|
128
|
+
function stderrMarker(id) {
|
|
129
|
+
return `AICLI_MARKER_ERR:${id}`;
|
|
130
|
+
}
|
|
123
131
|
function buildWrappedCommand(command, id, isWindows) {
|
|
124
132
|
const markerStart = `AICLI_MARKER_START:${id}`;
|
|
125
133
|
const markerEnd = `AICLI_MARKER_END:${id}`;
|
|
126
134
|
if (!isWindows) {
|
|
135
|
+
const quoted = `'${command.replace(/'/g, `'\\''`)}'`;
|
|
127
136
|
return `echo "${markerStart}"
|
|
128
|
-
${
|
|
129
|
-
echo "${markerEnd}
|
|
137
|
+
eval ${quoted} </dev/null
|
|
138
|
+
__aicli_rc=$?; echo "${stderrMarker(id)}" >&2; echo "${markerEnd}:$__aicli_rc"`;
|
|
130
139
|
}
|
|
131
140
|
const b64 = Buffer.from(command, "utf-8").toString("base64");
|
|
132
141
|
const decoded = `[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${b64}'))`;
|
|
@@ -158,32 +167,46 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
158
167
|
const markerStartPattern = `AICLI_MARKER_START:${id}`;
|
|
159
168
|
const markerEndPattern = `AICLI_MARKER_END:${id}`;
|
|
160
169
|
const proc = entry.proc;
|
|
170
|
+
const errMarker = stderrMarker(id);
|
|
171
|
+
const cleanStderr = (s) => {
|
|
172
|
+
const i = s.indexOf(errMarker);
|
|
173
|
+
return i < 0 ? s : s.slice(0, i);
|
|
174
|
+
};
|
|
175
|
+
const checkDone = () => {
|
|
176
|
+
if (resolved) return;
|
|
177
|
+
const parsed = extractPoolOutput(stdout, markerStartPattern, markerEndPattern);
|
|
178
|
+
if (parsed.exitCode === null) return;
|
|
179
|
+
if (!IS_WINDOWS2 && !stderr.includes(errMarker)) return;
|
|
180
|
+
stdout = parsed.output;
|
|
181
|
+
stderr = cleanStderr(stderr);
|
|
182
|
+
resolved = true;
|
|
183
|
+
cleanup();
|
|
184
|
+
resolve7({ stdout, stderr, exitCode: parsed.exitCode, timedOut, aborted });
|
|
185
|
+
};
|
|
161
186
|
const onData = (chunk) => {
|
|
162
187
|
stdout += IS_WINDOWS2 ? decodeWindowsBuffer(chunk) : chunk.toString("utf-8");
|
|
163
|
-
|
|
164
|
-
const endLine = stdout.split("\n").find((l) => l.includes(markerEndPattern));
|
|
165
|
-
const exitCode = endLine ? parseEndMarker(endLine) : null;
|
|
166
|
-
stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
|
|
167
|
-
resolved = true;
|
|
168
|
-
cleanup();
|
|
169
|
-
resolve7({ stdout, stderr, exitCode, timedOut, aborted });
|
|
170
|
-
}
|
|
188
|
+
checkDone();
|
|
171
189
|
};
|
|
172
190
|
const onErr = (chunk) => {
|
|
173
191
|
stderr += IS_WINDOWS2 ? decodeWindowsBuffer(chunk) : chunk.toString("utf-8");
|
|
192
|
+
checkDone();
|
|
174
193
|
};
|
|
175
194
|
const finishPoolFailure = (message, exitCode = null) => {
|
|
176
195
|
if (resolved) return;
|
|
177
196
|
resolved = true;
|
|
178
|
-
stdout =
|
|
197
|
+
stdout = extractPoolOutput(stdout, markerStartPattern, markerEndPattern).output;
|
|
198
|
+
stderr = cleanStderr(stderr);
|
|
179
199
|
stderr += `${stderr ? "\n" : ""}[pool terminated] ${message}`;
|
|
180
200
|
cleanup();
|
|
181
201
|
pool.delete(sessionKey);
|
|
182
|
-
resolve7({ stdout, stderr, exitCode
|
|
202
|
+
resolve7({ stdout, stderr, exitCode, timedOut, aborted });
|
|
183
203
|
};
|
|
184
204
|
const onClose = (code, signal) => {
|
|
185
205
|
const detail = signal ? `signal ${signal}` : `exit code ${code ?? "unknown"}`;
|
|
186
|
-
finishPoolFailure(
|
|
206
|
+
finishPoolFailure(
|
|
207
|
+
`The shell exited before the command finished (${detail}) \u2014 typically an explicit \`exit\`/\`exec\`, or \`set -e\` aborting on a failing command. Shell state (variables, options, functions) was reset; the next command runs in a fresh shell in the same directory.`,
|
|
208
|
+
signal ? null : code
|
|
209
|
+
);
|
|
187
210
|
};
|
|
188
211
|
const onStdinError = (err) => {
|
|
189
212
|
finishPoolFailure(`Shell stdin failed: ${err.message}`);
|
|
@@ -196,10 +219,11 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
196
219
|
if (resolved) return;
|
|
197
220
|
timedOut = true;
|
|
198
221
|
resolved = true;
|
|
199
|
-
stdout =
|
|
222
|
+
stdout = extractPoolOutput(stdout, markerStartPattern, markerEndPattern).output;
|
|
223
|
+
stderr = cleanStderr(stderr);
|
|
200
224
|
cleanup();
|
|
201
225
|
resolve7({ stdout, stderr, exitCode: null, timedOut, aborted });
|
|
202
|
-
killProcessTree(proc);
|
|
226
|
+
killProcessTree(proc, true);
|
|
203
227
|
pool.delete(sessionKey);
|
|
204
228
|
}, timeout);
|
|
205
229
|
const onAbort = () => {
|
|
@@ -207,9 +231,10 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
207
231
|
aborted = true;
|
|
208
232
|
resolved = true;
|
|
209
233
|
cleanup();
|
|
210
|
-
stdout =
|
|
234
|
+
stdout = extractPoolOutput(stdout, markerStartPattern, markerEndPattern).output;
|
|
235
|
+
stderr = cleanStderr(stderr);
|
|
211
236
|
resolve7({ stdout, stderr, exitCode: null, timedOut, aborted });
|
|
212
|
-
killProcessTree(proc);
|
|
237
|
+
killProcessTree(proc, true);
|
|
213
238
|
pool.delete(sessionKey);
|
|
214
239
|
};
|
|
215
240
|
if (abortSignal?.aborted) {
|
|
@@ -241,36 +266,18 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
|
|
|
241
266
|
}
|
|
242
267
|
});
|
|
243
268
|
}
|
|
244
|
-
function
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
|
|
269
|
+
function extractPoolOutput(stdout, startMarker, endMarker) {
|
|
270
|
+
const startMatch = new RegExp(`${escapeRegExp(startMarker)}\\r?\\n`).exec(stdout);
|
|
271
|
+
const bodyStart = startMatch ? startMatch.index + startMatch[0].length : 0;
|
|
272
|
+
const endMatch = new RegExp(`${escapeRegExp(endMarker)}:(\\d+)\\r?\\n`).exec(stdout.slice(bodyStart));
|
|
273
|
+
const body = endMatch ? stdout.slice(bodyStart, bodyStart + endMatch.index) : stdout.slice(bodyStart);
|
|
274
|
+
return {
|
|
275
|
+
output: body.trim(),
|
|
276
|
+
exitCode: endMatch ? Number(endMatch[1]) : null
|
|
277
|
+
};
|
|
249
278
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
252
|
-
let capturing = false;
|
|
253
|
-
const out = [];
|
|
254
|
-
for (const line of lines) {
|
|
255
|
-
if (line.includes(startMarker)) {
|
|
256
|
-
capturing = true;
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
if (line.includes(endMarker)) {
|
|
260
|
-
capturing = false;
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
if (capturing) {
|
|
264
|
-
out.push(line);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
if (!stdout.includes(endMarker) && out.length === 0) {
|
|
268
|
-
const startIdx = stdout.indexOf(startMarker);
|
|
269
|
-
if (startIdx >= 0) {
|
|
270
|
-
return stdout.slice(startIdx + startMarker.length).trimStart();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return out.join("\n").trim();
|
|
279
|
+
function escapeRegExp(s) {
|
|
280
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
274
281
|
}
|
|
275
282
|
function cleanupPoolSession(sessionKey) {
|
|
276
283
|
const entry = pool.get(sessionKey);
|
|
@@ -427,7 +434,7 @@ var undoStack = new UndoStack();
|
|
|
427
434
|
|
|
428
435
|
// src/tools/builtin/bash.ts
|
|
429
436
|
var IS_WINDOWS3 = platform2() === "win32";
|
|
430
|
-
var SHELL2 = IS_WINDOWS3 ? "powershell.exe" :
|
|
437
|
+
var SHELL2 = IS_WINDOWS3 ? "powershell.exe" : posixShell();
|
|
431
438
|
var cwdBySession = /* @__PURE__ */ new Map();
|
|
432
439
|
function getCwd() {
|
|
433
440
|
const key = getCurrentSessionKey();
|
|
@@ -556,7 +563,8 @@ Important rules:
|
|
|
556
563
|
}
|
|
557
564
|
if (timedOut) {
|
|
558
565
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
559
|
-
throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command
|
|
566
|
+
throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command, `${stdout}
|
|
567
|
+
${stderr}`));
|
|
560
568
|
}
|
|
561
569
|
if (status !== 0 || timedOut) {
|
|
562
570
|
const poolStdout = (stdout ?? "").trim();
|
|
@@ -575,7 +583,12 @@ ${combined || formatFailureFallback(status)}
|
|
|
575
583
|
}
|
|
576
584
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
577
585
|
updateCwdFromCommand(command, effectiveCwd);
|
|
578
|
-
|
|
586
|
+
const out = annotateSuccessOutput(command, suppressBinaryOutput(stdout));
|
|
587
|
+
const poolNote = /\[pool terminated\]/.test(stderr ?? "") ? `
|
|
588
|
+
|
|
589
|
+
${(stderr ?? "").trim()}` : "";
|
|
590
|
+
const body = out ? out + poolNote : emptyOutputResult(command, stderr ?? "");
|
|
591
|
+
return body + backgroundJobNote(command);
|
|
579
592
|
}
|
|
580
593
|
try {
|
|
581
594
|
const { stdout, stderr, status, signal, timedOut, aborted } = await runShell(
|
|
@@ -612,17 +625,18 @@ ${combined || formatFailureFallback(status)}
|
|
|
612
625
|
updateCwdFromCommand(command, effectiveCwd);
|
|
613
626
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
614
627
|
const result = Buffer.isBuffer(stdout) ? IS_WINDOWS3 ? decodeWindowsBuffer(stdout) : stdout.toString("utf-8") : String(stdout ?? "");
|
|
615
|
-
return annotateSuccessOutput(command, result) || emptyOutputResult(
|
|
628
|
+
return (annotateSuccessOutput(command, suppressBinaryOutput(result)) || emptyOutputResult(
|
|
616
629
|
command,
|
|
617
630
|
Buffer.isBuffer(stderr) ? IS_WINDOWS3 ? decodeWindowsBuffer(stderr) : stderr.toString("utf-8") : String(stderr ?? "")
|
|
618
|
-
);
|
|
631
|
+
)) + backgroundJobNote(command);
|
|
619
632
|
} catch (err) {
|
|
620
633
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
621
634
|
if (err && typeof err === "object") {
|
|
622
635
|
const execErr = err;
|
|
623
636
|
const isTimeout = execErr.code === "ETIMEDOUT" || execErr.status == null && execErr.signal === "SIGTERM" || /ETIMEDOUT/i.test(execErr.message ?? "");
|
|
624
637
|
if (isTimeout) {
|
|
625
|
-
|
|
638
|
+
const captured = [execErr.stdout, execErr.stderr].map((b) => Buffer.isBuffer(b) ? IS_WINDOWS3 ? decodeWindowsBuffer(b) : b.toString("utf-8") : String(b ?? "")).join("\n");
|
|
639
|
+
throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command, captured));
|
|
626
640
|
}
|
|
627
641
|
if ("status" in execErr && execErr.status !== void 0) {
|
|
628
642
|
const stderr = IS_WINDOWS3 && Buffer.isBuffer(execErr.stderr) ? decodeWindowsBuffer(execErr.stderr).trim() : execErr.stderr?.toString().trim() ?? "";
|
|
@@ -655,8 +669,15 @@ function looksLikeTestCommand(command) {
|
|
|
655
669
|
/(?:^|[;&|(\s])(?:go|cargo)\s+test\b/.test(command)
|
|
656
670
|
);
|
|
657
671
|
}
|
|
658
|
-
|
|
672
|
+
var TIMEOUT_CAPTURE_MAX = 2e3;
|
|
673
|
+
function formatTimeoutMessage(timeout, maxTimeout, command, captured) {
|
|
659
674
|
const seconds = Math.round(timeout / 1e3);
|
|
675
|
+
const tail = (captured ?? "").trim();
|
|
676
|
+
const capturedSection = tail ? [
|
|
677
|
+
"Output captured before the timeout (last part \u2014 the cause is often here):",
|
|
678
|
+
tail.length > TIMEOUT_CAPTURE_MAX ? "\u2026" + tail.slice(-TIMEOUT_CAPTURE_MAX) : tail,
|
|
679
|
+
""
|
|
680
|
+
] : [];
|
|
660
681
|
const testRunnerHint = command !== void 0 && looksLikeTestCommand(command) ? [
|
|
661
682
|
"This looks like a TEST run. Prefer the 'run_tests' tool instead of running the test runner through bash: it has a 5-minute timeout, auto-detects the framework, and returns a structured summary (no findstr/grep filtering needed).",
|
|
662
683
|
""
|
|
@@ -664,6 +685,7 @@ function formatTimeoutMessage(timeout, maxTimeout, command) {
|
|
|
664
685
|
return [
|
|
665
686
|
`Command timed out after ${seconds}s.`,
|
|
666
687
|
"",
|
|
688
|
+
...capturedSection,
|
|
667
689
|
...testRunnerHint,
|
|
668
690
|
"The previous command ran for longer than the timeout limit and was killed. This usually means it is scanning a large filesystem tree (recursive Get-ChildItem / find), compressing a big archive, or waiting on a network request.",
|
|
669
691
|
"",
|
|
@@ -836,6 +858,19 @@ ${err}`;
|
|
|
836
858
|
return detectPowerShellBackslashQuote(command) ? base + BACKSLASH_QUOTE_SILENT_WARNING : base;
|
|
837
859
|
}
|
|
838
860
|
var PS_TEXT_READ_CMDLET = /\b(?:Get-Content|gc|cat|type|Select-String|sls|Import-Csv)\b/i;
|
|
861
|
+
function suppressBinaryOutput(stdout) {
|
|
862
|
+
if (!stdout) return stdout;
|
|
863
|
+
const sample = stdout.slice(0, 8e3);
|
|
864
|
+
const replacement = (sample.match(/\uFFFD/g) ?? []).length;
|
|
865
|
+
if (!sample.includes("\0") && !(sample.length >= 64 && replacement / sample.length > 0.3)) {
|
|
866
|
+
return stdout;
|
|
867
|
+
}
|
|
868
|
+
return `[binary output suppressed: ${Buffer.byteLength(stdout, "utf-8")} bytes. Inspect it with a hex dump limited in size (e.g. \`xxd file | head -20\`), or use \`file\` to identify the type.]`;
|
|
869
|
+
}
|
|
870
|
+
function backgroundJobNote(command) {
|
|
871
|
+
if (IS_WINDOWS3 || !/(?:^|\s)&(?![&>])/m.test(command)) return "";
|
|
872
|
+
return "\n\n[Note: this command started a background job (`&`). It is not tracked by aicli \u2014 task_list/task_stop cannot see it and it keeps running after this session. For long-running processes (dev servers, watchers) prefer task_create.]";
|
|
873
|
+
}
|
|
839
874
|
function annotateSuccessOutput(command, stdout) {
|
|
840
875
|
if (!IS_WINDOWS3 || !PS_TEXT_READ_CMDLET.test(command)) return stdout;
|
|
841
876
|
if (!looksLikeGbkMojibake(stdout)) return stdout;
|
|
@@ -1013,7 +1048,9 @@ function runShell(command, opts) {
|
|
|
1013
1048
|
cwd: opts.cwd,
|
|
1014
1049
|
env: opts.env,
|
|
1015
1050
|
windowsHide: true,
|
|
1016
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
1051
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1052
|
+
// POSIX: own process group so killChild can take the whole tree down (A-01).
|
|
1053
|
+
detached: !IS_WINDOWS3
|
|
1017
1054
|
});
|
|
1018
1055
|
const stdoutChunks = [];
|
|
1019
1056
|
const stderrChunks = [];
|
|
@@ -1070,7 +1107,7 @@ function runShell(command, opts) {
|
|
|
1070
1107
|
});
|
|
1071
1108
|
}
|
|
1072
1109
|
function killChild(child) {
|
|
1073
|
-
killProcessTree(child);
|
|
1110
|
+
killProcessTree(child, true);
|
|
1074
1111
|
}
|
|
1075
1112
|
function updateCwdFromCommand(command, baseCwd) {
|
|
1076
1113
|
const cdMatches = [...command.matchAll(/(?:^|[;&|])\s*cd\s+(['"]?)([^\s;&|'"]+)\1/g)];
|
|
@@ -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-SZBSTSG4.js";
|
|
7
|
+
import "./chunk-OQZIP4LU.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-N2MHUA4B.js";
|
|
11
|
+
import "./chunk-KEOMNFBH.js";
|
|
12
|
+
import "./chunk-GVAAGBHX.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-BMLQPSHP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-A7YZLLWN.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-D6BLSFYD.js";
|
|
6
|
+
import "./chunk-662ZJPJE.js";
|
|
7
7
|
import "./chunk-RS7SKYTS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-N2MHUA4B.js";
|
|
9
|
+
import "./chunk-KEOMNFBH.js";
|
|
10
|
+
import "./chunk-GVAAGBHX.js";
|
|
11
11
|
import "./chunk-TU3L3PW7.js";
|
|
12
12
|
import "./chunk-HOSJZMQS.js";
|
|
13
13
|
import "./chunk-BMLQPSHP.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-A7YZLLWN.js";
|
|
15
15
|
export {
|
|
16
16
|
formatDoctorReport,
|
|
17
17
|
runDoctorCli
|