jinzd-ai-cli 0.4.228 → 0.4.230

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 (32) hide show
  1. package/dist/{batch-K6IRL6TU.js → batch-T74D2CCK.js} +3 -3
  2. package/dist/{chunk-DEHVRQWW.js → chunk-4KM53GLG.js} +1 -1
  3. package/dist/{chunk-EEQHP4GK.js → chunk-62R7CACG.js} +101 -302
  4. package/dist/{chunk-JZNKM3RV.js → chunk-6GSDDDEO.js} +1 -1
  5. package/dist/{chunk-LDWTVCE5.js → chunk-7I4GGVIS.js} +1 -1
  6. package/dist/{chunk-JGQ3TULW.js → chunk-DKPHVQUA.js} +1 -1
  7. package/dist/{chunk-MQVC7FJH.js → chunk-F2DUNYGY.js} +21 -36
  8. package/dist/{chunk-ACO2RJY3.js → chunk-ITEGK3IN.js} +1 -1
  9. package/dist/{chunk-32LTIQQN.js → chunk-LMKCS5XH.js} +4 -4
  10. package/dist/{chunk-NI34BUBR.js → chunk-S6SFZP3G.js} +1 -1
  11. package/dist/{chunk-4GF47FW3.js → chunk-SARJYCDV.js} +4 -4
  12. package/dist/{chunk-VSEXYCEE.js → chunk-SKUNYJDW.js} +2 -2
  13. package/dist/{chunk-JO2CAKHA.js → chunk-T3A74XGG.js} +1 -1
  14. package/dist/{chunk-QYQCCIBT.js → chunk-ZWU7FWHO.js} +22 -3
  15. package/dist/{ci-D35MUGEH.js → ci-ADQTAYOZ.js} +5 -5
  16. package/dist/{ci-format-EQ4HGHXR.js → ci-format-KZSTHIEW.js} +2 -2
  17. package/dist/{constants-F2LRIWV2.js → constants-JTHN5JSQ.js} +1 -1
  18. package/dist/{doctor-cli-R3AH5CLF.js → doctor-cli-XTIL3RTQ.js} +5 -5
  19. package/dist/electron-server.js +169 -373
  20. package/dist/{hub-AAYGBUDA.js → hub-BHHNMBCY.js} +2 -2
  21. package/dist/index.js +36 -49
  22. package/dist/{persist-XUXIPYUU.js → persist-I3JI27OK.js} +2 -2
  23. package/dist/{pr-HX6V63FO.js → pr-NUHU64NS.js} +5 -5
  24. package/dist/{run-tests-5QHWA4MF.js → run-tests-HZMY436A.js} +2 -2
  25. package/dist/{run-tests-7SGHDDHL.js → run-tests-M45ZJPR6.js} +1 -1
  26. package/dist/{server-E5XTQG7W.js → server-Q7MNZB4X.js} +4 -4
  27. package/dist/{server-O2YK3VWK.js → server-RCAFE2LO.js} +37 -44
  28. package/dist/{task-orchestrator-T2LUS5ZQ.js → task-orchestrator-IVSLED6U.js} +4 -4
  29. package/dist/{usage-AIHU5PIY.js → usage-KNMT35C2.js} +2 -2
  30. package/dist/web/client/app.js +13 -5
  31. package/dist/web/client/index.html +14 -6
  32. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-JZNKM3RV.js";
4
+ } from "./chunk-6GSDDDEO.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
  import {
3
3
  ProviderRegistry
4
- } from "./chunk-EEQHP4GK.js";
4
+ } from "./chunk-62R7CACG.js";
5
5
  import {
6
6
  getActivePluginAssets,
7
7
  getPendingHookTrust,
@@ -11,10 +11,10 @@ import {
11
11
  listHooks,
12
12
  listInstalledPlugins,
13
13
  resetStats
14
- } from "./chunk-ACO2RJY3.js";
14
+ } from "./chunk-ITEGK3IN.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-JGQ3TULW.js";
17
+ } from "./chunk-DKPHVQUA.js";
18
18
  import {
19
19
  getGitRoot
20
20
  } from "./chunk-HOSJZMQS.js";
@@ -26,7 +26,7 @@ import {
26
26
  MCP_PROJECT_CONFIG_NAME,
27
27
  MEMORY_FILE_NAME,
28
28
  VERSION
29
- } from "./chunk-JZNKM3RV.js";
29
+ } from "./chunk-6GSDDDEO.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-MQVC7FJH.js";
4
+ } from "./chunk-F2DUNYGY.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-JZNKM3RV.js";
14
+ } from "./chunk-6GSDDDEO.js";
15
15
  import {
16
16
  atomicWriteFileSync
17
17
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-JZNKM3RV.js";
4
+ } from "./chunk-6GSDDDEO.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -43,6 +43,8 @@ var Session = class _Session {
43
43
  * 持久化在 toJSON / fromJSON 中,重启后不会重复请求。
