jinzd-ai-cli 0.4.251 → 0.4.253
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-S4ZNQSLB.js → batch-TPW2SM6G.js} +2 -2
- package/dist/{chunk-WAMQOWD7.js → chunk-2JHYZUQE.js} +1 -1
- package/dist/{chunk-TOLUJH7J.js → chunk-ABMMKA5S.js} +1 -1
- package/dist/{chunk-KKUQYOJ2.js → chunk-BZNTSGLQ.js} +74 -20
- package/dist/{chunk-BPIQVHMP.js → chunk-M2QHKPRA.js} +1 -1
- package/dist/{chunk-JNBI6LWS.js → chunk-OWCEONX7.js} +1 -1
- package/dist/{chunk-JIFN4ZTW.js → chunk-P5JUXUBS.js} +2 -2
- package/dist/{chunk-O3XSFPYH.js → chunk-PSXIVQ3N.js} +14 -6
- package/dist/{chunk-TL2OVINO.js → chunk-Q4KBR2SG.js} +1 -1
- package/dist/{chunk-7LCBW23G.js → chunk-RPYNPLIE.js} +1 -1
- package/dist/{chunk-AU25ALMG.js → chunk-SC6FMQLH.js} +4 -4
- package/dist/{chunk-SJTKGZTS.js → chunk-UMW33EEH.js} +1 -1
- package/dist/{chunk-PPLGNBAM.js → chunk-USG3ASQ2.js} +1 -1
- package/dist/{chunk-BWKVP5MG.js → chunk-YMHARKR6.js} +1 -1
- package/dist/{chunk-OOLE7AB4.js → chunk-YWG5KKSL.js} +4 -4
- package/dist/{chunk-2QZMITSL.js → chunk-ZRBGH245.js} +5 -4
- package/dist/{ci-CBYMGT6N.js → ci-DYTVVEBO.js} +6 -6
- package/dist/{ci-format-BL33TQJQ.js → ci-format-QTSA6FJJ.js} +2 -2
- package/dist/{constants-OBL6KZZH.js → constants-7KSDW6RF.js} +1 -1
- package/dist/{doctor-cli-EPQYJPFE.js → doctor-cli-ZOIMXV4C.js} +6 -6
- package/dist/electron-server.js +98 -28
- package/dist/{hub-XDXDCDAE.js → hub-6L2UCZAU.js} +1 -1
- package/dist/index.js +21 -21
- package/dist/{persistent-memory-INKFBSYN.js → persistent-memory-HQKE5X7Z.js} +2 -2
- package/dist/{persistent-memory-BYENYJ2N.js → persistent-memory-QOT2TQCT.js} +2 -2
- package/dist/{pr-TQSLLQOK.js → pr-HMOXDXWR.js} +6 -6
- package/dist/{run-tests-NXCN4BG3.js → run-tests-JVQU3RAN.js} +2 -2
- package/dist/{run-tests-GYAYL4QO.js → run-tests-RSYTYFZF.js} +2 -2
- package/dist/{server-YAUZBOBR.js → server-O2YQGG72.js} +6 -6
- package/dist/{server-GEESDASL.js → server-VOIG5VKM.js} +23 -13
- package/dist/{task-orchestrator-XYXSWZ2W.js → task-orchestrator-PLP3INNN.js} +6 -6
- package/dist/{usage-MTCEERXQ.js → usage-3EQUVK37.js} +2 -2
- package/package.json +1 -1
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-2JHYZUQE.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-RPYNPLIE.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-UMW33EEH.js";
|
|
77
77
|
import {
|
|
78
78
|
hasSemanticIndex,
|
|
79
79
|
semanticSearch
|
|
@@ -2307,10 +2307,10 @@ var ThinkTagFilter = class {
|
|
|
2307
2307
|
return "";
|
|
2308
2308
|
}
|
|
2309
2309
|
};
|
|
2310
|
-
function
|
|
2310
|
+
function parseToolCallArguments(raw, onWarn) {
|
|
2311
2311
|
const argStr = raw || "{}";
|
|
2312
2312
|
try {
|
|
2313
|
-
return JSON.parse(argStr);
|
|
2313
|
+
return { args: JSON.parse(argStr), status: "ok" };
|
|
2314
2314
|
} catch {
|
|
2315
2315
|
const truncated = argStr.trimEnd();
|
|
2316
2316
|
const lastComma = truncated.lastIndexOf(",");
|
|
@@ -2318,13 +2318,18 @@ function repairToolCallArguments(raw, onWarn) {
|
|
|
2318
2318
|
try {
|
|
2319
2319
|
const repaired = JSON.parse(fixed);
|
|
2320
2320
|
onWarn?.("Tool call JSON was truncated and auto-repaired. Some parameters may be missing.");
|
|
2321
|
-
return repaired;
|
|
2321
|
+
return { args: repaired, status: "repaired" };
|
|
2322
2322
|
} catch {
|
|
2323
2323
|
onWarn?.("Tool call JSON could not be parsed, using empty arguments.");
|
|
2324
|
-
return {};
|
|
2324
|
+
return { args: {}, status: "failed" };
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
+
function buildTruncatedArgumentsError(toolName, status, parsedKeys) {
|
|
2329
|
+
const lost = status === "failed" ? "The arguments JSON was cut off and could not be parsed at all." : `The arguments JSON was cut off mid-way; only these keys survived: ${parsedKeys.join(", ") || "(none)"}. Any remaining value is incomplete.`;
|
|
2330
|
+
const longContentHint = toolName === "write_file" || toolName === "edit_file" ? " For long documents (300+ lines / 3 KB+), do NOT retry write_file \u2014 use `save_last_response`, which streams the document straight to disk without an argument size limit." : "";
|
|
2331
|
+
return `[${toolName}] NOT EXECUTED \u2014 the model output hit its length limit while emitting this tool call, so the arguments were truncated. ${lost} Nothing was written or changed. Retry with a smaller payload: split the work into several calls, or shorten the arguments.${longContentHint}`;
|
|
2332
|
+
}
|
|
2328
2333
|
async function consumeToolCallStream(stream, hooks = {}) {
|
|
2329
2334
|
const textParts = [];
|
|
2330
2335
|
const accumulators = /* @__PURE__ */ new Map();
|
|
@@ -2397,10 +2402,12 @@ async function consumeToolCallStream(stream, hooks = {}) {
|
|
|
2397
2402
|
}
|
|
2398
2403
|
const toolCalls = [];
|
|
2399
2404
|
for (const [, acc] of accumulators) {
|
|
2405
|
+
const parsed = parseToolCallArguments(acc.arguments, hooks.onWarn);
|
|
2400
2406
|
toolCalls.push({
|
|
2401
2407
|
id: acc.id,
|
|
2402
2408
|
name: acc.name,
|
|
2403
|
-
arguments:
|
|
2409
|
+
arguments: parsed.args,
|
|
2410
|
+
...parsed.status === "ok" ? {} : { argumentsTruncated: parsed.status }
|
|
2404
2411
|
});
|
|
2405
2412
|
}
|
|
2406
2413
|
if (toolCalls.length > 0) {
|
|
@@ -2986,7 +2993,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
2986
2993
|
const reasoningContent = message.reasoning_content;
|
|
2987
2994
|
if (message.tool_calls && message.tool_calls.length > 0) {
|
|
2988
2995
|
const toolCalls = message.tool_calls.map((tc) => {
|
|
2989
|
-
const
|
|
2996
|
+
const parsed = parseToolCallArguments(
|
|
2990
2997
|
tc.function.arguments || "{}",
|
|
2991
2998
|
(m) => process.stderr.write(`[warn] ${m}
|
|
2992
2999
|
`)
|
|
@@ -2994,7 +3001,8 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
2994
3001
|
return {
|
|
2995
3002
|
id: tc.id,
|
|
2996
3003
|
name: tc.function.name,
|
|
2997
|
-
arguments:
|
|
3004
|
+
arguments: parsed.args,
|
|
3005
|
+
...parsed.status === "ok" ? {} : { argumentsTruncated: parsed.status }
|
|
2998
3006
|
};
|
|
2999
3007
|
});
|
|
3000
3008
|
return { toolCalls, usage, reasoningContent };
|
|
@@ -7157,6 +7165,15 @@ var ToolExecutor = class {
|
|
|
7157
7165
|
isError: true
|
|
7158
7166
|
};
|
|
7159
7167
|
}
|
|
7168
|
+
if (call.argumentsTruncated) {
|
|
7169
|
+
const message = buildTruncatedArgumentsError(
|
|
7170
|
+
call.name,
|
|
7171
|
+
call.argumentsTruncated,
|
|
7172
|
+
Object.keys(call.arguments)
|
|
7173
|
+
);
|
|
7174
|
+
console.log(theme.warning(` \u26A0 ${call.name}: arguments truncated by output limit \u2014 not executed`));
|
|
7175
|
+
return { callId: call.id, content: message, isError: true };
|
|
7176
|
+
}
|
|
7160
7177
|
const dangerLevel = getDangerLevel(call.name, call.arguments);
|
|
7161
7178
|
let toolCallAlreadyPrinted = false;
|
|
7162
7179
|
runHook(this.hookConfig?.preToolExecution, {
|
|
@@ -7767,6 +7784,30 @@ var subAgentGuard = {
|
|
|
7767
7784
|
active: false
|
|
7768
7785
|
};
|
|
7769
7786
|
|
|
7787
|
+
// src/tools/arg-aliases.ts
|
|
7788
|
+
function pickArg(args, canonical, aliases) {
|
|
7789
|
+
if (args[canonical] !== void 0 && args[canonical] !== null) return args[canonical];
|
|
7790
|
+
for (const alias of aliases) {
|
|
7791
|
+
if (args[alias] !== void 0 && args[alias] !== null) return args[alias];
|
|
7792
|
+
}
|
|
7793
|
+
return void 0;
|
|
7794
|
+
}
|
|
7795
|
+
var OLD_STR_ALIASES = ["old_string", "oldStr", "oldString", "old_text", "search"];
|
|
7796
|
+
var NEW_STR_ALIASES = ["new_string", "newStr", "newString", "new_text", "replace"];
|
|
7797
|
+
var CONTENT_ALIASES = ["file_text", "text", "contents", "data"];
|
|
7798
|
+
var INSERT_LINE_ALIASES = ["insert_line", "line", "after_line"];
|
|
7799
|
+
var INSERT_CONTENT_ALIASES = ["content", "new_str", "text"];
|
|
7800
|
+
function normalizeReplaceArgs(raw) {
|
|
7801
|
+
const oldStr = pickArg(raw, "old_str", OLD_STR_ALIASES);
|
|
7802
|
+
if (oldStr === void 0) return void 0;
|
|
7803
|
+
return { old_str: oldStr, new_str: pickArg(raw, "new_str", NEW_STR_ALIASES) };
|
|
7804
|
+
}
|
|
7805
|
+
function describeReceivedKeys(args) {
|
|
7806
|
+
const keys = Object.keys(args).filter((k) => args[k] !== void 0);
|
|
7807
|
+
if (keys.length === 0) return " (no arguments received)";
|
|
7808
|
+
return ` Received keys: ${keys.join(", ")}.`;
|
|
7809
|
+
}
|
|
7810
|
+
|
|
7770
7811
|
// src/tools/builtin/write-file.ts
|
|
7771
7812
|
var writeFileTool = {
|
|
7772
7813
|
definition: {
|
|
@@ -7805,7 +7846,8 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
|
|
|
7805
7846
|
},
|
|
7806
7847
|
async execute(args) {
|
|
7807
7848
|
const filePath = String(args["path"] ?? args["file"] ?? "");
|
|
7808
|
-
const
|
|
7849
|
+
const contentArg = pickArg(args, "content", CONTENT_ALIASES);
|
|
7850
|
+
const content = String(contentArg ?? "");
|
|
7809
7851
|
const encoding = args["encoding"] ?? "utf-8";
|
|
7810
7852
|
const appendMode = String(args["append"] ?? "false").toLowerCase() === "true";
|
|
7811
7853
|
if (!filePath) throw new ToolError("write_file", "path is required");
|
|
@@ -7822,9 +7864,10 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
|
|
|
7822
7864
|
if (appendMode) {
|
|
7823
7865
|
appendFileSync(filePath, content, encoding);
|
|
7824
7866
|
} else {
|
|
7825
|
-
atomicWriteFileSync(filePath, content);
|
|
7867
|
+
atomicWriteFileSync(filePath, encoding === "utf-8" || encoding === "utf8" ? content : Buffer.from(content, encoding));
|
|
7826
7868
|
}
|
|
7827
7869
|
const lines = content.split("\n").length;
|
|
7870
|
+
const bytes = Buffer.byteLength(content, encoding);
|
|
7828
7871
|
const mode = appendMode ? "appended" : "written";
|
|
7829
7872
|
void (async () => {
|
|
7830
7873
|
try {
|
|
@@ -7833,7 +7876,7 @@ Do NOT split a long document into many write_file(append=true) calls. That patte
|
|
|
7833
7876
|
} catch {
|
|
7834
7877
|
}
|
|
7835
7878
|
})();
|
|
7836
|
-
return `File ${mode}: ${filePath} (${lines} lines, ${
|
|
7879
|
+
return `File ${mode}: ${filePath} (${lines} lines, ${bytes} bytes)`;
|
|
7837
7880
|
}
|
|
7838
7881
|
};
|
|
7839
7882
|
|
|
@@ -8099,15 +8142,22 @@ function parseEditsArg(raw) {
|
|
|
8099
8142
|
throw new ToolError("edit_file", `edits[${i}] must be an object`);
|
|
8100
8143
|
}
|
|
8101
8144
|
const rec = e;
|
|
8102
|
-
|
|
8145
|
+
const normalized = normalizeReplaceArgs(rec);
|
|
8146
|
+
if (normalized === void 0) {
|
|
8147
|
+
throw new ToolError(
|
|
8148
|
+
"edit_file",
|
|
8149
|
+
`edits[${i}].old_str is missing.${describeReceivedKeys(rec)}`
|
|
8150
|
+
);
|
|
8151
|
+
}
|
|
8152
|
+
if (typeof normalized.old_str !== "string") {
|
|
8103
8153
|
throw new ToolError("edit_file", `edits[${i}].old_str must be a string`);
|
|
8104
8154
|
}
|
|
8105
|
-
if (
|
|
8155
|
+
if (normalized.new_str !== void 0 && typeof normalized.new_str !== "string") {
|
|
8106
8156
|
throw new ToolError("edit_file", `edits[${i}].new_str must be a string`);
|
|
8107
8157
|
}
|
|
8108
8158
|
return {
|
|
8109
|
-
old_str:
|
|
8110
|
-
new_str: String(
|
|
8159
|
+
old_str: normalized.old_str,
|
|
8160
|
+
new_str: String(normalized.new_str ?? ""),
|
|
8111
8161
|
ignore_whitespace: Boolean(rec.ignore_whitespace),
|
|
8112
8162
|
replace_all: Boolean(rec.replace_all)
|
|
8113
8163
|
};
|
|
@@ -8291,9 +8341,10 @@ Note: Path can be absolute or relative to cwd.`,
|
|
|
8291
8341
|
}
|
|
8292
8342
|
return lines.join("\n");
|
|
8293
8343
|
}
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
const
|
|
8344
|
+
const replaceArgs = normalizeReplaceArgs(args);
|
|
8345
|
+
if (replaceArgs !== void 0) {
|
|
8346
|
+
const oldStr = String(replaceArgs.old_str);
|
|
8347
|
+
const newStr = String(replaceArgs.new_str ?? "");
|
|
8297
8348
|
const ignoreWs = Boolean(args["ignore_whitespace"]);
|
|
8298
8349
|
const replaceAll = Boolean(args["replace_all"]);
|
|
8299
8350
|
if (oldStr === "") throw new ToolError("edit_file", "old_str cannot be empty");
|
|
@@ -8323,10 +8374,14 @@ Please read the file first and use exact text.`;
|
|
|
8323
8374
|
Old: ${truncatePreview(oldStr)}
|
|
8324
8375
|
New: ${truncatePreview(newStr)}`;
|
|
8325
8376
|
}
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
const
|
|
8377
|
+
const insertLineArg = pickArg(args, "insert_after_line", INSERT_LINE_ALIASES);
|
|
8378
|
+
if (insertLineArg !== void 0) {
|
|
8379
|
+
const afterLine = Number(insertLineArg);
|
|
8380
|
+
const content = String(pickArg(args, "insert_content", INSERT_CONTENT_ALIASES) ?? "");
|
|
8329
8381
|
const lines = original.split("\n");
|
|
8382
|
+
if (!Number.isFinite(afterLine)) {
|
|
8383
|
+
throw new ToolError("edit_file", `insert_after_line must be a number, got ${JSON.stringify(insertLineArg)}`);
|
|
8384
|
+
}
|
|
8330
8385
|
if (afterLine < 0 || afterLine > lines.length) {
|
|
8331
8386
|
throw new ToolError("edit_file", `insert_after_line ${afterLine} is out of range (file has ${lines.length} lines)`);
|
|
8332
8387
|
}
|
|
@@ -8340,6 +8395,12 @@ Please read the file first and use exact text.`;
|
|
|
8340
8395
|
const fromLine = Number(args["delete_from_line"]);
|
|
8341
8396
|
const toLine = Number(args["delete_to_line"] ?? args["delete_from_line"]);
|
|
8342
8397
|
const lines = original.split("\n");
|
|
8398
|
+
if (!Number.isFinite(fromLine) || !Number.isFinite(toLine)) {
|
|
8399
|
+
throw new ToolError(
|
|
8400
|
+
"edit_file",
|
|
8401
|
+
`delete_from_line/delete_to_line must be numbers, got ${JSON.stringify(args["delete_from_line"])}/${JSON.stringify(args["delete_to_line"])}`
|
|
8402
|
+
);
|
|
8403
|
+
}
|
|
8343
8404
|
if (fromLine < 1 || toLine < fromLine || toLine > lines.length) {
|
|
8344
8405
|
throw new ToolError(
|
|
8345
8406
|
"edit_file",
|
|
@@ -8354,7 +8415,7 @@ Please read the file first and use exact text.`;
|
|
|
8354
8415
|
}
|
|
8355
8416
|
throw new ToolError(
|
|
8356
8417
|
"edit_file",
|
|
8357
|
-
"No operation specified. Provide one of: (old_str + new_str), (insert_after_line + insert_content), (delete_from_line + delete_to_line), edits=[...], or patch=<unified diff>."
|
|
8418
|
+
"No operation specified. Provide one of: (old_str + new_str), (insert_after_line + insert_content), (delete_from_line + delete_to_line), edits=[...], or patch=<unified diff>." + describeReceivedKeys(args)
|
|
8358
8419
|
);
|
|
8359
8420
|
}
|
|
8360
8421
|
};
|
|
@@ -9651,7 +9712,7 @@ Any of these triggers means use save_last_response, NOT write_file:
|
|
|
9651
9712
|
mkdirSync7(dirname6(filePath), { recursive: true });
|
|
9652
9713
|
atomicWriteFileSync(filePath, content);
|
|
9653
9714
|
const lines = content.split("\n").length;
|
|
9654
|
-
return `File saved: ${filePath} (${lines} lines, ${content
|
|
9715
|
+
return `File saved: ${filePath} (${lines} lines, ${Buffer.byteLength(content, "utf-8")} bytes)`;
|
|
9655
9716
|
}
|
|
9656
9717
|
};
|
|
9657
9718
|
|
|
@@ -13094,6 +13155,15 @@ var ToolExecutorWeb = class _ToolExecutorWeb {
|
|
|
13094
13155
|
if (!tool) {
|
|
13095
13156
|
return { callId: call.id, content: `Unknown tool: ${call.name}`, isError: true };
|
|
13096
13157
|
}
|
|
13158
|
+
if (call.argumentsTruncated) {
|
|
13159
|
+
const message = buildTruncatedArgumentsError(
|
|
13160
|
+
call.name,
|
|
13161
|
+
call.argumentsTruncated,
|
|
13162
|
+
Object.keys(call.arguments)
|
|
13163
|
+
);
|
|
13164
|
+
this.send({ type: "info", message: `\u26A0 ${call.name}: arguments truncated by output limit \u2014 not executed` });
|
|
13165
|
+
return { callId: call.id, content: message, isError: true };
|
|
13166
|
+
}
|
|
13097
13167
|
const dangerLevel = getDangerLevel(call.name, call.arguments);
|
|
13098
13168
|
let toolCallStarted = false;
|
|
13099
13169
|
runHook(this.hookConfig?.preToolExecution, {
|
|
@@ -15135,7 +15205,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
15135
15205
|
Cost: ${formatCost(cost)}` : "";
|
|
15136
15206
|
let memoryLine = "";
|
|
15137
15207
|
try {
|
|
15138
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
15208
|
+
const { countPendingMemories } = await import("./persistent-memory-QOT2TQCT.js");
|
|
15139
15209
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
15140
15210
|
if (pending > 0) memoryLine = `
|
|
15141
15211
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -15944,7 +16014,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
15944
16014
|
async function handleTest(args, ctx) {
|
|
15945
16015
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
15946
16016
|
try {
|
|
15947
|
-
const { executeTests } = await import("./run-tests-
|
|
16017
|
+
const { executeTests } = await import("./run-tests-JVQU3RAN.js");
|
|
15948
16018
|
const argStr = args.join(" ").trim();
|
|
15949
16019
|
let testArgs = {};
|
|
15950
16020
|
if (argStr) {
|
|
@@ -16208,7 +16278,7 @@ async function handleMemory(args, ctx) {
|
|
|
16208
16278
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
16209
16279
|
} else if (sub === "export") {
|
|
16210
16280
|
if (args[1] === "md") {
|
|
16211
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
16281
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-QOT2TQCT.js");
|
|
16212
16282
|
ctx.send({
|
|
16213
16283
|
type: "export_data",
|
|
16214
16284
|
format: "md",
|
|
@@ -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-PLP3INNN.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-P5JUXUBS.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-BZNTSGLQ.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-USG3ASQ2.js";
|
|
80
80
|
import "./chunk-GLSR2NR3.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-SC6FMQLH.js";
|
|
94
94
|
import {
|
|
95
95
|
ProviderRegistry
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-ZRBGH245.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-OWCEONX7.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-Q4KBR2SG.js";
|
|
117
117
|
import {
|
|
118
118
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
119
119
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
stripOuterCodeFence,
|
|
133
133
|
stripToolCallReminder,
|
|
134
134
|
teeStreamErrorSummary
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-PSXIVQ3N.js";
|
|
136
136
|
import {
|
|
137
137
|
AuthError,
|
|
138
138
|
ProviderError,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
import {
|
|
147
147
|
fileCheckpoints
|
|
148
148
|
} from "./chunk-4BKXL7SM.js";
|
|
149
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-ABMMKA5S.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-M2QHKPRA.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-7KSDW6RF.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-RSYTYFZF.js");
|
|
2370
2370
|
const argStr = args.join(" ").trim();
|
|
2371
2371
|
let testArgs = {};
|
|
2372
2372
|
if (argStr) {
|
|
@@ -8013,7 +8013,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
8013
8013
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
8014
8014
|
process.exit(1);
|
|
8015
8015
|
}
|
|
8016
|
-
const { startWebServer } = await import("./server-
|
|
8016
|
+
const { startWebServer } = await import("./server-VOIG5VKM.js");
|
|
8017
8017
|
await startWebServer({ port, host: options.host });
|
|
8018
8018
|
});
|
|
8019
8019
|
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) => {
|
|
@@ -8180,11 +8180,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
8180
8180
|
console.log(footer + "\n");
|
|
8181
8181
|
});
|
|
8182
8182
|
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) => {
|
|
8183
|
-
const { runUsageCli } = await import("./usage-
|
|
8183
|
+
const { runUsageCli } = await import("./usage-3EQUVK37.js");
|
|
8184
8184
|
await runUsageCli(options);
|
|
8185
8185
|
});
|
|
8186
8186
|
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) => {
|
|
8187
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
8187
|
+
const { runDoctorCli } = await import("./doctor-cli-ZOIMXV4C.js");
|
|
8188
8188
|
const argv = process.argv.slice(2);
|
|
8189
8189
|
await runDoctorCli({
|
|
8190
8190
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -8193,7 +8193,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
8193
8193
|
});
|
|
8194
8194
|
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) => {
|
|
8195
8195
|
try {
|
|
8196
|
-
const batch = await import("./batch-
|
|
8196
|
+
const batch = await import("./batch-TPW2SM6G.js");
|
|
8197
8197
|
switch (action) {
|
|
8198
8198
|
case "submit":
|
|
8199
8199
|
if (!arg) {
|
|
@@ -8236,7 +8236,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
8236
8236
|
}
|
|
8237
8237
|
});
|
|
8238
8238
|
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) => {
|
|
8239
|
-
const { startMcpServer } = await import("./server-
|
|
8239
|
+
const { startMcpServer } = await import("./server-O2YQGG72.js");
|
|
8240
8240
|
await startMcpServer({
|
|
8241
8241
|
allowDestructive: !!options.allowDestructive,
|
|
8242
8242
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -8249,7 +8249,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8249
8249
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
8250
8250
|
process.exit(1);
|
|
8251
8251
|
}
|
|
8252
|
-
const { runPrCli } = await import("./pr-
|
|
8252
|
+
const { runPrCli } = await import("./pr-HMOXDXWR.js");
|
|
8253
8253
|
const result = await runPrCli({
|
|
8254
8254
|
action,
|
|
8255
8255
|
target,
|
|
@@ -8269,8 +8269,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8269
8269
|
process.exit(result.exitCode);
|
|
8270
8270
|
});
|
|
8271
8271
|
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) => {
|
|
8272
|
-
const { runCi } = await import("./ci-
|
|
8273
|
-
const { formatCiResult } = await import("./ci-format-
|
|
8272
|
+
const { runCi } = await import("./ci-DYTVVEBO.js");
|
|
8273
|
+
const { formatCiResult } = await import("./ci-format-QTSA6FJJ.js");
|
|
8274
8274
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
8275
8275
|
if (formats > 1) {
|
|
8276
8276
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -8428,7 +8428,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
8428
8428
|
config.get("customProviders"),
|
|
8429
8429
|
config.getConfigDir()
|
|
8430
8430
|
);
|
|
8431
|
-
const { startHub } = await import("./hub-
|
|
8431
|
+
const { startHub } = await import("./hub-6L2UCZAU.js");
|
|
8432
8432
|
await startHub(
|
|
8433
8433
|
{
|
|
8434
8434
|
topic: topic ?? "",
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-USG3ASQ2.js";
|
|
32
32
|
import "./chunk-HOSJZMQS.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-M2QHKPRA.js";
|
|
34
34
|
import "./chunk-B5TYJO7V.js";
|
|
35
35
|
import "./chunk-IW3Q7AE5.js";
|
|
36
36
|
export {
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2JHYZUQE.js";
|
|
31
31
|
import "./chunk-YVTASHS5.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-UMW33EEH.js";
|
|
33
33
|
import "./chunk-6BUTA5VW.js";
|
|
34
34
|
export {
|
|
35
35
|
addMemoryEntry,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-YWG5KKSL.js";
|
|
6
|
+
import "./chunk-YMHARKR6.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
} from "./chunk-HLWUDRBO.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZRBGH245.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-OWCEONX7.js";
|
|
18
|
+
import "./chunk-PSXIVQ3N.js";
|
|
19
19
|
import "./chunk-5ULLIOVC.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-M2QHKPRA.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-BZNTSGLQ.js";
|
|
5
|
+
import "./chunk-USG3ASQ2.js";
|
|
6
6
|
import "./chunk-GLSR2NR3.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-Q4KBR2SG.js";
|
|
13
13
|
import {
|
|
14
14
|
getDangerLevel,
|
|
15
15
|
schemaToJsonSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PSXIVQ3N.js";
|
|
17
17
|
import "./chunk-5ULLIOVC.js";
|
|
18
18
|
import "./chunk-HOSJZMQS.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-ABMMKA5S.js";
|
|
21
21
|
import {
|
|
22
22
|
VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-M2QHKPRA.js";
|
|
24
24
|
import "./chunk-6RPGQ5CG.js";
|
|
25
25
|
import "./chunk-KHYD3WXE.js";
|
|
26
26
|
import "./chunk-NYNSYLFY.js";
|