@chaoset/adaptive-perf 0.4.0 → 0.6.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/README.md CHANGED
@@ -1,22 +1,46 @@
1
1
  # @chaoset/adaptive-perf — DSH 极简性能自适应插件
2
2
 
3
+ > **默认策略(0.6.0,功能优先)**:本插件的性能收益本质是"砍上下文/砍工具换
4
+ > token",没有无损形态——旧版把下列机制默认开启,导致 standard/PTC 模式功能
5
+ > 缺失(编排类工具族从目录删除、PTC 程序调用直接 `UNKNOWN_TOOL`;技能目录与
6
+ > AGENTS.md 摘要被剥离;官方引导段被屏蔽;首轮只剩两个工具)。**0.6.0 起全部
7
+ > 机制默认关闭,安装后对会话零干预,官方 preset 功能完整**;需要省 token 时在
8
+ > 设置页按需开启下列任意机制(补偿机制——关键词/失败信号放行、`skill_search`
9
+ > 按需发现——随开启自动生效)。下文描述的是各机制**开启后**的行为。
10
+
3
11
  让 **标准模式(standard)** 与 **PTC 模式(code)** 达到 **极简模式(minimal)**
4
12
  级别的高性能,同时保留完整能力——不是静态裁剪,而是**动态自适应**:
5
13
 
6
- - **首轮锚定(bootstrap)**:决定模型首轮"轨迹"(思维链风格)的是请求 #1 可见的
7
- **工具 schema** 与**自动注入的上下文提醒**(参照
14
+ - **真实 Minimal 工具对(realPair)**:首轮"轨迹"由请求 #1 可见的**工具 schema**
15
+ 逐字决定——只有与 Minimal 完全相同的 schema 能锚定(参照
8
16
  [dsh-anchored-standard](https://github.com/xiaobright/dsh-anchored-standard/)
9
- 的实测:Minimal 真实工具对在 256000 输出预算下 5/5 锚定、任何 standard 系
10
- schema 11/11 落入 standard-like;技能目录在场时锚定完全无法复现 0/9)。因此:
11
- - 请求 #1 的工具目录收窄到真实 Minimal 工具对(`bash` + `str_replace_editor`);
17
+ 实测:真实工具对 5/5 锚定,任何 standard 系 schema——包括 sandboxed
18
+ bash/read——11/11 落入 standard-like)。本插件把官方 minimal preset 同款插件
19
+ (持久 PTY bash + `str_replace_editor`,含逐字相同的描述)挂进会话作用域,
20
+ 按名阴影 standard 的 sandboxed bash——**不是**只把目录收窄到同名工具。
21
+ - **首轮锚定(bootstrap)**:决定首轮"轨迹"(思维链风格)的是请求 #1 可见的
22
+ **工具 schema** 与**自动注入的上下文提醒**。因此:
23
+ - 请求 #1 的工具目录 = 真实 Minimal 工具对(`bash` + `str_replace_editor`);
12
24
  - 请求 #1 剥离自动注入上下文(技能目录提醒 `skill-catalog`、AGENTS.md 摘要
13
25
  `agent-instructions`,用户主动的技能手势不过滤);
14
26
  - 会话出现首个**持久**晋升信号(首个 `tool/call` 或 `assistant/message`,
15
- `promoteOn` 可选 `either`/`tool-call`/`assistant-message`)后恢复完整目录;
16
- 阶段从持久会话事件推导,**resume / reload 不丢状态**;
27
+ `promoteOn` 可选 `either`/`tool-call`/`assistant-message`)后进入 **resident
28
+ 目录**:bootstrap 工具对 + 常驻发现工具(`dev_tool_search` +
29
+ `skill_search` + `skill_load`)+ 已解锁工具,而不是一次性 dump 完整
30
+ Standard 目录(避免 post-promotion regression);阶段从持久会话事件推导,
31
+ **resume / reload 不丢状态**;
32
+ - `dev_tool_search` 可搜索完整目录并按名解锁工具,解锁结果下一请求生效;
17
33
  - compaction 会把会话打回"第二次首轮":`compaction/end` 之后回到受控目录
