jinzd-ai-cli 0.4.194 → 0.4.195

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-ZVMXIRBH.js";
4
+ } from "./chunk-KRP2XBJ3.js";
5
5
  import "./chunk-TZQHYZKT.js";
6
- import "./chunk-ZEHHAE3B.js";
6
+ import "./chunk-6RWXUT74.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-ZEHHAE3B.js";
5
+ } from "./chunk-6RWXUT74.js";
6
6
 
7
7
  // src/diagnostics/crash-log.ts
8
8
  import {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.194";
4
+ var VERSION = "0.4.195";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-ZEHHAE3B.js";
4
+ } from "./chunk-6RWXUT74.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -6,7 +6,7 @@ import { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.194";
9
+ var VERSION = "0.4.195";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -5,15 +5,15 @@ import {
5
5
  } from "./chunk-T2NL5ZIA.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-3KCEPI4E.js";
8
+ } from "./chunk-6WUIOZGL.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-CKBBAXCA.js";
11
+ } from "./chunk-KT6PA3NH.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  isFileWriteTool,
15
15
  runLeanAgentLoop
16
- } from "./chunk-ZRG2FPC6.js";
16
+ } from "./chunk-YZH2QQXJ.js";
17
17
  import {
18
18
  EnvLoader,
19
19
  NetworkError,
@@ -26,7 +26,7 @@ import {
26
26
  SUBAGENT_ALLOWED_TOOLS,
27
27
  SUBAGENT_DEFAULT_MAX_ROUNDS,
28
28
  SUBAGENT_MAX_ROUNDS_LIMIT
29
- } from "./chunk-ZEHHAE3B.js";
29
+ } from "./chunk-6RWXUT74.js";
30
30
  import {
31
31
  fileCheckpoints
32
32
  } from "./chunk-4BKXL7SM.js";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-ZEHHAE3B.js";
11
+ } from "./chunk-6RWXUT74.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONFIG_DIR_NAME
4
- } from "./chunk-ZEHHAE3B.js";
4
+ } from "./chunk-6RWXUT74.js";
5
5
  import {
6
6
  atomicWriteFileSync
7
7
  } from "./chunk-IW3Q7AE5.js";
@@ -3,7 +3,7 @@ import {
3
3
  detectsHallucinatedFileOp,
4
4
  repairToolCallArguments,
5
5
  schemaToJsonSchema
6
- } from "./chunk-ZRG2FPC6.js";
6
+ } from "./chunk-YZH2QQXJ.js";
7
7
  import {
8
8
  AuthError,
9
9
  ProviderError,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-ZJX6ZU5D.js";
4
+ } from "./chunk-A2P7LQEX.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-ZEHHAE3B.js";
14
+ } from "./chunk-6RWXUT74.js";
15
15
 
16
16
  // src/mcp/client.ts
17
17
  import { spawn } from "child_process";
