@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.
- package/CHANGELOG.md +18 -0
- package/advisor/compaction.mjs +7 -5
- package/advisor/history.mjs +24 -11
- package/advisor/loop.mjs +13 -8
- package/advisor/messages.mjs +72 -8
- package/advisor/run.mjs +24 -13
- package/advisor.mjs +7 -3
- package/agent/chat-call.mjs +14 -9
- package/agent/completion.mjs +28 -40
- package/agent/continue-decision.mjs +14 -8
- package/agent/digest-account.mjs +133 -59
- package/agent/dispatch-run.mjs +1 -1
- package/agent/dispatch.mjs +2 -1
- package/agent/family-tools.mjs +12 -13
- package/agent/helpers.mjs +17 -72
- package/agent/image-heal.mjs +18 -4
- package/agent/post-turn.mjs +13 -26
- package/agent/record-results.mjs +21 -6
- package/agent/run-stages.mjs +72 -37
- package/agent/run-start.mjs +148 -113
- package/agent/setup-reminders.mjs +187 -91
- package/agent/setup.mjs +204 -138
- package/agent/spawn-child.mjs +2 -2
- package/agent/suspension.mjs +43 -15
- package/agent/timers.mjs +4 -1
- package/agent/turn-domain-text.mjs +105 -0
- package/agent/turn-loop.mjs +54 -22
- package/agent/turn-projection.mjs +127 -227
- package/agent/turn-tool-process.mjs +32 -37
- package/agent-tools/advisor-async.mjs +6 -3
- package/agent-tools/advisor-launch.mjs +5 -5
- package/agent-tools/advisor.mjs +1 -1
- package/agent-tools/async-discard.mjs +7 -2
- package/agent-tools/async-settle.mjs +18 -12
- package/agent-tools/bash-async.mjs +5 -2
- package/agent-tools/batch-closeout.mjs +12 -62
- package/agent-tools/batch-ledger-bind.mjs +19 -8
- package/agent-tools/batch-lifecycle.mjs +37 -11
- package/agent-tools/batch-read.mjs +151 -4
- package/agent-tools/batch-record-write.mjs +5 -5
- package/agent-tools/batch-segment-vocab.mjs +84 -4
- package/agent-tools/batch-skeleton.mjs +18 -14
- package/agent-tools/batch-supersede.mjs +1 -1
- package/agent-tools/batch-tier-gate.mjs +36 -119
- package/agent-tools/batch.mjs +30 -20
- package/agent-tools/browser-async.mjs +5 -2
- package/agent-tools/consult.mjs +10 -7
- package/agent-tools/context.mjs +47 -31
- package/agent-tools/digest-budget.mjs +10 -9
- package/agent-tools/eng.mjs +3 -4
- package/agent-tools/escalate-async.mjs +3 -3
- package/agent-tools/goal.mjs +5 -2
- package/agent-tools/judge-domain.mjs +347 -0
- package/agent-tools/manifest.mjs +2 -2
- package/agent-tools/parent-channel.mjs +6 -3
- package/agent-tools/plan.mjs +11 -10
- package/agent-tools/review-facts.mjs +9 -3
- package/agent-tools/skill.mjs +7 -8
- package/agent-tools/spawn-gates.mjs +5 -16
- package/agent-tools/ssh-session.mjs +6 -3
- package/agent-tools/ssh-transfer.mjs +1 -1
- package/agent-tools/subagent-actions.mjs +2 -2
- package/agent-tools/subagent-async.mjs +11 -8
- package/agent-tools/subagent-scheduler.mjs +9 -9
- package/agent-tools/subagent-spawn.mjs +2 -2
- package/agent-tools/subagent.mjs +5 -18
- package/agent-tools/task.mjs +0 -8
- package/agent.mjs +15 -15
- package/auto-think.mjs +5 -2
- package/compaction-work-state.mjs +230 -0
- package/compress-form.mjs +41 -6
- package/config-defaults.mjs +5 -2
- package/config.mjs +53 -17
- package/context-degrade.mjs +79 -48
- package/context-echo.mjs +6 -26
- package/context-push.mjs +328 -31
- package/context.mjs +203 -141
- package/conventions.mjs +1 -1
- package/declaration.mjs +95 -17
- package/escape.mjs +6 -5
- package/explore-distill.mjs +35 -8
- package/generate-title.mjs +10 -1
- package/knowledge/prompt-resources.md +5 -1
- package/ledger-tools.mjs +50 -50
- package/ledger-write-ops.mjs +43 -16
- package/memory/docs.mjs +51 -15
- package/memory/file-list.mjs +6 -0
- package/model-specs.mjs +87 -21
- package/origin-guard.mjs +190 -0
- package/package.json +1 -1
- package/prompt-files.mjs +33 -11
- package/prompt-overlays.mjs +12 -5
- package/prompts/advisor-design.md +55 -36
- package/prompts/advisor-round1.md +18 -7
- package/prompts/advisor-round2.md +18 -7
- package/prompts/advisor-round3.md +18 -7
- package/prompts/common.md +89 -51
- package/prompts/consult-base.md +2 -3
- package/prompts/discipline-engineering.md +474 -440
- package/prompts/discipline-normal.md +107 -31
- package/prompts/knowledge/business-gates.md +23 -15
- package/prompts/knowledge/decision-quality.md +16 -18
- package/prompts/knowledge/doc-lookup.md +22 -27
- package/prompts/knowledge/document-writing.md +31 -49
- package/prompts/knowledge/documentation-evaluation.md +37 -45
- package/prompts/knowledge/evidence-discipline.md +36 -55
- package/prompts/knowledge/normal-coding-workflow.md +27 -21
- package/prompts/knowledge/normal-delivery-collaboration.md +33 -17
- package/prompts/knowledge/normal-work-management.md +10 -7
- package/prompts/knowledge/product-security.md +22 -17
- package/prompts/knowledge/project-records.md +63 -52
- package/prompts/knowledge/tool-apply-patch.md +12 -13
- package/prompts/knowledge/tool-bash.md +13 -4
- package/prompts/knowledge/tool-batch-eng-coder.md +13 -6
- package/prompts/knowledge/tool-batch-eng-designer.md +14 -6
- package/prompts/knowledge/tool-batch-review.md +12 -6
- package/prompts/knowledge/tool-batch.md +76 -62
- package/prompts/knowledge/tool-browser.md +45 -34
- package/prompts/knowledge/tool-context.md +2 -2
- package/prompts/knowledge/tool-delete.md +5 -1
- package/prompts/knowledge/tool-doc-check.md +25 -24
- package/prompts/knowledge/tool-doc-graph-read.md +3 -3
- package/prompts/knowledge/tool-doc-graph.md +15 -15
- package/prompts/knowledge/tool-edit.md +26 -23
- package/prompts/knowledge/tool-execute.md +9 -4
- package/prompts/knowledge/tool-fetch.md +7 -1
- package/prompts/knowledge/tool-file-ops.md +6 -1
- package/prompts/knowledge/tool-git-read.md +3 -1
- package/prompts/knowledge/tool-git.md +1 -1
- package/prompts/knowledge/tool-glob.md +3 -1
- package/prompts/knowledge/tool-grep.md +5 -2
- package/prompts/knowledge/tool-hashline-edit.md +4 -2
- package/prompts/knowledge/tool-insert-after.md +3 -1
- package/prompts/knowledge/tool-ledger-read.md +6 -13
- package/prompts/knowledge/tool-ledger.md +14 -10
- package/prompts/knowledge/tool-ls.md +2 -0
- package/prompts/knowledge/tool-manifest.md +10 -7
- package/prompts/knowledge/tool-memory.md +15 -11
- package/prompts/knowledge/tool-operations.md +59 -71
- package/prompts/knowledge/tool-plan.md +1 -2
- package/prompts/knowledge/tool-process.md +1 -1
- package/prompts/knowledge/tool-read-history.md +6 -7
- package/prompts/knowledge/tool-read.md +1 -0
- package/prompts/knowledge/tool-settings.md +6 -7
- package/prompts/knowledge/tool-ssh.md +37 -15
- package/prompts/knowledge/tool-subagent.md +37 -39
- package/prompts/knowledge/tool-task.md +3 -1
- package/prompts/knowledge/tool-team-ledger.md +5 -1
- package/prompts/knowledge/tool-tree.md +2 -0
- package/prompts/knowledge/tool-wait-for.md +16 -16
- package/prompts/knowledge/tool-write.md +4 -1
- package/prompts/knowledge/upstream-protocol.md +39 -37
- package/prompts/persona-coder.md +1 -3
- package/prompts/persona-eng-coder.md +5 -5
- package/prompts/persona-eng-designer.md +34 -17
- package/prompts/persona-engineering.md +532 -501
- package/prompts/persona-explore.md +0 -2
- package/prompts/persona-normal.md +17 -9
- package/prompts/persona-plan.md +0 -2
- package/prompts/persona-tester.md +0 -2
- package/prompts/subagent-base.md +0 -2
- package/provider/anthropic.mjs +4 -2
- package/provider/core.mjs +5 -3
- package/provider/errors.mjs +41 -7
- package/provider/google.mjs +5 -3
- package/provider/reasoning-echo.mjs +16 -0
- package/provider/responses.mjs +4 -2
- package/provider/sse.mjs +11 -6
- package/rules.mjs +11 -10
- package/session-lifecycle.mjs +115 -81
- package/session-slot-write.mjs +1 -1
- package/session.mjs +23 -20
- package/shell-identity.mjs +129 -22
- package/skip-dirs.mjs +24 -0
- package/team-ledger.mjs +22 -22
- package/text-budget.mjs +1 -1
- package/think-off.mjs +27 -0
- package/token-ttl.mjs +1 -1
- package/token-window.mjs +278 -88
- package/tool-docs/bash.md +0 -2
- package/tool-docs/consult_start.md +2 -2
- package/tool-docs/consult_stop.md +2 -2
- package/tools/browser.mjs +8 -8
- package/tools/execute.mjs +2 -2
- package/tools/file.mjs +17 -11
- package/tools/git.mjs +12 -12
- package/tools/ops.mjs +2 -2
- package/tools/patch.mjs +1 -1
- package/tools/process-doc-mark.mjs +33 -4
- package/tools/repomap.mjs +25 -3
- package/tools/search.mjs +74 -26
- package/tools/shared.mjs +4 -3
- package/tools/ssh.mjs +5 -5
- package/tools/tree.mjs +32 -10
- package/tools/web-deepseek.mjs +1 -1
- package/tools/web.mjs +2 -2
- package/tools/write-gate-params.mjs +3 -3
- 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"
|
|
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: "
|
|
166
|
-
detail: { type: "string", description: "
|
|
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: "
|
|
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: "
|
|
202
|
-
owner: { type: "string", description: "
|
|
203
|
-
title: { type: "string", description: "
|
|
204
|
-
detail: { type: "string", description: "
|
|
205
|
-
id: { type: "number", description: "
|
|
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: "
|
|
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 ? "
|
|
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 批,
|
|
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
|
-
|
|
397
|
+
pendingInject: agent._pendingInject ?? [],
|
|
398
398
|
sessionStart: agent._sessionStart ?? null,
|
|
399
399
|
// 创建端(SLOT-END-PARAM 批 §6.20 判据句 4 写面——全新分支):取值链已由守卫(上方
|
|
400
400
|
// `guardForeignSlotFile`)解析入 `agent._slotCreatedBy`(文件不在盘 ⇒ 进程端名)。
|