jinzd-ai-cli 0.4.218 → 0.4.219
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 +1 -0
- package/dist/{batch-7V7OTMUP.js → batch-CHAPYRVM.js} +2 -2
- package/dist/chunk-3I4RZYYO.js +638 -0
- package/dist/{chunk-L4UREAID.js → chunk-4ZN6L6K5.js} +3 -3
- package/dist/{chunk-VGFTM3XT.js → chunk-64NUW3WL.js} +1 -1
- package/dist/{chunk-C2Z42DI5.js → chunk-EGMORH5W.js} +1 -1
- package/dist/{chunk-GX3HSGJX.js → chunk-GEN4O5QH.js} +165 -637
- package/dist/chunk-GGKQHPB3.js +604 -0
- package/dist/{chunk-P4VBLXKS.js → chunk-KIEZBTVD.js} +1 -1
- package/dist/{chunk-H2UIHGHH.js → chunk-QUFYBR6Q.js} +29 -189
- package/dist/{chunk-NTCB7CMT.js → chunk-U7KVU25H.js} +1 -1
- package/dist/{chunk-5CA2TJ5F.js → chunk-VADHBW7T.js} +1 -1
- package/dist/{ci-L6GH2WVC.js → ci-QPP66T53.js} +4 -4
- package/dist/{ci-format-WW7454AY.js → ci-format-5S3EEYRK.js} +2 -2
- package/dist/{constants-NCTFSHDU.js → constants-FJOLBABC.js} +1 -1
- package/dist/doctor-cli-KB2LUDF3.js +17 -0
- package/dist/electron-server.js +419 -116
- package/dist/{hub-CDL6T7CP.js → hub-DIM7SKKY.js} +1 -1
- package/dist/index.js +71 -181
- package/dist/{pr-D6PEKEGK.js → pr-YQGH72N6.js} +4 -4
- package/dist/{run-tests-SWU2XEV7.js → run-tests-GEZSSNJM.js} +2 -2
- package/dist/{run-tests-NXVVKAK2.js → run-tests-O76JIBCW.js} +1 -1
- package/dist/{server-LHYSS6CK.js → server-5E2AIXVX.js} +39 -75
- package/dist/{server-WUT7VYTD.js → server-Z6O3G2LY.js} +9 -9
- package/dist/{task-orchestrator-C5AA2BI5.js → task-orchestrator-5HBW4O64.js} +9 -9
- package/dist/{usage-6ZUUJBI2.js → usage-BMK6M5U3.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-MWKE2TNS.js +0 -129
- package/dist/chunk-OUC75QCF.js +0 -166
- package/dist/doctor-cli-EWMFBP5Q.js +0 -226
|
@@ -154,7 +154,7 @@ ${content}`);
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
157
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
157
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-5HBW4O64.js");
|
|
158
158
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
159
159
|
let interrupted = false;
|
|
160
160
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
autoTrimSessionIfNeeded,
|
|
7
7
|
buildInitPrompt,
|
|
8
8
|
clearDevState,
|
|
9
|
-
loadContextFiles,
|
|
10
9
|
loadDevState,
|
|
11
10
|
parseSimpleYaml,
|
|
12
11
|
persistToolRound,
|
|
@@ -15,7 +14,7 @@ import {
|
|
|
15
14
|
scanProject,
|
|
16
15
|
sessionHasMeaningfulContent,
|
|
17
16
|
setupProxy
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QUFYBR6Q.js";
|
|
19
18
|
import {
|
|
20
19
|
buildReviewPrompt,
|
|
21
20
|
buildSecurityReviewPrompt
|
|
@@ -28,48 +27,35 @@ import {
|
|
|
28
27
|
cleanupRejectedTeeFile,
|
|
29
28
|
clearRecentlyDeniedAutoActions,
|
|
30
29
|
deleteMemoryEntry,
|
|
31
|
-
describePlugin,
|
|
32
30
|
estimateTokens,
|
|
33
31
|
expireMemoryEntry,
|
|
34
32
|
exportMemoryEntries,
|
|
35
33
|
formatMemoryForPrompt,
|
|
36
34
|
formatPermissionProfileWarning,
|
|
37
|
-
getActivePluginAssets,
|
|
38
|
-
getInstalledPlugin,
|
|
39
|
-
getPendingHookTrust,
|
|
40
35
|
getRecentlyDeniedAutoActions,
|
|
41
36
|
googleSearchContext,
|
|
42
37
|
initTheme,
|
|
43
|
-
installPlugin,
|
|
44
38
|
isInterrupted,
|
|
45
39
|
isMemoryExpired,
|
|
46
40
|
lastResponseStore,
|
|
47
|
-
listHooks,
|
|
48
|
-
listInstalledPlugins,
|
|
49
41
|
listMemoryEntries,
|
|
50
42
|
memoryMarkdownPath,
|
|
51
43
|
memoryStorePath,
|
|
52
|
-
mergePluginHooks,
|
|
53
|
-
pluginRoot,
|
|
54
44
|
renderDiff,
|
|
55
45
|
requestInterrupt,
|
|
56
46
|
resetInterrupt,
|
|
57
47
|
rlInternal,
|
|
58
|
-
runLifecycleHooks,
|
|
59
48
|
setContextWindow,
|
|
60
49
|
setMaxOutputCap,
|
|
61
|
-
setPluginEnabled,
|
|
62
50
|
spawnAgentContext,
|
|
63
51
|
theme,
|
|
64
|
-
trustHook,
|
|
65
|
-
trustPlugin,
|
|
66
52
|
undoStack,
|
|
67
|
-
untrustHook,
|
|
68
53
|
updateMemoryApproval
|
|
69
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-GEN4O5QH.js";
|
|
55
|
+
import "./chunk-K3CF65QH.js";
|
|
70
56
|
import "./chunk-T2NL5ZIA.js";
|
|
71
57
|
import "./chunk-BXP6YZ2P.js";
|
|
72
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-64NUW3WL.js";
|
|
73
59
|
import {
|
|
74
60
|
SessionManager,
|
|
75
61
|
getContentText
|
|
@@ -83,19 +69,45 @@ import {
|
|
|
83
69
|
getPricing
|
|
84
70
|
} from "./chunk-E44DTERW.js";
|
|
85
71
|
import {
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
fileCheckpoints
|
|
73
|
+
} from "./chunk-4BKXL7SM.js";
|
|
74
|
+
import {
|
|
75
|
+
buildChatIndex,
|
|
76
|
+
clearChatIndex,
|
|
77
|
+
getChatIndexStatus,
|
|
78
|
+
searchChatMemory
|
|
79
|
+
} from "./chunk-TB4W4Y4T.js";
|
|
80
|
+
import "./chunk-KHYD3WXE.js";
|
|
81
|
+
import {
|
|
82
|
+
DEFAULT_PATTERNS,
|
|
83
|
+
scanString
|
|
84
|
+
} from "./chunk-SLSWPBK3.js";
|
|
85
|
+
import {
|
|
86
|
+
buildDoctorReport,
|
|
87
|
+
formatDoctorReport,
|
|
88
|
+
loadContextFiles,
|
|
88
89
|
writeCrashLog
|
|
89
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-3I4RZYYO.js";
|
|
90
91
|
import {
|
|
91
92
|
ProviderRegistry
|
|
92
93
|
} from "./chunk-QMXC327F.js";
|
|
93
94
|
import {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
describePlugin,
|
|
96
|
+
getActivePluginAssets,
|
|
97
|
+
getInstalledPlugin,
|
|
98
|
+
getPendingHookTrust,
|
|
99
|
+
installFlushOnExit,
|
|
100
|
+
installPlugin,
|
|
101
|
+
listHooks,
|
|
102
|
+
listInstalledPlugins,
|
|
103
|
+
mergePluginHooks,
|
|
104
|
+
pluginRoot,
|
|
105
|
+
runLifecycleHooks,
|
|
106
|
+
setPluginEnabled,
|
|
107
|
+
trustHook,
|
|
108
|
+
trustPlugin,
|
|
109
|
+
untrustHook
|
|
110
|
+
} from "./chunk-GGKQHPB3.js";
|
|
99
111
|
import {
|
|
100
112
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
101
113
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -117,7 +129,7 @@ import {
|
|
|
117
129
|
} from "./chunk-XPBEJB27.js";
|
|
118
130
|
import {
|
|
119
131
|
ConfigManager
|
|
120
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-KIEZBTVD.js";
|
|
121
133
|
import {
|
|
122
134
|
AuthError,
|
|
123
135
|
ProviderError,
|
|
@@ -135,34 +147,18 @@ import {
|
|
|
135
147
|
DESCRIPTION,
|
|
136
148
|
DEV_STATE_FILE_NAME,
|
|
137
149
|
MCP_PROJECT_CONFIG_NAME,
|
|
138
|
-
MEMORY_FILE_NAME,
|
|
139
150
|
PLAN_MODE_READONLY_TOOLS,
|
|
140
151
|
PLAN_MODE_SYSTEM_ADDON,
|
|
141
152
|
REPO_URL,
|
|
142
153
|
SKILLS_DIR_NAME,
|
|
143
154
|
VERSION,
|
|
144
155
|
buildUserIdentityPrompt
|
|
145
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-U7KVU25H.js";
|
|
146
157
|
import {
|
|
147
158
|
formatGitContextForPrompt,
|
|
148
159
|
getGitContext,
|
|
149
160
|
getGitRoot
|
|
150
161
|
} from "./chunk-HOSJZMQS.js";
|
|
151
|
-
import {
|
|
152
|
-
fileCheckpoints
|
|
153
|
-
} from "./chunk-4BKXL7SM.js";
|
|
154
|
-
import {
|
|
155
|
-
buildChatIndex,
|
|
156
|
-
clearChatIndex,
|
|
157
|
-
getChatIndexStatus,
|
|
158
|
-
searchChatMemory
|
|
159
|
-
} from "./chunk-TB4W4Y4T.js";
|
|
160
|
-
import "./chunk-KHYD3WXE.js";
|
|
161
|
-
import {
|
|
162
|
-
DEFAULT_PATTERNS,
|
|
163
|
-
scanString
|
|
164
|
-
} from "./chunk-SLSWPBK3.js";
|
|
165
|
-
import "./chunk-K3CF65QH.js";
|
|
166
162
|
import "./chunk-CKH4KQ4E.js";
|
|
167
163
|
import {
|
|
168
164
|
atomicWriteFileSync
|
|
@@ -173,7 +169,7 @@ import { program } from "commander";
|
|
|
173
169
|
|
|
174
170
|
// src/repl/repl.ts
|
|
175
171
|
import * as readline from "readline";
|
|
176
|
-
import { existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as
|
|
172
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync2, mkdirSync as mkdirSync4 } from "fs";
|
|
177
173
|
import { join as join4, resolve as resolve2, extname as extname2, dirname as dirname3, basename as basename2 } from "path";
|
|
178
174
|
import chalk4 from "chalk";
|
|
179
175
|
|
|
@@ -666,7 +662,7 @@ Error${typeName}: ${lines.join("\n")}
|
|
|
666
662
|
};
|
|
667
663
|
|
|
668
664
|
// src/repl/commands/index.ts
|
|
669
|
-
import { writeFileSync, mkdirSync as mkdirSync2, existsSync as existsSync2, readFileSync
|
|
665
|
+
import { writeFileSync, mkdirSync as mkdirSync2, existsSync as existsSync2, readFileSync } from "fs";
|
|
670
666
|
import { execSync as execSync2 } from "child_process";
|
|
671
667
|
import { platform } from "os";
|
|
672
668
|
import { resolve, dirname as dirname2, join as join2, basename } from "path";
|
|
@@ -1765,7 +1761,7 @@ No tools match "${filter}".
|
|
|
1765
1761
|
const { join: join5 } = await import("path");
|
|
1766
1762
|
const { existsSync: existsSync5 } = await import("fs");
|
|
1767
1763
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1768
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1764
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-FJOLBABC.js");
|
|
1769
1765
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1770
1766
|
const cwd = process.cwd();
|
|
1771
1767
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2824,7 +2820,7 @@ ${hint}` : "")
|
|
|
2824
2820
|
usage: "/test [command|filter]",
|
|
2825
2821
|
async execute(args, ctx) {
|
|
2826
2822
|
try {
|
|
2827
|
-
const { executeTests } = await import("./run-tests-
|
|
2823
|
+
const { executeTests } = await import("./run-tests-GEZSSNJM.js");
|
|
2828
2824
|
const argStr = args.join(" ").trim();
|
|
2829
2825
|
let testArgs = {};
|
|
2830
2826
|
if (argStr) {
|
|
@@ -3185,126 +3181,16 @@ ${hint}` : "")
|
|
|
3185
3181
|
// ── /doctor ────────────────────────────────────────────────────────────────
|
|
3186
3182
|
{
|
|
3187
3183
|
name: "doctor",
|
|
3188
|
-
description: "Health check:
|
|
3184
|
+
description: "Health check: context, permissions, hooks, plugins, MCP, config",
|
|
3189
3185
|
usage: "/doctor",
|
|
3190
3186
|
execute(_args, ctx) {
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
}
|
|
3199
|
-
console.log();
|
|
3200
|
-
const configDir = ctx.config.getConfigDir();
|
|
3201
|
-
console.log(theme.heading("Config Files:"));
|
|
3202
|
-
console.log(` Dir: ${theme.accent(configDir)}`);
|
|
3203
|
-
const checkFile = (label, filePath) => {
|
|
3204
|
-
const exists = existsSync2(filePath);
|
|
3205
|
-
const icon = exists ? theme.success("\u2713") : theme.dim("\u2013");
|
|
3206
|
-
let extra = "";
|
|
3207
|
-
if (exists) {
|
|
3208
|
-
try {
|
|
3209
|
-
extra = theme.dim(` (${statSync2(filePath).size} bytes)`);
|
|
3210
|
-
} catch {
|
|
3211
|
-
}
|
|
3212
|
-
}
|
|
3213
|
-
console.log(` ${icon} ${label.padEnd(14)} ${exists ? filePath : theme.dim("(not found)")}${extra}`);
|
|
3214
|
-
};
|
|
3215
|
-
checkFile("config.json", join2(configDir, "config.json"));
|
|
3216
|
-
checkFile("memory.md", join2(configDir, MEMORY_FILE_NAME));
|
|
3217
|
-
checkFile("dev-state.md", join2(configDir, "dev-state.md"));
|
|
3218
|
-
console.log();
|
|
3219
|
-
const mcpManager = ctx.getMcpManager();
|
|
3220
|
-
if (mcpManager) {
|
|
3221
|
-
console.log(theme.heading("MCP Servers:"));
|
|
3222
|
-
const statuses = mcpManager.getStatus();
|
|
3223
|
-
if (statuses.length === 0) {
|
|
3224
|
-
console.log(theme.dim(" (no servers configured)"));
|
|
3225
|
-
} else {
|
|
3226
|
-
for (const s of statuses) {
|
|
3227
|
-
const icon = s.connected ? theme.success(" \u2713") : theme.error(" \u2717");
|
|
3228
|
-
const state = s.connected ? theme.success(`connected`) + theme.dim(` \xB7 ${s.serverName} \xB7 ${s.toolCount} tools`) : theme.error("disconnected") + (s.error ? theme.dim(` \xB7 ${s.error}`) : "");
|
|
3229
|
-
console.log(`${icon} ${s.serverId.padEnd(16)} ${state}`);
|
|
3230
|
-
}
|
|
3231
|
-
}
|
|
3232
|
-
console.log();
|
|
3233
|
-
}
|
|
3234
|
-
const provider = ctx.getCurrentProvider();
|
|
3235
|
-
const model = ctx.getCurrentModel();
|
|
3236
|
-
const ctxTokens = ctx.estimateConversationTokens();
|
|
3237
|
-
const ctxWindow = ctx.getContextWindowSize();
|
|
3238
|
-
const pct = ctxWindow > 0 ? Math.round(ctxTokens / ctxWindow * 100) : 0;
|
|
3239
|
-
const pctColor = pct > 80 ? theme.error : pct > 60 ? theme.warning : theme.success;
|
|
3240
|
-
const dirs = ctx.listContextDirs();
|
|
3241
|
-
console.log(theme.heading("Current Session:"));
|
|
3242
|
-
console.log(` Provider: ${theme.accent(provider)}`);
|
|
3243
|
-
console.log(` Model: ${theme.accent(model)}`);
|
|
3244
|
-
console.log(` Context: ${pctColor(`${pct}%`)} (est. ${ctxTokens.toLocaleString()} / ${ctxWindow.toLocaleString()} tokens)`);
|
|
3245
|
-
if (dirs.length > 0) {
|
|
3246
|
-
console.log(` Extra dirs: ${dirs.map((d) => d.dir).join(", ")}`);
|
|
3247
|
-
}
|
|
3248
|
-
console.log();
|
|
3249
|
-
const crashes = listRecentCrashes(5, configDir);
|
|
3250
|
-
console.log(theme.heading("Recent Crashes (last 5):"));
|
|
3251
|
-
if (crashes.length === 0) {
|
|
3252
|
-
console.log(theme.dim(" (none \u2014 clean!)"));
|
|
3253
|
-
} else {
|
|
3254
|
-
for (const c of crashes) {
|
|
3255
|
-
console.log(` ${theme.error("\u2717")} ${c.timestamp} ${theme.warning(c.kind)}`);
|
|
3256
|
-
console.log(` ${theme.dim(c.message)}`);
|
|
3257
|
-
console.log(` ${theme.dim(c.file)}`);
|
|
3258
|
-
}
|
|
3259
|
-
}
|
|
3260
|
-
console.log();
|
|
3261
|
-
const allStats = getStatsSnapshot();
|
|
3262
|
-
const totalCalls = allStats.reduce((a, b) => a + b.calls, 0);
|
|
3263
|
-
const totalFails = allStats.reduce((a, b) => a + b.failures, 0);
|
|
3264
|
-
const topUsed = getTopUsedTools(5);
|
|
3265
|
-
const topFailing = getTopFailingTools(5);
|
|
3266
|
-
console.log(theme.heading("Tool Usage:"));
|
|
3267
|
-
const pctFail = totalCalls ? (totalFails * 100 / totalCalls).toFixed(1) : "0.0";
|
|
3268
|
-
console.log(` total: ${totalCalls} calls \xB7 ${totalFails} failures (${pctFail}%)`);
|
|
3269
|
-
if (topUsed.length > 0) {
|
|
3270
|
-
console.log(theme.dim(" top used:"));
|
|
3271
|
-
for (const t of topUsed) {
|
|
3272
|
-
const avg = t.calls ? (t.totalDurationMs / t.calls).toFixed(0) : "0";
|
|
3273
|
-
console.log(` ${t.name.padEnd(20)} ${String(t.calls).padStart(6)} calls \xB7 avg ${avg}ms`);
|
|
3274
|
-
}
|
|
3275
|
-
}
|
|
3276
|
-
if (topFailing.length > 0) {
|
|
3277
|
-
console.log(theme.dim(" top failing:"));
|
|
3278
|
-
for (const t of topFailing) {
|
|
3279
|
-
const rate = (t.failures * 100 / Math.max(1, t.calls)).toFixed(1);
|
|
3280
|
-
const msg = t.lastFailureMessage ? ` \xB7 ${theme.dim(t.lastFailureMessage.slice(0, 80))}` : "";
|
|
3281
|
-
console.log(` ${theme.error(t.name.padEnd(20))} ${t.failures}/${t.calls} (${rate}%)${msg}`);
|
|
3282
|
-
}
|
|
3283
|
-
}
|
|
3284
|
-
console.log();
|
|
3285
|
-
const usage = getConfigDirUsage(configDir);
|
|
3286
|
-
const fmt = (n) => {
|
|
3287
|
-
if (n < 1024) return `${n} B`;
|
|
3288
|
-
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
3289
|
-
if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
3290
|
-
return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`;
|
|
3291
|
-
};
|
|
3292
|
-
const dirAnnotations = {
|
|
3293
|
-
models: "semantic search model \u2192 /index semantic-clear to free",
|
|
3294
|
-
index: "symbol index \u2192 /index clear to rebuild",
|
|
3295
|
-
history: "conversation history \u2192 auto-pruned after 30 days",
|
|
3296
|
-
logs: "crash logs",
|
|
3297
|
-
"memory-index": "chat memory index \u2192 /memory index-clear to free"
|
|
3298
|
-
};
|
|
3299
|
-
console.log(theme.heading("Disk Usage (~/.aicli):"));
|
|
3300
|
-
console.log(` total: ${theme.accent(fmt(usage.totalBytes))}`);
|
|
3301
|
-
for (const e of usage.entries.slice(0, 10)) {
|
|
3302
|
-
const note = dirAnnotations[e.name];
|
|
3303
|
-
const noteStr = note ? ` ${theme.dim("\xB7")} ${theme.dim(note)}` : "";
|
|
3304
|
-
console.log(` ${e.name.padEnd(18)} ${theme.dim(fmt(e.bytes))}${noteStr}`);
|
|
3305
|
-
}
|
|
3306
|
-
console.log();
|
|
3307
|
-
console.log(theme.success("\u2713 Health check complete\n"));
|
|
3187
|
+
const report = buildDoctorReport({
|
|
3188
|
+
config: ctx.config,
|
|
3189
|
+
providers: ctx.providers,
|
|
3190
|
+
cwd: process.cwd(),
|
|
3191
|
+
mcpStatuses: ctx.getMcpManager()?.getStatus() ?? []
|
|
3192
|
+
});
|
|
3193
|
+
console.log(formatDoctorReport(report, true));
|
|
3308
3194
|
}
|
|
3309
3195
|
},
|
|
3310
3196
|
{
|
|
@@ -4691,7 +4577,7 @@ function parseAtReferences(input2, cwd) {
|
|
|
4691
4577
|
continue;
|
|
4692
4578
|
}
|
|
4693
4579
|
if (mime) {
|
|
4694
|
-
const fileSize =
|
|
4580
|
+
const fileSize = statSync2(absPath).size;
|
|
4695
4581
|
if (fileSize > MAX_IMAGE_BYTES) {
|
|
4696
4582
|
refs.push({ path: rawPath, type: "toolarge" });
|
|
4697
4583
|
continue;
|
|
@@ -4949,7 +4835,7 @@ var Repl = class {
|
|
|
4949
4835
|
const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
4950
4836
|
let isDir;
|
|
4951
4837
|
try {
|
|
4952
|
-
isDir =
|
|
4838
|
+
isDir = statSync2(fullPath).isDirectory();
|
|
4953
4839
|
} catch {
|
|
4954
4840
|
continue;
|
|
4955
4841
|
}
|
|
@@ -4981,7 +4867,7 @@ ${treeLines.join("\n")}`
|
|
|
4981
4867
|
const fullPath = join4(dir, name);
|
|
4982
4868
|
let st;
|
|
4983
4869
|
try {
|
|
4984
|
-
st =
|
|
4870
|
+
st = statSync2(fullPath);
|
|
4985
4871
|
} catch {
|
|
4986
4872
|
continue;
|
|
4987
4873
|
}
|
|
@@ -5028,7 +4914,7 @@ ${content}
|
|
|
5028
4914
|
}
|
|
5029
4915
|
let isDir;
|
|
5030
4916
|
try {
|
|
5031
|
-
isDir =
|
|
4917
|
+
isDir = statSync2(absPath).isDirectory();
|
|
5032
4918
|
} catch {
|
|
5033
4919
|
return { success: false, charCount: 0, added: false, error: `Cannot access: ${dirPath}` };
|
|
5034
4920
|
}
|
|
@@ -6198,7 +6084,7 @@ Session '${this.resumeSessionId}' not found.
|
|
|
6198
6084
|
if (!entry.toLowerCase().startsWith(prefix.toLowerCase())) continue;
|
|
6199
6085
|
try {
|
|
6200
6086
|
const fullPath = join4(absDir, entry);
|
|
6201
|
-
const stat =
|
|
6087
|
+
const stat = statSync2(fullPath);
|
|
6202
6088
|
const rel = dir === "." ? entry : `${dir}/${entry}`;
|
|
6203
6089
|
results.push(stat.isDirectory() ? `${rel}/` : rel);
|
|
6204
6090
|
} catch {
|
|
@@ -7369,7 +7255,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7369
7255
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7370
7256
|
process.exit(1);
|
|
7371
7257
|
}
|
|
7372
|
-
const { startWebServer } = await import("./server-
|
|
7258
|
+
const { startWebServer } = await import("./server-5E2AIXVX.js");
|
|
7373
7259
|
await startWebServer({ port, host: options.host });
|
|
7374
7260
|
});
|
|
7375
7261
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -7536,16 +7422,20 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7536
7422
|
console.log(footer + "\n");
|
|
7537
7423
|
});
|
|
7538
7424
|
program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
|
|
7539
|
-
const { runUsageCli } = await import("./usage-
|
|
7425
|
+
const { runUsageCli } = await import("./usage-BMK6M5U3.js");
|
|
7540
7426
|
await runUsageCli(options);
|
|
7541
7427
|
});
|
|
7542
7428
|
program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
|
|
7543
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7544
|
-
|
|
7429
|
+
const { runDoctorCli } = await import("./doctor-cli-KB2LUDF3.js");
|
|
7430
|
+
const argv = process.argv.slice(2);
|
|
7431
|
+
await runDoctorCli({
|
|
7432
|
+
json: !!options.json || argv.includes("--json"),
|
|
7433
|
+
resetStats: !!options.resetStats || argv.includes("--reset-stats")
|
|
7434
|
+
});
|
|
7545
7435
|
});
|
|
7546
7436
|
program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
|
|
7547
7437
|
try {
|
|
7548
|
-
const batch = await import("./batch-
|
|
7438
|
+
const batch = await import("./batch-CHAPYRVM.js");
|
|
7549
7439
|
switch (action) {
|
|
7550
7440
|
case "submit":
|
|
7551
7441
|
if (!arg) {
|
|
@@ -7588,7 +7478,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7588
7478
|
}
|
|
7589
7479
|
});
|
|
7590
7480
|
program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
|
|
7591
|
-
const { startMcpServer } = await import("./server-
|
|
7481
|
+
const { startMcpServer } = await import("./server-Z6O3G2LY.js");
|
|
7592
7482
|
await startMcpServer({
|
|
7593
7483
|
allowDestructive: !!options.allowDestructive,
|
|
7594
7484
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7601,7 +7491,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7601
7491
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
7602
7492
|
process.exit(1);
|
|
7603
7493
|
}
|
|
7604
|
-
const { runPrCli } = await import("./pr-
|
|
7494
|
+
const { runPrCli } = await import("./pr-YQGH72N6.js");
|
|
7605
7495
|
const result = await runPrCli({
|
|
7606
7496
|
action,
|
|
7607
7497
|
target,
|
|
@@ -7621,8 +7511,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7621
7511
|
process.exit(result.exitCode);
|
|
7622
7512
|
});
|
|
7623
7513
|
program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
|
|
7624
|
-
const { runCi } = await import("./ci-
|
|
7625
|
-
const { formatCiResult } = await import("./ci-format-
|
|
7514
|
+
const { runCi } = await import("./ci-QPP66T53.js");
|
|
7515
|
+
const { formatCiResult } = await import("./ci-format-5S3EEYRK.js");
|
|
7626
7516
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
7627
7517
|
if (formats > 1) {
|
|
7628
7518
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -7779,7 +7669,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7779
7669
|
}),
|
|
7780
7670
|
config.get("customProviders")
|
|
7781
7671
|
);
|
|
7782
|
-
const { startHub } = await import("./hub-
|
|
7672
|
+
const { startHub } = await import("./hub-DIM7SKKY.js");
|
|
7783
7673
|
await startHub(
|
|
7784
7674
|
{
|
|
7785
7675
|
topic: topic ?? "",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-4ZN6L6K5.js";
|
|
6
|
+
import "./chunk-VADHBW7T.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
import "./chunk-XPBEJB27.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KIEZBTVD.js";
|
|
19
19
|
import "./chunk-TZQHYZKT.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-U7KVU25H.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|