@@ -483,6 +483,11 @@ function isCleanDocumentBody(content) {
483
483
  function teeFileStats(content) {
484
484
  return { lines: content.split("\n").length, bytes: Buffer.byteLength(content, "utf-8") };
485
485
  }
486
+ function freshPriorContent(current, baselineAtTurnStart) {
487
+ if (!current) return void 0;
488
+ if (current === baselineAtTurnStart) return void 0;
489
+ return current;
490
+ }
486
491
  function evaluateTeeContent(rawContent, saveToFile, priorContent) {
487
492
  const fallback = (matched) => {
488
493
  if (priorContent && priorContent !== rawContent && isCleanDocumentBody(priorContent)) {
@@ -1053,6 +1058,7 @@ export {
1053
1058
  TEE_FINAL_USER_NUDGE,
1054
1059
  CONTENT_ONLY_STREAM_REMINDER,
1055
1060
  isCleanDocumentBody,
1061
+ freshPriorContent,
1056
1062
  evaluateTeeContent,
1057
1063
  buildDeferredSaveInstruction,
1058
1064
  teeStreamErrorSummary,
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-HLWUDRBO.js";
7
7
  import {
8
8
  ProviderRegistry
9
- } from "./chunk-2BLBXGOE.js";
10
- import "./chunk-ZRG2FPC6.js";
9
+ } from "./chunk-VWZMVWA4.js";
10
+ import "./chunk-YZH2QQXJ.js";
11
11
  import {
12
12
  ConfigManager
13
- } from "./chunk-ZVMXIRBH.js";
13
+ } from "./chunk-KRP2XBJ3.js";
14
14
  import "./chunk-TZQHYZKT.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-ZEHHAE3B.js";
17
+ } from "./chunk-6RWXUT74.js";
18
18
 
19
19
  // src/cli/ci.ts
20
20
  import { execFileSync, execSync } from "child_process";
@@ -36,7 +36,7 @@ import {
36
36
  TEST_TIMEOUT,
37
37
  VERSION,
38
38
  buildUserIdentityPrompt
39
- } from "./chunk-ZEHHAE3B.js";
39
+ } from "./chunk-6RWXUT74.js";
40
40
  export {
41
41
  AGENTIC_BEHAVIOR_GUIDELINE,
42
42
  APP_NAME,
@@ -2,26 +2,26 @@
2
2
  import {
3
3
  getConfigDirUsage,
4
4
  listRecentCrashes
5
- } from "./chunk-5IVUINDO.js";
5
+ } from "./chunk-4ZRGTTO4.js";
6
6
  import {
7
7
  ProviderRegistry
8
- } from "./chunk-2BLBXGOE.js";
8
+ } from "./chunk-VWZMVWA4.js";
9
9
  import {
10
10
  getStatsSnapshot,
11
11
  getTopFailingTools,
12
12
  getTopUsedTools,
13
13
  resetStats
14
- } from "./chunk-CKBBAXCA.js";
15
- import "./chunk-ZRG2FPC6.js";
14
+ } from "./chunk-KT6PA3NH.js";
15
+ import "./chunk-YZH2QQXJ.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-ZVMXIRBH.js";
18
+ } from "./chunk-KRP2XBJ3.js";
19
19
  import "./chunk-TZQHYZKT.js";
20
20
  import {
21
21
  DEV_STATE_FILE_NAME,
22
22
  MEMORY_FILE_NAME,
23
23
  VERSION
24
- } from "./chunk-ZEHHAE3B.js";
24
+ } from "./chunk-6RWXUT74.js";
25
25
  import "./chunk-IW3Q7AE5.js";
26
26
 
27
27
  // src/diagnostics/doctor-cli.ts
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-LTBUGDLE.js";
39
+ } from "./chunk-7YZXAPHE.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -1974,6 +1974,11 @@ function isCleanDocumentBody(content) {
1974
1974
  function teeFileStats(content) {
1975
1975
  return { lines: content.split("\n").length, bytes: Buffer.byteLength(content, "utf-8") };
1976
1976
  }
