jinzd-ai-cli 0.4.260 → 0.4.262

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 (39) hide show
  1. package/README.md +10 -8
  2. package/README.zh-CN.md +11 -9
  3. package/dist/{batch-LBMJWMMO.js → batch-2B7UUX27.js} +2 -2
  4. package/dist/{chunk-U2HN3EW6.js → chunk-25HFWCM3.js} +19 -7
  5. package/dist/{chunk-2BGNEVS5.js → chunk-2XPJRRBB.js} +4 -4
  6. package/dist/{chunk-AAWV4BP4.js → chunk-A6JLBNAI.js} +2 -2
  7. package/dist/{chunk-XTA3LSPQ.js → chunk-BS44XEZ4.js} +1 -1
  8. package/dist/{chunk-NEYNE6UE.js → chunk-D6DHS5GL.js} +11 -9
  9. package/dist/{chunk-63M2ELJS.js → chunk-FWBSGBB7.js} +4 -4
  10. package/dist/{chunk-HBR33J6J.js → chunk-HPDI4F5F.js} +1 -1
  11. package/dist/{chunk-Y7UZSFGS.js → chunk-JEJHNVA2.js} +1 -1
  12. package/dist/{chunk-CLJKNKUN.js → chunk-JFXKQPKY.js} +1 -1
  13. package/dist/{chunk-3TE7ZWO5.js → chunk-KMS3LBO3.js} +1 -1
  14. package/dist/{chunk-KRENSXPC.js → chunk-KWYJFLXY.js} +1 -1
  15. package/dist/{chunk-K6WMQBUP.js → chunk-MTIS7H6V.js} +1 -1
  16. package/dist/{chunk-VJP2GLW5.js → chunk-WAAFA32V.js} +1 -1
  17. package/dist/{chunk-FCPYMBTA.js → chunk-XZNRZGG2.js} +57 -25
  18. package/dist/{chunk-26C6YZ3A.js → chunk-ZQZEBPAQ.js} +1 -1
  19. package/dist/{ci-PSA7F4EI.js → ci-G6OZDH4H.js} +6 -6
  20. package/dist/{ci-format-WAHEZZMY.js → ci-format-BRS7G5X5.js} +2 -2
  21. package/dist/{constants-C55LGUR7.js → constants-24AD5JQV.js} +1 -1
  22. package/dist/{doctor-cli-YANDJBHC.js → doctor-cli-WWZRFGQJ.js} +6 -6
  23. package/dist/electron-server.js +87 -42
  24. package/dist/{hub-CBOC3TT3.js → hub-2DYZQVEN.js} +1 -1
  25. package/dist/index.js +90 -41
  26. package/dist/{persistent-memory-DUFOZTDV.js → persistent-memory-DFSZZSYP.js} +2 -2
  27. package/dist/{persistent-memory-KEYVKD54.js → persistent-memory-LJT37XVO.js} +2 -2
  28. package/dist/{pr-T6KCK5DT.js → pr-OOIQPCBX.js} +6 -6
  29. package/dist/{run-tests-K43DLTA3.js → run-tests-ICTVJSJN.js} +2 -2
  30. package/dist/{run-tests-S2RLPMCR.js → run-tests-W4TG4OQV.js} +2 -2
  31. package/dist/{server-GTRCCOXN.js → server-GTVYIHBG.js} +6 -6
  32. package/dist/{server-SV3TV5BJ.js → server-IXUVVPTV.js} +14 -14
  33. package/dist/{task-orchestrator-DW5AWW7J.js → task-orchestrator-6MHSDOFR.js} +6 -6
  34. package/dist/{usage-BP442V2Q.js → usage-23I3ZJZO.js} +2 -2
  35. package/dist/web/client/actions.js +12 -7
  36. package/dist/web/client/app.js +4 -36
  37. package/dist/web/client/sidebar-tabs.js +48 -0
  38. package/dist/web/client/sw.js +1 -1
  39. package/package.json +1 -1
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-2BGNEVS5.js";
6
- import "./chunk-VJP2GLW5.js";
5
+ } from "./chunk-2XPJRRBB.js";
6
+ import "./chunk-WAAFA32V.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-U2HN3EW6.js";
14
+ } from "./chunk-25HFWCM3.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-K6WMQBUP.js";
18
- import "./chunk-FCPYMBTA.js";
17
+ } from "./chunk-MTIS7H6V.js";
18
+ import "./chunk-XZNRZGG2.js";
19
19
  import "./chunk-TU3L3PW7.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-KRENSXPC.js";
