jinzd-ai-cli 0.4.282 → 0.4.284

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 (33) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  3. package/dist/{batch-SBP6H7IK.js → batch-DA7VA35X.js} +2 -2
  4. package/dist/{chunk-TNIMHTKG.js → chunk-3DRSBZQ7.js} +1 -1
  5. package/dist/{chunk-LNUWIY6M.js → chunk-BXG44VIQ.js} +1 -1
  6. package/dist/{chunk-GSGJABL6.js → chunk-C4CIIIDT.js} +3 -3
  7. package/dist/{chunk-RHSCROLG.js → chunk-FZ4THGUP.js} +1 -1
  8. package/dist/{chunk-7XKIDSJT.js → chunk-I4FJGILK.js} +4 -4
  9. package/dist/{chunk-WMHLWCZQ.js → chunk-OZKTHQWA.js} +3 -3
  10. package/dist/{chunk-SGUPIQYT.js → chunk-PPPSK4MA.js} +1 -1
  11. package/dist/{chunk-HJDJAI7T.js → chunk-PWLQU43X.js} +1 -1
  12. package/dist/{chunk-6IRG727F.js → chunk-QKGKWCXE.js} +1 -1
  13. package/dist/{chunk-JQU4GYET.js → chunk-RV2YOTEQ.js} +1 -1
  14. package/dist/{chunk-YRPL7A3S.js → chunk-VFVN5CWA.js} +1 -1
  15. package/dist/{chunk-EVD6CCO2.js → chunk-XSBGCZOP.js} +1 -1
  16. package/dist/{chunk-KDXA7RXA.js → chunk-Z23JYUOL.js} +124 -3
  17. package/dist/{ci-VAAMX44S.js → ci-HG2TPYVY.js} +4 -4
  18. package/dist/{ci-format-RMULFSB5.js → ci-format-UB7K63UZ.js} +2 -2
  19. package/dist/{constants-PXLMEBJY.js → constants-3DDHA3LT.js} +1 -1
  20. package/dist/{doctor-cli-C2DFYU2M.js → doctor-cli-ISFDY7LZ.js} +4 -4
  21. package/dist/electron-server.js +225 -27
  22. package/dist/{hub-XIU3YTOE.js → hub-MP2CNDMZ.js} +1 -1
  23. package/dist/index.js +100 -89
  24. package/dist/{persistent-memory-TA224ZFQ.js → persistent-memory-AMDRRB5E.js} +2 -2
  25. package/dist/{persistent-memory-ACXKU6RV.js → persistent-memory-J2OVPLWI.js} +2 -2
  26. package/dist/{pr-J74HW44E.js → pr-BREZ3DJX.js} +4 -4
  27. package/dist/{run-tests-4KTX5YMO.js → run-tests-DPO23PKA.js} +2 -2
  28. package/dist/{run-tests-JLZ2KIGV.js → run-tests-XHLV74GU.js} +2 -2
  29. package/dist/{server-4CZXYGJN.js → server-KK7DIV3J.js} +5 -5
  30. package/dist/{server-226R6675.js → server-W2VIUKTQ.js} +118 -30
  31. package/dist/{task-orchestrator-6C3R7KSK.js → task-orchestrator-YM5IMIKL.js} +5 -5
  32. package/dist/{usage-FY3TEJJS.js → usage-TXPZY7EB.js} +2 -2
  33. package/package.json +2 -2
