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
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-CSATDZ3Z.js";
4
+ } from "./chunk-UKIDVNA5.js";
5
5
  import "./chunk-5ULLIOVC.js";
6
- import "./chunk-25FKQO3A.js";
6
+ import "./chunk-FK3WUEP6.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -14,7 +14,7 @@ import {
14
14
  runHook,
15
15
  runLifecycleHooks,
16
16
  runTool
17
- } from "./chunk-MSK2BAKT.js";
17
+ } from "./chunk-D3636NWD.js";
18
18
  import {
19
19
  getDangerLevel,
20
20
  isFileWriteTool,
@@ -33,7 +33,7 @@ import {
33
33
  } from "./chunk-4BKXL7SM.js";
34
34
  import {
35
35
  runTestsTool
36
- } from "./chunk-6RU5AKXB.js";
36
+ } from "./chunk-SCE4HTKR.js";
37
37
  import {
38
38
  CONFIG_DIR_NAME,
39
39
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
@@ -43,7 +43,7 @@ import {
43
43
  SUBAGENT_ALLOWED_TOOLS,
44
44
  SUBAGENT_DEFAULT_MAX_ROUNDS,
45
45
  SUBAGENT_MAX_ROUNDS_LIMIT
46
- } from "./chunk-25FKQO3A.js";
46
+ } from "./chunk-FK3WUEP6.js";
47
47
  import {
48
48
  loadChatIndex,
49
49
  searchChatMemory
@@ -11,10 +11,10 @@ import {
11
11
  listHooks,
12
12
  listInstalledPlugins,
13
13
  resetStats
14
- } from "./chunk-MSK2BAKT.js";
14
+ } from "./chunk-D3636NWD.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-CSATDZ3Z.js";
17
+ } from "./chunk-UKIDVNA5.js";
18
18
  import {
19
19
  getGitRoot
20
20
  } from "./chunk-HOSJZMQS.js";
@@ -26,7 +26,7 @@ import {
26
26
  MCP_PROJECT_CONFIG_NAME,
27
27
  MEMORY_FILE_NAME,
28
28
  VERSION
29
- } from "./chunk-25FKQO3A.js";
29
+ } from "./chunk-FK3WUEP6.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -509,6 +509,48 @@ function formatBytes(n) {
509
509
  if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
