jinzd-ai-cli 0.4.229 → 0.4.231

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 (32) hide show
  1. package/dist/{batch-XZHTNJXJ.js → batch-FLMFMR3R.js} +3 -3
  2. package/dist/{chunk-DEHVRQWW.js → chunk-4KM53GLG.js} +1 -1
  3. package/dist/{chunk-PQLRX7US.js → chunk-5T746UEU.js} +4 -4
  4. package/dist/{chunk-EEQHP4GK.js → chunk-62R7CACG.js} +101 -302
  5. package/dist/{chunk-SJ36SUG7.js → chunk-75TAFSFZ.js} +2 -2
  6. package/dist/{chunk-AXIMNQSY.js → chunk-ADARC33O.js} +1 -1
  7. package/dist/{chunk-DMF6UHO6.js → chunk-FWAA3ARX.js} +14 -24
  8. package/dist/{chunk-QFOJ4GXC.js → chunk-NB7LR3TP.js} +4 -4
  9. package/dist/{chunk-TEXAIWUJ.js → chunk-TQPU3J4P.js} +1 -1
  10. package/dist/{chunk-QCGKCNBX.js → chunk-UOIUGBG2.js} +1 -1
  11. package/dist/{chunk-FEVOW3NQ.js → chunk-XTMHBOHG.js} +1 -1
  12. package/dist/{chunk-AEXWMIRE.js → chunk-YH657UWU.js} +1 -1
  13. package/dist/{chunk-B3POS7LB.js → chunk-ZOLZ6JPG.js} +1 -1
  14. package/dist/{chunk-QYQCCIBT.js → chunk-ZWU7FWHO.js} +22 -3
  15. package/dist/{ci-ZCVDKFXY.js → ci-SI2VXE4Q.js} +5 -5
  16. package/dist/{ci-format-CKXDFTN3.js → ci-format-SFTFN3SE.js} +2 -2
  17. package/dist/{constants-J2MSGNFA.js → constants-EOWAB3VR.js} +1 -1
  18. package/dist/{doctor-cli-3VNTECP2.js → doctor-cli-4YVKJESI.js} +5 -5
  19. package/dist/electron-server.js +157 -356
  20. package/dist/{hub-LIH5JEI7.js → hub-6IKXR32G.js} +2 -2
  21. package/dist/index.js +36 -49
  22. package/dist/{persist-XUXIPYUU.js → persist-I3JI27OK.js} +2 -2
  23. package/dist/{pr-HY2QCVUY.js → pr-QJFFSYEU.js} +5 -5
  24. package/dist/{run-tests-QVXDTJ3O.js → run-tests-RZKUBZB4.js} +1 -1
  25. package/dist/{run-tests-WBGQI5V7.js → run-tests-ZBX476UL.js} +2 -2
  26. package/dist/{server-5RXWIX4I.js → server-4XGNHG6P.js} +4 -4
  27. package/dist/{server-LYTXYK6Y.js → server-6IDBCCJ2.js} +32 -39
  28. package/dist/{task-orchestrator-FA4KOVD2.js → task-orchestrator-UGKJ7UY4.js} +4 -4
  29. package/dist/{usage-EHV6YVGH.js → usage-2VGL3YWF.js} +2 -2
  30. package/dist/web/client/app.js +13 -5
  31. package/dist/web/client/index.html +14 -6
  32. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-FEVOW3NQ.js";
4
+ } from "./chunk-XTMHBOHG.js";
5
5
  import "./chunk-5ULLIOVC.js";
6
- import "./chunk-B3POS7LB.js";
6
+ import "./chunk-ZOLZ6JPG.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -200,7 +200,7 @@ async function cmdResults(batchId, outPath) {
200
200
  console.log(`Saved ${lines.length} result(s) to ${outPath} (${ok} succeeded, ${err} failed/errored).`);
