@chaoset/adaptive-perf 0.10.0 → 0.10.1

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 CHANGED
@@ -1,255 +1,245 @@
1
1
  # Changelog
2
2
 
3
- ## [0.10.0](https://github.com/winliyou/dsh-plugins) (2026-08-28)
3
+ ## 0.10.1 (2026-08-29)
4
4
 
5
5
  ### Features
6
6
 
7
- * **适配 DSH 0.1.2 的 PTC preset 更名**:0.1.2 把 PTC 模式的 preset id 由
8
- `code` 改为 `ptc`(commit "rename code-mode to ptc"),默认 presets 改为
9
- `['standard', 'code', 'ptc', 'cordis']`——新旧宿主都覆盖,不存在的 id 无
10
- 副作用;设置页默认值/提示文本同步。section 阴影 order 常量更新为 0.1.2
11
- 参考值(阴影按 name 匹配、order 仅排序,新旧宿主效果一致)
7
+ * 设置卡片初次读取配置时在状态栏显示 spinner +「加载中…」(respect
8
+ `prefers-reduced-motion`):此前只显示禁用态的默认值表单,无法区分加载中与
9
+ 加载失败
12
10
 
13
- ### Bug Fixes
11
+ ## 0.10.0 (2026-08-28)
14
12
 
15
- * **支持从源码运行的 DSH**:真实 Minimal 工具对的官方包导入链首插安装闭包
16
- 共享 fallback `$DSH_HOME/profiles/node_modules/<pkg>`(harness 启动时
17
- heal 的依赖闭包镜像,npm 安装与源码运行都会建立),以 realpath 导入保证
18
- 与 harness 同一模块实例。修复本地路径安装(插件 realpath 在插件仓库)时
19
- 裸 import 解析不到官方包、realPair 静默降级的问题;remote 服务的
20
- typert-protocol 同样优先 fallback。已对照 dsh 源码 0.1.2-alpha.1 复核
21
- systemPrompt/tools/skills/agentPresets 契约无变化
13
+ ### Features
22
14
 
23
- ## [0.9.1](https://github.com/winliyou/dsh-plugins) (2026-08-28)
15
+ * 适配 DSH 0.1.2 的 PTC preset 更名:0.1.2 把 PTC 模式的 preset id 由 `code`
16
+ 改为 `ptc`,默认 presets 改为 `['standard', 'code', 'ptc', 'cordis']`——新旧
17
+ 宿主都覆盖,不存在的 id 无副作用;设置页默认值/提示文本同步
24
18
 
25
19
  ### Bug Fixes
26
20
 
27
- * **适配 DSH 0.1.1-rc.2**:6 个 `@deepseek-ai/*` optionalDependencies(typert-protocol / terminal / terminal-bash / tool-bash-persistent / fs-local / tool-str-replace-editor)range 从 `^0.1.0-rc.8` 升到 `^0.1.1-rc.2`。npm semver 的 prerelease 规则下旧 range 无法匹配 `0.1.1-rc.2`,新版宿主下真实 Minimal 工具对的官方模块会解析到旧版本或缺失
28
- * 已对照 0.1.1-rc.2 全量 diff 官方包:agent/service 事件、systemPrompt、tools、skills、agentPresets 契约无变化,运行时逻辑无需调整
29
-
30
- ## [0.9.0](https://github.com/winliyou/dsh-plugins) (2026-08-25)
31
-
32
- ### Features
21
+ * 支持从源码运行的 DSH:真实 Minimal 工具对的官方包导入链首插安装闭包共享
22
+ fallback `$DSH_HOME/profiles/node_modules/<pkg>`,以 realpath 导入保证与
23
+ harness 同一模块实例;修复本地路径安装时裸 import 解析不到官方包、realPair
24
+ 静默降级的问题。已对照 dsh 源码 0.1.2-alpha.1 复核 systemPrompt / tools /
25
+ skills / agentPresets 契约无变化
33
26
 
34
- * 设置卡片按语义分组折叠(首轮锚定 / 极简提示词层 / 高级 JSON 默认收起):20+ 字段不再一屏平铺,渐进披露;分组头带 `aria-expanded`
35
- * `bootstrap.maxTokens` 数字输入改草稿态:编辑期保留原始输入(清空/删改中间态不立即跳回 0),失焦才归一化显示,消除输入被强制改写的突兀感
27
+ ## 0.9.1 (2026-08-28)
36
28
 
37
29
  ### Bug Fixes
38
30
 
39
- * `session/event` 处理器对 `agents.get(session.id)` 的 `agent.id === session.id` 隐含契约加防御性兜底(按 `agent.session.id` 匹配)并注释说明:未来二者分离时晋升信号不再静默丢配导致 bootstrap restrict 不释放
40
- * 修复 `applyFamilies`JSDoc 注释与函数签名挤在同一行的格式瑕疵
31
+ * 适配 DSH 0.1.1-rc.2:6 `@deepseek-ai/*` optionalDependencies range
32
+ `^0.1.0-rc.8` 升到 `^0.1.1-rc.2`(npm semver prerelease 规则下旧 range
33
+ 无法匹配 `0.1.1-rc.2`,新版宿主下官方模块会解析到旧版本或缺失)
34
+ * 已对照 0.1.1-rc.2 全量 diff 官方包:各契约无变化,运行时逻辑无需调整
41
35
 
42
- ## [0.8.0](https://github.com/winliyou/dsh-plugins) (2026-08-22)
36
+ ## 0.9.0 (2026-08-25)
43
37
 
44
38
  ### Features
45
39
 
46
- * **`keywordMatchMode` config** (`smart`(default) | `substring` | `word`): escalation keywords containing CJK keep substring matching (CJK has no word boundaries — `\b` would never match a pure-CJK keyword), pure-ASCII words match on word boundaries via lookarounds (`(?<![a-z0-9_])kw(?![a-z0-9_])`, more predictable than `\b`). Statement text like "the goal is to refactor" or "goalish" no longer falsely escalates the goal family on the substring "goal"; `substring` restores pre-0.8.0 behavior; validated in `remote.set` and normalized with fallback
47
- * explicit empty arrays are now legal values for all string-list config fields (`presets`, `bootstrap.tools`, family tools/keywords…): previously an emptied list was silently reverted to the default on save, so "apply no preset" was impossible to express
40
+ * 设置卡片按语义分组折叠(首轮锚定 / 极简提示词层 / 高级 JSON 默认收起):
41
+ 20+ 字段不再一屏平铺,渐进披露;分组头带 `aria-expanded`
42
+ * `bootstrap.maxTokens` 数字输入改草稿态:编辑期保留原始输入(清空/删改中间态
43
+ 不立即跳回 0),失焦才归一化显示
48
44
 
49
45
  ### Bug Fixes
50
46
 
51
- * pre-step injected-context stripping now requires bootstrap enabled: with `bootstrap.enabled=false` injections were stripped while no discovery tools were registered as compensation — unrecoverable context loss
52
- * hot-updating `bootstrap.promoteOn` now takes effect for already-tracked sessions: the phase cache is invalidated and rebuilt from the persistent journal (persistent promotion signals survive the rebuild)
53
- * per-message overhead reduced: composed preset resolved once per agent instead of once per message; suppressed-context-sources Set cached by content key instead of rebuilt per message; preset lookup failure warning capped at 20 occurrences
54
- * settings card: `promoteOn` is a select, `maxTokens` a number input (invalid input can no longer be saved); loading placeholder for `suppressInjectedContext` matches the real default; error notices render in the header badge so they are visible while collapsed; dirty detection compares field-by-field instead of order-sensitive JSON.stringify; error color referenced the non-existent `state-danger-primary` token so errors never rendered red (now `state-error-primary`)
55
- * removed `filterBootstrapMessages` (exact duplicate of `stripSuppressedMessages`); fixed malformed nested JSDoc on dev_tool_search; description truncation operator-precedence bug (`split('\n')[0].slice(...)` could throw under `noUncheckedIndexedAccess` semantics)
56
-
57
- ## [0.7.3](https://github.com/winliyou/dsh-plugins) (2026-08-22)
58
-
59
- ### Bug Fixes
47
+ * `session/event` 处理器对 `agents.get(session.id)` 的隐含契约
48
+ (`agent.id === session.id`)加防御性兜底(按 `agent.session.id` 匹配):
49
+ 未来二者分离时晋升信号不再静默丢配导致 bootstrap restrict 不释放
60
50
 
61
- * **P0 dev_tool_search used the post-restrict catalog**: tools hidden by restrict layers were undiscoverable/unlockable; it now searches a pre-restrict snapshot captured at agent setup
62
- * **P0 escalate() did not recompute the bootstrap deny set**: after an escalation signal, family tools stayed hidden behind the second restrict layer; escalate now resyncs the keep-set so the release takes effect on the next request
63
- * real Minimal tool pair remounts idempotently via a state key: unrelated hot-updates no longer destroy/recreate persistent PTY bashes (cwd/env/background jobs survive)
64
- * first-round maxTokens cap: listener always registered with in-callback branching (0→N hot-update works; N→0 strips the field instead of injecting 0); promotion strips any cap injected this session including stale values from before a hot-update change
65
- * custom tool families defined in settings survive normalizeConfig (previously silently dropped)
66
- * test mocks made host-faithful (schemas reflect active restrict layers); regression tests added for both P0s
67
-
68
- ## [0.7.2](https://github.com/winliyou/dsh-plugins) (2026-08-22)
69
-
70
- * align with dsh 0.1.0-rc.8 dependency set
71
-
72
- ## [0.7.0](https://github.com/winliyou/dsh-plugins) (2026-08-18)
51
+ ## 0.8.0 (2026-08-22)
73
52
 
