@eddyskywalker/dsh-chatgpt-subscription 0.97.2 → 0.97.3

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/index.js CHANGED
@@ -885,7 +885,7 @@ const ROUTE_PREFIX$6 = "/api/dsh-chatgpt-subscription";
885
885
  * `test/responses-client.test.ts` asserts the two agree, so a release that
886
886
  * forgets this constant fails the suite instead of shipping quietly.
887
887
  */
888
- const PLUGIN_VERSION = "0.97.2";
888
+ const PLUGIN_VERSION = "0.97.3";
889
889
  const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
890
890
  const CODEX_API_BASE = "https://chatgpt.com/backend-api/codex";
891
891
  const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses`;
@@ -119306,24 +119306,72 @@ function installDeepSeekV41FlashOptimizations(ctx, options = {}) {
119306
119306
  /** 示范消息 id 前缀;用于识别已插入的示范,避免重复插入。 */
119307
119307
  const REASONING_SEED_ID_PREFIX = "dsh-reasoning-seed-";
119308
119308
  /** 固定示范正文。改动它会让所有已开启会话的前缀缓存失效一次。 */
119309
- const REASONING_SEED_EXCHANGES = Object.freeze([{
119310
- user: "Session warm-up, not a task; the real request follows. Note how you will work in this session, then reply with one word.",
119311
- reasoning: [
119312
- "Warm-up only, real task comes next. Plan for session: read request, locate exact files/symbols first. Batch independent reads in one program, return concise evidence.",
119313
- "Checkable facts -> check via tools, not guess. Think in short notes, keep only decision-relevant points; no restating rules or user text.",
119314
- "Before negative claim, run cheap check that could flip it. Before edit/rename/delete, find dependents. Evidence enough -> act, no repeated read loops. Same error twice -> switch approach.",
119315
- "Final answer: full sentences, user language. Now reply one word."
119316
- ].join("\n"),
119317
- reply: "Ready."
119318
- }, {
119319
- user: "Warm-up 2, not a task: in one sentence, how would you approach tests failing right after a config key rename?",
119320
- reasoning: [
119321
- "Rename regression. Likely stale refs: code, tests, fixtures, schema defaults, docs. Grep old key whole repo incl json/yaml.",
119322
- "Existing user configs still carry old key -> need migration or alias, else silent default. Then typecheck + affected tests; full suite if shared type. No weakening asserts.",
119323
- "Answer one sentence."
119324
- ].join("\n"),
119325
- reply: "Search the old key across code, fixtures and docs, add a migration or alias for existing configs, then run the typecheck and the affected tests."
119326
- }]);
119309
+ const REASONING_SEED_EXCHANGES = Object.freeze([
119310
+ {
119311
+ user: "Practice round 1, unrelated to the real request: plan the next move.",
119312
+ reasoning: ["I need modify repo host? User asks helper timeout too short run_code cancellation increase only helper. Should inspect relevant code. Must Chinese progress updates all. Should triage likely L1 maybe harness repo or plugin? Screenshot run_code program timeout 120000, tool call helper aborted. Should locate helper tool invocation and timeout. Current cwd plugin but helper configured host? User specifically 顾问(run_code)等待时间太短. Likely host harness consult_helper nested call timeout tied run_code deadline default 120s. Should fix in host implementation checkout? User asks can only helper increase wait. I should implement. Should load official-tools? Task is develop host itself in repo? User requests capability change helper wait, official-tools description says \"Check host’s plugins when user asks how to do something in this app... capability missing should change... Not a request to develop host, even in its repo: load before reading files.\" This is develop host behavior, not plugins? It says load before reading files for capability change. Should load official-tools first? But task about helper, not listed specifically. General app capability missing/change yes. Also current repo plugin may implement helper? Should inspect. Before substantive work helper required. I can first orientation read files then helper. Should progress opening before first tool L1/L2 multi. I'll say plan Chinese. Then call skill official-tools and perhaps code_tools search/read. Should know available tools. Could batch pwd, skill, grep relevant in two repos? Skills must before actions. One run_code with skill official-tools only maybe then inspect."].join("\n"),
119313
+ reply: "Plan noted."
119314
+ },
119315
+ {
119316
+ user: "Practice round 2, unrelated to the real request: plan the next move.",
119317
+ reasoning: ["No plugin fit. Should inspect host and current plugin perhaps helper implemented by preset not source? Search both for consult_helper, run_code timeout. Use tools.grep path absolute. Also git status both to avoid clobber. tools.win_bash available likely. Can batch greps and status. Perhaps list tool names? grep known."].join("\n"),
119318
+ reply: "Plan noted."
119319
+ },
119320
+ {
119321
+ user: "Practice round 3, unrelated to the real request: plan the next move.",
119322
+ reasoning: ["Advisor in plugin not harness. Now search plugin src for helper files. Glob. Also run_code implementation likely plugin src/host/runtime/code-mode or host package. Since helper own plugin can nested call perhaps registered tool. Should timeout behavior. Search in plugin for \"helper\" paths and code run."].join("\n"),
119323
+ reply: "Plan noted."
119324
+ },
119325
+ {
119326
+ user: "Practice round 4, unrelated to the real request: plan the next move.",
119327
+ reasoning: ["I have config helperTimeoutMs max 300000 default. Outer run_code default 120000 kills. Should only helper wait longer likely code-mode should dynamically extend outer deadline when nested tool has timeoutMs metadata > remaining? Should inspect code-mode implementation and helper registration. Search precise files. src/index huge around helper registration. grep CONSULT... references."].join("\n"),
119328
+ reply: "Plan noted."
119329
+ },
119330
+ {
119331
+ user: "Practice round 5, unrelated to the real request: plan the next move.",
119332
+ reasoning: ["No dynamic extension. Perhaps top-level run_code tool timeoutMs set 600000 max but default 120000. Could change preset prompt instruct agents when helper call inside run_code set timeoutMs 600000? But screenshot shows run_code from preset invoked no timeoutMs. User wants only helper. Easiest change default run_code timeout to 305000? affects all. Not desired. Could register separate native consult_helper already available. But screenshot model chose run_code wrapping helper because instructions perhaps helper in native whitelist but call inside? It used tools.consult_helper. I can modify code-mode to detect program contains consult_helper and set outer timeout? Bad parsing/hack. Better API supports per-nested tool extending parent deadline? Should inspect harness PTC runtime to see timeout dynamic. Perhaps tool executor has timeoutMs from metadata and parent signal abort cannot extend. Should change run_code tool default timeout based on static analysis? Could expose config codeMode default timeout. User specifically only helper could make tool call in program direct native recommended; but model still may wrap. I can add prompt instruct \"When calling consult_helper inside run_code, set timeoutMs: 600000\". That is only prompt and no code behavior guarantee. User asks can only helper increase. I should likely implement automatic timeout oversight. Should understand architecture and intended mechanism perhaps `defineTool` timeoutMs supports function args? code-mode registration around 650. Read 620-740."].join("\n"),
119333
+ reply: "Plan noted."
119334
+ },
119335
+ {
119336
+ user: "Practice round 6, unrelated to the real request: plan the next move.",
119337
+ reasoning: ["Definition no timeoutMs means harness default 120s tool execution. PTC own timeout default 120. Outer tool timeout perhaps run_code registration defaults 120. I need set `timeoutMs` dynamically on definition impossible args function perhaps can be number or function? Could set 305000 for run_code but affects all outer tool though inner runtime still 120; only outer allowance no effect ordinary because PTC timer still 120. For helper need PTC timeout too. Could detect code string for helper then pass default 305000 into runtime spec. That would only extend helper-containing programs. Should explicit user timeout override respected. I can derive `timeoutMs = input.timeoutMs ?? (usesAdvisor(input.code) ? 305000 : undefined)` and definition `timeoutMs: 305000` to prevent outer tool kill. Ordinary code unaffected inner default. Advisor-containing entire program gets 305s (not only subcall technically but targeted). Better dynamic nested extension impossible after tool starts due outer signal fixed. Static detection of `tools.consult_helper` robust enough. Could use parser? Simple regex perhaps comments false positives only extends timeout no semantics risk. Should have no new cross module contract. Tests. However user asks only helper increase wait. Could perhaps set run_code `timeoutMs: 305000`, and in execute auto timeout when code includes exact `consult_helper`. This is 2 files + tests. But tool default max 600000. Advisor 305000 hardcoded currently. I can export constant from helper? transport importing helper contracts may coupling but same plugin. Better use tool catalog metadata to identify entry timeoutMs dynamically, not hardcode tool name? CatalogEntry includes definition timeoutMs? Read types top and toCatalogEntry."].join("\n"),
119338
+ reply: "Plan noted."
119339
+ },
119340
+ {
119341
+ user: "Practice round 7, unrelated to the real request: plan the next move.",
119342
+ reasoning: ["Advisor disabled, proceed own judgment. Should check harness defineTool timeoutMs perhaps maximum and run_code default. Setting outer 305000 means if PTC runtime default 120 ordinary unchanged. Explicit user up to 600000 currently outer tool if fixed 305000 would break explicit 600000! Currently definition no timeoutMs likely default 120000 yet tool caller explicit 600000 gets outer killed at 120? Existing bug perhaps. If set outer timeoutMs 605000 or 600000 to allow max explicit, then ordinary inner still 120. Advisor auto 305. Better set run_code timeoutMs equal runtime max 600000? Tool schema default outer 120 now issue for any explicit >120. Could set 600000; but requested only helper, outer ordinary remains inner 120 so no effective change. However if runtime.timeout missing/unsupported older runtime, outer may run longer than before. Could use 305000 to match helper but explicit >305 currently allowed and expected cap 600. So choose 600000 outer (or 605000 grace) and auto only helper. But user asked only helper; outer timeout metadata broad but actual defaults unchanged. Could avoid static by `timeoutMs: 305000` and cap explicit? Not good. Another mechanism defineTool timeoutMs can function? Should inspect harness tool definition types. Search `timeoutMs?: number |` and tool defaults."].join("\n"),
119343
+ reply: "Plan noted."
119344
+ },
119345
+ {
119346
+ user: "Practice round 8, unrelated to the real request: plan the next move.",
119347
+ reasoning: [
119348
+ "Should act. But should consider better design than source detection. Could define transport tool outer 305000 and adjust request timeout if code includes `consult_helper`. I should perhaps use shared constant ADVISOR_DEFAULT_TIMEOUT_MS + grace 5000. Import constant into transport creates host/runtime/code-mode -> shared helper no circular. `ADVISOR_DEFAULT_TIMEOUT_MS` default but user can configure lower; auto always 305 is okay maximum not exact. User asked increase only helper, default 300. Could export `ADVISOR_TOOL_TIMEOUT_MS = 305000` shared and use in helper + transport to single source. That changes 3 source files + test, within L1 cap 5. Could keep local `const ADVISOR_TRANSPORT_TIMEOUT_MS = 305_000` in transport and helper remains duplicate existing 305000. Better shared constant to avoid drift. Add `ADVISOR_TOOL_TIMEOUT_MS = ADVISOR_DEFAULT_TIMEOUT_MS + 5_000`. import in helper index and transport. Definition `timeoutMs: 600000?` If shared 305000 then explicit timeout issue. Could dynamically outer timeout impossible. Set transport outer 600000 existing PTC max, but tests may assert property? Add `const TRANSPORT_TOOL_TIMEOUT_MS = 600_000` perhaps now external code can wait 600 if runtime no default. Yet PTC default covers current. Better outer `timeoutMs: ADVISOR_TOOL_TIMEOUT_MS` and user explicit up to 600 would still outer cut at 305, an existing outer cut at 120 improved but not full. No regression relative current. But if explicit 600 user expects 600 and still fails at 305. Not scope. Could set outer 600000 to honor schema. That is logically correct general fix, though user only wants helper default extension. I can explain outer ceiling raised but effective regular stays default. Tests test outer 600000 maybe. However tool execution pipeline default 120; setting 600 is necessary for explicit values. Good.",
119349
+ "",
119350
+ "Static detection robust: use regex `/\\btools\\s*\\.\\s*consult_helper\\s*\\(/` or string `.includes('tools.consult_helper')` screenshot exact. Could also alias `const { consult_helper } = tools; await consult_helper` won't detect. Primary syntax standard. Could detect catalog entry and code via member expression regex allowing whitespace and bracket notation `tools['consult_helper']`. I can do simple regex. False positives comments only extend. No security. Name constant. `effectiveTimeoutMs= input.timeoutMs ?? (hasAdvisorCall(sanitizedCode) ? ADVISOR_TOOL_TIMEOUT_MS : undefined)`; PTC 305000 vs internal 300. Outer 600. If user configured helper timeout 1000 still outer 305 but request returns earlier. Fine. If user explicit 120 still overridden? no.",
119351
+ "",
119352
+ "Potential native consult_helper direct already uses 305 and unaffected. Only nested.",
119353
+ "",
119354
+ "Should test direct `definition.timeoutMs` property and request. Add 3 tests maybe one test with 3 calls? Keep small. Could insert after old runtime test. Use helper maybe repeated host. I can write test `it('顾问子调用自动使用顾问期限,普通程序和显式期限不变', async () => { const requests...; const host catalog include consult_helper? For code runtime run doesn't execute code, catalog not relevant detection source only. Should include to mirror. `runtime.resolve req=>({...req, timeoutMs: req.timeoutMs ?? 120000})`, run pushes spec. execute helper no actual tool call because runtime stub. Then ordinary and explicit. Assert specs [305000,120000,45000], definition.timeoutMs 600000. Good one test. But if request timeout assigned before resolve, seen. `code: \"const result = await tools.consult_helper({ question: 'review' })\"`. `description`. No actual tool invoke. Good.",
119355
+ "",
119356
+ "Now apply patch. Read exact helper imports and shared file known. Transport import top to place."
119357
+ ].join("\n"),
119358
+ reply: "Plan noted."
119359
+ },
119360
+ {
119361
+ user: "Practice round 9, unrelated to the real request: plan the next move.",
119362
+ reasoning: [
119363
+ "Implement via apply_patch. Should have tool apply_patch available program-only. Use tools.apply_patch with patch string. Should ordinary string not template raw except backslashes. Can use array lines joined. Easier tools.edit sequential? 4 files changes. Prefer apply_patch. Build patch string array. Include import shared, constants, definition timeoutMs, request. helper import constant and timeout. tests. Perhaps helper function `hasAdvisorCall` near constants. Regex no backslash if use string? RegExp constructor? Literal `/\\btools.../` in patch backslashes need escape JSON but tool program string array handles `\\\\b`. Could avoid regex and exact code `sanitizedCode.includes('tools.consult_helper')` standard syntax enough. But allows whitespace not necessary. Requirement screenshot exact. Use regex simple `/\\btools\\s*\\.\\s*consult_helper\\s*\\(/`. Add `const ADVISOR_CALL_PATTERN = /\\btools\\s*\\.\\s*consult_helper\\s*\\(/` and `const TRANSPORT_TOOL_TIMEOUT_MS = 600_000`. Comment why. Could use shared `ADVISOR_TOOL_TIMEOUT_MS`. Definition timeout 600. Request `const timeoutMs = input.timeoutMs ?? (ADVISOR_CALL_PATTERN.test(sanitizedCode) ? ADVISOR_TOOL_TIMEOUT_MS : undefined)` before request. Regex no global so safe. Spread timeoutMs.",
119364
+ "",
119365
+ "Test expects outer 600. Add after legacy test. Should have exact context. Use apply_patch."
119366
+ ].join("\n"),
119367
+ reply: "Plan noted."
119368
+ },
119369
+ {
119370
+ user: "Practice round 10, unrelated to the real request: plan the next move.",
119371
+ reasoning: ["apply_patch args input not patch. Tool schema hidden discovery. Error clear required input. I can call apply_patch({input: patch}) using retained patch variable? Top-level const patch persisted despite failed? run_code exception variables perhaps yes. Use `await tools.apply_patch({input: patch})`. This is changed args based evidence, okay."].join("\n"),
119372
+ reply: "Plan noted."
119373
+ }
119374
+ ]);
119327
119375
  const NATIVE_PROVIDERS = /* @__PURE__ */ new Set([
119328
119376
  "deepseek-official",
119329
119377
  "deepseek-account",
@@ -119403,10 +119451,13 @@ function isSeed(message) {
119403
119451
  return typeof message?.id === "string" && message.id.startsWith("dsh-reasoning-seed-");
119404
119452
  }
119405
119453
  /**
119406
- * 把示范插到前导 system 消息之后、第一条用户消息之前。
119454
+ * 把固定示范分散到对话中:首条用户消息前插入
119455
+ * {@link REASONING_SEED_INITIAL_EXCHANGES} 组,之后每隔
119456
+ * {@link REASONING_SEED_MESSAGE_STRIDE} 条原始消息再插入一组,最多用完示范列表。
119407
119457
  *
119408
- * 前导段之后若不是用户消息(例如开头就有 developer 工具变更),按原样返回:
119409
- * 这类请求的顺序约束因适配器而异,宁可不插也不改变既有语义。
119458
+ * 插入位置只由原始消息序号决定。历史增长不会移动旧示范,因此已有前缀缓存保持命中;
119459
+ * 同时较近的示范能对抗模型近期长思考的自我强化。工具调用与其结果之间不插入。
119460
+ * 前导段之后若不是用户消息(例如开头就有 developer 工具变更),按原样返回。
119410
119461
  * @param messages - 本次请求的消息。
119411
119462
  * @param provider - 线路 id。
119412
119463
  * @param model - 模型 id。
@@ -119419,11 +119470,31 @@ function insertReasoningSeed(messages, provider, model) {
119419
119470
  if (messages[index]?.role !== "user") return messages;
119420
119471
  const seed = buildReasoningSeedMessages(provider, model);
119421
119472
  if (seed.length === 0) return messages;
119422
- return [
119423
- ...messages.slice(0, index),
119424
- ...seed,
119425
- ...messages.slice(index)
119426
- ];
119473
+ const out = [...messages.slice(0, index)];
119474
+ const exchanges = REASONING_SEED_EXCHANGES.length;
119475
+ let exchange = 0;
119476
+ const insertNext = () => {
119477
+ if (exchange >= exchanges) return;
119478
+ out.push(...seed.slice(exchange * 2, exchange * 2 + 2));
119479
+ exchange += 1;
119480
+ };
119481
+ for (let initial = 0; initial < 5; initial += 1) insertNext();
119482
+ let sinceSeed = 0;
119483
+ for (; index < messages.length; index += 1) {
119484
+ const message = messages[index];
119485
+ if (message.role === "tool") {
119486
+ out.push(message);
119487
+ continue;
119488
+ }
119489
+ sinceSeed += 1;
119490
+ if (sinceSeed >= 2) {
119491
+ insertNext();
119492
+ sinceSeed = 0;
119493
+ }
119494
+ out.push(message);
119495
+ }
119496
+ if (sinceSeed >= 2 && messages.at(-1)?.role === "tool") insertNext();
119497
+ return out;
119427
119498
  }
119428
119499
  /** 读取实验开关(兼容 volatile 活引用与普通布尔值);默认关闭。 */
119429
119500
  function resolveDeepSeekV41FlashReasoningSeedEnabled(config) {
@@ -137589,7 +137660,7 @@ const Config = z$1.object({
137589
137660
  teamPolicyCacheGuard: z$1.boolean().default(true).volatile().description("保持 Agent Teams 系统提示稳定,切换团队开关时不重建前缀缓存。"),
137590
137661
  timelineCacheGuard: z$1.boolean().default(true).volatile().description("保持 Timeline 系统提示与工具描述稳定,避免中途变更使前缀缓存失效。"),
137591
137662
  deepseekV41FlashOptimization: z$1.boolean().default(true).volatile().description("启用 DeepSeek V4.1 Flash 的上下文稳定性与推理防坍塌优化。"),
137592
- deepseekV41FlashReasoningSeed: z$1.boolean().default(false).volatile().description("实验性:让 DeepSeek V4.1 Flash 改用更精简的笔记式思考。部分线路不支持;在会话中途切换会让一次缓存失效。"),
137663
+ deepseekV41FlashReasoningSeed: z$1.boolean().default(false).volatile().description("实验性:让 DeepSeek V4.1 Flash 改用更精简的笔记式思考。新会话从头开启最稳定;部分线路不支持,中途切换会让一次缓存失效。"),
137593
137664
  openModelsOptimization: z$1.boolean().default(true).volatile().description("启用开源模型家族的运行时稳定性与前缀缓存保护(不影响闭源模型)。"),
137594
137665
  cacheWarmup: z$1.boolean().default(true).volatile().description(CACHE_WARMUP_SETTING_DESCRIPTION),
137595
137666
  cacheWarmupProviders: z$1.array(z$1.string()).default(CONTROLLED_PROVIDERS).volatile().description("启用大结果预览投影的线路列表;留空数组表示全部关闭。"),
@@ -64,7 +64,7 @@ export declare const zh: {
64
64
  readonly settingsCacheWaitWarmupName: "等待缓存续热";
65
65
  readonly settingsCacheWaitWarmupNote: "等待子代理或后台任务期间,在缓存到期前 5 分钟轻量续热;默认用于 Kimi 以及两条 Claude 线路的 1 小时缓存档,其他线路需明确 TTL 并显式启用";
66
66
  readonly settingsReasoningSeedName: "精简思考示范";
67
- readonly settingsReasoningSeedNote: "实验性:在 DeepSeek V4.1 Flash 请求前附一段固定的笔记式思考示范,让模型改用更精简的推理;只对能回传历史思考的线路生效,示范不写入会话";
67
+ readonly settingsReasoningSeedNote: "实验性:在 DeepSeek V4.1 Flash 对话中按固定间隔插入笔记式思考示范,让模型改用更精简的推理;新会话从头开启最稳定,示范不写入会话";
68
68
  readonly settingsCacheAffinityName: "账号缓存亲和";
69
69
  readonly settingsCacheAffinityNote: "多账号轮换时优先选前缀仍热的账号,低额度时让位;默认用于 Kimi,其他线路需证明账号级缓存并显式启用";
70
70
  readonly settingsPlanModePipelineName: "计划模式管线";
@@ -157,7 +157,7 @@ export declare const dictionaries: {
157
157
  readonly settingsCacheWaitWarmupName: "等待缓存续热";
158
158
  readonly settingsCacheWaitWarmupNote: "等待子代理或后台任务期间,在缓存到期前 5 分钟轻量续热;默认用于 Kimi 以及两条 Claude 线路的 1 小时缓存档,其他线路需明确 TTL 并显式启用";
159
159
  readonly settingsReasoningSeedName: "精简思考示范";
160
- readonly settingsReasoningSeedNote: "实验性:在 DeepSeek V4.1 Flash 请求前附一段固定的笔记式思考示范,让模型改用更精简的推理;只对能回传历史思考的线路生效,示范不写入会话";
160
+ readonly settingsReasoningSeedNote: "实验性:在 DeepSeek V4.1 Flash 对话中按固定间隔插入笔记式思考示范,让模型改用更精简的推理;新会话从头开启最稳定,示范不写入会话";
161
161
  readonly settingsCacheAffinityName: "账号缓存亲和";
162
162
  readonly settingsCacheAffinityNote: "多账号轮换时优先选前缀仍热的账号,低额度时让位;默认用于 Kimi,其他线路需证明账号级缓存并显式启用";
163
163
  readonly settingsPlanModePipelineName: "计划模式管线";
@@ -246,7 +246,7 @@ export declare const dictionaries: {
246
246
  readonly settingsCacheWaitWarmupName: "等待缓存续热";
247
247
  readonly settingsCacheWaitWarmupNote: "等待子代理或后台任务期间,在缓存到期前 5 分钟轻量续热;默认用于 Kimi 以及两条 Claude 线路的 1 小时缓存档,其他线路需明确 TTL 并显式启用";
248
248
  readonly settingsReasoningSeedName: "精简思考示范";
249
- readonly settingsReasoningSeedNote: "实验性:在 DeepSeek V4.1 Flash 请求前附一段固定的笔记式思考示范,让模型改用更精简的推理;只对能回传历史思考的线路生效,示范不写入会话";
249
+ readonly settingsReasoningSeedNote: "实验性:在 DeepSeek V4.1 Flash 对话中按固定间隔插入笔记式思考示范,让模型改用更精简的推理;新会话从头开启最稳定,示范不写入会话";
250
250
  readonly settingsCacheAffinityName: "账号缓存亲和";
251
251
  readonly settingsCacheAffinityNote: "多账号轮换时优先选前缀仍热的账号,低额度时让位;默认用于 Kimi,其他线路需证明账号级缓存并显式启用";
252
252
  readonly settingsPlanModePipelineName: "计划模式管线";
@@ -76,7 +76,7 @@ export declare const ROUTE_PREFIX: "/api/dsh-chatgpt-subscription";
76
76
  * `test/responses-client.test.ts` asserts the two agree, so a release that
77
77
  * forgets this constant fails the suite instead of shipping quietly.
78
78
  */
79
- export declare const PLUGIN_VERSION: "0.97.2";
79
+ export declare const PLUGIN_VERSION: "0.97.3";
80
80
  export declare const CODEX_CHATGPT_PROVIDER_ID: "codex-chatgpt";
81
81
  export { MINIMAX_CODE_PROVIDER_ID, MINIMAX_CODE_ROUTE_PREFIX } from './shared/minimax-code-contracts.ts';
82
82
  export declare const CODEX_API_BASE: "https://chatgpt.com/backend-api/codex";
@@ -49,11 +49,18 @@ export interface SeedMessage {
49
49
  * @returns 交替排列的用户与助手示范消息;线路无法承载时为空数组。
50
50
  */
51
51
  export declare function buildReasoningSeedMessages(provider: string, model: string): SeedMessage[];
52
+ /** 首条用户消息前插入的示范组数;首步需要足够剂量建立写法。 */
53
+ export declare const REASONING_SEED_INITIAL_EXCHANGES = 5;
54
+ /** 首组之后,每经过多少条原始对话消息再插入一组示范。 */
55
+ export declare const REASONING_SEED_MESSAGE_STRIDE = 2;
52
56
  /**
53
- * 把示范插到前导 system 消息之后、第一条用户消息之前。
57
+ * 把固定示范分散到对话中:首条用户消息前插入
58
+ * {@link REASONING_SEED_INITIAL_EXCHANGES} 组,之后每隔
59
+ * {@link REASONING_SEED_MESSAGE_STRIDE} 条原始消息再插入一组,最多用完示范列表。
54
60
  *
55
- * 前导段之后若不是用户消息(例如开头就有 developer 工具变更),按原样返回:
56
- * 这类请求的顺序约束因适配器而异,宁可不插也不改变既有语义。
61
+ * 插入位置只由原始消息序号决定。历史增长不会移动旧示范,因此已有前缀缓存保持命中;
62
+ * 同时较近的示范能对抗模型近期长思考的自我强化。工具调用与其结果之间不插入。
63
+ * 前导段之后若不是用户消息(例如开头就有 developer 工具变更),按原样返回。
57
64
  * @param messages - 本次请求的消息。
58
65
  * @param provider - 线路 id。
59
66
  * @param model - 模型 id。
@@ -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atgpt-subscription",
3
- "version": "0.97.2",
3
+ "version": "0.97.3",
4
4
  "description": "Multi-provider subscription hub and agent runtime enhancements for DeepSeek Harness (DSH).",
5
5
  "icon": "./assets/icon.svg",
6
6
  "author": {