jinzd-ai-cli 0.4.187 → 0.4.188

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.
Files changed (26) hide show
  1. package/dist/{batch-UTP6NYVX.js → batch-D6K2KHJK.js} +2 -2
  2. package/dist/{chat-index-2I7ZHRE5.js → chat-index-JXTYDRCY.js} +1 -1
  3. package/dist/{chat-index-BE4TPLFH.js → chat-index-WDMVP7BN.js} +1 -1
  4. package/dist/{chunk-MM3F43H6.js → chunk-4UZE4ADL.js} +54 -23
  5. package/dist/{chunk-MVK25WZW.js → chunk-DFQSQQEU.js} +1 -1
  6. package/dist/{chunk-Q6BSUIDV.js → chunk-J3XSJCO5.js} +4 -4
  7. package/dist/{chunk-T5VKNPLD.js → chunk-KIGVJVX4.js} +52 -23
  8. package/dist/{chunk-43T4MY5B.js → chunk-MUQZOUV5.js} +1 -1
  9. package/dist/{chunk-4SZ6X47A.js → chunk-NRSAAMIF.js} +1 -1
  10. package/dist/{chunk-L5L5B7HD.js → chunk-ODAAPNSL.js} +1 -1
  11. package/dist/{chunk-UAJKGLRV.js → chunk-Q7SB3R25.js} +1 -1
  12. package/dist/{chunk-SOWBY545.js → chunk-UK6E2563.js} +1 -1
  13. package/dist/{chunk-ZTBUTA24.js → chunk-VPTRE7IW.js} +2 -2
  14. package/dist/{ci-2WFKSG2J.js → ci-42ZBP2SY.js} +2 -2
  15. package/dist/{constants-XEL5347E.js → constants-NCWVAAI7.js} +1 -1
  16. package/dist/{doctor-cli-MYJFAWKV.js → doctor-cli-R3SWTL5Z.js} +4 -4
  17. package/dist/electron-server.js +6 -6
  18. package/dist/{hub-CHE7JDIH.js → hub-3ZGIM2FN.js} +1 -1
  19. package/dist/index.js +18 -18
  20. package/dist/{run-tests-NWRKAVFS.js → run-tests-IJYP6BMT.js} +1 -1
  21. package/dist/{run-tests-Z7IGVS2W.js → run-tests-NS3SPH6S.js} +2 -2
  22. package/dist/{server-25WVH5YX.js → server-SVTSJ3PK.js} +5 -5
  23. package/dist/{server-2B5JDVJS.js → server-TZRMRT3O.js} +11 -11
  24. package/dist/{task-orchestrator-DC7NGBQA.js → task-orchestrator-GMJ5PLVV.js} +5 -5
  25. package/dist/{usage-ZVKFH7BM.js → usage-IYMFSHDX.js} +2 -2
  26. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-UAJKGLRV.js";
4
+ } from "./chunk-Q7SB3R25.js";
5
5
  import "./chunk-TZQHYZKT.js";
6
- import "./chunk-SOWBY545.js";
6
+ import "./chunk-UK6E2563.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
 
9
9
  // src/cli/batch.ts
@@ -6,7 +6,7 @@ import {
6
6
  getChatIndexStatus,
7
7
  loadChatIndex,
8
8
  searchChatMemory
9
- } from "./chunk-MM3F43H6.js";
9
+ } from "./chunk-4UZE4ADL.js";
10
10
  import "./chunk-KHYD3WXE.js";
11
11
  import "./chunk-SLSWPBK3.js";
12
12
  import "./chunk-PDX44BCA.js";
@@ -5,7 +5,7 @@ import {
5
5
  getChatIndexStatus,
6
6
  loadChatIndex,
7
7
  searchChatMemory
8
- } from "./chunk-T5VKNPLD.js";
8
+ } from "./chunk-KIGVJVX4.js";
9
9
  import "./chunk-JV5N65KN.js";
10
10
  import "./chunk-3RG5ZIWI.js";
