jinzd-ai-cli 0.4.146 → 0.4.149
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-GMCR2YE6.js → batch-FEENWXO3.js} +2 -2
- package/dist/{chunk-QJWZ5G64.js → chunk-27XZX7Q5.js} +1 -1
- package/dist/{chunk-AWRXHBW2.js → chunk-2FYSJHDI.js} +1 -1
- package/dist/{chunk-EUE7FFIO.js → chunk-2GKXIACT.js} +1 -1
- package/dist/{chunk-BOQ4YWRM.js → chunk-3JHGCSRE.js} +3 -3
- package/dist/{chunk-GB2KTJC2.js → chunk-6FEGCTFY.js} +1 -1
- package/dist/{chunk-JB7LEZQO.js → chunk-CL3PKT7X.js} +1 -1
- package/dist/{chunk-AQQSYFTU.js → chunk-LXQMV7WL.js} +22 -5
- package/dist/{chunk-XZBA3NHG.js → chunk-ONOVJIL2.js} +55 -11
- package/dist/{chunk-RJYVWTHV.js → chunk-X5ZOA2SJ.js} +2 -2
- package/dist/{ci-CPXECTTZ.js → ci-FT2ULVM5.js} +3 -3
- package/dist/{constants-3VNPPLEQ.js → constants-MUKC5IQB.js} +1 -1
- package/dist/{doctor-cli-HVLJGWSO.js → doctor-cli-S5Y3YC7D.js} +5 -5
- package/dist/electron-server.js +78 -17
- package/dist/{hub-PSQ3P5DO.js → hub-DJK6P5RR.js} +1 -1
- package/dist/index.js +16 -16
- package/dist/{run-tests-D4ZQ7NLP.js → run-tests-Q4ZIVEOZ.js} +2 -2
- package/dist/{run-tests-OP6HUEBM.js → run-tests-UGR4ZC72.js} +1 -1
- package/dist/{server-IKU7UN7J.js → server-DQ2DR4WO.js} +4 -4
- package/dist/{server-KJJEI67Z.js → server-QBD57XPD.js} +8 -8
- package/dist/{task-orchestrator-JWQJJY3H.js → task-orchestrator-65WO3IZA.js} +4 -4
- 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-LXQMV7WL.js";
|
|
5
5
|
import "./chunk-2ZD3YTVM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-2GKXIACT.js";
|
|
7
7
|
import "./chunk-PDX44BCA.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/batch.ts
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-UQQJWHRV.js";
|
|
6
6
|
import {
|
|
7
7
|
runTestsTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6FEGCTFY.js";
|
|
9
9
|
import {
|
|
10
10
|
runTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CL3PKT7X.js";
|
|
12
12
|
import {
|
|
13
13
|
getDangerLevel,
|
|
14
14
|
isFileWriteTool
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
SUBAGENT_ALLOWED_TOOLS,
|
|
26
26
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
27
27
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2GKXIACT.js";
|
|
29
29
|
import {
|
|
30
30
|
fileCheckpoints
|
|
31
31
|
} from "./chunk-4BKXL7SM.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
CONFIG_FILE_NAME,
|
|
9
9
|
HISTORY_DIR_NAME,
|
|
10
10
|
PLUGINS_DIR_NAME
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2GKXIACT.js";
|
|
12
12
|
|
|
13
13
|
// src/config/config-manager.ts
|
|
14
14
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
@@ -302,11 +302,19 @@ ${err}`
|
|
|
302
302
|
migrateLegacyModels() {
|
|
303
303
|
const LEGACY_DEEPSEEK = /* @__PURE__ */ new Set(["deepseek-chat", "deepseek-reasoner"]);
|
|
304
304
|
const DEEPSEEK_TARGET = "deepseek-v4-flash";
|
|
305
|
+
const LEGACY_KIMI = /* @__PURE__ */ new Set(["kimi-k2-0711-preview", "kimi-k2-turbo-preview"]);
|
|
306
|
+
const KIMI_TARGET = "kimi-k2.6";
|
|
305
307
|
let changed = false;
|
|
306
308
|
const dm = this.config.defaultModels;
|
|
307
|
-
if (dm
|
|
308
|
-
dm.deepseek
|
|
309
|
-
|
|
309
|
+
if (dm) {
|
|
310
|
+
if (LEGACY_DEEPSEEK.has(dm.deepseek)) {
|
|
311
|
+
dm.deepseek = DEEPSEEK_TARGET;
|
|
312
|
+
changed = true;
|
|
313
|
+
}
|
|
314
|
+
if (LEGACY_KIMI.has(dm.kimi)) {
|
|
315
|
+
dm.kimi = KIMI_TARGET;
|
|
316
|
+
changed = true;
|
|
317
|
+
}
|
|
310
318
|
}
|
|
311
319
|
const mp = this.config.modelParams;
|
|
312
320
|
if (mp) {
|
|
@@ -319,10 +327,19 @@ ${err}`
|
|
|
319
327
|
changed = true;
|
|
320
328
|
}
|
|
321
329
|
}
|
|
330
|
+
for (const legacy of LEGACY_KIMI) {
|
|
331
|
+
if (legacy in mp) {
|
|
332
|
+
if (!(KIMI_TARGET in mp)) {
|
|
333
|
+
mp[KIMI_TARGET] = mp[legacy];
|
|
334
|
+
}
|
|
335
|
+
delete mp[legacy];
|
|
336
|
+
changed = true;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
322
339
|
}
|
|
323
340
|
if (changed) {
|
|
324
341
|
process.stderr.write(
|
|
325
|
-
`[ai-cli] Migrated retired
|
|
342
|
+
`[ai-cli] Migrated retired model ids in config.json (deepseek \u2192 ${DEEPSEEK_TARGET}, kimi \u2192 ${KIMI_TARGET})
|
|
326
343
|
`
|
|
327
344
|
);
|
|
328
345
|
}
|
|
@@ -1920,29 +1920,73 @@ Rules you MUST follow:
|
|
|
1920
1920
|
- When generating multiple files: call write_file for file 1 \u2192 call write_file for file 2 \u2192 ... \u2192 THEN summarize.
|
|
1921
1921
|
- If you catch yourself writing markdown/code that should be a file, STOP and use write_file instead.
|
|
1922
1922
|
- The system will detect and reject phantom claims. Each failed detection wastes a round. Be honest.`;
|
|
1923
|
-
var KimiProvider = class extends OpenAICompatibleProvider {
|
|
1923
|
+
var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
|
|
1924
1924
|
defaultBaseUrl = "https://api.moonshot.ai/v1";
|
|
1925
1925
|
// 禁用流式工具调用:Kimi 的 XML 伪调用检测(方案 A)需要完整响应
|
|
1926
1926
|
enableStreamingToolCalls = false;
|
|
1927
|
+
/**
|
|
1928
|
+
* Kimi K2.x 系列(非 moonshot-v1)只允许 temperature=1。
|
|
1929
|
+
* 其他值会收到 400 "invalid temperature: only 1 is allowed for this model"。
|
|
1930
|
+
*/
|
|
1931
|
+
static TEMP_1_MODELS = /* @__PURE__ */ new Set([
|
|
1932
|
+
"kimi-k2.6",
|
|
1933
|
+
"kimi-k2.5",
|
|
1934
|
+
"kimi-k2-thinking",
|
|
1935
|
+
"kimi-k2-thinking-turbo",
|
|
1936
|
+
"kimi-k2-0905-preview"
|
|
1937
|
+
]);
|
|
1938
|
+
/** 对需要固定 temperature=1 的模型自动修正请求。 */
|
|
1939
|
+
fixTemp(req) {
|
|
1940
|
+
if (_KimiProvider.TEMP_1_MODELS.has(req.model) && req.temperature !== 1) {
|
|
1941
|
+
return { ...req, temperature: 1 };
|
|
1942
|
+
}
|
|
1943
|
+
return req;
|
|
1944
|
+
}
|
|
1945
|
+
async chat(request) {
|
|
1946
|
+
return super.chat(this.fixTemp(request));
|
|
1947
|
+
}
|
|
1948
|
+
async *chatStream(request) {
|
|
1949
|
+
yield* super.chatStream(this.fixTemp(request));
|
|
1950
|
+
}
|
|
1927
1951
|
info = {
|
|
1928
1952
|
id: "kimi",
|
|
1929
1953
|
displayName: "Kimi (Moonshot AI)",
|
|
1930
|
-
defaultModel: "kimi-k2
|
|
1954
|
+
defaultModel: "kimi-k2.6",
|
|
1931
1955
|
apiKeyEnvVar: "AICLI_API_KEY_KIMI",
|
|
1932
1956
|
requiresApiKey: true,
|
|
1933
1957
|
baseUrl: this.defaultBaseUrl,
|
|
1934
1958
|
models: [
|
|
1935
|
-
// Kimi K2
|
|
1959
|
+
// Kimi K2.6 / K2.5 系列(最新一代,推荐)
|
|
1936
1960
|
{
|
|
1937
|
-
id: "kimi-k2
|
|
1938
|
-
displayName: "Kimi K2
|
|
1939
|
-
contextWindow:
|
|
1961
|
+
id: "kimi-k2.6",
|
|
1962
|
+
displayName: "Kimi K2.6",
|
|
1963
|
+
contextWindow: 262144,
|
|
1940
1964
|
supportsStreaming: true
|
|
1941
1965
|
},
|
|
1942
1966
|
{
|
|
1943
|
-
id: "kimi-k2
|
|
1944
|
-
displayName: "Kimi K2
|
|
1945
|
-
contextWindow:
|
|
1967
|
+
id: "kimi-k2.5",
|
|
1968
|
+
displayName: "Kimi K2.5",
|
|
1969
|
+
contextWindow: 262144,
|
|
1970
|
+
supportsStreaming: true
|
|
1971
|
+
},
|
|
1972
|
+
// Kimi K2 Thinking 系列(支持多步推理 + 工具调用)
|
|
1973
|
+
{
|
|
1974
|
+
id: "kimi-k2-thinking",
|
|
1975
|
+
displayName: "Kimi K2 Thinking",
|
|
1976
|
+
contextWindow: 262144,
|
|
1977
|
+
supportsStreaming: true
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
id: "kimi-k2-thinking-turbo",
|
|
1981
|
+
displayName: "Kimi K2 Thinking Turbo",
|
|
1982
|
+
contextWindow: 262144,
|
|
1983
|
+
supportsStreaming: true
|
|
1984
|
+
},
|
|
1985
|
+
// Kimi K2 Preview 系列
|
|
1986
|
+
{
|
|
1987
|
+
id: "kimi-k2-0905-preview",
|
|
1988
|
+
displayName: "Kimi K2 0905 Preview",
|
|
1989
|
+
contextWindow: 262144,
|
|
1946
1990
|
supportsStreaming: true
|
|
1947
1991
|
},
|
|
1948
1992
|
// moonshot-v1 系列(老一代,稳定)
|
|
@@ -1994,10 +2038,10 @@ var KimiProvider = class extends OpenAICompatibleProvider {
|
|
|
1994
2038
|
* 自动检测并解析,转换为真实 ToolCall 对象送入执行器。
|
|
1995
2039
|
*/
|
|
1996
2040
|
async chatWithTools(request, tools) {
|
|
1997
|
-
const enhancedRequest = {
|
|
2041
|
+
const enhancedRequest = this.fixTemp({
|
|
1998
2042
|
...request,
|
|
1999
2043
|
systemPrompt: (request.systemPrompt ?? "") + KIMI_XML_REMINDER
|
|
2000
|
-
};
|
|
2044
|
+
});
|
|
2001
2045
|
const result = await super.chatWithTools(enhancedRequest, tools);
|
|
2002
2046
|
if ("content" in result && result.content) {
|
|
2003
2047
|
if (detectsHallucinatedFileOp(result.content)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3JHGCSRE.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-
|
|
14
|
+
} from "./chunk-2GKXIACT.js";
|
|
15
15
|
import {
|
|
16
16
|
redactJson
|
|
17
17
|
} from "./chunk-7ZJN4KLV.js";
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-HLWUDRBO.js";
|
|
7
7
|
import {
|
|
8
8
|
ProviderRegistry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ONOVJIL2.js";
|
|
10
10
|
import {
|
|
11
11
|
ConfigManager
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LXQMV7WL.js";
|
|
13
13
|
import "./chunk-OWPFDHKC.js";
|
|
14
14
|
import "./chunk-2ZD3YTVM.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2GKXIACT.js";
|
|
18
18
|
import "./chunk-PDX44BCA.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/ci.ts
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getConfigDirUsage,
|
|
4
4
|
listRecentCrashes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2FYSJHDI.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ONOVJIL2.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LXQMV7WL.js";
|
|
12
12
|
import {
|
|
13
13
|
getStatsSnapshot,
|
|
14
14
|
getTopFailingTools,
|
|
15
15
|
getTopUsedTools,
|
|
16
16
|
resetStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CL3PKT7X.js";
|
|
18
18
|
import "./chunk-OWPFDHKC.js";
|
|
19
19
|
import "./chunk-2ZD3YTVM.js";
|
|
20
20
|
import {
|
|
21
21
|
DEV_STATE_FILE_NAME,
|
|
22
22
|
MEMORY_FILE_NAME,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2GKXIACT.js";
|
|
25
25
|
import "./chunk-PDX44BCA.js";
|
|
26
26
|
|
|
27
27
|
// src/diagnostics/doctor-cli.ts
|
package/dist/electron-server.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
VERSION,
|
|
37
37
|
buildUserIdentityPrompt,
|
|
38
38
|
runTestsTool
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-27XZX7Q5.js";
|
|
40
40
|
import {
|
|
41
41
|
hasSemanticIndex,
|
|
42
42
|
semanticSearch
|
|
@@ -455,11 +455,19 @@ ${err}`
|
|
|
455
455
|
migrateLegacyModels() {
|
|
456
456
|
const LEGACY_DEEPSEEK = /* @__PURE__ */ new Set(["deepseek-chat", "deepseek-reasoner"]);
|
|
457
457
|
const DEEPSEEK_TARGET = "deepseek-v4-flash";
|
|
458
|
+
const LEGACY_KIMI = /* @__PURE__ */ new Set(["kimi-k2-0711-preview", "kimi-k2-turbo-preview"]);
|
|
459
|
+
const KIMI_TARGET = "kimi-k2.6";
|
|
458
460
|
let changed = false;
|
|
459
461
|
const dm = this.config.defaultModels;
|
|
460
|
-
if (dm
|
|
461
|
-
dm.deepseek
|
|
462
|
-
|
|
462
|
+
if (dm) {
|
|
463
|
+
if (LEGACY_DEEPSEEK.has(dm.deepseek)) {
|
|
464
|
+
dm.deepseek = DEEPSEEK_TARGET;
|
|
465
|
+
changed = true;
|
|
466
|
+
}
|
|
467
|
+
if (LEGACY_KIMI.has(dm.kimi)) {
|
|
468
|
+
dm.kimi = KIMI_TARGET;
|
|
469
|
+
changed = true;
|
|
470
|
+
}
|
|
463
471
|
}
|
|
464
472
|
const mp = this.config.modelParams;
|
|
465
473
|
if (mp) {
|
|
@@ -472,10 +480,19 @@ ${err}`
|
|
|
472
480
|
changed = true;
|
|
473
481
|
}
|
|
474
482
|
}
|
|
483
|
+
for (const legacy of LEGACY_KIMI) {
|
|
484
|
+
if (legacy in mp) {
|
|
485
|
+
if (!(KIMI_TARGET in mp)) {
|
|
486
|
+
mp[KIMI_TARGET] = mp[legacy];
|
|
487
|
+
}
|
|
488
|
+
delete mp[legacy];
|
|
489
|
+
changed = true;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
475
492
|
}
|
|
476
493
|
if (changed) {
|
|
477
494
|
process.stderr.write(
|
|
478
|
-
`[ai-cli] Migrated retired
|
|
495
|
+
`[ai-cli] Migrated retired model ids in config.json (deepseek \u2192 ${DEEPSEEK_TARGET}, kimi \u2192 ${KIMI_TARGET})
|
|
479
496
|
`
|
|
480
497
|
);
|
|
481
498
|
}
|
|
@@ -2431,29 +2448,73 @@ Rules you MUST follow:
|
|
|
2431
2448
|
- When generating multiple files: call write_file for file 1 \u2192 call write_file for file 2 \u2192 ... \u2192 THEN summarize.
|
|
2432
2449
|
- If you catch yourself writing markdown/code that should be a file, STOP and use write_file instead.
|
|
2433
2450
|
- The system will detect and reject phantom claims. Each failed detection wastes a round. Be honest.`;
|
|
2434
|
-
var KimiProvider = class extends OpenAICompatibleProvider {
|
|
2451
|
+
var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
|
|
2435
2452
|
defaultBaseUrl = "https://api.moonshot.ai/v1";
|
|
2436
2453
|
// 禁用流式工具调用:Kimi 的 XML 伪调用检测(方案 A)需要完整响应
|
|
2437
2454
|
enableStreamingToolCalls = false;
|
|
2455
|
+
/**
|
|
2456
|
+
* Kimi K2.x 系列(非 moonshot-v1)只允许 temperature=1。
|
|
2457
|
+
* 其他值会收到 400 "invalid temperature: only 1 is allowed for this model"。
|
|
2458
|
+
*/
|
|
2459
|
+
static TEMP_1_MODELS = /* @__PURE__ */ new Set([
|
|
2460
|
+
"kimi-k2.6",
|
|
2461
|
+
"kimi-k2.5",
|
|
2462
|
+
"kimi-k2-thinking",
|
|
2463
|
+
"kimi-k2-thinking-turbo",
|
|
2464
|
+
"kimi-k2-0905-preview"
|
|
2465
|
+
]);
|
|
2466
|
+
/** 对需要固定 temperature=1 的模型自动修正请求。 */
|
|
2467
|
+
fixTemp(req) {
|
|
2468
|
+
if (_KimiProvider.TEMP_1_MODELS.has(req.model) && req.temperature !== 1) {
|
|
2469
|
+
return { ...req, temperature: 1 };
|
|
2470
|
+
}
|
|
2471
|
+
return req;
|
|
2472
|
+
}
|
|
2473
|
+
async chat(request) {
|
|
2474
|
+
return super.chat(this.fixTemp(request));
|
|
2475
|
+
}
|
|
2476
|
+
async *chatStream(request) {
|
|
2477
|
+
yield* super.chatStream(this.fixTemp(request));
|
|
2478
|
+
}
|
|
2438
2479
|
info = {
|
|
2439
2480
|
id: "kimi",
|
|
2440
2481
|
displayName: "Kimi (Moonshot AI)",
|
|
2441
|
-
defaultModel: "kimi-k2
|
|
2482
|
+
defaultModel: "kimi-k2.6",
|
|
2442
2483
|
apiKeyEnvVar: "AICLI_API_KEY_KIMI",
|
|
2443
2484
|
requiresApiKey: true,
|
|
2444
2485
|
baseUrl: this.defaultBaseUrl,
|
|
2445
2486
|
models: [
|
|
2446
|
-
// Kimi K2
|
|
2487
|
+
// Kimi K2.6 / K2.5 系列(最新一代,推荐)
|
|
2447
2488
|
{
|
|
2448
|
-
id: "kimi-k2
|
|
2449
|
-
displayName: "Kimi K2
|
|
2450
|
-
contextWindow:
|
|
2489
|
+
id: "kimi-k2.6",
|
|
2490
|
+
displayName: "Kimi K2.6",
|
|
2491
|
+
contextWindow: 262144,
|
|
2451
2492
|
supportsStreaming: true
|
|
2452
2493
|
},
|
|
2453
2494
|
{
|
|
2454
|
-
id: "kimi-k2
|
|
2455
|
-
displayName: "Kimi K2
|
|
2456
|
-
contextWindow:
|
|
2495
|
+
id: "kimi-k2.5",
|
|
2496
|
+
displayName: "Kimi K2.5",
|
|
2497
|
+
contextWindow: 262144,
|
|
2498
|
+
supportsStreaming: true
|
|
2499
|
+
},
|
|
2500
|
+
// Kimi K2 Thinking 系列(支持多步推理 + 工具调用)
|
|
2501
|
+
{
|
|
2502
|
+
id: "kimi-k2-thinking",
|
|
2503
|
+
displayName: "Kimi K2 Thinking",
|
|
2504
|
+
contextWindow: 262144,
|
|
2505
|
+
supportsStreaming: true
|
|
2506
|
+
},
|
|
2507
|
+
{
|
|
2508
|
+
id: "kimi-k2-thinking-turbo",
|
|
2509
|
+
displayName: "Kimi K2 Thinking Turbo",
|
|
2510
|
+
contextWindow: 262144,
|
|
2511
|
+
supportsStreaming: true
|
|
2512
|
+
},
|
|
2513
|
+
// Kimi K2 Preview 系列
|
|
2514
|
+
{
|
|
2515
|
+
id: "kimi-k2-0905-preview",
|
|
2516
|
+
displayName: "Kimi K2 0905 Preview",
|
|
2517
|
+
contextWindow: 262144,
|
|
2457
2518
|
supportsStreaming: true
|
|
2458
2519
|
},
|
|
2459
2520
|
// moonshot-v1 系列(老一代,稳定)
|
|
@@ -2505,10 +2566,10 @@ var KimiProvider = class extends OpenAICompatibleProvider {
|
|
|
2505
2566
|
* 自动检测并解析,转换为真实 ToolCall 对象送入执行器。
|
|
2506
2567
|
*/
|
|
2507
2568
|
async chatWithTools(request, tools) {
|
|
2508
|
-
const enhancedRequest = {
|
|
2569
|
+
const enhancedRequest = this.fixTemp({
|
|
2509
2570
|
...request,
|
|
2510
2571
|
systemPrompt: (request.systemPrompt ?? "") + KIMI_XML_REMINDER
|
|
2511
|
-
};
|
|
2572
|
+
});
|
|
2512
2573
|
const result = await super.chatWithTools(enhancedRequest, tools);
|
|
2513
2574
|
if ("content" in result && result.content) {
|
|
2514
2575
|
if (detectsHallucinatedFileOp(result.content)) {
|
|
@@ -12573,7 +12634,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
12573
12634
|
case "test": {
|
|
12574
12635
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
12575
12636
|
try {
|
|
12576
|
-
const { executeTests } = await import("./run-tests-
|
|
12637
|
+
const { executeTests } = await import("./run-tests-UGR4ZC72.js");
|
|
12577
12638
|
const argStr = args.join(" ").trim();
|
|
12578
12639
|
let testArgs = {};
|
|
12579
12640
|
if (argStr) {
|
|
@@ -386,7 +386,7 @@ ${content}`);
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
389
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
389
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-65WO3IZA.js");
|
|
390
390
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
391
391
|
let interrupted = false;
|
|
392
392
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
saveDevState,
|
|
21
21
|
sessionHasMeaningfulContent,
|
|
22
22
|
setupProxy
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-X5ZOA2SJ.js";
|
|
24
24
|
import {
|
|
25
25
|
getConfigDirUsage,
|
|
26
26
|
listRecentCrashes,
|
|
27
27
|
writeCrashLog
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2FYSJHDI.js";
|
|
29
29
|
import {
|
|
30
30
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
31
31
|
HALLUCINATION_CORRECTION_MESSAGE,
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
looksLikeDocumentBody,
|
|
44
44
|
stripPseudoToolCalls,
|
|
45
45
|
stripToolCallReminder
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-ONOVJIL2.js";
|
|
47
47
|
import {
|
|
48
48
|
ConfigManager
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-LXQMV7WL.js";
|
|
50
50
|
import {
|
|
51
51
|
ToolExecutor,
|
|
52
52
|
ToolRegistry,
|
|
@@ -65,16 +65,16 @@ import {
|
|
|
65
65
|
spawnAgentContext,
|
|
66
66
|
theme,
|
|
67
67
|
undoStack
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-3JHGCSRE.js";
|
|
69
69
|
import "./chunk-UQQJWHRV.js";
|
|
70
70
|
import "./chunk-2DXY7UGF.js";
|
|
71
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-6FEGCTFY.js";
|
|
72
72
|
import {
|
|
73
73
|
getStatsSnapshot,
|
|
74
74
|
getTopFailingTools,
|
|
75
75
|
getTopUsedTools,
|
|
76
76
|
installFlushOnExit
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-CL3PKT7X.js";
|
|
78
78
|
import "./chunk-OWPFDHKC.js";
|
|
79
79
|
import {
|
|
80
80
|
AuthError,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
SKILLS_DIR_NAME,
|
|
103
103
|
VERSION,
|
|
104
104
|
buildUserIdentityPrompt
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-2GKXIACT.js";
|
|
106
106
|
import {
|
|
107
107
|
formatGitContextForPrompt,
|
|
108
108
|
getGitContext,
|
|
@@ -1769,7 +1769,7 @@ No tools match "${filter}".
|
|
|
1769
1769
|
const { join: join6 } = await import("path");
|
|
1770
1770
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1771
1771
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
|
|
1772
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1772
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-MUKC5IQB.js");
|
|
1773
1773
|
const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
|
|
1774
1774
|
const cwd = process.cwd();
|
|
1775
1775
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2830,7 +2830,7 @@ ${hint}` : "")
|
|
|
2830
2830
|
usage: "/test [command|filter]",
|
|
2831
2831
|
async execute(args, ctx) {
|
|
2832
2832
|
try {
|
|
2833
|
-
const { executeTests } = await import("./run-tests-
|
|
2833
|
+
const { executeTests } = await import("./run-tests-Q4ZIVEOZ.js");
|
|
2834
2834
|
const argStr = args.join(" ").trim();
|
|
2835
2835
|
let testArgs = {};
|
|
2836
2836
|
if (argStr) {
|
|
@@ -7530,7 +7530,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
7530
7530
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
7531
7531
|
process.exit(1);
|
|
7532
7532
|
}
|
|
7533
|
-
const { startWebServer } = await import("./server-
|
|
7533
|
+
const { startWebServer } = await import("./server-QBD57XPD.js");
|
|
7534
7534
|
await startWebServer({ port, host: options.host });
|
|
7535
7535
|
});
|
|
7536
7536
|
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) => {
|
|
@@ -7697,12 +7697,12 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
7697
7697
|
console.log(footer + "\n");
|
|
7698
7698
|
});
|
|
7699
7699
|
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) => {
|
|
7700
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
7700
|
+
const { runDoctorCli } = await import("./doctor-cli-S5Y3YC7D.js");
|
|
7701
7701
|
await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
|
|
7702
7702
|
});
|
|
7703
7703
|
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) => {
|
|
7704
7704
|
try {
|
|
7705
|
-
const batch = await import("./batch-
|
|
7705
|
+
const batch = await import("./batch-FEENWXO3.js");
|
|
7706
7706
|
switch (action) {
|
|
7707
7707
|
case "submit":
|
|
7708
7708
|
if (!arg) {
|
|
@@ -7745,7 +7745,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
7745
7745
|
}
|
|
7746
7746
|
});
|
|
7747
7747
|
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) => {
|
|
7748
|
-
const { startMcpServer } = await import("./server-
|
|
7748
|
+
const { startMcpServer } = await import("./server-DQ2DR4WO.js");
|
|
7749
7749
|
await startMcpServer({
|
|
7750
7750
|
allowDestructive: !!options.allowDestructive,
|
|
7751
7751
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -7754,7 +7754,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
|
|
|
7754
7754
|
});
|
|
7755
7755
|
});
|
|
7756
7756
|
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; diff fetched via `gh pr diff <num>`", (v) => parseInt(v, 10)).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)").action(async (options) => {
|
|
7757
|
-
const { runCi } = await import("./ci-
|
|
7757
|
+
const { runCi } = await import("./ci-FT2ULVM5.js");
|
|
7758
7758
|
const result = await runCi({
|
|
7759
7759
|
pr: options.pr,
|
|
7760
7760
|
base: options.base,
|
|
@@ -7895,7 +7895,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
7895
7895
|
}),
|
|
7896
7896
|
config.get("customProviders")
|
|
7897
7897
|
);
|
|
7898
|
-
const { startHub } = await import("./hub-
|
|
7898
|
+
const { startHub } = await import("./hub-DJK6P5RR.js");
|
|
7899
7899
|
await startHub(
|
|
7900
7900
|
{
|
|
7901
7901
|
topic: topic ?? "",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3JHGCSRE.js";
|
|
5
5
|
import "./chunk-UQQJWHRV.js";
|
|
6
6
|
import "./chunk-2DXY7UGF.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-6FEGCTFY.js";
|
|
8
8
|
import {
|
|
9
9
|
runTool
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CL3PKT7X.js";
|
|
11
11
|
import {
|
|
12
12
|
getDangerLevel,
|
|
13
13
|
schemaToJsonSchema
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-2ZD3YTVM.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2GKXIACT.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
20
|
import "./chunk-7ZJN4KLV.js";
|
|
21
21
|
import "./chunk-KHYD3WXE.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
loadDevState,
|
|
15
15
|
persistToolRound,
|
|
16
16
|
setupProxy
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-X5ZOA2SJ.js";
|
|
18
18
|
import {
|
|
19
19
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
20
20
|
HALLUCINATION_CORRECTION_MESSAGE,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
looksLikeDocumentBody,
|
|
29
29
|
stripPseudoToolCalls,
|
|
30
30
|
stripToolCallReminder
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ONOVJIL2.js";
|
|
32
32
|
import {
|
|
33
33
|
ConfigManager
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LXQMV7WL.js";
|
|
35
35
|
import {
|
|
36
36
|
ToolExecutor,
|
|
37
37
|
ToolRegistry,
|
|
@@ -49,13 +49,13 @@ import {
|
|
|
49
49
|
spawnAgentContext,
|
|
50
50
|
truncateOutput,
|
|
51
51
|
undoStack
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-3JHGCSRE.js";
|
|
53
53
|
import "./chunk-UQQJWHRV.js";
|
|
54
54
|
import "./chunk-2DXY7UGF.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-6FEGCTFY.js";
|
|
56
56
|
import {
|
|
57
57
|
runTool
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-CL3PKT7X.js";
|
|
59
59
|
import {
|
|
60
60
|
getDangerLevel
|
|
61
61
|
} from "./chunk-OWPFDHKC.js";
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
SKILLS_DIR_NAME,
|
|
79
79
|
VERSION,
|
|
80
80
|
buildUserIdentityPrompt
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-2GKXIACT.js";
|
|
82
82
|
import {
|
|
83
83
|
formatGitContextForPrompt,
|
|
84
84
|
getGitContext,
|
|
@@ -2462,7 +2462,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
|
|
|
2462
2462
|
case "test": {
|
|
2463
2463
|
this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
2464
2464
|
try {
|
|
2465
|
-
const { executeTests } = await import("./run-tests-
|
|
2465
|
+
const { executeTests } = await import("./run-tests-Q4ZIVEOZ.js");
|
|
2466
2466
|
const argStr = args.join(" ").trim();
|
|
2467
2467
|
let testArgs = {};
|
|
2468
2468
|
if (argStr) {
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3JHGCSRE.js";
|
|
7
7
|
import "./chunk-UQQJWHRV.js";
|
|
8
8
|
import "./chunk-2DXY7UGF.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-6FEGCTFY.js";
|
|
10
10
|
import {
|
|
11
11
|
runTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CL3PKT7X.js";
|
|
13
13
|
import {
|
|
14
14
|
getDangerLevel
|
|
15
15
|
} from "./chunk-OWPFDHKC.js";
|
|
16
16
|
import "./chunk-2ZD3YTVM.js";
|
|
17
17
|
import {
|
|
18
18
|
SUBAGENT_ALLOWED_TOOLS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2GKXIACT.js";
|
|
20
20
|
import "./chunk-4BKXL7SM.js";
|
|
21
21
|
import "./chunk-7ZJN4KLV.js";
|
|
22
22
|
import "./chunk-KHYD3WXE.js";
|