jinzd-ai-cli 0.4.238 → 0.4.240

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.
Files changed (27) hide show
  1. package/dist/{batch-S2NUD45K.js → batch-QVWTKZF4.js} +2 -2
  2. package/dist/{chunk-BTKFZUIJ.js → chunk-3RAG6N4A.js} +3 -3
  3. package/dist/{chunk-NAPAMAFY.js → chunk-4MBOMN32.js} +59 -4
  4. package/dist/{chunk-J2M4GOFE.js → chunk-4URJHGUY.js} +1 -1
  5. package/dist/{chunk-EG5P3AMC.js → chunk-ATUYVDK7.js} +1 -1
  6. package/dist/{chunk-MSK2BAKT.js → chunk-D3636NWD.js} +1 -1
  7. package/dist/{chunk-25FKQO3A.js → chunk-FK3WUEP6.js} +1 -1
  8. package/dist/{chunk-45TJA46E.js → chunk-MJJDVV7I.js} +3 -3
  9. package/dist/{chunk-PTUOWHOH.js → chunk-O5DZLCMC.js} +2 -2
  10. package/dist/{chunk-6RU5AKXB.js → chunk-SCE4HTKR.js} +1 -1
  11. package/dist/{chunk-CSATDZ3Z.js → chunk-UKIDVNA5.js} +1 -1
  12. package/dist/{ci-HDGRBALH.js → ci-TVGNRBCM.js} +4 -4
  13. package/dist/{ci-format-W6DDOFS7.js → ci-format-MYXIMFBH.js} +2 -2
  14. package/dist/{constants-3KMOIJNP.js → constants-CGQSCJPK.js} +1 -1
  15. package/dist/{doctor-cli-E5MBY7CZ.js → doctor-cli-7EVHTO7C.js} +4 -4
  16. package/dist/electron-server.js +74 -3
  17. package/dist/{hub-5TKAR7Y7.js → hub-JAHPVHAL.js} +1 -1
  18. package/dist/index.js +89 -33
  19. package/dist/{pr-RRHV7P7D.js → pr-D22NW3CL.js} +4 -4
  20. package/dist/{run-tests-GP7ZMSAX.js → run-tests-L4UAFYAB.js} +2 -2
  21. package/dist/{run-tests-K36VNQ5W.js → run-tests-PRGRUUKE.js} +1 -1
  22. package/dist/{server-77FK46KF.js → server-ACSCQHUV.js} +4 -4
  23. package/dist/{server-7OUD4SE4.js → server-CXF4XPEZ.js} +26 -9
  24. package/dist/{task-orchestrator-AJRFTQVB.js → task-orchestrator-SFGLDJEX.js} +4 -4
  25. package/dist/{usage-5QO5AFYC.js → usage-MCATLIB3.js} +2 -2
  26. package/dist/web/client/app.js +3338 -3334
  27. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  scanProject,
15
15
  sessionHasMeaningfulContent,
16
16
  setupProxy
17
- } from "./chunk-PTUOWHOH.js";
17
+ } from "./chunk-O5DZLCMC.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-BTKFZUIJ.js";
55
+ } from "./chunk-3RAG6N4A.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-NAPAMAFY.js";
77
+ } from "./chunk-4MBOMN32.js";
78
78
  import {
79
79
  ProviderRegistry
80
80
  } from "./chunk-QYQI7ZWK.js";