@@ -22,6 +22,8 @@ import {
22
22
  armDeferredSave,
23
23
  autoTrimSessionIfNeeded,
24
24
  buildInitPrompt,
25
+ buildMemoryStatusView,
26
+ buildRecallView,
25
27
  buildRewindList,
26
28
  buildSessionCostReport,
27
29
  buildSessionExport,
@@ -45,6 +47,7 @@ import {
45
47
  parseBatchDeleteArgs,
46
48
  parseCheckpointCommand,
47
49
  parseCleanArgs,
50
+ parseMemoryCommand,
48
51
  parseMemoryShowFilters,
49
52
  parseModelCommand,
50
53
  parseRewindArgs,
@@ -52,6 +55,8 @@ import {
52
55
  parseSessionListArgs,
53
56
  persistToolRound,
54
57
  readGitDiff,
58
+ rebuildDoneMessage,
59
+ rebuildStartMessage,
55
60
  resolveForkPoint,
56
61
  resolveModelSwitch,
57
62
  resolveProviderSwitch,
@@ -68,7 +73,7 @@ import {
68
73
  setupProxy,
69
74
  snapshotFile,
70
75
  stripRoutingTags
71
- } from "./chunk-KDXA7RXA.js";
76
+ } from "./chunk-Z23JYUOL.js";
72
77
  import {
73
78
  CNY_PER_USD,
74
79
  CostTracker,
@@ -110,7 +115,7 @@ import {
110
115
  spawnAgentContext,
111
116
  truncateOutput,
112
117
  undoStack
113
- } from "./chunk-7XKIDSJT.js";
118
+ } from "./chunk-I4FJGILK.js";
114
119
  import {
115
120
  buildReviewPrompt,
116
121
  buildSecurityReviewPrompt
@@ -137,7 +142,7 @@ import {
137
142
  restoreMemoryEntries,
138
143
  updateMemoryApproval,
139
144
  updateMemoryEntry
140
- } from "./chunk-SGUPIQYT.js";
145
+ } from "./chunk-PPPSK4MA.js";
141
146
  import "./chunk-4DEMGCK4.js";
142
147
  import "./chunk-UUSRWSSX.js";
143
148
  import "./chunk-CKH4KQ4E.js";
@@ -156,7 +161,7 @@ import {
156
161
  buildDoctorReport,
157
162
  formatDoctorReport,
158
163
  loadContextFiles
159
- } from "./chunk-GSGJABL6.js";
164
+ } from "./chunk-C4CIIIDT.js";
160
165
  import {
161
166
  describePlugin,
162
167
  getActivePluginAssets,
@@ -171,13 +176,13 @@ import {
171
176
  runTool,
172
177
  setPluginEnabled,
173
178
  trustPlugin
174
- } from "./chunk-LNUWIY6M.js";
179
+ } from "./chunk-BXG44VIQ.js";
175
180
  import {
176
181
  ProviderRegistry
177
182
  } from "./chunk-UGY5SVNX.js";
178
183
  import {
179
184
  ConfigManager
180
- } from "./chunk-EVD6CCO2.js";
185
+ } from "./chunk-XSBGCZOP.js";
181
186
  import {
182
187
  CONTENT_ONLY_STREAM_REMINDER,
183
188
  TEE_FINAL_USER_NUDGE,
@@ -207,7 +212,7 @@ import {
207
212
  maskConfigSecrets
208
213
  } from "./chunk-XNFIYS7G.js";
209
214
  import "./chunk-4BKXL7SM.js";
210
- import "./chunk-HJDJAI7T.js";
215
+ import "./chunk-PWLQU43X.js";
211
216
  import {
212
217
  AGENTIC_BEHAVIOR_GUIDELINE,
213
218
  AUTHOR,
@@ -223,7 +228,7 @@ import {
223
228
  SKILLS_DIR_NAME,
224
229
  VERSION,
225
230
  buildUserIdentityPrompt
226
- } from "./chunk-JQU4GYET.js";
231
+ } from "./chunk-RV2YOTEQ.js";
227
232
 
228
233
  // src/web/server.ts
229
234
  import express from "express";
@@ -981,7 +986,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
981
986
  Cost: ${formatCost(cost)}` : "";
982
987
  let memoryLine = "";
983
988
  try {
984
- const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-ACXKU6RV.js");
989
+ const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-J2OVPLWI.js");
985
990
  const pending = countPendingMemories2(ctx.config.getConfigDir());
986
991
  if (pending > 0) memoryLine = `
987
992
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1889,7 +1894,7 @@ async function handleTest(args, ctx) {
1889
1894
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1890
1895
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
1891
1896
  }
1892
- const runTests = ctx.runTests ?? (await import("./run-tests-4KTX5YMO.js")).executeTests;
1897
+ const runTests = ctx.runTests ?? (await import("./run-tests-DPO23PKA.js")).executeTests;
1893
1898
  const report = await runTests(testArgs);
1894
1899
  ctx.send({ type: "info", message: report });
1895
1900
  } catch (err) {
@@ -2139,8 +2144,91 @@ async function handleIndex(args, ctx) {
2139
2144
  }
2140
2145
  }