74
53
  ### Features
75
54
 
76
- * **first-round anchoring, resident catalog after promotion (anchored-standard semantics).** Only request #1 is composed under Minimal conditions (real Minimal tool pair + minimal persona + suppressed global guide sections + stripped `skill-catalog`/`agent-instructions` injections + suppressed runtime snapshot); after the first persistent promotion signal (first `tool/call` or `assistant/message`) the session enters the **resident phase**: the bootstrap tool pair stays resident together with the discovery tools (`dev_tool_search`/`skill_search`/`skill_load`), the full catalog is unlocked on demand via `dev_tool_search`, and normal context injection becomes visible again. Performance is raised without reducing functionality — dumping the full catalog at promotion pulls the trajectory back to standard-like (the reference implementation's post-promotion regression), so the full catalog is fetched on demand instead. The tool/skill/web-search/plan/goal/subagent/workflow abilities of each mode remain fully available
77
-
78
- * **promotion is now persistent.** `scanPhase`/`observePhase` no longer reset on `compaction/end` (epoch-aware boundary removed); promotion is remembered per session like the reference implementation, so resume/reload and post-compaction rounds keep the resident catalog
55
+ * 新增 `keywordMatchMode` 配置(`smart` 默认 / `substring` / `word`):含 CJK
56
+ 的触发词保持子串匹配(CJK 无词边界,`\b` 永远匹配不到纯 CJK 关键词),纯
57
+ ASCII 词按词边界匹配(`(?<![a-z0-9_])kw(?![a-z0-9_])`,比 `\b` 更可预测)。
58
+ "the goal is to refactor" 或 "goalish" 不再因子串 "goal" 误触发 goal 族放行;
59
+ `substring` 恢复此前的行为;`remote.set` 校验并归一化(非法回退默认)
60
+ * 所有字符串列表字段(`presets`、`bootstrap.tools`、工具族 tools/keywords 等)
61
+ 允许显式空数组:此前清空列表保存会被静默还原为默认值,无法表达「不应用任何
62
+ preset」
79
63
 
80
- * **catalog is zero-trimmed by default.** `leanByDefault` defaults to `false`: orchestration tool families (subagent/workflow/ralph/goal) are never hidden unless explicitly opted in. `suppressInjectedContext` defaults to `true` (injections stay stripped for the whole session; visibility is carried by the resident discovery tools — measured: restoring injections after promotion pulls the trajectory back to standard-like, "Let me…" narration returns). Setting it to `false` restores post-promotion injections as an opt-in
64
+ ### Bug Fixes
81
65
 
82
- * **creator mode (cordis) is a target preset.** `presets` defaults to `["standard", "code", "cordis"]` in the bundle patch, the settings UI, and DEFAULT_CONFIG — the creator preset gets the same minimal-anchored first round
66
+ * pre-step 注入剥离要求 bootstrap 开启:`bootstrap.enabled=false` 时此前仍会
67
+ 剥离注入而没有发现工具补偿,造成不可恢复的上下文丢失
68
+ * 热更新 `bootstrap.promoteOn` 对已跟踪会话生效:阶段缓存失效并从持久事件流
69
+ 重建(持久晋升信号在重建中保留)
70
+ * 降低每条消息开销:composed preset 每个 agent 解析一次而非每条消息;抑制
71
+ source 集合按内容缓存;preset 查找失败告警限 20 次
72
+ * 设置卡片:`promoteOn` 改下拉、`maxTokens` 改数字输入(非法输入不可保存);
73
+ 错误提示在折叠态也经头部徽标可见;dirty 判定改为逐字段比较(不再依赖键序
74
+ 敏感的 JSON.stringify);错误色修正为真实存在的 `state-error-primary` token
75
+ (此前引用不存在的 token,错误永远不显示红色)
76
+ * 删除与 `stripSuppressedMessages` 完全重复的 `filterBootstrapMessages`;修复
77
+ dev_tool_search 描述截断的运算符优先级 bug
78
+
79
+ ## 0.7.3 (2026-08-22)
83
80
 
84
- ### Breaking (config)
81
+ ### Bug Fixes
85
82
 
86
- * **removed `skillDiscovery`, `instructionHint`, `bootstrap.compactionTools`; restored `bootstrap.discoveryTools`.** Under resident-catalog semantics the on-demand discovery is done by the resident `dev_tool_search`, so the one-shot instruction hint and the post-compaction work set are no longer needed; `bootstrap.discoveryTools` (default `dev_tool_search`/`skill_search`/`skill_load`) is restored as the resident post-promotion discovery set. The discovery tool factories (`createDevToolSearch`/`createSkillSearch`/`createSkillLoad`/`extractSkillBody`) and `loadUnlockedFromEvents` are back; saved configs ignore the removed fields; the settings UI renders the discovery-tools control again; `leanByDefault` keeps its new default (false) while `suppressInjectedContext` defaults to `true`
83
+ * **dev_tool_search 使用 restrict 后的目录(P0)**:被 restrict 隐藏的工具不可
84
+ 发现也不可解锁;改为搜索 agent 建立时捕获的 restrict 前快照
85
+ * **escalate() 未重算 bootstrap deny 集(P0)**:放行信号后该族工具仍被第二层
86
+ restrict 挡住;escalate 现在同步重算 keep-set,下一次请求生效
87
+ * 真实 Minimal 工具对经 state key 幂等重挂:无关热更新不再销毁/重建持久 PTY
88
+ bash(cwd/env/后台任务保留)
89
+ * 首轮 maxTokens 封顶改为 listener 内分支(0→N 热更新生效;N→0 剥离字段而非
90
+ 注入 0);晋升时剥离本次会话注入的任何封顶(含热更新前的过期值)
91
+ * 设置页定义的自定义工具族不再被 normalizeConfig 静默丢弃
92
+ * 测试 mock 对齐宿主行为(schema 反映生效 restrict 层),两个 P0 各补回归测试
87
93
 
88
- ## [0.6.0](https://github.com/winliyou/dsh-plugins) (2026-08-17)
94
+ ## 0.7.2 (2026-08-22)
89
95
 
96
+ ### Dependencies
90
97
 
91
- ### Breaking (behavior)
98
+ * 对齐 dsh 0.1.0-rc.8 依赖集
92
99
 
93
- * **function-first defaults — every optimization is now opt-in.** The previous defaults broke standard/PTC functionality: tool families removed from the catalog (PTC program calls hit `UNKNOWN_TOOL` outright), skill-catalog/AGENTS.md injections stripped, official prompt sections shadowed, request #1 restricted to two tools. These mechanisms have no lossless form (their savings come from removing context/tools), so `leanByDefault`, `suppressRuntimeContext`, `suppressInjectedContext`, `minimalPrompt.enabled`, and `bootstrap.enabled` all default to **false**: a fresh install is a zero-intervention no-op and official presets keep full functionality. Enable any mechanism on demand from the settings page; compensation paths (keyword/failure-signal escalation, `skill_search` discovery, instruction-hint) activate together with them. Tests now cover both the zero-intervention defaults and each mechanism under explicit opt-in config
100
+ ## 0.7.0 (2026-08-18)
94
101
 
95
- ## [0.5.3](https://github.com/winliyou/dsh-plugins) (2026-08-17)
102
+ ### Features
96
103
 