1977
+ function freshPriorContent(current, baselineAtTurnStart) {
1978
+ if (!current) return void 0;
1979
+ if (current === baselineAtTurnStart) return void 0;
1980
+ return current;
1981
+ }
1977
1982
  function evaluateTeeContent(rawContent, saveToFile, priorContent) {
1978
1983
  const fallback = (matched) => {
1979
1984
  if (priorContent && priorContent !== rawContent && isCleanDocumentBody(priorContent)) {
@@ -12767,6 +12772,7 @@ ${mcpBudgetNote}` : "");
12767
12772
  const ac = new AbortController();
12768
12773
  this.abortController = ac;
12769
12774
  let pendingTeeSave = null;
12775
+ const lastAssistantAtTurnStart = lastAssistantText(apiMessages);
12770
12776
  try {
12771
12777
  const loopResult = await runAgentLoop({
12772
12778
  maxToolRounds,
@@ -12988,6 +12994,7 @@ ${summaryContent}`,
12988
12994
  extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
12989
12995
  return "continue";
12990
12996
  }
12997
+ const freshPrior = freshPriorContent(lastAssistantText(apiMessages), lastAssistantAtTurnStart);
12991
12998
  const teeResult = await this.runSaveLastResponseTee(
12992
12999
  provider,
12993
13000
  call,
@@ -12998,7 +13005,8 @@ ${summaryContent}`,
12998
13005
  systemPromptVolatile,
12999
13006
  modelParams,
13000
13007
  ac,
13001
- usage
13008
+ usage,
13009
+ freshPrior
13002
13010
  );
13003
13011
  if (teeResult.deferred) pendingTeeSave = saveToFile;
13004
13012
  const teeToolResults = toolCalls.map((tc) => {
@@ -13056,7 +13064,7 @@ ${summaryContent}`,
13056
13064
  * - 同一轮其余 tool_calls 会被标记为 skipped——AI 通常只调一个工具,多并发
13057
13065
  * 场景极少。
13058
13066
  */
13059
- async runSaveLastResponseTee(provider, call, saveToFile, apiMessages, extraMessages, systemPrompt, systemPromptVolatile, modelParams, ac, roundUsage) {
13067
+ async runSaveLastResponseTee(provider, call, saveToFile, apiMessages, extraMessages, systemPrompt, systemPromptVolatile, modelParams, ac, roundUsage, priorContent) {
13060
13068
  let deferred = false;
13061
13069
  this.send({
13062
13070
  type: "tool_call_start",
@@ -13106,7 +13114,7 @@ ${summaryContent}`,
13106
13114
  await new Promise((resolve7, reject) => {
13107
13115
  fileStream.end((err) => err ? reject(err) : resolve7());
13108
13116
  });
13109
- const verdict = evaluateTeeContent(fullContent, saveToFile, lastAssistantText(apiMessages));
13117
+ const verdict = evaluateTeeContent(fullContent, saveToFile, priorContent);
13110
13118
  if (verdict.kind === "reject") {
13111
13119
  cleanupRejectedTeeFile(saveToFile);
13112
13120
  isError = true;
@@ -14180,7 +14188,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
14180
14188
  case "test": {
14181
14189
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
14182
14190
  try {
14183
- const { executeTests } = await import("./run-tests-RFK53W3D.js");
14191
+ const { executeTests } = await import("./run-tests-RY4GBMDM.js");
14184
14192
  const argStr = args.join(" ").trim();
14185
14193
  let testArgs = {};
14186
14194
  if (argStr) {
@@ -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-GJBPVYFW.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-PA5PWQFE.js");
158
158
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
159
159
  let interrupted = false;
160
160
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  saveDevState,
16
16
  sessionHasMeaningfulContent,
17
17
  setupProxy
18
- } from "./chunk-6VMXFFO3.js";
18
+ } from "./chunk-XTL6I7J3.js";
19
19
  import {
20
20
  ToolExecutor,
21
21
  ToolRegistry,
@@ -35,10 +35,10 @@ import {
35
35
  spawnAgentContext,
36
36
  theme,
37
37
  undoStack
38
- } from "./chunk-ZJX6ZU5D.js";
38
+ } from "./chunk-A2P7LQEX.js";
39
39
  import "./chunk-T2NL5ZIA.js";
40
40
  import "./chunk-BXP6YZ2P.js";
41
- import "./chunk-3KCEPI4E.js";
41
+ import "./chunk-6WUIOZGL.js";
42
42
  import {
43
43
  SessionManager,
44
44
  getContentText
@@ -55,16 +55,16 @@ import {
55
55
  getConfigDirUsage,
56
56
  listRecentCrashes,
57
57
  writeCrashLog
58
- } from "./chunk-5IVUINDO.js";
58
+ } from "./chunk-4ZRGTTO4.js";
59
59
  import {
60
60
  ProviderRegistry
61
- } from "./chunk-2BLBXGOE.js";
61
+ } from "./chunk-VWZMVWA4.js";
62
62
  import {
63
63
  getStatsSnapshot,
64
64
  getTopFailingTools,
65
65
  getTopUsedTools,
66
66
  installFlushOnExit
67
- } from "./chunk-CKBBAXCA.js";
67
+ } from "./chunk-KT6PA3NH.js";
68
68
  import {
69
69
  CONTENT_ONLY_STREAM_REMINDER,
70
70
  TEE_FINAL_USER_NUDGE,
@@ -77,14 +77,15 @@ import {
77
77
  consumeToolCallStream,
78
78
  evaluateTeeContent,
79
79
  extractWrittenFilePaths,
80
+ freshPriorContent,
80
81
  isCleanDocumentBody,
81
82
  runAgentLoop,
82
83
  stripToolCallReminder,
83
84
  teeStreamErrorSummary
84
- } from "./chunk-ZRG2FPC6.js";
85
+ } from "./chunk-YZH2QQXJ.js";
85
86
  import {
86
87
  ConfigManager
87
- } from "./chunk-ZVMXIRBH.js";
88
+ } from "./chunk-KRP2XBJ3.js";
88
89
  import {
89
90
  AuthError,
90
91
  ProviderError,
@@ -111,7 +112,7 @@ import {
111
112
  SKILLS_DIR_NAME,
112
113
  VERSION,
113
114
  buildUserIdentityPrompt
114
- } from "./chunk-ZEHHAE3B.js";
115
+ } from "./chunk-6RWXUT74.js";
115
116
  import {
116
117
  formatGitContextForPrompt,
117
118
  getGitContext,
@@ -1826,7 +1827,7 @@ No tools match "${filter}".
1826
1827
  const { join: join5 } = await import("path");
1827
1828
  const { existsSync: existsSync5 } = await import("fs");
1828
1829
  const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
1829
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-CDVYNTU7.js");
1830
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-5LJTWBPU.js");
1830
1831
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
1831
1832
  const cwd = process.cwd();
1832
1833
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2887,7 +2888,7 @@ ${hint}` : "")
2887
2888
  usage: "/test [command|filter]",
2888
2889
  async execute(args, ctx) {
2889
2890
  try {
2890
- const { executeTests } = await import("./run-tests-A2I3WZ2H.js");
2891
+ const { executeTests } = await import("./run-tests-2H2G7VPL.js");
2891
2892
  const argStr = args.join(" ").trim();
2892
2893
  let testArgs = {};
2893
2894
  if (argStr) {
@@ -6398,6 +6399,7 @@ ${mcpBudgetNote}` : "");
6398
6399
  let lastToolCallSignature = "";
6399
6400
  let repeatedToolCallCount = 0;
6400
6401
  let pendingTeeSave = null;
6402
+ const lastResponseAtTurnStart = lastResponseStore.content;
6401
6403
  this.setupInterjectionListener();
6402
6404
  try {
6403
6405
  const loopResult = await runAgentLoop({
@@ -6866,7 +6868,11 @@ Tip: You can continue the conversation by asking the AI to proceed.`
6866
6868
  return "continue";
6867
6869
  }
6868
6870
  if (genUsage) accumulateUsage(usage, genUsage);
6869
- const verdict = evaluateTeeContent(genContent, saveToFile, lastResponseStore.content);
6871
+ const verdict = evaluateTeeContent(
6872
+ genContent,
6873
+ saveToFile,
6874
+ freshPriorContent(lastResponseStore.content, lastResponseAtTurnStart)
6875
+ );
6870
6876
  if (verdict.kind === "reject") {
6871
6877
  cleanupRejectedTeeFile(saveToFile);
6872
6878
  const label = verdict.reason === "meta-narration" ? "meta-narration / leaked reasoning, not document body" : "pseudo-tool-call markup with no usable document body";
@@ -7244,7 +7250,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7244
7250
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7245
7251
  process.exit(1);
7246
7252
  }
7247
- const { startWebServer } = await import("./server-6NLQUZKD.js");
7253
+ const { startWebServer } = await import("./server-VJYNMQOR.js");
7248
7254
  await startWebServer({ port, host: options.host });
7249
7255
  });
7250
7256
  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) => {
@@ -7411,16 +7417,16 @@ program.command("sessions").description("List recent conversation sessions").opt
7411
7417
  console.log(footer + "\n");
7412
7418
  });
7413
7419
  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) => {
7414
- const { runUsageCli } = await import("./usage-7DVISDK2.js");
7420
+ const { runUsageCli } = await import("./usage-CF37QUOV.js");
7415
7421
  await runUsageCli(options);
7416
7422
  });
7417
7423
  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) => {
7418
- const { runDoctorCli } = await import("./doctor-cli-Q3QFVEWQ.js");
7424
+ const { runDoctorCli } = await import("./doctor-cli-2JM5LE3J.js");
7419
7425
  await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
7420
7426
  });
