dsh-tool-adapt 0.2.10 → 0.2.13

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.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/lib/client.js +64 -13
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## English
4
4
 
5
- **Current release: 0.2.9** — Portable settings transport: the plugin now resolves its settings scope on both the `settingsScope` (≤ 0.1.5) and `configForms` (≥ 0.1.7-rc.1) hosts, so the Settings card and pill switch keep working across the rename.
5
+ **Portable settings transport** — the plugin now resolves its settings scope on both the `settingsScope` (≤ 0.1.5) and `configForms` (≥ 0.1.7-rc.1) hosts, so the Settings card and pill switch keep working across the rename.
6
6
 
7
7
  A compatibility and safety adaptation layer for non-DeepSeek model families in DeepSeek Harness Web. It guards dead escalation states, injects model-family conventions, fuses repeated failures, and provides a lifecycle-safe Settings card and optional composer pill. Its DSH 0.1.2+ `remote.settings` path falls back to the legacy connection API on older RC hosts.
8
8
 
@@ -34,6 +34,10 @@ That card registers on both settings seats DSH has used: the legacy
34
34
  `<package name>#<row id>`) on ≥ 0.1.7-rc.2, where the **插件** panel (the first
35
35
  sidebar panel icon) shows a
36
36
  configure control for the row only while that exact key is registered.
37
+ The same card is also registered, additively and never as a gate, on the
38
+ root-scope `settings.section` list seat — identity `YOTK · ADAPT`, id
39
+ `yotk-tool-adapt`, order `61` — so on a host that declares that seat it is a
40
+ first-class page one click deep in 设置.
37
41
  `@deepseek-ai/schemastery` is a private `dependencies` entry whose floor must be
38
42
  ≥ 3.18.4 (`^3.18.4`): the profile hoists an older line (3.18.2) that satisfies a
39
43
  lower floor, and an entry whose Config exposes no volatile field is dropped from
