jinzd-ai-cli 0.4.19 → 0.4.20

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.
@@ -7,7 +7,7 @@ import {
7
7
  ProviderNotFoundError,
8
8
  RateLimitError,
9
9
  schemaToJsonSchema
10
- } from "./chunk-PR5JZVNN.js";
10
+ } from "./chunk-ZZPMHXTT.js";
11
11
  import {
12
12
  APP_NAME,
13
13
  CONFIG_DIR_NAME,
@@ -20,7 +20,7 @@ import {
20
20
  MCP_TOOL_PREFIX,
21
21
  PLUGINS_DIR_NAME,
22
22
  VERSION
23
- } from "./chunk-JNAZORS2.js";
23
+ } from "./chunk-XKWQJ5K4.js";
24
24
 
25
25
  // src/config/config-manager.ts
26
26
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -3441,7 +3441,7 @@ function saveDevState(content) {
3441
3441
  if (trimmed.length > DEV_STATE_MAX_CHARS) {
3442
3442
  trimmed = trimmed.slice(0, DEV_STATE_MAX_CHARS);
3443
3443
  const lastNewline = trimmed.lastIndexOf("\n");
3444
- if (lastNewline > DEV_STATE_MAX_CHARS * 0.8) {
3444
+ if (lastNewline > 0) {
3445
3445
  trimmed = trimmed.slice(0, lastNewline);
3446
3446
  }
3447
3447
  trimmed += "\n\n[...truncated]";
@@ -8,7 +8,7 @@ import { platform } from "os";
8
8
  import chalk from "chalk";
9
9
 
10
10
  // src/core/constants.ts
11
- var VERSION = "0.4.19";
11
+ var VERSION = "0.4.20";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
@@ -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.19";
9
+ var VERSION = "0.4.20";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -6,7 +6,7 @@ import {
6
6
  SUBAGENT_DEFAULT_MAX_ROUNDS,
7
7
  SUBAGENT_MAX_ROUNDS_LIMIT,
8
8
  runTestsTool
9
- } from "./chunk-JNAZORS2.js";
9
+ } from "./chunk-XKWQJ5K4.js";
10
10
 
11
11
  // src/tools/builtin/bash.ts
12
12
  import { execSync } from "child_process";
@@ -387,7 +387,7 @@ ${content}`);
387
387
  }
388
388
  }
389
389
  async function runTaskMode(config, providers, configManager, topic) {
390
- const { TaskOrchestrator } = await import("./task-orchestrator-JKY2T2W3.js");
390
+ const { TaskOrchestrator } = await import("./task-orchestrator-GFNC3Y6D.js");
391
391
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
392
392
  let interrupted = false;
393
393
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  saveDevState,
24
24
  sessionHasMeaningfulContent,
25
25
  setupProxy
26
- } from "./chunk-DBEYB76P.js";
26
+ } from "./chunk-IR6JR3GH.js";
27
27
  import {
28
28
  ToolRegistry,
29
29
  askUserContext,
@@ -38,7 +38,7 @@ import {
38
38
  theme,
39
39
  truncateOutput,
40
40
  undoStack
41
- } from "./chunk-PR5JZVNN.js";
41
+ } from "./chunk-ZZPMHXTT.js";
42
42
  import {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  AUTHOR,
@@ -58,7 +58,7 @@ import {
58
58
  REPO_URL,
59
59
  SKILLS_DIR_NAME,
60
60
  VERSION
61
- } from "./chunk-JNAZORS2.js";
61
+ } from "./chunk-XKWQJ5K4.js";
62
62
 
63
63
  // src/index.ts
64
64
  import { program } from "commander";
@@ -350,7 +350,7 @@ var Renderer = class {
350
350
  } catch (err) {
351
351
  if (err?.name === "AbortError") {
352
352
  interrupted = true;
353
- flushBuf();
353
+ if (!inThinking) flushBuf();
354
354
  } else {
355
355
  throw err;
356
356
  }
@@ -423,6 +423,9 @@ var Renderer = class {
423
423
  process.stdout.write(theme.dim("\n\u{1F4AD} Thinking...\n"));
424
424
  }
425
425
  }
426
+ if (this.wrapWidth > 0) {
427
+ displayed = wrapText(displayed, this.wrapWidth);
428
+ }
426
429
  const CHUNK_SIZE = 12;
427
430
  const DELAY_MS = 8;
428
431
  let pos = 0;
@@ -1038,11 +1041,18 @@ function createDefaultCommands() {
1038
1041
  return;
1039
1042
  }
1040
1043
  const sessions = ctx.sessions.listSessions();
1041
- const match = sessions.find((s) => s.id.startsWith(id));
1042
- if (!match) {
1044
+ const matches = sessions.filter((s) => s.id.startsWith(id));
1045
+ if (matches.length === 0) {
1043
1046
  ctx.renderer.renderError(`Session '${id}' not found.`);
1044
1047
  return;
1045
1048
  }
1049
+ if (matches.length > 1) {
1050
+ console.log(theme.warning(` \u26A0 Ambiguous prefix '${id}' matches ${matches.length} sessions \u2014 loading most recent:`));
1051
+ for (const m of matches.slice(0, 5)) {
1052
+ console.log(theme.dim(` ${m.id.slice(0, 12)} ${m.title ?? "(untitled)"}`));
1053
+ }
1054
+ }
1055
+ const match = matches[0];
1046
1056
  ctx.sessions.loadSession(match.id);
1047
1057
  ctx.setProvider(match.provider, match.model);
1048
1058
  ctx.resetSessionTokenUsage();
@@ -1155,7 +1165,8 @@ function createDefaultCommands() {
1155
1165
  const estStr = fmtCtx(estimated);
1156
1166
  const winStr = fmtCtx(ctxWindowSize);
1157
1167
  const pctColor = pct >= 80 ? theme.error : pct >= 60 ? theme.warning : theme.success;
1158
- console.log(` Context% : ~${estStr} / ${winStr} tokens (${pctColor(`${pct}%`)})`);
1168
+ const pctDisplay = pct > 100 ? `${pct}% \u26A0 over limit` : `${pct}%`;
1169
+ console.log(` Context% : ~${estStr} / ${winStr} tokens (${pctColor(pctDisplay)})`);
1159
1170
  }
1160
1171
  console.log();
1161
1172
  }
@@ -1821,7 +1832,8 @@ ${hint}` : "")
1821
1832
  }