18
34
  (bootstrap 工具对 + `compactionTools` 核心工作集),直到出现新的晋升信号;
19
35
  - `maxTokens > 0` 时可给请求 #1 封顶输出预算(晋升后自动剥离)。
36
+ - **常驻上下文抑制(suppressInjectedContext)**:技能目录提醒与 AGENTS.md 摘要
37
+ **不再在晋升后恢复**——参考实现实测它们即使在后置阶段也扰动轨迹,且每个请求
38
+ 多耗数千 token。替代品:
39
+ - `skill_search` / `skill_load`:晋升后常驻的两个小工具,按需发现并注入单个
40
+ 技能的完整说明(替代 ~9KB 的 `<available_skills>` 目录注入);
41
+ - `instruction-hint`:晋升后只注入**一次**的短提示——"指令文件存在,需要时
42
+ 自己读",而不是每请求 dump 全文(探测项目链 AGENTS.md/CLAUDE.md 与
43
+ `$DSH_HOME/AGENTS.md`,探测失败不注入,绝不抛错)。
20
44
  - **运行时上下文抑制**:对目标 preset 的会话调用 `suppressRuntimeContext()`
21
45
  (与极简模式的 `includeRuntimeContext: false` 同一机制),每次模型请求省掉
22
46
  "Current runtime context" 快照文本,**零功能损失**。
@@ -28,8 +52,9 @@
28
52
  - 按名阴影屏蔽三个全局引导段(空段在装配时被丢弃,等同极简 `complete`
29
53
  persona 的效果;plan-mode 与 PTC 的 SDK 段不受影响);
30
54
  - 按名阴影替换 `deployment:persona` 为极简语域 persona(默认与极简模式
31
- 逐字相同:`You are a helpful software engineer assistant.`)。
32
- 两处均为 agent 作用域的 prompt 段阴影,仅影响目标会话;**对已恢复/已晋升的
55
+ 逐字相同:`You are a helpful software engineer assistant.`);
56
+ - 挂载真实工具对时按名阴影 `tool:bash` 引导段(与可见工具一致)。
57
+ 各处均为 agent 作用域的 prompt 段阴影,仅影响目标会话;**对已恢复/已晋升的
33
58
  旧会话同样生效**(不依赖 bootstrap 阶段)。
34
59
  - **工具目录自适应精简**:会话启动时按"工具族"默认隐藏高开销低频工具
35
60
  (子代理 / 工作流 / ralph / goal 等编排类),只保留核心编码工具
@@ -45,11 +70,12 @@
45
70
 
46
71
  | 维度 | 极简模式 | 标准 / PTC 模式 | 本插件做法 |
47
72
  |---|---|---|---|
48
- | 首轮轨迹(决定后续行为风格) | Minimal 工具对锚定(5/5) | 任何 standard 系 schema 落入 standard-like(11/11) | 请求 #1 收窄到真实 Minimal 工具对,首个持久信号后恢复 |
73
+ | 首轮轨迹(决定后续行为风格) | Minimal 真实工具对锚定(5/5) | 任何 standard 系 schema(含 sandboxed bash)落入 standard-like(11/11) | realPair 挂载官方同款插件:请求 #1 schema 与 Minimal 逐字相同,首个持久信号后进 resident 目录 |
49
74
  | 首轮注入提醒 | 无 skill 目录/AGENTS.md 注入 | 自动注入(在场时锚定 0/9) | 请求 #1 剥离 `skill-catalog` + `agent-instructions` |
75
+ | 后置阶段注入 | 永不注入 | 晋升后每请求恢复 ~9KB 目录 + AGENTS.md 全文 | `suppressInjectedContext`:整个会话抑制;替代品为 `skill_search`/`skill_load` + 一次性 `instruction-hint` |
50
76
  | 系统提示语域(persona + 全局引导段) | 一句话 persona,无任何引导段 | identity/source/web-surface 引导段 + 标准 persona("Let me…" 叙述来源) | minimalPrompt 层按名阴影屏蔽 3 个全局段 + 替换极简 persona(对旧会话同样生效) |