510
510
  return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`;
511
511
  }
512
+ function buildActionSummary(report) {
513
+ const problems = [];
514
+ const steps = [];
515
+ const configuredProviders = report.providers.filter((p) => p.configured).length;
516
+ if (configuredProviders === 0) {
517
+ problems.push("No API keys are configured.");
518
+ steps.push("Run aicli config and add a provider key, or configure Ollama for local use.");
519
+ }
520
+ if (report.npmCheck?.status === "outdated" && report.npmCheck.latest) {
521
+ problems.push(`Installed version ${report.version} is behind npm ${report.npmCheck.latest}.`);
522
+ steps.push("Upgrade with npm i -g jinzd-ai-cli@latest, then run aicli doctor again.");
523
+ }
524
+ if (report.context.skipped.length > 0) {
525
+ const first = report.context.skipped[0];
526
+ problems.push(`Context file skipped: ${first.displayPath} (${first.reason}).`);
527
+ steps.push("Fix or shrink the skipped context file, or adjust the context settings in config.");
528
+ }
529
+ if (report.hooks.pendingTrust > 0) {
530
+ problems.push(`${report.hooks.pendingTrust} project hook(s) are pending trust.`);
531
+ steps.push("Review hooks with /hooks list, then trust only the expected project hooks.");
532
+ }
533
+ if (report.plugins.invalid > 0 || report.plugins.untrusted > 0) {
534
+ problems.push(`Plugin attention needed: ${report.plugins.invalid} invalid, ${report.plugins.untrusted} untrusted.`);
535
+ steps.push("Inspect plugins with /plugin list and /plugin inspect <name>.");
536
+ }
537
+ const disconnected = report.mcp.statuses.filter((s) => !s.connected);
538
+ if (disconnected.length > 0) {
539
+ problems.push(`${disconnected.length} MCP server(s) are disconnected.`);
540
+ steps.push("Run /mcp reconnect; inspect server command/env if it stays disconnected.");
541
+ }
542
+ if (report.recentCrashes.length > 0) {
543
+ problems.push(`${report.recentCrashes.length} recent crash log(s) found.`);
544
+ steps.push("Open the newest crash log path shown below and include it in a bug report if reproducible.");
545
+ }
546
+ const total = report.toolStats.totalCalls;
547
+ const failures = report.toolStats.totalFailures;
548
+ if (total >= 10 && failures / total >= 0.2) {
549
+ problems.push(`Tool failure rate is ${(failures * 100 / total).toFixed(1)}% (${failures}/${total}).`);
550
+ steps.push("Check the Top failing tools section and narrow permissions or command scope.");
551
+ }
552
+ return { problems: problems.slice(0, 3), steps: steps.slice(0, 3) };
553
+ }
512
554
  function formatDoctorReport(report, ansi = true) {
513
555
  const wrap = (code, s) => ansi ? `${code}${s}\x1B[0m` : s;
514
556
  const B = (s) => wrap("\x1B[1m", s);
@@ -523,7 +565,7 @@ function formatDoctorReport(report, ansi = true) {
523
565
  const nc = report.npmCheck;
524
566
  let versionLine = ` version: ${report.version}`;
525
567
  if (nc?.status === "up-to-date") versionLine += ` ${D("(latest on npm)")}`;
526
- else if (nc?.status === "outdated" && nc.latest) versionLine += ` ${Y(`\u2192 ${nc.latest} available`)} ${D("(npm i -g jinzd-ai-cli@latest)")}`;
568
+ else if (nc?.status === "outdated" && nc.latest) versionLine += ` ${Y(`update available: ${nc.latest}`)} ${D("(npm i -g jinzd-ai-cli@latest)")}`;
527
569
  else if (nc?.status === "skipped") versionLine += ` ${D(`(npm check skipped: ${nc.reason ?? "unknown"})`)}`;
528
570
  out.push(versionLine);
529
571
  out.push(` node: ${report.node}`);
@@ -532,6 +574,19 @@ function formatDoctorReport(report, ansi = true) {
532
574
  out.push(` project: ${report.projectRoot}`);
533
575
  out.push(` config: ${report.configDir}`);
534
576
  out.push("");
577
+ const actionSummary = buildActionSummary(report);
578
+ if (actionSummary.problems.length > 0) {
579
+ out.push(B("Problems:"));
580
+ for (const p of actionSummary.problems) out.push(` ${Y("!")} ${p}`);
581
+ out.push("");
582
+ out.push(B("Suggested next steps:"));
583
+ actionSummary.steps.forEach((step, i) => out.push(` ${i + 1}. ${step}`));
584
+ out.push("");
585
+ } else {
586
+ out.push(B("Problems:"));
587
+ out.push(` ${G("OK")} No high-priority issues detected.`);
588
+ out.push("");
589
+ }
535
590
  out.push(B("API Keys:"));
536
591
  for (const p of report.providers) {
537
592
  out.push(` ${p.configured ? G("\u2713") : D("\u25CB")} ${p.id.padEnd(14)} ${p.configured ? G("configured") : D("not configured")}`);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-25FKQO3A.js";
4
+ } from "./chunk-FK3WUEP6.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -6,7 +6,7 @@ import { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.237";
9
+ var VERSION = "0.4.240";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  PLUGINS_DIR_NAME
5
- } from "./chunk-25FKQO3A.js";
5
+ } from "./chunk-FK3WUEP6.js";
6
6
  import {
7
7
  atomicWriteFileSync
8
8
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.237";
4
+ var VERSION = "0.4.240";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-J2M4GOFE.js";
5
+ } from "./chunk-4URJHGUY.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -13,10 +13,10 @@ import {
13
13
  } from "./chunk-QYQI7ZWK.js";
14
14
  import {
15
15
  ConfigManager
16
- } from "./chunk-CSATDZ3Z.js";
16
+ } from "./chunk-UKIDVNA5.js";
17
17
  import {
18
18
  VERSION
19
- } from "./chunk-25FKQO3A.js";
19
+ } from "./chunk-FK3WUEP6.js";
20
20
 
21
21
  // src/cli/ci.ts
22
22
  import { execFileSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-BTKFZUIJ.js";
4
+ } from "./chunk-3RAG6N4A.js";
5
5
  import {
6
6
  APP_NAME,
7
7
  CONFIG_DIR_NAME,
@@ -11,7 +11,7 @@ import {
11
11
  MCP_PROTOCOL_VERSION,
12
12
  MCP_TOOL_PREFIX,
13
13
  VERSION
14
- } from "./chunk-25FKQO3A.js";
14
+ } from "./chunk-FK3WUEP6.js";
15
15
  import {
16
16
  atomicWriteFileSync
17
17
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-25FKQO3A.js";
4
+ } from "./chunk-FK3WUEP6.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-25FKQO3A.js";
11
+ } from "./chunk-FK3WUEP6.js";
12
12
  import {
13
13
  atomicWriteFileSync
14
14
  } from "./chunk-IW3Q7AE5.js";
@@ -3,14 +3,14 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-45TJA46E.js";
7
- import "./chunk-J2M4GOFE.js";
6
+ } from "./chunk-MJJDVV7I.js";
7
+ import "./chunk-4URJHGUY.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
9
  import "./chunk-QYQI7ZWK.js";
10
10
  import "./chunk-O3XSFPYH.js";
11
- import "./chunk-CSATDZ3Z.js";
11
+ import "./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
  export {
16
16
  CI_COMMENT_MARKER,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-J2M4GOFE.js";
10
- import "./chunk-25FKQO3A.js";
9
+ } from "./chunk-4URJHGUY.js";
10
+ import "./chunk-FK3WUEP6.js";
11
11
  export {
12
12
  DEFAULT_CI_THRESHOLDS,
13
13
  detectCiGateSignals,
@@ -38,7 +38,7 @@ import {
38
38
  TEST_TIMEOUT,
39
39
  VERSION,
40
40
  buildUserIdentityPrompt
41
- } from "./chunk-25FKQO3A.js";
41
+ } from "./chunk-FK3WUEP6.js";
42
42
  export {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  APP_NAME,
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  formatDoctorReport,
4
4
  runDoctorCli
5
- } from "./chunk-NAPAMAFY.js";
5
+ } from "./chunk-4MBOMN32.js";
6
6
  import "./chunk-QYQI7ZWK.js";
7
- import "./chunk-MSK2BAKT.js";
7
+ import "./chunk-D3636NWD.js";
8
8
  import "./chunk-O3XSFPYH.js";
9
- import "./chunk-CSATDZ3Z.js";
9
+ import "./chunk-UKIDVNA5.js";
10
10
  import "./chunk-5ULLIOVC.js";
11
11
  import "./chunk-HOSJZMQS.js";
12
- import "./chunk-25FKQO3A.js";
12
+ import "./chunk-FK3WUEP6.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
14
  export {
15
15
  formatDoctorReport,
@@ -38,7 +38,7 @@ import {
38
38
  VERSION,
39
39
  buildUserIdentityPrompt,
40
40
  runTestsTool
41
- } from "./chunk-EG5P3AMC.js";
41
+ } from "./chunk-ATUYVDK7.js";
42
42
  import {
43
43
  hasSemanticIndex,
44
44
  semanticSearch
@@ -15087,6 +15087,48 @@ function formatBytes(n) {
15087
15087
  if (n < 1024 * 1024 * 1024) return `${(n / 1024 / 1024).toFixed(1)} MB`;
15088
15088
  return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`;
15089
15089
  }
