@chaoset/adaptive-perf 0.3.2 → 0.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/README.md +106 -11
- package/client/client.cjs +90 -2
- package/cordis.patch.yml +12 -2
- package/lib/index.mjs +817 -45
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -3,23 +3,51 @@
|
|
|
3
3
|
让 **标准模式(standard)** 与 **PTC 模式(code)** 达到 **极简模式(minimal)**
|
|
4
4
|
级别的高性能,同时保留完整能力——不是静态裁剪,而是**动态自适应**:
|
|
5
5
|
|
|
6
|
-
-
|
|
7
|
-
|
|
6
|
+
- **真实 Minimal 工具对(realPair)**:首轮"轨迹"由请求 #1 可见的**工具 schema**
|
|
7
|
+
逐字决定——只有与 Minimal 完全相同的 schema 能锚定(参照
|
|
8
8
|
[dsh-anchored-standard](https://github.com/xiaobright/dsh-anchored-standard/)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
实测:真实工具对 5/5 锚定,任何 standard 系 schema——包括 sandboxed
|
|
10
|
+
bash/read——11/11 落入 standard-like)。本插件把官方 minimal preset 同款插件
|
|
11
|
+
(持久 PTY bash + `str_replace_editor`,含逐字相同的描述)挂进会话作用域,
|
|
12
|
+
按名阴影 standard 的 sandboxed bash——**不是**只把目录收窄到同名工具。
|
|
13
|
+
- **首轮锚定(bootstrap)**:决定首轮"轨迹"(思维链风格)的是请求 #1 可见的
|
|
14
|
+
**工具 schema** 与**自动注入的上下文提醒**。因此:
|
|
15
|
+
- 请求 #1 的工具目录 = 真实 Minimal 工具对(`bash` + `str_replace_editor`);
|
|
12
16
|
- 请求 #1 剥离自动注入上下文(技能目录提醒 `skill-catalog`、AGENTS.md 摘要
|
|
13
17
|
`agent-instructions`,用户主动的技能手势不过滤);
|
|
14
18
|
- 会话出现首个**持久**晋升信号(首个 `tool/call` 或 `assistant/message`,
|
|
15
|
-
`promoteOn` 可选 `either`/`tool-call`/`assistant-message
|
|
16
|
-
|
|
19
|
+
`promoteOn` 可选 `either`/`tool-call`/`assistant-message`)后进入 **resident
|
|
20
|
+
目录**:bootstrap 工具对 + 常驻发现工具(`dev_tool_search` +
|
|
21
|
+
`skill_search` + `skill_load`)+ 已解锁工具,而不是一次性 dump 完整
|
|
22
|
+
Standard 目录(避免 post-promotion regression);阶段从持久会话事件推导,
|
|
23
|
+
**resume / reload 不丢状态**;
|
|
24
|
+
- `dev_tool_search` 可搜索完整目录并按名解锁工具,解锁结果下一请求生效;
|
|
17
25
|
- compaction 会把会话打回"第二次首轮":`compaction/end` 之后回到受控目录
|
|
18
26
|
(bootstrap 工具对 + `compactionTools` 核心工作集),直到出现新的晋升信号;
|
|
19
27
|
- `maxTokens > 0` 时可给请求 #1 封顶输出预算(晋升后自动剥离)。
|
|
28
|
+
- **常驻上下文抑制(suppressInjectedContext)**:技能目录提醒与 AGENTS.md 摘要
|
|
29
|
+
**不再在晋升后恢复**——参考实现实测它们即使在后置阶段也扰动轨迹,且每个请求
|
|
30
|
+
多耗数千 token。替代品:
|
|
31
|
+
- `skill_search` / `skill_load`:晋升后常驻的两个小工具,按需发现并注入单个
|
|
32
|
+
技能的完整说明(替代 ~9KB 的 `<available_skills>` 目录注入);
|
|
33
|
+
- `instruction-hint`:晋升后只注入**一次**的短提示——"指令文件存在,需要时
|
|
34
|
+
自己读",而不是每请求 dump 全文(探测项目链 AGENTS.md/CLAUDE.md 与
|
|
35
|
+
`$DSH_HOME/AGENTS.md`,探测失败不注入,绝不抛错)。
|
|
20
36
|
- **运行时上下文抑制**:对目标 preset 的会话调用 `suppressRuntimeContext()`
|
|
21
37
|
(与极简模式的 `includeRuntimeContext: false` 同一机制),每次模型请求省掉
|
|
22
38
|
"Current runtime context" 快照文本,**零功能损失**。
|
|
39
|
+
- **极简提示词层(minimalPrompt)**:参考实现的完整锚定条件——首轮轨迹由
|
|
40
|
+
**Minimal 的完整 system prompt** 决定,只收窄工具 schema 不够(标准/PTC 的
|
|
41
|
+
系统提示仍带 `harness:identity` / `harness:source` / `app:web-surface` 三个
|
|
42
|
+
全局引导段与标准 persona,思维链仍是 standard-like 的 "Let me…" 叙述)。本层
|
|
43
|
+
对目标会话:
|
|
44
|
+
- 按名阴影屏蔽三个全局引导段(空段在装配时被丢弃,等同极简 `complete`
|
|
45
|
+
persona 的效果;plan-mode 与 PTC 的 SDK 段不受影响);
|
|
46
|
+
- 按名阴影替换 `deployment:persona` 为极简语域 persona(默认与极简模式
|
|
47
|
+
逐字相同:`You are a helpful software engineer assistant.`);
|
|
48
|
+
- 挂载真实工具对时按名阴影 `tool:bash` 引导段(与可见工具一致)。
|
|
49
|
+
各处均为 agent 作用域的 prompt 段阴影,仅影响目标会话;**对已恢复/已晋升的
|
|
50
|
+
旧会话同样生效**(不依赖 bootstrap 阶段)。
|
|
23
51
|
- **工具目录自适应精简**:会话启动时按"工具族"默认隐藏高开销低频工具
|
|
24
52
|
(子代理 / 工作流 / ralph / goal 等编排类),只保留核心编码工具
|
|
25
53
|
(bash / 文件读写编辑 / 检索 / jobs / todo / 提问 / 网页搜索 / 技能 / 计划)。
|
|
@@ -34,10 +62,12 @@
|
|
|
34
62
|
|
|
35
63
|
| 维度 | 极简模式 | 标准 / PTC 模式 | 本插件做法 |
|
|
36
64
|
|---|---|---|---|
|
|
37
|
-
| 首轮轨迹(决定后续行为风格) | Minimal
|
|
65
|
+
| 首轮轨迹(决定后续行为风格) | Minimal 真实工具对锚定(5/5) | 任何 standard 系 schema(含 sandboxed bash)落入 standard-like(11/11) | realPair 挂载官方同款插件:请求 #1 的 schema 与 Minimal 逐字相同,首个持久信号后进 resident 目录 |
|
|
38
66
|
| 首轮注入提醒 | 无 skill 目录/AGENTS.md 注入 | 自动注入(在场时锚定 0/9) | 请求 #1 剥离 `skill-catalog` + `agent-instructions` |
|
|
67
|
+
| 后置阶段注入 | 永不注入 | 晋升后每请求恢复 ~9KB 目录 + AGENTS.md 全文 | `suppressInjectedContext`:整个会话抑制;替代品为 `skill_search`/`skill_load` + 一次性 `instruction-hint` |
|
|
68
|
+
| 系统提示语域(persona + 全局引导段) | 一句话 persona,无任何引导段 | identity/source/web-surface 引导段 + 标准 persona("Let me…" 叙述来源) | minimalPrompt 层按名阴影屏蔽 3 个全局段 + 替换极简 persona(对旧会话同样生效) |
|
|
39
69
|
| 运行时上下文快照 | 关闭(`includeRuntimeContext: false`) | 每次请求注入文件策略/审批策略等快照 | 同一机制:`suppressRuntimeContext()` |
|
|
40
|
-
| 模型可见工具目录 | 2 个(bash、str_replace_editor) | ~22 个工具 schema 全部进请求 |
|
|
70
|
+
| 模型可见工具目录 | 2 个(bash、str_replace_editor) | ~22 个工具 schema 全部进请求 | 首轮 2 个;晋升后 resident 目录(工具对 + 发现工具 + 已解锁),编排族默认隐藏按需放行 |
|
|
41
71
|
| PTC SDK 参考段 | 无 | 全部工具的类型+描述渲染进提示 | 随目录缩小(同一 `visible` 视图驱动) |
|
|
42
72
|
|
|
43
73
|
## 安装(npm 生态方式)
|
|
@@ -84,11 +114,62 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
|
|
|
84
114
|
| `enabled` | `true` | 总开关 |
|
|
85
115
|
| `presets` | `["standard", "code"]` | 应用自适应的 preset id |
|
|
86
116
|
| `suppressRuntimeContext` | `true` | 抑制运行时上下文快照(零功能损失) |
|
|
117
|
+
| `suppressInjectedContext` | `true` | 整个会话剥离技能目录/AGENTS.md 注入(0.5.0;`false` = 只在请求 #1 剥离) |
|
|
118
|
+
| `skillDiscovery` | `true` | 晋升后常驻 `skill_search` / `skill_load`(0.5.0) |
|
|
119
|
+
| `instructionHint` | `true` | 晋升后一次性注入指令文件提示(0.5.0) |
|
|
87
120
|
| `leanByDefault` | `true` | 会话启动即隐藏编排类工具族 |
|
|
88
121
|
| `escalateOnKeyword` | `true` | 用户消息命中触发词 → 放行该族 |
|
|
89
122
|
| `escalateOnUnknownTool` | `true` | 工具调用失败(UNKNOWN_TOOL)→ 放行该族 |
|
|
90
123
|
| `coreTools` | 核心编码工具 | 展示用:不进入任何限制族 |
|
|
91
124
|
| `families` | 见下 | 工具族:`{ 族名: { enabled, tools, keywords } }` |
|
|
125
|
+
| `bootstrap` | 见下 | 首轮锚定(真实工具对 / 晋升信号 / 剥离上下文 / 压缩恢复集 / resident 发现工具 / 预算封顶) |
|
|
126
|
+
| `minimalPrompt` | 见下 | 极简提示词层(语域锚定) |
|
|
127
|
+
|
|
128
|
+
`bootstrap`(首轮锚定):
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"enabled": true,
|
|
133
|
+
"realPair": true,
|
|
134
|
+
"tools": ["bash", "str_replace_editor"],
|
|
135
|
+
"promoteOn": "either",
|
|
136
|
+
"suppressedContextSources": ["skill-catalog", "agent-instructions"],
|
|
137
|
+
"compactionTools": ["read", "write", "edit", "glob", "grep", "todo_write", "ask_user_question"],
|
|
138
|
+
"discoveryTools": ["dev_tool_search", "skill_search", "skill_load"],
|
|
139
|
+
"maxTokens": 0
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- `realPair`(0.5.0):把官方 minimal preset 同款插件(持久 PTY bash +
|
|
144
|
+
`str_replace_editor`)挂进会话作用域,按名阴影 standard 的 sandboxed
|
|
145
|
+
bash——请求 #1 的 schema 与 Minimal 逐字相同(只有逐字相同的 schema 能
|
|
146
|
+
锚定)。依赖 `@deepseek-ai` 官方插件包(optionalDependencies);缺失或
|
|
147
|
+
Windows(无 PTY 后端)时自动降级为"仅收窄目录"并告警。
|
|
148
|
+
- `tools`:请求 #1 可见的工具(真实 Minimal 对)。
|
|
149
|
+
- `promoteOn`:`either`(默认)/ `tool-call` / `assistant-message`。
|
|
150
|
+
- `suppressedContextSources`:剥离的自动注入 source.kind;`[]` 关闭剥离。
|
|
151
|
+
- `compactionTools`:compaction/end 之后、再次晋升前可用的核心工作集。
|
|
152
|
+
- `discoveryTools`:晋升后 resident 目录里的按需发现工具
|
|
153
|
+
(`dev_tool_search` 解锁工具;`skill_search`/`skill_load` 按需加载技能)。
|
|
154
|
+
- `maxTokens`:请求 #1 输出预算封顶(0 = 不封顶,opt-in)。
|
|
155
|
+
|
|
156
|
+
`minimalPrompt`(极简提示词层,0.4.0 新增):
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"enabled": true,
|
|
161
|
+
"persona": "You are a helpful software engineer assistant.",
|
|
162
|
+
"suppressSections": true
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
- `persona`:按名阴影替换 `deployment:persona`;默认与极简模式逐字相同,留空
|
|
167
|
+
(`""`)则不替换。
|
|
168
|
+
- `suppressSections`:屏蔽 `harness:identity` / `harness:source` / `app:web-surface`
|
|
169
|
+
三个全局引导段(等同极简 `complete` persona 的效果;plan-mode 与 PTC 的
|
|
170
|
+
SDK 段不受影响)。
|
|
171
|
+
- 生效范围:目标 preset 的全部会话,**包括已恢复/已晋升的旧会话**(不依赖
|
|
172
|
+
bootstrap 阶段);配置保存后热生效。
|
|
92
173
|
|
|
93
174
|
默认工具族(可整族禁用、改名、增删触发词):
|
|
94
175
|
|
|
@@ -110,8 +191,22 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
|
|
|
110
191
|
- 监听 host 根作用域的 `agent/created` / `agent/disposed` / `agent/inbox/inserted`
|
|
111
192
|
/ `tools/result`(与 `dsh-agent-presets` 自身同款事件用法),按
|
|
112
193
|
`agentPresets.composedPreset(agent.ctx)` 识别目标 preset
|
|
194
|
+
- **真实工具对**:`agent.ctx.plugin()` 把 `dsh-terminal` + `dsh-terminal-bash`
|
|
195
|
+
+ `dsh-tool-bash-persistent`(Minimal 逐字描述)+ `dsh-fs-local` +
|
|
196
|
+
`dsh-tool-str-replace-editor` 挂进 agent 作用域;scoped registration 按名
|
|
197
|
+
阴影继承的 sandboxed bash,且 `view()` 对 own layer 豁免 restrict——首轮
|
|
198
|
+
目录 = 真实工具对 + 被 deny 的其他继承工具;每个挂载是独立 fiber,
|
|
199
|
+
agent 销毁/插件卸载/配置关闭时全部撤销
|
|
113
200
|
- 限制通过 `agent.ctx.tools.restrict({ deny })` 逐族注册:多族限制自动取交集,
|
|
114
201
|
升级 = 释放该族 disposer(单会话单调、一次性目录变化,缓存失效有界)
|
|
202
|
+
- 发现工具(`dev_tool_search` / `skill_search` / `skill_load`)同样注册在
|
|
203
|
+
agent 作用域:已解锁工具写入会话状态并重算 deny 集;技能经宿主 `skills`
|
|
204
|
+
服务按 agent scope 查询,`skill_load` 用 `agent.inject` 以
|
|
205
|
+
`skill-invocation` 来源注入(用户技能手势同款,不被默认抑制集剥离)
|
|
206
|
+
- 上下文剥离与 instruction-hint 都在 `agent/pre-step`(prepend 注册,最后
|
|
207
|
+
一道变换):剥离失败绝不吞用户上下文;指令文件探测走宿主 `fs`,失败不注入
|
|
115
208
|
- 会话启动/插件重载时用 `tools.schemas(agent)` 记录可见目录,限制与之取交集
|
|
116
|
-
-
|
|
117
|
-
|
|
209
|
+
- 全部副作用(抑制器、限制、工具注册、提示段、监听)随 agent 销毁或插件
|
|
210
|
+
卸载自动释放
|
|
211
|
+
- **fail-safe**:插件任何内部错误只记日志,不拖垮 harness;官方插件包缺失
|
|
212
|
+
时自动降级
|
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,8 +62,16 @@ 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
|
-
fieldBootstrapMaxTokens: "请求 #1 的 maxTokens 封顶,晋升后自动剥离;0 = 不封顶(opt-in)"
|
|
68
|
+
fieldBootstrapMaxTokens: "请求 #1 的 maxTokens 封顶,晋升后自动剥离;0 = 不封顶(opt-in)",
|
|
69
|
+
minimalPromptEnabled: "极简提示词层(语域锚定)",
|
|
70
|
+
fieldMinimalPromptEnabled: "把系统提示拉回极简语域:屏蔽全局引导段 + 替换 persona。参考实现的完整锚定条件——仅收窄工具不足以翻转思维链风格(let me → let's/i'll/i need)",
|
|
71
|
+
minimalPromptPersona: "persona 文本",
|
|
72
|
+
fieldMinimalPromptPersona: "按名替换 deployment:persona;默认与极简模式逐字相同。留空 = 不替换(保留原 persona)",
|
|
73
|
+
minimalPromptSuppressSections: "屏蔽全局引导段",
|
|
74
|
+
fieldMinimalPromptSuppressSections: "屏蔽 harness:identity / harness:source / app:web-surface 三个全局段(等同极简 complete persona 的效果;plan-mode 与 PTC 的 SDK 段不受影响)"
|
|
59
75
|
};
|
|
60
76
|
const en = {
|
|
61
77
|
title: "Adaptive performance (adaptive-perf)",
|
|
@@ -79,12 +95,20 @@ window.__ModuleLoader__.load({
|
|
|
79
95
|
fieldEscalateOnKeyword: "A user message matching a family's trigger words re-enables that family for the session",
|
|
80
96
|
escalateOnUnknownTool: "Failure escalation",
|
|
81
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",
|
|
82
104
|
families: "Tool families (advanced)",
|
|
83
105
|
fieldFamilies: "JSON: { familyId: { enabled, tools: [names], keywords: [triggers] } }. Hot-applied on save.",
|
|
84
106
|
coreTools: "Core tools (never hidden)",
|
|
85
107
|
fieldCoreTools: "Informational: these never enter any restriction family. Tools not listed in any family stay visible too.",
|
|
86
108
|
bootstrapEnabled: "First-request bootstrap",
|
|
87
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",
|
|
88
112
|
bootstrapTools: "Bootstrap tools",
|
|
89
113
|
fieldBootstrapTools: "Tools visible on request #1 (the real Minimal pair: bash, str_replace_editor). Comma-separated.",
|
|
90
114
|
bootstrapPromoteOn: "Promotion trigger",
|
|
@@ -93,8 +117,16 @@ window.__ModuleLoader__.load({
|
|
|
93
117
|
fieldBootstrapSuppressed: "Auto-injected source.kinds stripped on request #1 (skill-catalog reminder, agent-instructions digest); comma-separated, empty = strip nothing",
|
|
94
118
|
bootstrapCompactionTools: "Post-compaction work set",
|
|
95
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.",
|
|
96
122
|
bootstrapMaxTokens: "First-request output cap (tokens)",
|
|
97
|
-
fieldBootstrapMaxTokens: "maxTokens cap for request #1, stripped after promotion; 0 = no cap (opt-in)"
|
|
123
|
+
fieldBootstrapMaxTokens: "maxTokens cap for request #1, stripped after promotion; 0 = no cap (opt-in)",
|
|
124
|
+
minimalPromptEnabled: "Minimal prompt layer (register anchor)",
|
|
125
|
+
fieldMinimalPromptEnabled: "Pull the system prompt back to the minimal register: suppress the global orientation sections and replace the persona. The reference's full anchoring condition — tool narrowing alone does not flip the thinking style (let me → let's/i'll/i need)",
|
|
126
|
+
minimalPromptPersona: "Persona text",
|
|
127
|
+
fieldMinimalPromptPersona: "Shadows deployment:persona by name; defaults to the exact minimal-mode text. Empty = keep the original persona",
|
|
128
|
+
minimalPromptSuppressSections: "Suppress global orientation sections",
|
|
129
|
+
fieldMinimalPromptSuppressSections: "Shadow harness:identity / harness:source / app:web-surface to empty (same effect as minimal's complete persona; plan-mode and the PTC SDK sections are unaffected)"
|
|
98
130
|
};
|
|
99
131
|
|
|
100
132
|
// ── 表单字段 ─────────────────────────────────────────────────────────
|
|
@@ -272,6 +304,27 @@ window.__ModuleLoader__.load({
|
|
|
272
304
|
disabled: draft === null,
|
|
273
305
|
onChange: (v) => setDraft({ ...draft, escalateOnUnknownTool: v })
|
|
274
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
|
+
}),
|
|
275
328
|
react.createElement(BoolField, {
|
|
276
329
|
label: t("bootstrapEnabled"),
|
|
277
330
|
hint: t("fieldBootstrapEnabled"),
|
|
@@ -279,6 +332,13 @@ window.__ModuleLoader__.load({
|
|
|
279
332
|
disabled: draft === null,
|
|
280
333
|
onChange: (v) => setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), enabled: v } })
|
|
281
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
|
+
}),
|
|
282
342
|
react.createElement(TextField, {
|
|
283
343
|
label: t("bootstrapTools"),
|
|
284
344
|
hint: t("fieldBootstrapTools"),
|
|
@@ -307,6 +367,13 @@ window.__ModuleLoader__.load({
|
|
|
307
367
|
disabled: draft === null || (draft.bootstrap && draft.bootstrap.enabled === false),
|
|
308
368
|
onChange: (v) => setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), compactionTools: v.split(/[,,\s]+/).filter((x) => x.length > 0) } })
|
|
309
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
|
+
}),
|
|
310
377
|
react.createElement(TextField, {
|
|
311
378
|
label: t("bootstrapMaxTokens"),
|
|
312
379
|
hint: t("fieldBootstrapMaxTokens"),
|
|
@@ -317,6 +384,27 @@ window.__ModuleLoader__.load({
|
|
|
317
384
|
setDraft({ ...draft, bootstrap: { ...(draft.bootstrap || {}), maxTokens: Number.isSafeInteger(n) && n > 0 ? n : 0 } });
|
|
318
385
|
}
|
|
319
386
|
}),
|
|
387
|
+
react.createElement(BoolField, {
|
|
388
|
+
label: t("minimalPromptEnabled"),
|
|
389
|
+
hint: t("fieldMinimalPromptEnabled"),
|
|
390
|
+
value: draft === null ? false : (draft.minimalPrompt && draft.minimalPrompt.enabled === true),
|
|
391
|
+
disabled: draft === null,
|
|
392
|
+
onChange: (v) => setDraft({ ...draft, minimalPrompt: { ...(draft.minimalPrompt || {}), enabled: v } })
|
|
393
|
+
}),
|
|
394
|
+
react.createElement(BoolField, {
|
|
395
|
+
label: t("minimalPromptSuppressSections"),
|
|
396
|
+
hint: t("fieldMinimalPromptSuppressSections"),
|
|
397
|
+
value: draft === null ? false : (draft.minimalPrompt && draft.minimalPrompt.suppressSections === true),
|
|
398
|
+
disabled: draft === null || (draft.minimalPrompt && draft.minimalPrompt.enabled === false),
|
|
399
|
+
onChange: (v) => setDraft({ ...draft, minimalPrompt: { ...(draft.minimalPrompt || {}), suppressSections: v } })
|
|
400
|
+
}),
|
|
401
|
+
react.createElement(TextField, {
|
|
402
|
+
label: t("minimalPromptPersona"),
|
|
403
|
+
hint: t("fieldMinimalPromptPersona"),
|
|
404
|
+
value: draft === null ? "" : ((draft.minimalPrompt && draft.minimalPrompt.persona) || ""),
|
|
405
|
+
disabled: draft === null || (draft.minimalPrompt && draft.minimalPrompt.enabled === false),
|
|
406
|
+
onChange: (v) => setDraft({ ...draft, minimalPrompt: { ...(draft.minimalPrompt || {}), persona: v } })
|
|
407
|
+
}),
|
|
320
408
|
react.createElement(Field, {
|
|
321
409
|
label: t("families"),
|
|
322
410
|
hint: familiesInvalid ? t("invalidFamilies") + (familiesError !== null ? " — " + familiesError : "") : t("fieldFamilies")
|
package/cordis.patch.yml
CHANGED
|
@@ -15,12 +15,22 @@
|
|
|
15
15
|
leanByDefault: true
|
|
16
16
|
escalateOnKeyword: true
|
|
17
17
|
escalateOnUnknownTool: true
|
|
18
|
-
#
|
|
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
|