@thincoder/core 0.11.2 → 0.11.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.
Files changed (198) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/advisor/compaction.mjs +7 -5
  3. package/advisor/history.mjs +24 -11
  4. package/advisor/loop.mjs +13 -8
  5. package/advisor/messages.mjs +72 -8
  6. package/advisor/run.mjs +24 -13
  7. package/advisor.mjs +7 -3
  8. package/agent/chat-call.mjs +14 -9
  9. package/agent/completion.mjs +28 -40
  10. package/agent/continue-decision.mjs +14 -8
  11. package/agent/digest-account.mjs +133 -59
  12. package/agent/dispatch-run.mjs +1 -1
  13. package/agent/dispatch.mjs +2 -1
  14. package/agent/family-tools.mjs +12 -13
  15. package/agent/helpers.mjs +17 -72
  16. package/agent/image-heal.mjs +18 -4
  17. package/agent/post-turn.mjs +13 -26
  18. package/agent/record-results.mjs +21 -6
  19. package/agent/run-stages.mjs +72 -37
  20. package/agent/run-start.mjs +148 -113
  21. package/agent/setup-reminders.mjs +187 -91
  22. package/agent/setup.mjs +204 -138
  23. package/agent/spawn-child.mjs +2 -2
  24. package/agent/suspension.mjs +43 -15
  25. package/agent/timers.mjs +4 -1
  26. package/agent/turn-domain-text.mjs +105 -0
  27. package/agent/turn-loop.mjs +54 -22
  28. package/agent/turn-projection.mjs +127 -227
  29. package/agent/turn-tool-process.mjs +32 -37
  30. package/agent-tools/advisor-async.mjs +6 -3
  31. package/agent-tools/advisor-launch.mjs +5 -5
  32. package/agent-tools/advisor.mjs +1 -1
  33. package/agent-tools/async-discard.mjs +7 -2
  34. package/agent-tools/async-settle.mjs +18 -12
  35. package/agent-tools/bash-async.mjs +5 -2
  36. package/agent-tools/batch-closeout.mjs +12 -62
  37. package/agent-tools/batch-ledger-bind.mjs +19 -8
  38. package/agent-tools/batch-lifecycle.mjs +37 -11
  39. package/agent-tools/batch-read.mjs +151 -4
  40. package/agent-tools/batch-record-write.mjs +5 -5
  41. package/agent-tools/batch-segment-vocab.mjs +84 -4
  42. package/agent-tools/batch-skeleton.mjs +18 -14
  43. package/agent-tools/batch-supersede.mjs +1 -1
  44. package/agent-tools/batch-tier-gate.mjs +36 -119
  45. package/agent-tools/batch.mjs +30 -20
  46. package/agent-tools/browser-async.mjs +5 -2
  47. package/agent-tools/consult.mjs +10 -7
  48. package/agent-tools/context.mjs +47 -31
  49. package/agent-tools/digest-budget.mjs +10 -9
  50. package/agent-tools/eng.mjs +3 -4
  51. package/agent-tools/escalate-async.mjs +3 -3
  52. package/agent-tools/goal.mjs +5 -2
  53. package/agent-tools/judge-domain.mjs +347 -0
  54. package/agent-tools/manifest.mjs +2 -2
  55. package/agent-tools/parent-channel.mjs +6 -3
  56. package/agent-tools/plan.mjs +11 -10
  57. package/agent-tools/review-facts.mjs +9 -3
  58. package/agent-tools/skill.mjs +7 -8
  59. package/agent-tools/spawn-gates.mjs +5 -16
  60. package/agent-tools/ssh-session.mjs +6 -3
  61. package/agent-tools/ssh-transfer.mjs +1 -1
  62. package/agent-tools/subagent-actions.mjs +2 -2
  63. package/agent-tools/subagent-async.mjs +11 -8
  64. package/agent-tools/subagent-scheduler.mjs +9 -9
  65. package/agent-tools/subagent-spawn.mjs +2 -2
  66. package/agent-tools/subagent.mjs +5 -18
  67. package/agent-tools/task.mjs +0 -8
  68. package/agent.mjs +15 -15
  69. package/auto-think.mjs +5 -2
  70. package/compaction-work-state.mjs +230 -0
  71. package/compress-form.mjs +41 -6
  72. package/config-defaults.mjs +5 -2
  73. package/config.mjs +53 -17
  74. package/context-degrade.mjs +79 -48
  75. package/context-echo.mjs +6 -26
  76. package/context-push.mjs +328 -31
  77. package/context.mjs +203 -141
  78. package/conventions.mjs +1 -1
  79. package/declaration.mjs +95 -17
  80. package/escape.mjs +6 -5
  81. package/explore-distill.mjs +35 -8
  82. package/generate-title.mjs +10 -1
  83. package/knowledge/prompt-resources.md +5 -1
  84. package/ledger-tools.mjs +50 -50
  85. package/ledger-write-ops.mjs +43 -16
  86. package/memory/docs.mjs +51 -15
  87. package/memory/file-list.mjs +6 -0
  88. package/model-specs.mjs +87 -21
  89. package/origin-guard.mjs +190 -0
  90. package/package.json +1 -1
  91. package/prompt-files.mjs +33 -11
  92. package/prompt-overlays.mjs +12 -5
  93. package/prompts/advisor-design.md +55 -36
  94. package/prompts/advisor-round1.md +18 -7
  95. package/prompts/advisor-round2.md +18 -7
  96. package/prompts/advisor-round3.md +18 -7
  97. package/prompts/common.md +89 -51
  98. package/prompts/consult-base.md +2 -3
  99. package/prompts/discipline-engineering.md +474 -440
  100. package/prompts/discipline-normal.md +107 -31
  101. package/prompts/knowledge/business-gates.md +23 -15
  102. package/prompts/knowledge/decision-quality.md +16 -18
  103. package/prompts/knowledge/doc-lookup.md +22 -27
  104. package/prompts/knowledge/document-writing.md +31 -49
  105. package/prompts/knowledge/documentation-evaluation.md +37 -45
  106. package/prompts/knowledge/evidence-discipline.md +36 -55
  107. package/prompts/knowledge/normal-coding-workflow.md +27 -21
  108. package/prompts/knowledge/normal-delivery-collaboration.md +33 -17
  109. package/prompts/knowledge/normal-work-management.md +10 -7
  110. package/prompts/knowledge/product-security.md +22 -17
  111. package/prompts/knowledge/project-records.md +63 -52
  112. package/prompts/knowledge/tool-apply-patch.md +12 -13
  113. package/prompts/knowledge/tool-bash.md +13 -4
  114. package/prompts/knowledge/tool-batch-eng-coder.md +13 -6
  115. package/prompts/knowledge/tool-batch-eng-designer.md +14 -6
  116. package/prompts/knowledge/tool-batch-review.md +12 -6
  117. package/prompts/knowledge/tool-batch.md +76 -62
  118. package/prompts/knowledge/tool-browser.md +45 -34
  119. package/prompts/knowledge/tool-context.md +2 -2
  120. package/prompts/knowledge/tool-delete.md +5 -1
  121. package/prompts/knowledge/tool-doc-check.md +25 -24
  122. package/prompts/knowledge/tool-doc-graph-read.md +3 -3
  123. package/prompts/knowledge/tool-doc-graph.md +15 -15
  124. package/prompts/knowledge/tool-edit.md +26 -23
  125. package/prompts/knowledge/tool-execute.md +9 -4
  126. package/prompts/knowledge/tool-fetch.md +7 -1
  127. package/prompts/knowledge/tool-file-ops.md +6 -1
  128. package/prompts/knowledge/tool-git-read.md +3 -1
  129. package/prompts/knowledge/tool-git.md +1 -1
  130. package/prompts/knowledge/tool-glob.md +3 -1
  131. package/prompts/knowledge/tool-grep.md +5 -2
  132. package/prompts/knowledge/tool-hashline-edit.md +4 -2
  133. package/prompts/knowledge/tool-insert-after.md +3 -1
  134. package/prompts/knowledge/tool-ledger-read.md +6 -13
  135. package/prompts/knowledge/tool-ledger.md +14 -10
  136. package/prompts/knowledge/tool-ls.md +2 -0
  137. package/prompts/knowledge/tool-manifest.md +10 -7
  138. package/prompts/knowledge/tool-memory.md +15 -11
  139. package/prompts/knowledge/tool-operations.md +59 -71
  140. package/prompts/knowledge/tool-plan.md +1 -2
  141. package/prompts/knowledge/tool-process.md +1 -1
  142. package/prompts/knowledge/tool-read-history.md +6 -7
  143. package/prompts/knowledge/tool-read.md +1 -0
  144. package/prompts/knowledge/tool-settings.md +6 -7
  145. package/prompts/knowledge/tool-ssh.md +37 -15
  146. package/prompts/knowledge/tool-subagent.md +37 -39
  147. package/prompts/knowledge/tool-task.md +3 -1
  148. package/prompts/knowledge/tool-team-ledger.md +5 -1
  149. package/prompts/knowledge/tool-tree.md +2 -0
  150. package/prompts/knowledge/tool-wait-for.md +16 -16
  151. package/prompts/knowledge/tool-write.md +4 -1
  152. package/prompts/knowledge/upstream-protocol.md +39 -37
  153. package/prompts/persona-coder.md +1 -3
  154. package/prompts/persona-eng-coder.md +5 -5
  155. package/prompts/persona-eng-designer.md +34 -17
  156. package/prompts/persona-engineering.md +532 -501
  157. package/prompts/persona-explore.md +0 -2
  158. package/prompts/persona-normal.md +17 -9
  159. package/prompts/persona-plan.md +0 -2
  160. package/prompts/persona-tester.md +0 -2
  161. package/prompts/subagent-base.md +0 -2
  162. package/provider/anthropic.mjs +4 -2
  163. package/provider/core.mjs +5 -3
  164. package/provider/errors.mjs +41 -7
  165. package/provider/google.mjs +5 -3
  166. package/provider/reasoning-echo.mjs +16 -0
  167. package/provider/responses.mjs +4 -2
  168. package/provider/sse.mjs +11 -6
  169. package/rules.mjs +11 -10
  170. package/session-lifecycle.mjs +115 -81
  171. package/session-slot-write.mjs +1 -1
  172. package/session.mjs +23 -20
  173. package/shell-identity.mjs +129 -22
  174. package/skip-dirs.mjs +24 -0
  175. package/team-ledger.mjs +22 -22
  176. package/text-budget.mjs +1 -1
  177. package/think-off.mjs +27 -0
  178. package/token-ttl.mjs +1 -1
  179. package/token-window.mjs +278 -88
  180. package/tool-docs/bash.md +0 -2
  181. package/tool-docs/consult_start.md +2 -2
  182. package/tool-docs/consult_stop.md +2 -2
  183. package/tools/browser.mjs +8 -8
  184. package/tools/execute.mjs +2 -2
  185. package/tools/file.mjs +17 -11
  186. package/tools/git.mjs +12 -12
  187. package/tools/ops.mjs +2 -2
  188. package/tools/patch.mjs +1 -1
  189. package/tools/process-doc-mark.mjs +33 -4
  190. package/tools/repomap.mjs +25 -3
  191. package/tools/search.mjs +74 -26
  192. package/tools/shared.mjs +4 -3
  193. package/tools/ssh.mjs +5 -5
  194. package/tools/tree.mjs +32 -10
  195. package/tools/web-deepseek.mjs +1 -1
  196. package/tools/web.mjs +2 -2
  197. package/tools/write-gate-params.mjs +3 -3
  198. package/window-policy.mjs +118 -78