@@ -94,7 +94,7 @@ import {
94
94
  trustHook,
95
95
  trustPlugin,
96
96
  untrustHook
97
- } from "./chunk-MSK2BAKT.js";
97
+ } from "./chunk-D3636NWD.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-O3XSFPYH.js";
117
117
  import {
118
118
  ConfigManager
119
- } from "./chunk-CSATDZ3Z.js";
119
+ } from "./chunk-UKIDVNA5.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-6RU5AKXB.js";
133
+ import "./chunk-SCE4HTKR.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-25FKQO3A.js";
152
+ } from "./chunk-FK3WUEP6.js";
153
153
  import {
154
154
  buildChatIndex,
155
155
  clearChatIndex,
@@ -1370,7 +1370,7 @@ No tools match "${filter}".
1370
1370
  const { join: join6 } = await import("path");
1371
1371
  const { existsSync: existsSync5 } = await import("fs");
1372
1372
  const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
1373
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-3KMOIJNP.js");
1373
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-CGQSCJPK.js");
1374
1374
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
1375
1375
  const cwd = process.cwd();
1376
1376
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2349,7 +2349,7 @@ function createReviewCommands() {
2349
2349
  usage: "/test [command|filter]",
2350
2350
  async execute(args, ctx) {
2351
2351
  try {
2352
- const { executeTests } = await import("./run-tests-GP7ZMSAX.js");
2352
+ const { executeTests } = await import("./run-tests-L4UAFYAB.js");
2353
2353
  const argStr = args.join(" ").trim();
2354
2354
  let testArgs = {};
2355
2355
  if (argStr) {
@@ -4289,6 +4289,10 @@ function maskKey(key) {
4289
4289
  if (key.length <= 10) return "****";
4290
4290
  return key.slice(0, 6) + "****" + key.slice(-4);
4291
4291
  }
4292
+ function errorMessage(err) {
4293
+ if (err instanceof Error && err.message) return err.message;
4294
+ return String(err ?? "unknown error");
4295
+ }
4292
4296
  var SetupWizard = class {
4293
4297
  constructor(config) {
4294
4298
  this.config = config;
@@ -4312,7 +4316,17 @@ var SetupWizard = class {
4312
4316
  ${greeting} Starting ai-cli...
4313
4317
  `));
4314
4318
  return true;
4315
- } catch {
4319
+ } catch (err) {
4320
+ const message = errorMessage(err);
4321
+ const canceled = /user force closed|interrupted|cancel|aborted/i.test(message);
4322
+ if (canceled) {
4323
+ console.log(theme.warning("\nSetup canceled. Run aicli config to try again.\n"));
4324
+ } else {
4325
+ console.log(theme.error(`
4326
+ First-run setup failed: ${message}`));
4327
+ console.log(theme.dim(`Config directory: ${this.config.getConfigDir()}`));
4328
+ console.log(theme.dim("Run aicli config to retry, or aicli doctor to inspect provider/config health.\n"));
4329
+ }
4316
4330
  return false;
4317
4331
  }
4318
4332
  }
@@ -4340,6 +4354,7 @@ ${greeting} Starting ai-cli...
4340
4354
  { value: "proxy", name: `Configure proxy (HTTP/HTTPS) ${proxyStatus}` },
4341
4355
  { value: "google", name: `Configure Google Search (API Key + CX) ${googleKeyStatus}` },
4342
4356
  { value: "behavior", name: `Behavior toggles (YOLO, MCP, ...) ${behaviorStatus}` },
4357
+ { value: "preset", name: "Apply task preset (safe review, workspace coding, local-only, team web)" },
4343
4358
  { value: "done", name: "Done" }
4344
4359
  ]
4345
4360
  });
@@ -4351,6 +4366,8 @@ ${greeting} Starting ai-cli...
4351
4366
  await this.setupGoogleSearch();
4352
4367
  } else if (action === "behavior") {
4353
4368
  await this.setupBehavior();
4369
+ } else if (action === "preset") {
4370
+ await this.setupPreset();
4354
4371
  } else if (action === "apikey") {
4355
4372
  const choicesWithStatus = PROVIDERS.map((p) => {
4356
4373
  if (NO_KEY_PROVIDERS.has(p.value)) {
@@ -4379,6 +4396,42 @@ ${greeting} Starting ai-cli...
4379
4396
  }
4380
4397
  }
4381
4398
  }
4399
+ async setupPreset() {
4400
+ const preset = await select({
4401
+ message: "Choose a task-oriented preset:",
4402
+ choices: [
4403
+ { value: "safe-review", name: "Safe review only - read-only tools, network confirm" },
4404
+ { value: "workspace-coding", name: "Workspace coding - write in workspace with confirmations" },
4405
+ { value: "local-ollama", name: "Local-only Ollama - local provider, external network denied" },
4406
+ { value: "team-web", name: "Team Web UI - workspace coding plus auth reminder" }
4407
+ ]
4408
+ });
4409
+ const currentNetwork = this.config.get("networkPolicy");
4410
+ if (preset === "safe-review") {
4411
+ this.config.set("defaultPermissionProfile", "read-only");
4412
+ this.config.set("alwaysYolo", false);
4413
+ this.config.set("networkPolicy", { ...currentNetwork, enabled: true, defaultAction: "confirm", tools: { ...currentNetwork.tools, shell: "confirm", web_fetch: "confirm", web_search: "confirm", google_search: "confirm", mcp: "confirm" } });
4414
+ console.log(theme.success("Preset applied: Safe review only. Writes require denial/confirmation according to the read-only profile."));
4415
+ } else if (preset === "workspace-coding") {
4416
+ this.config.set("defaultPermissionProfile", "workspace-write");
4417
+ this.config.set("alwaysYolo", false);
4418
+ this.config.set("networkPolicy", { ...currentNetwork, enabled: true, defaultAction: "confirm", tools: { ...currentNetwork.tools, shell: "confirm", web_fetch: "confirm", web_search: "confirm", google_search: "confirm", mcp: "confirm" } });
4419
+ console.log(theme.success("Preset applied: Workspace coding. File writes stay inside the workspace and sensitive actions still ask."));
4420
+ } else if (preset === "local-ollama") {
4421
+ this.config.set("defaultProvider", "ollama");
4422
+ this.config.set("defaultPermissionProfile", "workspace-write");
4423
+ this.config.set("alwaysYolo", false);
4424
+ this.config.set("networkPolicy", { ...currentNetwork, enabled: true, defaultAction: "deny", allowPrivateNetwork: true, tools: { ...currentNetwork.tools, shell: "confirm", web_fetch: "deny", web_search: "deny", google_search: "deny", mcp: "confirm" } });
4425
+ console.log(theme.success("Preset applied: Local-only Ollama. External web/search is denied; private network is allowed for local services."));
4426
+ } else {
4427
+ this.config.set("defaultPermissionProfile", "workspace-write");
4428
+ this.config.set("alwaysYolo", false);
4429
+ this.config.set("networkPolicy", { ...currentNetwork, enabled: true, defaultAction: "confirm", tools: { ...currentNetwork.tools, shell: "confirm", web_fetch: "confirm", web_search: "confirm", google_search: "confirm", mcp: "confirm" } });
4430
+ console.log(theme.warning("Preset applied: Team Web UI. Start Web with auth enabled and put it behind your normal TLS/reverse proxy boundary."));
4431
+ }
4432
+ this.config.save();
4433
+ console.log(theme.dim("Review changes with aicli doctor or aicli config.\n"));
4434
+ }
4382
4435
  async setupProvider(providerId) {
4383
4436
  if (NO_KEY_PROVIDERS.has(providerId)) {
4384
4437
  await this.setupOllama();
@@ -4396,25 +4449,18 @@ Managing ${displayName} API Key`);
4396
4449
  }
4397
4450
  const choices = existingKey ? [
4398
4451
  { value: "keep", name: "Keep current key" },
4399
- { value: "show", name: "Show full key" },
4452
+ { value: "fingerprint", name: `Copy masked fingerprint (${maskKey(existingKey)})` },
4400
4453
  { value: "change", name: "Update key" }
4401
4454
  ] : [{ value: "change", name: "Enter key" }, { value: "skip", name: "Skip" }];
4402
4455
  const action = await select({
4403
4456
  message: "Action:",
4404
4457
  choices
4405
4458
  });
4406
- if (action === "show" && existingKey) {
4407
- console.log(theme.warning(`
4408
- Full Key: ${existingKey}
4409
- `));
4410
- const updateAfterShow = await select({
4411
- message: "Would you like to update this key?",
4412
- choices: [
4413
- { value: "keep", name: "Keep current" },
4414
- { value: "change", name: "Update" }
4415
- ]
4416
- });
4417
- if (updateAfterShow !== "change") return;
4459
+ if (action === "fingerprint" && existingKey) {
4460
+ console.log(theme.dim(`
4461
+ Fingerprint: ${maskKey(existingKey)}`));
4462
+ console.log(theme.dim(" Full secrets are not printed. Use Update key to replace it.\n"));
4463
+ return;
4418
4464
  } else if (action === "keep" || action === "skip") {
4419
4465
  return;
4420
4466
  }
@@ -5366,6 +5412,7 @@ var Repl = class {
5366
5412
  contextLoadResult = null;
5367
5413
  /** 本次会话累计 token 用量 */
5368
5414
  sessionTokenUsage = { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
5415
+ unknownPricingWarnings = /* @__PURE__ */ new Set();
5369
5416
  /** Fold a single-request TokenUsage (with optional cache fields) into sessionTokenUsage + cost tracker.
5370
5417
  * modelOverride lets the smart router attribute cost to the actually-used model
5371
5418
  * when it differs from the UI-selected currentModel. */
@@ -5374,7 +5421,16 @@ var Repl = class {
5374
5421
  this.sessionTokenUsage.outputTokens += u.outputTokens;
5375
5422
  this.sessionTokenUsage.cacheCreationTokens += u.cacheCreationTokens ?? 0;
5376
5423
  this.sessionTokenUsage.cacheReadTokens += u.cacheReadTokens ?? 0;
5377
- this.costTracker.addCost(this.currentProvider, modelOverride ?? this.currentModel, u);
5424
+ const effectiveModel = modelOverride ?? this.currentModel;
5425
+ const totalTokens = u.inputTokens + u.outputTokens + (u.cacheCreationTokens ?? 0) + (u.cacheReadTokens ?? 0);
5426
+ if (totalTokens > 0 && !getPricing(this.currentProvider, effectiveModel)) {
5427
+ const key = `${this.currentProvider}/${effectiveModel}`;
5428
+ if (!this.unknownPricingWarnings.has(key)) {
5429
+ this.unknownPricingWarnings.add(key);
5430
+ this.renderer.printInfo(`Cost notice: pricing is unknown for ${key}. Tokens are tracked, but cost is excluded from totals. Run aicli usage to review unknown-priced models.`);
5431
+ }
5432
+ }
5433
+ this.costTracker.addCost(this.currentProvider, effectiveModel, u);
5378
5434
  }
5379
5435
  /** 启动时检测到的 Git 分支(无 git 仓库时为 null) */
5380
5436
  gitBranch = null;
@@ -7747,7 +7803,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7747
7803
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7748
7804
  process.exit(1);
7749
7805
  }
7750
- const { startWebServer } = await import("./server-7OUD4SE4.js");
7806
+ const { startWebServer } = await import("./server-CXF4XPEZ.js");
7751
7807
  await startWebServer({ port, host: options.host });
7752
7808
  });
7753
7809
  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) => {
@@ -7914,11 +7970,11 @@ program.command("sessions").description("List recent conversation sessions").opt
7914
7970
  console.log(footer + "\n");
7915
7971
  });
7916
7972
  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) => {
7917
- const { runUsageCli } = await import("./usage-5QO5AFYC.js");
7973
+ const { runUsageCli } = await import("./usage-MCATLIB3.js");
7918
7974
  await runUsageCli(options);
7919
7975
  });
7920
7976
  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) => {
7921
- const { runDoctorCli } = await import("./doctor-cli-E5MBY7CZ.js");
7977
+ const { runDoctorCli } = await import("./doctor-cli-7EVHTO7C.js");
7922
7978
  const argv = process.argv.slice(2);
7923
7979
  await runDoctorCli({
7924
7980
  json: !!options.json || argv.includes("--json"),
@@ -7927,7 +7983,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
7927
7983
  });
7928
7984
  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) => {
7929
7985
  try {
7930
- const batch = await import("./batch-S2NUD45K.js");
7986
+ const batch = await import("./batch-QVWTKZF4.js");
7931
7987
  switch (action) {
7932
7988
  case "submit":
7933
7989
  if (!arg) {
@@ -7970,7 +8026,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7970
8026
  }
7971
8027
  });
7972
8028
  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) => {
7973
- const { startMcpServer } = await import("./server-77FK46KF.js");
8029
+ const { startMcpServer } = await import("./server-ACSCQHUV.js");
7974
8030
  await startMcpServer({
7975
8031
  allowDestructive: !!options.allowDestructive,
7976
8032
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7983,7 +8039,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
7983
8039
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
7984
8040
  process.exit(1);
7985
8041
  }
7986
- const { runPrCli } = await import("./pr-RRHV7P7D.js");
8042
+ const { runPrCli } = await import("./pr-D22NW3CL.js");
7987
8043
  const result = await runPrCli({
7988
8044
  action,
7989
8045
  target,
@@ -8003,8 +8059,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8003
8059
  process.exit(result.exitCode);
8004
8060
  });
8005
8061
  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) => {
8006
- const { runCi } = await import("./ci-HDGRBALH.js");
8007
- const { formatCiResult } = await import("./ci-format-W6DDOFS7.js");
8062
+ const { runCi } = await import("./ci-TVGNRBCM.js");
8063
+ const { formatCiResult } = await import("./ci-format-MYXIMFBH.js");
8008
8064
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
8009
8065
  if (formats > 1) {
8010
8066
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -8162,7 +8218,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
8162
8218
  config.get("customProviders"),
8163
8219
  config.getConfigDir()
8164
8220
  );
8165
- const { startHub } = await import("./hub-5TKAR7Y7.js");
8221
+ const { startHub } = await import("./hub-JAHPVHAL.js");
8166
8222
  await startHub(
8167
8223
  {
8168
8224
  topic: topic ?? "",
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-45TJA46E.js";
6
- import "./chunk-J2M4GOFE.js";
5
+ } from "./chunk-MJJDVV7I.js";
6
+ import "./chunk-4URJHGUY.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -15,11 +15,11 @@ import {
15
15
  import "./chunk-O3XSFPYH.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-CSATDZ3Z.js";
18
+ } from "./chunk-UKIDVNA5.js";
19
19
  import "./chunk-5ULLIOVC.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-25FKQO3A.js";
22
+ } from "./chunk-FK3WUEP6.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-6RU5AKXB.js";
6
- import "./chunk-25FKQO3A.js";
5
+ } from "./chunk-SCE4HTKR.js";
6
+ import "./chunk-FK3WUEP6.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-EG5P3AMC.js";
4
+ } from "./chunk-ATUYVDK7.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-BTKFZUIJ.js";
4
+ } from "./chunk-3RAG6N4A.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-MSK2BAKT.js";
11
+ } from "./chunk-D3636NWD.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-6RU5AKXB.js";
19
+ import "./chunk-SCE4HTKR.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-25FKQO3A.js";
22
+ } from "./chunk-FK3WUEP6.js";
23
23
  import "./chunk-5MYPIQ3Y.js";