11
11
  export {
@@ -9,10 +9,47 @@ import {
9
9
  } from "./chunk-SLSWPBK3.js";
10
10
 
11
11
  // src/memory/chat-index.ts
12
- import fs from "fs";
12
+ import fs2 from "fs";
13
13
  import path from "path";
14
14
  import os from "os";
15
15
  import crypto from "crypto";
16
+
17
+ // src/core/atomic-write.ts
18
+ import fs from "fs";
19
+ var RETRYABLE_CODES = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EBUSY"]);
20
+ var MAX_RENAME_RETRIES = 10;
21
+ function sleepSync(ms) {
22
+ const sab = new Int32Array(new SharedArrayBuffer(4));
23
+ Atomics.wait(sab, 0, 0, ms);
24
+ }
25
+ function atomicWriteFileSync(target, data) {
26
+ const tmp = `${target}.tmp`;
27
+ fs.writeFileSync(tmp, data);
28
+ for (let attempt = 0; ; attempt++) {
29
+ try {
30
+ fs.renameSync(tmp, target);
31
+ return;
32
+ } catch (err) {
33
+ const code = err.code;
34
+ if (attempt < MAX_RENAME_RETRIES && code && RETRYABLE_CODES.has(code)) {
35
+ sleepSync(5 * (attempt + 1));
36
+ continue;
37
+ }
38
+ try {
39
+ fs.writeFileSync(target, data);
40
+ try {
41
+ fs.unlinkSync(tmp);
42
+ } catch {
43
+ }
44
+ return;
45
+ } catch {
46
+ throw err;
47
+ }
48
+ }
49
+ }
50
+ }
51
+
52
+ // src/memory/chat-index.ts
16
53
  var MEMORY_DIR_NAME = "memory-index";
17
54
  var CHUNKS_FILE = "chunks.json";
18
55
  var VECTORS_FILE = "vectors.vec";
@@ -99,7 +136,7 @@ function writeVectorsFile(chunks, vectors) {
99
136
  );
100
137
  }
101
138
  const dir = memoryIndexDir();
102
- fs.mkdirSync(dir, { recursive: true });
139
+ fs2.mkdirSync(dir, { recursive: true });
103
140
  const totalBytes = VEC_HEADER_BYTES + vectors.byteLength;
104
141
  const buf = Buffer.alloc(totalBytes);
105
142
  buf.writeUInt32LE(VEC_MAGIC, 0);
@@ -107,17 +144,14 @@ function writeVectorsFile(chunks, vectors) {
107
144
  buf.writeUInt32LE(chunks.length, 8);
108
145
  buf.writeUInt32LE(EMBEDDING_DIM, 12);
109
146
  Buffer.from(vectors.buffer, vectors.byteOffset, vectors.byteLength).copy(buf, VEC_HEADER_BYTES);
110
- const target = vectorsPath();
111
- const tmp = `${target}.tmp`;
112
- fs.writeFileSync(tmp, buf);
113
- fs.renameSync(tmp, target);
147
+ atomicWriteFileSync(vectorsPath(), buf);
114
148
  }