22
+ } from "./chunk-KWYJFLXY.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-HBR33J6J.js";
6
- import "./chunk-KRENSXPC.js";
5
+ } from "./chunk-HPDI4F5F.js";
6
+ import "./chunk-KWYJFLXY.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-XTA3LSPQ.js";
5
- import "./chunk-26C6YZ3A.js";
4
+ } from "./chunk-BS44XEZ4.js";
5
+ import "./chunk-ZQZEBPAQ.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-NEYNE6UE.js";
5
- import "./chunk-3TE7ZWO5.js";
4
+ } from "./chunk-D6DHS5GL.js";
5
+ import "./chunk-KMS3LBO3.js";
6
6
  import "./chunk-GLSR2NR3.js";
7
7
  import "./chunk-UUSRWSSX.js";
8
8
  import "./chunk-CKH4KQ4E.js";
9
9
  import "./chunk-BXP6YZ2P.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-Y7UZSFGS.js";
12
+ } from "./chunk-JEJHNVA2.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  schemaToJsonSchema
16
- } from "./chunk-FCPYMBTA.js";
16
+ } from "./chunk-XZNRZGG2.js";
17
17
  import "./chunk-TU3L3PW7.js";
18
18
  import "./chunk-HOSJZMQS.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
- import "./chunk-HBR33J6J.js";
20
+ import "./chunk-HPDI4F5F.js";
21
21
  import {
22
22
  VERSION
23
- } from "./chunk-KRENSXPC.js";
23
+ } from "./chunk-KWYJFLXY.js";
24
24
  import "./chunk-6RPGQ5CG.js";
25
25
  import "./chunk-KHYD3WXE.js";
26
26
  import "./chunk-NYNSYLFY.js";
@@ -23,7 +23,7 @@ import {
23
23
  scanDirTree,
24
24
  scanProject,
25
25
  setupProxy
26
- } from "./chunk-AAWV4BP4.js";
26
+ } from "./chunk-A6JLBNAI.js";
27
27
  import {
28
28
  computeCost,
29
29
  formatCost,
@@ -64,7 +64,7 @@ import {
64
64
  spawnAgentContext,
65
65
  truncateOutput,
66
66
  undoStack
67
- } from "./chunk-NEYNE6UE.js";
67
+ } from "./chunk-D6DHS5GL.js";
68
68
  import {
69
69
  addMemoryEntry,
70
70
  clearMemoryEntries,
@@ -78,7 +78,7 @@ import {
78
78
  parseWritableScope,
79
79
  updateMemoryApproval,
80
80
  updateMemoryEntry
81
- } from "./chunk-3TE7ZWO5.js";
81
+ } from "./chunk-KMS3LBO3.js";
82
82
  import "./chunk-GLSR2NR3.js";
83
83
  import "./chunk-UUSRWSSX.js";
84
84
  import "./chunk-CKH4KQ4E.js";
@@ -91,13 +91,13 @@ import {
91
91
  buildDoctorReport,
92
92
  formatDoctorReport,
93
93
  loadContextFiles
94
- } from "./chunk-63M2ELJS.js";
94
+ } from "./chunk-FWBSGBB7.js";
95
95
  import {
96
96
  ProviderRegistry
97
- } from "./chunk-U2HN3EW6.js";
97
+ } from "./chunk-25HFWCM3.js";
98
98
  import {
99
99
  ConfigManager
100
- } from "./chunk-K6WMQBUP.js";
100
+ } from "./chunk-MTIS7H6V.js";
101
101
  import {
102
102
  describePlugin,
103
103
  getActivePluginAssets,
@@ -112,7 +112,7 @@ import {
112
112
  runTool,
113
113
  setPluginEnabled,
114
114
  trustPlugin
115
- } from "./chunk-Y7UZSFGS.js";
115
+ } from "./chunk-JEJHNVA2.js";
116
116
  import {
117
117
  CONTENT_ONLY_STREAM_REMINDER,
118
118
  TEE_FINAL_USER_NUDGE,
@@ -129,7 +129,7 @@ import {
129
129
  stripOuterCodeFence,
130
130
  stripToolCallReminder,
131
131
  teeStreamErrorSummary
132
- } from "./chunk-FCPYMBTA.js";
132
+ } from "./chunk-XZNRZGG2.js";
133
133
  import "./chunk-TU3L3PW7.js";