7421
7427
  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) => {
7422
7428
  try {
7423
- const batch = await import("./batch-XGARS57W.js");
7429
+ const batch = await import("./batch-46RLXVR7.js");
7424
7430
  switch (action) {
7425
7431
  case "submit":
7426
7432
  if (!arg) {
@@ -7463,7 +7469,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7463
7469
  }
7464
7470
  });
7465
7471
  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) => {
7466
- const { startMcpServer } = await import("./server-RULXWZD4.js");
7472
+ const { startMcpServer } = await import("./server-6ZDQTDLT.js");
7467
7473
  await startMcpServer({
7468
7474
  allowDestructive: !!options.allowDestructive,
7469
7475
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7472,7 +7478,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
7472
7478
  });
7473
7479
  });
7474
7480
  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; diff fetched via `gh pr diff <num>`", (v) => parseInt(v, 10)).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)").action(async (options) => {
7475
- const { runCi } = await import("./ci-4TYLP7HF.js");
7481
+ const { runCi } = await import("./ci-FBTIW7YY.js");
7476
7482
  const result = await runCi({
7477
7483
  pr: options.pr,
7478
7484
  base: options.base,
@@ -7618,7 +7624,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7618
7624
  }),
7619
7625
  config.get("customProviders")
7620
7626
  );
7621
- const { startHub } = await import("./hub-UORFAHQ3.js");
7627
+ const { startHub } = await import("./hub-ZIYP65L7.js");
7622
7628
  await startHub(
7623
7629
  {
7624
7630
  topic: topic ?? "",
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-3KCEPI4E.js";
6
- import "./chunk-ZEHHAE3B.js";
5
+ } from "./chunk-6WUIOZGL.js";
6
+ import "./chunk-6RWXUT74.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-LTBUGDLE.js";
4
+ } from "./chunk-7YZXAPHE.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-ZJX6ZU5D.js";
4
+ } from "./chunk-A2P7LQEX.js";
5
5
  import "./chunk-T2NL5ZIA.js";
