jinzd-ai-cli 0.4.219 → 0.4.220
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 +101 -99
- package/README.zh-CN.md +40 -38
- package/dist/{batch-CHAPYRVM.js → batch-QBSKTLTO.js} +3 -3
- package/dist/{chunk-TZQHYZKT.js → chunk-5ULLIOVC.js} +1 -0
- package/dist/{chunk-KIEZBTVD.js → chunk-5WBNXYDJ.js} +2 -2
- package/dist/{chunk-GGKQHPB3.js → chunk-ALQN7VUJ.js} +1 -1
- package/dist/{chunk-EGMORH5W.js → chunk-CAUHLHDR.js} +1 -1
- package/dist/{chunk-GEN4O5QH.js → chunk-IZW5LMI6.js} +4 -4
- package/dist/{chunk-3I4RZYYO.js → chunk-P3LKFA54.js} +6 -5
- package/dist/{chunk-VADHBW7T.js → chunk-P4DYAGUI.js} +1 -1
- package/dist/{chunk-4ZN6L6K5.js → chunk-P4PTXCHY.js} +6 -5
- package/dist/{chunk-QMXC327F.js → chunk-PUBCJF7E.js} +213 -175
- package/dist/{chunk-U7KVU25H.js → chunk-QZYNRCPX.js} +1 -1
- package/dist/{chunk-QUFYBR6Q.js → chunk-VHX7KZDY.js} +2 -2
- package/dist/{chunk-64NUW3WL.js → chunk-Y25MSSUP.js} +1 -1
- package/dist/{ci-QPP66T53.js → ci-5SNXGM3M.js} +6 -6
- package/dist/{ci-format-5S3EEYRK.js → ci-format-57QQTHQE.js} +2 -2
- package/dist/{constants-FJOLBABC.js → constants-ML5KFEOH.js} +1 -1
- package/dist/{doctor-cli-KB2LUDF3.js → doctor-cli-ZRH3XZ3R.js} +6 -6
- package/dist/electron-server.js +505 -442
- package/dist/{hub-DIM7SKKY.js → hub-IPLMJ6TJ.js} +1 -1
- package/dist/index.js +72 -31
- package/dist/{pr-YQGH72N6.js → pr-GJYDAPK4.js} +8 -7
- package/dist/{run-tests-O76JIBCW.js → run-tests-GK5AIAV2.js} +1 -1
- package/dist/{run-tests-GEZSSNJM.js → run-tests-KLQAI5CX.js} +2 -2
- package/dist/{server-Z6O3G2LY.js → server-5FZDALHH.js} +5 -5
- package/dist/{server-5E2AIXVX.js → server-RU36PRSH.js} +43 -16
- package/dist/{task-orchestrator-5HBW4O64.js → task-orchestrator-JMHPVNUO.js} +5 -5
- package/dist/{usage-BMK6M5U3.js → usage-IRMRCCKN.js} +3 -3
- package/package.json +1 -1
|
@@ -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-JMHPVNUO.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-VHX7KZDY.js";
|
|
18
18
|
import {
|
|
19
19
|
buildReviewPrompt,
|
|
20
20
|
buildSecurityReviewPrompt
|
|
@@ -51,11 +51,11 @@ import {
|
|
|
51
51
|
theme,
|
|
52
52
|
undoStack,
|
|
53
53
|
updateMemoryApproval
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-IZW5LMI6.js";
|
|
55
55
|
import "./chunk-K3CF65QH.js";
|
|
56
56
|
import "./chunk-T2NL5ZIA.js";
|
|
57
57
|
import "./chunk-BXP6YZ2P.js";
|
|
58
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-Y25MSSUP.js";
|
|
59
59
|
import {
|
|
60
60
|
SessionManager,
|
|
61
61
|
getContentText
|
|
@@ -87,10 +87,10 @@ import {
|
|
|
87
87
|
formatDoctorReport,
|
|
88
88
|
loadContextFiles,
|
|
89
89
|
writeCrashLog
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-P3LKFA54.js";
|
|
91
91
|
import {
|
|
92
92
|
ProviderRegistry
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-PUBCJF7E.js";
|
|
94
94
|
import {
|
|
95
95
|
describePlugin,
|
|
96
96
|
getActivePluginAssets,
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
trustHook,
|
|
108
108
|
trustPlugin,
|
|
109
109
|
untrustHook
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-ALQN7VUJ.js";
|
|
111
111
|
import {
|
|
112
112
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
113
113
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -129,12 +129,12 @@ import {
|
|
|
129
129
|
} from "./chunk-XPBEJB27.js";
|
|
130
130
|
import {
|
|
131
131
|
ConfigManager
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-5WBNXYDJ.js";
|
|
133
133
|
import {
|
|
134
134
|
AuthError,
|
|
135
135
|
ProviderError,
|
|
136
136
|
RateLimitError
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-5ULLIOVC.js";
|
|
138
138
|
import {
|
|
139
139
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
140
140
|
AUTHOR,
|
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
SKILLS_DIR_NAME,
|
|
154
154
|
VERSION,
|
|
155
155
|
buildUserIdentityPrompt
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-QZYNRCPX.js";
|
|
157
157
|
import {
|
|
158
158
|
formatGitContextForPrompt,
|
|
159
159
|
getGitContext,
|
|
@@ -891,7 +891,7 @@ function createDefaultCommands() {
|
|
|
891
891
|
title: "Chat & model",
|
|
892
892
|
rows: [
|
|
893
893
|
["/provider <name>", "Switch AI provider"],
|
|
894
|
-
["/model
|
|
894
|
+
["/model [name|refresh|cache]", "Switch model or refresh live model cache"],
|
|
895
895
|
["/route [on|off|show|test <msg>]", "Smart model routing rules"],
|
|
896
896
|
["/think [on|off|status]", "Toggle Extended Thinking (deep reasoning)"],
|
|
897
897
|
["/plan [execute|exit|status]", "Enter/manage Plan Mode (read-only)"],
|
|
@@ -1059,13 +1059,46 @@ No commands match "${filter}".
|
|
|
1059
1059
|
},
|
|
1060
1060
|
{
|
|
1061
1061
|
name: "model",
|
|
1062
|
-
description: "Switch model
|
|
1063
|
-
usage: "/model [name]",
|
|
1062
|
+
description: "Switch model, refresh live model list, or inspect model cache",
|
|
1063
|
+
usage: "/model [name|refresh [provider]|cache [clear [provider]]]",
|
|
1064
1064
|
async execute(args, ctx) {
|
|
1065
|
+
const sub = (args[0] ?? "").toLowerCase();
|
|
1066
|
+
if (sub === "refresh") {
|
|
1067
|
+
const providerId = args[1] ?? ctx.getCurrentProvider();
|
|
1068
|
+
if (!ctx.providers.has(providerId)) {
|
|
1069
|
+
ctx.renderer.printInfo(`Provider is not configured: ${providerId}`);
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
ctx.renderer.printInfo(`Refreshing models for ${providerId}...`);
|
|
1073
|
+
try {
|
|
1074
|
+
const models = await ctx.providers.refreshModels(providerId);
|
|
1075
|
+
ctx.renderer.printSuccess(`Refreshed ${models.length} model(s) for ${providerId}.`);
|
|
1076
|
+
} catch (err) {
|
|
1077
|
+
ctx.renderer.printInfo(`Model refresh failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1078
|
+
}
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
if (sub === "cache") {
|
|
1082
|
+
if ((args[1] ?? "").toLowerCase() === "clear") {
|
|
1083
|
+
const providerId = args[2];
|
|
1084
|
+
ctx.providers.clearModelCache(providerId);
|
|
1085
|
+
ctx.renderer.printSuccess(providerId ? `Cleared model cache for ${providerId}.` : "Cleared model cache.");
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
const rows = ctx.providers.getModelCacheStatus();
|
|
1089
|
+
if (rows.length === 0) {
|
|
1090
|
+
ctx.renderer.printInfo("Model cache is empty. Use /model refresh to populate it.");
|
|
1091
|
+
return;
|
|
1092
|
+
}
|
|
1093
|
+
ctx.renderer.printTable(
|
|
1094
|
+
["Provider", "Models", "Fetched"],
|
|
1095
|
+
rows.map((row) => [row.providerId, row.count, row.fetchedAt])
|
|
1096
|
+
);
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1065
1099
|
let targetModel;
|
|
1066
1100
|
if (!args[0]) {
|
|
1067
|
-
const
|
|
1068
|
-
const models = await provider.listModels();
|
|
1101
|
+
const models = await ctx.providers.listModels(ctx.getCurrentProvider());
|
|
1069
1102
|
const currentModel = ctx.getCurrentModel();
|
|
1070
1103
|
const items = models.map((m) => ({
|
|
1071
1104
|
value: m.id,
|
|
@@ -1073,7 +1106,9 @@ No commands match "${filter}".
|
|
|
1073
1106
|
hint: [
|
|
1074
1107
|
m.displayName,
|
|
1075
1108
|
`ctx:${fmtCtx(m.contextWindow)}`,
|
|
1076
|
-
m.supportsThinking ? "
|
|
1109
|
+
m.supportsThinking ? "thinking" : "",
|
|
1110
|
+
m.metadataUnknown ? "metadata?" : "",
|
|
1111
|
+
m.source && m.source !== "curated" ? m.source : "",
|
|
1077
1112
|
m.id === currentModel ? "(current)" : ""
|
|
1078
1113
|
].filter(Boolean).join(" ")
|
|
1079
1114
|
}));
|
|
@@ -1761,7 +1796,7 @@ No tools match "${filter}".
|
|
|
1761
1796
|
const { join: join5 } = await import("path");
|
|
1762
1797
|
const { existsSync: existsSync5 } = await import("fs");
|
|
1763
1798
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1764
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1799
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-ML5KFEOH.js");
|
|
1765
1800
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1766
1801
|
const cwd = process.cwd();
|
|
1767
1802
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2820,7 +2855,7 @@ ${hint}` : "")
|
|
|
2820
2855
|
usage: "/test [command|filter]",
|
|
2821
2856
|
async execute(args, ctx) {
|
|
2822
2857
|
try {
|
|
2823
|
-
const { executeTests } = await import("./run-tests-
|
|
2858
|
+
const { executeTests } = await import("./run-tests-KLQAI5CX.js");
|
|
2824
2859
|
const argStr = args.join(" ").trim();
|
|
2825
2860
|
let testArgs = {};
|
|
2826
2861
|
if (argStr) {
|
|
@@ -3786,6 +3821,7 @@ var PROVIDERS = [
|
|
|
3786
3821
|
{ value: "zhipu", name: "Zhipu (GLM)" },
|
|
3787
3822
|
{ value: "kimi", name: "Kimi (Moonshot AI)" },
|
|
3788
3823
|
{ value: "minimax", name: "MiniMax (\u6D77\u87BA)" },
|
|
3824
|
+
{ value: "qwen", name: "Qwen (Alibaba Cloud)" },
|
|
3789
3825
|
{ value: "openai", name: "OpenAI" },
|
|
3790
3826
|
{ value: "openrouter", name: "OpenRouter" },
|
|
3791
3827
|
{ value: "ollama", name: "Ollama (Local)" }
|
|
@@ -7231,7 +7267,8 @@ program.command("providers").description("List all AI providers and their config
|
|
|
7231
7267
|
baseUrl: config.get("customBaseUrls")[id],
|
|
7232
7268
|
timeout: config.get("timeouts")[id]
|
|
7233
7269
|
}),
|
|
7234
|
-
config.get("customProviders")
|
|
7270
|
+
config.get("customProviders"),
|
|
7271
|
+
config.getConfigDir()
|
|
7235
7272
|
);
|
|
7236
7273
|
const all = registry.listAll();
|
|
7237
7274
|
console.log("\nAvailable providers:\n");
|
|
@@ -7255,7 +7292,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7255
7292
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7256
7293
|
process.exit(1);
|
|
7257
7294
|
}
|
|
7258
|
-
const { startWebServer } = await import("./server-
|
|
7295
|
+
const { startWebServer } = await import("./server-RU36PRSH.js");
|
|
7259
7296
|
await startWebServer({ port, host: options.host });
|
|
7260
7297
|
});
|
|
7261
7298
|
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) => {
|
|
@@ -7422,11 +7459,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7422
7459
|
console.log(footer + "\n");
|
|
7423
7460
|
});
|
|
7424
7461
|
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) => {
|
|
7425
|
-
const { runUsageCli } = await import("./usage-
|
|
7462
|
+
const { runUsageCli } = await import("./usage-IRMRCCKN.js");
|
|
7426
7463
|
await runUsageCli(options);
|
|
7427
7464
|
});
|
|
7428
7465
|
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) => {
|
|
7429
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7466
|
+
const { runDoctorCli } = await import("./doctor-cli-ZRH3XZ3R.js");
|
|
7430
7467
|
const argv = process.argv.slice(2);
|
|
7431
7468
|
await runDoctorCli({
|
|
7432
7469
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -7435,7 +7472,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
7435
7472
|
});
|
|
7436
7473
|
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) => {
|
|
7437
7474
|
try {
|
|
7438
|
-
const batch = await import("./batch-
|
|
7475
|
+
const batch = await import("./batch-QBSKTLTO.js");
|
|
7439
7476
|
switch (action) {
|
|
7440
7477
|
case "submit":
|
|
7441
7478
|
if (!arg) {
|
|
@@ -7478,7 +7515,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7478
7515
|
}
|
|
7479
7516
|
});
|
|
7480
7517
|
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) => {
|
|
7481
|
-
const { startMcpServer } = await import("./server-
|
|
7518
|
+
const { startMcpServer } = await import("./server-5FZDALHH.js");
|
|
7482
7519
|
await startMcpServer({
|
|
7483
7520
|
allowDestructive: !!options.allowDestructive,
|
|
7484
7521
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7491,7 +7528,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7491
7528
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
7492
7529
|
process.exit(1);
|
|
7493
7530
|
}
|
|
7494
|
-
const { runPrCli } = await import("./pr-
|
|
7531
|
+
const { runPrCli } = await import("./pr-GJYDAPK4.js");
|
|
7495
7532
|
const result = await runPrCli({
|
|
7496
7533
|
action,
|
|
7497
7534
|
target,
|
|
@@ -7511,8 +7548,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
7511
7548
|
process.exit(result.exitCode);
|
|
7512
7549
|
});
|
|
7513
7550
|
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) => {
|
|
7514
|
-
const { runCi } = await import("./ci-
|
|
7515
|
-
const { formatCiResult } = await import("./ci-format-
|
|
7551
|
+
const { runCi } = await import("./ci-5SNXGM3M.js");
|
|
7552
|
+
const { formatCiResult } = await import("./ci-format-57QQTHQE.js");
|
|
7516
7553
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
7517
7554
|
if (formats > 1) {
|
|
7518
7555
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -7667,9 +7704,10 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7667
7704
|
baseUrl: config.get("customBaseUrls")[id],
|
|
7668
7705
|
timeout: config.get("timeouts")[id]
|
|
7669
7706
|
}),
|
|
7670
|
-
config.get("customProviders")
|
|
7707
|
+
config.get("customProviders"),
|
|
7708
|
+
config.getConfigDir()
|
|
7671
7709
|
);
|
|
7672
|
-
const { startHub } = await import("./hub-
|
|
7710
|
+
const { startHub } = await import("./hub-IPLMJ6TJ.js");
|
|
7673
7711
|
await startHub(
|
|
7674
7712
|
{
|
|
7675
7713
|
topic: topic ?? "",
|
|
@@ -7702,7 +7740,8 @@ program.command("join").description("Join a running hub as a remote AI agent").o
|
|
|
7702
7740
|
baseUrl: config.get("customBaseUrls")[id],
|
|
7703
7741
|
timeout: config.get("timeouts")[id]
|
|
7704
7742
|
}),
|
|
7705
|
-
config.get("customProviders")
|
|
7743
|
+
config.get("customProviders"),
|
|
7744
|
+
config.getConfigDir()
|
|
7706
7745
|
);
|
|
7707
7746
|
const { joinHub } = await import("./agent-client-6GX6QQDU.js");
|
|
7708
7747
|
await joinHub(
|
|
@@ -7743,7 +7782,8 @@ async function runHeadless(options) {
|
|
|
7743
7782
|
timeout: config.get("timeouts")[id],
|
|
7744
7783
|
proxy: config.get("proxy")
|
|
7745
7784
|
}),
|
|
7746
|
-
config.get("customProviders")
|
|
7785
|
+
config.get("customProviders"),
|
|
7786
|
+
config.getConfigDir()
|
|
7747
7787
|
);
|
|
7748
7788
|
const providerId = options.provider ?? config.getDefaultProvider();
|
|
7749
7789
|
if (!providers.has(providerId)) {
|
|
@@ -7902,7 +7942,8 @@ async function startRepl(options) {
|
|
|
7902
7942
|
timeout: config.get("timeouts")[id],
|
|
7903
7943
|
proxy: config.get("proxy")
|
|
7904
7944
|
}),
|
|
7905
|
-
config.get("customProviders")
|
|
7945
|
+
config.get("customProviders"),
|
|
7946
|
+
config.getConfigDir()
|
|
7906
7947
|
);
|
|
7907
7948
|
if (providers.listAvailable().length === 0) {
|
|
7908
7949
|
console.error(
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-P4PTXCHY.js";
|
|
6
|
+
import "./chunk-P4DYAGUI.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
} from "./chunk-HLWUDRBO.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PUBCJF7E.js";
|
|
15
15
|
import "./chunk-XPBEJB27.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-5WBNXYDJ.js";
|
|
19
|
+
import "./chunk-5ULLIOVC.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QZYNRCPX.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|
|
@@ -179,7 +179,8 @@ async function getProvider(opts) {
|
|
|
179
179
|
await registry.initialize(
|
|
180
180
|
(id) => config.getApiKey(id),
|
|
181
181
|
(id) => ({ baseUrl: config.get("customBaseUrls")[id], timeout: config.get("timeouts")[id], proxy: config.get("proxy") }),
|
|
182
|
-
config.get("customProviders")
|
|
182
|
+
config.get("customProviders"),
|
|
183
|
+
config.getConfigDir()
|
|
183
184
|
);
|
|
184
185
|
const providerId = opts.provider ?? config.getDefaultProvider();
|
|
185
186
|
if (!registry.has(providerId)) throw new Error(`Provider '${providerId}' is not configured. Set the right AICLI_API_KEY_* env var or pass --provider.`);
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IZW5LMI6.js";
|
|
5
5
|
import "./chunk-K3CF65QH.js";
|
|
6
6
|
import "./chunk-T2NL5ZIA.js";
|
|
7
7
|
import "./chunk-BXP6YZ2P.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Y25MSSUP.js";
|
|
9
9
|
import "./chunk-4BKXL7SM.js";
|
|
10
10
|
import "./chunk-TB4W4Y4T.js";
|
|
11
11
|
import "./chunk-KHYD3WXE.js";
|
|
12
12
|
import "./chunk-SLSWPBK3.js";
|
|
13
13
|
import {
|
|
14
14
|
runTool
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ALQN7VUJ.js";
|
|
16
16
|
import {
|
|
17
17
|
getDangerLevel,
|
|
18
18
|
schemaToJsonSchema
|
|
19
19
|
} from "./chunk-XPBEJB27.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-5ULLIOVC.js";
|
|
21
21
|
import {
|
|
22
22
|
VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-QZYNRCPX.js";
|
|
24
24
|
import "./chunk-HOSJZMQS.js";
|
|
25
25
|
import "./chunk-CKH4KQ4E.js";
|
|
26
26
|
import "./chunk-IW3Q7AE5.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
scanDirTree,
|
|
24
24
|
scanProject,
|
|
25
25
|
setupProxy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VHX7KZDY.js";
|
|
27
27
|
import {
|
|
28
28
|
buildReviewPrompt,
|
|
29
29
|
buildSecurityReviewPrompt
|
|
@@ -66,11 +66,11 @@ import {
|
|
|
66
66
|
truncateOutput,
|
|
67
67
|
undoStack,
|
|
68
68
|
updateMemoryApproval
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-IZW5LMI6.js";
|
|
70
70
|
import "./chunk-K3CF65QH.js";
|
|
71
71
|
import "./chunk-T2NL5ZIA.js";
|
|
72
72
|
import "./chunk-BXP6YZ2P.js";
|
|
73
|
-
import "./chunk-
|
|
73
|
+
import "./chunk-Y25MSSUP.js";
|
|
74
74
|
import {
|
|
75
75
|
SessionManager,
|
|
76
76
|
getContentText
|
|
@@ -89,10 +89,10 @@ import {
|
|
|
89
89
|
buildDoctorReport,
|
|
90
90
|
formatDoctorReport,
|
|
91
91
|
loadContextFiles
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-P3LKFA54.js";
|
|
93
93
|
import {
|
|
94
94
|
ProviderRegistry
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-PUBCJF7E.js";
|
|
96
96
|
import {
|
|
97
97
|
describePlugin,
|
|
98
98
|
getActivePluginAssets,
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
runTool,
|
|
108
108
|
setPluginEnabled,
|
|
109
109
|
trustPlugin
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-ALQN7VUJ.js";
|
|
111
111
|
import {
|
|
112
112
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
113
113
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -126,8 +126,8 @@ import {
|
|
|
126
126
|
} from "./chunk-XPBEJB27.js";
|
|
127
127
|
import {
|
|
128
128
|
ConfigManager
|
|
129
|
-
} from "./chunk-
|
|
130
|
-
import "./chunk-
|
|
129
|
+
} from "./chunk-5WBNXYDJ.js";
|
|
130
|
+
import "./chunk-5ULLIOVC.js";
|
|
131
131
|
import {
|
|
132
132
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
133
133
|
AUTHOR,
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
SKILLS_DIR_NAME,
|
|
145
145
|
VERSION,
|
|
146
146
|
buildUserIdentityPrompt
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-QZYNRCPX.js";
|
|
148
148
|
import {
|
|
149
149
|
formatGitContextForPrompt,
|
|
150
150
|
getGitContext,
|
|
@@ -1682,13 +1682,39 @@ ${summaryContent}`,
|
|
|
1682
1682
|
break;
|
|
1683
1683
|
}
|
|
1684
1684
|
case "model": {
|
|
1685
|
-
const
|
|
1686
|
-
if (!
|
|
1687
|
-
this.send({ type: "error", message: "Usage: /model <id
|
|
1685
|
+
const sub = args[0];
|
|
1686
|
+
if (!sub) {
|
|
1687
|
+
this.send({ type: "error", message: "Usage: /model <id>|refresh [provider]|cache [clear [provider]]" });
|
|
1688
|
+
return;
|
|
1689
|
+
}
|
|
1690
|
+
if (sub === "refresh") {
|
|
1691
|
+
const providerId = args[1] ?? this.currentProvider;
|
|
1692
|
+
try {
|
|
1693
|
+
const models2 = await this.providers.refreshModels(providerId);
|
|
1694
|
+
this.send({ type: "info", message: `Refreshed ${models2.length} model(s) for ${providerId}.` });
|
|
1695
|
+
this.sendStatus();
|
|
1696
|
+
} catch (err) {
|
|
1697
|
+
this.send({ type: "error", message: `Model refresh failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
1698
|
+
}
|
|
1699
|
+
return;
|
|
1700
|
+
}
|
|
1701
|
+
if (sub === "cache") {
|
|
1702
|
+
if ((args[1] ?? "").toLowerCase() === "clear") {
|
|
1703
|
+
const providerId = args[2];
|
|
1704
|
+
this.providers.clearModelCache(providerId);
|
|
1705
|
+
this.send({ type: "info", message: providerId ? `Cleared model cache for ${providerId}.` : "Cleared model cache." });
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
const rows = this.providers.getModelCacheStatus();
|
|
1709
|
+
this.send({
|
|
1710
|
+
type: "info",
|
|
1711
|
+
message: rows.length === 0 ? "Model cache is empty. Use /model refresh to populate it." : rows.map((row) => `${row.providerId}: ${row.count} model(s), fetched ${row.fetchedAt}`).join("\n")
|
|
1712
|
+
});
|
|
1688
1713
|
return;
|
|
1689
1714
|
}
|
|
1690
|
-
const
|
|
1691
|
-
const
|
|
1715
|
+
const modelId = sub;
|
|
1716
|
+
const models = await this.providers.listModels(this.currentProvider);
|
|
1717
|
+
const found = models.find((m) => m.id === modelId);
|
|
1692
1718
|
if (!found) {
|
|
1693
1719
|
this.send({ type: "error", message: `Model "${modelId}" not found` });
|
|
1694
1720
|
return;
|
|
@@ -2765,7 +2791,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2765
2791
|
case "test": {
|
|
2766
2792
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2767
2793
|
try {
|
|
2768
|
-
const { executeTests } = await import("./run-tests-
|
|
2794
|
+
const { executeTests } = await import("./run-tests-KLQAI5CX.js");
|
|
2769
2795
|
const argStr = args.join(" ").trim();
|
|
2770
2796
|
let testArgs = {};
|
|
2771
2797
|
if (argStr) {
|
|
@@ -3601,7 +3627,8 @@ async function startWebServer(options = {}) {
|
|
|
3601
3627
|
timeout: config.get("timeouts")[id],
|
|
3602
3628
|
proxy: config.get("proxy")
|
|
3603
3629
|
}),
|
|
3604
|
-
config.get("customProviders")
|
|
3630
|
+
config.get("customProviders"),
|
|
3631
|
+
config.getConfigDir()
|
|
3605
3632
|
);
|
|
3606
3633
|
if (options._extraProviders) {
|
|
3607
3634
|
for (const p of options._extraProviders) {
|
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IZW5LMI6.js";
|
|
7
7
|
import "./chunk-K3CF65QH.js";
|
|
8
8
|
import "./chunk-T2NL5ZIA.js";
|
|
9
9
|
import "./chunk-BXP6YZ2P.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-Y25MSSUP.js";
|
|
11
11
|
import "./chunk-4BKXL7SM.js";
|
|
12
12
|
import "./chunk-TB4W4Y4T.js";
|
|
13
13
|
import "./chunk-KHYD3WXE.js";
|
|
14
14
|
import "./chunk-SLSWPBK3.js";
|
|
15
15
|
import {
|
|
16
16
|
runTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ALQN7VUJ.js";
|
|
18
18
|
import {
|
|
19
19
|
getDangerLevel,
|
|
20
20
|
runLeanAgentLoop
|
|
21
21
|
} from "./chunk-XPBEJB27.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-5ULLIOVC.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBAGENT_ALLOWED_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QZYNRCPX.js";
|
|
26
26
|
import "./chunk-HOSJZMQS.js";
|
|
27
27
|
import "./chunk-CKH4KQ4E.js";
|
|
28
28
|
import {
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
} from "./chunk-E44DTERW.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-5WBNXYDJ.js";
|
|
12
|
+
import "./chunk-5ULLIOVC.js";
|
|
13
|
+
import "./chunk-QZYNRCPX.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|