24
24
  import "./chunk-KHYD3WXE.js";
25
25
  import "./chunk-KCEO2XJ4.js";
@@ -23,7 +23,7 @@ import {
23
23
  scanDirTree,
24
24
  scanProject,
25
25
  setupProxy
26
- } from "./chunk-PTUOWHOH.js";
26
+ } from "./chunk-O5DZLCMC.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-BTKFZUIJ.js";
70
+ } from "./chunk-3RAG6N4A.js";
71
71
  import "./chunk-K3CF65QH.js";
72
72
  import "./chunk-UUSRWSSX.js";
73
73
  import "./chunk-CKH4KQ4E.js";
@@ -78,13 +78,14 @@ import {
78
78
  } from "./chunk-JMP3LJC2.js";
79
79
  import {
80
80
  computeCost,
81
- formatCost
81
+ formatCost,
82
+ getPricing
82
83
  } from "./chunk-E44DTERW.js";
83
84
  import {
84
85
  buildDoctorReport,
85
86
  formatDoctorReport,
86
87
  loadContextFiles
87
- } from "./chunk-NAPAMAFY.js";
88
+ } from "./chunk-4MBOMN32.js";
88
89
  import {
89
90
  ProviderRegistry
90
91
  } from "./chunk-QYQI7ZWK.js";
