jinzd-ai-cli 0.4.219 → 0.4.221

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 +101 -99
  2. package/README.zh-CN.md +40 -38
  3. package/dist/{batch-CHAPYRVM.js → batch-LSWWSINO.js} +3 -3
  4. package/dist/{chunk-GEN4O5QH.js → chunk-4AX2MEJA.js} +4 -4
  5. package/dist/{chunk-64NUW3WL.js → chunk-4MOBTDS6.js} +1 -1
  6. package/dist/{chunk-4ZN6L6K5.js → chunk-5BY4XICU.js} +6 -5
  7. package/dist/{chunk-MC34ISJU.js → chunk-5GTWZ4QF.js} +30 -6
  8. package/dist/{chunk-TZQHYZKT.js → chunk-5ULLIOVC.js} +1 -0
  9. package/dist/{chunk-3I4RZYYO.js → chunk-6SKMGONY.js} +6 -5
  10. package/dist/{chunk-QUFYBR6Q.js → chunk-BYQEWWA4.js} +2 -2
  11. package/dist/{chunk-VADHBW7T.js → chunk-OULVIHCT.js} +1 -1
  12. package/dist/{chunk-KIEZBTVD.js → chunk-PMTEZTXP.js} +2 -2
  13. package/dist/{chunk-QMXC327F.js → chunk-PUBCJF7E.js} +213 -175
  14. package/dist/{chunk-U7KVU25H.js → chunk-QDN5G7JN.js} +1 -1
  15. package/dist/{chunk-GGKQHPB3.js → chunk-QKJ3MAP7.js} +1 -1
  16. package/dist/{chunk-A4GUGWEY.js → chunk-QT5FA2ZY.js} +1 -1
  17. package/dist/{chunk-EGMORH5W.js → chunk-S5EEKS4P.js} +1 -1
  18. package/dist/{ci-QPP66T53.js → ci-OIFTAJKR.js} +6 -6
  19. package/dist/{ci-format-5S3EEYRK.js → ci-format-H6BLMWQ5.js} +2 -2
  20. package/dist/{constants-FJOLBABC.js → constants-EJRLT7DM.js} +1 -1
  21. package/dist/{doctor-cli-KB2LUDF3.js → doctor-cli-EXC7YU5D.js} +6 -6
  22. package/dist/electron-server.js +558 -466
  23. package/dist/{hub-DIM7SKKY.js → hub-HQDRQBNM.js} +2 -2
  24. package/dist/index.js +376 -45
  25. package/dist/{persist-L54DPLI7.js → persist-GTBEKVFL.js} +2 -2
  26. package/dist/{pr-YQGH72N6.js → pr-VSZNVKBS.js} +8 -7
  27. package/dist/{run-tests-O76JIBCW.js → run-tests-55JGEZYL.js} +1 -1
  28. package/dist/{run-tests-GEZSSNJM.js → run-tests-OYXK27XH.js} +2 -2
  29. package/dist/{server-5E2AIXVX.js → server-JKNIZ5CB.js} +54 -22
  30. package/dist/{server-Z6O3G2LY.js → server-XX6UM4ZQ.js} +5 -5
  31. package/dist/{task-orchestrator-5HBW4O64.js → task-orchestrator-F3DUIACA.js} +5 -5
  32. package/dist/{usage-BMK6M5U3.js → usage-4KFX3HTK.js} +3 -3
  33. package/package.json +1 -1
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-4ZN6L6K5.js";
6
- import "./chunk-VADHBW7T.js";
5
+ } from "./chunk-5BY4XICU.js";
6
+ import "./chunk-OULVIHCT.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -11,15 +11,15 @@ import {
11
11
  } from "./chunk-HLWUDRBO.js";
12
12
  import {
13
13
  ProviderRegistry
14
- } from "./chunk-QMXC327F.js";
14
+ } from "./chunk-PUBCJF7E.js";
15
15
  import "./chunk-XPBEJB27.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-KIEZBTVD.js";
