jinzd-ai-cli 0.4.279 → 0.4.281

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 (34) hide show
  1. package/dist/{batch-6QZSWCBL.js → batch-237ZXBQD.js} +2 -2
  2. package/dist/{chunk-2BKRWTEQ.js → chunk-2FCKZ3OS.js} +1 -1
  3. package/dist/{chunk-UD3BVNC5.js → chunk-4XJVSMZ6.js} +1 -1
  4. package/dist/{chunk-5XHEXRMN.js → chunk-5GYOQ7EF.js} +1 -1
  5. package/dist/{chunk-CGDYO52A.js → chunk-6NO5FZW6.js} +1 -0
  6. package/dist/{chunk-JLOQBYU4.js → chunk-BVGSR3BA.js} +3 -3
  7. package/dist/{chunk-FQJFGGKN.js → chunk-FHRIDE2T.js} +4 -4
  8. package/dist/{chunk-6WMT7OQG.js → chunk-H2VE4TTN.js} +1 -1
  9. package/dist/{chunk-CMNXAJLH.js → chunk-IXEKDAIX.js} +1 -1
  10. package/dist/{chunk-NZPHEUJM.js → chunk-J3RWNQOF.js} +1 -1
  11. package/dist/{chunk-7L4TEK7Q.js → chunk-J5TXHFDO.js} +122 -3
  12. package/dist/{chunk-RJY3HJS4.js → chunk-JT2A2M4F.js} +1 -1
  13. package/dist/{chunk-IIXZ7IPN.js → chunk-L7C34TFI.js} +1 -1
  14. package/dist/{chunk-JS6VAPWM.js → chunk-UTJQXG4P.js} +3 -3
  15. package/dist/{chunk-MX75TNE5.js → chunk-VB54ILH7.js} +1 -1
  16. package/dist/{chunk-SIVM2YQQ.js → chunk-WUIOUJA2.js} +1 -1
  17. package/dist/{ci-F4ESOYI5.js → ci-LXRTYJ6F.js} +4 -4
  18. package/dist/{ci-format-AIRW3TVQ.js → ci-format-II3OT2VU.js} +2 -2
  19. package/dist/{constants-3VMMZJDS.js → constants-X53QCUTP.js} +1 -1
  20. package/dist/{doctor-cli-WVMEWMYE.js → doctor-cli-6JCJEQR4.js} +4 -4
  21. package/dist/electron-server.js +144 -91
  22. package/dist/{hub-JJCCCU3O.js → hub-RXAFF7QI.js} +2 -2
  23. package/dist/index.js +68 -130
  24. package/dist/{persist-PQM4BRI4.js → persist-TBQILDSE.js} +2 -2
  25. package/dist/{persistent-memory-KSZKM4JG.js → persistent-memory-7CKJLS25.js} +2 -2
  26. package/dist/{persistent-memory-QZN4Q3W4.js → persistent-memory-WAKFKH2I.js} +2 -2
  27. package/dist/{pr-GFB5JC26.js → pr-DZTRHAMG.js} +4 -4
  28. package/dist/{run-tests-HMHHIG7Y.js → run-tests-4ESYEROQ.js} +2 -2
  29. package/dist/{run-tests-EL54INOI.js → run-tests-XGCNUT5S.js} +2 -2
  30. package/dist/{server-WUSJWC3A.js → server-6RYXFG3H.js} +60 -98
  31. package/dist/{server-6C7GITHY.js → server-EFA7UP4I.js} +5 -5
  32. package/dist/{task-orchestrator-C7RUUA2Q.js → task-orchestrator-H3AEIHR3.js} +5 -5
  33. package/dist/{usage-CW6BT2UV.js → usage-W7TZWHY7.js} +2 -2
  34. package/package.json +1 -1
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-RYQBBEMM.js";
12
12
  import {
13
13
  persistDiscussion
14
- } from "./chunk-MX75TNE5.js";
14
+ } from "./chunk-VB54ILH7.js";
15
15
  import {
16
16
  AUTO_COMPACT_INSTRUCTION,
17
17
  McpManager,
@@ -23,6 +23,12 @@ import {
23
23
  autoTrimSessionIfNeeded,
24
24
  buildInitPrompt,
25
25
  buildSessionCostReport,
26
+ buildSessionExport,
27
+ checkpointDeletedMessage,
28
+ checkpointNotFoundMessage,
29
+ checkpointRestoredMessage,
30
+ checkpointSavedMessage,
31
+ clearedSessionMessage,
26
32
  costSourceNote,
27
33
  decideDeferredSave,
28
34
  decideModel,
@@ -30,9 +36,11 @@ import {
30
36
  estimateConversationTokens,
31
37
  evaluateContextPressure,
32
38
  filterMemoryEntries,
39
+ formatCheckpointList,
33
40
  formatSessionSummaryLine,
34
41
  loadDevState,
35
42
  parseBatchDeleteArgs,
43
+ parseCheckpointCommand,
36
44
  parseCleanArgs,
37
45
  parseMemoryShowFilters,
38
46
  parseModelCommand,
@@ -55,7 +63,7 @@ import {
55
63
  setupProxy,
56
64
  snapshotFile,
57
65
  stripRoutingTags
58
- } from "./chunk-7L4TEK7Q.js";
66
+ } from "./chunk-J5TXHFDO.js";
59
67
  import {
60
68
  CNY_PER_USD,
61
69
  CostTracker,
@@ -97,7 +105,7 @@ import {
97
105
  spawnAgentContext,
98
106
  truncateOutput,
99
107
  undoStack
100
- } from "./chunk-FQJFGGKN.js";
108
+ } from "./chunk-FHRIDE2T.js";
101
109
  import {
102
110
  buildReviewPrompt,
103
111
  buildSecurityReviewPrompt
@@ -124,7 +132,7 @@ import {
124
132
  restoreMemoryEntries,
125
133
  updateMemoryApproval,
126
134
  updateMemoryEntry
127
- } from "./chunk-6WMT7OQG.js";
135
+ } from "./chunk-H2VE4TTN.js";
128
136
  import "./chunk-4DEMGCK4.js";
129
137
  import "./chunk-UUSRWSSX.js";
130
138
  import "./chunk-CKH4KQ4E.js";
@@ -134,7 +142,7 @@ import "./chunk-5C76XDDF.js";
134
142
  import {
135
143
  SessionManager,
136
144
  getContentText
137
- } from "./chunk-CGDYO52A.js";
145
+ } from "./chunk-6NO5FZW6.js";
138
146
  import "./chunk-NYNSYLFY.js";
139
147
  import {
140
148
  scanString
@@ -143,7 +151,7 @@ import {
143
151
  buildDoctorReport,
144
152
  formatDoctorReport,
145
153
  loadContextFiles
146
- } from "./chunk-JLOQBYU4.js";
154
+ } from "./chunk-BVGSR3BA.js";
147
155
  import {
148
156
  describePlugin,
149
157
  getActivePluginAssets,
@@ -158,13 +166,13 @@ import {
158
166
  runTool,
159
167
  setPluginEnabled,
160
168
  trustPlugin
161
- } from "./chunk-IIXZ7IPN.js";
169
+ } from "./chunk-L7C34TFI.js";
162
170
  import {
163
171
  ProviderRegistry
164
172
  } from "./chunk-UGY5SVNX.js";
165
173
  import {
166
174
  ConfigManager
167
- } from "./chunk-UD3BVNC5.js";
175
+ } from "./chunk-4XJVSMZ6.js";
168
176
  import {
169
177
  CONTENT_ONLY_STREAM_REMINDER,
170
178
  TEE_FINAL_USER_NUDGE,
@@ -194,7 +202,7 @@ import {
194
202
  maskConfigSecrets
195
203
  } from "./chunk-XNFIYS7G.js";
196
204
  import "./chunk-4BKXL7SM.js";
197
- import "./chunk-NZPHEUJM.js";
205
+ import "./chunk-J3RWNQOF.js";
198
206
  import {
199
207
  AGENTIC_BEHAVIOR_GUIDELINE,
200
208
  AUTHOR,
@@ -210,7 +218,7 @@ import {
210
218
  SKILLS_DIR_NAME,
211
219
  VERSION,
212
220
  buildUserIdentityPrompt
213
- } from "./chunk-2BKRWTEQ.js";
221
+ } from "./chunk-2FCKZ3OS.js";
214
222
 
215
223
  // src/web/server.ts
216
224
  import express from "express";
@@ -943,10 +951,14 @@ function lastAssistantText(messages) {
943
951
 
944
952
  // src/web/commands/session-commands.ts
945
953
  async function handleClear(_args, ctx) {
954
+ const prior = ctx.sessions.current;
955
+ const priorId = prior?.id ?? null;
956
+ const priorCount = prior?.messages.length ?? 0;
946
957
  ctx.saveIfNeeded();
947
- ctx.sessions.createSession(ctx.currentProvider, ctx.currentModel);
958
+ const created = ctx.sessions.createSession(ctx.currentProvider, ctx.currentModel);
959
+ ctx.unsavedSessions.set(created.id, created);
948
960
  ctx.resetWebSessionUsage();
949
- ctx.send({ type: "info", message: "Conversation cleared." });
961
+ ctx.send({ type: "info", message: clearedSessionMessage(priorId, priorCount) });
950
962
  ctx.sendStatus();
951
963
  ctx.sendSessionList();
952
964
  }
@@ -964,7 +976,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
964
976
  Cost: ${formatCost(cost)}` : "";
965
977
  let memoryLine = "";
966
978
  try {
967
- const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-KSZKM4JG.js");
979
+ const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-7CKJLS25.js");
968
980
  const pending = countPendingMemories2(ctx.config.getConfigDir());
969
981
  if (pending > 0) memoryLine = `
970
982
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1325,56 +1337,36 @@ async function handleCheckpoint(args, ctx) {
1325
1337
  ctx.send({ type: "error", message: "No active session." });
1326
1338
  return;
1327
1339
  }
1328
- const sub = args[0]?.toLowerCase();
1329
- if (!sub || sub === "list") {
1330
- const cps = session.checkpoints;
1331
- if (cps.length === 0) {
1332
- ctx.send({ type: "info", message: "No checkpoints. Use /checkpoint save <name> to create one." });
1333
- } else {
1334
- const lines = [`\u{1F4CC} Checkpoints (${cps.length}):`, ""];
1335
- for (const cp of cps) {
1336
- const ts = cp.timestamp.toLocaleString();
1337
- lines.push(` ${cp.name.padEnd(20)} msg #${cp.messageIndex} ${ts}`);
1338
- }
1339
- ctx.send({ type: "info", message: lines.join("\n") });
1340
- }
1340
+ const intent = parseCheckpointCommand(args);
1341
+ if (intent.kind === "list") {
1342
+ ctx.send({ type: "info", message: formatCheckpointList(session.checkpoints).join("\n") });
1341
1343
  return;
1342
1344
  }
1343
- const cpName = args.slice(1).join(" ").trim();
1344
- if (sub === "save") {
1345
- if (!cpName) {
1346
- ctx.send({ type: "error", message: "Usage: /checkpoint save <name>" });
1347
- return;
1348
- }
1349
- session.createCheckpoint(cpName);
1350
- ctx.send({ type: "info", message: `\u2713 Checkpoint "${cpName}" saved at message #${session.messages.length}` });
1351
- } else if (sub === "restore") {
1352
- if (!cpName) {
1353
- ctx.send({ type: "error", message: "Usage: /checkpoint restore <name>" });
1354
- return;
1355
- }
1356
- const ok = session.restoreCheckpoint(cpName);
1357
- if (ok) {
1358
- ctx.send({ type: "info", message: `\u2713 Restored to checkpoint "${cpName}" (${session.messages.length} messages)` });
1359
- ctx.sendSessionMessages();
1360
- ctx.sendStatus();
1361
- } else {
1362
- ctx.send({ type: "error", message: `Checkpoint "${cpName}" not found.` });
1363
- }
1364
- } else if (sub === "delete") {
1365
- if (!cpName) {
1366
- ctx.send({ type: "error", message: "Usage: /checkpoint delete <name>" });
1345
+ if (intent.kind === "usage" || intent.kind === "unknown") {
1346
+ ctx.send({ type: "error", message: intent.message });
1347
+ return;
1348
+ }
1349
+ if (intent.kind === "save") {
1350
+ session.createCheckpoint(intent.name);
1351
+ ctx.send({ type: "info", message: checkpointSavedMessage(intent.name, session.messages.length) });
1352
+ return;
1353
+ }
1354
+ if (intent.kind === "restore") {
1355
+ if (!session.restoreCheckpoint(intent.name)) {
1356
+ ctx.send({ type: "error", message: checkpointNotFoundMessage(intent.name) });
1367
1357
  return;
1368
1358
  }
1369
- const ok = session.deleteCheckpoint(cpName);
1370
- if (ok) {
1371
- ctx.send({ type: "info", message: `\u2713 Deleted checkpoint "${cpName}"` });
1372
- } else {
1373
- ctx.send({ type: "error", message: `Checkpoint "${cpName}" not found.` });
1374
- }
1375
- } else {
1376
- ctx.send({ type: "error", message: `Unknown subcommand: ${sub}. Use save/restore/list/delete.` });
1359
+ ctx.resetWebSessionUsage();
1360
+ ctx.send({ type: "info", message: checkpointRestoredMessage(intent.name, session.messages.length) });
1361
+ ctx.sendSessionMessages();
1362
+ ctx.sendStatus();
1363
+ return;
1364
+ }
1365
+ if (!session.deleteCheckpoint(intent.name)) {
1366
+ ctx.send({ type: "error", message: checkpointNotFoundMessage(intent.name) });
1367
+ return;
1377
1368
  }
1369
+ ctx.send({ type: "info", message: checkpointDeletedMessage(intent.name) });
1378
1370
  }
1379
1371
  async function handleBranch(args, ctx) {
1380
1372
  const session = ctx.sessions.current;
@@ -1891,7 +1883,7 @@ async function handleTest(args, ctx) {
1891
1883
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1892
1884
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
1893
1885
  }
1894
- const runTests = ctx.runTests ?? (await import("./run-tests-EL54INOI.js")).executeTests;
1886
+ const runTests = ctx.runTests ?? (await import("./run-tests-XGCNUT5S.js")).executeTests;
1895
1887
  const report = await runTests(testArgs);
1896
1888
  ctx.send({ type: "info", message: report });
1897
1889
  } catch (err) {
@@ -2227,7 +2219,7 @@ async function handleMemory(args, ctx) {
2227
2219
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
2228
2220
  } else if (sub === "export") {
2229
2221
  if (args[1] === "md") {
2230
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-KSZKM4JG.js");
2222
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-7CKJLS25.js");
2231
2223
  ctx.send({
2232
2224
  type: "export_data",
2233
2225
  format: "md",
@@ -2478,7 +2470,7 @@ async function handleHelp(_args, ctx) {
2478
2470
  " /about \u2014 Version & author info",
2479
2471
  " /provider <id> \u2014 Switch AI provider",
2480
2472
  " /model <id> \u2014 Switch model",
2481
- " /clear \u2014 Clear conversation & start new session",
2473
+ " /clear \u2014 Start a new session (previous conversation is kept)",
2482
2474
  " /compact [hint] \u2014 Compress conversation history",
2483
2475
  " /think [on|off] \u2014 Toggle extended thinking mode",
2484
2476
  " /plan [execute|exit|status] \u2014 Read-only planning mode (bare /plan enters it)",
@@ -3884,43 +3876,13 @@ ${summaryContent}`,
3884
3876
  this.send({ type: "info", message: "No messages to export." });
3885
3877
  return;
3886
3878
  }
3887
- const title = session.title ?? "Untitled";
3888
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
3889
- if (format === "json") {
3890
- const data = {
3891
- title,
3892
- provider: this.currentProvider,
3893
- model: this.currentModel,
3894
- exported: (/* @__PURE__ */ new Date()).toISOString(),
3895
- messages: session.messages.map((m) => ({
3896
- role: m.role,
3897
- content: getContentText(m.content),
3898
- timestamp: m.timestamp?.toISOString()
3899
- }))
3900
- };
3901
- this.send({
3902
- type: "export_data",
3903
- format: "json",
3904
- filename: `aicli-${timestamp}.json`,
3905
- content: JSON.stringify(data, null, 2)
3906
- });
3907
- } else {
3908
- const lines = [`# ${title}`, "", `> Exported: ${(/* @__PURE__ */ new Date()).toLocaleString()} | Provider: ${this.currentProvider} | Model: ${this.currentModel}`, ""];
3909
- for (const m of session.messages) {
3910
- const text = getContentText(m.content);
3911
- if (m.role === "user") {
3912
- lines.push(`## \u{1F9D1} User`, "", text, "");
3913
- } else if (m.role === "assistant") {
3914
- lines.push(`## \u{1F916} Assistant`, "", text, "");
3915
- }
3916
- }
3917
- this.send({
3918
- type: "export_data",
3919
- format: "md",
3920
- filename: `aicli-${timestamp}.md`,
3921
- content: lines.join("\n")
3922
- });
3923
- }
3879
+ const exported = buildSessionExport(session, format);
3880
+ this.send({
3881
+ type: "export_data",
3882
+ format,
3883
+ filename: exported.filename,
3884
+ content: exported.content
3885
+ });
3924
3886
  }
3925
3887
  memoryShow(args = []) {
3926
3888
  const configDir = this.config.getConfigDir();
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-FQJFGGKN.js";
4
+ } from "./chunk-FHRIDE2T.js";
5
5
  import "./chunk-GHWZVPUV.js";
6
- import "./chunk-6WMT7OQG.js";
6
+ import "./chunk-H2VE4TTN.js";
7
7
  import "./chunk-4DEMGCK4.js";
8
8
  import "./chunk-UUSRWSSX.js";
9
9
  import "./chunk-CKH4KQ4E.js";
@@ -14,7 +14,7 @@ import "./chunk-NYNSYLFY.js";
14
14
  import "./chunk-3FEZSLGI.js";
15
15
  import {
16
16
  runTool
17
- } from "./chunk-IIXZ7IPN.js";
17
+ } from "./chunk-L7C34TFI.js";
18
18
  import {
19
19
  getDangerLevel,
20
20
  schemaToJsonSchema
@@ -23,10 +23,10 @@ import "./chunk-TU3L3PW7.js";
23
23
  import "./chunk-HOSJZMQS.js";
24
24
  import "./chunk-IW3Q7AE5.js";
25
25
  import "./chunk-4BKXL7SM.js";
26
- import "./chunk-NZPHEUJM.js";
26
+ import "./chunk-J3RWNQOF.js";
27
27
  import {
28
28
  VERSION
29
- } from "./chunk-2BKRWTEQ.js";
29
+ } from "./chunk-2FCKZ3OS.js";
30
30
 
31
31
  // src/mcp/server.ts
32
32
  import { createInterface } from "readline";
@@ -4,9 +4,9 @@ import {
4
4
  googleSearchContext,
5
5
  isToolCapableProvider,
6
6
  truncateOutput
7
- } from "./chunk-FQJFGGKN.js";
7
+ } from "./chunk-FHRIDE2T.js";
8
8
  import "./chunk-GHWZVPUV.js";
9
- import "./chunk-6WMT7OQG.js";
9
+ import "./chunk-H2VE4TTN.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-IIXZ7IPN.js";
20
+ } from "./chunk-L7C34TFI.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-NZPHEUJM.js";
31
+ import "./chunk-J3RWNQOF.js";
32
32
  import {
33
33
  SUBAGENT_ALLOWED_TOOLS
34
- } from "./chunk-2BKRWTEQ.js";
34
+ } from "./chunk-2FCKZ3OS.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-UD3BVNC5.js";
11
+ } from "./chunk-4XJVSMZ6.js";
12
12
  import "./chunk-TU3L3PW7.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
- import "./chunk-2BKRWTEQ.js";
14
+ import "./chunk-2FCKZ3OS.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.279",
3
+ "version": "0.4.281",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",