44
44
  */
45
45
  titleAiGenerated;
46
+ /** P1-PERF-03: 脏标记 — 任何修改操作设为 true,save() 后归零;避免大 session 无变更时的全量序列化写盘 */
47
+ dirty = false;
46
48
  tokenUsage = {
47
49
  inputTokens: 0,
48
50
  outputTokens: 0,
@@ -85,10 +87,12 @@ var Session = class _Session {
85
87
  this.provider = provider;
86
88
  this.model = model;
87
89
  this.updated = /* @__PURE__ */ new Date();
90
+ this.dirty = true;
88
91
  }
89
92
  addMessage(message) {
90
93
  this.messages.push(message);
91
94
  this.updated = /* @__PURE__ */ new Date();
95
+ this.dirty = true;
92
96
  if (!this.title && message.role === "user") {
93
97
  this.title = getContentText(message.content).slice(0, 50).replace(/\n/g, " ");
94
98
  }
@@ -98,6 +102,7 @@ var Session = class _Session {
98
102
  this.tokenUsage.outputTokens += usage.outputTokens;
99
103
  this.tokenUsage.cacheCreationTokens += usage.cacheCreationTokens ?? 0;
100
104
  this.tokenUsage.cacheReadTokens += usage.cacheReadTokens ?? 0;
105
+ this.dirty = true;
101
106
  }
102
107
  clear() {
103
108
  this.messages = [];
@@ -110,6 +115,7 @@ var Session = class _Session {
110
115
  cacheReadTokens: 0
111
116
  };
112
117
  this.updated = /* @__PURE__ */ new Date();
118
+ this.dirty = true;
113
119
  }
114
120
  /**
115
121
  * 上下文压缩:用摘要消息替换旧消息,保留最近 keepLast 条。
@@ -135,6 +141,7 @@ var Session = class _Session {
135
141
  const removedCount = cutIndex;
136
142
  this.messages = [summaryMsg, ackMsg, ...preserved];
137
143
  this.updated = /* @__PURE__ */ new Date();
144
+ this.dirty = true;
138
145
  return removedCount;
139
146
  }
140
147
  /** 在当前消息位置创建检查点 */
@@ -145,6 +152,7 @@ var Session = class _Session {
145
152
  messageIndex: this.messages.length,
146
153
  timestamp: /* @__PURE__ */ new Date()
147
154
  });
155
+ this.dirty = true;
148
156
  }
149
157
  /** 恢复到指定检查点:截断消息到检查点位置,移除后续检查点 */
150
158
  restoreCheckpoint(name) {
@@ -153,6 +161,7 @@ var Session = class _Session {
153
161
  this.messages = this.messages.slice(0, cp.messageIndex);
154
162
  this.checkpoints = this.checkpoints.filter((c) => c.messageIndex <= cp.messageIndex);
155
163
  this.updated = /* @__PURE__ */ new Date();
164
+ this.dirty = true;
156
165
  return true;
157
166
  }
158
167
  listCheckpoints() {
@@ -220,6 +229,7 @@ var Session = class _Session {
220
229
  this.messages = _Session.cloneMessages(this.messages.slice(0, fromIndex));
221
230
  this.activeBranchId = id;
222
231
  this.updated = /* @__PURE__ */ new Date();
232
+ this.dirty = true;
223
233
  return id;
224
234
  }
225
235
  /**
@@ -237,6 +247,7 @@ var Session = class _Session {
237
247
  this.messages = target;
238
248
  this.activeBranchId = id;
239
249
  this.updated = /* @__PURE__ */ new Date();
250
+ this.dirty = true;
240
251
  return true;
241
252
  }
242
253
  /**
@@ -261,6 +272,7 @@ var Session = class _Session {
261
272
  this.branches.splice(idx, 1);
262
273
  this._inactiveBranchMessages.delete(id);
263
274
  this.updated = /* @__PURE__ */ new Date();
275
+ this.dirty = true;
264
276
  return true;
265
277
  }
266
278
  /** Rename a branch (affects only display title). */
@@ -269,6 +281,7 @@ var Session = class _Session {
269
281
  if (!b) return false;
270
282
  b.title = newTitle;
271
283
  this.updated = /* @__PURE__ */ new Date();
284
+ this.dirty = true;
272
285
  return true;
273
286
  }