115
149
  function readVectorsFile(expectedCount) {
116
150
  const p = vectorsPath();
117
- if (!fs.existsSync(p)) return null;
151
+ if (!fs2.existsSync(p)) return null;
118
152
  let buf;
119
153
  try {
120
- buf = fs.readFileSync(p);
154
+ buf = fs2.readFileSync(p);
121
155
  } catch {
122
156
  return null;
123
157
  }
@@ -136,17 +170,14 @@ function readVectorsFile(expectedCount) {
136
170
  }
137
171
  function writeIndexFile(idx) {
138
172
  const dir = memoryIndexDir();
139
- fs.mkdirSync(dir, { recursive: true });
140
- const target = chunksPath();
141
- const tmp = `${target}.tmp`;
142
- fs.writeFileSync(tmp, JSON.stringify(idx, null, 2), "utf-8");
143
- fs.renameSync(tmp, target);
173
+ fs2.mkdirSync(dir, { recursive: true });
174
+ atomicWriteFileSync(chunksPath(), JSON.stringify(idx, null, 2));
144
175
  }
145
176
  function readIndexFile() {
146
177
  const p = chunksPath();
147
- if (!fs.existsSync(p)) return null;
178
+ if (!fs2.existsSync(p)) return null;
148
179
  try {
149
- const raw = fs.readFileSync(p, "utf-8");
180
+ const raw = fs2.readFileSync(p, "utf-8");
150
181
  const data = JSON.parse(raw);
151
182
  if (data.version !== 1) return null;
152
183
  return data;
@@ -163,24 +194,24 @@ function loadChatIndex() {
163
194
  }
164
195
  function clearChatIndex() {
165
196
  try {
166
- if (fs.existsSync(chunksPath())) fs.unlinkSync(chunksPath());
197
+ if (fs2.existsSync(chunksPath())) fs2.unlinkSync(chunksPath());
167
198
  } catch {
168
199
  }
169
200
  try {
170
- if (fs.existsSync(vectorsPath())) fs.unlinkSync(vectorsPath());
201
+ if (fs2.existsSync(vectorsPath())) fs2.unlinkSync(vectorsPath());
171
202
  } catch {
172
203
  }
173
204
  }
174
205
  function listSessionFiles() {
175
206
  const dir = historyDir();
176
- if (!fs.existsSync(dir)) return [];
207
+ if (!fs2.existsSync(dir)) return [];
177
208
  const out = [];
178
- for (const name of fs.readdirSync(dir)) {
209
+ for (const name of fs2.readdirSync(dir)) {
179
210
  if (!name.endsWith(".json")) continue;
180
211
  const id = name.replace(/\.json$/, "");
181
212
  const p = path.join(dir, name);
182
213
  try {
183
- const st = fs.statSync(p);
214
+ const st = fs2.statSync(p);
184
215
  out.push({ id, path: p, mtime: st.mtimeMs });
185
216
  } catch {
186
217
  }
@@ -189,7 +220,7 @@ function listSessionFiles() {
189
220
  }
190
221
  function readSession(p) {
191
222
  try {
192
- const data = JSON.parse(fs.readFileSync(p, "utf-8"));
223
+ const data = JSON.parse(fs2.readFileSync(p, "utf-8"));
193
224
  if (!data.id || !Array.isArray(data.messages)) return null;
194
225
  return data;
195
226
  } catch {
@@ -332,8 +363,8 @@ function getChatIndexStatus() {
332
363
  chunksFileSizeBytes: 0
333
364
  };
334
365
  try {
335
- if (fs.existsSync(vectorsPath())) status.vecFileSizeBytes = fs.statSync(vectorsPath()).size;
336
- if (fs.existsSync(chunksPath())) status.chunksFileSizeBytes = fs.statSync(chunksPath()).size;
366
+ if (fs2.existsSync(vectorsPath())) status.vecFileSizeBytes = fs2.statSync(vectorsPath()).size;
367
+ if (fs2.existsSync(chunksPath())) status.chunksFileSizeBytes = fs2.statSync(chunksPath()).size;
337
368
  } catch {
338
369
  }
339
370
  const idx = readIndexFile();
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONFIG_DIR_NAME
4
- } from "./chunk-SOWBY545.js";
4
+ } from "./chunk-UK6E2563.js";
5
5
 
6
6
  // src/diagnostics/tool-stats.ts
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } from "fs";
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-HDSKW7Q3.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-4SZ6X47A.js";
8
+ } from "./chunk-NRSAAMIF.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-MVK25WZW.js";
11
+ } from "./chunk-DFQSQQEU.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  isFileWriteTool
@@ -25,14 +25,14 @@ import {
25
25
  SUBAGENT_ALLOWED_TOOLS,
26
26
  SUBAGENT_DEFAULT_MAX_ROUNDS,
27
27
  SUBAGENT_MAX_ROUNDS_LIMIT
28
- } from "./chunk-SOWBY545.js";
28
+ } from "./chunk-UK6E2563.js";
29
29
  import {
30
30
  fileCheckpoints
31
31
  } from "./chunk-4BKXL7SM.js";
32
32
  import {
33
33
  loadChatIndex,
34
34
  searchChatMemory
35
- } from "./chunk-MM3F43H6.js";
35
+ } from "./chunk-4UZE4ADL.js";
36
36
  import {
37
37
  indexProject
38
38
  } from "./chunk-VNNYHW6N.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-JV5N65KN.js";
6
6
 
7
7
  // src/memory/chat-index.ts
8
- import fs from "fs";
8
+ import fs2 from "fs";
9
9
  import path from "path";
10
10
  import os from "os";
11
11
  import crypto from "crypto";
@@ -118,6 +118,41 @@ function redactJson(value, options) {
118
118
  return { value: redacted, hits: allHits };
119
119
  }
120
120
 
121
+ // src/core/atomic-write.ts
122
+ import fs from "fs";
123
+ var RETRYABLE_CODES = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EBUSY"]);
124
+ var MAX_RENAME_RETRIES = 10;
125
+ function sleepSync(ms) {
126
+ const sab = new Int32Array(new SharedArrayBuffer(4));
127
+ Atomics.wait(sab, 0, 0, ms);
128
+ }
129
+ function atomicWriteFileSync(target, data) {
130
+ const tmp = `${target}.tmp`;
131
+ fs.writeFileSync(tmp, data);
132
+ for (let attempt = 0; ; attempt++) {
133
+ try {
134
+ fs.renameSync(tmp, target);
135
+ return;
136
+ } catch (err) {
137
+ const code = err.code;
138
+ if (attempt < MAX_RENAME_RETRIES && code && RETRYABLE_CODES.has(code)) {
139
+ sleepSync(5 * (attempt + 1));
140
+ continue;
141
+ }
142
+ try {
143
+ fs.writeFileSync(target, data);
144
+ try {
145
+ fs.unlinkSync(tmp);
146
+ } catch {
147
+ }
148
+ return;
149
+ } catch {
150
+ throw err;
151
+ }
152
+ }
153
+ }
154
+ }
155
+
121
156
  // src/memory/chat-index.ts
122
157
  var MEMORY_DIR_NAME = "memory-index";
123
158
  var CHUNKS_FILE = "chunks.json";
@@ -205,7 +240,7 @@ function writeVectorsFile(chunks, vectors) {
205
240
  );
206
241
  }
207
242
  const dir = memoryIndexDir();
208
- fs.mkdirSync(dir, { recursive: true });
243
+ fs2.mkdirSync(dir, { recursive: true });
209
244
  const totalBytes = VEC_HEADER_BYTES + vectors.byteLength;
210
245
  const buf = Buffer.alloc(totalBytes);