package/lib/client.js CHANGED
@@ -280,7 +280,13 @@ window.__ModuleLoader__.load({
280
280
  const scope = props.scope
281
281
  const api = props.api
282
282
  const [tick, setTick] = React.useState(0)
283
- const [open, setOpen] = React.useState(false)
283
+ // The collapsible body starts EXPANDED wherever this card renders ALONE —
284
+ // the row seat's `view === 'page'` branch and the `settings.section` page,
285
+ // which both pass `defaultOpen: true`. Collapsed stays the default for the
286
+ // legacy ≤ 0.1.5 `settings.plugin.item` seat, because there the card still
287
+ // sits inside the Plugins list of many cards, which is the reason the
288
+ // disclosure existed. The header button below folds it back either way.
289
+ const [open, setOpen] = React.useState(props.defaultOpen === true)
284
290
  const [staged, setStaged] = React.useState({})
285
291
  const [saving, setSaving] = React.useState(false)
286
292
  const [failed, setFailed] = React.useState(false)
@@ -914,20 +920,65 @@ window.__ModuleLoader__.load({
914
920
  // resolveSettingsScopeFrom (settingsScope ≤ 0.1.5 / configForms ≥ 0.1.7), so
915
921
  // this plugin keeps exactly one read path and one write path.
916
922
  //
917
- // `slots` is awaited NON-GATINGLY, and the callback returns the registration
918
- // disposer so the entry is owned by the registering fiber and released with
919
- // the rest of disposeSlots on stop / update / HMR.
920
- const registerRowConfig = (sctx) => sctx.slots.inject('plugins.row.config', () => sctx.slots.register({
921
- name: 'plugins.row.config',
922
- key: ROW_CONFIG_KEY,
923
- }, function ToolAdaptRowConfig(props) {
924
- if (props && props.view === 'summary') {
925
- return e('span', { style: SUMMARY_STYLE }, '非 DeepSeek 模型的工具适配开关(守卫 / L2 惯例 / L0 熔断 / 状态胶囊)。')
926
- }
927
- return e(SettingsCard, { scope, api })
928
- }))
923
+ // `slots` is awaited NON-GATINGLY, and the registration disposer joins the
924
+ // package's OWN disposal list — exactly like the legacy card seat above and
925
+ // the `settings.section` page below — so every slot registration this bundle
926
+ // owns is released through the one combined disposer apply returns. Handing
927
+ // the disposer back to `ctx.inject` instead would leave this one seat on a
928
+ // different disposal path than its siblings, so an unload / update / HMR
929
+ // could leak the entry while the other seats were released.
930
+ const registerRowConfig = (sctx) => {
931
+ disposeSlots.push(sctx.slots.inject('plugins.row.config', () => sctx.slots.register({
932
+ name: 'plugins.row.config',
933
+ key: ROW_CONFIG_KEY,
934
+ }, function ToolAdaptRowConfig(props) {
935
+ if (props && props.view === 'summary') {
936
+ return e('span', { style: SUMMARY_STYLE }, '非 DeepSeek 模型的工具适配开关(守卫 / L2 惯例 / L0 熔断 / 状态胶囊)。')
937
+ }
938
+ // view === 'page': this card IS the page, so it starts expanded.
939
+ return e(SettingsCard, { scope, api, defaultOpen: true })
940
+ })))
941
+ }
929
942
  ctx.inject(['slots'], registerRowConfig)
930
943
 
944
+ // ── additive seat: the `settings.section` page ──────────────────────────
945
+ //
946
+ // 0.1.7-rc.2 also declares the root-scope LIST slot `settings.section`
947
+ // ("one settings page per list entry"), which puts this same card one click
948
+ // deep inside 设置 as a first-class page of its own. It is purely ADDITIVE:
949
+ // the row seat above stays the bundle row's configuration, and both render
950
+ // the SAME `SettingsCard` through the SAME single transport — no second
951
+ // settings UI and no second read/write path.
952
+ //
953
+ // The seat declares exactly three registrant options — `id` (required),
954
+ // `order`, `label` — so only those travel here. `label` is a THUNK, like
955
+ // every label the catalog projects: the shell re-reads it on each
956
+ // projection instead of caching registrant-localized text.
957
+ //
958
+ // Same non-gating shape as the row seat: `slots` is awaited with
959
+ // `ctx.inject(['slots'], cb)`, the callback RETURNS the registration
960
+ // disposer, and that disposer is pushed onto disposeSlots so the entry is
961
+ // owned by the registering fiber and released with the rest on stop /
962
+ // update / HMR. The seat is host-version dependent — a host that does not
963
+ // declare it simply never fires the inner `slots.inject`, so this
964
+ // registration can never gate the plugin.
965
+ const registerSettingsSection = (sctx) => {
966
+ disposeSlots.push(sctx.slots.inject('settings.section', () => sctx.slots.register({
967
+ name: 'settings.section',
968
+ id: 'yotk-tool-adapt',
969
+ order: 61,
970
+ label: () => 'YOTK · ADAPT',
971
+ }, function ToolAdaptSettingsSection() {
972
+ // The section owner shares `close` and nothing else; this card needs
973
+ // neither `close` nor the host-owned optional `form` prop, because
974
+ // values keep flowing through the one resolved transport — so the page
975
+ // branch is literally the row seat's `view === 'page'` render,
976
+ // including `defaultOpen: true`: one card alone on the page.
977
+ return e(SettingsCard, { scope, api, defaultOpen: true })
978
+ })))
979
+ }
980
+ ctx.inject(['slots'], registerSettingsSection)
981
+
931
982
  // Pill: fully lifecycle-owned. The effect runs startPill() now and the
932
983
  // returned disposer on stop / update / HMR, idempotently releasing the
933
984
  // mounted flag, root, shadow DOM, observers, both intervals, the rAF,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tool-adapt",
3
- "version": "0.2.10",
3
+ "version": "0.2.13",
4
4
  "description": "EN: Compatibility and safety adaptation layer for non-DeepSeek models in DeepSeek Harness Web. ZH: 面向 DeepSeek Harness Web 非 DeepSeek 模型的兼容与安全适配层。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",