15090
+ function buildActionSummary(report) {
15091
+ const problems = [];
15092
+ const steps = [];
15093
+ const configuredProviders = report.providers.filter((p) => p.configured).length;
15094
+ if (configuredProviders === 0) {
15095
+ problems.push("No API keys are configured.");
15096
+ steps.push("Run aicli config and add a provider key, or configure Ollama for local use.");
15097
+ }
15098
+ if (report.npmCheck?.status === "outdated" && report.npmCheck.latest) {
15099
+ problems.push(`Installed version ${report.version} is behind npm ${report.npmCheck.latest}.`);
15100
+ steps.push("Upgrade with npm i -g jinzd-ai-cli@latest, then run aicli doctor again.");
15101
+ }
15102
+ if (report.context.skipped.length > 0) {
15103
+ const first = report.context.skipped[0];
15104
+ problems.push(`Context file skipped: ${first.displayPath} (${first.reason}).`);
15105
+ steps.push("Fix or shrink the skipped context file, or adjust the context settings in config.");
15106
+ }
15107
+ if (report.hooks.pendingTrust > 0) {
15108
+ problems.push(`${report.hooks.pendingTrust} project hook(s) are pending trust.`);
15109
+ steps.push("Review hooks with /hooks list, then trust only the expected project hooks.");
15110
+ }
15111
+ if (report.plugins.invalid > 0 || report.plugins.untrusted > 0) {
15112
+ problems.push(`Plugin attention needed: ${report.plugins.invalid} invalid, ${report.plugins.untrusted} untrusted.`);
15113
+ steps.push("Inspect plugins with /plugin list and /plugin inspect <name>.");
15114
+ }
15115
+ const disconnected = report.mcp.statuses.filter((s) => !s.connected);
15116
+ if (disconnected.length > 0) {
15117
+ problems.push(`${disconnected.length} MCP server(s) are disconnected.`);
15118
+ steps.push("Run /mcp reconnect; inspect server command/env if it stays disconnected.");
15119
+ }
15120
+ if (report.recentCrashes.length > 0) {
15121
+ problems.push(`${report.recentCrashes.length} recent crash log(s) found.`);
15122
+ steps.push("Open the newest crash log path shown below and include it in a bug report if reproducible.");
15123
+ }
15124
+ const total = report.toolStats.totalCalls;
15125
+ const failures = report.toolStats.totalFailures;
15126
+ if (total >= 10 && failures / total >= 0.2) {
15127
+ problems.push(`Tool failure rate is ${(failures * 100 / total).toFixed(1)}% (${failures}/${total}).`);
15128
+ steps.push("Check the Top failing tools section and narrow permissions or command scope.");
15129
+ }
15130
+ return { problems: problems.slice(0, 3), steps: steps.slice(0, 3) };
15131
+ }
15090
15132
  function formatDoctorReport(report, ansi = true) {
15091
15133
  const wrap = (code, s) => ansi ? `${code}${s}\x1B[0m` : s;
15092
15134
  const B = (s) => wrap("\x1B[1m", s);
@@ -15101,7 +15143,7 @@ function formatDoctorReport(report, ansi = true) {
15101
15143
  const nc = report.npmCheck;
15102
15144
  let versionLine = ` version: ${report.version}`;
15103
15145
  if (nc?.status === "up-to-date") versionLine += ` ${D("(latest on npm)")}`;
15104
- else if (nc?.status === "outdated" && nc.latest) versionLine += ` ${Y(`\u2192 ${nc.latest} available`)} ${D("(npm i -g jinzd-ai-cli@latest)")}`;
15146
+ else if (nc?.status === "outdated" && nc.latest) versionLine += ` ${Y(`update available: ${nc.latest}`)} ${D("(npm i -g jinzd-ai-cli@latest)")}`;
15105
15147
  else if (nc?.status === "skipped") versionLine += ` ${D(`(npm check skipped: ${nc.reason ?? "unknown"})`)}`;
15106
15148
  out.push(versionLine);
15107
15149
  out.push(` node: ${report.node}`);
@@ -15110,6 +15152,19 @@ function formatDoctorReport(report, ansi = true) {
15110
15152
  out.push(` project: ${report.projectRoot}`);
15111
15153
  out.push(` config: ${report.configDir}`);
15112
15154
  out.push("");
15155
+ const actionSummary = buildActionSummary(report);
15156
+ if (actionSummary.problems.length > 0) {
15157
+ out.push(B("Problems:"));
15158
+ for (const p of actionSummary.problems) out.push(` ${Y("!")} ${p}`);
15159
+ out.push("");
15160
+ out.push(B("Suggested next steps:"));
15161
+ actionSummary.steps.forEach((step, i) => out.push(` ${i + 1}. ${step}`));
15162
+ out.push("");
15163
+ } else {
15164
+ out.push(B("Problems:"));
15165
+ out.push(` ${G("OK")} No high-priority issues detected.`);
15166
+ out.push("");
15167
+ }
15113
15168
  out.push(B("API Keys:"));
15114
15169
  for (const p of report.providers) {
15115
15170
  out.push(` ${p.configured ? G("\u2713") : D("\u25CB")} ${p.id.padEnd(14)} ${p.configured ? G("configured") : D("not configured")}`);
@@ -15873,6 +15928,10 @@ async function handleMcp(_args, ctx) {
15873
15928
  ctx.sendToolsList();
15874
15929
  return;
15875
15930
  }
15931
+ if (sub) {
15932
+ 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(" ")}` });
15933
+ return;
15934
+ }
15876
15935
  const statuses = ctx.mcpManager.getStatus();
15877
15936
  if (statuses.length === 0) {
15878
15937
  ctx.send({ type: "info", message: "No MCP servers configured." });
@@ -16036,7 +16095,7 @@ async function handleSecurityReview(args, ctx) {
16036
16095
  async function handleTest(args, ctx) {
16037
16096
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
16038
16097
  try {
16039
- const { executeTests } = await import("./run-tests-K36VNQ5W.js");
16098
+ const { executeTests } = await import("./run-tests-PRGRUUKE.js");
16040
16099
  const argStr = args.join(" ").trim();
16041
16100
  let testArgs = {};
16042
16101
  if (argStr) {
@@ -16674,12 +16733,21 @@ var SessionHandler = class {
16674
16733
  planMode = false;
16675
16734
  runtimeThinking = null;
16676
16735
  sessionTokenUsage = { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
16736
+ unknownPricingWarnings = /* @__PURE__ */ new Set();
16677
16737
  /** Accumulate a TokenUsage (with optional cache fields) into sessionTokenUsage. */
16678
16738
  addWebSessionUsage(u) {
16679
16739
  this.sessionTokenUsage.inputTokens += u.inputTokens;
16680
16740
  this.sessionTokenUsage.outputTokens += u.outputTokens;
16681
16741
  this.sessionTokenUsage.cacheCreationTokens += u.cacheCreationTokens ?? 0;
16682
16742
  this.sessionTokenUsage.cacheReadTokens += u.cacheReadTokens ?? 0;
16743
+ const totalTokens = u.inputTokens + u.outputTokens + (u.cacheCreationTokens ?? 0) + (u.cacheReadTokens ?? 0);
16744
+ if (totalTokens > 0 && !getPricing(this.currentProvider, this.currentModel)) {
16745
+ const key = `${this.currentProvider}/${this.currentModel}`;
16746
+ if (!this.unknownPricingWarnings.has(key)) {
16747
+ this.unknownPricingWarnings.add(key);
16748
+ 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.` });
16749
+ }
16750
+ }
16683
16751
  }