51
77
  | 运行时上下文快照 | 关闭(`includeRuntimeContext: false`) | 每次请求注入文件策略/审批策略等快照 | 同一机制:`suppressRuntimeContext()` |
52
- | 模型可见工具目录 | 2 个(bash、str_replace_editor) | ~22 个工具 schema 全部进请求 | bootstrap 后默认隐藏 4 个编排类工具族(~11 个工具),按需放行 |
78
+ | 模型可见工具目录 | 2 个(bash、str_replace_editor) | ~22 个工具 schema 全部进请求 | 首轮 2 个;晋升后 resident 目录(工具对 + 发现工具 + 已解锁),编排族默认隐藏按需放行 |
53
79
  | PTC SDK 参考段 | 无 | 全部工具的类型+描述渲染进提示 | 随目录缩小(同一 `visible` 视图驱动) |
54
80
 
55
81
  ## 安装(npm 生态方式)
@@ -96,14 +122,45 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
96
122
  | `enabled` | `true` | 总开关 |
97
123
  | `presets` | `["standard", "code"]` | 应用自适应的 preset id |
98
124
  | `suppressRuntimeContext` | `true` | 抑制运行时上下文快照(零功能损失) |
125
+ | `suppressInjectedContext` | `true` | 整个会话剥离技能目录/AGENTS.md 注入(0.5.0;`false` = 只在请求 #1 剥离) |
126
+ | `skillDiscovery` | `true` | 晋升后常驻 `skill_search` / `skill_load`(0.5.0) |
127
+ | `instructionHint` | `true` | 晋升后一次性注入指令文件提示(0.5.0) |
99
128
  | `leanByDefault` | `true` | 会话启动即隐藏编排类工具族 |
100
129
  | `escalateOnKeyword` | `true` | 用户消息命中触发词 → 放行该族 |
101
130
  | `escalateOnUnknownTool` | `true` | 工具调用失败(UNKNOWN_TOOL)→ 放行该族 |
102
131
  | `coreTools` | 核心编码工具 | 展示用:不进入任何限制族 |
103
132
  | `families` | 见下 | 工具族:`{ 族名: { enabled, tools, keywords } }` |
104
- | `bootstrap` | 见下 | 首轮锚定(工具对 / 晋升信号 / 剥离上下文 / 压缩恢复集 / 预算封顶) |
133
+ | `bootstrap` | 见下 | 首轮锚定(真实工具对 / 晋升信号 / 剥离上下文 / 压缩恢复集 / resident 发现工具 / 预算封顶) |
105
134
  | `minimalPrompt` | 见下 | 极简提示词层(语域锚定) |
106
135
 
136
+ `bootstrap`(首轮锚定):
137
+
138
+ ```json
139
+ {
140
+ "enabled": true,
141
+ "realPair": true,
142
+ "tools": ["bash", "str_replace_editor"],
143
+ "promoteOn": "either",
144
+ "suppressedContextSources": ["skill-catalog", "agent-instructions"],
145
+ "compactionTools": ["read", "write", "edit", "glob", "grep", "todo_write", "ask_user_question"],
146
+ "discoveryTools": ["dev_tool_search", "skill_search", "skill_load"],
147
+ "maxTokens": 0
148
+ }
149
+ ```
150
+
151
+ - `realPair`(0.5.0):把官方 minimal preset 同款插件(持久 PTY bash +
152
+ `str_replace_editor`)挂进会话作用域,按名阴影 standard 的 sandboxed
153
+ bash——请求 #1 的 schema 与 Minimal 逐字相同(只有逐字相同的 schema 能
154
+ 锚定)。依赖 `@deepseek-ai` 官方插件包(optionalDependencies);缺失或
155
+ Windows(无 PTY 后端)时自动降级为"仅收窄目录"并告警。
156
+ - `tools`:请求 #1 可见的工具(真实 Minimal 对)。
157
+ - `promoteOn`:`either`(默认)/ `tool-call` / `assistant-message`。
158
+ - `suppressedContextSources`:剥离的自动注入 source.kind;`[]` 关闭剥离。
159
+ - `compactionTools`:compaction/end 之后、再次晋升前可用的核心工作集。
160
+ - `discoveryTools`:晋升后 resident 目录里的按需发现工具
161
+ (`dev_tool_search` 解锁工具;`skill_search`/`skill_load` 按需加载技能)。
162
+ - `maxTokens`:请求 #1 输出预算封顶(0 = 不封顶,opt-in)。
163
+
107
164
  `minimalPrompt`(极简提示词层,0.4.0 新增):