201
201
  } else {
202
202
  process.stdout.write(body);
203
- process.stderr.write(`
203
+ process.stdout.write(`
204
204
  [Summary] ${lines.length} results: ${ok} succeeded, ${err} failed/errored.
205
205
  `);
206
206
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SessionManager
4
- } from "./chunk-QYQCCIBT.js";
4
+ } from "./chunk-ZWU7FWHO.js";
5
5
 
6
6
  // src/hub/persist.ts
7
7
  import { join } from "path";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-AXIMNQSY.js";
5
+ } from "./chunk-ADARC33O.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -10,13 +10,13 @@ import {
10
10
  } from "./chunk-HLWUDRBO.js";
11
11
  import {
12
12
  ProviderRegistry
13
- } from "./chunk-EEQHP4GK.js";
13
+ } from "./chunk-62R7CACG.js";
14
14
  import {
15
15
  ConfigManager
16
- } from "./chunk-FEVOW3NQ.js";
16
+ } from "./chunk-XTMHBOHG.js";
17
17
  import {
18
18
  VERSION
19
- } from "./chunk-B3POS7LB.js";
19
+ } from "./chunk-ZOLZ6JPG.js";
20
20
 
21
21
  // src/cli/ci.ts
22
22
  import { execFileSync } from "child_process";
@@ -1522,84 +1522,44 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
1522
1522
  }
1523
1523
  };
1524
1524
 
1525
- // src/providers/zhipu.ts
1526
- var ZhipuProvider = class extends OpenAICompatibleProvider {
1527
- defaultBaseUrl = "https://open.bigmodel.cn/api/paas/v4";
1528
- // GLM-5 / GLM-5.1 等深度思考模型生成长内容需要较长时间,默认 5 分钟
1529
- defaultTimeout = 3e5;
1530
- info = {
1531
- id: "zhipu",
1532
- displayName: "Zhipu (GLM)",
1533
- // 默认选 GLM-4.6:中文写作口碑最稳 + 200K 上下文 + 价格只有 5.1 的 ~1/2。
1534
- // 需要 Agent 长跑 / 代码工程时再手动 /model glm-5.1。
1535
- defaultModel: "glm-4.6",
1536
- apiKeyEnvVar: "AICLI_API_KEY_ZHIPU",
1537
- requiresApiKey: true,
1538
- baseUrl: this.defaultBaseUrl,
1539
- models: [
1540
- // ── GLM-5.2 系列(2026-06 最新旗舰,主打代码工程) ──
1541
- // 744B MoE / 40B active,与 5.1 同底座,后训练强化超长上下文代码任务。
1542
- // 思考模式 High/Max 由请求参数控制,不另列 model id。
1543
- // 上下文:标准 `glm-5.2` 在 paas/v4 上原生即 1M(open.bigmodel.cn/pricing 定价页
1544
- // 实测口径 1M,¥8/¥28)。曾被移除的 `glm-5.2[1m]` 是 *带后缀的 model code*——那个
1545
- // code 只在 GLM Coding Plan 的 Anthropic 兼容端点存在,paas/v4 不认会报「模型不存在」;
1546
- // 1M 能力本身在标准 code 上就有,无需后缀。
1547
- {
1548
- id: "glm-5.2",
1549
- displayName: "GLM-5.2 (2026-06 Flagship, 1M, Coding)",
1550
- contextWindow: 1048576,
1551
- supportsStreaming: true,
1552
- supportsThinking: true
1553
- },
1554
- // 视觉编程旗舰:原生多模态(图片 / 短视频 / 文本同上下文)。API model code = `glm-5v-turbo`
1555
- // (Z.ai 官方文档代码示例确认)。REPL 用 `@./pic.png` 引用本地图即可走 vision 请求;
1556
- // getVisionModelHint 已识别 `5v` 不拦截。
1557
- {
1558
- id: "glm-5v-turbo",
1559
- displayName: "GLM-5V-Turbo (Multimodal Vision + Coding)",
1560
- contextWindow: 202752,
1561
- supportsStreaming: true
1562
- },
1563
- // ── GLM-5.1 系列(2026-04 旗舰,主打长程 Agent + 代码工程) ──
1564
- {
1565
- id: "glm-5.1",
1566
- displayName: "GLM-5.1 (2026 Flagship, 200K, Agent+Code)",
1567
- contextWindow: 204800,
1568
- supportsStreaming: true,
1569
- supportsThinking: true
1570
- },
1571
- {
1572
- id: "glm-5.1-reasoning",
1573
- displayName: "GLM-5.1 Reasoning (Deep Thinking)",
1574
- contextWindow: 204800,
1575
- supportsStreaming: true,
1576
- supportsThinking: true
1577
- },
1578
- {
1579
- id: "glm-5.1-air",
1580
- displayName: "GLM-5.1 Air (Lightweight 5.1)",
1581
- contextWindow: 204800,
1582
- supportsStreaming: true,
1583
- supportsThinking: true
1584
- },
1585
- // ── GLM-5 系列(2026-02) ──
1586
- {
1587
- id: "glm-5",
1588
- displayName: "GLM-5 (Flagship, Deep Thinking)",
1589
- contextWindow: 131072,
1590
- supportsStreaming: true,
1591
- supportsThinking: true
1592
- },
1593
- // ── GLM-4.6 系列(2025-09,中文写作口碑最佳) ──
1594
- {
1595
- id: "glm-4.6",
1596
- displayName: "GLM-4.6 (200K, \u4E2D\u6587\u5199\u4F5C\u63A8\u8350)",
1597
- contextWindow: 204800,
1598
- supportsStreaming: true
1599
- }
1600
- ]
1525
+ // src/providers/static-config.ts
1526
+ function createStaticProviderClass(config) {
1527
+ return class extends OpenAICompatibleProvider {
1528
+ defaultBaseUrl = config.baseUrl;
1529
+ defaultTimeout = config.defaultTimeout ?? 12e4;
1530
+ enableStreamingToolCalls = config.enableStreamingToolCalls ?? true;
1531
+ reliableContentOnlyTee = config.reliableContentOnlyTee ?? true;
1532
+ info = {
1533
+ id: config.id,
1534
+ displayName: config.displayName,
1535
+ defaultModel: config.defaultModel,
1536
+ apiKeyEnvVar: config.apiKeyEnvVar,
1537
+ requiresApiKey: config.requiresApiKey ?? true,
1538
+ baseUrl: config.baseUrl,
1539
+ models: config.models
1540
+ };
1601
1541
  };
1542
+ }
1543
+
1544
+ // src/providers/zhipu.ts
1545
+ var ZHIPU_CONFIG = {
1546
+ id: "zhipu",
1547
+ displayName: "Zhipu (GLM)",
1548
+ defaultModel: "glm-4.6",
1549
+ apiKeyEnvVar: "AICLI_API_KEY_ZHIPU",
1550
+ baseUrl: "https://open.bigmodel.cn/api/paas/v4",
1551
+ defaultTimeout: 3e5,
1552
+ models: [
1553
+ { id: "glm-5.2", displayName: "GLM-5.2 (2026-06 Flagship, 1M, Coding)", contextWindow: 1048576, supportsStreaming: true, supportsThinking: true },
1554
+ { id: "glm-5v-turbo", displayName: "GLM-5V-Turbo (Multimodal Vision + Coding)", contextWindow: 202752, supportsStreaming: true },
1555
+ { id: "glm-5.1", displayName: "GLM-5.1 (2026 Flagship, 200K, Agent+Code)", contextWindow: 204800, supportsStreaming: true, supportsThinking: true },
1556
+ { id: "glm-5.1-reasoning", displayName: "GLM-5.1 Reasoning (Deep Thinking)", contextWindow: 204800, supportsStreaming: true, supportsThinking: true },
1557
+ { id: "glm-5.1-air", displayName: "GLM-5.1 Air (Lightweight 5.1)", contextWindow: 204800, supportsStreaming: true, supportsThinking: true },
1558
+ { id: "glm-5", displayName: "GLM-5 (Flagship, Deep Thinking)", contextWindow: 131072, supportsStreaming: true, supportsThinking: true },
1559
+ { id: "glm-4.6", displayName: "GLM-4.6 (200K, \u4E2D\u6587\u5199\u4F5C\u63A8\u8350)", contextWindow: 204800, supportsStreaming: true }
1560
+ ]
1602
1561
  };
1562
+ var ZhipuProvider = createStaticProviderClass(ZHIPU_CONFIG);
1603
1563
 
1604
1564
  // src/providers/kimi.ts
1605
1565
  var KIMI_XML_REMINDER = `
@@ -1766,242 +1726,81 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
1766
1726
  };
1767
1727
 
1768
1728
  // src/providers/minimax.ts
1769
- var MiniMaxProvider = class extends OpenAICompatibleProvider {
1770
- defaultBaseUrl = "https://api.minimaxi.com/v1";
1771
- info = {
1772
- id: "minimax",
1773
- displayName: "MiniMax (\u6D77\u87BA)",
1774
- defaultModel: "MiniMax-M3",
1775
- apiKeyEnvVar: "AICLI_API_KEY_MINIMAX",
1776
- requiresApiKey: true,
1777
- baseUrl: this.defaultBaseUrl,
1778
- models: [
1779
- {
1780
- id: "MiniMax-M3",
1781
- displayName: "MiniMax M3\uFF08\u65D7\u8230\uFF0C1M \u4E0A\u4E0B\u6587\uFF09",
1782
- contextWindow: 1e6,
1783
- supportsStreaming: true
1784
- },
1785
- {
1786
- id: "MiniMax-M2.7",
1787
- displayName: "MiniMax M2.7",
1788
- contextWindow: 1e6,
1789
- supportsStreaming: true
1790
- },
1791
- {
1792
- id: "MiniMax-M2.7-highspeed",
1793
- displayName: "MiniMax M2.7 Highspeed",
1794
- contextWindow: 1e6,
1795
- supportsStreaming: true
1796
- },
1797
- {
1798
- id: "MiniMax-M2.5",
1799
- displayName: "MiniMax M2.5",
1800
- contextWindow: 1e6,
1801
- supportsStreaming: true
1802
- },
1803
- {
1804
- id: "MiniMax-M2.5-highspeed",
1805
- displayName: "MiniMax M2.5 Highspeed",
1806
- contextWindow: 1e6,
1807
- supportsStreaming: true
1808
- }
1809
- ]
1810
- };
1729
+ var MINIMAX_CONFIG = {
1730
+ id: "minimax",
1731
+ displayName: "MiniMax (\u6D77\u87BA)",
1732
+ defaultModel: "MiniMax-M3",
1733
+ apiKeyEnvVar: "AICLI_API_KEY_MINIMAX",
1734
+ baseUrl: "https://api.minimaxi.com/v1",
1735
+ models: [
1736
+ { id: "MiniMax-M3", displayName: "MiniMax M3\uFF08\u65D7\u8230\uFF0C1M \u4E0A\u4E0B\u6587\uFF09", contextWindow: 1e6, supportsStreaming: true },
1737
+ { id: "MiniMax-M2.7", displayName: "MiniMax M2.7", contextWindow: 1e6, supportsStreaming: true },
1738
+ { id: "MiniMax-M2.7-highspeed", displayName: "MiniMax M2.7 Highspeed", contextWindow: 1e6, supportsStreaming: true },
1739
+ { id: "MiniMax-M2.5", displayName: "MiniMax M2.5", contextWindow: 1e6, supportsStreaming: true },
1740
+ { id: "MiniMax-M2.5-highspeed", displayName: "MiniMax M2.5 Highspeed", contextWindow: 1e6, supportsStreaming: true }
1741
+ ]
1811
1742
  };
1743
+ var MiniMaxProvider = createStaticProviderClass(MINIMAX_CONFIG);
1812
1744
 
1813
1745
  // src/providers/qwen.ts
1814
- var QwenProvider = class extends OpenAICompatibleProvider {
1815
- defaultBaseUrl = "https://dashscope.aliyuncs.com/compatible-mode/v1";
1816
- info = {
1817
- id: "qwen",
1818
- displayName: "Qwen (Alibaba Cloud)",
1819
- defaultModel: "qwen-plus",
1820
- apiKeyEnvVar: "AICLI_API_KEY_QWEN",
1821
- requiresApiKey: true,
1822
- baseUrl: this.defaultBaseUrl,
1823
- models: [
1824
- {
1825
- id: "qwen-plus",
1826
- displayName: "Qwen Plus",
1827
- contextWindow: 131072,
1828
- supportsStreaming: true
1829
- },
1830
- {
1831
- id: "qwen-max",
1832
- displayName: "Qwen Max",
1833
- contextWindow: 131072,
1834
- supportsStreaming: true
1835
- },
1836
- {
1837
- id: "qwen-turbo",
1838
- displayName: "Qwen Turbo",
1839
- contextWindow: 131072,
1840
- supportsStreaming: true
1841
- },
1842
- {
1843
- id: "qwen-coder-plus",
1844
- displayName: "Qwen Coder Plus",
1845
- contextWindow: 131072,
1846
- supportsStreaming: true
1847
- }
1848
- ]
1849
- };
1746
+ var QWEN_CONFIG = {
1747
+ id: "qwen",
1748
+ displayName: "Qwen (Alibaba Cloud)",
1749
+ defaultModel: "qwen-plus",
1750
+ apiKeyEnvVar: "AICLI_API_KEY_QWEN",
1751
+ baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
1752
+ models: [
1753
+ { id: "qwen-plus", displayName: "Qwen Plus", contextWindow: 131072, supportsStreaming: true },
1754
+ { id: "qwen-max", displayName: "Qwen Max", contextWindow: 131072, supportsStreaming: true },
1755
+ { id: "qwen-turbo", displayName: "Qwen Turbo", contextWindow: 131072, supportsStreaming: true },
1756
+ { id: "qwen-coder-plus", displayName: "Qwen Coder Plus", contextWindow: 131072, supportsStreaming: true }
1757
+ ]
1850
1758
  };
1759
+ var QwenProvider = createStaticProviderClass(QWEN_CONFIG);
1851
1760
 
1852
1761
  // src/providers/openai.ts
1853
- var OpenAIProvider = class extends OpenAICompatibleProvider {
1854
- defaultBaseUrl = "https://api.openai.com/v1";
1855
- info = {
1856
- id: "openai",
1857
- displayName: "OpenAI",
1858
- defaultModel: "gpt-5.4",
1859
- apiKeyEnvVar: "AICLI_API_KEY_OPENAI",
1860
- requiresApiKey: true,
1861
- baseUrl: this.defaultBaseUrl,
1862
- models: [
1863
- // GPT-5.4 系列(最新旗舰,1.05M 上下文)
1864
- {
1865
- id: "gpt-5.4",
1866
- displayName: "GPT-5.4",
1867
- contextWindow: 105e4,
1868
- supportsStreaming: true
1869
- },
1870
- {
1871
- id: "gpt-5.4-pro",
1872
- displayName: "GPT-5.4 Pro",
1873
- contextWindow: 105e4,
1874
- supportsStreaming: true
1875
- },
1876
- // GPT-5 系列(400K 上下文)
1877
- {
1878
- id: "gpt-5",
1879
- displayName: "GPT-5",
1880
- contextWindow: 4e5,
1881
- supportsStreaming: true
1882
- },
1883
- {
1884
- id: "gpt-5-mini",
1885
- displayName: "GPT-5 Mini",
1886
- contextWindow: 4e5,
1887
- supportsStreaming: true
1888
- },
1889
- {
1890
- id: "gpt-5-nano",
1891
- displayName: "GPT-5 Nano",
1892
- contextWindow: 4e5,
1893
- supportsStreaming: true
1894
- },
1895
- // GPT-4.1 系列(1M 上下文)
1896
- {
1897
- id: "gpt-4.1",
1898
- displayName: "GPT-4.1",
1899
- contextWindow: 1048576,
1900
- supportsStreaming: true
1901
- },
1902
- {
1903
- id: "gpt-4.1-mini",
1904
- displayName: "GPT-4.1 Mini",
1905
- contextWindow: 1048576,
1906
- supportsStreaming: true
1907
- },
1908
- {
1909
- id: "gpt-4.1-nano",
1910
- displayName: "GPT-4.1 Nano",
1911
- contextWindow: 1048576,
1912
- supportsStreaming: true
1913
- },
1914
- // 推理模型(200K 上下文)
1915
- {
1916
- id: "o3",
1917
- displayName: "o3",
1918
- contextWindow: 2e5,
1919
- supportsStreaming: true
1920
- },
1921
- {
1922
- id: "o4-mini",
1923
- displayName: "o4 Mini",
1924
- contextWindow: 2e5,
1925
- supportsStreaming: true
1926
- }
1927
- ]
1928
- };
1762
+ var OPENAI_CONFIG = {
1763
+ id: "openai",
1764
+ displayName: "OpenAI",
1765
+ defaultModel: "gpt-5.4",
1766
+ apiKeyEnvVar: "AICLI_API_KEY_OPENAI",
1767
+ baseUrl: "https://api.openai.com/v1",
1768
+ models: [
1769
+ { id: "gpt-5.4", displayName: "GPT-5.4", contextWindow: 105e4, supportsStreaming: true },
1770
+ { id: "gpt-5.4-pro", displayName: "GPT-5.4 Pro", contextWindow: 105e4, supportsStreaming: true },
1771
+ { id: "gpt-5", displayName: "GPT-5", contextWindow: 4e5, supportsStreaming: true },
1772
+ { id: "gpt-5-mini", displayName: "GPT-5 Mini", contextWindow: 4e5, supportsStreaming: true },
1773
+ { id: "gpt-5-nano", displayName: "GPT-5 Nano", contextWindow: 4e5, supportsStreaming: true },
1774
+ { id: "gpt-4.1", displayName: "GPT-4.1", contextWindow: 1048576, supportsStreaming: true },
1775
+ { id: "gpt-4.1-mini", displayName: "GPT-4.1 Mini", contextWindow: 1048576, supportsStreaming: true },
1776
+ { id: "gpt-4.1-nano", displayName: "GPT-4.1 Nano", contextWindow: 1048576, supportsStreaming: true },
1777
+ { id: "o3", displayName: "o3", contextWindow: 2e5, supportsStreaming: true },
1778
+ { id: "o4-mini", displayName: "o4 Mini", contextWindow: 2e5, supportsStreaming: true }
1779
+ ]
1929
1780
  };
1781
+ var OpenAIProvider = createStaticProviderClass(OPENAI_CONFIG);
1930
1782
 
1931
1783
  // src/providers/openrouter.ts
1932
- var OpenRouterProvider = class extends OpenAICompatibleProvider {
1933
- defaultBaseUrl = "https://openrouter.ai/api/v1";
1934
- info = {
1935
- id: "openrouter",
1936
- displayName: "OpenRouter",
1937
- defaultModel: "anthropic/claude-sonnet-4",
1938
- apiKeyEnvVar: "AICLI_API_KEY_OPENROUTER",
1939
- requiresApiKey: true,
1940
- baseUrl: this.defaultBaseUrl,
1941
- models: [
1942
- {
1943
- id: "anthropic/claude-opus-4",
1944
- displayName: "Claude Opus 4",
1945
- contextWindow: 2e5,
1946
- supportsStreaming: true
1947
- },
1948
- {
1949
- id: "anthropic/claude-sonnet-4",
1950
- displayName: "Claude Sonnet 4",
1951
- contextWindow: 2e5,
1952
- supportsStreaming: true
1953
- },
1954
- {
1955
- id: "anthropic/claude-haiku-4",
1956
- displayName: "Claude Haiku 4",
1957
- contextWindow: 2e5,
1958
- supportsStreaming: true
1959
- },
1960
- {
1961
- id: "openai/gpt-5.4",
1962
- displayName: "GPT-5.4",
1963
- contextWindow: 105e4,
1964
- supportsStreaming: true
1965
- },
1966
- {
1967
- id: "google/gemini-2.5-pro",
1968
- displayName: "Gemini 2.5 Pro",
1969
- contextWindow: 1048576,
1970
- supportsStreaming: true
1971
- },
1972
- {
1973
- id: "google/gemini-2.5-flash",
1974
- displayName: "Gemini 2.5 Flash",
1975
- contextWindow: 1048576,
1976
- supportsStreaming: true
1977
- },
1978
- {
1979
- id: "meta-llama/llama-4-maverick",
1980
- displayName: "Llama 4 Maverick",
1981
- contextWindow: 1048576,
1982
- supportsStreaming: true
1983
- },
1984
- {
1985
- id: "meta-llama/llama-4-scout",
1986
- displayName: "Llama 4 Scout",
1987
- contextWindow: 512e3,
1988
- supportsStreaming: true
1989
- },
1990
- {
1991
- id: "qwen/qwen3-coder",
1992
- displayName: "Qwen3 Coder",
1993
- contextWindow: 262144,
1994
- supportsStreaming: true
1995
- },
1996
- {
1997
- id: "mistralai/mistral-large",
1998
- displayName: "Mistral Large",
1999
- contextWindow: 131072,
2000
- supportsStreaming: true
2001
- }
2002
- ]
2003
- };
1784
+ var OPENROUTER_CONFIG = {
1785
+ id: "openrouter",
1786
+ displayName: "OpenRouter",
1787
+ defaultModel: "anthropic/claude-sonnet-4",
1788
+ apiKeyEnvVar: "AICLI_API_KEY_OPENROUTER",
1789
+ baseUrl: "https://openrouter.ai/api/v1",
1790
+ models: [
1791
+ { id: "anthropic/claude-opus-4", displayName: "Claude Opus 4", contextWindow: 2e5, supportsStreaming: true },
1792
+ { id: "anthropic/claude-sonnet-4", displayName: "Claude Sonnet 4", contextWindow: 2e5, supportsStreaming: true },
1793
+ { id: "anthropic/claude-haiku-4", displayName: "Claude Haiku 4", contextWindow: 2e5, supportsStreaming: true },
1794
+ { id: "openai/gpt-5.4", displayName: "GPT-5.4", contextWindow: 105e4, supportsStreaming: true },
1795
+ { id: "google/gemini-2.5-pro", displayName: "Gemini 2.5 Pro", contextWindow: 1048576, supportsStreaming: true },
1796
+ { id: "google/gemini-2.5-flash", displayName: "Gemini 2.5 Flash", contextWindow: 1048576, supportsStreaming: true },
1797
+ { id: "meta-llama/llama-4-maverick", displayName: "Llama 4 Maverick", contextWindow: 1048576, supportsStreaming: true },
1798
+ { id: "meta-llama/llama-4-scout", displayName: "Llama 4 Scout", contextWindow: 512e3, supportsStreaming: true },
1799
+ { id: "qwen/qwen3-coder", displayName: "Qwen3 Coder", contextWindow: 262144, supportsStreaming: true },
1800
+ { id: "mistralai/mistral-large", displayName: "Mistral Large", contextWindow: 131072, supportsStreaming: true }
1801
+ ]
2004
1802
  };
1803
+ var OpenRouterProvider = createStaticProviderClass(OPENROUTER_CONFIG);
2005
1804
 
2006
1805
  // src/providers/ollama.ts
2007
1806
  var OllamaProvider = class extends OpenAICompatibleProvider {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-DMF6UHO6.js";
4
+ } from "./chunk-FWAA3ARX.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-B3POS7LB.js";
14
+ } from "./chunk-ZOLZ6JPG.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
  VERSION
4
- } from "./chunk-B3POS7LB.js";
4
+ } from "./chunk-ZOLZ6JPG.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -14,7 +14,7 @@ import {
14
14
  runHook,
15
15
  runLifecycleHooks,
16
16
  runTool
17
- } from "./chunk-TEXAIWUJ.js";
17
+ } from "./chunk-TQPU3J4P.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-AEXWMIRE.js";
36
+ } from "./chunk-YH657UWU.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-B3POS7LB.js";
46
+ } from "./chunk-ZOLZ6JPG.js";
47
47
  import {
48
48
  loadChatIndex,
49
49
  searchChatMemory
@@ -1219,7 +1219,17 @@ Current working directory: ${process.cwd()}
1219
1219
  Please use list_dir to verify the file path and retry.`
1220
1220
  );
1221
1221
  }
1222
- const { size } = statSync2(normalizedPath);
1222
+ const st = statSync2(normalizedPath);
1223
+ if (st.isDirectory()) {
1224
+ const entries = readdirSync2(normalizedPath, { withFileTypes: true }).slice(0, 10);
1225
+ const listing = entries.map((e) => `${e.isDirectory() ? "\u{1F4C1}" : "\u{1F4C4}"} ${e.name}`).join("\n");
1226
+ return `[Directory: ${filePath}]
1227
+ This path is a directory, not a file. Use list_dir to browse it.
1228
+ ` + (listing ? `
1229
+ First 10 entries:
1230
+ ${listing}` : "");
1231
+ }
1232
+ const { size } = st;
1223
1233
  if (size > MAX_FILE_BYTES) {
1224
1234
  const mb = (size / 1024 / 1024).toFixed(1);
1225
1235
  return `[File too large: ${filePath} (${mb} MB)]
@@ -4731,7 +4741,6 @@ function saveMemoryEntries(configDir, entries) {
4731
4741
  mkdirSync3(configDir, { recursive: true });
4732
4742
  const jsonl = entries.map((entry) => JSON.stringify(entry)).join("\n");
4733
4743
  atomicWriteFileSync(memoryStorePath(configDir), jsonl ? jsonl + "\n" : "");
4734
- syncLegacyMarkdown(configDir, entries);
4735
4744
  }
4736
4745
  function isMemoryExpired(entry, at = /* @__PURE__ */ new Date()) {
4737
4746
  return Boolean(entry.expiresAt && Date.parse(entry.expiresAt) <= at.getTime());
@@ -4802,25 +4811,6 @@ function findUnique(entries, idPrefix) {
4802
4811
  if (matches.length > 1) throw new Error(`memory id is ambiguous: ${idPrefix}`);
4803
4812
  return matches[0];
4804
4813
  }
4805
- function syncLegacyMarkdown(configDir, entries = loadMemoryEntries(configDir)) {
4806
- mkdirSync3(dirname4(memoryMarkdownPath(configDir)), { recursive: true });
4807
- const active = entries.filter((entry) => entry.approved && !isMemoryExpired(entry));
4808
- const markdown = active.map((entry) => {
4809
- const date = entry.createdAt.replace("T", " ").slice(0, 19);
4810
- const source = [
4811
- `id:${entry.id.slice(0, 8)}`,
4812
- `scope:${entry.scope}`,
4813
- entry.sourceSession ? `session:${entry.sourceSession.slice(0, 8)}` : "",
4814
- entry.sourceProject ? `project:${entry.sourceProject}` : "",
4815
- `sensitivity:${entry.sensitivity}`
4816
- ].filter(Boolean).join(" \xB7 ");
4817
- return `## ${date}
4818
- <!-- ${source} -->
4819
- ${entry.content}
4820
- `;
4821
- }).join("\n");
4822
- atomicWriteFileSync(memoryMarkdownPath(configDir), markdown);
4823
- }
4824
4814
  function formatMemoryForPrompt(configDir, cwd = process.cwd()) {
4825
4815
  const entries = listMemoryEntries(configDir, { cwd }).filter((entry) => entry.approved && !isMemoryExpired(entry));
4826
4816
  if (entries.length === 0) return null;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ProviderRegistry
4
- } from "./chunk-EEQHP4GK.js";
4
+ } from "./chunk-62R7CACG.js";
5
5
  import {
6
6
  getActivePluginAssets,
7
7
  getPendingHookTrust,
@@ -11,10 +11,10 @@ import {
11
11
  listHooks,
12
12
  listInstalledPlugins,
13
13
  resetStats
14
- } from "./chunk-TEXAIWUJ.js";
14
+ } from "./chunk-TQPU3J4P.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-FEVOW3NQ.js";
17
+ } from "./chunk-XTMHBOHG.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-B3POS7LB.js";
29
+ } from "./chunk-ZOLZ6JPG.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  PLUGINS_DIR_NAME
5
- } from "./chunk-B3POS7LB.js";
5
+ } from "./chunk-ZOLZ6JPG.js";
6
6
  import {
7
7
  atomicWriteFileSync
8
8
  } from "./chunk-IW3Q7AE5.js";
@@ -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.229";
9
+ var VERSION = "0.4.231";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-B3POS7LB.js";
11
+ } from "./chunk-ZOLZ6JPG.js";
12
12
  import {
13
13
  atomicWriteFileSync
14
14
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-B3POS7LB.js";
4
+ } from "./chunk-ZOLZ6JPG.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";