@eddyskywalker/dsh-chatgpt-subscription 1.3.1 → 1.5.0
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/lib/advisor-contracts-BG7iEfUc.js +8 -0
- package/lib/client.js +23 -13
- package/lib/client.js.map +1 -1
- package/lib/codemode.js +72 -7
- package/lib/index.js +260 -114
- package/lib/{preset-sync-RBsYhDY3.js → preset-sync-DspdQkYN.js} +1 -8
- package/lib/{progress-updates-jiHnSAmz.js → progress-updates-ART24-8J.js} +81 -4
- package/lib/progress-updates.js +1 -1
- package/lib/{tool-result-pruner-CuKHwU2R.js → tool-result-pruner-Duw9-Gwo.js} +381 -127
- package/lib/tool-result-pruner.js +1 -1
- package/lib/types/client/features/progress-updates/contracts.d.ts +2 -0
- package/lib/types/client/features/progress-updates/contracts.d.ts.map +1 -1
- package/lib/types/client/features/progress-updates/dashboard.d.ts.map +1 -1
- package/lib/types/client/features/progress-updates/locales.d.ts +8 -2
- package/lib/types/client/features/progress-updates/locales.d.ts.map +1 -1
- package/lib/types/client/locales-ru/grok.d.ts.map +1 -1
- package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
- package/lib/types/client/providers/grok/locales.d.ts +3 -1
- package/lib/types/client/providers/grok/locales.d.ts.map +1 -1
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/host/common/model-facts-data.d.ts +4 -0
- package/lib/types/host/common/model-facts-data.d.ts.map +1 -0
- package/lib/types/host/common/model-facts.d.ts +41 -0
- package/lib/types/host/common/model-facts.d.ts.map +1 -0
- package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
- package/lib/types/host/providers/glm-coding-plan/model-catalog.d.ts +9 -11
- package/lib/types/host/providers/glm-coding-plan/model-catalog.d.ts.map +1 -1
- package/lib/types/host/providers/grok/model-catalog.d.ts +5 -1
- package/lib/types/host/providers/grok/model-catalog.d.ts.map +1 -1
- package/lib/types/host/providers/minimax-code/mapper.d.ts.map +1 -1
- package/lib/types/host/providers/minimax-code/model-catalog.d.ts +17 -11
- package/lib/types/host/providers/minimax-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/providers/qoder/mapper.d.ts +0 -25
- package/lib/types/host/providers/qoder/mapper.d.ts.map +1 -1
- package/lib/types/host/providers/qoder/model-catalog.d.ts.map +1 -1
- package/lib/types/host/providers/step-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/providers/workbuddy/model-catalog.d.ts.map +1 -1
- package/lib/types/host/runtime/advisor/index.d.ts +4 -1
- package/lib/types/host/runtime/advisor/index.d.ts.map +1 -1
- package/lib/types/host/runtime/advisor/prompt.d.ts +14 -0
- package/lib/types/host/runtime/advisor/prompt.d.ts.map +1 -1
- package/lib/types/host/runtime/advisor/request.d.ts +3 -0
- package/lib/types/host/runtime/advisor/request.d.ts.map +1 -1
- package/lib/types/host/runtime/codemode/transport.d.ts +4 -3
- package/lib/types/host/runtime/codemode/transport.d.ts.map +1 -1
- package/lib/types/host/runtime/deepseek-v41-flash/discipline.d.ts.map +1 -1
- package/lib/types/host/runtime/deepseek-v41-flash/index.d.ts +2 -2
- package/lib/types/host/runtime/deepseek-v41-flash/index.d.ts.map +1 -1
- package/lib/types/host/runtime/deepseek-v41-flash/match.d.ts.map +1 -1
- package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts +4 -0
- package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts.map +1 -1
- package/lib/types/host/runtime/open-models/identity.d.ts +6 -0
- package/lib/types/host/runtime/open-models/identity.d.ts.map +1 -0
- package/lib/types/host/runtime/open-models/index.d.ts +4 -5
- package/lib/types/host/runtime/open-models/index.d.ts.map +1 -1
- package/lib/types/host/runtime/open-models/profiles.d.ts +10 -22
- package/lib/types/host/runtime/open-models/profiles.d.ts.map +1 -1
- package/lib/types/host/runtime/open-models/state-anchor.d.ts.map +1 -1
- package/lib/types/host/runtime/progress-updates/projection.d.ts +6 -1
- package/lib/types/host/runtime/progress-updates/projection.d.ts.map +1 -1
- package/lib/types/host/runtime/progress-updates/store.d.ts +2 -0
- package/lib/types/host/runtime/progress-updates/store.d.ts.map +1 -1
- package/lib/types/shared/grok-contracts.d.ts +1 -1
- package/lib/types/shared/grok-contracts.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { a as resolveProgressUpdatesSettings, n as attachProgressSettings } from "./progress-updates-
|
|
1
|
+
import { a as resolveProgressUpdatesSettings, n as attachProgressSettings, o as PROGRESS_UPDATE_LANGUAGES } from "./progress-updates-ART24-8J.js";
|
|
2
|
+
import { n as ADVISOR_TOOL_TIMEOUT_MS, r as CONSULT_ADVISOR_TOOL_NAME, t as ADVISOR_STATE_PATH } from "./advisor-contracts-BG7iEfUc.js";
|
|
2
3
|
import { h as resolvePlanModePipelineEnabled, l as attachPlanModePipelineSettings } from "./plan-mode-pipeline-DQ8TM6mP.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import { A as isDeepSeekV41Flash, B as estimateCodexPayloadTokens, C as
|
|
4
|
+
import { a as PLUGIN_MESSAGE_SOURCE_KIND, c as formatToolUpdateNotice, d as midConversationUpdateToUserMessage, f as normalizeGenerateOptions, i as LlmError$1, l as leadingSystemEndIndex, n as installBundledPresets, o as extractSystemText, r as resolvesFromHere, s as formatMidConversationSystemReminder, u as midConversationSystemToUserMessage } from "./preset-sync-DspdQkYN.js";
|
|
5
|
+
import { A as isDeepSeekV41Flash, B as estimateCodexPayloadTokens, C as isQwenOpenModel, D as matchOpenModelSession, E as matchOpenModelScope, F as checkpointFromMetadata, G as shouldCompactCodexPayload, H as latestCodexCompaction, I as checkpointFromOutputItems, K as withCodexCompactionTrigger, L as codexCompactionReplayMetadata, M as isDeepSeekV41FlashSession, N as readScopeRoute, O as bareOpenModelId, P as readSessionRoute, R as codexRemoteCompactionEnabled, S as isOpenModelSessionPrefixCacheProtected, T as matchOpenModelProfile, U as noteCodexRemoteCompactionFailure, V as isCompactionItem, W as projectFreshCodexCompaction, _ as isLongSparseOpenModel, b as isOpenModelCacheWarmupProtected, d as OPEN_MODEL_PROFILES, f as isDeepSeekV4NonV41Model, g as isKimiOpenModel, h as isKimiK31OpenModel, j as isDeepSeekV41FlashScope, k as DEEPSEEK_OFFICIAL_PROVIDERS, l as resolveSkipProviders, m as isGlm5OpenModel, n as DEFAULT_SKIP_PROVIDERS, p as isGlm54OpenModel, r as PRUNER_SERVICE_NAME, u as shouldSkipPruningForSession, v as isMimoOpenModel, w as isStepOpenModel, x as isOpenModelPrefixCacheProtected, y as isMinimaxOpenModel, z as codexRemoteCompactionThreshold } from "./tool-result-pruner-Duw9-Gwo.js";
|
|
5
6
|
import { C as isDelegatedCaller, S as installDispatchExecutionGuard, T as resolveDispatchExecutionGuardEnabled, _ as installPlanModeExitReminder, b as registeredPlanControllerActive, h as createPlanNotice, l as PLAN_PROJECTION_KEY, n as EXIT_PLAN_MODE, w as isDelegatedSession } from "./plan-mode-cY8pp0PZ.js";
|
|
6
7
|
import { createRequire } from "node:module";
|
|
7
8
|
import * as LlmModule from "@deepseek-ai/dsh-llm";
|
|
@@ -891,7 +892,7 @@ const ROUTE_PREFIX$6 = "/api/dsh-chatgpt-subscription";
|
|
|
891
892
|
* `test/responses-client.test.ts` asserts the two agree, so a release that
|
|
892
893
|
* forgets this constant fails the suite instead of shipping quietly.
|
|
893
894
|
*/
|
|
894
|
-
const PLUGIN_VERSION = "1.
|
|
895
|
+
const PLUGIN_VERSION = "1.5.0";
|
|
895
896
|
const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
|
|
896
897
|
const CODEX_API_BASE = "https://chatgpt.com/backend-api/codex";
|
|
897
898
|
const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses`;
|
|
@@ -8528,7 +8529,7 @@ const PROMPT_CACHE_POLICIES = Object.freeze({
|
|
|
8528
8529
|
waitJobs: true
|
|
8529
8530
|
}),
|
|
8530
8531
|
"minimax-code": policy({
|
|
8531
|
-
mode: "
|
|
8532
|
+
mode: "automatic",
|
|
8532
8533
|
scope: "unknown",
|
|
8533
8534
|
staticPrefix: true,
|
|
8534
8535
|
coldStart: "in-flight",
|
|
@@ -14568,6 +14569,26 @@ Rules:
|
|
|
14568
14569
|
- Cite only evidence visible in the transcript. Do not claim to have read files, run commands, or verified anything that is not visible. Omitted-history markers are not evidence that the agent skipped work.
|
|
14569
14570
|
- Do not demand commits, branches, extra documentation, or other process the user did not request.
|
|
14570
14571
|
- If the agent is on track, say so after the review in one sentence. Keep the advice under 300 words unless the situation genuinely needs more.`;
|
|
14572
|
+
/**
|
|
14573
|
+
* 顾问反馈与进展更新共用同一个语言档位。
|
|
14574
|
+
*
|
|
14575
|
+
* 提示词本身是英文,但顾问的回复会直接成为一条进展正文,所以这里明确把输出
|
|
14576
|
+
* 语言钉在进展设置上;`auto` 跟随最近一条真人用户消息,而不是英文系统提示。
|
|
14577
|
+
*/
|
|
14578
|
+
const ADVISOR_LANGUAGE_DIRECTIVES = {
|
|
14579
|
+
auto: "Write your advice in the language the human user is writing in, following the most recent user message; do not switch to English just because these instructions are in English.",
|
|
14580
|
+
zh: "Write your advice in Simplified Chinese, even when the conversation or these instructions are in another language.",
|
|
14581
|
+
en: "Write your advice in English, even when the conversation or these instructions are in another language.",
|
|
14582
|
+
ru: "Write your advice in Russian, even when the conversation or these instructions are in another language."
|
|
14583
|
+
};
|
|
14584
|
+
/**
|
|
14585
|
+
* 取一个语言档位对应的顾问输出指令。
|
|
14586
|
+
* @param language - 进展更新的语言档位。
|
|
14587
|
+
* @returns 追加给顾问系统提示的一句指令。
|
|
14588
|
+
*/
|
|
14589
|
+
function advisorLanguageDirective(language) {
|
|
14590
|
+
return ADVISOR_LANGUAGE_DIRECTIVES[language] ?? ADVISOR_LANGUAGE_DIRECTIVES.auto;
|
|
14591
|
+
}
|
|
14571
14592
|
const ADVISOR_TOOL_DESCRIPTION = `Consult the configured read-only advisor model for a stronger second opinion on your own reading of this conversation. The conversation is forwarded automatically, including tool calls and results; the question argument only sets the review focus.
|
|
14572
14593
|
|
|
14573
14594
|
Call advisor BEFORE substantive work: before writing, editing, committing to an interpretation, or building on an assumption. If orientation is needed first, find and read the relevant files, then call advisor; orientation itself is not substantive work. Also call advisor when you believe a multi-step task is complete; make the deliverable durable first by writing the file or saving the result. Call it when errors recur or the approach stops converging, and before changing approach. On short reactive tasks where the next action is dictated by tool output you just read, you may skip it.
|
|
@@ -15039,6 +15060,7 @@ async function requestAdvisor(options) {
|
|
|
15039
15060
|
const gaps = [options.transcript.omittedMessages > 0 ? `${options.transcript.omittedMessages} middle messages were omitted to fit the advisor context window.` : "", options.transcript.orphanedToolCalls > 0 ? `${options.transcript.orphanedToolCalls} tool results fell outside that window; their calls carry an explicit placeholder.` : ""].filter(Boolean);
|
|
15040
15061
|
const system = [
|
|
15041
15062
|
ADVISOR_SYSTEM_PROMPT,
|
|
15063
|
+
advisorLanguageDirective(options.language ?? "auto"),
|
|
15042
15064
|
`The main agent requests this review focus:\n${options.question}`,
|
|
15043
15065
|
options.transcript.sourceSystem,
|
|
15044
15066
|
...gaps
|
|
@@ -15152,6 +15174,11 @@ function routeOf$1(config) {
|
|
|
15152
15174
|
...reasoningEffort === "" || reasoningEffort === "auto" ? {} : { reasoningEffort }
|
|
15153
15175
|
};
|
|
15154
15176
|
}
|
|
15177
|
+
/** 顾问回复跟随进展更新的语言档位;配置写错时按 auto 处理。 */
|
|
15178
|
+
function progressLanguageOf(config) {
|
|
15179
|
+
const language = value(config.progressUpdatesLanguage, "auto");
|
|
15180
|
+
return typeof language === "string" && PROGRESS_UPDATE_LANGUAGES.includes(language) ? language : "auto";
|
|
15181
|
+
}
|
|
15155
15182
|
/** Which model the conversation itself runs on, used only for the weaker-advisor warning. */
|
|
15156
15183
|
function mainRouteOf(agent) {
|
|
15157
15184
|
const config = agent?.session?.requestHeader?.()?.config;
|
|
@@ -15168,9 +15195,11 @@ function spentTokens(usage) {
|
|
|
15168
15195
|
var AdvisorService = class {
|
|
15169
15196
|
selections;
|
|
15170
15197
|
llm;
|
|
15171
|
-
|
|
15198
|
+
languageOf;
|
|
15199
|
+
constructor(selections, llm, languageOf = () => "auto") {
|
|
15172
15200
|
this.selections = selections;
|
|
15173
15201
|
this.llm = llm;
|
|
15202
|
+
this.languageOf = languageOf;
|
|
15174
15203
|
}
|
|
15175
15204
|
async consult(args, agentInput, signal) {
|
|
15176
15205
|
const agent = agentInput;
|
|
@@ -15217,7 +15246,8 @@ var AdvisorService = class {
|
|
|
15217
15246
|
timeoutMs: state.limits.timeoutMs,
|
|
15218
15247
|
maxRetries: state.limits.maxRetries,
|
|
15219
15248
|
sessionId,
|
|
15220
|
-
signal
|
|
15249
|
+
signal,
|
|
15250
|
+
language: this.languageOf()
|
|
15221
15251
|
});
|
|
15222
15252
|
if (result.status === "ok" || result.status === "truncated" || result.status === "declined") {
|
|
15223
15253
|
const usage = await this.selections.addUsage(sessionId, {
|
|
@@ -15253,7 +15283,7 @@ function installAdvisor(ctx, config) {
|
|
|
15253
15283
|
contextTokenBudget: value(config.advisorContextTokenBudget, 1e5),
|
|
15254
15284
|
sessionTokenBudget: value(config.advisorSessionTokenBudget, 2e5)
|
|
15255
15285
|
}), void 0, (sessionId) => sessionHeaderOf(ctx, sessionId), () => firstAvailableAdvisorRoute(ctx.llm));
|
|
15256
|
-
const service = new AdvisorService(store, ctx.llm);
|
|
15286
|
+
const service = new AdvisorService(store, ctx.llm, () => progressLanguageOf(config));
|
|
15257
15287
|
const disposeTool = ctx.tools.register(defineTool({
|
|
15258
15288
|
name: CONSULT_ADVISOR_TOOL_NAME,
|
|
15259
15289
|
description: ADVISOR_TOOL_DESCRIPTION,
|
|
@@ -50422,10 +50452,11 @@ const GROK_VIDEO_TOOL_NAME = "grok_imagine_video";
|
|
|
50422
50452
|
const GROK_REASONING_EFFORTS = [
|
|
50423
50453
|
"low",
|
|
50424
50454
|
"medium",
|
|
50425
|
-
"high"
|
|
50455
|
+
"high",
|
|
50456
|
+
"xhigh"
|
|
50426
50457
|
];
|
|
50427
50458
|
function isGrokReasoningEffort(value) {
|
|
50428
|
-
return value === "low" || value === "medium" || value === "high";
|
|
50459
|
+
return value === "low" || value === "medium" || value === "high" || value === "xhigh";
|
|
50429
50460
|
}
|
|
50430
50461
|
//#endregion
|
|
50431
50462
|
//#region src/host/providers/grok/types.ts
|
|
@@ -50511,32 +50542,49 @@ function entry(input) {
|
|
|
50511
50542
|
...input
|
|
50512
50543
|
};
|
|
50513
50544
|
}
|
|
50514
|
-
/** Source: xai-org/grok-build xai-grok-models/default_models.json (grok-4.6, grok-4.5). */
|
|
50515
|
-
const GROK_MODEL_CATALOG = [
|
|
50516
|
-
|
|
50517
|
-
|
|
50518
|
-
|
|
50519
|
-
|
|
50520
|
-
|
|
50521
|
-
|
|
50522
|
-
|
|
50523
|
-
|
|
50524
|
-
|
|
50525
|
-
|
|
50526
|
-
|
|
50527
|
-
|
|
50528
|
-
|
|
50529
|
-
|
|
50530
|
-
|
|
50531
|
-
|
|
50532
|
-
|
|
50533
|
-
|
|
50534
|
-
|
|
50535
|
-
|
|
50536
|
-
|
|
50537
|
-
|
|
50538
|
-
|
|
50539
|
-
|
|
50545
|
+
/** Source: xai-org/grok-build xai-grok-models/default_models.json (grok-4.7, grok-4.6, grok-4.5). */
|
|
50546
|
+
const GROK_MODEL_CATALOG = [
|
|
50547
|
+
entry({
|
|
50548
|
+
id: "grok-4.7",
|
|
50549
|
+
name: "Grok 4.7",
|
|
50550
|
+
contextWindow: 5e5,
|
|
50551
|
+
maxOutputTokens: 128e3,
|
|
50552
|
+
reasoningEfforts: [
|
|
50553
|
+
"low",
|
|
50554
|
+
"medium",
|
|
50555
|
+
"high",
|
|
50556
|
+
"xhigh"
|
|
50557
|
+
],
|
|
50558
|
+
described: true,
|
|
50559
|
+
description: "Grok 4.7 coding and agentic model."
|
|
50560
|
+
}),
|
|
50561
|
+
entry({
|
|
50562
|
+
id: "grok-4.6",
|
|
50563
|
+
name: "Grok 4.6",
|
|
50564
|
+
contextWindow: 5e5,
|
|
50565
|
+
maxOutputTokens: 64e3,
|
|
50566
|
+
reasoningEfforts: [
|
|
50567
|
+
"low",
|
|
50568
|
+
"medium",
|
|
50569
|
+
"high"
|
|
50570
|
+
],
|
|
50571
|
+
described: true,
|
|
50572
|
+
description: "SpaceXAI's frontier coding model."
|
|
50573
|
+
}),
|
|
50574
|
+
entry({
|
|
50575
|
+
id: "grok-4.5",
|
|
50576
|
+
name: "Grok 4.5",
|
|
50577
|
+
contextWindow: 5e5,
|
|
50578
|
+
maxOutputTokens: 64e3,
|
|
50579
|
+
reasoningEfforts: [
|
|
50580
|
+
"low",
|
|
50581
|
+
"medium",
|
|
50582
|
+
"high"
|
|
50583
|
+
],
|
|
50584
|
+
described: true,
|
|
50585
|
+
description: "Grok 4.5 coding and agentic model."
|
|
50586
|
+
})
|
|
50587
|
+
];
|
|
50540
50588
|
GROK_MODEL_CATALOG.map((item) => item.id);
|
|
50541
50589
|
function resolveGrokModel(entries, id) {
|
|
50542
50590
|
const wanted = id.trim();
|
|
@@ -52584,7 +52632,7 @@ function parseSettingsPatch$7(body, catalog) {
|
|
|
52584
52632
|
patch.contextWindowOverrides = overrides;
|
|
52585
52633
|
}
|
|
52586
52634
|
if (body.defaultReasoningEffort !== void 0) {
|
|
52587
|
-
if (body.defaultReasoningEffort !== null && !isGrokReasoningEffort(body.defaultReasoningEffort)) throw new Error("defaultReasoningEffort must be low, medium, high or null");
|
|
52635
|
+
if (body.defaultReasoningEffort !== null && !isGrokReasoningEffort(body.defaultReasoningEffort)) throw new Error("defaultReasoningEffort must be low, medium, high, xhigh or null");
|
|
52588
52636
|
patch.defaultReasoningEffort = body.defaultReasoningEffort;
|
|
52589
52637
|
}
|
|
52590
52638
|
return patch;
|
|
@@ -58241,7 +58289,7 @@ const KIMI_CODE_MODELS = [
|
|
|
58241
58289
|
thinkingType: "only",
|
|
58242
58290
|
minimumPlan: "Moderato",
|
|
58243
58291
|
contextPlan: "Allegretto",
|
|
58244
|
-
description: "The K3.1 Pro flagship:
|
|
58292
|
+
description: "The K3.1 Pro flagship: 2.8T parameters, a 256K context window on Plus/Moderato and 1M on Pro/Allegretto and above. Thinking runs at low/high/max, defaults to high, and cannot be disabled.",
|
|
58245
58293
|
supportsDynamicTools: true,
|
|
58246
58294
|
quotaMultiplier: 2,
|
|
58247
58295
|
speed: "regular"
|
|
@@ -67906,7 +67954,7 @@ async function assertVideoCapableRoute(ctx, exec, source) {
|
|
|
67906
67954
|
const llm = ctx.get("llm");
|
|
67907
67955
|
if (llm === void 0) throw new HarnessError(`cannot attach "${source}": the LLM service is unavailable`, "KIMI_VIDEO_NO_LLM");
|
|
67908
67956
|
const active = await llm.resolveModelInfo(provider, model, exec.signal);
|
|
67909
|
-
if (active.inputModalities === void 0 || !active.inputModalities.includes("video")) throw new HarnessError(`cannot attach "${source}": model "${model}" does not accept video input; switch to k3, k3.1-pro, kimi-for-coding or kimi-for-coding-highspeed`, "KIMI_VIDEO_MODEL_UNSUPPORTED");
|
|
67957
|
+
if (active.inputModalities === void 0 || !active.inputModalities.includes("video")) throw new HarnessError(`cannot attach "${source}": model "${model}" does not accept video input; switch to k3, k3.1-pro, k3.1-pro-highspeed, kimi-for-coding or kimi-for-coding-highspeed`, "KIMI_VIDEO_MODEL_UNSUPPORTED");
|
|
67910
67958
|
}
|
|
67911
67959
|
function humanBytes$1(bytes) {
|
|
67912
67960
|
return bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
@@ -69648,8 +69696,9 @@ function floorForcedThinkingTokens(modelId, requested) {
|
|
|
69648
69696
|
function maxOutputTokensFor$1(modelId, contextWindow) {
|
|
69649
69697
|
const model = catalogEntry$2(modelId);
|
|
69650
69698
|
const declared = model?.maxTokens ?? 32768;
|
|
69699
|
+
const preferred = Math.min(model?.defaultMaxTokens ?? declared, declared);
|
|
69651
69700
|
const window = contextWindow ?? model?.contextWindow ?? 512e3;
|
|
69652
|
-
return Math.max(1, Math.min(
|
|
69701
|
+
return Math.max(1, Math.min(preferred, window - CONTEXT_HEADROOM_TOKENS));
|
|
69653
69702
|
}
|
|
69654
69703
|
/** Reduce a requested cap so prompt plus output still fit the window. */
|
|
69655
69704
|
function clampOutputToContext(requested, contextWindow, estimatedInputTokens) {
|
|
@@ -69758,7 +69807,7 @@ function buildMinimaxRequest(options, images = NO_RESOLVED_IMAGES$2, request = {
|
|
|
69758
69807
|
const thinking = thinkingFieldFor(options.model, requestedEffort);
|
|
69759
69808
|
const modelDef = catalogEntry$2(options.model);
|
|
69760
69809
|
const thinkingEngaged = outputConfig !== void 0 || thinking?.type === "adaptive" || modelDef?.thinking === "always-on" || modelDef?.thinking === "forced-effort";
|
|
69761
|
-
const caching = request.cacheControl !== false;
|
|
69810
|
+
const caching = request.cacheControl !== false && modelDef?.supportsExplicitCache !== false;
|
|
69762
69811
|
const body = {
|
|
69763
69812
|
model: options.model,
|
|
69764
69813
|
max_tokens: maxTokens,
|
|
@@ -70235,12 +70284,12 @@ function processMinimaxStreamLine(line, state) {
|
|
|
70235
70284
|
//#endregion
|
|
70236
70285
|
//#region src/host/providers/minimax-code/model-catalog.ts
|
|
70237
70286
|
/**
|
|
70238
|
-
* The
|
|
70287
|
+
* The five ids the subscription serves today.
|
|
70239
70288
|
*
|
|
70240
|
-
* `MiniMax-M3`
|
|
70241
|
-
*
|
|
70289
|
+
* `MiniMax-M3` remains the measured baseline, and `MiniMax-M4` is the current
|
|
70290
|
+
* 3T flagship published for the API, M Plan and MiniMax Code.
|
|
70242
70291
|
*
|
|
70243
|
-
* The
|
|
70292
|
+
* The M3.1 id used to be `MiniMax-M3.1-Flash-Preview`. MiniMax published
|
|
70244
70293
|
* `MiniMax-M3.1-Flash` (no suffix) and the preview id was measured answering
|
|
70245
70294
|
* 200 on the same day, so the catalog carries the GA name only. Anything still
|
|
70246
70295
|
* naming the preview id in a stored selection, a `provider/model` route string
|
|
@@ -70300,6 +70349,7 @@ const MINIMAX_CODE_MODELS = [
|
|
|
70300
70349
|
"max"
|
|
70301
70350
|
],
|
|
70302
70351
|
defaultReasoningEffort: null,
|
|
70352
|
+
supportsExplicitCache: false,
|
|
70303
70353
|
maxAttachments: 9,
|
|
70304
70354
|
maxImageBytes: 10 * 1024 * 1024,
|
|
70305
70355
|
maxVideoBytes: 50 * 1024 * 1024,
|
|
@@ -70326,11 +70376,40 @@ const MINIMAX_CODE_MODELS = [
|
|
|
70326
70376
|
"max"
|
|
70327
70377
|
],
|
|
70328
70378
|
defaultReasoningEffort: null,
|
|
70379
|
+
supportsExplicitCache: false,
|
|
70329
70380
|
maxAttachments: 4,
|
|
70330
70381
|
maxImageBytes: 10 * 1024 * 1024,
|
|
70331
70382
|
maxVideoBytes: 50 * 1024 * 1024,
|
|
70332
70383
|
filesApiDocumented: true,
|
|
70333
70384
|
description: "Flash model with a 1M context window. Thinking is forced on with a selectable effort level. Accepts up to 4 attachments."
|
|
70385
|
+
},
|
|
70386
|
+
{
|
|
70387
|
+
id: "MiniMax-M4",
|
|
70388
|
+
name: "MiniMax M4",
|
|
70389
|
+
contextWindow: 512e3,
|
|
70390
|
+
optionalContextWindow: 1e6,
|
|
70391
|
+
maxTokens: 262144,
|
|
70392
|
+
defaultMaxTokens: 131072,
|
|
70393
|
+
inputModalities: [
|
|
70394
|
+
"text",
|
|
70395
|
+
"image",
|
|
70396
|
+
"video"
|
|
70397
|
+
],
|
|
70398
|
+
thinking: "forced-effort",
|
|
70399
|
+
reasoningEfforts: [
|
|
70400
|
+
"low",
|
|
70401
|
+
"medium",
|
|
70402
|
+
"high",
|
|
70403
|
+
"xhigh",
|
|
70404
|
+
"max"
|
|
70405
|
+
],
|
|
70406
|
+
defaultReasoningEffort: null,
|
|
70407
|
+
supportsExplicitCache: false,
|
|
70408
|
+
maxAttachments: null,
|
|
70409
|
+
maxImageBytes: null,
|
|
70410
|
+
maxVideoBytes: null,
|
|
70411
|
+
filesApiDocumented: false,
|
|
70412
|
+
description: "2.74T-parameter MoE flagship with 66B active parameters, MSA2 and a 1M-token context window. Thinking is always on with a selectable effort level. Accepts text, image and video input."
|
|
70334
70413
|
}
|
|
70335
70414
|
];
|
|
70336
70415
|
const BY_ID = new Map(MINIMAX_CODE_MODELS.map((model) => [model.id, model]));
|
|
@@ -70439,6 +70518,23 @@ function contextWindowForModel(modelId, contextWindowOverrides) {
|
|
|
70439
70518
|
return fallback;
|
|
70440
70519
|
}
|
|
70441
70520
|
/**
|
|
70521
|
+
* The "everything enabled" selections shipped before M4.
|
|
70522
|
+
*
|
|
70523
|
+
* A stored list equal to one of these is still an untouched default, not an
|
|
70524
|
+
* explicit choice to keep the new model out. The current default is handled
|
|
70525
|
+
* separately from the live catalog size.
|
|
70526
|
+
*/
|
|
70527
|
+
const PREVIOUS_DEFAULT_MODEL_IDS = [[
|
|
70528
|
+
"MiniMax-M2.7",
|
|
70529
|
+
"MiniMax-M2.7-highspeed",
|
|
70530
|
+
"MiniMax-M3"
|
|
70531
|
+
], [
|
|
70532
|
+
"MiniMax-M2.7",
|
|
70533
|
+
"MiniMax-M2.7-highspeed",
|
|
70534
|
+
"MiniMax-M3",
|
|
70535
|
+
"MiniMax-M3.1-Flash"
|
|
70536
|
+
]];
|
|
70537
|
+
/**
|
|
70442
70538
|
* The catalog ids the user's stored selection actually resolves to.
|
|
70443
70539
|
*
|
|
70444
70540
|
* A stored list that still equals the shipped default has never been edited, so
|
|
@@ -70453,7 +70549,7 @@ function resolveMinimaxCodeEnabledModelIds(stored, enabled = true) {
|
|
|
70453
70549
|
const catalogIds = minimaxCodeModelIds();
|
|
70454
70550
|
const shipped = new Set(catalogIds);
|
|
70455
70551
|
const resolved = stored.map((id) => resolveMinimaxCodeModelId(id));
|
|
70456
|
-
if (resolved.length === shipped.size && resolved.every((id) => shipped.has(id))) return catalogIds;
|
|
70552
|
+
if (PREVIOUS_DEFAULT_MODEL_IDS.some((previous) => previous.length === resolved.length && previous.every((id) => resolved.includes(id))) || resolved.length === shipped.size && resolved.every((id) => shipped.has(id))) return catalogIds;
|
|
70457
70553
|
return [...new Set(resolved)].filter((id) => shipped.has(id));
|
|
70458
70554
|
}
|
|
70459
70555
|
/**
|
|
@@ -88244,7 +88340,7 @@ const GLM_MODEL_CATALOG = [
|
|
|
88244
88340
|
supportsImages: true,
|
|
88245
88341
|
defaultContextWindow: 1e6,
|
|
88246
88342
|
defaultMaxTokens: GLM5_MAX_OUTPUT,
|
|
88247
|
-
description: "旗舰模型,1M
|
|
88343
|
+
description: "旗舰模型,1M 上下文,Coding Plan 端点支持图片输入,强制思考。"
|
|
88248
88344
|
},
|
|
88249
88345
|
{
|
|
88250
88346
|
id: "GLM-5.3-Flash",
|
|
@@ -88268,7 +88364,19 @@ const GLM_MODEL_CATALOG = [
|
|
|
88268
88364
|
supportsImages: true,
|
|
88269
88365
|
defaultContextWindow: 1e6,
|
|
88270
88366
|
defaultMaxTokens: GLM5_MAX_OUTPUT,
|
|
88271
|
-
description: "上一代旗舰,1M
|
|
88367
|
+
description: "上一代旗舰,1M 上下文,Coding Plan 端点支持图片输入(新套餐会路由到 GLM-5.3)。"
|
|
88368
|
+
},
|
|
88369
|
+
{
|
|
88370
|
+
id: "GLM-5.1",
|
|
88371
|
+
name: "GLM-5.1",
|
|
88372
|
+
regions: BOTH,
|
|
88373
|
+
reasoningEfforts: [],
|
|
88374
|
+
thinkingDisableable: false,
|
|
88375
|
+
wire: "anthropic",
|
|
88376
|
+
supportsImages: false,
|
|
88377
|
+
defaultContextWindow: 202752,
|
|
88378
|
+
defaultMaxTokens: GLM5_MAX_OUTPUT,
|
|
88379
|
+
description: "上一代 GLM 模型,200K 上下文,纯文本输入。"
|
|
88272
88380
|
},
|
|
88273
88381
|
{
|
|
88274
88382
|
id: "GLM-5-Turbo",
|
|
@@ -88288,7 +88396,7 @@ const GLM_MODEL_IDS = GLM_MODEL_CATALOG.map((model) => model.id);
|
|
|
88288
88396
|
/**
|
|
88289
88397
|
* 首次安装默认勾选的模型。
|
|
88290
88398
|
*
|
|
88291
|
-
*
|
|
88399
|
+
* 刻意是全部行:这张表已经是 Coding Plan 面的模型全集(官方 builtin 配置公布的那一份),
|
|
88292
88400
|
* 藏掉任何一行都等于不给用户开启它的办法——与其如此,不如让用户在设置页里自己取消。
|
|
88293
88401
|
*/
|
|
88294
88402
|
const DEFAULT_VISIBLE_MODEL_IDS$4 = [...GLM_MODEL_IDS];
|
|
@@ -96049,9 +96157,10 @@ async function loadStepQuota(quotaCredential, profile, options = {}) {
|
|
|
96049
96157
|
/**
|
|
96050
96158
|
* Step 5 系列的官方规格(2026-11-30 读取)。
|
|
96051
96159
|
*
|
|
96052
|
-
*
|
|
96053
|
-
* - Step 5:1M 上下文、
|
|
96054
|
-
* - Step 5 Preview:1M
|
|
96160
|
+
* 官方模型页(托管 API):
|
|
96161
|
+
* - Step 5 GA:1M 上下文、65536 输出上限、text/image/video 输入、low/medium/high/xhigh/max。
|
|
96162
|
+
* - Step 5 Preview:1M 上下文;托管 API 输出上限 65536 与 low/medium/high。HF 权重卡的
|
|
96163
|
+
* 最大输出 1M 是自托管口径,不得覆盖托管 API 的 65536。
|
|
96055
96164
|
* - 两者都未声明可关闭思考;`max_tokens` 的官方默认值是 INF。
|
|
96056
96165
|
*
|
|
96057
96166
|
* 这张表**不是**随包目录:它只给运行时目录补能力,是否出现仍由 `/models` 决定。
|
|
@@ -96061,7 +96170,7 @@ const KNOWN_STEP_MODEL_FACTS = {
|
|
|
96061
96170
|
"step-5": {
|
|
96062
96171
|
name: "Step 5",
|
|
96063
96172
|
defaultContextWindow: 1e6,
|
|
96064
|
-
maxOutputTokens:
|
|
96173
|
+
maxOutputTokens: 65536,
|
|
96065
96174
|
reasoningEfforts: [
|
|
96066
96175
|
"low",
|
|
96067
96176
|
"medium",
|
|
@@ -96077,7 +96186,7 @@ const KNOWN_STEP_MODEL_FACTS = {
|
|
|
96077
96186
|
"step-5-preview": {
|
|
96078
96187
|
name: "Step 5 Preview",
|
|
96079
96188
|
defaultContextWindow: 1e6,
|
|
96080
|
-
maxOutputTokens:
|
|
96189
|
+
maxOutputTokens: 65536,
|
|
96081
96190
|
reasoningEfforts: [
|
|
96082
96191
|
"low",
|
|
96083
96192
|
"medium",
|
|
@@ -104260,23 +104369,35 @@ const STATIC_GLOBAL_SEEDS = [
|
|
|
104260
104369
|
name: "Auto",
|
|
104261
104370
|
reasoning: false,
|
|
104262
104371
|
supportsEffort: false,
|
|
104263
|
-
supportsImages:
|
|
104372
|
+
supportsImages: false,
|
|
104373
|
+
contextWindow: 2e5
|
|
104264
104374
|
},
|
|
104265
104375
|
{
|
|
104266
104376
|
id: "Ultimate",
|
|
104267
104377
|
upstreamKey: "ultimate",
|
|
104268
104378
|
name: "Ultimate",
|
|
104269
|
-
reasoning:
|
|
104270
|
-
supportsEffort:
|
|
104271
|
-
supportsImages:
|
|
104379
|
+
reasoning: false,
|
|
104380
|
+
supportsEffort: false,
|
|
104381
|
+
supportsImages: false,
|
|
104382
|
+
contextWindow: 2e5
|
|
104272
104383
|
},
|
|
104273
104384
|
{
|
|
104274
104385
|
id: "Performance",
|
|
104275
104386
|
upstreamKey: "performance",
|
|
104276
104387
|
name: "Performance",
|
|
104277
|
-
reasoning:
|
|
104278
|
-
supportsEffort:
|
|
104279
|
-
supportsImages:
|
|
104388
|
+
reasoning: false,
|
|
104389
|
+
supportsEffort: false,
|
|
104390
|
+
supportsImages: false,
|
|
104391
|
+
contextWindow: 2e5
|
|
104392
|
+
},
|
|
104393
|
+
{
|
|
104394
|
+
id: "Fast",
|
|
104395
|
+
upstreamKey: "fast",
|
|
104396
|
+
name: "Fast",
|
|
104397
|
+
reasoning: false,
|
|
104398
|
+
supportsEffort: false,
|
|
104399
|
+
supportsImages: false,
|
|
104400
|
+
contextWindow: 2e5
|
|
104280
104401
|
},
|
|
104281
104402
|
{
|
|
104282
104403
|
id: "Efficient",
|
|
@@ -104284,7 +104405,7 @@ const STATIC_GLOBAL_SEEDS = [
|
|
|
104284
104405
|
name: "Efficient",
|
|
104285
104406
|
reasoning: false,
|
|
104286
104407
|
supportsEffort: false,
|
|
104287
|
-
supportsImages:
|
|
104408
|
+
supportsImages: false,
|
|
104288
104409
|
contextWindow: 2e5
|
|
104289
104410
|
},
|
|
104290
104411
|
{
|
|
@@ -104407,7 +104528,7 @@ const STATIC_CN_SEEDS = [
|
|
|
104407
104528
|
name: "Auto",
|
|
104408
104529
|
reasoning: false,
|
|
104409
104530
|
supportsEffort: false,
|
|
104410
|
-
supportsImages:
|
|
104531
|
+
supportsImages: false,
|
|
104411
104532
|
contextWindow: 2e5
|
|
104412
104533
|
},
|
|
104413
104534
|
{
|
|
@@ -106023,6 +106144,11 @@ async function loadQoderQuota(credentials, options = {}) {
|
|
|
106023
106144
|
*
|
|
106024
106145
|
* @module dsh-chatgpt-subscription/qoder-mapper
|
|
106025
106146
|
*/
|
|
106147
|
+
const QODER_V41_FLASH_REPLAY_NAMES = /* @__PURE__ */ new Set([
|
|
106148
|
+
"DeepSeek-Flash",
|
|
106149
|
+
"DeepSeek-V4-Flash",
|
|
106150
|
+
"dfmodel"
|
|
106151
|
+
]);
|
|
106026
106152
|
const qoderReasoningDialect = new ReasoningKeyDialect$1();
|
|
106027
106153
|
function isRecord$47(value) {
|
|
106028
106154
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -106236,12 +106362,12 @@ function createQoderReplayDiagnostics() {
|
|
|
106236
106362
|
};
|
|
106237
106363
|
}
|
|
106238
106364
|
/**
|
|
106239
|
-
* Qoder 的 V4.1 Flash
|
|
106365
|
+
* Qoder 的 V4.1 Flash 实时目录叫 `DeepSeek-Flash`、兜底表叫 `DeepSeek-V4-Flash`,上行 key 是 `dfmodel`。
|
|
106240
106366
|
* 自有回放标记按上行 key 生成,示范信封按可见 id 生成;两者必须视为同一模型,
|
|
106241
106367
|
* 但仍只放行这一对已知别名,换到 Qwen/GLM/Kimi 时继续拒绝。
|
|
106242
106368
|
*/
|
|
106243
106369
|
function qoderReplayModelMatches(responseModel, model) {
|
|
106244
|
-
return responseModel === model || responseModel === "
|
|
106370
|
+
return responseModel === model || typeof responseModel === "string" && QODER_V41_FLASH_REPLAY_NAMES.has(responseModel) && QODER_V41_FLASH_REPLAY_NAMES.has(model);
|
|
106245
106371
|
}
|
|
106246
106372
|
/**
|
|
106247
106373
|
* 把助手消息拆成上游要的三段,并决定**这条消息的推理能不能回放**。
|
|
@@ -123804,6 +123930,12 @@ const DEEPSEEK_V41_FLASH_DISCIPLINE_TEXT = [
|
|
|
123804
123930
|
"",
|
|
123805
123931
|
"Before a change that other code or data may rely on (deleting, renaming, overwriting, or altering a signature, schema, or configuration), use tools to find what depends on the target and confirm those dependents still work afterward. Read-only checks are cheap here, so do not ration them. Runtime notices, guards, and failing tests arrive only after an action has happened; they are not a reason to skip a check before it.",
|
|
123806
123932
|
"",
|
|
123933
|
+
"Tool use is free or cheap in this session, and the budget is ample. Do not conserve reads, searches, tool calls, or verification to protect a budget; use as much support as the task needs, including parallel reads and repeated checks.",
|
|
123934
|
+
"",
|
|
123935
|
+
"Before a state-changing action—delete, rename, publish, submit, overwrite, or change a shared contract—name the immediate state it changes and one downstream effect it can trigger. If that effect is not written in the rules or visible in a tool result, run one minimal check instead of assuming it away.",
|
|
123936
|
+
"",
|
|
123937
|
+
"When you notice a risk you cannot handle now, put it in the task list with the condition that makes it urgent; do not leave it only in prose. A rule restated from memory is not evidence: verify an ambiguous limit with one minimal tool call.",
|
|
123938
|
+
"",
|
|
123807
123939
|
"When inspecting multiple files, searching symbols, or reading large logs, prefer one programmatic batch (`code_run` / `run_code`) or parallel read-only calls that return concise structured evidence rather than raw log dumps.",
|
|
123808
123940
|
"",
|
|
123809
123941
|
"Act as soon as you have a clear plan or verified evidence instead of re-deriving settled facts. If two consecutive attempts in the same direction add no new evidence or hit the same error, switch to minimal reproduction or inspect the underlying definition. Follow `[V4.1-Flash State Anchor]` notices to stay on the primary goal, and deliver once acceptance criteria are verified.",
|
|
@@ -124429,6 +124561,7 @@ function createSessionState$1() {
|
|
|
124429
124561
|
errorAnchorPending: false,
|
|
124430
124562
|
activeFiles: [],
|
|
124431
124563
|
taskLine: "",
|
|
124564
|
+
taskLineAgeSteps: 0,
|
|
124432
124565
|
compactionAnchorPending: false,
|
|
124433
124566
|
lastEffort: void 0,
|
|
124434
124567
|
lastEffortWarnedTransition: void 0,
|
|
@@ -124451,6 +124584,12 @@ function summarizeTodoItems(rawTodos) {
|
|
|
124451
124584
|
if (pending !== void 0 && label(pending).length > 0) parts.push(`NEXT: ${label(pending)}`);
|
|
124452
124585
|
return parts.join(" | ");
|
|
124453
124586
|
}
|
|
124587
|
+
/** 紧凑任务行里是否仍有未完成项。 */
|
|
124588
|
+
function hasOpenTaskLine(taskLine) {
|
|
124589
|
+
const match = /^(\d+)\/(\d+)\s+done/.exec(taskLine);
|
|
124590
|
+
if (match === null) return taskLine.length > 0;
|
|
124591
|
+
return Number(match[1]) < Number(match[2]);
|
|
124592
|
+
}
|
|
124454
124593
|
/** 把 `todo_write` 参数归纳成紧凑进度行:完成数/总数、进行中与下一项。 */
|
|
124455
124594
|
function summarizeTodos(args) {
|
|
124456
124595
|
if (!isRecord$29(args) || !Array.isArray(args["todos"])) return void 0;
|
|
@@ -124588,7 +124727,7 @@ function renderStateAnchorText(input) {
|
|
|
124588
124727
|
let remaining = MAX_ANCHOR_CHARS - fixed.reduce((sum, line) => sum + line.length + 1, 0);
|
|
124589
124728
|
let tasksLine;
|
|
124590
124729
|
if (input.tasks !== void 0 && input.tasks.length > 0) {
|
|
124591
|
-
const full = `TASKS: ${input.tasks}`;
|
|
124730
|
+
const full = `TASKS: ${input.taskStaleSteps !== void 0 && input.taskStaleSteps >= 8 && hasOpenTaskLine(input.tasks) ? `STALE ${String(input.taskStaleSteps)} steps; handle/update | ` : ""}${input.tasks}`;
|
|
124592
124731
|
if (full.length + 1 <= remaining) tasksLine = full;
|
|
124593
124732
|
else if (remaining - 1 >= 15) tasksLine = full.slice(0, remaining - 4).trimEnd() + "...";
|
|
124594
124733
|
if (tasksLine !== void 0) remaining -= tasksLine.length + 1;
|
|
@@ -124723,8 +124862,11 @@ function installDeepSeekV41FlashStateAnchor(ctx, options = {}) {
|
|
|
124723
124862
|
if (events !== void 0) recoverGoalFromEvents(state.goals, events, currentTurn);
|
|
124724
124863
|
}
|
|
124725
124864
|
const projectedTasks = readSessionTaskLine(host, payload?.agent);
|
|
124726
|
-
if (projectedTasks !== void 0
|
|
124727
|
-
|
|
124865
|
+
if (projectedTasks !== void 0 && projectedTasks !== state.taskLine) {
|
|
124866
|
+
state.taskLine = projectedTasks;
|
|
124867
|
+
state.taskLineAgeSteps = 0;
|
|
124868
|
+
} else if (hasOpenTaskLine(state.taskLine)) state.taskLineAgeSteps += 1;
|
|
124869
|
+
const hasOpenTasks = hasOpenTaskLine(state.taskLine);
|
|
124728
124870
|
let trigger;
|
|
124729
124871
|
let nextWatermarkIndex = state.crossedWatermarkIndex;
|
|
124730
124872
|
for (let i = state.crossedWatermarkIndex + 1; i < watermarks.length; i += 1) if (approxTokens >= watermarks[i]) nextWatermarkIndex = i;
|
|
@@ -124752,6 +124894,7 @@ function installDeepSeekV41FlashStateAnchor(ctx, options = {}) {
|
|
|
124752
124894
|
goal,
|
|
124753
124895
|
earlierGoal: earlierGoals(state.goals),
|
|
124754
124896
|
tasks: state.taskLine,
|
|
124897
|
+
taskStaleSteps: hasOpenTasks ? state.taskLineAgeSteps : 0,
|
|
124755
124898
|
activeFiles: state.activeFiles,
|
|
124756
124899
|
consecutiveErrors: state.consecutiveToolErrors,
|
|
124757
124900
|
lastErrorTool: state.lastErrorTool
|
|
@@ -124772,7 +124915,10 @@ function installDeepSeekV41FlashStateAnchor(ctx, options = {}) {
|
|
|
124772
124915
|
const failed = result?.isError === true || isRecord$29(decision) && decision["kind"] === "block";
|
|
124773
124916
|
if (!failed && exec?.name === "todo_write") {
|
|
124774
124917
|
const tasks = summarizeTodos(exec.arguments);
|
|
124775
|
-
if (tasks !== void 0)
|
|
124918
|
+
if (tasks !== void 0) {
|
|
124919
|
+
if (tasks !== state.taskLine) state.taskLineAgeSteps = 0;
|
|
124920
|
+
state.taskLine = tasks;
|
|
124921
|
+
}
|
|
124776
124922
|
}
|
|
124777
124923
|
if (exec?.parent !== void 0) return decision;
|
|
124778
124924
|
const targetFile = extractTargetFile$1(exec?.arguments);
|
|
@@ -126007,7 +126153,8 @@ function installOpenModelObservationGuard(ctx, options = {}) {
|
|
|
126007
126153
|
* 顺应三大开源模型物理阵营的共同约束:
|
|
126008
126154
|
* - **阵营 A(Kimi K3/K3.1 KDA+Gated DSA、Qwen GDN+QSA、GLM-5.3-Flash、Ling 7:1 KDA)**:
|
|
126009
126155
|
* 固定递推状态随超长对话发生覆写/混叠,NoPE + 稀疏索引强依赖显式文件路径与符号名;
|
|
126010
|
-
* - **阵营 B(GLM-5.2/5.3 IndexShare、MiniMax M3/M3.1 MSA
|
|
126156
|
+
* - **阵营 B(GLM-5.2/5.3 IndexShare、MiniMax M3/M3.1 MSA、MiniMax M4 MSA2、
|
|
126157
|
+
* DeepSeek V4 CSA+HCA、Hy4)**:
|
|
126011
126158
|
* 单步精确历史注意力预算约 ~2,048 tokens,高水位易失焦;
|
|
126012
126159
|
* - **阵营 C(Step-3.5/3.7 SWA W=512、Step-5 深窄网、MiMo-V2.6 SWA W=128)**:
|
|
126013
126160
|
* 局部滑窗极窄,超过 128–512 tokens 外的目标约束难以进入局部层。
|
|
@@ -126281,7 +126428,7 @@ function installOpenModelStateAnchor(ctx, options = {}) {
|
|
|
126281
126428
|
//#region src/host/runtime/open-models/index.ts
|
|
126282
126429
|
/**
|
|
126283
126430
|
* 开源模型运行时专项优化总成(Kimi K3/K3.1、GLM-5.x、DeepSeek-V4 Pro/Flash、
|
|
126284
|
-
* MiniMax M3/M3.1/M2.7、Qwen 3.5–4、Step 3.5–5、MiMo V2.6、Ling 3.1、Hunyuan Hy4、
|
|
126431
|
+
* MiniMax M4/M3/M3.1/M2.7、Qwen 3.5–4、Step 3.5–5、MiMo V2.6、Ling 3.1、Hunyuan Hy4、
|
|
126285
126432
|
* LongCat 2.0 及 Ollama 本地推理模型)。
|
|
126286
126433
|
*
|
|
126287
126434
|
* 采用「共享物理架构积木 + 模型手术刀级专属补丁」两层设计:
|
|
@@ -126292,8 +126439,7 @@ function installOpenModelStateAnchor(ctx, options = {}) {
|
|
|
126292
126439
|
* 3. **入库前观测头 + Kimi 只读空转提醒 + ESC ANSI 清洗 + 非受控失控提醒**(`observation-guard.ts`);
|
|
126293
126440
|
* 4. **按模型精准门控的无损双信号推理坍塌守卫**(复用 `reasoning-collapse-guard`)。
|
|
126294
126441
|
*
|
|
126295
|
-
* 严格排除 DeepSeek V4.1 Flash
|
|
126296
|
-
* (Claude / GPT-5 / GPT-6 / Gemini / Grok)。
|
|
126442
|
+
* 严格排除 DeepSeek V4.1 Flash(由专属模块负责)以及所有未登记或动态未知模型。
|
|
126297
126443
|
*
|
|
126298
126444
|
* @module @eddyskywalker/dsh-chatgpt-subscription/host/open-models
|
|
126299
126445
|
*/
|
|
@@ -128550,15 +128696,15 @@ const FALLBACK_MODELS$1 = [
|
|
|
128550
128696
|
{
|
|
128551
128697
|
id: "default-model",
|
|
128552
128698
|
name: "Auto",
|
|
128553
|
-
contextWindow:
|
|
128554
|
-
maxContextWindow:
|
|
128555
|
-
maxTokens:
|
|
128699
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
128700
|
+
maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
128701
|
+
maxTokens: FALLBACK_MAX_TOKENS,
|
|
128556
128702
|
regions: ["intl"],
|
|
128557
|
-
supportsImage:
|
|
128703
|
+
supportsImage: false,
|
|
128558
128704
|
reasoningEfforts: [],
|
|
128559
128705
|
defaultReasoningEffort: null,
|
|
128560
128706
|
canDisableThinking: false,
|
|
128561
|
-
description: "
|
|
128707
|
+
description: "动态路由,具体后端由订阅决定"
|
|
128562
128708
|
},
|
|
128563
128709
|
{
|
|
128564
128710
|
id: "fast-model",
|
|
@@ -129288,24 +129434,24 @@ const FALLBACK_MODELS$1 = [
|
|
|
129288
129434
|
},
|
|
129289
129435
|
{
|
|
129290
129436
|
id: "hy4-preview-x",
|
|
129291
|
-
name: "
|
|
129292
|
-
contextWindow:
|
|
129293
|
-
maxContextWindow:
|
|
129294
|
-
maxTokens:
|
|
129437
|
+
name: "hy4-preview-x",
|
|
129438
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129439
|
+
maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129440
|
+
maxTokens: FALLBACK_MAX_TOKENS,
|
|
129295
129441
|
regions: ["cn"],
|
|
129296
129442
|
credits: { cn: "0.29" },
|
|
129297
|
-
supportsImage:
|
|
129298
|
-
reasoningEfforts: [
|
|
129299
|
-
defaultReasoningEffort:
|
|
129443
|
+
supportsImage: false,
|
|
129444
|
+
reasoningEfforts: [],
|
|
129445
|
+
defaultReasoningEffort: null,
|
|
129300
129446
|
canDisableThinking: false,
|
|
129301
|
-
description: "
|
|
129447
|
+
description: ""
|
|
129302
129448
|
},
|
|
129303
129449
|
{
|
|
129304
129450
|
id: "hunyuan-chat",
|
|
129305
|
-
name: "
|
|
129306
|
-
contextWindow:
|
|
129307
|
-
maxContextWindow:
|
|
129308
|
-
maxTokens:
|
|
129451
|
+
name: "hunyuan-chat",
|
|
129452
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129453
|
+
maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129454
|
+
maxTokens: FALLBACK_MAX_TOKENS,
|
|
129309
129455
|
regions: ["cn"],
|
|
129310
129456
|
credits: { cn: "0.10" },
|
|
129311
129457
|
supportsImage: false,
|
|
@@ -129372,45 +129518,45 @@ const FALLBACK_MODELS$1 = [
|
|
|
129372
129518
|
},
|
|
129373
129519
|
{
|
|
129374
129520
|
id: "hy4std",
|
|
129375
|
-
name: "
|
|
129376
|
-
contextWindow:
|
|
129377
|
-
maxContextWindow:
|
|
129378
|
-
maxTokens:
|
|
129521
|
+
name: "hy4std",
|
|
129522
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129523
|
+
maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129524
|
+
maxTokens: FALLBACK_MAX_TOKENS,
|
|
129379
129525
|
regions: ["cn"],
|
|
129380
129526
|
credits: { cn: "0.29" },
|
|
129381
|
-
supportsImage:
|
|
129382
|
-
reasoningEfforts: [
|
|
129383
|
-
defaultReasoningEffort:
|
|
129527
|
+
supportsImage: false,
|
|
129528
|
+
reasoningEfforts: [],
|
|
129529
|
+
defaultReasoningEffort: null,
|
|
129384
129530
|
canDisableThinking: false,
|
|
129385
|
-
description: "
|
|
129531
|
+
description: ""
|
|
129386
129532
|
},
|
|
129387
129533
|
{
|
|
129388
129534
|
id: "hy4flash-free",
|
|
129389
|
-
name: "
|
|
129390
|
-
contextWindow:
|
|
129391
|
-
maxContextWindow:
|
|
129392
|
-
maxTokens:
|
|
129535
|
+
name: "hy4flash-free",
|
|
129536
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129537
|
+
maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129538
|
+
maxTokens: FALLBACK_MAX_TOKENS,
|
|
129393
129539
|
regions: ["cn"],
|
|
129394
129540
|
credits: { cn: "0.00" },
|
|
129395
|
-
supportsImage:
|
|
129396
|
-
reasoningEfforts: [
|
|
129397
|
-
defaultReasoningEffort:
|
|
129541
|
+
supportsImage: false,
|
|
129542
|
+
reasoningEfforts: [],
|
|
129543
|
+
defaultReasoningEffort: null,
|
|
129398
129544
|
canDisableThinking: false,
|
|
129399
|
-
description: "
|
|
129545
|
+
description: ""
|
|
129400
129546
|
},
|
|
129401
129547
|
{
|
|
129402
129548
|
id: "hy4flash",
|
|
129403
|
-
name: "
|
|
129404
|
-
contextWindow:
|
|
129405
|
-
maxContextWindow:
|
|
129406
|
-
maxTokens:
|
|
129549
|
+
name: "hy4flash",
|
|
129550
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129551
|
+
maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
|
|
129552
|
+
maxTokens: FALLBACK_MAX_TOKENS,
|
|
129407
129553
|
regions: ["cn"],
|
|
129408
129554
|
credits: { cn: "0.03" },
|
|
129409
|
-
supportsImage:
|
|
129410
|
-
reasoningEfforts: [
|
|
129411
|
-
defaultReasoningEffort:
|
|
129555
|
+
supportsImage: false,
|
|
129556
|
+
reasoningEfforts: [],
|
|
129557
|
+
defaultReasoningEffort: null,
|
|
129412
129558
|
canDisableThinking: false,
|
|
129413
|
-
description: "
|
|
129559
|
+
description: ""
|
|
129414
129560
|
}
|
|
129415
129561
|
];
|
|
129416
129562
|
/**
|