16684
16752
  resetWebSessionUsage() {
16685
16753
  this.sessionTokenUsage = { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
@@ -16783,6 +16851,7 @@ var SessionHandler = class {
16783
16851
  models: p.info.models.map((m) => ({ id: m.id, name: m.displayName ?? m.id }))
16784
16852
  }));
16785
16853
  const costUsd = computeCost(this.currentProvider, this.currentModel, this.sessionTokenUsage);
16854
+ const costPricingUnknown = costUsd == null && this.sessionTokenUsage.inputTokens + this.sessionTokenUsage.outputTokens + this.sessionTokenUsage.cacheCreationTokens + this.sessionTokenUsage.cacheReadTokens > 0;
16786
16855
  const sess = this.sessions.current;
16787
16856
  const branches = sess ? sess.listBranches().map((b) => ({
16788
16857
  id: b.id,
@@ -16798,12 +16867,14 @@ var SessionHandler = class {
16798
16867
  model: this.currentModel,
16799
16868
  sessionId: this.sessions.current?.id ?? "",
16800
16869
  sessionTitle: this.sessions.current?.title ?? void 0,
16870
+ cwd: process.cwd(),
16801
16871
  messageCount: this.sessions.current?.messages.length ?? 0,
16802
16872
  planMode: this.planMode,
16803
16873
  thinkingMode: this.runtimeThinking ?? false,
16804
16874
  permissionProfile: this.config.get("defaultPermissionProfile") ?? "legacy",
16805
16875
  tokenUsage: { ...this.sessionTokenUsage },
16806
16876
  costUsd,
16877
+ costPricingUnknown,
16807
16878
  providers: providerList,
16808
16879
  branches,
16809
16880
  activeBranchId: sess?.activeBranchId ?? "main",
@@ -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-AJRFTQVB.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-SFGLDJEX.js");
158
158
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
159
159
  let interrupted = false;
160
160
  const onSigint = () => {