19
- import "./chunk-TZQHYZKT.js";
18
+ } from "./chunk-PMTEZTXP.js";
19
+ import "./chunk-5ULLIOVC.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-U7KVU25H.js";
22
+ } from "./chunk-QDN5G7JN.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -179,7 +179,8 @@ async function getProvider(opts) {
179
179
  await registry.initialize(
180
180
  (id) => config.getApiKey(id),
181
181
  (id) => ({ baseUrl: config.get("customBaseUrls")[id], timeout: config.get("timeouts")[id], proxy: config.get("proxy") }),
182
- config.get("customProviders")
182
+ config.get("customProviders"),
183
+ config.getConfigDir()
183
184
  );
184
185
  const providerId = opts.provider ?? config.getDefaultProvider();
185
186
  if (!registry.has(providerId)) throw new Error(`Provider '${providerId}' is not configured. Set the right AICLI_API_KEY_* env var or pass --provider.`);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-EGMORH5W.js";
4
+ } from "./chunk-S5EEKS4P.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-64NUW3WL.js";
6
- import "./chunk-U7KVU25H.js";
5
+ } from "./chunk-4MOBTDS6.js";
6
+ import "./chunk-QDN5G7JN.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -7,7 +7,7 @@ import {
7
7
  import "./chunk-NZ4X6GUC.js";
8
8
  import {
9
9
  persistDiscussion
10
- } from "./chunk-A4GUGWEY.js";
10
+ } from "./chunk-QT5FA2ZY.js";
11
11
  import {
12
12
  AuthManager,
13
13
  TOKEN_EXPIRY_MS
@@ -23,7 +23,7 @@ import {
23
23
  scanDirTree,
24
24
  scanProject,
25
25
  setupProxy
26
- } from "./chunk-QUFYBR6Q.js";
26
+ } from "./chunk-BYQEWWA4.js";
27
27
  import {
28
28
  buildReviewPrompt,
29
29
  buildSecurityReviewPrompt
@@ -66,15 +66,15 @@ import {
66
66
  truncateOutput,
67
67
  undoStack,
68
68
  updateMemoryApproval
69
- } from "./chunk-GEN4O5QH.js";
69
+ } from "./chunk-4AX2MEJA.js";
70
70
  import "./chunk-K3CF65QH.js";
71
71
  import "./chunk-T2NL5ZIA.js";
72
72
  import "./chunk-BXP6YZ2P.js";
