jinzd-ai-cli 0.4.270 → 0.4.272
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-IMLMUXJL.js → batch-3KHEEICT.js} +2 -2
- package/dist/{chat-index-7MMTGQNA.js → chat-index-2D5GK2DB.js} +2 -2
- package/dist/{chat-index-Q6BKWWAM.js → chat-index-TDU3S2MG.js} +2 -2
- package/dist/{chunk-BOMB6XCF.js → chunk-257ZLWOP.js} +2 -2
- package/dist/{chunk-B5TYJO7V.js → chunk-3FEZSLGI.js} +51 -6
- package/dist/{chunk-F26YTEMB.js → chunk-5NZVRFLP.js} +4 -4
- package/dist/{chunk-UDUE4DAE.js → chunk-A5ICBOQ6.js} +1 -1
- package/dist/{chunk-JJVVCWO4.js → chunk-AHNTBH7G.js} +1 -1
- package/dist/{chunk-OBULDJSU.js → chunk-CGDYO52A.js} +1 -1
- package/dist/{chunk-TG4PF7FZ.js → chunk-EZ6VXKJV.js} +1 -1
- package/dist/{chunk-FXCDD7JS.js → chunk-FBYFNBUD.js} +3 -3
- package/dist/{chunk-YVTASHS5.js → chunk-FSC6KEWU.js} +51 -6
- package/dist/{chunk-6RPGQ5CG.js → chunk-GHWZVPUV.js} +1 -1
- package/dist/{chunk-DIJIYWQE.js → chunk-JMU5DELU.js} +11 -11
- package/dist/{chunk-X3JPBJ6C.js → chunk-MFUAK7OM.js} +6 -6
- package/dist/{chunk-JQXXPTWL.js → chunk-MX75TNE5.js} +1 -1
- package/dist/{chunk-YHLTSZVH.js → chunk-PXWOJEFG.js} +8 -8
- package/dist/{chunk-75SPJKDY.js → chunk-WMVG5E56.js} +1 -1
- package/dist/{chunk-M3GDYEUH.js → chunk-XBOP6NLW.js} +4 -4
- package/dist/chunk-XNFIYS7G.js +82 -0
- package/dist/{chunk-PLFXDRNX.js → chunk-XUNQSAUM.js} +1 -1
- package/dist/{chunk-ZWEZNKDW.js → chunk-YOVHMQEJ.js} +1 -1
- package/dist/{chunk-HOT76ATM.js → chunk-Z75H56SJ.js} +8 -8
- package/dist/{ci-HQVXWJ53.js → ci-6CTWCDH3.js} +4 -4
- package/dist/{ci-format-762IL4OM.js → ci-format-MC5HZBCE.js} +2 -2
- package/dist/config-command-E5DHADEV.js +11 -0
- package/dist/{constants-4TPE3JSV.js → constants-SGKY75QU.js} +1 -1
- package/dist/{doctor-cli-3ES6NFVL.js → doctor-cli-7CW4BIGM.js} +4 -4
- package/dist/electron-server.js +96 -28
- package/dist/{hub-QXRWPBJP.js → hub-ORAAJOPT.js} +2 -2
- package/dist/index.js +83 -99
- package/dist/{persist-A2QSXYFY.js → persist-PQM4BRI4.js} +3 -3
- package/dist/{persistent-memory-F4JPWYZJ.js → persistent-memory-6NQQ2H2B.js} +3 -3
- package/dist/{persistent-memory-URIJJJ3N.js → persistent-memory-6SB5ZUOI.js} +3 -3
- package/dist/{pr-HVVHZOJ2.js → pr-FNKV6IWI.js} +5 -5
- package/dist/{run-tests-WM7TMO2N.js → run-tests-34HXDZXM.js} +2 -2
- package/dist/{run-tests-UZG6SVJ5.js → run-tests-PS37BVOI.js} +2 -2
- package/dist/{server-HPRLFLOI.js → server-IEOQIQPC.js} +53 -56
- package/dist/{server-E5OBXT33.js → server-OZTSIFXL.js} +10 -10
- package/dist/{task-orchestrator-HJUUL55Y.js → task-orchestrator-77MEVKT6.js} +12 -12
- package/dist/{usage-L3DUPHD6.js → usage-RI6YOAOP.js} +2 -2
- package/package.json +1 -1
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z75H56SJ.js";
|
|
6
|
+
import "./chunk-XBOP6NLW.js";
|
|
6
7
|
import "./chunk-AUEX6RNY.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-M3GDYEUH.js";
|
|
8
|
+
import "./chunk-5NZVRFLP.js";
|
|
9
9
|
import "./chunk-3OBY7WSS.js";
|
|
10
10
|
import "./chunk-TU3L3PW7.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
|
-
import "./chunk-75SPJKDY.js";
|
|
13
12
|
import "./chunk-IW3Q7AE5.js";
|
|
13
|
+
import "./chunk-WMVG5E56.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|
|
16
16
|
runDoctorCli
|
package/dist/electron-server.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
searchCandidates,
|
|
8
8
|
searchChatMemory,
|
|
9
9
|
updateSessionInIndex
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YOVHMQEJ.js";
|
|
11
11
|
import {
|
|
12
12
|
fileCheckpoints
|
|
13
13
|
} from "./chunk-SKET65WZ.js";
|
|
@@ -36,14 +36,14 @@ import {
|
|
|
36
36
|
touchMemoryReferences,
|
|
37
37
|
updateMemoryApproval,
|
|
38
38
|
updateMemoryEntry
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-257ZLWOP.js";
|
|
40
40
|
import {
|
|
41
41
|
redactJson,
|
|
42
42
|
scanString
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-FSC6KEWU.js";
|
|
44
44
|
import {
|
|
45
45
|
runTestsTool
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-A5ICBOQ6.js";
|
|
47
47
|
import {
|
|
48
48
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
49
49
|
APP_NAME,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
77
77
|
VERSION,
|
|
78
78
|
buildUserIdentityPrompt
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-AHNTBH7G.js";
|
|
80
80
|
import {
|
|
81
81
|
hasSemanticIndex,
|
|
82
82
|
semanticSearch
|
|
@@ -16039,7 +16039,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
16039
16039
|
Cost: ${formatCost(cost)}` : "";
|
|
16040
16040
|
let memoryLine = "";
|
|
16041
16041
|
try {
|
|
16042
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
16042
|
+
const { countPendingMemories } = await import("./persistent-memory-6SB5ZUOI.js");
|
|
16043
16043
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
16044
16044
|
if (pending > 0) memoryLine = `
|
|
16045
16045
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -16852,7 +16852,7 @@ async function handleTest(args, ctx) {
|
|
|
16852
16852
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
16853
16853
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
16854
16854
|
}
|
|
16855
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
16855
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-PS37BVOI.js")).executeTests;
|
|
16856
16856
|
const report = await runTests(testArgs);
|
|
16857
16857
|
ctx.send({ type: "info", message: report });
|
|
16858
16858
|
} catch (err) {
|
|
@@ -17110,7 +17110,7 @@ async function handleMemory(args, ctx) {
|
|
|
17110
17110
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
17111
17111
|
} else if (sub === "export") {
|
|
17112
17112
|
if (args[1] === "md") {
|
|
17113
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
17113
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-6SB5ZUOI.js");
|
|
17114
17114
|
ctx.send({
|
|
17115
17115
|
type: "export_data",
|
|
17116
17116
|
format: "md",
|
|
@@ -17275,28 +17275,96 @@ function applyProfileCommand(args, profile) {
|
|
|
17275
17275
|
};
|
|
17276
17276
|
}
|
|
17277
17277
|
|
|
17278
|
+
// src/core/config-command.ts
|
|
17279
|
+
var CONFIG_USAGE = "Usage: config [show | get <path> | set <path> <value>]";
|
|
17280
|
+
var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
17281
|
+
function maskSecret(value) {
|
|
17282
|
+
if (value.length <= 8) return "****";
|
|
17283
|
+
return `${value.slice(0, 4)}****${value.slice(-4)}`;
|
|
17284
|
+
}
|
|
17285
|
+
function maskConfigSecrets(config) {
|
|
17286
|
+
const apiKeys = config["apiKeys"];
|
|
17287
|
+
if (apiKeys && typeof apiKeys === "object") {
|
|
17288
|
+
const keys = apiKeys;
|
|
17289
|
+
for (const k of Object.keys(keys)) {
|
|
17290
|
+
if (typeof keys[k] === "string") keys[k] = maskSecret(keys[k]);
|
|
17291
|
+
}
|
|
17292
|
+
}
|
|
17293
|
+
const custom = config["customProviders"];
|
|
17294
|
+
if (custom && typeof custom === "object") {
|
|
17295
|
+
for (const entry of Object.values(custom)) {
|
|
17296
|
+
if (entry && typeof entry === "object" && typeof entry["apiKey"] === "string") {
|
|
17297
|
+
const e = entry;
|
|
17298
|
+
e["apiKey"] = maskSecret(e["apiKey"]);
|
|
17299
|
+
}
|
|
17300
|
+
}
|
|
17301
|
+
}
|
|
17302
|
+
return config;
|
|
17303
|
+
}
|
|
17304
|
+
function applyConfigCommand(args, target) {
|
|
17305
|
+
const sub = args[0]?.toLowerCase();
|
|
17306
|
+
if (!sub) return { action: "wizard", changed: false, isError: false };
|
|
17307
|
+
if (sub === "show") {
|
|
17308
|
+
return {
|
|
17309
|
+
action: "show",
|
|
17310
|
+
json: JSON.stringify(maskConfigSecrets(target.toJSON()), null, 2),
|
|
17311
|
+
changed: false,
|
|
17312
|
+
isError: false
|
|
17313
|
+
};
|
|
17314
|
+
}
|
|
17315
|
+
if (sub === "get") {
|
|
17316
|
+
const path3 = args[1]?.trim();
|
|
17317
|
+
if (!path3) {
|
|
17318
|
+
return { action: "usage", summary: "Usage: config get <path> (e.g. ui.theme)", changed: false, isError: true };
|
|
17319
|
+
}
|
|
17320
|
+
const value = target.getByPath(path3);
|
|
17321
|
+
const shown = value === void 0 ? "(undefined)" : typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
17322
|
+
return { action: "get", summary: `${path3} = ${shown}`, changed: false, isError: false };
|
|
17323
|
+
}
|
|
17324
|
+
if (sub === "set") {
|
|
17325
|
+
const path3 = args[1]?.trim();
|
|
17326
|
+
const value = args.slice(2).join(" ").trim();
|
|
17327
|
+
if (!path3 || value === "") {
|
|
17328
|
+
return {
|
|
17329
|
+
action: "usage",
|
|
17330
|
+
summary: "Usage: config set <path> <value> (e.g. ui.theme light)",
|
|
17331
|
+
changed: false,
|
|
17332
|
+
isError: true
|
|
17333
|
+
};
|
|
17334
|
+
}
|
|
17335
|
+
if (path3.split(".").some((k) => FORBIDDEN_KEYS.has(k))) {
|
|
17336
|
+
return { action: "set", summary: `Forbidden path segment in "${path3}"`, changed: false, isError: true };
|
|
17337
|
+
}
|
|
17338
|
+
try {
|
|
17339
|
+
target.setByPath(path3, value);
|
|
17340
|
+
} catch (err) {
|
|
17341
|
+
return {
|
|
17342
|
+
action: "set",
|
|
17343
|
+
summary: `Config error: ${err instanceof Error ? err.message : String(err)}`,
|
|
17344
|
+
changed: false,
|
|
17345
|
+
isError: true
|
|
17346
|
+
};
|
|
17347
|
+
}
|
|
17348
|
+
return { action: "set", summary: `Set ${path3} = ${value}`, changed: true, isError: false };
|
|
17349
|
+
}
|
|
17350
|
+
return { action: "usage", summary: CONFIG_USAGE, changed: false, isError: true };
|
|
17351
|
+
}
|
|
17352
|
+
|
|
17278
17353
|
// src/web/commands/security-commands.ts
|
|
17279
17354
|
async function handleConfig(args, ctx) {
|
|
17280
|
-
const
|
|
17281
|
-
if (
|
|
17282
|
-
ctx.
|
|
17355
|
+
const outcome = applyConfigCommand(args, ctx.config);
|
|
17356
|
+
if (outcome.action === "show" || outcome.action === "wizard") {
|
|
17357
|
+
const json = outcome.json ?? JSON.stringify(maskConfigSecrets(ctx.config.toJSON()), null, 2);
|
|
17358
|
+
ctx.send({ type: "info", message: `\u2699\uFE0F Configuration (secrets masked):
|
|
17283
17359
|
\`\`\`json
|
|
17284
|
-
${
|
|
17360
|
+
${json}
|
|
17285
17361
|
\`\`\`` });
|
|
17286
|
-
|
|
17287
|
-
const val = ctx.config.getByPath(args[1]);
|
|
17288
|
-
const display = typeof val === "object" ? JSON.stringify(val, null, 2) : String(val ?? "undefined");
|
|
17289
|
-
ctx.send({ type: "info", message: `${args[1]} = ${display}` });
|
|
17290
|
-
} else if (sub === "set" && args[1] && args[2] !== void 0) {
|
|
17291
|
-
try {
|
|
17292
|
-
ctx.config.setByPath(args[1], args.slice(2).join(" "));
|
|
17293
|
-
ctx.send({ type: "info", message: `\u2713 ${args[1]} = ${args.slice(2).join(" ")}` });
|
|
17294
|
-
} catch (err) {
|
|
17295
|
-
ctx.send({ type: "error", message: `Config error: ${err.message}` });
|
|
17296
|
-
}
|
|
17297
|
-
} else {
|
|
17298
|
-
ctx.send({ type: "info", message: "Usage: /config [show] | /config get <key> | /config set <key> <value>" });
|
|
17362
|
+
return;
|
|
17299
17363
|
}
|
|
17364
|
+
ctx.send({
|
|
17365
|
+
type: outcome.isError ? "error" : "info",
|
|
17366
|
+
message: (outcome.changed ? "\u2713 " : "") + (outcome.summary ?? "")
|
|
17367
|
+
});
|
|
17300
17368
|
}
|
|
17301
17369
|
async function handleDoctor(_args, ctx) {
|
|
17302
17370
|
const report = buildDoctorReport({
|
|
@@ -19032,7 +19100,7 @@ Backup saved: ${result.backupPath}` : "";
|
|
|
19032
19100
|
return;
|
|
19033
19101
|
}
|
|
19034
19102
|
try {
|
|
19035
|
-
const { searchChatMemory: searchChatMemory2, loadChatIndex: loadChatIndex2 } = await import("./chat-index-
|
|
19103
|
+
const { searchChatMemory: searchChatMemory2, loadChatIndex: loadChatIndex2 } = await import("./chat-index-TDU3S2MG.js");
|
|
19036
19104
|
const loaded = loadChatIndex2();
|
|
19037
19105
|
if (!loaded || loaded.idx.chunks.length === 0) {
|
|
19038
19106
|
this.send({ type: "memory_hits", query: q, hits: [], indexMissing: true });
|
|
@@ -19068,7 +19136,7 @@ Backup saved: ${result.backupPath}` : "";
|
|
|
19068
19136
|
}
|
|
19069
19137
|
async handleMemoryStatus() {
|
|
19070
19138
|
try {
|
|
19071
|
-
const { getChatIndexStatus } = await import("./chat-index-
|
|
19139
|
+
const { getChatIndexStatus } = await import("./chat-index-TDU3S2MG.js");
|
|
19072
19140
|
const s = getChatIndexStatus();
|
|
19073
19141
|
this.send({
|
|
19074
19142
|
type: "memory_status",
|
|
@@ -19093,7 +19161,7 @@ Backup saved: ${result.backupPath}` : "";
|
|
|
19093
19161
|
type: "info",
|
|
19094
19162
|
message: full ? "\u{1F9E0} Rebuilding chat memory index (this may take a while on first run \u2014 ~117 MB embedder)." : "\u{1F9E0} Refreshing chat memory index (incremental)\u2026"
|
|
19095
19163
|
});
|
|
19096
|
-
const { buildChatIndex } = await import("./chat-index-
|
|
19164
|
+
const { buildChatIndex } = await import("./chat-index-TDU3S2MG.js");
|
|
19097
19165
|
const stats = await buildChatIndex({
|
|
19098
19166
|
full,
|
|
19099
19167
|
onProgress: (p) => {
|
|
@@ -143,7 +143,7 @@ ${content}`);
|
|
|
143
143
|
const state = await runDiscussion(config, providers, options.topic);
|
|
144
144
|
if (options.save !== false && state.messages.length > 0) {
|
|
145
145
|
try {
|
|
146
|
-
const { persistDiscussion } = await import("./persist-
|
|
146
|
+
const { persistDiscussion } = await import("./persist-PQM4BRI4.js");
|
|
147
147
|
const { path } = await persistDiscussion(state, configManager, defaultProvider, defaultModel);
|
|
148
148
|
console.log(chalk.dim(`
|
|
149
149
|
\u{1F4BE} Saved to history \u2014 open it in the Web UI and hit \u{1F3AC} to replay.
|
|
@@ -158,7 +158,7 @@ ${content}`);
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
161
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
161
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-77MEVKT6.js");
|
|
162
162
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
163
163
|
let interrupted = false;
|
|
164
164
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
sessionHasMeaningfulContent,
|
|
26
26
|
setupProxy,
|
|
27
27
|
stripRoutingTags
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MFUAK7OM.js";
|
|
29
29
|
import {
|
|
30
30
|
CostTracker,
|
|
31
31
|
computeCost,
|
|
@@ -33,16 +33,6 @@ import {
|
|
|
33
33
|
getPricing,
|
|
34
34
|
setCostCurrency
|
|
35
35
|
} from "./chunk-JT6UN5C6.js";
|
|
36
|
-
import {
|
|
37
|
-
buildReviewPrompt,
|
|
38
|
-
buildSecurityReviewPrompt
|
|
39
|
-
} from "./chunk-HLWUDRBO.js";
|
|
40
|
-
import {
|
|
41
|
-
NO_THINKING,
|
|
42
|
-
applyThinkingFlag,
|
|
43
|
-
chatParamsFrom,
|
|
44
|
-
thinkingParamsFor
|
|
45
|
-
} from "./chunk-6YZEZFX5.js";
|
|
46
36
|
import {
|
|
47
37
|
ToolExecutor,
|
|
48
38
|
ToolRegistry,
|
|
@@ -64,7 +54,23 @@ import {
|
|
|
64
54
|
setMaxOutputCap,
|
|
65
55
|
spawnAgentContext,
|
|
66
56
|
undoStack
|
|
67
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-JMU5DELU.js";
|
|
58
|
+
import {
|
|
59
|
+
buildReviewPrompt,
|
|
60
|
+
buildSecurityReviewPrompt
|
|
61
|
+
} from "./chunk-HLWUDRBO.js";
|
|
62
|
+
import {
|
|
63
|
+
NO_THINKING,
|
|
64
|
+
applyThinkingFlag,
|
|
65
|
+
chatParamsFrom,
|
|
66
|
+
thinkingParamsFor
|
|
67
|
+
} from "./chunk-6YZEZFX5.js";
|
|
68
|
+
import {
|
|
69
|
+
buildChatIndex,
|
|
70
|
+
clearChatIndex,
|
|
71
|
+
getChatIndexStatus,
|
|
72
|
+
searchChatMemory
|
|
73
|
+
} from "./chunk-GHWZVPUV.js";
|
|
68
74
|
import {
|
|
69
75
|
addMemoryEntry,
|
|
70
76
|
backupMemoryStore,
|
|
@@ -89,11 +95,12 @@ import {
|
|
|
89
95
|
touchMemoryReferences,
|
|
90
96
|
updateMemoryApproval,
|
|
91
97
|
updateMemoryEntry
|
|
92
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-PXWOJEFG.js";
|
|
93
99
|
import "./chunk-GLSR2NR3.js";
|
|
94
100
|
import "./chunk-UUSRWSSX.js";
|
|
95
101
|
import "./chunk-CKH4KQ4E.js";
|
|
96
102
|
import "./chunk-BXP6YZ2P.js";
|
|
103
|
+
import "./chunk-KHYD3WXE.js";
|
|
97
104
|
import {
|
|
98
105
|
initTheme,
|
|
99
106
|
theme
|
|
@@ -101,20 +108,18 @@ import {
|
|
|
101
108
|
import {
|
|
102
109
|
SessionManager,
|
|
103
110
|
getContentText
|
|
104
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-CGDYO52A.js";
|
|
112
|
+
import "./chunk-NYNSYLFY.js";
|
|
113
|
+
import {
|
|
114
|
+
DEFAULT_PATTERNS,
|
|
115
|
+
scanString
|
|
116
|
+
} from "./chunk-3FEZSLGI.js";
|
|
105
117
|
import {
|
|
106
118
|
buildDoctorReport,
|
|
107
119
|
formatDoctorReport,
|
|
108
120
|
loadContextFiles,
|
|
109
121
|
writeCrashLog
|
|
110
|
-
} from "./chunk-
|
|
111
|
-
import {
|
|
112
|
-
ProviderRegistry,
|
|
113
|
-
listBuiltInProviderMetadata
|
|
114
|
-
} from "./chunk-AUEX6RNY.js";
|
|
115
|
-
import {
|
|
116
|
-
ConfigManager
|
|
117
|
-
} from "./chunk-F26YTEMB.js";
|
|
122
|
+
} from "./chunk-Z75H56SJ.js";
|
|
118
123
|
import {
|
|
119
124
|
describePlugin,
|
|
120
125
|
getActivePluginAssets,
|
|
@@ -131,7 +136,14 @@ import {
|
|
|
131
136
|
trustHook,
|
|
132
137
|
trustPlugin,
|
|
133
138
|
untrustHook
|
|
134
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-XBOP6NLW.js";
|
|
140
|
+
import {
|
|
141
|
+
ProviderRegistry,
|
|
142
|
+
listBuiltInProviderMetadata
|
|
143
|
+
} from "./chunk-AUEX6RNY.js";
|
|
144
|
+
import {
|
|
145
|
+
ConfigManager
|
|
146
|
+
} from "./chunk-5NZVRFLP.js";
|
|
135
147
|
import {
|
|
136
148
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
137
149
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -162,10 +174,16 @@ import {
|
|
|
162
174
|
getGitContext,
|
|
163
175
|
getGitRoot
|
|
164
176
|
} from "./chunk-HOSJZMQS.js";
|
|
177
|
+
import {
|
|
178
|
+
atomicWriteFileSync
|
|
179
|
+
} from "./chunk-IW3Q7AE5.js";
|
|
180
|
+
import {
|
|
181
|
+
applyConfigCommand
|
|
182
|
+
} from "./chunk-XNFIYS7G.js";
|
|
165
183
|
import {
|
|
166
184
|
fileCheckpoints
|
|
167
185
|
} from "./chunk-4BKXL7SM.js";
|
|
168
|
-
import "./chunk-
|
|
186
|
+
import "./chunk-EZ6VXKJV.js";
|
|
169
187
|
import {
|
|
170
188
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
171
189
|
AUTHOR,
|
|
@@ -183,22 +201,7 @@ import {
|
|
|
183
201
|
SKILLS_DIR_NAME,
|
|
184
202
|
VERSION,
|
|
185
203
|
buildUserIdentityPrompt
|
|
186
|
-
} from "./chunk-
|
|
187
|
-
import {
|
|
188
|
-
buildChatIndex,
|
|
189
|
-
clearChatIndex,
|
|
190
|
-
getChatIndexStatus,
|
|
191
|
-
searchChatMemory
|
|
192
|
-
} from "./chunk-6RPGQ5CG.js";
|
|
193
|
-
import "./chunk-KHYD3WXE.js";
|
|
194
|
-
import "./chunk-NYNSYLFY.js";
|
|
195
|
-
import {
|
|
196
|
-
DEFAULT_PATTERNS,
|
|
197
|
-
scanString
|
|
198
|
-
} from "./chunk-B5TYJO7V.js";
|
|
199
|
-
import {
|
|
200
|
-
atomicWriteFileSync
|
|
201
|
-
} from "./chunk-IW3Q7AE5.js";
|
|
204
|
+
} from "./chunk-WMVG5E56.js";
|
|
202
205
|
|
|
203
206
|
// src/index.ts
|
|
204
207
|
import { program } from "commander";
|
|
@@ -1404,7 +1407,7 @@ No tools match "${filter}".
|
|
|
1404
1407
|
const { join: join6 } = await import("path");
|
|
1405
1408
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1406
1409
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1407
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1410
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-SGKY75QU.js");
|
|
1408
1411
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1409
1412
|
const cwd = process.cwd();
|
|
1410
1413
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -1615,57 +1618,24 @@ function createSecurityCommands() {
|
|
|
1615
1618
|
description: "Configuration: wizard, get/set values, show all",
|
|
1616
1619
|
usage: "/config [set <path> <value> | get <path> | show]",
|
|
1617
1620
|
async execute(args, ctx) {
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1620
|
-
if (!sub) {
|
|
1621
|
+
const outcome = applyConfigCommand(args, ctx.config);
|
|
1622
|
+
if (outcome.action === "wizard") {
|
|
1621
1623
|
await ctx.runSetupWizard();
|
|
1622
1624
|
return;
|
|
1623
1625
|
}
|
|
1624
|
-
if (
|
|
1625
|
-
|
|
1626
|
-
if (masked.apiKeys && typeof masked.apiKeys === "object") {
|
|
1627
|
-
const keys = masked.apiKeys;
|
|
1628
|
-
for (const key of Object.keys(keys)) {
|
|
1629
|
-
const val = keys[key];
|
|
1630
|
-
if (typeof val === "string" && val.length > 8) {
|
|
1631
|
-
keys[key] = val.slice(0, 4) + "****" + val.slice(-4);
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
console.log(JSON.stringify(masked, null, 2));
|
|
1626
|
+
if (outcome.action === "show") {
|
|
1627
|
+
console.log(outcome.json);
|
|
1636
1628
|
return;
|
|
1637
1629
|
}
|
|
1638
|
-
if (
|
|
1639
|
-
|
|
1640
|
-
if (!path) {
|
|
1641
|
-
console.log(theme.warning("Usage: /config get <path> (e.g. ui.theme)"));
|
|
1642
|
-
return;
|
|
1643
|
-
}
|
|
1644
|
-
const val = config.getByPath(path);
|
|
1645
|
-
if (val === void 0) {
|
|
1646
|
-
console.log(theme.dim(` ${path} = (undefined)`));
|
|
1647
|
-
} else {
|
|
1648
|
-
console.log(theme.dim(` ${path} = `) + chalk2.white(typeof val === "object" ? JSON.stringify(val) : String(val)));
|
|
1649
|
-
}
|
|
1630
|
+
if (outcome.isError) {
|
|
1631
|
+
console.log(theme.warning(` ${outcome.summary}`));
|
|
1650
1632
|
return;
|
|
1651
1633
|
}
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1654
|
-
const value = args.slice(2).join(" ").trim();
|
|
1655
|
-
if (!path || value === "") {
|
|
1656
|
-
console.log(theme.warning("Usage: /config set <path> <value> (e.g. ui.theme light)"));
|
|
1657
|
-
return;
|
|
1658
|
-
}
|
|
1659
|
-
const FORBIDDEN_KEYS = ["__proto__", "constructor", "prototype"];
|
|
1660
|
-
if (path.split(".").some((k) => FORBIDDEN_KEYS.includes(k))) {
|
|
1661
|
-
console.log(theme.error(` \u2717 Forbidden path segment: ${path}`));
|
|
1662
|
-
return;
|
|
1663
|
-
}
|
|
1664
|
-
config.setByPath(path, value);
|
|
1665
|
-
console.log(theme.success(` \u2713 Set ${path} = ${value}`));
|
|
1634
|
+
if (outcome.changed) {
|
|
1635
|
+
console.log(theme.success(` \u2713 ${outcome.summary}`));
|
|
1666
1636
|
return;
|
|
1667
1637
|
}
|
|
1668
|
-
console.log(theme.
|
|
1638
|
+
console.log(theme.dim(` ${outcome.summary}`));
|
|
1669
1639
|
}
|
|
1670
1640
|
},
|
|
1671
1641
|
{
|
|
@@ -2357,7 +2327,7 @@ function createReviewCommands() {
|
|
|
2357
2327
|
usage: "/test [command|filter]",
|
|
2358
2328
|
async execute(args, ctx) {
|
|
2359
2329
|
try {
|
|
2360
|
-
const { executeTests } = await import("./run-tests-
|
|
2330
|
+
const { executeTests } = await import("./run-tests-34HXDZXM.js");
|
|
2361
2331
|
const argStr = args.join(" ").trim();
|
|
2362
2332
|
let testArgs = {};
|
|
2363
2333
|
if (argStr) {
|
|
@@ -5740,7 +5710,7 @@ Session '${this.resumeSessionId}' not found.
|
|
|
5740
5710
|
})();
|
|
5741
5711
|
void (async () => {
|
|
5742
5712
|
try {
|
|
5743
|
-
const { getChatIndexStatus: getChatIndexStatus2, buildChatIndex: buildChatIndex2 } = await import("./chat-index-
|
|
5713
|
+
const { getChatIndexStatus: getChatIndexStatus2, buildChatIndex: buildChatIndex2 } = await import("./chat-index-2D5GK2DB.js");
|
|
5744
5714
|
const initial = getChatIndexStatus2();
|
|
5745
5715
|
this.chatMemoryStatus = {
|
|
5746
5716
|
exists: initial.exists,
|
|
@@ -7521,12 +7491,26 @@ program.option("--provider <name>", `AI provider to use (${builtInProviderIds},
|
|
|
7521
7491
|
await startRepl(options);
|
|
7522
7492
|
}
|
|
7523
7493
|
});
|
|
7524
|
-
program.command("config").description("Configure API keys and preferences").action(async () => {
|
|
7494
|
+
program.command("config [action] [path] [value...]").description("Configure API keys and preferences: wizard (no args) | show | get <path> | set <path> <value>").action(async (action, path, valueParts) => {
|
|
7525
7495
|
const config = new ConfigManager();
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7496
|
+
if (!action) {
|
|
7497
|
+
const { SetupWizard } = await import("./setup-wizard-S55ICNHH.js");
|
|
7498
|
+
const wizard = new SetupWizard(config);
|
|
7499
|
+
await wizard.runFull();
|
|
7500
|
+
console.log("Configuration saved.");
|
|
7501
|
+
return;
|
|
7502
|
+
}
|
|
7503
|
+
const { applyConfigCommand: applyConfigCommand2 } = await import("./config-command-E5DHADEV.js");
|
|
7504
|
+
const outcome = applyConfigCommand2([action, ...path ? [path] : [], ...valueParts ?? []], config);
|
|
7505
|
+
if (outcome.action === "show") {
|
|
7506
|
+
console.log(outcome.json);
|
|
7507
|
+
return;
|
|
7508
|
+
}
|
|
7509
|
+
if (outcome.isError) {
|
|
7510
|
+
console.error(outcome.summary);
|
|
7511
|
+
process.exit(1);
|
|
7512
|
+
}
|
|
7513
|
+
console.log(outcome.changed ? `\u2713 ${outcome.summary}` : outcome.summary);
|
|
7530
7514
|
});
|
|
7531
7515
|
program.command("providers").description("List all AI providers and their configuration status").action(async () => {
|
|
7532
7516
|
const config = new ConfigManager();
|
|
@@ -7562,7 +7546,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7562
7546
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7563
7547
|
process.exit(1);
|
|
7564
7548
|
}
|
|
7565
|
-
const { startWebServer } = await import("./server-
|
|
7549
|
+
const { startWebServer } = await import("./server-IEOQIQPC.js");
|
|
7566
7550
|
await startWebServer({ port, host: options.host });
|
|
7567
7551
|
});
|
|
7568
7552
|
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) => {
|
|
@@ -7729,11 +7713,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7729
7713
|
console.log(footer + "\n");
|
|
7730
7714
|
});
|
|
7731
7715
|
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) => {
|
|
7732
|
-
const { runUsageCli } = await import("./usage-
|
|
7716
|
+
const { runUsageCli } = await import("./usage-RI6YOAOP.js");
|
|
7733
7717
|
await runUsageCli(options);
|
|
7734
7718
|
});
|
|
7735
7719
|
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) => {
|
|
7736
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7720
|
+
const { runDoctorCli } = await import("./doctor-cli-7CW4BIGM.js");
|
|
7737
7721
|
const argv = process.argv.slice(2);
|
|
7738
7722
|
await runDoctorCli({
|
|
7739
7723
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -7742,7 +7726,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
7742
7726
|
});
|
|
7743
7727
|
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) => {
|
|
7744
7728
|
try {
|
|
7745
|
-
const batch = await import("./batch-
|
|
7729
|
+
const batch = await import("./batch-3KHEEICT.js");
|
|
7746
7730
|
switch (action) {
|
|
7747
7731
|
case "submit":
|
|
7748
7732
|
if (!arg) {
|
|
@@ -7785,7 +7769,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7785
7769
|
}
|
|
7786
7770
|
});
|
|
7787
7771
|
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) => {
|
|
7788
|
-
const { startMcpServer } = await import("./server-
|
|
7772
|
+
const { startMcpServer } = await import("./server-OZTSIFXL.js");
|
|
7789
7773
|
await startMcpServer({
|
|
7790
7774
|
allowDestructive: !!options.allowDestructive,
|
|
7791
7775
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7798,7 +7782,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7798
7782
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
7799
7783
|
process.exit(1);
|
|
7800
7784
|
}
|
|
7801
|
-
const { runPrCli } = await import("./pr-
|
|
7785
|
+
const { runPrCli } = await import("./pr-FNKV6IWI.js");
|
|
7802
7786
|
const result = await runPrCli({
|
|
7803
7787
|
action,
|
|
7804
7788
|
target,
|
|
@@ -7818,8 +7802,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7818
7802
|
process.exit(result.exitCode);
|
|
7819
7803
|
});
|
|
7820
7804
|
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) => {
|
|
7821
|
-
const { runCi } = await import("./ci-
|
|
7822
|
-
const { formatCiResult } = await import("./ci-format-
|
|
7805
|
+
const { runCi } = await import("./ci-6CTWCDH3.js");
|
|
7806
|
+
const { formatCiResult } = await import("./ci-format-MC5HZBCE.js");
|
|
7823
7807
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
7824
7808
|
if (formats > 1) {
|
|
7825
7809
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -7977,7 +7961,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7977
7961
|
config.get("customProviders"),
|
|
7978
7962
|
config.getConfigDir()
|
|
7979
7963
|
);
|
|
7980
|
-
const { startHub } = await import("./hub-
|
|
7964
|
+
const { startHub } = await import("./hub-ORAAJOPT.js");
|
|
7981
7965
|
await startHub(
|
|
7982
7966
|
{
|
|
7983
7967
|
topic: topic ?? "",
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
discussionToMessages,
|
|
4
4
|
persistDiscussion
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-MX75TNE5.js";
|
|
6
|
+
import "./chunk-CGDYO52A.js";
|
|
7
7
|
import "./chunk-NYNSYLFY.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3FEZSLGI.js";
|
|
9
9
|
import "./chunk-IW3Q7AE5.js";
|
|
10
10
|
export {
|
|
11
11
|
discussionToMessages,
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PXWOJEFG.js";
|
|
32
|
+
import "./chunk-3FEZSLGI.js";
|
|
32
33
|
import "./chunk-HOSJZMQS.js";
|
|
33
|
-
import "./chunk-75SPJKDY.js";
|
|
34
|
-
import "./chunk-B5TYJO7V.js";
|
|
35
34
|
import "./chunk-IW3Q7AE5.js";
|
|
35
|
+
import "./chunk-WMVG5E56.js";
|
|
36
36
|
export {
|
|
37
37
|
addMemoryEntry,
|
|
38
38
|
backupMemoryStore,
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-257ZLWOP.js";
|
|
31
|
+
import "./chunk-FSC6KEWU.js";
|
|
32
|
+
import "./chunk-AHNTBH7G.js";
|
|
33
33
|
import "./chunk-6BUTA5VW.js";
|
|
34
34
|
export {
|
|
35
35
|
addMemoryEntry,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-FBYFNBUD.js";
|
|
6
|
+
import "./chunk-XUNQSAUM.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
} from "./chunk-AUEX6RNY.js";
|
|
18
18
|
import {
|
|
19
19
|
ConfigManager
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5NZVRFLP.js";
|
|
21
21
|
import "./chunk-3OBY7WSS.js";
|
|
22
22
|
import "./chunk-TU3L3PW7.js";
|
|
23
|
+
import "./chunk-IW3Q7AE5.js";
|
|
23
24
|
import {
|
|
24
25
|
VERSION
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-IW3Q7AE5.js";
|
|
26
|
+
} from "./chunk-WMVG5E56.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/pr.ts
|
|
29
29
|
import { execFileSync } from "child_process";
|