6
6
  import "./chunk-BXP6YZ2P.js";
7
- import "./chunk-3KCEPI4E.js";
7
+ import "./chunk-6WUIOZGL.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-CKBBAXCA.js";
10
+ } from "./chunk-KT6PA3NH.js";
11
11
  import {
12
12
  getDangerLevel,
13
13
  schemaToJsonSchema
14
- } from "./chunk-ZRG2FPC6.js";
14
+ } from "./chunk-YZH2QQXJ.js";
15
15
  import "./chunk-TZQHYZKT.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-ZEHHAE3B.js";
18
+ } from "./chunk-6RWXUT74.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
20
  import "./chunk-TB4W4Y4T.js";
21
21
  import "./chunk-KHYD3WXE.js";
@@ -19,7 +19,7 @@ import {
19
19
  loadDevState,
20
20
  persistToolRound,
21
21
  setupProxy
22
- } from "./chunk-6VMXFFO3.js";
22
+ } from "./chunk-XTL6I7J3.js";
23
23
  import {
24
24
  ToolExecutor,
25
25
  ToolRegistry,
@@ -38,10 +38,10 @@ import {
38
38
  spawnAgentContext,
39
39
  truncateOutput,
40
40
  undoStack
41
- } from "./chunk-ZJX6ZU5D.js";
41
+ } from "./chunk-A2P7LQEX.js";
42
42
  import "./chunk-T2NL5ZIA.js";
43
43
  import "./chunk-BXP6YZ2P.js";
44
- import "./chunk-3KCEPI4E.js";
44
+ import "./chunk-6WUIOZGL.js";
45
45
  import {
46
46
  SessionManager,
47
47
  getContentText
@@ -52,10 +52,10 @@ import {
52
52
  } from "./chunk-V37XOYOE.js";
53
53
  import {
54
54
  ProviderRegistry
55
- } from "./chunk-2BLBXGOE.js";
55
+ } from "./chunk-VWZMVWA4.js";
56
56
  import {
57
57
  runTool
58
- } from "./chunk-CKBBAXCA.js";
58
+ } from "./chunk-KT6PA3NH.js";
59
59
  import {
60
60
  CONTENT_ONLY_STREAM_REMINDER,
61
61
  TEE_FINAL_USER_NUDGE,
@@ -64,15 +64,16 @@ import {
64
64
  buildRoundBudgetHint,
65
65
  consumeToolCallStream,
66
66
  evaluateTeeContent,
67
+ freshPriorContent,
67
68
  getDangerLevel,
68
69
  isCleanDocumentBody,
69
70
  runAgentLoop,
70
71
  stripToolCallReminder,
71
72
  teeStreamErrorSummary
72
- } from "./chunk-ZRG2FPC6.js";
73
+ } from "./chunk-YZH2QQXJ.js";
73
74
  import {
74
75
  ConfigManager
75
- } from "./chunk-ZVMXIRBH.js";
76
+ } from "./chunk-KRP2XBJ3.js";
76
77
  import "./chunk-TZQHYZKT.js";
