jinzd-ai-cli 0.1.46 → 0.1.47

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.
@@ -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.1.46";
11
+ var VERSION = "0.1.47";
12
12
  var APP_NAME = "ai-cli";
13
13
  var CONFIG_DIR_NAME = ".aicli";
14
14
  var CONFIG_FILE_NAME = "config.json";
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  SUBAGENT_MAX_ROUNDS_LIMIT,
30
30
  VERSION,
31
31
  runTestsTool
32
- } from "./chunk-LRU55UAO.js";
32
+ } from "./chunk-ZUZDWQVG.js";
33
33
 
34
34
  // src/index.ts
35
35
  import { program } from "commander";
@@ -1924,7 +1924,12 @@ var SessionManager = class {
1924
1924
  if (!existsSync2(filePath)) {
1925
1925
  throw new Error(`Session ${id} not found`);
1926
1926
  }
1927
- const data = JSON.parse(readFileSync2(filePath, "utf-8"));
1927
+ let data;
1928
+ try {
1929
+ data = JSON.parse(readFileSync2(filePath, "utf-8"));
1930
+ } catch (err) {
1931
+ throw new Error(`Session ${id} is corrupted: ${err instanceof Error ? err.message : String(err)}`);
1932
+ }
1928
1933
  const session = Session.fromJSON(data);
1929
1934
  this._current = session;
1930
1935
  return session;
@@ -2950,8 +2955,15 @@ function scanDirTree(dir, maxDepth = 2, maxEntries = 80) {
2950
2955
  }
2951
2956
  const filtered = entries.filter((e) => !e.startsWith(".") && !SCAN_SKIP_DIRS.has(e));
2952
2957
  const sorted = filtered.sort((a, b) => {
2953
- const aIsDir = statSync2(join5(d, a)).isDirectory();
2954
- const bIsDir = statSync2(join5(d, b)).isDirectory();
2958
+ let aIsDir = false, bIsDir = false;
2959
+ try {
2960
+ aIsDir = statSync2(join5(d, a)).isDirectory();
2961
+ } catch {
2962
+ }
2963
+ try {
2964
+ bIsDir = statSync2(join5(d, b)).isDirectory();
2965
+ } catch {
2966
+ }
2955
2967
  if (aIsDir !== bIsDir) return aIsDir ? -1 : 1;
2956
2968
  return a.localeCompare(b);
2957
2969
  });
@@ -4161,7 +4173,7 @@ ${hint}` : "")
4161
4173
  description: "Run project tests and show structured report",
4162
4174
  usage: "/test [command|filter]",
4163
4175
  async execute(args, _ctx) {
4164
- const { executeTests } = await import("./run-tests-V62QUKVZ.js");
4176
+ const { executeTests } = await import("./run-tests-EM3QNRWV.js");
4165
4177
  const argStr = args.join(" ").trim();
4166
4178
  let testArgs = {};
4167
4179
  if (argStr) {
@@ -9106,17 +9118,17 @@ Session '${this.resumeSessionId}' not found.
9106
9118
  this.renderer.renderError(err);
9107
9119
  } finally {
9108
9120
  processing = false;
9109
- }
9110
- if (this.running) {
9111
- rlAny.output = savedOutput;
9112
- const rlInternal = this.rl;
9113
- rlInternal.line = "";
9114
- rlInternal.cursor = 0;
9115
- rlInternal.paused = false;
9116
- process.stdin.resume();
9117
- this.showPrompt();
9118
- } else {
9119
- resolve5();
9121
+ if (this.running) {
9122
+ rlAny.output = savedOutput;
9123
+ const rlInternal = this.rl;
9124
+ rlInternal.line = "";
9125
+ rlInternal.cursor = 0;
9126
+ rlInternal.paused = false;
9127
+ process.stdin.resume();
9128
+ this.showPrompt();
9129
+ } else {
9130
+ resolve5();
9131
+ }
9120
9132
  }
9121
9133
  });
9122
9134
  this.rl.on("close", () => {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-LRU55UAO.js";
5
+ } from "./chunk-ZUZDWQVG.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",