dsh-tool-adapt 0.2.9 → 0.2.12
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 +8 -0
- package/lib/client.js +47 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,6 +34,14 @@ 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 设置.
|
|
41
|
+
`@deepseek-ai/schemastery` is a private `dependencies` entry whose floor must be
|
|
42
|
+
≥ 3.18.4 (`^3.18.4`): the profile hoists an older line (3.18.2) that satisfies a
|
|
43
|
+
lower floor, and an entry whose Config exposes no volatile field is dropped from
|
|
44
|
+
`SettingsForms.describe()` — the card then renders nothing with no error.
|
|
37
45
|
A legacy `plugins/tool-adapt.config.json` is migrated once if the
|
|
38
46
|
settings user layer is empty; the old file is kept for rollback. The
|
|
39
47
|
`GET/POST /api/tool-adapt/status|set` routes remain as a compatibility
|
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
|
-
|
|
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)
|
|
@@ -924,10 +930,49 @@ window.__ModuleLoader__.load({
|
|
|
924
930
|
if (props && props.view === 'summary') {
|
|
925
931
|
return e('span', { style: SUMMARY_STYLE }, '非 DeepSeek 模型的工具适配开关(守卫 / L2 惯例 / L0 熔断 / 状态胶囊)。')
|
|
926
932
|
}
|
|
927
|
-
|
|
933
|
+
// view === 'page': this card IS the page, so it starts expanded.
|
|
934
|
+
return e(SettingsCard, { scope, api, defaultOpen: true })
|
|
928
935
|
}))
|
|
929
936
|
ctx.inject(['slots'], registerRowConfig)
|
|
930
937
|
|
|
938
|
+
// ── additive seat: the `settings.section` page ──────────────────────────
|
|
939
|
+
//
|
|
940
|
+
// 0.1.7-rc.2 also declares the root-scope LIST slot `settings.section`
|
|
941
|
+
// ("one settings page per list entry"), which puts this same card one click
|
|
942
|
+
// deep inside 设置 as a first-class page of its own. It is purely ADDITIVE:
|
|
943
|
+
// the row seat above stays the bundle row's configuration, and both render
|
|
944
|
+
// the SAME `SettingsCard` through the SAME single transport — no second
|
|
945
|
+
// settings UI and no second read/write path.
|
|
946
|
+
//
|
|
947
|
+
// The seat declares exactly three registrant options — `id` (required),
|
|
948
|
+
// `order`, `label` — so only those travel here. `label` is a THUNK, like
|
|
949
|
+
// every label the catalog projects: the shell re-reads it on each
|
|
950
|
+
// projection instead of caching registrant-localized text.
|
|
951
|
+
//
|
|
952
|
+
// Same non-gating shape as the row seat: `slots` is awaited with
|
|
953
|
+
// `ctx.inject(['slots'], cb)`, the callback RETURNS the registration
|
|
954
|
+
// disposer, and that disposer is pushed onto disposeSlots so the entry is
|
|
955
|
+
// owned by the registering fiber and released with the rest on stop /
|
|
956
|
+
// update / HMR. The seat is host-version dependent — a host that does not
|
|
957
|
+
// declare it simply never fires the inner `slots.inject`, so this
|
|
958
|
+
// registration can never gate the plugin.
|
|
959
|
+
const registerSettingsSection = (sctx) => {
|
|
960
|
+
disposeSlots.push(sctx.slots.inject('settings.section', () => sctx.slots.register({
|
|
961
|
+
name: 'settings.section',
|
|
962
|
+
id: 'yotk-tool-adapt',
|
|
963
|
+
order: 61,
|
|
964
|
+
label: () => 'YOTK · ADAPT',
|
|
965
|
+
}, function ToolAdaptSettingsSection() {
|
|
966
|
+
// The section owner shares `close` and nothing else; this card needs
|
|
967
|
+
// neither `close` nor the host-owned optional `form` prop, because
|
|
968
|
+
// values keep flowing through the one resolved transport — so the page
|
|
969
|
+
// branch is literally the row seat's `view === 'page'` render,
|
|
970
|
+
// including `defaultOpen: true`: one card alone on the page.
|
|
971
|
+
return e(SettingsCard, { scope, api, defaultOpen: true })
|
|
972
|
+
})))
|
|
973
|
+
}
|
|
974
|
+
ctx.inject(['slots'], registerSettingsSection)
|
|
975
|
+
|
|
931
976
|
// Pill: fully lifecycle-owned. The effect runs startPill() now and the
|
|
932
977
|
// returned disposer on stop / update / HMR, idempotently releasing the
|
|
933
978
|
// 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.
|
|
3
|
+
"version": "0.2.12",
|
|
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",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "node --test"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
22
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
23
23
|
},
|
|
24
24
|
"dsh": {
|
|
25
25
|
"bundle": {
|