jinzd-ai-cli 0.4.256 → 0.4.257
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-A6WZTY56.js → batch-HCTZJMGR.js} +2 -2
- package/dist/{chunk-3F5FAUCI.js → chunk-4VWME5CO.js} +1 -1
- package/dist/{chunk-IXGGIS3K.js → chunk-5DLLJ67Q.js} +1 -1
- package/dist/{chunk-TN62NEIY.js → chunk-BQXVQKMH.js} +1 -1
- package/dist/{chunk-3C6TKCRL.js → chunk-DFV7F6S7.js} +1 -1
- package/dist/{chunk-DQW3TJ4M.js → chunk-DGMSS565.js} +1 -1
- package/dist/{chunk-EWLXBTSC.js → chunk-DQY2DDGS.js} +1 -1
- package/dist/{chunk-VUGDRRX3.js → chunk-ELYDRIKV.js} +4 -4
- package/dist/{chunk-GUOLPI33.js → chunk-EZ6QLHOS.js} +9 -3
- package/dist/{chunk-X45KVQHD.js → chunk-GOGDUA4G.js} +4 -4
- package/dist/{chunk-LEZB4KKZ.js → chunk-HOS7CGBI.js} +7 -3
- package/dist/{chunk-FIXDD5WC.js → chunk-HPPK4IA3.js} +1 -1
- package/dist/{chunk-2CGCEN7Q.js → chunk-MJ6JLSPR.js} +41 -3
- package/dist/{chunk-AL3H7VI2.js → chunk-NRTYNGEZ.js} +1 -1
- package/dist/{chunk-UPOFNYWD.js → chunk-NX55D52V.js} +2 -2
- package/dist/{chunk-KTN7YDXC.js → chunk-QEVXWHWN.js} +1 -1
- package/dist/{chunk-VEBTQK3D.js → chunk-QI4AJPRD.js} +5 -5
- package/dist/{chunk-P5HO5RXI.js → chunk-X2ZXQMN2.js} +1 -1
- package/dist/{ci-2YHS67DD.js → ci-OGJDKUEN.js} +6 -6
- package/dist/{ci-format-AS3NBCVH.js → ci-format-CG6US3KX.js} +2 -2
- package/dist/{constants-RMUULNCF.js → constants-3UC2F5GC.js} +1 -1
- package/dist/{doctor-cli-UOSY3GL6.js → doctor-cli-FPYSCH5H.js} +6 -6
- package/dist/electron-server.js +62 -14
- package/dist/{hub-SIPD6DKN.js → hub-5NRTE7PL.js} +1 -1
- package/dist/index.js +34 -24
- package/dist/{persistent-memory-ELW2QNRA.js → persistent-memory-CHPNGWN2.js} +2 -2
- package/dist/{persistent-memory-JIXASKVH.js → persistent-memory-PNJCHP33.js} +2 -2
- package/dist/{pr-NI5ZF7LE.js → pr-KAEI2IK3.js} +6 -6
- package/dist/{run-tests-XZ4DN4NV.js → run-tests-EOHLRWQC.js} +2 -2
- package/dist/{run-tests-NSOI3UB5.js → run-tests-F7Y6POVK.js} +2 -2
- package/dist/{server-52KYUXTT.js → server-4NP2ZVLA.js} +6 -6
- package/dist/{server-WIBGSOFE.js → server-REZPCUHW.js} +14 -14
- package/dist/{task-orchestrator-BPXLRZTU.js → task-orchestrator-LTPRJVLH.js} +6 -6
- package/dist/{usage-K7GM44EG.js → usage-XPBLQ4FZ.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-DFV7F6S7.js";
|
|
5
5
|
import "./chunk-TU3L3PW7.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-5DLLJ67Q.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFileSync
|
|
9
9
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ProviderRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MJ6JLSPR.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DFV7F6S7.js";
|
|
8
8
|
import {
|
|
9
9
|
getActivePluginAssets,
|
|
10
10
|
getPendingHookTrust,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
listHooks,
|
|
15
15
|
listInstalledPlugins,
|
|
16
16
|
resetStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-X2ZXQMN2.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-
|
|
29
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -39,9 +39,15 @@ var PRICING_TABLE = {
|
|
|
39
39
|
"gemini-1.5-flash": { input: 0.075, output: 0.3 },
|
|
40
40
|
// ── DeepSeek ──────────────────────────────────────────────────
|
|
41
41
|
// V4 family (2026-04-23+):1M context, Thinking / Non-Thinking dual-mode, 384K max output
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//
|
|
42
|
+
// 费率 2026-08-01 对 api-docs.deepseek.com/quick_start/pricing 官方 USD 表逐项核对。
|
|
43
|
+
// 修正前 pro 三项整齐高 4×(官方降过价未跟)、flash cacheRead 高 10×(像是按 input 的
|
|
44
|
+
// 20% 拍脑袋而非抄文档)——`aicli usage` 因此系统性高报 DeepSeek 成本。
|
|
45
|
+
// 待办:官方已公告峰谷定价(北京时间 9-12 点、14-18 点为平时 2 倍),本表仍是单一费率,
|
|
46
|
+
// 届时高峰时段会低报;等该策略实际生效后再决定是否引入时段维度。
|
|
47
|
+
"deepseek-v4-pro": { input: 0.435, output: 0.87, cacheRead: 3625e-6 },
|
|
48
|
+
"deepseek-v4-flash": { input: 0.14, output: 0.28, cacheRead: 28e-4 },
|
|
49
|
+
// Legacy aliases:retires 2026-07-24 UTC 15:59,官方 route 到 V4 Flash。
|
|
50
|
+
// 这几条只服务历史 session 的成本回算,保留当时的费率口径,不随现价改动。
|
|
45
51
|
"deepseek-chat": { input: 0.14, output: 0.28, cacheRead: 0.028 },
|
|
46
52
|
"deepseek-reasoner": { input: 0.14, output: 0.28, cacheRead: 0.028 },
|
|
47
53
|
"deepseek-v3": { input: 0.27, output: 1.1, cacheRead: 0.07 },
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HPPK4IA3.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-MJ6JLSPR.js";
|
|
14
14
|
import {
|
|
15
15
|
ConfigManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DFV7F6S7.js";
|
|
17
17
|
import {
|
|
18
18
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/ci.ts
|
|
22
22
|
import { execFileSync } from "child_process";
|
|
@@ -859,6 +859,7 @@ var BudgetWarner = class {
|
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
861
|
var EMPTY_RESPONSE_NUDGE = "Your previous response was empty \u2014 no text and no tool calls. This usually means the context window is nearly full. Please either: (1) continue the task by calling the next tool you need, or (2) give a concise final text summary of what has been accomplished so far and what remains. Do NOT repeat earlier long outputs.";
|
|
862
|
+
var LENGTH_LIMIT_NUDGE = "Your previous attempt hit the model output token limit (finish_reason=length) before producing ANY answer text or tool call \u2014 the entire output budget was consumed by extended reasoning. Retrying the same way will fail identically. Do NOT reason at length again: start producing output immediately. If the deliverable is long, do NOT try to emit it in one response \u2014 write it to disk in several smaller write_file calls (part 1, part 2, ...), each well under the output limit, and keep any thinking short.";
|
|
862
863
|
function describeFinishReason(fr) {
|
|
863
864
|
if (fr === "length") return "output limit reached (finish_reason=length)";
|
|
864
865
|
if (fr === "content_filter") return "content blocked (finish_reason=content_filter)";
|
|
@@ -866,7 +867,9 @@ function describeFinishReason(fr) {
|
|
|
866
867
|
return "empty response";
|
|
867
868
|
}
|
|
868
869
|
function emptyResponseHint(fr) {
|
|
869
|
-
if (fr === "length")
|
|
870
|
+
if (fr === "length") {
|
|
871
|
+
return "Output token budget exhausted before any answer \u2014 on thinking models max_tokens covers reasoning + answer. Try: raise config.modelParams.<model>.maxTokens, ask for the deliverable in parts, or /model to switch.";
|
|
872
|
+
}
|
|
870
873
|
if (fr === "content_filter") return "Content was blocked by the provider filter.";
|
|
871
874
|
return "Context window may be exhausted or max_tokens too low.";
|
|
872
875
|
}
|
|
@@ -875,10 +878,11 @@ var EmptyResponseGuard = class {
|
|
|
875
878
|
onEmpty(canRetry, finishReason) {
|
|
876
879
|
if (this.retries === 0 && canRetry) {
|
|
877
880
|
this.retries++;
|
|
881
|
+
const isLength = finishReason === "length";
|
|
878
882
|
return {
|
|
879
883
|
action: "nudge",
|
|
880
|
-
injectMessage: EMPTY_RESPONSE_NUDGE,
|
|
881
|
-
displayMessage: `\u26A0 ${describeFinishReason(finishReason)} \u2014 nudging AI to continue...`
|
|
884
|
+
injectMessage: isLength ? LENGTH_LIMIT_NUDGE : EMPTY_RESPONSE_NUDGE,
|
|
885
|
+
displayMessage: isLength ? `\u26A0 ${describeFinishReason(finishReason)} \u2014 the whole output budget went to reasoning; asking AI to write directly in smaller parts...` : `\u26A0 ${describeFinishReason(finishReason)} \u2014 nudging AI to continue...`
|
|
882
886
|
};
|
|
883
887
|
}
|
|
884
888
|
return {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
detectsHallucinatedFileOp,
|
|
4
4
|
parseToolCallArguments,
|
|
5
5
|
schemaToJsonSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HOS7CGBI.js";
|
|
7
7
|
import {
|
|
8
8
|
AuthError,
|
|
9
9
|
ProviderError,
|
|
@@ -957,20 +957,49 @@ function isLoopbackBaseUrl(baseUrl) {
|
|
|
957
957
|
if (host === "localhost" || host === "::1" || host === "0.0.0.0") return true;
|
|
958
958
|
return /^127(?:\.\d{1,3}){3}$/.test(host);
|
|
959
959
|
}
|
|
960
|
+
function readRetryCount(headers) {
|
|
961
|
+
if (!headers) return 0;
|
|
962
|
+
const KEY = "x-stainless-retry-count";
|
|
963
|
+
let raw;
|
|
964
|
+
const getter = headers.get;
|
|
965
|
+
if (typeof getter === "function") {
|
|
966
|
+
raw = getter.call(headers, KEY) ?? void 0;
|
|
967
|
+
} else if (Array.isArray(headers)) {
|
|
968
|
+
raw = headers.find(([k]) => k.toLowerCase() === KEY)?.[1];
|
|
969
|
+
} else {
|
|
970
|
+
const entry = Object.entries(headers).find(
|
|
971
|
+
([k]) => k.toLowerCase() === KEY
|
|
972
|
+
);
|
|
973
|
+
raw = entry?.[1];
|
|
974
|
+
}
|
|
975
|
+
const n = Number(raw);
|
|
976
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
977
|
+
}
|
|
960
978
|
var OpenAICompatibleProvider = class extends BaseProvider {
|
|
961
979
|
client;
|
|
962
980
|
defaultTimeout = 6e4;
|
|
963
981
|
// ms
|
|
982
|
+
/**
|
|
983
|
+
* openai-node 的默认 `maxRetries` 是 **2**,且**超时也算可重试错误**。
|
|
984
|
+
* 对普通 REST 请求这没问题,但 LLM 调用的超时是分钟级:东叔配 `timeouts.deepseek=300000`
|
|
985
|
+
* (5 分钟)本意是「最多等 5 分钟」,实际最坏是 5min × 3 次 = **15 分钟以上的完全静默**
|
|
986
|
+
* ——尤其 DeepSeek/Kimi 走 `enableStreamingToolCalls=false` 的非流式回退路径时,
|
|
987
|
+
* 屏幕上连一个字都不会动,看起来就是卡死(实战:一次 skill 任务空转近 20 分钟)。
|
|
988
|
+
* 故显式降到 1(仍保留一次对瞬时网络抖动的重试),并在 fetch 包装里把重试**打印出来**。
|
|
989
|
+
*/
|
|
990
|
+
defaultMaxRetries = 1;
|
|
964
991
|
/** 子类设为 false 可禁用流式工具调用(虚假声明检测需要完整响应) */
|
|
965
992
|
enableStreamingToolCalls = true;
|
|
966
993
|
async initialize(apiKey, options) {
|
|
967
994
|
if (options?.timeout !== void 0) {
|
|
968
995
|
this.defaultTimeout = options.timeout;
|
|
969
996
|
}
|
|
997
|
+
const maxRetries = typeof options?.maxRetries === "number" ? options.maxRetries : this.defaultMaxRetries;
|
|
970
998
|
const clientOptions = {
|
|
971
999
|
apiKey,
|
|
972
1000
|
baseURL: options?.baseUrl ?? this.defaultBaseUrl,
|
|
973
|
-
timeout: this.defaultTimeout
|
|
1001
|
+
timeout: this.defaultTimeout,
|
|
1002
|
+
maxRetries
|
|
974
1003
|
};
|
|
975
1004
|
const proxyUrl = isLoopbackBaseUrl(clientOptions.baseURL) ? void 0 : options?.proxy;
|
|
976
1005
|
try {
|
|
@@ -985,7 +1014,16 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
985
1014
|
bodyTimeout: STREAM_BODY_TIMEOUT,
|
|
986
1015
|
headersTimeout: STREAM_HEADERS_TIMEOUT
|
|
987
1016
|
});
|
|
988
|
-
clientOptions.fetch = ((url, init) =>
|
|
1017
|
+
clientOptions.fetch = ((url, init) => {
|
|
1018
|
+
const retryCount = readRetryCount(init?.headers);
|
|
1019
|
+
if (retryCount > 0) {
|
|
1020
|
+
process.stderr.write(
|
|
1021
|
+
`[${this.info.id}] \u27F3 request retry ${retryCount}/${maxRetries} \u2014 previous attempt failed or timed out
|
|
1022
|
+
`
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
return undiciFetch(url, { ...init, dispatcher });
|
|
1026
|
+
});
|
|
989
1027
|
} catch {
|
|
990
1028
|
}
|
|
991
1029
|
this.client = new OpenAI(clientOptions);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
truncateForPersist
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QI4AJPRD.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-5DLLJ67Q.js";
|
|
15
15
|
import {
|
|
16
16
|
atomicWriteFileSync
|
|
17
17
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
searchPersistentMemories,
|
|
8
8
|
touchMemoryReferences,
|
|
9
9
|
updateMemoryEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4VWME5CO.js";
|
|
11
11
|
import {
|
|
12
12
|
indexProject
|
|
13
13
|
} from "./chunk-GLSR2NR3.js";
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
runHook,
|
|
24
24
|
runLifecycleHooks,
|
|
25
25
|
runTool
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-X2ZXQMN2.js";
|
|
27
27
|
import {
|
|
28
28
|
buildTruncatedArgumentsError,
|
|
29
29
|
getDangerLevel,
|
|
30
30
|
isFileWriteTool,
|
|
31
31
|
runLeanAgentLoop
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HOS7CGBI.js";
|
|
33
33
|
import {
|
|
34
34
|
EnvLoader,
|
|
35
35
|
NetworkError,
|
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
} from "./chunk-4BKXL7SM.js";
|
|
41
41
|
import {
|
|
42
42
|
runTestsTool
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-BQXVQKMH.js";
|
|
44
44
|
import {
|
|
45
45
|
CONFIG_DIR_NAME,
|
|
46
46
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
47
47
|
SUBAGENT_ALLOWED_TOOLS,
|
|
48
48
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
49
49
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
51
51
|
import {
|
|
52
52
|
loadChatIndex,
|
|
53
53
|
searchChatMemory
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-GOGDUA4G.js";
|
|
7
|
+
import "./chunk-HPPK4IA3.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-MJ6JLSPR.js";
|
|
10
|
+
import "./chunk-DFV7F6S7.js";
|
|
11
|
+
import "./chunk-HOS7CGBI.js";
|
|
12
12
|
import "./chunk-TU3L3PW7.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-5DLLJ67Q.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
export {
|
|
16
16
|
CI_COMMENT_MARKER,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ELYDRIKV.js";
|
|
6
|
+
import "./chunk-MJ6JLSPR.js";
|
|
7
|
+
import "./chunk-DFV7F6S7.js";
|
|
8
|
+
import "./chunk-X2ZXQMN2.js";
|
|
9
|
+
import "./chunk-HOS7CGBI.js";
|
|
10
10
|
import "./chunk-TU3L3PW7.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-5DLLJ67Q.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|
package/dist/electron-server.js
CHANGED
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
touchMemoryReferences,
|
|
35
35
|
updateMemoryApproval,
|
|
36
36
|
updateMemoryEntry
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-NRTYNGEZ.js";
|
|
38
38
|
import {
|
|
39
39
|
redactJson,
|
|
40
40
|
scanString
|
|
41
41
|
} from "./chunk-YVTASHS5.js";
|
|
42
42
|
import {
|
|
43
43
|
runTestsTool
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-DGMSS565.js";
|
|
45
45
|
import {
|
|
46
46
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
47
47
|
APP_NAME,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
74
74
|
VERSION,
|
|
75
75
|
buildUserIdentityPrompt
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-QEVXWHWN.js";
|
|
77
77
|
import {
|
|
78
78
|
hasSemanticIndex,
|
|
79
79
|
semanticSearch
|
|
@@ -2482,6 +2482,7 @@ var BudgetWarner = class {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
};
|
|
2484
2484
|
var EMPTY_RESPONSE_NUDGE = "Your previous response was empty \u2014 no text and no tool calls. This usually means the context window is nearly full. Please either: (1) continue the task by calling the next tool you need, or (2) give a concise final text summary of what has been accomplished so far and what remains. Do NOT repeat earlier long outputs.";
|
|
2485
|
+
var LENGTH_LIMIT_NUDGE = "Your previous attempt hit the model output token limit (finish_reason=length) before producing ANY answer text or tool call \u2014 the entire output budget was consumed by extended reasoning. Retrying the same way will fail identically. Do NOT reason at length again: start producing output immediately. If the deliverable is long, do NOT try to emit it in one response \u2014 write it to disk in several smaller write_file calls (part 1, part 2, ...), each well under the output limit, and keep any thinking short.";
|
|
2485
2486
|
function describeFinishReason(fr) {
|
|
2486
2487
|
if (fr === "length") return "output limit reached (finish_reason=length)";
|
|
2487
2488
|
if (fr === "content_filter") return "content blocked (finish_reason=content_filter)";
|
|
@@ -2489,7 +2490,9 @@ function describeFinishReason(fr) {
|
|
|
2489
2490
|
return "empty response";
|
|
2490
2491
|
}
|
|
2491
2492
|
function emptyResponseHint(fr) {
|
|
2492
|
-
if (fr === "length")
|
|
2493
|
+
if (fr === "length") {
|
|
2494
|
+
return "Output token budget exhausted before any answer \u2014 on thinking models max_tokens covers reasoning + answer. Try: raise config.modelParams.<model>.maxTokens, ask for the deliverable in parts, or /model to switch.";
|
|
2495
|
+
}
|
|
2493
2496
|
if (fr === "content_filter") return "Content was blocked by the provider filter.";
|
|
2494
2497
|
return "Context window may be exhausted or max_tokens too low.";
|
|
2495
2498
|
}
|
|
@@ -2498,10 +2501,11 @@ var EmptyResponseGuard = class {
|
|
|
2498
2501
|
onEmpty(canRetry, finishReason) {
|
|
2499
2502
|
if (this.retries === 0 && canRetry) {
|
|
2500
2503
|
this.retries++;
|
|
2504
|
+
const isLength = finishReason === "length";
|
|
2501
2505
|
return {
|
|
2502
2506
|
action: "nudge",
|
|
2503
|
-
injectMessage: EMPTY_RESPONSE_NUDGE,
|
|
2504
|
-
displayMessage: `\u26A0 ${describeFinishReason(finishReason)} \u2014 nudging AI to continue...`
|
|
2507
|
+
injectMessage: isLength ? LENGTH_LIMIT_NUDGE : EMPTY_RESPONSE_NUDGE,
|
|
2508
|
+
displayMessage: isLength ? `\u26A0 ${describeFinishReason(finishReason)} \u2014 the whole output budget went to reasoning; asking AI to write directly in smaller parts...` : `\u26A0 ${describeFinishReason(finishReason)} \u2014 nudging AI to continue...`
|
|
2505
2509
|
};
|
|
2506
2510
|
}
|
|
2507
2511
|
return {
|
|
@@ -2786,20 +2790,49 @@ function isLoopbackBaseUrl(baseUrl) {
|
|
|
2786
2790
|
if (host === "localhost" || host === "::1" || host === "0.0.0.0") return true;
|
|
2787
2791
|
return /^127(?:\.\d{1,3}){3}$/.test(host);
|
|
2788
2792
|
}
|
|
2793
|
+
function readRetryCount(headers) {
|
|
2794
|
+
if (!headers) return 0;
|
|
2795
|
+
const KEY = "x-stainless-retry-count";
|
|
2796
|
+
let raw;
|
|
2797
|
+
const getter = headers.get;
|
|
2798
|
+
if (typeof getter === "function") {
|
|
2799
|
+
raw = getter.call(headers, KEY) ?? void 0;
|
|
2800
|
+
} else if (Array.isArray(headers)) {
|
|
2801
|
+
raw = headers.find(([k]) => k.toLowerCase() === KEY)?.[1];
|
|
2802
|
+
} else {
|
|
2803
|
+
const entry = Object.entries(headers).find(
|
|
2804
|
+
([k]) => k.toLowerCase() === KEY
|
|
2805
|
+
);
|
|
2806
|
+
raw = entry?.[1];
|
|
2807
|
+
}
|
|
2808
|
+
const n = Number(raw);
|
|
2809
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
2810
|
+
}
|
|
2789
2811
|
var OpenAICompatibleProvider = class extends BaseProvider {
|
|
2790
2812
|
client;
|
|
2791
2813
|
defaultTimeout = 6e4;
|
|
2792
2814
|
// ms
|
|
2815
|
+
/**
|
|
2816
|
+
* openai-node 的默认 `maxRetries` 是 **2**,且**超时也算可重试错误**。
|
|
2817
|
+
* 对普通 REST 请求这没问题,但 LLM 调用的超时是分钟级:东叔配 `timeouts.deepseek=300000`
|
|
2818
|
+
* (5 分钟)本意是「最多等 5 分钟」,实际最坏是 5min × 3 次 = **15 分钟以上的完全静默**
|
|
2819
|
+
* ——尤其 DeepSeek/Kimi 走 `enableStreamingToolCalls=false` 的非流式回退路径时,
|
|
2820
|
+
* 屏幕上连一个字都不会动,看起来就是卡死(实战:一次 skill 任务空转近 20 分钟)。
|
|
2821
|
+
* 故显式降到 1(仍保留一次对瞬时网络抖动的重试),并在 fetch 包装里把重试**打印出来**。
|
|
2822
|
+
*/
|
|
2823
|
+
defaultMaxRetries = 1;
|
|
2793
2824
|
/** 子类设为 false 可禁用流式工具调用(虚假声明检测需要完整响应) */
|
|
2794
2825
|
enableStreamingToolCalls = true;
|
|
2795
2826
|
async initialize(apiKey, options) {
|
|
2796
2827
|
if (options?.timeout !== void 0) {
|
|
2797
2828
|
this.defaultTimeout = options.timeout;
|
|
2798
2829
|
}
|
|
2830
|
+
const maxRetries = typeof options?.maxRetries === "number" ? options.maxRetries : this.defaultMaxRetries;
|
|
2799
2831
|
const clientOptions = {
|
|
2800
2832
|
apiKey,
|
|
2801
2833
|
baseURL: options?.baseUrl ?? this.defaultBaseUrl,
|
|
2802
|
-
timeout: this.defaultTimeout
|
|
2834
|
+
timeout: this.defaultTimeout,
|
|
2835
|
+
maxRetries
|
|
2803
2836
|
};
|
|
2804
2837
|
const proxyUrl = isLoopbackBaseUrl(clientOptions.baseURL) ? void 0 : options?.proxy;
|
|
2805
2838
|
try {
|
|
@@ -2814,7 +2847,16 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
2814
2847
|
bodyTimeout: STREAM_BODY_TIMEOUT,
|
|
2815
2848
|
headersTimeout: STREAM_HEADERS_TIMEOUT
|
|
2816
2849
|
});
|
|
2817
|
-
clientOptions.fetch = ((url, init) =>
|
|
2850
|
+
clientOptions.fetch = ((url, init) => {
|
|
2851
|
+
const retryCount = readRetryCount(init?.headers);
|
|
2852
|
+
if (retryCount > 0) {
|
|
2853
|
+
process.stderr.write(
|
|
2854
|
+
`[${this.info.id}] \u27F3 request retry ${retryCount}/${maxRetries} \u2014 previous attempt failed or timed out
|
|
2855
|
+
`
|
|
2856
|
+
);
|
|
2857
|
+
}
|
|
2858
|
+
return undiciFetch(url, { ...init, dispatcher });
|
|
2859
|
+
});
|
|
2818
2860
|
} catch {
|
|
2819
2861
|
}
|
|
2820
2862
|
this.client = new OpenAI(clientOptions);
|
|
@@ -13536,9 +13578,15 @@ var PRICING_TABLE = {
|
|
|
13536
13578
|
"gemini-1.5-flash": { input: 0.075, output: 0.3 },
|
|
13537
13579
|
// ── DeepSeek ──────────────────────────────────────────────────
|
|
13538
13580
|
// V4 family (2026-04-23+):1M context, Thinking / Non-Thinking dual-mode, 384K max output
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
//
|
|
13581
|
+
// 费率 2026-08-01 对 api-docs.deepseek.com/quick_start/pricing 官方 USD 表逐项核对。
|
|
13582
|
+
// 修正前 pro 三项整齐高 4×(官方降过价未跟)、flash cacheRead 高 10×(像是按 input 的
|
|
13583
|
+
// 20% 拍脑袋而非抄文档)——`aicli usage` 因此系统性高报 DeepSeek 成本。
|
|
13584
|
+
// 待办:官方已公告峰谷定价(北京时间 9-12 点、14-18 点为平时 2 倍),本表仍是单一费率,
|
|
13585
|
+
// 届时高峰时段会低报;等该策略实际生效后再决定是否引入时段维度。
|
|
13586
|
+
"deepseek-v4-pro": { input: 0.435, output: 0.87, cacheRead: 3625e-6 },
|
|
13587
|
+
"deepseek-v4-flash": { input: 0.14, output: 0.28, cacheRead: 28e-4 },
|
|
13588
|
+
// Legacy aliases:retires 2026-07-24 UTC 15:59,官方 route 到 V4 Flash。
|
|
13589
|
+
// 这几条只服务历史 session 的成本回算,保留当时的费率口径,不随现价改动。
|
|
13542
13590
|
"deepseek-chat": { input: 0.14, output: 0.28, cacheRead: 0.028 },
|
|
13543
13591
|
"deepseek-reasoner": { input: 0.14, output: 0.28, cacheRead: 0.028 },
|
|
13544
13592
|
"deepseek-v3": { input: 0.27, output: 1.1, cacheRead: 0.07 },
|
|
@@ -15237,7 +15285,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
15237
15285
|
Cost: ${formatCost(cost)}` : "";
|
|
15238
15286
|
let memoryLine = "";
|
|
15239
15287
|
try {
|
|
15240
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
15288
|
+
const { countPendingMemories } = await import("./persistent-memory-PNJCHP33.js");
|
|
15241
15289
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
15242
15290
|
if (pending > 0) memoryLine = `
|
|
15243
15291
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -16046,7 +16094,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
16046
16094
|
async function handleTest(args, ctx) {
|
|
16047
16095
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
16048
16096
|
try {
|
|
16049
|
-
const { executeTests } = await import("./run-tests-
|
|
16097
|
+
const { executeTests } = await import("./run-tests-F7Y6POVK.js");
|
|
16050
16098
|
const argStr = args.join(" ").trim();
|
|
16051
16099
|
let testArgs = {};
|
|
16052
16100
|
if (argStr) {
|
|
@@ -16310,7 +16358,7 @@ async function handleMemory(args, ctx) {
|
|
|
16310
16358
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
16311
16359
|
} else if (sub === "export") {
|
|
16312
16360
|
if (args[1] === "md") {
|
|
16313
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
16361
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-PNJCHP33.js");
|
|
16314
16362
|
ctx.send({
|
|
16315
16363
|
type: "export_data",
|
|
16316
16364
|
format: "md",
|
|
@@ -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-
|
|
157
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-LTPRJVLH.js");
|
|
158
158
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
159
159
|
let interrupted = false;
|
|
160
160
|
const onSigint = () => {
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CostTracker
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DQY2DDGS.js";
|
|
5
5
|
import {
|
|
6
6
|
McpManager,
|
|
7
7
|
SNAPSHOT_PROMPT,
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
scanProject,
|
|
18
18
|
sessionHasMeaningfulContent,
|
|
19
19
|
setupProxy
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NX55D52V.js";
|
|
21
21
|
import {
|
|
22
22
|
computeCost,
|
|
23
23
|
formatCost,
|
|
24
24
|
getPricing
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-EZ6QLHOS.js";
|
|
26
26
|
import {
|
|
27
27
|
buildReviewPrompt,
|
|
28
28
|
buildSecurityReviewPrompt
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
spawnAgentContext,
|
|
51
51
|
theme,
|
|
52
52
|
undoStack
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-QI4AJPRD.js";
|
|
54
54
|
import {
|
|
55
55
|
addMemoryEntry,
|
|
56
56
|
backupMemoryStore,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
touchMemoryReferences,
|
|
77
77
|
updateMemoryApproval,
|
|
78
78
|
updateMemoryEntry
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-4VWME5CO.js";
|
|
80
80
|
import "./chunk-GLSR2NR3.js";
|
|
81
81
|
import "./chunk-UUSRWSSX.js";
|
|
82
82
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -90,13 +90,13 @@ import {
|
|
|
90
90
|
formatDoctorReport,
|
|
91
91
|
loadContextFiles,
|
|
92
92
|
writeCrashLog
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-ELYDRIKV.js";
|
|
94
94
|
import {
|
|
95
95
|
ProviderRegistry
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-MJ6JLSPR.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-DFV7F6S7.js";
|
|
100
100
|
import {
|
|
101
101
|
describePlugin,
|
|
102
102
|
getActivePluginAssets,
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
trustHook,
|
|
114
114
|
trustPlugin,
|
|
115
115
|
untrustHook
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-X2ZXQMN2.js";
|
|
117
117
|
import {
|
|
118
118
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
119
119
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
stripOuterCodeFence,
|
|
133
133
|
stripToolCallReminder,
|
|
134
134
|
teeStreamErrorSummary
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-HOS7CGBI.js";
|
|
136
136
|
import {
|
|
137
137
|
AuthError,
|
|
138
138
|
ProviderError,
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
import {
|
|
147
147
|
fileCheckpoints
|
|
148
148
|
} from "./chunk-4BKXL7SM.js";
|
|
149
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-BQXVQKMH.js";
|
|
150
150
|
import {
|
|
151
151
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
152
152
|
AUTHOR,
|
|
@@ -165,7 +165,7 @@ import {
|
|
|
165
165
|
SKILLS_DIR_NAME,
|
|
166
166
|
VERSION,
|
|
167
167
|
buildUserIdentityPrompt
|
|
168
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
169
169
|
import {
|
|
170
170
|
buildChatIndex,
|
|
171
171
|
clearChatIndex,
|
|
@@ -330,6 +330,14 @@ var ABOUT_FEATURES = [
|
|
|
330
330
|
"Standalone executable packaging (no Node.js required), Electron desktop app"
|
|
331
331
|
];
|
|
332
332
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
333
|
+
function formatSpinnerElapsed(startedAt, now = Date.now()) {
|
|
334
|
+
const sec = Math.floor((now - startedAt) / 1e3);
|
|
335
|
+
if (sec < 10) return "";
|
|
336
|
+
if (sec < 60) return ` (${sec}s)`;
|
|
337
|
+
const m = Math.floor(sec / 60);
|
|
338
|
+
const s = sec % 60;
|
|
339
|
+
return ` (${m}m${String(s).padStart(2, "0")}s)`;
|
|
340
|
+
}
|
|
333
341
|
function createSpinner(text) {
|
|
334
342
|
if (!process.stdout.isTTY) {
|
|
335
343
|
return {
|
|
@@ -342,10 +350,11 @@ function createSpinner(text) {
|
|
|
342
350
|
let frameIdx = 0;
|
|
343
351
|
let currentText = text;
|
|
344
352
|
let timer = null;
|
|
353
|
+
let startedAt = Date.now();
|
|
345
354
|
const render = () => {
|
|
346
355
|
const frame = SPINNER_FRAMES[frameIdx % SPINNER_FRAMES.length];
|
|
347
356
|
frameIdx++;
|
|
348
|
-
process.stdout.write(`\r${theme.accent(frame)} ${currentText} `);
|
|
357
|
+
process.stdout.write(`\r${theme.accent(frame)} ${currentText}${formatSpinnerElapsed(startedAt)} `);
|
|
349
358
|
};
|
|
350
359
|
const clear = () => {
|
|
351
360
|
process.stdout.write("\r\x1B[2K");
|
|
@@ -362,6 +371,7 @@ function createSpinner(text) {
|
|
|
362
371
|
},
|
|
363
372
|
start(t) {
|
|
364
373
|
currentText = t;
|
|
374
|
+
startedAt = Date.now();
|
|
365
375
|
if (!timer) {
|
|
366
376
|
frameIdx = 0;
|
|
367
377
|
timer = setInterval(render, 80);
|
|
@@ -1387,7 +1397,7 @@ No tools match "${filter}".
|
|
|
1387
1397
|
const { join: join6 } = await import("path");
|
|
1388
1398
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1389
1399
|
const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
|
|
1390
|
-
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-
|
|
1400
|
+
const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-3UC2F5GC.js");
|
|
1391
1401
|
const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
|
|
1392
1402
|
const cwd = process.cwd();
|
|
1393
1403
|
const projectRoot = getGitRoot2(cwd) ?? cwd;
|
|
@@ -2366,7 +2376,7 @@ function createReviewCommands() {
|
|
|
2366
2376
|
usage: "/test [command|filter]",
|
|
2367
2377
|
async execute(args, ctx) {
|
|
2368
2378
|
try {
|
|
2369
|
-
const { executeTests } = await import("./run-tests-
|
|
2379
|
+
const { executeTests } = await import("./run-tests-EOHLRWQC.js");
|
|
2370
2380
|
const argStr = args.join(" ").trim();
|
|
2371
2381
|
let testArgs = {};
|
|
2372
2382
|
if (argStr) {
|
|
@@ -8023,7 +8033,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
8023
8033
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
8024
8034
|
process.exit(1);
|
|
8025
8035
|
}
|
|
8026
|
-
const { startWebServer } = await import("./server-
|
|
8036
|
+
const { startWebServer } = await import("./server-REZPCUHW.js");
|
|
8027
8037
|
await startWebServer({ port, host: options.host });
|
|
8028
8038
|
});
|
|
8029
8039
|
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) => {
|
|
@@ -8190,11 +8200,11 @@ program.command("sessions").description("List recent conversation sessions").opt
|
|
|
8190
8200
|
console.log(footer + "\n");
|
|
8191
8201
|
});
|
|
8192
8202
|
program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
|
|
8193
|
-
const { runUsageCli } = await import("./usage-
|
|
8203
|
+
const { runUsageCli } = await import("./usage-XPBLQ4FZ.js");
|
|
8194
8204
|
await runUsageCli(options);
|
|
8195
8205
|
});
|
|
8196
8206
|
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) => {
|
|
8197
|
-
const { runDoctorCli } = await import("./doctor-cli-
|
|
8207
|
+
const { runDoctorCli } = await import("./doctor-cli-FPYSCH5H.js");
|
|
8198
8208
|
const argv = process.argv.slice(2);
|
|
8199
8209
|
await runDoctorCli({
|
|
8200
8210
|
json: !!options.json || argv.includes("--json"),
|
|
@@ -8203,7 +8213,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
|
|
|
8203
8213
|
});
|
|
8204
8214
|
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) => {
|
|
8205
8215
|
try {
|
|
8206
|
-
const batch = await import("./batch-
|
|
8216
|
+
const batch = await import("./batch-HCTZJMGR.js");
|
|
8207
8217
|
switch (action) {
|
|
8208
8218
|
case "submit":
|
|
8209
8219
|
if (!arg) {
|
|
@@ -8246,7 +8256,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
|
|
|
8246
8256
|
}
|
|
8247
8257
|
});
|
|
8248
8258
|
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) => {
|
|
8249
|
-
const { startMcpServer } = await import("./server-
|
|
8259
|
+
const { startMcpServer } = await import("./server-4NP2ZVLA.js");
|
|
8250
8260
|
await startMcpServer({
|
|
8251
8261
|
allowDestructive: !!options.allowDestructive,
|
|
8252
8262
|
allowOutsideCwd: !!options.allowOutsideCwd,
|
|
@@ -8259,7 +8269,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8259
8269
|
console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
|
|
8260
8270
|
process.exit(1);
|
|
8261
8271
|
}
|
|
8262
|
-
const { runPrCli } = await import("./pr-
|
|
8272
|
+
const { runPrCli } = await import("./pr-KAEI2IK3.js");
|
|
8263
8273
|
const result = await runPrCli({
|
|
8264
8274
|
action,
|
|
8265
8275
|
target,
|
|
@@ -8279,8 +8289,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
|
|
|
8279
8289
|
process.exit(result.exitCode);
|
|
8280
8290
|
});
|
|
8281
8291
|
program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
|
|
8282
|
-
const { runCi } = await import("./ci-
|
|
8283
|
-
const { formatCiResult } = await import("./ci-format-
|
|
8292
|
+
const { runCi } = await import("./ci-OGJDKUEN.js");
|
|
8293
|
+
const { formatCiResult } = await import("./ci-format-CG6US3KX.js");
|
|
8284
8294
|
const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
|
|
8285
8295
|
if (formats > 1) {
|
|
8286
8296
|
console.error("Choose only one output format: --json, --markdown, or --sarif.");
|
|
@@ -8438,7 +8448,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
|
|
|
8438
8448
|
config.get("customProviders"),
|
|
8439
8449
|
config.getConfigDir()
|
|
8440
8450
|
);
|
|
8441
|
-
const { startHub } = await import("./hub-
|
|
8451
|
+
const { startHub } = await import("./hub-5NRTE7PL.js");
|
|
8442
8452
|
await startHub(
|
|
8443
8453
|
{
|
|
8444
8454
|
topic: topic ?? "",
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
touchMemoryReferences,
|
|
29
29
|
updateMemoryApproval,
|
|
30
30
|
updateMemoryEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-4VWME5CO.js";
|
|
32
32
|
import "./chunk-HOSJZMQS.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-5DLLJ67Q.js";
|
|
34
34
|
import "./chunk-B5TYJO7V.js";
|
|
35
35
|
import "./chunk-IW3Q7AE5.js";
|
|
36
36
|
export {
|
|
@@ -27,9 +27,9 @@ import {
|
|
|
27
27
|
touchMemoryReferences,
|
|
28
28
|
updateMemoryApproval,
|
|
29
29
|
updateMemoryEntry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NRTYNGEZ.js";
|
|
31
31
|
import "./chunk-YVTASHS5.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-QEVXWHWN.js";
|
|
33
33
|
import "./chunk-6BUTA5VW.js";
|
|
34
34
|
export {
|
|
35
35
|
addMemoryEntry,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
countSeverity,
|
|
4
4
|
runCi
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-GOGDUA4G.js";
|
|
6
|
+
import "./chunk-HPPK4IA3.js";
|
|
7
7
|
import {
|
|
8
8
|
buildReviewPrompt,
|
|
9
9
|
buildSecurityReviewPrompt,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
} from "./chunk-HLWUDRBO.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MJ6JLSPR.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-DFV7F6S7.js";
|
|
18
|
+
import "./chunk-HOS7CGBI.js";
|
|
19
19
|
import "./chunk-TU3L3PW7.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
23
23
|
import "./chunk-IW3Q7AE5.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/pr.ts
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ToolRegistry
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-QI4AJPRD.js";
|
|
5
|
+
import "./chunk-4VWME5CO.js";
|
|
6
6
|
import "./chunk-GLSR2NR3.js";
|
|
7
7
|
import "./chunk-UUSRWSSX.js";
|
|
8
8
|
import "./chunk-CKH4KQ4E.js";
|
|
9
9
|
import "./chunk-BXP6YZ2P.js";
|
|
10
10
|
import {
|
|
11
11
|
runTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-X2ZXQMN2.js";
|
|
13
13
|
import {
|
|
14
14
|
getDangerLevel,
|
|
15
15
|
schemaToJsonSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HOS7CGBI.js";
|
|
17
17
|
import "./chunk-TU3L3PW7.js";
|
|
18
18
|
import "./chunk-HOSJZMQS.js";
|
|
19
19
|
import "./chunk-4BKXL7SM.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-BQXVQKMH.js";
|
|
21
21
|
import {
|
|
22
22
|
VERSION
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
24
24
|
import "./chunk-6RPGQ5CG.js";
|
|
25
25
|
import "./chunk-KHYD3WXE.js";
|
|
26
26
|
import "./chunk-NYNSYLFY.js";
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
scanDirTree,
|
|
24
24
|
scanProject,
|
|
25
25
|
setupProxy
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NX55D52V.js";
|
|
27
27
|
import {
|
|
28
28
|
computeCost,
|
|
29
29
|
formatCost,
|
|
30
30
|
getPricing
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-EZ6QLHOS.js";
|
|
32
32
|
import {
|
|
33
33
|
buildReviewPrompt,
|
|
34
34
|
buildSecurityReviewPrompt
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
spawnAgentContext,
|
|
64
64
|
truncateOutput,
|
|
65
65
|
undoStack
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-QI4AJPRD.js";
|
|
67
67
|
import {
|
|
68
68
|
addMemoryEntry,
|
|
69
69
|
clearMemoryEntries,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
parseWritableScope,
|
|
78
78
|
updateMemoryApproval,
|
|
79
79
|
updateMemoryEntry
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-4VWME5CO.js";
|
|
81
81
|
import "./chunk-GLSR2NR3.js";
|
|
82
82
|
import "./chunk-UUSRWSSX.js";
|
|
83
83
|
import "./chunk-CKH4KQ4E.js";
|
|
@@ -90,13 +90,13 @@ import {
|
|
|
90
90
|
buildDoctorReport,
|
|
91
91
|
formatDoctorReport,
|
|
92
92
|
loadContextFiles
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-ELYDRIKV.js";
|
|
94
94
|
import {
|
|
95
95
|
ProviderRegistry
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-MJ6JLSPR.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigManager
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-DFV7F6S7.js";
|
|
100
100
|
import {
|
|
101
101
|
describePlugin,
|
|
102
102
|
getActivePluginAssets,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
runTool,
|
|
112
112
|
setPluginEnabled,
|
|
113
113
|
trustPlugin
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-X2ZXQMN2.js";
|
|
115
115
|
import {
|
|
116
116
|
CONTENT_ONLY_STREAM_REMINDER,
|
|
117
117
|
TEE_FINAL_USER_NUDGE,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
stripOuterCodeFence,
|
|
129
129
|
stripToolCallReminder,
|
|
130
130
|
teeStreamErrorSummary
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-HOS7CGBI.js";
|
|
132
132
|
import "./chunk-TU3L3PW7.js";
|
|
133
133
|
import {
|
|
134
134
|
formatGitContextForPrompt,
|
|
@@ -136,7 +136,7 @@ import {
|
|
|
136
136
|
getGitRoot
|
|
137
137
|
} from "./chunk-HOSJZMQS.js";
|
|
138
138
|
import "./chunk-4BKXL7SM.js";
|
|
139
|
-
import "./chunk-
|
|
139
|
+
import "./chunk-BQXVQKMH.js";
|
|
140
140
|
import {
|
|
141
141
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
142
142
|
AUTHOR,
|
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
SKILLS_DIR_NAME,
|
|
153
153
|
VERSION,
|
|
154
154
|
buildUserIdentityPrompt
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
156
156
|
import "./chunk-6RPGQ5CG.js";
|
|
157
157
|
import "./chunk-KHYD3WXE.js";
|
|
158
158
|
import "./chunk-NYNSYLFY.js";
|
|
@@ -815,7 +815,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
815
815
|
Cost: ${formatCost(cost)}` : "";
|
|
816
816
|
let memoryLine = "";
|
|
817
817
|
try {
|
|
818
|
-
const { countPendingMemories } = await import("./persistent-memory-
|
|
818
|
+
const { countPendingMemories } = await import("./persistent-memory-CHPNGWN2.js");
|
|
819
819
|
const pending = countPendingMemories(ctx.config.getConfigDir());
|
|
820
820
|
if (pending > 0) memoryLine = `
|
|
821
821
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -1624,7 +1624,7 @@ async function handleSecurityReview(args, ctx) {
|
|
|
1624
1624
|
async function handleTest(args, ctx) {
|
|
1625
1625
|
ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
|
|
1626
1626
|
try {
|
|
1627
|
-
const { executeTests } = await import("./run-tests-
|
|
1627
|
+
const { executeTests } = await import("./run-tests-EOHLRWQC.js");
|
|
1628
1628
|
const argStr = args.join(" ").trim();
|
|
1629
1629
|
let testArgs = {};
|
|
1630
1630
|
if (argStr) {
|
|
@@ -1888,7 +1888,7 @@ async function handleMemory(args, ctx) {
|
|
|
1888
1888
|
ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
|
|
1889
1889
|
} else if (sub === "export") {
|
|
1890
1890
|
if (args[1] === "md") {
|
|
1891
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
1891
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-CHPNGWN2.js");
|
|
1892
1892
|
ctx.send({
|
|
1893
1893
|
type: "export_data",
|
|
1894
1894
|
format: "md",
|
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
ToolRegistry,
|
|
4
4
|
googleSearchContext,
|
|
5
5
|
truncateOutput
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QI4AJPRD.js";
|
|
7
|
+
import "./chunk-4VWME5CO.js";
|
|
8
8
|
import "./chunk-GLSR2NR3.js";
|
|
9
9
|
import "./chunk-UUSRWSSX.js";
|
|
10
10
|
import "./chunk-CKH4KQ4E.js";
|
|
11
11
|
import "./chunk-BXP6YZ2P.js";
|
|
12
12
|
import {
|
|
13
13
|
runTool
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-X2ZXQMN2.js";
|
|
15
15
|
import {
|
|
16
16
|
getDangerLevel,
|
|
17
17
|
runLeanAgentLoop
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HOS7CGBI.js";
|
|
19
19
|
import "./chunk-TU3L3PW7.js";
|
|
20
20
|
import "./chunk-HOSJZMQS.js";
|
|
21
21
|
import "./chunk-4BKXL7SM.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-BQXVQKMH.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBAGENT_ALLOWED_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-5DLLJ67Q.js";
|
|
26
26
|
import "./chunk-6RPGQ5CG.js";
|
|
27
27
|
import "./chunk-KHYD3WXE.js";
|
|
28
28
|
import "./chunk-NYNSYLFY.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CostTracker
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DQY2DDGS.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCost,
|
|
7
7
|
getPricing
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EZ6QLHOS.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigManager
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DFV7F6S7.js";
|
|
12
12
|
import "./chunk-TU3L3PW7.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-5DLLJ67Q.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/usage.ts
|