jinzd-ai-cli 0.4.133 → 0.4.134

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-TULOCMHX.js";
4
+ } from "./chunk-63YPIF2A.js";
5
5
  import "./chunk-2ZD3YTVM.js";
6
- import "./chunk-GSOT7BGM.js";
6
+ import "./chunk-WKITLEBR.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
 
9
9
  // src/cli/batch.ts
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-NJRM3YMJ.js";
4
+ } from "./chunk-JER6BUQL.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-GSOT7BGM.js";
14
+ } from "./chunk-WKITLEBR.js";
15
15
  import {
16
16
  redactJson
17
17
  } from "./chunk-7ZJN4KLV.js";
@@ -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.133";
9
+ var VERSION = "0.4.134";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-GSOT7BGM.js";
11
+ } from "./chunk-WKITLEBR.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
  schemaToJsonSchema
4
- } from "./chunk-ZMM2FP6Y.js";
4
+ } from "./chunk-ZOFXDRJT.js";
5
5
  import {
6
6
  AuthError,
7
7
  ProviderError,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-GSOT7BGM.js";
5
+ } from "./chunk-WKITLEBR.js";
6
6
 
7
7
  // src/diagnostics/crash-log.ts
8
8
  import {
@@ -5,12 +5,12 @@ import {
5
5
  } from "./chunk-3BICTI5M.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-CBQNO5JN.js";
8
+ } from "./chunk-P6CGP7CU.js";
9
9
  import {
10
10
  getDangerLevel,
11
11
  isFileWriteTool,
12
12
  runTool
13
- } from "./chunk-ZMM2FP6Y.js";
13
+ } from "./chunk-ZOFXDRJT.js";
14
14
  import {
15
15
  EnvLoader,
16
16
  NetworkError,
@@ -23,7 +23,7 @@ import {
23
23
  SUBAGENT_ALLOWED_TOOLS,
24
24
  SUBAGENT_DEFAULT_MAX_ROUNDS,
25
25
  SUBAGENT_MAX_ROUNDS_LIMIT
26
- } from "./chunk-GSOT7BGM.js";
26
+ } from "./chunk-WKITLEBR.js";
27
27
  import {
28
28
  fileCheckpoints
29
29
  } from "./chunk-4BKXL7SM.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-GSOT7BGM.js";
4
+ } from "./chunk-WKITLEBR.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.133";
4
+ var VERSION = "0.4.134";
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
  CONFIG_DIR_NAME
4
- } from "./chunk-GSOT7BGM.js";
4
+ } from "./chunk-WKITLEBR.js";
5
5
 
6
6
  // src/diagnostics/tool-stats.ts
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } from "fs";
@@ -36,7 +36,7 @@ import {
36
36
  TEST_TIMEOUT,
37
37
  VERSION,
38
38
  buildUserIdentityPrompt
39
- } from "./chunk-GSOT7BGM.js";
39
+ } from "./chunk-WKITLEBR.js";
40
40
  import "./chunk-PDX44BCA.js";
41
41
  export {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -2,25 +2,25 @@
2
2
  import {
3
3
  getConfigDirUsage,
4
4
  listRecentCrashes
5
- } from "./chunk-E5AOTJSI.js";
5
+ } from "./chunk-CQZMVPOW.js";
6
6
  import {
7
7
  ProviderRegistry
8
- } from "./chunk-L3V2MC32.js";
8
+ } from "./chunk-BQL6IYCI.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-TULOCMHX.js";
11
+ } from "./chunk-63YPIF2A.js";
12
12
  import {
13
13
  getStatsSnapshot,
14
14
  getTopFailingTools,
15
15
  getTopUsedTools,
16
16
  resetStats
17
- } from "./chunk-ZMM2FP6Y.js";
17
+ } from "./chunk-ZOFXDRJT.js";
18
18
  import "./chunk-2ZD3YTVM.js";
19
19
  import {
20
20
  DEV_STATE_FILE_NAME,
21
21
  MEMORY_FILE_NAME,
22
22
  VERSION
23
- } from "./chunk-GSOT7BGM.js";
23
+ } from "./chunk-WKITLEBR.js";
24
24
  import "./chunk-PDX44BCA.js";
25
25
 