211
246
  buf.writeUInt32LE(VEC_MAGIC, 0);
@@ -213,17 +248,14 @@ function writeVectorsFile(chunks, vectors) {
213
248
  buf.writeUInt32LE(chunks.length, 8);
214
249
  buf.writeUInt32LE(EMBEDDING_DIM, 12);
215
250
  Buffer.from(vectors.buffer, vectors.byteOffset, vectors.byteLength).copy(buf, VEC_HEADER_BYTES);
216
- const target = vectorsPath();
217
- const tmp = `${target}.tmp`;
218
- fs.writeFileSync(tmp, buf);
219
- fs.renameSync(tmp, target);
251
+ atomicWriteFileSync(vectorsPath(), buf);
220
252
  }
221
253
  function readVectorsFile(expectedCount) {
222
254
  const p = vectorsPath();
223
- if (!fs.existsSync(p)) return null;
255
+ if (!fs2.existsSync(p)) return null;
224
256
  let buf;
225
257
  try {
226
- buf = fs.readFileSync(p);
258
+ buf = fs2.readFileSync(p);
227
259
  } catch {
228
260
  return null;
229
261
  }
@@ -242,17 +274,14 @@ function readVectorsFile(expectedCount) {
242
274
  }
243
275
  function writeIndexFile(idx) {
244
276
  const dir = memoryIndexDir();
245
- fs.mkdirSync(dir, { recursive: true });
246
- const target = chunksPath();
247
- const tmp = `${target}.tmp`;
248
- fs.writeFileSync(tmp, JSON.stringify(idx, null, 2), "utf-8");
249
- fs.renameSync(tmp, target);
277
+ fs2.mkdirSync(dir, { recursive: true });
278
+ atomicWriteFileSync(chunksPath(), JSON.stringify(idx, null, 2));
250
279
  }
251
280
  function readIndexFile() {
252
281
  const p = chunksPath();
253
- if (!fs.existsSync(p)) return null;
282
+ if (!fs2.existsSync(p)) return null;
254
283
  try {
255
- const raw = fs.readFileSync(p, "utf-8");
284
+ const raw = fs2.readFileSync(p, "utf-8");
256
285
  const data = JSON.parse(raw);
257
286
  if (data.version !== 1) return null;
258
287
  return data;
@@ -269,24 +298,24 @@ function loadChatIndex() {
269
298
  }
270
299
  function clearChatIndex() {
271
300
  try {
272
- if (fs.existsSync(chunksPath())) fs.unlinkSync(chunksPath());
301
+ if (fs2.existsSync(chunksPath())) fs2.unlinkSync(chunksPath());
273
302
  } catch {
274
303
  }
275
304
  try {
276
- if (fs.existsSync(vectorsPath())) fs.unlinkSync(vectorsPath());
305
+ if (fs2.existsSync(vectorsPath())) fs2.unlinkSync(vectorsPath());
277
306
  } catch {
278
307
  }
279
308
  }
280
309
  function listSessionFiles() {
281
310
  const dir = historyDir();
282
- if (!fs.existsSync(dir)) return [];
311
+ if (!fs2.existsSync(dir)) return [];
283
312
  const out = [];
284
- for (const name of fs.readdirSync(dir)) {
313
+ for (const name of fs2.readdirSync(dir)) {
285
314
  if (!name.endsWith(".json")) continue;
286
315
  const id = name.replace(/\.json$/, "");
287
316
  const p = path.join(dir, name);
288
317
  try {
289
- const st = fs.statSync(p);
318
+ const st = fs2.statSync(p);
290
319
  out.push({ id, path: p, mtime: st.mtimeMs });
291
320
  } catch {
292
321
  }
@@ -295,7 +324,7 @@ function listSessionFiles() {
295
324
  }
296
325
  function readSession(p) {
297
326
  try {
298
- const data = JSON.parse(fs.readFileSync(p, "utf-8"));
327
+ const data = JSON.parse(fs2.readFileSync(p, "utf-8"));
299
328
  if (!data.id || !Array.isArray(data.messages)) return null;
300
329
  return data;
301
330
  } catch {
@@ -438,8 +467,8 @@ function getChatIndexStatus() {
438
467
  chunksFileSizeBytes: 0
439
468
  };
440
469
  try {
441
- if (fs.existsSync(vectorsPath())) status.vecFileSizeBytes = fs.statSync(vectorsPath()).size;
442
- if (fs.existsSync(chunksPath())) status.chunksFileSizeBytes = fs.statSync(chunksPath()).size;
470
+ if (fs2.existsSync(vectorsPath())) status.vecFileSizeBytes = fs2.statSync(vectorsPath()).size;
471
+ if (fs2.existsSync(chunksPath())) status.chunksFileSizeBytes = fs2.statSync(chunksPath()).size;
443
472
  } catch {
444
473
  }
445
474
  const idx = readIndexFile();
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-SOWBY545.js";
5
+ } from "./chunk-UK6E2563.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
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-SOWBY545.js";
4
+ } from "./chunk-UK6E2563.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.187";
9
+ var VERSION = "0.4.188";
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-SOWBY545.js";
11
+ } from "./chunk-UK6E2563.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
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.187";
4
+ var VERSION = "0.4.188";
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
  truncateForPersist
4
- } from "./chunk-Q6BSUIDV.js";
4
+ } from "./chunk-J3XSJCO5.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-SOWBY545.js";
14
+ } from "./chunk-UK6E2563.js";
15
15
 
16
16
  // src/mcp/client.ts
17
17
  import { spawn } from "child_process";
@@ -10,11 +10,11 @@ import {
10
10
  import "./chunk-HIU2SH4V.js";
11
11
  import {
12
12
  ConfigManager
13
- } from "./chunk-UAJKGLRV.js";
13
+ } from "./chunk-Q7SB3R25.js";
14
14
  import "./chunk-TZQHYZKT.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-SOWBY545.js";
17
+ } from "./chunk-UK6E2563.js";
18
18
  import "./chunk-PDX44BCA.js";
19
19
 
20
20
  // src/cli/ci.ts
@@ -36,7 +36,7 @@ import {
36
36
  TEST_TIMEOUT,
37
37
  VERSION,
38
38
  buildUserIdentityPrompt
39
- } from "./chunk-SOWBY545.js";
39
+ } from "./chunk-UK6E2563.js";
40
40
  import "./chunk-PDX44BCA.js";
