jinzd-ai-cli 0.4.102 → 0.4.103
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-TD5ZKJBZ.js → batch-LNTG2IRQ.js} +2 -2
- package/dist/{chunk-LAYBLRQG.js → chunk-DGXUO7D4.js} +1 -1
- package/dist/{chunk-5IMEELWI.js → chunk-JHPSWYO3.js} +1 -1
- package/dist/{chunk-QLTWUTEO.js → chunk-OVYOYUP7.js} +1 -1
- package/dist/{chunk-CFPZYNSE.js → chunk-RZWWODW7.js} +22 -11
- package/dist/{chunk-K6RVCRFK.js → chunk-SN56X6RE.js} +1 -1
- package/dist/{chunk-VFYKMIQE.js → chunk-VOWVIR2U.js} +2 -2
- package/dist/electron-server.js +25 -14
- package/dist/{hub-4MMNKPXW.js → hub-4YGZ4XHN.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/{run-tests-K2EJOXH2.js → run-tests-3YOJEN2Q.js} +2 -2
- package/dist/{run-tests-3Z6YDZ6Q.js → run-tests-SN74WT4Z.js} +1 -1
- package/dist/{server-DE7WP5J2.js → server-BG4WR6RF.js} +3 -3
- package/dist/{server-J2TQBUA5.js → server-TNPDHGQT.js} +6 -6
- package/dist/{task-orchestrator-FFOUDDVB.js → task-orchestrator-MUIH3XBY.js} +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SN56X6RE.js";
|
|
5
5
|
import "./chunk-2ZD3YTVM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-JHPSWYO3.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/batch.ts
|
|
9
9
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-6VRJGH25.js";
|
|
24
24
|
import {
|
|
25
25
|
runTestsTool
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OVYOYUP7.js";
|
|
27
27
|
import {
|
|
28
28
|
CONFIG_DIR_NAME,
|
|
29
29
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
SUBAGENT_ALLOWED_TOOLS,
|
|
32
32
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
33
33
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-JHPSWYO3.js";
|
|
35
35
|
|
|
36
36
|
// src/tools/types.ts
|
|
37
37
|
function isFileWriteTool(name) {
|
|
@@ -1827,8 +1827,13 @@ var ToolExecutor = class {
|
|
|
1827
1827
|
var writeFileTool = {
|
|
1828
1828
|
definition: {
|
|
1829
1829
|
name: "write_file",
|
|
1830
|
-
description: `Write content to a file. Creates the file if it doesn't exist
|
|
1831
|
-
|
|
1830
|
+
description: `Write content to a file. Creates the file if it doesn't exist; overwrites by default or appends with append=true. Automatically creates parent directories.
|
|
1831
|
+
|
|
1832
|
+
[CRITICAL: pick the right tool by content size]
|
|
1833
|
+
- Short content (under ~300 lines / ~3 KB): use write_file in ONE call. Do NOT chunk.
|
|
1834
|
+
- Long content (300+ lines, or 3 KB+, or any document you'd describe as "complete file" / "full directory" / "long article" / "exam paper"): you MUST use \`save_last_response\` instead. It generates and saves the file in a single streaming pass, avoiding the tool_call argument truncation that happens around 2 KB.
|
|
1835
|
+
|
|
1836
|
+
Do NOT split a long document into many write_file(append=true) calls. That pattern is fragile, slow, and triggers many approval prompts. If you find yourself about to call write_file twice for the same path in one turn \u2014 STOP and use save_last_response.`,
|
|
1832
1837
|
parameters: {
|
|
1833
1838
|
path: {
|
|
1834
1839
|
type: "string",
|
|
@@ -3207,16 +3212,22 @@ var lastResponseStore = { content: "" };
|
|
|
3207
3212
|
var saveLastResponseTool = {
|
|
3208
3213
|
definition: {
|
|
3209
3214
|
name: "save_last_response",
|
|
3210
|
-
description: `
|
|
3215
|
+
description: `Generate AND save a long document to a file in one streaming pass. Use this whenever the user asks you to PRODUCE and SAVE a complete document.
|
|
3211
3216
|
|
|
3212
|
-
[
|
|
3213
|
-
|
|
3214
|
-
-
|
|
3215
|
-
-
|
|
3217
|
+
[When to use \u2014 pick this over write_file]
|
|
3218
|
+
Any of these triggers means use save_last_response, NOT write_file:
|
|
3219
|
+
- The expected output is 300+ lines or 3 KB+ (exam papers, table-of-contents, full chapter, long report, structured outline, complete teaching plan, full code module)
|
|
3220
|
+
- The user said "save as ...", "\u4FDD\u5B58\u4E3A ...", "write the full ...", "complete the entire ...", "list the whole directory"
|
|
3221
|
+
- You'd otherwise need multiple write_file(append=true) calls to fit the content
|
|
3216
3222
|
|
|
3217
|
-
[
|
|
3223
|
+
[How it works]
|
|
3224
|
+
- You only pass the target file path as an argument
|
|
3225
|
+
- The system runs a fresh streaming generation; content streams to the user AND to disk simultaneously (tee mode)
|
|
3226
|
+
- No content is passed via tool arguments \u2192 not subject to the ~2 KB tool_call argument truncation that breaks write_file for large docs
|
|
3218
3227
|
|
|
3219
|
-
[
|
|
3228
|
+
[Anti-pattern \u2014 DO NOT DO]
|
|
3229
|
+
- Do NOT call write_file with chunked append=true to build up a long file. Use save_last_response for the whole file in one pass.
|
|
3230
|
+
- Do NOT first write a partial file with write_file, then "extend" it with edit_file inserts. Use save_last_response.`,
|
|
3220
3231
|
parameters: {
|
|
3221
3232
|
path: {
|
|
3222
3233
|
type: "string",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
schemaToJsonSchema,
|
|
4
4
|
truncateForPersist
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RZWWODW7.js";
|
|
6
6
|
import {
|
|
7
7
|
AuthError,
|
|
8
8
|
ProviderError,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
MCP_PROTOCOL_VERSION,
|
|
22
22
|
MCP_TOOL_PREFIX,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JHPSWYO3.js";
|
|
25
25
|
|
|
26
26
|
// src/providers/claude.ts
|
|
27
27
|
import Anthropic from "@anthropic-ai/sdk";
|
package/dist/electron-server.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
VERSION,
|
|
37
37
|
buildUserIdentityPrompt,
|
|
38
38
|
runTestsTool
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-DGXUO7D4.js";
|
|
40
40
|
import {
|
|
41
41
|
hasSemanticIndex,
|
|
42
42
|
semanticSearch
|
|
@@ -5179,8 +5179,13 @@ var ToolExecutor = class {
|
|
|
5179
5179
|
var writeFileTool = {
|
|
5180
5180
|
definition: {
|
|
5181
5181
|
name: "write_file",
|
|
5182
|
-
description: `Write content to a file. Creates the file if it doesn't exist
|
|
5183
|
-
|
|
5182
|
+
description: `Write content to a file. Creates the file if it doesn't exist; overwrites by default or appends with append=true. Automatically creates parent directories.
|
|
5183
|
+
|
|
5184
|
+
[CRITICAL: pick the right tool by content size]
|
|
5185
|
+
- Short content (under ~300 lines / ~3 KB): use write_file in ONE call. Do NOT chunk.
|
|
5186
|
+
- Long content (300+ lines, or 3 KB+, or any document you'd describe as "complete file" / "full directory" / "long article" / "exam paper"): you MUST use \`save_last_response\` instead. It generates and saves the file in a single streaming pass, avoiding the tool_call argument truncation that happens around 2 KB.
|
|
5187
|
+
|
|
5188
|
+
Do NOT split a long document into many write_file(append=true) calls. That pattern is fragile, slow, and triggers many approval prompts. If you find yourself about to call write_file twice for the same path in one turn \u2014 STOP and use save_last_response.`,
|
|
5184
5189
|
parameters: {
|
|
5185
5190
|
path: {
|
|
5186
5191
|
type: "string",
|
|
@@ -6559,16 +6564,22 @@ var lastResponseStore = { content: "" };
|
|
|
6559
6564
|
var saveLastResponseTool = {
|
|
6560
6565
|
definition: {
|
|
6561
6566
|
name: "save_last_response",
|
|
6562
|
-
description: `
|
|
6563
|
-
|
|
6564
|
-
[
|
|
6565
|
-
|
|
6566
|
-
-
|
|
6567
|
-
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6567
|
+
description: `Generate AND save a long document to a file in one streaming pass. Use this whenever the user asks you to PRODUCE and SAVE a complete document.
|
|
6568
|
+
|
|
6569
|
+
[When to use \u2014 pick this over write_file]
|
|
6570
|
+
Any of these triggers means use save_last_response, NOT write_file:
|
|
6571
|
+
- The expected output is 300+ lines or 3 KB+ (exam papers, table-of-contents, full chapter, long report, structured outline, complete teaching plan, full code module)
|
|
6572
|
+
- The user said "save as ...", "\u4FDD\u5B58\u4E3A ...", "write the full ...", "complete the entire ...", "list the whole directory"
|
|
6573
|
+
- You'd otherwise need multiple write_file(append=true) calls to fit the content
|
|
6574
|
+
|
|
6575
|
+
[How it works]
|
|
6576
|
+
- You only pass the target file path as an argument
|
|
6577
|
+
- The system runs a fresh streaming generation; content streams to the user AND to disk simultaneously (tee mode)
|
|
6578
|
+
- No content is passed via tool arguments \u2192 not subject to the ~2 KB tool_call argument truncation that breaks write_file for large docs
|
|
6579
|
+
|
|
6580
|
+
[Anti-pattern \u2014 DO NOT DO]
|
|
6581
|
+
- Do NOT call write_file with chunked append=true to build up a long file. Use save_last_response for the whole file in one pass.
|
|
6582
|
+
- Do NOT first write a partial file with write_file, then "extend" it with edit_file inserts. Use save_last_response.`,
|
|
6572
6583
|
parameters: {
|
|
6573
6584
|
path: {
|
|
6574
6585
|
type: "string",
|
|
@@ -11616,7 +11627,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
11616
11627
|
case "test": {
|
|
11617
11628
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
11618
11629
|
try {
|
|
11619
|
-
const { executeTests } = await import("./run-tests-
|
|
11630
|
+
const { executeTests } = await import("./run-tests-SN74WT4Z.js");
|
|
11620
11631
|
const argStr = args.join(" ").trim();
|
|
11621
11632
|
let testArgs = {};
|
|
11622
11633
|
if (argStr) {
|
|
@@ -385,7 +385,7 @@ ${content}`);
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
388
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
388
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-MUIH3XBY.js");
|
|
389
389
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
390
390
|
let interrupted = false;
|
|
391
391
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
saveDevState,
|
|
29
29
|
sessionHasMeaningfulContent,
|
|
30
30
|
setupProxy
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-VOWVIR2U.js";
|
|
32
32
|
import {
|
|
33
33
|
ConfigManager
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SN56X6RE.js";
|
|
35
35
|
import {
|
|
36
36
|
ToolExecutor,
|
|
37
37
|
ToolRegistry,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
spawnAgentContext,
|
|
51
51
|
theme,
|
|
52
52
|
undoStack
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-RZWWODW7.js";
|
|
54
54
|
import "./chunk-2ZD3YTVM.js";
|
|
55
55
|
import {
|
|
56
56
|
fileCheckpoints
|
|
@@ -68,7 +68,7 @@ import "./chunk-KJLJPUY2.js";
|
|
|
68
68
|
import "./chunk-6VRJGH25.js";
|
|
69
69
|
import "./chunk-2DXY7UGF.js";
|
|
70
70
|
import "./chunk-KHYD3WXE.js";
|
|
71
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-OVYOYUP7.js";
|
|
72
72
|
import {
|
|
73
73
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
74
74
|
AUTHOR,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
SKILLS_DIR_NAME,
|
|
91
91
|
VERSION,
|
|
92
92
|
buildUserIdentityPrompt
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-JHPSWYO3.js";
|
|
94
94
|
|
|
95
95
|
// src/index.ts
|
|
96
96
|
import { program } from "commander";
|
|
@@ -2610,7 +2610,7 @@ ${hint}` : "")
|
|
|
2610
2610
|
usage: "/test [command|filter]",
|
|
2611
2611
|
async execute(args, ctx) {
|
|
2612
2612
|
try {
|
|
2613
|
-
const { executeTests } = await import("./run-tests-
|
|
2613
|
+
const { executeTests } = await import("./run-tests-3YOJEN2Q.js");
|
|
2614
2614
|
const argStr = args.join(" ").trim();
|
|
2615
2615
|
let testArgs = {};
|
|
2616
2616
|
if (argStr) {
|
|
@@ -6749,7 +6749,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
6749
6749
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
6750
6750
|
process.exit(1);
|
|
6751
6751
|
}
|
|
6752
|
-
const { startWebServer } = await import("./server-
|
|
6752
|
+
const { startWebServer } = await import("./server-TNPDHGQT.js");
|
|
6753
6753
|
await startWebServer({ port, host: options.host });
|
|
6754
6754
|
});
|
|
6755
6755
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -6872,7 +6872,7 @@ program.command("sessions").description("List recent conversation sessions").act
|
|
|
6872
6872
|
});
|
|
6873
6873
|
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) => {
|
|
6874
6874
|
try {
|
|
6875
|
-
const batch = await import("./batch-
|
|
6875
|
+
const batch = await import("./batch-LNTG2IRQ.js");
|
|
6876
6876
|
switch (action) {
|
|
6877
6877
|
case "submit":
|
|
6878
6878
|
if (!arg) {
|
|
@@ -6915,7 +6915,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
6915
6915
|
}
|
|
6916
6916
|
});
|
|
6917
6917
|
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) => {
|
|
6918
|
-
const { startMcpServer } = await import("./server-
|
|
6918
|
+
const { startMcpServer } = await import("./server-BG4WR6RF.js");
|
|
6919
6919
|
await startMcpServer({
|
|
6920
6920
|
allowDestructive: !!options.allowDestructive,
|
|
6921
6921
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7042,7 +7042,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7042
7042
|
}),
|
|
7043
7043
|
config.get("customProviders")
|
|
7044
7044
|
);
|
|
7045
|
-
const { startHub } = await import("./hub-
|
|
7045
|
+
const { startHub } = await import("./hub-4YGZ4XHN.js");
|
|
7046
7046
|
await startHub(
|
|
7047
7047
|
{
|
|
7048
7048
|
topic: topic ?? "",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
getDangerLevel,
|
|
5
5
|
schemaToJsonSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZWWODW7.js";
|
|
7
7
|
import "./chunk-2ZD3YTVM.js";
|
|
8
8
|
import "./chunk-4BKXL7SM.js";
|
|
9
9
|
import "./chunk-ANYYM4CF.js";
|
|
@@ -12,10 +12,10 @@ import "./chunk-KJLJPUY2.js";
|
|
|
12
12
|
import "./chunk-6VRJGH25.js";
|
|
13
13
|
import "./chunk-2DXY7UGF.js";
|
|
14
14
|
import "./chunk-KHYD3WXE.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-OVYOYUP7.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JHPSWYO3.js";
|
|
19
19
|
|
|
20
20
|
// src/mcp/server.ts
|
|
21
21
|
import { createInterface } from "readline";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
loadDevState,
|
|
22
22
|
persistToolRound,
|
|
23
23
|
setupProxy
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VOWVIR2U.js";
|
|
25
25
|
import {
|
|
26
26
|
ConfigManager
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SN56X6RE.js";
|
|
28
28
|
import {
|
|
29
29
|
ToolExecutor,
|
|
30
30
|
ToolRegistry,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
spawnAgentContext,
|
|
43
43
|
truncateOutput,
|
|
44
44
|
undoStack
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-RZWWODW7.js";
|
|
46
46
|
import "./chunk-2ZD3YTVM.js";
|
|
47
47
|
import "./chunk-4BKXL7SM.js";
|
|
48
48
|
import "./chunk-ANYYM4CF.js";
|
|
@@ -51,7 +51,7 @@ import "./chunk-KJLJPUY2.js";
|
|
|
51
51
|
import "./chunk-6VRJGH25.js";
|
|
52
52
|
import "./chunk-2DXY7UGF.js";
|
|
53
53
|
import "./chunk-KHYD3WXE.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-OVYOYUP7.js";
|
|
55
55
|
import {
|
|
56
56
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
57
57
|
AUTHOR,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
SKILLS_DIR_NAME,
|
|
71
71
|
VERSION,
|
|
72
72
|
buildUserIdentityPrompt
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-JHPSWYO3.js";
|
|
74
74
|
|
|
75
75
|
// src/web/server.ts
|
|
76
76
|
import express from "express";
|
|
@@ -2379,7 +2379,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2379
2379
|
case "test": {
|
|
2380
2380
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2381
2381
|
try {
|
|
2382
|
-
const { executeTests } = await import("./run-tests-
|
|
2382
|
+
const { executeTests } = await import("./run-tests-3YOJEN2Q.js");
|
|
2383
2383
|
const argStr = args.join(" ").trim();
|
|
2384
2384
|
let testArgs = {};
|
|
2385
2385
|
if (argStr) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getDangerLevel,
|
|
5
5
|
googleSearchContext,
|
|
6
6
|
truncateOutput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RZWWODW7.js";
|
|
8
8
|
import "./chunk-2ZD3YTVM.js";
|
|
9
9
|
import "./chunk-4BKXL7SM.js";
|
|
10
10
|
import "./chunk-ANYYM4CF.js";
|
|
@@ -13,10 +13,10 @@ import "./chunk-KJLJPUY2.js";
|
|
|
13
13
|
import "./chunk-6VRJGH25.js";
|
|
14
14
|
import "./chunk-2DXY7UGF.js";
|
|
15
15
|
import "./chunk-KHYD3WXE.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-OVYOYUP7.js";
|
|
17
17
|
import {
|
|
18
18
|
SUBAGENT_ALLOWED_TOOLS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JHPSWYO3.js";
|
|
20
20
|
|
|
21
21
|
// src/hub/task-orchestrator.ts
|
|
22
22
|
import { createInterface } from "readline";
|