77
78
  import {
78
79
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -92,7 +93,7 @@ import {
92
93
  SKILLS_DIR_NAME,
93
94
  VERSION,
94
95
  buildUserIdentityPrompt
95
- } from "./chunk-ZEHHAE3B.js";
96
+ } from "./chunk-6RWXUT74.js";
96
97
  import {
97
98
  formatGitContextForPrompt,
98
99
  getGitContext,
@@ -1026,6 +1027,7 @@ ${mcpBudgetNote}` : "");
1026
1027
  const ac = new AbortController();
1027
1028
  this.abortController = ac;
1028
1029
  let pendingTeeSave = null;
1030
+ const lastAssistantAtTurnStart = lastAssistantText(apiMessages);
1029
1031
  try {
1030
1032
  const loopResult = await runAgentLoop({
1031
1033
  maxToolRounds,
@@ -1247,6 +1249,7 @@ ${summaryContent}`,
1247
1249
  extraMessages.push(...provider.buildToolResultMessages(toolCalls, results, reasoningContent));
1248
1250
  return "continue";
1249
1251
  }
1252
+ const freshPrior = freshPriorContent(lastAssistantText(apiMessages), lastAssistantAtTurnStart);
1250
1253
  const teeResult = await this.runSaveLastResponseTee(
1251
1254
  provider,
1252
1255
  call,
@@ -1257,7 +1260,8 @@ ${summaryContent}`,
1257
1260
  systemPromptVolatile,
1258
1261
  modelParams,
1259
1262
  ac,
1260
- usage
1263
+ usage,
1264
+ freshPrior
1261
1265
  );
1262
1266
  if (teeResult.deferred) pendingTeeSave = saveToFile;
1263
1267
  const teeToolResults = toolCalls.map((tc) => {
@@ -1315,7 +1319,7 @@ ${summaryContent}`,
1315
1319
  * - 同一轮其余 tool_calls 会被标记为 skipped——AI 通常只调一个工具,多并发
1316
1320
  * 场景极少。
1317
1321
  */
1318
- async runSaveLastResponseTee(provider, call, saveToFile, apiMessages, extraMessages, systemPrompt, systemPromptVolatile, modelParams, ac, roundUsage) {
1322
+ async runSaveLastResponseTee(provider, call, saveToFile, apiMessages, extraMessages, systemPrompt, systemPromptVolatile, modelParams, ac, roundUsage, priorContent) {
1319
1323
  let deferred = false;
1320
1324
  this.send({
1321
1325
  type: "tool_call_start",
@@ -1365,7 +1369,7 @@ ${summaryContent}`,
1365
1369
  await new Promise((resolve3, reject) => {
1366
1370
  fileStream.end((err) => err ? reject(err) : resolve3());
1367
1371
  });
1368
- const verdict = evaluateTeeContent(fullContent, saveToFile, lastAssistantText(apiMessages));
1372
+ const verdict = evaluateTeeContent(fullContent, saveToFile, priorContent);
1369
1373
  if (verdict.kind === "reject") {
1370
1374
  cleanupRejectedTeeFile(saveToFile);
1371
1375
  isError = true;
@@ -2439,7 +2443,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2439
2443
  case "test": {
2440
2444
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2441
2445
  try {
2442
- const { executeTests } = await import("./run-tests-A2I3WZ2H.js");
2446
+ const { executeTests } = await import("./run-tests-2H2G7VPL.js");
2443
2447
  const argStr = args.join(" ").trim();
2444
2448
  let testArgs = {};
2445
2449
  if (argStr) {
@@ -3,21 +3,21 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-ZJX6ZU5D.js";
6
+ } from "./chunk-A2P7LQEX.js";
7
7
  import "./chunk-T2NL5ZIA.js";
8
8
  import "./chunk-BXP6YZ2P.js";
9
- import "./chunk-3KCEPI4E.js";
9
+ import "./chunk-6WUIOZGL.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-CKBBAXCA.js";
12
+ } from "./chunk-KT6PA3NH.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  runLeanAgentLoop
16
- } from "./chunk-ZRG2FPC6.js";
16
+ } from "./chunk-YZH2QQXJ.js";
17
17
  import "./chunk-TZQHYZKT.js";
18
18
  import {
19
19
  SUBAGENT_ALLOWED_TOOLS
20
- } from "./chunk-ZEHHAE3B.js";
20
+ } from "./chunk-6RWXUT74.js";
21
21
  import "./chunk-4BKXL7SM.js";
22
22
  import "./chunk-TB4W4Y4T.js";
23
23
  import "./chunk-KHYD3WXE.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-V37XOYOE.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-ZVMXIRBH.js";
11
+ } from "./chunk-KRP2XBJ3.js";
12
12
  import "./chunk-TZQHYZKT.js";
13
- import "./chunk-ZEHHAE3B.js";
13
+ import "./chunk-6RWXUT74.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
 
16
16
  // src/cli/usage.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.194",
3
+ "version": "0.4.195",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",