73
- import "./chunk-64NUW3WL.js";
73
+ import "./chunk-4MOBTDS6.js";
74
74
  import {
75
75
  SessionManager,
76
76
  getContentText
77
- } from "./chunk-MC34ISJU.js";
77
+ } from "./chunk-5GTWZ4QF.js";
78
78
  import {
79
79
  computeCost,
80
80
  formatCost
@@ -89,10 +89,10 @@ import {
89
89
  buildDoctorReport,
90
90
  formatDoctorReport,
91
91
  loadContextFiles
92
- } from "./chunk-3I4RZYYO.js";
92
+ } from "./chunk-6SKMGONY.js";
93
93
  import {
94
94
  ProviderRegistry
95
- } from "./chunk-QMXC327F.js";
95
+ } from "./chunk-PUBCJF7E.js";
96
96
  import {
97
97
  describePlugin,
98
98
  getActivePluginAssets,
@@ -107,7 +107,7 @@ import {
107
107
  runTool,
108
108
  setPluginEnabled,
109
109
  trustPlugin
110
- } from "./chunk-GGKQHPB3.js";
110
+ } from "./chunk-QKJ3MAP7.js";
111
111
  import {
112
112
  CONTENT_ONLY_STREAM_REMINDER,
113
113
  TEE_FINAL_USER_NUDGE,
@@ -126,8 +126,8 @@ import {
126
126
  } from "./chunk-XPBEJB27.js";
127
127
  import {
128
128
  ConfigManager
129
- } from "./chunk-KIEZBTVD.js";
130
- import "./chunk-TZQHYZKT.js";
129
+ } from "./chunk-PMTEZTXP.js";
130
+ import "./chunk-5ULLIOVC.js";
131
131
  import {
132
132
  AGENTIC_BEHAVIOR_GUIDELINE,
133
133
  AUTHOR,
@@ -144,7 +144,7 @@ import {
144
144
  SKILLS_DIR_NAME,
145
145
  VERSION,
146
146
  buildUserIdentityPrompt
147
- } from "./chunk-U7KVU25H.js";
147
+ } from "./chunk-QDN5G7JN.js";
148
148
  import {
149
149
  formatGitContextForPrompt,
150
150
  getGitContext,
@@ -1682,13 +1682,39 @@ ${summaryContent}`,
1682
1682
  break;
1683
1683
  }
1684
1684
  case "model": {
1685
- const modelId = args[0];
1686
- if (!modelId) {
1687
- this.send({ type: "error", message: "Usage: /model <id>" });
1685
+ const sub = args[0];
1686
+ if (!sub) {
1687
+ this.send({ type: "error", message: "Usage: /model <id>|refresh [provider]|cache [clear [provider]]" });
1688
+ return;
1689
+ }
1690
+ if (sub === "refresh") {
1691
+ const providerId = args[1] ?? this.currentProvider;
1692
+ try {
1693
+ const models2 = await this.providers.refreshModels(providerId);
1694
+ this.send({ type: "info", message: `Refreshed ${models2.length} model(s) for ${providerId}.` });
1695
+ this.sendStatus();
1696
+ } catch (err) {
1697
+ this.send({ type: "error", message: `Model refresh failed: ${err instanceof Error ? err.message : String(err)}` });
1698
+ }
1699
+ return;
1700
+ }
1701
+ if (sub === "cache") {
1702
+ if ((args[1] ?? "").toLowerCase() === "clear") {
1703
+ const providerId = args[2];
1704
+ this.providers.clearModelCache(providerId);
1705
+ this.send({ type: "info", message: providerId ? `Cleared model cache for ${providerId}.` : "Cleared model cache." });
1706
+ return;
1707
+ }
1708
+ const rows = this.providers.getModelCacheStatus();
1709
+ this.send({
1710
+ type: "info",
1711
+ message: rows.length === 0 ? "Model cache is empty. Use /model refresh to populate it." : rows.map((row) => `${row.providerId}: ${row.count} model(s), fetched ${row.fetchedAt}`).join("\n")
1712
+ });
1688
1713
  return;
1689
1714
  }
1690
- const provider = this.providers.get(this.currentProvider);
1691
- const found = provider?.info.models.find((m) => m.id === modelId);
1715
+ const modelId = sub;
1716
+ const models = await this.providers.listModels(this.currentProvider);
1717
+ const found = models.find((m) => m.id === modelId);
1692
1718
  if (!found) {
1693
1719
  this.send({ type: "error", message: `Model "${modelId}" not found` });
1694
1720
  return;
@@ -2765,7 +2791,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2765
2791
  case "test": {
2766
2792
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2767
2793
  try {
2768
- const { executeTests } = await import("./run-tests-GEZSSNJM.js");
2794
+ const { executeTests } = await import("./run-tests-OYXK27XH.js");
2769
2795
  const argStr = args.join(" ").trim();
2770
2796
  let testArgs = {};
2771
2797
  if (argStr) {
@@ -3188,7 +3214,8 @@ Add .md files to create commands.` });
3188
3214
  messageCount: s.messageCount,
3189
3215
  updated: s.updated instanceof Date ? s.updated.toISOString() : String(s.updated),
3190
3216
  isCurrent: s.id === this.sessions.current?.id
3191
- }))
3217
+ })),
3218
+ totalCount: list.length
3192
3219
  });
3193
3220
  }
3194
3221
  sendToolsList() {
@@ -3601,7 +3628,8 @@ async function startWebServer(options = {}) {
3601
3628
  timeout: config.get("timeouts")[id],
3602
3629
  proxy: config.get("proxy")
3603
3630
  }),
3604
- config.get("customProviders")
3631
+ config.get("customProviders"),
3632
+ config.getConfigDir()
3605
3633
  );