104
+ * **首轮锚定 + 晋升后 resident 目录(anchored-standard 语义)**:只有请求 #1
105
+ 按极简条件组装(真实 Minimal 工具对 + 极简 persona + 屏蔽全局引导段 + 剥离
106
+ `skill-catalog`/`agent-instructions` 注入 + 抑制运行时快照);首个持久晋升
107
+ 信号后进入 resident 阶段——工具对与发现工具常驻,完整目录经 `dev_tool_search`
108
+ 按需解锁,常规注入恢复可见。只提高性能不减少功能:晋升时一次性倒出完整目录
109
+ 会把轨迹拉回 standard-like(参考实现的晋升后回退问题),故完整目录按需取用
110
+ * **晋升持久化**:阶段不再因 `compaction/end` 重置;晋升按会话记忆化,resume /
111
+ reload 与压缩后的轮次保持 resident 目录
112
+ * **工具目录默认零裁剪**:`leanByDefault` 默认 `false`,编排类工具族(子代理/
113
+ 工作流/ralph/goal)不再隐藏除非显式开启;`suppressInjectedContext` 默认
114
+ `true`(晋升后恢复注入会把轨迹拉回 standard-like,"Let me…" 叙述回归),
115
+ 设为 `false` 恢复晋升后注入
116
+ * **创造模式(cordis)纳入目标 preset**:`presets` 默认
117
+ `["standard", "code", "cordis"]`,创造模式获得同样的首轮极简锚定
118
+
119
+ ### Breaking
120
+
121
+ * 移除 `skillDiscovery` / `instructionHint` / `bootstrap.compactionTools`;
122
+ 恢复 `bootstrap.discoveryTools`(默认 `dev_tool_search` / `skill_search` /
123
+ `skill_load`)作为晋升后常驻发现集。resident 语义下按需发现由常驻
124
+ `dev_tool_search` 承担,指令提示与压缩回退集不再需要;已保存的旧配置自动
125
+ 忽略被移除字段
126
+
127
+ ## 0.6.0 (2026-08-17)
128
+
129
+ ### Breaking
130
+
131
+ * **功能优先——所有优化改为 opt-in**:此前默认值破坏 standard/PTC 功能(工具族
132
+ 从目录移除、注入剥离、引导段屏蔽、首轮只留两个工具)。这些机制的收益来自
133
+ 移除上下文/工具,没有无损形式,故 `leanByDefault`、`suppressRuntimeContext`、
134
+ `suppressInjectedContext`、`minimalPrompt.enabled`、`bootstrap.enabled` 全部
135
+ 默认 `false`:全新安装零干预无副作用,官方 preset 保持完整功能;按需在设置
136
+ 页开启,补偿路径(关键词/失败信号放行、发现工具、指令提示)随之激活
137
+
138
+ ## 0.5.3 (2026-08-17)
97
139
 
98
140
  ### Bug Fixes
99
141
 
100
- * pass the live config snapshot as `base` when registering the settings namespace: without `base`, a schema without defaults (adaptive-perf's `any()`) made `settings.describe()` return `value: undefined`, and the settings page's wire validation (`invalid_type: nonoptional` at `namespaces[n].value`) failed hard, breaking the whole settings UI. With `base` the resolved value is always the full config object
101
-
102
- ## [0.5.2](https://github.com/winliyou/dsh-plugins) (2026-08-17)
142
+ * 注册设置命名空间时把实时配置快照作为 `base` 传入:无默认值的 schema 曾使
143
+ `settings.describe()` 返回 `value: undefined`,设置页 wire 校验失败、整个
144
+ 设置 UI 挂掉;传入 `base` 后返回值始终是完整配置对象
103
145
 
146
+ ## 0.5.2 (2026-08-17)
104
147
 
105
148
  ### Bug Fixes
106
149
 
107
- * register the config namespace into the host settings service (`ctx.settings.register`) so the settings page's configurable-plugins tab lists it: the tab dispatches cards from `settings.describe()`, and a namespace that was never registered renders nothing even with a correctly keyed card. Registration is visibility-only — the card still reads/writes through the plugin's own config gateway (config.json stays authoritative, hot-reload preserved). Fail-safe when schemastery or the settings service is unavailable; duplicate registrations (HMR) are ignored
108
-
109
- ## [0.5.1](https://github.com/winliyou/dsh-plugins) (2026-08-17)
150
+ * 把配置命名空间注册进宿主 settings 服务(`ctx.settings.register`),设置页
151
+ 「插件配置」tab 才会列出卡片(tab 按 `settings.describe()` 分发,未注册的
152
+ 命名空间不渲染)。注册只管可见性,卡片读写仍走插件自己的配置网关(config.json
153
+ 权威、热更新保留);settings 服务缺失时 fail-safe,重复注册(HMR)静默忽略
110
154
 
155
+ ## 0.5.1 (2026-08-17)
111
156
 
112
157
  ### Bug Fixes
113
158
 
114
- * settings card registration: pass `key` (the settings namespace, matching the host-side service key) when registering into `settings.plugin.item` — the host `dsh-client-ui-slots` 0.1.0-rc.7 declares it as a keyed slot, and a registration without `key` fails the whole client bundle apply ("Failed to load plugins: keyed slot requires options.key")
115
-
116
- ## [0.5.0](https://github.com/winliyou/dsh-plugins) (2026-08-16)
159
+ * 设置卡片注册补 `key`(settings 命名空间,与 host service key 一致):宿主
160
+ `dsh-client-ui-slots` 0.1.0-rc.7 声明为 keyed slot,缺 `key` 会让整个 client
161
+ bundle 激活失败("Failed to load plugins: keyed slot requires options.key")
117
162
 
163
+ ## 0.5.0 (2026-08-16)
118
164
 
119
165
  ### Features
120
166
 
121
- * real Minimal tool pair on request #1 (`bootstrap.realPair`)
122
-
123
- The bootstrap phase previously only *narrowed* the standard/PTC catalog, so
124
- request #1 still exposed the sandboxed standard `bash` schema (and no
125
- `str_replace_editor` at all the standard preset does not mount it).
126
- Per dsh-anchored-standard issue #11 the first-request trajectory is decided
127
- by the *byte-identical* tool schema: the real Minimal pair anchors 5/5 while
128
- every standard-family schema (including sandboxed bash) falls standard-like
129
- 11/11. The plugin now mounts the official minimal-preset plugins — the
130
- persistent PTY bash (`@deepseek-ai/dsh-tool-bash-persistent` over
131
- `dsh-terminal` + `dsh-terminal-bash`, with the exact minimal description)
132
- and `str_replace_editor` over the bare local fs (`dsh-fs-local`) — into each
133
- target agent's scoped tool layer, where scoped registrations shadow the
134
- inherited sandboxed `bash` by name and own-layer registrations are exempt
135
- from restrictions. The `tool:bash` guidance section is shadowed to empty at
136
- the same time. The packages are optionalDependencies; when they cannot be
137
- resolved (or on Windows, where the PTY backend is unavailable) the plugin
138
- degrades to the previous catalog-only behavior with a warning.
139
-
140
- * permanent injected-context suppression (`suppressInjectedContext`)
141
-
142
- The skill-catalog reminder and the AGENTS.md digest were previously stripped
143
- only on request #1 and re-injected after promotion. The reference implementation
144
- removes both injections entirely: even post-promotion they perturb the
145
- trajectory and cost thousands of tokens per request. With
146
- `suppressInjectedContext: true` (default) the strip now applies to every
147
- request of the session; `skill_search` / `skill_load` (resident after
148
- promotion, gated by `skillDiscovery`) replace the ~9KB catalog dump, and the
149
- new one-shot `instruction-hint` (`instructionHint`, default on) tells the
150
- model once per session that instruction files exist and should be read when
151
- relevant, instead of embedding their content. User-initiated skill gestures
152
- (`skill-invocation`) are never filtered.
153
-
154
- * resident discovery set now includes skill_search / skill_load
155
-
156
- `bootstrap.discoveryTools` defaults to `[dev_tool_search, skill_search,
157
- skill_load]` so the promoted catalog keeps the on-demand discovery surface of
158
- the reference's resident set; skills stay reachable while the catalog
159
- injection stays off.
160
-
161
- ## [0.4.0](https://github.com/winliyou/dsh-plugins) (2026-08-16)
162
-
167
+ * **首轮真实 Minimal 工具对(`bootstrap.realPair`)**:此前 bootstrap 只是收窄
168
+ standard/PTC 目录,请求 #1 仍是 standard 系 schema(且 standard 不挂
169
+ `str_replace_editor`)。现把官方 minimal preset 同款插件(持久 PTY bash
170
+ `@deepseek-ai/dsh-tool-bash-persistent` + `str_replace_editor`)挂进每个目标
171
+ agent 的会话作用域,按名阴影继承的 sandboxed bash(scoped 注册豁免
172
+ restrict),同时把 `tool:bash` 引导段阴影为空。官方包为
173
+ optionalDependencies,解析不到(或 Windows PTY 后端)时降级为仅收窄目录
174
+ 并告警
175
+ * **常驻注入剥离(`suppressInjectedContext`,默认开启)**:技能目录提醒与
176
+ AGENTS.md 摘要此前只在请求 #1 剥离、晋升后恢复;实测晋升后它们仍扰动轨迹
177
+ 且每请求多耗数千 token。开启后整个会话持续剥离,由常驻 `skill_search` /
178
+ `skill_load` 与一次性 `instruction-hint` 替代;用户主动的技能手势
179
+ (`skill-invocation`)永不过滤
180
+ * **常驻发现集纳入 `skill_search` / `skill_load`**:`bootstrap.discoveryTools`
181
+ 默认 `[dev_tool_search, skill_search, skill_load]`
182
+
183
+ ## 0.4.0 (2026-08-16)
163
184
 
164
185
  ### Features
165
186
 