108
165
 
109
166
  ```json
@@ -142,8 +199,22 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
142
199
  - 监听 host 根作用域的 `agent/created` / `agent/disposed` / `agent/inbox/inserted`
143
200
  / `tools/result`(与 `dsh-agent-presets` 自身同款事件用法),按
144
201
  `agentPresets.composedPreset(agent.ctx)` 识别目标 preset
202
+ - **真实工具对**:`agent.ctx.plugin()` 把 `dsh-terminal` + `dsh-terminal-bash`
203
+ + `dsh-tool-bash-persistent`(Minimal 逐字描述)+ `dsh-fs-local` +
204
+ `dsh-tool-str-replace-editor` 挂进 agent 作用域;scoped registration 按名
205
+ 阴影继承的 sandboxed bash,且 `view()` 对 own layer 豁免 restrict——首轮
206
+ 目录 = 真实工具对 + 被 deny 的其他继承工具;每个挂载是独立 fiber,
207
+ agent 销毁/插件卸载/配置关闭时全部撤销
145
208
  - 限制通过 `agent.ctx.tools.restrict({ deny })` 逐族注册:多族限制自动取交集,
146
209
  升级 = 释放该族 disposer(单会话单调、一次性目录变化,缓存失效有界)
210
+ - 发现工具(`dev_tool_search` / `skill_search` / `skill_load`)同样注册在
211
+ agent 作用域:已解锁工具写入会话状态并重算 deny 集;技能经宿主 `skills`
212
+ 服务按 agent scope 查询,`skill_load` 用 `agent.inject` 以
213
+ `skill-invocation` 来源注入(用户技能手势同款,不被默认抑制集剥离)
214
+ - 上下文剥离与 instruction-hint 都在 `agent/pre-step`(prepend 注册,最后
215
+ 一道变换):剥离失败绝不吞用户上下文;指令文件探测走宿主 `fs`,失败不注入
147
216
  - 会话启动/插件重载时用 `tools.schemas(agent)` 记录可见目录,限制与之取交集
148
- - 全部副作用(抑制器、限制、监听)随 agent 销毁或插件卸载自动释放
149
- - **fail-safe**:插件任何内部错误只记日志,不拖垮 harness
217
+ - 全部副作用(抑制器、限制、工具注册、提示段、监听)随 agent 销毁或插件
218
+ 卸载自动释放
219
+ - **fail-safe**:插件任何内部错误只记日志,不拖垮 harness;官方插件包缺失
220
+ 时自动降级
package/client/client.cjs CHANGED
@@ -40,12 +40,20 @@ window.__ModuleLoader__.load({
40
40
  fieldEscalateOnKeyword: "用户消息命中工具族触发词(如“子代理”)时,该会话放行对应工具族",
41
41
  escalateOnUnknownTool: "失败自动放行",
42
42
  fieldEscalateOnUnknownTool: "PTC 程序调用被隐藏工具报 UNKNOWN_TOOL 时自动放行对应族",
43
+ suppressInjectedContext: "常驻抑制注入上下文",
44
+ fieldSuppressInjectedContext: "整个会话剥离技能目录提醒(skill-catalog)与 AGENTS.md 摘要(agent-instructions),不再在晋升后恢复——替代品是 skill_search/skill_load 按需发现与一次性 instruction-hint(参照 dsh-anchored-standard:注入在场即使后置也扰动轨迹)",
45
+ skillDiscovery: "技能按需发现",
46
+ fieldSkillDiscovery: "晋升后常驻 skill_search / skill_load 两个小工具,替代 ~9KB 的 <available_skills> 目录注入",
47
+ instructionHint: "指令文件一次性提示",
48
+ fieldInstructionHint: "晋升后注入一次“指令文件存在,需要时自读”的短提示(探测项目链 AGENTS.md/CLAUDE.md 与 $DSH_HOME/AGENTS.md),替代全文摘要",
43
49
  families: "工具族(高级)",
44
50
  fieldFamilies: "JSON:{ 族名: { enabled, tools: [工具名], keywords: [触发词] } }。保存后热生效。",
45
51
  coreTools: "核心工具(永不隐藏)",
46
52
  fieldCoreTools: "展示用:这些工具不进入任何限制族。未列入任何族的工具也默认保留。",
47
53
  bootstrapEnabled: "首轮锚定(bootstrap)",
48
54
  fieldBootstrapEnabled: "请求 #1 只暴露 Minimal 真实工具对并剥离自动注入上下文,首个持久信号(promoteOn)后恢复——让首轮轨迹锚定极简(参照 dsh-anchored-standard 实测:工具 schema + 注入提醒决定轨迹)",
55
+ bootstrapRealPair: "挂载真实 Minimal 工具对",
56
+ fieldBootstrapRealPair: "把官方 minimal preset 同款插件(持久 PTY bash + str_replace_editor)挂进会话作用域,按名阴影 standard 的 sandboxed bash——schema 与 Minimal 逐字相同才能锚定(issue #11:任何 standard 系 schema 11/11 落入 standard-like);依赖官方插件包,缺失时自动降级",
49
57
  bootstrapTools: "首轮工具",
50
58
  fieldBootstrapTools: "请求 #1 可见的工具(真实 Minimal 对:bash, str_replace_editor)。逗号分隔。",
51
59
  bootstrapPromoteOn: "晋升触发",
@@ -54,6 +62,8 @@ window.__ModuleLoader__.load({
54
62
  fieldBootstrapSuppressed: "请求 #1 剥离的自动注入 source.kind(技能目录提醒 skill-catalog、AGENTS.md 摘要 agent-instructions);逗号分隔,留空=不剥离",
55
63
  bootstrapCompactionTools: "压缩后工作集",
56
64
  fieldBootstrapCompactionTools: "compaction/end 之后、再次晋升前额外可用的工具(核心工作集)。逗号分隔。",
65
+ bootstrapDiscoveryTools: "晋升后常驻发现工具",
66
+ fieldBootstrapDiscoveryTools: "晋升后保留在 resident 目录里的按需发现工具(如 dev_tool_search);逗号分隔。",
57
67
  bootstrapMaxTokens: "首轮输出预算封顶(token)",
58
68
  fieldBootstrapMaxTokens: "请求 #1 的 maxTokens 封顶,晋升后自动剥离;0 = 不封顶(opt-in)",
59
69
  minimalPromptEnabled: "极简提示词层(语域锚定)",
@@ -85,12 +95,20 @@ window.__ModuleLoader__.load({
85
95
  fieldEscalateOnKeyword: "A user message matching a family's trigger words re-enables that family for the session",
86
96
  escalateOnUnknownTool: "Failure escalation",
87
97
  fieldEscalateOnUnknownTool: "A PTC program calling a hidden tool (UNKNOWN_TOOL) re-enables that family",
98
+ suppressInjectedContext: "Always suppress injected context",
99
+ fieldSuppressInjectedContext: "Strip the skill-catalog reminder and the AGENTS.md digest from every request, not just request #1 — replaced by on-demand skill_search/skill_load and a one-shot instruction hint (per dsh-anchored-standard: the injections perturb the trajectory even after promotion)",
100
+ skillDiscovery: "On-demand skill discovery",
101
+ fieldSkillDiscovery: "Keep skill_search / skill_load resident after promotion as the replacement for the ~9KB <available_skills> catalog injection",
102
+ instructionHint: "One-shot instruction hint",
103
+ fieldInstructionHint: "After promotion, inject ONCE a short hint that instruction files exist and should be read when relevant (probes the project chain AGENTS.md/CLAUDE.md and $DSH_HOME/AGENTS.md), instead of dumping their content",
88
104
  families: "Tool families (advanced)",
89
105
  fieldFamilies: "JSON: { familyId: { enabled, tools: [names], keywords: [triggers] } }. Hot-applied on save.",
90
106
  coreTools: "Core tools (never hidden)",
91
107
  fieldCoreTools: "Informational: these never enter any restriction family. Tools not listed in any family stay visible too.",
92
108
  bootstrapEnabled: "First-request bootstrap",
93
109
  fieldBootstrapEnabled: "Request #1 exposes only the real Minimal tool pair and drops auto-injected context; the first durable signal (promoteOn) restores the catalog — anchors the first-request trajectory to minimal (per dsh-anchored-standard measurements)",
110
+ bootstrapRealPair: "Mount the real Minimal tool pair",
111
+ fieldBootstrapRealPair: "Mount the official minimal-preset plugins (persistent PTY bash + str_replace_editor) into the session scope, shadowing the standard sandboxed bash by name — only byte-identical schemas anchor (issue #11: every standard-family schema fell standard-like 11/11); degrades gracefully when the official packages are missing",
94
112
  bootstrapTools: "Bootstrap tools",
95
113
  fieldBootstrapTools: "Tools visible on request #1 (the real Minimal pair: bash, str_replace_editor). Comma-separated.",
96
114
  bootstrapPromoteOn: "Promotion trigger",
@@ -99,6 +117,8 @@ window.__ModuleLoader__.load({
99
117
  fieldBootstrapSuppressed: "Auto-injected source.kinds stripped on request #1 (skill-catalog reminder, agent-instructions digest); comma-separated, empty = strip nothing",
100
118
  bootstrapCompactionTools: "Post-compaction work set",
101
119
  fieldBootstrapCompactionTools: "Extra tools available after compaction/end until a new promotion signal (core work set). Comma-separated.",
120
+ bootstrapDiscoveryTools: "Resident discovery tools",
121
+ fieldBootstrapDiscoveryTools: "On-demand discovery tools kept in the resident catalog after promotion (e.g. dev_tool_search). Comma-separated.",
102
122
  bootstrapMaxTokens: "First-request output cap (tokens)",
103
123
  fieldBootstrapMaxTokens: "maxTokens cap for request #1, stripped after promotion; 0 = no cap (opt-in)",
104
124
  minimalPromptEnabled: "Minimal prompt layer (register anchor)",
@@ -284,6 +304,27 @@ window.__ModuleLoader__.load({
284
304
  disabled: draft === null,
285
305
  onChange: (v) => setDraft({ ...draft, escalateOnUnknownTool: v })
286
306
  }),
307
+ react.createElement(BoolField, {
308
+ label: t("suppressInjectedContext"),
309
+ hint: t("fieldSuppressInjectedContext"),
310
+ value: draft === null ? false : draft.suppressInjectedContext,
311
+ disabled: draft === null,
312
+ onChange: (v) => setDraft({ ...draft, suppressInjectedContext: v })
313
+ }),
314
+ react.createElement(BoolField, {
315
+ label: t("skillDiscovery"),
316
+ hint: t("fieldSkillDiscovery"),
317
+ value: draft === null ? false : draft.skillDiscovery,
318
+ disabled: draft === null,
319
+ onChange: (v) => setDraft({ ...draft, skillDiscovery: v })
320
+ }),
321
+ react.createElement(BoolField, {
322
+ label: t("instructionHint"),
323
+ hint: t("fieldInstructionHint"),
324
+ value: draft === null ? false : draft.instructionHint,
325
+ disabled: draft === null,
326
+ onChange: (v) => setDraft({ ...draft, instructionHint: v })
327
+ }),
287
328
  react.createElement(BoolField, {
288
329
  label: t("bootstrapEnabled"),
289
330
  hint: t("fieldBootstrapEnabled"),
@@ -291,6 +332,13 @@ window.__ModuleLoader__.load({
291
332
  disabled: draft === null,
292
333
  onChange: (v) => setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), enabled: v } })
293
334
  }),
335
+ react.createElement(BoolField, {
336
+ label: t("bootstrapRealPair"),
337
+ hint: t("fieldBootstrapRealPair"),
338
+ value: draft === null ? false : !!draft.bootstrap && draft.bootstrap.realPair,
339
+ disabled: draft === null || (draft.bootstrap && draft.bootstrap.enabled === false),
340
+ onChange: (v) => setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), realPair: v } })
341
+ }),
294
342
  react.createElement(TextField, {
295
343
  label: t("bootstrapTools"),
296
344
  hint: t("fieldBootstrapTools"),
@@ -319,6 +367,13 @@ window.__ModuleLoader__.load({
319
367
  disabled: draft === null || (draft.bootstrap && draft.bootstrap.enabled === false),
320
368
  onChange: (v) => setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), compactionTools: v.split(/[,,\s]+/).filter((x) => x.length > 0) } })
321
369
  }),
370
+ react.createElement(TextField, {
371
+ label: t("bootstrapDiscoveryTools"),
372
+ hint: t("fieldBootstrapDiscoveryTools"),
373
+ value: draft === null ? "" : ((draft.bootstrap && draft.bootstrap.discoveryTools) || []).join(", "),
374
+ disabled: draft === null || (draft.bootstrap && draft.bootstrap.enabled === false),
375
+ onChange: (v) => setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), discoveryTools: v.split(/[,,\s]+/).filter((x) => x.length > 0) } })
376
+ }),
322
377
  react.createElement(TextField, {
323
378
  label: t("bootstrapMaxTokens"),
324
379
  hint: t("fieldBootstrapMaxTokens"),
@@ -446,6 +501,9 @@ window.__ModuleLoader__.load({
446
501
  });
447
502
  ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
448
503
  name: "settings.plugin.item",
504
+ // keyed slot:key 为卡片编辑的设置 namespace(与 host 侧 serviceKey 一致),
505
+ // 设置页按 key 与宿主服务的 namespace 配对 dispatch。
506
+ key: "adaptivePerfConfig",
449
507
  id: "adaptive-perf",
450
508
  order: 40,
451
509
  locale: NS,
package/cordis.patch.yml CHANGED
@@ -15,12 +15,22 @@
15
15
  leanByDefault: true
16
16
  escalateOnKeyword: true
17
17
  escalateOnUnknownTool: true
18
- # 首轮锚定(参照 dsh-anchored-standard 实测):请求 #1 只暴露 Minimal
19
- # 真实工具对并剥离自动注入上下文,首个持久信号后恢复完整目录。
18
+ # 常驻上下文抑制(参照 dsh-anchored-standard):整个会话剥离技能目录
19
+ # 提醒与 AGENTS.md 摘要注入,替代品是 skill_search/skill_load 按需
20
+ # 发现与 instruction-hint 一次性提示。
21
+ suppressInjectedContext: true
22
+ skillDiscovery: true
23
+ instructionHint: true
24
+ # 首轮锚定(参照 dsh-anchored-standard issue #11):请求 #1 只暴露
25
+ # 真实 Minimal 工具对(realPair 挂载官方 minimal preset 同款插件,
26
+ # schema 与 Minimal 逐字相同)并剥离自动注入上下文,首个持久信号后
27
+ # 进入 resident 目录(工具对 + 发现工具 + 已解锁工具)。
20
28
  bootstrap:
21
29
  enabled: true
30
+ realPair: true
22
31
  tools: [bash, str_replace_editor]
23
32
  promoteOn: either
24
33
  suppressedContextSources: [skill-catalog, agent-instructions]
25
34
  compactionTools: [read, write, edit, glob, grep, todo_write, ask_user_question]
35
+ discoveryTools: [dev_tool_search, skill_search, skill_load]
26
36
  maxTokens: 0