134
134
  import {
135
135
  formatGitContextForPrompt,
@@ -137,7 +137,7 @@ import {
137
137
  getGitRoot
138
138
  } from "./chunk-HOSJZMQS.js";
139
139
  import "./chunk-4BKXL7SM.js";
140
- import "./chunk-HBR33J6J.js";
140
+ import "./chunk-HPDI4F5F.js";
141
141
  import {
142
142
  AGENTIC_BEHAVIOR_GUIDELINE,
143
143
  AUTHOR,
@@ -153,7 +153,7 @@ import {
153
153
  SKILLS_DIR_NAME,
154
154
  VERSION,
155
155
  buildUserIdentityPrompt
156
- } from "./chunk-KRENSXPC.js";
156
+ } from "./chunk-KWYJFLXY.js";
157
157
  import "./chunk-6RPGQ5CG.js";
158
158
  import "./chunk-KHYD3WXE.js";
159
159
  import "./chunk-NYNSYLFY.js";
@@ -815,7 +815,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
815
815
  Cost: ${formatCost(cost)}` : "";
816
816
  let memoryLine = "";
817
817
  try {
818
- const { countPendingMemories } = await import("./persistent-memory-KEYVKD54.js");
818
+ const { countPendingMemories } = await import("./persistent-memory-LJT37XVO.js");
819
819
  const pending = countPendingMemories(ctx.config.getConfigDir());
820
820
  if (pending > 0) memoryLine = `
821
821
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1624,14 +1624,14 @@ async function handleSecurityReview(args, ctx) {
1624
1624
  async function handleTest(args, ctx) {
1625
1625
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1626
1626
  try {
1627
- const { executeTests } = await import("./run-tests-K43DLTA3.js");
1628
1627
  const argStr = args.join(" ").trim();
1629
1628
  let testArgs = {};
1630
1629
  if (argStr) {
1631
1630
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1632
1631
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
1633
1632
  }
1634
- const report = await executeTests(testArgs);
1633
+ const runTests = ctx.runTests ?? (await import("./run-tests-ICTVJSJN.js")).executeTests;
1634
+ const report = await runTests(testArgs);
1635
1635
  ctx.send({ type: "info", message: report });
1636
1636
  } catch (err) {
1637
1637
  ctx.send({ type: "error", message: `Test failed: ${err.message}` });
@@ -1888,7 +1888,7 @@ async function handleMemory(args, ctx) {
1888
1888
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
1889
1889
  } else if (sub === "export") {
1890
1890
  if (args[1] === "md") {
1891
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-KEYVKD54.js");
1891
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-LJT37XVO.js");
1892
1892
  ctx.send({
1893
1893
  type: "export_data",
1894
1894
  format: "md",
@@ -3,26 +3,26 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-NEYNE6UE.js";
7
- import "./chunk-3TE7ZWO5.js";
6
+ } from "./chunk-D6DHS5GL.js";
7
+ import "./chunk-KMS3LBO3.js";
8
8
  import "./chunk-GLSR2NR3.js";
9
9
  import "./chunk-UUSRWSSX.js";
10
10
  import "./chunk-CKH4KQ4E.js";
11
11
  import "./chunk-BXP6YZ2P.js";
12
12
  import {
13
13
  runTool
14
- } from "./chunk-Y7UZSFGS.js";
14
+ } from "./chunk-JEJHNVA2.js";
15
15
  import {
16
16
  getDangerLevel,
17
17
  runLeanAgentLoop
18
- } from "./chunk-FCPYMBTA.js";
18
+ } from "./chunk-XZNRZGG2.js";
19
19
  import "./chunk-TU3L3PW7.js";
20
20
  import "./chunk-HOSJZMQS.js";
21
21
  import "./chunk-4BKXL7SM.js";
22
- import "./chunk-HBR33J6J.js";
22
+ import "./chunk-HPDI4F5F.js";
23
23
  import {
24
24
  SUBAGENT_ALLOWED_TOOLS
25
- } from "./chunk-KRENSXPC.js";
25
+ } from "./chunk-KWYJFLXY.js";
26
26
  import "./chunk-6RPGQ5CG.js";
27
27
  import "./chunk-KHYD3WXE.js";
28
28
  import "./chunk-NYNSYLFY.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-EZ6QLHOS.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-K6WMQBUP.js";
11
+ } from "./chunk-MTIS7H6V.js";
12
12
  import "./chunk-TU3L3PW7.js";
13
- import "./chunk-KRENSXPC.js";
13
+ import "./chunk-KWYJFLXY.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
 
16
16
  // src/cli/usage.ts
@@ -87,16 +87,21 @@ document.addEventListener('keydown', (event) => {
87
87
 
88
88
  document.getElementById('auth-form')?.addEventListener('submit', handleAuth);
89
89
 
90
- function registerServiceWorker() {
90
+ function registerServiceWorker() {
91
91
  // Self-updating service worker (v0.4.159). A new SW postMessages
92
92
  // 'sw-updated' (and triggers controllerchange) when it takes over; reload
93
93
  // once so users do not stay on stale index.html/app.js after an upgrade.
94
- if (!('serviceWorker' in navigator)) return;
95
- let swReloaded = false;
96
- const reloadOnce = () => {
97
- if (!swReloaded) {
98
- swReloaded = true;
99
- location.reload();
94
+ if (!('serviceWorker' in navigator)) return;
95
+ // A first-time install also emits `controllerchange` after clients.claim().
96
+ // Reloading in that case resets focus and any in-progress input for no gain:
97
+ // this page already came from the current server. Only an already-controlled
98
+ // page needs a reload when a replacement worker takes over.
99
+ const hadController = Boolean(navigator.serviceWorker.controller);
100
+ let swReloaded = false;
101
+ const reloadOnce = () => {
102
+ if (hadController && !swReloaded) {
103
+ swReloaded = true;
104
+ location.reload();
100
105
  }
101
106
  };
102
107
  navigator.serviceWorker.addEventListener('message', (e) => {
@@ -24,6 +24,7 @@ import {
24
24
  sessionSearchInput, toolsSearchInput, sessionTabsListEl, btnAddTab,
25
25
  dashboardPanel, btnDashboardRefresh,
26
26
  } from './dom.js';
27
+ import { setupSidebarTabs } from './sidebar-tabs.js';
27
28
 
28
29
  // ── Configure marked.js ────────────────────────────────────────────
29
30
 
@@ -1654,42 +1655,9 @@ if (sessionSearchInput) {
1654
1655
 
1655
1656
  // ── Sidebar tabs ──────────────────────────────────────────────────────
1656
1657
 
1657
- let fileTreeLoaded = false;
1658
-
1659
- function switchSidebarTab(tabName) {
1660
- document.querySelectorAll('.sidebar-tab').forEach(btn => {
1661
- const active = btn.dataset.tab === tabName;
1662
- btn.classList.toggle('active', active);
1663
- btn.setAttribute('aria-selected', String(active));
1664
- btn.tabIndex = active ? 0 : -1;
1665
- });
1666
- document.querySelectorAll('.sidebar-tab-content').forEach(el => {
1667
- const active = el.id === `tab-${tabName}`;
1668
- el.classList.toggle('hidden', !active);
1669
- el.setAttribute('aria-hidden', String(!active));
1670
- });
1671
- // Lazy-init file tree on first visit
1672
- if (tabName === 'files' && !fileTreeLoaded) {
1673
- fileTreeLoaded = true;
1674
- initFileTree();
1675
- }
1676
- if (tabName === 'dashboard') renderDashboard();
1677
- }
1678
-
1679
- const sidebarTabs = [...document.querySelectorAll('.sidebar-tab')];
1680
- sidebarTabs.forEach((btn, index) => {
1681
- btn.addEventListener('click', () => switchSidebarTab(btn.dataset.tab));
1682
- btn.addEventListener('keydown', (event) => {
1683
- let target = index;
1684
- if (event.key === 'ArrowRight') target = (index + 1) % sidebarTabs.length;
1685
- else if (event.key === 'ArrowLeft') target = (index - 1 + sidebarTabs.length) % sidebarTabs.length;
1686
- else if (event.key === 'Home') target = 0;
1687
- else if (event.key === 'End') target = sidebarTabs.length - 1;
1688
- else return;
1689
- event.preventDefault();
1690
- sidebarTabs[target].focus();
1691
- switchSidebarTab(sidebarTabs[target].dataset.tab);
1692
- });
1658
+ const switchSidebarTab = setupSidebarTabs({
1659
+ onFilesFirstVisit: initFileTree,
1660
+ onDashboard: renderDashboard,
1693
1661
  });
1694
1662
  btnDashboardRefresh?.addEventListener('click', () => {
1695
1663
  send({ type: 'command', name: 'status', args: [] });
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Accessible sidebar tab state machine.
3
+ *
4
+ * Kept independent from app.js so click/keyboard/ARIA state transitions have
5
+ * one owner and can be tested without the rest of the chat application.
6
+ */
7
+ export function setupSidebarTabs({ onFilesFirstVisit, onDashboard }) {
8
+ const tabs = [...document.querySelectorAll('.sidebar-tab')];
9
+ let fileTreeLoaded = false;
10
+
11
+ function switchTo(tabName) {
12
+ tabs.forEach((button) => {
13
+ const active = button.dataset.tab === tabName;
14
+ button.classList.toggle('active', active);
15
+ button.setAttribute('aria-selected', String(active));
16
+ button.tabIndex = active ? 0 : -1;
17
+ });
18
+ document.querySelectorAll('.sidebar-tab-content').forEach((panel) => {
19
+ const active = panel.id === `tab-${tabName}`;
20
+ panel.classList.toggle('hidden', !active);
21
+ panel.setAttribute('aria-hidden', String(!active));
22
+ });
23
+
24
+ if (tabName === 'files' && !fileTreeLoaded) {
25
+ fileTreeLoaded = true;
26
+ onFilesFirstVisit();
27
+ }
28
+ if (tabName === 'dashboard') onDashboard();
29
+ }
30
+
31
+ tabs.forEach((button, index) => {
32
+ button.addEventListener('click', () => switchTo(button.dataset.tab));
33
+ button.addEventListener('keydown', (event) => {
34
+ let target = index;
35
+ if (event.key === 'ArrowRight') target = (index + 1) % tabs.length;
36
+ else if (event.key === 'ArrowLeft') target = (index - 1 + tabs.length) % tabs.length;
37
+ else if (event.key === 'Home') target = 0;
38
+ else if (event.key === 'End') target = tabs.length - 1;
39
+ else return;
40
+
41
+ event.preventDefault();
42
+ tabs[target].focus();
43
+ switchTo(tabs[target].dataset.tab);
44
+ });
45
+ });
46
+
47
+ return switchTo;
48
+ }
@@ -16,7 +16,7 @@ const CACHE_NAME = 'aicli-v3';
16
16
  // HTML/JS that must always be fresh — never served from the SW cache, so an
17
17
  // upgraded server is reflected on the very next load. Other assets (vendored
18
18
  // CSS/JS, icons) are large + content-stable and fine to cache.
19
- const NEVER_CACHE = new Set(['/', '/index.html', '/state.js', '/util.js', '/dom.js', '/app.js', '/templates.js', '/actions.js']);
19
+ const NEVER_CACHE = new Set(['/', '/index.html', '/state.js', '/util.js', '/dom.js', '/app.js', '/sidebar-tabs.js', '/templates.js', '/actions.js']);
20
20
 
21
21
  // App shell to precache (offline-capable startup). Deliberately EXCLUDES the
22
22
  // always-fresh HTML/JS in NEVER_CACHE — only large content-stable assets.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.260",
3
+ "version": "0.4.262",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",