166
- * minimal-prompt layer (register anchoring, per dsh-anchored-standard)
167
-
168
- The reference's full anchoring condition is the *complete minimal system
169
- prompt*, not just the tool catalog: tool narrowing alone leaves the global
170
- orientation sections (harness:identity / harness:source / app:web-surface)
171
- and the standard persona in the prompt, and the model keeps narrating in the
172
- standard-like register ("Let me…" thinking chains). The new `minimalPrompt`
173
- layer shadows those sections to empty per target agent (same effect as
174
- minimal's `complete` persona; plan-mode and the PTC SDK sections are
175
- untouched) and shadows `deployment:persona` with the exact minimal-mode text
176
- ("You are a helpful software engineer assistant."), so the assembled system
177
- prompt for standard / PTC sessions drops to the minimal register from request
178
- #1 onward — including for resumed/already-promoted sessions, which the
179
- bootstrap phase never touches. All knobs are configurable and hot-applied
180
- (`minimalPrompt.enabled` / `.persona` / `.suppressSections`).
181
-
182
- ## [0.3.2](https://github.com/winliyou/dsh-plugins) (2026-08-16)
187
+ * **极简提示词层(minimalPrompt,语域锚定)**:完整的锚定条件是极简的完整
188
+ system prompt——只收窄工具目录不够,全局引导段与标准 persona 会让思维链保持
189
+ standard-like "Let me…" 叙述。本层把三个全局引导段阴影为空(等同极简
190
+ `complete` persona 的效果;plan-mode PTC SDK 段不受影响),并把
191
+ `deployment:persona` 按名替换为与极简模式逐字相同的文本;对已恢复/已晋升的
192
+ 旧会话同样生效(bootstrap 阶段不触碰它们)。全部开关可配置、热生效
183
193
 
194
+ ## 0.3.2 (2026-08-16)
184
195
 
185
196
  ### Bug Fixes
186
197
 
187
- * bootstrap tool narrowing now uses tools.restrict instead of filtering assembly.tools
188
-
189
- In PTC/code mode the assembled tool catalog contains only run_code, so
190
- filtering it down to the Minimal pair always hit the fail-safe and the
191
- first request kept the full SDK (verified live: the model still saw 15
192
- tools). tools.restrict drives both the API catalog and the PTC SDK
193
- reference section (the same mechanism the family trimming uses), so the
194
- bootstrap phase now temporarily denies everything except
195
- run_code + the Minimal pair (plus the post-compaction work set) and
196
- lifts the restriction on the first durable promotion signal. Verified
197
- live: on request #1 the model reports run_code as the only direct tool
198
- and the SDK declarations contain only the Minimal pair.
199
-
200
- ## [0.3.1](https://github.com/winliyou/dsh-plugins) (2026-08-16)
198
+ * bootstrap 工具收窄改用 `tools.restrict` 而非过滤 `assembly.tools`:PTC/code
199
+ 模式组装目录只含 run_code,过滤收窄总是触发 fail-safe、首轮仍见完整 SDK
200
+ (实测模型看到 15 个工具)。`tools.restrict` 同时驱动 API 目录与 PTC SDK
201
+ 参考段(与工具族精简同一机制),bootstrap 改为临时 deny run_code
202
+ Minimal 对之外的全部工具,首个持久晋升信号解除
201
203
 
204
+ ## 0.3.1 (2026-08-16)
202
205
 
203
206
  ### Bug Fixes
204
207
 
205
- * raise engines.node to >=22.19.0 (node 20 is EOL; aligns with the reference preset baseline and the current LTS floor)
206
-
207
- ## [0.3.0](https://github.com/winliyou/dsh-plugins/compare/adaptive-perf-v0.2.2...adaptive-perf-v0.3.0) (2026-08-16)
208
+ * `engines.node` 提到 >=22.19.0node 20 EOL
208
209
 
210
+ ## 0.3.0 (2026-08-16)
209
211
 
210
212
  ### Features
211
213
 
212
- * first-request bootstrap anchoring (inspired by dsh-anchored-standard)
213
-
214
- Request #1 for target presets now exposes only the real Minimal tool pair
215
- (bash + str_replace_editor) and strips auto-injected context
216
- (skill-catalog reminder, AGENTS.md digest), which anchors the first-request
217
- trajectory on minimal conditions (the community measurements: the Minimal
218
- pair anchors 5/5 at the adapter-default budget while every standard-family
219
- schema falls into standard-like behavior 11/11, and a present skill catalog
220
- breaks the anchor 0/9). The session promotes after its first durable
221
- tool/call or assistant/message (promoteOn: either, or tool-call /
222
- assistant-message) — phase derived from durable session events, resume-safe.
223
- A compaction resets the phase (epoch-aware): after compaction/end the
224
- session falls back to the bootstrap pair plus a configurable compactionTools
225
- work set until a new promotion signal. bootstrap.maxTokens optionally caps
226
- request #1's output budget and is stripped after promotion.
227
-
228
- Wiring uses the harness's public waterfalls: system-prompt/assemble (tool
229
- catalog narrowing), agent/pre-step (context stripping, prepend-registered so
230
- the strip is the final transform), agent/request (budget cap), and
231
- session/event (phase feed). Degrades to the full catalog on any filter
232
- failure so a plugin bug can never brick a session.
214
+ * **首轮 bootstrap 锚定**(受 dsh-anchored-standard 启发):请求 #1 只暴露真实
215
+ Minimal 工具对(bash + str_replace_editor)并剥离自动注入上下文(技能目录
216
+ 提醒、AGENTS.md 摘要),把首轮轨迹锚定在极简条件上。首个持久 tool/call
217
+ assistant/message 后晋升;阶段从持久会话事件推导,resume 安全;compaction
218
+ 重置阶段,压缩后回到 bootstrap 工具对 + 可配置压缩工作集直到新晋升信号。
219
+ `bootstrap.maxTokens` 可选封顶首轮输出预算、晋升后剥离。
233
220
 
234
- ## [0.2.2](https://github.com/winliyou/dsh-plugins/compare/adaptive-perf-v0.2.1...adaptive-perf-v0.2.2) (2026-08-16)
221
+ 接线全部走宿主公开 waterfall:system-prompt/assemble(目录收窄)、
222
+ agent/pre-step(上下文剥离,prepend 注册保证最后执行)、agent/request(预算
223
+ 封顶)、session/event(阶段供给)。任何过滤失败降级为完整目录,插件 bug 不会
224
+ 拖垮会话。
235
225
 
226
+ ## 0.2.2 (2026-08-16)
236
227
 
237
228
  ### Bug Fixes
238
229
 