41
41
  export {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getConfigDirUsage,
4
4
  listRecentCrashes
5
- } from "./chunk-43T4MY5B.js";
5
+ } from "./chunk-MUQZOUV5.js";
6
6
  import {
7
7
  ProviderRegistry
8
8
  } from "./chunk-IQ7JE43O.js";
@@ -11,17 +11,17 @@ import {
11
11
  getTopFailingTools,
12
12
  getTopUsedTools,
13
13
  resetStats
14
- } from "./chunk-MVK25WZW.js";
14
+ } from "./chunk-DFQSQQEU.js";
15
15
  import "./chunk-HIU2SH4V.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-UAJKGLRV.js";
18
+ } from "./chunk-Q7SB3R25.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-SOWBY545.js";
24
+ } from "./chunk-UK6E2563.js";
25
25
  import "./chunk-PDX44BCA.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-L5L5B7HD.js";
39
+ } from "./chunk-ODAAPNSL.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -49,7 +49,7 @@ import {
49
49
  loadChatIndex,
50
50
  redactJson,
51
51
  searchChatMemory
52
- } from "./chunk-T5VKNPLD.js";
52
+ } from "./chunk-KIGVJVX4.js";
53
53
  import "./chunk-JV5N65KN.js";
54
54
  import "./chunk-3RG5ZIWI.js";
55
55
 
@@ -14076,7 +14076,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
14076
14076
  case "test": {
14077
14077
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
14078
14078
  try {
14079
- const { executeTests } = await import("./run-tests-NWRKAVFS.js");
14079
+ const { executeTests } = await import("./run-tests-IJYP6BMT.js");
14080
14080
  const argStr = args.join(" ").trim();
14081
14081
  let testArgs = {};
14082
14082
  if (argStr) {
@@ -14600,7 +14600,7 @@ Add .md files to create commands.` });
14600
14600
  return;
14601
14601
  }
14602
14602
  try {
14603
- const { searchChatMemory: searchChatMemory2, loadChatIndex: loadChatIndex2 } = await import("./chat-index-BE4TPLFH.js");
14603
+ const { searchChatMemory: searchChatMemory2, loadChatIndex: loadChatIndex2 } = await import("./chat-index-WDMVP7BN.js");
14604
14604
  const loaded = loadChatIndex2();
14605
14605
  if (!loaded || loaded.idx.chunks.length === 0) {
14606
14606
  this.send({ type: "memory_hits", query: q, hits: [], indexMissing: true });
@@ -14636,7 +14636,7 @@ Add .md files to create commands.` });
14636
14636
  }