26
26
  // src/diagnostics/doctor-cli.ts
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-ZSOFSMKO.js";
39
+ } from "./chunk-4SSCJXAA.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -12219,7 +12219,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
12219
12219
  case "test": {
12220
12220
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
12221
12221
  try {
12222
- const { executeTests } = await import("./run-tests-YDQ2F6LG.js");
12222
+ const { executeTests } = await import("./run-tests-CL7X7D4R.js");
12223
12223
  const argStr = args.join(" ").trim();
12224
12224
  let testArgs = {};
12225
12225
  if (argStr) {
@@ -386,7 +386,7 @@ ${content}`);
386
386
  }
387
387
  }
388
388
  async function runTaskMode(config, providers, configManager, topic) {
389
- const { TaskOrchestrator } = await import("./task-orchestrator-AHFLTADN.js");
389
+ const { TaskOrchestrator } = await import("./task-orchestrator-HL2GAAGA.js");
390
390
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
391
391
  let interrupted = false;
392
392
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -16,12 +16,12 @@ import {
16
16
  saveDevState,
17
17
  sessionHasMeaningfulContent,
18
18
  setupProxy
19
- } from "./chunk-BQV6WMAW.js";
19
+ } from "./chunk-2QPEE3AY.js";
20
20
  import {
21
21
  getConfigDirUsage,
22
22
  listRecentCrashes,
23
23
  writeCrashLog
24
- } from "./chunk-E5AOTJSI.js";
24
+ } from "./chunk-CQZMVPOW.js";
25
25
  import {
26
26
  CONTENT_ONLY_STREAM_REMINDER,
27
27
  HALLUCINATION_CORRECTION_MESSAGE,
@@ -39,10 +39,10 @@ import {
39
39
  looksLikeDocumentBody,
40
40
  stripPseudoToolCalls,
41
41
  stripToolCallReminder
42
- } from "./chunk-L3V2MC32.js";
42
+ } from "./chunk-BQL6IYCI.js";
43
43
  import {
44
44
  ConfigManager
45
- } from "./chunk-TULOCMHX.js";
45
+ } from "./chunk-63YPIF2A.js";
46
46
  import {
47
47
  ToolExecutor,
48
48
  ToolRegistry,
@@ -61,16 +61,16 @@ import {
61
61
  spawnAgentContext,
62
62
  theme,
63
63
  undoStack
64
- } from "./chunk-NJRM3YMJ.js";
64
+ } from "./chunk-JER6BUQL.js";
65
65
  import "./chunk-3BICTI5M.js";
66
66
  import "./chunk-2DXY7UGF.js";
67
- import "./chunk-CBQNO5JN.js";
67
+ import "./chunk-P6CGP7CU.js";
68
68
  import {
69
69
  getStatsSnapshot,
70
70
  getTopFailingTools,
71
71
  getTopUsedTools,
72
72
  installFlushOnExit
73
- } from "./chunk-ZMM2FP6Y.js";
73
+ } from "./chunk-ZOFXDRJT.js";
74
74
  import "./chunk-2ZD3YTVM.js";
75
75
  import {
76
76
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -93,7 +93,7 @@ import {
93
93
  SKILLS_DIR_NAME,
94
94
  VERSION,
95
95
  buildUserIdentityPrompt
96
- } from "./chunk-GSOT7BGM.js";
96
+ } from "./chunk-WKITLEBR.js";
97
97
  import {
98
98
  formatGitContextForPrompt,
99
99
  getGitContext,
@@ -1247,7 +1247,6 @@ No commands match "${filter}".
1247
1247
  ctx.renderer.printInfo(`Already using provider: ${targetId}`);
1248
1248
  return;
1249
1249
  }
1250
- await ctx.generateDevStateSnapshot();
1251
1250
  const session = ctx.sessions.current;
1252
1251
  const msgCount = session?.messages.length ?? 0;
1253
1252
  ctx.setProvider(targetId);
@@ -1291,7 +1290,6 @@ No commands match "${filter}".
1291
1290
  ctx.renderer.printInfo(`Already using model: ${targetModel}`);
1292
1291
  return;
1293
1292
  }
1294
- await ctx.generateDevStateSnapshot();
1295
1293
  const session = ctx.sessions.current;
1296
1294
  const msgCount = session?.messages.length ?? 0;
1297
1295
  ctx.setProvider(ctx.getCurrentProvider(), targetModel);
@@ -1814,7 +1812,7 @@ No tools match "${filter}".
1814
1812
  const { join: join6 } = await import("path");
1815
1813
  const { existsSync: existsSync6 } = await import("fs");
1816
1814
  const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
1817
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-JGQULN3U.js");
1815
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-7VLZQ2ZS.js");
1818
1816
  const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
1819
1817
  const cwd = process.cwd();
1820
1818
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2875,7 +2873,7 @@ ${hint}` : "")
2875
2873
  usage: "/test [command|filter]",
2876
2874
  async execute(args, ctx) {
2877
2875
  try {
2878
- const { executeTests } = await import("./run-tests-4ARDT4DG.js");
2876
+ const { executeTests } = await import("./run-tests-I6RJ35P6.js");
2879
2877
  const argStr = args.join(" ").trim();
2880
2878
  let testArgs = {};
2881
2879
  if (argStr) {
@@ -3559,6 +3557,17 @@ Summary: ${fileMap.size} file(s) \u2014 ${newFiles} new, ${modifiedFiles} modifi
3559
3557
  console.log();
3560
3558
  }
3561
3559
  },
3560
+ {
3561
+ name: "snapshot",
3562
+ description: "Force-generate a dev-state handoff snapshot now (normally auto on /exit)",
3563
+ usage: "/snapshot",
3564
+ async execute(_args, ctx) {
3565
+ const ok = await ctx.generateDevStateSnapshot();
3566
+ if (!ok) {
3567
+ ctx.renderer.printInfo("No meaningful conversation yet \u2014 nothing to snapshot.");
3568
+ }
3569
+ }
3570
+ },
3562
3571
  {
3563
3572
  name: "exit",
3564
3573
  description: "Exit the REPL",
@@ -7198,11 +7207,21 @@ Tip: You can continue the conversation by asking the AI to proceed.`
7198
7207
  await cmd.execute(args, ctx);
7199
7208
  }
7200
7209
  handleExit() {
7210
+ void this.shutdownAsync();
7211
+ }
7212
+ async shutdownAsync() {
7201
7213
  this.running = false;
7202
7214
  const sessionId = this.sessions.current?.id;
7203
7215
  if (sessionId) {
7204
7216
  this.events.emit("session.end", { sessionId });
7205
7217
  }
7218
+ try {
7219
+ await Promise.race([
7220
+ this.generateDevStateSnapshot(),
7221
+ new Promise((resolve3) => setTimeout(resolve3, 1e4).unref())
7222
+ ]);
7223
+ } catch {
7224
+ }
7206
7225
  this.mcpManager?.closeAll().catch((err) => {
7207
7226
  process.stderr.write(`[mcp] cleanup error: ${err instanceof Error ? err.message : err}
7208
7227
  `);
@@ -7304,7 +7323,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7304
7323
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7305
7324
  process.exit(1);
7306
7325
  }
7307
- const { startWebServer } = await import("./server-QFFTT7TJ.js");
7326
+ const { startWebServer } = await import("./server-HIJQRAOG.js");
7308
7327
  await startWebServer({ port, host: options.host });
7309
7328
  });
7310
7329
  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) => {
@@ -7471,12 +7490,12 @@ program.command("sessions").description("List recent conversation sessions").opt
7471
7490
  console.log(footer + "\n");
7472
7491
  });
7473
7492
  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) => {
7474
- const { runDoctorCli } = await import("./doctor-cli-ISNGTCZM.js");
7493
+ const { runDoctorCli } = await import("./doctor-cli-FCJ4W3ZH.js");
7475
7494
  await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
7476
7495
  });
7477
7496
  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) => {
7478
7497
  try {
7479
- const batch = await import("./batch-3IW4CMU4.js");
7498
+ const batch = await import("./batch-ZCBWXMNR.js");
7480
7499
  switch (action) {
7481
7500
  case "submit":
7482
7501
  if (!arg) {
@@ -7519,7 +7538,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7519
7538
  }
7520
7539
  });
7521
7540
  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) => {
7522
- const { startMcpServer } = await import("./server-CVVX2KGJ.js");
7541
+ const { startMcpServer } = await import("./server-432AF6JW.js");
7523
7542
  await startMcpServer({
7524
7543
  allowDestructive: !!options.allowDestructive,
7525
7544
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7646,7 +7665,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7646
7665
  }),
7647
7666
  config.get("customProviders")
7648
7667
  );
7649
- const { startHub } = await import("./hub-7A2LMOI7.js");
7668
+ const { startHub } = await import("./hub-6LOXFNGG.js");
7650
7669
  await startHub(
7651
7670
  {
7652
7671
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-ZSOFSMKO.js";
4
+ } from "./chunk-4SSCJXAA.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  executeTests,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-CBQNO5JN.js";
6
- import "./chunk-GSOT7BGM.js";
5
+ } from "./chunk-P6CGP7CU.js";
6
+ import "./chunk-WKITLEBR.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
9
9
  executeTests,
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-NJRM3YMJ.js";
4
+ } from "./chunk-JER6BUQL.js";
5
5
  import "./chunk-3BICTI5M.js";
6
6
  import "./chunk-2DXY7UGF.js";
7
- import "./chunk-CBQNO5JN.js";
7
+ import "./chunk-P6CGP7CU.js";
8
8
  import {
9
9
  getDangerLevel,
10
10
  runTool,
11
11
  schemaToJsonSchema
12
- } from "./chunk-ZMM2FP6Y.js";
12
+ } from "./chunk-ZOFXDRJT.js";
13
13
  import "./chunk-2ZD3YTVM.js";
14
14
  import {
15
15
  VERSION
16
- } from "./chunk-GSOT7BGM.js";
16
+ } from "./chunk-WKITLEBR.js";
17
17
  import "./chunk-4BKXL7SM.js";
18
18
  import "./chunk-7ZJN4KLV.js";
19
19
  import "./chunk-KHYD3WXE.js";
@@ -14,7 +14,7 @@ import {
14
14
  loadDevState,
15
15
  persistToolRound,
16
16
  setupProxy
17
- } from "./chunk-BQV6WMAW.js";
17
+ } from "./chunk-2QPEE3AY.js";
18
18
  import {
19
19
  CONTENT_ONLY_STREAM_REMINDER,
20
20
  HALLUCINATION_CORRECTION_MESSAGE,
@@ -28,10 +28,10 @@ import {
28
28
  looksLikeDocumentBody,
29
29
  stripPseudoToolCalls,
30
30
  stripToolCallReminder
31
- } from "./chunk-L3V2MC32.js";
31
+ } from "./chunk-BQL6IYCI.js";
32
32
  import {
33
33
  ConfigManager
34
- } from "./chunk-TULOCMHX.js";
34
+ } from "./chunk-63YPIF2A.js";
35
35
  import {
36
36
  ToolExecutor,
37
37
  ToolRegistry,
@@ -49,14 +49,14 @@ import {
49
49
  spawnAgentContext,
50
50
  truncateOutput,
51
51
  undoStack
52
- } from "./chunk-NJRM3YMJ.js";
52
+ } from "./chunk-JER6BUQL.js";
53
53
  import "./chunk-3BICTI5M.js";
54
54
  import "./chunk-2DXY7UGF.js";
55
- import "./chunk-CBQNO5JN.js";
55
+ import "./chunk-P6CGP7CU.js";
56
56
  import {
57
57
  getDangerLevel,
58
58
  runTool
59
- } from "./chunk-ZMM2FP6Y.js";
59
+ } from "./chunk-ZOFXDRJT.js";
60
60
  import "./chunk-2ZD3YTVM.js";
61
61
  import {
62
62
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -76,7 +76,7 @@ import {
76
76
  SKILLS_DIR_NAME,
77
77
  VERSION,
78
78
  buildUserIdentityPrompt
79
- } from "./chunk-GSOT7BGM.js";
79
+ } from "./chunk-WKITLEBR.js";
80
80
  import {
81
81
  formatGitContextForPrompt,
82
82
  getGitContext,
@@ -2460,7 +2460,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2460
2460
  case "test": {
2461
2461
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2462
2462
  try {
2463
- const { executeTests } = await import("./run-tests-4ARDT4DG.js");
2463
+ const { executeTests } = await import("./run-tests-I6RJ35P6.js");
2464
2464
  const argStr = args.join(" ").trim();
2465
2465
  let testArgs = {};
2466
2466
  if (argStr) {
@@ -3,18 +3,18 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-NJRM3YMJ.js";
6
+ } from "./chunk-JER6BUQL.js";
7
7
  import "./chunk-3BICTI5M.js";
8
8
  import "./chunk-2DXY7UGF.js";
9
- import "./chunk-CBQNO5JN.js";
9
+ import "./chunk-P6CGP7CU.js";
10
10
  import {
11
11
  getDangerLevel,
12
12
  runTool
13
- } from "./chunk-ZMM2FP6Y.js";
13
+ } from "./chunk-ZOFXDRJT.js";
14
14
  import "./chunk-2ZD3YTVM.js";
15
15
  import {
16
16
  SUBAGENT_ALLOWED_TOOLS
17
- } from "./chunk-GSOT7BGM.js";
17
+ } from "./chunk-WKITLEBR.js";
18
18
  import "./chunk-4BKXL7SM.js";
19
19
  import "./chunk-7ZJN4KLV.js";
20
20
  import "./chunk-KHYD3WXE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.133",
3
+ "version": "0.4.134",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",