dsh-mindmap 0.17.0 → 0.18.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/CHANGELOG.md +1 -0
- package/client.js +39 -38
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -42,6 +42,7 @@ All notable changes to this project are documented here. Release-specific notes
|
|
|
42
42
|
- Keep the readable zoom floor finite by deriving it from the same numeric font-size constant used by node boxes, rather than parsing a CSS style string at startup.
|
|
43
43
|
- Restored host-side settings on 0.1.7+ hosts: the service no longer has `register`, so the 0.15.0 startup path never read live values or ran its `.imported` migration. The flat `Config` export remains the loader-discovered schema; host approval now reads the `mindmap` descriptor from `describe()` at execution time, and legacy settings are restored via revision-checked `update()` only when the profile has no saved user overrides. Older hosts retain their `register` path. The tests now mock the actual service surface without `register` and exercise live approval changes and one-time migration.
|
|
44
44
|
- Extended the tooling peer range with `^0.2.0-alpha.0` for the 0.2.0 prerelease tuple. Hosts that enforce peer compatibility no longer skip the plugin solely because its previous range stopped at 0.1.7; the optional sidebar peer is unchanged.
|
|
45
|
+
- Extended the tooling peer range with `^0.2.1-alpha.0` for the 0.2.1 prerelease tuple: hosts on `0.2.1-rc.x` (npm latest) pass the enforced peer check again instead of skipping the plugin. The 0.2.1 API surface was verified face-by-face against the `0.2.1-rc.2` package and is identical to 0.2.0 — settings methods, `Agent { id }`, defineTool/execute, `ChatSnapshot.legacy.nodes`, `useChat`, the three slots and every client inject module survive unchanged; 0.2.1 itself only adds new-model and Search/Fetch API changes. The optional `dsh-better-sidebar` peer is unchanged.
|
|
45
46
|
- 0.1.7 settings volatile mechanism: all seven Config fields (`requireApproval`, `approvalMode`, `defaultPanelWidth`, `lineStyle`, `cardStyle`, `colorTheme`, `growthAnimation`) are now marked `.extra('volatile', true)` on their schemastery schema nodes. Without `meta.volatile`, the 0.1.7 host's settings storage (`dsh-settings` `volatileForm`/`isVolatilePath`/`write`) rejects all reads and writes for the `mindmap` namespace — the settings panel (设置 → 思维脑图) displays stale or default values and saving a new choice is silently dropped. The `volatile` meta is transparent to older hosts (0.1.5 and below ignore it), so the dual-path behavior is unchanged. A one-time legacy migration was also added: on startup, when the settings value is all-defaults, the plugin reads `~/.dsh/settings.yaml.imported` (the host-renamed old `settings.yaml`), extracts the `mindmap:` section's scalar fields with a line-by-line parser (no YAML dependency), validates each value against its allowed set, and writes the result to the new settings store via `scope.update()`. The `.imported` file is never deleted (it is host-managed); failures are silently skipped so the plugin still loads and the user can configure manually.
|
|
46
47
|
- dsh-tools peer dependency window extended to cover the `0.1.7-rc.2` release: `^0.1.7-alpha.0` is appended to the comparator list (`^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.3-alpha.0 || ^0.1.5-alpha.0 || ^0.1.7-alpha.0`). Under node-semver prerelease tuple rules, `0.1.7-rc.2` requires a `[0,1,7]` tuple with a prerelease tag in the range — without this comparator, `pnpm add dsh-mindmap` on a 0.1.7 host fails with ERESOLVE. The static API surface (Agent `{ id }`, `SessionHeader.cwd`, `settings.describe` envelope, `ChatSnapshot.legacy.nodes`, `ToolResultNode` fields, `conversation.session.header.actions` / `conversation.chat.turn` slots, `settings.section` slot, client inject ids, `@deepseek-ai/schemastery ^3.18.0`) was verified unchanged against the 0.1.7-rc.2 npm package. A `settings.plugin.item` string found in client.js comments was confirmed to be a documentation remark (the actual registration uses `settings.section`, which remains healthy in 0.1.7); no code migration is required.
|
|
47
48
|
- Creating a mindmap re-checks its target against the filesystem immediately before the write (036 follow-up, P1). The path was validated when the confirmation was drawn, but the plan was then trusted as-is: renaming the target directory and replacing it with a symlink pointing outside the session working directory while the user was reading the confirmation made `mindmap_create` write the file outside the workspace. Every candidate — inbox or explicit directory — is now re-resolved through the same inside-the-cwd check right before its atomic `wx` create; a path that no longer resolves inside the session cwd aborts the create (no outside file, no session grant), and the user is asked to start it again. The path confirmed and the path written stay the same one.
|
package/client.js
CHANGED
|
@@ -1602,17 +1602,17 @@ window.__ModuleLoader__.load({
|
|
|
1602
1602
|
panelHost: { position: "fixed", top: 0, right: 0, bottom: 0, left: 0, pointerEvents: "none", zIndex: 40 },
|
|
1603
1603
|
overlayRoot: { position: "absolute", top: 0, right: 0, bottom: 0, display: "flex", flexDirection: "column", background: "var(--dsw-alias-bg-base)", color: "var(--dsw-alias-label-primary)", fontSize: "13px", minWidth: 0, borderLeft: "1px solid var(--dsw-alias-border-l2)", boxShadow: "-8px 0 24px rgba(16,24,40,0.10)", pointerEvents: "auto" },
|
|
1604
1604
|
overlayHandle: { position: "absolute", left: -4, top: 0, bottom: 0, width: 8, cursor: "col-resize", zIndex: 1 },
|
|
1605
|
-
header: { display: "flex", flexDirection: "column", gap: "6px", padding: "
|
|
1606
|
-
headerTop: { display: "flex", alignItems: "center", gap: "10px", flex: "none" },
|
|
1607
|
-
tabRow: { display: "flex", alignItems: "
|
|
1608
|
-
tab: { border: "none", background: "none", cursor: "pointer", padding: "
|
|
1605
|
+
header: { display: "flex", flexDirection: "column", flex: "none", minWidth: 0, gap: "6px", padding: "10px 0 0", boxSizing: "border-box", borderBottom: "0.5px solid var(--dsw-alias-border-l3)" },
|
|
1606
|
+
headerTop: { display: "flex", alignItems: "center", gap: "10px", flex: "none", minWidth: 0, padding: "0 7px", overflowX: "auto" },
|
|
1607
|
+
tabRow: { display: "flex", alignItems: "stretch", gap: "2px", height: "38px", paddingTop: "3px", boxSizing: "border-box", marginTop: "auto", overflowX: "auto", overflowY: "hidden", minWidth: 0, flex: "none" },
|
|
1608
|
+
tab: { display: "inline-flex", alignItems: "center", flex: "none", boxSizing: "border-box", border: "none", borderTop: "2px solid transparent", borderRight: "1px solid var(--dsw-alias-border-l2)", background: "none", cursor: "pointer", padding: "0 12px", lineHeight: "18px", borderRadius: 0, font: "inherit", color: "var(--dsw-alias-label-secondary)", whiteSpace: "nowrap", maxWidth: "160px", overflow: "hidden", textOverflow: "ellipsis", transition: "background 0.08s ease, color 0.08s ease" },
|
|
1609
1609
|
tabHover: { background: "var(--dsw-alias-interactive-bg-hover)" },
|
|
1610
|
-
//
|
|
1611
|
-
tabActive: { background: "var(--dsw-alias-bg-
|
|
1610
|
+
// 与终端标签一致:顶部蓝线、直角页签,上方留缝,底部分隔线独立。
|
|
1611
|
+
tabActive: { background: "var(--dsw-alias-bg-base)", color: "var(--dsw-alias-label-primary)", borderTopColor: "var(--dsw-alias-state-business-primary)" },
|
|
1612
1612
|
// 文档 tab = 包裹(承载视觉)+ 标题按钮 + 关闭 ✕(013:可关闭标签页)。
|
|
1613
|
-
tabWrap: { display: "inline-flex", alignItems: "flex-
|
|
1614
|
-
tabTitle: { background: "none", border: "none", cursor: "pointer", font: "inherit", color: "inherit", padding: "
|
|
1615
|
-
tabClose: { background: "none", border: "none", cursor: "pointer", padding: "
|
|
1613
|
+
tabWrap: { display: "inline-flex", alignItems: "center", flex: "none", boxSizing: "border-box", borderTop: "2px solid transparent", borderRight: "1px solid var(--dsw-alias-border-l2)", borderRadius: 0, overflow: "hidden", maxWidth: "210px", transition: "background 0.08s ease" },
|
|
1614
|
+
tabTitle: { background: "none", border: "none", cursor: "pointer", font: "inherit", color: "inherit", padding: "0 4px 0 10px", height: "100%", lineHeight: "18px", whiteSpace: "nowrap", minWidth: 0, maxWidth: "170px", overflow: "hidden", textOverflow: "ellipsis" },
|
|
1615
|
+
tabClose: { background: "none", border: "none", cursor: "pointer", padding: "0 6px", height: "100%", lineHeight: "18px", color: "var(--dsw-alias-label-tertiary)", fontSize: "11px", flex: "none" },
|
|
1616
1616
|
spacer: { flex: "1 1 auto" },
|
|
1617
1617
|
action: { border: "1px solid var(--dsw-alias-border-l2)", background: "var(--dsw-alias-bg-layer-3)", color: "var(--dsw-alias-label-primary)", borderRadius: "8px", height: "20px", padding: "0 12px", cursor: "pointer", font: "inherit", fontSize: "12px", whiteSpace: "nowrap" },
|
|
1618
1618
|
body: { flex: "1 1 auto", minHeight: 0, overflow: "auto", padding: "16px" },
|
|
@@ -1737,15 +1737,11 @@ window.__ModuleLoader__.load({
|
|
|
1737
1737
|
searchCount: { flex: "none", minWidth: "38px", textAlign: "center", fontSize: "11px", lineHeight: "20px", color: "var(--dsw-alias-label-secondary)", fontVariantNumeric: "tabular-nums", userSelect: "none", whiteSpace: "nowrap" },
|
|
1738
1738
|
// 027 内嵌头部(sidebar 模式):BS 外层已有 Tab 头部,内嵌只保留一行
|
|
1739
1739
|
// 紧凑工具栏——脑图列表标签 + 当前脑图标签 + 导出按钮(行尾)。
|
|
1740
|
-
//
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
// 当前脑图标签包裹:与 standalone 的 tabWrap 同构,但圆角与内距更紧凑。
|
|
1746
|
-
sbTabWrap: { display: "inline-flex", alignItems: "center", borderRadius: "6px", overflow: "hidden", maxWidth: "160px", transition: "background 0.08s ease" },
|
|
1747
|
-
sbTabTitle: { background: "none", border: "none", cursor: "pointer", font: "inherit", color: "inherit", padding: "2px 4px 2px 8px", lineHeight: "20px", whiteSpace: "nowrap", maxWidth: "110px", overflow: "hidden", textOverflow: "ellipsis" },
|
|
1748
|
-
sbTabClose: { background: "none", border: "none", cursor: "pointer", padding: "2px 6px 2px 2px", lineHeight: "20px", color: "var(--dsw-alias-label-tertiary)", fontSize: "11px", flex: "none" },
|
|
1740
|
+
// 原生侧栏标签条 38px + 此工具栏 38px = 官方会话头部最低 76px。
|
|
1741
|
+
// 固定 border-box 高度;操作区独立横滚,避免窄栏/授权文案撑高分隔线。
|
|
1742
|
+
sbToolbar: { display: "flex", alignItems: "stretch", gap: 0, height: "38px", padding: 0, boxSizing: "border-box", background: "color-mix(in srgb,var(--dsw-alias-bg-base) 88%,var(--dsw-alias-bg-layer-2))", borderBottom: "0.5px solid var(--dsw-alias-border-l3)", flex: "none", minWidth: 0 },
|
|
1743
|
+
sbTabs: { display: "flex", alignItems: "stretch", flex: "1 1 auto", minWidth: 0, gap: "2px", paddingTop: "3px", boxSizing: "border-box", overflowX: "auto", overflowY: "hidden", scrollbarWidth: "none" },
|
|
1744
|
+
sbActions: { display: "flex", alignItems: "center", flex: "0 1 auto", minWidth: 0, maxWidth: "65%", gap: "6px", padding: "3px 7px", boxSizing: "border-box", overflowX: "auto", overflowY: "hidden", scrollbarWidth: "none", whiteSpace: "nowrap" },
|
|
1749
1745
|
};
|
|
1750
1746
|
|
|
1751
1747
|
// 内嵌界面与 Better Sidebar 共用宿主字体角色;变量缺失时仍有完整回退。
|
|
@@ -1760,8 +1756,11 @@ window.__ModuleLoader__.load({
|
|
|
1760
1756
|
...S,
|
|
1761
1757
|
sbRoot: { display: "flex", flexDirection: "column", flex: "1 1 auto", minHeight: 0, minWidth: 0, font: SIDEBAR_BODY_FONT },
|
|
1762
1758
|
sbToolbar: sidebarFontStyle(S.sbToolbar),
|
|
1763
|
-
sbTab: sidebarFontStyle(S.
|
|
1764
|
-
|
|
1759
|
+
sbTab: sidebarFontStyle(S.tab),
|
|
1760
|
+
sbTabActive: S.tabActive,
|
|
1761
|
+
sbTabWrap: S.tabWrap,
|
|
1762
|
+
sbTabTitle: sidebarFontStyle(S.tabTitle),
|
|
1763
|
+
sbTabClose: sidebarFontStyle(S.tabClose),
|
|
1765
1764
|
action: sidebarFontStyle(S.action),
|
|
1766
1765
|
emptyHint: sidebarFontStyle(S.emptyHint),
|
|
1767
1766
|
treeRefresh: sidebarFontStyle(S.treeRefresh),
|
|
@@ -4268,8 +4267,8 @@ window.__ModuleLoader__.load({
|
|
|
4268
4267
|
// 在 visible=false 时仍能调 onAutoOpen 把壳拉起。
|
|
4269
4268
|
if (!visible) return null;
|
|
4270
4269
|
// headerHeight 由独立 fixed 壳传入(对齐聊天头部底部分隔线);
|
|
4271
|
-
// BS Tab
|
|
4272
|
-
const wsHeaderStyle = headerHeight != null ? { ...S.header, height: `${headerHeight
|
|
4270
|
+
// BS Tab 模式使用自己的 38px 标签栏;独立壳传入的高度已包含底边框。
|
|
4271
|
+
const wsHeaderStyle = headerHeight != null ? { ...S.header, height: `${headerHeight}px` } : S.header;
|
|
4273
4272
|
|
|
4274
4273
|
// 027 导出按钮(两种模式共用):disabled 语义 = 无树 / 导出中 / 本地占位。
|
|
4275
4274
|
const exportBtn = (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -4324,7 +4323,8 @@ window.__ModuleLoader__.load({
|
|
|
4324
4323
|
// 027 sidebar 模式:单行紧凑工具栏。BS 外层已有 Tab 头部与关闭按钮,
|
|
4325
4324
|
// 内嵌不再加重复外壳标题或关闭按钮。
|
|
4326
4325
|
return (0, react_jsx_runtime.jsxs)("div", { style: S.sbRoot, children: [
|
|
4327
|
-
(0, react_jsx_runtime.jsxs)("div", { style: S.sbToolbar, children: [
|
|
4326
|
+
(0, react_jsx_runtime.jsxs)("div", { style: S.sbToolbar, "data-mindmap-toolbar": "", children: [
|
|
4327
|
+
(0, react_jsx_runtime.jsxs)("div", { style: S.sbTabs, "data-mindmap-tabs": "", children: [
|
|
4328
4328
|
(0, react_jsx_runtime.jsx)("button", {
|
|
4329
4329
|
type: "button",
|
|
4330
4330
|
style: active === TREE_TAB ? { ...S.sbTab, ...S.sbTabActive } : (hoverKey === TREE_TAB ? { ...S.sbTab, ...S.tabHover } : S.sbTab),
|
|
@@ -4366,13 +4366,15 @@ window.__ModuleLoader__.load({
|
|
|
4366
4366
|
}),
|
|
4367
4367
|
],
|
|
4368
4368
|
}, shown) : null,
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4369
|
+
] }),
|
|
4370
|
+
// 操作与页签各自横滚;保留所有功能,不让内容撑高工具栏。
|
|
4371
|
+
(0, react_jsx_runtime.jsxs)("div", { style: S.sbActions, "data-mindmap-actions": "", children: [
|
|
4372
|
+
approvalControls,
|
|
4373
|
+
exportErrorSpan,
|
|
4374
|
+
refreshBtn,
|
|
4375
|
+
copyBtn,
|
|
4376
|
+
exportBtn,
|
|
4377
|
+
] }),
|
|
4376
4378
|
] }),
|
|
4377
4379
|
// 016:脑图视图走 MindmapCanvas(自带滚动 + 居中 + 右上角缩放控制条),
|
|
4378
4380
|
// 不再套 S.body(避免嵌套滚动容器与双重 padding);目录/加载/空态保持原样。
|
|
@@ -4579,17 +4581,16 @@ window.__ModuleLoader__.load({
|
|
|
4579
4581
|
window.addEventListener("mouseup", onUp);
|
|
4580
4582
|
}
|
|
4581
4583
|
|
|
4582
|
-
//
|
|
4583
|
-
//
|
|
4584
|
-
// 头部高度 = 聊天头部 rect.bottom - 1 - 面板顶(面板顶 ≈ 视口顶)。
|
|
4585
|
-
// 主选 wSkVaW_header;结构链回退;合法性钳制 [40,200];失败回退 74(75-1)。
|
|
4584
|
+
// 独立壳按实际底边对齐:border-box 高度 = 官方头部 bottom - 面板 top。
|
|
4585
|
+
// 不再额外减边框;优先使用稳定的页签标记,旧宿主选择器作回退。
|
|
4586
4586
|
const panelRootRef = react.useRef(null);
|
|
4587
|
-
const FALLBACK_HEADER_HEIGHT =
|
|
4587
|
+
const FALLBACK_HEADER_HEIGHT = 76;
|
|
4588
4588
|
const [headerHeight, setHeaderHeight] = react.useState(FALLBACK_HEADER_HEIGHT);
|
|
4589
4589
|
react.useLayoutEffect(() => {
|
|
4590
4590
|
const HEADER_MIN = 40;
|
|
4591
4591
|
const HEADER_MAX = 200;
|
|
4592
4592
|
const tryPaths = [
|
|
4593
|
+
() => document.querySelector('[data-conversation-tabs]')?.closest('header'),
|
|
4593
4594
|
() => document.querySelector('[class*="wSkVaW_header"]'),
|
|
4594
4595
|
() => {
|
|
4595
4596
|
const frame = document.querySelector("[data-dsh-frame]");
|
|
@@ -4606,7 +4607,7 @@ window.__ModuleLoader__.load({
|
|
|
4606
4607
|
const panelTop = panelRootRef.current
|
|
4607
4608
|
? panelRootRef.current.getBoundingClientRect().top
|
|
4608
4609
|
: rect.top;
|
|
4609
|
-
const h = rect.bottom -
|
|
4610
|
+
const h = rect.bottom - panelTop;
|
|
4610
4611
|
if (h >= HEADER_MIN && h <= HEADER_MAX) {
|
|
4611
4612
|
setHeaderHeight(Math.round(h * 10) / 10);
|
|
4612
4613
|
return;
|
|
@@ -4615,7 +4616,7 @@ window.__ModuleLoader__.load({
|
|
|
4615
4616
|
setHeaderHeight(FALLBACK_HEADER_HEIGHT);
|
|
4616
4617
|
};
|
|
4617
4618
|
measure();
|
|
4618
|
-
const target = tryPaths
|
|
4619
|
+
const target = tryPaths.map((path) => path()).find(Boolean);
|
|
4619
4620
|
let observer = null;
|
|
4620
4621
|
if (target && typeof ResizeObserver !== "undefined") {
|
|
4621
4622
|
observer = new ResizeObserver(measure);
|
|
@@ -4626,7 +4627,7 @@ window.__ModuleLoader__.load({
|
|
|
4626
4627
|
if (observer) observer.disconnect();
|
|
4627
4628
|
window.removeEventListener("resize", measure);
|
|
4628
4629
|
};
|
|
4629
|
-
}, []);
|
|
4630
|
+
}, [open]);
|
|
4630
4631
|
|
|
4631
4632
|
// 014 布局让位:面板打开/拖宽时把宽度写进 CSS 变量,挤窄 #root 推走
|
|
4632
4633
|
// 聊天区(better-sidebar 同款);关闭/卸载时移除变量恢复全宽。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mindmap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Mindmap plugin for DeepSeek Harness: a plain markdown file in the working directory IS the mindmap; the chat edits it step by step and the right-side panel follows live.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@deepseek-ai/schemastery": "^3.18.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.3-alpha.0 || ^0.1.5-alpha.0 || ^0.1.7-alpha.0 || ^0.2.0-alpha.0",
|
|
40
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.3-alpha.0 || ^0.1.5-alpha.0 || ^0.1.7-alpha.0 || ^0.2.0-alpha.0 || ^0.2.1-alpha.0",
|
|
41
41
|
"dsh-better-sidebar": ">=0.10.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|