14637
14637
  async handleMemoryStatus() {
14638
14638
  try {
14639
- const { getChatIndexStatus } = await import("./chat-index-BE4TPLFH.js");
14639
+ const { getChatIndexStatus } = await import("./chat-index-WDMVP7BN.js");
14640
14640
  const s = getChatIndexStatus();
14641
14641
  this.send({
14642
14642
  type: "memory_status",
@@ -14661,7 +14661,7 @@ Add .md files to create commands.` });
14661
14661
  type: "info",
14662
14662
  message: full ? "\u{1F9E0} Rebuilding chat memory index (this may take a while on first run \u2014 ~117 MB embedder)." : "\u{1F9E0} Refreshing chat memory index (incremental)\u2026"
14663
14663
  });
14664
- const { buildChatIndex } = await import("./chat-index-BE4TPLFH.js");
14664
+ const { buildChatIndex } = await import("./chat-index-WDMVP7BN.js");
14665
14665
  const stats = await buildChatIndex({
14666
14666
  full,
14667
14667
  onProgress: (p) => {
@@ -155,7 +155,7 @@ ${content}`);
155
155
  }
156
156
  }
157
157
  async function runTaskMode(config, providers, configManager, topic) {
158
- const { TaskOrchestrator } = await import("./task-orchestrator-DC7NGBQA.js");
158
+ const { TaskOrchestrator } = await import("./task-orchestrator-GMJ5PLVV.js");
159
159
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
160
160
  let interrupted = false;
161
161
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  saveDevState,
16
16
  sessionHasMeaningfulContent,
17
17
  setupProxy
18
- } from "./chunk-ZTBUTA24.js";
18
+ } from "./chunk-VPTRE7IW.js";
19
19
  import {
20
20
  ToolExecutor,
21
21
  ToolRegistry,
@@ -34,10 +34,10 @@ import {
34
34
  spawnAgentContext,
35
35
  theme,
36
36
  undoStack
37
- } from "./chunk-Q6BSUIDV.js";
37
+ } from "./chunk-J3XSJCO5.js";
38
38
  import "./chunk-HDSKW7Q3.js";
39
39
  import "./chunk-ZWVIDFGY.js";
40
- import "./chunk-4SZ6X47A.js";
40
+ import "./chunk-NRSAAMIF.js";
41
41
  import {
42
42
  SessionManager,
43
43
  getContentText
@@ -54,7 +54,7 @@ import {
54
54
  getConfigDirUsage,
55
55
  listRecentCrashes,
56
56
  writeCrashLog
57
- } from "./chunk-43T4MY5B.js";
57
+ } from "./chunk-MUQZOUV5.js";
58
58
  import {
59
59
  CONTENT_ONLY_STREAM_REMINDER,
60
60
  ProviderRegistry,
@@ -78,11 +78,11 @@ import {
78
78
  getTopFailingTools,
79
79
  getTopUsedTools,
80
80
  installFlushOnExit
81
- } from "./chunk-MVK25WZW.js";
81
+ } from "./chunk-DFQSQQEU.js";
82
82
  import "./chunk-HIU2SH4V.js";
83
83
  import {
84
84
  ConfigManager
85
- } from "./chunk-UAJKGLRV.js";
85
+ } from "./chunk-Q7SB3R25.js";
86
86
  import {
87
87
  AuthError,
88
88
  ProviderError,
@@ -109,7 +109,7 @@ import {
109
109
  SKILLS_DIR_NAME,
110
110
  VERSION,
111
111
  buildUserIdentityPrompt
112
- } from "./chunk-SOWBY545.js";
112
+ } from "./chunk-UK6E2563.js";
113
113
  import {
114
114
  formatGitContextForPrompt,
115
115
  getGitContext,
@@ -123,7 +123,7 @@ import {
123
123
  clearChatIndex,
124
124
  getChatIndexStatus,
125
125
  searchChatMemory
126
- } from "./chunk-MM3F43H6.js";
126
+ } from "./chunk-4UZE4ADL.js";
127
127
  import "./chunk-KHYD3WXE.js";