2141
2146
  async function handleMemory(args, ctx) {
2142
- const sub = args[0];
2143
- if (sub === "backup") {
2147
+ const intent = parseMemoryCommand(args);
2148
+ const configDir = ctx.config.getConfigDir();
2149
+ if (intent.kind === "usage") {
2150
+ ctx.send({ type: "error", message: intent.message });
2151
+ return;
2152
+ }
2153
+ if (intent.kind === "rebuild") {
2154
+ ctx.send({ type: "info", message: rebuildStartMessage(intent.full) });
2155
+ try {
2156
+ const { buildChatIndex } = await import("./chat-index-2D5GK2DB.js");
2157
+ const stats = await buildChatIndex({ full: intent.full });
2158
+ ctx.send({ type: "info", message: rebuildDoneMessage(stats) });
2159
+ } catch (err) {
2160
+ ctx.send({ type: "error", message: `Rebuild failed: ${err instanceof Error ? err.message : String(err)}` });
2161
+ }
2162
+ return;
2163
+ }
2164
+ if (intent.kind === "index-clear") {
2165
+ const { clearChatIndex } = await import("./chat-index-2D5GK2DB.js");
2166
+ clearChatIndex();
2167
+ ctx.send({ type: "info", message: "Chat memory index cleared (persistent memory untouched)." });
2168
+ return;
2169
+ }
2170
+ if (intent.kind === "status") {
2171
+ const { getChatIndexStatus } = await import("./chat-index-2D5GK2DB.js");
2172
+ const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-J2OVPLWI.js");
2173
+ const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
2174
+ const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
2175
+ const view = buildMemoryStatusView({
2176
+ active: memories.filter((m) => m.approved && !isMemoryExpired2(m)).length,
2177
+ pending: memories.filter((m) => !m.approved && !isMemoryExpired2(m)).length,
2178
+ injected: injected ? { entryCount: injected.entryCount, totalCount: injected.totalCount, chars: injected.content.length, truncated: injected.truncated } : null,
2179
+ storePath: memoryStorePath(configDir),
2180
+ chatIndex: getChatIndexStatus()
2181
+ });
2182
+ ctx.send({
2183
+ type: "info",
2184
+ message: [
2185
+ "\u{1F9E0} Governed Memory",
2186
+ ...view.governed.map((r) => ` ${r.label.padEnd(13)}: ${r.value}`),
2187
+ "",
2188
+ "\u{1F9E0} Chat Memory Index",
2189
+ ...view.chatIndexHint ? [` ${view.chatIndexHint}`] : view.chatIndex.map((r) => ` ${r.label.padEnd(13)}: ${r.value}`)
2190
+ ].join("\n")
2191
+ });
2192
+ return;
2193
+ }
2194
+ if (intent.kind === "recall") {
2195
+ const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-J2OVPLWI.js");
2196
+ const { searchChatMemory } = await import("./chat-index-2D5GK2DB.js");
2197
+ const persistentHits = searchPersistentMemories(configDir, intent.query, process.cwd(), 3);
2198
+ if (persistentHits.length > 0) {
2199
+ touchMemoryReferences(configDir, persistentHits.map((h) => h.entry.id));
2200
+ }
2201
+ let chatHits = [];
2202
+ try {
2203
+ chatHits = await searchChatMemory(intent.query, { topK: 5, minScore: 0.2 });
2204
+ } catch (err) {
2205
+ ctx.send({ type: "error", message: `Recall failed: ${err instanceof Error ? err.message : String(err)}` });
2206
+ return;
2207
+ }
2208
+ const view = buildRecallView(
2209
+ intent.query,
2210
+ persistentHits.map((h) => ({ id: h.entry.id, scope: h.entry.scope, score: h.score, content: h.entry.content })),
2211
+ chatHits.map((h) => ({
2212
+ timestamp: h.chunk.timestamp,
2213
+ title: h.chunk.sessionTitle ?? h.chunk.sessionId.slice(0, 8),
2214
+ score: h.score,
2215
+ text: h.chunk.text
2216
+ }))
2217
+ );
2218
+ const lines = [];
2219
+ if (view.persistentHeading) {
2220
+ lines.push(view.persistentHeading, "");
2221
+ for (const hit of view.persistent) lines.push(` ${hit.label}`, ` ${hit.body}`, "");
2222
+ }
2223
+ if (view.chatHeading) {
2224
+ lines.push(view.chatHeading, "");
2225
+ for (const hit of view.chat) lines.push(` ${hit.label}`, ` ${hit.body}`, "");
2226
+ }
2227
+ if (view.note) lines.push(view.note);
2228
+ ctx.send({ type: "info", message: lines.join("\n") });
2229
+ return;
2230
+ }
2231
+ if (intent.kind === "backup") {
2144
2232
  try {
2145
2233
  const result = backupMemoryStore(ctx.config.getConfigDir(), parseOutFlag(args.slice(1)));
2146
2234
  ctx.send({ type: "info", message: `\u2713 Backed up ${result.count} entr${result.count === 1 ? "y" : "ies"} to ${result.backupPath}` });
@@ -2149,20 +2237,20 @@ async function handleMemory(args, ctx) {
2149
2237
  }
2150
2238
  return;
2151
2239
  }
2152
- if (sub === "restore") {
2153
- const configDir = ctx.config.getConfigDir();
2154
- const verdict = checkWebRestorePath(configDir, args[1]);
2240
+ if (intent.kind === "restore") {
2241
+ const configDir2 = ctx.config.getConfigDir();
2242
+ const verdict = checkWebRestorePath(configDir2, args[1]);
2155
2243
  if (!verdict.ok) {
2156
2244
  ctx.send({ type: "error", message: verdict.reason });
2157
2245
  return;
2158
2246
  }
2159
2247
  try {
2160
- const result = restoreMemoryEntries(configDir, verdict.resolved);
2248
+ const result = restoreMemoryEntries(configDir2, verdict.resolved);
2161
2249
  const lines = [
2162
2250
  `\u2713 Restored ${result.imported} entr${result.imported === 1 ? "y" : "ies"} (${result.skipped} duplicate${result.skipped === 1 ? "" : "s"} skipped)`
2163
2251
  ];
2164
2252
  if (result.backupPath) lines.push(`Pre-restore backup: ${result.backupPath}`);
2165
- const pending = countPendingMemories(configDir);
2253
+ const pending = countPendingMemories(configDir2);
2166
2254
  if (pending > 0) lines.push(`${pending} entr${pending === 1 ? "y" : "ies"} pending approval \u2014 /memory show --pending`);
2167
2255
  ctx.send({ type: "info", message: lines.join("\n") });
2168
2256
  ctx.sendMemoryEntries();
@@ -2171,7 +2259,7 @@ async function handleMemory(args, ctx) {
2171
2259
  }
2172
2260
  return;
2173
2261
  }
2174
- if (sub === "rebind") {
2262
+ if (intent.kind === "rebind") {
2175
2263
  const id = args[1];
2176
2264
  const newPath = args.slice(2).join(" ").trim();
2177
2265
  if (!id || !newPath) {
@@ -2187,11 +2275,11 @@ async function handleMemory(args, ctx) {
2187
2275
  }
2188
2276
  return;
2189
2277
  }
2190
- if (sub === "path") {
2278
+ if (intent.kind === "path") {
2191
2279
  ctx.send({ type: "info", message: memoryStorePath(ctx.config.getConfigDir()) });
2192
2280
  return;
2193
2281
  }
2194
- if (sub === "add" && args.length > 1) {
2282
+ if (intent.kind === "add") {
2195
2283
  const rest = args.slice(1);
2196
2284
  const opts = {};
2197
2285
  const text = [];
@@ -2209,7 +2297,7 @@ async function handleMemory(args, ctx) {
2209
2297
  return;
2210
2298
  }
2211
2299
  ctx.memoryAdd(text.join(" "), opts);
2212
- } else if (sub === "edit") {
2300
+ } else if (intent.kind === "edit") {
2213
2301
  const id = args[1];
2214
2302
  const text = args.slice(2).join(" ").trim();
2215
2303
  if (!id || !text) {
@@ -2217,15 +2305,15 @@ async function handleMemory(args, ctx) {
2217
2305
  return;
2218
2306
  }
2219
2307
  ctx.memoryEdit(id, text);
2220
- } else if (sub === "approve" || sub === "reject" || sub === "delete" || sub === "expire") {
2308
+ } else if (intent.kind === "manage") {
2221
2309
  if (!args[1]) {
2222
- ctx.send({ type: "info", message: `Usage: /memory ${sub} <id>` });
2310
+ ctx.send({ type: "info", message: `Usage: /memory ${intent.action} <id>` });
2223
2311
  return;
2224
2312
  }
2225
- ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
2226
- } else if (sub === "export") {
2313
+ ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
2314
+ } else if (intent.kind === "export") {
2227
2315
  if (args[1] === "md") {
2228
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-ACXKU6RV.js");
2316
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-J2OVPLWI.js");
2229
2317
  ctx.send({
2230
2318
  type: "export_data",
2231
2319
  format: "md",
@@ -2235,7 +2323,7 @@ async function handleMemory(args, ctx) {
2235
2323
  } else {
2236
2324
  ctx.handleMemoryManage("export");
2237
2325
  }
2238
- } else if (sub === "clear") {
2326
+ } else if (intent.kind === "clear") {
2239
2327
  if (args[1] === "confirm") {
2240
2328
  ctx.memoryClear();
2241
2329
  } else {
@@ -2245,8 +2333,7 @@ async function handleMemory(args, ctx) {
2245
2333
  });
2246
2334
  }
2247
2335
  } else {
2248
- const isShow = sub === "show" || sub === "view" || sub === "list";
2249
- ctx.memoryShow(isShow ? args.slice(1) : args);
2336
+ ctx.memoryShow(intent.rest);
2250
2337
  }
2251
2338
  }
2252
2339
  async function handleAddDir(args, ctx) {
@@ -2490,7 +2577,8 @@ async function handleHelp(_args, ctx) {
2490
2577
  " /tools \u2014 Show tools, MCP servers & skills",
2491
2578
  " /export [md|json] \u2014 Export conversation",
2492
2579
  " /skill [name|off|list|reload] \u2014 Manage agent skills",
2493
- " /memory [show|add|clear] \u2014 Persistent memory management",
2580
+ " /memory show|add|edit|approve|reject|delete|expire|rebind|clear|backup|restore|export|path \u2014 Governed memory",
2581
+ " /memory rebuild|refresh|status|recall <query>|index-clear \u2014 Chat memory index (cross-session recall)",
2494
2582
  " /agent list|switch|stop|summary \u2014 Manage named sub-agents",
2495
2583
  " /yolo [on|off] \u2014 Toggle auto-approve (skip confirmations)",
2496
2584
  " /search <keyword> \u2014 Search across all session histories",
@@ -4,9 +4,9 @@ import {
4
4
  googleSearchContext,
5
5
  isToolCapableProvider,
6
6
  truncateOutput
7
- } from "./chunk-7XKIDSJT.js";
7
+ } from "./chunk-I4FJGILK.js";
8
8
  import "./chunk-GHWZVPUV.js";
9
- import "./chunk-SGUPIQYT.js";
9
+ import "./chunk-PPPSK4MA.js";
10
10
  import "./chunk-4DEMGCK4.js";
11
11
  import "./chunk-UUSRWSSX.js";
12
12
  import "./chunk-CKH4KQ4E.js";
@@ -17,7 +17,7 @@ import "./chunk-NYNSYLFY.js";
17
17
  import "./chunk-3FEZSLGI.js";
18
18
  import {
19
19
  runTool
20
- } from "./chunk-LNUWIY6M.js";
20
+ } from "./chunk-BXG44VIQ.js";
21
21
  import {
22
22
  getDangerLevel,
23
23
  runLeanAgentLoop
@@ -28,10 +28,10 @@ import {
28
28
  atomicWriteFileSync
29
29
  } from "./chunk-IW3Q7AE5.js";
30
30
  import "./chunk-4BKXL7SM.js";
31
- import "./chunk-HJDJAI7T.js";
31
+ import "./chunk-PWLQU43X.js";
32
32
  import {
33
33
  SUBAGENT_ALLOWED_TOOLS
34
- } from "./chunk-JQU4GYET.js";
34
+ } from "./chunk-RV2YOTEQ.js";
35
35
 
36
36
  // src/hub/task-orchestrator.ts
37
37
  import { createInterface } from "readline";
@@ -8,10 +8,10 @@ import {
8
8
  } from "./chunk-DPTEC6AQ.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-EVD6CCO2.js";
11
+ } from "./chunk-XSBGCZOP.js";
12
12
  import "./chunk-TU3L3PW7.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
- import "./chunk-JQU4GYET.js";
14
+ import "./chunk-RV2YOTEQ.js";
15
15
 
16
16
  // src/cli/usage.ts
17
17
  function classifyRowCost(row) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.282",
3
+ "version": "0.4.284",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,7 +57,7 @@
57
57
  "options": "no-deprecation"
58
58
  },
59
59
  "engines": {
60
- "node": ">=20.18.1"
60
+ "node": ">=22.12.0"
61
61
  },
62
62
  "files": [
63
63
  "dist/*.js",