jinzd-ai-cli 0.4.191 → 0.4.194
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-4XSN4VF7.js → batch-XGARS57W.js} +2 -2
- package/dist/{chunk-JTLPYPT3.js → chunk-2BLBXGOE.js} +3 -929
- package/dist/{chunk-HSQAKOYX.js → chunk-3KCEPI4E.js} +1 -1
- package/dist/{chunk-TRV47UK4.js → chunk-5IVUINDO.js} +1 -1
- package/dist/{chunk-IMSENBJ6.js → chunk-6VMXFFO3.js} +2 -2
- package/dist/{chunk-Y3PNCW7A.js → chunk-CKBBAXCA.js} +1 -1
- package/dist/{chunk-6Z42O3DN.js → chunk-LTBUGDLE.js} +1 -1
- package/dist/{chunk-ASVBZIUE.js → chunk-ZEHHAE3B.js} +1 -1
- package/dist/{chunk-RQ7JVLFM.js → chunk-ZJX6ZU5D.js} +43 -55
- package/dist/chunk-ZRG2FPC6.js +1066 -0
- package/dist/{chunk-XDH5EFWC.js → chunk-ZVMXIRBH.js} +1 -1
- package/dist/{ci-USJCTRP7.js → ci-4TYLP7HF.js} +4 -4
- package/dist/{constants-3T5G34S5.js → constants-CDVYNTU7.js} +1 -1
- package/dist/{doctor-cli-3QE7FZKB.js → doctor-cli-Q3QFVEWQ.js} +6 -6
- package/dist/electron-server.js +159 -69
- package/dist/{hub-LABDYMAE.js → hub-UORFAHQ3.js} +1 -1
- package/dist/index.js +78 -47
- package/dist/{run-tests-X2MCBIKN.js → run-tests-A2I3WZ2H.js} +2 -2
- package/dist/{run-tests-H3VCHOJB.js → run-tests-RFK53W3D.js} +1 -1
- package/dist/{server-TJDKEECG.js → server-6NLQUZKD.js} +63 -27
- package/dist/{server-FE7XTYVC.js → server-RULXWZD4.js} +5 -5
- package/dist/{task-orchestrator-VFCQGTYA.js → task-orchestrator-GJBPVYFW.js} +37 -65
- package/dist/{usage-FYKIOPJI.js → usage-7DVISDK2.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-HIU2SH4V.js +0 -64
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZJX6ZU5D.js";
|
|
5
5
|
import {
|
|
6
6
|
APP_NAME,
|
|
7
7
|
CONFIG_DIR_NAME,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
MCP_PROTOCOL_VERSION,
|
|
12
12
|
MCP_TOOL_PREFIX,
|
|
13
13
|
VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZEHHAE3B.js";
|
|
15
15
|
|
|
16
16
|
// src/mcp/client.ts
|
|
17
17
|
import { spawn } from "child_process";
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
} from "./chunk-T2NL5ZIA.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3KCEPI4E.js";
|
|
9
9
|
import {
|
|
10
10
|
runTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CKBBAXCA.js";
|
|
12
12
|
import {
|
|
13
13
|
getDangerLevel,
|
|
14
|
-
isFileWriteTool
|
|
15
|
-
|
|
14
|
+
isFileWriteTool,
|
|
15
|
+
runLeanAgentLoop
|
|
16
|
+
} from "./chunk-ZRG2FPC6.js";
|
|
16
17
|
import {
|
|
17
18
|
EnvLoader,
|
|
18
19
|
NetworkError,
|
|
@@ -25,7 +26,7 @@ import {
|
|
|
25
26
|
SUBAGENT_ALLOWED_TOOLS,
|
|
26
27
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
27
28
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZEHHAE3B.js";
|
|
29
30
|
import {
|
|
30
31
|
fileCheckpoints
|
|
31
32
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -3801,9 +3802,19 @@ ${preamble}`;
|
|
|
3801
3802
|
}
|
|
3802
3803
|
|
|
3803
3804
|
// src/tools/builtin/save-last-response.ts
|
|
3804
|
-
import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync2 } from "fs";
|
|
3805
|
+
import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync2, unlinkSync as unlinkSync2, rmdirSync as rmdirSync2 } from "fs";
|
|
3805
3806
|
import { dirname as dirname3 } from "path";
|
|
3806
3807
|
var lastResponseStore = { content: "" };
|
|
3808
|
+
function cleanupRejectedTeeFile(filePath) {
|
|
3809
|
+
try {
|
|
3810
|
+
unlinkSync2(filePath);
|
|
3811
|
+
} catch {
|
|
3812
|
+
}
|
|
3813
|
+
try {
|
|
3814
|
+
rmdirSync2(dirname3(filePath));
|
|
3815
|
+
} catch {
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3807
3818
|
var saveLastResponseTool = {
|
|
3808
3819
|
definition: {
|
|
3809
3820
|
name: "save_last_response",
|
|
@@ -4345,61 +4356,37 @@ async function runSubAgent(task, maxRounds, agentIndex, ctx) {
|
|
|
4345
4356
|
];
|
|
4346
4357
|
const subSystemPrompt = buildSubAgentSystemPrompt(task, ctx.systemPrompt);
|
|
4347
4358
|
const toolDefs = subRegistry.getDefinitions();
|
|
4348
|
-
const extraMessages = [];
|
|
4349
|
-
const totalUsage = { inputTokens: 0, outputTokens: 0 };
|
|
4350
|
-
let finalContent = "";
|
|
4351
4359
|
printSubAgentHeader(task, maxRounds, agentIndex);
|
|
4352
|
-
|
|
4353
|
-
|
|
4360
|
+
const loop = await runLeanAgentLoop({
|
|
4361
|
+
provider: ctx.provider,
|
|
4362
|
+
messages: subMessages,
|
|
4363
|
+
model: ctx.model,
|
|
4364
|
+
maxRounds,
|
|
4365
|
+
chatParams: {
|
|
4366
|
+
temperature: ctx.modelParams.temperature,
|
|
4367
|
+
maxTokens: ctx.modelParams.maxTokens,
|
|
4368
|
+
timeout: ctx.modelParams.timeout,
|
|
4369
|
+
thinking: ctx.modelParams.thinking
|
|
4370
|
+
},
|
|
4371
|
+
executeTools: (calls) => subExecutor.executeAll(calls),
|
|
4372
|
+
systemPromptForRound: () => subSystemPrompt,
|
|
4373
|
+
toolDefsForRound: () => toolDefs,
|
|
4374
|
+
onRoundStart: (round) => {
|
|
4354
4375
|
subExecutor.setRoundInfo(round + 1, maxRounds);
|
|
4355
|
-
const result = await ctx.provider.chatWithTools(
|
|
4356
|
-
{
|
|
4357
|
-
messages: subMessages,
|
|
4358
|
-
model: ctx.model,
|
|
4359
|
-
systemPrompt: subSystemPrompt,
|
|
4360
|
-
stream: false,
|
|
4361
|
-
temperature: ctx.modelParams.temperature,
|
|
4362
|
-
maxTokens: ctx.modelParams.maxTokens,
|
|
4363
|
-
timeout: ctx.modelParams.timeout,
|
|
4364
|
-
thinking: ctx.modelParams.thinking,
|
|
4365
|
-
...extraMessages.length > 0 ? { _extraMessages: extraMessages } : {}
|
|
4366
|
-
},
|
|
4367
|
-
toolDefs
|
|
4368
|
-
);
|
|
4369
|
-
if (result.usage) {
|
|
4370
|
-
totalUsage.inputTokens += result.usage.inputTokens;
|
|
4371
|
-
totalUsage.outputTokens += result.usage.outputTokens;
|
|
4372
|
-
}
|
|
4373
|
-
if ("content" in result) {
|
|
4374
|
-
finalContent = result.content;
|
|
4375
|
-
break;
|
|
4376
|
-
}
|
|
4377
4376
|
if (ctx.configManager) {
|
|
4378
4377
|
googleSearchContext.configManager = ctx.configManager;
|
|
4379
4378
|
}
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
toolResults,
|
|
4385
|
-
reasoningContent
|
|
4386
|
-
);
|
|
4387
|
-
extraMessages.push(...newMsgs);
|
|
4388
|
-
}
|
|
4389
|
-
if (!finalContent) {
|
|
4390
|
-
finalContent = `(Sub-agent reached maximum rounds (${maxRounds}) without producing a final response)`;
|
|
4391
|
-
}
|
|
4392
|
-
} catch (err) {
|
|
4393
|
-
const errMsg = err instanceof Error ? err.message : String(err);
|
|
4394
|
-
finalContent = `(Sub-agent error: ${errMsg})`;
|
|
4395
|
-
process.stderr.write(
|
|
4396
|
-
`
|
|
4379
|
+
},
|
|
4380
|
+
onRoundsExhausted: () => `(Sub-agent reached maximum rounds (${maxRounds}) without producing a final response)`,
|
|
4381
|
+
onError: (errMsg) => {
|
|
4382
|
+
process.stderr.write(`
|
|
4397
4383
|
[spawn_agent] Error in sub-agent loop: ${errMsg}
|
|
4398
|
-
`
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4384
|
+
`);
|
|
4385
|
+
return `(Sub-agent error: ${errMsg})`;
|
|
4386
|
+
}
|
|
4387
|
+
});
|
|
4388
|
+
printSubAgentFooter(loop.usage, agentIndex);
|
|
4389
|
+
return { content: loop.content, usage: loop.usage };
|
|
4403
4390
|
}
|
|
4404
4391
|
var spawnAgentTool = {
|
|
4405
4392
|
definition: {
|
|
@@ -5660,6 +5647,7 @@ export {
|
|
|
5660
5647
|
truncateOutput,
|
|
5661
5648
|
ToolExecutor,
|
|
5662
5649
|
lastResponseStore,
|
|
5650
|
+
cleanupRejectedTeeFile,
|
|
5663
5651
|
askUserContext,
|
|
5664
5652
|
googleSearchContext,
|
|
5665
5653
|
spawnAgentContext,
|