1822
1833
  const ok = ctx.restoreCheckpoint(name);
1823
1834
  if (ok) {
1824
- console.log(theme.success(` \u2713 Restored to checkpoint "${name}" (${session.messages.length} messages)`));
1835
+ ctx.resetSessionTokenUsage();
1836
+ console.log(theme.success(` \u2713 Restored to checkpoint "${name}" (${session.messages.length} messages, token usage reset)`));
1825
1837
  } else {
1826
1838
  ctx.renderer.renderError(`Checkpoint "${name}" not found.`);
1827
1839
  }
@@ -1925,17 +1937,21 @@ ${hint}` : "")
1925
1937
  name: "test",
1926
1938
  description: "Run project tests and show structured report",
1927
1939
  usage: "/test [command|filter]",
1928
- async execute(args, _ctx) {
1929
- const { executeTests } = await import("./run-tests-HP4MMQAP.js");
1930
- const argStr = args.join(" ").trim();
1931
- let testArgs = {};
1932
- if (argStr) {
1933
- const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1934
- testArgs = isCommand ? { command: argStr } : { filter: argStr };
1935
- }
1936
- const report = await executeTests(testArgs);
1937
- const firstLines = report.split("\n").slice(0, 3).join("\n");
1938
- console.log(theme.dim(firstLines));
1940
+ async execute(args, ctx) {
1941
+ try {
1942
+ const { executeTests } = await import("./run-tests-S3UPP5B4.js");
1943
+ const argStr = args.join(" ").trim();
1944
+ let testArgs = {};
1945
+ if (argStr) {
1946
+ const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1947
+ testArgs = isCommand ? { command: argStr } : { filter: argStr };
1948
+ }
1949
+ const report = await executeTests(testArgs);
1950
+ const firstLines = report.split("\n").slice(0, 3).join("\n");
1951
+ console.log(theme.dim(firstLines));
1952
+ } catch (err) {
1953
+ ctx.renderer.renderError(`Test execution failed: ${err instanceof Error ? err.message : String(err)}`);
1954
+ }
1939
1955
  }
1940
1956
  },
1941
1957
  {
@@ -5548,7 +5564,7 @@ program.command("web").description("Start Web UI server with browser-based chat
5548
5564
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
5549
5565
  process.exit(1);
5550
5566
  }
5551
- const { startWebServer } = await import("./server-JFLTWF7Q.js");
5567
+ const { startWebServer } = await import("./server-HAZM4ENT.js");
5552
5568
  await startWebServer({ port, host: options.host });
5553
5569
  });
5554
5570
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -5781,7 +5797,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
5781
5797
  }),
5782
5798
  config.get("customProviders")
5783
5799
  );
5784
- const { startHub } = await import("./hub-RJRNBB5G.js");
5800
+ const { startHub } = await import("./hub-J3OGSYQ5.js");
5785
5801
  await startHub(
5786
5802
  {
5787
5803
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-6WLDJKHU.js";
4
+ } from "./chunk-ZIFAZ4EJ.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-JNAZORS2.js";
5
+ } from "./chunk-XKWQJ5K4.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -18,7 +18,7 @@ import {
18
18
  renderDiff,
19
19
  runHook,
20
20
  setupProxy
21
- } from "./chunk-DBEYB76P.js";
21
+ } from "./chunk-IR6JR3GH.js";
22
22
  import {
23
23
  AuthManager
24
24
  } from "./chunk-BYNY5JPB.js";
@@ -32,7 +32,7 @@ import {
32
32
  spawnAgentContext,
33
33
  truncateOutput,
34
34
  undoStack
35
- } from "./chunk-PR5JZVNN.js";
35
+ } from "./chunk-ZZPMHXTT.js";
36
36
  import {
37
37
  AGENTIC_BEHAVIOR_GUIDELINE,
38
38
  AUTHOR,
@@ -49,7 +49,7 @@ import {
49
49
  PLUGINS_DIR_NAME,
50
50
  SKILLS_DIR_NAME,
51
51
  VERSION
52
- } from "./chunk-JNAZORS2.js";
52
+ } from "./chunk-XKWQJ5K4.js";
53
53
 
54
54
  // src/web/server.ts
55
55
  import express from "express";
@@ -1490,7 +1490,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
1490
1490
  case "test": {
1491
1491
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1492
1492
  try {
1493
- const { executeTests } = await import("./run-tests-HP4MMQAP.js");
1493
+ const { executeTests } = await import("./run-tests-S3UPP5B4.js");
1494
1494
  const argStr = args.join(" ").trim();
1495
1495
  let testArgs = {};
1496
1496
  if (argStr) {
@@ -4,10 +4,10 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-PR5JZVNN.js";
7
+ } from "./chunk-ZZPMHXTT.js";
8
8
  import {
9
9
  SUBAGENT_ALLOWED_TOOLS
10
- } from "./chunk-JNAZORS2.js";
10
+ } from "./chunk-XKWQJ5K4.js";
11
11
 
12
12
  // src/hub/task-orchestrator.ts
13
13
  import { createInterface } from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.19",
3
+ "version": "0.4.20",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",