package/skip-dirs.mjs CHANGED
@@ -8,6 +8,8 @@
8
8
  *
9
9
  * **名单只此一份**:`SKIP_DIRS`(42 项)答「索引 / 遍历 / 搜索时跳过什么」——剪掉的是噪音。
10
10
  * 面判不读任何排除名单:面只有两值(文档面放行 ∥ 其余产品面拦),「什么算产物」不参与面判定。
11
+ * `BUILD_ARTIFACT_*` 三份与它**并列不同面**:读索引行、只在大纲编撰面生效,不改索引准入
12
+ * (见下方该族头注)。
11
13
  *
12
14
  * 三条处置(理由写在项旁,防后人「顺手补回去」):
13
15
  * - `bin` **不列**:`thincoder-cli/bin/` 有 2 个 `.mjs` 是 CLI 入口、产品代码;列进名单会把入口
@@ -46,3 +48,25 @@ export const SKIP_DIRS_FOLD = new Set([
46
48
 
47
49
  /** 目录名前缀族(`bazel-<workspace>` 无法枚举——workspace 名任意)。 */
48
50
  export const SKIP_DIR_PREFIXES = ["bazel-"]
51
+
52
+ /**
53
+ * 构建产物目录族——**只在大纲编撰面生效**,不进 `SKIP_DIRS`、不改索引准入:
54
+ * 库里的行照留(由维护面按 `ENOENT` 判死),只是不进大纲三段
55
+ * (机制 = `docs/core/design/MEMORY.md` §4「文件发现与范围」)。
56
+ *
57
+ * 取景 = 记忆库里 `path` 的段序列(相对 origin 根,`/` 分隔):
58
+ * - 段命中 `BUILD_ARTIFACT_DIRS`——浏览器缓存目录(`bin/Debug/…/EBWebView/…` 一族);
59
+ * - 相邻段对命中 `BUILD_ARTIFACT_DIR_PAIRS`——`bin` → `Debug` = 构建输出树;
60
+ * - 段前缀命中 `BUILD_ARTIFACT_DIR_PREFIXES`——带后缀的产物目录(`dist-*`)。
61
+ *
62
+ * **`bin` 单独不列**:`thincoder-cli/bin/` 是产品入口,列入会把入口漏出大纲;
63
+ * 只认 `bin` 后紧跟 `Debug` 的那一对。
64
+ */
65
+ export const BUILD_ARTIFACT_DIRS = new Set(["EBWebView", "WidevineCdm"])
66
+
67
+ /** 相邻段对(`bin` → `Debug`):两个段连着出现才算构建输出树,单独任一段不算。 */
68
+ export const BUILD_ARTIFACT_DIR_PAIRS = [["bin", "Debug"]]
69
+
70
+ /** 段前缀族(`dist-*`:`dist-linux` ∥ `dist-win` 一类,名自带后缀)。**只判目录段**:
71
+ * 文件名以 `dist-` 开头的是产品代码(如 `scripts/dist-resource-face.mjs`),照旧进大纲。 */
72
+ export const BUILD_ARTIFACT_DIR_PREFIXES = ["dist-"]
package/team-ledger.mjs CHANGED
@@ -138,14 +138,14 @@ function assertArgs(name, decl, args) {
138
138
  }
139
139
 
140
140
  /** 各 action 声明条目(= 参数并集按 action 收窄的单源;schema 与守卫同源)。 */
141
- const SCOPE_DESC = `"repo"(缺省——当前仓,自动派生)∥ "team"(全队跨仓)`
141
+ const SCOPE_DESC = `"repo" (default — this repo, derived automatically) or "team" (every repo in the team)`
142
142
  const ACTION_SPECS = {
143
143
  query: {
144
144
  type: "object",
145
145
  properties: {
146
146
  scope: { type: "string", enum: ["repo", "team"], description: SCOPE_DESC },
147
- status: { type: "string", enum: STATUSES, description: "按状态过滤(六态之一,缺省 = 不过滤)" },
148
- owner: { type: "string", description: "按负责人过滤(用户名精确匹配)" },
147
+ status: { type: "string", enum: STATUSES, description: "Filter by state — one of the six; omitted ⇒ no filter." },
148
+ owner: { type: "string", description: "Filter by owner (exact username)." },
149
149
  },
150
150
  additionalProperties: false,
151
151
  },
@@ -153,8 +153,8 @@ const ACTION_SPECS = {
153
153
  type: "object",
154
154
  properties: {
155
155
  scope: { type: "string", enum: ["repo", "team"], description: SCOPE_DESC },
156
- status: { type: "string", enum: STATUSES, description: "按状态过滤(六态之一,缺省 = 不过滤)" },
157
- owner: { type: "string", description: "按负责人过滤(用户名精确匹配)" },
156
+ status: { type: "string", enum: STATUSES, description: "Filter by state — one of the six; omitted ⇒ no filter." },
157
+ owner: { type: "string", description: "Filter by owner (exact username)." },
158
158
  },
159
159
  additionalProperties: false,
160
160
  },
@@ -162,9 +162,9 @@ const ACTION_SPECS = {
162
162
  type: "object",
163
163
  required: ["title"],
164
164
  properties: {
165
- title: { type: "string", description: "标题(必填——trim 非空 ∥ ≤200)" },
166
- detail: { type: "string", description: "正文(可空 ∥ ≤4000)" },
167
- owner: { type: "string", description: "负责人(缺省 = 自己)" },
165
+ title: { type: "string", description: "Title — required; trimmed non-empty and at most 200 characters." },
166
+ detail: { type: "string", description: "Body — optional, at most 4000 characters." },
167
+ owner: { type: "string", description: "Owner; omitted ⇒ you." },
168
168
  },
169
169
  additionalProperties: false,
170
170
  },
@@ -172,11 +172,11 @@ const ACTION_SPECS = {
172
172
  type: "object",
173
173
  required: ["id"],
174
174
  properties: {
175
- id: { type: "number", description: "条目编号(全局)" },
176
- title: { type: "string", description: "标题(缺省 = 不变)" },
177
- detail: { type: "string", description: "正文(缺省 = 不变)" },
178
- owner: { type: "string", description: "负责人(交接 = 换负责人;缺省 = 不变)" },
179
- status: { type: "string", enum: STATUSES, description: "目标状态(迁移表合法后继——非法由服务端 400)" },
175
+ id: { type: "number", description: "Row number (global)." },
176
+ title: { type: "string", description: "Title; omitted ⇒ unchanged." },
177
+ detail: { type: "string", description: "Body; omitted ⇒ unchanged." },
178
+ owner: { type: "string", description: "Owner — set it to hand the row over; omitted ⇒ unchanged." },
179
+ status: { type: "string", enum: STATUSES, description: "Target state — must be a legal successor in the migration table; anything else is refused by the server with 400." },
180
180
  },
181
181
  additionalProperties: false,
182
182
  },
@@ -184,8 +184,8 @@ const ACTION_SPECS = {
184
184
  type: "object",
185
185
  required: ["id", "status"],
186
186
  properties: {
187
- id: { type: "number", description: "条目编号(全局)" },
188
- status: { type: "string", enum: ["已核销", "已废弃"], description: "目标态(收口 / 撤回)" },
187
+ id: { type: "number", description: "Row number (global)." },
188
+ status: { type: "string", enum: ["已核销", "已废弃"], description: "Target state: settle or withdraw." },
189
189
  },
190
190
  additionalProperties: false,
191
191
  },
@@ -198,11 +198,11 @@ const UNION_PARAMETERS = {
198
198
  properties: {
199
199
  action: { type: "string", enum: FULL_ACTIONS, description: "" }, // 变体构造时填描述
200
200
  scope: { type: "string", enum: ["repo", "team"], description: SCOPE_DESC },
201
- status: { type: "string", enum: STATUSES, description: "状态(query ∥ count 过滤——六态之一;update 目标态——迁移表合法后继;close ∈ {已核销, 已废弃})" },
202
- owner: { type: "string", description: "负责人(query ∥ count 过滤——用户名精确匹配;add ∥ update 设值)" },
203
- title: { type: "string", description: "标题(add 必填 ∥ update 可改——trim 非空 ∥ ≤200)" },
204
- detail: { type: "string", description: "正文(add ∥ update——可空 ∥ ≤4000)" },
205
- id: { type: "number", description: "条目编号(update ∥ close 必填——全局编号)" },
201
+ status: { type: "string", enum: STATUSES, description: "Status — one of the six. On query and count it filters; on update it is the target state and must be a legal successor in the migration table. On close it is `已核销` or `已废弃`." },
202
+ owner: { type: "string", description: "Owner: on query and count it filters (exact username); on add and update it sets the value." },
203
+ title: { type: "string", description: "Title: required on add, changeable on update — trimmed non-empty and at most 200 characters." },
204
+ detail: { type: "string", description: "Body: on add and update, optional, at most 4000 characters." },
205
+ id: { type: "number", description: "Row number: required on update and close; the numbering is global." },
206
206
  },
207
207
  additionalProperties: false,
208
208
  }
@@ -214,13 +214,13 @@ function makeTeamLedgerTool(actions, { readonly = false, writeFace = false } = {
214
214
  const readProps = {}
215
215
  if (readonly) for (const a of actions) Object.assign(readProps, ACTION_SPECS[a].properties)
216
216
  const properties = readonly
217
- ? { action: { type: "string", enum: actions, description: "操作(只读二值):query 查询 / count 计数" }, ...readProps }
217
+ ? { action: { type: "string", enum: actions, description: "Which operation to run — read-only: `query` or `count`." }, ...readProps }
218
218
  : {
219
219
  ...UNION_PARAMETERS.properties,
220
220
  action: {
221
221
  ...UNION_PARAMETERS.properties.action,
222
222
  enum: actions,
223
- description: writeFace ? "操作(五值):query 查询 / count 计数 / add 新增 / update 更新 / close 收口或撤回——写三仅主 agent 装配面" : "操作(只读二值):query 查询 / count 计数",
223
+ description: writeFace ? "Which operation to run. The three write actions are assembled for the main agent only." : "Which operation to run — read-only: `query` or `count`.",
224
224
  },
225
225
  }
226
226
  return {
package/text-budget.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * text-budget.mjs — 文本额度纯函数(零依赖——TUI-OOM-ROOTCAUSE 批,AGENT-LOOP.md §6.15 / TUI-SESSION-VIEW.md §5.2)。
2
+ * text-budget.mjs — 文本额度纯函数(零依赖——TUI-OOM-ROOTCAUSE 批,TOOL-OUTPUT-LIMITS.md §2 头尾预览 / TUI-SESSION-VIEW.md §5.2)。
3
3
  *
4
4
  * 单一来源(D2):agent 侧捕获截断(spawn-child.mjs——子代理 `_capturedOutput`)与 TUI 面
5
5
  * 载体额度(tui/display-budget.mjs)共用本体的 `capText` / `appendCappedText`——两处各自
package/think-off.mjs CHANGED
@@ -25,6 +25,33 @@ export function thinkOffPath(spec) {
25
25
  return true
26
26
  }
27
27
 
28
+ /** 有效思考模式(判据本体 = `docs/core/design/AGENT-LOOP.md` §5.4 的判定次序):
29
+ * 这一轮请求会不会真的带思考 —— 判据是「服务端的有效模式」,不是「UI 显成什么」。
30
+ * 输入 `provider` = 该渠道的描述子(`thinking` ∥ `reasoningEffort` 两键的实际值)、`spec` = 核规格(可为 `null`)。
31
+ * 次序(自上而下,先命中先返回):
32
+ * ① `thinkAlwaysOn === true` 或非空且非 `"none"` 的 `reasoningEffort` ⇒ `true`(显式要思考 / 服务端强制);
33
+ * ② `reasoningEffort === "none"` ∥ `thinking.type === "disabled"` ⇒ `false`(两枚显式 off 形);
34
+ * ③ `thinking === null` 且该族的 off 形本来就是 `null`(`spec.thinkApi === "effort"`)且 `thinkOffPath(spec)` 为真
35
+ * ⇒ `false`——只有 effort 族有资格把 `null` 读成关闭:它的 off 形 = 置 `null` + 删 effort,且枚举含 `"none"`
36
+ * 时载荷层才补发 `reasoning_effort:"none"`(`provider/core.mjs` 的支),此时它才是有效关闭;
37
+ * ④ 其余 ⇒ `true`:没有任何 off 证据就不按「已关思考」静默省键(kimi 式 `thinking:null` 而枚举无 `none`、
38
+ * 以及 type 族的 `thinking:null`——`null` 不是它的 off 形,载荷层的 `if (provider.thinking)` 会跳过它、
39
+ * 服务端默认照旧思考——两处都落这一支)。
40
+ * 边界:两个参数都必须显式传入;`null` 是合法实参(没有渠道 ∥ 未声明族),`undefined` 点名报错,不补默认。 */
41
+ export function isThinkingRequest(provider, spec) {
42
+ if (provider === undefined) throw new Error("isThinkingRequest: provider is required — 传该渠道的描述子(没有渠道时传 null),本函数不替调用方补默认")
43
+ if (spec === undefined) throw new Error("isThinkingRequest: spec is required — 传该族的规格(未声明的族传 null),本函数不替调用方补默认")
44
+ const effort = provider?.reasoningEffort
45
+ if (spec?.thinkAlwaysOn === true) return true
46
+ if (typeof effort === "string" && effort.trim() !== "" && effort !== "none") return true
47
+ if (effort === "none") return false
48
+ if (provider?.thinking?.type === "disabled") return false
49
+ // `null` 只有 effort 族读得成关闭(它的 off 形就是 null + 删 effort);type 族的 off 形是 {type:"disabled"},
50
+ // 收到 null 只表示「没配」——载荷层 `if (provider.thinking)` 会跳过它、服务端照旧思考,不能据此判合规省键。
51
+ if (provider?.thinking === null && spec?.thinkApi === "effort" && thinkOffPath(spec)) return false
52
+ return true
53
+ }
54
+
28
55
  /** advisor 推理档写面三态(**写语义单源** —— 由 VSC `settings-panel-write.mjs` 的 `applyAdvisorEffort` 上提;B10 S11:
29
56
  * 桌面主侧 ∕ VSC 写面两端同引,零副本):`advisor` 对象原地作用于 `{ thinking, reasoningEffort }` 两键 ——
30
57
  * ① `"none"`(关思考)⇒ `thinking = thinkOffShape(spec)`(族别 off 形)+ 删 `reasoningEffort`;
package/token-ttl.mjs CHANGED
@@ -394,7 +394,7 @@ export function persistEngTokens(agent) {
394
394
  // 会话级档位(#441③ 键齐——与 `newSlotData` 规范结构 / `saveSession` 携带面同源:
395
395
  // 实况有值携带、无则 `null`;老槽禁回填不适用——本分支只产全新槽)。
396
396
  effort: agent._slotEffort ?? null,
397
- pendingReminders: agent._pendingReminders ?? [],
397
+ pendingInject: agent._pendingInject ?? [],
398
398
  sessionStart: agent._sessionStart ?? null,
399
399
  // 创建端(SLOT-END-PARAM 批 §6.20 判据句 4 写面——全新分支):取值链已由守卫(上方
400
400
  // `guardForeignSlotFile`)解析入 `agent._slotCreatedBy`(文件不在盘 ⇒ 进程端名)。