@@ -102,7 +103,7 @@ import {
102
103
  runTool,
103
104
  setPluginEnabled,
104
105
  trustPlugin
105
- } from "./chunk-MSK2BAKT.js";
106
+ } from "./chunk-D3636NWD.js";
106
107
  import {
107
108
  CONTENT_ONLY_STREAM_REMINDER,
108
109
  TEE_FINAL_USER_NUDGE,
@@ -121,7 +122,7 @@ import {
121
122
  } from "./chunk-O3XSFPYH.js";
122
123
  import {
123
124
  ConfigManager
124
- } from "./chunk-CSATDZ3Z.js";
125
+ } from "./chunk-UKIDVNA5.js";
125
126
  import "./chunk-5ULLIOVC.js";
126
127
  import {
127
128
  formatGitContextForPrompt,
@@ -129,7 +130,7 @@ import {
129
130
  getGitRoot
130
131
  } from "./chunk-HOSJZMQS.js";
131
132
  import "./chunk-4BKXL7SM.js";
132
- import "./chunk-6RU5AKXB.js";
133
+ import "./chunk-SCE4HTKR.js";
133
134
  import {
134
135
  AGENTIC_BEHAVIOR_GUIDELINE,
135
136
  AUTHOR,
@@ -146,7 +147,7 @@ import {
146
147
  SKILLS_DIR_NAME,
147
148
  VERSION,
148
149
  buildUserIdentityPrompt
149
- } from "./chunk-25FKQO3A.js";
150
+ } from "./chunk-FK3WUEP6.js";
150
151
  import "./chunk-5MYPIQ3Y.js";
151
152
  import "./chunk-KHYD3WXE.js";
152
153
  import {
@@ -1431,6 +1432,10 @@ async function handleMcp(_args, ctx) {
1431
1432
  ctx.sendToolsList();
1432
1433
  return;
1433
1434
  }
1435
+ if (sub) {
1436
+ ctx.send({ type: "error", message: `The Web UI supports /mcp reconnect and status display only. Run this command in the terminal instead: aicli, then /mcp ${[sub, ..._args.slice(1)].join(" ")}` });
1437
+ return;
1438
+ }
1434
1439
  const statuses = ctx.mcpManager.getStatus();
1435
1440
  if (statuses.length === 0) {
1436
1441
  ctx.send({ type: "info", message: "No MCP servers configured." });
@@ -1594,7 +1599,7 @@ async function handleSecurityReview(args, ctx) {
1594
1599
  async function handleTest(args, ctx) {
1595
1600
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1596
1601
  try {
1597
- const { executeTests } = await import("./run-tests-GP7ZMSAX.js");
1602
+ const { executeTests } = await import("./run-tests-L4UAFYAB.js");
1598
1603
  const argStr = args.join(" ").trim();
1599
1604
  let testArgs = {};
1600
1605
  if (argStr) {
@@ -2232,12 +2237,21 @@ var SessionHandler = class {
2232
2237
  planMode = false;
2233
2238
  runtimeThinking = null;
2234
2239
  sessionTokenUsage = { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
2240
+ unknownPricingWarnings = /* @__PURE__ */ new Set();
2235
2241
  /** Accumulate a TokenUsage (with optional cache fields) into sessionTokenUsage. */
2236
2242
  addWebSessionUsage(u) {
2237
2243
  this.sessionTokenUsage.inputTokens += u.inputTokens;
2238
2244
  this.sessionTokenUsage.outputTokens += u.outputTokens;
2239
2245
  this.sessionTokenUsage.cacheCreationTokens += u.cacheCreationTokens ?? 0;
2240
2246
  this.sessionTokenUsage.cacheReadTokens += u.cacheReadTokens ?? 0;
2247
+ const totalTokens = u.inputTokens + u.outputTokens + (u.cacheCreationTokens ?? 0) + (u.cacheReadTokens ?? 0);
2248
+ if (totalTokens > 0 && !getPricing(this.currentProvider, this.currentModel)) {
2249
+ const key = `${this.currentProvider}/${this.currentModel}`;
2250
+ if (!this.unknownPricingWarnings.has(key)) {
2251
+ this.unknownPricingWarnings.add(key);
2252
+ this.send({ type: "info", message: `Cost notice: pricing is unknown for ${key}. Tokens are tracked, but cost is excluded from totals. Run /cost or aicli usage to review.` });
2253
+ }
2254
+ }
2241
2255
  }
2242
2256
  resetWebSessionUsage() {
2243
2257
  this.sessionTokenUsage = { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
@@ -2341,6 +2355,7 @@ var SessionHandler = class {
2341
2355
  models: p.info.models.map((m) => ({ id: m.id, name: m.displayName ?? m.id }))
2342
2356
  }));
2343
2357
  const costUsd = computeCost(this.currentProvider, this.currentModel, this.sessionTokenUsage);
2358
+ const costPricingUnknown = costUsd == null && this.sessionTokenUsage.inputTokens + this.sessionTokenUsage.outputTokens + this.sessionTokenUsage.cacheCreationTokens + this.sessionTokenUsage.cacheReadTokens > 0;
2344
2359
  const sess = this.sessions.current;
2345
2360
  const branches = sess ? sess.listBranches().map((b) => ({
2346
2361
  id: b.id,
@@ -2356,12 +2371,14 @@ var SessionHandler = class {
2356
2371
  model: this.currentModel,
2357
2372
  sessionId: this.sessions.current?.id ?? "",
2358
2373
  sessionTitle: this.sessions.current?.title ?? void 0,
2374
+ cwd: process.cwd(),
2359
2375
  messageCount: this.sessions.current?.messages.length ?? 0,
2360
2376
  planMode: this.planMode,
2361
2377
  thinkingMode: this.runtimeThinking ?? false,
2362
2378
  permissionProfile: this.config.get("defaultPermissionProfile") ?? "legacy",
2363
2379
  tokenUsage: { ...this.sessionTokenUsage },
2364
2380
  costUsd,
2381
+ costPricingUnknown,
2365
2382
  providers: providerList,
2366
2383
  branches,
2367
2384
  activeBranchId: sess?.activeBranchId ?? "main",
@@ -3,14 +3,14 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-BTKFZUIJ.js";
6
+ } from "./chunk-3RAG6N4A.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-MSK2BAKT.js";
13
+ } from "./chunk-D3636NWD.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-6RU5AKXB.js";
21
+ import "./chunk-SCE4HTKR.js";
22
22
  import {
23
23
  SUBAGENT_ALLOWED_TOOLS
24
- } from "./chunk-25FKQO3A.js";
24
+ } from "./chunk-FK3WUEP6.js";
25
25
  import "./chunk-5MYPIQ3Y.js";
26
26
  import "./chunk-KHYD3WXE.js";
27
27
  import "./chunk-KCEO2XJ4.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-E44DTERW.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-CSATDZ3Z.js";
11
+ } from "./chunk-UKIDVNA5.js";
12
12
  import "./chunk-5ULLIOVC.js";
13
- import "./chunk-25FKQO3A.js";
13
+ import "./chunk-FK3WUEP6.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
 
16
16
  // src/cli/usage.ts