jinzd-ai-cli 0.4.228 → 0.4.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{batch-K6IRL6TU.js → batch-T74D2CCK.js} +3 -3
- package/dist/{chunk-DEHVRQWW.js → chunk-4KM53GLG.js} +1 -1
- package/dist/{chunk-EEQHP4GK.js → chunk-62R7CACG.js} +101 -302
- package/dist/{chunk-JZNKM3RV.js → chunk-6GSDDDEO.js} +1 -1
- package/dist/{chunk-LDWTVCE5.js → chunk-7I4GGVIS.js} +1 -1
- package/dist/{chunk-JGQ3TULW.js → chunk-DKPHVQUA.js} +1 -1
- package/dist/{chunk-MQVC7FJH.js → chunk-F2DUNYGY.js} +21 -36
- package/dist/{chunk-ACO2RJY3.js → chunk-ITEGK3IN.js} +1 -1
- package/dist/{chunk-32LTIQQN.js → chunk-LMKCS5XH.js} +4 -4
- package/dist/{chunk-NI34BUBR.js → chunk-S6SFZP3G.js} +1 -1
- package/dist/{chunk-4GF47FW3.js → chunk-SARJYCDV.js} +4 -4
- package/dist/{chunk-VSEXYCEE.js → chunk-SKUNYJDW.js} +2 -2
- package/dist/{chunk-JO2CAKHA.js → chunk-T3A74XGG.js} +1 -1
- package/dist/{chunk-QYQCCIBT.js → chunk-ZWU7FWHO.js} +22 -3
- package/dist/{ci-D35MUGEH.js → ci-ADQTAYOZ.js} +5 -5
- package/dist/{ci-format-EQ4HGHXR.js → ci-format-KZSTHIEW.js} +2 -2
- package/dist/{constants-F2LRIWV2.js → constants-JTHN5JSQ.js} +1 -1
- package/dist/{doctor-cli-R3AH5CLF.js → doctor-cli-XTIL3RTQ.js} +5 -5
- package/dist/electron-server.js +169 -373
- package/dist/{hub-AAYGBUDA.js → hub-BHHNMBCY.js} +2 -2
- package/dist/index.js +36 -49
- package/dist/{persist-XUXIPYUU.js → persist-I3JI27OK.js} +2 -2
- package/dist/{pr-HX6V63FO.js → pr-NUHU64NS.js} +5 -5
- package/dist/{run-tests-5QHWA4MF.js → run-tests-HZMY436A.js} +2 -2
- package/dist/{run-tests-7SGHDDHL.js → run-tests-M45ZJPR6.js} +1 -1
- package/dist/{server-E5XTQG7W.js → server-Q7MNZB4X.js} +4 -4
- package/dist/{server-O2YK3VWK.js → server-RCAFE2LO.js} +37 -44
- package/dist/{task-orchestrator-T2LUS5ZQ.js → task-orchestrator-IVSLED6U.js} +4 -4
- package/dist/{usage-AIHU5PIY.js → usage-KNMT35C2.js} +2 -2
- package/dist/web/client/app.js +13 -5
- package/dist/web/client/index.html +14 -6
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DKPHVQUA.js";
|
|
5
5
|
import "./chunk-5ULLIOVC.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-6GSDDDEO.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.
|
|
203
|
+
process.stdout.write(`
|
|
204
204
|
[Summary] ${lines.length} results: ${ok} succeeded, ${err} failed/errored.
|
|
205
205
|
`);
|
|
206
206
|
}
|
|
@@ -1522,84 +1522,44 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
};
|
|
1524
1524
|
|
|
1525
|
-
// src/providers/
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
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
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
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
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
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
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
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
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
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 {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
runHook,
|
|
15
15
|
runLifecycleHooks,
|
|
16
16
|
runTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ITEGK3IN.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-
|
|
36
|
+
} from "./chunk-S6SFZP3G.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-
|
|
46
|
+
} from "./chunk-6GSDDDEO.js";
|
|
47
47
|
import {
|
|
48
48
|
loadChatIndex,
|
|
49
49
|
searchChatMemory
|
|
@@ -558,14 +558,19 @@ Important rules:
|
|
|
558
558
|
);
|
|
559
559
|
}
|
|
560
560
|
if (status !== 0 || timedOut) {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
561
|
+
const poolStdout = (stdout ?? "").trim();
|
|
562
|
+
const poolStderr = (stderr ?? "").trim();
|
|
563
|
+
const combined = [poolStdout, poolStderr].filter(Boolean).join("\n");
|
|
564
|
+
const hint = buildErrorHint(command, combined);
|
|
565
|
+
throw new ToolError(
|
|
566
|
+
"bash",
|
|
567
|
+
`Exit code ${status}:
|
|
568
|
+
${combined || `exit ${status}`}
|
|
569
|
+
|
|
570
|
+
` + (hint ? `${hint}
|
|
571
|
+
|
|
572
|
+
` : "") + `[Command failed. Report this error to the user. Do not retry with variant commands.]`
|
|
573
|
+
);
|
|
569
574
|
}
|
|
570
575
|
pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
|
|
571
576
|
updateCwdFromCommand(command, effectiveCwd);
|
|
@@ -2264,7 +2269,7 @@ var ToolExecutor = class {
|
|
|
2264
2269
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "ok" }, { configDir: this.hookConfigDir });
|
|
2265
2270
|
return { callId: call.id, content, isError: false };
|
|
2266
2271
|
} catch (err) {
|
|
2267
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
2272
|
+
const message = err instanceof Error ? err.message : err && typeof err === "object" && "message" in err ? String(err.message) : String(err);
|
|
2268
2273
|
this.printToolResult(call.name, message, true, false);
|
|
2269
2274
|
runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "error" });
|
|
2270
2275
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "error", error: message }, { configDir: this.hookConfigDir });
|
|
@@ -2309,7 +2314,7 @@ var ToolExecutor = class {
|
|
|
2309
2314
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "ok" }, { configDir: this.hookConfigDir });
|
|
2310
2315
|
return { callId: call.id, content, isError: false };
|
|
2311
2316
|
} catch (err) {
|
|
2312
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
2317
|
+
const message = err instanceof Error ? err.message : err && typeof err === "object" && "message" in err ? String(err.message) : String(err);
|
|
2313
2318
|
this.printToolResult(call.name, message, true, false);
|
|
2314
2319
|
runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "error" });
|
|
2315
2320
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "error", error: message }, { configDir: this.hookConfigDir });
|
|
@@ -2330,7 +2335,7 @@ var ToolExecutor = class {
|
|
|
2330
2335
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "ok" }, { configDir: this.hookConfigDir });
|
|
2331
2336
|
return { callId: call.id, content, isError: false };
|
|
2332
2337
|
} catch (err) {
|
|
2333
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
2338
|
+
const message = err instanceof Error ? err.message : err && typeof err === "object" && "message" in err ? String(err.message) : String(err);
|
|
2334
2339
|
this.printToolResult(call.name, message, true, false);
|
|
2335
2340
|
runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "error" });
|
|
2336
2341
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "error", error: message }, { configDir: this.hookConfigDir });
|
|
@@ -2370,7 +2375,7 @@ var ToolExecutor = class {
|
|
|
2370
2375
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "ok" }, { configDir: this.hookConfigDir });
|
|
2371
2376
|
return { callId: call.id, content, isError: false };
|
|
2372
2377
|
} catch (err) {
|
|
2373
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
2378
|
+
const message = err instanceof Error ? err.message : err && typeof err === "object" && "message" in err ? String(err.message) : String(err);
|
|
2374
2379
|
this.printToolResult(call.name, message, true, false);
|
|
2375
2380
|
runHook(this.hookConfig?.postToolExecution, { tool: call.name, status: "error" });
|
|
2376
2381
|
runLifecycleHooks(this.hookConfig, "PostToolUse", { tool: call.name, status: "error", error: message }, { configDir: this.hookConfigDir });
|
|
@@ -2456,7 +2461,7 @@ var ToolExecutor = class {
|
|
|
2456
2461
|
this.printToolResult(call.name, rawContent, false, wasTruncated);
|
|
2457
2462
|
results[i] = { callId: call.id, content, isError: false };
|
|
2458
2463
|
} catch (err) {
|
|
2459
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
2464
|
+
const message = err instanceof Error ? err.message : err && typeof err === "object" && "message" in err ? String(err.message) : String(err);
|
|
2460
2465
|
this.printToolResult(call.name, message, true, false);
|
|
2461
2466
|
results[i] = { callId: call.id, content: message, isError: true };
|
|
2462
2467
|
}
|
|
@@ -4726,7 +4731,6 @@ function saveMemoryEntries(configDir, entries) {
|
|
|
4726
4731
|
mkdirSync3(configDir, { recursive: true });
|
|
4727
4732
|
const jsonl = entries.map((entry) => JSON.stringify(entry)).join("\n");
|
|
4728
4733
|
atomicWriteFileSync(memoryStorePath(configDir), jsonl ? jsonl + "\n" : "");
|
|
4729
|
-
syncLegacyMarkdown(configDir, entries);
|
|
4730
4734
|
}
|
|
4731
4735
|
function isMemoryExpired(entry, at = /* @__PURE__ */ new Date()) {
|
|
4732
4736
|
return Boolean(entry.expiresAt && Date.parse(entry.expiresAt) <= at.getTime());
|
|
@@ -4797,25 +4801,6 @@ function findUnique(entries, idPrefix) {
|
|
|
4797
4801
|
if (matches.length > 1) throw new Error(`memory id is ambiguous: ${idPrefix}`);
|
|
4798
4802
|
return matches[0];
|
|
4799
4803
|
}
|
|
4800
|
-
function syncLegacyMarkdown(configDir, entries = loadMemoryEntries(configDir)) {
|
|
4801
|
-
mkdirSync3(dirname4(memoryMarkdownPath(configDir)), { recursive: true });
|
|
4802
|
-
const active = entries.filter((entry) => entry.approved && !isMemoryExpired(entry));
|
|
4803
|
-
const markdown = active.map((entry) => {
|
|
4804
|
-
const date = entry.createdAt.replace("T", " ").slice(0, 19);
|
|
4805
|
-
const source = [
|
|
4806
|
-
`id:${entry.id.slice(0, 8)}`,
|
|
4807
|
-
`scope:${entry.scope}`,
|
|
4808
|
-
entry.sourceSession ? `session:${entry.sourceSession.slice(0, 8)}` : "",
|
|
4809
|
-
entry.sourceProject ? `project:${entry.sourceProject}` : "",
|
|
4810
|
-
`sensitivity:${entry.sensitivity}`
|
|
4811
|
-
].filter(Boolean).join(" \xB7 ");
|
|
4812
|
-
return `## ${date}
|
|
4813
|
-
<!-- ${source} -->
|
|
4814
|
-
${entry.content}
|
|
4815
|
-
`;
|
|
4816
|
-
}).join("\n");
|
|
4817
|
-
atomicWriteFileSync(memoryMarkdownPath(configDir), markdown);
|
|
4818
|
-
}
|
|
4819
4804
|
function formatMemoryForPrompt(configDir, cwd = process.cwd()) {
|
|
4820
4805
|
const entries = listMemoryEntries(configDir, { cwd }).filter((entry) => entry.approved && !isMemoryExpired(entry));
|
|
4821
4806
|
if (entries.length === 0) return null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-T3A74XGG.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-
|
|
13
|
+
} from "./chunk-62R7CACG.js";
|
|
14
14
|
import {
|
|
15
15
|
ConfigManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DKPHVQUA.js";
|
|
17
17
|
import {
|
|
18
18
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-6GSDDDEO.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/ci.ts
|
|
22
22
|
import { execFileSync } from "child_process";
|