jinzd-ai-cli 0.4.65 → 0.4.66
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/{chunk-2B2EVU6Z.js → chunk-HOBLE365.js} +24 -8
- package/dist/{chunk-AQNAV4H4.js → chunk-NIJZBQ6I.js} +1 -1
- package/dist/{chunk-UNLZJRCY.js → chunk-UIFW7G4A.js} +1 -1
- package/dist/{chunk-SKN6HBBT.js → chunk-X5RX2VGQ.js} +1 -1
- package/dist/{hub-TKYPJZEX.js → hub-JA7HH44N.js} +1 -1
- package/dist/index.js +29 -12
- package/dist/{run-tests-C4CEOYZP.js → run-tests-47TTKJTB.js} +1 -1
- package/dist/{run-tests-KATYWRVQ.js → run-tests-E55HLJDD.js} +1 -1
- package/dist/{server-CDRR3DC7.js → server-A3SB52SS.js} +4 -4
- package/dist/{task-orchestrator-4DCUYIRI.js → task-orchestrator-KOCFBDPK.js} +2 -2
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
RateLimitError,
|
|
9
9
|
schemaToJsonSchema,
|
|
10
10
|
truncateForPersist
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-X5RX2VGQ.js";
|
|
12
12
|
import {
|
|
13
13
|
APP_NAME,
|
|
14
14
|
CONFIG_DIR_NAME,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
MCP_TOOL_PREFIX,
|
|
22
22
|
PLUGINS_DIR_NAME,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NIJZBQ6I.js";
|
|
25
25
|
|
|
26
26
|
// src/config/config-manager.ts
|
|
27
27
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
@@ -3819,18 +3819,34 @@ function trimOldToolOutput(messages, keepRecentRounds = 10) {
|
|
|
3819
3819
|
}
|
|
3820
3820
|
return trimmed;
|
|
3821
3821
|
}
|
|
3822
|
+
function cloneMessages(messages) {
|
|
3823
|
+
return messages.map((m) => ({ ...m }));
|
|
3824
|
+
}
|
|
3822
3825
|
function autoTrimSessionIfNeeded(session, sizeLimit = SESSION_SIZE_LIMIT) {
|
|
3823
|
-
const
|
|
3824
|
-
if (
|
|
3826
|
+
const originalSize = JSON.stringify(session.toJSON()).length;
|
|
3827
|
+
if (originalSize <= sizeLimit) return false;
|
|
3828
|
+
const snapshotLen = session.messages.length;
|
|
3829
|
+
let working = cloneMessages(session.messages.slice(0, snapshotLen));
|
|
3830
|
+
let committedSize = originalSize;
|
|
3831
|
+
let anyTrim = false;
|
|
3825
3832
|
let keepRecent = 10;
|
|
3826
3833
|
while (keepRecent >= 2) {
|
|
3827
|
-
const
|
|
3828
|
-
if (
|
|
3834
|
+
const trimmedCount = trimOldToolOutput(working, keepRecent);
|
|
3835
|
+
if (trimmedCount === 0) break;
|
|
3836
|
+
anyTrim = true;
|
|
3837
|
+
const originalMessages = session.messages;
|
|
3838
|
+
session.messages = [...working, ...originalMessages.slice(snapshotLen)];
|
|
3829
3839
|
const newSize = JSON.stringify(session.toJSON()).length;
|
|
3830
|
-
|
|
3840
|
+
session.messages = originalMessages;
|
|
3841
|
+
committedSize = newSize;
|
|
3842
|
+
if (newSize <= sizeLimit) break;
|
|
3831
3843
|
keepRecent = Math.max(2, Math.floor(keepRecent / 2));
|
|
3844
|
+
if (keepRecent < 2) break;
|
|
3832
3845
|
}
|
|
3833
|
-
return
|
|
3846
|
+
if (!anyTrim) return false;
|
|
3847
|
+
const appended = session.messages.slice(snapshotLen);
|
|
3848
|
+
session.messages.splice(0, session.messages.length, ...working, ...appended);
|
|
3849
|
+
return committedSize < originalSize;
|
|
3834
3850
|
}
|
|
3835
3851
|
|
|
3836
3852
|
// src/repl/dev-state.ts
|
|
@@ -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-KOCFBDPK.js");
|
|
389
389
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
390
390
|
let interrupted = false;
|
|
391
391
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
saveDevState,
|
|
32
32
|
sessionHasMeaningfulContent,
|
|
33
33
|
setupProxy
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-HOBLE365.js";
|
|
35
35
|
import {
|
|
36
36
|
ToolExecutor,
|
|
37
37
|
ToolRegistry,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
spawnAgentContext,
|
|
47
47
|
theme,
|
|
48
48
|
undoStack
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-X5RX2VGQ.js";
|
|
50
50
|
import {
|
|
51
51
|
fileCheckpoints
|
|
52
52
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
SKILLS_DIR_NAME,
|
|
72
72
|
VERSION,
|
|
73
73
|
buildUserIdentityPrompt
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-NIJZBQ6I.js";
|
|
75
75
|
|
|
76
76
|
// src/index.ts
|
|
77
77
|
import { program } from "commander";
|
|
@@ -2193,7 +2193,7 @@ ${hint}` : "")
|
|
|
2193
2193
|
usage: "/test [command|filter]",
|
|
2194
2194
|
async execute(args, ctx) {
|
|
2195
2195
|
try {
|
|
2196
|
-
const { executeTests } = await import("./run-tests-
|
|
2196
|
+
const { executeTests } = await import("./run-tests-47TTKJTB.js");
|
|
2197
2197
|
const argStr = args.join(" ").trim();
|
|
2198
2198
|
let testArgs = {};
|
|
2199
2199
|
if (argStr) {
|
|
@@ -3280,14 +3280,31 @@ var CostTracker = class {
|
|
|
3280
3280
|
this.records = [];
|
|
3281
3281
|
}
|
|
3282
3282
|
}
|
|
3283
|
-
/**
|
|
3283
|
+
/**
|
|
3284
|
+
* Save to disk (atomic write).
|
|
3285
|
+
*
|
|
3286
|
+
* H2: Snapshot records before writing and only clear the dirty flag after
|
|
3287
|
+
* the write succeeds. If writeFileSync/renameSync throws, dirty remains
|
|
3288
|
+
* true so the next save() retries — prevents silent data loss on transient
|
|
3289
|
+
* disk errors. writeFileSync is sync in Node.js so there's no interleaving
|
|
3290
|
+
* risk within a single save() call; the snapshot mainly protects against
|
|
3291
|
+
* future refactors to async I/O.
|
|
3292
|
+
*/
|
|
3284
3293
|
save() {
|
|
3285
3294
|
if (!this.dirty) return;
|
|
3286
|
-
const
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3295
|
+
const snapshot = {
|
|
3296
|
+
version: 1,
|
|
3297
|
+
records: [...this.records]
|
|
3298
|
+
// shallow copy — records are plain data
|
|
3299
|
+
};
|
|
3300
|
+
try {
|
|
3301
|
+
const tmp = this.filePath + ".tmp";
|
|
3302
|
+
writeFileSync2(tmp, JSON.stringify(snapshot, null, 2), "utf-8");
|
|
3303
|
+
renameSync(tmp, this.filePath);
|
|
3304
|
+
this.dirty = false;
|
|
3305
|
+
} catch (err) {
|
|
3306
|
+
console.error("[cost-tracker] Failed to persist cost history:", err);
|
|
3307
|
+
}
|
|
3291
3308
|
}
|
|
3292
3309
|
/**
|
|
3293
3310
|
* Record cost from a completed session/interaction.
|
|
@@ -5905,7 +5922,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
5905
5922
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
5906
5923
|
process.exit(1);
|
|
5907
5924
|
}
|
|
5908
|
-
const { startWebServer } = await import("./server-
|
|
5925
|
+
const { startWebServer } = await import("./server-A3SB52SS.js");
|
|
5909
5926
|
await startWebServer({ port, host: options.host });
|
|
5910
5927
|
});
|
|
5911
5928
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -6138,7 +6155,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
6138
6155
|
}),
|
|
6139
6156
|
config.get("customProviders")
|
|
6140
6157
|
);
|
|
6141
|
-
const { startHub } = await import("./hub-
|
|
6158
|
+
const { startHub } = await import("./hub-JA7HH44N.js");
|
|
6142
6159
|
await startHub(
|
|
6143
6160
|
{
|
|
6144
6161
|
topic: topic ?? "",
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
persistToolRound,
|
|
22
22
|
rebuildExtraMessages,
|
|
23
23
|
setupProxy
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-HOBLE365.js";
|
|
25
25
|
import {
|
|
26
26
|
AuthManager
|
|
27
27
|
} from "./chunk-BYNY5JPB.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
spawnAgentContext,
|
|
42
42
|
truncateOutput,
|
|
43
43
|
undoStack
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-X5RX2VGQ.js";
|
|
45
45
|
import "./chunk-4BKXL7SM.js";
|
|
46
46
|
import {
|
|
47
47
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
SKILLS_DIR_NAME,
|
|
62
62
|
VERSION,
|
|
63
63
|
buildUserIdentityPrompt
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-NIJZBQ6I.js";
|
|
65
65
|
|
|
66
66
|
// src/web/server.ts
|
|
67
67
|
import express from "express";
|
|
@@ -1971,7 +1971,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
1971
1971
|
case "test": {
|
|
1972
1972
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1973
1973
|
try {
|
|
1974
|
-
const { executeTests } = await import("./run-tests-
|
|
1974
|
+
const { executeTests } = await import("./run-tests-47TTKJTB.js");
|
|
1975
1975
|
const argStr = args.join(" ").trim();
|
|
1976
1976
|
let testArgs = {};
|
|
1977
1977
|
if (argStr) {
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getDangerLevel,
|
|
5
5
|
googleSearchContext,
|
|
6
6
|
truncateOutput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-X5RX2VGQ.js";
|
|
8
8
|
import "./chunk-4BKXL7SM.js";
|
|
9
9
|
import {
|
|
10
10
|
SUBAGENT_ALLOWED_TOOLS
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NIJZBQ6I.js";
|
|
12
12
|
|
|
13
13
|
// src/hub/task-orchestrator.ts
|
|
14
14
|
import { createInterface } from "readline";
|