jinzd-ai-cli 0.4.224 → 0.4.226
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/dist/{batch-EQER63CQ.js → batch-IJ6X3SWP.js} +2 -2
- package/dist/{chunk-34RV4ZKA.js → chunk-55NPPWBW.js} +1 -1
- package/dist/{chunk-A2AVDSXJ.js → chunk-D5A2K4AO.js} +1 -1
- package/dist/{chunk-4RQPCOEE.js → chunk-GOMPGWWO.js} +3 -3
- package/dist/{chunk-6FEZAWH5.js → chunk-HZC6JFPM.js} +3 -3
- package/dist/{chunk-JDMFVRFG.js → chunk-KDJEFBOS.js} +3 -3
- package/dist/{chunk-35OPVVEK.js → chunk-NQYNIK4C.js} +1 -1
- package/dist/{chunk-JU7OI4BN.js → chunk-PEUYYZQU.js} +1 -1
- package/dist/{chunk-QJUAQKH2.js → chunk-QNIFXUKV.js} +1 -1
- package/dist/{chunk-HLXQXV23.js → chunk-SHJL3ZEA.js} +1 -1
- package/dist/{chunk-4CZZJQXJ.js → chunk-XN24Y4OZ.js} +2 -2
- package/dist/{ci-UAQFOAMS.js → ci-7SRQSN7E.js} +4 -4
- package/dist/{ci-format-MNUHYUTO.js → ci-format-FM52GDQG.js} +2 -2
- package/dist/{constants-PGDTYD2R.js → constants-LX5P32PH.js} +1 -1
- package/dist/{doctor-cli-F6A3GOVY.js → doctor-cli-6KSSI65N.js} +4 -4
- package/dist/electron-server.js +47 -3
- package/dist/{hub-EDTZKS7E.js → hub-AWY3NZUF.js} +1 -1
- package/dist/index.js +132 -24
- package/dist/{pr-YC7DMVC5.js → pr-IO56XB47.js} +4 -4
- package/dist/{run-tests-AUEKHJCC.js → run-tests-FKBEUFKX.js} +2 -2
- package/dist/{run-tests-S36TE2W2.js → run-tests-NQWCJSZX.js} +1 -1
- package/dist/{server-347YIBHS.js → server-I2RRWW7W.js} +4 -4
- package/dist/{server-LQFHSFN4.js → server-Y7YXAYF3.js} +53 -9
- package/dist/{task-orchestrator-FIR5MCND.js → task-orchestrator-CODR7HC6.js} +4 -4
- package/dist/{usage-3MXPFFBU.js → usage-6H5AIUZM.js} +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NQYNIK4C.js";
|
|
5
5
|
import "./chunk-5ULLIOVC.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-QNIFXUKV.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFileSync
|
|
9
9
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
runHook,
|
|
15
15
|
runLifecycleHooks,
|
|
16
16
|
runTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-D5A2K4AO.js";
|
|
18
18
|
import {
|
|
19
19
|
getDangerLevel,
|
|
20
20
|
isFileWriteTool,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "./chunk-4BKXL7SM.js";
|
|
34
34
|
import {
|
|
35
35
|
runTestsTool
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-PEUYYZQU.js";
|
|
37
37
|
import {
|
|
38
38
|
CONFIG_DIR_NAME,
|
|
39
39
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
SUBAGENT_ALLOWED_TOOLS,
|
|
44
44
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
45
45
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-QNIFXUKV.js";
|
|
47
47
|
import {
|
|
48
48
|
loadChatIndex,
|
|
49
49
|
searchChatMemory
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
listHooks,
|
|
12
12
|
listInstalledPlugins,
|
|
13
13
|
resetStats
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-D5A2K4AO.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NQYNIK4C.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-
|
|
29
|
+
} from "./chunk-QNIFXUKV.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-55NPPWBW.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
} from "./chunk-PUBCJF7E.js";
|
|
14
14
|
import {
|
|
15
15
|
ConfigManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NQYNIK4C.js";
|
|
17
17
|
import {
|
|
18
18
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QNIFXUKV.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/ci.ts
|
|
22
22
|
import { execFileSync } from "child_process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GOMPGWWO.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-
|
|
14
|
+
} from "./chunk-QNIFXUKV.js";
|
|
15
15
|
import {
|
|
16
16
|
atomicWriteFileSync
|
|
17
17
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-KDJEFBOS.js";
|
|
7
|
+
import "./chunk-55NPPWBW.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-PUBCJF7E.js";
|
|
10
10
|
import "./chunk-XPBEJB27.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-NQYNIK4C.js";
|
|
12
12
|
import "./chunk-5ULLIOVC.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-QNIFXUKV.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
export {
|
|
16
16
|
CI_COMMENT_MARKER,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HZC6JFPM.js";
|
|
6
6
|
import "./chunk-PUBCJF7E.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-D5A2K4AO.js";
|
|
8
8
|
import "./chunk-XPBEJB27.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NQYNIK4C.js";
|
|
10
10
|
import "./chunk-5ULLIOVC.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QNIFXUKV.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|
package/dist/electron-server.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
VERSION,
|
|
39
39
|
buildUserIdentityPrompt,
|
|
40
40
|
runTestsTool
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-SHJL3ZEA.js";
|
|
42
42
|
import {
|
|
43
43
|
hasSemanticIndex,
|
|
44
44
|
semanticSearch
|
|
@@ -15289,6 +15289,50 @@ async function handleSession(args, ctx) {
|
|
|
15289
15289
|
}
|
|
15290
15290
|
if (sub === "delete" && args[1]) {
|
|
15291
15291
|
const targetId = args[1];
|
|
15292
|
+
if (targetId === "--filter") {
|
|
15293
|
+
let filterMessages;
|
|
15294
|
+
for (let i = 1; i < args.length; i++) {
|
|
15295
|
+
if (args[i] === "--filter" && i + 1 < args.length) {
|
|
15296
|
+
const val = args[i + 1];
|
|
15297
|
+
i++;
|
|
15298
|
+
const eq = val.indexOf("=");
|
|
15299
|
+
if (eq > 0) {
|
|
15300
|
+
const key = val.slice(0, eq);
|
|
15301
|
+
const vals = val.slice(eq + 1).split(",").map((s) => s.trim().toLowerCase());
|
|
15302
|
+
if (key === "messages") {
|
|
15303
|
+
const n = Number(vals[0]);
|
|
15304
|
+
if (Number.isFinite(n) && n >= 0) filterMessages = n;
|
|
15305
|
+
}
|
|
15306
|
+
}
|
|
15307
|
+
}
|
|
15308
|
+
}
|
|
15309
|
+
if (filterMessages === void 0) {
|
|
15310
|
+
ctx.send({ type: "error", message: "Usage: /session delete --filter messages=N" });
|
|
15311
|
+
return;
|
|
15312
|
+
}
|
|
15313
|
+
const list2 = ctx.sessions.listSessions();
|
|
15314
|
+
const matches = list2.filter((s) => s.messageCount === filterMessages);
|
|
15315
|
+
if (matches.length === 0) {
|
|
15316
|
+
ctx.send({ type: "info", message: `No sessions with ${filterMessages} message(s) found.` });
|
|
15317
|
+
return;
|
|
15318
|
+
}
|
|
15319
|
+
let deleted = 0;
|
|
15320
|
+
let failed = 0;
|
|
15321
|
+
for (const s of matches) {
|
|
15322
|
+
if (ctx.sessions.deleteSession(s.id)) {
|
|
15323
|
+
deleted++;
|
|
15324
|
+
} else {
|
|
15325
|
+
failed++;
|
|
15326
|
+
}
|
|
15327
|
+
}
|
|
15328
|
+
if (!ctx.sessions.current) {
|
|
15329
|
+
ctx.sessions.createSession(ctx.currentProvider, ctx.currentModel);
|
|
15330
|
+
ctx.resetWebSessionUsage();
|
|
15331
|
+
}
|
|
15332
|
+
ctx.send({ type: "info", message: `Deleted ${deleted} session(s) with ${filterMessages} message(s)${failed > 0 ? `, ${failed} failed` : ""}.` });
|
|
15333
|
+
ctx.sendSessionList();
|
|
15334
|
+
return;
|
|
15335
|
+
}
|
|
15292
15336
|
const cachedKey = ctx.unsavedSessions.has(targetId) ? targetId : [...ctx.unsavedSessions.keys()].find((k) => k.startsWith(targetId));
|
|
15293
15337
|
if (cachedKey) {
|
|
15294
15338
|
ctx.unsavedSessions.delete(cachedKey);
|
|
@@ -15363,7 +15407,7 @@ async function handleSession(args, ctx) {
|
|
|
15363
15407
|
}
|
|
15364
15408
|
return;
|
|
15365
15409
|
}
|
|
15366
|
-
ctx.send({ type: "info", message: "Usage: /session new | list | load <id> | delete <id> | rename <id> <title>" });
|
|
15410
|
+
ctx.send({ type: "info", message: "Usage: /session new | list | load <id> | delete <id> | delete --filter messages=N | rename <id> <title>" });
|
|
15367
15411
|
}
|
|
15368
15412
|
async function handleExport(args, ctx) {
|
|
15369
15413
|
const format = args[0] === "json" ? "json" : "md";
|
|
@@ -15973,7 +16017,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
15973
16017
|
async function handleTest(args, ctx) {
|
|
15974
16018
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
15975
16019
|
try {
|
|
15976
|
-
const { executeTests } = await import("./run-tests-
|
|
16020
|
+
const { executeTests } = await import("./run-tests-NQWCJSZX.js");
|
|
15977
16021
|
const argStr = args.join(" ").trim();
|
|
15978
16022
|
let testArgs = {};
|
|
15979
16023
|
if (argStr) {
|
|
@@ -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-CODR7HC6.js");
|
|
158
158
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
159
159
|
let interrupted = false;
|
|
160
160
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
scanProject,
|
|
15
15
|
sessionHasMeaningfulContent,
|
|
16
16
|
setupProxy
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XN24Y4OZ.js";
|
|
18
18
|
import {
|
|
19
19
|
buildReviewPrompt,
|
|
20
20
|
buildSecurityReviewPrompt
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
theme,
|
|
53
53
|
undoStack,
|
|
54
54
|
updateMemoryApproval
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-GOMPGWWO.js";
|
|
56
56
|
import "./chunk-K3CF65QH.js";
|
|
57
57
|
import "./chunk-UUSRWSSX.js";
|
|
58
58
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
formatDoctorReport,
|
|
75
75
|
loadContextFiles,
|
|
76
76
|
writeCrashLog
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-HZC6JFPM.js";
|
|
78
78
|
import {
|
|
79
79
|
ProviderRegistry
|
|
80
80
|
} from "./chunk-PUBCJF7E.js";
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
trustHook,
|
|
95
95
|
trustPlugin,
|
|
96
96
|
untrustHook
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-D5A2K4AO.js";
|
|
98
98
|
import {
|
|
99
99
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
100
100
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
} from "./chunk-XPBEJB27.js";
|
|
117
117
|
import {
|
|
118
118
|
ConfigManager
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-NQYNIK4C.js";
|
|
120
120
|
import {
|
|
121
121
|
AuthError,
|
|
122
122
|
ProviderError,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
import {
|
|
131
131
|
fileCheckpoints
|
|
132
132
|
} from "./chunk-4BKXL7SM.js";
|
|
133
|
-
import "./chunk-
|
|
133
|
+
import "./chunk-PEUYYZQU.js";
|
|
134
134
|
import {
|
|
135
135
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
136
136
|
AUTHOR,
|
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
SKILLS_DIR_NAME,
|
|
150
150
|
VERSION,
|
|
151
151
|
buildUserIdentityPrompt
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-QNIFXUKV.js";
|
|
153
153
|
import {
|
|
154
154
|
buildChatIndex,
|
|
155
155
|
clearChatIndex,
|
|
@@ -763,6 +763,7 @@ function parseSessionListArgs(args) {
|
|
|
763
763
|
let limit = DEFAULT_SESSION_LIST_LIMIT;
|
|
764
764
|
let all = false;
|
|
765
765
|
const filter = {};
|
|
766
|
+
const warnings = [];
|
|
766
767
|
let search = null;
|
|
767
768
|
let days = null;
|
|
768
769
|
let since = null;
|
|
@@ -788,6 +789,15 @@ function parseSessionListArgs(args) {
|
|
|
788
789
|
const vals = val.slice(eq + 1).split(",").map((s) => s.trim().toLowerCase());
|
|
789
790
|
if (key === "provider") filter.provider = vals;
|
|
790
791
|
else if (key === "model") filter.model = vals;
|
|
792
|
+
else if (key === "messages") {
|
|
793
|
+
const n = Number(vals[0]);
|
|
794
|
+
if (Number.isFinite(n) && n >= 0) filter.messages = n;
|
|
795
|
+
else warnings.push(`Invalid filter value for "messages": expected a non-negative integer, got "${vals[0]}"`);
|
|
796
|
+
} else {
|
|
797
|
+
warnings.push(`Unknown filter key: "${key}". Supported keys: provider, model, messages`);
|
|
798
|
+
}
|
|
799
|
+
} else {
|
|
800
|
+
warnings.push(`Invalid --filter syntax: "${val}". Expected key=value`);
|
|
791
801
|
}
|
|
792
802
|
} else if ((a === "--search" || a === "-s") && i + 1 < args.length) {
|
|
793
803
|
search = args[++i];
|
|
@@ -814,7 +824,7 @@ function parseSessionListArgs(args) {
|
|
|
814
824
|
}
|
|
815
825
|
}
|
|
816
826
|
if (all) limit = -1;
|
|
817
|
-
return { limit, all, filter, search, days, since, sort, json, stale, verbose };
|
|
827
|
+
return { limit, all, filter, search, days, since, sort, json, stale, verbose, warnings };
|
|
818
828
|
}
|
|
819
829
|
function renderTranscriptMessage(msg, renderer) {
|
|
820
830
|
if (msg.role === "user") {
|
|
@@ -1022,7 +1032,7 @@ function createMiscCommands() {
|
|
|
1022
1032
|
rows: [
|
|
1023
1033
|
["/clear", "Clear conversation history"],
|
|
1024
1034
|
["/compact [instruction]", "Summarize & compress history"],
|
|
1025
|
-
["/session new|list|load|show|page|remove", "Manage saved sessions (
|
|
1035
|
+
["/session new|list [--filter k=v]|load|show|page|remove", "Manage saved sessions (list: --filter provider=/model=/messages=)"],
|
|
1026
1036
|
["/checkpoint [save|restore|delete] <name>", "Session checkpoints"],
|
|
1027
1037
|
["/fork [checkpoint]", "Fork session from checkpoint or current"],
|
|
1028
1038
|
["/branch [list|new|switch|delete|rename|diff|cherry-pick]", "Conversation branches"],
|
|
@@ -1823,7 +1833,7 @@ No tools match "${filter}".
|
|
|
1823
1833
|
const { join: join7 } = await import("path");
|
|
1824
1834
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1825
1835
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1826
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1836
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-LX5P32PH.js");
|
|
1827
1837
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1828
1838
|
const cwd = process.cwd();
|
|
1829
1839
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2802,7 +2812,7 @@ function createReviewCommands() {
|
|
|
2802
2812
|
usage: "/test [command|filter]",
|
|
2803
2813
|
async execute(args, ctx) {
|
|
2804
2814
|
try {
|
|
2805
|
-
const { executeTests } = await import("./run-tests-
|
|
2815
|
+
const { executeTests } = await import("./run-tests-FKBEUFKX.js");
|
|
2806
2816
|
const argStr = args.join(" ").trim();
|
|
2807
2817
|
let testArgs = {};
|
|
2808
2818
|
if (argStr) {
|
|
@@ -3421,7 +3431,7 @@ function createSessionCommands() {
|
|
|
3421
3431
|
{
|
|
3422
3432
|
name: "session",
|
|
3423
3433
|
description: "Session management",
|
|
3424
|
-
usage: "/session new|list [--limit N|--all] [--filter
|
|
3434
|
+
usage: "/session new|list [--limit N|--all] [--filter provider=|model=|messages=N] [--search kw] [--days N|--stale N] [--sort f[:o]] [--json] [--verbose]|load <id>|show <id> [page]|page <n>|remove <id>|clean --stale N [--dry-run]",
|
|
3425
3435
|
async execute(args, ctx) {
|
|
3426
3436
|
const sub = args[0];
|
|
3427
3437
|
if (sub === "new") {
|
|
@@ -3433,22 +3443,27 @@ function createSessionCommands() {
|
|
|
3433
3443
|
ctx.renderer.printSuccess("New session started.");
|
|
3434
3444
|
} else if (sub === "list") {
|
|
3435
3445
|
const opts = parseSessionListArgs(args);
|
|
3446
|
+
for (const w of opts.warnings) {
|
|
3447
|
+
ctx.renderer.printInfo(`\u26A0 ${w}`);
|
|
3448
|
+
}
|
|
3436
3449
|
const needFileSize = opts.verbose || opts.sort.field === "size";
|
|
3437
3450
|
let allSessions = ctx.sessions.listSessions({ includeFileSize: needFileSize });
|
|
3438
3451
|
if (allSessions.length === 0) {
|
|
3439
3452
|
ctx.renderer.printInfo("No saved sessions.");
|
|
3440
3453
|
return;
|
|
3441
3454
|
}
|
|
3442
|
-
const hasFilters = opts.filter.provider || opts.filter.model;
|
|
3455
|
+
const hasFilters = opts.filter.provider || opts.filter.model || opts.filter.messages !== void 0;
|
|
3443
3456
|
const hasSearch = !!opts.search;
|
|
3444
3457
|
const hasTimeFilter = opts.days !== null || opts.since !== null;
|
|
3445
3458
|
const hasStale = opts.stale !== null;
|
|
3446
3459
|
if (hasFilters) {
|
|
3447
3460
|
const p = opts.filter.provider;
|
|
3448
3461
|
const m = opts.filter.model;
|
|
3462
|
+
const msg = opts.filter.messages;
|
|
3449
3463
|
allSessions = allSessions.filter((s) => {
|
|
3450
3464
|
if (p && !p.includes(s.provider.toLowerCase())) return false;
|
|
3451
3465
|
if (m && !m.some((kw) => s.model.toLowerCase().includes(kw))) return false;
|
|
3466
|
+
if (msg !== void 0 && s.messageCount !== msg) return false;
|
|
3452
3467
|
return true;
|
|
3453
3468
|
});
|
|
3454
3469
|
}
|
|
@@ -3606,9 +3621,102 @@ function createSessionCommands() {
|
|
|
3606
3621
|
}
|
|
3607
3622
|
renderTranscriptPage(cur.messages, ctx.renderer, n);
|
|
3608
3623
|
} else if (sub === "remove" || sub === "delete") {
|
|
3624
|
+
if (args[1] === "--filter") {
|
|
3625
|
+
let filterMessages;
|
|
3626
|
+
let dryRun = false;
|
|
3627
|
+
for (let i = 1; i < args.length; i++) {
|
|
3628
|
+
if (args[i] === "--filter" && i + 1 < args.length) {
|
|
3629
|
+
const val = args[++i];
|
|
3630
|
+
const eq = val.indexOf("=");
|
|
3631
|
+
if (eq > 0) {
|
|
3632
|
+
const key = val.slice(0, eq);
|
|
3633
|
+
const vals = val.slice(eq + 1).split(",").map((s) => s.trim().toLowerCase());
|
|
3634
|
+
if (key === "messages") {
|
|
3635
|
+
const n = Number(vals[0]);
|
|
3636
|
+
if (Number.isFinite(n) && n >= 0) filterMessages = n;
|
|
3637
|
+
else {
|
|
3638
|
+
ctx.renderer.renderError(`Invalid filter value for "messages": expected a non-negative integer, got "${vals[0]}"`);
|
|
3639
|
+
return;
|
|
3640
|
+
}
|
|
3641
|
+
} else {
|
|
3642
|
+
ctx.renderer.renderError(`Unsupported filter key for remove: "${key}". Only "messages" is supported.`);
|
|
3643
|
+
return;
|
|
3644
|
+
}
|
|
3645
|
+
} else {
|
|
3646
|
+
ctx.renderer.renderError(`Invalid --filter syntax: "${val}". Expected key=value (e.g., messages=0)`);
|
|
3647
|
+
return;
|
|
3648
|
+
}
|
|
3649
|
+
} else if (args[i] === "--dry-run") {
|
|
3650
|
+
dryRun = true;
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
if (filterMessages === void 0) {
|
|
3654
|
+
ctx.renderer.renderError("Usage: /session remove --filter messages=N [--dry-run]");
|
|
3655
|
+
return;
|
|
3656
|
+
}
|
|
3657
|
+
const allSessions = ctx.sessions.listSessions();
|
|
3658
|
+
const matches3 = allSessions.filter((s) => s.messageCount === filterMessages);
|
|
3659
|
+
if (matches3.length === 0) {
|
|
3660
|
+
ctx.renderer.printInfo(`No sessions with ${filterMessages} message(s) found.`);
|
|
3661
|
+
return;
|
|
3662
|
+
}
|
|
3663
|
+
console.log();
|
|
3664
|
+
console.log(
|
|
3665
|
+
theme.warning(` Found ${matches3.length} session(s) with ${filterMessages} message(s):`)
|
|
3666
|
+
);
|
|
3667
|
+
for (const s of matches3.slice(0, 20)) {
|
|
3668
|
+
console.log(
|
|
3669
|
+
theme.dim(
|
|
3670
|
+
` ${s.id.slice(0, 12)} ${s.provider}/${s.model} ${String(s.messageCount).padStart(4)} msgs ${s.updated.toISOString().slice(0, 10)} ${truncateTitle(s.title ?? "(untitled)", 60)}`
|
|
3671
|
+
)
|
|
3672
|
+
);
|
|
3673
|
+
}
|
|
3674
|
+
if (matches3.length > 20) {
|
|
3675
|
+
console.log(theme.dim(` ... and ${matches3.length - 20} more`));
|
|
3676
|
+
}
|
|
3677
|
+
if (dryRun) {
|
|
3678
|
+
console.log(
|
|
3679
|
+
theme.info(`
|
|
3680
|
+
--dry-run: no sessions were deleted. Remove --dry-run to actually delete.`)
|
|
3681
|
+
);
|
|
3682
|
+
return;
|
|
3683
|
+
}
|
|
3684
|
+
console.log();
|
|
3685
|
+
const choice2 = await ctx.select(
|
|
3686
|
+
`Delete all ${matches3.length} matching sessions?`,
|
|
3687
|
+
[
|
|
3688
|
+
{ label: "No \u2014 keep them", value: "no" },
|
|
3689
|
+
{ label: "Yes \u2014 delete permanently", value: "yes", hint: "unlinks all matching history files" }
|
|
3690
|
+
]
|
|
3691
|
+
);
|
|
3692
|
+
if (choice2 !== "yes") {
|
|
3693
|
+
ctx.renderer.printInfo("Cancelled \u2014 no sessions deleted.");
|
|
3694
|
+
return;
|
|
3695
|
+
}
|
|
3696
|
+
let deleted = 0;
|
|
3697
|
+
let failed = 0;
|
|
3698
|
+
for (const s of matches3) {
|
|
3699
|
+
if (ctx.sessions.deleteSession(s.id)) {
|
|
3700
|
+
deleted++;
|
|
3701
|
+
} else {
|
|
3702
|
+
failed++;
|
|
3703
|
+
}
|
|
3704
|
+
}
|
|
3705
|
+
const currentStillExists = ctx.sessions.current !== null;
|
|
3706
|
+
ctx.renderer.printSuccess(
|
|
3707
|
+
`Removed: ${deleted} deleted${failed > 0 ? `, ${failed} failed` : ""}.`
|
|
3708
|
+
);
|
|
3709
|
+
if (!currentStillExists) {
|
|
3710
|
+
ctx.sessions.createSession(ctx.getCurrentProvider(), ctx.getCurrentModel());
|
|
3711
|
+
ctx.resetSessionTokenUsage();
|
|
3712
|
+
ctx.clearDevState();
|
|
3713
|
+
ctx.renderer.printInfo("Current session was among deleted \u2014 started a fresh session.");
|
|
3714
|
+
}
|
|
3715
|
+
return;
|
|
3716
|
+
}
|
|
3609
3717
|
const id = args[1];
|
|
3610
3718
|
if (!id) {
|
|
3611
|
-
ctx.renderer.renderError("Usage: /session remove <id>");
|
|
3719
|
+
ctx.renderer.renderError("Usage: /session remove <id> | /session remove --filter messages=N [--dry-run]");
|
|
3612
3720
|
return;
|
|
3613
3721
|
}
|
|
3614
3722
|
const sessions = ctx.sessions.listSessions();
|
|
@@ -3716,7 +3824,7 @@ function createSessionCommands() {
|
|
|
3716
3824
|
`Cleaned up: ${deleted} deleted${failed > 0 ? `, ${failed} failed` : ""}.`
|
|
3717
3825
|
);
|
|
3718
3826
|
} else {
|
|
3719
|
-
ctx.renderer.renderError("Usage: /session new|list|load <id>|show <id> [page]|page <n>|remove <id
|
|
3827
|
+
ctx.renderer.renderError("Usage: /session new|list|load <id>|show <id> [page]|page <n>|remove <id>|remove --filter messages=N [--dry-run]|clean --stale N [--dry-run]");
|
|
3720
3828
|
}
|
|
3721
3829
|
}
|
|
3722
3830
|
},
|
|
@@ -7649,7 +7757,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7649
7757
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7650
7758
|
process.exit(1);
|
|
7651
7759
|
}
|
|
7652
|
-
const { startWebServer } = await import("./server-
|
|
7760
|
+
const { startWebServer } = await import("./server-Y7YXAYF3.js");
|
|
7653
7761
|
await startWebServer({ port, host: options.host });
|
|
7654
7762
|
});
|
|
7655
7763
|
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) => {
|
|
@@ -7816,11 +7924,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7816
7924
|
console.log(footer + "\n");
|
|
7817
7925
|
});
|
|
7818
7926
|
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) => {
|
|
7819
|
-
const { runUsageCli } = await import("./usage-
|
|
7927
|
+
const { runUsageCli } = await import("./usage-6H5AIUZM.js");
|
|
7820
7928
|
await runUsageCli(options);
|
|
7821
7929
|
});
|
|
7822
7930
|
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) => {
|
|
7823
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7931
|
+
const { runDoctorCli } = await import("./doctor-cli-6KSSI65N.js");
|
|
7824
7932
|
const argv = process.argv.slice(2);
|
|
7825
7933
|
await runDoctorCli({
|
|
7826
7934
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -7829,7 +7937,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
7829
7937
|
});
|
|
7830
7938
|
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) => {
|
|
7831
7939
|
try {
|
|
7832
|
-
const batch = await import("./batch-
|
|
7940
|
+
const batch = await import("./batch-IJ6X3SWP.js");
|
|
7833
7941
|
switch (action) {
|
|
7834
7942
|
case "submit":
|
|
7835
7943
|
if (!arg) {
|
|
@@ -7872,7 +7980,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7872
7980
|
}
|
|
7873
7981
|
});
|
|
7874
7982
|
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) => {
|
|
7875
|
-
const { startMcpServer } = await import("./server-
|
|
7983
|
+
const { startMcpServer } = await import("./server-I2RRWW7W.js");
|
|
7876
7984
|
await startMcpServer({
|
|
7877
7985
|
allowDestructive: !!options.allowDestructive,
|
|
7878
7986
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7885,7 +7993,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7885
7993
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
7886
7994
|
process.exit(1);
|
|
7887
7995
|
}
|
|
7888
|
-
const { runPrCli } = await import("./pr-
|
|
7996
|
+
const { runPrCli } = await import("./pr-IO56XB47.js");
|
|
7889
7997
|
const result = await runPrCli({
|
|
7890
7998
|
action,
|
|
7891
7999
|
target,
|
|
@@ -7905,8 +8013,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7905
8013
|
process.exit(result.exitCode);
|
|
7906
8014
|
});
|
|
7907
8015
|
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) => {
|
|
7908
|
-
const { runCi } = await import("./ci-
|
|
7909
|
-
const { formatCiResult } = await import("./ci-format-
|
|
8016
|
+
const { runCi } = await import("./ci-7SRQSN7E.js");
|
|
8017
|
+
const { formatCiResult } = await import("./ci-format-FM52GDQG.js");
|
|
7910
8018
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
7911
8019
|
if (formats > 1) {
|
|
7912
8020
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -8064,7 +8172,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
8064
8172
|
config.get("customProviders"),
|
|
8065
8173
|
config.getConfigDir()
|
|
8066
8174
|
);
|
|
8067
|
-
const { startHub } = await import("./hub-
|
|
8175
|
+
const { startHub } = await import("./hub-AWY3NZUF.js");
|
|
8068
8176
|
await startHub(
|
|
8069
8177
|
{
|
|
8070
8178
|
topic: topic ?? "",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-KDJEFBOS.js";
|
|
6
|
+
import "./chunk-55NPPWBW.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-NQYNIK4C.js";
|
|
19
19
|
import "./chunk-5ULLIOVC.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QNIFXUKV.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GOMPGWWO.js";
|
|
5
5
|
import "./chunk-K3CF65QH.js";
|
|
6
6
|
import "./chunk-UUSRWSSX.js";
|
|
7
7
|
import "./chunk-CKH4KQ4E.js";
|
|
8
8
|
import "./chunk-BXP6YZ2P.js";
|
|
9
9
|
import {
|
|
10
10
|
runTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D5A2K4AO.js";
|
|
12
12
|
import {
|
|
13
13
|
getDangerLevel,
|
|
14
14
|
schemaToJsonSchema
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
import "./chunk-5ULLIOVC.js";
|
|
17
17
|
import "./chunk-HOSJZMQS.js";
|
|
18
18
|
import "./chunk-4BKXL7SM.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-PEUYYZQU.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QNIFXUKV.js";
|
|
23
23
|
import "./chunk-NVUCDUXE.js";
|
|
24
24
|
import "./chunk-KHYD3WXE.js";
|
|
25
25
|
import "./chunk-B5TYJO7V.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
scanDirTree,
|
|
24
24
|
scanProject,
|
|
25
25
|
setupProxy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XN24Y4OZ.js";
|
|
27
27
|
import {
|
|
28
28
|
buildReviewPrompt,
|
|
29
29
|
buildSecurityReviewPrompt
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
truncateOutput,
|
|
68
68
|
undoStack,
|
|
69
69
|
updateMemoryApproval
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-GOMPGWWO.js";
|
|
71
71
|
import "./chunk-K3CF65QH.js";
|
|
72
72
|
import "./chunk-UUSRWSSX.js";
|
|
73
73
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
buildDoctorReport,
|
|
85
85
|
formatDoctorReport,
|
|
86
86
|
loadContextFiles
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-HZC6JFPM.js";
|
|
88
88
|
import {
|
|
89
89
|
ProviderRegistry
|
|
90
90
|
} from "./chunk-PUBCJF7E.js";
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
runTool,
|
|
103
103
|
setPluginEnabled,
|
|
104
104
|
trustPlugin
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-D5A2K4AO.js";
|
|
106
106
|
import {
|
|
107
107
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
108
108
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
} from "./chunk-XPBEJB27.js";
|
|
122
122
|
import {
|
|
123
123
|
ConfigManager
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-NQYNIK4C.js";
|
|
125
125
|
import "./chunk-5ULLIOVC.js";
|
|
126
126
|
import {
|
|
127
127
|
formatGitContextForPrompt,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
getGitRoot
|
|
130
130
|
} from "./chunk-HOSJZMQS.js";
|
|
131
131
|
import "./chunk-4BKXL7SM.js";
|
|
132
|
-
import "./chunk-
|
|
132
|
+
import "./chunk-PEUYYZQU.js";
|
|
133
133
|
import {
|
|
134
134
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
135
135
|
AUTHOR,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
SKILLS_DIR_NAME,
|
|
147
147
|
VERSION,
|
|
148
148
|
buildUserIdentityPrompt
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-QNIFXUKV.js";
|
|
150
150
|
import "./chunk-NVUCDUXE.js";
|
|
151
151
|
import "./chunk-KHYD3WXE.js";
|
|
152
152
|
import {
|
|
@@ -870,6 +870,50 @@ async function handleSession(args, ctx) {
|
|
|
870
870
|
}
|
|
871
871
|
if (sub === "delete" && args[1]) {
|
|
872
872
|
const targetId = args[1];
|
|
873
|
+
if (targetId === "--filter") {
|
|
874
|
+
let filterMessages;
|
|
875
|
+
for (let i = 1; i < args.length; i++) {
|
|
876
|
+
if (args[i] === "--filter" && i + 1 < args.length) {
|
|
877
|
+
const val = args[i + 1];
|
|
878
|
+
i++;
|
|
879
|
+
const eq = val.indexOf("=");
|
|
880
|
+
if (eq > 0) {
|
|
881
|
+
const key = val.slice(0, eq);
|
|
882
|
+
const vals = val.slice(eq + 1).split(",").map((s) => s.trim().toLowerCase());
|
|
883
|
+
if (key === "messages") {
|
|
884
|
+
const n = Number(vals[0]);
|
|
885
|
+
if (Number.isFinite(n) && n >= 0) filterMessages = n;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
if (filterMessages === void 0) {
|
|
891
|
+
ctx.send({ type: "error", message: "Usage: /session delete --filter messages=N" });
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
const list2 = ctx.sessions.listSessions();
|
|
895
|
+
const matches = list2.filter((s) => s.messageCount === filterMessages);
|
|
896
|
+
if (matches.length === 0) {
|
|
897
|
+
ctx.send({ type: "info", message: `No sessions with ${filterMessages} message(s) found.` });
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
let deleted = 0;
|
|
901
|
+
let failed = 0;
|
|
902
|
+
for (const s of matches) {
|
|
903
|
+
if (ctx.sessions.deleteSession(s.id)) {
|
|
904
|
+
deleted++;
|
|
905
|
+
} else {
|
|
906
|
+
failed++;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
if (!ctx.sessions.current) {
|
|
910
|
+
ctx.sessions.createSession(ctx.currentProvider, ctx.currentModel);
|
|
911
|
+
ctx.resetWebSessionUsage();
|
|
912
|
+
}
|
|
913
|
+
ctx.send({ type: "info", message: `Deleted ${deleted} session(s) with ${filterMessages} message(s)${failed > 0 ? `, ${failed} failed` : ""}.` });
|
|
914
|
+
ctx.sendSessionList();
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
873
917
|
const cachedKey = ctx.unsavedSessions.has(targetId) ? targetId : [...ctx.unsavedSessions.keys()].find((k) => k.startsWith(targetId));
|
|
874
918
|
if (cachedKey) {
|
|
875
919
|
ctx.unsavedSessions.delete(cachedKey);
|
|
@@ -944,7 +988,7 @@ async function handleSession(args, ctx) {
|
|
|
944
988
|
}
|
|
945
989
|
return;
|
|
946
990
|
}
|
|
947
|
-
ctx.send({ type: "info", message: "Usage: /session new | list | load <id> | delete <id> | rename <id> <title>" });
|
|
991
|
+
ctx.send({ type: "info", message: "Usage: /session new | list | load <id> | delete <id> | delete --filter messages=N | rename <id> <title>" });
|
|
948
992
|
}
|
|
949
993
|
async function handleExport(args, ctx) {
|
|
950
994
|
const format = args[0] === "json" ? "json" : "md";
|
|
@@ -1554,7 +1598,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
1554
1598
|
async function handleTest(args, ctx) {
|
|
1555
1599
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1556
1600
|
try {
|
|
1557
|
-
const { executeTests } = await import("./run-tests-
|
|
1601
|
+
const { executeTests } = await import("./run-tests-FKBEUFKX.js");
|
|
1558
1602
|
const argStr = args.join(" ").trim();
|
|
1559
1603
|
let testArgs = {};
|
|
1560
1604
|
if (argStr) {
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GOMPGWWO.js";
|
|
7
7
|
import "./chunk-K3CF65QH.js";
|
|
8
8
|
import "./chunk-UUSRWSSX.js";
|
|
9
9
|
import "./chunk-CKH4KQ4E.js";
|
|
10
10
|
import "./chunk-BXP6YZ2P.js";
|
|
11
11
|
import {
|
|
12
12
|
runTool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-D5A2K4AO.js";
|
|
14
14
|
import {
|
|
15
15
|
getDangerLevel,
|
|
16
16
|
runLeanAgentLoop
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
import "./chunk-5ULLIOVC.js";
|
|
19
19
|
import "./chunk-HOSJZMQS.js";
|
|
20
20
|
import "./chunk-4BKXL7SM.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-PEUYYZQU.js";
|
|
22
22
|
import {
|
|
23
23
|
SUBAGENT_ALLOWED_TOOLS
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QNIFXUKV.js";
|
|
25
25
|
import "./chunk-NVUCDUXE.js";
|
|
26
26
|
import "./chunk-KHYD3WXE.js";
|
|
27
27
|
import "./chunk-B5TYJO7V.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./chunk-E44DTERW.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NQYNIK4C.js";
|
|
12
12
|
import "./chunk-5ULLIOVC.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-QNIFXUKV.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|