dsh-advisor 0.2.1 → 0.2.2

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
@@ -43,7 +43,7 @@ The advisor is off by default. When enabled, `provider` and `model` are **mandat
43
43
  The same keys compose across **three surfaces** (later layers override earlier ones; every surface shares the same key set and the same hard gate, with the host-side gate as the final line of defense on every path):
44
44
 
45
45
  1. **Plugin-row config** — the profile patch layer (`$DSH_HOME/profiles/<profile>/cordis.patch.yml`). This is the composition base.
46
- 2. **dsh web Settings page — the "插件配置" (Plugin Configuration) page** — the Advisor **card** (id `advisor`) with the enabled toggle, provider / model selects restricted to system-configured providers and their models, and the optional fields. Saving writes into the `advisor` settings namespace and applies to new sessions immediately — no restart. The card requires a current dsh web build whose shell declares the `settings.plugin.item` card slot and loads packages that declare `dsh.client`; it reads and writes the namespace through the official `GatewayService` RPC channel (`/api/advisor/get` + `/api/advisor/set`), which is not gated by the settings exposure allowlist. It additionally blocks saving while enabled with a required field empty.
46
+ 2. **dsh web Settings page — the "插件配置" (Plugin Configuration) page** — the Advisor **card** (namespace key `advisor`) with the enabled toggle, provider / model selects restricted to system-configured providers and their models, and the optional fields. Saving writes into the `advisor` settings namespace and applies to new sessions immediately — no restart. The card requires a current dsh web build whose shell declares the `settings.plugin.item` card slot and loads packages that declare `dsh.client`; it reads and writes the namespace through the official `GatewayService` RPC channel (`/api/advisor/get` + `/api/advisor/set`), which is not gated by the settings exposure allowlist. It additionally blocks saving while enabled with a required field empty.
47
47
  3. **`/advisor` command** — per-session and ephemeral: it flips a session override, never the persisted config (see [Verify](#verify)).
48
48
 
49
49
  In a **dsh-tui** profile the same five keys are editable in the TUI `/settings` screen: run `dsh --profile dsh-tui`, open `/settings`, and edit the **Advisor** section (`enabled` / `provider` / `model` / `immuneTurns` / `maxDeltaMessages`, each with zh/en label + hint). Edits are staged and written on save through the revision-fenced `settings.mutate` into the same `advisor` namespace user layer the web card writes, and re-apply live without a restart. `systemPrompt` is NOT a TUI field (the TUI text control is single-line; a multi-line prompt would be truncated) — edit it via the web card or `$DSH_HOME/settings.yaml`. The section requires dsh-tui ≥ v0.8.0 (shipped in the `dsh-tui-settings-sections` row of the v0.8.0+ bundle); older dsh-tui versions no-op it cleanly and the two file paths — profile patch layer + global `$DSH_HOME/settings.yaml` — remain the edit paths. `/advisor config` stays a read-only readback whose edit hint names the `/settings` screen when the seam is mounted. Save behavior differs from the web card: the TUI seam has no cross-field validation, so a save may set `enabled: true` with empty `provider`/`model` — the explicit model gate resolves that to disabled-with-reason at runtime (visible via `/advisor status` and `/advisor config`); the web card blocks such a save outright. Full reference → [docs/configuration.md](docs/configuration.md).
package/README.zh.md CHANGED
@@ -43,7 +43,7 @@ advisor 默认关闭。启用后,`provider` 与 `model` 为**必填**:`enabl
43
43
  同一组键在**三个配置面**之间合成(后一层覆盖前一层;各处使用同一组键与同一个硬门禁,宿主侧门禁始终是所有路径上的最后防线):
44
44
 
45
45
  1. **插件行 config** —— profile 补丁层(`$DSH_HOME/profiles/<profile>/cordis.patch.yml`)。这是合成 base。
46
- 2. **dsh web Settings 页 —— "插件配置"页** —— Advisor **卡片**(id `advisor`),含 enabled 开关、只列出系统内已配置 provider 及其模型的 provider/model 选择框与可选字段。保存写入 `advisor` settings namespace,新会话立即生效,无需重启。卡片要求当前版本的 dsh web 构建(其 web shell 声明了 `settings.plugin.item` 卡片 slot 并能加载 `dsh.client` 声明包);它通过官方 `GatewayService` RPC 通道读写该命名空间(`/api/advisor/get` + `/api/advisor/set`),不受 settings 暴露白名单门控。卡片还会在 enabled 且必填字段为空时阻止保存。
46
+ 2. **dsh web Settings 页 —— "插件配置"页** —— Advisor **卡片**(namespace key `advisor`),含 enabled 开关、只列出系统内已配置 provider 及其模型的 provider/model 选择框与可选字段。保存写入 `advisor` settings namespace,新会话立即生效,无需重启。卡片要求当前版本的 dsh web 构建(其 web shell 声明了 `settings.plugin.item` 卡片 slot 并能加载 `dsh.client` 声明包);它通过官方 `GatewayService` RPC 通道读写该命名空间(`/api/advisor/get` + `/api/advisor/set`),不受 settings 暴露白名单门控。卡片还会在 enabled 且必填字段为空时阻止保存。
47
47
  3. **`/advisor` 指令** —— 按会话且临时:翻转的是会话级 override,从不修改持久化配置(见[验证](#验证))。
48
48
 
49
49
  在 **dsh-tui** profile 中,同样的五个键可在 TUI `/settings` 屏幕编辑:运行 `dsh --profile dsh-tui`、打开 `/settings`,编辑 **Advisor** 分节(`enabled` / `provider` / `model` / `immuneTurns` / `maxDeltaMessages`,每项均带中英文标签与提示)。编辑先暂存,保存时经 revision 栅栏保护的 `settings.mutate` 写入 web 卡片所写的同一个 `advisor` 命名空间 user layer,并 live 重应用、无需重启。`systemPrompt` **不是** TUI 字段(TUI text 控件为单行;多行 prompt 会被截断)——请经 web 卡片或 `$DSH_HOME/settings.yaml` 编辑。该分节要求 dsh-tui ≥ v0.8.0(随 v0.8.0+ 组合包的 `dsh-tui-settings-sections` 行提供);旧版 dsh-tui 会干净地 no-op,仍以两个文件路径——profile 补丁层 + 全局 `$DSH_HOME/settings.yaml`——作为编辑路径。`/advisor config` 仍是只读回读,seam 挂载时其编辑提示指向 `/settings` 屏幕。保存行为与 web 卡片不同:TUI seam 没有跨字段校验,一次保存可能把 `enabled: true` 与空 `provider`/`model` 一起写入——显式模型门禁会在运行时把它解析为 disabled-with-reason(可见于 `/advisor status` 与 `/advisor config`);web 卡片则会直接阻止这样的保存。完整参考 → [docs/configuration.md](docs/configuration.md)。
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Advisor settings card (plan dsh-advisor-plugin-config-card-ux, task 1): the
3
3
  * card registered into the "插件配置" settings page's `settings.plugin.item`
4
- * slot (id `advisor`, order 30). It keeps the n5 gateway channel — the store
4
+ * keyed slot (key `advisor` the settings namespace the card edits). It keeps
5
+ * the n5 gateway channel — the store
5
6
  * reads/writes the advisor config through `/api/advisor/get` +
6
7
  * `/api/advisor/set` (KD-G3) — while the card chrome is rebuilt to replicate
7
8
  * the upstream `PluginCard` contract (self-drawn: the upstream client value
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Advisor settings plugin, browser half. Registers the `advisor` card into
3
- * the shell-declared `settings.plugin.item` slot (the "插件配置" settings
4
- * page — id `advisor`, order 30, after the upstream bash / agent-loop /
5
- * web-search cards). The card's store joins the settings namespaces and the
3
+ * the shell-declared `settings.plugin.item` keyed slot (the "插件配置"
4
+ * settings page — key `advisor`, the settings namespace the card edits,
5
+ * appearing after the upstream bash / agent-loop / web-search cards in
6
+ * registration order). The card's store joins the settings namespaces and the
6
7
  * provider directory through the connection wire, and keeps fresh on pushed
7
8
  * invalidations. Export discipline: the client half value-imports ONLY the
8
9
  * frozen platform module table (CLIENT_EXTERNALS: react /
package/lib/client.js CHANGED
@@ -834,9 +834,13 @@ function apply(ctx) {
834
834
  ctx.slots.inject("settings.plugin.item", function* () {
835
835
  yield ctx.slots.register({
836
836
  name: "settings.plugin.item",
837
- id: "advisor",
838
- order: 30,
839
- // bash 0 / agent-loop 10 / web-search 20 / advisor 30
837
+ // rc.7 keyed slot: the key is the settings namespace the card edits —
838
+ // the already-installed `advisor` namespace (ADVISOR_SETTINGS_NAMESPACE
839
+ // in src/settings.ts; spelled as a literal here because the host-half
840
+ // settings module is outside the client bundle's externals). Keyed
841
+ // entries declare no `id`/`order` — appearance order is registration
842
+ // order, which still places this card after the upstream three.
843
+ key: "advisor",
840
844
  locale: NS,
841
845
  inject: () => ({ controller, useSnapshot })
842
846
  }, AdvisorCard);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-advisor",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "dsh plugin bundle porting the omp advisor subsystem: a per-session reviewer model that observes the primary transcript and injects severity-ranked advice (nit/concern/blocker).",
6
6
  "repository": {
@@ -51,24 +51,24 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@deepseek-ai/cordis": "^4.0.1",
54
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
55
- "@deepseek-ai/dsh-api-gateway": "^0.1.0-rc.6",
56
- "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6",
57
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
58
- "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
59
- "@deepseek-ai/dsh-client-schema-form": "^0.1.0-rc.6",
60
- "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.6",
61
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
62
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
63
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
64
- "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.6",
65
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
66
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
67
- "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
68
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
69
- "@deepseek-ai/dsh-timeout": "^0.1.0-rc.6",
70
- "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.6",
71
- "@deepseek-ai/dsh-typert-registry": "^0.1.0-rc.6",
54
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.7",
55
+ "@deepseek-ai/dsh-api-gateway": "^0.1.0-rc.7",
56
+ "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.7",
57
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
58
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
59
+ "@deepseek-ai/dsh-client-schema-form": "^0.1.0-rc.7",
60
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
61
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
62
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
63
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
64
+ "@deepseek-ai/dsh-client-web-react": "^0.1.0-rc.7",
65
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
66
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.7",
67
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.7",
68
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
69
+ "@deepseek-ai/dsh-timeout": "^0.1.0-rc.7",
70
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.7",
71
+ "@deepseek-ai/dsh-typert-registry": "^0.1.0-rc.7",
72
72
  "react": "^18.2.0",
73
73
  "@deepseek-ai/schemastery": "^3.18.1"
74
74
  },