274
287
  /**
@@ -351,6 +364,7 @@ var Session = class _Session {
351
364
  };
352
365
  this.messages.push(copy);
353
366
  this.updated = /* @__PURE__ */ new Date();
367
+ this.dirty = true;
354
368
  return copy;
355
369
  }
356
370
  getMeta() {
@@ -443,6 +457,7 @@ var Session = class _Session {
443
457
  });
444
458
  forked.checkpoints = original.checkpoints.filter((c) => c.messageIndex <= clampedCount).map((c) => ({ ...c, timestamp: new Date(c.timestamp.getTime()) }));
445
459
  forked.updated = /* @__PURE__ */ new Date();
460
+ forked.dirty = true;
446
461
  return forked;
447
462
  }
448
463
  /**
@@ -522,6 +537,7 @@ var Session = class _Session {
522
537
  }
523
538
  }
524
539
  }
540
+ session.dirty = false;
525
541
  return session;
526
542
  }
527
543
  };
@@ -585,8 +601,10 @@ var SessionManager = class {
585
601
  clearCurrent() {
586
602
  this._current = null;
587
603
  }
588
- async save() {
604
+ /** P1-PERF-03: `force` 跳过脏检查(用于进程退出、fork 等必须落盘场景) */
605
+ async save(force = false) {
589
606
  if (!this._current) return;
607
+ if (!force && !this._current.dirty) return;
590
608
  mkdirSync(this.historyDir, { recursive: true });
591
609
  const filePath = join(this.historyDir, `${this._current.id}.json`);
592
610
  const raw = this._current.toJSON();
@@ -594,6 +612,7 @@ var SessionManager = class {
594
612
  const { value: payload, hits } = redactJson(raw, opts);
595
613
  this.lastRedactionHits = hits.length;
596
614
  atomicWriteFileSync(filePath, JSON.stringify(payload, null, 2));
615
+ this._current.dirty = false;
597
616
  }
598
617
  loadSession(id) {
599
618
  const filePath = join(this.historyDir, `${id}.json`);
@@ -734,10 +753,10 @@ var SessionManager = class {
734
753
  if (!this._current) {
735
754
  throw new Error("No active session to fork");
736
755
  }
737
- await this.save();
756
+ await this.save(true);
738
757
  const forked = Session.fork(this._current, uuidv4(), messageCount, title);
739
758
  this._current = forked;
740
- await this.save();
759
+ await this.save(true);
741
760
  return forked;
742
761
  }
743
762
  /**
@@ -3,14 +3,14 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-32LTIQQN.js";
7
- import "./chunk-JO2CAKHA.js";
6
+ } from "./chunk-LMKCS5XH.js";
7
+ import "./chunk-T3A74XGG.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
- import "./chunk-EEQHP4GK.js";
9
+ import "./chunk-62R7CACG.js";
10
10
  import "./chunk-ODYTXQ26.js";
11
- import "./chunk-JGQ3TULW.js";
11
+ import "./chunk-DKPHVQUA.js";
12
12
  import "./chunk-5ULLIOVC.js";
13
- import "./chunk-JZNKM3RV.js";
13
+ import "./chunk-6GSDDDEO.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
  export {
16
16
  CI_COMMENT_MARKER,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-JO2CAKHA.js";
10
- import "./chunk-JZNKM3RV.js";
9
+ } from "./chunk-T3A74XGG.js";
10
+ import "./chunk-6GSDDDEO.js";
11
11
  export {
12
12
  DEFAULT_CI_THRESHOLDS,
13
13
  detectCiGateSignals,
@@ -38,7 +38,7 @@ import {
38
38
  TEST_TIMEOUT,
39
39
  VERSION,
40
40
  buildUserIdentityPrompt
41
- } from "./chunk-JZNKM3RV.js";
41
+ } from "./chunk-6GSDDDEO.js";
42
42
  export {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  APP_NAME,
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  formatDoctorReport,
4
4
  runDoctorCli
5
- } from "./chunk-4GF47FW3.js";
6
- import "./chunk-EEQHP4GK.js";
7
- import "./chunk-ACO2RJY3.js";
5
+ } from "./chunk-SARJYCDV.js";
6
+ import "./chunk-62R7CACG.js";
7
+ import "./chunk-ITEGK3IN.js";
8
8
  import "./chunk-ODYTXQ26.js";
9
- import "./chunk-JGQ3TULW.js";
9
+ import "./chunk-DKPHVQUA.js";
10
10
  import "./chunk-5ULLIOVC.js";
11
11
  import "./chunk-HOSJZMQS.js";
12
- import "./chunk-JZNKM3RV.js";
12
+ import "./chunk-6GSDDDEO.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
14
  export {
15
15
  formatDoctorReport,