128
128
  import {
129
129
  DEFAULT_PATTERNS,
@@ -1824,7 +1824,7 @@ No tools match "${filter}".
1824
1824
  const { join: join5 } = await import("path");
1825
1825
  const { existsSync: existsSync5 } = await import("fs");
1826
1826
  const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
1827
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-XEL5347E.js");
1827
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-NCWVAAI7.js");
1828
1828
  const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
1829
1829
  const cwd = process.cwd();
1830
1830
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2885,7 +2885,7 @@ ${hint}` : "")
2885
2885
  usage: "/test [command|filter]",
2886
2886
  async execute(args, ctx) {
2887
2887
  try {
2888
- const { executeTests } = await import("./run-tests-Z7IGVS2W.js");
2888
+ const { executeTests } = await import("./run-tests-NS3SPH6S.js");
2889
2889
  const argStr = args.join(" ").trim();
2890
2890
  let testArgs = {};
2891
2891
  if (argStr) {
@@ -5480,7 +5480,7 @@ Session '${this.resumeSessionId}' not found.
5480
5480
  })();
5481
5481
  void (async () => {
5482
5482
  try {
5483
- const { getChatIndexStatus: getChatIndexStatus2, buildChatIndex: buildChatIndex2 } = await import("./chat-index-2I7ZHRE5.js");
5483
+ const { getChatIndexStatus: getChatIndexStatus2, buildChatIndex: buildChatIndex2 } = await import("./chat-index-JXTYDRCY.js");
5484
5484
  const initial = getChatIndexStatus2();
5485
5485
  this.chatMemoryStatus = {
5486
5486
  exists: initial.exists,
@@ -7256,7 +7256,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7256
7256
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7257
7257
  process.exit(1);
7258
7258
  }
7259
- const { startWebServer } = await import("./server-2B5JDVJS.js");
7259
+ const { startWebServer } = await import("./server-TZRMRT3O.js");
7260
7260
  await startWebServer({ port, host: options.host });
7261
7261
  });
7262
7262
  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) => {
@@ -7423,16 +7423,16 @@ program.command("sessions").description("List recent conversation sessions").opt
7423
7423
  console.log(footer + "\n");
7424
7424
  });
7425
7425
  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) => {
7426
- const { runUsageCli } = await import("./usage-ZVKFH7BM.js");
7426
+ const { runUsageCli } = await import("./usage-IYMFSHDX.js");
7427
7427
  await runUsageCli(options);
7428
7428
  });
7429
7429
  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) => {
7430
- const { runDoctorCli } = await import("./doctor-cli-MYJFAWKV.js");
7430
+ const { runDoctorCli } = await import("./doctor-cli-R3SWTL5Z.js");
7431
7431
  await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
7432
7432
  });
7433
7433
  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) => {
7434
7434
  try {
7435
- const batch = await import("./batch-UTP6NYVX.js");
7435
+ const batch = await import("./batch-D6K2KHJK.js");
7436
7436
  switch (action) {
7437
7437
  case "submit":
7438
7438
  if (!arg) {
@@ -7475,7 +7475,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7475
7475
  }
7476
7476
  });
7477
7477
  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) => {
7478
- const { startMcpServer } = await import("./server-25WVH5YX.js");
7478
+ const { startMcpServer } = await import("./server-SVTSJ3PK.js");
7479
7479
  await startMcpServer({
7480
7480
  allowDestructive: !!options.allowDestructive,
7481
7481
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7484,7 +7484,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
7484
7484
  });
7485
7485
  });
7486
7486
  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) => {
7487
- const { runCi } = await import("./ci-2WFKSG2J.js");
7487
+ const { runCi } = await import("./ci-42ZBP2SY.js");
7488
7488
  const result = await runCi({
7489
7489
  pr: options.pr,
7490
7490
  base: options.base,
@@ -7630,7 +7630,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7630
7630
  }),
7631
7631
  config.get("customProviders")
7632
7632
  );
7633
- const { startHub } = await import("./hub-CHE7JDIH.js");
7633
+ const { startHub } = await import("./hub-3ZGIM2FN.js");
7634
7634
  await startHub(
7635
7635
  {
7636
7636
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-L5L5B7HD.js";
4
+ } from "./chunk-ODAAPNSL.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-4SZ6X47A.js";
6
- import "./chunk-SOWBY545.js";
5
+ } from "./chunk-NRSAAMIF.js";
6
+ import "./chunk-UK6E2563.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
9
9
  executeTests,
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-Q6BSUIDV.js";
4
+ } from "./chunk-J3XSJCO5.js";
5
5
  import "./chunk-HDSKW7Q3.js";
6
6
  import "./chunk-ZWVIDFGY.js";
7
- import "./chunk-4SZ6X47A.js";
7
+ import "./chunk-NRSAAMIF.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-MVK25WZW.js";
10
+ } from "./chunk-DFQSQQEU.js";
11
11
  import {
12
12
  getDangerLevel,
13
13
  schemaToJsonSchema
@@ -15,9 +15,9 @@ import {
15
15
  import "./chunk-TZQHYZKT.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-SOWBY545.js";
18
+ } from "./chunk-UK6E2563.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
- import "./chunk-MM3F43H6.js";
20
+ import "./chunk-4UZE4ADL.js";
21
21
  import "./chunk-KHYD3WXE.js";
22
22
  import "./chunk-SLSWPBK3.js";
23
23
  import "./chunk-VNNYHW6N.js";
@@ -19,7 +19,7 @@ import {
19
19
  loadDevState,
20
20
  persistToolRound,
21
21
  setupProxy
22
- } from "./chunk-ZTBUTA24.js";
22
+ } from "./chunk-VPTRE7IW.js";
23
23
  import {
24
24
  ToolExecutor,
25
25
  ToolRegistry,
@@ -37,10 +37,10 @@ import {
37
37
  spawnAgentContext,
38
38
  truncateOutput,
39
39
  undoStack
40
- } from "./chunk-Q6BSUIDV.js";
40
+ } from "./chunk-J3XSJCO5.js";
41
41
  import "./chunk-HDSKW7Q3.js";
42
42
  import "./chunk-ZWVIDFGY.js";
43
- import "./chunk-4SZ6X47A.js";
43
+ import "./chunk-NRSAAMIF.js";
44
44
  import {
45
45
  SessionManager,
46
46
  getContentText
@@ -65,13 +65,13 @@ import {
65
65
  } from "./chunk-IQ7JE43O.js";
66
66
  import {
67
67
  runTool
68
- } from "./chunk-MVK25WZW.js";
68
+ } from "./chunk-DFQSQQEU.js";
69
69
  import {
70
70
  getDangerLevel
71
71
  } from "./chunk-HIU2SH4V.js";
72
72
  import {
73
73
  ConfigManager
74
- } from "./chunk-UAJKGLRV.js";
74
+ } from "./chunk-Q7SB3R25.js";
75
75
  import "./chunk-TZQHYZKT.js";
76
76
  import {
77
77
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -91,14 +91,14 @@ import {
91
91
  SKILLS_DIR_NAME,
92
92
  VERSION,
93
93
  buildUserIdentityPrompt
94
- } from "./chunk-SOWBY545.js";
94
+ } from "./chunk-UK6E2563.js";
95
95
  import {
96
96
  formatGitContextForPrompt,
97
97
  getGitContext,
98
98
  getGitRoot
99
99
  } from "./chunk-HOSJZMQS.js";
100
100
  import "./chunk-4BKXL7SM.js";
101
- import "./chunk-MM3F43H6.js";
101
+ import "./chunk-4UZE4ADL.js";
102
102
  import "./chunk-KHYD3WXE.js";
103
103
  import "./chunk-SLSWPBK3.js";
104
104
  import "./chunk-VNNYHW6N.js";
@@ -2437,7 +2437,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2437
2437
  case "test": {
2438
2438
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2439
2439
  try {
2440
- const { executeTests } = await import("./run-tests-Z7IGVS2W.js");
2440
+ const { executeTests } = await import("./run-tests-NS3SPH6S.js");
2441
2441
  const argStr = args.join(" ").trim();
2442
2442
  let testArgs = {};
2443
2443
  if (argStr) {
@@ -2961,7 +2961,7 @@ Add .md files to create commands.` });
2961
2961
  return;
