jinzd-ai-cli 0.4.261 → 0.4.263
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.
- package/README.md +29 -22
- package/README.zh-CN.md +32 -25
- package/THIRD_PARTY_NOTICES.md +88 -0
- package/dist/{batch-YUPAC4CK.js → batch-AN47AYCZ.js} +2 -2
- package/dist/{chunk-XZNRZGG2.js → chunk-3OBY7WSS.js} +1 -0
- package/dist/{chunk-R6DXWVVN.js → chunk-3RHY2HF7.js} +1 -1
- package/dist/{chunk-T7R7ILYT.js → chunk-5K2LFD7D.js} +1 -1
- package/dist/{chunk-KFNQESEG.js → chunk-7YCA2BD3.js} +1 -1
- package/dist/{chunk-NOB2OPQI.js → chunk-B27MLWFJ.js} +4 -4
- package/dist/{chunk-HU3IYBU5.js → chunk-GKI7B4BD.js} +7 -6
- package/dist/{chunk-Z5TCAE4L.js → chunk-GMZTY7DA.js} +4 -4
- package/dist/{chunk-GC4KA5LF.js → chunk-MJICIIBW.js} +1 -1
- package/dist/{chunk-YXMBP567.js → chunk-MTZ6XHJD.js} +2 -2
- package/dist/{chunk-DQY2DDGS.js → chunk-QG4NG7KJ.js} +1 -1
- package/dist/{chunk-W5XUZYQE.js → chunk-QMB7QYZC.js} +1 -1
- package/dist/{chunk-OIOTHBDB.js → chunk-TL5MD5XU.js} +49 -25
- package/dist/{chunk-323S2X5I.js → chunk-VKBGOFEO.js} +1 -1
- package/dist/{chunk-HGTDI5ME.js → chunk-VUZAKIZ5.js} +1 -1
- package/dist/{chunk-H6FND2UG.js → chunk-WM4VTGAF.js} +3 -1
- package/dist/{chunk-KQQHMGK7.js → chunk-XST4N2JM.js} +1 -1
- package/dist/{chunk-EZ6QLHOS.js → chunk-YRD6M5XI.js} +30 -5
- package/dist/{ci-FX26BNT2.js → ci-JTO7LN5S.js} +6 -6
- package/dist/{ci-format-GEWIAIZD.js → ci-format-2VGHOLBA.js} +2 -2
- package/dist/{constants-YN4B6C7B.js → constants-HLSJL5HQ.js} +1 -1
- package/dist/{doctor-cli-PXGXZYQB.js → doctor-cli-JML4FGH4.js} +6 -6
- package/dist/electron-server.js +112 -41
- package/dist/{hub-RCANK6SK.js → hub-6EYFGJRT.js} +1 -1
- package/dist/index.js +107 -58
- package/dist/{persistent-memory-P3COUZZM.js → persistent-memory-ANIMO5CF.js} +2 -2
- package/dist/{persistent-memory-UARSSYAA.js → persistent-memory-MPBPSZDN.js} +2 -2
- package/dist/{pr-7LQTAUFK.js → pr-XE7NGT6U.js} +6 -6
- package/dist/{run-tests-YNHESHYY.js → run-tests-ME5KED57.js} +2 -2
- package/dist/{run-tests-7RYU4BK5.js → run-tests-TF7UPUWW.js} +2 -2
- package/dist/{server-YZ37TL46.js → server-BIYJEJK3.js} +6 -6
- package/dist/{server-SSAWGNT7.js → server-VKA4FR2Z.js} +38 -19
- package/dist/{task-orchestrator-ZFL4E6NZ.js → task-orchestrator-2RAKLFWN.js} +6 -6
- package/dist/{usage-PDKM7J75.js → usage-5F5Q3GGR.js} +4 -4
- package/dist/web/client/actions.js +12 -7
- package/dist/web/client/app.js +5 -37
- package/dist/web/client/sidebar-tabs.js +48 -0
- package/dist/web/client/sw.js +1 -1
- package/package.json +13 -10
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
scanDirTree,
|
|
24
24
|
scanProject,
|
|
25
25
|
setupProxy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MTZ6XHJD.js";
|
|
27
27
|
import {
|
|
28
28
|
computeCost,
|
|
29
29
|
formatCost,
|
|
30
30
|
getPricing
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-YRD6M5XI.js";
|
|
32
32
|
import {
|
|
33
33
|
buildReviewPrompt,
|
|
34
34
|
buildSecurityReviewPrompt
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
spawnAgentContext,
|
|
65
65
|
truncateOutput,
|
|
66
66
|
undoStack
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-GKI7B4BD.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-
|
|
81
|
+
} from "./chunk-VUZAKIZ5.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-
|
|
94
|
+
} from "./chunk-B27MLWFJ.js";
|
|
95
95
|
import {
|
|
96
96
|
ProviderRegistry
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-TL5MD5XU.js";
|
|
98
98
|
import {
|
|
99
99
|
ConfigManager
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-WM4VTGAF.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-
|
|
115
|
+
} from "./chunk-QMB7QYZC.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-
|
|
132
|
+
} from "./chunk-3OBY7WSS.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-
|
|
140
|
+
import "./chunk-XST4N2JM.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-
|
|
156
|
+
} from "./chunk-VKBGOFEO.js";
|
|
157
157
|
import "./chunk-6RPGQ5CG.js";
|
|
158
158
|
import "./chunk-KHYD3WXE.js";
|
|
159
159
|
import "./chunk-NYNSYLFY.js";
|
|
@@ -752,11 +752,24 @@ async function handleModel(args, ctx) {
|
|
|
752
752
|
ctx.sendStatus();
|
|
753
753
|
}
|
|
754
754
|
async function handleThink(args, ctx) {
|
|
755
|
-
const sub = args[0];
|
|
755
|
+
const sub = args[0]?.toLowerCase() ?? "toggle";
|
|
756
|
+
if (sub === "status") {
|
|
757
|
+
ctx.send({
|
|
758
|
+
type: "info",
|
|
759
|
+
message: `Thinking mode: ${ctx.runtimeThinking === null ? "CONFIG" : ctx.runtimeThinking ? "ON" : "OFF"}; effort: ${ctx.runtimeThinkingEffort ?? "config/default (high for DeepSeek V4)"}`
|
|
760
|
+
});
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
756
763
|
if (sub === "on") ctx.runtimeThinking = true;
|
|
757
764
|
else if (sub === "off") ctx.runtimeThinking = false;
|
|
758
|
-
else
|
|
759
|
-
|
|
765
|
+
else if (sub === "low" || sub === "high" || sub === "max") {
|
|
766
|
+
ctx.runtimeThinking = true;
|
|
767
|
+
ctx.runtimeThinkingEffort = sub;
|
|
768
|
+
} else ctx.runtimeThinking = ctx.runtimeThinking !== true;
|
|
769
|
+
ctx.send({
|
|
770
|
+
type: "info",
|
|
771
|
+
message: `Thinking mode: ${ctx.runtimeThinking ? "ON" : "OFF"}${ctx.runtimeThinking ? ` (${ctx.runtimeThinkingEffort ?? "high"})` : ""}`
|
|
772
|
+
});
|
|
760
773
|
ctx.sendStatus();
|
|
761
774
|
}
|
|
762
775
|
async function handlePlan(args, ctx) {
|
|
@@ -815,7 +828,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
815
828
|
Cost: ${formatCost(cost)}` : "";
|
|
816
829
|
let memoryLine = "";
|
|
817
830
|
try {
|
|
818
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
831
|
+
const { countPendingMemories } = await import("./persistent-memory-MPBPSZDN.js");
|
|
819
832
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
820
833
|
if (pending > 0) memoryLine = `
|
|
821
834
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -1624,14 +1637,14 @@ async function handleSecurityReview(args, ctx) {
|
|
|
1624
1637
|
async function handleTest(args, ctx) {
|
|
1625
1638
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1626
1639
|
try {
|
|
1627
|
-
const { executeTests } = await import("./run-tests-YNHESHYY.js");
|
|
1628
1640
|
const argStr = args.join(" ").trim();
|
|
1629
1641
|
let testArgs = {};
|
|
1630
1642
|
if (argStr) {
|
|
1631
1643
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
1632
1644
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
1633
1645
|
}
|
|
1634
|
-
const
|
|
1646
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-ME5KED57.js")).executeTests;
|
|
1647
|
+
const report = await runTests(testArgs);
|
|
1635
1648
|
ctx.send({ type: "info", message: report });
|
|
1636
1649
|
} catch (err) {
|
|
1637
1650
|
ctx.send({ type: "error", message: `Test failed: ${err.message}` });
|
|
@@ -1888,7 +1901,7 @@ async function handleMemory(args, ctx) {
|
|
|
1888
1901
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
1889
1902
|
} else if (sub === "export") {
|
|
1890
1903
|
if (args[1] === "md") {
|
|
1891
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
1904
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-MPBPSZDN.js");
|
|
1892
1905
|
ctx.send({
|
|
1893
1906
|
type: "export_data",
|
|
1894
1907
|
format: "md",
|
|
@@ -2319,6 +2332,7 @@ var SessionHandler = class {
|
|
|
2319
2332
|
currentModel;
|
|
2320
2333
|
planMode = false;
|
|
2321
2334
|
runtimeThinking = null;
|
|
2335
|
+
runtimeThinkingEffort = null;
|
|
2322
2336
|
sessionTokenUsage = { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
|
|
2323
2337
|
unknownPricingWarnings = /* @__PURE__ */ new Set();
|
|
2324
2338
|
/** Accumulate a TokenUsage (with optional cache fields) into sessionTokenUsage. */
|
|
@@ -2457,7 +2471,8 @@ var SessionHandler = class {
|
|
|
2457
2471
|
cwd: process.cwd(),
|
|
2458
2472
|
messageCount: this.sessions.current?.messages.length ?? 0,
|
|
2459
2473
|
planMode: this.planMode,
|
|
2460
|
-
thinkingMode: this.
|
|
2474
|
+
thinkingMode: this.getModelParams().thinking ?? false,
|
|
2475
|
+
thinkingEffort: this.runtimeThinkingEffort ?? this.getModelParams().thinkingEffort,
|
|
2461
2476
|
permissionProfile: this.config.get("defaultPermissionProfile") ?? "legacy",
|
|
2462
2477
|
tokenUsage: { ...this.sessionTokenUsage },
|
|
2463
2478
|
costUsd,
|
|
@@ -2822,6 +2837,7 @@ var SessionHandler = class {
|
|
|
2822
2837
|
maxTokens: modelParams.maxTokens,
|
|
2823
2838
|
timeout: modelParams.timeout,
|
|
2824
2839
|
thinking: modelParams.thinking,
|
|
2840
|
+
thinkingEffort: modelParams.thinkingEffort,
|
|
2825
2841
|
thinkingBudget: modelParams.thinkingBudget,
|
|
2826
2842
|
signal: ac.signal
|
|
2827
2843
|
});
|
|
@@ -2896,6 +2912,7 @@ ${mcpBudgetNote}` : "");
|
|
|
2896
2912
|
maxTokens: modelParams.maxTokens,
|
|
2897
2913
|
timeout: modelParams.timeout,
|
|
2898
2914
|
thinking: modelParams.thinking,
|
|
2915
|
+
thinkingEffort: modelParams.thinkingEffort,
|
|
2899
2916
|
thinkingBudget: modelParams.thinkingBudget,
|
|
2900
2917
|
signal: ac.signal,
|
|
2901
2918
|
...extraMessages.length > 0 ? { _extraMessages: extraMessages } : {}
|
|
@@ -3212,6 +3229,7 @@ ${summaryContent}`,
|
|
|
3212
3229
|
maxTokens: modelParams.maxTokens,
|
|
3213
3230
|
timeout: modelParams.timeout,
|
|
3214
3231
|
thinking: modelParams.thinking,
|
|
3232
|
+
thinkingEffort: modelParams.thinkingEffort,
|
|
3215
3233
|
thinkingBudget: modelParams.thinkingBudget,
|
|
3216
3234
|
signal: ac.signal,
|
|
3217
3235
|
_extraMessages: teeExtraMessages
|
|
@@ -3746,6 +3764,7 @@ Backup saved: ${result.backupPath}` : "";
|
|
|
3746
3764
|
...params,
|
|
3747
3765
|
maxTokens: params.maxTokens ?? DEFAULT_MAX_TOKENS,
|
|
3748
3766
|
thinking: this.runtimeThinking ?? params.thinking,
|
|
3767
|
+
thinkingEffort: this.runtimeThinkingEffort ?? params.thinkingEffort,
|
|
3749
3768
|
thinkingBudget: params.thinkingBudget
|
|
3750
3769
|
};
|
|
3751
3770
|
}
|
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-GKI7B4BD.js";
|
|
7
|
+
import "./chunk-VUZAKIZ5.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-
|
|
14
|
+
} from "./chunk-QMB7QYZC.js";
|
|
15
15
|
import {
|
|
16
16
|
getDangerLevel,
|
|
17
17
|
runLeanAgentLoop
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3OBY7WSS.js";
|
|
19
19
|
import "./chunk-TU3L3PW7.js";
|
|
20
20
|
import "./chunk-HOSJZMQS.js";
|
|
21
21
|
import "./chunk-4BKXL7SM.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-XST4N2JM.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBAGENT_ALLOWED_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-VKBGOFEO.js";
|
|
26
26
|
import "./chunk-6RPGQ5CG.js";
|
|
27
27
|
import "./chunk-KHYD3WXE.js";
|
|
28
28
|
import "./chunk-NYNSYLFY.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CostTracker
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QG4NG7KJ.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCost,
|
|
7
7
|
getPricing
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YRD6M5XI.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WM4VTGAF.js";
|
|
12
12
|
import "./chunk-TU3L3PW7.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-VKBGOFEO.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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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) => {
|
package/dist/web/client/app.js
CHANGED
|
@@ -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
|
|
|
@@ -570,7 +571,7 @@ function renderDashboard() {
|
|
|
570
571
|
${dashRow('Session', s.sessionTitle || (s.sessionId ? s.sessionId.slice(0, 8) : '-'))}
|
|
571
572
|
${dashRow('Provider', `${s.provider || '-'} / ${s.model || '-'}`)}
|
|
572
573
|
${dashRow('Messages', String(s.messageCount ?? 0))}
|
|
573
|
-
${dashRow('Mode', `${s.planMode ? 'plan' : 'execute'}${s.thinkingMode ?
|
|
574
|
+
${dashRow('Mode', `${s.planMode ? 'plan' : 'execute'}${s.thinkingMode ? ` · thinking:${s.thinkingEffort || 'high'}` : ''}${s.autoMode ? ' · auto' : ''}`)}
|
|
574
575
|
</section>
|
|
575
576
|
<section class="dashboard-section">
|
|
576
577
|
<div class="dashboard-section-title">Approvals <span class="confirm-queue-count">${pending.length}</span></div>
|
|
@@ -1654,42 +1655,9 @@ if (sessionSearchInput) {
|
|
|
1654
1655
|
|
|
1655
1656
|
// ── Sidebar tabs ──────────────────────────────────────────────────────
|
|
1656
1657
|
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
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
|
+
}
|
package/dist/web/client/sw.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "0.4.263",
|
|
4
4
|
"description": "Cross-platform REPL-style AI CLI with multi-provider support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,10 +60,12 @@
|
|
|
60
60
|
"node": ">=20.18.1"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|
|
63
|
-
"dist/*.js",
|
|
64
|
-
"dist/web/",
|
|
65
|
-
"dist/wasm/",
|
|
66
|
-
"README.md"
|
|
63
|
+
"dist/*.js",
|
|
64
|
+
"dist/web/",
|
|
65
|
+
"dist/wasm/",
|
|
66
|
+
"README.md",
|
|
67
|
+
"README.zh-CN.md",
|
|
68
|
+
"THIRD_PARTY_NOTICES.md"
|
|
67
69
|
],
|
|
68
70
|
"keywords": [
|
|
69
71
|
"ai",
|
|
@@ -117,7 +119,7 @@
|
|
|
117
119
|
"@typescript-eslint/parser": "^8.13.0",
|
|
118
120
|
"@vitest/coverage-v8": "3.2.7",
|
|
119
121
|
"@yao-pkg/pkg": "^6.22.0",
|
|
120
|
-
"electron": "^41.4
|
|
122
|
+
"electron": "^41.10.4",
|
|
121
123
|
"electron-builder": "^26.15.3",
|
|
122
124
|
"eslint": "^9.13.0",
|
|
123
125
|
"tsup": "^8.3.5",
|
|
@@ -125,10 +127,11 @@
|
|
|
125
127
|
"typescript": "^5.7.3",
|
|
126
128
|
"vitest": "3.2.7"
|
|
127
129
|
},
|
|
128
|
-
"overrides": {
|
|
129
|
-
"adm-zip": "0.6.0",
|
|
130
|
-
"esbuild": "0.28.1",
|
|
131
|
-
"
|
|
130
|
+
"overrides": {
|
|
131
|
+
"adm-zip": "0.6.0",
|
|
132
|
+
"esbuild": "0.28.1",
|
|
133
|
+
"nanoid": "3.3.18",
|
|
134
|
+
"sharp": "0.35.0"
|
|
132
135
|
},
|
|
133
136
|
"author": "jinzd",
|
|
134
137
|
"build": {
|