239
- * register config-gateway endpoints via a typert-loader host artifact (lib/typert.host.js) so the api-gateway claims them regardless of module-instance identity ([dsh-plugins#registry-install](https://github.com/winliyou/dsh-plugins))
240
-
241
- When the package is installed from the npm registry, its typert-protocol copy differs from the harness's, so the Remote-decorator SRC markers are invisible to the gateway and settings-page calls fail with "transport failure ... HTTP 404". The typert artifact registers the same get/set endpoints into ctx.typert.local through the official loader mechanism.
242
-
243
- ## [0.2.1](https://github.com/winliyou/dsh-plugins/compare/adaptive-perf-v0.2.0...adaptive-perf-v0.2.1) (2026-08-16)
230
+ * typert-loader host artifactlib/typert.host.js)注册配置网关端点,
231
+ api-gateway 不再受模块实例身份影响:npm registry 安装时包内 typert-protocol
232
+ 副本与 harness 不同源,Remote 装饰器 SRC 标记对网关不可见,设置页调用报
233
+ "transport failure ... HTTP 404"
244
234
 
235
+ ## 0.2.1 (2026-08-16)
245
236
 
246
237
  ### Bug Fixes
247
238
 
248
- * mount remote config namespaces in client bundles ([a647484](https://github.com/winliyou/dsh-plugins/commit/a64748489ddf003cb29c0527016ea089748e0c7b))
249
-
250
- ## [0.2.0](https://github.com/winliyou/dsh-plugins/compare/adaptive-perf-v0.1.2...adaptive-perf-v0.2.0) (2026-08-15)
239
+ * client bundle 挂载远程配置命名空间(修复 web boot "did not activate")
251
240
 
241
+ ## 0.2.0 (2026-08-15)
252
242
 
253
243
  ### Features
254
244
 
255
- * convert plugins to DSH bundle installation ([caae797](https://github.com/winliyou/dsh-plugins/commit/caae797acd12c70af52b0868ec352d91a0a7ef12))
245
+ * 插件转为 DSH bundle 安装方式
package/README.md CHANGED
@@ -1,116 +1,47 @@
1
1
  # @chaoset/adaptive-perf — DSH 极简性能自适应插件
2
2
 
3
- > **默认策略(0.7.0,首轮锚定、晋升后 resident 目录)**:只提高性能,不减少功能。
4
- > 非极简模式会话的**请求 #1** 按极简模式条件组装——真实 Minimal 工具对
5
- > 锚定首轮轨迹、极简 persona + 屏蔽全局引导段对齐语域、剥离技能目录/指令
6
- > 摘要注入、抑制运行时快照;首个**持久**晋升信号(首个 `tool/call` 或
7
- > `assistant/message`)后进入 **resident 阶段**——保留 bootstrap 工具对 +
8
- > 常驻发现工具(`dev_tool_search` / `skill_search` / `skill_load`),完整
9
- > 目录经 `dev_tool_search` 按需解锁,常规上下文注入恢复可见(与
10
- > [dsh-anchored-standard](https://github.com/xiaobright/dsh-anchored-standard/)
11
- > 语义一致:晋升按会话记忆化,compaction 不重置;晋升时一次性倒出完整目录
12
- > 会把轨迹拉回 standard-like,故完整目录按需取用)。工具目录默认**零裁剪**
13
- > (编排类工具族始终可用);`leanByDefault` 是省 token 的 opt-in 开关,
14
- > `suppressInjectedContext` 默认开启(注入剥离由发现工具承担可见性),
15
- > 设置页按需调整。
16
-
17
- **标准模式(standard)**、**PTC 模式(code)** 与 **创造模式(cordis)**
18
- 达到 **极简模式(minimal)** 级别的高性能,同时保留完整能力——不是静态裁剪,
19
- 而是**动态自适应**:
20
-
21
- - **真实 Minimal 工具对(realPair)**:首轮"轨迹"由请求 #1 可见的**工具 schema**
22
- 逐字决定——只有与 Minimal 完全相同的 schema 能锚定(参照
23
- [dsh-anchored-standard](https://github.com/xiaobright/dsh-anchored-standard/)
24
- 实测:真实工具对 5/5 锚定,任何 standard 系 schema——包括 sandboxed
25
- bash/read——11/11 落入 standard-like)。本插件把官方 minimal preset 同款插件
26
- (持久 PTY bash + `str_replace_editor`,含逐字相同的描述)挂进会话作用域,
27
- 按名阴影 standard 的 sandboxed bash——**不是**只把目录收窄到同名工具。
28
- - **首轮锚定(bootstrap)**:决定首轮"轨迹"(思维链风格)的是请求 #1 可见的
29
- **工具 schema** 与**自动注入的上下文提醒**。因此:
30
- - 请求 #1 的工具目录 = 真实 Minimal 工具对(`bash` + `str_replace_editor`);
31
- - 请求 #1 剥离自动注入上下文(技能目录提醒 `skill-catalog`、AGENTS.md 摘要
32
- `agent-instructions`,用户主动的技能手势不过滤);
33
- - 会话出现首个**持久**晋升信号(首个 `tool/call` 或 `assistant/message`,
34
- `promoteOn` 可选 `either`/`tool-call`/`assistant-message`)后进入
35
- **resident 阶段**:保留 bootstrap 工具对 + 常驻发现工具(0.7.0 语义:
36
- 只锚定首轮,不减少后续功能;完整目录经 `dev_tool_search` 按需解锁——
37
- 晋升时一次性倒出完整目录会把轨迹拉回 standard-like,anchored-standard
38
- 实测的"晋升后回退"问题),常规注入(技能目录提醒 + AGENTS.md 摘要)
39
- 恢复可见;阶段从持久会话事件推导,**resume / reload 不丢状态**,晋升
40
- 信号**持久**(`compaction/end` 不重置,与 dsh-anchored-standard 一致);
41
- - `maxTokens > 0` 时可给请求 #1 封顶输出预算(晋升后自动剥离)。
42
- - **常驻上下文抑制(suppressInjectedContext,默认开启)**:整个会话持续
43
- 剥离技能目录提醒 + AGENTS.md 摘要注入——实测晋升后恢复注入会把轨迹拉回
44
- standard-like("Let me…" 叙述回归),且每请求多耗数千 token。功能可见性
45
- 由常驻发现工具承担:`dev_tool_search` 搜索完整目录并按名解锁、
46
- `skill_search` / `skill_load` 按需搜索/加载技能说明。设为 `false` 时只剥
47
- 离请求 #1,晋升后恢复常规注入(功能不减少但轨迹回退,opt-in)。
48
- - **运行时上下文抑制**:对目标 preset 的会话调用 `suppressRuntimeContext()`
49
- (与极简模式的 `includeRuntimeContext: false` 同一机制),每次模型请求省掉
50
- "Current runtime context" 快照文本,**零功能损失**。
51
- - **极简提示词层(minimalPrompt)**:参考实现的完整锚定条件——首轮轨迹由
52
- **Minimal 的完整 system prompt** 决定,只收窄工具 schema 不够(标准/PTC 的
53
- 系统提示仍带 `harness:identity` / `harness:source` / `app:web-surface` 三个
54
- 全局引导段与标准 persona,思维链仍是 standard-like 的 "Let me…" 叙述)。本层
55
- 对目标会话:
56
- - 按名阴影屏蔽三个全局引导段(空段在装配时被丢弃,等同极简 `complete`
57
- persona 的效果;plan-mode 与 PTC 的 SDK 段不受影响);
58
- - 按名阴影替换 `deployment:persona` 为极简语域 persona(默认与极简模式
59
- 逐字相同:`You are a helpful software engineer assistant.`);
60
- - 挂载真实工具对时按名阴影 `tool:bash` 引导段(与可见工具一致)。
61
- 各处均为 agent 作用域的 prompt 段阴影,仅影响目标会话;**对已恢复/已晋升的
62
- 旧会话同样生效**(不依赖 bootstrap 阶段)。
63
- - **工具目录自适应精简(leanByDefault,0.7.0 起为 opt-in)**:默认 `false` =
64
- 工具目录零裁剪,编排类工具族(子代理 / 工作流 / ralph / goal)始终可用。
65
- 设为 `true` 时会话启动按"工具族"隐藏高开销低频工具,只保留核心编码工具
66
- (bash / 文件读写编辑 / 检索 / jobs / todo / 提问 / 网页搜索 / 技能 / 计划),
67
- 标准模式的工具目录因此逼近极简;PTC 模式系统提示里的 **SDK 参考段同步缩小**。
68
- - **需求信号自动放行**(会话内单调升级,只升不降,限制请求缓存失效次数):
69
- - 关键词信号:用户消息命中工具族触发词(如"子代理"、"工作流")→ 放行该族;
70
- - 失败信号:PTC 程序调用被隐藏工具报 `UNKNOWN_TOOL` → 放行该族,下次即可调用。
71
-
72
- 所有开关与工具族可在设置页配置、随时放行;配置保存后**热生效**(无需重启)。
73
-
74
- ## 为什么极简模式最快(源码对照 + 社区实测结论)
75
-
76
- | 维度 | 极简模式 | 标准 / PTC 模式 | 本插件做法 |
77
- |---|---|---|---|
78
- | 首轮轨迹(决定后续行为风格) | Minimal 真实工具对锚定(5/5) | 任何 standard 系 schema(含 sandboxed bash)落入 standard-like(11/11) | realPair 挂载官方同款插件:请求 #1 的 schema 与 Minimal 逐字相同 |
79
- | 首轮注入提醒 | 无 skill 目录/AGENTS.md 注入 | 自动注入(在场时锚定 0/9) | 请求 #1 剥离 `skill-catalog` + `agent-instructions` |
80
- | 后置阶段注入 | 永不注入 | 晋升后每请求恢复 ~9KB 目录 + AGENTS.md 全文 | 默认全程剥离(发现工具承担可见性);`suppressInjectedContext=false` opt-in 恢复 |
81
- | 系统提示语域(persona + 全局引导段) | 一句话 persona,无任何引导段 | identity/source/web-surface 引导段 + 标准 persona("Let me…" 叙述来源) | minimalPrompt 层按名阴影屏蔽 3 个全局段 + 替换极简 persona(对旧会话同样生效) |
82
- | 运行时上下文快照 | 关闭(`includeRuntimeContext: false`) | 每次请求注入文件策略/审批策略等快照 | 同一机制:`suppressRuntimeContext()` |
83
- | 模型可见工具目录 | 2 个(bash、str_replace_editor) | ~22 个工具 schema 全部进请求 | 首轮 2 个;晋升后 resident(2 + 3 个发现工具,完整目录按需解锁);opt-in lean 时隐藏编排族按需放行 |
84
- | PTC SDK 参考段 | 无 | 全部工具的类型+描述渲染进提示 | 随目录缩小(同一 `visible` 视图驱动) |
85
-
86
- ## 安装(npm 生态方式)
87
-
88
- 本包是 DSH bundle:自带 `cordis.patch.yml`,使用 `dsh plugin` 安装后会
89
- 自动加入 profile 的 `dsh.profile.bundles`,无需手改 `cordis.patch.yml`。
90
-
91
- > 给 AI agent:直接执行下面的 `dsh plugin ...` 命令即可,不要手动编辑 `cordis.patch.yml`。
3
+ 让标准(standard)/ PTC(code)/ 创造(cordis)模式达到极简模式级别的高性能,
4
+ 同时保留完整能力——不是静态裁剪,而是动态自适应。锚定条件参照社区实测的
5
+ [dsh-anchored-standard](https://github.com/xiaobright/dsh-anchored-standard/)。
6
+
7
+ - **首轮锚定(bootstrap,默认开启)**:请求 #1 按极简模式条件组装——挂载官方
8
+ minimal preset 同款**真实工具对**(持久 PTY bash + `str_replace_editor`,
9
+ schema Minimal 逐字相同),剥离技能目录提醒(`skill-catalog`)与
10
+ AGENTS.md 摘要(`agent-instructions`)注入,可选封顶首轮输出预算。首个持久
11
+ 晋升信号(首个 `tool/call` 或 `assistant/message`)后进入 resident 阶段:
12
+ 保留工具对与常驻发现工具(`dev_tool_search` / `skill_search` / `skill_load`),
13
+ 完整目录经 `dev_tool_search` 按需解锁,常规注入恢复可见。阶段从持久会话事件
14
+ 推导,resume / reload / compaction 不丢状态。
15
+ - **常驻上下文抑制(suppressInjectedContext,默认开启)**:整个会话持续剥离
16
+ 技能目录提醒与 AGENTS.md 摘要注入,功能可见性由发现工具承担;设为 `false`
17
+ 时只在请求 #1 剥离,晋升后恢复常规注入。
18
+ - **运行时上下文抑制(suppressRuntimeContext,默认开启)**:与极简模式同一
19
+ 机制关闭运行时快照注入,每次请求省掉快照文本,零功能损失。
20
+ - **极简提示词层(minimalPrompt,默认开启)**:屏蔽三个全局引导段
21
+ (`harness:identity` / `harness:source` / `app:web-surface`)并把 persona
22
+ 替换为极简语域文本,让系统提示回到极简语域;对已恢复/已晋升的旧会话同样生效。
23
+ - **工具目录精简(leanByDefault,默认关闭)**:默认零裁剪。开启后按「工具族」
24
+ 隐藏编排类工具(子代理/工作流/ralph/goal),只保留核心编码工具,标准模式的
25
+ 工具目录逼近极简,PTC SDK 参考段同步缩小。
26
+ - **需求信号自动放行**:用户消息命中工具族触发词,或 PTC 程序调用被隐藏工具报
27
+ `UNKNOWN_TOOL` 时,放行对应工具族(会话内单调升级,只升不降)。
28
+
29
+ 所有开关与工具族可在设置页配置,保存后热生效(无需重启)。
30
+
31
+ ## 安装
32
+
33
+ 本包是 DSH bundle:自带 `cordis.patch.yml`,`dsh plugin` 安装后自动加入
34
+ profile `dsh.profile.bundles`,无需手改 `cordis.patch.yml`。
92
35
 
93
36
  ```bash
94
- # 安装到默认 web profile
95
37
  dsh plugin --profile web add @chaoset/adaptive-perf
96
-
97
- # 指定其他 profile
98
- dsh plugin --profile tui add @chaoset/adaptive-perf
99
-
100
- # 卸载
101
38
  dsh plugin --profile web remove @chaoset/adaptive-perf
102
39
  ```
103
40
 
104
- 也可以从其他来源安装:
105
-
106
- - **GitHub**:如果该包有独立 Git 仓库或 Release tarball,可用
107
- `dsh plugin --profile web add github:owner/repo` 或
108
- `dsh plugin --profile web add https://github.com/owner/repo/releases/download/v1.0.0/adaptive-perf.tgz`
109
- - **镜像站**:`dsh plugin --profile web add @chaoset/adaptive-perf --registry=https://registry.npmmirror.com`
41
+ 也支持本地路径 / GitHub / 镜像站安装,见仓库根 `README.md` 的「安装」。
42
+ 安装后重启 harness 生效。
110
43
 
111
- 更完整的说明见仓库根目录 `README.md` 的「安装来源」。
112
-
113
- 安装后**重启 harness** 生效(或等待 DSH 对配置层变更的响应)。
44
+ > 给 AI agent:直接执行 `dsh plugin ...` 命令即可,不要手动编辑 `cordis.patch.yml`。
114
45
 
115
46
  ## 配置
116
47
 
@@ -120,22 +51,22 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
120
51
  2. bundle patch 中 `cordis.patch.yml` 的 config
121
52
  3. 用户 profile/home 的 `cordis.patch.yml` 覆盖
122
53
  4. **DSH 设置页 → 插件配置 → 极简性能自适应**(保存到
123
- `$DSH_HOME/plugins/adaptive-perf/config.json`,立即热生效)
54
+ `~/.dsh/plugins/adaptive-perf/config.json`,立即热生效)
124
55
 
125
56
  | 字段 | 默认值 | 说明 |
126
57
  |---|---|---|
127
58
  | `enabled` | `true` | 总开关 |
128
- | `presets` | `["standard", "code", "cordis"]` | 应用自适应的 preset id |
59
+ | `presets` | `["standard", "code", "ptc", "cordis"]` | 应用自适应的 preset id |
129
60
  | `suppressRuntimeContext` | `true` | 抑制运行时上下文快照(零功能损失) |
130
- | `suppressInjectedContext` | `true` | 常驻上下文抑制(默认开启):整个会话剥离技能目录/AGENTS.md 注入(发现工具承担可见性);`false` = 只在请求 #1 剥离,晋升后恢复 |
131
- | `leanByDefault` | `false` | 工具目录精简(opt-in):`true` = 会话启动即隐藏编排类工具族;`false`(默认)= 零裁剪 |
61
+ | `suppressInjectedContext` | `true` | 整个会话剥离技能目录/AGENTS.md 注入;`false` = 只在请求 #1 剥离,晋升后恢复 |
62
+ | `leanByDefault` | `false` | 工具目录精简(opt-in):`true` = 会话启动即隐藏编排类工具族 |
132
63
  | `escalateOnKeyword` | `true` | 用户消息命中触发词 → 放行该族(匹配方式见 `keywordMatchMode`) |
133
- | `keywordMatchMode` | `"smart"` | 触发词匹配模式:`smart` = 含 CJK 的触发词子串匹配、纯 ASCII 词词边界匹配(`"goalish"` 不命中 `"goal"`,整词 `"the goal is"` 命中);`substring` = 一律子串;`word` = 一律词边界 |
64
+ | `keywordMatchMode` | `"smart"` | `smart` = 含 CJK 的触发词子串匹配、纯 ASCII 词词边界匹配;`substring` = 一律子串;`word` = 一律词边界 |
134
65
  | `escalateOnUnknownTool` | `true` | 工具调用失败(UNKNOWN_TOOL)→ 放行该族 |
135
66
  | `coreTools` | 核心编码工具 | 展示用:不进入任何限制族 |
136
67
  | `families` | 见下 | 工具族:`{ 族名: { enabled, tools, keywords } }` |
137
- | `bootstrap` | 见下 | 首轮锚定(真实工具对 / 晋升信号 / 剥离上下文 / 压缩恢复集 / resident 发现工具 / 预算封顶) |
138
- | `minimalPrompt` | 见下 | 极简提示词层(语域锚定) |
68
+ | `bootstrap` | 见下 | 首轮锚定 |
69
+ | `minimalPrompt` | 见下 | 极简提示词层 |
139
70
 
140
71
  `bootstrap`(首轮锚定):
141
72
 
@@ -151,28 +82,18 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
151
82
  }
152
83
  ```
153
84
 
154
- - `realPair`(0.5.0):把官方 minimal preset 同款插件(持久 PTY bash +
155
- `str_replace_editor`)挂进会话作用域,按名阴影 standardsandboxed
156
- bash——请求 #1 schema 与 Minimal 逐字相同(只有逐字相同的 schema 能
157
- 锚定)。依赖 `@deepseek-ai` 官方插件包(optionalDependencies);缺失或
158
- Windows(无 PTY 后端)时自动降级为"仅收窄目录"并告警。
159
- - `tools`:请求 #1 可见的工具(真实 Minimal 对)。
85
+ - `realPair`:挂载官方 minimal preset 同款插件(持久 PTY bash +
86
+ `str_replace_editor`),请求 #1schema 与 Minimal 逐字相同。依赖
87
+ `@deepseek-ai` 官方插件包(optionalDependencies);缺失或 Windows(无 PTY
88
+ 后端)时自动降级为「仅收窄目录」并告警。
89
+ - `tools`:请求 #1 可见的工具。
160
90
  - `promoteOn`:`either`(默认)/ `tool-call` / `assistant-message`。
161
91
  - `suppressedContextSources`:首轮剥离的自动注入 source.kind;`[]` 关闭剥离。
162
- - `discoveryTools`:晋升后 resident 目录的常驻发现工具——`dev_tool_search`
163
- (搜索完整目录并按名解锁,解锁结果下一请求生效且会话内保持)、
164
- `skill_search` / `skill_load`(无门控,按需搜索/加载技能说明,替代常驻
165
- ~9KB 技能目录)。
166
- - `maxTokens`:请求 #1 输出预算封顶(0 = 不封顶,opt-in)。
167
-
168
- > 0.7.0 破坏性变更:移除 `skillDiscovery` / `instructionHint` /
169
- > `bootstrap.compactionTools` 三个字段(resident 语义下不再需要:
170
- > `dev_tool_search` 常驻提供按需发现,无压缩回退、无指令提示补偿);
171
- > `bootstrap.discoveryTools` **恢复**为 resident 目录的常驻发现工具
172
- > (默认 `dev_tool_search` / `skill_search` / `skill_load`)。已保存的旧配置
173
- > 会自动忽略被移除字段。
92
+ - `discoveryTools`:晋升后常驻的发现工具——`dev_tool_search` 搜索完整目录并
93
+ 按名解锁,`skill_search` / `skill_load` 按需搜索/加载技能说明。
94
+ - `maxTokens`:请求 #1 输出预算封顶(0 = 不封顶)。
174
95
 
175
- `minimalPrompt`(极简提示词层,0.4.0 新增):
96
+ `minimalPrompt`(极简提示词层):
176
97
 
177
98
  ```json
178
99
  {
@@ -184,11 +105,9 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
184
105
 
185
106
  - `persona`:按名阴影替换 `deployment:persona`;默认与极简模式逐字相同,留空
186
107
  (`""`)则不替换。
187
- - `suppressSections`:屏蔽 `harness:identity` / `harness:source` / `app:web-surface`
188
- 三个全局引导段(等同极简 `complete` persona 的效果;plan-mode 与 PTC 的
189
- SDK 段不受影响)。
190
- - 生效范围:目标 preset 的全部会话,**包括已恢复/已晋升的旧会话**(不依赖
191
- bootstrap 阶段);配置保存后热生效。
108
+ - `suppressSections`:屏蔽 `harness:identity` / `harness:source` /
109
+ `app:web-surface` 三个全局引导段(plan-mode 与 PTC 的 SDK 段不受影响)。
110
+ - 生效范围:目标 preset 的全部会话,包括已恢复/已晋升的旧会话。
192
111
 
193
112
  默认工具族(可整族禁用、改名、增删触发词):
194
113
 
@@ -202,30 +121,5 @@ dsh plugin --profile web remove @chaoset/adaptive-perf
202
121
  ```
203
122
 
204
123
  > 工具名只在目标 preset 目录中**实际存在**时才被隐藏(运行时取交集),preset
205
- > 升级改名/删除工具不会导致插件报错;`tools.restrict()` 的限制按 agent 作用域
206
- > 生效,子代理同样遵循自适应策略(其自身注册的委托机制工具不受影响)。
207
-
208
- ## 实现要点
209
-
210
- - 监听 host 根作用域的 `agent/created` / `agent/disposed` / `agent/inbox/inserted`
211
- / `tools/result`(与 `dsh-agent-presets` 自身同款事件用法),按
212
- `agentPresets.composedPreset(agent.ctx)` 识别目标 preset
213
- - **真实工具对**:`agent.ctx.plugin()` 把 `dsh-terminal` + `dsh-terminal-bash`
214
- + `dsh-tool-bash-persistent`(Minimal 逐字描述)+ `dsh-fs-local` +
215
- `dsh-tool-str-replace-editor` 挂进 agent 作用域;scoped registration 按名
216
- 阴影继承的 sandboxed bash,且 `view()` 对 own layer 豁免 restrict——首轮
217
- 目录 = 真实工具对 + 被 deny 的其他继承工具;每个挂载是独立 fiber,
218
- agent 销毁/插件卸载/配置关闭时全部撤销
219
- - 限制通过 `agent.ctx.tools.restrict({ deny })` 逐族注册:多族限制自动取交集,
220
- 升级 = 释放该族 disposer(单会话单调、一次性目录变化,缓存失效有界)
221
- - 发现工具(`dev_tool_search` / `skill_search` / `skill_load`)同样注册在
222
- agent 作用域:已解锁工具写入会话状态并重算 deny 集;技能经宿主 `skills`
223
- 服务按 agent scope 查询,`skill_load` 用 `agent.inject` 以
224
- `skill-invocation` 来源注入(用户技能手势同款,不被默认抑制集剥离)
225
- - 上下文剥离与 instruction-hint 都在 `agent/pre-step`(prepend 注册,最后
226
- 一道变换):剥离失败绝不吞用户上下文;指令文件探测走宿主 `fs`,失败不注入
227
- - 会话启动/插件重载时用 `tools.schemas(agent)` 记录可见目录,限制与之取交集
228
- - 全部副作用(抑制器、限制、工具注册、提示段、监听)随 agent 销毁或插件
229
- 卸载自动释放
230
- - **fail-safe**:插件任何内部错误只记日志,不拖垮 harness;官方插件包缺失
231
- 时自动降级
124
+ > 升级改名/删除工具不会导致插件报错;限制按 agent 作用域生效,子代理同样遵循
125
+ > 自适应策略。
package/client/client.cjs CHANGED
@@ -40,7 +40,7 @@ window.__ModuleLoader__.load({
40
40
  });
41
41
  module.exports = __toCommonJS(index_exports);
42
42
  var React = __toESM(require("react"), 1);
43
- var css = ".ap_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;min-width:0;overflow:hidden}.ap_card[data-open=true]{border-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-shadow-lv1)}.ap_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:10px;align-items:center;gap:12px;padding:12px 14px;display:flex}.ap_header:hover,.ap_card[data-open=true]>.ap_header{background:var(--dsw-alias-interactive-bg-hover)}.ap_title{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:20px}.ap_badge{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px}.ap_body{border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);padding:10px 14px 12px}.ap_field{flex-direction:column;gap:4px;padding:8px 0;display:flex}.ap_label{font-size:12px;font-weight:500;line-height:18px}.ap_input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:32px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 10px;font-size:13px;line-height:20px}.ap_textarea{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:6px 10px;font-size:12px;line-height:18px;resize:vertical;min-height:120px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ap_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}.ap_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:8px 0 2px;display:flex}.ap_save{font:inherit;cursor:pointer;border:1px solid transparent;border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.ap_discard{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:0 0;color:inherit}.ap_status{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary);flex:1}.ap_section{border-top:1px dashed var(--dsw-alias-border-l2);margin-top:8px;padding-top:2px}.ap_sectionHead{appearance:none;width:100%;font:inherit;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;justify-content:space-between;gap:8px;padding:6px 2px;display:flex}.ap_sectionHead:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.ap_sectionTitle{font-size:12px;font-weight:600;line-height:18px}.ap_sectionChevron{flex:none;font-size:10px}.ap_sectionBody{flex-direction:column;display:flex}.ap_status.ap_error{color:var(--dsw-alias-state-error-primary)}.ap_badge_error{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px;max-width:260px;overflow:hidden;text-overflow:ellipsis}";
43
+ var css = ".ap_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;min-width:0;overflow:hidden}.ap_card[data-open=true]{border-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-shadow-lv1)}.ap_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:10px;align-items:center;gap:12px;padding:12px 14px;display:flex}.ap_header:hover,.ap_card[data-open=true]>.ap_header{background:var(--dsw-alias-interactive-bg-hover)}.ap_title{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:20px}.ap_badge{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px}.ap_body{border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);padding:10px 14px 12px}.ap_field{flex-direction:column;gap:4px;padding:8px 0;display:flex}.ap_label{font-size:12px;font-weight:500;line-height:18px}.ap_input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:32px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 10px;font-size:13px;line-height:20px}.ap_textarea{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:6px 10px;font-size:12px;line-height:18px;resize:vertical;min-height:120px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ap_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}.ap_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:8px 0 2px;display:flex}.ap_save{font:inherit;cursor:pointer;border:1px solid transparent;border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.ap_discard{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:0 0;color:inherit}.ap_status{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary);flex:1}.ap_section{border-top:1px dashed var(--dsw-alias-border-l2);margin-top:8px;padding-top:2px}.ap_sectionHead{appearance:none;width:100%;font:inherit;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;justify-content:space-between;gap:8px;padding:6px 2px;display:flex}.ap_sectionHead:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.ap_sectionTitle{font-size:12px;font-weight:600;line-height:18px}.ap_sectionChevron{flex:none;font-size:10px}.ap_sectionBody{flex-direction:column;display:flex}.ap_status.ap_error{color:var(--dsw-alias-state-error-primary)}.ap_badge_error{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px;max-width:260px;overflow:hidden;text-overflow:ellipsis}.ap_spin{flex:none;width:10px;height:10px;border:1.5px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-label-secondary);border-radius:50%;animation:ap-spin .8s linear infinite}@keyframes ap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.ap_spin{animation:none}}";
44
44
  var tagId = "@chaoset/adaptive-perf/client.css";
45
45
  if (typeof document !== "undefined" && document.querySelector('style[data-plugin-css="' + tagId + '"]') === null) {
46
46
  tag = document.createElement("style");
@@ -61,6 +61,7 @@ window.__ModuleLoader__.load({
61
61
  saveFailed: "\u4FDD\u5B58\u5931\u8D25",
62
62
  saved: "\u5DF2\u4FDD\u5B58\uFF0C\u70ED\u751F\u6548\uFF08\u65B0\u4F1A\u8BDD\u7ACB\u5373\u751F\u6548\uFF09",
63
63
  loadFailed: "\u8BFB\u53D6\u914D\u7F6E\u5931\u8D25",
64
+ loading: "\u52A0\u8F7D\u4E2D\u2026",
64
65
  invalidFamilies: "families \u5FC5\u987B\u662F\u5408\u6CD5 JSON \u5BF9\u8C61",
65
66
  enabled: "\u542F\u7528\u63D2\u4EF6",
66
67
  presets: "\u76EE\u6807 preset",
@@ -113,6 +114,7 @@ window.__ModuleLoader__.load({
113
114
  saveFailed: "Save failed",
114
115
  saved: "Saved; hot-applied (new sessions take effect immediately)",
115
116
  loadFailed: "Failed to load config",
117
+ loading: "Loading\u2026",
116
118
  invalidFamilies: "families must be valid JSON object",
117
119
  enabled: "Enable plugin",
118
120
  presets: "Target presets",
@@ -506,8 +508,14 @@ window.__ModuleLoader__.load({
506
508
  { className: "ap_footer" },
507
509
  React.createElement(
508
510
  "span",
509
- { className: "ap_status" + (status !== null && status.kind === "error" ? " ap_error" : ""), role: "status" },
510
- status !== null ? status.text : ""
511
+ {
512
+ className: "ap_status" + (status !== null && status.kind === "error" ? " ap_error" : ""),
513
+ role: "status",
514
+ // 初次读取配置期间给出加载提示:此前字段只以禁用态显示默认值,
515
+ // 无法区分加载中与加载失败。
516
+ style: status === null && draft === null ? { display: "inline-flex", alignItems: "center", gap: "5px" } : void 0
517
+ },
518
+ status !== null ? status.text : draft === null ? [React.createElement("span", { className: "ap_spin", key: "spin", "aria-hidden": true }), t("loading")] : ""
511
519
  ),
512
520
  React.createElement(
513
521
  "button",
package/client/index.tsx CHANGED
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import type { TypertRemoteContribution } from "@deepseek-ai/dsh-typert-protocol";
3
3
 
4
4
  // ── 样式(注入 style 标签,模仿官方卡片外观)──────────────────────────
5
- var css = ".ap_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;min-width:0;overflow:hidden}.ap_card[data-open=true]{border-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-shadow-lv1)}.ap_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:10px;align-items:center;gap:12px;padding:12px 14px;display:flex}.ap_header:hover,.ap_card[data-open=true]>.ap_header{background:var(--dsw-alias-interactive-bg-hover)}.ap_title{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:20px}.ap_badge{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px}.ap_body{border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);padding:10px 14px 12px}.ap_field{flex-direction:column;gap:4px;padding:8px 0;display:flex}.ap_label{font-size:12px;font-weight:500;line-height:18px}.ap_input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:32px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 10px;font-size:13px;line-height:20px}.ap_textarea{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:6px 10px;font-size:12px;line-height:18px;resize:vertical;min-height:120px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ap_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}.ap_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:8px 0 2px;display:flex}.ap_save{font:inherit;cursor:pointer;border:1px solid transparent;border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.ap_discard{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:0 0;color:inherit}.ap_status{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary);flex:1}.ap_section{border-top:1px dashed var(--dsw-alias-border-l2);margin-top:8px;padding-top:2px}.ap_sectionHead{appearance:none;width:100%;font:inherit;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;justify-content:space-between;gap:8px;padding:6px 2px;display:flex}.ap_sectionHead:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.ap_sectionTitle{font-size:12px;font-weight:600;line-height:18px}.ap_sectionChevron{flex:none;font-size:10px}.ap_sectionBody{flex-direction:column;display:flex}.ap_status.ap_error{color:var(--dsw-alias-state-error-primary)}.ap_badge_error{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px;max-width:260px;overflow:hidden;text-overflow:ellipsis}";
5
+ var css = ".ap_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;min-width:0;overflow:hidden}.ap_card[data-open=true]{border-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-shadow-lv1)}.ap_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:10px;align-items:center;gap:12px;padding:12px 14px;display:flex}.ap_header:hover,.ap_card[data-open=true]>.ap_header{background:var(--dsw-alias-interactive-bg-hover)}.ap_title{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:20px}.ap_badge{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-state-success-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px}.ap_body{border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);padding:10px 14px 12px}.ap_field{flex-direction:column;gap:4px;padding:8px 0;display:flex}.ap_label{font-size:12px;font-weight:500;line-height:18px}.ap_input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:32px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:0 10px;font-size:13px;line-height:20px}.ap_textarea{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);font:inherit;color:var(--dsw-alias-label-primary);border-radius:6px;padding:6px 10px;font-size:12px;line-height:18px;resize:vertical;min-height:120px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ap_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}.ap_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:8px 0 2px;display:flex}.ap_save{font:inherit;cursor:pointer;border:1px solid transparent;border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.ap_discard{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 14px;font-size:12px;line-height:18px;background:0 0;color:inherit}.ap_status{font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary);flex:1}.ap_section{border-top:1px dashed var(--dsw-alias-border-l2);margin-top:8px;padding-top:2px}.ap_sectionHead{appearance:none;width:100%;font:inherit;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;justify-content:space-between;gap:8px;padding:6px 2px;display:flex}.ap_sectionHead:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.ap_sectionTitle{font-size:12px;font-weight:600;line-height:18px}.ap_sectionChevron{flex:none;font-size:10px}.ap_sectionBody{flex-direction:column;display:flex}.ap_status.ap_error{color:var(--dsw-alias-state-error-primary)}.ap_badge_error{white-space:nowrap;background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);color:var(--dsw-alias-state-error-primary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:16px;max-width:260px;overflow:hidden;text-overflow:ellipsis}.ap_spin{flex:none;width:10px;height:10px;border:1.5px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-label-secondary);border-radius:50%;animation:ap-spin .8s linear infinite}@keyframes ap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.ap_spin{animation:none}}";
6
6
  var tagId = "@chaoset/adaptive-perf/client.css";
7
7
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId + "\"]") === null) {
8
8
  var tag = document.createElement("style");
@@ -24,6 +24,7 @@ import type { TypertRemoteContribution } from "@deepseek-ai/dsh-typert-protocol"
24
24
  saveFailed: "保存失败",
25
25
  saved: "已保存,热生效(新会话立即生效)",
26
26
  loadFailed: "读取配置失败",
27
+ loading: "加载中…",
27
28
  invalidFamilies: "families 必须是合法 JSON 对象",
28
29
  enabled: "启用插件",
29
30
  presets: "目标 preset",
@@ -76,6 +77,7 @@ import type { TypertRemoteContribution } from "@deepseek-ai/dsh-typert-protocol"
76
77
  saveFailed: "Save failed",
77
78
  saved: "Saved; hot-applied (new sessions take effect immediately)",
78
79
  loadFailed: "Failed to load config",
80
+ loading: "Loading…",
79
81
  invalidFamilies: "families must be valid JSON object",
80
82
  enabled: "Enable plugin",
81
83
  presets: "Target presets",
@@ -461,8 +463,17 @@ import type { TypertRemoteContribution } from "@deepseek-ai/dsh-typert-protocol"
461
463
  { className: "ap_footer" },
462
464
  React.createElement(
463
465
  "span",
464
- { className: "ap_status" + (status !== null && status.kind === "error" ? " ap_error" : ""), role: "status" },
465
- status !== null ? status.text : ""
466
+ {
467
+ className: "ap_status" + (status !== null && status.kind === "error" ? " ap_error" : ""),
468
+ role: "status",
469
+ // 初次读取配置期间给出加载提示:此前字段只以禁用态显示默认值,
470
+ // 无法区分加载中与加载失败。
471
+ style: status === null && draft === null ? { display: "inline-flex", alignItems: "center", gap: "5px" } : void 0
472
+ },
473
+ status !== null ? status.text
474
+ : draft === null
475
+ ? [React.createElement("span", { className: "ap_spin", key: "spin", "aria-hidden": true }), t("loading")]
476
+ : ""
466
477
  ),
467
478
  React.createElement(
468
479
  "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoset/adaptive-perf",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "DSH host plugin: bring standard / PTC presets to minimal-mode-level performance — real Minimal tool pair, permanent injected-context suppression with on-demand discovery, runtime-context suppression, and adaptive tool-catalog trimming with demand-driven escalation",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,12 +40,6 @@
40
40
  "@deepseek-ai/dsh-fs-local": "^0.1.1-rc.2",
41
41
  "@deepseek-ai/dsh-tool-str-replace-editor": "^0.1.1-rc.2"
42
42
  },
43
- "scripts": {
44
- "build": "bun ../../scripts/build.mjs",
45
- "typecheck": "tsc -p tsconfig.json --noEmit",
46
- "test": "bun ../../scripts/build.mjs && vitest run",
47
- "prepublishOnly": "bun run test"
48
- },
49
43
  "repository": {
50
44
  "type": "git",
51
45
  "url": "https://github.com/winliyou/dsh-plugins.git",
@@ -56,5 +50,10 @@
56
50
  },
57
51
  "engines": {
58
52
  "node": ">=22.19.0"
53
+ },
54
+ "scripts": {
55
+ "build": "node ../../scripts/build.mjs",
56
+ "typecheck": "tsc -p tsconfig.json --noEmit",
57
+ "test": "node ../../scripts/build.mjs && vitest run"
59
58
  }
60
- }
59
+ }