2962
2962
  }
2963
2963
  try {
2964
- const { searchChatMemory, loadChatIndex } = await import("./chat-index-2I7ZHRE5.js");
2964
+ const { searchChatMemory, loadChatIndex } = await import("./chat-index-JXTYDRCY.js");
2965
2965
  const loaded = loadChatIndex();
2966
2966
  if (!loaded || loaded.idx.chunks.length === 0) {
2967
2967
  this.send({ type: "memory_hits", query: q, hits: [], indexMissing: true });
@@ -2997,7 +2997,7 @@ Add .md files to create commands.` });
2997
2997
  }
2998
2998
  async handleMemoryStatus() {
2999
2999
  try {
3000
- const { getChatIndexStatus } = await import("./chat-index-2I7ZHRE5.js");
3000
+ const { getChatIndexStatus } = await import("./chat-index-JXTYDRCY.js");
3001
3001
  const s = getChatIndexStatus();
3002
3002
  this.send({
3003
3003
  type: "memory_status",
@@ -3022,7 +3022,7 @@ Add .md files to create commands.` });
3022
3022
  type: "info",
3023
3023
  message: full ? "\u{1F9E0} Rebuilding chat memory index (this may take a while on first run \u2014 ~117 MB embedder)." : "\u{1F9E0} Refreshing chat memory index (incremental)\u2026"
3024
3024
  });
3025
- const { buildChatIndex } = await import("./chat-index-2I7ZHRE5.js");
3025
+ const { buildChatIndex } = await import("./chat-index-JXTYDRCY.js");
3026
3026
  const stats = await buildChatIndex({
3027
3027
  full,
3028
3028
  onProgress: (p) => {
@@ -3,22 +3,22 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-Q6BSUIDV.js";
6
+ } from "./chunk-J3XSJCO5.js";
7
7
  import "./chunk-HDSKW7Q3.js";
8
8
  import "./chunk-ZWVIDFGY.js";
9
- import "./chunk-4SZ6X47A.js";
9
+ import "./chunk-NRSAAMIF.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-MVK25WZW.js";
12
+ } from "./chunk-DFQSQQEU.js";
13
13
  import {
14
14
  getDangerLevel
15
15
  } from "./chunk-HIU2SH4V.js";
16
16
  import "./chunk-TZQHYZKT.js";
17
17
  import {
18
18
  SUBAGENT_ALLOWED_TOOLS
19
- } from "./chunk-SOWBY545.js";
19
+ } from "./chunk-UK6E2563.js";
20
20
  import "./chunk-4BKXL7SM.js";
21
- import "./chunk-MM3F43H6.js";
21
+ import "./chunk-4UZE4ADL.js";
22
22
  import "./chunk-KHYD3WXE.js";
23
23
  import "./chunk-SLSWPBK3.js";
24
24
  import "./chunk-VNNYHW6N.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-V37XOYOE.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-UAJKGLRV.js";
11
+ } from "./chunk-Q7SB3R25.js";
12
12
  import "./chunk-TZQHYZKT.js";
13
- import "./chunk-SOWBY545.js";
13
+ import "./chunk-UK6E2563.js";
14
14
  import "./chunk-PDX44BCA.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.187",
3
+ "version": "0.4.188",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",