3606
3634
  if (options._extraProviders) {
3607
3635
  for (const p of options._extraProviders) {
@@ -3829,18 +3857,22 @@ async function startWebServer(options = {}) {
3829
3857
  const authUser = req._authUser;
3830
3858
  const sm = authUser ? getUserShared(authUser).sessions : sessions;
3831
3859
  const list = sm.listSessions();
3860
+ const all = req.query.all === "true";
3861
+ const limit = all ? -1 : Number(req.query.limit) || 50;
3862
+ const sliced = limit > 0 ? list.slice(0, limit) : list;
3832
3863
  res.json({
3833
- sessions: list.slice(0, 50).map((s) => ({
3864
+ sessions: sliced.map((s) => ({
3834
3865
  id: s.id,
3835
3866
  title: s.title,
3836
3867
  provider: s.provider,
3837
3868
  model: s.model,
3838
3869
  messageCount: s.messageCount,
3839
3870
  updated: s.updated
3840
- }))
3871
+ })),
3872
+ totalCount: list.length
3841
3873
  });
3842
3874
  } catch {
3843
- res.json({ sessions: [] });
3875
+ res.json({ sessions: [], totalCount: 0 });
3844
3876
  }
3845
3877
  });
3846
3878
  app.get("/api/sessions/:id/replay", requireAuth, (req, res) => {
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-GEN4O5QH.js";
4
+ } from "./chunk-4AX2MEJA.js";
5
5
  import "./chunk-K3CF65QH.js";
6
6
  import "./chunk-T2NL5ZIA.js";
7
7
  import "./chunk-BXP6YZ2P.js";
8
- import "./chunk-64NUW3WL.js";
8
+ import "./chunk-4MOBTDS6.js";
9
9
  import "./chunk-4BKXL7SM.js";
10
10
  import "./chunk-TB4W4Y4T.js";
11
11
  import "./chunk-KHYD3WXE.js";
12
12
  import "./chunk-SLSWPBK3.js";
13
13
  import {
14
14
  runTool
15
- } from "./chunk-GGKQHPB3.js";
15
+ } from "./chunk-QKJ3MAP7.js";
16
16
  import {
17
17
  getDangerLevel,
18
18
  schemaToJsonSchema
19
19
  } from "./chunk-XPBEJB27.js";
20
- import "./chunk-TZQHYZKT.js";
20
+ import "./chunk-5ULLIOVC.js";
21
21
  import {
22
22
  VERSION
23
- } from "./chunk-U7KVU25H.js";
23
+ } from "./chunk-QDN5G7JN.js";
24
24
  import "./chunk-HOSJZMQS.js";
25
25
  import "./chunk-CKH4KQ4E.js";
26
26
  import "./chunk-IW3Q7AE5.js";
@@ -3,26 +3,26 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-GEN4O5QH.js";
6
+ } from "./chunk-4AX2MEJA.js";
7
7
  import "./chunk-K3CF65QH.js";
8
8
  import "./chunk-T2NL5ZIA.js";
9
9
  import "./chunk-BXP6YZ2P.js";
10
- import "./chunk-64NUW3WL.js";
10
+ import "./chunk-4MOBTDS6.js";
11
11
  import "./chunk-4BKXL7SM.js";
12
12
  import "./chunk-TB4W4Y4T.js";
13
13
  import "./chunk-KHYD3WXE.js";
14
14
  import "./chunk-SLSWPBK3.js";
15
15
  import {
16
16
  runTool
17
- } from "./chunk-GGKQHPB3.js";
17
+ } from "./chunk-QKJ3MAP7.js";
18
18
  import {
19
19
  getDangerLevel,
20
20
  runLeanAgentLoop
21
21
  } from "./chunk-XPBEJB27.js";
22
- import "./chunk-TZQHYZKT.js";
22
+ import "./chunk-5ULLIOVC.js";
23
23
  import {
24
24
  SUBAGENT_ALLOWED_TOOLS
25
- } from "./chunk-U7KVU25H.js";
25
+ } from "./chunk-QDN5G7JN.js";
26
26
  import "./chunk-HOSJZMQS.js";
27
27
  import "./chunk-CKH4KQ4E.js";
28
28
  import {
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-E44DTERW.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-KIEZBTVD.js";
12
- import "./chunk-TZQHYZKT.js";
13
- import "./chunk-U7KVU25H.js";
11
+ } from "./chunk-PMTEZTXP.js";
12
+ import "./chunk-5ULLIOVC.js";
13
+ import "./chunk-QDN5G7JN.js";
14
14
  import "./chunk-IW3Q7AE5.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.219",
3
+ "version": "0.4.221",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",